@@ -6335,16 +6335,12 @@ AC_C_BIGENDIAN
63356335
63366336AC_SUBST ( PYD_PLATFORM_TAG )
63376337# Special case of PYD_PLATFORM_TAG with python build with mingw.
6338- # Python can with compiled with clang or gcc and linked
6339- # to msvcrt or ucrt. To avoid conflicts between them
6340- # we are selecting the extension as based on the compiler
6341- # and the runtime they link to
6342- # gcc + x86_64 + msvcrt = cp{version number}-x86_64
6343- # gcc + i686 + msvcrt = cp{version number}-i686
6344- # gcc + x86_64 + ucrt = cp{version number}-x86_64-ucrt
6345- # clang + x86_64 + ucrt = cp{version number}-x86_64-clang
6346- # clang + i686 + ucrt = cp{version number}-i686-clang
6347-
6338+ # Python can with different cpu arch and c runtime as well as different
6339+ # toolchain. We follow this`mingw_<cpu_arch>_<c_runtime>_<toolchain>`
6340+ # convention for PYD_PLATFORM_TAG. Where:
6341+ # `cpu_arch` = `x86_64`, `aarch64` or `i686`
6342+ # `c_runtime` = `msvcrt` or `ucrt`
6343+ # `toolchain` = `gnu` or `llvm`
63486344PYD_PLATFORM_TAG=""
63496345case $host in
63506346 *-*-mingw*)
@@ -6363,38 +6359,32 @@ esac
63636359case $host_os in
63646360 mingw*)
63656361 AC_MSG_CHECKING ( PYD_PLATFORM_TAG )
6362+ PYD_PLATFORM_TAG="mingw"
63666363 case $host in
63676364 i686-*-mingw*)
6368- if test -n "${cc_is_clang}"; then
6369- # it is CLANG32
6370- PYD_PLATFORM_TAG="mingw_i686_clang"
6371- else
6372- if test $linking_to_ucrt = no; then
6373- PYD_PLATFORM_TAG="mingw_i686"
6374- else
6375- PYD_PLATFORM_TAG="mingw_i686_ucrt"
6376- fi
6377- fi
6365+ PYD_PLATFORM_TAG+="_i686"
63786366 ;;
63796367 x86_64-*-mingw*)
6380- if test -n "${cc_is_clang}"; then
6381- # it is CLANG64
6382- PYD_PLATFORM_TAG="mingw_x86_64_clang"
6383- else
6384- if test $linking_to_ucrt = no; then
6385- PYD_PLATFORM_TAG="mingw_x86_64"
6386- else
6387- PYD_PLATFORM_TAG="mingw_x86_64_ucrt"
6388- fi
6389- fi
6368+ PYD_PLATFORM_TAG+="_x86_64"
63906369 ;;
63916370 aarch64-*-mingw*)
6392- PYD_PLATFORM_TAG+="mingw_aarch64 "
6371+ PYD_PLATFORM_TAG+="_aarch64 "
63936372 ;;
63946373 armv7-*-mingw*)
6395- PYD_PLATFORM_TAG+="mingw_armv7 "
6374+ PYD_PLATFORM_TAG+="_armv7 "
63966375 ;;
63976376 esac
6377+ if test $linking_to_ucrt = no; then
6378+ PYD_PLATFORM_TAG+="_msvcrt"
6379+ else
6380+ PYD_PLATFORM_TAG += "_ucrt"
6381+ fi
6382+ if test -n "${cc_is_clang}"; then
6383+ # it is CLANG32
6384+ PYD_PLATFORM_TAG+="_llvm"
6385+ else
6386+ PYD_PLATFORM_TAG+="_gnu"
6387+ fi
63986388 AC_MSG_RESULT ( $PYD_PLATFORM_TAG )
63996389esac
64006390
0 commit comments