mirror of https://github.com/python/cpython.git
gh-93744: Remove configure --with-cxx-main option (#95651)
Remove the "configure --with-cxx-main" build option: it didn't work
for many years. Remove the MAINCC variable from configure and
Makefile.
The MAINCC variable was added by the issue gh-42471: commit
0f48d98b74
. Previously, --with-cxx-main
was named --with-cxx.
Keep CXX and LDCXXSHARED variables, even if they are no longer used
by Python build system.
This commit is contained in:
parent
3a9e1fda7a
commit
398ed84dc4
|
@ -41,12 +41,6 @@ General Options
|
||||||
|
|
||||||
See :data:`sys.int_info.bits_per_digit <sys.int_info>`.
|
See :data:`sys.int_info.bits_per_digit <sys.int_info>`.
|
||||||
|
|
||||||
.. cmdoption:: --with-cxx-main
|
|
||||||
.. cmdoption:: --with-cxx-main=COMPILER
|
|
||||||
|
|
||||||
Compile the Python ``main()`` function and link Python executable with C++
|
|
||||||
compiler: ``$CXX``, or *COMPILER* if specified.
|
|
||||||
|
|
||||||
.. cmdoption:: --with-suffix=SUFFIX
|
.. cmdoption:: --with-suffix=SUFFIX
|
||||||
|
|
||||||
Set the Python executable suffix to *SUFFIX*.
|
Set the Python executable suffix to *SUFFIX*.
|
||||||
|
@ -721,22 +715,10 @@ Compiler flags
|
||||||
|
|
||||||
Example: ``gcc -pthread``.
|
Example: ``gcc -pthread``.
|
||||||
|
|
||||||
.. envvar:: MAINCC
|
|
||||||
|
|
||||||
C compiler command used to build the ``main()`` function of programs like
|
|
||||||
``python``.
|
|
||||||
|
|
||||||
Variable set by the :option:`--with-cxx-main` option of the configure
|
|
||||||
script.
|
|
||||||
|
|
||||||
Default: ``$(CC)``.
|
|
||||||
|
|
||||||
.. envvar:: CXX
|
.. envvar:: CXX
|
||||||
|
|
||||||
C++ compiler command.
|
C++ compiler command.
|
||||||
|
|
||||||
Used if the :option:`--with-cxx-main` option is used.
|
|
||||||
|
|
||||||
Example: ``g++ -pthread``.
|
Example: ``g++ -pthread``.
|
||||||
|
|
||||||
.. envvar:: CFLAGS
|
.. envvar:: CFLAGS
|
||||||
|
@ -854,7 +836,7 @@ Linker flags
|
||||||
|
|
||||||
Linker command used to build programs like ``python`` and ``_testembed``.
|
Linker command used to build programs like ``python`` and ``_testembed``.
|
||||||
|
|
||||||
Default: ``$(PURIFY) $(MAINCC)``.
|
Default: ``$(PURIFY) $(CC)``.
|
||||||
|
|
||||||
.. envvar:: CONFIGURE_LDFLAGS
|
.. envvar:: CONFIGURE_LDFLAGS
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ abs_builddir= @abs_builddir@
|
||||||
|
|
||||||
CC= @CC@
|
CC= @CC@
|
||||||
CXX= @CXX@
|
CXX= @CXX@
|
||||||
MAINCC= @MAINCC@
|
|
||||||
LINKCC= @LINKCC@
|
LINKCC= @LINKCC@
|
||||||
AR= @AR@
|
AR= @AR@
|
||||||
READELF= @READELF@
|
READELF= @READELF@
|
||||||
|
@ -1222,10 +1221,10 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h M
|
||||||
-o $@ $(srcdir)/Modules/getpath.c
|
-o $@ $(srcdir)/Modules/getpath.c
|
||||||
|
|
||||||
Programs/python.o: $(srcdir)/Programs/python.c
|
Programs/python.o: $(srcdir)/Programs/python.c
|
||||||
$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c
|
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c
|
||||||
|
|
||||||
Programs/_testembed.o: $(srcdir)/Programs/_testembed.c Programs/test_frozenmain.h
|
Programs/_testembed.o: $(srcdir)/Programs/_testembed.c Programs/test_frozenmain.h
|
||||||
$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c
|
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c
|
||||||
|
|
||||||
Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(srcdir)/Modules/_sre/sre.h $(srcdir)/Modules/_sre/sre_constants.h $(srcdir)/Modules/_sre/sre_lib.h
|
Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(srcdir)/Modules/_sre/sre.h $(srcdir)/Modules/_sre/sre_constants.h $(srcdir)/Modules/_sre/sre_lib.h
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Remove the ``configure --with-cxx-main`` build option: it didn't work for
|
||||||
|
many years. Remove the ``MAINCC`` variable from ``configure`` and
|
||||||
|
``Makefile``. Patch by Victor Stinner.
|
|
@ -927,7 +927,6 @@ MULTIARCH_CPPFLAGS
|
||||||
PLATFORM_TRIPLET
|
PLATFORM_TRIPLET
|
||||||
MULTIARCH
|
MULTIARCH
|
||||||
ac_ct_CXX
|
ac_ct_CXX
|
||||||
MAINCC
|
|
||||||
CXX
|
CXX
|
||||||
EGREP
|
EGREP
|
||||||
SED
|
SED
|
||||||
|
@ -1036,7 +1035,6 @@ enable_universalsdk
|
||||||
with_universal_archs
|
with_universal_archs
|
||||||
with_framework_name
|
with_framework_name
|
||||||
enable_framework
|
enable_framework
|
||||||
with_cxx_main
|
|
||||||
with_emscripten_target
|
with_emscripten_target
|
||||||
enable_wasm_dynamic_linking
|
enable_wasm_dynamic_linking
|
||||||
enable_wasm_pthreads
|
enable_wasm_pthreads
|
||||||
|
@ -1805,9 +1803,6 @@ Optional Packages:
|
||||||
specify the name for the python framework on macOS
|
specify the name for the python framework on macOS
|
||||||
only valid when --enable-framework is set. see
|
only valid when --enable-framework is set. see
|
||||||
Mac/README.rst (default is 'Python')
|
Mac/README.rst (default is 'Python')
|
||||||
--with-cxx-main[=COMPILER]
|
|
||||||
compile main() and link Python executable with C++
|
|
||||||
compiler specified in COMPILER (default is $CXX)
|
|
||||||
--with-emscripten-target=[browser|node]
|
--with-emscripten-target=[browser|node]
|
||||||
Emscripten platform
|
Emscripten platform
|
||||||
--with-suffix=SUFFIX set executable suffix to SUFFIX (default is empty,
|
--with-suffix=SUFFIX set executable suffix to SUFFIX (default is empty,
|
||||||
|
@ -5550,35 +5545,6 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-cxx-main=<compiler>" >&5
|
|
||||||
$as_echo_n "checking for --with-cxx-main=<compiler>... " >&6; }
|
|
||||||
|
|
||||||
# Check whether --with-cxx_main was given.
|
|
||||||
if test "${with_cxx_main+set}" = set; then :
|
|
||||||
withval=$with_cxx_main;
|
|
||||||
|
|
||||||
case $withval in
|
|
||||||
no) with_cxx_main=no
|
|
||||||
MAINCC='$(CC)';;
|
|
||||||
yes) with_cxx_main=yes
|
|
||||||
MAINCC='$(CXX)';;
|
|
||||||
*) with_cxx_main=yes
|
|
||||||
MAINCC=$withval
|
|
||||||
if test -z "$CXX"
|
|
||||||
then
|
|
||||||
CXX=$withval
|
|
||||||
fi;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
|
|
||||||
with_cxx_main=no
|
|
||||||
MAINCC='$(CC)'
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cxx_main" >&5
|
|
||||||
$as_echo "$with_cxx_main" >&6; }
|
|
||||||
|
|
||||||
preset_cxx="$CXX"
|
preset_cxx="$CXX"
|
||||||
if test -z "$CXX"
|
if test -z "$CXX"
|
||||||
then
|
then
|
||||||
|
@ -6661,7 +6627,7 @@ LDVERSION="$VERSION"
|
||||||
$as_echo_n "checking LINKCC... " >&6; }
|
$as_echo_n "checking LINKCC... " >&6; }
|
||||||
if test -z "$LINKCC"
|
if test -z "$LINKCC"
|
||||||
then
|
then
|
||||||
LINKCC='$(PURIFY) $(MAINCC)'
|
LINKCC='$(PURIFY) $(CC)'
|
||||||
case $ac_sys_system in
|
case $ac_sys_system in
|
||||||
QNX*)
|
QNX*)
|
||||||
# qcc must be used because the other compilers do not
|
# qcc must be used because the other compilers do not
|
||||||
|
|
25
configure.ac
25
configure.ac
|
@ -865,29 +865,6 @@ rm -f conftest.c conftest.out
|
||||||
AC_USE_SYSTEM_EXTENSIONS
|
AC_USE_SYSTEM_EXTENSIONS
|
||||||
|
|
||||||
AC_SUBST(CXX)
|
AC_SUBST(CXX)
|
||||||
AC_SUBST(MAINCC)
|
|
||||||
AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
|
|
||||||
AC_ARG_WITH(cxx_main,
|
|
||||||
AS_HELP_STRING([--with-cxx-main@<:@=COMPILER@:>@],
|
|
||||||
[compile main() and link Python executable with C++ compiler specified in COMPILER (default is $CXX)]),
|
|
||||||
[
|
|
||||||
|
|
||||||
case $withval in
|
|
||||||
no) with_cxx_main=no
|
|
||||||
MAINCC='$(CC)';;
|
|
||||||
yes) with_cxx_main=yes
|
|
||||||
MAINCC='$(CXX)';;
|
|
||||||
*) with_cxx_main=yes
|
|
||||||
MAINCC=$withval
|
|
||||||
if test -z "$CXX"
|
|
||||||
then
|
|
||||||
CXX=$withval
|
|
||||||
fi;;
|
|
||||||
esac], [
|
|
||||||
with_cxx_main=no
|
|
||||||
MAINCC='$(CC)'
|
|
||||||
])
|
|
||||||
AC_MSG_RESULT($with_cxx_main)
|
|
||||||
|
|
||||||
preset_cxx="$CXX"
|
preset_cxx="$CXX"
|
||||||
if test -z "$CXX"
|
if test -z "$CXX"
|
||||||
|
@ -1358,7 +1335,7 @@ AC_SUBST(LINKCC)
|
||||||
AC_MSG_CHECKING(LINKCC)
|
AC_MSG_CHECKING(LINKCC)
|
||||||
if test -z "$LINKCC"
|
if test -z "$LINKCC"
|
||||||
then
|
then
|
||||||
LINKCC='$(PURIFY) $(MAINCC)'
|
LINKCC='$(PURIFY) $(CC)'
|
||||||
case $ac_sys_system in
|
case $ac_sys_system in
|
||||||
QNX*)
|
QNX*)
|
||||||
# qcc must be used because the other compilers do not
|
# qcc must be used because the other compilers do not
|
||||||
|
|
Loading…
Reference in New Issue