Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / external / nss / ExternalProject_nss.mk
blob2e93d7000c3ab77ecf2765cc655a24ea3a913d5b
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,\
15 build \
18 ifeq ($(OS),WNT)
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) \
24 LIB="$(ILIB)" \
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 \
29 ,nss)
31 else # OS!=WNT
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)") \
48 NSDISTMODE=copy \
49 $(MAKE) -j1 AR="$(AR)" \
50 RANLIB="$(RANLIB)" \
51 NMEDIT="$(NM)edit" \
52 COMMA=$(COMMA) \
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 \
57 nss_build_all \
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 \
61 && $(PERL) \
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) \
74 ,nss)
76 endif
78 # vim: set noet sw=4 ts=4: