configure.ac                                  |    2 -
 external/libxml2/UnpackedTarball_libxml2.mk   |    3 +
 external/libxml2/libxml2-config.patch.1       |   43 --------------------------
 external/libxml2/xml2-config.in               |   28 ++++++++++++++++
 external/redland/UnpackedTarball_raptor.mk    |    1 
 external/redland/raptor/libxml-override.patch |   13 -------
 6 files changed, 31 insertions(+), 59 deletions(-)

New commits:
commit 5c044ae7a3246bddbd0513bd5ed3efef10cb1503
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sun May 30 13:23:16 2021 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Sep 15 10:56:29 2022 +0200

    libxml2: use xml2-config dummy for internal build
    
    When building a static LO with --disable-dynloading on Linux,
    --without-system-libs failed for me. And it left me really puzzled:
    raptor configure failed and claimed it couldn't link libxml2.
    
    raptor's config.log showed missing math functions. xml2-config of
    LO's build is patched and it includes a -lm. The xml2-config in my
    chroot doesn't. But we explicitly pass the xml2-config for
    non-system-libxml2 build. Reading the configure from raptor didn't
    reveal a way, that it could somehow pick up the xml2-config from
    the chroot, but that code is autoconf-complex...
    
    When running "sh -x configure", it turned out the configure script
    actually picks up the LIBXML_* flags from the environment, which
    are set by LO's config_host.mk. These just add -lm for Android.
    
    So this adds a xml2-config.in "dummy", which overwrites the one
    from the libxml2 source and just echos LO's LIBXML_* values and
    it adds -lm for all DISABLE_DYNLOADING targets.
    
    Change-Id: Ia713cf80c8e7dc989cf23c224e7a0f7ea1210a87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116409
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>
    (cherry picked from commit 8b9f8f0f9d38cc64f742fe5358fce88d0f82391a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139965
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/configure.ac b/configure.ac
index 8ef428589d79..3a39b672a033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9614,7 +9614,7 @@ else
         
LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
     else
         LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
-        if test "$_os" = Android; then
+        if test "$DISABLE_DYNLOADING" = TRUE; then
             LIBXML_LIBS="$LIBXML_LIBS -lm"
         fi
     fi
diff --git a/external/libxml2/UnpackedTarball_libxml2.mk 
b/external/libxml2/UnpackedTarball_libxml2.mk
index 83df02849cb3..8c81c3d26e4c 100644
--- a/external/libxml2/UnpackedTarball_libxml2.mk
+++ b/external/libxml2/UnpackedTarball_libxml2.mk
@@ -14,7 +14,6 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,libxml2,$(LIBXML_TARBALL),,libxml2)
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libxml2))
 
 $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\
-       external/libxml2/libxml2-config.patch.1 \
        external/libxml2/libxml2-global-symbols.patch \
        external/libxml2/libxml2-vc10.patch \
        $(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \
@@ -23,4 +22,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\
                external/libxml2/libxml2-icu.patch.0) \
 ))
 
+$(eval $(call 
gb_UnpackedTarball_add_file,libxml2,xml2-config.in,external/libxml2/xml2-config.in))
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/libxml2/libxml2-config.patch.1 
b/external/libxml2/libxml2-config.patch.1
deleted file mode 100644
index 5a2ef1485e92..000000000000
--- a/external/libxml2/libxml2-config.patch.1
+++ /dev/null
@@ -1,43 +0,0 @@
-Hack the xml2-config to return paths into WORKDIR.
-
---- a/xml2-config.in   2009-12-17 11:45:20.000000000 +0000
-+++ b/xml2-config.in   2009-12-17 11:45:36.000000000 +0000
-@@ -1,9 +1,14 @@
- #! /bin/sh
- 
--prefix=@prefix@
--exec_prefix=@exec_prefix@
--includedir=@includedir@
--libdir=@libdir@
-+#prefix=@prefix@
-+#exec_prefix=@exec_prefix@
-+#includedir=@includedir@
-+#libdir=@libdir@
-+
-+prefix=${WORKDIR}/UnpackedTarball/libxml2
-+exec_prefix=${WORKDIR}/UnpackedTarball/libxml2
-+includedir=${WORKDIR}/UnpackedTarball/libxml2/include
-+libdir=${WORKDIR}/UnpackedTarball/libxml2/.libs
- cflags=
- libs=
- 
-@@ -67,7 +72,8 @@
-       ;;
- 
-     --cflags)
--        cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
-+        #cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
-+        cflags="-I${includedir}"
-               ;;
- 
-     --libtool-libs)
-@@ -91,7 +96,8 @@
-             libs="@XML_LIBDIR@ $libs"
-         fi
- 
--        libs="$libs @WIN32_EXTRA_LIBADD@"
-+        #libs="$libs @WIN32_EXTRA_LIBADD@"
-+        libs="-L${libdir} -lxml2 -lm"
-         ;;
- 
-     *)
diff --git a/external/libxml2/xml2-config.in b/external/libxml2/xml2-config.in
new file mode 100644
index 000000000000..164508e47e67
--- /dev/null
+++ b/external/libxml2/xml2-config.in
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+while test $# -gt 0; do
+    case "$1" in
+    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+    *) optarg= ;;
+    esac
+
+    case "$1" in
+    --version)
+       echo @VERSION@
+       exit 0
+        ;;
+    --cflags)
+        cflags="$LIBXML_CFLAGS"
+        ;;
+    --libs)
+        libs="$LIBXML_LIBS"
+        ;;
+    esac
+    shift
+done
+
+if test -n "$cflags$libs"; then
+    echo $cflags $libs
+fi
+
+exit 0
diff --git a/external/redland/UnpackedTarball_raptor.mk 
b/external/redland/UnpackedTarball_raptor.mk
index c5ff226168d8..fbdc8b6f5510 100644
--- a/external/redland/UnpackedTarball_raptor.mk
+++ b/external/redland/UnpackedTarball_raptor.mk
@@ -30,7 +30,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,raptor,\
        
external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1
 \
        
external/redland/raptor/0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1
 \
        external/redland/raptor/libtool.patch \
-       external/redland/raptor/libxml-override.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/redland/raptor/libxml-override.patch 
b/external/redland/raptor/libxml-override.patch
deleted file mode 100644
index edc2d0d497a4..000000000000
--- a/external/redland/raptor/libxml-override.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- configure
-+++ configure
-@@ -14387,8 +14387,8 @@
- 
- libxml_source=no
- if test "X$XML_CONFIG" != "X"; then
--  LIBXML_CFLAGS=`$XML_CONFIG --cflags`
--  LIBXML_LIBS=`$XML_CONFIG --libs`
-+  : ${LIBXML_CFLAGS=`$XML_CONFIG --cflags`}
-+  : ${LIBXML_LIBS=`$XML_CONFIG --libs`}
- 
-   CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS"
-   LIBS="$LIBS $LIBXML_LIBS"

Reply via email to