Switch to recommended form of GPLv3 permissions notice.
[bpt/emacs.git] / nt / configure.bat
CommitLineData
f466241d
EZ
1@echo off\r
2rem ----------------------------------------------------------------------\r
12ff2dc5 3rem Configuration script for MS Windows 95/98/Me and NT/2000/XP\r
ceb4c4d3 4rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,\r
6d344054 5rem 2006, 2007, 2008 Free Software Foundation, Inc.\r
f466241d
EZ
6\r
7rem This file is part of GNU Emacs.\r
8\r
9rem GNU Emacs is free software; you can redistribute it and/or modify\r
10rem it under the terms of the GNU General Public License as published by\r
4a9f99bd 11rem the Free Software Foundation; either version 3, or (at your option)\r
f466241d
EZ
12rem any later version.\r
13\r
14rem GNU Emacs is distributed in the hope that it will be useful,\r
15rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
17rem GNU General Public License for more details.\r
18\r
19rem You should have received a copy of the GNU General Public License\r
20rem along with GNU Emacs; see the file COPYING. If not, write to the\r
364c38d3
LK
21rem Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\r
22rem Boston, MA 02110-1301, USA.\r
f466241d
EZ
23rem ----------------------------------------------------------------------\r
24rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
25rem\r
12ff2dc5 26rem + MS Windows 95/98/Me or NT/2000/XP\r
361823f4 27rem + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75\r
56a469c3
EZ
28rem or later) and the Mingw32 and W32 API headers and libraries.\r
29rem + Visual Studio 2005 is not supported at this time.\r
f466241d 30rem\r
361823f4 31rem For reference, here is a list of which builds of GNU make are known to\r
f466241d
EZ
32rem work or not, and whether they work in the presence and/or absence of\r
33rem sh.exe.\r
7019fb66 34rem\r
f466241d 35rem sh exists no sh\r
56a469c3 36rem cygwin b20.1 make (3.75): fails[1,5] fails[2,5]\r
f466241d
EZ
37rem MSVC compiled gmake 3.77: okay okay\r
38rem MSVC compiled gmake 3.78.1: okay okay\r
39rem MSVC compiled gmake 3.79.1: okay okay\r
56a469c3
EZ
40rem mingw32/gcc-2.92.2 make (3.77): okay okay[4]\r
41rem cygwin compiled gmake 3.77: fails[1,5] fails[2,5]\r
42rem cygwin compiled gmake 3.78.1: fails[5] fails[2,5]\r
43rem cygwin compiled gmake 3.79.1: fails[3,5] fails[2?,5]\r
17f55fae
EZ
44rem cygwin compiled make 3.80: okay[6] fails?[7]\r
45rem cygwin compiled make 3.81: fails fails?[7]\r
56a469c3 46rem mingw32 compiled make 3.79.1: okay okay\r
17f55fae
EZ
47rem mingw32 compiled make 3.80: okay okay?[7]\r
48rem mingw32 compiled make 3.81: okay okay[8]\r
f466241d
EZ
49rem\r
50rem [1] doesn't cope with makefiles with DOS line endings, so must mount\r
51rem emacs source with text!=binary.\r
52rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.\r
56a469c3
EZ
53rem [3] requires LC_MESSAGES support to build; cannot build with early\r
54rem versions of cygwin.\r
55rem [4] may fail on Windows 9X and Windows ME; if so, install Bash.\r
56rem [5] fails when building leim due to the use of cygwin style paths.\r
57rem May work if building emacs without leim.\r
17f55fae
EZ
58rem [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath';\r
59rem look for "cygpath" near line 85 of gmake.defs.\r
60rem [7] not recommended; please report if you try this combination.\r
61rem [8] tested only on Windows XP.\r
f466241d
EZ
62rem\r
63\r
dbbdb507
EZ
64if exist config.log del config.log\r
65\r
f466241d
EZ
66rem ----------------------------------------------------------------------\r
67rem See if the environment is large enough. We need 43 (?) bytes.\r
68set $foo$=123456789_123456789_123456789_123456789_123\r
69if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv\r
70set $foo$=\r
71\r
72rem ----------------------------------------------------------------------\r
73rem Make sure we are running in the nt subdir\r
74if exist configure.bat goto start\r
75echo You must run configure from the nt subdirectory.\r
76goto end\r
77\r
78:start\r
79rem ----------------------------------------------------------------------\r
80rem Default settings.\r
81set prefix=\r
82set nodebug=N\r
83set noopt=N\r
84set nocygwin=N\r
85set COMPILER=\r
86set usercflags=\r
3a1ebd63 87set docflags=\r
f466241d 88set userldflags=\r
3a1ebd63 89set doldflags=\r
f466241d
EZ
90set sep1=\r
91set sep2=\r
2aec15a4 92set usefontbackend=Y\r
f466241d
EZ
93\r
94rem ----------------------------------------------------------------------\r
95rem Handle arguments.\r
96:again\r
97if "%1" == "-h" goto usage\r
98if "%1" == "--help" goto usage\r
99if "%1" == "--prefix" goto setprefix\r
100if "%1" == "--with-gcc" goto withgcc\r
101if "%1" == "--with-msvc" goto withmsvc\r
102if "%1" == "--no-debug" goto nodebug\r
103if "%1" == "--no-opt" goto noopt\r
104if "%1" == "--no-cygwin" goto nocygwin\r
105if "%1" == "--cflags" goto usercflags\r
106if "%1" == "--ldflags" goto userldflags\r
e0006538 107if "%1" == "--without-png" goto withoutpng\r
aad0eae4 108if "%1" == "--without-jpeg" goto withoutjpeg\r
12ff2dc5 109if "%1" == "--without-gif" goto withoutgif\r
47c01e80 110if "%1" == "--without-tiff" goto withouttiff\r
507f5dce 111if "%1" == "--without-xpm" goto withoutxpm\r
2aec15a4 112if "%1" == "--disable-font-backend" goto withoutfont\r
f466241d
EZ
113if "%1" == "" goto checkutils\r
114:usage\r
115echo Usage: configure [options]\r
116echo Options:\r
117echo. --prefix PREFIX install Emacs in directory PREFIX\r
118echo. --with-gcc use GCC to compile Emacs\r
119echo. --with-msvc use MSVC to compile Emacs\r
120echo. --no-debug exclude debug info from executables\r
121echo. --no-opt disable optimization\r
122echo. --no-cygwin use -mno-cygwin option with GCC\r
123echo. --cflags FLAG pass FLAG to compiler\r
124echo. --ldflags FLAG pass FLAG to compiler when linking\r
f01e03d3
JB
125echo. --without-png do not use PNG library even if it is installed\r
126echo. --without-jpeg do not use JPEG library even if it is installed\r
127echo. --without-gif do not use GIF library even if it is installed\r
128echo. --without-tiff do not use TIFF library even if it is installed\r
129echo. --without-xpm do not use XPM library even if it is installed\r
2aec15a4 130echo. --disable-font-backend build without font backend support\r
f466241d
EZ
131goto end\r
132rem ----------------------------------------------------------------------\r
133:setprefix\r
134shift\r
135set prefix=%1\r
136shift\r
137goto again\r
138rem ----------------------------------------------------------------------\r
139:withgcc\r
140set COMPILER=gcc\r
141shift\r
142goto again\r
143rem ----------------------------------------------------------------------\r
144:withmsvc\r
145set COMPILER=cl\r
146shift\r
147goto again\r
148rem ----------------------------------------------------------------------\r
149:nodebug\r
150set nodebug=Y\r
151shift\r
152goto again\r
153rem ----------------------------------------------------------------------\r
154:noopt\r
155set noopt=Y\r
156shift\r
157goto again\r
158rem ----------------------------------------------------------------------\r
159:nocygwin\r
160set nocygwin=Y\r
161shift\r
162goto again\r
163rem ----------------------------------------------------------------------\r
164:usercflags\r
165shift\r
166set usercflags=%usercflags%%sep1%%1\r
167set sep1= %nothing%\r
168shift\r
169goto again\r
170rem ----------------------------------------------------------------------\r
171:userldflags\r
172shift\r
173set userldflags=%userldflags%%sep2%%1\r
174set sep2= %nothing%\r
175shift\r
176goto again\r
e0006538
JR
177rem ----------------------------------------------------------------------\r
178\r
179:withoutpng\r
180set pngsupport=N\r
181set HAVE_PNG=\r
39bd0e03 182shift\r
e0006538 183goto again\r
f466241d 184\r
aad0eae4
JR
185rem ----------------------------------------------------------------------\r
186\r
187:withoutjpeg\r
188set jpegsupport=N\r
189set HAVE_JPEG=\r
39bd0e03 190shift\r
aad0eae4
JR
191goto again\r
192\r
12ff2dc5
JB
193rem ----------------------------------------------------------------------\r
194\r
195:withoutgif\r
196set gifsupport=N\r
197set HAVE_GIF=\r
198shift\r
199goto again\r
200\r
47c01e80
JB
201rem ----------------------------------------------------------------------\r
202\r
203:withouttiff\r
204set tiffsupport=N\r
205set HAVE_TIFF=\r
206shift\r
207goto again\r
208\r
507f5dce
JR
209rem ----------------------------------------------------------------------\r
210\r
211:withoutxpm\r
212set xpmsupport=N\r
213set HAVE_XPM=\r
214shift\r
215goto again\r
216\r
2aec15a4
JR
217:withoutfont\r
218set usefontbackend=N\r
2cd47384
JR
219shift\r
220goto again\r
221\r
f466241d
EZ
222rem ----------------------------------------------------------------------\r
223rem Check that necessary utilities (cp and rm) are present.\r
224:checkutils\r
225echo Checking for 'cp'...\r
226cp configure.bat junk.bat\r
227if not exist junk.bat goto needcp\r
228echo Checking for 'rm'...\r
229rm junk.bat\r
230if exist junk.bat goto needrm\r
231goto checkcompiler\r
232:needcp\r
233echo You need 'cp' (the Unix file copy program) to build Emacs.\r
234goto end\r
235:needrm\r
236del junk.bat\r
237echo You need 'rm' (the Unix file delete program) to build Emacs.\r
238goto end\r
239\r
240rem ----------------------------------------------------------------------\r
241rem Auto-detect compiler if not specified, and validate GCC if chosen.\r
242:checkcompiler\r
e0006538 243if (%COMPILER%)==(cl) goto compilercheckdone\r
f466241d
EZ
244if (%COMPILER%)==(gcc) goto checkgcc\r
245\r
f466241d 246echo Checking whether 'gcc' is available...\r
680d641f 247echo main(){} >junk.c\r
f466241d 248gcc -c junk.c\r
680d641f 249if exist junk.o goto checkgcc\r
f466241d 250\r
680d641f
JR
251echo Checking whether 'cl' is available...\r
252cl -nologo -c junk.c\r
253if exist junk.obj goto clOK\r
254goto nocompiler\r
255\r
f466241d 256:checkgcc\r
1046da1c 257if exist junk.o del junk.o\r
f466241d
EZ
258Rem WARNING -- COMMAND.COM on some systems only looks at the first\r
259Rem 8 characters of a label. So do NOT be tempted to change\r
260Rem chkapi* into something fancier like checkw32api\r
261Rem You HAVE been warned!\r
1046da1c 262if (%nocygwin%) == (Y) goto chkapiN\r
f466241d
EZ
263echo Checking whether gcc requires '-mno-cygwin'...\r
264echo #include "cygwin/version.h" >junk.c\r
265echo main(){} >>junk.c\r
dbbdb507
EZ
266echo gcc -c junk.c >>config.log\r
267gcc -c junk.c >>config.log 2>&1\r
f466241d 268if not exist junk.o goto chkapi\r
dbbdb507
EZ
269echo gcc -mno-cygwin -c junk.c >>config.log\r
270gcc -mno-cygwin -c junk.c >>config.log 2>&1\r
f466241d 271if exist junk.o set nocygwin=Y\r
f466241d
EZ
272\r
273:chkapi\r
dbbdb507
EZ
274echo The failed program was: >>config.log\r
275type junk.c >>config.log\r
1046da1c
EZ
276:chkapiN\r
277rm -f junk.c junk.o\r
f466241d
EZ
278rem ----------------------------------------------------------------------\r
279rem Older versions of the Windows API headers either don't have any of\r
280rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1\r
281rem are like this), or have a typo in the definition of\r
282rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this\r
283rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros\r
284rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.\r
892508a4 285rem Beginning with Emacs 23, we need usp10.h.\r
f466241d
EZ
286rem\r
287echo Checking whether W32 API headers are too old...\r
288echo #include "windows.h" >junk.c\r
892508a4 289echo #include "usp10.h" >>junk.c\r
f466241d
EZ
290echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c\r
291echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c\r
292if (%nocygwin%) == (Y) goto chkapi1\r
293set cf=%usercflags%\r
294goto chkapi2\r
295:chkapi1\r
296set cf=%usercflags% -mno-cygwin\r
297:chkapi2\r
298echo on\r
299gcc %cf% -c junk.c\r
dbbdb507
EZ
300@echo off\r
301@echo gcc %cf% -c junk.c >>config.log\r
302gcc %cf% -c junk.c >>config.log 2>&1\r
f466241d
EZ
303set cf=\r
304if exist junk.o goto gccOk\r
dbbdb507
EZ
305echo The failed program was: >>config.log\r
306type junk.c >>config.log\r
f466241d
EZ
307\r
308:nocompiler\r
309echo.\r
310echo Configure failed.\r
311echo To configure Emacs for Windows, you need to have either\r
312echo gcc-2.95 or later with Mingw32 and the W32 API headers,\r
313echo or MSVC 2.x or later.\r
314del junk.c\r
315goto end\r
316\r
317:gccOk\r
318set COMPILER=gcc\r
f466241d 319echo Using 'gcc'\r
dbbdb507
EZ
320rm -f junk.c junk.o\r
321Rem It is not clear what GCC version began supporting -mtune\r
322Rem and pentium4 on x86, so check this explicitly.\r
323echo main(){} >junk.c\r
324echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log\r
325gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1\r
326if not errorlevel 1 goto gccMtuneOk\r
327echo The failed program was: >>config.log\r
328type junk.c >>config.log\r
329set mf=-mcpu=i686\r
330rm -f junk.c junk.o\r
331goto compilercheckdone\r
332:gccMtuneOk\r
333echo GCC supports -mtune=pentium4 >>config.log\r
334set mf=-mtune=pentium4\r
335rm -f junk.c junk.o\r
e0006538 336goto compilercheckdone\r
f466241d
EZ
337\r
338:clOk\r
339set COMPILER=cl\r
340rm -f junk.c junk.obj\r
341echo Using 'MSVC'\r
e0006538
JR
342\r
343:compilercheckdone\r
344\r
345rem ----------------------------------------------------------------------\r
346rem Check for external image libraries. Since they are loaded\r
347rem dynamically, the libraries themselves do not need to be present\r
348rem at compile time, but the header files are required.\r
349\r
112dc8e1
JR
350set mingwflag=\r
351\r
352if (%nocygwin%) == (N) goto flagsOK\r
353set mingwflag=-mno-cygwin\r
354\r
355:flagsOK\r
356\r
e0006538
JR
357if (%pngsupport%) == (N) goto pngDone\r
358\r
359echo Checking for libpng...\r
360echo #include "png.h" >junk.c\r
361echo main (){} >>junk.c\r
362rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
363echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
364%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
e0006538
JR
365if exist junk.obj goto havePng\r
366\r
507f5dce 367echo ...png.h not found, building without PNG support.\r
dbbdb507
EZ
368echo The failed program was: >>config.log\r
369type junk.c >>config.log\r
e0006538
JR
370set HAVE_PNG=\r
371goto :pngDone\r
372\r
373:havePng\r
374echo ...PNG header available, building with PNG support.\r
375set HAVE_PNG=1\r
376\r
377:pngDone\r
378rm -f junk.c junk.obj\r
f466241d 379\r
aad0eae4
JR
380if (%jpegsupport%) == (N) goto jpegDone\r
381\r
507f5dce 382echo Checking for jpeg-6b...\r
aad0eae4
JR
383echo #include "jconfig.h" >junk.c\r
384echo main (){} >>junk.c\r
385rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
386echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
387%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
aad0eae4
JR
388if exist junk.obj goto haveJpeg\r
389\r
507f5dce 390echo ...jconfig.h not found, building without JPEG support.\r
dbbdb507
EZ
391echo The failed program was: >>config.log\r
392type junk.c >>config.log\r
aad0eae4
JR
393set HAVE_JPEG=\r
394goto :jpegDone\r
395\r
396:haveJpeg\r
397echo ...JPEG header available, building with JPEG support.\r
398set HAVE_JPEG=1\r
399\r
400:jpegDone\r
401rm -f junk.c junk.obj\r
402\r
12ff2dc5
JB
403if (%gifsupport%) == (N) goto gifDone\r
404\r
507f5dce 405echo Checking for libgif...\r
12ff2dc5
JB
406echo #include "gif_lib.h" >junk.c\r
407echo main (){} >>junk.c\r
408rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
409echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
410%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
12ff2dc5
JB
411if exist junk.obj goto haveGif\r
412\r
507f5dce 413echo ...gif_lib.h not found, building without GIF support.\r
dbbdb507
EZ
414echo The failed program was: >>config.log\r
415type junk.c >>config.log\r
12ff2dc5
JB
416set HAVE_GIF=\r
417goto :gifDone\r
418\r
419:haveGif\r
420echo ...GIF header available, building with GIF support.\r
421set HAVE_GIF=1\r
422\r
423:gifDone\r
424rm -f junk.c junk.obj\r
425\r
47c01e80
JB
426if (%tiffsupport%) == (N) goto tiffDone\r
427\r
428echo Checking for tiff...\r
429echo #include "tiffio.h" >junk.c\r
430echo main (){} >>junk.c\r
431rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
432echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
433%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
47c01e80
JB
434if exist junk.obj goto haveTiff\r
435\r
507f5dce 436echo ...tiffio.h not found, building without TIFF support.\r
dbbdb507
EZ
437echo The failed program was: >>config.log\r
438type junk.c >>config.log\r
47c01e80
JB
439set HAVE_TIFF=\r
440goto :tiffDone\r
441\r
442:haveTiff\r
443echo ...TIFF header available, building with TIFF support.\r
444set HAVE_TIFF=1\r
445\r
446:tiffDone\r
447rm -f junk.c junk.obj\r
448\r
507f5dce
JR
449if (%xpmsupport%) == (N) goto xpmDone\r
450\r
451echo Checking for libXpm...\r
452echo #define FOR_MSW 1 >junk.c\r
453echo #include "X11/xpm.h" >>junk.c\r
454echo main (){} >>junk.c\r
455rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
456echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
457%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
507f5dce
JR
458if exist junk.obj goto haveXpm\r
459\r
460echo ...X11/xpm.h not found, building without XPM support.\r
dbbdb507
EZ
461echo The failed program was: >>config.log\r
462type junk.c >>config.log\r
507f5dce
JR
463set HAVE_XPM=\r
464goto :xpmDone\r
465\r
466:haveXpm\r
467echo ...XPM header available, building with XPM support.\r
468set HAVE_XPM=1\r
469\r
470:xpmDone\r
471rm -f junk.c junk.obj junk.err junk.out\r
472\r
f466241d
EZ
473rem ----------------------------------------------------------------------\r
474:genmakefiles\r
475echo Generating makefiles\r
476if %COMPILER% == gcc set MAKECMD=gmake\r
477if %COMPILER% == cl set MAKECMD=nmake\r
478\r
479rem Pass on chosen settings to makefiles.\r
480rem NB. Be very careful to not have a space before redirection symbols\r
481rem except when there is a preceding digit, when a space is required.\r
482rem\r
483echo # Start of settings from configure.bat >config.settings\r
484echo COMPILER=%COMPILER%>>config.settings\r
dbbdb507 485if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings\r
f466241d
EZ
486if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings\r
487if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
488if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
489if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
3a1ebd63
EZ
490rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r
491rem and the if command cannot cope with this\r
492for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y\r
493if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags%>>config.settings\r
494for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y\r
495if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings\r
2cd47384 496if (%usefontbackend%) == (Y) echo USE_FONTBACKEND=1 >>config.settings\r
f466241d
EZ
497echo # End of settings from configure.bat>>config.settings\r
498echo. >>config.settings\r
499\r
c262c68c
EZ
500copy config.nt config.tmp\r
501echo. >>config.tmp\r
502echo /* Start of settings from configure.bat. */ >>config.tmp\r
3a1ebd63
EZ
503if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp\r
504if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp\r
c262c68c
EZ
505if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp\r
506if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp\r
507if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp\r
508if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r
509if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp\r
510echo /* End of settings from configure.bat. */ >>config.tmp\r
511\r
512Rem See if fc.exe returns a meaningful exit status. If it does, we\r
513Rem might as well avoid unnecessary overwriting of config.h and epaths.h,\r
514Rem since this forces recompilation of every source file.\r
515if exist foo.bar del foo.bar\r
516fc /b foo.bar foo.bar >nul 2>&1\r
517if not errorlevel 2 goto doCopy\r
518fc /b config.tmp ..\src\config.h >nul 2>&1\r
519if errorlevel 1 goto doCopy\r
520fc /b paths.h ..\src\epaths.h >nul 2>&1\r
521if errorlevel 0 goto dontCopy\r
522:doCopy\r
523copy config.tmp ..\src\config.h\r
f466241d
EZ
524copy paths.h ..\src\epaths.h\r
525\r
c262c68c
EZ
526:dontCopy\r
527if exist config.tmp del config.tmp\r
f466241d 528copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r
a392138f 529if exist ..\admin\unidata copy /b config.settings+%MAKECMD%.defs+..\admin\unidata\makefile.w32-in ..\admin\unidata\makefile\r
f466241d
EZ
530copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r
531copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r
8aee12d0
GM
532copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile\r
533copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in ..\doc\misc\makefile\r
534copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in ..\doc\lispref\makefile\r
535copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in ..\doc\lispintro\makefile\r
f466241d
EZ
536if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile\r
537copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile\r
538rem Use the default (no-op) Makefile.in if the nt version is not present.\r
539if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile\r
540if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile\r
541del config.settings\r
542\r
e44f8099
EZ
543Rem Some people use WinZip which doesn't create empty directories!\r
544if not exist ..\site-lisp\nul mkdir ..\site-lisp\\r
57a64408
JB
545Rem Update subdirs.el only if it is different or fc.exe doesn't work.\r
546if exist foo.bar del foo.bar\r
547fc /b foo.bar foo.bar >nul 2>&1\r
548if not errorlevel 2 goto doUpdateSubdirs\r
549fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1\r
550if not errorlevel 1 goto dontUpdateSubdirs\r
551:doUpdateSubdirs\r
552if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el\r
553copy subdirs.el ..\site-lisp\subdirs.el\r
554\r
555:dontUpdateSubdirs\r
f466241d 556echo.\r
32154d10
JR
557\r
558rem check that we have all the libraries we need.\r
559set libsOK=1\r
560\r
561if not "(%HAVE_XPM%)" == "()" goto checkpng\r
562if (%xpmsupport%) == (N) goto checkpng\r
563 set libsOK=0\r
564 echo XPM support is missing. It is required for color icons in the toolbar.\r
565 echo Install libXpm development files or use --without-xpm\r
566\r
567:checkpng\r
568if not "(%HAVE_PNG%)" == "()" goto checkjpeg\r
569if (%pngsupport%) == (N) goto checkjpeg\r
570 set libsOK=0\r
571 echo PNG support is missing.\r
572 echo Install libpng development files or use --without-png\r
573\r
574:checkjpeg\r
575if not "(%HAVE_JPEG%)" == "()" goto checktiff\r
576if (%jpegsupport%) == (N) goto checktiff\r
577 set libsOK=0\r
578 echo JPEG support is missing.\r
579 echo Install jpeg development files or use --without-jpeg\r
580\r
581:checktiff\r
582if not "(%HAVE_TIFF%)" == "()" goto checkgif\r
583if (%tiffsupport%) == (N) goto checkgif\r
584 set libsOK=0\r
585 echo TIFF support is missing.\r
586 echo Install libtiff development files or use --without-tiff\r
587\r
588:checkgif\r
589if not "(%HAVE_GIF%)" == "()" goto donelibchecks\r
590if (%gifsupport%) == (N) goto donelibchecks\r
591 set libsOK=0\r
592 echo GIF support is missing.\r
593 echo Install giflib or libungif development files or use --without-gif\r
594\r
595:donelibchecks\r
596if (%libsOK%) == (1) goto success\r
597echo.\r
598echo Important libraries are missing. Fix these issues before running make.\r
599goto end\r
600\r
601:success\r
f466241d 602echo Emacs successfully configured.\r
a27014fc 603echo Emacs successfully configured. >>config.log\r
361823f4 604if (%MAKECMD%) == (gmake) set MAKECMD=make\r
f466241d
EZ
605echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.\r
606goto end\r
607\r
608:SmallEnv\r
609echo Your environment size is too small. Please enlarge it and rerun configure.\r
610echo For example, type "command.com /e:2048" to have 2048 bytes available.\r
611set $foo$=\r
612:end\r
613set prefix=\r
614set nodebug=\r
615set noopt=\r
616set nocygwin=\r
617set COMPILER=\r
618set MAKECMD=\r
619set usercflags=\r
3a1ebd63 620set docflags=\r
f466241d 621set userldflags=\r
3a1ebd63 622set doldflags=\r
112dc8e1 623set mingwflag=\r
dbbdb507 624set mf=\r
a2fcf029
MB
625\r
626goto skipArchTag\r
627 arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c\r
628:skipArchTag\r