summaryrefslogtreecommitdiffstats
path: root/external/redland
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-09-03 10:45:38 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-09-03 14:29:36 +0200
commita574bb602031f0d1febb059c7dc9d1c4937271c6 (patch)
tree4ac871ad8528a4c9b4268b955c447fae007d759a /external/redland
parentintermittent forecast.ets.add.fods failure (diff)
downloadcore-a574bb602031f0d1febb059c7dc9d1c4937271c6.tar.gz
core-a574bb602031f0d1febb059c7dc9d1c4937271c6.zip
external/redland: Honour LIBXML_CFLAGS/LIBS in raptor's configure
I ran into this issue with a somewhat special setup on macOS, with both Xcode 11 and Xcode 12 beta installed, and > xcode-select -s /Applications/Xcode-beta.app/Contents/Developer and > CC/CXX=... -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk ... to make the LO build use the latest SDK from Xcode 12 beta. (And with implicit --with-system-libxml, and with recent Clang 12 trunk.) However, even though raptor's configure receives our LIBXML_CFLAGS/LIBS env vars from config_host.mk, it always overrides them with output from some $XML_CONFIG tool. For whatever reason, in my setup that caused raptor's LIBXML_CFLAGS to be set to > -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include (And a similar reference to that /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk in LIBXML_LIBS. That MacOSX.sdk directory symlinks to some /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk. I don't know about that /Library/Developer/CommandLineTools/SDKs tree, but it smells like it is maintained by Xcode and not properly adapted for my Xcode 12 beta install.) Anyway, that LIBXML_CFLAGS ends up on raptor's compiler command lines, causing them to contain > ... -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk ... -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include ... so that something like > #include <stdio.h> in workdir/UnpackedTarball/raptor/src/raptor_parse.c will include > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h rather than > /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/stdio.h and consider the former not to be a system header, and thus emit warnings/errors like > In file included from raptor_parse.c:30: > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:220:5: error: 'TARGET_OS_EMBEDDED' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_] > #if TARGET_OS_EMBEDDED > ^ that it would suppress from system headers. Raptor's configure appears to always override LIBXML_CFLAGS/LIBS since <https://github.com/dajobe/raptor/commit/ 7da03ba5cd6e45ea41afebd4955acf6e96e9d622> "Switch libxml and libcurl to use PKG_PROG_PKG_CONFIG and PKG_CHECK_MODULES", which looks like a bug to me. (Trying to prevent that code from being executed by passing in --without-xml2-config, similar to the existing --without-xslt-config in external/redland/ExternalProject_raptor.mk, would fail with > configure: error: libxml2 is not available - please get it from http://xmlsoft.org/ from raptor's configure, apparently suppressing libxml2 detection altogether.) Change-Id: I5f2813e849bb61c0af48df0579abe87d3671185b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101991 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external/redland')
-rw-r--r--external/redland/UnpackedTarball_raptor.mk1
-rw-r--r--external/redland/raptor/libxml-override.patch13
2 files changed, 14 insertions, 0 deletions
diff --git a/external/redland/UnpackedTarball_raptor.mk b/external/redland/UnpackedTarball_raptor.mk
index 517b11a3d14f..2e0ef98fa2b5 100644
--- a/external/redland/UnpackedTarball_raptor.mk
+++ b/external/redland/UnpackedTarball_raptor.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,raptor,\
external/redland/raptor/xml2-config.patch \
external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.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
new file mode 100644
index 000000000000..edc2d0d497a4
--- /dev/null
+++ b/external/redland/raptor/libxml-override.patch
@@ -0,0 +1,13 @@
+--- 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"