Branch libreoffice-24-8-3
[LibreOffice.git] / external / nss / nss_macosx.patch
blob456bd62d509b8026e4863731ac496121b64a5350
1 diff -ru a/nspr/configure b/nspr/configure
2 --- a/a/nspr/configure 2014-09-29 16:50:33.907375937 +0100
3 +++ b/b/nspr/configure 2014-09-29 16:51:59.213931947 +0100
4 @@ -6448,6 +6448,9 @@
5 AS='$(CC) -x assembler-with-cpp'
6 CFLAGS="$CFLAGS -Wall -fno-common"
7 case "${target_cpu}" in
8 + aarch64)
9 + CPU_ARCH=arm64
10 + ;;
11 arm*)
12 CPU_ARCH=arm
14 @@ -6483,7 +6486,7 @@
17 DSO_CFLAGS=-fPIC
18 - DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
19 + DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @__________________________________________________OOO/$@ -headerpad_max_install_names'
20 _OPTIMIZE_FLAGS=-O2
21 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
22 STRIP="$STRIP -x -S"
23 diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk
24 --- a/a/nss/coreconf/Darwin.mk 2014-09-29 16:50:22.992304799 +0100
25 +++ b/b/nss/coreconf/Darwin.mk 2014-09-29 16:51:59.214931953 +0100
26 @@ -20,13 +20,17 @@
28 ifeq (,$(filter-out i%86,$(CPU_ARCH)))
29 ifdef USE_64
30 +ifeq (,$(findstring -arch ,$(CC)))
31 CC += -arch x86_64
32 CCC += -arch x86_64
33 +endif
34 override CPU_ARCH = x86_64
35 else
36 OS_REL_CFLAGS = -Di386
37 +ifeq (,$(findstring -arch ,$(CC)))
38 CC += -arch i386
39 CCC += -arch i386
40 +endif
41 override CPU_ARCH = x86
42 endif
43 else
44 @@ -33,19 +37,20 @@
45 ifeq (arm,$(CPU_ARCH))
46 # Nothing set for arm currently.
47 else
48 -OS_REL_CFLAGS = -Dppc
49 -CC += -arch ppc
50 -CCC += -arch ppc
51 endif
52 endif
54 ifneq (,$(MACOS_SDK_DIR))
55 + CLANG_VERSION_FULL := $(shell $(CC) -v 2>&1 | grep "clang version" | sed -e "s/^.*clang version[ ]*//" | awk '{ print $$1 }')
56 GCC_VERSION_FULL := $(shell $(CC) -dumpversion)
57 GCC_VERSION_MAJOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$1 }')
58 GCC_VERSION_MINOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$2 }')
59 GCC_VERSION = $(GCC_VERSION_MAJOR).$(GCC_VERSION_MINOR)
60 + ifneq (,$(CLANG_VERSION_FULL))
61 + DARWIN_SDK_CFLAGS = -isysroot $(MACOS_SDK_DIR)
62 + DARWIN_SDK_SHLIBFLAGS = -isysroot $(MACOS_SDK_DIR)
64 - ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR)))
65 + else ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR)))
66 # GCC <= 3
67 DARWIN_SDK_FRAMEWORKS = -F$(MACOS_SDK_DIR)/System/Library/Frameworks
68 ifneq (,$(shell find $(MACOS_SDK_DIR)/Library/Frameworks -maxdepth 0))
69 @@ -108,7 +113,7 @@
70 # May override this with different compatibility and current version numbers.
71 DARWIN_DYLIB_VERSIONS = -compatibility_version 1 -current_version 1
72 # May override this with -bundle to create a loadable module.
73 -DSO_LDOPTS = -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @executable_path/$(notdir $@) -headerpad_max_install_names
74 +DSO_LDOPTS = -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @__________________________________________________OOO/$(notdir $@) -headerpad_max_install_names
76 ifdef USE_GCOV
77 OS_CFLAGS += --coverage
78 diff -ru a/nss/Makefile b/nss/Makefile
79 --- a/a/nss/Makefile 2014-09-29 16:50:22.990304789 +0100
80 +++ b/b/nss/Makefile 2014-09-29 16:51:59.207931908 +0100
81 @@ -82,6 +82,9 @@
82 ifeq ($(OS_TARGET),WIN95)
83 NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
84 endif
85 +ifdef MACOS_SDK_DIR
86 +NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
87 +endif
88 ifdef USE_DEBUG_RTL
89 NSPR_CONFIGURE_OPTS += --enable-debug-rtl
90 endif