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