From: Eric Bartley Date: Sun, 27 Apr 1997 01:31:37 +0000 (-0500) Subject: Support shared libperl on AIX X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=019c9bb5516c92cceeeb4b050fa8075a1359c43c;p=p5sagit%2Fp5-mst-13.2.git Support shared libperl on AIX 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 --- diff --git a/Configure b/Configure index 0dbe17c..3644491 100755 --- a/Configure +++ b/Configure @@ -4726,6 +4726,9 @@ xxx='' tmp_shrpenv='' if "$useshrplib"; then case "$osname" in + aix) + # We'll set it in Makefile.SH... + ;; solaris|netbsd) xxx="-R $shrpdir" ;; diff --git a/Makefile.SH b/Makefile.SH index db4e759..16b523d 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -24,6 +24,7 @@ case "$d_dosuid" in esac linklibperl='$(LIBPERL)' +shrpldflags='$(LDDLFLAGS)' case "$useshrplib" in true) pldlflags="$cccdlflags" @@ -37,6 +38,11 @@ true) 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='' @@ -98,6 +104,7 @@ man3ext = $man3ext # The following are used to build and install shared libraries for # dynamic loading. LDDLFLAGS = $lddlflags +SHRPLDFLAGS = $shrpldflags CCDLFLAGS = $ccdlflags DLSUFFIX = .$dlext PLDLFLAGS = $pldlflags @@ -248,8 +255,18 @@ $(LIBPERL): $& perl$(OBJ_EXT) $(obj) 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!' diff --git a/hints/aix.sh b/hints/aix.sh index 6a9e545..2c42151 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -17,6 +17,9 @@ alignbytes=8 usemymalloc='n' +so="a" +dlext="so" + # Make setsockopt work correctly. See man page. # ccflags='-D_BSD=44'