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