build fix
[LibreOffice.git] / external / nss / ExternalProject_nss.mk
blobb7bdf4b26ac91d7a53a14223af4a754821ee19b5
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 $(eval $(call gb_ExternalProject_register_targets,nss,\
13 configure \
14 build \
17 $(call gb_ExternalProject_get_state_target,nss,configure):
18 $(call gb_ExternalProject_run,configure,\
19 $(if $(filter MSC,$(COM)),INCLUDE="$(COMPATH)/include" LIB="$(ILIB)") \
20 $(if $(CROSS_COMPILING),\
21 NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
22 nspr/configure --includedir=$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include \
23 $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
24 $(if $(filter MSC-X86_64,$(COM)-$(CPUNAME)),--enable-64bit) \
25 $(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)),--host=i686-pc-cygwin) \
26 ,,nss_configure.log)
28 ifeq ($(OS),WNT)
29 ifeq ($(COM),MSC)
30 $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure) $(call gb_ExternalExecutable_get_dependencies,python)
31 $(call gb_ExternalProject_run,build,\
32 $(if $(MSVC_USE_DEBUG_RUNTIME),USE_DEBUG_RTL=1,BUILD_OPT=1) \
33 MOZ_MSVCVERSION=9 OS_TARGET=WIN95 \
34 $(if $(filter X86_64,$(CPUNAME)),USE_64=1) \
35 LIB="$(ILIB)" \
36 XCFLAGS="-arch:SSE $(SOLARINC)" \
37 $(MAKE) -j1 nss_build_all RC="rc.exe $(SOLARINC)" \
38 NSINSTALL='$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \
39 ,nss)
42 else
43 $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure) $(call gb_ExternalExecutable_get_dependencies,python)
44 $(call gb_ExternalProject_run,build,\
45 $(MAKE) -j1 nss_build_all \
46 NS_USE_GCC=1 \
47 CC="$(CC) $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
48 CXX="$(CXX) $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
49 OS_LIBS="-ladvapi32 -lws2_32 -lmswsock -lwinmm $(if $(MINGW_SHARED_GXXLIB),$(MINGW_SHARED_LIBSTDCPP))" \
50 LDFLAGS="" \
51 PATH="$(PATH)" \
52 RANLIB="$(RANLIB)" \
53 OS_TARGET=WINNT RC="$(WINDRES)" OS_RELEASE="5.0" \
54 IMPORT_LIB_SUFFIX=dll.a \
55 NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --enable-shared --disable-static" \
56 NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py" \
57 && rm -f $(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/lib/*.a \
58 ,nss)
60 endif
61 else # OS!=WNT
62 $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure) $(call gb_ExternalExecutable_get_dependencies,python)
63 $(call gb_ExternalProject_run,build,\
64 $(if $(filter FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X86_64,$(CPUNAME)),USE_64=1)) \
65 $(if $(filter IOS,$(OS)),\
66 $(if $(filter arm64,$(CC)),USE_64=1)) \
67 $(if $(filter MACOSX,$(OS)),\
68 $(if $(filter-out POWERPC,$(CPUNAME)),MACOS_SDK_DIR=$(MACOSX_SDK_PATH)) \
69 NSS_USE_SYSTEM_SQLITE=1) \
70 $(if $(filter LINUX,$(OS)),$(if $(ENABLE_DBGUTIL),,BUILD_OPT=1)) \
71 $(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \
72 $(if $(CROSS_COMPILING),\
73 $(if $(filter MACOSXPOWERPC,$(OS)$(CPUNAME)),CPU_ARCH=ppc) \
74 $(if $(filter IOS-ARM,$(OS)-$(CPUNAME)),CPU_ARCH=arm) \
75 NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
76 NSDISTMODE=copy \
77 $(MAKE) -j1 AR="$(AR)" \
78 RANLIB="$(RANLIB)" \
79 NMEDIT="$(NM)edit" \
80 CCC="$(CXX)" \
81 $(if $(CROSS_COMPILING),NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)") \
82 nss_build_all \
83 && rm -f $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \
84 $(if $(filter MACOSX,$(OS)),\
85 && chmod u+w $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.dylib \
86 && $(PERL) \
87 $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
88 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libfreebl3.dylib \
89 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnspr4.dylib \
90 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnss3.dylib \
91 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnssckbi.dylib \
92 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnssdbm3.dylib \
93 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnssutil3.dylib \
94 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libplc4.dylib \
95 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libplds4.dylib \
96 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libsmime3.dylib \
97 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libsoftokn3.dylib \
98 $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libssl3.dylib) \
99 ,nss)
101 endif
103 # vim: set noet sw=4 ts=4: