@@ -6313,16 +6313,12 @@ AC_C_BIGENDIAN
63136313
63146314AC_SUBST ( PYD_PLATFORM_TAG )
63156315# Special case of PYD_PLATFORM_TAG with python build with mingw.
6316- # Python can with compiled with clang or gcc and linked
6317- # to msvcrt or ucrt. To avoid conflicts between them
6318- # we are selecting the extension as based on the compiler
6319- # and the runtime they link to
6320- # gcc + x86_64 + msvcrt = cp{version number}-x86_64
6321- # gcc + i686 + msvcrt = cp{version number}-i686
6322- # gcc + x86_64 + ucrt = cp{version number}-x86_64-ucrt
6323- # clang + x86_64 + ucrt = cp{version number}-x86_64-clang
6324- # clang + i686 + ucrt = cp{version number}-i686-clang
6325-
6316+ # Python can with different cpu arch and c runtime as well as different
6317+ # toolchain. We follow this`mingw_<cpu_arch>_<c_runtime>_<toolchain>`
6318+ # convention for PYD_PLATFORM_TAG. Where:
6319+ # `cpu_arch` = `x86_64`, `aarch64` or `i686`
6320+ # `c_runtime` = `msvcrt` or `ucrt`
6321+ # `toolchain` = `gnu` or `llvm`
63266322PYD_PLATFORM_TAG=""
63276323case $host in
63286324 *-*-mingw*)
@@ -6341,38 +6337,32 @@ esac
63416337case $host_os in
63426338 mingw*)
63436339 AC_MSG_CHECKING ( PYD_PLATFORM_TAG )
6340+ PYD_PLATFORM_TAG="mingw"
63446341 case $host in
63456342 i686-*-mingw*)
6346- if test -n "${cc_is_clang}"; then
6347- # it is CLANG32
6348- PYD_PLATFORM_TAG="mingw_i686_clang"
6349- else
6350- if test $linking_to_ucrt = no; then
6351- PYD_PLATFORM_TAG="mingw_i686"
6352- else
6353- PYD_PLATFORM_TAG="mingw_i686_ucrt"
6354- fi
6355- fi
6343+ PYD_PLATFORM_TAG+="_i686"
63566344 ;;
63576345 x86_64-*-mingw*)
6358- if test -n "${cc_is_clang}"; then
6359- # it is CLANG64
6360- PYD_PLATFORM_TAG="mingw_x86_64_clang"
6361- else
6362- if test $linking_to_ucrt = no; then
6363- PYD_PLATFORM_TAG="mingw_x86_64"
6364- else
6365- PYD_PLATFORM_TAG="mingw_x86_64_ucrt"
6366- fi
6367- fi
6346+ PYD_PLATFORM_TAG+="_x86_64"
63686347 ;;
63696348 aarch64-*-mingw*)
6370- PYD_PLATFORM_TAG+="mingw_aarch64 "
6349+ PYD_PLATFORM_TAG+="_aarch64 "
63716350 ;;
63726351 armv7-*-mingw*)
6373- PYD_PLATFORM_TAG+="mingw_armv7 "
6352+ PYD_PLATFORM_TAG+="_armv7 "
63746353 ;;
63756354 esac
6355+ if test $linking_to_ucrt = no; then
6356+ PYD_PLATFORM_TAG+="_msvcrt"
6357+ else
6358+ PYD_PLATFORM_TAG += "_ucrt"
6359+ fi
6360+ if test -n "${cc_is_clang}"; then
6361+ # it is CLANG32
6362+ PYD_PLATFORM_TAG+="_llvm"
6363+ else
6364+ PYD_PLATFORM_TAG+="_gnu"
6365+ fi
63766366 AC_MSG_RESULT ( $PYD_PLATFORM_TAG )
63776367esac
63786368
0 commit comments