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