1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval
$(call gb_ExternalProject_ExternalProject
,nss
))
12 # nss build calls configure for nspr itself - if for some reason the configure step should be split out,
13 # make sure to create config.status (aka run configure) in dir specified with OBJDIR_NAME (nspr/out)
14 $(eval
$(call gb_ExternalProject_register_targets
,nss
,\
19 $(call gb_ExternalProject_get_state_target
,nss
,build
): $(call gb_ExternalExecutable_get_dependencies
,python
)
20 $(call gb_ExternalProject_run
,build
,\
21 $(if
$(MSVC_USE_DEBUG_RUNTIME
),USE_DEBUG_RTL
=1,BUILD_OPT
=1) \
22 MOZ_MSVCVERSION
=9 OS_TARGET
=WIN95 \
23 $(if
$(filter X86_64
,$(CPUNAME
)),USE_64
=1) \
25 XCFLAGS
="-arch:SSE $(SOLARINC)" \
26 $(MAKE
) -j1 nss_build_all RC
="rc.exe $(SOLARINC)" \
27 NSINSTALL
='$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \
28 NSS_DISABLE_GTESTS
=1 \
32 # make sure to specify NSPR_CONFIGURE_OPTS as env (before make command), so nss can append it's own defaults
33 # OTOH specify e.g. CC and NSINSTALL as arguments (after make command), so they will overrule nss makefile values
34 $(call gb_ExternalProject_get_state_target
,nss
,build
): $(call gb_ExternalExecutable_get_dependencies
,python
)
35 $(call gb_ExternalProject_run
,build
,\
36 $(if
$(filter ANDROID FREEBSD LINUX MACOSX
,$(OS
)),$(if
$(filter X86_64
,$(CPUNAME
)),USE_64
=1)) \
37 $(if
$(filter iOS
,$(OS
)),\
38 $(if
$(filter arm64
,$(CC
)),USE_64
=1)) \
39 $(if
$(filter MACOSX
,$(OS
)),\
40 $(if
$(filter-out POWERPC
,$(CPUNAME
)),MACOS_SDK_DIR
=$(MACOSX_SDK_PATH
)) \
41 NSS_USE_SYSTEM_SQLITE
=1) \
42 $(if
$(filter LINUX
,$(OS
)),$(if
$(ENABLE_DBGUTIL
),,BUILD_OPT
=1)) \
43 $(if
$(filter SOLARIS
,$(OS
)),NS_USE_GCC
=1) \
44 $(if
$(CROSS_COMPILING
),\
45 $(if
$(filter MACOSXPOWERPC
,$(OS
)$(CPUNAME
)),CPU_ARCH
=ppc
) \
46 $(if
$(filter iOS-ARM
,$(OS
)-$(CPUNAME
)),CPU_ARCH
=arm
) \
47 NSPR_CONFIGURE_OPTS
="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)") \
49 $(MAKE
) -j1 AR
="$(AR)" \
53 CC
="$(CC)$(if $(filter ANDROID,$(OS)), -D_PR_NO_LARGE_FILES=1 -DSQLITE_DISABLE_LFS=1)" CCC
="$(CXX)" \
54 $(if
$(CROSS_COMPILING
),NSINSTALL
="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
55 $(if
$(filter ANDROID
,$(OS
)),OS_TARGET
=Android OS_TARGET_RELEASE
=16 ARCHFLAG
="" DEFAULT_COMPILER
=clang ANDROID_NDK
=$(ANDROID_NDK_HOME
) ANDROID_TOOLCHAIN_VERSION
=$(ANDROID_GCC_TOOLCHAIN_VERSION
) ANDROID_PREFIX
=$(HOST_PLATFORM
) ANDROID_SYSROOT
=$(ANDROID_NDK_HOME
)/sysroot ANDROID_TOOLCHAIN
=$(ANDROID_BINUTILS_PREBUILT_ROOT
)) \
56 NSS_DISABLE_GTESTS
=1 \
58 && rm -f
$(call gb_UnpackedTarball_get_dir
,nss
)/dist/out
/lib
/*.a \
59 $(if
$(filter MACOSX
,$(OS
)),\
60 && chmod u
+w
$(call gb_UnpackedTarball_get_dir
,nss
)/dist/out
/lib
/*.dylib \
62 $(SRCDIR
)/solenv
/bin
/macosx-change-install-names.pl shl OOO \
63 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libfreebl3.dylib \
64 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libnspr4.dylib \
65 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libnss3.dylib \
66 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libnssckbi.dylib \
67 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libnssdbm3.dylib \
68 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libnssutil3.dylib \
69 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libplc4.dylib \
70 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libplds4.dylib \
71 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libsmime3.dylib \
72 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libsoftokn3.dylib \
73 $(EXTERNAL_WORKDIR
)/dist/out
/lib
/libssl3.dylib
) \
78 # vim: set noet sw=4 ts=4: