The problem with libtool an AIX is that shared libraries on AIX are a
bit strange. I searched the web for two days and now I know how to compile
pygtk:
/bin/ld -bM:SRE -o .libs/lib_gtkmodule.so.0.0.0 gtkmodule.o gtkobject-support.o
gtk-types.o gtk.o -L/usr/local/lib -lgtk -lgdk -lgmodule -lgthread -lglib
-lpthread -lXext -lX11 -lm -lc -bexpall -e init_gtk -brtl
-bI:/usr/local/lib/python1.5/config/python.exp
The important parts are:
-e init_gtk
-brtl
-bI:/usr/local/lib/python1.5/config/python.exp
-e tells the linker that "init_gtk" is the entry symbol. That is what
is passed back to python when the module is loaded. If -e is missing,
then the symbol passed back to python will contain garbage and python
will crash.
-brtl means to use the dynamic loader to load this module. There is also
a bug in the dynamic loader (fixed with the patch APARTXT IX89428)
which prevents shared libraries from working. You need both (the patch
*and* -brtl) to make it work. To check if you have the correct patch
installed, run "lslpp -l bos.rte.bind_cmds". If the version is below
4.3.2.4, then you need the patch.
*IMPORTANT*: You must supply -brtl to all shared modules *and* to all
programs which use these shared modules, ie. you must link python itself
with it and you must link all modules for python with it. In our
case, that are the shared libraries in glib, gtk and the pygtk modules.
-bI:xxx tells the linker which symbols will be present when the module
is loaded (ie. it should not produce errors if these are missing when
the module is linked). libtool uses -berok instead. This means that
any missing symbol will not generate a warning or error and your
program will crash *without any useful hint what is going on* when you
run it.
The same applies to ExtensionClass.
I've attached a patch which fixes pygtk-0.7.0. Unfortunately, since
one must pass the init function to the linker, this breaks the build
for all other systems. Therefore, I would suggest to add this verbatim
to the source tree. AIX users can then apply it as needed *or* you
could add a test at the beginning of the configure script and apply
the patch when you detect AIX. Please note that I have only AIX 4.3.2
and therefore, I cannot say if this works with any other AIX version.
--
==============================================
Sowatec AG, CH-8330 Pf�ffikon (ZH)
Witzbergstr. 7, http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, [EMAIL PROTECTED]
==============================================
-------------------------------------------------
This mail sent through IMP: www.hepe.com
README.AIX.gz