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