1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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 #*************************************************************************
33 # --- Settings -----------------------------------------------------
35 .INCLUDE
: settings.mk
37 # --- Files --------------------------------------------------------
39 .IF
"$(SYSTEM_NSS)"=="YES"
41 @echo
"NSS will not be built. Using system one instead."
44 .IF
"$(OS)" == "ANDROID" ||
"$(OS)" == "IOS"
46 @echo
"FIXME: NSS module not buildable yet on this platform"
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
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"
78 .IF
"$(OS)" == "MACOSX"
79 my_prefix
=/@.__________________________________________________
$(EXTRPATH
)
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
)
90 .IF
"$(OS)$(COM)$(CPUNAME)"=="WNTMSCX86_64"
91 CONFIGURE_ACTION
+=--enable-64bit
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
99 .IF
"$(OS)$(COM)"=="LINUXGCC"
100 .IF
"$(BUILD64)"=="1"
101 # force 64-bit buildmode
107 .IF
"$(OS)$(COM)"=="MACOSXGCC"
108 .IF
"$(BUILD64)"=="1"
109 # force 64-bit buildmode
115 .IF
"$(OS)$(COM)"=="FREEBSDGCC"
116 .IF
"$(CPUNAME)"=="X86_64"
117 # force 64-bit buildmode
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
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
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
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
171 .ENDIF
# "$(GUI)"=="UNX"
179 nspr-4.9
-build.patch \
180 nss-3.13
.3-build.patch \
184 PATH
!:=$(NSSBUILDTOOLS
)/bin
:$(PATH
)
188 .IF
"$(MINGW_SHARED_GCCLIB)"=="YES"
189 nss_CC
+=-shared-libgcc
190 nss_CXX
+=-shared-libgcc
193 nss_LIBS
=-ladvapi32
-lws2_32
-lmswsock
-lwinmm
194 .IF
"$(MINGW_SHARED_GXXLIB)"=="YES"
195 nss_LIBS
+=$(MINGW_SHARED_LIBSTDCPP
)
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
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"
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).
229 #To build nss one has to call "make nss_build_all" in
230 #mozilla/security/nss
232 .IF
"$(CPUNAME)"=="X86_64"
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"
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
) \
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