[Python-bugs-list] [Bug #124782] configure should attempt to find a default C++ compiler.

noreply@sourceforge.net noreply@sourceforge.net
Wed, 13 Dec 2000 07:54:21 -0800


Bug #124782, was updated on 2000-Dec-06 15:50
Here is a current snapshot of the bug.

Project: Python
Category: Build
Status: Closed
Resolution: Wont Fix
Bug Group: None
Priority: 3
Submitted by: gvanrossum
Assigned to : loewis
Summary: configure should attempt to find a default C++ compiler.

Details: It's annoying that C++ isn't better supported by default. Currently, you must specify the C++ compiler with the --with-gxx=... flag.

The configure script could easily set CXX to g++ if that exists and if we are using GCC, for example.

(But why does using the --with-gxx flag automatically create a main program compiled with C++?)


Follow-Ups:

Date: 2000-Dec-13 07:54
By: gvanrossum

Comment:
Closed again. Thanks!

-------------------------------------------------------

Date: 2000-Dec-13 07:27
By: loewis

Comment:
I've uploaded patch 102817, which runs something like AC_PROG_CXX. We can't use that directly, as it fails if no C++ compiler is found. Also, if -with-cxx is given, no attempt to autodetermine a C++ compiler is made.
-------------------------------------------------------

Date: 2000-Dec-13 06:27
By: gvanrossum

Comment:
Reopening, because of one remaining issue.  I just checked in changes to Modules/makesetup and Misc/Makefile.pre.in to use $(CXX) instead of $(CCC) for the C++ compiler, since CCC doesn't seem to be defined.  However this only works if --with-cxx is used; otherwise CXX is not defined either.  There was a bug report about this, #124478.

The problem is, CXX extensions using the Makefile.pre.in mechanism don't work out of the box unless --with-cxx is used.  I don't care if the --with-cxx option is changed (probably better not), but even if it isn't, the CXX variable should be given a default value if a C++ compiler can be guessed (I bet trying g++ when we're using GCC would take care of 90% of the problem :-).
-------------------------------------------------------

Date: 2000-Dec-13 06:17
By: loewis

Comment:
The --with-cxx flag is designed to support extension modules written in C++. In some compilation systems, compiling any object file with C++ requires that the main function is compiled and linked with the C++ compiler. For example, on an a.out system, with g++, g++ will generate a call to __main as the first thing in main(), to allow for construction of global objects. On an advanced compilation system (e.g. ELF, or Win32), this is not necessary - global objects will be constructed even if main was not compiled with a C++ compiler.

I believe the sole purpose of --with-cxx flag is to support that case; I can't emagine any other reason to use it. Since  such requirement of the C++ compiler is becoming rare, I don't think there is a need to change the behaviour of the Python configure.in. 

So the real bug is that --with-cxx was not documented; that is corrected in README 1.107.
-------------------------------------------------------

Date: 2000-Dec-11 12:47
By: gvanrossum

Comment:
Martin, do you happen to be a C++ user?  Maybe you have an idea what to do with this?  If not, assign it back to me or to Nobody.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=124782&group_id=5470