misc. Python build/configure topics ( but especially AIX dynamic loading )

Steven D. Majewski (sdm7g@elvis.med.virginia.edu)
Thu, 17 Feb 1994 15:01:15 -0500

I managed to build the dbm module using AIX's libdbm, rather than
ndbm, and it appears to work ok. ( very minimal test: I made a
dbm object, filled it with 3 or 4 key,value pairs, quit and restarted
python, and was able to reload and read the dbm object. )

I had *extreme* lack of success in getting either gnu-dld or Jack
Jansen's SGI dl package ported to AIX. Initially, it didn't look
as if it was going to be so hard - the both use an extended COFF
format. But THEN I noticed that whole sections of the AIX include
files were blocked off with "#ifdef 0" - which is, I assume, an
idiom for "if NEVER" ! Bummer! :-(

I tried for a while to do something from scratch, but the documentation
on the AIX library calls to implement it are woefully slim - with no
examples of how to use the calls, I just experimented and read .h files a lot.

Luckily, I managed to get a copy of an AIX emulation of Sun's
dlopen routines ( written by Jens-Uwe Mager, Helios Software GmbH ).

I was able to get a version of python with dlopen support built.
It built without error, but I haven't yet tested it. I'm reading
the section in the extensions manual about shared libraries, and trying
to figure out how to do it: AIX requires an explicit export list of
functions. At first I thought that this would require me to list all
of the external methods, but on second look, my guess is that I only
need to export the initialization method - which should handle the
method dispatch & attribute tables itself. Any thoughts on this ?
( Maybe it'll make more sense when I finish reading it! :-> )

And: if that *IS* the case, then we can possibly dispense with the
dlopen emulation library, and just use AIX's "load" function with
the entry point set to the init routine when building the shared
library. I'll have to make mods to import ( anything else ? ) and
change the configue options for AIX. ( It would certainly be
preferable to not have to require yet another package to be built
before building python! )

Which leads me to the other problem (question) - configure:

I suppose, since libdl was in /usr/local/lib, rather than /usr/lib,
that configure didn't know itself to add the shared library support.
I *DID* manage to find the right combination of editing and command
line symbol assignment to configure to manage to get it built, but
those assignments override the defaults, they don't append to them -
so I had to configure one to find out the defaults, and manually
append them on a second configure.

I also ftp-ed the autoconfig package, so I could print out and read
the docs on THAT package, but if anyone more adept at configure has
any tips on how to EASILY get it to do the "right thing", it would
likely be shorted than my current instructions would be ( assuming
I can actually reproduce it! :-o )

-- Trying-to-use-up-my-entire-weeks-quota-of-smileys-in-one-message,
-- Steve M.