@@ -6311,16 +6311,12 @@ AC_C_BIGENDIAN
63116311
63126312AC_SUBST ( PYD_PLATFORM_TAG )
63136313# Special case of PYD_PLATFORM_TAG with python build with mingw.
6314- # Python can with compiled with clang or gcc and linked
6315- # to msvcrt or ucrt. To avoid conflicts between them
6316- # we are selecting the extension as based on the compiler
6317- # and the runtime they link to
6318- # gcc + x86_64 + msvcrt = cp{version number}-x86_64
6319- # gcc + i686 + msvcrt = cp{version number}-i686
6320- # gcc + x86_64 + ucrt = cp{version number}-x86_64-ucrt
6321- # clang + x86_64 + ucrt = cp{version number}-x86_64-clang
6322- # clang + i686 + ucrt = cp{version number}-i686-clang
6323-
6314+ # Python can with different cpu arch and c runtime as well as different
6315+ # toolchain. We follow this`mingw_<cpu_arch>_<c_runtime>_<toolchain>`
6316+ # convention for PYD_PLATFORM_TAG. Where:
6317+ # `cpu_arch` = `x86_64`, `aarch64` or `i686`
6318+ # `c_runtime` = `msvcrt` or `ucrt`
6319+ # `toolchain` = `gnu` or `llvm`
63246320PYD_PLATFORM_TAG=""
63256321case $host in
63266322 *-*-mingw*)
@@ -6339,38 +6335,32 @@ esac
63396335case $host_os in
63406336 mingw*)
63416337 AC_MSG_CHECKING ( PYD_PLATFORM_TAG )
6338+ PYD_PLATFORM_TAG="mingw"
63426339 case $host in
63436340 i686-*-mingw*)
6344- if test -n "${cc_is_clang}"; then
6345- # it is CLANG32
6346- PYD_PLATFORM_TAG="mingw_i686_clang"
6347- else
6348- if test $linking_to_ucrt = no; then
6349- PYD_PLATFORM_TAG="mingw_i686"
6350- else
6351- PYD_PLATFORM_TAG="mingw_i686_ucrt"
6352- fi
6353- fi
6341+ PYD_PLATFORM_TAG+="_i686"
63546342 ;;
63556343 x86_64-*-mingw*)
6356- if test -n "${cc_is_clang}"; then
6357- # it is CLANG64
6358- PYD_PLATFORM_TAG="mingw_x86_64_clang"
6359- else
6360- if test $linking_to_ucrt = no; then
6361- PYD_PLATFORM_TAG="mingw_x86_64"
6362- else
6363- PYD_PLATFORM_TAG="mingw_x86_64_ucrt"
6364- fi
6365- fi
6344+ PYD_PLATFORM_TAG+="_x86_64"
63666345 ;;
63676346 aarch64-*-mingw*)
6368- PYD_PLATFORM_TAG+="mingw_aarch64 "
6347+ PYD_PLATFORM_TAG+="_aarch64 "
63696348 ;;
63706349 armv7-*-mingw*)
6371- PYD_PLATFORM_TAG+="mingw_armv7 "
6350+ PYD_PLATFORM_TAG+="_armv7 "
63726351 ;;
63736352 esac
6353+ if test $linking_to_ucrt = no; then
6354+ PYD_PLATFORM_TAG+="_msvcrt"
6355+ else
6356+ PYD_PLATFORM_TAG += "_ucrt"
6357+ fi
6358+ if test -n "${cc_is_clang}"; then
6359+ # it is CLANG32
6360+ PYD_PLATFORM_TAG+="_llvm"
6361+ else
6362+ PYD_PLATFORM_TAG+="_gnu"
6363+ fi
63746364 AC_MSG_RESULT ( $PYD_PLATFORM_TAG )
63756365esac
63766366
0 commit comments