]> granicus.if.org Git - libatomic_ops/commitdiff
Allow alternate CC (CROSS_CC) for AC_TRY_COMPILE (configure)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 27 Feb 2017 17:58:28 +0000 (20:58 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 27 Feb 2017 17:58:28 +0000 (20:58 +0300)
* configure.ac [GCC && CROSS_CC] (CC): Assign to CROSS_CC temporarily
(for AC_TRY_COMPILE); restore original value after last AC_TRY_COMPILE.

configure.ac

index 9087c594919089912493ef22dcdeff28a38f9b97..187b871ef89527573dd9e2d3b6d0f7253256d21f 100644 (file)
@@ -23,6 +23,11 @@ need_asm=false
 PICFLAG=
 AC_MSG_CHECKING(for PIC compiler flag)
 if test "$GCC" = yes; then
+  old_CC="$CC"
+  if test -n "$CROSS_CC"; then
+    CC="$CROSS_CC"
+  fi
+
   case "$host" in
     *-*-cygwin* | *-*-mingw*)
       # Cygwin and Mingw[-w32/64] do not need -fPIC.
@@ -72,6 +77,8 @@ extern int quiet;
   if test "$enable_werror" = yes; then
     CFLAGS="-Werror $CFLAGS"
   fi
+
+  CC="$old_CC"
 else
   case "$host" in
     *-*-hpux*)