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