Commit | Line | Data |
---|---|---|
987fdba5 JB |
1 | #!/bin/sh |
2 | ||
3 | prefix=/usr | |
4 | version=@VERSION@ | |
5 | ||
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 | ||
27 | if test $# -eq 0; then | |
28 | usage 1 1>&2 | |
29 | fi | |
30 | ||
31 | lib_ssl=yes | |
32 | lib_smime=yes | |
33 | lib_nss=yes | |
34 | lib_nssutil=yes | |
35 | ||
36 | while test $# -gt 0; do | |
37 | case "$1" in | |
38 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; | |
39 | *) optarg= ;; | |
40 | esac | |
41 | ||
42 | case $1 in | |
43 | --prefix=*) | |
44 | prefix=$optarg | |
45 | ;; | |
46 | --prefix) | |
47 | echo_prefix=yes | |
48 | ;; | |
49 | --exec-prefix=*) | |
50 | exec_prefix=$optarg | |
51 | ;; | |
52 | --exec-prefix) | |
53 | echo_exec_prefix=yes | |
54 | ;; | |
55 | --includedir=*) | |
56 | includedir=$optarg | |
57 | ;; | |
58 | --includedir) | |
59 | echo_includedir=yes | |
60 | ;; | |
61 | --libdir=*) | |
62 | libdir=$optarg | |
63 | ;; | |
64 | --libdir) | |
65 | echo_libdir=yes | |
66 | ;; | |
67 | --version) | |
68 | echo $version | |
69 | ;; | |
70 | --cflags) | |
71 | echo_cflags=yes | |
72 | ;; | |
73 | --libs) | |
74 | echo_libs=yes | |
75 | ;; | |
76 | ssl) | |
77 | lib_ssl=yes | |
78 | ;; | |
79 | smime) | |
80 | lib_smime=yes | |
81 | ;; | |
82 | nss) | |
83 | lib_nss=yes | |
84 | ;; | |
85 | nssutil) | |
86 | lib_nssutil=yes | |
87 | ;; | |
88 | *) | |
89 | usage 1 1>&2 | |
90 | ;; | |
91 | esac | |
92 | shift | |
93 | done | |
94 | ||
95 | # Set variables that may be dependent upon other variables | |
96 | if test -z "$exec_prefix"; then | |
97 | exec_prefix=${prefix} | |
98 | fi | |
99 | if test -z "$includedir"; then | |
100 | includedir=${prefix}/include/nss | |
101 | fi | |
102 | if test -z "$libdir"; then | |
103 | libdir=${exec_prefix}/lib | |
104 | fi | |
105 | ||
106 | if test "$echo_prefix" = "yes"; then | |
107 | echo $prefix | |
108 | fi | |
109 | ||
110 | if test "$echo_exec_prefix" = "yes"; then | |
111 | echo $exec_prefix | |
112 | fi | |
113 | ||
114 | if test "$echo_includedir" = "yes"; then | |
115 | echo $includedir | |
116 | fi | |
117 | ||
118 | if test "$echo_libdir" = "yes"; then | |
119 | echo $libdir | |
120 | fi | |
121 | ||
122 | if test "$echo_cflags" = "yes"; then | |
123 | echo -I$includedir | |
124 | fi | |
125 | ||
126 | if test "$echo_libs" = "yes"; then | |
127 | libdirs="-L$libdir" | |
128 | if test -n "$lib_ssl"; then | |
129 | libdirs="$libdirs -lssl3" | |
130 | fi | |
131 | if test -n "$lib_smime"; then | |
132 | libdirs="$libdirs -lsmime3" | |
133 | fi | |
134 | if test -n "$lib_nss"; then | |
135 | libdirs="$libdirs -lnss3" | |
136 | fi | |
137 | if test -n "$lib_nssutil"; then | |
138 | libdirs="$libdirs -lnssutil3" | |
139 | fi | |
140 | echo $libdirs | |
141 | fi | |
142 |