summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-08-11 16:11:23 +0300
committerTor Lillqvist <tml@collabora.com>2014-08-11 19:40:36 +0300
commit5c37960d9507fac206f0b90d36f778db9fe2b6a5 (patch)
tree0f2853e9d28a0b8aded3abd2bec4f88cecae8df7
parentaacdc61b5da2f30b16361b8e22ff081352fc69d6 (diff)
First attempt at building NSS for iOS, too
Let's hope that the various static archives that get built by the NSS build machinery contain what an iOS app that needs NSS services requires. I patch out the construction of any dylibs and executables in nss. We don't use any dylibs on iOS anyway, and of course don't need any NSS executables either. Change-Id: Ic977c6e3d6c4e953202e78f8e08c4e61f6c9cb1b
-rwxr-xr-xbin/lo-all-static-libs2
-rw-r--r--external/nss/ExternalPackage_nss.mk8
-rw-r--r--external/nss/ExternalProject_nss.mk7
-rw-r--r--external/nss/Module_nss.mk2
-rw-r--r--external/nss/UnpackedTarball_nss.mk2
-rw-r--r--external/nss/nss-ios.patch101
6 files changed, 117 insertions, 5 deletions
diff --git a/bin/lo-all-static-libs b/bin/lo-all-static-libs
index 77c0507b0d25..01fc3cfc8b51 100755
--- a/bin/lo-all-static-libs
+++ b/bin/lo-all-static-libs
@@ -42,6 +42,7 @@ ANDROID)
;;
IOS)
oslibs="$WORKDIR/UnpackedTarball/icu/source/stubdata/*.a"
+ nsslibs=`find $WORKDIR/UnpackedTarball/nss -name 'lib*.a'`
;;
*)
oslibs=
@@ -52,6 +53,7 @@ echo $INSTDIR/$LIBO_LIB_FOLDER/lib*.a \
$foolibs \
$WORKDIR/LinkTarget/StaticLibrary/lib*.a \
$oslibs \
+ $nsslibs \
$WORKDIR/UnpackedTarball/coinmp/Cbc/src/.libs/*.a \
$WORKDIR/UnpackedTarball/coinmp/Cgl/src/.libs/*.a \
$WORKDIR/UnpackedTarball/coinmp/Clp/src/.libs/*.a \
diff --git a/external/nss/ExternalPackage_nss.mk b/external/nss/ExternalPackage_nss.mk
index 26f923979d63..5dbe1d035ef2 100644
--- a/external/nss/ExternalPackage_nss.mk
+++ b/external/nss/ExternalPackage_nss.mk
@@ -11,7 +11,9 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,nss,nss))
$(eval $(call gb_ExternalPackage_use_external_project,nss,nss))
-ifeq ($(OS),MACOSX)
+ifeq ($(OS),IOS)
+# nothing...
+else ifeq ($(OS),MACOSX)
$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
dist/out/lib/libfreebl3.dylib \
dist/out/lib/libnspr4.dylib \
@@ -59,7 +61,9 @@ $(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
endif
ifeq ($(SYSTEM_CURL),)
-ifeq ($(OS),MACOSX)
+ifeq ($(OS),IOS)
+# nothing
+else ifeq ($(OS),MACOSX)
$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
dist/out/lib/libnsspem.dylib \
))
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index cfda1acd593d..3bf851b2fa12 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -17,6 +17,8 @@ $(eval $(call gb_ExternalProject_register_targets,nss,\
$(call gb_ExternalProject_get_state_target,nss,configure):
$(call gb_ExternalProject_run,configure,\
$(if $(filter MSC,$(COM)),LIB="$(ILIB)") \
+ $(if $(CROSS_COMPILING),\
+ NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
nspr/configure --includedir=$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter MSC-X86_64,$(COM)-$(CPUNAME)),--enable-64bit) \
@@ -64,8 +66,9 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject
$(if $(filter-out 1050,$(MAC_OS_X_VERSION_MIN_REQUIRED)),NSS_USE_SYSTEM_SQLITE=1)) \
$(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \
$(if $(CROSS_COMPILING),\
- $(if $(filter MACOSXPOWERPC,$(OS)$(CPUNAME)),CPU_ARCH=ppc) \
- NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
+ $(if $(filter MACOSXPOWERPC,$(OS)$(CPUNAME)),CPU_ARCH=ppc) \
+ $(if $(filter IOS-ARM,$(OS)-$(CPUNAME)),CPU_ARCH=arm) \
+ NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
NSDISTMODE=copy \
$(MAKE) -j1 AR="$(AR)" RANLIB="$(RANLIB)" NMEDIT="$(NM)edit" nss_build_all \
&& rm -f $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \
diff --git a/external/nss/Module_nss.mk b/external/nss/Module_nss.mk
index 5bc94e566d62..c1e1ab2bc074 100644
--- a/external/nss/Module_nss.mk
+++ b/external/nss/Module_nss.mk
@@ -10,7 +10,7 @@
$(eval $(call gb_Module_Module,nss))
ifeq ($(SYSTEM_NSS),)
-ifeq ($(filter ANDROID IOS,$(OS)),)
+ifeq ($(filter ANDROID,$(OS)),)
$(eval $(call gb_Module_add_targets,nss,\
UnpackedTarball_nss \
ExternalPackage_nss \
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index 94b50e9f50dd..4e14e3529cde 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -24,6 +24,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
external/nss/nss.mingw.patch.3) \
external/nss/nspr-build-config.patch \
external/nss/ubsan.patch.0 \
+ $(if $(filter IOS,$(OS)), \
+ external/nss/nss-ios.patch) \
))
# nss-pem is only needed for internal curl to read the NSS CA database
diff --git a/external/nss/nss-ios.patch b/external/nss/nss-ios.patch
new file mode 100644
index 000000000000..8e883f97d84b
--- /dev/null
+++ b/external/nss/nss-ios.patch
@@ -0,0 +1,101 @@
+--- a/a/nspr/config/autoconf.mk.in
++++ a/a/nspr/config/autoconf.mk.in
+@@ -67,7 +67,7 @@
+ MSC_VER = @MSC_VER@
+ AR = @AR@
+ AR_FLAGS = @AR_FLAGS@
+-LD = @LD@
++LD = echo
+ RANLIB = @RANLIB@
+ PERL = @PERL@
+ RC = @RC@
+--- a/a/nspr/configure
++++ a/a/nspr/configure
+@@ -755,7 +755,7 @@
+ OBJDIR='$(OBJDIR_NAME)'
+ OBJDIR_NAME=.
+ OBJDIR_SUFFIX=OBJ
+-NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
++NSINSTALL=${NSINSTALL?'$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'}
+ NOSUCHFILE=/no-such-file
+ LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
+ LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
+@@ -3060,7 +3060,7 @@
+ LIB_SUFFIX=a
+ DLL_SUFFIX=so
+ ASM_SUFFIX=s
+-MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
++MKSHLIB='touch $@; echo'
+ PR_MD_ASFILES=
+ PR_MD_CSRCS=
+ PR_MD_ARCH_DIR=unix
+@@ -3904,7 +3904,7 @@
+ DSO_CFLAGS=-fPIC
+ DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @__________________________________________________OOO/$@ -headerpad_max_install_names'
+ _OPTIMIZE_FLAGS=-O2
+- MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
++ MKSHLIB=touch $@
+ STRIP="$STRIP -x -S"
+ DLL_SUFFIX=dylib
+ USE_PTHREADS=1
+--- a/a/nss/coreconf/ruleset.mk
++++ a/a/nss/coreconf/ruleset.mk
+@@ -68,7 +68,7 @@
+ endif
+
+ ifeq ($(MKPROG),)
+- MKPROG = $(CC)
++ MKPROG = touch $@; echo
+ endif
+
+ #
+--- a/a/nss/coreconf/Darwin.mk
++++ a/a/nss/coreconf/Darwin.mk
+@@ -124,7 +124,7 @@
+ # May override this with -bundle to create a loadable module.
+ DSO_LDOPTS = -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @__________________________________________________OOO/$(notdir $@) -headerpad_max_install_names
+
+-MKSHLIB = $(CC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
++MKSHLIB = touch $@; echo
+ DLL_SUFFIX = dylib
+ ifdef MAPFILE
+ MKSHLIB += -exported_symbols_list $(MAPFILE)
+--- a/a/nss/coreconf/UNIX.mk
++++ a/a/nss/coreconf/UNIX.mk
+@@ -21,10 +21,14 @@
+
+ ifdef BUILD_TREE
+ NSINSTALL_DIR = $(BUILD_TREE)/nss
++ifndef NSINSTALL
+ NSINSTALL = $(BUILD_TREE)/nss/nsinstall
++endif
+ else
+ NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
++ifndef NSINSTALL
+ NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
++endif
+ endif
+
+ MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
+--- a/a/nspr/pr/src/Makefile.in
++++ a/a/nspr/pr/src/Makefile.in
+@@ -180,7 +180,7 @@
+ endif
+
+ ifeq ($(OS_TARGET),MacOSX)
+-OS_LIBS = -framework CoreServices -framework CoreFoundation
++OS_LIBS = -framework CoreFoundation
+ endif
+
+ EXTRA_LIBS += $(OS_LIBS)
+--- a/a/nss/cmd/shlibsign/sign.sh
++++ a/a/nss/cmd/shlibsign/sign.sh
+@@ -2,6 +2,8 @@
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
++
++exit 0
+
+ # arguments:
+ # 1: full path to DIST/OBJDIR (parent dir of "lib")