xml2-config.in 1.68 KB
Newer Older
1 2 3 4 5
#! /bin/sh

prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
6
libdir=@libdir@
7 8 9 10

usage()
{
    cat <<EOF
11
Usage: xml2-config [OPTION]
12 13 14 15

Known values for OPTION are:

  --prefix=DIR		change libxml prefix [default $prefix]
16
  --exec-prefix=DIR	change libxml exec prefix [default $exec_prefix]
17 18
  --libs		print library linking information
  --cflags		print pre-processor and compiler flags
19
  --modules		module support enabled
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
  --help		display this help and exit
  --version		output version information
EOF

    exit $1
}

if test $# -eq 0; then
    usage 1
fi

cflags=false
libs=false

while test $# -gt 0; do
    case "$1" in
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) optarg= ;;
    esac

    case "$1" in
    --prefix=*)
	prefix=$optarg
43 44
	includedir=$prefix/include
	libdir=$prefix/lib
45 46 47 48 49 50
	;;

    --prefix)
	echo $prefix
	;;

51 52 53 54 55 56 57 58 59
    --exec-prefix=*)
      exec_prefix=$optarg
      libdir=$exec_prefix/lib
      ;;

    --exec-prefix)
      echo $exec_prefix
      ;;

60 61 62 63 64 65 66 67 68 69 70 71 72
    --version)
	echo @VERSION@
	exit 0
	;;

    --help)
	usage 0
	;;

    --cflags)
       	echo @XML_INCLUDEDIR@ @XML_CFLAGS@
       	;;

73
    --libtool-libs)
74 75 76 77
	if [ -r ${libdir}/@XML_LIBTOOLLIBS@ ]
	then
	    echo ${libdir}/@XML_LIBTOOLLIBS@
	fi
78 79
        ;;

80 81 82 83
    --modules)
       	echo @WITH_MODULES@
       	;;

84
    --libs)
85 86
        if [ "`uname`" = "Linux" ]
	then
87
	    if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ]
88
	    then
89
		echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@
90
	    else
91
		echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@
92 93
	    fi
	else
94
	    echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ @WIN32_EXTRA_LIBADD@
95
	fi
96 97 98 99 100 101 102 103 104 105 106
       	;;

    *)
	usage
	exit 1
	;;
    esac
    shift
done

exit 0