~ubuntu-branches/ubuntu/karmic/gtk-gnutella/karmic

« back to all changes in this revision

Viewing changes to U/packages/xmlconfig.U

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Kleineidam
  • Date: 2004-05-22 15:26:55 UTC
  • Revision ID: james.westby@ubuntu.com-20040522152655-lyi6iaswmy4hq4wy
Tags: upstream-0.93.3.0
ImportĀ upstreamĀ versionĀ 0.93.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
?RCS: $Id: xmlconfig.U,v 1.2 2003/11/01 15:13:33 rmanfredi Exp $
 
2
?RCS:
 
3
?RCS: @COPYRIGHT@
 
4
?RCS:
 
5
?MAKE:xmlconfig xmlcflags xmlldflags d_libxml2: awk sed
 
6
?MAKE:  -pick add $@ %<
 
7
?S:xmlconfig:
 
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".
 
10
?S:.
 
11
?S:xmlcflags:
 
12
?S:     This variable holds the compiler flags required to compile with libxml2.
 
13
?S:.
 
14
?S:xmlldflags:
 
15
?S:     This variable holds the linker flags required to link against libxml2.
 
16
?S:.
 
17
?S:d_libxml2:
 
18
?S:     Controls whether HAS_LIBXML2 is defined.
 
19
?S:.
 
20
?C:HAS_LIBXML2:
 
21
?C: This symbol is defined when libxml 2.4.19, at least, is present.
 
22
?C:.
 
23
?H:#$d_libxml2 HAS_LIBXML2      /**/
 
24
?H:.
 
25
?T:modver version vint
 
26
: how can we find information about libxml2?
 
27
echo " "
 
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"
 
31
        modver=--modversion
 
32
elif xml2-config --cflags >/dev/null 2>&1; then
 
33
        xmlconfig='xml2-config'
 
34
        modver=--version
 
35
else
 
36
        echo "You don't seem to have libxml2 installed."
 
37
        xmlconfig='false'
 
38
        modver=''
 
39
fi
 
40
case "$xmlconfig" in
 
41
false) ;;
 
42
*) echo "(I'll use '$xmlconfig' to gather that information.)";;
 
43
esac
 
44
 
 
45
?X: Make sure we have a good enough version
 
46
xmlcflags=""
 
47
xmlldflags=""
 
48
d_libxml2="$undef"
 
49
version=`$xmlconfig $modver`
 
50
case "$version" in
 
51
'') ;;
 
52
*)
 
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
 
56
        else
 
57
                echo "Good, you have libxml2 $version.  Enabling XML persistence..."
 
58
                xmlcflags=`$xmlconfig --cflags`
 
59
                xmlldflags=`$xmlconfig --libs`
 
60
                d_libxml2="$define"
 
61
                case " $xmlldflags " in
 
62
                *" -lpthread "*)
 
63
                        echo "(Removing unneeded -lpthread from the list of libraries.)"
 
64
                        xmlldflags=`echo "$xmlldflags " | $sed -e 's/-lpthread //'`
 
65
                        ;;
 
66
                esac
 
67
        fi
 
68
        ;;
 
69
esac
 
70