--- /dev/null
+@echo off\r
+echo Configuring GNU Bison for DJGPP v2.x...\r
+\r
+Rem The SmallEnv tests protect against fixed and too small size\r
+Rem of the environment in stock DOS shell.\r
+\r
+Rem Find out if NLS is wanted or not,\r
+Rem if dependency-tracking is wanted or not,\r
+Rem if caching is wanted or not\r
+Rem and where the sources are.\r
+Rem We always default to NLS support,\r
+Rem no dependency tracking\r
+Rem and to in place configuration.\r
+set ARGS=\r
+set NLS=enabled\r
+if not "%NLS%" == "enabled" goto SmallEnv\r
+set CACHING=enabled\r
+if not "%CACHING%" == "enabled" goto SmallEnv\r
+set DEPENDENCY_TRACKING=disabled\r
+if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv\r
+set LIBICONV_PREFIX=disabled\r
+if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv\r
+set LIBINTL_PREFIX=disabled\r
+if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv\r
+set HTML=enabled\r
+if not "%HTML%" == "enabled" goto SmallEnv\r
+set XSRC=.\r
+if not "%XSRC%" == "." goto SmallEnv\r
+\r
+Rem Loop over all arguments.\r
+Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS.\r
+Rem All other arguments are stored into ARGS.\r
+:ArgLoop\r
+if "%1" == "nls" goto NextArgument\r
+if "%1" == "NLS" goto NextArgument\r
+if "%1" == "no-nls" goto NoNLS\r
+if "%1" == "no-NLS" goto NoNLS\r
+if "%1" == "NO-NLS" goto NoNLS\r
+goto CachingOption\r
+:NoNLS\r
+if "%1" == "no-nls" set NLS=disabled\r
+if "%1" == "no-NLS" set NLS=disabled\r
+if "%1" == "NO-NLS" set NLS=disabled\r
+if not "%NLS%" == "disabled" goto SmallEnv\r
+goto NextArgument\r
+:CachingOption\r
+if "%1" == "cache" goto NextArgument\r
+if "%1" == "CACHE" goto NextArgument\r
+if "%1" == "no-cache" goto NoCaching\r
+if "%1" == "no-CACHE" goto NoCaching\r
+if "%1" == "NO-CACHE" goto NoCaching\r
+goto DependencyOption\r
+:NoCaching\r
+if "%1" == "no-cache" set CACHING=disabled\r
+if "%1" == "no-CACHE" set CACHING=disabled\r
+if "%1" == "NO-CACHE" set CACHING=disabled\r
+if not "%CACHING%" == "disabled" goto SmallEnv\r
+goto NextArgument\r
+:DependencyOption\r
+if "%1" == "no-dep" goto NextArgument\r
+if "%1" == "no-DEP" goto NextArgument\r
+if "%1" == "NO-DEP" goto NextArgument\r
+if "%1" == "dep" goto DependecyTraking\r
+if "%1" == "DEP" goto DependecyTraking\r
+goto LibiconvPrefixOption\r
+:DependecyTraking\r
+if "%1" == "dep" set DEPENDENCY_TRACKING=enabled\r
+if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled\r
+if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv\r
+goto NextArgument\r
+:LibiconvPrefixOption\r
+if "%1" == "no-libiconvprefix" goto NextArgument\r
+if "%1" == "no-LIBICONVPREFIX" goto NextArgument\r
+if "%1" == "NO-LIBICONVPREFIX" goto NextArgument\r
+if "%1" == "libiconvprefix" goto WithLibiconvPrefix\r
+if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix\r
+goto LibintlPrefixOption\r
+:WithLibiconvPrefix\r
+if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled\r
+if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled\r
+if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv\r
+goto NextArgument\r
+:LibintlPrefixOption\r
+if "%1" == "no-libiconvprefix" goto NextArgument\r
+if "%1" == "no-LIBICONVPREFIX" goto NextArgument\r
+if "%1" == "NO-LIBICONVPREFIX" goto NextArgument\r
+if "%1" == "libintlprefix" goto _WithLibintlPrefix\r
+if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix\r
+goto HTMLOption\r
+:_WithLibintlPrefix\r
+if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled\r
+if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled\r
+if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv\r
+:HTMLOption\r
+if "%1" == "withhtml" goto NextArgument\r
+if "%1" == "withHTML" goto NextArgument\r
+if "%1" == "WITHHTML" goto NextArgument\r
+if "%1" == "withouthtml" goto _WithoutHTML\r
+if "%1" == "withoutHTML" goto _WithoutHTML\r
+if "%1" == "WITHOUTHTML" goto _WithoutHTML\r
+goto SrcDirOption\r
+:_WithoutHTML\r
+if "%1" == "withouthtml" set HTML=disabled\r
+if "%1" == "withoutHTML" set HTML=disabled\r
+if "%1" == "WITHOUTHTML" set HTML=disabled\r
+if not "%HTML%" == "disabled" goto SmallEnv\r
+goto NextArgument\r
+:SrcDirOption\r
+echo %1 | grep -q "/"\r
+if errorlevel 1 goto CollectArgument\r
+set XSRC=%1\r
+if not "%XSRC%" == "%1" goto SmallEnv\r
+goto NextArgument\r
+:CollectArgument\r
+set _ARGS=%ARGS% %1\r
+if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv\r
+echo %_ARGS% | grep -q "[^ ]"\r
+if not errorlevel 0 set ARGS=%_ARGS%\r
+set _ARGS=\r
+:NextArgument\r
+shift\r
+if not "%1" == "" goto ArgLoop\r
+\r
+Rem Create an arguments file for the configure script.\r
+echo --srcdir=%XSRC% > arguments\r
+if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments\r
+if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments\r
+if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments\r
+if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments\r
+if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments\r
+if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments\r
+if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments\r
+if "%HTML%" == "enabled" echo --enable-html >> arguments\r
+if "%HTML%" == "disabled" echo --disable-html >> arguments\r
+if not "%ARGS%" == "" echo %ARGS% >> arguments\r
+set ARGS=\r
+set CACHING=\r
+set DEPENDENCY_TRACKING=\r
+\r
+if "%XSRC%" == "." goto InPlace\r
+\r
+:NotInPlace\r
+redir -e /dev/null update %XSRC%/configure.orig ./configure\r
+test -f ./configure\r
+if errorlevel 1 update %XSRC%/configure ./configure\r
+\r
+:InPlace\r
+Rem Update configuration files\r
+echo Updating configuration scripts...\r
+test -f ./configure.orig\r
+if errorlevel 1 update configure configure.orig\r
+sed -f %XSRC%/djgpp/config.sed configure.orig > configure\r
+if errorlevel 1 goto SedError\r
+\r
+Rem Make sure they have a config.site file\r
+set CONFIG_SITE=%XSRC%/djgpp/config.site\r
+if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv\r
+\r
+Rem Make sure crucial file names are not munged by unpacking\r
+test -f %XSRC%/po/Makefile.in.in\r
+if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in\r
+test -f %XSRC%/po/Makefile.in-in\r
+if errorlevel 1 mv -f %XSRC%/po/Makefile.in %XSRC%/po/Makefile.in-in\r
+test -f %XSRC%/runtime-po/Makefile.in.in\r
+if not errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in.in %XSRC%/runtime-po/Makefile.in-in\r
+test -f %XSRC%/runtime-po/Makefile.in-in\r
+if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in %XSRC%/runtime-po/Makefile.in-in\r
+test -f %XSRC%/data/c++.m4\r
+if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4\r
+test -f %XSRC%/data/cxx.m4\r
+if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %XSRC%/data/cxx.m4\r
+\r
+Rem Fix data/lalr1.cc to reflect the renaming of c++.m4\r
+sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc\r
+if errorlevel 1 goto lalr1_ccFileError\r
+mv ./lalr1.cc %XSRC%/data/lalr1.cc\r
+\r
+Rem Define DJGPP specific defs in config.hin\r
+echo Editing config.hin...\r
+test -f %XSRC%/config_h.orig\r
+if errorlevel 1 update %XSRC%/config.hin %XSRC%/config_h.orig\r
+sed -f %XSRC%/djgpp/config_h.sed %XSRC%/config_h.orig > config.hin\r
+if errorlevel 1 goto SedError2\r
+mv -f config.hin %XSRC%/config.hin\r
+\r
+\r
+Rem Fixing ilicit testsuite file name.\r
+test -f %XSRC%/tests/c++.at\r
+if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at\r
+\r
+Rem Fixing ilicit calc++ file names in the calc++ directory.\r
+test -d %XSRC%/examples/calc++\r
+if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx\r
+test -d %XSRC%/examples/calcxx\r
+if errorlevel 1 mv -f %XSRC%/examples/calcpp %XSRC%/examples/calcxx\r
+test -f %XSRC%/examples/calcxx/calc++-scanner.cc\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r
+test -f %XSRC%/examples/calcxx/calcxx-scanner.cc\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r
+test -f %XSRC%/examples/calcxx/calc++-scanner.ll\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r
+test -f %XSRC%/examples/calcxx/calcxx-scanner.ll\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r
+test -f %XSRC%/examples/calcxx/calc++-driver.cc\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r
+test -f %XSRC%/examples/calcxx/calcxx-driver.cc\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r
+test -f %XSRC%/examples/calcxx/calc++-driver.hh\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r
+test -f %XSRC%/examples/calcxx/calcxx-driver.hh\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r
+test -f %XSRC%/examples/calcxx/calc++-parser.cc\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r
+test -f %XSRC%/examples/calcxx/calcxx-parser.cc\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r
+test -f %XSRC%/examples/calcxx/calc++-parser.hh\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r
+test -f %XSRC%/examples/calcxx/calcxx-parser.hh\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r
+test -f %XSRC%/examples/calcxx/calc++-parser.stamp\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp\r
+test -f %XSRC%/examples/calcxx/calcxx-parser.stamp\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp\r
+test -f %XSRC%/examples/calcxx/calc++-parser.yy\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r
+test -f %XSRC%/examples/calcxx/calcxx-parser.yy\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r
+test -f %XSRC%/examples/calcxx/calc++.cc\r
+if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++.cc %XSRC%/examples/calcxx/calcxx.cc\r
+test -f %XSRC%/examples/calcxx/calcxx.cc\r
+if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc\r
+\r
+Rem Fixing #include lines in calcxx files.\r
+sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc\r
+if errorlevel 1 goto calcxxFileError\r
+mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc\r
+sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc\r
+if errorlevel 1 goto calcxxFileError\r
+mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r
+sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh\r
+if errorlevel 1 goto calcxxFileError\r
+mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r
+sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc\r
+if errorlevel 1 goto calcxxFileError\r
+mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r
+sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh\r
+if errorlevel 1 goto calcxxFileError\r
+mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r
+:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy\r
+:if errorlevel 1 goto calcxxFileError\r
+:mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r
+sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc\r
+if errorlevel 1 goto calcxxFileError\r
+mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r
+:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll\r
+:if errorlevel 1 goto calcxxFileError\r
+:mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r
+sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test\r
+if errorlevel 1 goto calcxxFileError\r
+mv ./test %XSRC%/examples/calcxx/test\r
+\r
+\r
+Rem Fixing the scanner files to make file names 8.3 valid.\r
+Rem Use only if you want to change the scan-gram.l and scan-skel.l files.\r
+: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-gram.l > scan-gram.l\r
+: if errorlevel 1 goto ScannerFileError\r
+: mv ./scan-gram.l %XSRC%/src/scan-gram.l\r
+: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-skel.l > scan-skel.l\r
+: if errorlevel 1 goto ScannerFileError\r
+: mv ./scan-skel.l %XSRC%/src/scan-skel.l\r
+\r
+\r
+Rem This is required because DOS/Windows are case-insensitive\r
+Rem to file names, and "make install" will do nothing if Make\r
+Rem finds a file called `install'.\r
+if exist INSTALL ren INSTALL INSTALL.txt\r
+\r
+Rem Set SHELL to a sane default or some configure tests stop working\r
+Rem if the package is configured across partitions.\r
+if not "%SHELL%" == "" goto HomeName\r
+set SHELL=/bin/sh\r
+if not "%SHELL%" == "/bin/sh" goto SmallEnv\r
+echo No SHELL found in the environment, using default value\r
+\r
+:HomeName\r
+Rem Set HOME to a sane default so configure stops complaining.\r
+if not "%HOME%" == "" goto HostName\r
+set HOME=%XSRC%/djgpp\r
+if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv\r
+echo No HOME found in the environment, using default value\r
+\r
+:HostName\r
+Rem Set HOSTNAME so it shows in config.status\r
+if not "%HOSTNAME%" == "" goto hostdone\r
+if "%windir%" == "" goto msdos\r
+set OS=MS-Windows\r
+if not "%OS%" == "MS-Windows" goto SmallEnv\r
+goto haveos\r
+:msdos\r
+set OS=MS-DOS\r
+if not "%OS%" == "MS-DOS" goto SmallEnv\r
+:haveos\r
+if not "%USERNAME%" == "" goto haveuname\r
+if not "%USER%" == "" goto haveuser\r
+echo No USERNAME and no USER found in the environment, using default values\r
+set HOSTNAME=Unknown PC\r
+if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv\r
+goto userdone\r
+:haveuser\r
+set HOSTNAME=%USER%'s PC\r
+if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv\r
+goto userdone\r
+:haveuname\r
+set HOSTNAME=%USERNAME%'s PC\r
+if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv\r
+:userdone\r
+set _HOSTNAME=%HOSTNAME%, %OS%\r
+if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv\r
+set HOSTNAME=%_HOSTNAME%\r
+:hostdone\r
+set _HOSTNAME=\r
+set OS=\r
+\r
+Rem install-sh is required by the configure script but clashes with the\r
+Rem various Makefile install-foo targets, so we MUST have it before the\r
+Rem script runs and rename it afterwards\r
+test -f %XSRC%/install-sh\r
+if not errorlevel 1 goto NoRen0\r
+test -f %XSRC%/install-sh.sh\r
+if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh\r
+:NoRen0\r
+\r
+if "%NLS%" == "disabled" goto WithoutNLS\r
+\r
+:WithNLS\r
+Rem Check for the needed libraries and binaries.\r
+test -x /dev/env/DJDIR/bin/msgfmt.exe\r
+if errorlevel 1 goto MissingNLSTools\r
+test -x /dev/env/DJDIR/bin/xgettext.exe\r
+if errorlevel 1 goto MissingNLSTools\r
+test -f /dev/env/DJDIR/include/libcharset.h\r
+if errorlevel 1 goto MissingNLSTools\r
+test -f /dev/env/DJDIR/lib/libcharset.a\r
+if errorlevel 1 goto MissingNLSTools\r
+test -f /dev/env/DJDIR/include/iconv.h\r
+if errorlevel 1 goto MissingNLSTools\r
+test -f /dev/env/DJDIR/lib/libiconv.a\r
+if errorlevel 1 goto MissingNLSTools\r
+test -f /dev/env/DJDIR/include/libintl.h\r
+if errorlevel 1 goto MissingNLSTools\r
+test -f /dev/env/DJDIR/lib/libintl.a\r
+if errorlevel 1 goto MissingNLSTools\r
+\r
+Rem Recreate the files in the %XSRC%/po subdir with our ported tools.\r
+redir -e /dev/null rm %XSRC%/po/*.gmo\r
+redir -e /dev/null rm %XSRC%/po/bison.pot\r
+redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c\r
+redir -e /dev/null rm %XSRC%/po/stamp-cat-id\r
+\r
+Rem Update the arguments file for the configure script.\r
+Rem We prefer without-included-gettext because libintl.a from gettext package\r
+Rem is the only one that is garanteed to have been ported to DJGPP.\r
+echo --enable-nls --without-included-gettext >> arguments\r
+goto ConfigurePackage\r
+\r
+:MissingNLSTools\r
+echo Needed libs/tools for NLS not found. Configuring without NLS.\r
+:WithoutNLS\r
+Rem Update the arguments file for the configure script.\r
+echo --disable-nls >> arguments\r
+\r
+:ConfigurePackage\r
+echo Running the ./configure script...\r
+sh ./configure @arguments\r
+if errorlevel 1 goto CfgError\r
+rm arguments\r
+echo Done.\r
+goto End\r
+\r
+:lalr1_ccFileError\r
+echo ./data/lalr1.cc file editing failed!\r
+goto End\r
+\r
+:calcxxFileError\r
+echo ./examples/calcxx file editing failed!\r
+goto End\r
+\r
+:ScannerFileError\r
+echo ./scanner file editing failed!\r
+goto End\r
+\r
+:SedError\r
+echo ./configure script editing failed!\r
+goto End\r
+\r
+:SedError2\r
+echo ./config.hin editing failed!\r
+goto End\r
+\r
+:CfgError\r
+echo ./configure script exited abnormally!\r
+goto End\r
+\r
+:SmallEnv\r
+echo Your environment size is too small. Enlarge it and run me again.\r
+echo Configuration NOT done!\r
+\r
+:End\r
+test -f %XSRC%/install-sh.sh\r
+if not errorlevel 1 goto NoRen1\r
+test -f %XSRC%/install-sh\r
+if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh\r
+:NoRen1\r
+if "%SHELL%" == "/bin/sh" set SHELL=\r
+if "%HOME%" == "%XSRC%/djgpp" set HOME=\r
+set ARGS=\r
+set CONFIG_SITE=\r
+set HOSTNAME=\r
+set NLS=\r
+set CACHING=\r
+set DEPENDENCY_TRACKING=\r
+set XSRC=\r
--- /dev/null
+# 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,c++\\.at,cxx.at,g;t t\
+ s,c++\\.m4,cxx.m4,g;t t\
+ s,calc++,calcxx,g;t t\
+ s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
+ s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
+ s,(MAKEINFOFLAGS),& --no-split,\
+ /^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],\
+ }\
+ /^\\.y\\.c:/,/^$/ {\
+ /\\\$(YACCCOMPILE)/ {\
+ a\\\
+ -@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\
+ -@test -f y.tab.h && mv -f y.tab.h y_tab.h\
+ }\
+ }\
+/^libbison.a:/ i\\\
+\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\
+subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\
+ \\$(COMPILE) -c \\$<\
+/^yacc:/ i\\\
+yacc.bat:\\\
+ echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\
+/^bin_SCRIPTS =/s/$/ yacc.bat/\
+/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/
+
+
+# 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 and _libs instead of .deps and .libs, because
+# the latter is an invalid name on 8+3 MS-DOS filesystem. This makes
+# the generated Makefiles good for every DJGPP installation, not only
+# the one where the package was configured (which could happen to be
+# a Windows box, where leading dots in file names are allowed).
+s,\.deps,_deps,g
+s,\.libs,_libs,g
+/^rmdir[ ]*\.tst/ i\
+am__leading_dot=_
+
+# 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,),,
+ /null[ ]*2>&1/ s,2>&1,&`,
+ /null.*null/ s,null.*null,&`,
+ /null.*null/ !{
+ /null[ ]*2>&1/ !s,null,&`,
+ }
+}
+
+# DOS-style absolute file names should be supported as well
+/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
+
+# Prevent the spliting of subs.sed.
+# The sed script: subs.sed is split into 48 lines long files.
+# This will produce sed scripts called subs-$ac_sed_frag.sed, where
+# $ac_sed_frag is some unique number. This will not work if the splited
+# sed script contains a multiple line sed command at line #48. In this
+# case the first part of the multiple line sed command will be written
+# at the end of one particular subs-$ac_sed_frag.sed and the rest of the
+# sed command will be written at the begining of the next subs-$ac_sed_frag.sed
+# making both sed script useless.
+# This matches the configure script produced by Autoconf 2.57
+/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
+
+# Autoconf 2.52e generated configure scripts
+# write absolute paths into Makefiles and bison.in
+# making them useless for DJGPP installations for
+# which the package has not been configured for.
+/MISSING=/,/^$/ {
+ /^fi$/ a\
+am_missing_run=`echo "$am_missing_run" | sed 's%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
+}
+/^install_sh=/a\
+install_sh=`echo "$install_sh" | sed 's%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
+
+# This will only work if the assumption that the
+# testsuite is ran from the following path:
+# ${top_srcdir}/tests/testsuite.dir
+# holds. The explicit names are of no importance.
+# ../../. == ${top_srcdir}
+/\.)[ ]*ac_abs_builddir=/,/^esac$/ {
+ /^esac$/ a\
+ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
+}
+/\.)[ ]*ac_abs_top_builddir=/,/^esac$/ {
+ /^esac$/ a\
+ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
+}
+/\.)[ ]*ac_abs_srcdir=/,/^esac$/ {
+ /^esac$/ a\
+ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
+}
+/\.)[ ]*ac_abs_top_srcdir=/,/^esac$/ {
+ /^esac$/ a\
+ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
+}
+
+# Add DJGPP version information.
+/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/
+
+# We need makeinfo to make the html formated docs.
+/\$am_missing_run[ ]*makeinfo/ s,\$am_missing_run,,
+
+# The path to the FORTRAN compiler and libraries
+# shall contain no absolute path reference so it
+# will be good for all djgpp installations.
+/^FLIBS="\$ac_cv_flibs"/ i\
+ac_djgpp_path=`echo "$DJDIR" | sed 's%\\\\\\%/%g' | tr $as_cr_LETTERS $as_cr_letters`\
+ac_cv_flibs=`echo "$ac_cv_flibs" | sed "s%-L$ac_djgpp_path%-L/dev/env/DJDIR%g"`
+
+# The following is not a valid DOS file name
+s/calc++/calcxx/g
\ No newline at end of file