(unidatagen-nmake, unidatagen-clean-nmake, unidatagen-CMD)
[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
32154d10
JR
124echo. --without-png do not use libpng\r
125echo. --without-jpeg do not use jpeg-6b\r
126echo. --without-gif do not use giflib or libungif\r
127echo. --without-tiff do not use libtiff\r
128echo. --without-xpm do not use libXpm\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
247echo Checking whether 'cl' is available...\r
248echo main(){} >junk.c\r
249cl -nologo -c junk.c\r
250if exist junk.obj goto clOK\r
251\r
252echo Checking whether 'gcc' is available...\r
253gcc -c junk.c\r
254if not exist junk.o goto nocompiler\r
255del junk.o\r
256\r
257:checkgcc\r
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
262if (%nocygwin%) == (Y) goto chkapi\r
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
EZ
271if exist junk.o set nocygwin=Y\r
272rm -f junk.c junk.o\r
273\r
274:chkapi\r
dbbdb507
EZ
275echo The failed program was: >>config.log\r
276type junk.c >>config.log\r
f466241d
EZ
277rem ----------------------------------------------------------------------\r
278rem Older versions of the Windows API headers either don't have any of\r
279rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1\r
280rem are like this), or have a typo in the definition of\r
281rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this\r
282rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros\r
283rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.\r
284rem\r
285echo Checking whether W32 API headers are too old...\r
286echo #include "windows.h" >junk.c\r
287echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c\r
288echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c\r
289if (%nocygwin%) == (Y) goto chkapi1\r
290set cf=%usercflags%\r
291goto chkapi2\r
292:chkapi1\r
293set cf=%usercflags% -mno-cygwin\r
294:chkapi2\r
295echo on\r
296gcc %cf% -c junk.c\r
dbbdb507
EZ
297@echo off\r
298@echo gcc %cf% -c junk.c >>config.log\r
299gcc %cf% -c junk.c >>config.log 2>&1\r
f466241d
EZ
300set cf=\r
301if exist junk.o goto gccOk\r
dbbdb507
EZ
302echo The failed program was: >>config.log\r
303type junk.c >>config.log\r
f466241d
EZ
304\r
305:nocompiler\r
306echo.\r
307echo Configure failed.\r
308echo To configure Emacs for Windows, you need to have either\r
309echo gcc-2.95 or later with Mingw32 and the W32 API headers,\r
310echo or MSVC 2.x or later.\r
311del junk.c\r
312goto end\r
313\r
314:gccOk\r
315set COMPILER=gcc\r
f466241d 316echo Using 'gcc'\r
dbbdb507
EZ
317rm -f junk.c junk.o\r
318Rem It is not clear what GCC version began supporting -mtune\r
319Rem and pentium4 on x86, so check this explicitly.\r
320echo main(){} >junk.c\r
321echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log\r
322gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1\r
323if not errorlevel 1 goto gccMtuneOk\r
324echo The failed program was: >>config.log\r
325type junk.c >>config.log\r
326set mf=-mcpu=i686\r
327rm -f junk.c junk.o\r
328goto compilercheckdone\r
329:gccMtuneOk\r
330echo GCC supports -mtune=pentium4 >>config.log\r
331set mf=-mtune=pentium4\r
332rm -f junk.c junk.o\r
e0006538 333goto compilercheckdone\r
f466241d
EZ
334\r
335:clOk\r
336set COMPILER=cl\r
337rm -f junk.c junk.obj\r
338echo Using 'MSVC'\r
e0006538
JR
339\r
340:compilercheckdone\r
341\r
342rem ----------------------------------------------------------------------\r
343rem Check for external image libraries. Since they are loaded\r
344rem dynamically, the libraries themselves do not need to be present\r
345rem at compile time, but the header files are required.\r
346\r
112dc8e1
JR
347set mingwflag=\r
348\r
349if (%nocygwin%) == (N) goto flagsOK\r
350set mingwflag=-mno-cygwin\r
351\r
352:flagsOK\r
353\r
e0006538
JR
354if (%pngsupport%) == (N) goto pngDone\r
355\r
356echo Checking for libpng...\r
357echo #include "png.h" >junk.c\r
358echo main (){} >>junk.c\r
359rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
360echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
361%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
e0006538
JR
362if exist junk.obj goto havePng\r
363\r
507f5dce 364echo ...png.h not found, building without PNG support.\r
dbbdb507
EZ
365echo The failed program was: >>config.log\r
366type junk.c >>config.log\r
e0006538
JR
367set HAVE_PNG=\r
368goto :pngDone\r
369\r
370:havePng\r
371echo ...PNG header available, building with PNG support.\r
372set HAVE_PNG=1\r
373\r
374:pngDone\r
375rm -f junk.c junk.obj\r
f466241d 376\r
aad0eae4
JR
377if (%jpegsupport%) == (N) goto jpegDone\r
378\r
507f5dce 379echo Checking for jpeg-6b...\r
aad0eae4
JR
380echo #include "jconfig.h" >junk.c\r
381echo main (){} >>junk.c\r
382rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
383echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
384%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
aad0eae4
JR
385if exist junk.obj goto haveJpeg\r
386\r
507f5dce 387echo ...jconfig.h not found, building without JPEG support.\r
dbbdb507
EZ
388echo The failed program was: >>config.log\r
389type junk.c >>config.log\r
aad0eae4
JR
390set HAVE_JPEG=\r
391goto :jpegDone\r
392\r
393:haveJpeg\r
394echo ...JPEG header available, building with JPEG support.\r
395set HAVE_JPEG=1\r
396\r
397:jpegDone\r
398rm -f junk.c junk.obj\r
399\r
12ff2dc5
JB
400if (%gifsupport%) == (N) goto gifDone\r
401\r
507f5dce 402echo Checking for libgif...\r
12ff2dc5
JB
403echo #include "gif_lib.h" >junk.c\r
404echo main (){} >>junk.c\r
405rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
406echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
407%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
12ff2dc5
JB
408if exist junk.obj goto haveGif\r
409\r
507f5dce 410echo ...gif_lib.h not found, building without GIF support.\r
dbbdb507
EZ
411echo The failed program was: >>config.log\r
412type junk.c >>config.log\r
12ff2dc5
JB
413set HAVE_GIF=\r
414goto :gifDone\r
415\r
416:haveGif\r
417echo ...GIF header available, building with GIF support.\r
418set HAVE_GIF=1\r
419\r
420:gifDone\r
421rm -f junk.c junk.obj\r
422\r
47c01e80
JB
423if (%tiffsupport%) == (N) goto tiffDone\r
424\r
425echo Checking for tiff...\r
426echo #include "tiffio.h" >junk.c\r
427echo main (){} >>junk.c\r
428rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
429echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
430%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
47c01e80
JB
431if exist junk.obj goto haveTiff\r
432\r
507f5dce 433echo ...tiffio.h not found, building without TIFF support.\r
dbbdb507
EZ
434echo The failed program was: >>config.log\r
435type junk.c >>config.log\r
47c01e80
JB
436set HAVE_TIFF=\r
437goto :tiffDone\r
438\r
439:haveTiff\r
440echo ...TIFF header available, building with TIFF support.\r
441set HAVE_TIFF=1\r
442\r
443:tiffDone\r
444rm -f junk.c junk.obj\r
445\r
507f5dce
JR
446if (%xpmsupport%) == (N) goto xpmDone\r
447\r
448echo Checking for libXpm...\r
449echo #define FOR_MSW 1 >junk.c\r
450echo #include "X11/xpm.h" >>junk.c\r
451echo main (){} >>junk.c\r
452rem -o option is ignored with cl, but allows result to be consistent.\r
dbbdb507
EZ
453echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
454%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
507f5dce
JR
455if exist junk.obj goto haveXpm\r
456\r
457echo ...X11/xpm.h not found, building without XPM support.\r
dbbdb507
EZ
458echo The failed program was: >>config.log\r
459type junk.c >>config.log\r
507f5dce
JR
460set HAVE_XPM=\r
461goto :xpmDone\r
462\r
463:haveXpm\r
464echo ...XPM header available, building with XPM support.\r
465set HAVE_XPM=1\r
466\r
467:xpmDone\r
468rm -f junk.c junk.obj junk.err junk.out\r
469\r
f466241d
EZ
470rem ----------------------------------------------------------------------\r
471:genmakefiles\r
472echo Generating makefiles\r
473if %COMPILER% == gcc set MAKECMD=gmake\r
474if %COMPILER% == cl set MAKECMD=nmake\r
475\r
476rem Pass on chosen settings to makefiles.\r
477rem NB. Be very careful to not have a space before redirection symbols\r
478rem except when there is a preceding digit, when a space is required.\r
479rem\r
480echo # Start of settings from configure.bat >config.settings\r
481echo COMPILER=%COMPILER%>>config.settings\r
dbbdb507 482if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings\r
f466241d
EZ
483if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings\r
484if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
485if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
486if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
3a1ebd63
EZ
487rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r
488rem and the if command cannot cope with this\r
489for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y\r
490if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags%>>config.settings\r
491for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y\r
492if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings\r
2cd47384 493if (%usefontbackend%) == (Y) echo USE_FONTBACKEND=1 >>config.settings\r
f466241d
EZ
494echo # End of settings from configure.bat>>config.settings\r
495echo. >>config.settings\r
496\r
c262c68c
EZ
497copy config.nt config.tmp\r
498echo. >>config.tmp\r
499echo /* Start of settings from configure.bat. */ >>config.tmp\r
3a1ebd63
EZ
500if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp\r
501if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp\r
c262c68c
EZ
502if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp\r
503if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp\r
504if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp\r
505if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r
506if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp\r
507echo /* End of settings from configure.bat. */ >>config.tmp\r
508\r
509Rem See if fc.exe returns a meaningful exit status. If it does, we\r
510Rem might as well avoid unnecessary overwriting of config.h and epaths.h,\r
511Rem since this forces recompilation of every source file.\r
512if exist foo.bar del foo.bar\r
513fc /b foo.bar foo.bar >nul 2>&1\r
514if not errorlevel 2 goto doCopy\r
515fc /b config.tmp ..\src\config.h >nul 2>&1\r
516if errorlevel 1 goto doCopy\r
517fc /b paths.h ..\src\epaths.h >nul 2>&1\r
518if errorlevel 0 goto dontCopy\r
519:doCopy\r
520copy config.tmp ..\src\config.h\r
f466241d
EZ
521copy paths.h ..\src\epaths.h\r
522\r
c262c68c
EZ
523:dontCopy\r
524if exist config.tmp del config.tmp\r
f466241d
EZ
525copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r
526copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r
527copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r
8aee12d0
GM
528copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile\r
529copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in ..\doc\misc\makefile\r
530copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in ..\doc\lispref\makefile\r
531copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in ..\doc\lispintro\makefile\r
f466241d
EZ
532if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile\r
533copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile\r
534rem Use the default (no-op) Makefile.in if the nt version is not present.\r
535if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile\r
536if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile\r
537del config.settings\r
538\r
e44f8099
EZ
539Rem Some people use WinZip which doesn't create empty directories!\r
540if not exist ..\site-lisp\nul mkdir ..\site-lisp\\r
57a64408
JB
541Rem Update subdirs.el only if it is different or fc.exe doesn't work.\r
542if exist foo.bar del foo.bar\r
543fc /b foo.bar foo.bar >nul 2>&1\r
544if not errorlevel 2 goto doUpdateSubdirs\r
545fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1\r
546if not errorlevel 1 goto dontUpdateSubdirs\r
547:doUpdateSubdirs\r
548if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el\r
549copy subdirs.el ..\site-lisp\subdirs.el\r
550\r
551:dontUpdateSubdirs\r
f466241d 552echo.\r
32154d10
JR
553\r
554rem check that we have all the libraries we need.\r
555set libsOK=1\r
556\r
557if not "(%HAVE_XPM%)" == "()" goto checkpng\r
558if (%xpmsupport%) == (N) goto checkpng\r
559 set libsOK=0\r
560 echo XPM support is missing. It is required for color icons in the toolbar.\r
561 echo Install libXpm development files or use --without-xpm\r
562\r
563:checkpng\r
564if not "(%HAVE_PNG%)" == "()" goto checkjpeg\r
565if (%pngsupport%) == (N) goto checkjpeg\r
566 set libsOK=0\r
567 echo PNG support is missing.\r
568 echo Install libpng development files or use --without-png\r
569\r
570:checkjpeg\r
571if not "(%HAVE_JPEG%)" == "()" goto checktiff\r
572if (%jpegsupport%) == (N) goto checktiff\r
573 set libsOK=0\r
574 echo JPEG support is missing.\r
575 echo Install jpeg development files or use --without-jpeg\r
576\r
577:checktiff\r
578if not "(%HAVE_TIFF%)" == "()" goto checkgif\r
579if (%tiffsupport%) == (N) goto checkgif\r
580 set libsOK=0\r
581 echo TIFF support is missing.\r
582 echo Install libtiff development files or use --without-tiff\r
583\r
584:checkgif\r
585if not "(%HAVE_GIF%)" == "()" goto donelibchecks\r
586if (%gifsupport%) == (N) goto donelibchecks\r
587 set libsOK=0\r
588 echo GIF support is missing.\r
589 echo Install giflib or libungif development files or use --without-gif\r
590\r
591:donelibchecks\r
592if (%libsOK%) == (1) goto success\r
593echo.\r
594echo Important libraries are missing. Fix these issues before running make.\r
595goto end\r
596\r
597:success\r
f466241d 598echo Emacs successfully configured.\r
a27014fc 599echo Emacs successfully configured. >>config.log\r
f466241d
EZ
600echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.\r
601goto end\r
602\r
603:SmallEnv\r
604echo Your environment size is too small. Please enlarge it and rerun configure.\r
605echo For example, type "command.com /e:2048" to have 2048 bytes available.\r
606set $foo$=\r
607:end\r
608set prefix=\r
609set nodebug=\r
610set noopt=\r
611set nocygwin=\r
612set COMPILER=\r
613set MAKECMD=\r
614set usercflags=\r
3a1ebd63 615set docflags=\r
f466241d 616set userldflags=\r
3a1ebd63 617set doldflags=\r
112dc8e1 618set mingwflag=\r
dbbdb507 619set mf=\r
a2fcf029
MB
620\r
621goto skipArchTag\r
622 arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c\r
623:skipArchTag\r