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