xref: /trunk/main/nss/makefile.mk (revision 1439c24f)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28PRJ=.
29
30PRJNAME=nss
31TARGET=nss
32
33# --- Settings -----------------------------------------------------
34
35.INCLUDE :	settings.mk
36
37# --- Files --------------------------------------------------------
38
39.IF "$(ENABLE_NSS_MODULE)"!="YES"
40all:
41	@echo "NSS will not be built. ENABLE_NSS_MODULE is '$(ENABLE_NSS_MODULE)'"
42.ENDIF
43
44TARFILE_NAME=nss-3.12.6-with-nspr-4.8.4
45TARFILE_MD5=b92261a5679276c400555004937af965
46TARFILE_ROOTDIR=nss-3.12.6
47PATCH_FILES=nss.patch
48
49.IF "$(OS)"=="MACOSX"
50MACOS_SDK_DIR=/Developer/SDKs/MacOSX10.4u.sdk
51.EXPORT : MACOS_SDK_DIR
52PATCH_FILES+=nss_macosx.patch
53.ENDIF # "$(OS)"=="MACOSX"
54
55.IF "$(debug)" != ""
56.ELSE
57BUILD_OPT=1
58.EXPORT: BUILD_OPT
59.ENDIF
60
61.IF "$(GUI)"=="UNX"
62.IF "$(OS)$(COM)"=="LINUXGCC"
63.IF "$(BUILD64)"=="1"
64# force 64-bit buildmode
65USE_64:=1
66.EXPORT : USE_64
67.ENDIF			# "$(CPU)"=="X"
68.ENDIF                  # "$(OS)$(COM)"=="LINUXGCC"
69
70.IF "$(OS)$(COM)"=="FREEBSDGCC"
71.IF "$(CPU)"=="X"
72# force 64-bit buildmode
73USE_64:=1
74.EXPORT : USE_64
75.ENDIF			# "$(CPU)"=="X"
76.ENDIF                  # "$(OS)$(COM)"=="LINUXGCC"
77
78.IF "$(OS)"=="MACOSX"
79.IF "$(EXTRA_CFLAGS)"!=""
80CPP:=gcc -E $(EXTRA_CFLAGS)
81CXX:=g++ $(EXTRA_CFLAGS)
82CC:=gcc $(EXTRA_CFLAGS)
83.EXPORT : CPP
84.ENDIF # "$(EXTRA_CFLAGS)"!=""
85.ENDIF # "$(OS)"=="MACOSX"
86
87OUT2LIB=mozilla$/dist$/out$/lib$/*$(DLLPOST)
88
89BUILD_DIR=mozilla$/security$/nss
90BUILD_ACTION= $(GNUMAKE) nss_build_all
91#See #i105566# && moz#513024#
92.IF "$(OS)"=="LINUX"
93BUILD_ACTION+=FREEBL_NO_DEPEND=1
94.ENDIF
95
96.ENDIF			# "$(GUI)"=="UNX"
97
98
99.IF "$(GUI)"=="WNT"
100
101.IF "$(COM)"=="GCC"
102
103PATCH_FILES+=nss.patch.mingw
104
105moz_build:=$(shell cygpath -p $(MOZILLABUILD))
106PATH!:=$(moz_build)/bin:$(PATH)
107
108nss_CC=$(CC)
109nss_CXX=$(CXX)
110.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
111nss_CC+=-shared-libgcc
112nss_CXX+=-shared-libgcc
113.ENDIF
114
115nss_LIBS=
116.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
117nss_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
118.ENDIF
119
120
121BUILD_DIR=mozilla$/security$/nss
122BUILD_ACTION=NS_USE_GCC=1 CC="$(nss_CC)" CXX="$(nss_CXX)" OS_LIBS="$(nss_LIBS)" OS_TARGET=WIN95 _WIN32_IE=0x500 PATH="$(PATH)" DEFINES=-D_WIN32_IE=0x500 $(GNUMAKE) nss_build_all
123
124OUT2LIB= \
125	mozilla$/dist$/out$/lib$/libnspr4.a \
126	mozilla$/dist$/out$/lib$/libnss3.a \
127	mozilla$/dist$/out$/lib$/libnssdbm3.a \
128	mozilla$/dist$/out$/lib$/libnssutil3.a \
129	mozilla$/dist$/out$/lib$/libplc4.a \
130	mozilla$/dist$/out$/lib$/libplds4.a \
131	mozilla$/dist$/out$/lib$/libsmime3.a \
132	mozilla$/dist$/out$/lib$/libsoftokn3.a \
133	mozilla$/dist$/out$/lib$/libsqlite3.a \
134	mozilla$/dist$/out$/lib$/libssl3.a
135
136.ELSE			# "$(COM)"=="GCC"
137MOZ_MSVCVERSION= 9
138.EXPORT : MOZ_MSVCVERSION
139moz_build:=$(shell cygpath -p $(MOZILLABUILD))
140
141#Using WINNT will cause at least that nspr4.dll, plc4.dll, plds4.dll
142#become libnspr4.dll, libplc4.dll, libplds4.dll
143#WINNT causes the use of Microsoft fibers (specific to Windows NT and Windows 2000).
144#OS_TARGET= WINNT
145OS_TARGET=WIN95
146.EXPORT : OS_TARGET
147
148# make use of stlport headerfiles
149EXT_USE_STLPORT=TRUE
150
151#To build nss one has to call "make nss_build_all" in
152#mozilla/security/nss
153NSS_BUILD_DIR= $(subst,\,/ $(PWD)/$(MISC)/build/$(TARFILE_ROOTDIR)/mozilla/security/nss)
154BUILD_ACTION= PATH="$(moz_build)/msys/bin:$(moz_build)/moztools/bin:$(PATH)" && $(subst,/,$/ $(MOZILLABUILD)/msys/bin/bash) -i \
155	-c "cd $(NSS_BUILD_DIR) && make nss_build_all"
156
157OUT2LIB= \
158	mozilla$/dist$/out$/lib$/nspr4.lib \
159	mozilla$/dist$/out$/lib$/nss3.lib \
160	mozilla$/dist$/out$/lib$/nssdbm3.lib \
161	mozilla$/dist$/out$/lib$/nssutil3.lib \
162	mozilla$/dist$/out$/lib$/plc4.lib \
163	mozilla$/dist$/out$/lib$/plds4.lib \
164	mozilla$/dist$/out$/lib$/smime3.lib \
165	mozilla$/dist$/out$/lib$/softokn3.lib \
166	mozilla$/dist$/out$/lib$/sqlite3.lib \
167	mozilla$/dist$/out$/lib$/ssl3.lib
168
169.ENDIF			# "$(COM)"=="GCC"
170
171OUT2BIN=mozilla$/dist$/out$/lib$/*$(DLLPOST)
172.ENDIF			# "$(GUI)"=="WNT"
173
174
175OUTDIR2INC=mozilla$/dist$/public$/nss mozilla$/dist$/out$/include
176
177# --- Targets ------------------------------------------------------
178
179.INCLUDE : set_ext.mk
180.INCLUDE :	target.mk
181.INCLUDE :	tg_ext.mk
182
183# This is a hack to build on a Linux 3.0 system.  Between unpacking
184# the archive and building it, the existing Linux2.6.mk makefile is
185# copied to Linux3.0.mk, which otherwise would be missing and break
186# the build.  See moz module for a similar hack.
187# If someone finds a better solution then please change this.
188.IF "$(OS)"=="LINUX"
189BUILD_ACTION:= $(COPY) \
190	../../../mozilla/security/coreconf/Linux2.6.mk \
191	../../../mozilla/security/coreconf/Linux3.0.mk \
192	&& $(BUILD_ACTION)
193.ENDIF
194