Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | |
| 3 | prefix=@prefix@ |
| 4 | exec_prefix=@exec_prefix@ |
| 5 | includedir=@includedir@ |
| 6 | libdir=@libdir@ |
| 7 | |
| 8 | usage() |
| 9 | { |
| 10 | cat <<EOF |
Daniel Veillard | 070803b | 2002-05-03 07:29:38 +0000 | [diff] [blame] | 11 | Usage: xml2-config [OPTION] |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 12 | |
| 13 | Known values for OPTION are: |
| 14 | |
| 15 | --prefix=DIR change libxml prefix [default $prefix] |
William M. Brack | 9202942 | 2004-01-04 01:01:14 +0000 | [diff] [blame] | 16 | --exec-prefix=DIR change libxml exec prefix [default $exec_prefix] |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 17 | --libs print library linking information |
| 18 | --cflags print pre-processor and compiler flags |
Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 19 | --modules module support enabled |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 20 | --help display this help and exit |
| 21 | --version output version information |
| 22 | EOF |
| 23 | |
| 24 | exit $1 |
| 25 | } |
| 26 | |
| 27 | if test $# -eq 0; then |
| 28 | usage 1 |
| 29 | fi |
| 30 | |
| 31 | cflags=false |
| 32 | libs=false |
| 33 | |
| 34 | while 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 Veillard | 070803b | 2002-05-03 07:29:38 +0000 | [diff] [blame] | 43 | includedir=$prefix/include |
| 44 | libdir=$prefix/lib |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 45 | ;; |
| 46 | |
| 47 | --prefix) |
| 48 | echo $prefix |
| 49 | ;; |
| 50 | |
William M. Brack | 9202942 | 2004-01-04 01:01:14 +0000 | [diff] [blame] | 51 | --exec-prefix=*) |
| 52 | exec_prefix=$optarg |
| 53 | libdir=$exec_prefix/lib |
| 54 | ;; |
| 55 | |
| 56 | --exec-prefix) |
| 57 | echo $exec_prefix |
| 58 | ;; |
| 59 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 60 | --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 Veillard | e855373 | 2003-09-01 20:33:14 +0000 | [diff] [blame] | 73 | --libtool-libs) |
Daniel Veillard | 4f27a8a | 2006-03-07 09:00:20 +0000 | [diff] [blame] | 74 | if [ -r ${libdir}/@XML_LIBTOOLLIBS@ ] |
| 75 | then |
| 76 | echo ${libdir}/@XML_LIBTOOLLIBS@ |
| 77 | fi |
Daniel Veillard | e855373 | 2003-09-01 20:33:14 +0000 | [diff] [blame] | 78 | ;; |
| 79 | |
Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 80 | --modules) |
| 81 | echo @WITH_MODULES@ |
| 82 | ;; |
| 83 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 84 | --libs) |
Daniel Veillard | 61c5220 | 2003-04-30 12:20:34 +0000 | [diff] [blame] | 85 | if [ "`uname`" = "Linux" ] |
| 86 | then |
Daniel Veillard | aa2404e | 2008-01-11 06:44:00 +0000 | [diff] [blame] | 87 | if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ] |
Daniel Veillard | 61c5220 | 2003-04-30 12:20:34 +0000 | [diff] [blame] | 88 | then |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 89 | echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@ |
Daniel Veillard | 61c5220 | 2003-04-30 12:20:34 +0000 | [diff] [blame] | 90 | else |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 91 | echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ |
Daniel Veillard | 61c5220 | 2003-04-30 12:20:34 +0000 | [diff] [blame] | 92 | fi |
| 93 | else |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 94 | echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ @WIN32_EXTRA_LIBADD@ |
Daniel Veillard | 61c5220 | 2003-04-30 12:20:34 +0000 | [diff] [blame] | 95 | fi |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 96 | ;; |
| 97 | |
| 98 | *) |
| 99 | usage |
| 100 | exit 1 |
| 101 | ;; |
| 102 | esac |
| 103 | shift |
| 104 | done |
| 105 | |
| 106 | exit 0 |