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