classification
Title: Python build fails for gcc 4.x from Gnu
Type: Stage:
Components: Build Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Make python build with gcc-4.2 on OS X 10.4.9
View: 1779871
Assigned To: Nosy List: johnwgrove, jyasskin, schmir
Priority: normal Keywords:

Created on 2006-03-15 23:36 by johnwgrove, last changed 2008-03-14 22:38 by jyasskin. This issue is now closed.

Files
File name Uploaded Description Edit
configure.in johnwgrove, 2006-03-15 23:36 Python-2.4.2/configure.in
Messages (3)
msg27788 - (view) Author: John W. Grove (johnwgrove) Date: 2006-03-15 23:36
The configure script for Python 4.2.2 add the compiler
flags -Wno-long-double and -no-cpp-precomp when using
the Gnu gcc compiler on Darwin. This causes the build
to fail when using versions of GCC build directly from
Gnu source (for example gcc-4.0.2 and gcc-4.1). These
options are only available when using the "native" gcc
compilers supplied with the Darwin OS. In particular I
am using OS X 8.5.0. There is a simple correction to
this problem that involves using autoconf tests for the
appropriateness of these options before adding them to
the BASECFLAGS environment variable. In particular the
following works:

Replace the line

BASECFLAGS="$BASECFLAGS -Wno-long-double
-no-cpp-precomp -mno-fused-madd"

at or near line 3165 under the Darwin case in configure.in

with the following test

AC_LANG_SAVE
	    AC_LANG_C
            ac_save_cc="$CC"
	    for arg in -Wno-long-double -no-cpp-precomp
-mno-fused-madd ; do
	      CC="$ac_save_cc $arg"
	      AC_COMPILE_IFELSE([
		      AC_LANG_SOURCE([[
#include <stdlib.h>
#include <stdio.h>
int main(int argc,char**argv)
{
    return 0;
}
              ]])],[BASECFLAGS="$BASECFLAGS $arg"],[])
	    done
            CC="$ac_save_cc"
	    AC_LANG_RESTORE

in other words test to see if the option works with the
chosen compiler before adding it blindly to BASECFLAGS.

I am attaching this version of configure.in for your
convenience. I tested my build of Python-2.4.2 on both
Linux and Darwin using the apple version of gcc 3.3 as
well as Gnu versions gcc 4.0.2 and 4.1 that I built
from source. The build and install worked properly and
the python executable was runable in all cases. I did
not perform more extensive regression tests, but I
believe this change has no effect for compilations
using previously support configurations, and only
applies for new currently unsupported compilers.



msg63535 - (view) Author: Ralf Schmitt (schmir) Date: 2008-03-14 19:19
This should be closed:
from http://python.org/download/releases/2.4.5/:
"Since the release candidate, we received various reports that the this
release may fail to build on current operating systems, in particular on
OS X. We have made no attempt to fix these problems..."
msg63539 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-03-14 22:38
I think this is still a problem at head, so it's not covered by the
comment about the bugfix releases. But there is another issue covering
the same thing... Since that one also has a patch and is a little newer,
I'll point this one over there.
History
Date User Action Args
2008-03-14 22:38:29jyasskinsetstatus: open -> closed
resolution: duplicate
superseder: Make python build with gcc-4.2 on OS X 10.4.9
messages: + msg63539
2008-03-14 19:19:12schmirsetnosy: + schmir
messages: + msg63535
2007-08-25 04:13:33jyasskinsetnosy: + jyasskin
2006-03-15 23:36:35johnwgrovecreate