* updated knights (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / security / nss / nss-config.in
blobbde873f7af957fee609145f1d6c0eb87d5e8af25
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
3
4 # T2 SDE: package/.../nss/nss-config.in
5 # Copyright (C) 2008 - 2020 The T2 SDE Project
6
7 # More information can be found in the files COPYING and README.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 prefix=@prefix@
17 major_version=@MOD_MAJOR_VERSION@
18 minor_version=@MOD_MINOR_VERSION@
19 patch_version=@MOD_PATCH_VERSION@
21 usage()
23         cat <<EOF
24 Usage: nss-config [OPTIONS] [LIBRARIES]
25 Options:
26         [--prefix[=DIR]]
27         [--exec-prefix[=DIR]]
28         [--includedir[=DIR]]
29         [--libdir[=DIR]]
30         [--version]
31         [--libs]
32         [--cflags]
33 Dynamic Libraries:
34         nss
35         ssl
36         smime
37         nssutil
38 EOF
39         exit $1
42 if test $# -eq 0; then
43         usage 1 1>&2
46 lib_ssl=yes
47 lib_smime=yes
48 lib_nss=yes
49 lib_nssutil=yes
51 while test $# -gt 0; do
52   case "$1" in
53   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
54   *) optarg= ;;
55   esac
57   case $1 in
58     --prefix=*)
59       prefix=$optarg
60       ;;
61     --prefix)
62       echo_prefix=yes
63       ;;
64     --exec-prefix=*)
65       exec_prefix=$optarg
66       ;;
67     --exec-prefix)
68       echo_exec_prefix=yes
69       ;;
70     --includedir=*)
71       includedir=$optarg
72       ;;
73     --includedir)
74       echo_includedir=yes
75       ;;
76     --libdir=*)
77       libdir=$optarg
78       ;;
79     --libdir)
80       echo_libdir=yes
81       ;;
82     --version)
83       echo ${major_version}.${minor_version}.${patch_version}
84       ;;
85     --cflags)
86       echo_cflags=yes
87       ;;
88     --libs)
89       echo_libs=yes
90       ;;
91     ssl)
92       lib_ssl=yes
93       ;;
94     smime)
95       lib_smime=yes
96       ;;
97     nss)
98       lib_nss=yes
99       ;;
100     nssutil)
101       lib_nssutil=yes
102       ;;
103     *)
104       usage 1 1>&2
105       ;;
106   esac
107   shift
108 done
110 # Set variables that may be dependent upon other variables
111 if test -z "$exec_prefix"; then
112     exec_prefix=@exec_prefix@
114 if test -z "$includedir"; then
115     includedir=@includedir@
117 if test -z "$libdir"; then
118     libdir=@libdir@
121 if test "$echo_prefix" = "yes"; then
122     echo $prefix
125 if test "$echo_exec_prefix" = "yes"; then
126     echo $exec_prefix
129 if test "$echo_includedir" = "yes"; then
130     echo $includedir
133 if test "$echo_libdir" = "yes"; then
134     echo $libdir
137 if test "$echo_cflags" = "yes"; then
138     echo -I$includedir
141 if test "$echo_libs" = "yes"; then
142       libdirs="-Wl,-R$libdir -L$libdir"
143       if test -n "$lib_ssl"; then
144         libdirs="$libdirs -lssl${major_version}"
145       fi
146       if test -n "$lib_smime"; then
147         libdirs="$libdirs -lsmime${major_version}"
148       fi
149       if test -n "$lib_nss"; then
150         libdirs="$libdirs -lnss${major_version}"
151       fi
152       if test -n "$lib_nssutil"; then
153         libdirs="$libdirs -lnssutil${major_version}"
154       fi
155       echo $libdirs