~ubuntu-branches/ubuntu/maverick/libxml2/maverick

« back to all changes in this revision

Viewing changes to xml2-config

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 19:50:33 UTC
  • Revision ID: james.westby@ubuntu.com-20071205195033-ti05mbo96lfyuhfe
Tags: 2.6.30.dfsg-3ubuntu1
* Merge with Debian; remaining changes:
  - debian/rules: create a udeb for debian-installer, correct libxml2-dev
    Depends to include zlib1g-dev.
  - Build a python-libxml2-dbg package.
  - Fix a regression using XSLT copy element. LP: #147144.
* Link using -Bsymbolic-functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
prefix=/usr
 
4
exec_prefix=${prefix}
 
5
includedir=${prefix}/include
 
6
libdir=${exec_prefix}/lib
 
7
 
 
8
usage()
 
9
{
 
10
    cat <<EOF
 
11
Usage: xml2-config [OPTION]
 
12
 
 
13
Known values for OPTION are:
 
14
 
 
15
  --prefix=DIR          change libxml prefix [default $prefix]
 
16
  --exec-prefix=DIR     change libxml exec prefix [default $exec_prefix]
 
17
  --libs                print library linking information
 
18
                        add --static to print static library linking information
 
19
  --cflags              print pre-processor and compiler flags
 
20
  --modules             module support enabled
 
21
  --help                display this help and exit
 
22
  --version             output version information
 
23
EOF
 
24
 
 
25
    exit $1
 
26
}
 
27
 
 
28
if test $# -eq 0; then
 
29
    usage 1
 
30
fi
 
31
 
 
32
cflags=false
 
33
libs=false
 
34
 
 
35
while test $# -gt 0; do
 
36
    case "$1" in
 
37
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
 
38
    *) optarg= ;;
 
39
    esac
 
40
 
 
41
    case "$1" in
 
42
    --prefix=*)
 
43
        prefix=$optarg
 
44
        includedir=$prefix/include
 
45
        libdir=$prefix/lib
 
46
        ;;
 
47
 
 
48
    --prefix)
 
49
        echo $prefix
 
50
        ;;
 
51
 
 
52
    --exec-prefix=*)
 
53
      exec_prefix=$optarg
 
54
      libdir=$exec_prefix/lib
 
55
      ;;
 
56
 
 
57
    --exec-prefix)
 
58
      echo $exec_prefix
 
59
      ;;
 
60
 
 
61
    --version)
 
62
        echo 2.6.30
 
63
        exit 0
 
64
        ;;
 
65
 
 
66
    --help)
 
67
        usage 0
 
68
        ;;
 
69
 
 
70
    --cflags)
 
71
        echo -I${includedir}/libxml2 
 
72
        ;;
 
73
 
 
74
    --libtool-libs)
 
75
        if [ -r ${libdir}/libxml2.la ]
 
76
        then
 
77
            echo ${libdir}/libxml2.la
 
78
        fi
 
79
        ;;
 
80
 
 
81
    --modules)
 
82
        echo 1
 
83
        ;;
 
84
 
 
85
    --libs)
 
86
        if [ "`uname`" = "Linux" ]
 
87
        then
 
88
            if [ "-L${libdir}" = "-L/usr/lib64" ]
 
89
            then
 
90
                LIBS="-lxml2"
 
91
            else
 
92
                LIBS="-L${libdir} -lxml2"
 
93
            fi
 
94
        else
 
95
            LIBS="-L${libdir} -lxml2 "
 
96
        fi
 
97
        if [ "$2" = "--static" ]
 
98
        then
 
99
            shift
 
100
            LIBS="${LIBS} -lz -lpthread   -lm "
 
101
        fi
 
102
        echo ${LIBS}
 
103
        ;;
 
104
 
 
105
    *)
 
106
        usage
 
107
        exit 1
 
108
        ;;
 
109
    esac
 
110
    shift
 
111
done
 
112
 
 
113
exit 0