nss-config.in 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #!/bin/sh
  2. prefix=/usr
  3. surum=@VERSION@
  4. usage()
  5. {
  6. cat <<EOF
  7. Usage: nss-config [OPTIONS] [LIBRARIES]
  8. Options:
  9. [--prefix[=DIR]]
  10. [--exec-prefix[=DIR]]
  11. [--includedir[=DIR]]
  12. [--libdir[=DIR]]
  13. [--version]
  14. [--libs]
  15. [--cflags]
  16. Dynamic Libraries:
  17. nss
  18. nssutil
  19. ssl
  20. smime
  21. EOF
  22. exit $1
  23. }
  24. if test $# -eq 0; then
  25. usage 1 1>&2
  26. fi
  27. lib_ssl=yes
  28. lib_smime=yes
  29. lib_nss=yes
  30. lib_nssutil=yes
  31. while test $# -gt 0; do
  32. case "$1" in
  33. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  34. *) optarg= ;;
  35. esac
  36. case $1 in
  37. --prefix=*)
  38. prefix=$optarg
  39. ;;
  40. --prefix)
  41. echo_prefix=yes
  42. ;;
  43. --exec-prefix=*)
  44. exec_prefix=$optarg
  45. ;;
  46. --exec-prefix)
  47. echo_exec_prefix=yes
  48. ;;
  49. --includedir=*)
  50. includedir=$optarg
  51. ;;
  52. --includedir)
  53. echo_includedir=yes
  54. ;;
  55. --libdir=*)
  56. libdir=$optarg
  57. ;;
  58. --libdir)
  59. echo_libdir=yes
  60. ;;
  61. --version)
  62. echo $surum
  63. ;;
  64. --cflags)
  65. echo_cflags=yes
  66. ;;
  67. --libs)
  68. echo_libs=yes
  69. ;;
  70. ssl)
  71. lib_ssl=yes
  72. ;;
  73. smime)
  74. lib_smime=yes
  75. ;;
  76. nss)
  77. lib_nss=yes
  78. ;;
  79. nssutil)
  80. lib_nssutil=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=${prefix}
  91. fi
  92. if test -z "$includedir"; then
  93. includedir=${prefix}/include/nss
  94. fi
  95. if test -z "$libdir"; then
  96. libdir=${exec_prefix}/lib
  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_ssl"; then
  116. libdirs="$libdirs -lssl3"
  117. fi
  118. if test -n "$lib_smime"; then
  119. libdirs="$libdirs -lsmime3"
  120. fi
  121. if test -n "$lib_nss"; then
  122. libdirs="$libdirs -lnss3"
  123. fi
  124. if test -n "$lib_nssutil"; then
  125. libdirs="$libdirs -lnssutil3"
  126. fi
  127. echo $libdirs
  128. fi