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