Commit | Line | Data |
---|---|---|
f466241d EZ |
1 | @echo off\r |
2 | rem ----------------------------------------------------------------------\r | |
ee705a5c | 3 | rem Configuration script for MS Windows operating systems\r |
acaf905b | 4 | rem Copyright (C) 1999-2012 Free Software Foundation, Inc.\r |
f466241d EZ |
5 | \r |
6 | rem This file is part of GNU Emacs.\r | |
7 | \r | |
eef0be9e | 8 | rem GNU Emacs is free software: you can redistribute it and/or modify\r |
f466241d | 9 | rem it under the terms of the GNU General Public License as published by\r |
eef0be9e GM |
10 | rem the Free Software Foundation, either version 3 of the License, or\r |
11 | rem (at your option) any later version.\r | |
f466241d EZ |
12 | \r |
13 | rem GNU Emacs is distributed in the hope that it will be useful,\r | |
14 | rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r | |
15 | rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r | |
16 | rem GNU General Public License for more details.\r | |
17 | \r | |
18 | rem You should have received a copy of the GNU General Public License\r | |
eef0be9e GM |
19 | rem along with GNU Emacs. If not, see http://www.gnu.org/licenses/.\r |
20 | \r | |
f466241d EZ |
21 | rem ----------------------------------------------------------------------\r |
22 | rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r | |
23 | rem\r | |
ee705a5c | 24 | rem + MS Windows 95, NT or later\r |
361823f4 | 25 | rem + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75\r |
56a469c3 EZ |
26 | rem or later) and the Mingw32 and W32 API headers and libraries.\r |
27 | rem + Visual Studio 2005 is not supported at this time.\r | |
f466241d | 28 | rem\r |
361823f4 | 29 | rem For reference, here is a list of which builds of GNU make are known to\r |
f466241d EZ |
30 | rem work or not, and whether they work in the presence and/or absence of\r |
31 | rem sh.exe.\r | |
7019fb66 | 32 | rem\r |
f466241d | 33 | rem sh exists no sh\r |
56a469c3 | 34 | rem cygwin b20.1 make (3.75): fails[1,5] fails[2,5]\r |
f466241d EZ |
35 | rem MSVC compiled gmake 3.77: okay okay\r |
36 | rem MSVC compiled gmake 3.78.1: okay okay\r | |
37 | rem MSVC compiled gmake 3.79.1: okay okay\r | |
56a469c3 EZ |
38 | rem mingw32/gcc-2.92.2 make (3.77): okay okay[4]\r |
39 | rem cygwin compiled gmake 3.77: fails[1,5] fails[2,5]\r | |
40 | rem cygwin compiled gmake 3.78.1: fails[5] fails[2,5]\r | |
41 | rem cygwin compiled gmake 3.79.1: fails[3,5] fails[2?,5]\r | |
17f55fae EZ |
42 | rem cygwin compiled make 3.80: okay[6] fails?[7]\r |
43 | rem cygwin compiled make 3.81: fails fails?[7]\r | |
56a469c3 | 44 | rem mingw32 compiled make 3.79.1: okay okay\r |
17f55fae EZ |
45 | rem mingw32 compiled make 3.80: okay okay?[7]\r |
46 | rem mingw32 compiled make 3.81: okay okay[8]\r | |
f466241d EZ |
47 | rem\r |
48 | rem [1] doesn't cope with makefiles with DOS line endings, so must mount\r | |
49 | rem emacs source with text!=binary.\r | |
50 | rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.\r | |
56a469c3 EZ |
51 | rem [3] requires LC_MESSAGES support to build; cannot build with early\r |
52 | rem versions of cygwin.\r | |
53 | rem [4] may fail on Windows 9X and Windows ME; if so, install Bash.\r | |
54 | rem [5] fails when building leim due to the use of cygwin style paths.\r | |
55 | rem May work if building emacs without leim.\r | |
17f55fae EZ |
56 | rem [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath';\r |
57 | rem look for "cygpath" near line 85 of gmake.defs.\r | |
58 | rem [7] not recommended; please report if you try this combination.\r | |
59 | rem [8] tested only on Windows XP.\r | |
f466241d EZ |
60 | rem\r |
61 | \r | |
dbbdb507 EZ |
62 | if exist config.log del config.log\r |
63 | \r | |
f466241d EZ |
64 | rem ----------------------------------------------------------------------\r |
65 | rem See if the environment is large enough. We need 43 (?) bytes.\r | |
66 | set $foo$=123456789_123456789_123456789_123456789_123\r | |
67 | if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv\r | |
68 | set $foo$=\r | |
69 | \r | |
70 | rem ----------------------------------------------------------------------\r | |
71 | rem Make sure we are running in the nt subdir\r | |
72 | if exist configure.bat goto start\r | |
73 | echo You must run configure from the nt subdirectory.\r | |
74 | goto end\r | |
75 | \r | |
76 | :start\r | |
4a1a6b5b BK |
77 | rem ----------------------------------------------------------------------\r |
78 | rem Attempt to enable command extensions. Set use_extensions to 1 if\r | |
79 | rem they are available and 0 if they are not available.\r | |
80 | set use_extensions=1\r | |
81 | setlocal ENABLEEXTENSIONS\r | |
82 | if "%CMDEXTVERSION%" == "" set use_extensions=0\r | |
83 | if "%use_extensions%" == "1" goto afterext\r | |
84 | \r | |
85 | echo. Command extensions are not available. Using parameters that include the =\r | |
86 | echo. character by enclosing them in quotes will not be supported.\r | |
87 | \r | |
88 | :afterext\r | |
89 | \r | |
f466241d EZ |
90 | rem ----------------------------------------------------------------------\r |
91 | rem Default settings.\r | |
92 | set prefix=\r | |
93 | set nodebug=N\r | |
94 | set noopt=N\r | |
7d0170c8 | 95 | set enablechecking=N\r |
75663c75 | 96 | set profile=N\r |
f466241d EZ |
97 | set nocygwin=N\r |
98 | set COMPILER=\r | |
99 | set usercflags=\r | |
4d3fcc8e | 100 | set escusercflags=\r |
3a1ebd63 | 101 | set docflags=\r |
f466241d | 102 | set userldflags=\r |
4d3fcc8e | 103 | set escuserldflags=\r |
fd4af8d9 | 104 | set extrauserlibs=\r |
3a1ebd63 | 105 | set doldflags=\r |
fd4af8d9 | 106 | set doextralibs=\r |
f466241d EZ |
107 | set sep1=\r |
108 | set sep2=\r | |
e3aef5c6 | 109 | set sep3=\r |
fd4af8d9 | 110 | set sep4=\r |
e3aef5c6 | 111 | set distfiles=\r |
f466241d EZ |
112 | \r |
113 | rem ----------------------------------------------------------------------\r | |
114 | rem Handle arguments.\r | |
115 | :again\r | |
116 | if "%1" == "-h" goto usage\r | |
117 | if "%1" == "--help" goto usage\r | |
118 | if "%1" == "--prefix" goto setprefix\r | |
119 | if "%1" == "--with-gcc" goto withgcc\r | |
120 | if "%1" == "--with-msvc" goto withmsvc\r | |
121 | if "%1" == "--no-debug" goto nodebug\r | |
122 | if "%1" == "--no-opt" goto noopt\r | |
7d0170c8 | 123 | if "%1" == "--enable-checking" goto enablechecking\r |
75663c75 | 124 | if "%1" == "--profile" goto profile\r |
f466241d EZ |
125 | if "%1" == "--no-cygwin" goto nocygwin\r |
126 | if "%1" == "--cflags" goto usercflags\r | |
127 | if "%1" == "--ldflags" goto userldflags\r | |
fd4af8d9 | 128 | if "%1" == "--lib" goto extrauserlibs\r |
e0006538 | 129 | if "%1" == "--without-png" goto withoutpng\r |
aad0eae4 | 130 | if "%1" == "--without-jpeg" goto withoutjpeg\r |
12ff2dc5 | 131 | if "%1" == "--without-gif" goto withoutgif\r |
47c01e80 | 132 | if "%1" == "--without-tiff" goto withouttiff\r |
fd4af8d9 | 133 | if "%1" == "--without-gnutls" goto withoutgnutls\r |
9078ead6 | 134 | if "%1" == "--without-libxml2" goto withoutlibxml2\r |
507f5dce | 135 | if "%1" == "--without-xpm" goto withoutxpm\r |
8bc63b1a | 136 | if "%1" == "--with-svg" goto withsvg\r |
e3aef5c6 | 137 | if "%1" == "--distfiles" goto distfiles\r |
f466241d | 138 | if "%1" == "" goto checkutils\r |
ee705a5c | 139 | \r |
f466241d EZ |
140 | :usage\r |
141 | echo Usage: configure [options]\r | |
142 | echo Options:\r | |
143 | echo. --prefix PREFIX install Emacs in directory PREFIX\r | |
144 | echo. --with-gcc use GCC to compile Emacs\r | |
145 | echo. --with-msvc use MSVC to compile Emacs\r | |
146 | echo. --no-debug exclude debug info from executables\r | |
147 | echo. --no-opt disable optimization\r | |
0566bc95 | 148 | echo. --enable-checking enable additional run-time checks\r |
75663c75 | 149 | echo. --profile enable profiling\r |
f466241d EZ |
150 | echo. --no-cygwin use -mno-cygwin option with GCC\r |
151 | echo. --cflags FLAG pass FLAG to compiler\r | |
152 | echo. --ldflags FLAG pass FLAG to compiler when linking\r | |
fd4af8d9 | 153 | echo. --lib LIB link to extra library LIB\r |
f01e03d3 JB |
154 | echo. --without-png do not use PNG library even if it is installed\r |
155 | echo. --without-jpeg do not use JPEG library even if it is installed\r | |
156 | echo. --without-gif do not use GIF library even if it is installed\r | |
157 | echo. --without-tiff do not use TIFF library even if it is installed\r | |
158 | echo. --without-xpm do not use XPM library even if it is installed\r | |
e9fce1ac | 159 | echo. --without-gnutls do not use GnuTLS library even if it is installed\r |
9078ead6 | 160 | echo. --without-libxml2 do not use libxml2 library even if it is installed\r |
8d67bc8e | 161 | echo. --with-svg use the RSVG library (experimental)\r |
e3aef5c6 | 162 | echo. --distfiles path to files for make dist, e.g. libXpm.dll\r |
4a1a6b5b BK |
163 | if "%use_extensions%" == "0" goto end\r |
164 | echo.\r | |
165 | echo. The cflags and ldflags arguments support parameters that include the =\r | |
166 | echo. character. However, since the = character is normally treated as a\r | |
167 | echo. separator character you will need to enclose any parameter that includes\r | |
168 | echo. the = character in quotes. For example, to include\r | |
169 | echo. -DSITELOAD_PURESIZE_EXTRA=100000 as one of the cflags you would run\r | |
170 | echo. configure.bat as follows:\r | |
171 | echo. configure.bat --cflags "-DSITELOAD_PURESIZE_EXTRA=100000"\r | |
172 | echo.\r | |
173 | echo. Note that this capability of processing parameters that include the =\r | |
174 | echo. character depends on command extensions. This batch file attempts to\r | |
175 | echo. enable command extensions. If command extensions cannot be enabled, a\r | |
176 | echo. warning message will be displayed.\r | |
f466241d | 177 | goto end\r |
ee705a5c | 178 | \r |
f466241d | 179 | rem ----------------------------------------------------------------------\r |
ee705a5c | 180 | \r |
f466241d EZ |
181 | :setprefix\r |
182 | shift\r | |
183 | set prefix=%1\r | |
184 | shift\r | |
185 | goto again\r | |
ee705a5c | 186 | \r |
f466241d | 187 | rem ----------------------------------------------------------------------\r |
ee705a5c | 188 | \r |
f466241d EZ |
189 | :withgcc\r |
190 | set COMPILER=gcc\r | |
191 | shift\r | |
192 | goto again\r | |
ee705a5c | 193 | \r |
f466241d | 194 | rem ----------------------------------------------------------------------\r |
ee705a5c | 195 | \r |
f466241d EZ |
196 | :withmsvc\r |
197 | set COMPILER=cl\r | |
198 | shift\r | |
199 | goto again\r | |
ee705a5c | 200 | \r |
f466241d | 201 | rem ----------------------------------------------------------------------\r |
ee705a5c | 202 | \r |
f466241d EZ |
203 | :nodebug\r |
204 | set nodebug=Y\r | |
205 | shift\r | |
206 | goto again\r | |
ee705a5c | 207 | \r |
f466241d | 208 | rem ----------------------------------------------------------------------\r |
ee705a5c | 209 | \r |
f466241d EZ |
210 | :noopt\r |
211 | set noopt=Y\r | |
212 | shift\r | |
213 | goto again\r | |
ee705a5c | 214 | \r |
f466241d | 215 | rem ----------------------------------------------------------------------\r |
ee705a5c | 216 | \r |
7d0170c8 JB |
217 | :enablechecking\r |
218 | set enablechecking=Y\r | |
219 | shift\r | |
220 | goto again\r | |
ee705a5c | 221 | \r |
7d0170c8 | 222 | rem ----------------------------------------------------------------------\r |
ee705a5c | 223 | \r |
75663c75 JR |
224 | :profile\r |
225 | set profile=Y\r | |
226 | shift\r | |
227 | goto again\r | |
ee705a5c | 228 | \r |
75663c75 | 229 | rem ----------------------------------------------------------------------\r |
ee705a5c | 230 | \r |
f466241d EZ |
231 | :nocygwin\r |
232 | set nocygwin=Y\r | |
233 | shift\r | |
234 | goto again\r | |
ee705a5c | 235 | \r |
f466241d | 236 | rem ----------------------------------------------------------------------\r |
ee705a5c | 237 | \r |
f466241d | 238 | :usercflags\r |
4a1a6b5b BK |
239 | if "%use_extensions%" == "1" goto ucflagex\r |
240 | goto ucflagne\r | |
241 | \r | |
242 | :ucflagex\r | |
243 | shift\r | |
244 | set usercflags=%usercflags%%sep1%%~1\r | |
4d3fcc8e | 245 | set escusercflags=%usercflags:"=\"%\r |
4a1a6b5b BK |
246 | set sep1= %nothing%\r |
247 | shift\r | |
248 | goto again\r | |
249 | \r | |
250 | :ucflagne\r | |
f466241d EZ |
251 | shift\r |
252 | set usercflags=%usercflags%%sep1%%1\r | |
4d3fcc8e | 253 | set escusercflags=%usercflags%\r |
f466241d EZ |
254 | set sep1= %nothing%\r |
255 | shift\r | |
256 | goto again\r | |
ee705a5c | 257 | \r |
fd4af8d9 TZ |
258 | :extrauserlibs\r |
259 | shift\r | |
260 | echo. extrauserlibs: %extrauserlibs%\r | |
261 | set extrauserlibs=%extrauserlibs%%sep4%%1\r | |
262 | set sep4= %nothing%\r | |
263 | shift\r | |
264 | goto again\r | |
265 | \r | |
f466241d | 266 | rem ----------------------------------------------------------------------\r |
ee705a5c | 267 | \r |
f466241d | 268 | :userldflags\r |
4a1a6b5b BK |
269 | if "%use_extensions%" == "1" goto ulflagex\r |
270 | goto ulflagne\r | |
271 | \r | |
272 | :ulflagex\r | |
273 | shift\r | |
274 | set userldflags=%userldflags%%sep2%%~1\r | |
4d3fcc8e | 275 | set escuserldflags=%userldflags:"=\"%\r |
4a1a6b5b BK |
276 | set sep2= %nothing%\r |
277 | shift\r | |
278 | goto again\r | |
279 | \r | |
280 | :ulflagne\r | |
f466241d EZ |
281 | shift\r |
282 | set userldflags=%userldflags%%sep2%%1\r | |
4d3fcc8e | 283 | set escuserldflags=%userldflags%\r |
f466241d EZ |
284 | set sep2= %nothing%\r |
285 | shift\r | |
286 | goto again\r | |
ee705a5c | 287 | \r |
e0006538 JR |
288 | rem ----------------------------------------------------------------------\r |
289 | \r | |
290 | :withoutpng\r | |
291 | set pngsupport=N\r | |
292 | set HAVE_PNG=\r | |
39bd0e03 | 293 | shift\r |
e0006538 | 294 | goto again\r |
f466241d | 295 | \r |
aad0eae4 JR |
296 | rem ----------------------------------------------------------------------\r |
297 | \r | |
298 | :withoutjpeg\r | |
299 | set jpegsupport=N\r | |
300 | set HAVE_JPEG=\r | |
39bd0e03 | 301 | shift\r |
aad0eae4 JR |
302 | goto again\r |
303 | \r | |
12ff2dc5 JB |
304 | rem ----------------------------------------------------------------------\r |
305 | \r | |
306 | :withoutgif\r | |
307 | set gifsupport=N\r | |
308 | set HAVE_GIF=\r | |
309 | shift\r | |
310 | goto again\r | |
311 | \r | |
47c01e80 JB |
312 | rem ----------------------------------------------------------------------\r |
313 | \r | |
fd4af8d9 TZ |
314 | :withoutgnutls\r |
315 | set tlssupport=N\r | |
316 | set HAVE_GNUTLS=\r | |
317 | shift\r | |
318 | goto again\r | |
319 | \r | |
320 | rem ----------------------------------------------------------------------\r | |
321 | \r | |
9078ead6 EZ |
322 | :withoutlibxml2\r |
323 | set libxml2support=N\r | |
324 | set HAVE_LIBXML2=\r | |
325 | shift\r | |
326 | goto again\r | |
327 | \r | |
328 | rem ----------------------------------------------------------------------\r | |
329 | \r | |
47c01e80 JB |
330 | :withouttiff\r |
331 | set tiffsupport=N\r | |
332 | set HAVE_TIFF=\r | |
333 | shift\r | |
334 | goto again\r | |
335 | \r | |
507f5dce JR |
336 | rem ----------------------------------------------------------------------\r |
337 | \r | |
338 | :withoutxpm\r | |
339 | set xpmsupport=N\r | |
340 | set HAVE_XPM=\r | |
341 | shift\r | |
342 | goto again\r | |
343 | \r | |
8bc63b1a JR |
344 | :withsvg\r |
345 | shift\r | |
346 | set svgsupport=Y\r | |
347 | goto again\r | |
348 | \r | |
e3aef5c6 CS |
349 | rem ----------------------------------------------------------------------\r |
350 | \r | |
351 | :distfiles\r | |
352 | set HAVE_DISTFILES=1\r | |
353 | shift\r | |
354 | set distfiles=%distfiles%%sep3%%1\r | |
355 | set sep3= %nothing%\r | |
356 | shift\r | |
357 | goto again\r | |
358 | \r | |
f466241d EZ |
359 | rem ----------------------------------------------------------------------\r |
360 | rem Check that necessary utilities (cp and rm) are present.\r | |
ee705a5c | 361 | \r |
f466241d EZ |
362 | :checkutils\r |
363 | echo Checking for 'cp'...\r | |
364 | cp configure.bat junk.bat\r | |
365 | if not exist junk.bat goto needcp\r | |
366 | echo Checking for 'rm'...\r | |
367 | rm junk.bat\r | |
368 | if exist junk.bat goto needrm\r | |
369 | goto checkcompiler\r | |
ee705a5c | 370 | \r |
f466241d EZ |
371 | :needcp\r |
372 | echo You need 'cp' (the Unix file copy program) to build Emacs.\r | |
373 | goto end\r | |
ee705a5c | 374 | \r |
f466241d EZ |
375 | :needrm\r |
376 | del junk.bat\r | |
377 | echo You need 'rm' (the Unix file delete program) to build Emacs.\r | |
378 | goto end\r | |
379 | \r | |
380 | rem ----------------------------------------------------------------------\r | |
381 | rem Auto-detect compiler if not specified, and validate GCC if chosen.\r | |
ee705a5c | 382 | \r |
f466241d | 383 | :checkcompiler\r |
e0006538 | 384 | if (%COMPILER%)==(cl) goto compilercheckdone\r |
f466241d EZ |
385 | if (%COMPILER%)==(gcc) goto checkgcc\r |
386 | \r | |
f466241d | 387 | echo Checking whether 'gcc' is available...\r |
680d641f | 388 | echo main(){} >junk.c\r |
f466241d | 389 | gcc -c junk.c\r |
680d641f | 390 | if exist junk.o goto checkgcc\r |
f466241d | 391 | \r |
680d641f JR |
392 | echo Checking whether 'cl' is available...\r |
393 | cl -nologo -c junk.c\r | |
394 | if exist junk.obj goto clOK\r | |
395 | goto nocompiler\r | |
396 | \r | |
f466241d | 397 | :checkgcc\r |
1046da1c | 398 | if exist junk.o del junk.o\r |
f466241d EZ |
399 | Rem WARNING -- COMMAND.COM on some systems only looks at the first\r |
400 | Rem 8 characters of a label. So do NOT be tempted to change\r | |
401 | Rem chkapi* into something fancier like checkw32api\r | |
402 | Rem You HAVE been warned!\r | |
1046da1c | 403 | if (%nocygwin%) == (Y) goto chkapiN\r |
f466241d EZ |
404 | echo Checking whether gcc requires '-mno-cygwin'...\r |
405 | echo #include "cygwin/version.h" >junk.c\r | |
406 | echo main(){} >>junk.c\r | |
dbbdb507 EZ |
407 | echo gcc -c junk.c >>config.log\r |
408 | gcc -c junk.c >>config.log 2>&1\r | |
f466241d | 409 | if not exist junk.o goto chkapi\r |
dbbdb507 EZ |
410 | echo gcc -mno-cygwin -c junk.c >>config.log\r |
411 | gcc -mno-cygwin -c junk.c >>config.log 2>&1\r | |
f466241d | 412 | if exist junk.o set nocygwin=Y\r |
f466241d EZ |
413 | \r |
414 | :chkapi\r | |
dbbdb507 EZ |
415 | echo The failed program was: >>config.log\r |
416 | type junk.c >>config.log\r | |
ee705a5c | 417 | \r |
1046da1c EZ |
418 | :chkapiN\r |
419 | rm -f junk.c junk.o\r | |
f466241d EZ |
420 | rem ----------------------------------------------------------------------\r |
421 | rem Older versions of the Windows API headers either don't have any of\r | |
422 | rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1\r | |
423 | rem are like this), or have a typo in the definition of\r | |
424 | rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this\r | |
425 | rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros\r | |
426 | rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.\r | |
892508a4 | 427 | rem Beginning with Emacs 23, we need usp10.h.\r |
f466241d EZ |
428 | rem\r |
429 | echo Checking whether W32 API headers are too old...\r | |
430 | echo #include "windows.h" >junk.c\r | |
892508a4 | 431 | echo #include "usp10.h" >>junk.c\r |
f466241d EZ |
432 | echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c\r |
433 | echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c\r | |
434 | if (%nocygwin%) == (Y) goto chkapi1\r | |
435 | set cf=%usercflags%\r | |
436 | goto chkapi2\r | |
ee705a5c | 437 | \r |
f466241d EZ |
438 | :chkapi1\r |
439 | set cf=%usercflags% -mno-cygwin\r | |
ee705a5c | 440 | \r |
f466241d EZ |
441 | :chkapi2\r |
442 | echo on\r | |
443 | gcc %cf% -c junk.c\r | |
dbbdb507 EZ |
444 | @echo off\r |
445 | @echo gcc %cf% -c junk.c >>config.log\r | |
446 | gcc %cf% -c junk.c >>config.log 2>&1\r | |
f466241d | 447 | set cf=\r |
05212154 | 448 | if exist junk.o goto chkuser\r |
dbbdb507 EZ |
449 | echo The failed program was: >>config.log\r |
450 | type junk.c >>config.log\r | |
05212154 JB |
451 | goto nocompiler\r |
452 | \r | |
453 | :chkuser\r | |
454 | rm -f junk.o\r | |
455 | echo int main (int argc, char *argv[]) {>junk.c\r | |
4d3fcc8e | 456 | echo char *usercflags = "%escusercflags%";>>junk.c\r |
05212154 JB |
457 | echo }>>junk.c\r |
458 | echo gcc -Werror -c junk.c >>config.log\r | |
459 | gcc -Werror -c junk.c >>config.log 2>&1\r | |
460 | if exist junk.o goto gccOk\r | |
461 | echo.\r | |
462 | echo Error in --cflags argument: %usercflags%\r | |
463 | echo Backslashes and quotes cannot be used with --cflags. Please use forward\r | |
464 | echo slashes for filenames and paths (e.g. when passing directories to -I).\r | |
465 | rm -f junk.c\r | |
466 | goto end\r | |
f466241d EZ |
467 | \r |
468 | :nocompiler\r | |
469 | echo.\r | |
470 | echo Configure failed.\r | |
471 | echo To configure Emacs for Windows, you need to have either\r | |
472 | echo gcc-2.95 or later with Mingw32 and the W32 API headers,\r | |
473 | echo or MSVC 2.x or later.\r | |
474 | del junk.c\r | |
475 | goto end\r | |
476 | \r | |
477 | :gccOk\r | |
478 | set COMPILER=gcc\r | |
f466241d | 479 | echo Using 'gcc'\r |
dbbdb507 EZ |
480 | rm -f junk.c junk.o\r |
481 | Rem It is not clear what GCC version began supporting -mtune\r | |
482 | Rem and pentium4 on x86, so check this explicitly.\r | |
483 | echo main(){} >junk.c\r | |
484 | echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log\r | |
485 | gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1\r | |
486 | if not errorlevel 1 goto gccMtuneOk\r | |
487 | echo The failed program was: >>config.log\r | |
488 | type junk.c >>config.log\r | |
489 | set mf=-mcpu=i686\r | |
490 | rm -f junk.c junk.o\r | |
540c2a33 | 491 | goto gccdebug\r |
ee705a5c | 492 | \r |
dbbdb507 EZ |
493 | :gccMtuneOk\r |
494 | echo GCC supports -mtune=pentium4 >>config.log\r | |
495 | set mf=-mtune=pentium4\r | |
496 | rm -f junk.c junk.o\r | |
ee705a5c | 497 | \r |
540c2a33 JB |
498 | :gccdebug\r |
499 | rem Check for DWARF-2 debug info support, else default to stabs\r | |
500 | echo main(){} >junk.c\r | |
501 | echo gcc -c -gdwarf-2 -g3 junk.c >>config.log\r | |
502 | gcc -c -gdwarf-2 -g3 junk.c >>config.log 2>&1\r | |
503 | if not errorlevel 1 goto gccdwarf\r | |
504 | echo The failed program was: >>config.log\r | |
505 | type junk.c >>config.log\r | |
506 | set dbginfo=-gstabs+\r | |
507 | rm -f junk.c junk.o\r | |
508 | goto compilercheckdone\r | |
ee705a5c | 509 | \r |
540c2a33 JB |
510 | :gccdwarf\r |
511 | echo GCC supports DWARF-2 >>config.log\r | |
512 | set dbginfo=-gdwarf-2 -g3\r | |
513 | rm -f junk.c junk.o\r | |
e0006538 | 514 | goto compilercheckdone\r |
f466241d EZ |
515 | \r |
516 | :clOk\r | |
517 | set COMPILER=cl\r | |
518 | rm -f junk.c junk.obj\r | |
519 | echo Using 'MSVC'\r | |
e0006538 JR |
520 | \r |
521 | :compilercheckdone\r | |
522 | \r | |
523 | rem ----------------------------------------------------------------------\r | |
524 | rem Check for external image libraries. Since they are loaded\r | |
525 | rem dynamically, the libraries themselves do not need to be present\r | |
526 | rem at compile time, but the header files are required.\r | |
527 | \r | |
112dc8e1 JR |
528 | set mingwflag=\r |
529 | \r | |
530 | if (%nocygwin%) == (N) goto flagsOK\r | |
531 | set mingwflag=-mno-cygwin\r | |
532 | \r | |
533 | :flagsOK\r | |
534 | \r | |
e0006538 JR |
535 | if (%pngsupport%) == (N) goto pngDone\r |
536 | \r | |
537 | echo Checking for libpng...\r | |
538 | echo #include "png.h" >junk.c\r | |
539 | echo main (){} >>junk.c\r | |
540 | rem -o option is ignored with cl, but allows result to be consistent.\r | |
dbbdb507 EZ |
541 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r |
542 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
e0006538 JR |
543 | if exist junk.obj goto havePng\r |
544 | \r | |
507f5dce | 545 | echo ...png.h not found, building without PNG support.\r |
dbbdb507 EZ |
546 | echo The failed program was: >>config.log\r |
547 | type junk.c >>config.log\r | |
e0006538 JR |
548 | set HAVE_PNG=\r |
549 | goto :pngDone\r | |
550 | \r | |
551 | :havePng\r | |
552 | echo ...PNG header available, building with PNG support.\r | |
553 | set HAVE_PNG=1\r | |
554 | \r | |
555 | :pngDone\r | |
556 | rm -f junk.c junk.obj\r | |
f466241d | 557 | \r |
fd4af8d9 TZ |
558 | if (%tlssupport%) == (N) goto tlsDone\r |
559 | \r | |
560 | rem this is a copy of the PNG detection\r | |
561 | echo Checking for libgnutls...\r | |
562 | echo #include "gnutls/gnutls.h" >junk.c\r | |
563 | echo main (){} >>junk.c\r | |
564 | rem -o option is ignored with cl, but allows result to be consistent.\r | |
565 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r | |
566 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
567 | if exist junk.obj goto haveTls\r | |
568 | \r | |
569 | echo ...gnutls.h not found, building without TLS support.\r | |
570 | echo The failed program was: >>config.log\r | |
571 | type junk.c >>config.log\r | |
572 | set HAVE_GNUTLS=\r | |
573 | goto :tlsDone\r | |
574 | \r | |
575 | :haveTls\r | |
e9fce1ac | 576 | echo ...GnuTLS header available, building with GnuTLS support.\r |
fd4af8d9 TZ |
577 | set HAVE_GNUTLS=1\r |
578 | \r | |
579 | :tlsDone\r | |
580 | rm -f junk.c junk.obj\r | |
581 | \r | |
9078ead6 EZ |
582 | if (%libxml2support%) == (N) goto xml2Done\r |
583 | \r | |
584 | echo Checking for libxml2....\r | |
585 | echo #include "libxml/HTMLparser.h" >junk.c\r | |
586 | echo main(){} >>junk.c\r | |
587 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r | |
588 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
589 | if exist junk.obj goto havelibxml2\r | |
590 | \r | |
591 | echo ...libxml/HTMLparser.h not found, building without libxml2 support\r | |
592 | echo The failed program was: >>config.log\r | |
593 | type junk.c >>config.log\r | |
594 | set HAVE_LIBXML2=\r | |
595 | goto xml2Done\r | |
596 | \r | |
597 | :havelibxml2\r | |
598 | echo ...libxml2 header available, building with libxml2 support\r | |
599 | set HAVE_LIBXML2=1\r | |
600 | \r | |
601 | :xml2Done\r | |
602 | rm -f junk.c junk.obj\r | |
603 | \r | |
aad0eae4 JR |
604 | if (%jpegsupport%) == (N) goto jpegDone\r |
605 | \r | |
507f5dce | 606 | echo Checking for jpeg-6b...\r |
aad0eae4 JR |
607 | echo #include "jconfig.h" >junk.c\r |
608 | echo main (){} >>junk.c\r | |
609 | rem -o option is ignored with cl, but allows result to be consistent.\r | |
dbbdb507 EZ |
610 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r |
611 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
aad0eae4 JR |
612 | if exist junk.obj goto haveJpeg\r |
613 | \r | |
507f5dce | 614 | echo ...jconfig.h not found, building without JPEG support.\r |
dbbdb507 EZ |
615 | echo The failed program was: >>config.log\r |
616 | type junk.c >>config.log\r | |
aad0eae4 JR |
617 | set HAVE_JPEG=\r |
618 | goto :jpegDone\r | |
619 | \r | |
620 | :haveJpeg\r | |
621 | echo ...JPEG header available, building with JPEG support.\r | |
622 | set HAVE_JPEG=1\r | |
623 | \r | |
624 | :jpegDone\r | |
625 | rm -f junk.c junk.obj\r | |
626 | \r | |
12ff2dc5 JB |
627 | if (%gifsupport%) == (N) goto gifDone\r |
628 | \r | |
507f5dce | 629 | echo Checking for libgif...\r |
12ff2dc5 JB |
630 | echo #include "gif_lib.h" >junk.c\r |
631 | echo main (){} >>junk.c\r | |
632 | rem -o option is ignored with cl, but allows result to be consistent.\r | |
dbbdb507 EZ |
633 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r |
634 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
12ff2dc5 JB |
635 | if exist junk.obj goto haveGif\r |
636 | \r | |
507f5dce | 637 | echo ...gif_lib.h not found, building without GIF support.\r |
dbbdb507 EZ |
638 | echo The failed program was: >>config.log\r |
639 | type junk.c >>config.log\r | |
12ff2dc5 JB |
640 | set HAVE_GIF=\r |
641 | goto :gifDone\r | |
642 | \r | |
643 | :haveGif\r | |
644 | echo ...GIF header available, building with GIF support.\r | |
645 | set HAVE_GIF=1\r | |
646 | \r | |
647 | :gifDone\r | |
648 | rm -f junk.c junk.obj\r | |
649 | \r | |
47c01e80 JB |
650 | if (%tiffsupport%) == (N) goto tiffDone\r |
651 | \r | |
652 | echo Checking for tiff...\r | |
653 | echo #include "tiffio.h" >junk.c\r | |
654 | echo main (){} >>junk.c\r | |
655 | rem -o option is ignored with cl, but allows result to be consistent.\r | |
dbbdb507 EZ |
656 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r |
657 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
47c01e80 JB |
658 | if exist junk.obj goto haveTiff\r |
659 | \r | |
507f5dce | 660 | echo ...tiffio.h not found, building without TIFF support.\r |
dbbdb507 EZ |
661 | echo The failed program was: >>config.log\r |
662 | type junk.c >>config.log\r | |
47c01e80 JB |
663 | set HAVE_TIFF=\r |
664 | goto :tiffDone\r | |
665 | \r | |
666 | :haveTiff\r | |
667 | echo ...TIFF header available, building with TIFF support.\r | |
668 | set HAVE_TIFF=1\r | |
669 | \r | |
670 | :tiffDone\r | |
671 | rm -f junk.c junk.obj\r | |
672 | \r | |
507f5dce JR |
673 | if (%xpmsupport%) == (N) goto xpmDone\r |
674 | \r | |
675 | echo Checking for libXpm...\r | |
676 | echo #define FOR_MSW 1 >junk.c\r | |
677 | echo #include "X11/xpm.h" >>junk.c\r | |
678 | echo main (){} >>junk.c\r | |
679 | rem -o option is ignored with cl, but allows result to be consistent.\r | |
dbbdb507 EZ |
680 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r |
681 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
507f5dce JR |
682 | if exist junk.obj goto haveXpm\r |
683 | \r | |
684 | echo ...X11/xpm.h not found, building without XPM support.\r | |
dbbdb507 EZ |
685 | echo The failed program was: >>config.log\r |
686 | type junk.c >>config.log\r | |
507f5dce JR |
687 | set HAVE_XPM=\r |
688 | goto :xpmDone\r | |
689 | \r | |
690 | :haveXpm\r | |
691 | echo ...XPM header available, building with XPM support.\r | |
692 | set HAVE_XPM=1\r | |
693 | \r | |
694 | :xpmDone\r | |
8bc63b1a JR |
695 | rm -f junk.c junk.obj\r |
696 | \r | |
697 | if not (%svgsupport%) == (Y) goto :svgDone\r | |
698 | echo Checking for librsvg...\r | |
699 | echo #include "librsvg/rsvg.h" >junk.c\r | |
700 | echo main (){} >>junk.c\r | |
701 | rem -o option is ignored with cl, but allows result to be consistent.\r | |
702 | echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r | |
703 | %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r | |
704 | if exist junk.obj goto haveSvg\r | |
705 | \r | |
706 | echo ...librsvg/rsvg.h or dependencies not found, building without SVG support.\r | |
707 | echo The failed program was: >>config.log\r | |
708 | type junk.c >>config.log\r | |
709 | set HAVE_RSVG=\r | |
710 | goto :svgDone\r | |
711 | \r | |
712 | :haveSvg\r | |
713 | echo ...librsvg header available, building with SVG support (EXPERIMENTAL).\r | |
714 | set HAVE_RSVG=1\r | |
715 | \r | |
716 | :svgDone\r | |
507f5dce JR |
717 | rm -f junk.c junk.obj junk.err junk.out\r |
718 | \r | |
e3aef5c6 CS |
719 | rem Any distfiles provided for building distribution? If no, we're done.\r |
720 | if "(%HAVE_DISTFILES%)"=="()" goto :distFilesDone\r | |
721 | \r | |
722 | rem Any arguments to --distfiles specified? If no, we're done.\r | |
723 | if not "%distfiles%"=="" goto :checkDistFiles\r | |
724 | set distFilesOk=0\r | |
725 | echo No arguments specified for option --distfiles!\r | |
726 | goto distfilesDone\r | |
727 | \r | |
728 | :checkDistFiles\r | |
729 | echo Checking for distfiles...\r | |
730 | rem Check if all specified distfiles exist\r | |
731 | set fileNotFound=\r | |
732 | for %%d in (%distfiles%) do if not exist %%d set fileNotFound=%%d\r | |
733 | if not "%fileNotFound%"=="" goto distFilesNotFound\r | |
734 | \r | |
735 | set distFilesOK=1\r | |
736 | echo ...all distfiles found.\r | |
737 | goto :distFilesDone\r | |
738 | \r | |
739 | :distFilesNotFound\r | |
740 | set distFilesOk=0\r | |
741 | echo ...%fileNotFound% not found.\r | |
742 | set distfiles=\r | |
743 | goto :distfilesDone\r | |
744 | \r | |
745 | :distFilesDone\r | |
746 | set fileNotFound=\r | |
747 | \r | |
f466241d | 748 | rem ----------------------------------------------------------------------\r |
ee705a5c | 749 | \r |
f466241d EZ |
750 | :genmakefiles\r |
751 | echo Generating makefiles\r | |
752 | if %COMPILER% == gcc set MAKECMD=gmake\r | |
753 | if %COMPILER% == cl set MAKECMD=nmake\r | |
754 | \r | |
755 | rem Pass on chosen settings to makefiles.\r | |
f466241d | 756 | rem\r |
e383e32d EZ |
757 | rem The weird place we put the redirection is to make sure no extra\r |
758 | rem whitespace winds up at the end of the Make variables, since some\r | |
759 | rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will\r | |
760 | rem write the blanks between the end of command arguments and the\r | |
761 | rem redirection symbol to the file. OTOH, we cannot put the\r | |
762 | rem redirection immediately after the last character of the command,\r | |
763 | rem because environment variable expansion can yield a digit there,\r | |
764 | rem which will then be misinterpreted as the file descriptor to\r | |
765 | rem redirect...\r | |
f466241d | 766 | echo # Start of settings from configure.bat >config.settings\r |
e383e32d EZ |
767 | >>config.settings echo COMPILER=%COMPILER%\r |
768 | if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf%\r | |
769 | if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo%\r | |
770 | if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1\r | |
771 | if (%noopt%) == (Y) >>config.settings echo NOOPT=1\r | |
e383e32d EZ |
772 | if (%profile%) == (Y) >>config.settings echo PROFILE=1\r |
773 | if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1\r | |
774 | if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix%\r | |
775 | if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles%\r | |
3a1ebd63 EZ |
776 | rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r |
777 | rem and the if command cannot cope with this\r | |
778 | for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y\r | |
e383e32d EZ |
779 | if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags%\r |
780 | if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags%\r | |
3a1ebd63 | 781 | for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y\r |
e383e32d | 782 | if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags%\r |
fd4af8d9 | 783 | for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y\r |
e383e32d | 784 | if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs%\r |
f466241d EZ |
785 | echo # End of settings from configure.bat>>config.settings\r |
786 | echo. >>config.settings\r | |
787 | \r | |
c262c68c EZ |
788 | copy config.nt config.tmp\r |
789 | echo. >>config.tmp\r | |
790 | echo /* Start of settings from configure.bat. */ >>config.tmp\r | |
8f978ca0 JB |
791 | rem We write USER_CFLAGS and USER_LDFLAGS starting with a space to simplify\r |
792 | rem processing of compiler options in w32.c:get_emacs_configuration_options\r | |
ce128722 EZ |
793 | if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%" >>config.tmp\r |
794 | if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%" >>config.tmp\r | |
f179addc | 795 | if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp\r |
0566bc95 | 796 | if (%enablechecking%) == (Y) echo #define ENABLE_CHECKING 1 >>config.tmp\r |
c262c68c | 797 | if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp\r |
fd4af8d9 | 798 | if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp\r |
9078ead6 | 799 | if not "(%HAVE_LIBXML2%)" == "()" echo #define HAVE_LIBXML2 1 >>config.tmp\r |
c262c68c EZ |
800 | if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp\r |
801 | if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp\r | |
802 | if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r | |
803 | if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp\r | |
8bc63b1a JR |
804 | if "(%HAVE_RSVG%)" == "(1)" echo #define HAVE_RSVG 1 >>config.tmp\r |
805 | \r | |
c262c68c EZ |
806 | echo /* End of settings from configure.bat. */ >>config.tmp\r |
807 | \r | |
808 | Rem See if fc.exe returns a meaningful exit status. If it does, we\r | |
809 | Rem might as well avoid unnecessary overwriting of config.h and epaths.h,\r | |
810 | Rem since this forces recompilation of every source file.\r | |
811 | if exist foo.bar del foo.bar\r | |
812 | fc /b foo.bar foo.bar >nul 2>&1\r | |
813 | if not errorlevel 2 goto doCopy\r | |
814 | fc /b config.tmp ..\src\config.h >nul 2>&1\r | |
815 | if errorlevel 1 goto doCopy\r | |
816 | fc /b paths.h ..\src\epaths.h >nul 2>&1\r | |
252b4f5c | 817 | if not errorlevel 1 goto dontCopy\r |
ee705a5c | 818 | \r |
c262c68c EZ |
819 | :doCopy\r |
820 | copy config.tmp ..\src\config.h\r | |
f466241d EZ |
821 | copy paths.h ..\src\epaths.h\r |
822 | \r | |
c262c68c EZ |
823 | :dontCopy\r |
824 | if exist config.tmp del config.tmp\r | |
f466241d | 825 | copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r |
a392138f | 826 | if exist ..\admin\unidata copy /b config.settings+%MAKECMD%.defs+..\admin\unidata\makefile.w32-in ..\admin\unidata\makefile\r |
f466241d | 827 | copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r |
f915f0f7 | 828 | copy /b config.settings+%MAKECMD%.defs+..\lib\makefile.w32-in ..\lib\makefile\r |
f466241d | 829 | copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r |
8aee12d0 GM |
830 | copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile\r |
831 | copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in ..\doc\misc\makefile\r | |
832 | copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in ..\doc\lispref\makefile\r | |
833 | copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in ..\doc\lispintro\makefile\r | |
f466241d EZ |
834 | if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile\r |
835 | copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile\r | |
836 | rem Use the default (no-op) Makefile.in if the nt version is not present.\r | |
837 | if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile\r | |
838 | if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile\r | |
839 | del config.settings\r | |
840 | \r | |
e44f8099 EZ |
841 | Rem Some people use WinZip which doesn't create empty directories!\r |
842 | if not exist ..\site-lisp\nul mkdir ..\site-lisp\\r | |
57a64408 JB |
843 | Rem Update subdirs.el only if it is different or fc.exe doesn't work.\r |
844 | if exist foo.bar del foo.bar\r | |
845 | fc /b foo.bar foo.bar >nul 2>&1\r | |
846 | if not errorlevel 2 goto doUpdateSubdirs\r | |
847 | fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1\r | |
848 | if not errorlevel 1 goto dontUpdateSubdirs\r | |
ee705a5c | 849 | \r |
57a64408 JB |
850 | :doUpdateSubdirs\r |
851 | if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el\r | |
852 | copy subdirs.el ..\site-lisp\subdirs.el\r | |
853 | \r | |
854 | :dontUpdateSubdirs\r | |
f466241d | 855 | echo.\r |
32154d10 JR |
856 | \r |
857 | rem check that we have all the libraries we need.\r | |
858 | set libsOK=1\r | |
859 | \r | |
860 | if not "(%HAVE_XPM%)" == "()" goto checkpng\r | |
861 | if (%xpmsupport%) == (N) goto checkpng\r | |
862 | set libsOK=0\r | |
863 | echo XPM support is missing. It is required for color icons in the toolbar.\r | |
864 | echo Install libXpm development files or use --without-xpm\r | |
865 | \r | |
866 | :checkpng\r | |
867 | if not "(%HAVE_PNG%)" == "()" goto checkjpeg\r | |
868 | if (%pngsupport%) == (N) goto checkjpeg\r | |
869 | set libsOK=0\r | |
870 | echo PNG support is missing.\r | |
871 | echo Install libpng development files or use --without-png\r | |
872 | \r | |
873 | :checkjpeg\r | |
874 | if not "(%HAVE_JPEG%)" == "()" goto checktiff\r | |
875 | if (%jpegsupport%) == (N) goto checktiff\r | |
876 | set libsOK=0\r | |
877 | echo JPEG support is missing.\r | |
878 | echo Install jpeg development files or use --without-jpeg\r | |
879 | \r | |
880 | :checktiff\r | |
881 | if not "(%HAVE_TIFF%)" == "()" goto checkgif\r | |
882 | if (%tiffsupport%) == (N) goto checkgif\r | |
883 | set libsOK=0\r | |
884 | echo TIFF support is missing.\r | |
885 | echo Install libtiff development files or use --without-tiff\r | |
886 | \r | |
887 | :checkgif\r | |
e3aef5c6 CS |
888 | if not "(%HAVE_GIF%)" == "()" goto checkdistfiles\r |
889 | if (%gifsupport%) == (N) goto checkdistfiles\r | |
32154d10 JR |
890 | set libsOK=0\r |
891 | echo GIF support is missing.\r | |
892 | echo Install giflib or libungif development files or use --without-gif\r | |
893 | \r | |
e3aef5c6 CS |
894 | :checkdistfiles\r |
895 | if "(%HAVE_DISTFILES%)" == "()" goto donelibchecks\r | |
896 | if (%distFilesOk%) == (1) goto donelibchecks\r | |
897 | echo.\r | |
898 | echo Files specified with option --distfiles could not be found.\r | |
899 | echo Fix these issues before running make dist\r | |
900 | \r | |
32154d10 JR |
901 | :donelibchecks\r |
902 | if (%libsOK%) == (1) goto success\r | |
903 | echo.\r | |
904 | echo Important libraries are missing. Fix these issues before running make.\r | |
905 | goto end\r | |
906 | \r | |
907 | :success\r | |
f466241d | 908 | echo Emacs successfully configured.\r |
a27014fc | 909 | echo Emacs successfully configured. >>config.log\r |
361823f4 | 910 | if (%MAKECMD%) == (gmake) set MAKECMD=make\r |
f466241d EZ |
911 | echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.\r |
912 | goto end\r | |
913 | \r | |
914 | :SmallEnv\r | |
915 | echo Your environment size is too small. Please enlarge it and rerun configure.\r | |
916 | echo For example, type "command.com /e:2048" to have 2048 bytes available.\r | |
917 | set $foo$=\r | |
ee705a5c | 918 | \r |
f466241d EZ |
919 | :end\r |
920 | set prefix=\r | |
921 | set nodebug=\r | |
922 | set noopt=\r | |
7d0170c8 | 923 | set enablechecking=\r |
75663c75 | 924 | set profile=\r |
f466241d EZ |
925 | set nocygwin=\r |
926 | set COMPILER=\r | |
927 | set MAKECMD=\r | |
928 | set usercflags=\r | |
3a1ebd63 | 929 | set docflags=\r |
f466241d | 930 | set userldflags=\r |
3a1ebd63 | 931 | set doldflags=\r |
112dc8e1 | 932 | set mingwflag=\r |
dbbdb507 | 933 | set mf=\r |
e3aef5c6 CS |
934 | set distfiles=\r |
935 | set HAVE_DISTFILES=\r | |
936 | set distFilesOk=\r | |
ca6e909c | 937 | set pngsupport=\r |
fd4af8d9 | 938 | set tlssupport=\r |
9078ead6 | 939 | set libxml2support=\r |
ca6e909c EZ |
940 | set jpegsupport=\r |
941 | set gifsupport=\r | |
942 | set tiffsupport=\r | |
943 | set xpmsupport=\r | |
944 | set svgsupport=\r | |
945 | set libsOK=\r | |
946 | set HAVE_GIF=\r | |
947 | set HAVE_JPEG=\r | |
948 | set HAVE_PNG=\r | |
949 | set HAVE_TIFF=\r | |
950 | set HAVE_XPM=\r | |
951 | set dbginfo=\r | |
a2fcf029 | 952 | \r |