From ccd2862d233a21f9824d898239dccbda17d375ed Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Oct 2018 13:39:27 +0200 Subject: [PATCH 1/3] Use SDK options with cpp too in configure under macOS Otherwise trying to compile and preprocess a file could behave differently because the format could not find a header existing in the system due to the use of -isysroot option, confusing configure. --- configure | 2 ++ configure.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configure b/configure index f16d012a6c..cb8efcf19d 100755 --- a/configure +++ b/configure @@ -20194,6 +20194,7 @@ elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then fi if test "x$MACOSX_SDK_OPTS" != "x"; then + eval "CPP=\"$CPP $MACOSX_SDK_OPTS\"" eval "CC=\"$CC $MACOSX_SDK_OPTS\"" eval "CXX=\"$CXX $MACOSX_SDK_OPTS\"" eval "LD=\"$LD $MACOSX_SDK_OPTS\"" @@ -20206,6 +20207,7 @@ if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then else MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN" fi + eval "CPP=\"$CPP $MACOSX_VERSION_MIN_OPTS\"" eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\"" eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\"" eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\"" diff --git a/configure.in b/configure.in index dd079889cb..326c675a04 100644 --- a/configure.in +++ b/configure.in @@ -1279,6 +1279,7 @@ elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then fi if test "x$MACOSX_SDK_OPTS" != "x"; then + eval "CPP=\"$CPP $MACOSX_SDK_OPTS\"" eval "CC=\"$CC $MACOSX_SDK_OPTS\"" eval "CXX=\"$CXX $MACOSX_SDK_OPTS\"" eval "LD=\"$LD $MACOSX_SDK_OPTS\"" @@ -1291,6 +1292,7 @@ if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then else MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN" fi + eval "CPP=\"$CPP $MACOSX_VERSION_MIN_OPTS\"" eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\"" eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\"" eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\"" From 2242e98a4c0821ea352ffa22b57d9c32d242fc5c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Oct 2018 18:14:47 +0200 Subject: [PATCH 2/3] Disable the use of liblzma in libtiff if detecting it failed We only disabled LZMA support in libtiff if --without-liblzma was explicitly specified, but we need to do it also if liblzma wasn't detected because libtiff configure might erroneously decide that it's available under macOS when using -isysroot, which would result in compilation errors later. And even if there were no such problem, it's still worth disabling LZMA support explicitly to skip unnecessary checking for it again in libtiff configure. --- configure | 2 +- configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index cb8efcf19d..a13a739ad2 100755 --- a/configure +++ b/configure @@ -23371,7 +23371,7 @@ fi fi fi -if test "$HAVE_LZMA" = "no" -o "$wxUSE_LIBTIFF" = "builtin"; then +if test "$wxUSE_LIBLZMA" = "no" -a "$wxUSE_LIBTIFF" = "builtin"; then ac_configure_args="$ac_configure_args --disable-lzma" fi diff --git a/configure.in b/configure.in index 326c675a04..e168e56e6f 100644 --- a/configure.in +++ b/configure.in @@ -2585,7 +2585,7 @@ dnl We need to disable the use of lzma in built-in libtiff explicitly, as dnl otherwise we'd depend on the system lzma library, which is typically dnl undesirable when using builtin libraries. We also disable the use of lzma dnl if it's not available anyhow, just to speed up libtiff configure a little. -if test "$HAVE_LZMA" = "no" -o "$wxUSE_LIBTIFF" = "builtin"; then +if test "$wxUSE_LIBLZMA" = "no" -a "$wxUSE_LIBTIFF" = "builtin"; then ac_configure_args="$ac_configure_args --disable-lzma" fi From ef2b015e399e192050fad5eca5b5f125dfa54946 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Oct 2018 22:58:48 +0200 Subject: [PATCH 3/3] Export CC and similar variables for sub-configure scripts This is especially important under macOS where we modify CC, CPP and CXX to use the specified SDK, and it's important to compile the code of 3rd party libtiff and expat libraries using the same SDK, but also matters for the other platforms when using non-default CC and CXX values. By exporting these values we ensure that tiff and expat use the same compilers and flags as the main libraries linking with them. --- configure | 2 ++ configure.in | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/configure b/configure index a13a739ad2..2378cc74fd 100755 --- a/configure +++ b/configure @@ -20494,6 +20494,8 @@ if test "$USE_UNIX" = 1 ; then fi +export CC CFLAGS CPP CPPFLAGS CXX CXXFLAGS LDD LDFLAGS OBJCFLAGS OBJCXXFLAGS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } diff --git a/configure.in b/configure.in index e168e56e6f..1159b013c6 100644 --- a/configure.in +++ b/configure.in @@ -1477,6 +1477,10 @@ if test "$USE_UNIX" = 1 ; then AC_DEFINE(__UNIX__) fi +dnl Values of these variables shouldn't change any longer from now on, we +dnl export them to ensure they're picked up by sub-configure scripts. +export CC CFLAGS CPP CPPFLAGS CXX CXXFLAGS LDD LDFLAGS OBJCFLAGS OBJCXXFLAGS + dnl ------------------------------------------------------------------------ dnl Check for headers dnl ------------------------------------------------------------------------