X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/90ddbd5eed4de3fb8a9de367319ac8af05208b79..77bb73e7af76ef5180b22c3b8355aaff1f498f68:/djgpp/config.bat?ds=sidebyside diff --git a/djgpp/config.bat b/djgpp/config.bat index abcdaee6..6e0350ef 100644 --- a/djgpp/config.bat +++ b/djgpp/config.bat @@ -1,8 +1,25 @@ @echo off +Rem Configure Bison for DJGPP. + Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line Rem format, or else stock DOS/Windows shells will refuse to run it. -echo Configuring GNU Bison for DJGPP v2.x... +Rem Copyright (C) 2005-2011 Free Software Foundation, Inc. + +Rem This program is free software: you can redistribute it and/or modify +Rem it under the terms of the GNU General Public License as published by +Rem the Free Software Foundation, either version 3 of the License, or +Rem (at your option) any later version. +Rem +Rem This program is distributed in the hope that it will be useful, +Rem but WITHOUT ANY WARRANTY; without even the implied warranty of +Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +Rem GNU General Public License for more details. +Rem +Rem You should have received a copy of the GNU General Public License +Rem along with this program. If not, see . + +echo Configuring Bison for DJGPP v2.x... Rem The SmallEnv tests protect against fixed and too small size Rem of the environment in stock DOS shell. @@ -125,53 +142,117 @@ shift if not "%1" == "" goto ArgLoop Rem Create an arguments file for the configure script. -echo --srcdir=%XSRC% > arguments -if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments -if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments -if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments -if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments -if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments -if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments -if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments -if "%HTML%" == "enabled" echo --enable-html >> arguments -if "%HTML%" == "disabled" echo --disable-html >> arguments -if not "%ARGS%" == "" echo %ARGS% >> arguments +echo --srcdir=%XSRC% > args +if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> args +if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> args +if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> args +if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> args +if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> args +if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> args +if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> args +if "%HTML%" == "enabled" echo --enable-html >> args +if "%HTML%" == "disabled" echo --disable-html >> args +if not "%ARGS%" == "" echo %ARGS% >> args set ARGS= set CACHING= set DEPENDENCY_TRACKING= +set LIBICONV_PREFIX= +set LIBINTL_PREFIX= +set HTML= if "%XSRC%" == "." goto InPlace :NotInPlace -redir -e /dev/null update %XSRC%/configure.orig ./configure +redir -e /dev/null update %XSRC%/configure.org ./configure test -f ./configure if errorlevel 1 update %XSRC%/configure ./configure :InPlace Rem Update configuration files echo Updating configuration scripts... -test -f ./configure.orig -if errorlevel 1 update configure configure.orig -sed -f %XSRC%/djgpp/config.sed configure.orig > configure +test -f ./configure.org +if errorlevel 1 update configure configure.org +sed -f %XSRC%/djgpp/config.sed configure.org > configure if errorlevel 1 goto SedError Rem Make sure they have a config.site file set CONFIG_SITE=%XSRC%/djgpp/config.site if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv +Rem inttypes_.h and inttypes.h map to the same 8.3 alias. +test -f %XSRC%/lib/inttypes_.h +if not errorlevel 1 mv -f %XSRC%/lib/inttypes_.h %XSRC%/lib/_inttypes.h + Rem Make sure crucial file names are not munged by unpacking test -f %XSRC%/po/Makefile.in.in if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in test -f %XSRC%/po/Makefile.in-in if errorlevel 1 mv -f %XSRC%/po/Makefile.in %XSRC%/po/Makefile.in-in +test -f %XSRC%/po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/po/Makefile.inin %XSRC%/po/Makefile.in-in +test -f %XSRC%/po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/po/Makefile.in_in %XSRC%/po/Makefile.in-in +test -f %XSRC%/po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/po/Makefile_in.in %XSRC%/po/Makefile.in-in test -f %XSRC%/runtime-po/Makefile.in.in if not errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in.in %XSRC%/runtime-po/Makefile.in-in test -f %XSRC%/runtime-po/Makefile.in-in if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.inin %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in_in %XSRC%/runtime-po/Makefile.in-in +test -f %XSRC%/runtime-po/Makefile.in-in +if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile_in.in %XSRC%/runtime-po/Makefile.in-in test -f %XSRC%/data/c++.m4 if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4 test -f %XSRC%/data/cxx.m4 if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %XSRC%/data/cxx.m4 +test -f %XSRC%/data/c++-skel.m4 +if not errorlevel 1 mv -f %XSRC%/data/c++-skel.m4 %XSRC%/data/cxx-skel.m4 +test -f %XSRC%/data/cxx-skel.m4 +if errorlevel 1 mv -f %XSRC%/data/cpp-skel.m4 %XSRC%/data/cxx-skel.m4 +test -f %XSRC%/build-aux/javacomp.sh.in +if not errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.shin %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh_in %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javacomp.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in +test -f %XSRC%/build-aux/javaexec.sh.in +if not errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh.in %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.shin %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh_in %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/build-aux/javaexec.sh-in +if errorlevel 1 mv -f %XSRC%/build-aux/javaexec_sh.in %XSRC%/build-aux/javaexec.sh-in +test -f %XSRC%/doc/yacc.1.in +if not errorlevel 1 mv -f %XSRC%/doc/yacc.1.in %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc.1 %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc.1in %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc.1_in %XSRC%/doc/yacc.1-in +test -f %XSRC%/doc/yacc.1-in +if errorlevel 1 mv -f %XSRC%/doc/yacc_1.in %XSRC%/doc/yacc.1-in +test -f %XSRC%/etc/bench.pl.in +if not errorlevel 1 mv -f %XSRC%/etc/bench.pl.in %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench.pl %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench.plin %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench.pl_in %XSRC%/etc/bench.pl-in +test -f %XSRC%/etc/bench.pl-in +if errorlevel 1 mv -f %XSRC%/etc/bench_pl.in %XSRC%/etc/bench.pl-in + :scan_gram_c_Test test -f %XSRC%/src/c-scan-gram.c if not errorlevel 1 goto scan_skel_c_Test @@ -189,22 +270,36 @@ sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc if errorlevel 1 goto lalr1_ccFileError mv ./lalr1.cc %XSRC%/data/lalr1.cc sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.cc -if errorlevel 1 goto location.ccFileError +if errorlevel 1 goto location_ccFileError mv ./location.cc %XSRC%/data/location.cc +sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.cc +if errorlevel 1 goto glr_ccFileError +mv ./glr.cc %XSRC%/data/glr.cc + +Rem Fix src/getargs.c to reflect the renaming of c++-skel.m4 +sed "s/c++-skel\.m4/cxx-skel.m4/" %XSRC%/src/getargs.c > getargs.c +if errorlevel 1 goto getargs_cFileError +mv ./getargs.c %XSRC%/src/getargs.c Rem Define DJGPP specific defs in config.hin echo Editing config.hin... -test -f %XSRC%/config_h.orig -if errorlevel 1 update %XSRC%/config.hin %XSRC%/config_h.orig -sed -f %XSRC%/djgpp/config_h.sed %XSRC%/config_h.orig > config.hin +test -f %XSRC%/lib/config_h.org +if errorlevel 1 update %XSRC%/lib/config.hin %XSRC%/lib/config_h.org +sed -f %XSRC%/djgpp/config_h.sed %XSRC%/lib/config_h.org > config.hin if errorlevel 1 goto SedError2 -mv -f config.hin %XSRC%/config.hin +mv -f config.hin %XSRC%/lib/config.hin Rem Fixing ilicit testsuite file name. test -f %XSRC%/tests/c++.at if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at +test -f %XSRC%/tests/testsuite.org +if errorlevel 1 update %XSRC%/tests/testsuite %XSRC%/tests/testsuite.org +sed -f %XSRC%/djgpp/testsuite.sed %XSRC%/tests/testsuite.org > testsuite.tmp +if errorlevel 1 goto SedError3 +mv -f ./testsuite.tmp %XSRC%/tests/testsuite + Rem Fixing ilicit calc++ file names in the calc++ directory. test -d %XSRC%/examples/calc++ if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx @@ -248,28 +343,28 @@ test -f %XSRC%/examples/calcxx/calcxx.cc if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc Rem Fixing #include lines in calcxx files. -sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc if errorlevel 1 goto calcxxFileError mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc -sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc if errorlevel 1 goto calcxxFileError mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc -sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh if errorlevel 1 goto calcxxFileError mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh -sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc if errorlevel 1 goto calcxxFileError mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc -sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh if errorlevel 1 goto calcxxFileError mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh -:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy +:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy :if errorlevel 1 goto calcxxFileError :mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy -sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc +sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc if errorlevel 1 goto calcxxFileError mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc -:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll +:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll :if errorlevel 1 goto calcxxFileError :mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test @@ -377,20 +472,20 @@ redir -e /dev/null rm %XSRC%/po/stamp-cat-id Rem Update the arguments file for the configure script. Rem We prefer without-included-gettext because libintl.a from gettext package Rem is the only one that is garanteed to have been ported to DJGPP. -echo --enable-nls --without-included-gettext >> arguments +echo --enable-nls --without-included-gettext >> args goto ConfigurePackage :MissingNLSTools echo Needed libs/tools for NLS not found. Configuring without NLS. :WithoutNLS Rem Update the arguments file for the configure script. -echo --disable-nls >> arguments +echo --disable-nls >> args :ConfigurePackage echo Running the ./configure script... -sh ./configure @arguments +sh ./configure @args if errorlevel 1 goto CfgError -rm arguments +rm args echo Done. goto End @@ -398,6 +493,14 @@ goto End echo ./data/lalr1.cc file editing failed! goto End +:glr_ccFileError +echo ./data/glr.cc file editing failed! +goto End + +:getargs_cFileError +echo ./src/getargs.c file editing failed! +goto End + :location_ccFileError echo ./data/location.cc file editing failed! goto End @@ -415,7 +518,11 @@ echo ./configure script editing failed! goto End :SedError2 -echo ./config.hin editing failed! +echo ./lib/config.hin editing failed! +goto End + +:SedError3 +echo ./tests/testsuite editing failed! goto End :CfgError @@ -434,10 +541,7 @@ if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh :NoRen1 if "%SHELL%" == "/bin/sh" set SHELL= if "%HOME%" == "%XSRC%/djgpp" set HOME= -set ARGS= set CONFIG_SITE= set HOSTNAME= set NLS= -set CACHING= -set DEPENDENCY_TRACKING= set XSRC=