blob: 19574864cb6a61c86ab445c18138e769d21e6139 [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001#! /bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5includedir=@includedir@
Daniel Veillard8123c4f2012-11-08 16:24:07 +08006libdir=@libdir@
Owen Taylor3473f882001-02-23 17:55:21 +00007
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
18 --cflags print pre-processor and compiler flags
Daniel Veillardce1648b2005-01-04 15:10:22 +000019 --modules module support enabled
Owen Taylor3473f882001-02-23 17:55:21 +000020 --help display this help and exit
21 --version output version information
22EOF
23
24 exit $1
25}
26
27if test $# -eq 0; then
28 usage 1
29fi
30
31cflags=false
32libs=false
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
Daniel Veillard070803b2002-05-03 07:29:38 +000043 includedir=$prefix/include
44 libdir=$prefix/lib
Owen Taylor3473f882001-02-23 17:55:21 +000045 ;;
46
47 --prefix)
48 echo $prefix
49 ;;
50
William M. Brack92029422004-01-04 01:01:14 +000051 --exec-prefix=*)
52 exec_prefix=$optarg
53 libdir=$exec_prefix/lib
54 ;;
55
56 --exec-prefix)
57 echo $exec_prefix
58 ;;
59
Owen Taylor3473f882001-02-23 17:55:21 +000060 --version)
61 echo @VERSION@
62 exit 0
63 ;;
64
65 --help)
66 usage 0
67 ;;
68
69 --cflags)
70 echo @XML_INCLUDEDIR@ @XML_CFLAGS@
71 ;;
72
Daniel Veillarde8553732003-09-01 20:33:14 +000073 --libtool-libs)
Daniel Veillard4f27a8a2006-03-07 09:00:20 +000074 if [ -r ${libdir}/@XML_LIBTOOLLIBS@ ]
75 then
76 echo ${libdir}/@XML_LIBTOOLLIBS@
77 fi
Daniel Veillarde8553732003-09-01 20:33:14 +000078 ;;
79
Daniel Veillardce1648b2005-01-04 15:10:22 +000080 --modules)
81 echo @WITH_MODULES@
82 ;;
83
Owen Taylor3473f882001-02-23 17:55:21 +000084 --libs)
Daniel Veillard61c52202003-04-30 12:20:34 +000085 if [ "`uname`" = "Linux" ]
86 then
Daniel Veillardaa2404e2008-01-11 06:44:00 +000087 if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ]
Daniel Veillard61c52202003-04-30 12:20:34 +000088 then
Daniel Richard G5706b6d2012-08-06 11:32:54 +080089 echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@
Daniel Veillard61c52202003-04-30 12:20:34 +000090 else
Daniel Richard G5706b6d2012-08-06 11:32:54 +080091 echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@
Daniel Veillard61c52202003-04-30 12:20:34 +000092 fi
93 else
Daniel Richard G5706b6d2012-08-06 11:32:54 +080094 echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ @WIN32_EXTRA_LIBADD@
Daniel Veillard61c52202003-04-30 12:20:34 +000095 fi
Owen Taylor3473f882001-02-23 17:55:21 +000096 ;;
97
98 *)
99 usage
100 exit 1
101 ;;
102 esac
103 shift
104done
105
106exit 0