# 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
d_varargs=''
d_vfork=''
d_voidsig=''
+d_volatile=''
d_vprintf=''
d_charvspr=''
d_wait4=''
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
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='#!'
echo "#! /bin/echo hi" > try
$eunicefix try
chmod +x try
- try > today
+ ./try > today
if test -s today; then
echo "It does."
sharpbang='#! '
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."
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
}
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.)";;
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
$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
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";;
: 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"
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
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"
}
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...)"
}
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...)"
: 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
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
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'
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
#
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:
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
-/* $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
*
* 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
*
#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
"LAELEM",
"LHELEM",
"LOCAL",
- "UNUSED",
+ "PIPE",
"FILENO",
"GHBYNAME",
"GHBYADDR",
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 */
+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.
local(*domain) = @_;
shift(@_);
@cmp = @_;
+ local($[) = 0;
foreach $name (@_) {
@extra = split(//,$name);
$abbrev = shift(@extra);
-#define PATCHLEVEL 8
+#define PATCHLEVEL 9
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
#
$(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
-/* $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
*
* 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
*
#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"
%{
-/* $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
*
* 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
*
{ $$ = 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
{ $$ = oper1(OUMINUS,$2); }
| '+' term %prec UMINUS
{ $$ = oper1(OUPLUS,$2); }
- | '(' expr ')'
+ | '(' cond ')'
{ $$ = oper1(OPAREN,$2); }
| GETLINE
{ $$ = oper0(OGETLINE); }