| 1 | @echo off\r |
| 2 | Rem Configure Bison for DJGPP.\r |
| 3 | \r |
| 4 | Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line\r |
| 5 | Rem format, or else stock DOS/Windows shells will refuse to run it.\r |
| 6 | \r |
| 7 | Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.\r |
| 8 | \r |
| 9 | Rem This program is free software; you can redistribute it and/or modify\r |
| 10 | Rem it under the terms of the GNU General Public License as published by\r |
| 11 | Rem the Free Software Foundation; either version 2, or (at your option)\r |
| 12 | Rem any later version.\r |
| 13 | \r |
| 14 | Rem This program is distributed in the hope that it will be useful,\r |
| 15 | Rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r |
| 16 | Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r |
| 17 | Rem GNU General Public License for more details.\r |
| 18 | \r |
| 19 | Rem You should have received a copy of the GNU General Public License\r |
| 20 | Rem along with this program; if not, write to the Free Software Foundation,\r |
| 21 | Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r |
| 22 | \r |
| 23 | echo Configuring Bison for DJGPP v2.x...\r |
| 24 | \r |
| 25 | Rem The SmallEnv tests protect against fixed and too small size\r |
| 26 | Rem of the environment in stock DOS shell.\r |
| 27 | \r |
| 28 | Rem Find out if NLS is wanted or not,\r |
| 29 | Rem if dependency-tracking is wanted or not,\r |
| 30 | Rem if caching is wanted or not\r |
| 31 | Rem and where the sources are.\r |
| 32 | Rem We always default to NLS support,\r |
| 33 | Rem no dependency tracking\r |
| 34 | Rem and to in place configuration.\r |
| 35 | set ARGS=\r |
| 36 | set NLS=enabled\r |
| 37 | if not "%NLS%" == "enabled" goto SmallEnv\r |
| 38 | set CACHING=enabled\r |
| 39 | if not "%CACHING%" == "enabled" goto SmallEnv\r |
| 40 | set DEPENDENCY_TRACKING=disabled\r |
| 41 | if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv\r |
| 42 | set LIBICONV_PREFIX=disabled\r |
| 43 | if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv\r |
| 44 | set LIBINTL_PREFIX=disabled\r |
| 45 | if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv\r |
| 46 | set HTML=enabled\r |
| 47 | if not "%HTML%" == "enabled" goto SmallEnv\r |
| 48 | set XSRC=.\r |
| 49 | if not "%XSRC%" == "." goto SmallEnv\r |
| 50 | \r |
| 51 | Rem Loop over all arguments.\r |
| 52 | Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS.\r |
| 53 | Rem All other arguments are stored into ARGS.\r |
| 54 | :ArgLoop\r |
| 55 | if "%1" == "nls" goto NextArgument\r |
| 56 | if "%1" == "NLS" goto NextArgument\r |
| 57 | if "%1" == "no-nls" goto NoNLS\r |
| 58 | if "%1" == "no-NLS" goto NoNLS\r |
| 59 | if "%1" == "NO-NLS" goto NoNLS\r |
| 60 | goto CachingOption\r |
| 61 | :NoNLS\r |
| 62 | if "%1" == "no-nls" set NLS=disabled\r |
| 63 | if "%1" == "no-NLS" set NLS=disabled\r |
| 64 | if "%1" == "NO-NLS" set NLS=disabled\r |
| 65 | if not "%NLS%" == "disabled" goto SmallEnv\r |
| 66 | goto NextArgument\r |
| 67 | :CachingOption\r |
| 68 | if "%1" == "cache" goto NextArgument\r |
| 69 | if "%1" == "CACHE" goto NextArgument\r |
| 70 | if "%1" == "no-cache" goto NoCaching\r |
| 71 | if "%1" == "no-CACHE" goto NoCaching\r |
| 72 | if "%1" == "NO-CACHE" goto NoCaching\r |
| 73 | goto DependencyOption\r |
| 74 | :NoCaching\r |
| 75 | if "%1" == "no-cache" set CACHING=disabled\r |
| 76 | if "%1" == "no-CACHE" set CACHING=disabled\r |
| 77 | if "%1" == "NO-CACHE" set CACHING=disabled\r |
| 78 | if not "%CACHING%" == "disabled" goto SmallEnv\r |
| 79 | goto NextArgument\r |
| 80 | :DependencyOption\r |
| 81 | if "%1" == "no-dep" goto NextArgument\r |
| 82 | if "%1" == "no-DEP" goto NextArgument\r |
| 83 | if "%1" == "NO-DEP" goto NextArgument\r |
| 84 | if "%1" == "dep" goto DependecyTraking\r |
| 85 | if "%1" == "DEP" goto DependecyTraking\r |
| 86 | goto LibiconvPrefixOption\r |
| 87 | :DependecyTraking\r |
| 88 | if "%1" == "dep" set DEPENDENCY_TRACKING=enabled\r |
| 89 | if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled\r |
| 90 | if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv\r |
| 91 | goto NextArgument\r |
| 92 | :LibiconvPrefixOption\r |
| 93 | if "%1" == "no-libiconvprefix" goto NextArgument\r |
| 94 | if "%1" == "no-LIBICONVPREFIX" goto NextArgument\r |
| 95 | if "%1" == "NO-LIBICONVPREFIX" goto NextArgument\r |
| 96 | if "%1" == "libiconvprefix" goto WithLibiconvPrefix\r |
| 97 | if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix\r |
| 98 | goto LibintlPrefixOption\r |
| 99 | :WithLibiconvPrefix\r |
| 100 | if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled\r |
| 101 | if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled\r |
| 102 | if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv\r |
| 103 | goto NextArgument\r |
| 104 | :LibintlPrefixOption\r |
| 105 | if "%1" == "no-libiconvprefix" goto NextArgument\r |
| 106 | if "%1" == "no-LIBICONVPREFIX" goto NextArgument\r |
| 107 | if "%1" == "NO-LIBICONVPREFIX" goto NextArgument\r |
| 108 | if "%1" == "libintlprefix" goto _WithLibintlPrefix\r |
| 109 | if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix\r |
| 110 | goto HTMLOption\r |
| 111 | :_WithLibintlPrefix\r |
| 112 | if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled\r |
| 113 | if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled\r |
| 114 | if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv\r |
| 115 | :HTMLOption\r |
| 116 | if "%1" == "withhtml" goto NextArgument\r |
| 117 | if "%1" == "withHTML" goto NextArgument\r |
| 118 | if "%1" == "WITHHTML" goto NextArgument\r |
| 119 | if "%1" == "withouthtml" goto _WithoutHTML\r |
| 120 | if "%1" == "withoutHTML" goto _WithoutHTML\r |
| 121 | if "%1" == "WITHOUTHTML" goto _WithoutHTML\r |
| 122 | goto SrcDirOption\r |
| 123 | :_WithoutHTML\r |
| 124 | if "%1" == "withouthtml" set HTML=disabled\r |
| 125 | if "%1" == "withoutHTML" set HTML=disabled\r |
| 126 | if "%1" == "WITHOUTHTML" set HTML=disabled\r |
| 127 | if not "%HTML%" == "disabled" goto SmallEnv\r |
| 128 | goto NextArgument\r |
| 129 | :SrcDirOption\r |
| 130 | echo %1 | grep -q "/"\r |
| 131 | if errorlevel 1 goto CollectArgument\r |
| 132 | set XSRC=%1\r |
| 133 | if not "%XSRC%" == "%1" goto SmallEnv\r |
| 134 | goto NextArgument\r |
| 135 | :CollectArgument\r |
| 136 | set _ARGS=%ARGS% %1\r |
| 137 | if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv\r |
| 138 | echo %_ARGS% | grep -q "[^ ]"\r |
| 139 | if not errorlevel 0 set ARGS=%_ARGS%\r |
| 140 | set _ARGS=\r |
| 141 | :NextArgument\r |
| 142 | shift\r |
| 143 | if not "%1" == "" goto ArgLoop\r |
| 144 | \r |
| 145 | Rem Create an arguments file for the configure script.\r |
| 146 | echo --srcdir=%XSRC% > arguments\r |
| 147 | if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments\r |
| 148 | if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments\r |
| 149 | if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments\r |
| 150 | if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments\r |
| 151 | if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments\r |
| 152 | if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments\r |
| 153 | if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments\r |
| 154 | if "%HTML%" == "enabled" echo --enable-html >> arguments\r |
| 155 | if "%HTML%" == "disabled" echo --disable-html >> arguments\r |
| 156 | if not "%ARGS%" == "" echo %ARGS% >> arguments\r |
| 157 | set ARGS=\r |
| 158 | set CACHING=\r |
| 159 | set DEPENDENCY_TRACKING=\r |
| 160 | set LIBICONV_PREFIX=\r |
| 161 | set LIBINTL_PREFIX=\r |
| 162 | set HTML=\r |
| 163 | \r |
| 164 | if "%XSRC%" == "." goto InPlace\r |
| 165 | \r |
| 166 | :NotInPlace\r |
| 167 | redir -e /dev/null update %XSRC%/configure.org ./configure\r |
| 168 | test -f ./configure\r |
| 169 | if errorlevel 1 update %XSRC%/configure ./configure\r |
| 170 | \r |
| 171 | :InPlace\r |
| 172 | Rem Update configuration files\r |
| 173 | echo Updating configuration scripts...\r |
| 174 | test -f ./configure.org\r |
| 175 | if errorlevel 1 update configure configure.org\r |
| 176 | sed -f %XSRC%/djgpp/config.sed configure.org > configure\r |
| 177 | if errorlevel 1 goto SedError\r |
| 178 | \r |
| 179 | Rem Make sure they have a config.site file\r |
| 180 | set CONFIG_SITE=%XSRC%/djgpp/config.site\r |
| 181 | if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv\r |
| 182 | \r |
| 183 | Rem inttypes_.h and inttypes.h map to the same 8.3 alias.\r |
| 184 | test -f %XSRC%/lib/inttypes_.h\r |
| 185 | if not errorlevel 1 mv -f %XSRC%/lib/inttypes_.h %XSRC%/lib/_inttypes.h\r |
| 186 | \r |
| 187 | Rem Make sure crucial file names are not munged by unpacking\r |
| 188 | test -f %XSRC%/po/Makefile.in.in\r |
| 189 | if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in\r |
| 190 | test -f %XSRC%/po/Makefile.in-in\r |
| 191 | if errorlevel 1 mv -f %XSRC%/po/Makefile.in %XSRC%/po/Makefile.in-in\r |
| 192 | test -f %XSRC%/po/Makefile.in-in\r |
| 193 | if errorlevel 1 mv -f %XSRC%/po/Makefile.inin %XSRC%/po/Makefile.in-in\r |
| 194 | test -f %XSRC%/po/Makefile.in-in\r |
| 195 | if errorlevel 1 mv -f %XSRC%/po/Makefile.in_in %XSRC%/po/Makefile.in-in\r |
| 196 | test -f %XSRC%/po/Makefile.in-in\r |
| 197 | if errorlevel 1 mv -f %XSRC%/po/Makefile_in.in %XSRC%/po/Makefile.in-in\r |
| 198 | test -f %XSRC%/runtime-po/Makefile.in.in\r |
| 199 | if not errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in.in %XSRC%/runtime-po/Makefile.in-in\r |
| 200 | test -f %XSRC%/runtime-po/Makefile.in-in\r |
| 201 | if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in %XSRC%/runtime-po/Makefile.in-in\r |
| 202 | test -f %XSRC%/runtime-po/Makefile.in-in\r |
| 203 | if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.inin %XSRC%/runtime-po/Makefile.in-in\r |
| 204 | test -f %XSRC%/runtime-po/Makefile.in-in\r |
| 205 | if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in_in %XSRC%/runtime-po/Makefile.in-in\r |
| 206 | test -f %XSRC%/runtime-po/Makefile.in-in\r |
| 207 | if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile_in.in %XSRC%/runtime-po/Makefile.in-in\r |
| 208 | test -f %XSRC%/data/c++.m4\r |
| 209 | if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4\r |
| 210 | test -f %XSRC%/data/cxx.m4\r |
| 211 | if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %XSRC%/data/cxx.m4\r |
| 212 | :scan_gram_c_Test\r |
| 213 | test -f %XSRC%/src/c-scan-gram.c\r |
| 214 | if not errorlevel 1 goto scan_skel_c_Test\r |
| 215 | test -f %XSRC%/src/scan-gram-c.c\r |
| 216 | if not errorlevel 1 mv -f %XSRC%/src/scan-gram-c.c %XSRC%/src/c-scan-gram.c\r |
| 217 | :scan_skel_c_Test\r |
| 218 | test -f %XSRC%/src/c-scan-skel.c\r |
| 219 | if not errorlevel 1 goto FixFiles\r |
| 220 | test -f %XSRC%/src/scan-skel-c.c\r |
| 221 | if not errorlevel 1 mv -f %XSRC%/src/scan-skel-c.c %XSRC%/src/c-scan-skel.c\r |
| 222 | \r |
| 223 | :FixFiles\r |
| 224 | Rem Fix data/lalr1.cc and data/location.cc to reflect the renaming of c++.m4\r |
| 225 | sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc\r |
| 226 | if errorlevel 1 goto lalr1_ccFileError\r |
| 227 | mv ./lalr1.cc %XSRC%/data/lalr1.cc\r |
| 228 | sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.cc\r |
| 229 | if errorlevel 1 goto location.ccFileError\r |
| 230 | mv ./location.cc %XSRC%/data/location.cc\r |
| 231 | sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.cc\r |
| 232 | if errorlevel 1 goto glr.ccFileError\r |
| 233 | mv ./glr.cc %XSRC%/data/glr.cc\r |
| 234 | \r |
| 235 | Rem Define DJGPP specific defs in config.hin\r |
| 236 | echo Editing config.hin...\r |
| 237 | test -f %XSRC%/lib/config_h.org\r |
| 238 | if errorlevel 1 update %XSRC%/lib/config.hin %XSRC%/lib/config_h.org\r |
| 239 | sed -f %XSRC%/djgpp/config_h.sed %XSRC%/lib/config_h.org > config.hin\r |
| 240 | if errorlevel 1 goto SedError2\r |
| 241 | mv -f config.hin %XSRC%/lib/config.hin\r |
| 242 | \r |
| 243 | \r |
| 244 | Rem Fixing ilicit testsuite file name.\r |
| 245 | test -f %XSRC%/tests/c++.at\r |
| 246 | if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at\r |
| 247 | \r |
| 248 | Rem Fixing ilicit calc++ file names in the calc++ directory.\r |
| 249 | test -d %XSRC%/examples/calc++\r |
| 250 | if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx\r |
| 251 | test -d %XSRC%/examples/calcxx\r |
| 252 | if errorlevel 1 mv -f %XSRC%/examples/calcpp %XSRC%/examples/calcxx\r |
| 253 | test -f %XSRC%/examples/calcxx/calc++-scanner.cc\r |
| 254 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r |
| 255 | test -f %XSRC%/examples/calcxx/calcxx-scanner.cc\r |
| 256 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r |
| 257 | test -f %XSRC%/examples/calcxx/calc++-scanner.ll\r |
| 258 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r |
| 259 | test -f %XSRC%/examples/calcxx/calcxx-scanner.ll\r |
| 260 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r |
| 261 | test -f %XSRC%/examples/calcxx/calc++-driver.cc\r |
| 262 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r |
| 263 | test -f %XSRC%/examples/calcxx/calcxx-driver.cc\r |
| 264 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r |
| 265 | test -f %XSRC%/examples/calcxx/calc++-driver.hh\r |
| 266 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r |
| 267 | test -f %XSRC%/examples/calcxx/calcxx-driver.hh\r |
| 268 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r |
| 269 | test -f %XSRC%/examples/calcxx/calc++-parser.cc\r |
| 270 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r |
| 271 | test -f %XSRC%/examples/calcxx/calcxx-parser.cc\r |
| 272 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r |
| 273 | test -f %XSRC%/examples/calcxx/calc++-parser.hh\r |
| 274 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r |
| 275 | test -f %XSRC%/examples/calcxx/calcxx-parser.hh\r |
| 276 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r |
| 277 | test -f %XSRC%/examples/calcxx/calc++-parser.stamp\r |
| 278 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp\r |
| 279 | test -f %XSRC%/examples/calcxx/calcxx-parser.stamp\r |
| 280 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp\r |
| 281 | test -f %XSRC%/examples/calcxx/calc++-parser.yy\r |
| 282 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r |
| 283 | test -f %XSRC%/examples/calcxx/calcxx-parser.yy\r |
| 284 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r |
| 285 | test -f %XSRC%/examples/calcxx/calc++.cc\r |
| 286 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++.cc %XSRC%/examples/calcxx/calcxx.cc\r |
| 287 | test -f %XSRC%/examples/calcxx/calcxx.cc\r |
| 288 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc\r |
| 289 | \r |
| 290 | Rem Fixing #include lines in calcxx files.\r |
| 291 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc\r |
| 292 | if errorlevel 1 goto calcxxFileError\r |
| 293 | mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc\r |
| 294 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc\r |
| 295 | if errorlevel 1 goto calcxxFileError\r |
| 296 | mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r |
| 297 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh\r |
| 298 | if errorlevel 1 goto calcxxFileError\r |
| 299 | mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r |
| 300 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc\r |
| 301 | if errorlevel 1 goto calcxxFileError\r |
| 302 | mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r |
| 303 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh\r |
| 304 | if errorlevel 1 goto calcxxFileError\r |
| 305 | mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r |
| 306 | :sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy\r |
| 307 | :if errorlevel 1 goto calcxxFileError\r |
| 308 | :mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r |
| 309 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc\r |
| 310 | if errorlevel 1 goto calcxxFileError\r |
| 311 | mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r |
| 312 | :sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll\r |
| 313 | :if errorlevel 1 goto calcxxFileError\r |
| 314 | :mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r |
| 315 | sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test\r |
| 316 | if errorlevel 1 goto calcxxFileError\r |
| 317 | mv ./test %XSRC%/examples/calcxx/test\r |
| 318 | \r |
| 319 | \r |
| 320 | Rem Fixing the scanner files to make file names 8.3 valid.\r |
| 321 | Rem Use only if you want to change the scan-gram.l and scan-skel.l files.\r |
| 322 | : sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-gram.l > scan-gram.l\r |
| 323 | : if errorlevel 1 goto ScannerFileError\r |
| 324 | : mv ./scan-gram.l %XSRC%/src/scan-gram.l\r |
| 325 | : sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-skel.l > scan-skel.l\r |
| 326 | : if errorlevel 1 goto ScannerFileError\r |
| 327 | : mv ./scan-skel.l %XSRC%/src/scan-skel.l\r |
| 328 | \r |
| 329 | \r |
| 330 | Rem This is required because DOS/Windows are case-insensitive\r |
| 331 | Rem to file names, and "make install" will do nothing if Make\r |
| 332 | Rem finds a file called `install'.\r |
| 333 | if exist INSTALL ren INSTALL INSTALL.txt\r |
| 334 | \r |
| 335 | Rem Set SHELL to a sane default or some configure tests stop working\r |
| 336 | Rem if the package is configured across partitions.\r |
| 337 | if not "%SHELL%" == "" goto HomeName\r |
| 338 | set SHELL=/bin/sh\r |
| 339 | if not "%SHELL%" == "/bin/sh" goto SmallEnv\r |
| 340 | echo No SHELL found in the environment, using default value\r |
| 341 | \r |
| 342 | :HomeName\r |
| 343 | Rem Set HOME to a sane default so configure stops complaining.\r |
| 344 | if not "%HOME%" == "" goto HostName\r |
| 345 | set HOME=%XSRC%/djgpp\r |
| 346 | if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv\r |
| 347 | echo No HOME found in the environment, using default value\r |
| 348 | \r |
| 349 | :HostName\r |
| 350 | Rem Set HOSTNAME so it shows in config.status\r |
| 351 | if not "%HOSTNAME%" == "" goto hostdone\r |
| 352 | if "%windir%" == "" goto msdos\r |
| 353 | set OS=MS-Windows\r |
| 354 | if not "%OS%" == "MS-Windows" goto SmallEnv\r |
| 355 | goto haveos\r |
| 356 | :msdos\r |
| 357 | set OS=MS-DOS\r |
| 358 | if not "%OS%" == "MS-DOS" goto SmallEnv\r |
| 359 | :haveos\r |
| 360 | if not "%USERNAME%" == "" goto haveuname\r |
| 361 | if not "%USER%" == "" goto haveuser\r |
| 362 | echo No USERNAME and no USER found in the environment, using default values\r |
| 363 | set HOSTNAME=Unknown PC\r |
| 364 | if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv\r |
| 365 | goto userdone\r |
| 366 | :haveuser\r |
| 367 | set HOSTNAME=%USER%'s PC\r |
| 368 | if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv\r |
| 369 | goto userdone\r |
| 370 | :haveuname\r |
| 371 | set HOSTNAME=%USERNAME%'s PC\r |
| 372 | if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv\r |
| 373 | :userdone\r |
| 374 | set _HOSTNAME=%HOSTNAME%, %OS%\r |
| 375 | if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv\r |
| 376 | set HOSTNAME=%_HOSTNAME%\r |
| 377 | :hostdone\r |
| 378 | set _HOSTNAME=\r |
| 379 | set OS=\r |
| 380 | \r |
| 381 | Rem install-sh is required by the configure script but clashes with the\r |
| 382 | Rem various Makefile install-foo targets, so we MUST have it before the\r |
| 383 | Rem script runs and rename it afterwards\r |
| 384 | test -f %XSRC%/install-sh\r |
| 385 | if not errorlevel 1 goto NoRen0\r |
| 386 | test -f %XSRC%/install-sh.sh\r |
| 387 | if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh\r |
| 388 | :NoRen0\r |
| 389 | \r |
| 390 | if "%NLS%" == "disabled" goto WithoutNLS\r |
| 391 | \r |
| 392 | :WithNLS\r |
| 393 | Rem Check for the needed libraries and binaries.\r |
| 394 | test -x /dev/env/DJDIR/bin/msgfmt.exe\r |
| 395 | if errorlevel 1 goto MissingNLSTools\r |
| 396 | test -x /dev/env/DJDIR/bin/xgettext.exe\r |
| 397 | if errorlevel 1 goto MissingNLSTools\r |
| 398 | test -f /dev/env/DJDIR/include/libcharset.h\r |
| 399 | if errorlevel 1 goto MissingNLSTools\r |
| 400 | test -f /dev/env/DJDIR/lib/libcharset.a\r |
| 401 | if errorlevel 1 goto MissingNLSTools\r |
| 402 | test -f /dev/env/DJDIR/include/iconv.h\r |
| 403 | if errorlevel 1 goto MissingNLSTools\r |
| 404 | test -f /dev/env/DJDIR/lib/libiconv.a\r |
| 405 | if errorlevel 1 goto MissingNLSTools\r |
| 406 | test -f /dev/env/DJDIR/include/libintl.h\r |
| 407 | if errorlevel 1 goto MissingNLSTools\r |
| 408 | test -f /dev/env/DJDIR/lib/libintl.a\r |
| 409 | if errorlevel 1 goto MissingNLSTools\r |
| 410 | \r |
| 411 | Rem Recreate the files in the %XSRC%/po subdir with our ported tools.\r |
| 412 | redir -e /dev/null rm %XSRC%/po/*.gmo\r |
| 413 | redir -e /dev/null rm %XSRC%/po/bison.pot\r |
| 414 | redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c\r |
| 415 | redir -e /dev/null rm %XSRC%/po/stamp-cat-id\r |
| 416 | \r |
| 417 | Rem Update the arguments file for the configure script.\r |
| 418 | Rem We prefer without-included-gettext because libintl.a from gettext package\r |
| 419 | Rem is the only one that is garanteed to have been ported to DJGPP.\r |
| 420 | echo --enable-nls --without-included-gettext >> arguments\r |
| 421 | goto ConfigurePackage\r |
| 422 | \r |
| 423 | :MissingNLSTools\r |
| 424 | echo Needed libs/tools for NLS not found. Configuring without NLS.\r |
| 425 | :WithoutNLS\r |
| 426 | Rem Update the arguments file for the configure script.\r |
| 427 | echo --disable-nls >> arguments\r |
| 428 | \r |
| 429 | :ConfigurePackage\r |
| 430 | echo Running the ./configure script...\r |
| 431 | sh ./configure @arguments\r |
| 432 | if errorlevel 1 goto CfgError\r |
| 433 | rm arguments\r |
| 434 | echo Done.\r |
| 435 | goto End\r |
| 436 | \r |
| 437 | :lalr1_ccFileError\r |
| 438 | echo ./data/lalr1.cc file editing failed!\r |
| 439 | goto End\r |
| 440 | \r |
| 441 | :glr_ccFileError\r |
| 442 | echo ./data/glr.cc file editing failed!\r |
| 443 | goto End\r |
| 444 | \r |
| 445 | :location_ccFileError\r |
| 446 | echo ./data/location.cc file editing failed!\r |
| 447 | goto End\r |
| 448 | \r |
| 449 | :calcxxFileError\r |
| 450 | echo ./examples/calcxx file editing failed!\r |
| 451 | goto End\r |
| 452 | \r |
| 453 | :ScannerFileError\r |
| 454 | echo ./scanner file editing failed!\r |
| 455 | goto End\r |
| 456 | \r |
| 457 | :SedError\r |
| 458 | echo ./configure script editing failed!\r |
| 459 | goto End\r |
| 460 | \r |
| 461 | :SedError2\r |
| 462 | echo ./config.hin editing failed!\r |
| 463 | goto End\r |
| 464 | \r |
| 465 | :CfgError\r |
| 466 | echo ./configure script exited abnormally!\r |
| 467 | goto End\r |
| 468 | \r |
| 469 | :SmallEnv\r |
| 470 | echo Your environment size is too small. Enlarge it and run me again.\r |
| 471 | echo Configuration NOT done!\r |
| 472 | \r |
| 473 | :End\r |
| 474 | test -f %XSRC%/install-sh.sh\r |
| 475 | if not errorlevel 1 goto NoRen1\r |
| 476 | test -f %XSRC%/install-sh\r |
| 477 | if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh\r |
| 478 | :NoRen1\r |
| 479 | if "%SHELL%" == "/bin/sh" set SHELL=\r |
| 480 | if "%HOME%" == "%XSRC%/djgpp" set HOME=\r |
| 481 | set CONFIG_SITE=\r |
| 482 | set HOSTNAME=\r |
| 483 | set NLS=\r |
| 484 | set XSRC=\r |