[PATCH] convert nss to gbuild

Peter Foley (via Code Review) gerrit at gerrit.libreoffice.org
Tue Jan 1 13:00:01 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1529

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/29/1529/1

convert nss to gbuild

Change-Id: I59edc4c437abccc201823d97f1cbec230d273b05
---
M RepositoryExternal.mk
M config_host.mk.in
M configure.ac
M libxmlsec/xmlsec1-configure.patch
A nss/ExternalPackage_nss.mk
A nss/ExternalProject_nss.mk
A nss/Makefile
A nss/Module_nss.mk
A nss/UnpackedTarball_nss.mk
D nss/makefile.mk
A nss/nss-config.in
D nss/nss-config.patch
R nss/nss.mingw.patch
M nss/prj/build.lst
M nss/prj/d.lst
D nss/prj/dmake
M openldap/ExternalProject_openldap.mk
17 files changed, 395 insertions(+), 463 deletions(-)



diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index cb63693..0b3fc76 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2206,9 +2206,7 @@
 
 ifeq (,$(filter DESKTOP,$(BUILD_TYPE)))
 
-define gb_LinkTarget__use_nss3
-
-endef
+gb_LinkTarget__use_nss3:=
 
 else
 
@@ -2245,10 +2243,11 @@
 ))
 
 define gb_LinkTarget__use_nss3
+$(call gb_LinkTarget_use_package,$(1),nss)
 $(call gb_LinkTarget_set_include,$(1),\
 	$$(INCLUDE) \
-	-I$(OUTDIR)/inc/mozilla/nspr \
-	-I$(OUTDIR)/inc/mozilla/nss \
+	-I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/public/nss \
+	-I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include \
 )
 
 $(call gb_LinkTarget_use_libraries,$(1),\
@@ -2260,6 +2259,7 @@
 endef
 
 define gb_LinkTarget__use_plc4
+$(call gb_LinkTarget_use_package,$(1),nss)
 $(call gb_LinkTarget_use_libraries,$(1),\
     plc4 \
 )
diff --git a/config_host.mk.in b/config_host.mk.in
index 08f6a85..ffb9514 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -405,6 +405,9 @@
 export NEON_VERSION=@NEON_VERSION@
 export NM=@NM@
 export nodep=@nodep@
+export NSS_MAJOR=@NSS_MAJOR@
+export NSS_MINOR=@NSS_MINOR@
+export NSS_PATCH=@NSS_PATCH@
 export NSS_CFLAGS=$(gb_SPACE)@NSS_CFLAGS@
 export NSS_LIBS=$(gb_SPACE)@NSS_LIBS@
 export NSSBUILDTOOLS=@NSSBUILDTOOLS@
diff --git a/configure.ac b/configure.ac
index 68723f4..d42e807 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8255,6 +8255,9 @@
     libo_MINGW_CHECK_DLL([SSL3], [ssl3])
 else
     SYSTEM_NSS="NO"
+	NSS_MAJOR="3"
+	NSS_MINOR="13"
+	NSS_PATCH="5"
     BUILD_TYPE="$BUILD_TYPE NSS"
     AC_MSG_RESULT([internal])
     if test "$build_os" = "cygwin"; then
@@ -8275,6 +8278,9 @@
     fi
 fi # system nss
 AC_SUBST(SYSTEM_NSS)
+AC_SUBST(NSS_MAJOR)
+AC_SUBST(NSS_MINOR)
+AC_SUBST(NSS_PATCH)
 AC_SUBST(NSS_CFLAGS)
 AC_SUBST(NSS_LIBS)
 AC_SUBST(NSSBUILDTOOLS)
diff --git a/libxmlsec/xmlsec1-configure.patch b/libxmlsec/xmlsec1-configure.patch
index ead9050..2db0426 100644
--- a/libxmlsec/xmlsec1-configure.patch
+++ b/libxmlsec/xmlsec1-configure.patch
@@ -97,10 +97,29 @@
 -    ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name"
 -    ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name"
 +    ac_nss_lib_dir="${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT}"
-+    ac_nss_inc_dir="${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/mozilla"
++    ac_nss_inc_dir="${WORKDIR}/UnpackedTarball/nss/mozilla/dist/out/include ${WORKDIR}/UnpackedTarball/nss/mozilla/dist/public"
  
      AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION)
      NSPR_INCLUDES_FOUND="no"
+@@ -637,15 +660,15 @@
+ 	NSPR_PRINIT_H="$with_nspr/include/prinit.h"
+     else
+ 	for dir in $ac_nss_inc_dir ; do
+-    	    if test -f $dir/nspr/prinit.h ; then
++    	    if test -f $dir/prinit.h ; then
+     		dnl do not add -I/usr/include because compiler does it anyway
+         	if test "z$dir" = "z/usr/include" ; then
+     		    NSPR_CFLAGS=""
+     		else
+-    		    NSPR_CFLAGS="-I$dir/nspr"
++    		    NSPR_CFLAGS="-I$dir"
+     		fi
+ 		NSPR_INCLUDES_FOUND="yes"
+-		NSPR_PRINIT_H="$dir/nspr/prinit.h"
++		NSPR_PRINIT_H="$dir/prinit.h"
+     		break
+     	    fi
+ 	done
 @@ -648,7 +671,7 @@
  	done
  	
