[Python-Dev] MacOSX -framework options and distutils weirdness

2007-10-09 Thread Greg Ewing
A while back I wrote about a problem I was having with
the ordering of -framework options in distutils compilation
commands. Well, now I've discovered something even stranger.

When distutils executes the following link command, I get
a bunch of undefined OpenGL-related symbols. But if I
copy and paste *exactly the same command* into the shell,
it succeeds!

What could possibly be going on here?

gcc -Wl,-F. -bundle -framework Python
build/temp.darwin-8.4.0-Power_Macintosh-2.3/_soya.o
build/temp.darwin-8.4.0-Power_Macintosh-2.3/matrix.o
build/temp.darwin-8.4.0-Power_Macintosh-2.3/chunk.o -L/usr/lib -L/usr/local/lib
-L/usr/X11R6/lib -lm -lGLEW -lfreetype -lcal3d -lstdc++ -lode -o
build/lib.darwin-8.4.0-Power_Macintosh-2.3/soya/_soya.so -framework OpenGL
-framework SDL -framework OpenAL

This is on MacOSX 10.4 with Python 2.3.

--
Greg
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] MacOSX -framework options and distutils weirdness

2007-10-09 Thread Ronald Oussoren
 
On Tuesday, October 09, 2007, at 12:29PM, "Greg Ewing" <[EMAIL PROTECTED]> 
wrote:
>A while back I wrote about a problem I was having with
>the ordering of -framework options in distutils compilation
>commands. Well, now I've discovered something even stranger.
>
>When distutils executes the following link command, I get
>a bunch of undefined OpenGL-related symbols. But if I
>copy and paste *exactly the same command* into the shell,
>it succeeds!
>
>What could possibly be going on here?

My guess is MACOSX_DEPLOYMENT_TARGET: this is set in the environment by 
distutils.

>
>gcc -Wl,-F. -bundle -framework Python
>build/temp.darwin-8.4.0-Power_Macintosh-2.3/_soya.o
>build/temp.darwin-8.4.0-Power_Macintosh-2.3/matrix.o
>build/temp.darwin-8.4.0-Power_Macintosh-2.3/chunk.o -L/usr/lib -L/usr/local/lib
>-L/usr/X11R6/lib -lm -lGLEW -lfreetype -lcal3d -lstdc++ -lode -o
>build/lib.darwin-8.4.0-Power_Macintosh-2.3/soya/_soya.so -framework OpenGL
>-framework SDL -framework OpenAL
>
>This is on MacOSX 10.4 with Python 2.3.

Is that the system supplied version of Python?  Distutils sets 
MACOSX_DEPLOYMENT_TARGET to 10.4 in that case, for home-build binaries the 
variable is set to whatever the value was at configure time, defaulting to 10.3.

Ronald

>
>--
>Greg
>___
>Python-Dev mailing list
>[email protected]
>http://mail.python.org/mailman/listinfo/python-dev
>Unsubscribe: 
>http://mail.python.org/mailman/options/python-dev/ronaldoussoren%40mac.com
>
>
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] MacOSX -framework options and distutils weirdness

2007-10-09 Thread Greg Ewing
Ronald Oussoren wrote:
> Is that the system supplied version of Python?

No, it's my own installation of 2.3, but it's installed
as a framework in /Library/Frameworks.

> My guess is MACOSX_DEPLOYMENT_TARGET: this is set in the 
 > environment by distutils.

I wondered about that -- I've noticed that with later
Python versions, distutils linking commands *don't* work
in the shell unless I set MACOSX_DEPLOYMENT_TARGET to
10.3 (it's not set at all in my shell environment by
default).

But the problem here is the other way around. I would
have thought distutils would set it to something appropriate
for the Python being used.

Any suggestions on how I can find out what setting of
MACOSX_DEPLOYMENT_TARGET is being used by distutils, and
how to make it use something different if it's not right?

--
Greg


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] MacOSX -framework options and distutils weirdness

2007-10-09 Thread Ronald Oussoren


On 9 Oct, 2007, at 23:11, Greg Ewing wrote:


Ronald Oussoren wrote:

Is that the system supplied version of Python?


No, it's my own installation of 2.3, but it's installed
as a framework in /Library/Frameworks.


My guess is MACOSX_DEPLOYMENT_TARGET: this is set in the

> environment by distutils.

I wondered about that -- I've noticed that with later
Python versions, distutils linking commands *don't* work
in the shell unless I set MACOSX_DEPLOYMENT_TARGET to
10.3 (it's not set at all in my shell environment by
default).

But the problem here is the other way around. I would
have thought distutils would set it to something appropriate
for the Python being used.


It is supposed to do that, but to be honest I don't remember if the  
code for that is present in the 2.3 tree and I'm too lazy to check the  
sources right now.


The deployment target does have an influence on how the compiler  
functions, which can explain when setting the target to a different  
value causes problems.





Any suggestions on how I can find out what setting of
MACOSX_DEPLOYMENT_TARGET is being used by distutils, and
how to make it use something different if it's not right?


In current versions of python this is read from config/Makefile in the  
standard library (that is /Library/Frameworks/Python.framework/ 
Versions/2.3/lib/python2.3/config/Makefile)


Ronald




--
Greg






smime.p7s
Description: S/MIME cryptographic signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com