(usercflags, userldflags): Quote %1.
[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
4e6835db 5rem 2006, 2007 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
f466241d 27rem + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 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
EZ
30rem\r
31rem For reference, here is a list of which builds of gmake are known to\r
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
87set userldflags=\r
88set sep1=\r
89set sep2=\r
90\r
91rem ----------------------------------------------------------------------\r
92rem Handle arguments.\r
93:again\r
94if "%1" == "-h" goto usage\r
95if "%1" == "--help" goto usage\r
96if "%1" == "--prefix" goto setprefix\r
97if "%1" == "--with-gcc" goto withgcc\r
98if "%1" == "--with-msvc" goto withmsvc\r
99if "%1" == "--no-debug" goto nodebug\r
100if "%1" == "--no-opt" goto noopt\r
101if "%1" == "--no-cygwin" goto nocygwin\r
102if "%1" == "--cflags" goto usercflags\r
103if "%1" == "--ldflags" goto userldflags\r
e0006538 104if "%1" == "--without-png" goto withoutpng\r
aad0eae4 105if "%1" == "--without-jpeg" goto withoutjpeg\r
12ff2dc5 106if "%1" == "--without-gif" goto withoutgif\r
47c01e80 107if "%1" == "--without-tiff" goto withouttiff\r
507f5dce 108if "%1" == "--without-xpm" goto withoutxpm\r
f466241d
EZ
109if "%1" == "" goto checkutils\r
110:usage\r
111echo Usage: configure [options]\r
112echo Options:\r
113echo. --prefix PREFIX install Emacs in directory PREFIX\r
114echo. --with-gcc use GCC to compile Emacs\r
115echo. --with-msvc use MSVC to compile Emacs\r
116echo. --no-debug exclude debug info from executables\r
117echo. --no-opt disable optimization\r
118echo. --no-cygwin use -mno-cygwin option with GCC\r
119echo. --cflags FLAG pass FLAG to compiler\r
120echo. --ldflags FLAG pass FLAG to compiler when linking\r
32154d10
JR
121echo. --without-png do not use libpng\r
122echo. --without-jpeg do not use jpeg-6b\r
123echo. --without-gif do not use giflib or libungif\r
124echo. --without-tiff do not use libtiff\r
125echo. --without-xpm do not use libXpm\r
f466241d
EZ
126goto end\r
127rem ----------------------------------------------------------------------\r
128:setprefix\r
129shift\r
130set prefix=%1\r
131shift\r
132goto again\r
133rem ----------------------------------------------------------------------\r
134:withgcc\r
135set COMPILER=gcc\r
136shift\r
137goto again\r
138rem ----------------------------------------------------------------------\r
139:withmsvc\r
140set COMPILER=cl\r
141shift\r
142goto again\r
143rem ----------------------------------------------------------------------\r
144:nodebug\r
145set nodebug=Y\r
146shift\r
147goto again\r
148rem ----------------------------------------------------------------------\r
149:noopt\r
150set noopt=Y\r
151shift\r
152goto again\r
153rem ----------------------------------------------------------------------\r
154:nocygwin\r
155set nocygwin=Y\r
156shift\r
157goto again\r
158rem ----------------------------------------------------------------------\r
159:usercflags\r
160shift\r
6d005ee7
EZ
161rem We quote arg here to leave quotes in the likes of "-DFOO=bar"\r
162set usercflags=%usercflags%%sep1%"%1"\r
f466241d
EZ
163set sep1= %nothing%\r
164shift\r
165goto again\r
166rem ----------------------------------------------------------------------\r
167:userldflags\r
168shift\r
6d005ee7 169set userldflags=%userldflags%%sep2%"%1"\r
f466241d
EZ
170set sep2= %nothing%\r
171shift\r
172goto again\r
e0006538
JR
173rem ----------------------------------------------------------------------\r
174\r
175:withoutpng\r
176set pngsupport=N\r
177set HAVE_PNG=\r
39bd0e03 178shift\r
e0006538 179goto again\r
f466241d 180\r
aad0eae4
JR
181rem ----------------------------------------------------------------------\r
182\r
183:withoutjpeg\r
184set jpegsupport=N\r
185set HAVE_JPEG=\r
39bd0e03 186shift\r
aad0eae4
JR
187goto again\r
188\r
12ff2dc5
JB
189rem ----------------------------------------------------------------------\r
190\r
191:withoutgif\r
192set gifsupport=N\r
193set HAVE_GIF=\r
194shift\r
195goto again\r
196\r
47c01e80
JB
197rem ----------------------------------------------------------------------\r
198\r
199:withouttiff\r
200set tiffsupport=N\r
201set HAVE_TIFF=\r
202shift\r
203goto again\r
204\r
507f5dce
JR
205rem ----------------------------------------------------------------------\r
206\r
207:withoutxpm\r
208set xpmsupport=N\r
209set HAVE_XPM=\r
210shift\r
211goto again\r
212\r
f466241d
EZ
213rem ----------------------------------------------------------------------\r
214rem Check that necessary utilities (cp and rm) are present.\r
215:checkutils\r
216echo Checking for 'cp'...\r
217cp configure.bat junk.bat\r
218if not exist junk.bat goto needcp\r
219echo Checking for 'rm'...\r
220rm junk.bat\r
221if exist junk.bat goto needrm\r
222goto checkcompiler\r
223:needcp\r
224echo You need 'cp' (the Unix file copy program) to build Emacs.\r
225goto end\r
226:needrm\r
227del junk.bat\r
228echo You need 'rm' (the Unix file delete program) to build Emacs.\r
229goto end\r
230\r
231rem ----------------------------------------------------------------------\r
232rem Auto-detect compiler if not specified, and validate GCC if chosen.\r
233:checkcompiler\r
e0006538 234if (%COMPILER%)==(cl) goto compilercheckdone\r
f466241d
EZ
235if (%COMPILER%)==(gcc) goto checkgcc\r
236\r
237echo Checking whether 'cl' is available...\r
238echo main(){} >junk.c\r
239cl -nologo -c junk.c\r
240if exist junk.obj goto clOK\r
241\r
242echo Checking whether 'gcc' is available...\r
243gcc -c junk.c\r
244if not exist junk.o goto nocompiler\r
245del junk.o\r
246\r
247:checkgcc\r
248Rem WARNING -- COMMAND.COM on some systems only looks at the first\r
249Rem 8 characters of a label. So do NOT be tempted to change\r
250Rem chkapi* into something fancier like checkw32api\r
251Rem You HAVE been warned!\r
252if (%nocygwin%) == (Y) goto chkapi\r
253echo Checking whether gcc requires '-mno-cygwin'...\r
254echo #include "cygwin/version.h" >junk.c\r
255echo main(){} >>junk.c\r
dbbdb507
EZ
256echo gcc -c junk.c >>config.log\r
257gcc -c junk.c >>config.log 2>&1\r
f466241d 258if not exist junk.o goto chkapi\r
dbbdb507
EZ
259echo gcc -mno-cygwin -c junk.c >>config.log\r
260gcc -mno-cygwin -c junk.c >>config.log 2>&1\r
f466241d
EZ
261if exist junk.o set nocygwin=Y\r
262rm -f junk.c junk.o\r
263\r
264:chkapi\r
dbbdb507
EZ
265echo The failed program was: >>config.log\r
266type junk.c >>config.log\r
f466241d
EZ
267rem ----------------------------------------------------------------------\r
268rem Older versions of the Windows API headers either don't have any of\r
269rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1\r
270rem are like this), or have a typo in the definition of\r
271rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this\r
272rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros\r
273rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.\r
274rem\r
275echo Checking whether W32 API headers are too old...\r
276echo #include "windows.h" >junk.c\r
277echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c\r
278echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c\r
279if (%nocygwin%) == (Y) goto chkapi1\r
280set cf=%usercflags%\r
281goto chkapi2\r
282:chkapi1\r
283set cf=%usercflags% -mno-cygwin\r
284:chkapi2\r
285echo on\r
286gcc %cf% -c junk.c\r
dbbdb507
EZ
287@echo off\r
288@echo gcc %cf% -c junk.c >>config.log\r
289gcc %cf% -c junk.c >>config.log 2>&1\r
f466241d
EZ
290set cf=\r
291if exist junk.o goto gccOk\r
dbbdb507
EZ
292echo The failed program was: >>config.log\r
293type junk.c >>config.log\r
f466241d
EZ
294\r
295:nocompiler\r
296echo.\r
297echo Configure failed.\r
298echo To configure Emacs for Windows, you need to have either\r
299echo gcc-2.95 or later with Mingw32 and the W32 API headers,\r
300echo or MSVC 2.x or later.\r
301del junk.c\r
302goto end\r
303\r
304:gccOk\r
305set COMPILER=gcc\r
f466241d 306echo Using 'gcc'\r
dbbdb507
EZ
307rm -f junk.c junk.o\r
308Rem It is not clear what GCC version began supporting -mtune\r
309Rem and pentium4 on x86, so check this explicitly.\r
310echo main(){} >junk.c\r
311echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log\r
312gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1\r
313if not errorlevel 1 goto gccMtuneOk\r
314echo The failed program was: >>config.log\r
315type junk.c >>config.log\r
316set mf=-mcpu=i686\r
317rm -f junk.c junk.o\r
318goto compilercheckdone\r
319:gccMtuneOk\r
320echo GCC supports -mtune=pentium4 >>config.log\r
321set mf=-mtune=pentium4\r
322rm -f junk.c junk.o\r
e0006538 323goto compilercheckdone\r
f466241d
EZ
324\r
325:clOk\r
326set COMPILER=cl\r
327rm -f junk.c junk.obj\r
328echo Using 'MSVC'\r
e0006538
JR
329\r
330:compilercheckdone\r
331\r
332rem ----------------------------------------------------------------------\r
333rem Check for external image libraries. Since they are loaded\r
334rem dynamically, the libraries themselves do not need to be present\r
335rem at compile time, but the header files are required.\r
336\r
112dc8e1
JR
337set mingwflag=\r
338\r
339if (%nocygwin%) == (N) goto flagsOK\r
340set mingwflag=-mno-cygwin\r
341\r
342:flagsOK\r
343\r
e0006538
JR
344if (%pngsupport%) == (N) goto pngDone\r
345\r
346echo Checking for libpng...\r
347echo #include "png.h" >junk.c\r
348echo main (){} >>junk.c\r
349rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
350echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
351%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
e0006538
JR
352if exist junk.obj goto havePng\r
353\r
507f5dce 354echo ...png.h not found, building without PNG support.\r
dbbdb507
EZ
355echo The failed program was: >>config.log\r
356type junk.c >>config.log\r
e0006538
JR
357set HAVE_PNG=\r
358goto :pngDone\r
359\r
360:havePng\r
361echo ...PNG header available, building with PNG support.\r
362set HAVE_PNG=1\r
363\r
364:pngDone\r
365rm -f junk.c junk.obj\r
f466241d 366\r
aad0eae4
JR
367if (%jpegsupport%) == (N) goto jpegDone\r
368\r
507f5dce 369echo Checking for jpeg-6b...\r
aad0eae4
JR
370echo #include "jconfig.h" >junk.c\r
371echo main (){} >>junk.c\r
372rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
373echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
374%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
aad0eae4
JR
375if exist junk.obj goto haveJpeg\r
376\r
507f5dce 377echo ...jconfig.h not found, building without JPEG support.\r
dbbdb507
EZ
378echo The failed program was: >>config.log\r
379type junk.c >>config.log\r
aad0eae4
JR
380set HAVE_JPEG=\r
381goto :jpegDone\r
382\r
383:haveJpeg\r
384echo ...JPEG header available, building with JPEG support.\r
385set HAVE_JPEG=1\r
386\r
387:jpegDone\r
388rm -f junk.c junk.obj\r
389\r
12ff2dc5
JB
390if (%gifsupport%) == (N) goto gifDone\r
391\r
507f5dce 392echo Checking for libgif...\r
12ff2dc5
JB
393echo #include "gif_lib.h" >junk.c\r
394echo main (){} >>junk.c\r
395rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
396echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
397%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
12ff2dc5
JB
398if exist junk.obj goto haveGif\r
399\r
507f5dce 400echo ...gif_lib.h not found, building without GIF support.\r
dbbdb507
EZ
401echo The failed program was: >>config.log\r
402type junk.c >>config.log\r
12ff2dc5
JB
403set HAVE_GIF=\r
404goto :gifDone\r
405\r
406:haveGif\r
407echo ...GIF header available, building with GIF support.\r
408set HAVE_GIF=1\r
409\r
410:gifDone\r
411rm -f junk.c junk.obj\r
412\r
47c01e80
JB
413if (%tiffsupport%) == (N) goto tiffDone\r
414\r
415echo Checking for tiff...\r
416echo #include "tiffio.h" >junk.c\r
417echo main (){} >>junk.c\r
418rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
419echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
420%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
47c01e80
JB
421if exist junk.obj goto haveTiff\r
422\r
507f5dce 423echo ...tiffio.h not found, building without TIFF support.\r
dbbdb507
EZ
424echo The failed program was: >>config.log\r
425type junk.c >>config.log\r
47c01e80
JB
426set HAVE_TIFF=\r
427goto :tiffDone\r
428\r
429:haveTiff\r
430echo ...TIFF header available, building with TIFF support.\r
431set HAVE_TIFF=1\r
432\r
433:tiffDone\r
434rm -f junk.c junk.obj\r
435\r
507f5dce
JR
436if (%xpmsupport%) == (N) goto xpmDone\r
437\r
438echo Checking for libXpm...\r
439echo #define FOR_MSW 1 >junk.c\r
440echo #include "X11/xpm.h" >>junk.c\r
441echo main (){} >>junk.c\r
442rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
443echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
444%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
507f5dce
JR
445if exist junk.obj goto haveXpm\r
446\r
447echo ...X11/xpm.h not found, building without XPM support.\r
dbbdb507
EZ
448echo The failed program was: >>config.log\r
449type junk.c >>config.log\r
507f5dce
JR
450set HAVE_XPM=\r
451goto :xpmDone\r
452\r
453:haveXpm\r
454echo ...XPM header available, building with XPM support.\r
455set HAVE_XPM=1\r
456\r
457:xpmDone\r
458rm -f junk.c junk.obj junk.err junk.out\r
459\r
f466241d
EZ
460rem ----------------------------------------------------------------------\r
461:genmakefiles\r
462echo Generating makefiles\r
463if %COMPILER% == gcc set MAKECMD=gmake\r
464if %COMPILER% == cl set MAKECMD=nmake\r
465\r
466rem Pass on chosen settings to makefiles.\r
467rem NB. Be very careful to not have a space before redirection symbols\r
468rem except when there is a preceding digit, when a space is required.\r
469rem\r
470echo # Start of settings from configure.bat >config.settings\r
471echo COMPILER=%COMPILER%>>config.settings\r
dbbdb507 472if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings\r
f466241d
EZ
473if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings\r
474if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
475if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
476if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
477if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings\r
478if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings\r
479echo # End of settings from configure.bat>>config.settings\r
480echo. >>config.settings\r
481\r
c262c68c
EZ
482copy config.nt config.tmp\r
483echo. >>config.tmp\r
484echo /* Start of settings from configure.bat. */ >>config.tmp\r
485if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>config.tmp\r
486if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>config.tmp\r
487if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp\r
488if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp\r
489if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp\r
490if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r
491if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp\r
492echo /* End of settings from configure.bat. */ >>config.tmp\r
493\r
494Rem See if fc.exe returns a meaningful exit status. If it does, we\r
495Rem might as well avoid unnecessary overwriting of config.h and epaths.h,\r
496Rem since this forces recompilation of every source file.\r
497if exist foo.bar del foo.bar\r
498fc /b foo.bar foo.bar >nul 2>&1\r
499if not errorlevel 2 goto doCopy\r
500fc /b config.tmp ..\src\config.h >nul 2>&1\r
501if errorlevel 1 goto doCopy\r
502fc /b paths.h ..\src\epaths.h >nul 2>&1\r
503if errorlevel 0 goto dontCopy\r
504:doCopy\r
505copy config.tmp ..\src\config.h\r
f466241d
EZ
506copy paths.h ..\src\epaths.h\r
507\r
c262c68c
EZ
508:dontCopy\r
509if exist config.tmp del config.tmp\r
f466241d
EZ
510copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r
511copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r
512copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r
8aee12d0
GM
513copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile\r
514copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in ..\doc\misc\makefile\r
515copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in ..\doc\lispref\makefile\r
516copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in ..\doc\lispintro\makefile\r
f466241d
EZ
517if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile\r
518copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile\r
519rem Use the default (no-op) Makefile.in if the nt version is not present.\r
520if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile\r
521if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile\r
522del config.settings\r
523\r
e44f8099
EZ
524Rem Some people use WinZip which doesn't create empty directories!\r
525if not exist ..\site-lisp\nul mkdir ..\site-lisp\\r
57a64408
JB
526Rem Update subdirs.el only if it is different or fc.exe doesn't work.\r
527if exist foo.bar del foo.bar\r
528fc /b foo.bar foo.bar >nul 2>&1\r
529if not errorlevel 2 goto doUpdateSubdirs\r
530fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1\r
531if not errorlevel 1 goto dontUpdateSubdirs\r
532:doUpdateSubdirs\r
533if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el\r
534copy subdirs.el ..\site-lisp\subdirs.el\r
535\r
536:dontUpdateSubdirs\r
f466241d 537echo.\r
32154d10
JR
538\r
539rem check that we have all the libraries we need.\r
540set libsOK=1\r
541\r
542if not "(%HAVE_XPM%)" == "()" goto checkpng\r
543if (%xpmsupport%) == (N) goto checkpng\r
544 set libsOK=0\r
545 echo XPM support is missing. It is required for color icons in the toolbar.\r
546 echo Install libXpm development files or use --without-xpm\r
547\r
548:checkpng\r
549if not "(%HAVE_PNG%)" == "()" goto checkjpeg\r
550if (%pngsupport%) == (N) goto checkjpeg\r
551 set libsOK=0\r
552 echo PNG support is missing.\r
553 echo Install libpng development files or use --without-png\r
554\r
555:checkjpeg\r
556if not "(%HAVE_JPEG%)" == "()" goto checktiff\r
557if (%jpegsupport%) == (N) goto checktiff\r
558 set libsOK=0\r
559 echo JPEG support is missing.\r
560 echo Install jpeg development files or use --without-jpeg\r
561\r
562:checktiff\r
563if not "(%HAVE_TIFF%)" == "()" goto checkgif\r
564if (%tiffsupport%) == (N) goto checkgif\r
565 set libsOK=0\r
566 echo TIFF support is missing.\r
567 echo Install libtiff development files or use --without-tiff\r
568\r
569:checkgif\r
570if not "(%HAVE_GIF%)" == "()" goto donelibchecks\r
571if (%gifsupport%) == (N) goto donelibchecks\r
572 set libsOK=0\r
573 echo GIF support is missing.\r
574 echo Install giflib or libungif development files or use --without-gif\r
575\r
576:donelibchecks\r
577if (%libsOK%) == (1) goto success\r
578echo.\r
579echo Important libraries are missing. Fix these issues before running make.\r
580goto end\r
581\r
582:success\r
f466241d 583echo Emacs successfully configured.\r
a27014fc 584echo Emacs successfully configured. >>config.log\r
f466241d
EZ
585echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.\r
586goto end\r
587\r
588:SmallEnv\r
589echo Your environment size is too small. Please enlarge it and rerun configure.\r
590echo For example, type "command.com /e:2048" to have 2048 bytes available.\r
591set $foo$=\r
592:end\r
593set prefix=\r
594set nodebug=\r
595set noopt=\r
596set nocygwin=\r
597set COMPILER=\r
598set MAKECMD=\r
599set usercflags=\r
600set userldflags=\r
112dc8e1 601set mingwflag=\r
dbbdb507 602set mf=\r
a2fcf029
MB
603\r
604goto skipArchTag\r
605 arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c\r
606:skipArchTag\r