;;
aix*)
shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
- shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib"
+ case "$osvers" in
+ 3*)
+ shrpldflags="$shrpldflags -e _nostart $ldflags $libs $cryptlib"
+ ;;
+ *)
+ shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib"
+ ;;
+ esac
aixinstdir=`pwd | sed 's/\/UU$//'`
linklibperl="-L $archlibexp/CORE -L $aixinstdir -lperl"
;;
#include <a.out.h>
#include <ldfcn.h>
+/* If using PerlIO, redefine these macros from <ldfcn.h> */
+#ifdef USE_PERLIO
+#define FSEEK(ldptr,o,p) PerlIO_seek(IOPTR(ldptr),(p==BEGINNING)?(OFFSET(ldptr)+o):o,p)
+#define FREAD(p,s,n,ldptr) PerlIO_read(IOPTR(ldptr),p,s*n)
+#endif
+
/*
* We simulate dlopen() et al. through a call to load. Because AIX has
* no call to find an exported symbol we read the loader section of the
;
return -1;
}
+/* This first case is a hack, since it assumes that the 3rd parameter to
+ FREAD is 1. See the redefinition of FREAD above to see how this works. */
+#ifdef USE_PERLIO
+ if (FREAD(ldbuf, sh.s_size, 1, ldp) != sh.s_size) {
+#else
if (FREAD(ldbuf, sh.s_size, 1, ldp) != 1) {
+#endif
errvalid++;
strcpy(errbuf, "readExports: cannot read loader section");
safefree(ldbuf);
;;
esac
+#
+# If we use the PerlIO abstraction layer, add its symbols
+#
+
+if [ $useperlio = "define" ]
+then
+ grep '^[A-Za-z]' perlio.sym >> perl.exp
+fi
+
#
# Extra globals not included above (including a few that might
# not actually be defined, but there's no harm in that).