nss: import at 3.0.1 beta 1
[mozilla-nss.git] / security / nss / cmd / platlibs.mk
blob1b2e8e829f17144e026b9e1c08c2405ed6ffb9b5
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
13 # License.
15 # The Original Code is the Netscape security libraries.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1994-2000
20 # the Initial Developer. All Rights Reserved.
22 # Contributor(s):
24 # Alternatively, the contents of this file may be used under the terms of
25 # either the GNU General Public License Version 2 or later (the "GPL"), or
26 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
38 # set RPATH-type linker instructions here so they can be used in the shared
39 # version and in the mixed (static nss libs/shared NSPR libs) version.
41 ifeq ($(OS_ARCH), SunOS)
42 ifeq ($(BUILD_SUN_PKG), 1)
43 ifeq ($(USE_64), 1)
44 EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
45 else
46 EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
47 endif
48 else
49 EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib'
50 endif
51 endif
53 ifeq ($(OS_ARCH), Linux)
54 ifeq ($(USE_64), 1)
55 EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:$$ORIGIN/../lib'
56 else
57 EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib'
58 endif
59 endif
61 ifeq ($(OS_ARCH), HP-UX)
62 ifeq ($(OS_TEST), ia64)
63 EXTRA_SHARED_LIBS += -Wl,+b,'$$ORIGIN/../lib'
64 else
65 # pa-risc
66 ifeq ($(USE_64), 1)
67 EXTRA_SHARED_LIBS += \
68 -Wl,+b,'$$ORIGIN/../../lib/pa20_64:$$ORIGIN/../../lib/64:$$ORIGIN/../lib'
69 else
70 EXTRA_SHARED_LIBS += -Wl,+b,'$$ORIGIN/../lib'
71 endif
72 endif
73 endif
75 SQLITE=-lsqlite3
77 ifdef USE_STATIC_LIBS
79 # can't do this in manifest.mn because OS_ARCH isn't defined there.
80 ifeq ($(OS_ARCH), WINNT)
82 DEFINES += -DNSS_USE_STATIC_LIBS
83 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
84 CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
85 ifdef MOZILLA_SECURITY_BUILD
86 CRYPTOLIB=$(DIST)/lib/crypto.lib
87 endif
88 ifdef MOZILLA_BSAFE_BUILD
89 CRYPTOLIB+=$(DIST)/lib/bsafe$(BSAFEVER).lib
90 CRYPTOLIB+=$(DIST)/lib/freebl.lib
91 endif
93 PKIXLIB = \
94 $(DIST)/lib/$(LIB_PREFIX)pkixcertsel.$(LIB_SUFFIX) \
95 $(DIST)/lib/$(LIB_PREFIX)pkixchecker.$(LIB_SUFFIX) \
96 $(DIST)/lib/$(LIB_PREFIX)pkixparams.$(LIB_SUFFIX) \
97 $(DIST)/lib/$(LIB_PREFIX)pkixresults.$(LIB_SUFFIX) \
98 $(DIST)/lib/$(LIB_PREFIX)pkixtop.$(LIB_SUFFIX) \
99 $(DIST)/lib/$(LIB_PREFIX)pkixutil.$(LIB_SUFFIX) \
100 $(DIST)/lib/$(LIB_PREFIX)pkixcrlsel.$(LIB_SUFFIX) \
101 $(DIST)/lib/$(LIB_PREFIX)pkixstore.$(LIB_SUFFIX) \
102 $(DIST)/lib/$(LIB_PREFIX)pkixpki.$(LIB_SUFFIX) \
103 $(DIST)/lib/$(LIB_PREFIX)pkixsystem.$(LIB_SUFFIX) \
104 $(DIST)/lib/$(LIB_PREFIX)pkixmodule.$(LIB_SUFFIX)
106 EXTRA_LIBS += \
107 $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
108 $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
109 $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
110 $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
111 $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
112 $(DIST)/lib/$(LIB_PREFIX)pkcs12.$(LIB_SUFFIX) \
113 $(DIST)/lib/$(LIB_PREFIX)pkcs7.$(LIB_SUFFIX) \
114 $(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
115 $(DIST)/lib/$(LIB_PREFIX)cryptohi.$(LIB_SUFFIX) \
116 $(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
117 $(DIST)/lib/$(LIB_PREFIX)certdb.$(LIB_SUFFIX) \
118 $(DIST)/lib/$(LIB_PREFIX)softokn.$(LIB_SUFFIX) \
119 $(CRYPTOLIB) \
120 $(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
121 $(DIST)/lib/$(LIB_PREFIX)nsspki.$(LIB_SUFFIX) \
122 $(DIST)/lib/$(LIB_PREFIX)nssdev.$(LIB_SUFFIX) \
123 $(DIST)/lib/$(LIB_PREFIX)nssb.$(LIB_SUFFIX) \
124 $(PKIXLIB) \
125 $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) \
126 $(DIST)/lib/$(LIB_PREFIX)sqlite3.$(LIB_SUFFIX) \
127 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(LIB_SUFFIX) \
128 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(LIB_SUFFIX) \
129 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(LIB_SUFFIX) \
130 $(NULL)
132 # $(PROGRAM) has NO explicit dependencies on $(OS_LIBS)
133 #OS_LIBS += \
134 wsock32.lib \
135 winmm.lib \
136 $(NULL)
137 else
139 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
140 CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
141 ifdef MOZILLA_SECURITY_BUILD
142 CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)crypto.$(LIB_SUFFIX)
143 endif
144 ifdef MOZILLA_BSAFE_BUILD
145 CRYPTOLIB+=$(DIST)/lib/$(LIB_PREFIX)bsafe.$(LIB_SUFFIX)
146 CRYPTOLIB+=$(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
147 endif
149 PKIXLIB = \
150 $(DIST)/lib/$(LIB_PREFIX)pkixtop.$(LIB_SUFFIX) \
151 $(DIST)/lib/$(LIB_PREFIX)pkixutil.$(LIB_SUFFIX) \
152 $(DIST)/lib/$(LIB_PREFIX)pkixsystem.$(LIB_SUFFIX) \
153 $(DIST)/lib/$(LIB_PREFIX)pkixcrlsel.$(LIB_SUFFIX) \
154 $(DIST)/lib/$(LIB_PREFIX)pkixmodule.$(LIB_SUFFIX) \
155 $(DIST)/lib/$(LIB_PREFIX)pkixstore.$(LIB_SUFFIX) \
156 $(DIST)/lib/$(LIB_PREFIX)pkixparams.$(LIB_SUFFIX) \
157 $(DIST)/lib/$(LIB_PREFIX)pkixchecker.$(LIB_SUFFIX) \
158 $(DIST)/lib/$(LIB_PREFIX)pkixpki.$(LIB_SUFFIX) \
159 $(DIST)/lib/$(LIB_PREFIX)pkixtop.$(LIB_SUFFIX) \
160 $(DIST)/lib/$(LIB_PREFIX)pkixresults.$(LIB_SUFFIX) \
161 $(DIST)/lib/$(LIB_PREFIX)pkixcertsel.$(LIB_SUFFIX)
163 EXTRA_LIBS += \
164 $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
165 $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
166 $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
167 $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
168 $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
169 $(DIST)/lib/$(LIB_PREFIX)pkcs12.$(LIB_SUFFIX) \
170 $(DIST)/lib/$(LIB_PREFIX)pkcs7.$(LIB_SUFFIX) \
171 $(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
172 $(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
173 $(DIST)/lib/$(LIB_PREFIX)cryptohi.$(LIB_SUFFIX) \
174 $(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
175 $(DIST)/lib/$(LIB_PREFIX)nsspki.$(LIB_SUFFIX) \
176 $(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
177 $(DIST)/lib/$(LIB_PREFIX)softokn.$(LIB_SUFFIX) \
178 $(DIST)/lib/$(LIB_PREFIX)certdb.$(LIB_SUFFIX) \
179 $(DIST)/lib/$(LIB_PREFIX)nsspki.$(LIB_SUFFIX) \
180 $(DIST)/lib/$(LIB_PREFIX)nssdev.$(LIB_SUFFIX) \
181 $(DIST)/lib/$(LIB_PREFIX)nssb.$(LIB_SUFFIX) \
182 $(CRYPTOLIB) \
183 $(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
184 $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) \
185 $(PKIXLIB) \
186 $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
187 $(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
188 $(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
189 $(NULL)
191 ifeq ($(OS_ARCH), AIX)
192 EXTRA_SHARED_LIBS += -brtl
193 endif
195 # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
196 # $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
197 EXTRA_SHARED_LIBS += \
198 -L$(DIST)/lib \
199 $(SQLITE) \
200 -L$(NSPR_LIB_DIR) \
201 -lplc4 \
202 -lplds4 \
203 -lnspr4 \
204 $(NULL)
205 endif
207 ifeq ($(OS_TARGET), SunOS)
208 OS_LIBS += -lbsm
209 endif
211 else # USE_STATIC_LIBS
212 # can't do this in manifest.mn because OS_ARCH isn't defined there.
213 ifeq ($(OS_ARCH), WINNT)
215 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
216 EXTRA_LIBS += \
217 $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
218 $(DIST)/lib/$(IMPORT_LIB_PREFIX)nssutil3$(IMPORT_LIB_SUFFIX) \
219 $(DIST)/lib/$(IMPORT_LIB_PREFIX)smime3$(IMPORT_LIB_SUFFIX) \
220 $(DIST)/lib/$(IMPORT_LIB_PREFIX)ssl3$(IMPORT_LIB_SUFFIX) \
221 $(DIST)/lib/$(IMPORT_LIB_PREFIX)nss3$(IMPORT_LIB_SUFFIX) \
222 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4$(IMPORT_LIB_SUFFIX) \
223 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4$(IMPORT_LIB_SUFFIX) \
224 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4$(IMPORT_LIB_SUFFIX) \
225 $(NULL)
227 # $(PROGRAM) has NO explicit dependencies on $(OS_LIBS)
228 #OS_LIBS += \
229 wsock32.lib \
230 winmm.lib \
231 $(NULL)
232 else
234 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
235 EXTRA_LIBS += \
236 $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
237 $(NULL)
239 ifeq ($(OS_ARCH), AIX)
240 EXTRA_SHARED_LIBS += -brtl
241 endif
243 # If GNU ld is used, we must use the -rpath-link option to tell
244 # the linker where to find libsoftokn3.so, an implicit dependency
245 # of libnss3.so.
246 ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD, $(OS_ARCH)))
247 EXTRA_SHARED_LIBS += -Wl,-rpath-link,$(DIST)/lib
248 endif
250 ifeq ($(OS_ARCH), SunOS)
251 ifdef NS_USE_GCC
252 ifdef GCC_USE_GNU_LD
253 EXTRA_SHARED_LIBS += -Wl,-rpath-link,$(DIST)/lib
254 endif
255 endif
256 endif
258 ifeq ($(OS_ARCH), Darwin)
259 EXTRA_SHARED_LIBS += -dylib_file @executable_path/libsoftokn3.dylib:$(DIST)/lib/libsoftokn3.dylib
260 endif
263 # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
264 # $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
265 EXTRA_SHARED_LIBS += \
266 -L$(DIST)/lib \
267 -lssl3 \
268 -lsmime3 \
269 -lnss3 \
270 -lnssutil3 \
271 -L$(NSPR_LIB_DIR) \
272 -lplc4 \
273 -lplds4 \
274 -lnspr4 \
275 $(NULL)
276 endif
278 endif # USE_STATIC_LIBS
280 # If a platform has a system zlib, set USE_SYSTEM_ZLIB to 1 and
281 # ZLIB_LIBS to the linker command-line arguments for the system zlib
282 # (for example, -lz) in the platform's config file in coreconf.
283 ifndef USE_SYSTEM_ZLIB
284 ZLIB_LIBS = $(DIST)/lib/$(LIB_PREFIX)zlib.$(LIB_SUFFIX)
285 endif
287 JAR_LIBS = $(DIST)/lib/$(LIB_PREFIX)jar.$(LIB_SUFFIX) \
288 $(ZLIB_LIBS) \
289 $(NULL)