blob: 304df6c9c451a88b6bb50d271eb38b22b5f6c238 [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001#! /bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5includedir=@includedir@
6libdir=@libdir@
7
8usage()
9{
10 cat <<EOF
Daniel Veillard070803b2002-05-03 07:29:38 +000011Usage: xml2-config [OPTION]
Owen Taylor3473f882001-02-23 17:55:21 +000012
13Known values for OPTION are:
14
15 --prefix=DIR change libxml prefix [default $prefix]
William M. Brack92029422004-01-04 01:01:14 +000016 --exec-prefix=DIR change libxml exec prefix [default $exec_prefix]
Owen Taylor3473f882001-02-23 17:55:21 +000017 --libs print library linking information
Daniel Veillarde8553732003-09-01 20:33:14 +000018 --libtool-libs print linking information for use with libtool
Owen Taylor3473f882001-02-23 17:55:21 +000019 --cflags print pre-processor and compiler flags
Daniel Veillardce1648b2005-01-04 15:10:22 +000020 --modules module support enabled
Owen Taylor3473f882001-02-23 17:55:21 +000021 --help display this help and exit
22 --version output version information
23EOF
24
25 exit $1
26}
27
28if test $# -eq 0; then
29 usage 1
30fi
31
32cflags=false
33libs=false
34
35while 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
Daniel Veillard070803b2002-05-03 07:29:38 +000044 includedir=$prefix/include
45 libdir=$prefix/lib
Owen Taylor3473f882001-02-23 17:55:21 +000046 ;;
47
48 --prefix)
49 echo $prefix
50 ;;
51
William M. Brack92029422004-01-04 01:01:14 +000052 --exec-prefix=*)
53 exec_prefix=$optarg
54 libdir=$exec_prefix/lib
55 ;;
56
57 --exec-prefix)
58 echo $exec_prefix
59 ;;
60
Owen Taylor3473f882001-02-23 17:55:21 +000061 --version)
62 echo @VERSION@
63 exit 0
64 ;;
65
66 --help)
67 usage 0
68 ;;
69
70 --cflags)
71 echo @XML_INCLUDEDIR@ @XML_CFLAGS@
72 ;;
73
Daniel Veillarde8553732003-09-01 20:33:14 +000074 --libtool-libs)
75 echo ${libdir}/@XML_LIBTOOLLIBS@
76 ;;
77
Daniel Veillardce1648b2005-01-04 15:10:22 +000078 --modules)
79 echo @WITH_MODULES@
80 ;;
81
Owen Taylor3473f882001-02-23 17:55:21 +000082 --libs)
Daniel Veillard61c52202003-04-30 12:20:34 +000083 if [ "`uname`" = "Linux" ]
84 then
85 if [ "@XML_LIBDIR@" = "-L/usr/lib64" ]
86 then
87 echo @XML_LIBS@
88 else
89 echo @XML_LIBDIR@ @XML_LIBS@
90 fi
91 else
92 echo @XML_LIBDIR@ @XML_LIBS@
93 fi
Owen Taylor3473f882001-02-23 17:55:21 +000094 ;;
95
96 *)
97 usage
98 exit 1
99 ;;
100 esac
101 shift
102done
103
104exit 0