diff options
author | Christian Heimes <christian@python.org> | 2021-12-08 10:52:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 10:52:08 (GMT) |
commit | 0461c68cdff1392a5299ebd8c37ddce0b60dd6cc (patch) | |
tree | 4bd21d52a03f6cacc7fea18cad78ff6a7a0b8dba | |
parent | c602c1be439e295fed9ebab47e895ef1d9df28be (diff) | |
download | cpython-0461c68cdff1392a5299ebd8c37ddce0b60dd6cc.zip cpython-0461c68cdff1392a5299ebd8c37ddce0b60dd6cc.tar.gz cpython-0461c68cdff1392a5299ebd8c37ddce0b60dd6cc.tar.bz2 |
bpo-45847: Don't override user overrides for CFLAGS/LIBS (GH-29967)
-rwxr-xr-x | configure | 94 | ||||
-rw-r--r-- | configure.ac | 54 | ||||
-rw-r--r-- | setup.py | 4 |
3 files changed, 85 insertions, 67 deletions
@@ -10538,8 +10538,8 @@ if eval test \"x\$"$as_ac_var"\" = x"yes"; then : _ACEOF have_uuid=yes - LIBUUID_CFLAGS= - LIBUUID_LIBS= + LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""} + LIBUUID_LIBS=${LIBUUID_LIBS-""} fi done @@ -10612,8 +10612,6 @@ fi echo "$LIBUUID_PKG_ERRORS" >&5 - LIBUUID_LIBS="-luuid" - LIBUUID_CFLAGS= for ac_header in uuid/uuid.h do : ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" @@ -10731,6 +10729,12 @@ LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS + if test "x$have_uuid" = xyes; then : + + LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""} + LIBUUID_LIBS=${LIBUUID_LIBS-"-luuid"} + +fi fi @@ -10742,8 +10746,6 @@ elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - LIBUUID_LIBS="-luuid" - LIBUUID_CFLAGS= for ac_header in uuid/uuid.h do : ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" @@ -10861,6 +10863,12 @@ LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS + if test "x$have_uuid" = xyes; then : + + LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""} + LIBUUID_LIBS=${LIBUUID_LIBS-"-luuid"} + +fi fi @@ -10898,8 +10906,8 @@ _ACEOF if test "x$ac_cv_func_uuid_generate_time" = xyes; then : have_uuid=yes - LIBUUID_CFLAGS= - LIBUUID_LIBS= + LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""} + LIBUUID_LIBS=${LIBUUID_LIBS-""} fi @@ -11350,8 +11358,8 @@ $as_echo "$with_system_expat" >&6; } if test "x$with_system_expat" = xyes; then : - LIBEXPAT_CFLAGS="" - LIBEXPAT_LDFLAGS="-lexpat" + LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""} + LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"} LIBEXPAT_INTERNAL= else @@ -11424,8 +11432,8 @@ $as_echo "$with_system_libmpdec" >&6; } if test "x$with_system_libmpdec" = xyes; then : - LIBMPDEC_CFLAGS="" - LIBMPDEC_LDFLAGS="-lmpdec" + LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""} + LIBMPDEC_LDFLAGS=${LIBMPDEC_LDFLAGS-"-lmpdec"} LIBMPDEC_INTERNAL= else @@ -11600,7 +11608,7 @@ fi echo "$LIBNSL_PKG_ERRORS" >&5 - LIBNSL_CFLAGS= + LIBNSL_CFLAGS=${LIBNSL_CFLAGS-""} save_CFLAGS=$CFLAGS save_CPPFLAGS=$CPPFLAGS save_LDFLAGS=$LDFLAGS @@ -11674,19 +11682,20 @@ LIBS=$save_LIBS case $ac_cv_search_yp_match in #( no) : - LIBNSL_LIBS= ;; #( + libnsl="" ;; #( "none required") : - LIBNSL_LIBS= ;; #( + libnsl="" ;; #( *) : - LIBNSL_LIBS=$ac_cv_search_yp_match + libnsl="$ac_cv_search_yp_match" ;; esac + LIBNSL_LIBS=${LIBNSL_LIBS-$libnsl} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - LIBNSL_CFLAGS= + LIBNSL_CFLAGS=${LIBNSL_CFLAGS-""} save_CFLAGS=$CFLAGS save_CPPFLAGS=$CPPFLAGS save_LDFLAGS=$LDFLAGS @@ -11760,13 +11769,14 @@ LIBS=$save_LIBS case $ac_cv_search_yp_match in #( no) : - LIBNSL_LIBS= ;; #( + libnsl="" ;; #( "none required") : - LIBNSL_LIBS= ;; #( + libnsl="" ;; #( *) : - LIBNSL_LIBS=$ac_cv_search_yp_match + libnsl="$ac_cv_search_yp_match" ;; esac + LIBNSL_LIBS=${LIBNSL_LIBS-$libnsl} else LIBNSL_CFLAGS=$pkg_cv_LIBNSL_CFLAGS @@ -11867,16 +11877,16 @@ fi echo "$LIBSQLITE3_PKG_ERRORS" >&5 - LIBSQLITE3_LIBS="-lsqlite3" - LIBSQLITE3_CFLAGS= + LIBSQLITE3_CFLAGS=${LIBSQLITE3_CFLAGS-""} + LIBSQLITE3_LIBS=${LIBSQLITE3_LIBS-"-lsqlite3"} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - LIBSQLITE3_LIBS="-lsqlite3" - LIBSQLITE3_CFLAGS= + LIBSQLITE3_CFLAGS=${LIBSQLITE3_CFLAGS-""} + LIBSQLITE3_LIBS=${LIBSQLITE3_LIBS-"-lsqlite3"} else @@ -12147,7 +12157,7 @@ $as_echo "$ac_cv_lib_gdbm_gdbm_open" >&6; } if test "x$ac_cv_lib_gdbm_gdbm_open" = xyes; then : have_gdbm=yes - GDBM_LIBS="$GDBM_LIBS -lgdbm" + GDBM_LIBS=${GDBM_LIBS-"-lgdbm"} else have_gdbm=no @@ -14619,8 +14629,8 @@ $as_echo "$ac_cv_lib_z_gzread" >&6; } if test "x$ac_cv_lib_z_gzread" = xyes; then : have_zlib=yes - ZLIB_CFLAGS= - ZLIB_LIBS=-lz + ZLIB_CFLAGS=${ZLIB_CFLAGS-""} + ZLIB_LIBS=${ZLIB_LIBS-"-lz"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 $as_echo_n "checking for inflateCopy in -lz... " >&6; } if ${ac_cv_lib_z_inflateCopy+:} false; then : @@ -14741,8 +14751,8 @@ $as_echo "$ac_cv_lib_z_gzread" >&6; } if test "x$ac_cv_lib_z_gzread" = xyes; then : have_zlib=yes - ZLIB_CFLAGS= - ZLIB_LIBS=-lz + ZLIB_CFLAGS=${ZLIB_CFLAGS-""} + ZLIB_LIBS=${ZLIB_LIBS-"-lz"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 $as_echo_n "checking for inflateCopy in -lz... " >&6; } if ${ac_cv_lib_z_inflateCopy+:} false; then : @@ -14938,8 +14948,8 @@ $as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then : have_bzip2=yes - BZIP2_CFLAGS= - BZIP2_LIBS=-lbz2 + BZIP2_CFLAGS=${BZIP2_CFLAGS-""} + BZIP2_LIBS=${BZIP2_LIBS-"-lbz2"} else have_bzip2=no @@ -15017,8 +15027,8 @@ $as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then : have_bzip2=yes - BZIP2_CFLAGS= - BZIP2_LIBS=-lbz2 + BZIP2_CFLAGS=${BZIP2_CFLAGS-""} + BZIP2_LIBS=${BZIP2_LIBS-"-lbz2"} else have_bzip2=no @@ -15160,8 +15170,8 @@ $as_echo "$ac_cv_lib_lzma_lzma_easy_encoder" >&6; } if test "x$ac_cv_lib_lzma_lzma_easy_encoder" = xyes; then : have_liblzma=yes - LIBLZMA_CFLAGS= - LIBLZMA_LIBS=-llzma + LIBLZMA_CFLAGS=${LIBLZMA_CFLAGS-""} + LIBLZMA_LIBS=${LIBLZMA_LIBS-"-llzma"} else have_liblzma=no @@ -15239,8 +15249,8 @@ $as_echo "$ac_cv_lib_lzma_lzma_easy_encoder" >&6; } if test "x$ac_cv_lib_lzma_lzma_easy_encoder" = xyes; then : have_liblzma=yes - LIBLZMA_CFLAGS= - LIBLZMA_LIBS=-llzma + LIBLZMA_CFLAGS=${LIBLZMA_CFLAGS-""} + LIBLZMA_LIBS=${LIBLZMA_LIBS-"-llzma"} else have_liblzma=no @@ -15840,10 +15850,11 @@ if test "$ac_res" != no; then : $as_echo "#define HAVE_CRYPT_R 1" >>confdefs.h if test "$ac_cv_search_crypt_r" = "none required"; then - LIBCRYPT_LIBS= + libcrypt= else - LIBCRYPT_LIBS="$ac_cv_search_crypt_r" + libcrypt="$ac_cv_search_crypt_r" fi + LIBCRYPT_LIBS=${LIBCRYPT_LIBS-$libcrypt} fi @@ -15922,10 +15933,11 @@ if test "$ac_res" != no; then : $as_echo "#define HAVE_CRYPT_R 1" >>confdefs.h if test "$ac_cv_search_crypt_r" = "none required"; then - LIBCRYPT_LIBS= + libcrypt= else - LIBCRYPT_LIBS="$ac_cv_search_crypt_r" + libcrypt="$ac_cv_search_crypt_r" fi + LIBCRYPT_LIBS=${LIBCRYPT_LIBS-$libcrypt} fi diff --git a/configure.ac b/configure.ac index 0905014..31544dd 100644 --- a/configure.ac +++ b/configure.ac @@ -2947,8 +2947,8 @@ dnl stream in big-endian byte-order AC_CHECK_HEADERS([uuid.h], [ AC_CHECK_FUNCS([uuid_create uuid_enc_be], [ have_uuid=yes - LIBUUID_CFLAGS= - LIBUUID_LIBS= + LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""} + LIBUUID_LIBS=${LIBUUID_LIBS-""} ]) ]) @@ -2961,8 +2961,6 @@ AS_VAR_IF([have_uuid], [missing], [ AC_DEFINE([HAVE_UUID_H], [1]) AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1]) ], [ - LIBUUID_LIBS="-luuid" - LIBUUID_CFLAGS= AC_CHECK_HEADERS([uuid/uuid.h], [ WITH_SAVE_ENV( [AC_CHECK_LIB([uuid], [uuid_generate_time], [have_uuid=yes]) @@ -2973,6 +2971,10 @@ AS_VAR_IF([have_uuid], [missing], [ AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1]) ]) ]) + AS_VAR_IF([have_uuid], [yes], [ + LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""} + LIBUUID_LIBS=${LIBUUID_LIBS-"-luuid"} + ]) ]) ] ) @@ -2983,8 +2985,8 @@ AS_VAR_IF([have_uuid], [missing], [ AC_CHECK_HEADERS([uuid/uuid.h], [ AC_CHECK_FUNC([uuid_generate_time], [ have_uuid=yes - LIBUUID_CFLAGS= - LIBUUID_LIBS= + LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""} + LIBUUID_LIBS=${LIBUUID_LIBS-""} ]) ]) ]) @@ -3147,8 +3149,8 @@ AC_ARG_WITH(system_expat, AC_MSG_RESULT($with_system_expat) AS_VAR_IF([with_system_expat], [yes], [ - LIBEXPAT_CFLAGS="" - LIBEXPAT_LDFLAGS="-lexpat" + LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""} + LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"} LIBEXPAT_INTERNAL= ], [ LIBEXPAT_CFLAGS="-I\$(srcdir)/Modules/expat" @@ -3203,8 +3205,8 @@ AC_ARG_WITH(system_libmpdec, AC_MSG_RESULT($with_system_libmpdec) AS_VAR_IF([with_system_libmpdec], [yes], [ - LIBMPDEC_CFLAGS="" - LIBMPDEC_LDFLAGS="-lmpdec" + LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""} + LIBMPDEC_LDFLAGS=${LIBMPDEC_LDFLAGS-"-lmpdec"} LIBMPDEC_INTERNAL= ], [ LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec" @@ -3293,15 +3295,16 @@ fi dnl check for NIS / libnsl dependencies dnl libnsl dependencies include tirpc includes and lib PKG_CHECK_MODULES([LIBNSL], [libnsl], [have_nis=yes], [ - LIBNSL_CFLAGS= + LIBNSL_CFLAGS=${LIBNSL_CFLAGS-""} WITH_SAVE_ENV([ AC_SEARCH_LIBS([yp_match], [nsl], [have_nis=yes], [have_nis=no]) ]) AS_CASE([$ac_cv_search_yp_match], - [no], [LIBNSL_LIBS=], - ["none required"], [LIBNSL_LIBS=], - [LIBNSL_LIBS=$ac_cv_search_yp_match] + [no], [libnsl=""], + ["none required"], [libnsl=""], + [libnsl="$ac_cv_search_yp_match"] ) + LIBNSL_LIBS=${LIBNSL_LIBS-$libnsl} ]) AS_VAR_IF([have_nis], [yes], [ @@ -3314,8 +3317,8 @@ AS_VAR_IF([have_nis], [yes], [ dnl Check for SQLite library. Use pkg-config if available. PKG_CHECK_MODULES( [LIBSQLITE3], [sqlite3 >= 3.7.15], [], [ - LIBSQLITE3_LIBS="-lsqlite3" - LIBSQLITE3_CFLAGS= + LIBSQLITE3_CFLAGS=${LIBSQLITE3_CFLAGS-""} + LIBSQLITE3_LIBS=${LIBSQLITE3_LIBS-"-lsqlite3"} ] ) AS_VAR_APPEND([LIBSQLITE3_CFLAGS], [' -I$(srcdir)/Modules/_sqlite']) @@ -3402,7 +3405,7 @@ WITH_SAVE_ENV([ AC_CHECK_HEADERS([gdbm.h], [ AC_CHECK_LIB([gdbm], [gdbm_open], [ have_gdbm=yes - GDBM_LIBS="$GDBM_LIBS -lgdbm" + GDBM_LIBS=${GDBM_LIBS-"-lgdbm"} ], [have_gdbm=no]) ], [have_gdbm=no]) ]) @@ -4196,8 +4199,8 @@ PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0], [ WITH_SAVE_ENV([ AC_CHECK_LIB([z], [gzread], [ have_zlib=yes - ZLIB_CFLAGS= - ZLIB_LIBS=-lz + ZLIB_CFLAGS=${ZLIB_CFLAGS-""} + ZLIB_LIBS=${ZLIB_LIBS-"-lz"} AC_CHECK_LIB([z], [inflateCopy], [AC_DEFINE([HAVE_ZLIB_COPY], [1])]) ], [ have_zlib=no @@ -4217,8 +4220,8 @@ PKG_CHECK_MODULES([BZIP2], [bzip2], [have_bzip2=yes], [ WITH_SAVE_ENV([ AC_CHECK_LIB([bz2], [BZ2_bzCompress], [ have_bzip2=yes - BZIP2_CFLAGS= - BZIP2_LIBS=-lbz2 + BZIP2_CFLAGS=${BZIP2_CFLAGS-""} + BZIP2_LIBS=${BZIP2_LIBS-"-lbz2"} ], [have_bzip2=no]) ]) ], [have_bzip2=no]) @@ -4229,8 +4232,8 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma], [have_liblzma=yes], [ WITH_SAVE_ENV([ AC_CHECK_LIB([lzma], [lzma_easy_encoder], [ have_liblzma=yes - LIBLZMA_CFLAGS= - LIBLZMA_LIBS=-llzma + LIBLZMA_CFLAGS=${LIBLZMA_CFLAGS-""} + LIBLZMA_LIBS=${LIBLZMA_LIBS-"-llzma"} ], [have_liblzma=no]) ]) ], [have_liblzma=no]) @@ -4303,10 +4306,11 @@ PKG_CHECK_MODULES([LIBCRYPT], [libxcrypt >= 3.1.1], [ AC_SEARCH_LIBS([crypt_r], [crypt], [ AC_DEFINE([HAVE_CRYPT_R], [1]) if test "$ac_cv_search_crypt_r" = "none required"; then - LIBCRYPT_LIBS= + libcrypt= else - LIBCRYPT_LIBS="$ac_cv_search_crypt_r" + libcrypt="$ac_cv_search_crypt_r" fi + LIBCRYPT_LIBS=${LIBCRYPT_LIBS-$libcrypt} ]) ]) ]) @@ -665,7 +665,9 @@ class PyBuildExt(build_ext): print("Custom linker flags may require --with-openssl-rpath=auto") print() - if os.environ.get("PYTHONSTRICTEXTENSIONBUILD") and (self.failed or self.failed_on_import): + if os.environ.get("PYTHONSTRICTEXTENSIONBUILD") and ( + self.failed or self.failed_on_import or self.missing + ): raise RuntimeError("Failed to build some stdlib modules") def build_extension(self, ext): |