diff --git a/nss/ExternalPackage_nss.mk b/nss/ExternalPackage_nss.mk
new file mode 100644
index 0000000..ae28d98
--- /dev/null
+++ b/nss/ExternalPackage_nss.mk
@@ -0,0 +1,78 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,nss,nss))
+
+$(eval $(call gb_ExternalPackage_use_external_project,nss,nss))
+
+$(eval $(call gb_ExternalPackage_add_files,nss,bin,\
+	config/nspr-config \
+	config/nss-config \
+))
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_files,nss,lib,\
+		mozilla/dist/out/lib/nspr4.lib \
+		mozilla/dist/out/lib/nss3.lib \
+		mozilla/dist/out/lib/nssdbm3.lib \
+		mozilla/dist/out/lib/nssutil3.lib \
+		mozilla/dist/out/lib/plc4.lib \
+		mozilla/dist/out/lib/plds4.lib \
+		mozilla/dist/out/lib/smime3.lib \
+		mozilla/dist/out/lib/softokn3.lib \
+		mozilla/dist/out/lib/sqlite3.lib \
+		mozilla/dist/out/lib/ssl3.lib \
+))
+else
+$(eval $(call gb_ExternalPackage_add_files,nss,lib,\
+		mozilla/nsprpub/out/pr/src/libnspr4.dll.a \
+		mozilla/dist/out/lib/libnss3.dll.a \
+		mozilla/dist/out/lib/libnssdbm3.dll.a \
+		mozilla/dist/out/lib/libnssutil3.dll.a \
+		mozilla/nsprpub/out/lib/libc/src/libplc4.dll.a \
+		mozilla/nsprpub/out/lib/ds/libplds4.dll.a \
+		mozilla/dist/out/lib/libsmime3.dll.a \
+		mozilla/dist/out/lib/libsoftokn3.dll.a \
+		mozilla/dist/out/lib/libsqlite3.dll.a \
+		mozilla/dist/out/lib/libssl3.dll.a \
+))
+endif
+$(eval $(call gb_ExternalPackage_add_files,nss,bin,\
+		mozilla/dist/out/lib/nspr4.dll \
+		mozilla/dist/out/lib/nss3.dll \
+		mozilla/dist/out/lib/nssdbm3.dll \
+		mozilla/dist/out/lib/nssutil3.dll \
+		mozilla/dist/out/lib/plc4.dll \
+		mozilla/dist/out/lib/plds4.dll \
+		mozilla/dist/out/lib/smime3.dll \
+		mozilla/dist/out/lib/softokn3.dll \
+		mozilla/dist/out/lib/sqlite3.dll \
+		mozilla/dist/out/lib/ssl3.dll \
+))
+else # OS!=WNT
+$(eval $(call gb_ExternalPackage_add_files,nss,lib,\
+		mozilla/dist/out/lib/libcrmf.a \
+		mozilla/dist/out/lib/libfreebl3.so \
+		mozilla/dist/out/lib/libnspr4.so \
+		mozilla/dist/out/lib/libnss3.so \
+		mozilla/dist/out/lib/libnssckbi.so \
+		mozilla/dist/out/lib/libnssdbm3.so \
+		mozilla/dist/out/lib/libnsssysinit.so \
+		mozilla/dist/out/lib/libnssutil3.so \
+		mozilla/dist/out/lib/libplc4.so \
+		mozilla/dist/out/lib/libplds4.so \
+		mozilla/dist/out/lib/libsmime3.so \
+		mozilla/dist/out/lib/libsoftokn3.so \
+		mozilla/dist/out/lib/libsqlite3.so \
+		mozilla/dist/out/lib/libssl3.so \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/nss/ExternalProject_nss.mk b/nss/ExternalProject_nss.mk
new file mode 100644
index 0000000..330a6e6
--- /dev/null
+++ b/nss/ExternalProject_nss.mk
@@ -0,0 +1,80 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,nss))
+
+$(eval $(call gb_ExternalProject_use_unpacked,nss,nss))
+
+$(eval $(call gb_ExternalProject_register_targets,nss,\
+	configure \
+	build \
+))
+
+$(call gb_ExternalProject_get_state_target,nss,configure):
+	cd $(EXTERNAL_WORKDIR) \
+	&& $(if $(filter MSC,$(COM)),LIB="$(ILIB)") \
+	mozilla/nsprpub/configure --includedir=$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include \
+	$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+	$(if $(filter MSCX,$(COM)$(CPU)),--enable-64bit) \
+	$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+	&& sed -e 's%@prefix@%$(OUTDIR)%' \
+	-e 's%@includedir@%$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/public/nss%' \
+	-e 's%@MOD_MAJOR_VERSION@%$(NSS_MAJOR)%' \
+	-e 's%@MOD_MINOR_VERSION@%$(NSS_MINOR)%' \
+	-e 's%@MOD_PATCH_VERSION@%$(NSS_PATCH)%' \
+	$(SRCDIR)/nss/nss-config.in > $(EXTERNAL_WORKDIR)/config/nss-config \
+	&& chmod a+x $(EXTERNAL_WORKDIR)/config/nss-config \
+	&& touch $@
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure)
+	cd $(EXTERNAL_WORKDIR)/mozilla/security/nss \
+	&& $(if $(debug),,BUILD_OPT=1) \
+	MOZ_MSVCVERSION=9 OS_TARGET=WIN95 \
+	PATH="$(NSSBUILDTOOLS)/msys/bin:$(NSSBUILDTOOLS)/moztools/bin:$(PATH)" \
+	$(if $(filter X,$(CPU)),USE_64=1) \
+	LIB="$(ILIB)" \
+	XCFLAGS="$(SOLARINC)" \
+	$(MAKE) -j1 nss_build_all RC="rc.exe $(SOLARINC)" \
+	&& touch $@
+
+
+else
+$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure)
+	cd $(EXTERNAL_WORKDIR)/mozilla/security/nss \
+	CC="$(CC) $(if $(filter YES,$(MINGW_SHARED_GCCLIB)),-shared-libgcc)" \
+	CXX="$(CXX) $(if $(filter YES,$(MINGW_SHARED_GCCLIB)),-shared-libgcc)" \
+	OS_LIBS="-ladvapi32 -lws2_32 -lmwsock -lwinm $(if $(filter YES,$(MINGW_SHARED_GXXLIB)),$(MINGW_SHARED_LIBSTDCPP))" \
+	OS_TARGET=WINNT RC="$(WINDRES)" OS_RELEASE="5.0" \
+	PATH="$(NSSBUILDTOOLS)/bin:$(PATH)" IMPORT_LIB_SUFFIX=dll.a \
+	NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --enable-shared --disable-static" \
+	NSINSTALL="$(PYTHON_FOR_BUILD) $(SRCDIR)/nss/nsinstall.py" \
+	$(MAKE) -j1 nss_build_all \
+	&& touch $@
+
+endif
+else # OS!=WNT
+$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure)
+	cd $(EXTERNAL_WORKDIR)/mozilla/security/nss \
+	&& $(if $(filter FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X,$(CPU)),USE_64=1)) \
+	$(if $(filter MACOSX,$(OS)),MACOS_SDK_DIR=$(MACOSX_SDK_PATH) \
+	$(if $(filter 1060 1070 1080,$(MAC_OS_X_VERSION_MIN_REQUIRED)),NSS_USE_SYSTEM_SQLITE=1)) \
+	$(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \
+	$(if $(filter YES,$(CROSS_COMPILING)),\
+	$(if $(filter MACOSXP,$(OS)$(CPU)),CPU_ARCH=ppc) \
+	NSINSTALL="$(subst $(INPATH),$(INPATH_FOR_BUILD),\
+	$(call gb_UnpackedTarball_get_dir,nss)/mozilla/security/coreconf/nsinstall/out/nsinstall)") \
+	NSDISTMODE=copy \
+	$(MAKE) -j1 $(if $(filter build,$(gb_Side)),build_coreconf,nss_build_all) \
+	&& touch $@
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/nss/Makefile b/nss/Makefile
new file mode 100644
index 0000000..ccb1c85
--- /dev/null
+++ b/nss/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/nss/Module_nss.mk b/nss/Module_nss.mk
new file mode 100644
index 0000000..5455fc0
--- /dev/null
+++ b/nss/Module_nss.mk
@@ -0,0 +1,22 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+
+$(eval $(call gb_Module_Module,nss))
+
+ifeq ($(SYSTEM_NSS),NO)
+ifeq ($(filter ANDROID IOS,$(OS)),)
+$(eval $(call gb_Module_add_targets,nss,\
+	UnpackedTarball_nss \
+	$(if $(filter build,$(gb_Side)),,ExternalPackage_nss) \
+	ExternalProject_nss \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/nss/UnpackedTarball_nss.mk b/nss/UnpackedTarball_nss.mk
new file mode 100644
index 0000000..6e9ad7b
--- /dev/null
+++ b/nss/UnpackedTarball_nss.mk
@@ -0,0 +1,24 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,nss))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,nss,$(NSS_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,nss,\
+	nss/nss.patch \
+	nss/nss.aix.patch \
+	nss/nss-3.13.5-zlib-werror.patch \
+	$(if $(filter MACOSX,$(OS)),nss/nss_macosx.patch) \
+	$(if $(filter WNTGCC,$(OS)$(COM)),nss/nspr-4.9-build.patch \
+	nss/nss-3.13.3-build.patch \
+	nss/nss.mingw.patch) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/nss/makefile.mk b/nss/makefile.mk
deleted file mode 100644
index 91c63d2..0000000
--- a/nss/makefile.mk
+++ /dev/null
@@ -1,269 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=.
-
-PRJNAME=nss
-TARGET=nss
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :	settings.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(SYSTEM_NSS)"=="YES"
-all:
-	@echo "NSS will not be built. Using system one instead."
-.ENDIF
-
-.IF "$(OS)" == "ANDROID" || "$(OS)" == "IOS"
- at all:
-	@echo "FIXME: NSS module not buildable yet on this platform"
-.ENDIF
-
-VER_MAJOR=3
-VER_MINOR=13
-VER_PATCH=5
-
-TARFILE_NAME=nss-$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)-with-nspr-4.9.1
-TARFILE_MD5=a0a861f539f0e7a91d05e6b9457e4db1
-TARFILE_ROOTDIR=nss-$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
-PATCH_FILES=nss.patch nss.aix.patch nss-config.patch \
-    nss-3.13.5-zlib-werror.patch
-# nss-3.13.5-zlib-werror.patch: avoid -Werror=implicit-function-declaration for
-# lseek, read, write
-
-.IF "$(OS)"=="MACOSX"
-PATCH_FILES+=nss_macosx.patch
-.ENDIF # "$(OS)"=="MACOSX"
-
-# For a MSVC build, not exporting BUILD_OPT causes the produced DLLs
-# to use the debug CRT. (The exact mechanism that causes this to
-# happen is a bit of a mystery...) That is confusing and wrong, as
-# nothing in LO otherwise uses that. It also makes testing a build
-# much harder for me at least, as I do that in a fairly pristine
-# virtual machine with no MSVC debugging runtime available. (The
-# normal CRT is bundled in the LO installer.)
-.IF "$(debug)" != "" && "$(OS)$(COM)" != "WNTMSC"
-.ELSE
-BUILD_OPT=1
-.EXPORT: BUILD_OPT
-.ENDIF
-
-.IF "$(OS)" == "MACOSX"
-my_prefix=/@.__________________________________________________$(EXTRPATH)
-.ELSE
-my_prefix=$(OUTDIR)
-.END
-
-CONFIGURE_ACTION=mozilla/nsprpub/configure --prefix=$(my_prefix) --includedir=$(OUTDIR)/inc/mozilla/nspr
-
-.IF "$(CROSS_COMPILING)"=="YES"
-CONFIGURE_ACTION+=--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
-.ENDIF
-
-.IF "$(OS)$(COM)$(CPUNAME)"=="WNTMSCX86_64"
-CONFIGURE_ACTION+=--enable-64bit
-.ENDIF
-
-CONFIGURE_ACTION+= ; \
-    sed -e 's\#@prefix@\#$(OUTDIR)\#' -e 's\#@includedir@\#$(OUTDIR)/inc/mozilla/nss\#' -e 's\#@MOD_MAJOR_VERSION@\#$(VER_MAJOR)\#' -e 's\#@MOD_MINOR_VERSION@\#$(VER_MINOR)\#' -e 's\#@MOD_PATCH_VERSION@\#$(VER_PATCH)\#' mozilla/security/nss/nss-config.in > mozilla/security/nss/nss-config ; \
-    chmod a+x mozilla/security/nss/nss-config
-
-.IF "$(OS)"!="WNT"
-.IF "$(OS)$(COM)"=="LINUXGCC"
-.IF "$(BUILD64)"=="1"
-# force 64-bit buildmode
-USE_64:=1
-.EXPORT : USE_64
-.ENDIF
-.ENDIF
-
-.IF "$(OS)$(COM)"=="MACOSXGCC"
-.IF "$(BUILD64)"=="1"
-# force 64-bit buildmode
-USE_64:=1
-.EXPORT : USE_64
-.ENDIF
-.ENDIF
-
-.IF "$(OS)$(COM)"=="FREEBSDGCC"
-.IF "$(CPUNAME)"=="X86_64"
-# force 64-bit buildmode
-USE_64:=1
-.EXPORT : USE_64
-.ENDIF
-.ENDIF
-
-.IF "$(OS)"=="MACOSX"
-MACOS_SDK_DIR:=$(MACOSX_SDK_PATH)
-.EXPORT : MACOS_SDK_DIR
-.ENDIF # "$(OS)"=="MACOSX"
-
-OUT2LIB=mozilla/dist/out/lib/*$(DLLPOST) mozilla/dist/out/lib/libcrmf.a
-
-OUT2BIN=config/nspr-config mozilla/security/nss/nss-config
-
-BUILD_DIR=mozilla/security/nss
-BUILD_ACTION= $(GNUMAKE) nss_build_all -j1
-
-.IF "$(CROSS_COMPILING)"=="YES"
-
-.IF "$(OS)-$(CPUNAME)"="MACOSX-POWERPC"
-# Hardcode this for now... need to add more when/if cross-compiling to
-# other desktop OSes, yeah, this is silly, but the nss build mechanism
-# is a bit messy, I could not figure out how to get it to get CPU_ARCH
-# automatically when cross-compiling
-BUILD_ACTION+= CPU_ARCH=ppc
-.ENDIF
-
-# When cross-compiling need to use a nsinstall built for the build
-# platform, so yeah, whole nss built for the build platform just for
-# that... But oh well, nss is small compared to LO;)
-BUILD_ACTION+= NSINSTALL=$(SRC_ROOT)/nss/$(INPATH_FOR_BUILD)/misc/build/$(TARFILE_ROOTDIR)/mozilla/security/coreconf/nsinstall/out/nsinstall
-
-.ENDIF
-
-#Note: with the new version the libfreebl3.so gets built in a way that does
-# not conflict with the system one on Linux automatically;
-# it is no longer necessary to add a workaround for #i105566# && moz#513024#
-.IF "$(OS)$(COM)"=="SOLARISGCC"
-BUILD_ACTION+=NS_USE_GCC=1
-.ENDIF
-
-# Otherwise, LibreOffice.app/Contents/MacOS/python -c 'import uno' fails to
-# dlopen LibreOffice.app/Contents/MacOS/libpyuno.dylib (at
-# pyuno/source/module/pyuno_dlopenwrapper.c:73) with dlerror "Symbol not found:
-# _sqlite3_wal_checkpoint; Referenced from: /System/Library/Frameworks/
-# CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/
-# CFNetwork; Expected in: [...]/LibreOffice.app/Contents/MacOS/libsqlite3.dylib;
-# in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/
-# CFNetwork.framework/Versions/A/CFNetwork":
-.IF "$(OS)" == "MACOSX" && "$(MAC_OS_X_VERSION_MIN_REQUIRED)" >= "1060"
-BUILD_ACTION += NSS_USE_SYSTEM_SQLITE=1
-.END
-
-.ENDIF			# "$(OS)"!="WNT"
-
-
-.IF "$(OS)"=="WNT"
-
-.IF "$(COM)"=="GCC"
-
-PATCH_FILES += \
-	       nspr-4.9-build.patch \
-	       nss-3.13.3-build.patch \
-	       nss.patch.mingw \
-
-
-PATH!:=$(NSSBUILDTOOLS)/bin:$(PATH)
-
-nss_CC=$(CC)
-nss_CXX=$(CXX)
-.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
-nss_CC+=-shared-libgcc
-nss_CXX+=-shared-libgcc
-.ENDIF
-
-nss_LIBS=-ladvapi32 -lws2_32 -lmswsock -lwinmm
-.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
-nss_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
-.ENDIF
-nss_LDFLAGS=
-
-OS_TARGET=WINNT
-.EXPORT : OS_TARGET
-
-BUILD_DIR=mozilla/security/nss
-BUILD_ACTION=$(GNUMAKE) NS_USE_GCC=1 CC="$(nss_CC)" CXX="$(nss_CXX)" OS_LIBS="$(nss_LIBS)" PATH="$(PATH)" NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --enable-shared --disable-static" LDFLAGS="$(nss_LDFLAGS)" RANLIB="$(RANLIB)" RC="$(WINDRES)" OS_RELEASE=5.0 NSINSTALL="$(PYTHON_FOR_BUILD) $(SRC_ROOT)/nss/nsinstall.py" IMPORT_LIB_SUFFIX=dll.a nss_build_all
-
-OUT2LIB= \
-    mozilla/nsprpub/out/pr/src/libnspr4.dll.a \
-    mozilla/dist/out/lib/libnss3.dll.a \
-    mozilla/dist/out/lib/libnssdbm3.dll.a \
-    mozilla/dist/out/lib/libnssutil3.dll.a \
-    mozilla/nsprpub/out/lib/libc/src/libplc4.dll.a \
-    mozilla/nsprpub/out/lib/ds/libplds4.dll.a \
-    mozilla/dist/out/lib/libsmime3.dll.a \
-    mozilla/dist/out/lib/libsoftokn3.dll.a \
-    mozilla/dist/out/lib/libsqlite3.dll.a \
-    mozilla/dist/out/lib/libssl3.dll.a
-
-.ELSE			# "$(COM)"=="GCC"
-MOZ_MSVCVERSION= 9
-.EXPORT : MOZ_MSVCVERSION
-nss_build:=$(shell cygpath -p $(NSSBUILDTOOLS))
-
-#Using WINNT will cause at least that nspr4.dll, plc4.dll, plds4.dll 
-#become libnspr4.dll, libplc4.dll, libplds4.dll
-#WINNT causes the use of Microsoft fibers (specific to Windows NT and Windows 2000). 
-#OS_TARGET= WINNT
-OS_TARGET=WIN95
-.EXPORT : OS_TARGET
-
-#To build nss one has to call "make nss_build_all" in 
-#mozilla/security/nss
-
-.IF "$(CPUNAME)"=="X86_64"
-PASS_USE_64=USE_64=1
-.ENDIF
-
-NSS_BUILD_DIR=$(ABS_PACKAGE_DIR)/$(TARFILE_ROOTDIR)/mozilla/security/nss
-BUILD_ACTION= PATH="$(nss_build)/msys/bin:$(nss_build)/moztools/bin:$(PATH)" && $(NSSBUILDTOOLS)/msys/bin/bash -i \
-    -c "cd $(NSS_BUILD_DIR) && make $(PASS_USE_64) nss_build_all"
-
-OUT2LIB= \
-     mozilla/dist/out/lib/nspr4.lib \
-     mozilla/dist/out/lib/nss3.lib \
-     mozilla/dist/out/lib/nssdbm3.lib \
-     mozilla/dist/out/lib/nssutil3.lib \
-     mozilla/dist/out/lib/plc4.lib \
-     mozilla/dist/out/lib/plds4.lib \
-     mozilla/dist/out/lib/smime3.lib \
-     mozilla/dist/out/lib/softokn3.lib \
-     mozilla/dist/out/lib/sqlite3.lib \
-     mozilla/dist/out/lib/ssl3.lib
-
-.ENDIF			# "$(COM)"=="GCC"
-
-OUT2BIN=mozilla/dist/out/lib/*$(DLLPOST) \
-     config/nspr-config \
-     mozilla/security/nss/nss-config
-
-.ENDIF			# "$(OS)"=="WNT"
-
-
-OUTDIR2INC=mozilla/dist/public/nss mozilla/dist/out/include
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_ext.mk
-.INCLUDE :	target.mk
-.INCLUDE :	tg_ext.mk
-
-
diff --git a/nss/nss-config.in b/nss/nss-config.in
new file mode 100644
index 0000000..141d483
--- /dev/null
+++ b/nss/nss-config.in
@@ -0,0 +1,147 @@
+#!/bin/sh
+
+prefix=@prefix@
+
+major_version=@MOD_MAJOR_VERSION@
+minor_version=@MOD_MINOR_VERSION@
+patch_version=@MOD_PATCH_VERSION@
+
+usage()
+{
+	cat <<EOF
+Usage: nss-config [OPTIONS] [LIBRARIES]
+Options:
+	[--prefix[=DIR]]
+	[--exec-prefix[=DIR]]
+	[--includedir[=DIR]]
+	[--libdir[=DIR]]
+	[--version]
+	[--libs]
+	[--cflags]
+Dynamic Libraries:
+	nss
+	ssl
+	smime
+EOF
+	exit $1
+}
+
+if test $# -eq 0; then
+	usage 1 1>&2
+fi
+
+lib_ssl=yes
+lib_smime=yes
+lib_nss=yes
+lib_nssutil=yes
+
+while test $# -gt 0; do
+  case "$1" in
+  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  case $1 in
+    --prefix=*)
+      prefix=$optarg
+      ;;
+    --prefix)
+      echo_prefix=yes
+      ;;
+    --exec-prefix=*)
+      exec_prefix=$optarg
+      ;;
+    --exec-prefix)
+      echo_exec_prefix=yes
+      ;;
+    --includedir=*)
+      includedir=$optarg
+      ;;
+    --includedir)
+      echo_includedir=yes
+      ;;
+    --libdir=*)
+      libdir=$optarg
+      ;;
+    --libdir)
+      echo_libdir=yes
+      ;;
+    --version)
+      echo ${major_version}.${minor_version}.${patch_version}
+      ;;
+    --cflags)
+      echo_cflags=yes
+      ;;
+    --libs)
+      echo_libs=yes
+      ;;
+    ssl)
+      lib_ssl=yes
+      ;;
+    smime)
+      lib_smime=yes
+      ;;
+    nss)
+      lib_nss=yes
+      ;;
+    nssutil)
+      lib_nssutil=yes
+      ;;
+    *)
+      usage 1 1>&2
+      ;;
+  esac
+  shift
+done
+
+# Set variables that may be dependent upon other variables
+if test -z "$exec_prefix"; then
+    exec_prefix=${prefix}
+fi
+if test -z "$includedir"; then
+    includedir=@includedir@
+fi
+if test -z "$libdir"; then
+    libdir=${exec_prefix}/lib
+fi
+
+if test "$echo_prefix" = "yes"; then
+    echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+    echo $exec_prefix
+fi
+
+if test "$echo_includedir" = "yes"; then
+    echo $includedir
+fi
+
+if test "$echo_libdir" = "yes"; then
+    echo $libdir
+fi
+
+if test "$echo_cflags" = "yes"; then
+    echo -I$includedir
+fi
+
+if test "$echo_libs" = "yes"; then
+      libdirs="-L$libdir"
+      if test `uname` != Darwin; then
+       libdirs="-Wl,-rpath-link,$libdir $libdirs"
+      fi
+      if test -n "$lib_ssl"; then
+	libdirs="$libdirs -lssl${major_version}"
+      fi
+      if test -n "$lib_smime"; then
+	libdirs="$libdirs -lsmime${major_version}"
+      fi
+      if test -n "$lib_nss"; then
+	libdirs="$libdirs -lnss${major_version}"
+      fi
+      if test -n "$lib_nssutil"; then
+        libdirs="$libdirs -lnssutil${major_version}"
+      fi
+      echo $libdirs
+fi      
+
diff --git a/nss/nss-config.patch b/nss/nss-config.patch
deleted file mode 100644
index 071cb99..0000000
--- a/nss/nss-config.patch
+++ /dev/null
@@ -1,150 +0,0 @@
---- /dev/null
-+++ misc/build/nss-3.13.5/mozilla/security/nss/nss-config.in	2010-06-11 16:35:54.946870871 +0200
-@@ -0,0 +1,147 @@
-+#!/bin/sh
-+
-+prefix=@prefix@
-+
-+major_version=@MOD_MAJOR_VERSION@
-+minor_version=@MOD_MINOR_VERSION@
-+patch_version=@MOD_PATCH_VERSION@
-+
-+usage()
-+{
-+	cat <<EOF
-+Usage: nss-config [OPTIONS] [LIBRARIES]
-+Options:
-+	[--prefix[=DIR]]
-+	[--exec-prefix[=DIR]]
-+	[--includedir[=DIR]]
-+	[--libdir[=DIR]]
-+	[--version]
-+	[--libs]
-+	[--cflags]
-+Dynamic Libraries:
-+	nss
-+	ssl
-+	smime
-+EOF
-+	exit $1
-+}
-+
-+if test $# -eq 0; then
-+	usage 1 1>&2
-+fi
-+
-+lib_ssl=yes
-+lib_smime=yes
-+lib_nss=yes
-+lib_nssutil=yes
-+
-+while test $# -gt 0; do
-+  case "$1" in
-+  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-+  *) optarg= ;;
-+  esac
-+
-+  case $1 in
-+    --prefix=*)
-+      prefix=$optarg
-+      ;;
-+    --prefix)
-+      echo_prefix=yes
-+      ;;
-+    --exec-prefix=*)
-+      exec_prefix=$optarg
-+      ;;
-+    --exec-prefix)
-+      echo_exec_prefix=yes
-+      ;;
-+    --includedir=*)
-+      includedir=$optarg
-+      ;;
-+    --includedir)
-+      echo_includedir=yes
-+      ;;
-+    --libdir=*)
-+      libdir=$optarg
-+      ;;
-+    --libdir)
-+      echo_libdir=yes
-+      ;;
-+    --version)
-+      echo ${major_version}.${minor_version}.${patch_version}
-+      ;;
-+    --cflags)
-+      echo_cflags=yes
-+      ;;
-+    --libs)
-+      echo_libs=yes
-+      ;;
-+    ssl)
-+      lib_ssl=yes
-+      ;;
-+    smime)
-+      lib_smime=yes
-+      ;;
-+    nss)
-+      lib_nss=yes
-+      ;;
-+    nssutil)
-+      lib_nssutil=yes
-+      ;;
-+    *)
-+      usage 1 1>&2
-+      ;;
-+  esac
-+  shift
-+done
-+
-+# Set variables that may be dependent upon other variables
-+if test -z "$exec_prefix"; then
-+    exec_prefix=${prefix}
-+fi
-+if test -z "$includedir"; then
-+    includedir=@includedir@
-+fi
-+if test -z "$libdir"; then
-+    libdir=${exec_prefix}/lib
-+fi
-+
-+if test "$echo_prefix" = "yes"; then
-+    echo $prefix
-+fi
-+
-+if test "$echo_exec_prefix" = "yes"; then
-+    echo $exec_prefix
-+fi
-+
-+if test "$echo_includedir" = "yes"; then
-+    echo $includedir
-+fi
-+
-+if test "$echo_libdir" = "yes"; then
-+    echo $libdir
-+fi
-+
-+if test "$echo_cflags" = "yes"; then
-+    echo -I$includedir
-+fi
-+
-+if test "$echo_libs" = "yes"; then
-+      libdirs="-L$libdir"
-+      if test `uname` != Darwin; then
-+       libdirs="-Wl,-rpath-link,$libdir $libdirs"
-+      fi
-+      if test -n "$lib_ssl"; then
-+	libdirs="$libdirs -lssl${major_version}"
-+      fi
-+      if test -n "$lib_smime"; then
-+	libdirs="$libdirs -lsmime${major_version}"
-+      fi
-+      if test -n "$lib_nss"; then
-+	libdirs="$libdirs -lnss${major_version}"
-+      fi
-+      if test -n "$lib_nssutil"; then
-+        libdirs="$libdirs -lnssutil${major_version}"
-+      fi
-+      echo $libdirs
-+fi      
-+
diff --git a/nss/nss.patch.mingw b/nss/nss.mingw.patch
similarity index 100%
rename from nss/nss.patch.mingw
rename to nss/nss.mingw.patch
diff --git a/nss/prj/build.lst b/nss/prj/build.lst
index 2377ac2..9c4caa1 100644
--- a/nss/prj/build.lst
+++ b/nss/prj/build.lst
@@ -1,3 +1,2 @@
 ns	nss	: solenv soltools NULL
-ns	nss						nmake	-	usr1	ns_mkout NULL
-ns	nss						nmake	-	all	ns_nss NULL
+ns	nss\prj						nmake	-	all	ns_nss NULL
diff --git a/nss/prj/d.lst b/nss/prj/d.lst
index 09c38c2..e69de29 100644
--- a/nss/prj/d.lst
+++ b/nss/prj/d.lst
@@ -1,34 +0,0 @@
-mkdir: %_DEST%\inc\mozilla\nspr
-mkdir: %_DEST%\inc\mozilla\nspr\obsolete
-mkdir: %_DEST%\inc\mozilla\nspr\private
-mkdir: %_DEST%\inc\mozilla\nss
-mkdir: %_DEST%\lib\sqlite
-
-..\%__SRC%\inc\include\* %_DEST%\inc\mozilla\nspr
-..\%__SRC%\inc\include\obsolete\protypes.h %_DEST%\inc\mozilla\nspr\obsolete\protypes.h
-..\%__SRC%\inc\include\private\*.h %_DEST%\inc\mozilla\nspr\private
-..\%__SRC%\inc\nss\*.h %_DEST%\inc\mozilla\nss
-
-..\%__SRC%\lib\libfreebl3.* %_DEST%\lib\libfreebl3.*
-..\%__SRC%\lib\libfreebl_32fpu_3.* %_DEST%\lib\libfreebl_32fpu_3.*
-..\%__SRC%\lib\libfreebl_32int64_3.* %_DEST%\lib\libfreebl_32int64_3.*
-..\%__SRC%\lib\libfreebl_32int_3.* %_DEST%\lib\libfreebl_32int_3.*
-..\%__SRC%\lib\libfreebl_64int_3.* %_DEST%\lib\libfreebl_64int_3.*
-..\%__SRC%\lib\libfreebl_64fpu_3.* %_DEST%\lib\libfreebl_64fpu_3.*
-..\%__SRC%\lib\libnspr4.* %_DEST%\lib\libnspr4.*
-..\%__SRC%\lib\libnss3.* %_DEST%\lib\libnss3.*
-..\%__SRC%\lib\libnssckbi.* %_DEST%\lib\libnssckbi.*
-..\%__SRC%\lib\libnssdbm3.* %_DEST%\lib\libnssdbm3.*
-..\%__SRC%\lib\libnssutil3.* %_DEST%\lib\libnssutil3.*
-..\%__SRC%\lib\libplc4.* %_DEST%\lib\libplc4.*
-..\%__SRC%\lib\libplds4.* %_DEST%\lib\libplds4.*
-..\%__SRC%\lib\libsmime3.* %_DEST%\lib\libsmime3.*
-..\%__SRC%\lib\libsoftokn3.* %_DEST%\lib\libsoftokn3.*
-..\%__SRC%\lib\libssl3.* %_DEST%\lib\libssl3.*
-..\%__SRC%\lib\libcrmf.a %_DEST%\lib\libcrmf.a
-
-..\%__SRC%\lib\libsqlite3.* %_DEST%\lib\sqlite\libsqlite3.*
-..\%__SRC%\lib\*.lib %_DEST%\lib
-
-..\%__SRC%\bin\* %_DEST%\bin
-
diff --git a/nss/prj/dmake b/nss/prj/dmake
deleted file mode 100644
index e69de29..0000000
--- a/nss/prj/dmake
+++ /dev/null
diff --git a/openldap/ExternalProject_openldap.mk b/openldap/ExternalProject_openldap.mk
index 5f739f0..e55296a 100644
--- a/openldap/ExternalProject_openldap.mk
+++ b/openldap/ExternalProject_openldap.mk
@@ -32,8 +32,8 @@
 		$(if $(filter YES,$(SYSTEM_NSS)), \
 			CPPFLAGS="$(NSS_CFLAGS)" CFLAGS="$(NSS_CFLAGS)" LDFLAGS="$(NSS_LIBS)" \
 			, \
-			CPPFLAGS="-I $(OUTDIR)/inc/mozilla/nss -I $(OUTDIR)/inc/mozilla/nspr" \
-			CFLAGS="-I $(OUTDIR)/inc/mozilla/nss -I $(OUTDIR)/inc/mozilla/nspr" \
+			CPPFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include" \
+			CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include" \
 			LDFLAGS="-L$(OUTDIR)/lib" \
 		) \
 	&& MAKEFLAGS= && $(MAKE) \

-- 
To view, visit https://gerrit.libreoffice.org/1529
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59edc4c437abccc201823d97f1cbec230d273b05
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Peter Foley <pefoley2 at verizon.net>



More information about the LibreOffice mailing list