gh-114099: Refactor configure and Makefile to accomodate non-macOS frameworks (#115120)

Part of the PEP 730 work to add iOS support.

This change lays the groundwork for introducing iOS/tvOS/watchOS 
frameworks; it includes the structural refactoring needed so that iOS
branches can be added into in a subsequent PR.

Summary of changes:
* Updates config.sub to the 2024-01-01 release. This is the "as 
  released" version of config.sub.
* Adds a RESSRCDIR variable to allow sharing of macOS and iOS Makefile 
  steps.
* Adds an INSTALLTARGETS variable so platforms can customise which
  targets are actually installed. This will be used to exclude certain
  targets (e.g., binaries, manfiles) from iOS framework installs.
* Adds a PYTHONFRAMEWORKINSTALLNAMEPREFIX variable; this is used as
  the install name for the library. This is needed to allow for iOS
  frameworks to specify an @rpath-based install name.
* Evaluates MACHDEP earlier in the configure process so that
  ac_sys_system is available.
* Modifies _PYTHON_HOST_PLATFORM evaluation for cross-platform builds
  so that the CPU architecture is differentiated from the host
  identifier. This will be used to generate a _PYTHON_HOST_PLATFORM
  definition that includes ABI information, not just CPU architecture.
* Differentiates between SOABI_PLATFORM and PLATFORM_TRIPLET.
  SOABI_PLATFORM is used in binary module names, and includes the ABI,
  but not the OS or CPU architecture (e.g.,
  math.cpython-313-iphonesimulator.dylib). PLATFORM_TRIPLET is used
  as the sys._multiarch value, and on iOS will contains the ABI and
  architecture (e.g., iphoneos-arm64). This differentiation hasn't
  historically been needed because while macOS is a multiarch platform,
  it uses a bare darwin as PLATFORM_TRIPLE.
* Removes the use of the deprecated -Wl,-single_module flag when
  compiling macOS frameworks.
* Some whitespace normalisation where there was a mix of spaces and tabs 
  in a single block.
This commit is contained in:
Russell Keith-Magee 2024-02-13 07:10:24 +08:00 committed by GitHub
parent 10756b10ff
commit 2f0778675a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 604 additions and 436 deletions

View file

@ -307,6 +307,74 @@ if test "$with_pkg_config" = yes -a -z "$PKG_CONFIG"; then
AC_MSG_ERROR([pkg-config is required])]
fi
# Set name for machine-dependent library files
AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
AC_MSG_CHECKING([MACHDEP])
if test -z "$MACHDEP"
then
# avoid using uname for cross builds
if test "$cross_compiling" = yes; then
# ac_sys_system and ac_sys_release are used for setting
# a lot of different things including 'define_xopen_source'
# in the case statement below.
case "$host" in
*-*-linux-android*)
ac_sys_system=Linux-android
;;
*-*-linux*)
ac_sys_system=Linux
;;
*-*-cygwin*)
ac_sys_system=Cygwin
;;
*-*-vxworks*)
ac_sys_system=VxWorks
;;
*-*-emscripten)
ac_sys_system=Emscripten
;;
*-*-wasi)
ac_sys_system=WASI
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
AC_MSG_ERROR([cross build not supported for $host])
esac
ac_sys_release=
else
ac_sys_system=`uname -s`
if test "$ac_sys_system" = "AIX" \
-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
ac_sys_release=`uname -v`
else
ac_sys_release=`uname -r`
fi
fi
ac_md_system=`echo $ac_sys_system |
tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
ac_md_release=`echo $ac_sys_release |
tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
aix*) MACHDEP="aix";;
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
'') MACHDEP="unknown";;
esac
if test "$ac_sys_system" = "SunOS"; then
# For Solaris, there isn't an OS version specific macro defined
# in most compilers, so we define one here.
SUNOS_VERSION=`echo $ac_sys_release | sed -e 's!\.\([0-9]\)$!.0\1!g' | tr -d '.'`
AC_DEFINE_UNQUOTED([Py_SUNOS_VERSION], [$SUNOS_VERSION],
[The version of SunOS/Solaris as reported by `uname -r' without the dot.])
fi
fi
AC_MSG_RESULT(["$MACHDEP"])
AC_MSG_CHECKING([for --enable-universalsdk])
AC_ARG_ENABLE([universalsdk],
AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@],
@ -424,11 +492,15 @@ AC_ARG_ENABLE([framework],
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
FRAMEWORKPYTHONW=
INSTALLTARGETS="commoninstall bininstall maninstall"
if test "x${prefix}" = "xNONE"; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
@ -441,71 +513,85 @@ AC_ARG_ENABLE([framework],
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
FRAMEWORKPYTHONW="frameworkpythonw"
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
case $ac_sys_system in #(
Darwin) :
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
FRAMEWORKPYTHONW="frameworkpythonw"
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
INSTALLTARGETS="commoninstall bininstall maninstall"
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
case "${enableval}" in
/System*)
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
if test "${prefix}" = "NONE" ; then
# See below
FRAMEWORKUNIXTOOLSPREFIX="/usr"
fi
;;
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
/Library*)
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
;;
case "${enableval}" in
/System*)
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
if test "${prefix}" = "NONE" ; then
# See below
FRAMEWORKUNIXTOOLSPREFIX="/usr"
fi
;;
*/Library/Frameworks)
MDIR="`dirname "${enableval}"`"
MDIR="`dirname "${MDIR}"`"
FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
/Library*)
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
;;
if test "${prefix}" = "NONE"; then
# User hasn't specified the
# --prefix option, but wants to install
# the framework in a non-default location,
# ensure that the compatibility links get
# installed relative to that prefix as well
# instead of in /usr/local.
FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
fi
;;
*/Library/Frameworks)
MDIR="`dirname "${enableval}"`"
MDIR="`dirname "${MDIR}"`"
FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
*)
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
;;
if test "${prefix}" = "NONE"; then
# User hasn't specified the
# --prefix option, but wants to install
# the framework in a non-default location,
# ensure that the compatibility links get
# installed relative to that prefix as well
# instead of in /usr/local.
FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
fi
;;
*)
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
;;
esac
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
PYTHONFRAMEWORKINSTALLNAMEPREFIX=${prefix}
RESSRCDIR=Mac/Resources/framework
# Add files for Mac specific code to the list of output
# files:
AC_CONFIG_FILES([Mac/Makefile])
AC_CONFIG_FILES([Mac/PythonLauncher/Makefile])
AC_CONFIG_FILES([Mac/Resources/framework/Info.plist])
AC_CONFIG_FILES([Mac/Resources/app/Info.plist])
;;
*)
AC_MSG_ERROR([Unknown platform for framework build])
;;
esac
esac
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
# Add files for Mac specific code to the list of output
# files:
AC_CONFIG_FILES([Mac/Makefile])
AC_CONFIG_FILES([Mac/PythonLauncher/Makefile])
AC_CONFIG_FILES([Mac/Resources/framework/Info.plist])
AC_CONFIG_FILES([Mac/Resources/app/Info.plist])
esac
],[
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
FRAMEWORKPYTHONW=
INSTALLTARGETS="commoninstall bininstall maninstall"
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
@ -519,6 +605,8 @@ AC_SUBST([PYTHONFRAMEWORKIDENTIFIER])
AC_SUBST([PYTHONFRAMEWORKDIR])
AC_SUBST([PYTHONFRAMEWORKPREFIX])
AC_SUBST([PYTHONFRAMEWORKINSTALLDIR])
AC_SUBST([PYTHONFRAMEWORKINSTALLNAMEPREFIX])
AC_SUBST([RESSRCDIR])
AC_SUBST([FRAMEWORKINSTALLFIRST])
AC_SUBST([FRAMEWORKINSTALLLAST])
AC_SUBST([FRAMEWORKALTINSTALLFIRST])
@ -526,105 +614,38 @@ AC_SUBST([FRAMEWORKALTINSTALLLAST])
AC_SUBST([FRAMEWORKPYTHONW])
AC_SUBST([FRAMEWORKUNIXTOOLSPREFIX])
AC_SUBST([FRAMEWORKINSTALLAPPSPREFIX])
AC_SUBST([INSTALLTARGETS])
AC_DEFINE_UNQUOTED([_PYTHONFRAMEWORK], ["${PYTHONFRAMEWORK}"],
[framework name])
# Set name for machine-dependent library files
AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
AC_MSG_CHECKING([MACHDEP])
if test -z "$MACHDEP"
then
# avoid using uname for cross builds
if test "$cross_compiling" = yes; then
# ac_sys_system and ac_sys_release are used for setting
# a lot of different things including 'define_xopen_source'
# in the case statement below.
case "$host" in
*-*-linux-android*)
ac_sys_system=Linux-android
;;
*-*-linux*)
ac_sys_system=Linux
;;
*-*-cygwin*)
ac_sys_system=Cygwin
;;
*-*-vxworks*)
ac_sys_system=VxWorks
;;
*-*-emscripten)
ac_sys_system=Emscripten
;;
*-*-wasi)
ac_sys_system=WASI
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
AC_MSG_ERROR([cross build not supported for $host])
esac
ac_sys_release=
else
ac_sys_system=`uname -s`
if test "$ac_sys_system" = "AIX" \
-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
ac_sys_release=`uname -v`
else
ac_sys_release=`uname -r`
fi
fi
ac_md_system=`echo $ac_sys_system |
tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
ac_md_release=`echo $ac_sys_release |
tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
aix*) MACHDEP="aix";;
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
'') MACHDEP="unknown";;
esac
if test "$ac_sys_system" = "SunOS"; then
# For Solaris, there isn't an OS version specific macro defined
# in most compilers, so we define one here.
SUNOS_VERSION=`echo $ac_sys_release | sed -e 's!\.\([0-9]\)$!.0\1!g' | tr -d '.'`
AC_DEFINE_UNQUOTED([Py_SUNOS_VERSION], [$SUNOS_VERSION],
[The version of SunOS/Solaris as reported by `uname -r' without the dot.])
fi
fi
AC_MSG_RESULT(["$MACHDEP"])
AC_SUBST([_PYTHON_HOST_PLATFORM])
if test "$cross_compiling" = yes; then
case "$host" in
*-*-linux*)
case "$host_cpu" in
arm*)
_host_cpu=arm
_host_ident=arm
;;
*)
_host_cpu=$host_cpu
_host_ident=$host_cpu
esac
;;
*-*-cygwin*)
_host_cpu=
_host_ident=
;;
*-*-vxworks*)
_host_cpu=$host_cpu
_host_ident=$host_cpu
;;
wasm32-*-* | wasm64-*-*)
_host_cpu=$host_cpu
_host_ident=$host_cpu
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
AC_MSG_ERROR([cross build not supported for $host])
esac
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_ident:+-$_host_ident}"
fi
# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
@ -935,6 +956,14 @@ else
fi
rm -f conftest.out
dnl On some platforms, using a true "triplet" for MULTIARCH would be redundant.
dnl For example, `arm64-apple-darwin` is redundant, because there isn't a
dnl non-Apple Darwin. Including the CPU architecture can also be potentially
dnl redundant - on macOS, for example, it's possible to do a single compile
dnl pass that includes multiple architectures, so it would be misleading for
dnl MULTIARCH (and thus the sysconfigdata module name) to include a single CPU
dnl architecture. PLATFORM_TRIPLET will be a pair or single value for these
dnl platforms.
AC_MSG_CHECKING([for multiarch])
AS_CASE([$ac_sys_system],
[Darwin*], [MULTIARCH=""],
@ -942,7 +971,6 @@ AS_CASE([$ac_sys_system],
[MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
)
AC_SUBST([MULTIARCH])
AC_MSG_RESULT([$MULTIARCH])
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
@ -952,6 +980,16 @@ elif test x$PLATFORM_TRIPLET != x && test x$MULTIARCH = x; then
MULTIARCH=$PLATFORM_TRIPLET
fi
AC_SUBST([PLATFORM_TRIPLET])
AC_MSG_RESULT([$MULTIARCH])
dnl Even if we *do* include the CPU architecture in the MULTIARCH value, some
dnl platforms don't need the CPU architecture in the SOABI tag. These platforms
dnl will have multiple sysconfig modules (one for each CPU architecture), but
dnl use a single "fat" binary at runtime. SOABI_PLATFORM is the component of
dnl the PLATFORM_TRIPLET that will be used in binary module extensions.
AS_CASE([$ac_sys_system],
[SOABI_PLATFORM=$PLATFORM_TRIPLET]
)
if test x$MULTIARCH != x; then
MULTIARCH_CPPFLAGS="-DMULTIARCH=\\\"$MULTIARCH\\\""
@ -1294,7 +1332,7 @@ fi
AC_MSG_CHECKING([LDLIBRARY])
# MacOSX framework builds need more magic. LDLIBRARY is the dynamic
# Apple framework builds need more magic. LDLIBRARY is the dynamic
# library that we build, but we do not want to link against it (we
# will find it with a -framework option). For this reason there is an
# extra variable BLDLIBRARY against which Python and the extension
@ -1302,9 +1340,14 @@ AC_MSG_CHECKING([LDLIBRARY])
# LDLIBRARY, but empty for MacOSX framework builds.
if test "$enable_framework"
then
LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
RUNSHARED=DYLD_FRAMEWORK_PATH=`pwd`${DYLD_FRAMEWORK_PATH:+:${DYLD_FRAMEWORK_PATH}}
case $ac_sys_system in
Darwin)
LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)';;
*)
AC_MSG_ERROR([Unknown platform for framework build]);;
esac
BLDLIBRARY=''
RUNSHARED=DYLD_FRAMEWORK_PATH=`pwd`${DYLD_FRAMEWORK_PATH:+:${DYLD_FRAMEWORK_PATH}}
else
BLDLIBRARY='$(LDLIBRARY)'
fi
@ -1316,64 +1359,64 @@ if test $enable_shared = "yes"; then
[Defined if Python is built as a shared library.])
case $ac_sys_system in
CYGWIN*)
LDLIBRARY='libpython$(LDVERSION).dll.a'
DLLLIBRARY='libpython$(LDVERSION).dll'
;;
LDLIBRARY='libpython$(LDVERSION).dll.a'
DLLLIBRARY='libpython$(LDVERSION).dll'
;;
SunOS*)
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
INSTSONAME="$LDLIBRARY".$SOVERSION
if test "$with_pydebug" != yes
then
PY3LIBRARY=libpython3.so
fi
;;
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
INSTSONAME="$LDLIBRARY".$SOVERSION
if test "$with_pydebug" != yes
then
PY3LIBRARY=libpython3.so
fi
;;
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*)
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
INSTSONAME="$LDLIBRARY".$SOVERSION
if test "$with_pydebug" != yes
then
PY3LIBRARY=libpython3.so
fi
;;
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
INSTSONAME="$LDLIBRARY".$SOVERSION
if test "$with_pydebug" != yes
then
PY3LIBRARY=libpython3.so
fi
;;
hp*|HP*)
case `uname -m` in
ia64)
LDLIBRARY='libpython$(LDVERSION).so'
;;
*)
LDLIBRARY='libpython$(LDVERSION).sl'
;;
esac
BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=SHLIB_PATH=`pwd`${SHLIB_PATH:+:${SHLIB_PATH}}
;;
case `uname -m` in
ia64)
LDLIBRARY='libpython$(LDVERSION).so'
;;
*)
LDLIBRARY='libpython$(LDVERSION).sl'
;;
esac
BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=SHLIB_PATH=`pwd`${SHLIB_PATH:+:${SHLIB_PATH}}
;;
Darwin*)
LDLIBRARY='libpython$(LDVERSION).dylib'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
;;
LDLIBRARY='libpython$(LDVERSION).dylib'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
;;
AIX*)
LDLIBRARY='libpython$(LDVERSION).so'
RUNSHARED=LIBPATH=`pwd`${LIBPATH:+:${LIBPATH}}
;;
LDLIBRARY='libpython$(LDVERSION).so'
RUNSHARED=LIBPATH=`pwd`${LIBPATH:+:${LIBPATH}}
;;
esac
else # shared is disabled
PY_ENABLE_SHARED=0
case $ac_sys_system in
CYGWIN*)
BLDLIBRARY='$(LIBRARY)'
LDLIBRARY='libpython$(LDVERSION).dll.a'
;;
BLDLIBRARY='$(LIBRARY)'
LDLIBRARY='libpython$(LDVERSION).dll.a'
;;
esac
fi
if test "$cross_compiling" = yes; then
RUNSHARED=
RUNSHARED=
fi
AC_ARG_VAR([HOSTRUNNER], [Program to run CPython for the host platform])
@ -5824,7 +5867,7 @@ AC_SUBST([SOABI])
AC_MSG_CHECKING([ABIFLAGS])
AC_MSG_RESULT([$ABIFLAGS])
AC_MSG_CHECKING([SOABI])
SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${SOABI_PLATFORM:+-$SOABI_PLATFORM}
AC_MSG_RESULT([$SOABI])
# Release build, debug build (Py_DEBUG), and trace refs build (Py_TRACE_REFS)
@ -5832,7 +5875,7 @@ AC_MSG_RESULT([$SOABI])
if test "$Py_DEBUG" = 'true'; then
# Similar to SOABI but remove "d" flag from ABIFLAGS
AC_SUBST([ALT_SOABI])
ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${SOABI_PLATFORM:+-$SOABI_PLATFORM}
AC_DEFINE_UNQUOTED([ALT_SOABI], ["${ALT_SOABI}"],
[Alternative SOABI used in debug build to load C extensions built in release mode])
fi