diff --git a/plan9/aperl b/plan9/aperl index 4d032e3c3d..04781fe710 100755 --- a/plan9/aperl +++ b/plan9/aperl @@ -4,4 +4,4 @@ # Executes perl command and alters stderr to produce Acme-friendly error messages # Created 02-JUL-1996, Luther Huffman, lutherh@stratcom.com -/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 24b3075f71..2408552a7a 100644 --- a/plan9/config.plan9 +++ b/plan9/config.plan9 @@ -590,7 +590,7 @@ * available to select active file descriptors. If the timeout field * is used, may need to be included. */ -#define HAS_SELECT /* config-skip */ +#undef HAS_SELECT /* config-skip */ /* HAS_SEM: * This symbol, if defined, indicates that the entire sem*(2) library is @@ -1127,6 +1127,49 @@ * This symbol, if defined, indicates to the C program that it should * include . */ + +#define IVTYPE long /**/ +#define UVTYPE unsigned long /**/ +#define I8TYPE char /**/ +#define U8TYPE unsigned char /**/ +#define I16TYPE short /**/ +#define U16TYPE unsigned short /**/ +#define I32TYPE long /**/ +#define U32TYPE unsigned long /**/ +#ifdef HAS_QUAD +#define I64TYPE long long /**/ +#define U64TYPE unsigned long long /**/ +#endif +#define NVTYPE double /**/ +#define IVSIZE 4 /**/ +#define UVSIZE 4 /**/ +#define I8SIZE 1 /**/ +#define U8SIZE 1 /**/ +#define I16SIZE 2 /**/ +#define U16SIZE 2 /**/ +#define I32SIZE 4 /**/ +#define U32SIZE 4 /**/ +#ifdef HAS_QUAD +#define I64SIZE 8 /**/ +#define U64SIZE 8 /**/ +#endif +#define NVSIZE 8 /**/ +#define Pid_t pid_t /* PID type */ +#define IVdf "ld" /**/ +#define UVuf "lu" /**/ +#define UVof "lo" /**/ +#define UVxf "lx" /**/ +#define UVXf "lX" /**/ +#define NVef "e" /**/ +#define NVff "f" /**/ +#define NVgf "g" /**/ +#define Drand01() (rand() / (double) ((unsigned long)1 << 15)) /**/ +#define Rand_seed_t unsigned /**/ +#define seedDrand01(x) srand((Rand_seed_t)x) /**/ +#define RANDBITS 15 /**/ +#define Sock_size_t int /**/ +#define I_NETDB + /* PWQUOTA: * This symbol, if defined, indicates to the C program that struct passwd * contains pw_quota. @@ -1590,8 +1633,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_EXP "/sys/lib/perl" /* */ -#define PRIVLIB "/sys/lib/perl" /* */ +#define PRIVLIB_EXP "/sys/lib/perl/_P9P_VERSION" /* */ +#define PRIVLIB "/sys/lib/perl/_P9P_VERSION" /* */ /* SIG_NAME: * This symbol contains a list of signal names in order of @@ -1628,8 +1671,8 @@ * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB_EXP "/sys/lib/perl/site_perl" /* */ -#define SITELIB "/sys/lib/perl/site_perl" /* */ +#define SITELIB_EXP "/sys/lib/perl/_P9P_VERSION/site_perl" /* */ +#define SITELIB "/sys/lib/perl/_P9P_VERSION/site_perl" /* */ /* SITEARCH_EXP: * This symbol contains the ~name expanded version of SITEARCH, to be used @@ -1643,7 +1686,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" /**/ /* SH_PATH: * Just here to shut up compiler warnings. 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 index a848de2b6d..b05a98f65d 100755 --- a/plan9/fndvers +++ b/plan9/fndvers @@ -12,3 +12,8 @@ ed plan9/genconfig.pl< $target + cp ext/re/re.pm $privlib + +IO.c: miniperl ext/IO/IO.xs $archlib/Config.pm ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/IO/IO.xs > $target + cp ext/IO/poll.h $sourcedir 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 } +re.$O: config.h re.c + $CCEXTCMD re.c + #cp regexec.c ext/re/re_exec.c + #cp regcomp.c ext/re/re_comp.c + #$CCEXTCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG ext/re/re_comp.c + #$CCEXTCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG ext/re/re_exec.c + + +IO.$O: config.h IO.c + $CCEXTCMD IO.c + +Opcode.$O: config.h Opcode.c + $CCEXTCMD Opcode.c + +dl_none.$O: config.h dl_none.c + $CCEXTCMD dl_none.c + +Fcntl.$O: config.h Fcntl.c + $CCEXTCMD Fcntl.c + +POSIX.$O: config.h POSIX.c + $CCEXTCMD POSIX.c + Socket.$O: config.h Socket.c - $CCCMD -I plan9 Socket.c + $CCEXTCMD -I plan9 Socket.c -Socket.c: miniperl ext/Socket/Socket.xs +Socket.c: miniperl ext/Socket/Socket.xs $archlib/Config.pm ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Socket/Socket.xs > $target cp ext/Socket/Socket.pm $privlib -Opcode.c: miniperl ext/Opcode/Opcode.xs +Opcode.c: miniperl ext/Opcode/Opcode.xs $archlib/Config.pm ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Opcode/Opcode.xs > $target cp ext/Opcode/*.pm $privlib -Fcntl.c: miniperl ext/Fcntl/Fcntl.xs +Fcntl.c: miniperl ext/Fcntl/Fcntl.xs $archlib/Config.pm ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Fcntl/Fcntl.xs > $target cp ext/Fcntl/Fcntl.pm $privlib -POSIX.c: miniperl ext/POSIX/POSIX.xs +POSIX.c: miniperl ext/POSIX/POSIX.xs $archlib/Config.pm ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/POSIX/POSIX.xs > $target cp ext/POSIX/POSIX.pm $privlib -dl_none.c: miniperl ext/DynaLoader/dl_none.xs +dl_none.c: miniperl ext/DynaLoader/dl_none.xs $archlib/Config.pm ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/DynaLoader/dl_none.xs > $target + cd ext/DynaLoader + $sourcedir^/miniperl DynaLoader_pm.PL + cd $sourcedir cp ext/DynaLoader/DynaLoader.pm $privlib test:V: @@ -125,6 +159,7 @@ $archlib/Config.pm: miniperl config.sh ./miniperl configpm $archlib/Config.pm config.sh: miniperl config.h + CONFIGDOTSH='true' ./miniperl ./plan9/genconfig.pl installall:V: @@ -136,7 +171,7 @@ man:V: $perlpods pod/pod2man.PL perl pod/pod2man plan9/perlplan9.pod > $installman3dir/perlplan9 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 poll.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..145e78ba89 100755 --- a/plan9/setup.rc +++ b/plan9/setup.rc @@ -3,23 +3,25 @@ # directories, and puts files where they belong. # To use, just run it from within the plan9 subdirectory with the appropriate # 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 +32,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"; }