diff --git a/plan9/aperl b/plan9/aperl index 4d032e3c3d..b260973989 100644 --- a/plan9/aperl +++ b/plan9/aperl @@ -3,5 +3,6 @@ # aperl: # Executes perl command and alters stderr to produce Acme-friendly error messages # Created 02-JUL-1996, Luther Huffman, lutherh@stratcom.com +# Modified May 2020, David Romano, unobe@cpan.org -/bin/perl $* |[2] /bin/perl -pe 's/ line (\d+)/:$1/' >[1=2] +/bin/perl-_P9P_VERSION $* |[2] /bin/perl-_P9P_VERSION -pe 's/ line (\d+)/:$1/' >[1=2] diff --git a/plan9/config.plan9 b/plan9/config.plan9 index 17f0584a2e..c4412d80c1 100644 --- a/plan9/config.plan9 +++ b/plan9/config.plan9 @@ -4,7 +4,7 @@ * configuration scripts were written in a shell dialect incomprehensible * to Plan 9. * config.h for Plan 9 - * Version: 5.8.0 + * Version: 5.8.9 */ /* Configuration time: 21-Oct-1996 15:11 @@ -18,6 +18,10 @@ * */ +/* + * Updated by David Romano 2020-05 without much blood or sweat...but plenty of tears. + */ + #ifndef _config_h_ #define _config_h_ @@ -52,17 +56,6 @@ # endif #endif -/* BIN: - * This symbol holds the path of the bin directory where the package will - * be installed. Program must be prepared to deal with ~name substitution. - */ -/* BIN_EXP: - * This symbol is the filename expanded version of the BIN symbol, for - * programs that do not want to deal with that at run-time. - */ -#define BIN "/_P9P_OBJTYPE/bin" /* */ -#define BIN_EXP "/_P9P_OBJTYPE/bin" /* */ - /* LOC_SED: * This symbol holds the complete pathname to the sed program. */ @@ -1069,8 +1062,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "/usr/bin" /**/ -#define BIN_EXP "/usr/bin" /**/ +#define BIN "/_P9P_OBJTYPE/bin" /* */ +#define BIN_EXP "/_P9P_OBJTYPE/bin" /* */ /* BYTEORDER: * This symbol holds the hexadecimal constant defined in byteorder, @@ -1115,30 +1108,6 @@ #define BYTEORDER 0x1234 /* large digits for MSB */ #endif /* NeXT */ -/* CAT2: - * This macro catenates 2 tokens together. - */ -/* STRINGIFY: - * This macro surrounds its token with double quotes. - */ -#if 42 == 1 -#define CAT2(a,b) a/**/b -#define STRINGIFY(a) "a" - /* If you can get stringification with catify, tell me how! */ -#endif -#if 42 == 42 -#define PeRl_CaTiFy(a, b) a ## b -#define PeRl_StGiFy(a) #a -/* the additional level of indirection enables these macros to be - * used as arguments to other macros. See K&R 2nd ed., page 231. */ -#define CAT2(a,b) PeRl_CaTiFy(a,b) -#define StGiFy(a) PeRl_StGiFy(a) -#define STRINGIFY(a) PeRl_StGiFy(a) -#endif -#if 42 != 1 && 42 != 42 -# include "Bletch: How does this C preprocessor concatenate tokens?" -#endif - /* CPPSTDIN: * This symbol contains the first part of the string which will invoke * the C preprocessor on the standard input and produce to standard @@ -3303,7 +3272,7 @@ #define U64SIZE 8 /**/ #endif #define NVSIZE 8 /**/ -/*#define NV_PRESERVES_UV +#define NV_PRESERVES_UV #define NV_PRESERVES_UV_BITS 31 /* IVdf: @@ -3364,8 +3333,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "/sys/lib/perl/5.10.1" /**/ -#define PRIVLIB_EXP "/sys/lib/perl/5.10.1" /**/ +#define PRIVLIB "/sys/lib/perl/_P9P_VERSION" /**/ +#define PRIVLIB_EXP "/sys/lib/perl/_P9P_VERSION" /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -3492,9 +3461,9 @@ * removed. The elements in inc_version_list (inc_version_list.U) can * be tacked onto this variable to generate a list of directories to search. */ -#define SITELIB "/sys/lib/perl/5.10.1/site_perl" /**/ -#define SITELIB_EXP "/sys/lib/perl/5.10.1/site_perl" /**/ -#define SITELIB_STEM "/sys/lib/perl/5.10.1/site_perl" /**/ +#define SITELIB "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ +#define SITELIB_EXP "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ +#define SITELIB_STEM "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. @@ -3530,7 +3499,7 @@ * script to make sure (one hopes) that it runs with perl and not * some shell. */ -#define STARTPERL "#!/bin/perl" /**/ +#define STARTPERL "#!/bin/perl-_P9P_VERSION" /**/ /* STDCHAR: * This symbol is defined to be the type of char used in stdio.h. diff --git a/plan9/exclude b/plan9/exclude index 7d9fc3c8af..1a6a8b5286 100644 --- a/plan9/exclude +++ b/plan9/exclude @@ -16,3 +16,4 @@ op/misc.t op/oct.t op/split.t op/stat.t +.git diff --git a/plan9/fndvers b/plan9/fndvers old mode 100644 new mode 100755 index a848de2b6d..b05a98f65d --- a/plan9/fndvers +++ b/plan9/fndvers @@ -12,3 +12,8 @@ ed plan9/genconfig.pl< uudmap.h + IO.c: miniperl ext/IO/IO.xs ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/IO/IO.xs > $target cp ext/IO/*.pm $privlib - if (test !-d $privlib/IO) { + if (test ! -d $privlib/IO) { mkdir $privlib/IO cp ext/IO/lib/IO/*.pm $privlib/IO } @@ -126,7 +135,8 @@ plan9.$O: config.h ./plan9/plan9.c $CCCMD $stem.c $archlib/Config.pm: miniperl config.sh - ./miniperl configpm $archlib/Config.pm + ./miniperl configpm + cp lib/Config.pm $archlib/Config.pm config.sh: miniperl config.h ./miniperl ./plan9/genconfig.pl @@ -143,7 +153,7 @@ man:V: $perlpods pod/pod2man.PL perl for (i in $histpodnames) pod/pod2man pod/$i.pod > $installman3dir/$i nuke clean:V: - rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c + rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c uudmap.h rm -rf $privlib/IO deleteman:V: diff --git a/plan9/plan9.c b/plan9/plan9.c index ebdac27dcb..51c9dd5655 100644 --- a/plan9/plan9.c +++ b/plan9/plan9.c @@ -1,20 +1,7 @@ #include "EXTERN.h" #include "perl.h" -/* Functions mentioned in but not implemented */ - -int getsockopt(int a, int b, int c, void *d, int *e) -{ - croak("Function \"getsockopt\" not implemented in this version of perl."); - return (int)NULL; -} - -int setsockopt(int a, int b, int c, void *d, int *e) -{ - croak("Function \"setsockopt\" not implemented in this version of perl."); - return (int)NULL; -} - +/* Functions mentioned in but not implemented */ int recvmsg(int a, struct msghdr *b, int c) { @@ -112,23 +99,3 @@ void endservent() { croak("Function \"endservent\" not implemented in this version of perl."); } - -int tcdrain(int) -{ -croak("Function \"tcdrain\" not implemented in this version of perl."); -} - -int tcflow(int, int) -{ -croak("Function \"tcflow\" not implemented in this version of perl."); -} - -int tcflush(int, int) -{ -croak("Function \"tcflush\" not implemented in this version of perl."); -} - -int tcsendbreak(int, int) -{ -croak("Function \"tcsendbreak\" not implemented in this version of perl."); -} diff --git a/plan9/setup.rc b/plan9/setup.rc index dd96c1f9c7..17650401d0 100644 --- a/plan9/setup.rc +++ b/plan9/setup.rc @@ -5,21 +5,25 @@ # permissions. # Last modified 6/30/96 by: # Luther Huffman, Strategic Computer Solutions, Inc., lutherh@stratcom.com +# Last modified May 2020 by: +# David Romano, unobe@cpan.org awk -f versnum ../patchlevel.h . buildinfo builddir = `{ cd .. ; pwd } if (~ $#* 0) platforms = $objtype if not switch($1) { - case -a ; platforms = (386 mips sparc 68020) + case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) case * ; echo 'Usage: setup.rc [-a]' >[1=2] ; exit } -sourcedir=/sys/src/cmd/perl/$p9pvers -privlib=/sys/lib/perl +sourceroot=/sys/src/cmd/perl +sourcedir=$sourceroot/$p9pvers +privroot=/sys/lib/perl +privlib=$privroot/$p9pvers sitelib=$privlib/site_perl #Build source directory -if (test ! -d /sys/src/cmd/perl) mkdir /sys/src/cmd/perl +if (test ! -d $sourceroot) mkdir $sourceroot if (test ! -d $sourcedir) mkdir $sourcedir #Populate source directory @@ -30,15 +34,17 @@ cd $sourcedir/lib ; rm -rf * #Build library directories echo Building library directories ... +if (test ! -d $privroot) mkdir $privroot if (test ! -d $privlib) mkdir $privlib if (test ! -d $privlib/auto) mkdir $privlib/auto if (test ! -d $sitelib) mkdir $sitelib for(i in $platforms){ - archlib=/$i/lib/perl/$p9pvers + archroot=/$i/lib/perl + archlib=$archroot/$p9pvers sitearch=$archlib/site_perl corelib=$archlib/CORE arpalib=$corelib/arpa - if (test ! -d /$i/lib/perl) mkdir /$i/lib/perl + if (test ! -d $archroot) mkdir $archroot if (test ! -d $archlib) mkdir $archlib if (test ! -d $sitearch) mkdir $sitearch if (test ! -d $corelib) mkdir $corelib diff --git a/plan9/uninstall.rc b/plan9/uninstall.rc new file mode 100755 index 0000000000..372c4b4d43 --- /dev/null +++ b/plan9/uninstall.rc @@ -0,0 +1,25 @@ +#!/bin/rc + +. buildinfo +if (~ $#* 0) platforms = $objtype +if not switch($1) { + case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) + case * ; echo 'Usage: uninstall.rc [-a]' >[1=2] ; exit +} +sourceroot=/sys/src/cmd/perl +sourcedir=$sourceroot/$p9pvers +privroot=/sys/lib/perl +privlib=$privroot/$p9pvers +sitelib=$privlib/site_perl + +echo Uninstalling perl/$p9pvers +cd $sourceroot + +for(i in $platforms){ + archroot=/$i/lib/perl + archlib=$archroot/$p9pvers + if (test -d $archlib) rm -r $archlib + rm /$i/bin/perl-$p9pvers +} +if (test -d $privlib) rm -r $privlib +if (test -d $sourcedir) rm -r $sourcedir diff --git a/plan9/versnum b/plan9/versnum index 6e579f3048..55f80d067e 100644 --- a/plan9/versnum +++ b/plan9/versnum @@ -1,8 +1,9 @@ -/PERL_VERSION/ {base = $3} -/PERL_SUBVERSION/ {subvers = $3} +/define PERL_REVISION/ {revision = $3} +/define PERL_VERSION/ {version = $3} +/define PERL_SUBVERSION/ {subvers = $3} END { if (subvers == 0) - printf "p9pvers = 5.%03d\n", base> "buildinfo"; + printf "p9pvers = %d.%d\n", revision, version> "buildinfo"; else - printf "p9pvers = 5.%03d_%02d\n" , base, subvers> "buildinfo"; + printf "p9pvers = %d.%d.%d\n" , revision, version, subvers> "buildinfo"; } diff --git a/sv.c b/sv.c index d2fcb0c58b..f5bd33b032 100644 --- a/sv.c +++ b/sv.c @@ -71,7 +71,7 @@ many types, a pointer to the body (struct xrv, xpv, xpviv...), which contains fields specific to each type. Some types store all they need in the head, so don't have a body. -In all but the most memory-paranoid configuations (ex: PURIFY), heads +In all but the most memory-paranoid configurations (ex: PURIFY), heads and bodies are allocated out of arenas, which by default are approximately 4K chunks of memory parcelled up into N heads or bodies. Sv-bodies are allocated by their sv-type, guaranteeing size @@ -866,10 +866,13 @@ struct body_details { U8 body_size; /* Size to allocate */ U8 copy; /* Size of structure to copy (may be shorter) */ U8 offset; - unsigned int type : 4; /* We have space for a sanity check. */ - unsigned int cant_upgrade : 1; /* Cannot upgrade this type */ - unsigned int zero_nv : 1; /* zero the NV when upgrading from this */ - unsigned int arena : 1; /* Allocated from an arena */ + + /** 9front, May 2020: These were changed from bitfield definitions (:4, :1, :1, :1, respectively), due to compilation failure later on when creating an array of these structs. I think the types are alright, but maybe have to revisit. **/ + U32 type; /* We have space for a sanity check. */ + U8 cant_upgrade; /* Cannot upgrade this type */ + U8 zero_nv; /* zero the NV when upgrading from this */ + U8 arena; /* Allocated from an arena */ + size_t arena_size; /* Size of arena to allocate */ }; @@ -2847,8 +2850,8 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) PL_reginterp_cnt += haseval; return str; } else { - const char *const typestr = sv_reftype(referent, 0); - const STRLEN typelen = strlen(typestr); + const char *const typestring = sv_reftype(referent, 0); + const STRLEN typelen = strlen(typestring); UV addr = PTR2UV(referent); const char *stashname = NULL; STRLEN stashnamelen = 0; /* hush, gcc */ @@ -2891,7 +2894,7 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) *--retval = '('; retval -= typelen; - memcpy(retval, typestr, typelen); + memcpy(retval, typestring, typelen); if (stashname) { *--retval = '='; diff --git a/utf8.c b/utf8.c index b5a380962a..080ae85977 100644 --- a/utf8.c +++ b/utf8.c @@ -1882,8 +1882,8 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span) SV** const bitssvp = hv_fetchs(hv, "BITS", FALSE); SV** const nonesvp = hv_fetchs(hv, "NONE", FALSE); SV** const extssvp = hv_fetchs(hv, "EXTRAS", FALSE); - const U8* const typestr = (U8*)SvPV_nolen(*typesvp); - const int typeto = typestr[0] == 'T' && typestr[1] == 'o'; + const U8* const typestring = (U8*)SvPV_nolen(*typesvp); + const int typeto = typestring[0] == 'T' && typestring[1] == 'o'; const STRLEN bits = SvUV(*bitssvp); const STRLEN octets = bits >> 3; /* if bits == 1, then octets == 0 */ const UV none = SvUV(*nonesvp); @@ -1974,7 +1974,7 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span) val = 0; if (typeto) { Perl_croak(aTHX_ "%s: illegal mapping '%s'", - typestr, l); + typestring, l); } } } @@ -1986,7 +1986,7 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span) if (octets) { val = 0; if (typeto) { - Perl_croak(aTHX_ "%s: illegal mapping '%s'", typestr, l); + Perl_croak(aTHX_ "%s: illegal mapping '%s'", typestring, l); } } else