[Distutils] building extensions with AIX

Greg Ward gward@python.net
Fri, 23 Jun 2000 22:32:57 -0400


On 23 June 2000, Rene Liebscher said:
> I have seen in the TODO file
> that there was an entry about AIX.

Yeah, what the TODO entry fails to mention is that I already tried to
fix this, in sysconfig.py:

    # "Fix" all pathnames in the Makefile that are explicitly relative,
    # ie. that start with "./".  This is a kludge to fix the "./ld_so_aix"
    # problem, the nature of which is that Python's installed Makefile
    # refers to "./ld_so_aix", but when we are building extensions we are
    # far from the directory where Python's Makefile (and ld_so_aix, for
    # that matter) is installed.  Unfortunately, there are several other
    # relative pathnames in the Makefile, and this fix doesn't fix them,
    # because the layout of Python's source tree -- which is what the
    # Makefile refers to -- is not fully preserved in the Python
    # installation.  Grumble.
    from os.path import normpath, join, dirname
    for (name, value) in done.items():
        if value[0:2] == "./":
            done[name] = normpath(join(dirname(fp.name), value))

> I tried it and found some little
> problems. It seems some paths in the
> Makefile are wrong.

The above fix *ought* to fix the relative pathname problem, but ISTR
that it didn't work.  Don't remember the details.

> After playing a little bit around
> with it, I wrote a new compiler 
> class. (I think, these changes could
> be included in unixccompiler, but
> to test it, it is nice to have a 
> own file for it.)

Man, why does everyone want to write CCompiler classes all of a sudden!
;-)

I'm not sure if this should be fixed early, in sysconfig, or late, in a
platform-specific UnixCCompiler subclass.  Note that there's a similar
problem with extension-building on OSF/1, and however we fix the AIX
problem should be how we fix the OSF/1 problem.

Rene, if you cook up new version of this patch, you might just solve
this problem for me.  Try this:

  * ditch the code in sysconfig that tries to fix "./" paths
  * fix your code so it fits in less than 80 columns, uses os.path.join
    instead of "+", and puts spaces around the "=" in assignments
    (but *not* default or keyword arguments)
  * extend the default compiler table, as you suggested, to respect
    sys.platform

Also, do you have access to AIX to test this on?  If not, we should bug
Vladimir Marangazov (Mr. Python-on-AIX).  He almost volunteered recently
on python-dev to test Distutils on AIX, but I didn't get a firm
commitment out of him.  ;-)

        Greg
-- 
Greg Ward - nerd                                        gward@python.net
http://starship.python.net/~gward/
I just read that 50% of the population has a below median IQ!