The current distribution will not build a shared libperl on AIX.
Currently the Makefile generated uses the same ld options for building
a shared libperl and dynamicly loaded extentions. AIX's compiler
requires that you tell it explicitly what symbols to export/import. So,
it needs a separate set of LD options for each.
On top of all this, AIX doesn't seem to have an equivilent to
LD_LIBRARY_PATH. So, the directories to search during runtime must be
explicitly compiled in. In the following patch I compiled in both the
compilation directory (for miniperl and testing) and the installation
directory. I wish someone could suggest something cleaner, but it works.
p5p-msgid:
199704270131.UAA51426@icd.cc.purdue.edu
tmp_shrpenv=''
if "$useshrplib"; then
case "$osname" in
+ aix)
+ # We'll set it in Makefile.SH...
+ ;;
solaris|netbsd)
xxx="-R $shrpdir"
;;
esac
linklibperl='$(LIBPERL)'
+shrpldflags='$(LDDLFLAGS)'
case "$useshrplib" in
true)
pldlflags="$cccdlflags"
sunos*|freebsd[23]*|netbsd*)
linklibperl="-lperl"
;;
+ aix*)
+ shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp -b noentry -lc -lm -lbsd"
+ aixinstdir=`pwd | sed 's/\/UU$//'`
+ linklibperl="-L $archlibexp/CORE -L $aixinstdir -lperl"
+ ;;
esac
;;
*) pldlflags=''
# The following are used to build and install shared libraries for
# dynamic loading.
LDDLFLAGS = $lddlflags
+SHRPLDFLAGS = $shrpldflags
CCDLFLAGS = $ccdlflags
DLSUFFIX = .$dlext
PLDLFLAGS = $pldlflags
case "$useshrplib" in
true)
$spitshell >>Makefile <<'!NO!SUBS!'
- $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj)
+ $(LD) $(SHRPLDFLAGS) -o $@ perl$(OBJ_EXT) $(obj)
+!NO!SUBS!
+ case "$osname" in
+ aix)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+ mv $@ libperl$(OBJ_EXT)
+ $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
!NO!SUBS!
+ ;;
+ *)
+ ;;
+ esac
;;
*)
$spitshell >>Makefile <<'!NO!SUBS!'
usemymalloc='n'
+so="a"
+dlext="so"
+
# Make setsockopt work correctly. See man page.
# ccflags='-D_BSD=44'