|
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/. |
|
5 |
|
6 |
|
7 prefix=@prefix@ |
|
8 |
|
9 major_version=@MOD_MAJOR_VERSION@ |
|
10 minor_version=@MOD_MINOR_VERSION@ |
|
11 patch_version=@MOD_PATCH_VERSION@ |
|
12 |
|
13 usage() |
|
14 { |
|
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 |
|
31 } |
|
32 |
|
33 if test $# -eq 0; then |
|
34 usage 1 1>&2 |
|
35 fi |
|
36 |
|
37 lib_nspr=yes |
|
38 lib_plc=yes |
|
39 lib_plds=yes |
|
40 |
|
41 while test $# -gt 0; do |
|
42 case "$1" in |
|
43 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
|
44 *) optarg= ;; |
|
45 esac |
|
46 |
|
47 case $1 in |
|
48 --prefix=*) |
|
49 prefix=$optarg |
|
50 ;; |
|
51 --prefix) |
|
52 echo_prefix=yes |
|
53 ;; |
|
54 --exec-prefix=*) |
|
55 exec_prefix=$optarg |
|
56 ;; |
|
57 --exec-prefix) |
|
58 echo_exec_prefix=yes |
|
59 ;; |
|
60 --includedir=*) |
|
61 includedir=$optarg |
|
62 ;; |
|
63 --includedir) |
|
64 echo_includedir=yes |
|
65 ;; |
|
66 --libdir=*) |
|
67 libdir=$optarg |
|
68 ;; |
|
69 --libdir) |
|
70 echo_libdir=yes |
|
71 ;; |
|
72 --version) |
|
73 echo ${major_version}.${minor_version}.${patch_version} |
|
74 ;; |
|
75 --cflags) |
|
76 echo_cflags=yes |
|
77 ;; |
|
78 --libs) |
|
79 echo_libs=yes |
|
80 ;; |
|
81 nspr) |
|
82 lib_nspr=yes |
|
83 ;; |
|
84 plc) |
|
85 lib_plc=yes |
|
86 ;; |
|
87 plds) |
|
88 lib_plds=yes |
|
89 ;; |
|
90 *) |
|
91 usage 1 1>&2 |
|
92 ;; |
|
93 esac |
|
94 shift |
|
95 done |
|
96 |
|
97 # Set variables that may be dependent upon other variables |
|
98 if test -z "$exec_prefix"; then |
|
99 exec_prefix=@exec_prefix@ |
|
100 fi |
|
101 if test -z "$includedir"; then |
|
102 includedir=@includedir@ |
|
103 fi |
|
104 if test -z "$libdir"; then |
|
105 libdir=@libdir@ |
|
106 fi |
|
107 |
|
108 if test "$echo_prefix" = "yes"; then |
|
109 echo $prefix |
|
110 fi |
|
111 |
|
112 if test "$echo_exec_prefix" = "yes"; then |
|
113 echo $exec_prefix |
|
114 fi |
|
115 |
|
116 if test "$echo_includedir" = "yes"; then |
|
117 echo $includedir |
|
118 fi |
|
119 |
|
120 if test "$echo_libdir" = "yes"; then |
|
121 echo $libdir |
|
122 fi |
|
123 |
|
124 if test "$echo_cflags" = "yes"; then |
|
125 echo -I$includedir |
|
126 fi |
|
127 |
|
128 if test "$echo_libs" = "yes"; then |
|
129 libdirs=-L$libdir |
|
130 if test -n "$lib_plds"; then |
|
131 libdirs="$libdirs -lplds${major_version}" |
|
132 fi |
|
133 if test -n "$lib_plc"; then |
|
134 libdirs="$libdirs -lplc${major_version}" |
|
135 fi |
|
136 if test -n "$lib_nspr"; then |
|
137 libdirs="$libdirs -lnspr${major_version}" |
|
138 fi |
|
139 os_ldflags="@LDFLAGS@" |
|
140 for i in $os_ldflags ; do |
|
141 if echo $i | grep \^-L >/dev/null; then |
|
142 libdirs="$libdirs $i" |
|
143 fi |
|
144 done |
|
145 echo $libdirs @OS_LIBS@ |
|
146 fi |
|
147 |