Ned Deily <n...@acm.org> wrote:

> Sorry, I don't use Xcode for Python development but I'm having a hard  
> time imagining what sequence of events would have caused the SDK to be  
> overwritten.  I'm assuming you mean:
> 
> /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework
> 
> Did you try to build Python within Xcode or something?

Nope.  I unpacked the sources to /tmp, then did a "make
frameworkinstall", I believe it was.  I expected things to wind up in
/Library/Frameworks/Python.Framework, which they did.  I was surprised
to see that the library under /Developer had the same timestamps.

> >> Secondly, when I then ran my Python-Cocoa app, it picked up the  
> >> framework
> >> in /Library/Frameworks/Python..., which didn't have objc, so it  
> >> bombed
> >> on that.  I just deleted /Library/Frameworks/Python....  That  
> >> seemed to
> >> fix that.
> > Can anyone explain to me why this happened?  Is this a side-effect of
> > overwriting the /Developer version of the library?
> 
> The normal install path for a frameworks build is /Library/Frameworks/ 
> Python.frameworks/Version/... .  And it appears that 
> /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks is a symlink to 
> /Library/Frameworks.

Hmmm.  OK, that makes it clearer what happened.  Here's the link line that
Xcode uses (I presume this comes from the Python-Cocoa project
template):

Ld 
/p/goodstuff/build/cocoa-gadget.build/Release/goodStuff.build/Objects-normal/ppc/goodStuff
 normal ppc
    cd /p/goodstuff
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    /Developer/usr/bin/gcc-4.0 -arch ppc -isysroot 
/Developer/SDKs/MacOSX10.5.sdk -L/p/goodstuff/build/Release 
-F/p/goodstuff/build/Release -filelist 
/p/goodstuff/build/cocoa-gadget.build/Release/goodStuff.build/Objects-normal/ppc/goodStuff.LinkFileList
 -mmacosx-version-min=10.5 -framework Cocoa -framework Python -framework WebKit 
-o 
/p/goodstuff/build/cocoa-gadget.build/Release/goodStuff.build/Objects-normal/ppc/goodStuff
ld warning: in 
/Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//Python.framework/Python, 
file is not of required architecture
Undefined symbols:
  "_Py_SetProgramName", referenced from:
      _main in main.o
  "_Py_Initialize", referenced from:
      _main in main.o
  "_PySys_SetArgv", referenced from:
      _main in main.o
  "_PyRun_SimpleFileExFlags", referenced from:
      _main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Apparently gcc resolved "-framework Python" to
"/Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks/Python.framework", my
new build.  But why did it use that in preference to
"/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework",
which also exists?  Ah, the "ld" page says that "The default framework
search path is /Library/Frameworks then /System/Library/Frameworks."

I probably want to add "-Z -F/System/Library/Frameworks" to the default
template.

Bill
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to