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