summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burt <isis!aburt>1988-01-23 14:57:57 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1988-01-23 14:57:57 +0000
commit135863df38bea8d721a115b5d13e08b816104784 (patch)
treed5947cc711fcade4b0dd8528ee65a70a5d5d189d
parent36ce8bec6e5bbc05c8d60ee17f105fc8b751cada (diff)
downloadperl-135863df38bea8d721a115b5d13e08b816104784.tar.gz
perl 1.0 patch 2: Various portability fixes.
Some things didn't work right on System V and Pyramids.
-rwxr-xr-xConfigure43
-rw-r--r--Makefile.SH9
-rw-r--r--arg.c10
-rw-r--r--malloc.c16
-rw-r--r--patchlevel.h2
-rw-r--r--perl.h26
-rw-r--r--perly.c7
-rw-r--r--search.c10
-rw-r--r--t/TEST23
-rw-r--r--t/op.time6
10 files changed, 124 insertions, 28 deletions
diff --git a/Configure b/Configure
index 66d8a6eae5..7327e1ce7e 100755
--- a/Configure
+++ b/Configure
@@ -8,7 +8,7 @@
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#
-# $Header: Configure,v 1.0.1.1 88/01/21 21:21:47 root Exp $
+# $Header: Configure,v 1.0.1.2 88/01/24 03:51:55 root Exp $
#
# Yes, you may rip this off to use in other distribution packages.
# (Note: this Configure script was generated automatically. Rather than
@@ -68,10 +68,13 @@ cc=''
contains=''
cpp=''
cppminus=''
+d_bcopy=''
d_charsprf=''
d_index=''
+d_statblks=''
d_stdstdio=''
d_strctcpy=''
+d_tminsys=''
d_vfork=''
d_voidsig=''
libc=''
@@ -638,6 +641,16 @@ else
fi
rm -f testcpp.c testcpp.out
+: see if bcopy exists
+echo " "
+if $contains bcopy libc.list >/dev/null 2>&1; then
+ echo 'bcopy() found.'
+ d_bcopy="$define"
+else
+ echo 'bcopy() not found.'
+ d_bcopy="$undef"
+fi
+
: see if sprintf is declared as int or pointer to char
echo " "
if $contains 'char.*sprintf' /usr/include/stdio.h >/dev/null 2>&1 ; then
@@ -671,6 +684,21 @@ else
esac
fi
+: see if stat knows about block sizes
+echo " "
+if $contains 'st_blocks;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
+ if $contains 'st_blksize;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
+ echo "Your stat knows about block sizes."
+ d_statblks="$define"
+ else
+ echo "Your stat doesn't know about block sizes."
+ d_statblks="$undef"
+ fi
+else
+ echo "Your stat doesn't know about block sizes."
+ d_statblks="$undef"
+fi
+
: see if stdio is really std
echo " "
if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
@@ -708,6 +736,16 @@ else
fi
$rm -f try.*
+: see if struct tm is defined in sys/time.h
+echo " "
+if $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then
+ echo "You have struct tm defined in <time.h> rather than <sys/time.h>."
+ d_tminsys="$undef"
+else
+ echo "You have struct tm defined in <sys/time.h> rather than <time.h>."
+ d_tminsys="$define"
+fi
+
: see if there is a vfork
echo " "
if $contains vfork libc.list >/dev/null 2>&1 ; then
@@ -1260,10 +1298,13 @@ cc='$cc'
contains='$contains'
cpp='$cpp'
cppminus='$cppminus'
+d_bcopy='$d_bcopy'
d_charsprf='$d_charsprf'
d_index='$d_index'
+d_statblks='$d_statblks'
d_stdstdio='$d_stdstdio'
d_strctcpy='$d_strctcpy'
+d_tminsys='$d_tminsys'
d_vfork='$d_vfork'
d_voidsig='$d_voidsig'
libc='$libc'
diff --git a/Makefile.SH b/Makefile.SH
index f45bb3fe84..7814bd92e0 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -14,16 +14,15 @@ case "$0" in
esac
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
-# $Header: Makefile.SH,v 1.0 87/12/18 16:11:50 root Exp $
+# $Header: Makefile.SH,v 1.0.1.1 88/01/24 03:55:18 root Exp $
#
# $Log: Makefile.SH,v $
-# Revision 1.0 87/12/18 16:11:50 root
-# Initial revision
+# Revision 1.0.1.1 88/01/24 03:55:18 root
+# patch 2: remove extra Log lines.
#
-# Revision 1.0 87/12/18 16:01:07 root
+# Revision 1.0 87/12/18 16:11:50 root
# Initial revision
#
-#
CC = $cc
bin = $bin
diff --git a/arg.c b/arg.c
index 8aceb66fee..1423d91a42 100644
--- a/arg.c
+++ b/arg.c
@@ -1,6 +1,9 @@
-/* $Header: arg.c,v 1.0.1.1 88/01/21 21:27:10 root Exp $
+/* $Header: arg.c,v 1.0.1.2 88/01/24 03:52:34 root Exp $
*
* $Log: arg.c,v $
+ * Revision 1.0.1.2 88/01/24 03:52:34 root
+ * patch 2: added STATBLKS dependencies.
+ *
* Revision 1.0.1.1 88/01/21 21:27:10 root
* Now defines signal return values correctly using VOIDSIG.
*
@@ -542,8 +545,13 @@ STR ***retary;
apush(ary,str_nmake((double)statbuf.st_atime));
apush(ary,str_nmake((double)statbuf.st_mtime));
apush(ary,str_nmake((double)statbuf.st_ctime));
+#ifdef STATBLOCKS
apush(ary,str_nmake((double)statbuf.st_blksize));
apush(ary,str_nmake((double)statbuf.st_blocks));
+#else
+ apush(ary,str_make("");
+ apush(ary,str_make("");
+#endif
}
sarg = (STR**)safemalloc((max+2)*sizeof(STR*));
sarg[0] = Nullstr;
diff --git a/malloc.c b/malloc.c
index 17c3b27930..6a6ceea549 100644
--- a/malloc.c
+++ b/malloc.c
@@ -1,6 +1,9 @@
-/* $Header: malloc.c,v 1.0 87/12/18 13:05:35 root Exp $
+/* $Header: malloc.c,v 1.0.1.1 88/01/24 03:53:23 root Exp $
*
* $Log: malloc.c,v $
+ * Revision 1.0.1.1 88/01/24 03:53:23 root
+ * patch 2: made depend on perl.h.
+ *
* Revision 1.0 87/12/18 13:05:35 root
* Initial revision
*
@@ -24,7 +27,16 @@ static char sccsid[] = "@(#)malloc.c 4.3 (Berkeley) 9/16/83";
* but bombs when it runs out.
*/
-#include <sys/types.h>
+#include "EXTERN.h"
+#include "handy.h"
+#include "search.h"
+#include "perl.h"
+
+/* I don't much care whether these are defined in sys/types.h--LAW */
+
+#define u_char unsigned char
+#define u_int unsigned int
+#define u_short unsigned short
#define NULL 0
diff --git a/patchlevel.h b/patchlevel.h
index 110c86f392..e3d7670bc6 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -1 +1 @@
-#define PATCHLEVEL 1
+#define PATCHLEVEL 2
diff --git a/perl.h b/perl.h
index ce2d2abf29..751b8cdc61 100644
--- a/perl.h
+++ b/perl.h
@@ -1,6 +1,9 @@
-/* $Header: perl.h,v 1.0.1.1 88/01/21 21:29:23 root Exp $
+/* $Header: perl.h,v 1.0.1.2 88/01/24 03:53:47 root Exp $
*
* $Log: perl.h,v $
+ * Revision 1.0.1.2 88/01/24 03:53:47 root
+ * patch 2: hid str_peek() in #ifdef DEBUGGING.
+ *
* Revision 1.0.1.1 88/01/21 21:29:23 root
* No longer defines STDSTDIO--gets it from config.h now.
*
@@ -24,7 +27,13 @@
#include <setjmp.h>
#include <sys/types.h>
#include <sys/stat.h>
+
+#ifdef TMINSYS
+#include <sys/time.h>
+#else
#include <time.h>
+#endif
+
#include <sys/times.h>
typedef struct arg ARG;
@@ -46,6 +55,12 @@ typedef struct htbl HASH;
#include "array.h"
#include "hash.h"
+#ifdef CHARSPRINTF
+ char *sprintf();
+#else
+ int sprintf();
+#endif
+
/* A string is TRUE if not "" or "0". */
#define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
EXT char *Yes INIT("1");
@@ -53,7 +68,10 @@ EXT char *No INIT("");
#define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
+#ifdef DEBUGGING
#define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
+#endif
+
#define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
#define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
EXT STR *Str;
@@ -185,12 +203,6 @@ double atof();
long time();
struct tm *gmtime(), *localtime();
-#ifdef CHARSPRINTF
- char *sprintf();
-#else
- int sprintf();
-#endif
-
#ifdef EUNICE
#define UNLINK(f) while (unlink(f) >= 0)
#else
diff --git a/perly.c b/perly.c
index 641971b401..dfd83d9b46 100644
--- a/perly.c
+++ b/perly.c
@@ -1,6 +1,9 @@
-char rcsid[] = "$Header: perly.c,v 1.0.1.1 88/01/21 21:25:57 root Exp $";
+char rcsid[] = "$Header: perly.c,v 1.0.1.2 88/01/24 00:06:03 root Exp $";
/*
* $Log: perly.c,v $
+ * Revision 1.0.1.2 88/01/24 00:06:03 root
+ * patch 2: s/(abc)/\1/ grandfathering didn't work right.
+ *
* Revision 1.0.1.1 88/01/21 21:25:57 root
* Now uses CPP and CPPMINUS symbols from config.h.
*
@@ -1646,7 +1649,7 @@ register char *s;
*d <<= 3;
*d += *s++ - '0';
}
- else if (!index('`"',term)) { /* oops, a subpattern */
+ else if (!index("`\"",term)) { /* oops, a subpattern */
s--;
goto defchar;
}
diff --git a/search.c b/search.c
index 79712a1359..b812ee1aa5 100644
--- a/search.c
+++ b/search.c
@@ -1,6 +1,9 @@
-/* $Header: search.c,v 1.0 87/12/18 13:05:59 root Exp $
+/* $Header: search.c,v 1.0.1.1 88/01/24 03:55:05 root Exp $
*
* $Log: search.c,v $
+ * Revision 1.0.1.1 88/01/24 03:55:05 root
+ * patch 2: made depend on perl.h.
+ *
* Revision 1.0 87/12/18 13:05:59 root
* Initial revision
*
@@ -8,14 +11,13 @@
/* string search routines */
-#include <stdio.h>
-#include <ctype.h>
-
#include "EXTERN.h"
#include "handy.h"
#include "util.h"
#include "INTERN.h"
#include "search.h"
+#include "EXTERN.h"
+#include "perl.h"
#define VERBOSE
#define FLUSH
diff --git a/t/TEST b/t/TEST
index 11c48e2908..451bbe6be6 100644
--- a/t/TEST
+++ b/t/TEST
@@ -1,6 +1,6 @@
#!./perl
-# $Header: TEST,v 1.0 87/12/18 13:11:34 root Exp $
+# $Header: TEST,v 1.0.1.1 88/01/24 03:55:39 root Exp $
# This is written in a peculiar style, since we're trying to avoid
# most of the constructs we'll be testing for.
@@ -14,10 +14,29 @@ if ($ARGV[0] eq '') {
@ARGV = split(/[ \n]/,`echo base.* comp.* cmd.* io.* op.*`);
}
+open(config,"../config.sh");
+while (<config>) {
+ if (/sharpbang='(.*)'/) {
+ $sharpbang = ($1 eq '#!');
+ last;
+ }
+}
$bad = 0;
while ($test = shift) {
print "$test...";
- open(results,"$test|") || (print "can't run.\n");
+ if ($sharpbang) {
+ open(results,"$test|") || (print "can't run.\n");
+ } else {
+ open(script,"$test") || die "Can't run $test";
+ $_ = <script>;
+ close(script);
+ if (/#!..perl(.*)/) {
+ $switch = $1;
+ } else {
+ $switch = '';
+ }
+ open(results,"./perl$switch $test|") || (print "can't run.\n");
+ }
$ok = 0;
while (<results>) {
if ($verbose) {
diff --git a/t/op.time b/t/op.time
index 1d92bac50f..87ef2605d1 100644
--- a/t/op.time
+++ b/t/op.time
@@ -1,6 +1,6 @@
#!./perl
-# $Header: op.time,v 1.0 87/12/18 13:14:33 root Exp $
+# $Header: op.time,v 1.0.1.1 88/01/24 03:56:09 root Exp $
print "1..5\n";
@@ -24,7 +24,7 @@ if ($i >= 200000) {print "ok 2\n";} else {print "not ok 2\n";}
($xsec,$foo) = localtime($now);
$localyday = $yday;
-if ($sec != $xsec && $yday && $wday && $year)
+if ($sec != $xsec && $mday && $year)
{print "ok 3\n";}
else
{print "not ok 3\n";}
@@ -32,7 +32,7 @@ else
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg);
($xsec,$foo) = localtime($now);
-if ($sec != $xsec && $yday && $wday && $year)
+if ($sec != $xsec && $mday && $year)
{print "ok 4\n";}
else
{print "not ok 4\n";}