summaryrefslogtreecommitdiff
path: root/perly.fixer
diff options
context:
space:
mode:
authorTim Bunce <Tim.Bunce@ig.co.uk>1997-09-05 00:00:00 +0000
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-09-05 00:00:00 +0000
commit25c49cb6c6f3bfa58236f2866fad8049f77a03df (patch)
tree5f58405c20adb60ac08e3186ea9d85374a71be46 /perly.fixer
parent05bbd9c3ff8acdd30cd1ac0def4e27307144bb8f (diff)
downloadperl-25c49cb6c6f3bfa58236f2866fad8049f77a03df.tar.gz
Enhance perly.fixer to help porters.
Diffstat (limited to 'perly.fixer')
-rwxr-xr-xperly.fixer38
1 files changed, 31 insertions, 7 deletions
diff --git a/perly.fixer b/perly.fixer
index 98296a72fd..156881657f 100755
--- a/perly.fixer
+++ b/perly.fixer
@@ -5,8 +5,9 @@
#
# However, if the user wishes to use byacc, or wishes to try another
# compiler compiler (e.g. bison or yacc), this script will get run.
+# See makefile run_byacc target for more details.
#
-# Currently, only byacc version 1.8 is supported.
+# Currently, only byacc version 1.8 is fully supported.
#
# Hacks to make it work with Interactive's SysVr3 Version 2.2
# doughera@lafvax.lafayette.edu (Andy Dougherty) 3/23/91
@@ -44,7 +45,15 @@ fi
plan="unknown"
-# Below, we check for various yaccpar outputs.
+echo ""
+echo "Warning: the yacc you have used is not directly supported by perl."
+echo "The perly.fixer script will attempt to make some changes to the generated"
+echo "file. The changes may be incomplete and that might lead to problems later"
+echo "(especially with complex scripts). You may need to apply the changes"
+echo "embedded in perl.fixer (and/or perly.c.dif*) by hand."
+echo ""
+
+# Below, we check for various characteristic yaccpar outputs.
# Test for BSD 4.3 version.
# Also tests for the SunOS 4.0.2 version
@@ -73,13 +82,15 @@ if *\( *\+\+yy_ps *>= *&yys\[ *YYMAXDEPTH *\] *\)' $input >$tmp 2>/dev/null
fi
fi
+# ------
+
case "$plan" in
##################################################################
# The SunOS 4.0.2 version has the comparison fixed already.
# Also added are out of memory checks (makes porting the generated
# code easier) For most systems, it can't hurt. -- TD
"bsd43")
- echo "Patching perly.c to allow dynamic yacc stack allocation"
+ echo "Attempting to path perly.c to allow dynamic yacc stack allocation"
echo "Assuming bsd4.3 yaccpar"
cat >$tmp <<'END'
/YYSTYPE[ ]*yyv\[ *YYMAXDEPTH *\];/c\
@@ -128,11 +139,15 @@ short *maxyyps;
/yacc stack overflow.*}/d
/yacc stack overflow/,/}/d
END
- sed -f $tmp <$input >$output ;;
+ if sed -f $tmp <$input >$output
+ then echo "The edit seems to have been applied okay."
+ else echo "The edit seems to have failed!"
+ fi
+ ;;
#######################################################
"isc") # Interactive Systems 2.2 version
- echo "Patching perly.c to allow dynamic yacc stack allocation"
+ echo "Attempting to path perly.c to allow dynamic yacc stack allocation"
echo "Assuming Interactive SysVr3 2.2 yaccpar"
# Easier to simply put whole script here than to modify the
# bsd script with sed.
@@ -178,11 +193,20 @@ int *maxyyps;
\ }\
\ if (yyv == NULL || yys == NULL)
END
- sed -f $tmp < $input > $output ;;
+ if sed -f $tmp < $input > $output
+ then echo "The edit seems to have been applied okay."
+ else echo "The edit seems to have failed!"
+ fi
+ ;;
######################################################
# Plan still unknown
- *) sed -e 's/Received token/ *** Received token/' $input >$output;
+ *)
+ echo "Unable to patch perly.c to allow dynamic yacc stack allocation (plan=$plan)"
+ # just do minimal change to write $output from $input
+ sed -e 's/Received token/ *** Received token/' $input >$output
+ ;;
esac
+echo ""
rm -rf $tmp $input