diff options
author | Jeffrey Yasskin <jyasskin@gmail.com> | 2010-07-09 16:30:58 (GMT) |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2010-07-09 16:30:58 (GMT) |
commit | d4fcdb1ea847389f0cc62840d59d0701f33bbf3d (patch) | |
tree | 4aa78e816c9dd0575f1f9aec33eeb4e36c3c571b /configure | |
parent | 74e4561a3cdf9d38caca4573b68e1c72fc489629 (diff) | |
download | cpython-d4fcdb1ea847389f0cc62840d59d0701f33bbf3d.zip cpython-d4fcdb1ea847389f0cc62840d59d0701f33bbf3d.tar.gz cpython-d4fcdb1ea847389f0cc62840d59d0701f33bbf3d.tar.bz2 |
Issue #9189: Allow users to set $CFLAGS, $CPPFLAGS, and $LDFLAGS when running
configure to append to Python's default values for those variables, and
similarly allow users to set $XXFLAGS on the make command line to append to the
values set by configure.
In the makefile, this renames the variables that used to be $XXFLAGS to
$PY_XXFLAGS, and renames the old $PY_CFLAGS to $PY_CORE_CFLAGS. To compensate,
sysconfig now aliases $XXFLAGS=$PY_XXFLAGS so that scripts using it keep
working. I see that as the right interface, not a backward-compatibility hack,
since these are logically the $XXFLAGS variables; we just use a different name
in the makefile to deal with make's semantics.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -1929,11 +1929,11 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default + enum { N = $2 / 2 - 1 }; int main () { -static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 }; - 0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0 ; @@ -1944,11 +1944,11 @@ if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default + enum { N = $2 / 2 - 1 }; int main () { -static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 }; - ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0 @@ -3158,9 +3158,12 @@ then (it is also a good idea to do 'make clean' before compiling)" "$LINENO" 5 fi -# If the user set CFLAGS, use this instead of the automatically -# determined setting -preset_cflags="$CFLAGS" +# Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2 +# when the compiler supports them, but we don't always want -O2, and +# we set -g later. +if test -z "$CFLAGS"; then + CFLAGS= +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3952,10 +3955,6 @@ 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 -if test ! -z "$preset_cflags" -then - CFLAGS=$preset_cflags -fi |