lib/vars.pm Declare pseudo-imported global variables
lib/warning.pm For "use warning"
makeaperl.SH perl script that produces a new perl binary
+makedef.pl Create symbol export lists for linking
makedepend.SH Precursor to makedepend
makedir.SH Precursor to makedir
malloc.c A version of malloc you might not want
perl.h Global declarations
perlapi.c Perl API functions
perlapi.h Perl API function declarations
-perl_exp.SH Creates list of exported symbols for AIX
perlio.c C code for PerlIO abstraction
perlio.h compatibility stub
perlio.sym Symbols for PerlIO abstraction
win32/include/dirent.h Win32 port
win32/include/netdb.h Win32 port
win32/include/sys/socket.h Win32 port
-win32/makedef.pl Win32 exports definition file writer
win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds)
win32/perlglob.c Win32 port
win32/perllib.c Win32 port
aix*)
shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
case "$osvers" in
- 3*)
- shrpldflags="$shrpldflags -e _nostart $ldflags $libs $cryptlib"
+ 3*) shrpldflags="$shrpldflags -e _nostart"
;;
- *)
- shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib"
+ *) shrpldflags="$shrpldflags -b noentry"
;;
esac
- aixinstdir=`pwd | sed 's/\/UU$//'`
- linklibperl="-L $archlibexp/CORE -L $aixinstdir -lperl"
+ shrpldflags="$shrpldflags $ldflags $libs $cryptlib"
+ linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
ldlibpth="LIBPATH=`pwd`:${LIBPATH}"
;;
hpux*)
# Files to be built with variable substitution before miniperl
# is available.
sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
- makedir.SH myconfig.SH perl_exp.SH writemain.SH
+ makedir.SH myconfig.SH writemain.SH
shextract = Makefile cflags config.h makeaperl makedepend \
- makedir myconfig perl.exp writemain
+ makedir myconfig writemain
# Files to be built with variable substitution after miniperl is
# available. Dependencies handled manually below (for now).
;;
esac
+case "$osname" in
+aix)
+ $spitshell >>Makefile <<!GROK!THIS!
+LIBS = $libs
+
+!GROK!THIS!
+ case "$useshrplib" in
+ define|true|[yY]*)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+
+LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT)
+MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT)
+
+$(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj)
+ $(RMS) $(LIBPERL_NONSHR)
+ $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj)
+
+$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT)
+ $(CC) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
+
+MINIPERLEXP = $(MINIPERL_NONSHR)
+
+LIBPERLEXPORT = perl.exp
+
+!NO!SUBS!
+
+ ;;
+ *)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+MINIPERLEXP = miniperl$(EXE_EXT)
+
+PERLEXPORT = perl.exp
+
+!NO!SUBS!
+ ;;
+ esac
+ $spitshell >>Makefile <<'!NO!SUBS!'
+perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
+ ./$(MINIPERLEXP) makedef.pl PLATFORM=aix | sort -u | sort -f > perl.exp.tmp
+ sh mv-if-diff perl.exp.tmp perl.exp
+
+!NO!SUBS!
+ ;;
+esac
+
if test -r $Makefile_s ; then
. $Makefile_s
$spitshell >>Makefile <<!GROK!THIS!
!GROK!THIS!
else
$spitshell >>Makefile <<'!NO!SUBS!'
-$(LIBPERL): $& perl$(OBJ_EXT) $(obj)
+$(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT)
!NO!SUBS!
case "$useshrplib" in
true)
$(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs)
$(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
-perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
+perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
$(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
+pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
$(SHRPENV) $(LDLIBPTH) purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
+purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
$(SHRPENV) $(LDLIBPTH) purecov $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
+quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
$(SHRPENV) $(LDLIBPTH) quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
# This version, if specified in Configure, does ONLY those scripts which need
# checks as well as the special code to validate that the script in question
# has been invoked correctly.
-suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
+suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
$(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
!NO!SUBS!
-@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
$(LDLIBPTH) sh ext/util/make_ext realclean $$x MAKE=$(MAKE) ; \
done
- rm -f *.orig */*.orig *~ */*~ core core.perl.*.? core.miniperl.*.? perl.core miniperl.core t/core t/core.perl.*.? t/perl.core t/tmp???? t/c t/perl so_locations t/nonexistent1
+ rm -f *.orig */*.orig *~ */*~ core core.perl.*.? core.miniperl.*.? perl.core miniperl.core t/core t/core.perl.*.? t/perl.core t/tmp???? t/c t/perl so_locations t/nonexistent1 so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
rm -rf $(addedbyconf)
rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
rm -f $(private)
config.h: config_h.SH config.sh
$(SHELL) config_h.SH
-# This is an AIXism.
-perl.exp: perl_exp.SH config.sh $(SYM) $(SYMH)
- $(SHELL) perl_exp.SH
-
# When done, touch perlmain.c so that it doesn't get remade each time.
depend: makedepend
sh ./makedepend MAKE=$(MAKE)
# it executed.
my $libref = dl_load_file($file, $module->dl_load_flags) or
- croak("Can't load '$file' for module $module: ".dl_error()."\n");
+ croak("Can't load '$file' for module $module: ".dl_error());
push(@dl_librefs,$libref); # record loaded object
* We keep a list of all loaded modules to be able to call the fini
* handlers at atexit() time.
*/
-static ModulePtr modList; /* XXX threadead */
+static ModulePtr modList; /* XXX threaded */
/*
* The last error from one of the dl* routines is kept in static
* variables here. Each error is returned only once to the caller.
*/
-static char errbuf[BUFSIZ]; /* XXX threadead */
-static int errvalid; /* XXX threadead */
+static char errbuf[BUFSIZ]; /* XXX threaded */
+static int errvalid; /* XXX threaded */
static void caterr(char *);
static int readExports(ModulePtr);
if (buf == 0)
return 0;
- if (strerror_r(err, buf, sizeof(buf)) == 0)
+ if (strerror_r(err, buf, BUFSIZ) == 0)
msg = buf;
else
msg = strerror_r_failed;
if (buf == 0)
return 0;
- if (strerror_r(err, buf, sizeof(buf)) == 0)
+ if (strerror_r(err, buf, BUFSIZ) == 0)
msg = buf;
else
msg = strerror_r_failed;
{
dTHX;
register ModulePtr mp;
- static int inited; /* XXX threadead */
+ static int inited; /* XXX threaded */
/*
* Upon the first call register a terminate handler that will
safefree(mp);
return NULL;
}
+
/*
* load should be declared load(const char *...). Thus we
* cast the path to a normal char *. Ugly.
*/
- if ((mp->entry = (void *)load((char *)path, L_NOAUTODEFER, NULL)) == NULL) {
+ if ((mp->entry = (void *)load((char *)path,
+#ifdef L_LIBPATH_EXEC
+ L_LIBPATH_EXEC |
+#endif
+ L_NOAUTODEFER,
+ NULL)) == NULL) {
+ int saverrno = errno;
+
safefree(mp->name);
safefree(mp);
errvalid++;
* can be further described by querying the loader about
* the last error.
*/
- if (errno == ENOEXEC) {
- char *tmp[BUFSIZ/sizeof(char *)];
- if (loadquery(L_GETMESSAGES, tmp, sizeof(tmp)) == -1)
- strerrorcpy(errbuf, errno);
+ if (saverrno == ENOEXEC) {
+ char *moreinfo[BUFSIZ/sizeof(char *)];
+ if (loadquery(L_GETMESSAGES, moreinfo, sizeof(moreinfo)) == -1)
+ strerrorcpy(errbuf, saverrno);
else {
char **p;
- for (p = tmp; *p; p++)
+ for (p = moreinfo; *p; p++)
caterr(*p);
}
} else
- strerrorcat(errbuf, errno);
+ strerrorcat(errbuf, saverrno);
return NULL;
}
mp->refCnt = 1;
* of the perl core are in the same shared object.
*/
if (loadbind(0, (void *)dlopen, mp->entry) == -1) {
+ int saverrno = errno;
+
dlclose(mp);
errvalid++;
strcpy(errbuf, "loadbind: ");
- strerrorcat(errbuf, errno);
+ strerrorcat(errbuf, saverrno);
return NULL;
}
if (readExports(mp) == -1) {
esac
so="a"
-dlext="so"
+dlext="o"
# Trying to set this breaks the POSIX.c compilation
# (e.g. pragma/overload core dumps)
# --jhi@iki.fi
cc=cc_r
+ if test ! -e /bin/cc_r; then
+ cat >&4 <<EOM
+For pthreads you should use the AIX C compiler cc_r.
+But I cannot find it in /bin.
+Cannot continue, aborting.
+EOM
+ fi
;;
'')
cc=cc_r
*)
cat >&4 <<EOM
For pthreads you should use the AIX C compiler cc_r.
-(now your compiler was '$cc')
+(now your compiler was set to '$cc')
Cannot continue, aborting.
EOM
exit 1
-#!../miniperl
-
-# Create the export list for perl. Needed by WIN32 for creating perl.dll.
-
+#
+# Create the export list for perl.
+#
+# Needed by WIN32 for creating perl.dll and by AIX for creating libperl.a
+# when -Dusershrplib is in effect.
+#
# reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h
-my $CCTYPE = "MSVC"; # default
+my $PLATFORM;
+my $CCTYPE;
while (@ARGV)
{
my $flag = shift;
$define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
- $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
+ $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
+ $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/);
}
-open(CFG,'config.h') || die "Cannot open config.h:$!";
+my @PLATFORM = qw(aix win32);
+my %PLATFORM;
+@PLATFORM{@PLATFORM} = ();
+
+defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n";
+exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n";
+
+my $config_sh = "config.sh";
+my $config_h = "config.h";
+my $thrdvar_h = "thrdvar.h";
+my $intrpvar_h = "intrpvar.h";
+my $perlvars_h = "perlvars.h";
+my $global_sym = "global.sym";
+my $pp_sym = "pp.sym";
+my $globvar_sym = "globvar.sym";
+my $perlio_sym = "perlio.sym";
+
+if ($PLATFORM eq 'aix') {
+ # Nothing for now.
+} elsif ($PLATFORM eq 'win32') {
+ $CCTYPE = "MSVC" unless defined $CCTYPE;
+ foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, $pp_sym, $globvar_sym) {
+ s!^!..\\!;
+ }
+}
+
+unless ($PLATFORM eq 'win32') {
+ open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n";
+ while (<CFG>)
+ {
+ if (/^(?:ccflags|optimize)='(.+)'$/) {
+ $_ = $1;
+ $define{$1} = 1 while /-D(\w+)/g;
+ }
+ }
+ close(CFG);
+}
+
+open(CFG,$config_h) || die "Cannot open $config_h: $!\n";
while (<CFG>)
{
$define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
$define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/;
+ $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/;
$define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
}
close(CFG);
-warn join(' ',keys %define)."\n";
-
-if ($define{PERL_OBJECT}) {
- print "LIBRARY PerlCore\n";
- print "DESCRIPTION 'Perl interpreter'\n";
- print "EXPORTS\n";
+if ($PLATFORM eq 'win32') {
+ warn join(' ',keys %define)."\n";
+ if ($define{PERL_OBJECT}) {
+ print "LIBRARY PerlCore\n";
+ print "DESCRIPTION 'Perl interpreter'\n";
+ print "EXPORTS\n";
# output_symbol("perl_alloc");
- output_symbol("perl_get_host_info");
- output_symbol("perl_alloc_using");
+ output_symbol("perl_get_host_info");
+ output_symbol("perl_alloc_using");
# output_symbol("perl_construct");
# output_symbol("perl_destruct");
# output_symbol("perl_free");
# output_symbol("perl_run");
# output_symbol("RunPerl");
# exit(0);
-}
-else {
- if ($CCTYPE ne 'GCC') {
- print "LIBRARY Perl\n";
- print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
}
else {
- $define{'PERL_GLOBAL_STRUCT'} = 1;
- $define{'MULTIPLICITY'} = 1;
- }
- print "EXPORTS\n";
+ if ($CCTYPE ne 'GCC') {
+ print "LIBRARY Perl\n";
+ print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
+ }
+ else {
+ $define{'PERL_GLOBAL_STRUCT'} = 1;
+ $define{'MULTIPLICITY'} = 1;
+ }
+ print "EXPORTS\n";
+ }
+} elsif ($PLATFORM eq 'aix') {
+ print "#!\n";
}
my %skip;
}
}
+if ($PLATFORM eq 'win32') {
skip_symbols [qw(
PL_statusvalue_vms
PL_archpat_auto
PL_cshname
PL_opsave
)];
+} elsif ($PLATFORM eq 'aix') {
+ skip_symbols([qw(
+Perl_dump_fds
+Perl_ErrorNo
+Perl_GetVars
+Perl_my_bcopy
+Perl_my_bzero
+Perl_my_chsize
+Perl_my_htonl
+Perl_my_memcmp
+Perl_my_memset
+Perl_my_ntohl
+Perl_my_swap
+Perl_safexcalloc
+Perl_safexfree
+Perl_safexmalloc
+Perl_safexrealloc
+Perl_same_dirent
+Perl_unlnk
+PL_cryptseen
+PL_opsave
+PL_statusvalue_vms
+PL_sys_intern
+)]);
+}
if ($define{'PERL_OBJECT'}) {
skip_symbols [qw(
{
my $file = shift;
my $proc = shift || sub { "PL_$_[2]" };
- open(VARS,$file) || die "Cannot open $file:$!";
+ open(VARS,$file) || die "Cannot open $file: $!\n";
my @syms;
while (<VARS>)
{
if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
{
- my $thrd = readvar("../thrdvar.h");
+ my $thrd = readvar($thrdvar_h);
skip_symbols $thrd;
}
if ($define{'MULTIPLICITY'})
{
- my $interp = readvar("../intrpvar.h");
+ my $interp = readvar($intrpvar_h);
skip_symbols $interp;
}
if ($define{'PERL_GLOBAL_STRUCT'})
{
- my $global = readvar("../perlvars.h");
+ my $global = readvar($perlvars_h);
skip_symbols $global;
emit_symbols [qw(Perl_GetVars)];
emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
PL_watchok)];
}
-if ($define{'HAVE_DES_FCRYPT'})
+if ($PLATFORM eq 'win32' && $define{'HAVE_DES_FCRYPT'})
{
emit_symbols [qw(win32_crypt)];
}
# functions from *.sym files
-for my $syms ('../global.sym','../pp.sym', '../globvar.sym')
+my @syms = ($global_sym, $pp_sym, $globvar_sym);
+
+if ($define{'USE_PERLIO'})
{
- open (GLOBAL, "<$syms") || die "failed to open $syms" . $!;
+ push @syms, $perlio_sym;
+ }
+
+for my $syms (@syms)
+ {
+ open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n";
while (<GLOBAL>)
{
next if (!/^[A-Za-z]/);
# variables
if ($define{'PERL_OBJECT'}) {
- for my $f ("../perlvars.h", "../intrpvar.h", "../thrdvar.h") {
+ for my $f ($perlvars_h, $ntrpvar_h, $thrdvar_h) {
my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" });
emit_symbols $glob;
}
}
else {
unless ($define{'PERL_GLOBAL_STRUCT'}) {
- my $glob = readvar("../perlvars.h");
+ my $glob = readvar($perlvars_h);
emit_symbols $glob;
}
unless ($define{'MULTIPLICITY'}) {
- my $glob = readvar("../intrpvar.h");
+ my $glob = readvar($intrpvar_h);
emit_symbols $glob;
}
unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'}) {
- my $glob = readvar("../thrdvar.h");
+ my $glob = readvar($thrdvar_h);
emit_symbols $glob;
}
}
-while (<DATA>) {
- my $symbol;
- next if (!/^[A-Za-z]/);
- next if (/^#/);
- s/\r//g;
- chomp($_);
- $symbol = $_;
- next if exists $skip{$symbol};
- emit_symbol($symbol);
-}
-
-foreach my $symbol (sort keys %export)
- {
- output_symbol($symbol);
- }
+sub try_symbol {
+ my $symbol = shift;
-sub emit_symbol {
- my $symbol = shift;
- chomp($symbol);
- $export{$symbol} = 1;
+ return if $symbol !~ /^[A-Za-z]/;
+ return if $symbol =~ /^\#/;
+ $symbol =~s/\r//g;
+ chomp($symbol);
+ next if exists $skip{$symbol};
+ emit_symbol($symbol);
}
-sub output_symbol {
- my $symbol = shift;
- $symbol = "_$symbol" if $CCTYPE eq 'BORLAND';
- print "\t$symbol\n";
-# XXX: binary compatibility between compilers is an exercise
-# in frustration :-(
-# if ($CCTYPE eq "BORLAND") {
-# # workaround Borland quirk by exporting both the straight
-# # name and a name with leading underscore. Note the
-# # alias *must* come after the symbol itself, if both
-# # are to be exported. (Linker bug?)
-# print "\t_$symbol\n";
-# print "\t$symbol = _$symbol\n";
-# }
-# elsif ($CCTYPE eq 'GCC') {
-# # Symbols have leading _ whole process is $%@"% slow
-# # so skip aliases for now
-# print "\t$symbol\n";
-# }
-# else {
-# # for binary coexistence, export both the symbol and
-# # alias with leading underscore
-# print "\t$symbol\n";
-# print "\t_$symbol = $symbol\n";
-# }
+while (<DATA>) {
+ try_symbol($_);
}
-1;
-__DATA__
-# extra globals not included above.
-perl_alloc
-perl_construct
-perl_destruct
-perl_free
-perl_parse
-perl_run
+if ($PLATFORM eq 'win32') {
+ foreach my $symbol (qw(
boot_DynaLoader
+Perl_getTHR
+Perl_init_os_extras
+Perl_setTHR
Perl_thread_create
+Perl_win32_init
+RunPerl
win32_errno
win32_environ
win32_stdin
win32_closedir
win32_longpath
win32_os_id
-Perl_win32_init
-Perl_init_os_extras
-Perl_getTHR
-Perl_setTHR
-RunPerl
-GetPerlInterpreter
-SetPerlInterpreter
+ )) {
+ try_symbol($symbol);
+ }
+}
+# Now all symbols should be defined because
+# next we are going to output them.
+
+foreach my $symbol (sort keys %export)
+ {
+ output_symbol($symbol);
+ }
+
+sub emit_symbol {
+ my $symbol = shift;
+ chomp($symbol);
+ $export{$symbol} = 1;
+}
+
+sub output_symbol {
+ my $symbol = shift;
+ if ($PLATFORM eq 'win32') {
+ print "\t$symbol\n";
+ $symbol = "_$symbol" if $CCTYPE eq 'BORLAND';
+# XXX: binary compatibility between compilers is an exercise
+# in frustration :-(
+# if ($CCTYPE eq "BORLAND") {
+# # workaround Borland quirk by exporting both the straight
+# # name and a name with leading underscore. Note the
+# # alias *must* come after the symbol itself, if both
+# # are to be exported. (Linker bug?)
+# print "\t_$symbol\n";
+# print "\t$symbol = _$symbol\n";
+# }
+# elsif ($CCTYPE eq 'GCC') {
+# # Symbols have leading _ whole process is $%@"% slow
+# # so skip aliases for now
+# nprint "\t$symbol\n";
+# }
+# else {
+# # for binary coexistence, export both the symbol and
+# # alias with leading underscore
+# print "\t$symbol\n";
+# print "\t_$symbol = $symbol\n";
+# }
+ } elsif ($PLATFORM eq 'aix') {
+ print "$symbol\n";
+ }
+}
+
+1;
+__DATA__
+# extra globals not included above.
+perl_alloc
+perl_construct
+perl_destruct
+perl_free
+perl_parse
+perl_run
+++ /dev/null
-#!/bin/sh
-#
-# Written: Nov 1994 Wayne Scott <wscott@ichips.intel.com>
-#
-# Updated: 1997-8 Jarkko Hietaniemi <jhi@iki.fi>
-#
-# Create the export list for perl.
-# Needed by AIX to do dynamic linking.
-#
-# This simple program relies on global.sym and few other *.sym files
-# and the *var*.h files being up to date with all of the global
-# symbols that a dynamic link library might want to access.
-#
-# Most symbols have a Perl_ or PL_prefix because that's what embed.h
-# sticks in front of them.
-#
-# AIX requires the list of external symbols (variables or functions)
-# that are made available for another executable object file the import.
-# The list is called the export file and it is a simple text file.
-# The first line must be
-#!
-# That is, hash-bang, pound-shout, however you want to call it.
-# The remainder of the file are the names of the symbols, one per line.
-# The file is then given to the system loader (cc/xlc command line)
-# as -bE:export.file.
-
-case $CONFIGDOTSH in
-'')
- if test -f config.sh; then TOP=.;
- elif test -f ../config.sh; then TOP=..;
- elif test -f ../../config.sh; then TOP=../..;
- elif test -f ../../../config.sh; then TOP=../../..;
- elif test -f ../../../../config.sh; then TOP=../../../..;
- else
- echo "Can't find config.sh."; exit 1
- fi
- . $TOP/config.sh
- ;;
-esac
-: This forces SH files to create target in same directory as SH file.
-: This is so that make depend always knows where to find SH derivatives.
-case "$0" in
-*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
-esac
-
-echo "Extracting perl.exp"
-
-rm -f perl.exp
-echo "#!" > perl.exp
-
-# No compat3 since 5.004_50.
-# No interp.sym since 5.005_03.
-# perlio.sym will added later if needed.
-
-grep '^Perl_' global.sym >> perl.exp
-grep '^Perl_' pp.sym >> perl.exp
-sed -n '/^[A-Za-z]/ s/^/PL_/p' globvar.sym >> perl.exp
-
-sed -n 's/^PERLVAR.*(G\([^[,]*\).*/PL_\1/p' perlvars.h >> perl.exp
-sed -n 's/^PERLVAR.*(I\([^[,]*\).*/PL_\1/p' intrpvar.h >> perl.exp
-sed -n 's/^PERLVAR.*(T\([^[,]*\).*/PL_\1/p' thrdvar.h >> perl.exp
-
-#
-# If we use the PerlIO abstraction layer, add its symbols.
-#
-
-if [ "X$useperlio" = "Xdefine" ]
-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).
-#
-
-#cat >>perl.exp <<END
-#END
-
-case "$usemymalloc" in
-true|[yY]*) usemymalloc=define ;;
-esac
-
-# Remove mymalloc if needed.
-case "$usemymalloc$d_mymalloc" in
-definedefine) ;;
-*)
- egrep -v '^(Perl_(calloc|malloc|malloced_size|mfree|realloc|safexcalloc|safexfree|safexmalloc|safexrealloc)|^PL_malloc_mutex)$' < perl.exp > perl.exp$$
- mv -f perl.exp$$ perl.exp
- case "$ccflags" in
- *DEBUGGING*) ;;
- *)
- egrep -v '^(Perl_dump_mstats)$' < perl.exp > perl.exp$$
- mv -f perl.exp$$ perl.exp
- ;;
- esac
- ;;
-esac
-
-# Remove unneeded utility functions.
-egrep -v '^(Perl_my_(bcopy|bzero|chsize|htonl|memcmp|memset|ntohl|swap))$' < perl.exp > perl.exp$$
-mv -f perl.exp$$ perl.exp
-
-case "$usethreads" in
-true|[yY]*) usethreads=define ;;
-esac
-
-# Remove thread symbols if needed.
-case "$usethreads" in
-define) ;;
-*)
- egrep -v '^(Perl_(condpair_magic|find_threadsv|magic_mutexfree|new_struct_thread|unlock_condpair)|^PL_((eval|nthreads)_cond|curthr|eval_owner|(cred|eval|strtab|sv|svref|threads|malloc|vtbl)_mutex|nthreads|threadnum|threadsv_names|thr_key|thrsv))$' < perl.exp > perl.exp$$
- mv -f perl.exp$$ perl.exp
- ;;
-esac
-
-# Remove debugging symbols if needed.
-case "$ccflags" in
-*DEBUGGING*) ;;
-*)
- egrep -v '^(PL_(block_type|watchaddr|watchok))$' < perl.exp > perl.exp$$
- mv -f perl.exp$$ perl.exp
- ;;
-esac
-
-# Remove unneeded globals.
-egrep -v '^(Perl_(ErrorNo|GetVars|same_dirent|unlnk)|PL_(cryptseen|statusvalue_vms))' < perl.exp > perl.exp$$
-mv -f perl.exp$$ perl.exp
-
-# The shebang line nicely sorts as the first one.
-sort -o perl.exp -u perl.exp
-
-# eof
missing. You need to figure out where your CRTL misplaced its environ
or define F<PERL_ENV_TABLES> (see L<perlvms>) so that environ is not searched.
+=item Can't read CRTL environ
+
+(S) A warning peculiar to VMS. Perl tried to read an element of %ENV
+from the CRTL's internal environment array and discovered the array was
+missing. You need to figure out where your CRTL misplaced its environ
+or define F<PERL_ENV_TABLES> (see L<perlvms>) so that environ is not searched.
+
=item Can't "redo" outside a block
(F) A "redo" statement was executed to restart the current block, but
=item Character class syntax [%s] belongs inside character classes
(W) The character class constructs [: :], [= =], and [. .] go
-I<inside> character classes, the [] are part of the construct. For
-example: /[[:alpha:]]/
+I<inside> character classes, the [] are part of the construct,
+for example: /[012[:alpha:]345]/. Note that the last two constructs
+are not currently implemented, they are placeholders for future extensions.
-=item Character class syntax [ .] is reserved for future extensions
+=item Character class syntax [. .] is reserved for future extensions
(W) Within regular expression character classes ([]) the syntax beginning
with "[." and ending with ".]" is reserved for future extensions.
(W) You may have tried to use an 8 or 9 in a octal number. Interpretation
of the octal number stopped before the 8 or 9.
-=item Illegal hex digit %s ignored
+=item Illegal hexadecimal digit %s ignored
(W) You may have tried to use a character other than 0 - 9 or A - F in a
hexadecimal number. Interpretation of the hexadecimal number stopped
=item Integer overflow in %s number
-(S) The literal hex, octal or binary number you have specified is
-too big for your architecture. On a 32-bit architecture the largest
+(S) The literal hexadecimal, octal or binary number you have specified
+is too big for your architecture. On a 32-bit architecture the largest
literal hex, octal or binary number representable without overflow
is 0xFFFFFFFF, 037777777777, or 0b11111111111111111111111111111111
respectively. Note that Perl transparently promotes decimal literals
to translate to the number of seconds which need to be added to UTC to
get local time.
+=item no UTC offset information; assuming local time is UTC
+
+(S) A warning peculiar to VMS. Per was unable to find the local
+timezone offset, so it's assuming that local system time is equivalent
+to UTC. If it's not, define the logical name F<SYS$TIMEZONE_DIFFERENTIAL>
+to translate to the number of seconds which need to be added to UTC to
+get local time.
+
=item Not a CODE reference
(F) Perl was trying to evaluate a reference to a code value (that is, a
L<perlvms>) so that the environ array isn't the target of the change to
%ENV which produced the warning.
+=item This Perl can't reset CRTL eviron elements (%s)
+
+=item This Perl can't set CRTL environ elements (%s=%s)
+
+(W) Warnings peculiar to VMS. You tried to change or delete an element
+of the CRTL's internal environ array, but your copy of Perl wasn't
+built with a CRTL that contained the setenv() function. You'll need to
+rebuild Perl with a CRTL that does, or redefine F<PERL_ENV_TABLES> (see
+L<perlvms>) so that the environ array isn't the target of the change to
+%ENV which produced the warning.
+
=item times not implemented
(F) Your version of the C library apparently doesn't do times(). I suspect
}
restart:
+ if (end_shift < 0)
+ end_shift = 0; /* can happen when strend == strpos */
if (flags & REXEC_SCREAM) {
SV *c = prog->check_substr;
char *strbeg = SvPVX(sv); /* XXXX Assume PV_force() on SCREAM! */
no warning 'unsafe' ;
*a = hex "0xv9" ;
EXPECT
-Illegal hex digit 'v' ignored at - line 3.
+Illegal hexadecimal digit 'v' ignored at - line 3.
########
# util.c
use warning 'unsafe' ;
Illegal binary digit '9' ignored at - line 3.
########
# util.c
+BEGIN { require Config ; import Config }
$^W =1 ;
+sub make_bin { "1" x $_[0] }
+my $s = $Config{longsize};
+eval { pack "q", 0 }; eval { $s = length pack "q", 0 } unless $@;
+$n = make_bin(8 * $s ) ;
+$o = make_bin(8 * $s + 1) ;
{
use warning 'unsafe' ;
- my $a = oct "0b111111111111111111111111111111111" ;
+ my $a = oct "0b$n" ;
+ my $b = oct "0b$o" ;
no warning 'unsafe' ;
- $a = oct "0b111111111111111111111111111111111" ;
+ $b = oct "0b$o" ;
}
-my $a = oct "0b111111111111111111111111111111111" ;
+my $b = oct "0b$o" ;
EXPECT
-Integer overflow in binary number at - line 5.
-Integer overflow in binary number at - line 9.
+Integer overflow in binary number at - line 12.
+Integer overflow in binary number at - line 16.
########
# util.c
+BEGIN { require Config ; import Config }
$^W =1 ;
+sub make_oct { ("","1","3")[$_[0]%3] . "7" x int($_[0]/3) }
+my $s = $Config{longsize};
+eval { pack "q", 0 }; eval { $s = length pack "q", 0 } unless $@;
+$n = make_oct(8 * $s );
+$o = make_oct(8 * $s + 1);
{
use warning 'unsafe' ;
- my $a = oct "777777777777777777777777777777777777" ;
+ my $a = oct "$n" ;
+ my $b = oct "$o" ;
no warning 'unsafe' ;
- $a = oct "777777777777777777777777777777777777" ;
+ $b = oct "$o" ;
}
-my $a = oct "777777777777777777777777777777777777" ;
+my $b = oct "$o" ;
EXPECT
-Integer overflow in octal number at - line 5.
-Integer overflow in octal number at - line 9.
+Integer overflow in octal number at - line 12.
+Integer overflow in octal number at - line 16.
########
# util.c
+BEGIN { require Config ; import Config }
$^W =1 ;
+sub make_hex { ("","1","3","7")[$_[0]%4] . "f" x int($_[0]/4) }
+my $s = $Config{longsize};
+eval { pack "q", 0 }; eval { $s = length pack "q", 0 } unless $@;
+$n = make_hex(8 * $s ) ;
+$o = make_hex(8 * $s + 1) ;
{
use warning 'unsafe' ;
- my $a = hex "ffffffffffffffffffffffffffffffff" ;
+ my $a = hex "$n" ;
+ my $b = hex "$o" ;
no warning 'unsafe' ;
- $a = hex "ffffffffffffffffffffffffffffffff" ;
+ $b = hex "$o" ;
}
-my $a = hex "ffffffffffffffffffffffffffffffff" ;
+my $b = hex "$o" ;
EXPECT
-Integer overflow in hex number at - line 5.
-Integer overflow in hex number at - line 9.
+Integer overflow in hexadecimal number at - line 12.
+Integer overflow in hexadecimal number at - line 16.
dTHR;
--s;
if (ckWARN(WARN_UNSAFE))
- Perl_warner(aTHX_ WARN_UNSAFE,"Illegal hex digit '%c' ignored", *s);
+ Perl_warner(aTHX_ WARN_UNSAFE,"Illegal hexadecimal digit '%c' ignored", *s);
break;
}
}
if (!overflowed && (n >> 4) != retval) {
dTHR;
if (ckWARN_d(WARN_UNSAFE))
- Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in hex number");
+ Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in hexadecimal number");
overflowed = TRUE;
}
retval = n | ((tmp - PL_hexdigit) & 15);
$(PERL95_OBJ) : $(CORE_H)
$(X2P_OBJ) : $(CORE_H)
-perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym makedef.pl
- $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
+ $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
CCTYPE=$(CCTYPE) > perldll.def
$(PERLDLL): perldll.def $(PERLDLL_OBJ)
$(PERL95_OBJ) : $(CORE_H)
$(X2P_OBJ) : $(CORE_H)
-perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym makedef.pl
- $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
+ $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
CCTYPE=$(CCTYPE) > perldll.def
$(PERLDLL): perldll.def $(PERLDLL_OBJ)