nss-config.in 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #!/bin/sh
  2. prefix=@prefix@
  3. major_version=@MOD_MAJOR_VERSION@
  4. minor_version=@MOD_MINOR_VERSION@
  5. patch_version=@MOD_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. ssl
  22. smime
  23. EOF
  24. exit $1
  25. }
  26. if test $# -eq 0; then
  27. usage 1 1>&2
  28. fi
  29. lib_ssl=yes
  30. lib_smime=yes
  31. lib_nss=yes
  32. lib_nssutil=yes
  33. while test $# -gt 0; do
  34. case "$1" in
  35. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  36. *) optarg= ;;
  37. esac
  38. case $1 in
  39. --prefix=*)
  40. prefix=$optarg
  41. ;;
  42. --prefix)
  43. echo_prefix=yes
  44. ;;
  45. --exec-prefix=*)
  46. exec_prefix=$optarg
  47. ;;
  48. --exec-prefix)
  49. echo_exec_prefix=yes
  50. ;;
  51. --includedir=*)
  52. includedir=$optarg
  53. ;;
  54. --includedir)
  55. echo_includedir=yes
  56. ;;
  57. --libdir=*)
  58. libdir=$optarg
  59. ;;
  60. --libdir)
  61. echo_libdir=yes
  62. ;;
  63. --version)
  64. echo ${major_version}.${minor_version}.${patch_version}
  65. ;;
  66. --cflags)
  67. echo_cflags=yes
  68. ;;
  69. --libs)
  70. echo_libs=yes
  71. ;;
  72. ssl)
  73. lib_ssl=yes
  74. ;;
  75. smime)
  76. lib_smime=yes
  77. ;;
  78. nss)
  79. lib_nss=yes
  80. ;;
  81. nssutil)
  82. lib_nssutil=yes
  83. ;;
  84. *)
  85. usage 1 1>&2
  86. ;;
  87. esac
  88. shift
  89. done
  90. # Set variables that may be dependent upon other variables
  91. if test -z "$exec_prefix"; then
  92. exec_prefix=`pkg-config --variable=exec_prefix nss`
  93. fi
  94. if test -z "$includedir"; then
  95. includedir=`pkg-config --variable=includedir nss`
  96. fi
  97. if test -z "$libdir"; then
  98. libdir=`pkg-config --variable=libdir nss`
  99. fi
  100. if test "$echo_prefix" = "yes"; then
  101. echo $prefix
  102. fi
  103. if test "$echo_exec_prefix" = "yes"; then
  104. echo $exec_prefix
  105. fi
  106. if test "$echo_includedir" = "yes"; then
  107. echo $includedir
  108. fi
  109. if test "$echo_libdir" = "yes"; then
  110. echo $libdir
  111. fi
  112. if test "$echo_cflags" = "yes"; then
  113. echo -I$includedir
  114. fi
  115. if test "$echo_libs" = "yes"; then
  116. libdirs="-Wl,-rpath-link,$libdir -L$libdir"
  117. if test -n "$lib_ssl"; then
  118. libdirs="$libdirs -lssl${major_version}"
  119. fi
  120. if test -n "$lib_smime"; then
  121. libdirs="$libdirs -lsmime${major_version}"
  122. fi
  123. if test -n "$lib_nss"; then
  124. libdirs="$libdirs -lnss${major_version}"
  125. fi
  126. if test -n "$lib_nssutil"; then
  127. libdirs="$libdirs -lnssutil${major_version}"
  128. fi
  129. echo $libdirs
  130. fi