# Additional editing of Makefiles
/(echo[ 	]*':t/ a\
# DJGPP specific Makefile changes.\
  /^aliaspath *	*=/s,:,";",g;t t\
  /TEXINPUTS=/s,:,";",g;t t\
  /PATH=/s,:,";",g;t t\
  s,\\.deps,_deps,g;t t\
  s,\\.new\\.,_new.,g;t t\
  s,\\.old\\.,_old.,g;t t\
  s,\\.tab\\.,_tab.,g;t t\
  s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
  s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
  /^install-info-am:/,/^$/ {\
    /@list=/ s,\\\$(INFO_DEPS),& bison.i,\
    /@for *file/ s,\\\$(INFO_DEPS),& bison.i,\
    s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
  }\
  /^install-pkgdataDATA:[ 	]\\\$(pkgdata_DATA)/,/^$/ {\
    /^$/ i\\\
	\\\$(mkinstalldirs) \\\$(libdir)\\\
	\\\$(INSTALL_DATA) \\\$(srcdir)/bison.hairy \\\$(libdir)/bison.hai \\\
	\\\$(INSTALL_DATA) \\\$(srcdir)/bison.simple \\\$(libdir)/bison.sim \
  }

# Makefile.in.in is renamed to Makefile.in-in.
/^ac_config_files=/,/_ACEOF/ {
  s|po/Makefile\.in|&:po/Makefile.in-in|
}
/CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2

# We always use _deps instead of .deps.
# This make the generated Makefiles good
# for every DJGPP installation, not only
# the one where the package was configured.
s,\.deps,_deps,g

# Replace (command) > /dev/null with `command > /dev/null`, since
# parenthesized commands always return zero status in the ported Bash,
# even if the named command doesn't exist
/if ([^|;]*null/{
  s,(,`,
  s,),,
  s,;  *then,`; then,
}

# DOS-style absolute file names should be supported as well
/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,

# Prevent the spliting of conftest.subs.
# The sed script: conftest.subs is split into 48 or 90 lines long files.
# This will produce sed scripts called conftest.s1, conftest.s2, etc.
# that will not work if conftest.subs contains a multi line sed command
# at line #90. In this case the first part of the sed command will be the
# last line of conftest.s1 and the rest of the command will be the first lines
# of conftest.s2. So both script will not work properly.
# This matches the configure script produced by Autoconf 2.52
/ac_max_sed_lines=[0-9]/ s,=.*$,=`sed -n "$=" $tmp/subs.sed`,

# The following two items are changes needed for configuring
# and compiling across partitions.
# 1) The given srcdir value is always translated from the
#    "x:" syntax into "/dev/x" syntax while we run configure.
/^[ 	]*-srcdir=\*.*$/ a\
    ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
/set X `ls -Lt \$srcdir/ i\
   if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
     srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
   fi
