Bug 1731343 [wpt PR 30843] - Add README.md to wpt/webtransport, a=testonly
[gecko.git] / nsprpub / config / nspr-config.in
blob2cb62a0f986e1e6886399a185ac7e25cbb3194ff
1 #!/bin/sh
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 prefix=@prefix@
9 major_version=@MOD_MAJOR_VERSION@
10 minor_version=@MOD_MINOR_VERSION@
11 patch_version=@MOD_PATCH_VERSION@
13 usage()
15 cat <<EOF
16 Usage: nspr-config [OPTIONS] [LIBRARIES]
17 Options:
18 [--prefix[=DIR]]
19 [--exec-prefix[=DIR]]
20 [--includedir[=DIR]]
21 [--libdir[=DIR]]
22 [--version]
23 [--libs]
24 [--cflags]
25 Libraries:
26 nspr
27 plc
28 plds
29 EOF
30 exit $1
33 if test $# -eq 0; then
34 usage 1 1>&2
37 lib_nspr=yes
38 lib_plc=yes
39 lib_plds=yes
41 while test $# -gt 0; do
42 case "$1" in
43 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
44 *) optarg= ;;
45 esac
47 case $1 in
48 --prefix=*)
49 prefix=$optarg
51 --prefix)
52 echo_prefix=yes
54 --exec-prefix=*)
55 exec_prefix=$optarg
57 --exec-prefix)
58 echo_exec_prefix=yes
60 --includedir=*)
61 includedir=$optarg
63 --includedir)
64 echo_includedir=yes
66 --libdir=*)
67 libdir=$optarg
69 --libdir)
70 echo_libdir=yes
72 --version)
73 echo ${major_version}.${minor_version}.${patch_version}
75 --cflags)
76 echo_cflags=yes
78 --libs)
79 echo_libs=yes
81 nspr)
82 lib_nspr=yes
84 plc)
85 lib_plc=yes
87 plds)
88 lib_plds=yes
91 usage 1 1>&2
93 esac
94 shift
95 done
97 # Set variables that may be dependent upon other variables
98 if test -z "$exec_prefix"; then
99 exec_prefix=@exec_prefix@
101 if test -z "$includedir"; then
102 includedir=@includedir@
104 if test -z "$libdir"; then
105 libdir=@libdir@
108 if test "$echo_prefix" = "yes"; then
109 echo $prefix
112 if test "$echo_exec_prefix" = "yes"; then
113 echo $exec_prefix
116 if test "$echo_includedir" = "yes"; then
117 echo $includedir
120 if test "$echo_libdir" = "yes"; then
121 echo $libdir
124 if test "$echo_cflags" = "yes"; then
125 echo -I$includedir
128 if test "$echo_libs" = "yes"; then
129 libdirs=-L$libdir
130 if test -n "$lib_plds"; then
131 libdirs="$libdirs -lplds${major_version}"
133 if test -n "$lib_plc"; then
134 libdirs="$libdirs -lplc${major_version}"
136 if test -n "$lib_nspr"; then
137 libdirs="$libdirs -lnspr${major_version}"
139 os_ldflags="@LDFLAGS@"
140 for i in $os_ldflags ; do
141 if echo $i | grep \^-L >/dev/null; then
142 libdirs="$libdirs $i"
144 done
145 echo $libdirs @OS_LIBS@