Bug 452390 Tracemonkey will crash if the compiler doesn't have FASTCALL r=danderson
[wine-gecko.git] / security / manager / Makefile.in
blob3d313b3462359bcec8c942fe730aa04648e2bd82
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 mozilla.org code.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1998
20 # the Initial Developer. All Rights Reserved.
22 # Contributor(s):
23 # Brian Ryner <bryner@brianryner.com>
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
39 DEPTH = ../..
40 topsrcdir = @top_srcdir@
41 srcdir = @srcdir@
42 VPATH = @srcdir@
44 include $(DEPTH)/config/autoconf.mk
46 MODULE = psm
48 ifndef MOZ_NATIVE_NSS
49 LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX)
50 endif
52 NSS3_LIB = $(DLL_PREFIX)nss3$(DLL_SUFFIX)
53 NSSUTIL3_LIB = $(DLL_PREFIX)nssutil3$(DLL_SUFFIX)
54 SMIME3_LIB = $(DLL_PREFIX)smime3$(DLL_SUFFIX)
55 SSL3_LIB = $(DLL_PREFIX)ssl3$(DLL_SUFFIX)
56 SOFTOKEN3_LIB = $(DLL_PREFIX)softokn3$(DLL_SUFFIX)
57 SOFTOKEN3_CHK = $(DLL_PREFIX)softokn3.chk
58 NSSDBM3_LIB = $(DLL_PREFIX)nssdbm3$(DLL_SUFFIX)
60 ifndef MOZ_NATIVE_NSS
61 ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
62 SDK_LIBS = \
63 $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
64 $(DIST)/lib/$(LIB_PREFIX)smime3.$(IMPORT_LIB_SUFFIX) \
65 $(DIST)/lib/$(LIB_PREFIX)ssl3.$(IMPORT_LIB_SUFFIX) \
66 $(DIST)/lib/$(LIB_PREFIX)nss3.$(IMPORT_LIB_SUFFIX) \
67 $(DIST)/lib/$(LIB_PREFIX)nssutil3.$(IMPORT_LIB_SUFFIX) \
68 $(DIST)/lib/$(LIB_PREFIX)softokn3.$(IMPORT_LIB_SUFFIX) \
69 $(NULL)
70 else
71 SDK_LIBS = \
72 $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
73 $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
74 $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
75 $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
76 $(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
77 $(DIST)/lib/$(LIB_PREFIX)softokn.$(LIB_SUFFIX) \
78 $(NULL)
79 endif
80 endif
82 # Default
83 HAVE_FREEBL_LIBS = 1
85 # 32-bit HP-UX PA-RISC
86 ifeq ($(OS_ARCH), HP-UX)
87 ifneq ($(OS_TEST), ia64)
88 ifndef HAVE_64BIT_OS
89 HAVE_FREEBL_LIBS =
90 HAVE_FREEBL_LIBS_32 = 1
91 endif
92 endif
93 endif
95 # SunOS SPARC
96 ifeq ($(OS_ARCH), SunOS)
97 ifneq (86,$(findstring 86,$(OS_TEST)))
98 ifdef HAVE_64BIT_OS
99 HAVE_FREEBL_LIBS =
100 HAVE_FREEBL_LIBS_64 = 1
101 else
102 HAVE_FREEBL_LIBS =
103 HAVE_FREEBL_LIBS_32 = 1
104 HAVE_FREEBL_LIBS_32INT64 = 1
105 endif
106 endif
107 endif
109 ifdef HAVE_FREEBL_LIBS
110 FREEBL_LIB = $(DLL_PREFIX)freebl3$(DLL_SUFFIX)
111 FREEBL_CHK = $(DLL_PREFIX)freebl3.chk
112 endif
113 ifdef HAVE_FREEBL_LIBS_32
114 FREEBL_32INT_LIB = libfreebl_32int_3$(DLL_SUFFIX)
115 FREEBL_32INT_CHK = libfreebl_32int_3.chk
116 FREEBL_32FPU_LIB = libfreebl_32fpu_3$(DLL_SUFFIX)
117 FREEBL_32FPU_CHK = libfreebl_32fpu_3.chk
118 endif
119 ifdef HAVE_FREEBL_LIBS_32INT64
120 FREEBL_32INT64_LIB = libfreebl_32int64_3$(DLL_SUFFIX)
121 FREEBL_32INT64_CHK = libfreebl_32int64_3.chk
122 endif
123 ifdef HAVE_FREEBL_LIBS_64
124 FREEBL_64INT_LIB = libfreebl_64int_3$(DLL_SUFFIX)
125 FREEBL_64INT_CHK = libfreebl_64int_3.chk
126 FREEBL_64FPU_LIB = libfreebl_64fpu_3$(DLL_SUFFIX)
127 FREEBL_64FPU_CHK = libfreebl_64fpu_3.chk
128 endif
130 ABS_DIST := $(shell cd $(DIST) && pwd)
131 ifeq ($(HOST_OS_ARCH),WINNT)
132 ifdef CYGDRIVE_MOUNT
133 ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
134 endif
135 ifneq (,$(filter mingw%,$(host_os)))
136 ABS_DIST := $(shell cd $(DIST) && pwd -W)
137 endif
138 endif
139 NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
140 ifneq (,$(strip $(NSPR_INCLUDE_DIR)))
141 NSPR_INCLUDE_DIR := $(subst -I,,$(subst -I$(DIST),-I$(ABS_DIST),$(NSPR_INCLUDE_DIR)))
142 else
143 NSPR_INCLUDE_DIR = $(ABS_DIST)/include/nspr
144 endif
145 NSPR_LIB_DIR = $(firstword $(filter -L%,$(NSPR_LIBS)))
146 ifneq (,$(strip $(NSPR_LIB_DIR)))
147 NSPR_LIB_DIR := $(subst -L,,$(subst -L$(DIST),-L$(ABS_DIST),$(NSPR_LIB_DIR)))
148 else
149 NSPR_LIB_DIR = $(ABS_DIST)/lib
150 endif
151 # Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides
152 # definitions in NSS, so just export it into the sub-make's environment.
153 ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_MEMORY))
154 export DLLFLAGS
155 endif
156 # NSS makefiles are not safe for parallel execution.
157 DEFAULT_GMAKE_FLAGS = MAKE="$(MAKE) -j1" -j1
158 DEFAULT_GMAKE_FLAGS += CC="$(CC)"
159 DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(ABS_DIST)
160 DEFAULT_GMAKE_FLAGS += DIST=$(ABS_DIST)
161 DEFAULT_GMAKE_FLAGS += NSPR_INCLUDE_DIR=$(NSPR_INCLUDE_DIR)
162 DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR)
163 DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
164 DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
165 DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1
166 ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
167 ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
168 DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
169 endif
170 ifndef MOZ_DEBUG
171 DEFAULT_GMAKE_FLAGS += BUILD_OPT=1 OPT_CODE_SIZE=1
172 endif
173 ifdef GNU_CC
174 DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1 NS_USE_NATIVE=
175 else
176 DEFAULT_GMAKE_FLAGS += NS_USE_GCC= NS_USE_NATIVE=1
177 endif
178 ifdef USE_N32
179 # It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS
180 # merely adds _PTH to coreconf's OBJDIR name.
181 DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1
182 endif
183 ifdef HAVE_64BIT_OS
184 DEFAULT_GMAKE_FLAGS += USE_64=1
185 endif
186 ifeq ($(OS_ARCH),WINNT)
187 DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
188 ifdef MOZ_DEBUG
189 ifndef MOZ_NO_DEBUG_RTL
190 DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
191 endif
192 endif
193 endif # WINNT
194 ifeq ($(OS_ARCH),OS2)
195 ifdef MOZ_OS2_HIGH_MEMORY
196 DEFAULT_GMAKE_FLAGS += MOZ_OS2_HIGH_MEMORY=1
197 endif
198 endif # OS2
199 # OS_CFLAGS needs to be passed on down.
200 ifeq ($(OS_ARCH),OpenVMS)
201 DEFAULT_GMAKE_FLAGS += XCFLAGS="$(OS_CFLAGS)"
202 endif
203 ifeq ($(OS_ARCH),Darwin)
204 # Make nsinstall use absolute symlinks by default when building NSS
205 # for Mozilla on Mac OS X. (Bugzilla bug 193164)
206 ifndef NSDISTMODE
207 DEFAULT_GMAKE_FLAGS += NSDISTMODE=absolute_symlink
208 endif
209 ifdef MACOS_SDK_DIR
210 DEFAULT_GMAKE_FLAGS += MACOS_SDK_DIR=$(MACOS_SDK_DIR)
211 endif
212 endif
213 ifdef CROSS_COMPILE
214 DEFAULT_GMAKE_FLAGS += \
215 NSINSTALL="$(NSINSTALL)" \
216 NATIVE_CC="$(HOST_CC)" \
217 CC="$(CC)" \
218 CCC="$(CXX)" \
219 LINK="$(LD)" \
220 AS="$(AS)" \
221 AR='$(AR) $(AR_FLAGS:$@=$$@)' \
222 RANLIB="$(RANLIB)" \
223 RC="$(RC) $(RCFLAGS)" \
224 OS_ARCH="$(OS_ARCH)" \
225 OS_TEST="$(OS_TEST)" \
226 CPU_ARCH="$(TARGET_CPU)" \
227 $(NULL)
228 SKIP_CHK=1
229 endif
230 SUBMAKEFILES = boot/Makefile ssl/Makefile pki/Makefile locales/Makefile
232 include $(topsrcdir)/config/rules.mk
234 # Attempt to properly handle NSS' refusal to implement a dependency system
235 export:: .nss.cleaned
237 .nss.cleaned: .nss.checkout
238 ifndef MOZ_NATIVE_NSS
239 $(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
240 $(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
241 ifndef SKIP_CHK
242 $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
243 $(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
244 endif
245 touch $@
246 endif
248 GARBAGE += .nss.cleaned
250 .nss.checkout:
251 ifndef MOZ_NATIVE_NSS
252 touch $(srcdir)/$@
253 endif
255 dependclean export packages chrome::
256 $(MAKE) -C boot $@
257 $(MAKE) -C ssl $@
258 $(MAKE) -C locales $@
259 ifdef MOZ_XUL
260 $(MAKE) -C pki $@
261 endif
263 libs::
264 ifndef MOZ_NATIVE_NSS
265 $(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
266 $(MAKE) -C $(topsrcdir)/security/dbm $(DEFAULT_GMAKE_FLAGS)
267 $(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
268 ifdef ENABLE_TESTS
269 # Need certutil binary for mochitest certificates generation
270 $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
271 $(MAKE) -C $(topsrcdir)/security/nss/cmd/certutil $(DEFAULT_GMAKE_FLAGS)
272 $(MAKE) -C $(topsrcdir)/security/nss/cmd/pk12util $(DEFAULT_GMAKE_FLAGS)
273 endif
274 ifndef SKIP_CHK
275 ifndef ENABLE_TESTS # Just avoid secondary compile
276 $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
277 endif
278 $(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS)
279 endif
280 $(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin
281 ifndef SKIP_CHK
282 $(INSTALL) -m 644 $(DIST)/lib/$(SOFTOKEN3_CHK) $(DIST)/bin
283 endif
284 $(INSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
285 $(INSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DIST)/bin
286 $(INSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DIST)/bin
287 $(INSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DIST)/bin
288 $(INSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DIST)/bin
289 $(INSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DIST)/bin
290 $(INSTALL) -m 755 $(SDK_LIBS) $(DIST)/sdk/lib
291 ifdef HAVE_FREEBL_LIBS
292 ifndef SKIP_CHK
293 $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_CHK) $(DIST)/bin
294 endif
295 $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DIST)/bin
296 endif
297 ifdef HAVE_FREEBL_LIBS_32
298 ifndef SKIP_CHK
299 $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT_CHK) $(DIST)/bin
300 $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_32FPU_CHK) $(DIST)/bin
301 endif
302 $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DIST)/bin
303 $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DIST)/bin
304 endif
305 ifdef HAVE_FREEBL_LIBS_32INT64
306 ifndef SKIP_CHK
307 $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT64_CHK) $(DIST)/bin
308 endif
309 $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DIST)/bin
310 endif
311 ifdef HAVE_FREEBL_LIBS_64
312 ifndef SKIP_CHK
313 $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_64INT_CHK) $(DIST)/bin
314 $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_64FPU_CHK) $(DIST)/bin
315 endif
316 $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DIST)/bin
317 $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DIST)/bin
318 endif
319 endif
320 ifndef MOZ_NATIVE_NSS
321 # NSS installs headers to dist/public and we want them in dist/include
322 $(NSINSTALL) -D $(DIST)/include/nss
323 (cd $(DIST)/public/nss && tar $(TAR_CREATE_FLAGS) - .) | \
324 (cd $(DIST)/include/nss && tar -xf -)
325 (cd $(DIST)/public/nss && tar $(TAR_CREATE_FLAGS) - .) | \
326 (cd $(DIST)/sdk/include && tar -xf -)
327 endif
328 $(MAKE) -C boot $@
329 $(MAKE) -C ssl $@
330 $(MAKE) -C locales $@
331 ifdef MOZ_XUL
332 $(MAKE) -C pki $@
333 endif
335 check::
336 $(MAKE) -C ssl $@
338 install::
339 ifndef MOZ_NATIVE_NSS
340 $(SYSINSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DESTDIR)$(mozappdir)
341 ifndef SKIP_CHK
342 $(SYSINSTALL) -m 644 $(DIST)/lib/$(SOFTOKEN3_CHK) $(DESTDIR)$(mozappdir)
343 endif
344 $(SYSINSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DESTDIR)$(mozappdir)
345 $(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DESTDIR)$(mozappdir)
346 $(SYSINSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DESTDIR)$(mozappdir)
347 $(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DESTDIR)$(mozappdir)
348 $(SYSINSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DESTDIR)$(mozappdir)
349 $(SYSINSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DESTDIR)$(mozappdir)
350 ifdef HAVE_FREEBL_LIBS
351 ifndef SKIP_CHK
352 $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_CHK) $(DESTDIR)$(mozappdir)
353 endif
354 $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DESTDIR)$(mozappdir)
355 endif
356 ifdef HAVE_FREEBL_LIBS_32
357 ifndef SKIP_CHK
358 $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT_CHK) $(DESTDIR)$(mozappdir)
359 $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_32FPU_CHK) $(DESTDIR)$(mozappdir)
360 endif
361 $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DESTDIR)$(mozappdir)
362 $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DESTDIR)$(mozappdir)
363 endif
364 ifdef HAVE_FREEBL_LIBS_32INT64
365 ifndef SKIP_CHK
366 $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT64_CHK) $(DESTDIR)$(mozappdir)
367 endif
368 $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DESTDIR)$(mozappdir)
369 endif
370 ifdef HAVE_FREEBL_LIBS_64
371 ifndef SKIP_CHK
372 $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_64INT_CHK) $(DESTDIR)$(mozappdir)
373 $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_64FPU_CHK) $(DESTDIR)$(mozappdir)
374 endif
375 $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DESTDIR)$(mozappdir)
376 $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DESTDIR)$(mozappdir)
377 endif
378 endif
379 $(MAKE) -C boot $@
380 $(MAKE) -C ssl $@
381 $(MAKE) -C locales $@
382 ifdef MOZ_XUL
383 $(MAKE) -C pki $@
384 endif
386 clean clobber clobber_all realclean distclean depend::
387 $(MAKE) -C boot $@
388 $(MAKE) -C ssl $@
389 $(MAKE) -C locales $@
390 ifdef MOZ_XUL
391 $(MAKE) -C pki $@
392 endif
393 ifndef MOZ_NATIVE_NSS
394 $(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
395 $(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
396 ifndef SKIP_CHK
397 $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
398 $(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
399 endif
400 endif
402 echo-requires-recursive::
403 $(MAKE) -C boot $@
404 $(MAKE) -C ssl $@
405 $(MAKE) -C pki $@
406 $(MAKE) -C locales $@