install: all
./perl installperl
-!NO!SUBS!
-
-: Only print out the rules for running byacc if the user _has_ byacc.
-: Otherwise, comment them out. Users who really know what they are
-: doing can uncomment them and run yacc or bison or whatever.
-case "$d_byacc" in
-'define')
- comment1=''
- comment2='#' ;;
-*) comment1='#'
- comment2='' ;;
-esac
-
-$spitshell >>Makefile <<!GROK!THIS!
-
-perly.h: perly.c
- @ echo Dummy dependency for dumb parallel make
- touch perly.h
# I now supply perly.c with the kits, so the following section is
-# used only if you have byacc.
+# used only if you force byacc to run by saying
+# make run_byacc
+# Since we patch up the byacc output, the perly.fixer script needs
+# to run with precisely the same version of byacc as I use. You
+# normally shouldn't remake perly.[ch].
+
+run_byacc:
+ @ echo 'Expect' 109 shift/reduce and 1 reduce/reduce conflict
+ $(BYACC) -d perly.y
+ sh $(shellflags) ./perly.fixer y.tab.c perly.c
+ mv y.tab.h perly.h
+ echo 'extern YYSTYPE yylval;' >>perly.h
+
+# We don't want to regenerate perly.c and perly.h, but they might
+# appear out-of-date after a patch is applied or a new distribution is
+# made.
+perly.c: perly.y
+ - touch perly.c
+
+perly.h: perly.y
+ - touch perly.h
-${comment1}perly.c: perly.y perly.c.diff
-${comment1} @ echo 'Expect' 109 shift/reduce and 1 reduce/reduce conflict
-${comment1} \$(BYACC) -d perly.y
-${comment1} sh \$(shellflags) ./perly.fixer y.tab.c perly.c
-${comment1} mv y.tab.h perly.h
-${comment1} echo 'extern YYSTYPE yylval;' >>perly.h
-
-# This version is used if you do not have byacc.
-${comment2}perly.c: perly.y
-${comment2} touch perly.c
-
-!GROK!THIS!
-
-$spitshell >>Makefile <<'!NO!SUBS!'
# Extensions:
# Names added to $(dynamic_ext) or $(static_ext) will automatically
# get built. There should ordinarily be no need to change any of
# When done, touch perlmain.c so that it doesn't get remade each time.
depend: makedepend
- - test -f perly.h || cp /dev/null perly.h
./makedepend
- - test -s perly.h || /bin/rm -f perly.h
- test -s perlmain.c && touch perlmain.c
cd x2p; $(MAKE) depend
if (delaymagic & DM_UID) {
#ifdef HAS_SETRESUID
(void)setresuid(uid,euid,(Uid_t)-1);
-#else /* not HAS_SETRESUID */
-#ifdef HAS_SETREUID
+#else
+# ifdef HAS_SETREUID
(void)setreuid(uid,euid);
-#else /* not HAS_SETREUID */
-#ifdef HAS_SETRUID
+# else
+# ifdef HAS_SETRUID
if ((delaymagic & DM_UID) == DM_RUID) {
(void)setruid(uid);
delaymagic &= ~DM_RUID;
}
-#endif /* HAS_SETRUID */
-#endif /* HAS_SETRESUID */
-#ifdef HAS_SETEUID
+# endif /* HAS_SETRUID */
+# ifdef HAS_SETEUID
if ((delaymagic & DM_UID) == DM_EUID) {
(void)seteuid(uid);
delaymagic &= ~DM_EUID;
}
-#endif /* HAS_SETEUID */
+# endif /* HAS_SETEUID */
if (delaymagic & DM_UID) {
if (uid != euid)
DIE("No setreuid available");
(void)setuid(uid);
}
-#endif /* not HAS_SETREUID */
+# endif /* HAS_SETREUID */
+#endif /* HAS_SETRESUID */
uid = (int)getuid();
euid = (int)geteuid();
}
if (delaymagic & DM_GID) {
#ifdef HAS_SETRESGID
(void)setresgid(gid,egid,(Gid_t)-1);
-#else /* not HAS_SETREGID */
-#ifdef HAS_SETREGID
+#else
+# ifdef HAS_SETREGID
(void)setregid(gid,egid);
-#else /* not HAS_SETREGID */
-#endif /* not HAS_SETRESGID */
-#ifdef HAS_SETRGID
+# else
+# ifdef HAS_SETRGID
if ((delaymagic & DM_GID) == DM_RGID) {
(void)setrgid(gid);
delaymagic &= ~DM_RGID;
}
-#endif /* HAS_SETRGID */
-#ifdef HAS_SETRESGID
- (void)setresgid(gid,egid,(Gid_t)-1);
-#else /* not HAS_SETREGID */
-#ifdef HAS_SETEGID
+# endif /* HAS_SETRGID */
+# ifdef HAS_SETEGID
if ((delaymagic & DM_GID) == DM_EGID) {
(void)setegid(gid);
delaymagic &= ~DM_EGID;
}
-#endif /* HAS_SETEGID */
+# endif /* HAS_SETEGID */
if (delaymagic & DM_GID) {
if (gid != egid)
DIE("No setregid available");
(void)setgid(gid);
}
-#endif /* not HAS_SETRESGID */
-#endif /* not HAS_SETREGID */
+# endif /* HAS_SETREGID */
+#endif /* HAS_SETRESGID */
gid = (int)getgid();
egid = (int)getegid();
}
*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac
-: Configure sets byacc=byacc if byacc is not found. We reset it to ''
-case "$byacc" in
-'byacc') byacc='';;
-esac
-
echo "Extracting x2p/Makefile (with variable substitutions)"
rm -f Makefile
cat >Makefile <<!GROK!THIS!
a2p: $(obj) a2p.o
$(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
-!NO!SUBS!
-
-: Only print out the rules for running byacc if the user _has_ byacc.
-: Otherwise, comment them out. Users who really know what they are
-: doing can uncomment them and run yacc or bison or whatever.
-: Configure sets byacc=byacc if byacc is not found.
-case "$byacc" in
-'')
- comment1='#'
- comment2='' ;;
-*) comment1=''
- comment2='#' ;;
-esac
-
-$spitshell >>Makefile <<!GROK!THIS!
-
# I now supply a2p.c with the kits, so the following section is
-# commented out if you don't have byacc.
-
-${comment1}a2p.c: a2p.y
-${comment1} @ echo Expect many shift/reduce and reduce/reduce conflicts
-${comment1} \$(BYACC) a2p.y
-${comment1} mv y.tab.c a2p.c
-
-# This version is used if you do not have byacc.
-${comment2}a2p.c: a2p.y
-${comment2} touch a2p.c
-
-!GROK!THIS!
-cat >>Makefile <<'!NO!SUBS!'
+# used only if you force byacc to run by saying
+# make run_byacc
+
+run_byacc:
+ @ echo Expect many shift/reduce and reduce/reduce conflicts
+ $(BYACC) a2p.y
+ mv y.tab.c a2p.c
+
+# We don't want to regenerate a2p.c, but it might appear out-of-date
+# after a patch is applied or a new distribution is made.
+a2p.c: a2p.y
+ - touch a2p.c
a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
$(CCCMD) $(LARGE) a2p.c
#include "a2p.h"
#include "util.h"
-static void tab();
-static void fixtab();
-static void addsemi();
-static void emit_split();
-static void numericize();
-
bool exitval = FALSE;
bool realexit = FALSE;
bool saw_getline = FALSE;
STR *subs;
STR *curargs = Nullstr;
-void addsemi _(( STR *str ));
-void emit_split _(( STR *str, int level ));
-void fixtab _(( STR *str, int lvl ));
-void numericize _(( int node ));
+static void addsemi _(( STR *str ));
+static void emit_split _(( STR *str, int level ));
+static void fixtab _(( STR *str, int lvl ));
+static void numericize _(( int node ));
+static void tab _(( STR *str, int lvl ));
+
int prewalk _(( int numit, int level, int node, int *numericptr ));
-void tab _(( STR *str, int lvl ));
STR * walk _(( int useval, int level, int node, int *numericptr, int minprec ));
str_cat(str,";");
}
-void
+static void
emit_split(str,level)
register STR *str;
int level;