nspr-config.in 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #!/bin/sh
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. prefix=@prefix@
  6. major_version=@MOD_MAJOR_VERSION@
  7. minor_version=@MOD_MINOR_VERSION@
  8. patch_version=@MOD_PATCH_VERSION@
  9. usage()
  10. {
  11. cat <<EOF
  12. Usage: nspr-config [OPTIONS] [LIBRARIES]
  13. Options:
  14. [--prefix[=DIR]]
  15. [--exec-prefix[=DIR]]
  16. [--includedir[=DIR]]
  17. [--libdir[=DIR]]
  18. [--version]
  19. [--libs]
  20. [--cflags]
  21. Libraries:
  22. nspr
  23. plc
  24. plds
  25. EOF
  26. exit $1
  27. }
  28. if test $# -eq 0; then
  29. usage 1 1>&2
  30. fi
  31. lib_nspr=yes
  32. lib_plc=yes
  33. lib_plds=yes
  34. while test $# -gt 0; do
  35. case "$1" in
  36. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  37. *) optarg= ;;
  38. esac
  39. case $1 in
  40. --prefix=*)
  41. prefix=$optarg
  42. ;;
  43. --prefix)
  44. echo_prefix=yes
  45. ;;
  46. --exec-prefix=*)
  47. exec_prefix=$optarg
  48. ;;
  49. --exec-prefix)
  50. echo_exec_prefix=yes
  51. ;;
  52. --includedir=*)
  53. includedir=$optarg
  54. ;;
  55. --includedir)
  56. echo_includedir=yes
  57. ;;
  58. --libdir=*)
  59. libdir=$optarg
  60. ;;
  61. --libdir)
  62. echo_libdir=yes
  63. ;;
  64. --version)
  65. echo ${major_version}.${minor_version}.${patch_version}
  66. ;;
  67. --cflags)
  68. echo_cflags=yes
  69. ;;
  70. --libs)
  71. echo_libs=yes
  72. ;;
  73. nspr)
  74. lib_nspr=yes
  75. ;;
  76. plc)
  77. lib_plc=yes
  78. ;;
  79. plds)
  80. lib_plds=yes
  81. ;;
  82. *)
  83. usage 1 1>&2
  84. ;;
  85. esac
  86. shift
  87. done
  88. # Set variables that may be dependent upon other variables
  89. if test -z "$exec_prefix"; then
  90. exec_prefix=@exec_prefix@
  91. fi
  92. if test -z "$includedir"; then
  93. includedir=@includedir@
  94. fi
  95. if test -z "$libdir"; then
  96. libdir=@libdir@
  97. fi
  98. if test "$echo_prefix" = "yes"; then
  99. echo $prefix
  100. fi
  101. if test "$echo_exec_prefix" = "yes"; then
  102. echo $exec_prefix
  103. fi
  104. if test "$echo_includedir" = "yes"; then
  105. echo $includedir
  106. fi
  107. if test "$echo_libdir" = "yes"; then
  108. echo $libdir
  109. fi
  110. if test "$echo_cflags" = "yes"; then
  111. echo -I$includedir
  112. fi
  113. if test "$echo_libs" = "yes"; then
  114. libdirs=-L$libdir
  115. if test -n "$lib_plds"; then
  116. libdirs="$libdirs -lplds${major_version}"
  117. fi
  118. if test -n "$lib_plc"; then
  119. libdirs="$libdirs -lplc${major_version}"
  120. fi
  121. if test -n "$lib_nspr"; then
  122. libdirs="$libdirs -lnspr${major_version}"
  123. fi
  124. os_ldflags="@LDFLAGS@"
  125. for i in $os_ldflags ; do
  126. if echo $i | grep \^-L >/dev/null; then
  127. libdirs="$libdirs $i"
  128. fi
  129. done
  130. echo $libdirs @OS_LIBS@
  131. fi