diff options
-rwxr-xr-x | Configure | 57 | ||||
-rw-r--r-- | Makefile.SH | 7 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | arg.h | 11 | ||||
-rw-r--r-- | eg/README | 4 | ||||
-rw-r--r-- | lib/abbrev.pl | 1 | ||||
-rw-r--r-- | patchlevel.h | 2 | ||||
-rw-r--r-- | x2p/Makefile.SH | 7 | ||||
-rw-r--r-- | x2p/a2p.h | 11 | ||||
-rw-r--r-- | x2p/a2p.y | 27 |
10 files changed, 86 insertions, 46 deletions
@@ -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 3.0.1.4 89/12/21 18:57:00 lwall Locked $ +# $Header: Configure,v 3.0.1.5 90/02/28 16:17:50 lwall Locked $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than @@ -154,6 +154,7 @@ d_syscall='' d_varargs='' d_vfork='' d_voidsig='' +d_volatile='' d_vprintf='' d_charvspr='' d_wait4='' @@ -256,7 +257,7 @@ attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__" pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb" d_newshome="/usr/NeWS" defvoidused=7 -libswanted="net_s net nsl_s nsl socket nm ndir ndbm dbm sun bsd x c_s" +libswanted="net_s net nsl_s nsl socket nm ndir ndbm dbm sun bsd BSD x c_s PW" inclwanted='/usr/netinclude /usr/include/sun /usr/include/bsd /usr/include/lan' : some greps do not return status, grrr. echo "grimblepritz" >grimble @@ -291,7 +292,7 @@ if sh -c '#' >/dev/null 2>&1 ; then echo "#!/bin/echo hi" > try $eunicefix try chmod +x try - try > today + ./try > today if $contains hi today >/dev/null 2>&1; then echo "It does." sharpbang='#!' @@ -299,7 +300,7 @@ if sh -c '#' >/dev/null 2>&1 ; then echo "#! /bin/echo hi" > try $eunicefix try chmod +x try - try > today + ./try > today if test -s today; then echo "It does." sharpbang='#! ' @@ -332,7 +333,7 @@ EOSS chmod +x try $eunicefix try -if try; then +if ./try; then echo "Yup, it does." else echo "Nope. You may have to fix up the shell scripts to make sure sh runs them." @@ -1043,6 +1044,12 @@ case "$optimize" in esac ;; esac +if $contains 'LANGUAGE_C' /usr/include/signal.h >/dev/null 2>&1; then + case "$dflt" in + *LANGUAGE_C*);; + *) dflt="$dflt -DLANGUAGE_C";; + esac +fi case "$dflt" in '') dflt=none;; esac @@ -1208,7 +1215,7 @@ main() } EOCP if $cc try.c -o try >/dev/null 2>&1 ; then - dflt=`try` + dflt=`./try` case "$dflt" in ????|????????) echo "(The test program ran ok.)";; *) echo "(The test program didn't run right for some reason.)";; @@ -1422,7 +1429,7 @@ EOM fi fi echo " " -set $libc $libnames +set `echo $libc $libnames | tr ' ' '\012' | sort | uniq` $echo $n "Extracting names from $* for later perusal...$c" nm $* 2>/dev/null >libc.tmp $sed -n -e 's/^.* [AT] *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list @@ -1435,6 +1442,8 @@ else $contains '^printf$' libc.list >/dev/null 2>&1 || \ $sed -n -e 's/^_//' \ -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list + $contains '^printf$' libc.list >/dev/null 2>&1 || \ + $sed -n -e 's/^.*|FUNC |GLOB .*|//p' <libc.tmp >libc.list if $contains '^printf$' libc.list >/dev/null 2>&1; then echo "done" else @@ -1605,7 +1614,7 @@ until a better solution is devised for the kernel problem. EOM rp="Do you want to do setuid/setgid emulation? [$dflt]" -echo $n "$rp $c" +$echo $n "$rp $c" . myread case "$ans" in '') $ans="$dflt";; @@ -1913,7 +1922,7 @@ fi : see if stdio is really std echo " " -if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then +if $contains 'char.*_ptr.*;' /usr/include/stdio.h >/dev/null 2>&1 ; then if $contains '_cnt;' /usr/include/stdio.h >/dev/null 2>&1 ; then echo "Your stdio is pretty std." d_stdstdio="$define" @@ -2052,6 +2061,25 @@ else fi rm -f $$.tmp +: check for volatile keyword +echo " " +echo 'Checking to see if your C compiler knows about "volatile"...' +$cat >try.c <<'EOCP' +main() +{ + volatile int foo; + foo = foo; +} +EOCP +if $cc -c try.c >/dev/null 2>&1 ; then + d_volatile="$define" + echo "Yup, it does." +else + d_volatile="$undef" + echo "Nope, it doesn't." +fi +$rm -f try.* + : see if there is a wait4 set wait4 d_wait4 eval $inlibc @@ -2216,7 +2244,7 @@ else echo "No sys/ndir.h found." fi -: see if this is DG/UX with a funky utime.h +: see if we should include utime.h echo " " if $test -r /usr/include/utime.h ; then i_utime="$define" @@ -2259,7 +2287,7 @@ main() } EOCP if $cc try.c -o try >/dev/null 2>&1 ; then - dflt=`try` + dflt=`./try` else dflt='4' echo "(I can't seem to compile the test program. Guessing...)" @@ -2317,7 +2345,7 @@ main() } EOCP if $cc try.c -o try >/dev/null 2>&1 ; then - dflt=`try` + dflt=`./try` else dflt='?' echo "(I can't seem to compile the test program...)" @@ -2376,7 +2404,7 @@ echo "Signals are: $sig_name" : see what type of char stdio uses. echo " " -if $contains 'unsigned.*char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then +if $contains 'unsigned.*char.*_ptr.*;' /usr/include/stdio.h >/dev/null 2>&1 ; then echo "Your stdio uses unsigned chars." stdchar="unsigned char" else @@ -2444,7 +2472,7 @@ case "$yacc" in esac cont=true echo " " -rp="Which compiler compiler (yacc or bison) will you use? [$dflt]" +rp="Which compiler compiler (yacc or bison -y) will you use? [$dflt]" $echo $n "$rp $c" . myread case "$ans" in @@ -2583,6 +2611,7 @@ d_syscall='$d_syscall' d_varargs='$d_varargs' d_vfork='$d_vfork' d_voidsig='$d_voidsig' +d_volatile='$d_volatile' d_vprintf='$d_vprintf' d_charvspr='$d_charvspr' d_wait4='$d_wait4' diff --git a/Makefile.SH b/Makefile.SH index 73890cbce1..63d326d301 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -25,9 +25,12 @@ esac echo "Extracting Makefile (with variable substitutions)" cat >Makefile <<!GROK!THIS! -# $Header: Makefile.SH,v 3.0.1.3 89/12/21 19:09:26 lwall Locked $ +# $Header: Makefile.SH,v 3.0.1.4 90/02/28 16:19:43 lwall Locked $ # # $Log: Makefile.SH,v $ +# Revision 3.0.1.4 90/02/28 16:19:43 lwall +# patch9: extraneous $ on suidperl in Makefile +# # Revision 3.0.1.3 89/12/21 19:09:26 lwall # patch7: Configure now lets you pick between yacc or bison # @@ -309,7 +312,7 @@ fi cd x2p; $(MAKE) install clean: - rm -f *.o all perl taintperl $suidperl perl.man + rm -f *.o all perl taintperl suidperl perl.man cd x2p; $(MAKE) clean realclean: @@ -78,8 +78,13 @@ Installation AIX/RT may need a -a switch and -DCRIPPLED_CC. SGI machines may need -Ddouble="long float". Ultrix (2.3) may need to hand assemble teval.s with a -J switch. + Ultrix on MIPS machines may need -DLANGUAGE_C. SCO Xenix may need -m25000 for yacc. Genix needs to use libc rather than libc_s, or #undef VARARGS. + NCR Tower 32 (OS 2.01.01) may need -W2,-Sl,2000 and #undef MKDIR. + Machines with half-implemented dbm routines will need to #undef ODBM & NDBM. + C's that don't try to restore registers on longjmp() may need -DJMPCLOBBER. + (Try this if you get random glitches.) 5) make test @@ -1,4 +1,4 @@ -/* $Header: arg.h,v 3.0.1.2 89/12/21 19:13:14 lwall Locked $ +/* $Header: arg.h,v 3.0.1.3 90/02/28 16:21:55 lwall Locked $ * * Copyright (c) 1989, Larry Wall * @@ -6,6 +6,9 @@ * as specified in the README file that comes with the perl 3.0 kit. * * $Log: arg.h,v $ + * Revision 3.0.1.3 90/02/28 16:21:55 lwall + * patch9: added pipe function + * * Revision 3.0.1.2 89/12/21 19:13:14 lwall * patch7: send() didn't allow a TO argument * @@ -211,7 +214,7 @@ #define O_LAELEM 191 #define O_LHELEM 192 #define O_LOCAL 193 -#define O_UNUSED 194 +#define O_PIPE 194 #define O_FILENO 195 #define O_GHBYNAME 196 #define O_GHBYADDR 197 @@ -458,7 +461,7 @@ char *opname[] = { "LAELEM", "LHELEM", "LOCAL", - "UNUSED", + "PIPE", "FILENO", "GHBYNAME", "GHBYADDR", @@ -832,7 +835,7 @@ char opargs[MAXO+1] = { A(0,1,0), /* LAELEM */ A(0,1,0), /* LHELEM */ A(1,0,0), /* LOCAL */ - A(0,0,0), /* UNUSED */ + A(0,0,0), /* PIPE */ A(1,0,0), /* FILENO */ A(1,0,0), /* GHBYNAME */ A(1,1,0), /* GHBYADDR */ @@ -1,3 +1,7 @@ +Although supplied with the perl package, the perl scripts in this eg +directory and its subdirectories are placed in the public domain, and +you may do anything with them that you wish. + This stuff is supplied on an as-is basis--little attempt has been made to make any of it portable. It's mostly here to give you an idea of what perl code looks like, and what tricks and idioms are used. diff --git a/lib/abbrev.pl b/lib/abbrev.pl index 5859a7be48..c233d4af7e 100644 --- a/lib/abbrev.pl +++ b/lib/abbrev.pl @@ -10,6 +10,7 @@ sub main'abbrev { local(*domain) = @_; shift(@_); @cmp = @_; + local($[) = 0; foreach $name (@_) { @extra = split(//,$name); $abbrev = shift(@extra); diff --git a/patchlevel.h b/patchlevel.h index a6997a9a35..618bca4808 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1 +1 @@ -#define PATCHLEVEL 8 +#define PATCHLEVEL 9 diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH index fec6548acf..118c28a2a6 100644 --- a/x2p/Makefile.SH +++ b/x2p/Makefile.SH @@ -18,9 +18,12 @@ case "$mallocsrc" in esac echo "Extracting x2p/Makefile (with variable substitutions)" cat >Makefile <<!GROK!THIS! -# $Header: Makefile.SH,v 3.0.1.3 89/12/21 20:29:00 lwall Locked $ +# $Header: Makefile.SH,v 3.0.1.4 90/03/01 10:28:09 lwall Locked $ # # $Log: Makefile.SH,v $ +# Revision 3.0.1.4 90/03/01 10:28:09 lwall +# patch9: a2p didn't allow logical expressions everywhere it should +# # Revision 3.0.1.3 89/12/21 20:29:00 lwall # patch7: Configure now lets you pick between yacc or bison # @@ -95,7 +98,7 @@ a2p: $(obj) a2p.o $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p a2p.c: a2p.y - @ echo Expect 208 shift/reduce conflicts... + @ echo Expect 232 shift/reduce conflicts... $(YACC) a2p.y mv y.tab.c a2p.c @@ -1,4 +1,4 @@ -/* $Header: a2p.h,v 3.0.1.2 89/12/21 20:30:29 lwall Locked $ +/* $Header: a2p.h,v 3.0.1.3 90/03/01 10:29:29 lwall Locked $ * * Copyright (c) 1989, Larry Wall * @@ -6,6 +6,9 @@ * as specified in the README file that comes with the perl 3.0 kit. * * $Log: a2p.h,v $ + * Revision 3.0.1.3 90/03/01 10:29:29 lwall + * patch9: a2p.h had bzero() definition depending on BCOPY + * * Revision 3.0.1.2 89/12/21 20:30:29 lwall * patch7: arranged so a2p has a chance of running on a 286 * @@ -21,8 +24,10 @@ #include "../config.h" #ifndef BCOPY -# define bcopy(s1,s2,l) memcpy(s2,s1,l); -# define bzero(s,l) memset(s,0,l); +# define bcopy(s1,s2,l) memcpy(s2,s1,l) +#endif +#ifndef BZERO +# define bzero(s,l) memset(s,0,l) #endif #include "handy.h" @@ -1,5 +1,5 @@ %{ -/* $Header: a2p.y,v 3.0 89/10/18 15:34:29 lwall Locked $ +/* $Header: a2p.y,v 3.0.1.1 90/03/01 10:30:08 lwall Locked $ * * Copyright (c) 1989, Larry Wall * @@ -7,6 +7,9 @@ * as specified in the README file that comes with the perl 3.0 kit. * * $Log: a2p.y,v $ + * Revision 3.0.1.1 90/03/01 10:30:08 lwall + * patch9: a2p didn't allow logical expressions everywhere it should + * * Revision 3.0 89/10/18 15:34:29 lwall * 3.0 baseline * @@ -87,28 +90,12 @@ arg_list: expr_list { $$ = rememberargs($$); } ; -patpat : pat +patpat : cond { $$ = oper1(OPAT,$1); } - | pat ',' pat + | cond ',' cond { $$ = oper2(ORANGE,$1,$3); } ; -pat : match - | rel - | compound_pat - ; - -compound_pat - : '(' compound_pat ')' - { $$ = oper1(OPPAREN,$2); } - | pat ANDAND maybe pat - { $$ = oper3(OPANDAND,$1,$3,$4); } - | pat OROR maybe pat - { $$ = oper3(OPOROR,$1,$3,$4); } - | NOT pat - { $$ = oper1(OPNOT,$2); } - ; - cond : expr | match | rel @@ -193,7 +180,7 @@ term : variable { $$ = oper1(OUMINUS,$2); } | '+' term %prec UMINUS { $$ = oper1(OUPLUS,$2); } - | '(' expr ')' + | '(' cond ')' { $$ = oper1(OPAREN,$2); } | GETLINE { $$ = oper0(OGETLINE); } |