[Pythonmac-SIG] Fwd: configure.in syntax to find python binary during build...

Jack Jansen jack@oratrix.nl
Sat, 01 Sep 2001 22:03:46 +0200


Recently, Steve Spicklemire <steve@spvi.com> said:
> > 	I'd like to modify configure.in for building Python on darwin. The 
> > current configure.in uses "-undefined suppress" for generating shared 
> > libs, and this get's a little tricky in later versions of darwin.

Note that "-undefined suppress" is only used if you don't
"--enable-framework". If you're doing a framework build then the
loader does know of all the externals (as they're in the Python
framework).

> > I 
> > snooped around on the darwin mailing list(s) and someone pointed me in 
> > the direction of "-bundle_loader" which tells ld where to find symbols 
> > that the library needs to have from the loading binary. Anyway.. since 
> > I choose '.exe' as the --with-suffix then my python binary turns out to 
> > be "python.exe" so this works for me in 'configure':
> >
> >         Darwin/*|next/*)
> >                 if test "$ns_dyld"
> >                 then LDSHARED='$(CC) $(LDFLAGS) -bundle -bundle_loader 
> > python.exe'
> >                 else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
> >                 fi

$(PYTHON) is what you're looking for. (Now you're probably saying,
"ah...":-)

However, I have a question about the -bundle_loader: is it also
supported under 10.0.4 and earlier (not running OSX at the moment, so
can't check myself)?

If it isn't you should make this dependent on the Darwin version.

And something else: as I see the Darwin/*|next/* in your code: you're
probably using an older release of Python than 2.2a2. I would suggest
you upgrade, as a lot of things related to dynamic loading have
changed.

And finally: if you have a patch relative to the current CVS sources
(or 2.2a2, that's good enough, I guess) please put it in the
sourceforge patch manager. You can assign it to me and I'll check it
in.

> >  However.. someone else might choose a different suffix, and when 
> > building shared modules in other directories I'm thinking that you may 
> > need a full path to the python binary for this to work. Long story 
> > short: How to you spell "Path to the installed binary of python" in 
> > configure.in so that I can modify it for newer versions of darwin?

Hmm, that's a more difficult problem. Because LDSHARED can be used in
two circumstances:
- During the build, when python.exe (or whatever) is in the current
  directory (and not in the installed directory yet)
- Later, during distutils-based extension building, when python.exe is
  installed (and you don't know where the build directory is anymore).

I don't see a solution for this (except for switching to frameworks,
which don't have the problem).
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.cwi.nl/~jack        | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm