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