On 19/08/2005, at 7:57 AM, Graham Dumpleton wrote:


On 19/08/2005, at 2:59 AM, Jim Gallacher wrote:


Ron Reisor wrote:

Hello,
I ran into a problem with the loader on MacOSX.
MaxOSX 1.4.2
python 2.4.1
apache 2.0.54
The loader seems to not like the "-undefined suppress" arguments in the final load.
I modified dist/setup.py by removing the two "-undefined suppress" and ran configure and make again and the new mod_python does build and seems to work ok.


The bit of code which includes "-undefined suppress" came from the patch Graham submitted for MODPYTHON-65.  See http://issues.apache.org/jira/browse/MODPYTHON-65 for details.

Not being a Mac person I can't comment further. Feel free to talk among yourselves. ;)


Yep, my fault. It will not build on Mac OS X 10.3.9 without that option if
you are using the standard version of GCC shipped with the operating
system.

I'll get onto my new Tiger laptop and try it there (haven't yet), but can
you tell me which GCC you are using? I know the GCC version shipped on the
box with Tiger, but are you using that, or are you using one supplied with
Fink? Was worried that the change might not apply to the Fink version of GCC.

The missing bit of information here is that Python on Tiger (10.4) is correctly
putting in the config/Makefile used by distutils the required options. Ie.,

  LDSHARED=       $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup
  BLDSHARED=      $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup

The duplicated definition of the -undefined option causes grief when setup.py
adds it as well.

Thus, setup.py will thus need to check first whether the -undefined option
already exists. Thus, setup.py should use:

if sys.platform == "darwin":
        if not '-bundle' in sysconfig.get_config_var("LDSHARED").split():
            sysconfig._config_vars["LDSHARED"] = \
                    string.replace(sysconfig.get_config_var("LDSHARED"), \
                    " -bundle "," -bundle -flat_namespace -undefined suppress ")
            sysconfig._config_vars["BLDSHARED"] = \
                    string.replace(sysconfig.get_config_var("BLDSHARED"), \
                    " -bundle "," -bundle -flat_namespace -undefined suppress ")

In Tiger it actually uses '-undefined dynamic_lookup' instead of what I had
used which is '-undefined suppress'. If though you try and use '-undefined
dynamic_lookup' on Panther (10.3) or earlier you will run up against a
further problem in that '-undefined dynamic_lookup' conflicts with the
default compilation mode of being compatible with Mac OS X 10.1. Thus,
still probably best to use '-undefined suppress', but the check means that
it will only be used on older versions of Mac OS X anyway, or at least where
the Python config isn't correct.

I'll attach a patch to the JIRA report on the original problem shortly.

Graham

Reply via email to