1
?RCS: $Id: xmlconfig.U,v 1.2 2003/11/01 15:13:33 rmanfredi Exp $
5
?MAKE:xmlconfig xmlcflags xmlldflags d_libxml2: awk sed
8
?S: This variable holds the command to use to grab information about libxml2.
9
?S: Typically something like "pkg-config libxml-2.0" or "xml2-config".
12
?S: This variable holds the compiler flags required to compile with libxml2.
15
?S: This variable holds the linker flags required to link against libxml2.
18
?S: Controls whether HAS_LIBXML2 is defined.
21
?C: This symbol is defined when libxml 2.4.19, at least, is present.
23
?H:#$d_libxml2 HAS_LIBXML2 /**/
25
?T:modver version vint
26
: how can we find information about libxml2?
28
echo "Checking how we can gather information about libxml2..." >&4
29
if pkg-config libxml-2.0 --cflags >/dev/null 2>&1; then
30
xmlconfig="pkg-config libxml-2.0"
32
elif xml2-config --cflags >/dev/null 2>&1; then
33
xmlconfig='xml2-config'
36
echo "You don't seem to have libxml2 installed."
42
*) echo "(I'll use '$xmlconfig' to gather that information.)";;
45
?X: Make sure we have a good enough version
49
version=`$xmlconfig $modver`
53
vint=`echo $version | $awk -F. '{print $1 * 10000 + $2 * 100 + $3;}'`
54
if test 0$vint -lt 20419; then
55
echo "Sorry, you have libxml2 $version, I need at least 2.4.19." >&4
57
echo "Good, you have libxml2 $version. Enabling XML persistence..."
58
xmlcflags=`$xmlconfig --cflags`
59
xmlldflags=`$xmlconfig --libs`
61
case " $xmlldflags " in
63
echo "(Removing unneeded -lpthread from the list of libraries.)"
64
xmlldflags=`echo "$xmlldflags " | $sed -e 's/-lpthread //'`