X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perly.fixer;h=00f583c6755fd0022f4013228350805abc0e133c;hb=231c9faeb17b45588bbde0b49d0d32f25d2a1286;hp=afe1a383cfa58e27415088cbffd3264c7738c977;hpb=e262e9be635eb2f99e78e37e3729f3b9494cef78;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perly.fixer b/perly.fixer index afe1a38..00f583c 100755 --- a/perly.fixer +++ b/perly.fixer @@ -19,17 +19,47 @@ input=$1 output=$2 tmp=/tmp/f$$ +inputh=`echo $input|sed 's:\.c$:.h:'` +if grep '^#ifdef PERL_CORE' $inputh; then + : never mind +else + echo "#ifdef PERL_CORE" > $tmp + sed -e 's:^typedef union {:#endif /* PERL_CORE */\ +\ +typedef union {:' $inputh >> $tmp + mv -f $tmp $inputh +fi + if grep 'yaccpar 1.8 (Berkeley)' $input >/dev/null 2>&1; then cp $input $output + # Don't expect the diff to do everything -- do some by hand if test -f perly_c.diff; then patch -F3 $output $tmp && mv -f $tmp $output || exit 1 rm -rf $input + echo "If you need to debug perly.c, you need to fix up the #line" + echo "directives yourself." fi exit elif grep 'yaccpar 1.9 (Berkeley)' $input >/dev/null 2>&1; then if test -f perly.c.dif9; then patch -F3 $output $tmp && mv -f $tmp $output || exit 1 rm -rf $input + echo "If you need to debug perly.c, you need to fix up the #line" + echo "directives yourself." exit 0 else echo "Diffs from byacc-1.9 are not available." @@ -90,7 +120,7 @@ case "$plan" in # Also added are out of memory checks (makes porting the generated # code easier) For most systems, it can't hurt. -- TD "bsd43") - echo "Attempting to path perly.c to allow dynamic yacc stack allocation" + echo "Attempting to patch perly.c to allow dynamic yacc stack allocation" echo "Assuming bsd4.3 yaccpar" cat >$tmp <<'END' /YYSTYPE[ ]*yyv\[ *YYMAXDEPTH *\];/c\ @@ -145,7 +175,7 @@ END ####################################################### "isc") # Interactive Systems 2.2 version - echo "Attempting to path perly.c to allow dynamic yacc stack allocation" + echo "Attempting to patch 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.