nss-config.in 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #!/bin/sh
  2. prefix=@prefix@
  3. major_version=@NSS_MAJOR_VERSION@
  4. minor_version=@NSS_MINOR_VERSION@
  5. patch_version=@NSS_PATCH_VERSION@
  6. usage()
  7. {
  8. cat <<EOF
  9. Usage: nss-config [OPTIONS] [LIBRARIES]
  10. Options:
  11. [--prefix[=DIR]]
  12. [--exec-prefix[=DIR]]
  13. [--includedir[=DIR]]
  14. [--libdir[=DIR]]
  15. [--version]
  16. [--libs]
  17. [--cflags]
  18. Dynamic Libraries:
  19. nss
  20. nssutil
  21. smime
  22. ssl
  23. softokn
  24. EOF
  25. exit $1
  26. }
  27. if test $# -eq 0; then
  28. usage 1 1>&2
  29. fi
  30. lib_nss=yes
  31. lib_nssutil=yes
  32. lib_smime=yes
  33. lib_ssl=yes
  34. lib_softokn=yes
  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. --exec-prefix=*)
  48. exec_prefix=$optarg
  49. ;;
  50. --exec-prefix)
  51. echo_exec_prefix=yes
  52. ;;
  53. --includedir=*)
  54. includedir=$optarg
  55. ;;
  56. --includedir)
  57. echo_includedir=yes
  58. ;;
  59. --libdir=*)
  60. libdir=$optarg
  61. ;;
  62. --libdir)
  63. echo_libdir=yes
  64. ;;
  65. --version)
  66. echo ${major_version}.${minor_version}.${patch_version}
  67. ;;
  68. --cflags)
  69. echo_cflags=yes
  70. ;;
  71. --libs)
  72. echo_libs=yes
  73. ;;
  74. nss)
  75. lib_nss=yes
  76. ;;
  77. nssutil)
  78. lib_nssutil=yes
  79. ;;
  80. smime)
  81. lib_smime=yes
  82. ;;
  83. ssl)
  84. lib_ssl=yes
  85. ;;
  86. softokn)
  87. lib_softokn=yes
  88. ;;
  89. *)
  90. usage 1 1>&2
  91. ;;
  92. esac
  93. shift
  94. done
  95. # Set variables that may be dependent upon other variables
  96. if test -z "$exec_prefix"; then
  97. exec_prefix=`pkg-config --variable=exec_prefix nss`
  98. fi
  99. if test -z "$includedir"; then
  100. includedir=`pkg-config --variable=includedir nss`
  101. fi
  102. if test -z "$libdir"; then
  103. libdir=`pkg-config --variable=libdir nss`
  104. fi
  105. if test "$echo_prefix" = "yes"; then
  106. echo $prefix
  107. fi
  108. if test "$echo_exec_prefix" = "yes"; then
  109. echo $exec_prefix
  110. fi
  111. if test "$echo_includedir" = "yes"; then
  112. echo $includedir
  113. fi
  114. if test "$echo_libdir" = "yes"; then
  115. echo $libdir
  116. fi
  117. if test "$echo_cflags" = "yes"; then
  118. echo -I$includedir
  119. fi
  120. if test "$echo_libs" = "yes"; then
  121. libdirs="-L$libdir"
  122. if test -n "$lib_nss"; then
  123. libdirs="$libdirs -lnss${major_version}"
  124. fi
  125. if test -n "$lib_nssutil"; then
  126. libdirs="$libdirs -lnssutil${major_version}"
  127. fi
  128. if test -n "$lib_smime"; then
  129. libdirs="$libdirs -lsmime${major_version}"
  130. fi
  131. if test -n "$lib_ssl"; then
  132. libdirs="$libdirs -lssl${major_version}"
  133. prefix=@prefix@
  134. fi
  135. if test -n "$lib_softokn"; then
  136. libdirs="$libdirs -lsoftokn${major_version}"
  137. fi
  138. echo $libdirs
  139. fi