Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / nss / makefile.mk
blobb1c38314f9e02af740fdb6e4688e069c11e44d71
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
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.
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).
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.
26 #*************************************************************************
28 PRJ=.
30 PRJNAME=nss
31 TARGET=nss
33 # --- Settings -----------------------------------------------------
35 .INCLUDE : settings.mk
37 # --- Files --------------------------------------------------------
39 .IF "$(SYSTEM_NSS)"=="YES"
40 all:
41 @echo "NSS will not be built. Using system one instead."
42 .ENDIF
44 .IF "$(OS)" == "ANDROID" || "$(OS)" == "IOS"
45 @all:
46 @echo "FIXME: NSS module not buildable yet on this platform"
47 .ENDIF
49 VER_MAJOR=3
50 VER_MINOR=13
51 VER_PATCH=5
53 TARFILE_NAME=nss-$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)-with-nspr-4.9.1
54 TARFILE_MD5=a0a861f539f0e7a91d05e6b9457e4db1
55 TARFILE_ROOTDIR=nss-$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
56 PATCH_FILES=nss.patch nss.aix.patch nss-config.patch \
57 nss-3.13.5-zlib-werror.patch
58 # nss-3.13.5-zlib-werror.patch: avoid -Werror=implicit-function-declaration for
59 # lseek, read, write
61 .IF "$(OS)"=="MACOSX"
62 PATCH_FILES+=nss_macosx.patch
63 .ENDIF # "$(OS)"=="MACOSX"
65 # For a MSVC build, not exporting BUILD_OPT causes the produced DLLs
66 # to use the debug CRT. (The exact mechanism that causes this to
67 # happen is a bit of a mystery...) That is confusing and wrong, as
68 # nothing in LO otherwise uses that. It also makes testing a build
69 # much harder for me at least, as I do that in a fairly pristine
70 # virtual machine with no MSVC debugging runtime available. (The
71 # normal CRT is bundled in the LO installer.)
72 .IF "$(debug)" != "" && "$(OS)$(COM)" != "WNTMSC"
73 .ELSE
74 BUILD_OPT=1
75 .EXPORT: BUILD_OPT
76 .ENDIF
78 .IF "$(OS)" == "MACOSX"
79 my_prefix=/@.__________________________________________________$(EXTRPATH)
80 .ELSE
81 my_prefix=$(OUTDIR)
82 .END
84 CONFIGURE_ACTION=mozilla/nsprpub/configure --prefix=$(my_prefix) --includedir=$(OUTDIR)/inc/mozilla/nspr
86 .IF "$(CROSS_COMPILING)"=="YES"
87 CONFIGURE_ACTION+=--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
88 .ENDIF
90 .IF "$(OS)$(COM)$(CPUNAME)"=="WNTMSCX86_64"
91 CONFIGURE_ACTION+=--enable-64bit
92 .ENDIF
94 CONFIGURE_ACTION+= ; \
95 sed -e 's\#@prefix@\#$(OUTDIR)\#' -e 's\#@includedir@\#$(OUTDIR)/inc/mozilla/nss\#' -e 's\#@MOD_MAJOR_VERSION@\#$(VER_MAJOR)\#' -e 's\#@MOD_MINOR_VERSION@\#$(VER_MINOR)\#' -e 's\#@MOD_PATCH_VERSION@\#$(VER_PATCH)\#' mozilla/security/nss/nss-config.in > mozilla/security/nss/nss-config ; \
96 chmod a+x mozilla/security/nss/nss-config
98 .IF "$(GUI)"=="UNX"
99 .IF "$(OS)$(COM)"=="LINUXGCC"
100 .IF "$(BUILD64)"=="1"
101 # force 64-bit buildmode
102 USE_64:=1
103 .EXPORT : USE_64
104 .ENDIF
105 .ENDIF
107 .IF "$(OS)$(COM)"=="MACOSXGCC"
108 .IF "$(BUILD64)"=="1"
109 # force 64-bit buildmode
110 USE_64:=1
111 .EXPORT : USE_64
112 .ENDIF
113 .ENDIF
115 .IF "$(OS)$(COM)"=="FREEBSDGCC"
116 .IF "$(CPUNAME)"=="X86_64"
117 # force 64-bit buildmode
118 USE_64:=1
119 .EXPORT : USE_64
120 .ENDIF
121 .ENDIF
123 .IF "$(OS)"=="MACOSX"
124 MACOS_SDK_DIR:=$(MACOSX_SDK_PATH)
125 .EXPORT : MACOS_SDK_DIR
126 .ENDIF # "$(OS)"=="MACOSX"
128 OUT2LIB=mozilla/dist/out/lib/*$(DLLPOST) mozilla/dist/out/lib/libcrmf.a
130 OUT2BIN=config/nspr-config mozilla/security/nss/nss-config
132 BUILD_DIR=mozilla/security/nss
133 BUILD_ACTION= $(GNUMAKE) nss_build_all -j1
135 .IF "$(CROSS_COMPILING)"=="YES"
137 .IF "$(OS)-$(CPUNAME)"="MACOSX-POWERPC"
138 # Hardcode this for now... need to add more when/if cross-compiling to
139 # other desktop OSes, yeah, this is silly, but the nss build mechanism
140 # is a bit messy, I could not figure out how to get it to get CPU_ARCH
141 # automatically when cross-compiling
142 BUILD_ACTION+= CPU_ARCH=ppc
143 .ENDIF
145 # When cross-compiling need to use a nsinstall built for the build
146 # platform, so yeah, whole nss built for the build platform just for
147 # that... But oh well, nss is small compared to LO;)
148 BUILD_ACTION+= NSINSTALL=$(SRC_ROOT)/nss/$(INPATH_FOR_BUILD)/misc/build/$(TARFILE_ROOTDIR)/mozilla/security/coreconf/nsinstall/out/nsinstall
150 .ENDIF
152 #Note: with the new version the libfreebl3.so gets built in a way that does
153 # not conflict with the system one on Linux automatically;
154 # it is no longer necessary to add a workaround for #i105566# && moz#513024#
155 .IF "$(OS)$(COM)"=="SOLARISGCC"
156 BUILD_ACTION+=NS_USE_GCC=1
157 .ENDIF
159 # Otherwise, LibreOffice.app/Contents/MacOS/python -c 'import uno' fails to
160 # dlopen LibreOffice.app/Contents/MacOS/libpyuno.dylib (at
161 # pyuno/source/module/pyuno_dlopenwrapper.c:73) with dlerror "Symbol not found:
162 # _sqlite3_wal_checkpoint; Referenced from: /System/Library/Frameworks/
163 # CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/
164 # CFNetwork; Expected in: [...]/LibreOffice.app/Contents/MacOS/libsqlite3.dylib;
165 # in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/
166 # CFNetwork.framework/Versions/A/CFNetwork":
167 .IF "$(OS)" == "MACOSX" && "$(MAC_OS_X_VERSION_MIN_REQUIRED)" >= "1060"
168 BUILD_ACTION += NSS_USE_SYSTEM_SQLITE=1
169 .END
171 .ENDIF # "$(GUI)"=="UNX"
174 .IF "$(GUI)"=="WNT"
176 .IF "$(COM)"=="GCC"
178 PATCH_FILES += \
179 nspr-4.9-build.patch \
180 nss-3.13.3-build.patch \
181 nss.patch.mingw \
184 PATH!:=$(NSSBUILDTOOLS)/bin:$(PATH)
186 nss_CC=$(CC)
187 nss_CXX=$(CXX)
188 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
189 nss_CC+=-shared-libgcc
190 nss_CXX+=-shared-libgcc
191 .ENDIF
193 nss_LIBS=-ladvapi32 -lws2_32 -lmswsock -lwinmm
194 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
195 nss_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
196 .ENDIF
197 nss_LDFLAGS=
199 OS_TARGET=WINNT
200 .EXPORT : OS_TARGET
202 BUILD_DIR=mozilla/security/nss
203 BUILD_ACTION=$(GNUMAKE) NS_USE_GCC=1 CC="$(nss_CC)" CXX="$(nss_CXX)" OS_LIBS="$(nss_LIBS)" PATH="$(PATH)" NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --enable-shared --disable-static" LDFLAGS="$(nss_LDFLAGS)" RANLIB="$(RANLIB)" RC="$(WINDRES)" OS_RELEASE=5.0 NSINSTALL="$(PYTHON_FOR_BUILD) $(SRC_ROOT)/nss/nsinstall.py" IMPORT_LIB_SUFFIX=dll.a nss_build_all
205 OUT2LIB= \
206 mozilla/nsprpub/out/pr/src/libnspr4.dll.a \
207 mozilla/dist/out/lib/libnss3.dll.a \
208 mozilla/dist/out/lib/libnssdbm3.dll.a \
209 mozilla/dist/out/lib/libnssutil3.dll.a \
210 mozilla/nsprpub/out/lib/libc/src/libplc4.dll.a \
211 mozilla/nsprpub/out/lib/ds/libplds4.dll.a \
212 mozilla/dist/out/lib/libsmime3.dll.a \
213 mozilla/dist/out/lib/libsoftokn3.dll.a \
214 mozilla/dist/out/lib/libsqlite3.dll.a \
215 mozilla/dist/out/lib/libssl3.dll.a
217 .ELSE # "$(COM)"=="GCC"
218 MOZ_MSVCVERSION= 9
219 .EXPORT : MOZ_MSVCVERSION
220 nss_build:=$(shell cygpath -p $(NSSBUILDTOOLS))
222 #Using WINNT will cause at least that nspr4.dll, plc4.dll, plds4.dll
223 #become libnspr4.dll, libplc4.dll, libplds4.dll
224 #WINNT causes the use of Microsoft fibers (specific to Windows NT and Windows 2000).
225 #OS_TARGET= WINNT
226 OS_TARGET=WIN95
227 .EXPORT : OS_TARGET
229 #To build nss one has to call "make nss_build_all" in
230 #mozilla/security/nss
232 .IF "$(CPUNAME)"=="X86_64"
233 PASS_USE_64=USE_64=1
234 .ENDIF
236 NSS_BUILD_DIR=$(ABS_PACKAGE_DIR)/$(TARFILE_ROOTDIR)/mozilla/security/nss
237 BUILD_ACTION= PATH="$(nss_build)/msys/bin:$(nss_build)/moztools/bin:$(PATH)" && $(NSSBUILDTOOLS)/msys/bin/bash -i \
238 -c "cd $(NSS_BUILD_DIR) && make $(PASS_USE_64) nss_build_all"
240 OUT2LIB= \
241 mozilla/dist/out/lib/nspr4.lib \
242 mozilla/dist/out/lib/nss3.lib \
243 mozilla/dist/out/lib/nssdbm3.lib \
244 mozilla/dist/out/lib/nssutil3.lib \
245 mozilla/dist/out/lib/plc4.lib \
246 mozilla/dist/out/lib/plds4.lib \
247 mozilla/dist/out/lib/smime3.lib \
248 mozilla/dist/out/lib/softokn3.lib \
249 mozilla/dist/out/lib/sqlite3.lib \
250 mozilla/dist/out/lib/ssl3.lib
252 .ENDIF # "$(COM)"=="GCC"
254 OUT2BIN=mozilla/dist/out/lib/*$(DLLPOST) \
255 config/nspr-config \
256 mozilla/security/nss/nss-config
258 .ENDIF # "$(GUI)"=="WNT"
261 OUTDIR2INC=mozilla/dist/public/nss mozilla/dist/out/include
263 # --- Targets ------------------------------------------------------
265 .INCLUDE : set_ext.mk
266 .INCLUDE : target.mk
267 .INCLUDE : tg_ext.mk