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