]>
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 | |
02650b7f PE |
7 | Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.\r |
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 | |
215 | \r | |
90ddbd5e JMG |
216 | :scan_gram_c_Test\r |
217 | test -f %XSRC%/src/c-scan-gram.c\r | |
218 | if not errorlevel 1 goto scan_skel_c_Test\r | |
219 | test -f %XSRC%/src/scan-gram-c.c\r | |
220 | if not errorlevel 1 mv -f %XSRC%/src/scan-gram-c.c %XSRC%/src/c-scan-gram.c\r | |
221 | :scan_skel_c_Test\r | |
222 | test -f %XSRC%/src/c-scan-skel.c\r | |
223 | if not errorlevel 1 goto FixFiles\r | |
224 | test -f %XSRC%/src/scan-skel-c.c\r | |
225 | if not errorlevel 1 mv -f %XSRC%/src/scan-skel-c.c %XSRC%/src/c-scan-skel.c\r | |
3768a1ae | 226 | \r |
90ddbd5e | 227 | :FixFiles\r |
c59929c3 | 228 | Rem Fix data/lalr1.cc and data/location.cc to reflect the renaming of c++.m4\r |
3768a1ae JMG |
229 | sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc\r |
230 | if errorlevel 1 goto lalr1_ccFileError\r | |
231 | mv ./lalr1.cc %XSRC%/data/lalr1.cc\r | |
c59929c3 | 232 | sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.cc\r |
0d1c1cab | 233 | if errorlevel 1 goto location_ccFileError\r |
c59929c3 | 234 | mv ./location.cc %XSRC%/data/location.cc\r |
b9471884 | 235 | sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.cc\r |
0d1c1cab | 236 | if errorlevel 1 goto glr_ccFileError\r |
b9471884 | 237 | mv ./glr.cc %XSRC%/data/glr.cc\r |
3768a1ae | 238 | \r |
0d1c1cab JMG |
239 | Rem Fix src/getargs.c to reflect the renaming of c++-skel.m4\r |
240 | sed "s/c++-skel\.m4/cxx-skel.m4/" %XSRC%/src/getargs.c > getargs.c\r | |
241 | if errorlevel 1 goto getargs_cFileError\r | |
242 | mv ./getargs.c %XSRC%/src/getargs.c\r | |
243 | \r | |
3768a1ae JMG |
244 | Rem Define DJGPP specific defs in config.hin\r |
245 | echo Editing config.hin...\r | |
12ab1c9d JMG |
246 | test -f %XSRC%/lib/config_h.org\r |
247 | if errorlevel 1 update %XSRC%/lib/config.hin %XSRC%/lib/config_h.org\r | |
248 | sed -f %XSRC%/djgpp/config_h.sed %XSRC%/lib/config_h.org > config.hin\r | |
3768a1ae | 249 | if errorlevel 1 goto SedError2\r |
179de98b | 250 | mv -f config.hin %XSRC%/lib/config.hin\r |
3768a1ae JMG |
251 | \r |
252 | \r | |
253 | Rem Fixing ilicit testsuite file name.\r | |
254 | test -f %XSRC%/tests/c++.at\r | |
255 | if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at\r | |
256 | \r | |
7ac22ca6 JMG |
257 | test -f %XSRC%/tests/testsuite.org\r |
258 | if errorlevel 1 update %XSRC%/tests/testsuite %XSRC%/tests/testsuite.org\r | |
259 | sed -f %XSRC%/djgpp/testsuite.sed %XSRC%/tests/testsuite.org > testsuite.tmp\r | |
260 | if errorlevel 1 goto SedError3\r | |
261 | mv -f ./testsuite.tmp %XSRC%/tests/testsuite\r | |
262 | \r | |
3768a1ae JMG |
263 | Rem Fixing ilicit calc++ file names in the calc++ directory.\r |
264 | test -d %XSRC%/examples/calc++\r | |
265 | if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx\r | |
266 | test -d %XSRC%/examples/calcxx\r | |
267 | if errorlevel 1 mv -f %XSRC%/examples/calcpp %XSRC%/examples/calcxx\r | |
268 | test -f %XSRC%/examples/calcxx/calc++-scanner.cc\r | |
269 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r | |
270 | test -f %XSRC%/examples/calcxx/calcxx-scanner.cc\r | |
271 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r | |
272 | test -f %XSRC%/examples/calcxx/calc++-scanner.ll\r | |
273 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r | |
274 | test -f %XSRC%/examples/calcxx/calcxx-scanner.ll\r | |
275 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r | |
276 | test -f %XSRC%/examples/calcxx/calc++-driver.cc\r | |
277 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r | |
278 | test -f %XSRC%/examples/calcxx/calcxx-driver.cc\r | |
279 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r | |
280 | test -f %XSRC%/examples/calcxx/calc++-driver.hh\r | |
281 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r | |
282 | test -f %XSRC%/examples/calcxx/calcxx-driver.hh\r | |
283 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r | |
284 | test -f %XSRC%/examples/calcxx/calc++-parser.cc\r | |
285 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r | |
286 | test -f %XSRC%/examples/calcxx/calcxx-parser.cc\r | |
287 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r | |
288 | test -f %XSRC%/examples/calcxx/calc++-parser.hh\r | |
289 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r | |
290 | test -f %XSRC%/examples/calcxx/calcxx-parser.hh\r | |
291 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r | |
292 | test -f %XSRC%/examples/calcxx/calc++-parser.stamp\r | |
293 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp\r | |
294 | test -f %XSRC%/examples/calcxx/calcxx-parser.stamp\r | |
295 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp\r | |
296 | test -f %XSRC%/examples/calcxx/calc++-parser.yy\r | |
297 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r | |
298 | test -f %XSRC%/examples/calcxx/calcxx-parser.yy\r | |
299 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r | |
300 | test -f %XSRC%/examples/calcxx/calc++.cc\r | |
301 | if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++.cc %XSRC%/examples/calcxx/calcxx.cc\r | |
302 | test -f %XSRC%/examples/calcxx/calcxx.cc\r | |
303 | if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc\r | |
304 | \r | |
305 | Rem Fixing #include lines in calcxx files.\r | |
02650b7f | 306 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc\r |
3768a1ae JMG |
307 | if errorlevel 1 goto calcxxFileError\r |
308 | mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc\r | |
02650b7f | 309 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc\r |
3768a1ae JMG |
310 | if errorlevel 1 goto calcxxFileError\r |
311 | mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc\r | |
02650b7f | 312 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh\r |
3768a1ae JMG |
313 | if errorlevel 1 goto calcxxFileError\r |
314 | mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh\r | |
02650b7f | 315 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc\r |
3768a1ae JMG |
316 | if errorlevel 1 goto calcxxFileError\r |
317 | mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc\r | |
02650b7f | 318 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh\r |
3768a1ae JMG |
319 | if errorlevel 1 goto calcxxFileError\r |
320 | mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh\r | |
02650b7f | 321 | :sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy\r |
3768a1ae JMG |
322 | :if errorlevel 1 goto calcxxFileError\r |
323 | :mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy\r | |
02650b7f | 324 | sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc\r |
3768a1ae JMG |
325 | if errorlevel 1 goto calcxxFileError\r |
326 | mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc\r | |
02650b7f | 327 | :sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll\r |
3768a1ae JMG |
328 | :if errorlevel 1 goto calcxxFileError\r |
329 | :mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll\r | |
330 | sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test\r | |
331 | if errorlevel 1 goto calcxxFileError\r | |
332 | mv ./test %XSRC%/examples/calcxx/test\r | |
333 | \r | |
334 | \r | |
335 | Rem Fixing the scanner files to make file names 8.3 valid.\r | |
336 | Rem Use only if you want to change the scan-gram.l and scan-skel.l files.\r | |
337 | : sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-gram.l > scan-gram.l\r | |
338 | : if errorlevel 1 goto ScannerFileError\r | |
339 | : mv ./scan-gram.l %XSRC%/src/scan-gram.l\r | |
340 | : sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-skel.l > scan-skel.l\r | |
341 | : if errorlevel 1 goto ScannerFileError\r | |
342 | : mv ./scan-skel.l %XSRC%/src/scan-skel.l\r | |
343 | \r | |
344 | \r | |
345 | Rem This is required because DOS/Windows are case-insensitive\r | |
346 | Rem to file names, and "make install" will do nothing if Make\r | |
347 | Rem finds a file called `install'.\r | |
348 | if exist INSTALL ren INSTALL INSTALL.txt\r | |
349 | \r | |
350 | Rem Set SHELL to a sane default or some configure tests stop working\r | |
351 | Rem if the package is configured across partitions.\r | |
352 | if not "%SHELL%" == "" goto HomeName\r | |
353 | set SHELL=/bin/sh\r | |
354 | if not "%SHELL%" == "/bin/sh" goto SmallEnv\r | |
355 | echo No SHELL found in the environment, using default value\r | |
356 | \r | |
357 | :HomeName\r | |
358 | Rem Set HOME to a sane default so configure stops complaining.\r | |
359 | if not "%HOME%" == "" goto HostName\r | |
360 | set HOME=%XSRC%/djgpp\r | |
361 | if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv\r | |
362 | echo No HOME found in the environment, using default value\r | |
363 | \r | |
364 | :HostName\r | |
365 | Rem Set HOSTNAME so it shows in config.status\r | |
366 | if not "%HOSTNAME%" == "" goto hostdone\r | |
367 | if "%windir%" == "" goto msdos\r | |
368 | set OS=MS-Windows\r | |
369 | if not "%OS%" == "MS-Windows" goto SmallEnv\r | |
370 | goto haveos\r | |
371 | :msdos\r | |
372 | set OS=MS-DOS\r | |
373 | if not "%OS%" == "MS-DOS" goto SmallEnv\r | |
374 | :haveos\r | |
375 | if not "%USERNAME%" == "" goto haveuname\r | |
376 | if not "%USER%" == "" goto haveuser\r | |
377 | echo No USERNAME and no USER found in the environment, using default values\r | |
378 | set HOSTNAME=Unknown PC\r | |
379 | if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv\r | |
380 | goto userdone\r | |
381 | :haveuser\r | |
382 | set HOSTNAME=%USER%'s PC\r | |
383 | if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv\r | |
384 | goto userdone\r | |
385 | :haveuname\r | |
386 | set HOSTNAME=%USERNAME%'s PC\r | |
387 | if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv\r | |
388 | :userdone\r | |
389 | set _HOSTNAME=%HOSTNAME%, %OS%\r | |
390 | if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv\r | |
391 | set HOSTNAME=%_HOSTNAME%\r | |
392 | :hostdone\r | |
393 | set _HOSTNAME=\r | |
394 | set OS=\r | |
395 | \r | |
396 | Rem install-sh is required by the configure script but clashes with the\r | |
397 | Rem various Makefile install-foo targets, so we MUST have it before the\r | |
398 | Rem script runs and rename it afterwards\r | |
399 | test -f %XSRC%/install-sh\r | |
400 | if not errorlevel 1 goto NoRen0\r | |
401 | test -f %XSRC%/install-sh.sh\r | |
402 | if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh\r | |
403 | :NoRen0\r | |
404 | \r | |
405 | if "%NLS%" == "disabled" goto WithoutNLS\r | |
406 | \r | |
407 | :WithNLS\r | |
408 | Rem Check for the needed libraries and binaries.\r | |
409 | test -x /dev/env/DJDIR/bin/msgfmt.exe\r | |
410 | if errorlevel 1 goto MissingNLSTools\r | |
411 | test -x /dev/env/DJDIR/bin/xgettext.exe\r | |
412 | if errorlevel 1 goto MissingNLSTools\r | |
413 | test -f /dev/env/DJDIR/include/libcharset.h\r | |
414 | if errorlevel 1 goto MissingNLSTools\r | |
415 | test -f /dev/env/DJDIR/lib/libcharset.a\r | |
416 | if errorlevel 1 goto MissingNLSTools\r | |
417 | test -f /dev/env/DJDIR/include/iconv.h\r | |
418 | if errorlevel 1 goto MissingNLSTools\r | |
419 | test -f /dev/env/DJDIR/lib/libiconv.a\r | |
420 | if errorlevel 1 goto MissingNLSTools\r | |
421 | test -f /dev/env/DJDIR/include/libintl.h\r | |
422 | if errorlevel 1 goto MissingNLSTools\r | |
423 | test -f /dev/env/DJDIR/lib/libintl.a\r | |
424 | if errorlevel 1 goto MissingNLSTools\r | |
425 | \r | |
426 | Rem Recreate the files in the %XSRC%/po subdir with our ported tools.\r | |
427 | redir -e /dev/null rm %XSRC%/po/*.gmo\r | |
428 | redir -e /dev/null rm %XSRC%/po/bison.pot\r | |
429 | redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c\r | |
430 | redir -e /dev/null rm %XSRC%/po/stamp-cat-id\r | |
431 | \r | |
432 | Rem Update the arguments file for the configure script.\r | |
433 | Rem We prefer without-included-gettext because libintl.a from gettext package\r | |
434 | Rem is the only one that is garanteed to have been ported to DJGPP.\r | |
c4d50517 | 435 | echo --enable-nls --without-included-gettext >> args\r |
3768a1ae JMG |
436 | goto ConfigurePackage\r |
437 | \r | |
438 | :MissingNLSTools\r | |
439 | echo Needed libs/tools for NLS not found. Configuring without NLS.\r | |
440 | :WithoutNLS\r | |
441 | Rem Update the arguments file for the configure script.\r | |
c4d50517 | 442 | echo --disable-nls >> args\r |
3768a1ae JMG |
443 | \r |
444 | :ConfigurePackage\r | |
445 | echo Running the ./configure script...\r | |
c4d50517 | 446 | sh ./configure @args\r |
3768a1ae | 447 | if errorlevel 1 goto CfgError\r |
c4d50517 | 448 | rm args\r |
3768a1ae JMG |
449 | echo Done.\r |
450 | goto End\r | |
451 | \r | |
452 | :lalr1_ccFileError\r | |
453 | echo ./data/lalr1.cc file editing failed!\r | |
454 | goto End\r | |
455 | \r | |
b9471884 JMG |
456 | :glr_ccFileError\r |
457 | echo ./data/glr.cc file editing failed!\r | |
458 | goto End\r | |
459 | \r | |
0d1c1cab JMG |
460 | :getargs_cFileError\r |
461 | echo ./src/getargs.c file editing failed!\r | |
462 | goto End\r | |
463 | \r | |
c59929c3 JMG |
464 | :location_ccFileError\r |
465 | echo ./data/location.cc file editing failed!\r | |
466 | goto End\r | |
467 | \r | |
3768a1ae JMG |
468 | :calcxxFileError\r |
469 | echo ./examples/calcxx file editing failed!\r | |
470 | goto End\r | |
471 | \r | |
472 | :ScannerFileError\r | |
473 | echo ./scanner file editing failed!\r | |
474 | goto End\r | |
475 | \r | |
476 | :SedError\r | |
477 | echo ./configure script editing failed!\r | |
478 | goto End\r | |
479 | \r | |
480 | :SedError2\r | |
7ac22ca6 JMG |
481 | echo ./lib/config.hin editing failed!\r |
482 | goto End\r | |
483 | \r | |
484 | :SedError3\r | |
485 | echo ./tests/testsuite editing failed!\r | |
3768a1ae JMG |
486 | goto End\r |
487 | \r | |
488 | :CfgError\r | |
489 | echo ./configure script exited abnormally!\r | |
490 | goto End\r | |
491 | \r | |
492 | :SmallEnv\r | |
493 | echo Your environment size is too small. Enlarge it and run me again.\r | |
494 | echo Configuration NOT done!\r | |
495 | \r | |
496 | :End\r | |
497 | test -f %XSRC%/install-sh.sh\r | |
498 | if not errorlevel 1 goto NoRen1\r | |
499 | test -f %XSRC%/install-sh\r | |
500 | if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh\r | |
501 | :NoRen1\r | |
502 | if "%SHELL%" == "/bin/sh" set SHELL=\r | |
503 | if "%HOME%" == "%XSRC%/djgpp" set HOME=\r | |
3768a1ae JMG |
504 | set CONFIG_SITE=\r |
505 | set HOSTNAME=\r | |
506 | set NLS=\r | |
3768a1ae | 507 | set XSRC=\r |