diff options
author | Christian Heimes <christian@python.org> | 2022-06-10 13:25:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 13:25:33 (GMT) |
commit | 3124d9a5aafb64431aa9facd0ae0e12201be77fa (patch) | |
tree | a292addb44305fb8db26f929646319d21970d50d /configure | |
parent | a87c9b538fbfc42883417c4d5e69f1a5922690e3 (diff) | |
download | cpython-3124d9a5aafb64431aa9facd0ae0e12201be77fa.zip cpython-3124d9a5aafb64431aa9facd0ae0e12201be77fa.tar.gz cpython-3124d9a5aafb64431aa9facd0ae0e12201be77fa.tar.bz2 |
gh-93491: Add support tier detection to configure (GH-93492)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 106 |
1 files changed, 106 insertions, 0 deletions
@@ -5213,6 +5213,39 @@ $as_echo "$ac_cv_path_EGREP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CC compiler name" >&5 +$as_echo_n "checking for CC compiler name... " >&6; } +if ${ac_cv_cc_name+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat > conftest.c <<EOF +#if defined(__INTEL_COMPILER) || defined(__ICC) + icc +#elif defined(__ibmxl__) || defined(__xlc__) || defined(__xlC__) + xlc +#elif defined(_MSC_VER) + msvc +#elif defined(__clang__) + clang +#elif defined(__GNUC__) + gcc +#else +# error unknown compiler +#endif +EOF + +if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then + ac_cv_cc_name=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` +else + ac_cv_cc_name="unknown" +fi +rm -f conftest.c conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_name" >&5 +$as_echo "$ac_cv_cc_name" >&6; } + # checks for UNIX variants that set C preprocessor variables # may set _GNU_SOURCE, __EXTENSIONS__, _POSIX_PTHREAD_SEMANTICS, # _POSIX_SOURCE, _POSIX_1_SOURCE, and more @@ -6172,6 +6205,66 @@ if test x$MULTIARCH != x; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PEP 11 support tier" >&5 +$as_echo_n "checking for PEP 11 support tier... " >&6; } +case $host/$ac_cv_cc_name in #( + x86_64-*-linux-gnu/gcc) : + PY_SUPPORT_TIER=1 ;; #( + x86_64-apple-darwin*/clang) : + PY_SUPPORT_TIER=1 ;; #( + i686-pc-windows-msvc/msvc) : + PY_SUPPORT_TIER=1 ;; #( + x86_64-pc-windows-msvc/msvc) : + PY_SUPPORT_TIER=1 ;; #( + + aarch64-apple-darwin*/clang) : + PY_SUPPORT_TIER=2 ;; #( + aarch64-*-linux-gnu/gcc) : + PY_SUPPORT_TIER=2 ;; #( + aarch64-*-linux-gnu/clang) : + PY_SUPPORT_TIER=2 ;; #( + powerpc64le-*-linux-gnu/gcc) : + PY_SUPPORT_TIER=2 ;; #( + x86_64-*-linux-gnu/clang) : + PY_SUPPORT_TIER=2 ;; #( + + aarch64-pc-windows-msvc/msvc) : + PY_SUPPORT_TIER=3 ;; #( + armv7l-*-linux-gnueabihf/gcc) : + PY_SUPPORT_TIER=3 ;; #( + powerpc64le-*-linux-gnu/clang) : + PY_SUPPORT_TIER=3 ;; #( + s390x-*-linux-gnu/gcc) : + PY_SUPPORT_TIER=3 ;; #( + x86_64-*-freebsd/clang) : + PY_SUPPORT_TIER=3 ;; #( + *) : + PY_SUPPORT_TIER=0 + ;; +esac + +case $PY_SUPPORT_TIER in #( + 1) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $host/$ac_cv_cc_name has tier 1 (supported)" >&5 +$as_echo "$host/$ac_cv_cc_name has tier 1 (supported)" >&6; } ;; #( + 2) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $host/$ac_cv_cc_name has tier 2 (supported)" >&5 +$as_echo "$host/$ac_cv_cc_name has tier 2 (supported)" >&6; } ;; #( + 3) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $host/$ac_cv_cc_name has tier 3 (partially supported)" >&5 +$as_echo "$host/$ac_cv_cc_name has tier 3 (partially supported)" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $host/$ac_cv_cc_name is not supported" >&5 +$as_echo "$as_me: WARNING: $host/$ac_cv_cc_name is not supported" >&2;} + ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define PY_SUPPORT_TIER $PY_SUPPORT_TIER +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5 $as_echo_n "checking for -Wl,--no-as-needed... " >&6; } if ${ac_cv_wl_no_as_needed+:} false; then : @@ -26296,3 +26389,16 @@ If you want a release build with all stable optimizations active (PGO, etc), please run ./configure --enable-optimizations " >&6;} fi + +if test "x$PY_SUPPORT_TIER" = x0; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + +Platform \"$host\" with compiler \"$ac_cv_cc_name\" is not supported by the +CPython core team, see https://peps.python.org/pep-0011/ for more information. +" >&5 +$as_echo "$as_me: WARNING: + +Platform \"$host\" with compiler \"$ac_cv_cc_name\" is not supported by the +CPython core team, see https://peps.python.org/pep-0011/ for more information. +" >&2;} +fi |