diff options
author | Eric Anderson <andersoe@cs.cmu.edu> | 2014-10-06 13:11:14 -0400 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-03-10 01:54:27 +0000 |
commit | 2728f5673fd99f0c634ffe5e72a2eee02526bc00 (patch) | |
tree | 7fd6a057547253ec3de27e4b174fac189e019496 /configure.ac | |
parent | 99db1c5c982360c5f8307f41eccc6417f83e6a84 (diff) |
Use AX_PROG_CC_FOR_BUILD macro to identify compiler targeting the build host.
(When cross-compiling, this is *not* the compiler used to build wireshark itself).
Macro ax_prog_cc_for_build.m4 retrieved from http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git
Change-Id: I035059d9315e0081dcf1ffbafd9ce6d7ad46700c
Reviewed-on: https://code.wireshark.org/review/4503
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Eric Anderson <andersoe@cs.cmu.edu>
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index e4db0d44ed..03c3a5f928 100644 --- a/configure.ac +++ b/configure.ac @@ -69,6 +69,12 @@ AC_PROG_CXX AC_PROG_CPP AC_PROG_MKDIR_P +# Set CC_FOR_BUILD (the *local* gcc to use for building e.g. lemon) +if test "x$cross_compiling" = xno -a -z "$CC_FOR_BUILD"; then + CC_FOR_BUILD="$CC" +fi +AX_PROG_CC_FOR_BUILD + dnl Work around libtool bug (fixed in the version 1.5a?) AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], ) AC_LIBTOOL_DLOPEN @@ -228,13 +234,6 @@ if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then ac_supports_gcc_flags=yes fi -if test "x$CC_FOR_BUILD" = x -then - CC_FOR_BUILD=$CC -fi -AC_SUBST(CC_FOR_BUILD) -AC_SUBST(CFLAGS_FOR_BUILD) - # Check for doxygen AC_PATH_PROG(DOXYGEN, doxygen) AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no") @@ -3158,6 +3157,8 @@ AC_SUBST(WS_CFLAGS) AC_SUBST(WS_CXXFLAGS) AC_SUBST(WS_LDFLAGS) +AC_SUBST(WS_CFLAGS_FOR_BUILD) + dnl Save the cacheable configure results to config.cache before recursing AC_CACHE_SAVE |