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