cppunit-config.in 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/sh
  2. prefix=@prefix@
  3. exec_prefix=@exec_prefix@
  4. exec_prefix_set=no
  5. includedir=@includedir@
  6. usage()
  7. {
  8. cat <<EOF
  9. Usage: cppunit-config [OPTION] ...
  10. Generic options
  11. --version output CppUnit version information.
  12. --help display this help and exit.
  13. Compilation support options
  14. --cflags print pre-processor and compiler flags
  15. --libs print library linking information
  16. Install directories CppUnit was configured to
  17. --prefix[=DIR]
  18. --exec-prefix[=DIR]
  19. EOF
  20. exit $1
  21. }
  22. if test $# -eq 0; then
  23. usage 1 1>&2
  24. fi
  25. while test $# -gt 0; do
  26. case "$1" in
  27. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  28. *) optarg= ;;
  29. esac
  30. case $1 in
  31. --prefix=*)
  32. prefix=$optarg
  33. if test $exec_prefix_set = no ; then
  34. exec_prefix=$optarg
  35. fi
  36. ;;
  37. --prefix)
  38. echo_prefix=yes
  39. ;;
  40. --exec-prefix=*)
  41. exec_prefix=$optarg
  42. exec_prefix_set=yes
  43. ;;
  44. --exec-prefix)
  45. echo_exec_prefix=yes
  46. ;;
  47. --version)
  48. echo @CPPUNIT_VERSION@
  49. ;;
  50. --help)
  51. usage 0
  52. ;;
  53. --cflags)
  54. echo_cflags=yes
  55. ;;
  56. --libs)
  57. echo_libs=yes
  58. ;;
  59. *)
  60. usage 1 1>&2
  61. ;;
  62. esac
  63. shift
  64. done
  65. if test "$echo_prefix" = "yes"; then
  66. echo $prefix
  67. fi
  68. if test "$echo_exec_prefix" = "yes"; then
  69. echo $exec_prefix
  70. fi
  71. if test "$echo_cflags" = "yes"; then
  72. if test "$includedir" != "/usr/include" ; then
  73. echo -I$includedir
  74. fi
  75. fi
  76. if test "$echo_libs" = "yes"; then
  77. if test @libdir@ != /usr/lib ; then
  78. my_linker_flags="-L@libdir@"
  79. fi
  80. echo ${my_linker_flags} -lcppunit @LIBADD_DL@
  81. fi