]>
Commit | Line | Data |
---|---|---|
a91d5515 ER |
1 | #!/bin/sh |
2 | ||
3 | prefix=@prefix@ | |
4 | ||
a91d5515 ER |
5 | usage() |
6 | { | |
7 | cat <<EOF | |
8 | Usage: nss-config [OPTIONS] [LIBRARIES] | |
9 | Options: | |
10 | [--prefix[=DIR]] | |
11 | [--exec-prefix[=DIR]] | |
12 | [--includedir[=DIR]] | |
13 | [--libdir[=DIR]] | |
14 | [--version] | |
15 | [--libs] | |
16 | [--cflags] | |
17 | Dynamic Libraries: | |
18 | nss | |
19 | ssl | |
20 | smime | |
21 | EOF | |
22 | exit $1 | |
23 | } | |
24 | ||
25 | if test $# -eq 0; then | |
26 | usage 1 1>&2 | |
27 | fi | |
28 | ||
29 | lib_ssl=yes | |
30 | lib_smime=yes | |
31 | lib_nss=yes | |
32 | ||
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 | ||
39 | case $1 in | |
40 | --prefix=*) | |
41 | prefix=$optarg | |
42 | ;; | |
43 | --prefix) | |
44 | echo_prefix=yes | |
45 | ;; | |
46 | --exec-prefix=*) | |
47 | exec_prefix=$optarg | |
48 | ;; | |
49 | --exec-prefix) | |
50 | echo_exec_prefix=yes | |
51 | ;; | |
52 | --includedir=*) | |
53 | includedir=$optarg | |
54 | ;; | |
55 | --includedir) | |
56 | echo_includedir=yes | |
57 | ;; | |
58 | --libdir=*) | |
59 | libdir=$optarg | |
60 | ;; | |
61 | --libdir) | |
62 | echo_libdir=yes | |
63 | ;; | |
64 | --version) | |
59138c52 | 65 | echo @version@ |
a91d5515 ER |
66 | ;; |
67 | --cflags) | |
68 | echo_cflags=yes | |
69 | ;; | |
70 | --libs) | |
71 | echo_libs=yes | |
72 | ;; | |
73 | ssl) | |
74 | lib_ssl=yes | |
75 | ;; | |
76 | smime) | |
77 | lib_smime=yes | |
78 | ;; | |
79 | nss) | |
80 | lib_nss=yes | |
81 | ;; | |
82 | *) | |
83 | usage 1 1>&2 | |
84 | ;; | |
85 | esac | |
86 | shift | |
87 | done | |
88 | ||
89 | # Set variables that may be dependent upon other variables | |
90 | if test -z "$exec_prefix"; then | |
628fee90 | 91 | exec_prefix=@exec_prefix@ |
a91d5515 ER |
92 | fi |
93 | if test -z "$includedir"; then | |
628fee90 | 94 | includedir=@includedir@ |
a91d5515 ER |
95 | fi |
96 | if test -z "$libdir"; then | |
628fee90 | 97 | libdir=@libdir@ |
a91d5515 ER |
98 | fi |
99 | ||
100 | if test "$echo_prefix" = "yes"; then | |
101 | echo $prefix | |
102 | fi | |
103 | ||
104 | if test "$echo_exec_prefix" = "yes"; then | |
105 | echo $exec_prefix | |
106 | fi | |
107 | ||
108 | if test "$echo_includedir" = "yes"; then | |
109 | echo $includedir | |
110 | fi | |
111 | ||
112 | if test "$echo_libdir" = "yes"; then | |
113 | echo $libdir | |
114 | fi | |
115 | ||
116 | if test "$echo_cflags" = "yes"; then | |
117 | echo -I$includedir | |
118 | fi | |
119 | ||
120 | if test "$echo_libs" = "yes"; then | |
a91d5515 ER |
121 | if test -n "$lib_ssl"; then |
122 | libdirs="$libdirs -lssl${major_version}" | |
123 | fi | |
124 | if test -n "$lib_smime"; then | |
125 | libdirs="$libdirs -lsmime${major_version}" | |
126 | fi | |
127 | if test -n "$lib_nss"; then | |
128 | libdirs="$libdirs -lnss${major_version}" | |
129 | fi | |
130 | echo $libdirs | |
131 | fi | |
132 |