Files
loongoffice/external/libxmlsec/xmlsec1-configure.patch.1
Stephan Bergmann 8646ab97dc Remove MinGW support
In OOo times, there'd originally been efforts to allow building on Windows with
MinGW.  Later, in LO times, this has been shifted to an attempt of cross-
compiling for Windows on Linux.  That attempt can be considered abandoned, and
the relevant code rotting.

Due to this heritage, there are now three kinds of MinGW-specific code in LO:

* Code from the original OOo native Windows effort that is no longer relevant
  for the LO cross-compilation effort, but has never been removed properly.

* Code from the original OOo native Windows effort that is re-purposed for the
  LO cross-compilation effort.

* Code that has been added specifially for the LO cross-compilation effort.

All three kinds of code are removed.

(An unrelated, remaining use of MinGW is for --enable-build-unowinreg, utilizing
--with-mingw-cross-compiler, MINGWCXX, and MINGWSTRIP.)

Change-Id: I49daad8669b4cbe49fa923050c4a4a6ff7dda568
Reviewed-on: https://gerrit.libreoffice.org/34127
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-10 18:01:27 +00:00

184 lines
6.5 KiB
Groff

From 70139f4422c78f21ed9a7435267e37d15c4c8fa6 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 4 Mar 2016 16:06:19 +0100
Subject: [PATCH] xmlsec1-configure.patch
Conflicts:
Makefile.am
Makefile.in
configure.ac
---
Makefile.am | 2 +-
Makefile.in | 2 +-
configure.ac | 50 +++++++++++++++++++++++++++++++++++++++-----------
win32/Makefile.msvc | 2 +-
4 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 3453c01..2c5effb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
NULL =
SAFE_VERSION = @XMLSEC_VERSION_SAFE@
-SUBDIRS = include src apps man docs
+SUBDIRS = include src
TEST_APP = apps/xmlsec1$(EXEEXT)
DEFAULT_CRYPTO = @XMLSEC_DEFAULT_CRYPTO@
diff --git a/Makefile.in b/Makefile.in
index f35b430..f3ca4ed 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -468,7 +468,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
NULL =
SAFE_VERSION = @XMLSEC_VERSION_SAFE@
-SUBDIRS = include src apps man docs
+SUBDIRS = include src
TEST_APP = apps/xmlsec1$(EXEEXT)
DEFAULT_CRYPTO = @XMLSEC_DEFAULT_CRYPTO@
bin_SCRIPTS = xmlsec1-config
diff --git a/configure.ac b/configure.ac
index b8770ad..721e4ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -227,8 +227,8 @@ dnl find libxml
dnl ==========================================================================
LIBXML_MIN_VERSION="2.7.4"
LIBXML_CONFIG="xml2-config"
-LIBXML_CFLAGS=""
-LIBXML_LIBS=""
+LIBXML_CFLAGS="$LIBXML_CFLAGS"
+LIBXML_LIBS="$LIBXML_LIBS"
LIBXML_FOUND="no"
AC_ARG_WITH(libxml,
[ --with-libxml=[PFX] libxml2 location]
@@ -237,6 +237,8 @@ AC_ARG_WITH(libxml-src,
[ --with-libxml-src=[PFX] not installed yet libxml2 location]
)
+if test "z$LIBXML_CFLAGS" = "z" -o "z$LIBXML_LIBS" = "z"; then
+
if test "z$with_libxml" = "zno" -o "z$with_libxml_src" = "zno"; then
AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION)
AC_MSG_ERROR(libxml2 >= $LIBXML_MIN_VERSION is required for $XMLSEC_PACKAGE)
@@ -285,6 +287,8 @@ if test "z$LIBXML_FOUND" = "zno" ; then
fi
fi
+fi
+
AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_LIBS)
AC_SUBST(LIBXML_CONFIG)
@@ -598,12 +602,26 @@ dnl ==========================================================================
XMLSEC_NO_NSS="1"
SEAMONKEY_MIN_VERSION="1.0"
MOZILLA_MIN_VERSION="1.4"
+if test "z$MOZ_FLAVOUR" = "zfirefox" ; then
+ MOZILLA_MIN_VERSION="1.0"
+fi
NSS_MIN_VERSION="3.9"
NSPR_MIN_VERSION="4.4.1"
NSS_CFLAGS=""
NSS_LIBS=""
-NSS_LIBS_LIST="-lnss3 -lsmime3"
-NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4"
+
+case $host_os in
+cygwin* | pw32*)
+ NSS_LIBS_LIST="-lnss3 -lsmime3"
+ NSPR_LIBS_LIST="-lnspr4"
+ ;;
+
+*)
+ NSS_LIBS_LIST="-lnss3 -lsmime3"
+ NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4"
+ ;;
+esac
+
NSS_CRYPTO_LIB="$XMLSEC_PACKAGE-nss"
NSS_FOUND="no"
NSPR_PACKAGE=mozilla-nspr
@@ -630,6 +648,16 @@ elif test "z$with_nss" = "z" -a "z$with_nspr" = "z" -a "z$with_mozilla_ver" = "z
dnl We are going to try all options
dnl
if test "z$NSS_FOUND" = "zno" ; then
+ PKG_CHECK_MODULES(NSS, $MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION,
+ [NSS_FOUND=yes NSPR_PACKAGE=$MOZ_FLAVOUR-nspr NSS_PACKAGE=$MOZ_FLAVOUR-nss],
+ [NSS_FOUND=no])
+ fi
+ if test "z$NSS_FOUND" = "zno" ; then
+ PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8,
+ [NSS_FOUND=yes NSPR_PACKAGE=nspr NSS_PACKAGE=nss],
+ [NSS_FOUND=no])
+ fi
+ if test "z$NSS_FOUND" = "zno" ; then
PKG_CHECK_MODULES(NSS, seamonkey-nspr >= $NSPR_MIN_VERSION seamonkey-nss >= $SEAMONKEY_MIN_VERSION,
[NSS_FOUND=yes NSPR_PACKAGE=seamonkey-nspr NSS_PACKAGE=seamonkey-nss],
[NSS_FOUND=no])
@@ -661,8 +689,8 @@ if test "z$NSS_FOUND" = "zno" ; then
ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION
fi
- 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="${WORKDIR}/UnpackedTarball/nss/dist/out/lib"
+ ac_nss_inc_dir="${WORKDIR}/UnpackedTarball/nss/dist/out/include ${WORKDIR}/UnpackedTarball/nss/dist/public"
AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION)
NSPR_INCLUDES_FOUND="no"
@@ -683,21 +711,21 @@ if test "z$NSS_FOUND" = "zno" ; then
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
for dir in $ac_nss_lib_dir ; do
- if test -f $dir/libnspr4$shrext ; then
+ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
dnl do not add -L/usr/lib because compiler does it anyway
if test "z$dir" = "z/usr/lib" ; then
NSPR_LIBS="$NSPR_LIBS_LIST"
@@ -768,7 +796,7 @@ if test "z$NSS_FOUND" = "zno" ; then
done
for dir in $ac_nss_lib_dir ; do
- if test -f $dir/libnss3$shrext ; then
+ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then
dnl do not add -L/usr/lib because compiler does it anyway
if test "z$dir" = "z/usr/lib" ; then
NSS_LIBS="$NSS_LIBS_LIST"
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 8c887a1..bbc661a 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -394,7 +394,7 @@ APP_LIBS = $(SOLIBS) $(XMLSEC_CRYPTO_SOLIBS)
XMLSEC_OPENSSL_SOLIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib
XMLSEC_OPENSSL_ALIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib
-XMLSEC_NSS_SOLIBS = smime3.lib ssl3.lib nss3.lib libnspr4.lib libplds4.lib libplc4.lib kernel32.lib user32.lib gdi32.lib
+XMLSEC_NSS_SOLIBS = smime3.lib nss3.lib nspr4.lib kernel32.lib user32.lib gdi32.lib
XMLSEC_NSS_ALIBS = smime3.lib ssl3.lib nss3.lib libnspr4_s.lib libplds4_s.lib libplc4_s.lib kernel32.lib user32.lib gdi32.lib
XMLSEC_MSCRYPTO_SOLIBS = kernel32.lib user32.lib gdi32.lib Crypt32.lib Advapi32.lib
--
2.6.6