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