libgnutls-config 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/sh
  2. prefix=/usr
  3. exec_prefix=/usr
  4. exec_prefix_set=no
  5. name=`basename $0`
  6. name=${name#lib}
  7. name=${name%-config}
  8. libs=`pkg-config --libs $name`
  9. cflags=`pkg-config --cflags $name`
  10. version=`pkg-config --modversion $name`
  11. usage()
  12. {
  13. echo Usage: lib$name-config [OPTIONS]
  14. cat <<EOF
  15. Options:
  16. [--prefix[=DIR]]
  17. [--exec-prefix[=DIR]]
  18. [--version]
  19. [--libs]
  20. [--cflags]
  21. EOF
  22. exit $1
  23. }
  24. if test $# -eq 0; then
  25. usage 1 1>&2
  26. fi
  27. while test $# -gt 0; do
  28. case "$1" in
  29. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  30. *) optarg= ;;
  31. esac
  32. case $1 in
  33. --prefix=*)
  34. prefix=$optarg
  35. if test $exec_prefix_set = no ; then
  36. exec_prefix=$optarg
  37. fi
  38. ;;
  39. --prefix)
  40. echo_prefix=yes
  41. ;;
  42. --exec-prefix=*)
  43. exec_prefix=$optarg
  44. exec_prefix_set=yes
  45. ;;
  46. --exec-prefix)
  47. echo_exec_prefix=yes
  48. ;;
  49. --version)
  50. echo $version
  51. exit 0
  52. ;;
  53. --cflags)
  54. echo_cflags=yes
  55. ;;
  56. --libs)
  57. echo_libs=yes
  58. ;;
  59. --help)
  60. usage 0
  61. ;;
  62. *)
  63. usage 1 1>&2
  64. ;;
  65. esac
  66. shift
  67. done
  68. if test "$echo_prefix" = "yes"; then
  69. echo $prefix
  70. fi
  71. if test "$echo_exec_prefix" = "yes"; then
  72. echo $exec_prefix
  73. fi
  74. if test "$echo_cflags" = "yes"; then
  75. echo $cflags
  76. fi
  77. if test "$echo_libs" = "yes"; then
  78. echo $libs
  79. fi