[Python-bugs-list] [ python-Bugs-467055 ] -flat_namespace not in Makefile.pre.in for Darwin/MacOS

noreply@sourceforge.net noreply@sourceforge.net
Tue, 02 Oct 2001 21:44:06 -0700


Bugs item #467055, was opened at 2001-10-01 19:55
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=467055&group_id=5470

Category: Macintosh
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Mitchell L Model (mlm)
Assigned to: Jack Jansen (jackjansen)
Summary: -flat_namespace not in Makefile.pre.in for Darwin/MacOS

Initial Comment:
Python 2.2a4 fixed Python 2.1's inadequate LDSHARED setting for Darwin/OS X as far as building Python is concerned.  However, it does not go quite far enough and the problem still exists for building other software that uses a similar configuration process, in particular Zope 2.4(.1).  It turns out that the top-level Makefile and Makefile.pre both have -flat_namespace correctly set, but Makefile.pre.in does not.  Since Makefile.pre.in gets installed in /usr/local/lib/python2.2/config, and other software using this build process reference Makefile.pre.in from there, -flat_namespace isn't set for the other software.  Manually adding:

LDSHARED= $(CC) $(LDFLAGS) -flat_namespace -undefined suppress

fixed the problem, at least for building Zope 2.4.  I don't know how much of that is actually needed other than -flat_namespace.

Please fix this for the real release!  The improvements for building on Mac OS X are wonderful -- it would be a shame for them to fail for the lack of one line in one file!

(I'm using Mac OS 10.1, in case that matters, with the developer tools installed.)

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

>Comment By: Mitchell L Model (mlm)
Date: 2001-10-02 21:44

Message:
Logged In: YES 
user_id=221340

I started working my way through the Zope build process to see what was going on.  Things looked correct far enough into the process that I began to wonder what was going on.  In desperation, I renamed /usr/local to something else, unpacked the Python 2.2a4 and Zope 2.4.1 tar files, and remade both.  I didn't get the error I got last night.

Ugh.  I spent some time retracing my steps, but I couldn't figure out what happened.  So, false alarm.  But I learned a lot!  Sorry to bother you with all this.

By the way, with the updates for OS 10.1 in Python 2.2a4, all I had to do to make both Python and Zope was:

    cd Python2.2a4
	configure --with-suffix=.exe
	make
	sudo make install

	cd Zope
	python wo_pcgi.py

That's all.  Just that one configure flag, and no global variables set.  Very, very nice.  What a delight to have a just released MacOS treated with respect by multi-platform software!

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-02 13:41

Message:
Logged In: YES 
user_id=6380

Yes, the build procedure can be quite dazzling -- I don't
claim complete knowledge myself any more. :-)

Any platform-specific things needed for 3rd party builds
*should* be picked up when the Modules/makesetup script runs
and transforms the installed Makefile.pre.in into a
Makefile. It would be interesting to find out why it doesn't
pick up the LDSHARED setting; can you figure that out? When
I try this on Linux (not with Zope), the LDSHARED setting
chosen by the configure script doe get stuffed into Makefile
correctly...

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

Comment By: Mitchell L Model (mlm)
Date: 2001-10-02 13:33

Message:
Logged In: YES 
user_id=221340

OK, I understand.  And I realized later that maybe it would have to be Zope that changes not Python.  I was somewhat seduced by the improvement from Python 2.1 to 2.2a4 with respect to building on OS X that I assumed the intention was to fix things entirely and that given how early it is in the Python 2.2 and Mac OS 10.1 games it seemed likely that what I uncovered was a bug.  If it was it would be great to have gotten it into the 2.2 release, so I shot out my message last night without completely thinking it through.

Although I have an enormous amount of experience in a lot of different languages, systems, and build mechanisms, I'm just recently getting involved in the Open Source world, Python, and OS X, and there's such a huge amount to know about that I'm finding I'm often running on guesses and hopes.

In this case, I was assuming that what Python and Zope were doing were both some kind of generally accepted installation procedure -- it certainly looked like Zope was using the Python mechanisms, since it was affected by Makefile.pre.in, etc.  I followed enough of the configure and build mechanisms through to figure out where Python was getting -flat_namespace from for its Makefile and Makefile.pre.

[This is a complex mechanism!  Reminds me of the early days of the X Window System and its imake facility.  There's a point at which even the most knowledgeable and experienced human can't follow enough levels of indirection and parameterization to make sense of things....]

Since Python installed Makefile.pre.in, and Zope used it, I assumed that was all as intended.  If Zope should use a different build process, then nothing needs to be done for Python. However, wouldn't it be easy enough for the Python installation process to modify the Makefile.pre.in that it installs in ../config?  Or at least add a release note telling people using Mac OS 10.1 to add a line to the installed file after the installation is complete?

Your call.  I just wanted to provide a heads-up in case I had discovered something you would want to have fixed.

[This is the first time I'm actually contributing anything t SourceForge, rather than just downloading stuff from it.  I invite you to email me with suggestions about what I should be saying using the bug tracker and what I shouldn't, or anything else you want to suggest about community assumptions and conventions.]

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-02 06:59

Message:
Logged In: YES 
user_id=6380

I'm not sure what you're suggesting we *do* here. We can't
add -flat_namespace to Makefile.pre.in, because it's a
platform-independent file. Also note that there's some name
confusion: the Makefile.pre.in that's installed in
.../config is not the same one that is used to build Python;
it's an old (and deprecated) way to build 3rd party
extensions, whose source is in Misc/Makefile.pre.in; the
current party line is to use distutils. Maybe Zope should
switch to using distutils too.

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=467055&group_id=5470