[Patches] [ python-Patches-681504 ] using gcc on cygwin for config

SourceForge.net noreply@sourceforge.net
Mon, 10 Feb 2003 12:40:44 -0800


Patches item #681504, was opened at 2003-02-05 21:46
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=681504&group_id=5470

Category: Distutils and setup.py
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Michiel de Hoon (mdehoon)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: using gcc on cygwin for config

Initial Comment:
On Cygwin, I noticed that distutils tries to use the cc
compiler instead of the gcc compiler for the config
step, resulting in an error. Instead, for the build
step the correct compiler (gcc) is being used.

For the build step, build_clib.py and build_ext.py
contain a call to customize_compiler after the call to
new_compiler. The call to customize_compiler causes gcc
to be used on cygwin. In config.py, however, this call
to customize_compiler after the call to new_compiler is
missing.

Adding the call to customize_compiler after the call to
new_compiler in config.py solves this problem, and the
config step then runs correctly on Cygwin.

BTW, I noticed that in version 1.44.6.3 of sysconfig.py
in CVS, the function get_python_version is missing,
causing errors in the build step. This is the latest
committed version of sysconfig.py. So I used version
1.56 instead (which was committed earlier than
1.44.6.3, but has a higher version number ??).


Michiel de Hoon
University of Tokyo, Human Genome Center

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

>Comment By: Jason Tishler (jlt63)
Date: 2003-02-10 11:40

Message:
Logged In: YES 
user_id=86216

> Adding a symlink would work, but I
> am not sure if it is the best solution.

Maybe both should be done?

> Would that be OK with you?

The patch is fine by me since it fixes Cygwin
and I assume any other Unix (if any) without a
/usr/bin/cc.

> Or do you think there might be some problem
> with the patch I submitted?

No, I don't think that there will be problems
with your patch. However, I cannot approve
patches. I can only submit them like you. :,)

Neal, should someone from distutils take
a look-see. Or, is it OK for me to apply?

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

Comment By: Michiel de Hoon (mdehoon)
Date: 2003-02-10 08:13

Message:
Logged In: YES 
user_id=488897

OK thanks for your help. Adding a symlink would work, but I
am not sure if it is the best solution. For the build step,
distutils uses gcc automatically and doesn't need a symlink
from cc. I think it is best if the config step mimics the
build step as closely as possible, and having one solution
for the build step and another for the config step might
break things. For the patch that I submitted, I compared the
config and the build step to find out where one chooses gcc
and the other cc. The patch contains only one or two lines,
and lets the config step choose gcc in the same way as the
build step. Would that be OK with you? Or do you think there
might be some problem with the patch I submitted?
--Michiel.

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

Comment By: Jason Tishler (jlt63)
Date: 2003-02-10 07:56

Message:
Logged In: YES 
user_id=86216

OK, now I get it. Thanks for you help. 

I can reproduce the problem under Cygwin
too. Now the question is, where is the right
place to fix this?

Under Red Hat 8.0, I get the following:

$ ls -il /usr/bin/cc /usr/bin/c++ /usr/bin/g++
 328451 -rwxr-xr-x    4 root     root        80780 Sep  3 
23:03 /usr/bin/c++
 328396 lrwxrwxrwx    1 root     root            3 Oct 21 
10:04 /usr/bin/cc -> gcc
 328451 -rwxr-xr-x    4 root     root        80780 Sep  3 
23:03 /usr/bin/g++

Under Cygwin, I get the following:

$ ls -il /usr/bin/cc /usr/bin/c++ /usr/bin/g++
ls: /usr/bin/cc: No such file or directory
 423677 lrwxrwxrwx    1 Administ Domain U       18 Dec  3 
08:22 /usr/bin/c++ -> g++.exe
 423679 -rwxrwxrwx    1 Administ Domain U    89600 Nov 14 
17:37 /usr/bin/g++

So from the above, we can see that a symlink from cc
to gcc could be considered missing under Cygwin.

I will ask the Cygwin gcc maintainer to add this symlink.
If the request is granted, will you consider this issue
resolved?

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

Comment By: Michiel de Hoon (mdehoon)
Date: 2003-02-10 07:06

Message:
Logged In: YES 
user_id=488897

The config step is where you do
python setup.py config
where you can do some test compilations before doing "python
setup.py build". Basically it works the same as
autoconf/automake's configure scripts. The code for the
config is in distutils/command/config.py. If you want to try
it out, you can go to my website
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon, download pygist,
unpack, and run "python setup.py config". You'll notice that
it won't work on cygwin, as it tries to use cc instead of gcc.
--Michiel.

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

Comment By: Jason Tishler (jlt63)
Date: 2003-02-10 06:54

Message:
Logged In: YES 
user_id=86216

> On Cygwin, I noticed that distutils tries to use the cc 
> compiler instead of the gcc compiler for the config 
> step, resulting in an error.

Please excuse my ignorance, but what is the "config
step?" How would one invoke the config step? Sorry,
but I'm only lightly versed in distutils.

> Instead, for the build 
> step the correct compiler (gcc) is being used.

The build step seems to work fine under Cygwin Python
2.2.2 and CVS.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-07 13:55

Message:
Logged In: YES 
user_id=33168

Jason, can you provide any input about the issues w/Cygwin?

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=681504&group_id=5470