Fix problem with caching in sub-configure scripts
Since the changes of ef2b015e39 (Export CC and similar variables for
sub-configure scripts, 2018-10-20), using "-C" option with configure
didn't work any longer when also using built-in libtiff or expat, as
their configure scripts aborted due to detecting inconsistent build
environment because the values of exported CC etc variables they saw
differed from the values in the cache file.
Fixing this seems to be difficult, as we'd need to update the cache
before running the sub-configure scripts (which is simple enough), but
also remove the cached entries from it after doing it, as otherwise we'd
get the same inconsistent build environment problem simply by running
"configure -C" without any other options twice in a row, because the
first run would cache CC=gcc etc.
So work around this instead by disabling cache when exporting these
variables. And to make this workaround less annoying, restrict it to
only the cases when it's really needed, i.e. when we do modify these
variables in a non-trivial way.
With these changes, "configure -C" works again, but only uses caching if
possible.
This commit is contained in:
parent
15a4375f93
commit
b79173943a
2 changed files with 42 additions and 3 deletions
16
configure
vendored
16
configure
vendored
|
|
@ -18656,6 +18656,8 @@ fi
|
|||
fi
|
||||
|
||||
|
||||
export_compiler_flags=no
|
||||
|
||||
if test "$USE_DARWIN" = 1; then
|
||||
|
||||
retest_macosx_linking=no
|
||||
|
|
@ -18708,6 +18710,8 @@ $as_echo "$as_me: WARNING: Disabling precompiled headers due to universal binary
|
|||
OBJCXXFLAGS="$OSX_ARCH_OPTS $OBJCXXFLAGS"
|
||||
OBJCFLAGS="$OSX_ARCH_OPTS $OBJCFLAGS"
|
||||
LDFLAGS="$OSX_ARCH_OPTS $LDFLAGS"
|
||||
|
||||
export_compiler_flags=yes
|
||||
fi
|
||||
|
||||
if test "$wxUSE_MAC" = 1; then
|
||||
|
|
@ -18893,6 +18897,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
|||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
export_compiler_flags=yes
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
@ -19095,7 +19101,15 @@ if test "$USE_UNIX" = 1 ; then
|
|||
|
||||
fi
|
||||
|
||||
export CC CFLAGS CPP CPPFLAGS CXX CXXFLAGS LDD LDFLAGS OBJCFLAGS OBJCXXFLAGS
|
||||
if test "$export_compiler_flags" = "yes"; then
|
||||
export CC CFLAGS CPP CPPFLAGS CXX CXXFLAGS LDD LDFLAGS OBJCFLAGS OBJCXXFLAGS
|
||||
|
||||
if test "$cache_file" != "/dev/null"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling caching due to a change in compiler options." >&5
|
||||
$as_echo "$as_me: WARNING: Disabling caching due to a change in compiler options." >&2;}
|
||||
cache_file="/dev/null"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue