still probs to compile python-ldap on macosx

Steven Graham sgraham at wugaa.com
Tue Nov 5 10:55:05 CET 2002


ld -R/filename does error out also, and after finding what was wrong it only
issued a warning as Jens said earlier.

For some reason gcc doesn't like the space in the filename when linking.
This might not be gcc, it could be the shell that gcc is calling to exec ld.
In any case I modified util.py in the distutils package to strip  out spaces
in the machine name ('Power Macintosh-2.2') when the osname is 'darwin'.

The patch is as follows:
--- util.py     Tue Nov  5 01:29:27 2002
+++ util.py.osx Tue Nov  5 01:26:22 2002
@@ -67,6 +67,8 @@
         m = rel_re.match(release)
         if m:
             release = m.group()
+    elif osname[:6] == "darwin":
+       machine = machine.replace(' ','')
 
     return "%s-%s-%s" % (osname, release, machine)
----end patch (don't include this in file)----

You can patch util.py (after making a backup) like so:

# cd /path/to/python/lib/distutils/
# cp util.py util.py.orig
# patch -u -p0 < patch_filename

Where patch_filename is the file you save the patch into.
If you don't want to use patch you can add the two line fix by hand :)

This will cause the output_dir variable to be set to
'build/temp.darwin-6.1-PowerMacintosh-2.2/'

I'm sure there is an easier way to set the build directory through options
in either setup.py or through the command line but I can't find any. This
fix seemed to work for me.

-Steve

Note: I have python2.2 installed on my system but it was showing the same
problems.

On 11/4/02 11:01 PM, "Peter Hawkins" <peter at hawkins.emu.id.au> wrote:

> Hi...
> 
> 
> On Tue, 5 Nov 2002 02:28 pm, Steven Graham wrote:
>> I disagree, under normal operation the command is failing and
>> exiting with a status of 1 (Under OS X)
>> 
>> 31% ld -R; echo $?
>> ld: unknown flag: -R
>> 1
> 
> -R takes an argument on other UNIXes. , and you'd expect ld to fail on
> that command line anyway since you haven't given it any input files.
> 
> On linux:
> peterh at warpcore:~$ ld -R; echo $?
> ld: unrecognized option '-R'
> ld: use the --help option for usage information
> 1
> peterh at warpcore:~$ ld -R/tmp; echo $?
> ld: no input files
> 1
> peterh at warpcore:~$
> 
> =)
> Peter

----
Steven Graham
sgraham at wugaa.com








More information about the python-ldap mailing list