]> granicus.if.org Git - python/commitdiff
[issue8211] configure: ignore AC_PROG_CC hardcoded CFLAGS
authorMarc-André Lemburg <mal@egenix.com>
Fri, 30 Apr 2010 17:20:14 +0000 (17:20 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Fri, 30 Apr 2010 17:20:14 +0000 (17:20 +0000)
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.

configure
configure.in

index a41c0d888e3d130c9fb2e9756562f14f75ac9376..ed2da6176f7f9286afc71e0bbb197faf3acb2aa8 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 80574 .
+# From configure.in Revision: 80647 .
 # Guess values for system-dependent variables and create Makefiles.
 # 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; }; }
 fi
 
-save_CFLAGS=$CFLAGS
+# If the user set CFLAGS, use this instead of the automatically
+# determined setting
+preset_cflags="$CFLAGS"
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 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_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 "${ECHO_T}no" >&6; }
 fi
-rm -f -r conftest*
+rm -f conftest*
 
 
 
@@ -5510,7 +5515,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 else
   ac_cv_header_stdc=no
 fi
-rm -f -r conftest*
+rm -f conftest*
 
 fi
 
@@ -5531,7 +5536,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 else
   ac_cv_header_stdc=no
 fi
-rm -f -r conftest*
+rm -f conftest*
 
 fi
 
@@ -6631,7 +6636,7 @@ _ACEOF
 
 
 fi
-rm -f -r conftest*
+rm -f conftest*
 
 { echo "$as_me:$LINENO: result: $was_it_defined" >&5
 echo "${ECHO_T}$was_it_defined" >&6; }
@@ -7168,7 +7173,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 else
   ac_cv_type_uid_t=no
 fi
-rm -f -r conftest*
+rm -f conftest*
 
 fi
 { 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
   unistd_defines_pthreads=no
 fi
-rm -f -r conftest*
+rm -f conftest*
 
     { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
 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
   ipv6type=$i
 fi
-rm -f -r conftest*
+rm -f conftest*
 
                        ;;
                kame)
@@ -17628,7 +17633,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                ipv6libdir=/usr/local/v6/lib
                                ipv6trylibc=yes
 fi
-rm -f -r conftest*
+rm -f conftest*
 
                        ;;
                linux-glibc)
@@ -17649,7 +17654,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   ipv6type=$i;
                                ipv6trylibc=yes
 fi
-rm -f -r conftest*
+rm -f conftest*
 
                        ;;
                linux-inet6)
@@ -17687,7 +17692,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                ipv6lib=inet6;
                                ipv6libdir=/usr/local/v6/lib
 fi
-rm -f -r conftest*
+rm -f conftest*
 
                        ;;
                v6d)
@@ -17710,7 +17715,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                ipv6libdir=/usr/local/v6/lib;
                                BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
 fi
-rm -f -r conftest*
+rm -f conftest*
 
                        ;;
                zeta)
@@ -17732,7 +17737,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                ipv6lib=inet6;
                                ipv6libdir=/usr/local/v6/lib
 fi
-rm -f -r conftest*
+rm -f conftest*
 
                        ;;
                esac
@@ -26278,7 +26283,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-rm -f -r conftest*
+rm -f conftest*
 
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26297,7 +26302,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-rm -f -r conftest*
+rm -f conftest*
 
 fi
 
@@ -26567,7 +26572,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-rm -f -r conftest*
+rm -f conftest*
 
 fi
 
index 8e19ec23e0c939118070a61037ceac48074739a4..4def2d42b899b5a5e82f8ad0e2a37eb5eb51fe2a 100644 (file)
@@ -531,9 +531,14 @@ then
 (it is also a good idea to do 'make clean' before compiling)])
 fi
 
-save_CFLAGS=$CFLAGS
+# If the user set CFLAGS, use this instead of the automatically
+# determined setting
+preset_cflags="$CFLAGS"
 AC_PROG_CC
-CFLAGS=$save_CFLAGS
+if test ! -z "$preset_cflags"
+then
+       CFLAGS=$preset_cflags
+fi
 
 AC_SUBST(CXX)
 AC_SUBST(MAINCC)