]>
Commit | Line | Data |
---|---|---|
a91d5515 ER |
1 | #!/bin/sh |
2 | ||
3 | prefix=@prefix@ | |
4 | ||
69aeda39 ER |
5 | major_version=@MOD_MAJOR_VERSION@ |
6 | minor_version=@MOD_MINOR_VERSION@ | |
7 | patch_version=@MOD_PATCH_VERSION@ | |
8 | ||
a91d5515 ER |
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 | |
6ec04d61 | 36 | lib_nssutil=yes |
a91d5515 ER |
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) | |
69aeda39 | 70 | echo ${major_version}.${minor_version}.${patch_version} |
a91d5515 ER |
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 | ;; | |
6ec04d61 | 87 | nssutil) |
88 | lib_nssutil=yes | |
89 | ;; | |
a91d5515 ER |
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 | |
628fee90 | 99 | exec_prefix=@exec_prefix@ |
a91d5515 ER |
100 | fi |
101 | if test -z "$includedir"; then | |
628fee90 | 102 | includedir=@includedir@ |
a91d5515 ER |
103 | fi |
104 | if test -z "$libdir"; then | |
628fee90 | 105 | libdir=@libdir@ |
a91d5515 ER |
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 | |
a91d5515 ER |
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 | |
6ec04d61 | 138 | if test -n "$lib_nssutil"; then |
139 | libdirs="$libdirs -lnssutil${major_version}" | |
140 | fi | |
a91d5515 ER |
141 | echo $libdirs |
142 | fi | |
143 |