xml2-config.in 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #! /bin/sh
  2. prefix=@prefix@
  3. exec_prefix=@exec_prefix@
  4. includedir=@includedir@
  5. libdir=@libdir@
  6. usage()
  7. {
  8. cat <<EOF
  9. Usage: xml2-config [OPTION]
  10. Known values for OPTION are:
  11. --prefix=DIR change libxml prefix [default $prefix]
  12. --exec-prefix=DIR change libxml exec prefix [default $exec_prefix]
  13. --libs print library linking information
  14. --cflags print pre-processor and compiler flags
  15. --modules module support enabled
  16. --help display this help and exit
  17. --version output version information
  18. EOF
  19. exit $1
  20. }
  21. if test $# -eq 0; then
  22. usage 1
  23. fi
  24. cflags=false
  25. libs=false
  26. while test $# -gt 0; do
  27. case "$1" in
  28. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  29. *) optarg= ;;
  30. esac
  31. case "$1" in
  32. --prefix=*)
  33. prefix=$optarg
  34. includedir=$prefix/include
  35. libdir=$prefix/lib
  36. ;;
  37. --prefix)
  38. echo $prefix
  39. ;;
  40. --exec-prefix=*)
  41. exec_prefix=$optarg
  42. libdir=$exec_prefix/lib
  43. ;;
  44. --exec-prefix)
  45. echo $exec_prefix
  46. ;;
  47. --version)
  48. echo @VERSION@
  49. exit 0
  50. ;;
  51. --help)
  52. usage 0
  53. ;;
  54. --cflags)
  55. echo @XML_INCLUDEDIR@ @XML_CFLAGS@
  56. ;;
  57. --libtool-libs)
  58. if [ -r ${libdir}/@XML_LIBTOOLLIBS@ ]
  59. then
  60. echo ${libdir}/@XML_LIBTOOLLIBS@
  61. fi
  62. ;;
  63. --modules)
  64. echo @WITH_MODULES@
  65. ;;
  66. --libs)
  67. if [ "`uname`" = "Linux" ]
  68. then
  69. if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ]
  70. then
  71. echo @XML_LIBS@
  72. else
  73. echo @XML_LIBDIR@ @XML_LIBS@
  74. fi
  75. else
  76. echo @XML_LIBDIR@ @XML_LIBS@ @WIN32_EXTRA_LIBADD@
  77. fi
  78. ;;
  79. *)
  80. usage
  81. exit 1
  82. ;;
  83. esac
  84. shift
  85. done
  86. exit 0