• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5includedir=@includedir@
6libdir=@libdir@
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 @VERSION@
62	exit 0
63	;;
64
65    --help)
66	usage 0
67	;;
68
69    --cflags)
70        cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
71       	;;
72
73    --libtool-libs)
74	if [ -r ${libdir}/@XML_LIBTOOLLIBS@ ]
75	then
76	    echo ${libdir}/@XML_LIBTOOLLIBS@
77	fi
78        ;;
79
80    --modules)
81       	echo @WITH_MODULES@
82       	;;
83
84    --libs)
85        if [ "$2" = "--dynamic" ]; then
86            shift
87            libs="@XML_LIBS@"
88        else
89            libs="@XML_LIBS@ @XML_PRIVATE_LIBS@ @MODULE_PLATFORM_LIBS@ @LIBS@"
90        fi
91
92        if [ "@XML_LIBDIR@" != "-L/usr/lib" -a "@XML_LIBDIR@" != "-L/usr/lib64" ]; then
93            libs="@XML_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