summaryrefslogtreecommitdiff
path: root/plan9
diff options
context:
space:
mode:
authorRomano <unobe@cpan.org>2020-06-25 15:08:04 -0700
committerNicolas R <nicolas@atoomic.org>2020-08-03 16:33:11 -0600
commita123eb892ee6a30b5910abc29fbccf2386306e08 (patch)
tree8bf7db7128ed831c0452e5151b38820e6c7a440c /plan9
parentbe2a5c504c374b2061df9780050f2d8223cf27ff (diff)
downloadperl-a123eb892ee6a30b5910abc29fbccf2386306e08.tar.gz
Plan9/9front i386 fixes
Diffstat (limited to 'plan9')
-rw-r--r--plan9/9front.patch46
-rw-r--r--plan9/aperl3
-rw-r--r--plan9/buildinfo2
-rw-r--r--plan9/config.plan9296
-rw-r--r--plan9/exclude1
-rwxr-xr-x[-rw-r--r--]plan9/fndvers5
-rw-r--r--plan9/genconfig.pl52
-rw-r--r--plan9/math.h12
-rw-r--r--plan9/mkfile432
-rw-r--r--plan9/plan9.c53
-rw-r--r--plan9/plan9ish.h6
-rwxr-xr-x[-rw-r--r--]plan9/setup.rc58
-rwxr-xr-xplan9/uninstall.rc25
-rw-r--r--plan9/versnum9
14 files changed, 743 insertions, 257 deletions
diff --git a/plan9/9front.patch b/plan9/9front.patch
new file mode 100644
index 0000000000..d57d4fc0d3
--- /dev/null
+++ b/plan9/9front.patch
@@ -0,0 +1,46 @@
+diff --git a/dist/IO/poll.h b/dist/IO/poll.h
+--- a/dist/IO/poll.h
++++ b/dist/IO/poll.h
+@@ -22,10 +22,12 @@
+
+ #define EMULATE_POLL_WITH_SELECT
+
++#ifdef __VMS
+ #ifdef poll
+ # undef poll
+ #endif
+ #define poll Perl_my_poll
++#endif
+
+ typedef struct pollfd {
+ int fd;
+diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -125,6 +125,8 @@ sub get_files {
+ # VMS keeps its include files in system libraries
+ if ($^O eq 'VMS') {
+ $file{'Sys$Library:DECC$RTLDEF.TLB'} = 1;
++ } elsif ($^O eq 'plan9') {
++ $file{'/sys/include/ape/errno.h'} = 1;
+ } elsif ($^O eq 'os390') {
+ # OS/390 C compiler doesn't generate #file or #line directives
+ $file{'/usr/include/errno.h'} = 1;
+diff --git a/sv.c b/sv.c
+--- a/sv.c
++++ b/sv.c
+@@ -876,10 +876,10 @@
+ U8 body_size; /* Size to allocate */
+ U8 copy; /* Size of structure to copy (may be shorter) */
+ U8 offset; /* Size of unalloced ghost fields to first alloced field*/
+- PERL_BITFIELD8 type : 4; /* We have space for a sanity check. */
+- PERL_BITFIELD8 cant_upgrade : 1;/* Cannot upgrade this type */
+- PERL_BITFIELD8 zero_nv : 1; /* zero the NV when upgrading from this */
+- PERL_BITFIELD8 arena : 1; /* Allocated from an arena */
++ PERL_BITFIELD8 type; /* We have space for a sanity check. */
++ PERL_BITFIELD8 cant_upgrade;/* Cannot upgrade this type */
++ PERL_BITFIELD8 zero_nv; /* zero the NV when upgrading from this */
++ PERL_BITFIELD8 arena; /* Allocated from an arena */
+ U32 arena_size; /* Size of arena to allocate */
+ };
+
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/buildinfo b/plan9/buildinfo
index 881e00e47b..597dea835b 100644
--- a/plan9/buildinfo
+++ b/plan9/buildinfo
@@ -1 +1 @@
-p9pvers = 5.008
+p9pvers = 5.32.0
diff --git a/plan9/config.plan9 b/plan9/config.plan9
index 0c0c602ca2..9970f64068 100644
--- a/plan9/config.plan9
+++ b/plan9/config.plan9
@@ -2,12 +2,12 @@
* This file is mangled by fndvers (and perhaps other scripts) to produce
* the config.h for Plan 9. It was handwritten because the standard
* configuration scripts were written in a shell dialect incomprehensible
- * to Plan 9.
+ * to Plan 9.
* config.h for Plan 9
- * Version: 5.8.0
- */
+ * Version: blead
+ */
-/* Configuration time: 21-Oct-1996 15:11
+/* First configuration time: 21-Oct-1996 15:11
* Configured by: Luther Huffman, lutherh@stratcom.com
* Target system: Plan 9
*/
@@ -18,19 +18,46 @@
*
*/
+/* Last configuration time: June 2020
+ * Configured by: David Romano, unobe@cpan.org
+ * Target system: Plan 9/9front
+ */
+
#ifndef _config_h_
#define _config_h_
+/* CHARBITS:
+ * This symbol contains the size of a char, so that the C preprocessor
+ * can make decisions based on it.
+ */
+#define CHARBITS 8 /**/
+
+
/* CAT2:
* This macro catenates 2 tokens together.
*/
-#define CAT2(a,b)a ## b
+#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 catenate tokens?"
+#endif
+
#define CAT3(a,b,c)a ## b ## c
#define CAT4(a,b,c,d)a ## b ## c ## d
#define CAT5(a,b,c,d,e)a ## b ## c ## d ## e
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
#define SCAT2(a,b)StGiFy(a) StGiFy(b)
#define SCAT3(a,b,c)StGiFy(a) StGiFy(b) StGiFy(c)
#define SCAT4(a,b,c,d)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d)
@@ -52,16 +79,22 @@
# 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.
+/* BYTEORDER:
+ * This symbol holds the hexadecimal constant defined in byteorder,
+ * in a UV, i.e. 0x1234 or 0x4321 or 0x12345678, etc...
+ * If the compiler supports cross-compiling or multiple-architecture
+ * binaries (eg. on NeXT systems), use compiler-defined macros to
+ * determine the byte order.
+ * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture
+ * Binaries (MAB) on either big endian or little endian machines.
+ * The endian-ness is available at compile-time. This only matters
+ * for perl, where the config.h can be generated and installed on
+ * one system, and used by a different architecture to build an
+ * extension. Older versions of NeXT that might not have
+ * defined either *_ENDIAN__ were all on Motorola 680x0 series,
+ * so the default case (for NeXT) is big endian to catch them.
+ * This might matter for NeXT 3.0.
*/
-#define BIN "/_P9P_OBJTYPE/bin" /* */
-#define BIN_EXP "/_P9P_OBJTYPE/bin" /* */
/* LOC_SED:
* This symbol holds the complete pathname to the sed program.
@@ -202,7 +235,7 @@
#define HAS_GETLOGIN /**/
/* HAS_GETPGID:
- * This symbol, if defined, indicates to the C program that
+ * This symbol, if defined, indicates to the C program that
* the getpgid(pid) function is available to get the
* process group id.
*/
@@ -244,7 +277,7 @@
* This symbol, if defined, indicates that the link routine is
* available to create hard links.
*/
-/* #define HAS_LINK / **/
+/* #define HAS_LINK /**/
/* HAS_LOCALECONV:
* This symbol, if defined, indicates that the localeconv routine is
@@ -262,7 +295,7 @@
* This symbol, if defined, indicates that the lstat routine is
* available to do file stats on symbolic links.
*/
-/*#define HAS_LSTAT / **/
+/*#define HAS_LSTAT /**/
/* HAS_MBLEN:
* This symbol, if defined, indicates that the mblen routine is available
@@ -382,7 +415,7 @@
* This symbol, if defined, indicates that the readlink routine is
* available to read the value of a symbolic link.
*/
-/*#define HAS_READLINK / **/
+/*#define HAS_READLINK /**/
/* HAS_RENAME:
* This symbol, if defined, indicates that the rename routine is available
@@ -434,7 +467,7 @@
* This symbol, if defined, indicates that the setpgid(pid, gpid)
* routine is available to set process group ID.
*/
-#define HAS_SETPGID / **/
+#define HAS_SETPGID /**/
/* HAS_SETPGRP2:
* This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
@@ -502,7 +535,7 @@
* This symbol, if defined, indicates that the strtod routine is
* available to provide better numeric string conversion than atof().
*/
-#define HAS_STRTOD /**/
+/*#define HAS_STRTOD /**/
/* HAS_STRTOL:
* This symbol, if defined, indicates that the strtol routine is available
@@ -520,7 +553,7 @@
* This symbol, if defined, indicates that the symlink routine is available
* to create symbolic links.
*/
-/*#define HAS_SYMLINK / **/
+/*#define HAS_SYMLINK /**/
/* HAS_SYSCALL:
* This symbol, if defined, indicates that the syscall routine is
@@ -654,7 +687,7 @@
#define I_LOCALE /**/
/* I_NET_ERRNO:
- * This symbol, if defined, indicates that <net/errno.h> exists and
+ * This symbol, if defined, indicates that <net/errno.h> exists and
* should be included.
*/
/*#define I_NET_ERRNO /* config-skip */
@@ -865,17 +898,6 @@
*/
#define PLAN9 /**/
-/* MEM_ALIGNBYTES:
- * This symbol contains the number of bytes required to align a
- * double, or a long double when applicable. Usual values are 2,
- * 4 and 8. The default is eight, for safety.
- */
-#if defined(MULTIARCH)
-# define MEM_ALIGNBYTES 8
-#else
-#define MEM_ALIGNBYTES 4
-#endif
-
/* ARCHLIB:
* This variable, if defined, holds the name of the directory in
* which the user wants to put architecture-dependent public
@@ -920,8 +942,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,
@@ -966,30 +988,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
@@ -1233,7 +1231,7 @@
* This symbol, if defined, indicates that the "fast stdio"
* is available to manipulate the stdio buffers directly.
*/
-/*#define HAS_FAST_STDIO / **/
+/*#define HAS_FAST_STDIO /**/
/* HAS_FCHDIR:
* This symbol, if defined, indicates that the fchdir routine is
@@ -1311,7 +1309,8 @@
/* HAS_FPCLASSIFY:
* This symbol, if defined, indicates that the fpclassify routine is
- * available to classify doubles. Available for example in HP-UX.
+ * available to classify doubles. Available for example in HP-UX and
+ * Plan9/9front.
* The returned values are defined in <math.h> and are
*
* FP_NORMAL Normalized
@@ -1321,7 +1320,7 @@
* FP_NAN NaN
*
*/
-/*#define HAS_FPCLASSIFY / **/
+#define HAS_FPCLASSIFY / **/
/* HAS_FPOS64_T:
* This symbol will be defined if the C compiler supports fpos64_t.
@@ -1707,11 +1706,11 @@
* REENTRANT_PROTO_T_ABC macros of reentr.h if d_gmtime_r
* is defined.
*/
-/*#define HAS_GMTIME_R / **/
+#define HAS_GMTIME_R / **/
#define GMTIME_R_PROTO 0 /**/
/* HAS_GNULIBC:
- * This symbol, if defined, indicates to the C program that
+ * This symbol, if defined, indicates to the C program that
* the GNU C library is being used. A better check is to use
* the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc.
*/
@@ -1754,7 +1753,7 @@
* This symbol, if defined, indicates that the ilogbl routine is
* available. If scalbnl is also present we can emulate frexpl.
*/
-/*#define HAS_ILOGBL / **/
+/*#define HAS_ILOGBL /**/
/* HAS_INT64_T:
* This symbol will defined if the C compiler supports int64_t.
@@ -1764,7 +1763,7 @@
#define HAS_INT64_T /**/
/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
+ * This manifest constant lets the C program know that isascii
* is available.
*/
/*#define HAS_ISASCII / **/
@@ -1824,29 +1823,68 @@
* REENTRANT_PROTO_T_ABC macros of reentr.h if d_localtime_r
* is defined.
*/
-/*#define HAS_LOCALTIME_R / **/
-/*#define LOCALTIME_R_NEEDS_TZSET / **/
+#define HAS_LOCALTIME_R
+#define LOCALTIME_R_NEEDS_TZSET / **/
#define LOCALTIME_R_PROTO 0 /**/
-
+#ifdef LOCALTIME_R_NEEDS_TZSET
+#define L_R_TZSET tzset(),
+#else
+#define L_R_TZSET
+#endif
/* HAS_LONG_DOUBLE:
* This symbol will be defined if the C compiler supports long
* doubles.
*/
/* LONG_DOUBLESIZE:
- * This symbol contains the size of a long double, so that the
+ * This symbol contains the size of a long double, so that the
* C preprocessor can make decisions based on it. It is only
- * defined if the system supports long doubles.
- */
-#define HAS_LONG_DOUBLE /**/
+ * defined if the system supports long doubles. Note that this
+ * is sizeof(long double), which may include unused bytes.
+ */
+/* HAS_LDEXPL:
+ * This symbol, if defined, indicates that the ldexpl routine is
+ * available to shift a long double floating-point number
+ * by an integral power of 2.
+ */
+/* LONG_DOUBLEKIND:
+ * LONG_DOUBLEKIND will be one of
+ * LONG_DOUBLE_IS_DOUBLE
+ * LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN
+ * LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN
+ * LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN
+ * LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN
+ * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE
+ * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE
+ * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE
+ * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE
+ * LONG_DOUBLE_IS_UNKNOWN_FORMAT
+ * It is only defined if the system supports long doubles.
+ */
+/*#define HAS_LDEXPL / **/
+#define HAS_LONG_DOUBLE / **/
#ifdef HAS_LONG_DOUBLE
#define LONG_DOUBLESIZE 8 /**/
+#define LONG_DOUBLEKIND 0 /**/
+#define LONG_DOUBLE_IS_DOUBLE 0
+#define LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN 1
+#define LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN 2
+#define LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN 3
+#define LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN 4
+#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE 5
+#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE 6
+#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE 7
+#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE 8
+#define LONG_DOUBLE_IS_UNKNOWN_FORMAT -1
+#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE /* back-compat */
+#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE /* back-compat */
#endif
+
/* HAS_LONG_LONG:
* This symbol will be defined if the C compiler supports long long.
*/
/* LONGLONGSIZE:
- * This symbol contains the size of a long long, so that the
+ * This symbol contains the size of a long long, so that the
* C preprocessor can make decisions based on it. It is only
* defined if the system supports long long.
*/
@@ -1948,7 +1986,7 @@
/*#define OLD_PTHREAD_CREATE_JOINABLE / **/
/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
+ * This symbol, if defined, indicates that the pthread_yield
* routine is available to yield the execution of the current
* thread. sched_yield is preferable to pthread_yield.
*/
@@ -2024,7 +2062,7 @@
* This symbol, if defined, indicates that the scalbnl routine is
* available. If ilogbl is also present we can emulate frexpl.
*/
-/*#define HAS_SCALBNL / **/
+/*#define HAS_SCALBNL /**/
/* HAS_SENDMSG:
* This symbol, if defined, indicates that the sendmsg routine is
@@ -2569,8 +2607,8 @@
* This symbol holds the type used for the second argument to
* getgroups() and setgroups(). Usually, this is the same as
* gidtype (gid_t) , but sometimes it isn't.
- * It can be int, ushort, gid_t, etc...
- * It may be necessary to include <sys/types.h> to get any
+ * It can be int, ushort, gid_t, etc...
+ * It may be necessary to include <sys/types.h> to get any
* typedef'ed information. This is only required if you have
* getgroups() or setgroups()..
*/
@@ -2731,6 +2769,12 @@
/*#define PWGECOS / **/
/*#define PWPASSWD / **/
+/* I_QUADMATH:
+ * This symbol, if defined, indicates that <quadmath.h> exists and
+ * should be included.
+ */
+/*#define I_QUADMATH / **/
+
/* I_SHADOW:
* This symbol, if defined, indicates that <shadow.h> exists and
* should be included.
@@ -2842,6 +2886,27 @@
*/
/*#define INSTALL_USR_BIN_PERL / **/
+/* DOUBLEINFBYTES:
+ * This symbol, if defined, is a comma-separated list of
+ * hexadecimal bytes for the double precision infinity.
+ */
+/* DOUBLENANBYTES:
+ * This symbol, if defined, is a comma-separated list of
+ * hexadecimal bytes (0xHH) for the double precision not-a-number.
+ */
+/* LONGDBLINFBYTES:
+ * This symbol, if defined, is a comma-separated list of
+ * hexadecimal bytes for the long double precision infinity.
+ */
+/* LONGDBLNANBYTES:
+ * This symbol, if defined, is a comma-separated list of
+ * hexadecimal bytes (0xHH) for the long double precision not-a-number.
+ */
+#define DOUBLEINFBYTES 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f /**/
+#define DOUBLENANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f /**/
+#define LONGDBLINFBYTES 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f /**/
+#define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /**/
+
/* PERL_PRIfldbl:
* This symbol, if defined, contains the string used by stdio to
* format long doubles (format 'f') for output.
@@ -2894,7 +2959,7 @@
#define MYMALLOC /**/
/* Mode_t:
- * This symbol holds the type used to declare file modes
+ * This symbol holds the type used to declare file modes
* for systems calls. It is usually mode_t, but may be
* int or unsigned short. It may be necessary to include <sys/types.h>
* to get any typedef'ed information.
@@ -3044,6 +3109,16 @@
* This symbol contains the number of bits a variable of type NVTYPE
* can preserve of a variable of type UVTYPE.
*/
+/* NV_OVERFLOWS_INTEGERS_AT:
+ * This symbol gives the largest integer value that NVs can hold. This
+ * value + 1.0 cannot be stored accurately. It is expressed as constant
+ * floating point expression to reduce the chance of decimale/binary
+ * conversion issues. If it can not be determined, the value 0 is given.
+ */
+/* NV_ZERO_IS_ALLBITS_ZERO:
+ * This symbol, if defined, indicates that a variable of type NVTYPE
+ * stores 0.0 in memory as all bits zero.
+ */
#define IVTYPE long /**/
#define UVTYPE unsigned long /**/
#define I8TYPE char /**/
@@ -3070,8 +3145,10 @@
#define U64SIZE 8 /**/
#endif
#define NVSIZE 8 /**/
-/*#define NV_PRESERVES_UV
+#define NV_PRESERVES_UV
#define NV_PRESERVES_UV_BITS 31
+#define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0
+#undef NV_ZERO_IS_ALLBITS_ZERO
/* IVdf:
* This symbol defines the format string used for printing a Perl IV
@@ -3131,8 +3208,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.33.1" /**/
-#define PRIVLIB_EXP "/sys/lib/perl/5.33.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
@@ -3179,7 +3256,7 @@
/* Select_fd_set_t:
* This symbol holds the type used for the 2nd, 3rd, and 4th
* arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
+ * is defined, and 'int *' otherwise. This is only useful if you
* have select(), of course.
*/
#define Select_fd_set_t fd_set* /**/
@@ -3205,10 +3282,10 @@
* The signals in the list are separated with commas, and the indices
* within that list and the SIG_NAME list match, so it's easy to compute
* the signal name from a number or vice versa at the price of a small
- * dynamic linear lookup.
+ * dynamic linear lookup.
* Duplicates are allowed, but are moved to the end of the list.
* The signal number corresponding to sig_name[i] is sig_number[i].
- * if (i < NSIG) then sig_number[i] == i.
+ * if (i < NSIG) then sig_number[i] == i.
* The last element is 0, corresponding to the 0 at the end of
* the sig_name list.
*/
@@ -3259,9 +3336,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.33.1/site_perl" /**/
-#define SITELIB_EXP "/sys/lib/perl/5.33.1/site_perl" /**/
-#define SITELIB_STEM "/sys/lib/perl/5.33.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.
@@ -3297,7 +3374,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.
@@ -3339,6 +3416,27 @@
*/
#define Uid_t uid_t /* UID type */
+/* GMTIME_MAX:
+ * This symbol contains the maximum value for the time_t offset that
+ * the system function gmtime () accepts, and defaults to 0
+ */
+/* GMTIME_MIN:
+ * This symbol contains the minimum value for the time_t offset that
+ * the system function gmtime () accepts, and defaults to 0
+ */
+/* LOCALTIME_MAX:
+ * This symbol contains the maximum value for the time_t offset that
+ * the system function localtime () accepts, and defaults to 0
+ */
+/* LOCALTIME_MIN:
+ * This symbol contains the minimum value for the time_t offset that
+ * the system function localtime () accepts, and defaults to 0
+ */
+#define GMTIME_MAX 2147483647 /**/
+#define GMTIME_MIN 0 /**/
+#define LOCALTIME_MAX 2147483647 /**/
+#define LOCALTIME_MIN 0 /**/
+
/* USE_64_BIT_INT:
* This symbol, if defined, indicates that 64-bit integers should
* be used when available. If not defined, the native integers
@@ -3415,6 +3513,14 @@
#define USE_PERLIO /**/
#endif
+/* USE_QUADMATH:
+ * This symbol, if defined, indicates that the quadmath library should
+ * be used when available.
+ */
+#ifndef USE_QUADMATH
+/*#define USE_QUADMATH / **/
+#endif
+
/* USE_SOCKS:
* This symbol, if defined, indicates that Perl should
* be built to use socks.
@@ -3452,11 +3558,11 @@
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's
* execution path, but it should be accessible by the world.
- * It may have a ~ on the front.
+ * It may have a ~ on the front.
* The standard distribution will put nothing in this directory.
* Vendors who distribute perl may wish to place their own
* architecture-dependent modules and extensions in this directory with
- * MakeMaker Makefile.PL INSTALLDIRS=vendor
+ * MakeMaker Makefile.PL INSTALLDIRS=vendor
* or equivalent. See INSTALL for details.
*/
/* PERL_VENDORARCH_EXP:
@@ -3549,13 +3655,13 @@
* This symbol, if defined, indicates that the copysignl routine is
* available. If aintl is also present we can emulate modfl.
*/
-/*#define HAS_COPYSIGNL / **/
+/*#define HAS_COPYSIGNL /**/
/* USE_CPLUSPLUS:
* This symbol, if defined, indicates that a C++ compiler was
* used to compiled Perl and will be used to compile extensions.
*/
-/*#define USE_CPLUSPLUS / **/
+/*#define USE_CPLUSPLUS /**/
/* HAS_DBMINIT_PROTO:
* This symbol, if defined, indicates that the system provides
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 100644..100755
--- a/plan9/fndvers
+++ b/plan9/fndvers
@@ -12,3 +12,8 @@ ed plan9/genconfig.pl<<!
g/_P9P_VERSION/s//$p9pvers/g
w plan9/genconfig.pl
!
+
+ed plan9/aperl<<!
+g/_P9P_VERSION/s//$p9pvers/g
+w plan9/aperl
+!
diff --git a/plan9/genconfig.pl b/plan9/genconfig.pl
index ebd97db018..14c1faed25 100644
--- a/plan9/genconfig.pl
+++ b/plan9/genconfig.pl
@@ -7,17 +7,21 @@
# to run may be supplied on the command line as key=val pairs.
#
# Last Modified: 28-Jun-1996 Luther Huffman lutherh@stratcom.com
+# Last Modified: May 2020 David Romano unobe@cpan.org
#
+my $VERBOSE = 0;
+
#==== Locations of installed Perl components
$p9pvers="_P9P_VERSION";
+$version="$p9pvers";
$prefix='';
$p9p_objtype=$ENV{'objtype'};
$builddir="/sys/src/cmd/perl/$p9pvers";
$installbin="/$p9p_objtype/bin";
$installman1dir="/sys/man/1";
$installman3dir="/sys/man/2";
-$installprivlib="/sys/lib/perl";
+$installprivlib="/sys/lib/perl/$p9pvers";
$installarchlib = "/$p9p_objtype/lib/perl/$p9pvers";
$archname="plan9_$p9p_objtype";
$installsitelib="$installprivlib/site_perl";
@@ -28,13 +32,15 @@ unshift(@INC,'lib'); # In case someone didn't define Perl_Root
# before the build
if ($ARGV[0] eq '-f') {
+ shift @ARGV;
open(ARGS,'<',$ARGV[1]) or die "Can't read data from $ARGV[1]: $!\n";
- @ARGV = ();
+ shift @ARGV;
while (<ARGS>) {
push(@ARGV,split(/\|/,$_));
}
close ARGS;
}
+my @extensions = @ARGV;
if (-f "config.h") { $infile = "config.h"; $outdir = "../"; }
elsif (-f "plan9/config.h") { $infile = "plan9/config.h"; $outdir = "./"; }
@@ -54,11 +60,9 @@ $time = localtime;
$cf_by = $ENV{'user'};
($vers = $]) =~ tr/./_/;
-# Plan 9 doesn't actually use version numbering. Following the original Unix
-# precedent of assigning a Unix edition number based on the edition number
-# of the manuals, I am referring to this as Plan 9, 1st edition.
-$osvers = '1';
-
+# 9front as Plan 9, 5th edition.
+$osvers = '5';
+
print OUT <<EndOfIntro;
# This file generated by genconfig.pl on a Plan 9 system.
# Input obtained from:
@@ -67,13 +71,15 @@ print OUT <<EndOfIntro;
# Time: $time
package='perl5'
-CONFIG='true'
+PERL_CONFIG_SH='true'
cf_time='$time'
cf_by='$cf_by'
ccdlflags=''
cccdlflags=''
libpth='$installprivlib'
ld='pcc'
+cppflags=''
+cppstdin='cpp'
lddlflags=''
ranlib=''
ar='ar'
@@ -96,7 +102,8 @@ man3ext=''
arch='$archname'
archname='$archname'
osname='plan9'
-extensions='IO Socket Opcode Fcntl POSIX DynaLoader FileHandle'
+version='$p9pvers'
+extensions='@extensions'
osvers='$osvers'
sig_maxsig='19'
sig_name='ZERO HUP INT QUIT ILL ABRT FPE KILL SEGV PIPE ALRM TERM USR1 USR2 CHLD CONT STOP TSTP TTIN TTOU'
@@ -176,7 +183,9 @@ print OUT "myuname='Plan9 $myname $osvers $p9p_objtype'\n";
# equivalent to the C preprocessor macros
if (open(SH,'<',"${outdir}config_h.SH")) {
while (<SH>) {
- next unless m%^#(?!if).*\$%;
+ # suicide @ regcomp.c:22117
+ #next unless m%^#(?!if).*\$%;
+ next unless !index($_, '#') && index($_, '#if') == -1 && rindex($_, '$') == length($_)-1;
s/^#//; s!(.*?)\s*/\*.*!$1!;
my(@words) = split;
$words[1] =~ s/\(.*//; # Clip off args from macro
@@ -195,7 +204,7 @@ if (open(SH,'<',"${outdir}config_h.SH")) {
}
close SH;
}
-else { warn "Couldn't read ${outfile}config_h.SH: $!\n"; }
+elsif ($VERBOSE) { warn "Couldn't read ${outfile}config_h.SH: $!\n"; }
$pp_vars{PLAN9} = 'define'; #Plan 9 specific
# OK, now read the C header file, and retcon statements into config.sh
@@ -233,7 +242,7 @@ while (<IN>) {
}
elsif (not length $val and not $had_val) {
# Wups -- should have been shell var for C preprocessor directive
- warn "Constant $token not found in config_h.SH\n";
+ warn "Constant $token not found in config_h.SH\n" if $VERBOSE;
$token =~ tr/A-Z/a-z/;
$token = "d_$token" unless $token =~ /^i_/;
print OUT "$token='$state'\n";
@@ -248,7 +257,7 @@ while (<IN>) {
delete $val_vars{$token};
}
elsif (!$pp_vars{$token}) { # Haven't seen it previously, either
- warn "Constant $token not found in config_h.SH (val=|$val|)\n";
+ warn "Constant $token not found in config_h.SH (val=|$val|)\n" if $VERBOSE;
$token =~ tr/A-Z/a-z/;
print OUT "$token='$val'\n";
if ($token =~ s/exp$//) {print OUT "$token='$val'\n";}
@@ -256,14 +265,15 @@ while (<IN>) {
}
close IN;
-foreach (sort keys %pp_vars) {
- warn "Didn't see $_ in $infile\n";
-}
-foreach (sort keys %val_vars) {
- warn "Didn't see $_ in $infile(val)\n";
+if ($VERBOSE) {
+ foreach (sort keys %pp_vars) {
+ warn "Didn't see $_ in $infile\n";
+ }
+ foreach (sort keys %val_vars) {
+ warn "Didn't see $_ in $infile(val)\n";
+ }
}
-
# print OUT "libs='",join(' ',@libs),"'\n";
# print OUT "libc='",join(' ',@crtls),"'\n";
@@ -280,10 +290,8 @@ if (open(PL,'<',"${outdir}patchlevel.h")) {
}
close PL;
}
-else { warn "Can't read ${outdir}patchlevel.h - skipping 'PERL_VERSION'"; }
+elsif ($VERBOSE) { warn "Can't read ${outdir}patchlevel.h - skipping 'PERL_VERSION'" }
print OUT "pager='/bin/p'\n";
close OUT;
-
-
diff --git a/plan9/math.h b/plan9/math.h
new file mode 100644
index 0000000000..fc0d725d59
--- /dev/null
+++ b/plan9/math.h
@@ -0,0 +1,12 @@
+/* Our math.h for HAS_FPCLASSIFY in plan9.config
+ * FP_NORMAL Normalized
+ * FP_ZERO Zero
+ * FP_INFINITE Infinity
+ * FP_SUBNORMAL Denormalized
+ * FP_NAN NaN
+ */
+#define FP_NORMAL 1
+#define FP_ZERO 2
+#define FP_INFINITE 3
+#define FP_SUBNORMAL 4
+#define FP_NAN 5
diff --git a/plan9/mkfile b/plan9/mkfile
index 245a00c9c4..6bc420e0ea 100644
--- a/plan9/mkfile
+++ b/plan9/mkfile
@@ -1,21 +1,42 @@
APE=/sys/src/ape
< $APE/config
<plan9/buildinfo
-sourcedir = /sys/src/cmd/perl/$p9pvers
archname = plan9_$objtype
-privlib=/sys/lib/perl
-archlib = /$objtype/lib/perl/$p9pvers
-sitelib = $privlib/site_perl
+privroot = /sys/lib/perl
+privlib = $privroot/$p9pvers
+archroot = /$objtype/lib/perl
+archlib = $archroot/$p9pvers
+sitelib = $privlib/site_perl
sitearch = $archlib/site_perl
+corelib = $archlib/CORE
+arpalib = $corelib/arpa
-CFLAGS = -B -D_POSIX_SOURCE -D_BSD_EXTENSION -DMY_UV_MAX=0x7fffffffUL
-LDFLAGS = -B
+pwd=`{pwd}
+cpanlib=`{cd cpan; ls -ld * | grep '^d' | awk '{ print $10 }' | grep -v '^\.'}
+icpanlib=`{echo $pwd^/cpan/^$cpanlib^/lib}
+distlib=`{cd dist; ls -ld * | grep '^d' | awk '{ print $10 }' | grep -v '^\.'}
+idistlib=`{echo $pwd^/dist/^$distlib $pwd^/dist/^$distlib^/lib }
+extlib=`{cd ext; ls -ld * | grep '^d' | awk '{ print $10 }' | grep -v '^\.'}
+iextlib=`{echo $pwd^/ext/^$extlib $pwd^/ext/^$extlib/lib }
-CCCMD = $CC -c $CFLAGS
+buildlibs=`{echo -I$pwd^/^(lib archlib privlib) -I^$icpanlib -I^$idistlib -I^$iextlib }
+miniperl=`{echo $pwd/miniperl $buildlibs }
+perl=`{echo $pwd/perl $buildlibs }
+xscmd=`{echo $pwd/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp -noprototypes -typemap $pwd/dist/ExtUtils-ParseXS/t/typemap}
+miniperlxs=`{echo $miniperl $xscmd}
+perlxs=`{echo $perl $xscmd}
-perllib = $archlib/CORE/libperl.a
+BASECFLAGS=-B -D_SUSV2_SOURCE -D_POSIX_SOURCE -D_BSD_EXTENSION
+PERLCFLAGS =-DPERL_CORE $BASECFLAGS
+CFLAGS=-DPERL_IS_MINIPERL $PERLCFLAGS
-perlshr = $archlib/CORE/libperlshr.a
+CCCMD = $CC -c $CFLAGS
+PERLCCCMD= $CC -c $PERLCFLAGS
+XSCCCMD= $CC -c $BASECFLAGS
+
+perllib = archlib/CORE/libperl.a
+
+perlshr = archlib/CORE/libperlshr.a
installman1dir = /sys/man/1
installman3dir = /sys/man/2
@@ -23,116 +44,377 @@ installman3dir = /sys/man/2
podnames = perl perlbook perldata perldebtut perldiag perldsc perlform perlfunc perlipc perllexwarn perllol perlmod perlmodlib perlmodinstall perlnewmod perlop perlootut perlopentut perlpacktut perlpod perlport perlrequick perlretut perlref perlreftut perlrequick perlrun perlsec perlstyle perlsub perlsyn perltie perltrap perlutil perlunifaq perluniintro perlvar
faqpodnames = perlfaq perlfaq1 perlfaq2 perlfaq3 perlfaq4 perlfaq5 perlfaq6 perlfaq7 perlfaq8 perlfaq9
advpodnames = perlapi perlapio perlcall perlclib perlcompile perldebguts perldbmfilter perldebug perldelta perldiag perlebcdic perlembed perlfilter perlfork perlguts perlhack perlintern perliol perllocale perlnumber perlobj perlpodspec perlre perlthrtut perltodo perlunicode perlunicook perlxs perlxs perlxstut
-archpodnames = perlaix perlamiga perlbeos perlbs2000 perlcygwin perldgux perldos perlfreebsd perlhpux perlhurd perlirix perlmacos perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris perltru64 perlvms perlvos perlwin32
-histpods = perl5004delta perl5005delta perl561delta perl56delta perl570delta perl571delta perl572delta perl573delta perl58delta perlhist
+archpodnames = perlaix perlamiga perlbeos perlbs2000 perlce perlcygwin perldgux perldos perlfreebsd perlhpux perlhurd perlirix perlmacos perlmpeix perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris perltru64 perlvms perlvos perlwin32
+histpodnames = perl5004delta perl5005delta perl561delta perl56delta perl570delta perl571delta perl572delta perl573delta perl58delta perlhist
libpods = ${podnames:%=pod/%.pod}
perlpods = $libpods
-extensions = IO Socket Opcode DynaLoader Fcntl POSIX
-ext_xs = IO.xs Socket.xs Opcode.xs dl_none.xs Fcntl.xs POSIX.xs
+extensions = File::Glob IO Opcode DynaLoader Fcntl POSIX Cwd re B Devel::Peek attributes Hash::Util Hash::Util::FieldHash mro Storable Time::HiRes Unicode::Normalize List::Util
+ext_xs = Glob.xs IO.xs Opcode.xs dl_none.xs Fcntl.xs POSIX.xs Cwd.xs re.xs B.xs Peek.xs attributes.xs Util.xs FieldHash.xs mro.xs Storable.xs HiRes.xs Normalize.xs ListUtil.xs
ext_c = ${ext_xs:%.xs=%.c}
-ext_obj = ${ext_xs:%.xs=%.$O}
+ext_obj = ${ext_xs:%.xs=%.$O} bsd_glob.$O poll.$O re_comp.$O re_exec.$O
+
+# Socket requires a full version of Perl (one with IO to build).
+more_extensions = Socket Data::Dumper
+more_ext_xs = Socket.xs Dumper.xs
+more_ext_c = ${more_ext_xs:%.xs=%.c}
+more_ext_obj = ${more_ext_xs:%.xs=%.$O}
-obj = av.$O deb.$O doio.$O doop.$O dquote.$O dump.$O globals.$O gv.$O hv.$O locale.$O malloc.$O mathoms.$O mg.$O numeric.$O op.$O pad.$O perlio.$O perly.$O pp.$O pp_ctl.$O pp_hot.$O pp_pack.$O pp_sort.$O pp_sys.$O reentr.$O regcomp.$O regexec.$O run.$O scope.$O sv.$O taint.$O time64.$O toke.$O universal.$O utf8.$O util.$O
+obj = av.$O caretx.$O deb.$O doio.$O doop.$O dquote.$O dump.$O globals.$O gv.$O hv.$O keywords.$O locale.$O malloc.$O mathoms.$O mg.$O mro_core.$O numeric.$O op.$O pad.$O perlapi.$O perlio.$O perly.$O pp.$O pp_ctl.$O pp_hot.$O pp_pack.$O pp_sort.$O pp_sys.$O reentr.$O regcomp.$O regexec.$O run.$O scope.$O sv.$O taint.$O time64.$O toke.$O universal.$O utf8.$O util.$O
OBJS = perl.$O plan9.$O $obj
-testlist = base/*.t comp/*.t cmd/*.t io/*.t op/*.t
+# TODO: what's this used for?
+testlist = `{cd t; echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t}
install:V: perl preplibrary
- cp perl /$objtype/bin/perl
- cp plan9/aperl /rc/bin/Perl
- mk man
+ cp perl /$objtype/bin/perl-$p9pvers
+ cp plan9/aperl /rc/bin/Perl-$p9pvers
-perl: config.h miniperlmain.$O miniperl $archlib/Config.pm perlmain.$O $perlshr
- $LD $CFLAGS -o perl perlmain.$O $perllib $perlshr
+ 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
+ if (test ! -d $archroot) mkdir $archroot
+ if (test ! -d $archlib) mkdir $archlib
+ if (test ! -d $sitearch) mkdir $sitearch
+ if (test ! -d $corelib) mkdir $corelib
+ if (test ! -d $arpalib) mkdir $arpalib
+ cp *.h plan9/*.h $corelib
+ cp plan9/arpa/*.h $arpalib
+
+ # Populate library directories
+ {cd privlib ; tar c . } | {cd $privlib ; tar x }
+ {cd lib ; tar c . } | {cd $privlib ; tar x }
+ {cd archlib ; tar c . } | {cd $archlib ; tar x }
+ # mk man # don't make man pages now--resolve multiversion
+
+perl: perlnosocket more_extensions
+ $LD $PERLCFLAGS -o perl perlmain.$O perl.$O $perllib $perlshr $more_ext_obj
+
+perlnosocket: config.h miniperlmain.$O miniperl archlib/Config.pm perlmain.$O $perlshr
+ $LD $PERLCFLAGS -o perl perlmain.$O perl.$O $perllib $perlshr
miniperl: config.h $perllib miniperlmain.$O
$LD $CFLAGS -o miniperl miniperlmain.$O $perllib
-preplibrary:V: miniperl $archlib/Config.pm
- cd $privlib
- for (file in *.pm */*.pm $archlib/Config.pm) $sourcedir/miniperl -e 'use AutoSplit; autosplit(@ARGV)' $file $privlib/auto
+preplibrary:V: miniperl archlib/Config.pm
+ mkdir -p privlib/auto
+ for (file in lib/*.pm lib/*/*.pm archlib/Config.pm) $miniperl -e 'use AutoSplit; autosplit(@ARGV)' $file privlib/auto
$perllib(%):N: %
$perllib: ${OBJS:%=$perllib(%)}
+ mkdir -p archlib/CORE
ar rv $perllib $OBJS
$RANLIB $perllib
-miniperlmain.$O: config.h
+miniperlmain.$O: config.h uudmap.h
$CCCMD miniperlmain.c
perlmain.$O: config.h perlmain.c
- $CCCMD perlmain.c
+ $PERLCCCMD perl.c
+ $PERLCCCMD perlmain.c
-perlmain.c: miniperl vms/writemain.pl
- ./miniperl vms/writemain.pl $extensions
+malloc.$O: malloc.c
+ # Does the PTRDIFF_MAX need to be set per architecture?
+ $CCCMD -DPTRDIFF_MAX^'='^9223372036854775807L malloc.c
+
+perlmain.c: miniperl extensions archlib/Config.pm
+ $miniperl -MExtUtils::Miniperl -e 'writemain(\q{perlmain.c}, @ARGV)' $extensions
config.h: plan9/fndvers
plan9/fndvers
- cp config.h $archlib/CORE
+ mkdir -p archlib/CORE
+ cp config.h archlib/CORE
$perlshr(%):N: %
$perlshr: ${ext_obj:%=$perlshr(%)}
ar rv $perlshr $ext_obj
$RANLIB $perlshr
-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) {
- mkdir $privlib/IO
- cp ext/IO/lib/IO/*.pm $privlib/IO
- }
-
-Socket.$O: config.h Socket.c
- $CCCMD -I plan9 Socket.c
-
-Socket.c: miniperl ext/Socket/Socket.xs
- ./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
- ./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
- ./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
- ./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
- ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/DynaLoader/dl_none.xs > $target
- cp ext/DynaLoader/DynaLoader.pm $privlib
-
-test:V:
- bind -b $privlib $sourcedir/lib
- bind -b $archlib $sourcedir/lib
- cd $sourcedir/t
- rm -f perl
- cp /$objtype/bin/perl $sourcedir/t
+uudmap.h: generate_uudmap.c
+ $CCCMD generate_uudmap.c
+ # This is currently a show-stopper for cross-compilation: find the true $objtype by looking at kernel?
+ $LD $CFLAGS -o generate_uudmap generate_uudmap.$O
+ chmod +x generate_uudmap
+ ./generate_uudmap uudmap.h bitcount.h mg_data.h
+
+extensions:V: miniperl archlib/Config.pm $ext_c dist/XSLoader/XSLoader.pm
+
+more_extensions:V: perlnosocket $more_ext_c $more_ext_obj
+ ext_obj=`{echo $ext_obj $more_ext_obj}
+
+Socket.$O: Socket.c
+ $XSCCCMD -I plan9 Socket.c
+
+attributes.$O: attributes.c
+ $XSCCCMD -I plan9 attributes.c
+
+mro.$O: mro.c
+ $XSCCCMD -I plan9 mro.c
+
+B.$O: B.c
+ $XSCCCMD -I plan9 B.c
+
+Peek.$O: Peek.c
+ $XSCCCMD -I plan9 Peek.c
+
+Util.$O: Util.c
+ $XSCCCMD -I plan9 Util.c
+
+FieldHash.$O: FieldHash.c
+ $XSCCCMD -I plan9 FieldHash.c
+
+re.$O: re.c
+ $XSCCCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT -I plan9 re.c
+
+re_comp.$O: re_comp.c
+ $XSCCCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT -I plan9 re_comp.c
+
+re_exec.$O: re_exec.c
+ $XSCCCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT -I plan9 re_exec.c
+
+Cwd.$O: Cwd.c IO.c
+ cp dist/IO/ppport.h dist/PathTools
+ $XSCCCMD -DDOUBLE_SLASHES_SPECIAL^'='^0 -I plan9 Cwd.c
+
+IO.$O: extensions
+ $XSCCCMD -I plan9 IO.c
+
+poll.$O: extensions
+ $XSCCCMD -I plan9 poll.c
+
+POSIX.$O: extensions
+ $XSCCCMD -I plan9 POSIX.c
+
+Glob.$O: extensions
+ $XSCCCMD -I plan9 Glob.c
+
+bsd_glob.$O: extensions
+ $XSCCCMD -I plan9 -I. bsd_glob.c
+
+Normalize.$O: extensions
+ $XSCCCMD -I plan9 -I. Normalize.c
+
+Dumper.$O: Dumper.c
+ $XSCCCMD -I plan9 -I. Dumper.c
+
+HiRes.$O: extensions
+ $XSCCCMD -I plan9 -I. HiRes.c
+
+Storable.$O: extensions
+ $XSCCCMD -I plan9 -I. Storable.c
+
+ListUtil.$O: extensions
+ $XSCCCMD -I plan9 -I. ListUtil.c
+
+Opcode.$O: extensions
+ $XSCCCMD -I plan9 Opcode.c
+
+Fcntl.$O: extensions
+ $XSCCCMD -I plan9 Fcntl.c
+
+dl_none.$O: extensions
+ $XSCCCMD -I plan9 dl_none.c
+
+Glob.c: archlib/Config.pm ext/File-Glob/Glob.xs
+ cd ext/File-Glob
+ $miniperl Makefile.PL # to write constants
+ cd $pwd
+ $miniperlxs ext/File-Glob/Glob.xs > $target
+ cp ext/File-Glob/bsd_glob.^(c h) $pwd
+ mkdir -p archlib/File
+ cp ext/File-Glob/Glob.pm archlib/File/Glob.pm
+
+ppport.h: archlib/Config.pm
+ if (test ! -f /bin/sh) bind -a /386/bin/ape /bin
+ # specify the list, otherwise suicide
+ $miniperl mkppport --list mkppport.lst
+
+Cwd.c: archlib/Config.pm dist/PathTools/Cwd.xs
+ $miniperlxs dist/PathTools/Cwd.xs > $target
+ cp dist/PathTools/Cwd.pm archlib
+ { cd dist/PathTools/lib; tar c . } | { mkdir -p archlib; cd archlib; tar x }
+
+IO.c: archlib/Config.pm dist/IO/IO.xs ppport.h
+ $miniperlxs dist/IO/IO.xs > $target
+ cp dist/IO/poll.^(c h) $pwd
+ cp dist/IO/IO.pm archlib
+ { cd dist/IO/lib; tar c . } | { mkdir -p archlib; cd archlib; tar x }
+
+dist/XSLoader/XSLoader.pm: archlib/Config.pm
+ cd dist/XSLoader
+ $miniperl XSLoader_pm.PL
+ cp XSLoader.pm $pwd/archlib
+
+ext/Errno/Errno.pm: perlnosocket
+ cd ext/Errno
+ $perl Makefile.PL
+ $perl Errno_pm.PL arch.txt
+ cp Errno.pm $pwd/archlib
+
+Socket.c: perlnosocket cpan/Socket/Socket.xs ext/Errno/Errno.pm
+ cd cpan/Socket
+ $perl Makefile.PL # to write const-xs.inc
+ cd $pwd
+ $perlxs cpan/Socket/Socket.xs > $target
+ cp cpan/Socket/Socket.pm archlib
+
+uni.data: archlib/Config.pm lib/unicore/mktables
+ $miniperl lib/unicore/mktables -C lib/unicore -makelist -p
+
+Normalize.c: archlib/Config.pm dist/Unicode-Normalize/Normalize.xs uni.data
+ $miniperl dist/Unicode-Normalize/mkheader
+ $miniperlxs dist/Unicode-Normalize/Normalize.xs > $target
+ mkdir -p archlib/Unicode
+ cp dist/Unicode-Normalize/Normalize.pm archlib/Unicode
+
+Dumper.c: perlnosocket dist/Data-Dumper/Dumper.xs
+ $perlxs dist/Data-Dumper/Dumper.xs > $target
+ mkdir -p archlib/Data
+ cp dist/Data-Dumper/Dumper.pm archlib/Data
+
+HiRes.c: archlib/Config.pm dist/Time-HiRes/HiRes.xs
+ cd dist/Time-HiRes
+ $miniperl Makefile.PL # to write const-xs.inc
+ cd $pwd
+ $miniperlxs dist/Time-HiRes/HiRes.xs > $target
+ mkdir -p archlib/Time
+ cp dist/Time-HiRes/HiRes.pm archlib/Time
+
+ListUtil.c: archlib/Config.pm cpan/Scalar-List-Utils/ListUtil.xs
+ cp cpan/Scalar-List-Utils/multicall.h $pwd
+ $miniperlxs cpan/Scalar-List-Utils/ListUtil.xs > $target
+ { cd cpan/Scalar-List-Utils/lib; tar c . } | { mkdir -p archlib; cd archlib; tar x }
+
+Storable.c: archlib/Config.pm dist/Storable/Storable.xs
+ $miniperlxs dist/Storable/Storable.xs > $target
+ cp dist/Storable/Storable.pm archlib
+
+Opcode.c: archlib/Config.pm ext/Opcode/Opcode.xs
+ $miniperlxs ext/Opcode/Opcode.xs > $target
+ cp ext/Opcode/^(Opcode ops)^.pm archlib
+
+Fcntl.c: archlib/Config.pm ext/Fcntl/Fcntl.xs
+ cd ext/Fcntl
+ $miniperl Makefile.PL # to write const-xs.inc
+ cd $pwd
+ $miniperlxs ext/Fcntl/Fcntl.xs > $target
+ cp ext/Fcntl/Fcntl.pm archlib
+
+POSIX.c: archlib/Config.pm ext/POSIX/POSIX.xs
+ cd ext/POSIX
+ $miniperl Makefile.PL # to write const-xs.inc
+ cd $pwd
+ $miniperlxs ext/POSIX/POSIX.xs > $target
+ cp ext/POSIX/lib/POSIX.pm archlib
+
+B.c: archlib/Config.pm ext/B/B.xs
+ cd ext/B
+ $miniperl Makefile.PL PERL_CORE^'='^1 # to write const-xs.inc
+ cd $pwd
+ $miniperlxs ext/B/B.xs > $target
+ cp ext/B/^(B O)^.pm archlib
+
+Peek.c: archlib/Config.pm ext/Devel-Peek/Peek.xs
+ $miniperlxs ext/Devel-Peek/Peek.xs > $target
+ cp ext/Devel-Peek/Peek.pm archlib
+
+attributes.c: archlib/Config.pm ext/attributes/attributes.xs
+ $miniperlxs ext/attributes/attributes.xs > $target
+ cp ext/attributes/attributes.pm archlib
+
+mro.c: archlib/Config.pm ext/mro/mro.xs
+ $miniperlxs ext/mro/mro.xs > $target
+ cp ext/mro/mro.pm archlib
+
+Util.c: archlib/Config.pm ext/Hash-Util/Util.xs
+ $miniperlxs ext/Hash-Util/Util.xs > $target
+ { cd ext/Hash-Util/lib; tar c . } | { cd archlib; tar x }
+
+FieldHash.c: archlib/Config.pm ext/Hash-Util-FieldHash/FieldHash.xs
+ $miniperlxs ext/Hash-Util-FieldHash/FieldHash.xs > $target
+ { cd ext/Hash-Util-FieldHash/lib; tar c . } | { cd archlib; tar x }
+
+re.c: archlib/Config.pm ext/re/re.xs
+ $miniperlxs ext/re/re.xs > $target
+ cp ext/re/re_^(comp top)^.h $pwd
+ cp ext/re/re.pm archlib
+
+re_comp.c: miniperl re.c regcomp.c
+ cp regcomp.c $target
+
+re_exec.c: miniperl re.c regexec.c
+ cp regexec.c $target
+
+dl_none.c: archlib/Config.pm ext/DynaLoader/dl_none.xs
+ cd ext/DynaLoader;
+ $miniperl DynaLoader_pm.PL
+ cd $pwd
+ $miniperlxs ext/DynaLoader/dl_none.xs > $target
+ cp ext/DynaLoader/DynaLoader.pm archlib
+
+preptest:Q: perl
+ # Bind the crap out of everything, as different tests expect different INCs
+ cp perl t/perl
+ cd t
+ mntpt=/$objtype/lib/perl
+ if (test ! -d $mntpt ) {
+ mkdir $mntpt
+ rmdir=1
+ }
+ ramfs -m $mntpt
+ mkdir -p $mntpt/5.32.0/site_perl
+ echo -n Binding directories
+ for (l in $pwd/lib $pwd/archlib $icpanlib $idistlib $iextlib ) {
+ if (test -d $l ) {
+ if (! ~ `{grep $l <{ns} >[1]/dev/null; echo $status} '') bind -a $l $mntpt/5.32.0/site_perl
+ echo -n .
+ }
+ }
+ bind $mntpt/5.32.0/site_perl $pwd/lib
+ echo done
+ echo Binding sh
+ if (! ~ `{grep /$objtype/bin/ape <{ns} >[1]/dev/null; echo $status} '') bind -a /$objtype/bin/ape /bin
+
+minitest:V: preptest
+ cd t
+ perl TEST $testlist
+ unmount $pwd/lib
+ unmount $mntpt
+ if (~ $rmdir 1) rm $mntpt
+ rm t/perl
+
+test:V: preptest
+ cd t
perl TEST `{ ls */*.t | comm -23 - ../plan9/exclude }
+ unmount $pwd/lib
+ unmount $mntpt
+ if (~ $rmdir 1) rm $mntpt
+ rm t/perl
-plan9.$O: config.h ./plan9/plan9.c
- cp ./plan9/plan9.c ./plan9.c
+plan9.$O: config.h plan9/plan9.c
+ cp plan9/plan9.c plan9.c
$CCCMD plan9.c
%.$O: config.h %.c
$CCCMD $stem.c
-$archlib/Config.pm: miniperl config.sh
- ./miniperl configpm $archlib/Config.pm
+archlib/Config.pm: config.sh
+ $miniperl make_patchnum.pl
+ $miniperl configpm
+ cp lib/Config.pm archlib/Config.pm
+ cp lib/Config_heavy.pl archlib/Config_heavy.pl
+ cp lib/Config_git.pl archlib/Config_git.pl
+
-config.sh: miniperl config.h
- ./miniperl ./plan9/genconfig.pl
+config.sh: miniperl
+ miniperl plan9/genconfig.pl $extensions $more_extensions
installall:V:
- for (objtype in 386 mips 68020 sparc) mk install
+ for (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) mk install
man:V: $perlpods pod/pod2man.PL perl
perl pod/pod2man.PL
@@ -143,8 +425,8 @@ 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 -rf $privlib/IO
+ rm -f *.$O config.sh $perllib config.h $perlshr perlmain.c perl miniperl git_version.h $ext_c $more_ext_c generate_uudmap uudmap.h bitcount.h mg_data.h plan9.c plan9ish.h math.h bsd_glob.^(c h) poll.^(c h) re_*.^(c h) uni.data multicall.h
+ rm -rf privlib archlib
deleteman:V:
rm -f $installman1dir/perl* $installman3dir/perl*
diff --git a/plan9/plan9.c b/plan9/plan9.c
index ebdac27dcb..02ef76c97b 100644
--- a/plan9/plan9.c
+++ b/plan9/plan9.c
@@ -1,20 +1,31 @@
#include "EXTERN.h"
#include "perl.h"
+#include "./plan9/math.h"
-/* Functions mentioned in <sys/socket.h> but not implemented */
+#define _PLAN9_SOURCE
+#include <u.h>
-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;
-}
+/** Function fpclassify(double) is required by sv.c, which was refactored in perl-5.24 era and uses other libraries to classify floating points. **/
-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;
+/* See /sys/src/lib/port/frexp.c */
+#define SHIFT 20
+
+int fpclassify(double d) {
+ FPdbleword x;
+
+ /* order matters: only isNaN can operate on NaN */
+ if ( isNaN(d) )
+ return FP_NAN;
+ else if ( isInf(d, 0) )
+ return FP_INFINITE;
+ else if ( d == 0 )
+ return FP_ZERO;
+
+ x.x = fabs(d);
+ return (x.hi >> SHIFT) ? FP_NORMAL : FP_SUBNORMAL;
}
+/* Functions mentioned in /sys/include/ape/sys/socket.h but not implemented */
int recvmsg(int a, struct msghdr *b, int c)
{
@@ -29,7 +40,7 @@ int sendmsg(int a, struct msghdr *b, int c)
}
-/* Functions mentioned in <netdb.h> but not implemented */
+/* Functions mentioned in /sys/include/ape/sys/netdb.h but not implemented */
struct netent *getnetbyname(const char *a)
{
croak("Function \"getnetbyname\" not implemented in this version of perl.");
@@ -112,23 +123,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/plan9ish.h b/plan9/plan9ish.h
index fa81502ac9..7fd8c7e5db 100644
--- a/plan9/plan9ish.h
+++ b/plan9/plan9ish.h
@@ -25,14 +25,14 @@
* getgrgid() routines are available to get group entries.
* The getgrent() has a separate definition, HAS_GETGRENT.
*/
-/*#define HAS_GROUP / **/
+/*#define HAS_GROUP /**/
/* HAS_PASSWD
* This symbol, if defined, indicates that the getpwnam() and
* getpwuid() routines are available to get password entries.
* The getpwent() has a separate definition, HAS_GETPWENT.
*/
-/*#define HAS_PASSWD / **/
+/*#define HAS_PASSWD /**/
#define HAS_KILL
#define HAS_WAIT
@@ -42,7 +42,7 @@
* to remove all versions of a file if unlink() is called. This is
* probably only relevant for VMS.
*/
-/* #define UNLINK_ALL_VERSIONS / **/
+/* #define UNLINK_ALL_VERSIONS /**/
/* PLAN9:
* This symbol, if defined, indicates that the program is running under
diff --git a/plan9/setup.rc b/plan9/setup.rc
index dd96c1f9c7..d300966bde 100644..100755
--- a/plan9/setup.rc
+++ b/plan9/setup.rc
@@ -1,51 +1,59 @@
#!/bin/rc
-# This is an rc shell script which unpacks the perl distribution, builds
-# 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:
+# This is an rc shell script puts files where they belong and does a bit of
+# patching in order not to modify some perl core code which might impact other
+# OSes. To use, just run it from within the plan9 subdirectory with the
+# appropriate permissions.
+# First modified 6/30/96 by:
# Luther Huffman, Strategic Computer Solutions, Inc., lutherh@stratcom.com
+# Last modified May 2020 by:
+# David Romano, unobe@cpan.org
+# Get the Perl version information
awk -f versnum ../patchlevel.h
. buildinfo
-builddir = `{ cd .. ; pwd }
+
+builddir = `{ cd .. ; pwd }
+
+# 'typestr' is used by /sys/src/cmd/cc/lex.c, but not sure when/if it is ever used.
+# Patch sv.c from afar, which uses 'typestr' as a variable name, and uses bit-fields.
+# Also patch some other things:
+status=`{cd $builddir; ape/patch -p1 <plan9/9front.patch}
+
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
-sitelib=$privlib/site_perl
-#Build source directory
-if (test ! -d /sys/src/cmd/perl) mkdir /sys/src/cmd/perl
-if (test ! -d $sourcedir) mkdir $sourcedir
+# Update some files
+cp plan9.c plan9ish.h mkfile $builddir
-#Populate source directory
-echo Building source directories ...
-{cd $builddir ; tar c .} | { cd $sourcedir ; tar x}
-cp $builddir/plan9/plan9.c $builddir/plan9/plan9ish.h $builddir/plan9/mkfile $sourcedir
-cd $sourcedir/lib ; rm -rf *
-
-#Build library directories
+exit;
+# Why is this done during setup and not during 'mk install'?
+# Build library directories
echo Building library directories ...
+privroot=/sys/lib/perl
+privlib=$privroot/$p9pvers
+sitelib=$privlib/site_perl
+
+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
if (test ! -d $arpalib) mkdir $arpalib
- cp $builddir/*.h $builddir/plan9/*.h $corelib
- cp $builddir/plan9/arpa/*.h $arpalib
+ cp $builddir/*.h *.h $corelib
+ cp arpa/*.h $arpalib
}
-#Populate library directories
+# Populate library directories
{cd $builddir/lib ; tar c . } | {cd $privlib ; tar x }
diff --git a/plan9/uninstall.rc b/plan9/uninstall.rc
new file mode 100755
index 0000000000..503991a684
--- /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";
}