ogg-config.in 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/sh
  2. # ogg-config
  3. #
  4. # Tool for retrieving the library/include paths Ogg was compiled with.
  5. #
  6. # Written 21 October 2000 by Jack Moffitt <jack@icecast.org>
  7. # Based *HEAVILY* on xmms-config from the XMMS package
  8. # which was
  9. # Based *HEAVILY* on gtk-config from the GTK+ library package.
  10. #
  11. # This work is released under the GNU GPL, version 2 or later.
  12. prefix="@prefix@"
  13. exec_prefix="@exec_prefix@"
  14. exec_prefix_set=no
  15. data_dir="@datadir@/@PACKAGE@"
  16. version="@VERSION@"
  17. include_dir="@includedir@"
  18. ogg_include_dir="@includedir@/@PACKAGE@"
  19. lib_dir="@libdir@"
  20. usage()
  21. {
  22. cat <<EOF
  23. Usage: ogg-config [OPTIONS]
  24. Options:
  25. [--prefix[=DIR]]
  26. [--version]
  27. [--libs]
  28. [--cflags]
  29. EOF
  30. exit $1
  31. }
  32. if test $# -eq 0; then
  33. usage 1 1>&2
  34. fi
  35. while test $# -gt 0; do
  36. case "$1" in
  37. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  38. *) optarg= ;;
  39. esac
  40. case $1 in
  41. --prefix=*)
  42. prefix=$optarg
  43. ;;
  44. --prefix)
  45. echo_prefix=yes
  46. ;;
  47. --version)
  48. echo $version
  49. ;;
  50. --cflags)
  51. echo_cflags=yes
  52. ;;
  53. --libs)
  54. echo_libs=yes
  55. ;;
  56. *)
  57. usage 1 1>&2
  58. ;;
  59. esac
  60. shift
  61. done
  62. if test "$echo_prefix" = "yes"; then
  63. echo $prefix
  64. fi
  65. if test "$echo_exec_prefix" = "yes"; then
  66. echo $exec_prefix
  67. fi
  68. if test "$include_dir" != "/usr/include"; then
  69. cflags="-I$include_dir"
  70. fi
  71. if test "$lib_dir" != "/usr/lib"; then
  72. libs="-L$lib_dir -logg"
  73. else
  74. libs="-logg"
  75. fi
  76. if test "$echo_cflags" = "yes"; then
  77. echo $cflags
  78. fi
  79. if test "$echo_libs" = "yes"; then
  80. echo $libs
  81. fi