PageRenderTime 72ms CodeModel.GetById 10ms app.highlight 57ms RepoModel.GetById 1ms app.codeStats 0ms

/security/manager/Makefile.in

http://github.com/zpao/v8monkey
Autoconf | 420 lines | 323 code | 33 blank | 64 comment | 4 complexity | 1c388b65a4f11b1a4eb99d6a774ffd3f MD5 | raw file
  1#
  2# ***** BEGIN LICENSE BLOCK *****
  3# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4#
  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/
  9#
 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.
 14#
 15# The Original Code is mozilla.org code.
 16#
 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.
 21#
 22# Contributor(s):
 23#   Brian Ryner <bryner@brianryner.com>
 24#
 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.
 36#
 37# ***** END LICENSE BLOCK *****
 38
 39DEPTH		= ../..
 40topsrcdir	= @top_srcdir@
 41srcdir		= @srcdir@
 42VPATH		= @srcdir@
 43
 44include $(DEPTH)/config/autoconf.mk
 45CC_WRAPPER =
 46CXX_WRAPPER =
 47include $(topsrcdir)/config/config.mk
 48
 49MODULE = psm
 50
 51ifndef MOZ_NATIVE_NSS
 52LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX)
 53endif
 54
 55NSS3_LIB = $(DLL_PREFIX)nss3$(DLL_SUFFIX)
 56NSSUTIL3_LIB = $(DLL_PREFIX)nssutil3$(DLL_SUFFIX)
 57SMIME3_LIB = $(DLL_PREFIX)smime3$(DLL_SUFFIX)
 58SSL3_LIB =  $(DLL_PREFIX)ssl3$(DLL_SUFFIX)
 59SOFTOKEN3_LIB = $(DLL_PREFIX)softokn3$(DLL_SUFFIX)
 60
 61ifndef NSS_DISABLE_DBM
 62NSSDBM3_LIB = $(DLL_PREFIX)nssdbm3$(DLL_SUFFIX)
 63else
 64NSSDBM3_LIB = 
 65endif
 66
 67ifndef MOZ_NATIVE_NSS
 68ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 69SDK_LIBS = \
 70  $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
 71  $(DIST)/lib/$(LIB_PREFIX)smime3.$(LIB_SUFFIX) \
 72  $(DIST)/lib/$(LIB_PREFIX)ssl3.$(LIB_SUFFIX) \
 73  $(DIST)/lib/$(LIB_PREFIX)nss3.$(LIB_SUFFIX) \
 74  $(DIST)/lib/$(LIB_PREFIX)nssutil3.$(LIB_SUFFIX) \
 75  $(NULL)
 76else
 77SDK_LIBS = \
 78  $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
 79  $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
 80  $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
 81  $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
 82  $(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
 83  $(NULL)
 84endif
 85endif
 86
 87# Default
 88HAVE_FREEBL_LIBS = 1
 89
 90# 32-bit HP-UX PA-RISC
 91ifeq ($(OS_ARCH), HP-UX)
 92ifneq ($(OS_TEST), ia64)
 93ifndef HAVE_64BIT_OS
 94HAVE_FREEBL_LIBS =
 95HAVE_FREEBL_LIBS_32 = 1
 96endif
 97endif
 98endif
 99
100# SunOS SPARC
101ifeq ($(OS_ARCH), SunOS)
102ifneq (86,$(findstring 86,$(OS_TEST)))
103ifdef HAVE_64BIT_OS
104HAVE_FREEBL_LIBS =
105HAVE_FREEBL_LIBS_64 = 1
106else
107HAVE_FREEBL_LIBS =
108HAVE_FREEBL_LIBS_32 = 1
109HAVE_FREEBL_LIBS_32INT64 = 1
110endif
111endif
112endif
113
114ifdef HAVE_FREEBL_LIBS
115FREEBL_LIB = $(DLL_PREFIX)freebl3$(DLL_SUFFIX)
116endif
117ifdef HAVE_FREEBL_LIBS_32
118FREEBL_32INT_LIB = libfreebl_32int_3$(DLL_SUFFIX)
119FREEBL_32FPU_LIB = libfreebl_32fpu_3$(DLL_SUFFIX)
120endif
121ifdef HAVE_FREEBL_LIBS_32INT64
122FREEBL_32INT64_LIB = libfreebl_32int64_3$(DLL_SUFFIX)
123endif
124ifdef HAVE_FREEBL_LIBS_64
125FREEBL_64INT_LIB = libfreebl_64int_3$(DLL_SUFFIX)
126FREEBL_64FPU_LIB = libfreebl_64fpu_3$(DLL_SUFFIX)
127endif
128
129ABS_DIST := $(call core_abspath,$(DIST))
130ifeq ($(HOST_OS_ARCH),WINNT)
131ifdef CYGDRIVE_MOUNT
132ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
133endif
134ifneq (,$(filter mingw%,$(host_os)))
135ABS_DIST := $(shell cd $(DIST) && pwd -W)
136endif
137endif
138# For all variables such as DLLFLAGS, that may contain $(DIST)
139DIST := $(ABS_DIST)
140NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
141ifneq (,$(strip $(NSPR_INCLUDE_DIR)))
142NSPR_INCLUDE_DIR := $(subst -I,,$(subst -I$(DIST),-I$(ABS_DIST),$(NSPR_INCLUDE_DIR)))
143else
144NSPR_INCLUDE_DIR = $(ABS_DIST)/include/nspr
145endif
146NSPR_LIB_DIR = $(firstword $(filter -L%,$(NSPR_LIBS)))
147ifneq (,$(strip $(NSPR_LIB_DIR)))
148NSPR_LIB_DIR := $(subst -L,,$(subst -L$(DIST),-L$(ABS_DIST),$(NSPR_LIB_DIR)))
149else
150NSPR_LIB_DIR = $(ABS_DIST)/lib
151endif
152# Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides
153# definitions in NSS, so just export it into the sub-make's environment.
154ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_MEMORY))
155export DLLFLAGS
156endif
157
158# To get debug symbols from NSS
159export MOZ_DEBUG_SYMBOLS
160
161ifdef .PYMAKE
162NSSMAKE = $(GMAKE)
163else
164NSSMAKE = $(MAKE)
165endif
166
167# NSS makefiles are not safe for parallel execution.
168DEFAULT_GMAKE_FLAGS = MAKE="$(NSSMAKE) -j1" -j1
169DEFAULT_GMAKE_FLAGS += CC="$(CC)"
170DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(ABS_DIST)
171DEFAULT_GMAKE_FLAGS += SOURCE_MDHEADERS_DIR=$(NSPR_INCLUDE_DIR)
172DEFAULT_GMAKE_FLAGS += DIST=$(ABS_DIST)
173DEFAULT_GMAKE_FLAGS += NSPR_INCLUDE_DIR=$(NSPR_INCLUDE_DIR)
174DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR)
175DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
176DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
177DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1
178DEFAULT_GMAKE_FLAGS += NSINSTALL="$(NSINSTALL)"
179ifndef MOZ_NATIVE_SQLITE
180DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3
181DEFAULT_GMAKE_FLAGS += SQLITE_INCLUDE_DIR=$(ABS_DIST)/include
182endif
183ifdef NSS_DISABLE_DBM 
184DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
185endif
186ABS_topsrcdir   := $(call core_abspath,$(topsrcdir))
187ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
188DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
189endif
190ifndef MOZ_DEBUG
191DEFAULT_GMAKE_FLAGS += BUILD_OPT=1 OPT_CODE_SIZE=1
192endif
193ifdef GNU_CC
194DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1
195else
196DEFAULT_GMAKE_FLAGS += NS_USE_GCC=
197endif
198ifdef USE_N32
199# It is not really necessary to specify USE_PTHREADS=1.  USE_PTHREADS
200# merely adds _PTH to coreconf's OBJDIR name.
201DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1
202endif
203ifdef HAVE_64BIT_OS
204DEFAULT_GMAKE_FLAGS += USE_64=1
205endif
206ifeq ($(OS_ARCH),WINNT)
207DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
208ifdef MOZ_DEBUG
209ifndef MOZ_NO_DEBUG_RTL
210DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
211endif
212endif
213endif # WINNT
214ifeq ($(OS_ARCH),OS2)
215ifdef MOZ_OS2_HIGH_MEMORY
216DEFAULT_GMAKE_FLAGS += MOZ_OS2_HIGH_MEMORY=1
217endif
218endif # OS2
219ifeq ($(OS_ARCH),Darwin)
220# Make nsinstall use absolute symlinks by default when building NSS
221# for Mozilla on Mac OS X. (Bugzilla bug 193164)
222ifndef NSDISTMODE
223DEFAULT_GMAKE_FLAGS += NSDISTMODE=absolute_symlink
224endif
225ifdef MACOS_SDK_DIR
226DEFAULT_GMAKE_FLAGS += MACOS_SDK_DIR=$(MACOS_SDK_DIR)
227endif
228endif
229
230# Turn off TLS compression support because it requires system zlib.
231# See bug 580679 comment 18.
232DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ZLIB=
233
234# Disable building of the test programs in security/nss/lib/zlib
235DEFAULT_GMAKE_FLAGS += PROGRAMS=
236
237# Disable creating .chk files. They will be generated from packager.mk
238# When bug 681624 lands, we can replace CHECKLOC= with SKIP_SHLIBSIGN=1
239DEFAULT_GMAKE_FLAGS += CHECKLOC=
240
241ifdef CROSS_COMPILE
242
243DEFAULT_GMAKE_FLAGS += \
244	NATIVE_CC="$(HOST_CC)" \
245	CC="$(CC)" \
246	CCC="$(CXX)" \
247	LINK="$(LD)" \
248	AS="$(AS)" \
249	AR='$(AR) $(AR_FLAGS:$@=$$@)' \
250	RANLIB="$(RANLIB)" \
251	RC="$(RC) $(RCFLAGS)" \
252	OS_ARCH="$(OS_ARCH)" \
253	OS_TEST="$(OS_TEST)" \
254	CPU_ARCH="$(TARGET_CPU)" \
255	$(NULL)
256
257# Android has pthreads integrated into -lc, so OS_PTHREAD is set to nothing
258ifeq ($(OS_TARGET), Android)
259DEFAULT_GMAKE_FLAGS += \
260	OS_RELEASE="2.6" \
261	OS_PTHREAD= \
262	STANDARDS_CFLAGS="-std=gnu89" \
263	$(NULL)
264
265DEFAULT_GMAKE_FLAGS += ARCHFLAG="$(CFLAGS) -DCHECK_FORK_GETPID -DRTLD_NOLOAD=0 -include $(ABS_topsrcdir)/security/manager/android_stub.h"
266endif
267endif
268
269ifdef WRAP_LDFLAGS
270DEFAULT_GMAKE_FLAGS += \
271	LDFLAGS="$(LDFLAGS) $(WRAP_LDFLAGS)" \
272	DSO_LDOPTS="-shared $(LDFLAGS) $(WRAP_LDFLAGS)" \
273	$(NULL)
274endif
275
276DEFAULT_GMAKE_FLAGS += FREEBL_NO_DEPEND=0
277ifeq ($(OS_TARGET),Linux)
278DEFAULT_GMAKE_FLAGS += FREEBL_LOWHASH=1
279endif
280
281SUBMAKEFILES = boot/Makefile ssl/Makefile pki/Makefile locales/Makefile
282
283include $(topsrcdir)/config/rules.mk
284
285ifdef MOZ_NSS_PATCH
286# If we're applying a patch, we'll copy the NSS source to the objdir
287# and build it from there.
288NSS_SRCDIR = $(CURDIR)/nss
289
290# This will copy and patch the NSS source for every build.
291# Since we "cp -p", it won't force rebuilds for most files, just
292# for patched files, but that's easier than trying to track
293# dependencies for patched files.
294export::
295	rm -rf $(NSS_SRCDIR)
296	$(NSINSTALL) -D $(NSS_SRCDIR)/security
297	cp -Rp $(topsrcdir)/security/nss $(NSS_SRCDIR)/security
298	cp -Rp $(topsrcdir)/security/coreconf $(NSS_SRCDIR)/security
299	cp -Rp $(topsrcdir)/security/dbm $(NSS_SRCDIR)/security
300	cp -Rp $(topsrcdir)/dbm $(NSS_SRCDIR)
301	(cd $(NSS_SRCDIR) && patch -p1 < $(call core_abspath,$(MOZ_NSS_PATCH)))
302else
303NSS_SRCDIR = $(topsrcdir)
304endif
305
306dependclean export packages chrome::
307	$(MAKE) -C boot $@
308	$(MAKE) -C ssl $@
309	$(MAKE) -C locales $@
310ifdef MOZ_XUL
311	$(MAKE) -C pki $@
312endif
313
314libs::
315ifndef MOZ_NATIVE_NSS
316ifndef NSS_DISABLE_DBM
317	$(NSSMAKE) -C $(NSS_SRCDIR)/security/dbm $(DEFAULT_GMAKE_FLAGS) 
318endif
319	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
320ifdef ENABLE_TESTS
321# Need certutil binary for mochitest certificates generation
322	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
323	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/certutil $(DEFAULT_GMAKE_FLAGS)
324	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/pk12util $(DEFAULT_GMAKE_FLAGS)
325	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/modutil $(DEFAULT_GMAKE_FLAGS)
326endif
327ifndef ENABLE_TESTS # Just avoid secondary compile
328	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
329endif
330	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS)
331	$(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin
332ifeq ($(OS_ARCH), SunOS)
333# has to use copy mode on Solaris, see #665509
334	$(NSINSTALL) -t -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
335else
336	$(INSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
337endif
338ifndef NSS_DISABLE_DBM
339	$(INSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DIST)/bin
340endif
341	$(INSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DIST)/bin
342	$(INSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DIST)/bin
343	$(INSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DIST)/bin
344	$(INSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DIST)/bin
345	$(INSTALL) -m 755 $(SDK_LIBS) $(DIST)/sdk/lib
346ifdef HAVE_FREEBL_LIBS
347	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DIST)/bin
348endif
349ifdef HAVE_FREEBL_LIBS_32
350	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DIST)/bin
351	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DIST)/bin
352endif
353ifdef HAVE_FREEBL_LIBS_32INT64
354	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DIST)/bin
355endif
356ifdef HAVE_FREEBL_LIBS_64
357	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DIST)/bin
358	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DIST)/bin
359endif
360endif
361ifndef MOZ_NATIVE_NSS
362# NSS installs headers to dist/public and we want them in dist/include
363	$(NSINSTALL) -D $(DIST)/include/nss
364	(cd $(DIST)/public/nss && tar $(TAR_CREATE_FLAGS) - .) | \
365	  (cd $(DIST)/include && tar -xf -)
366endif
367	$(MAKE) -C boot $@
368	$(MAKE) -C ssl $@
369	$(MAKE) -C locales $@
370ifdef MOZ_XUL
371	$(MAKE) -C pki $@
372endif
373
374check::
375	$(MAKE) -C ssl $@
376
377install::
378ifndef MOZ_NATIVE_NSS
379	$(SYSINSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DESTDIR)$(mozappdir)
380	$(SYSINSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DESTDIR)$(mozappdir)
381	$(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DESTDIR)$(mozappdir)
382	$(SYSINSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DESTDIR)$(mozappdir)
383	$(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DESTDIR)$(mozappdir)
384	$(SYSINSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DESTDIR)$(mozappdir)
385	$(SYSINSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DESTDIR)$(mozappdir)
386ifdef HAVE_FREEBL_LIBS
387	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DESTDIR)$(mozappdir)
388endif
389ifdef HAVE_FREEBL_LIBS_32
390	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DESTDIR)$(mozappdir)
391	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DESTDIR)$(mozappdir)
392endif
393ifdef HAVE_FREEBL_LIBS_32INT64
394	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DESTDIR)$(mozappdir)
395endif
396ifdef HAVE_FREEBL_LIBS_64
397	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DESTDIR)$(mozappdir)
398	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DESTDIR)$(mozappdir)
399endif
400endif
401	$(MAKE) -C boot $@
402	$(MAKE) -C ssl $@
403	$(MAKE) -C locales $@
404ifdef MOZ_XUL
405	$(MAKE) -C pki $@
406endif
407
408clean clobber clobber_all realclean distclean depend::
409	$(MAKE) -C boot $@
410	$(MAKE) -C ssl $@
411	$(MAKE) -C locales $@
412ifdef MOZ_XUL
413	$(MAKE) -C pki $@
414endif
415ifndef MOZ_NATIVE_NSS
416	$(NSSMAKE) -C $(NSS_SRCDIR)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
417	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
418	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
419	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
420endif