[issue8211] configure: ignore AC_PROG_CC hardcoded CFLAGS

Only override the AC_PROG_CC determined CFLAGS if they were set by the user.
This restores the default behavior in the common case of not having CFLAGS
defined when running configure.
This commit is contained in:
Marc-André Lemburg 2010-04-30 17:20:14 +00:00
parent 9663ddaa74
commit 6d5e579cc5
2 changed files with 30 additions and 20 deletions

41
configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# From configure.in Revision: 80574 . # From configure.in Revision: 80647 .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for python 2.7. # Generated by GNU Autoconf 2.61 for python 2.7.
# #
@ -2407,7 +2407,9 @@ echo "$as_me: error: cached CC is different -- throw away $cache_file
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi fi
save_CFLAGS=$CFLAGS # If the user set CFLAGS, use this instead of the automatically
# determined setting
preset_cflags="$CFLAGS"
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -3327,7 +3329,10 @@ 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_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
CFLAGS=$save_CFLAGS if test ! -z "$preset_cflags"
then
CFLAGS=$preset_cflags
fi
@ -3938,7 +3943,7 @@ else
{ echo "$as_me:$LINENO: result: no" >&5 { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; } echo "${ECHO_T}no" >&6; }
fi fi
rm -f -r conftest* rm -f conftest*
@ -5510,7 +5515,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
rm -f -r conftest* rm -f conftest*
fi fi
@ -5531,7 +5536,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
rm -f -r conftest* rm -f conftest*
fi fi
@ -6631,7 +6636,7 @@ _ACEOF
fi fi
rm -f -r conftest* rm -f conftest*
{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 { echo "$as_me:$LINENO: result: $was_it_defined" >&5
echo "${ECHO_T}$was_it_defined" >&6; } echo "${ECHO_T}$was_it_defined" >&6; }
@ -7168,7 +7173,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_type_uid_t=no ac_cv_type_uid_t=no
fi fi
rm -f -r conftest* rm -f conftest*
fi fi
{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
@ -15991,7 +15996,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
unistd_defines_pthreads=no unistd_defines_pthreads=no
fi fi
rm -f -r conftest* rm -f conftest*
{ echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
echo "${ECHO_T}$unistd_defines_pthreads" >&6; } echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
@ -17605,7 +17610,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then $EGREP "yes" >/dev/null 2>&1; then
ipv6type=$i ipv6type=$i
fi fi
rm -f -r conftest* rm -f conftest*
;; ;;
kame) kame)
@ -17628,7 +17633,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
ipv6trylibc=yes ipv6trylibc=yes
fi fi
rm -f -r conftest* rm -f conftest*
;; ;;
linux-glibc) linux-glibc)
@ -17649,7 +17654,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6type=$i; ipv6type=$i;
ipv6trylibc=yes ipv6trylibc=yes
fi fi
rm -f -r conftest* rm -f conftest*
;; ;;
linux-inet6) linux-inet6)
@ -17687,7 +17692,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6lib=inet6; ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
fi fi
rm -f -r conftest* rm -f conftest*
;; ;;
v6d) v6d)
@ -17710,7 +17715,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6libdir=/usr/local/v6/lib; ipv6libdir=/usr/local/v6/lib;
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS" BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
fi fi
rm -f -r conftest* rm -f conftest*
;; ;;
zeta) zeta)
@ -17732,7 +17737,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6lib=inet6; ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
fi fi
rm -f -r conftest* rm -f conftest*
;; ;;
esac esac
@ -26278,7 +26283,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f -r conftest* rm -f conftest*
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */ /* confdefs.h. */
@ -26297,7 +26302,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f -r conftest* rm -f conftest*
fi fi
@ -26567,7 +26572,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f -r conftest* rm -f conftest*
fi fi

View File

@ -531,9 +531,14 @@ then
(it is also a good idea to do 'make clean' before compiling)]) (it is also a good idea to do 'make clean' before compiling)])
fi fi
save_CFLAGS=$CFLAGS # If the user set CFLAGS, use this instead of the automatically
# determined setting
preset_cflags="$CFLAGS"
AC_PROG_CC AC_PROG_CC
CFLAGS=$save_CFLAGS if test ! -z "$preset_cflags"
then
CFLAGS=$preset_cflags
fi
AC_SUBST(CXX) AC_SUBST(CXX)
AC_SUBST(MAINCC) AC_SUBST(MAINCC)