2 rem ----------------------------------------------------------------------
\r
3 rem Configuration script for MS Windows operating systems
\r
4 rem Copyright (C) 1999-2015 Free Software Foundation, Inc.
\r
6 rem This file is part of GNU Emacs.
\r
8 rem GNU Emacs is free software: you can redistribute it and/or modify
\r
9 rem it under the terms of the GNU General Public License as published by
\r
10 rem the Free Software Foundation, either version 3 of the License, or
\r
11 rem (at your option) any later version.
\r
13 rem GNU Emacs is distributed in the hope that it will be useful,
\r
14 rem but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 rem GNU General Public License for more details.
\r
18 rem You should have received a copy of the GNU General Public License
\r
19 rem along with GNU Emacs. If not, see http://www.gnu.org/licenses/.
\r
21 rem ----------------------------------------------------------------------
\r
22 rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
\r
24 rem + MS Windows 95, NT or later
\r
25 rem + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75
\r
26 rem or later) and the Mingw32 and Windows API headers and libraries.
\r
27 rem + Visual Studio 2005 is not supported at this time.
\r
29 rem For reference, here is a list of which builds of GNU make are known to
\r
30 rem work or not, and whether they work in the presence and/or absence of
\r
34 rem cygwin b20.1 make (3.75): fails[1,5] fails[2,5]
\r
35 rem MSVC compiled gmake 3.77: okay okay
\r
36 rem MSVC compiled gmake 3.78.1: okay okay
\r
37 rem MSVC compiled gmake 3.79.1: okay okay
\r
38 rem mingw32/gcc-2.92.2 make (3.77): okay okay[4]
\r
39 rem cygwin compiled gmake 3.77: fails[1,5] fails[2,5]
\r
40 rem cygwin compiled gmake 3.78.1: fails[5] fails[2,5]
\r
41 rem cygwin compiled gmake 3.79.1: fails[3,5] fails[2?,5]
\r
42 rem cygwin compiled make 3.80: okay[6] fails?[7]
\r
43 rem cygwin compiled make 3.81: fails fails?[7]
\r
44 rem mingw32 compiled make 3.79.1: okay okay
\r
45 rem mingw32 compiled make 3.80: okay okay?[7]
\r
46 rem mingw32 compiled make 3.81: okay okay[8]
\r
48 rem [1] doesn't cope with makefiles with DOS line endings, so must mount
\r
49 rem emacs source with text!=binary.
\r
50 rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.
\r
51 rem [3] requires LC_MESSAGES support to build; cannot build with early
\r
52 rem versions of cygwin.
\r
53 rem [4] may fail on Windows 9X and Windows ME; if so, install Bash.
\r
54 rem [5] fails when building leim due to the use of cygwin style paths.
\r
55 rem May work if building emacs without leim.
\r
56 rem [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath';
\r
57 rem look for "cygpath" near line 85 of gmake.defs.
\r
58 rem [7] not recommended; please report if you try this combination.
\r
59 rem [8] tested only on Windows XP.
\r
61 echo ****************************************************************
\r
62 echo *** THIS METHOD OF BUILDING EMACS IS NO LONGER SUPPORTED. **
\r
63 echo *** INSTEAD, FOLLOW THE INSTRUCTIONS FROM INSTALL. **
\r
64 echo ****************************************************************
\r
66 set /p answer=Continue running this script at your own risks ? (Y/N)
\r
67 if x%answer% == xy (goto confirm_continue_y)
\r
68 if x%answer% == xY (goto confirm_continue_y)
\r
69 if x%answer% == xn (goto end)
\r
70 if x%answer% == xN (goto end)
\r
71 echo Please answer by Y or N
\r
72 goto confirm_continue
\r
75 if exist config.log del config.log
\r
77 rem ----------------------------------------------------------------------
\r
78 rem See if the environment is large enough. We need 43 (?) bytes.
\r
79 set $foo$=123456789_123456789_123456789_123456789_123
\r
80 if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv
\r
83 rem ----------------------------------------------------------------------
\r
84 rem Make sure we are running in the nt subdir
\r
85 if exist configure.bat goto start
\r
86 echo You must run configure from the nt subdirectory.
\r
90 rem ----------------------------------------------------------------------
\r
91 rem Attempt to enable command extensions. Set use_extensions to 1 if
\r
92 rem they are available and 0 if they are not available.
\r
93 set use_extensions=1
\r
94 setlocal ENABLEEXTENSIONS
\r
95 if "%CMDEXTVERSION%" == "" set use_extensions=0
\r
96 if "%use_extensions%" == "1" goto afterext
\r
98 echo. Command extensions are not available. Using parameters that include the =
\r
99 echo. character by enclosing them in quotes will not be supported.
\r
103 rem ----------------------------------------------------------------------
\r
104 rem Default settings.
\r
108 set enablechecking=N
\r
116 set escuserldflags=
\r
126 rem ----------------------------------------------------------------------
\r
127 rem Handle arguments.
\r
129 if "%1" == "-h" goto usage
\r
130 if "%1" == "--help" goto usage
\r
131 if "%1" == "--prefix" goto setprefix
\r
132 if "%1" == "--with-gcc" goto withgcc
\r
133 if "%1" == "--with-msvc" goto withmsvc
\r
134 if "%1" == "--no-debug" goto nodebug
\r
135 if "%1" == "--no-opt" goto noopt
\r
136 if "%1" == "--enable-checking" goto enablechecking
\r
137 if "%1" == "--profile" goto profile
\r
138 if "%1" == "--no-cygwin" goto nocygwin
\r
139 if "%1" == "--cflags" goto usercflags
\r
140 if "%1" == "--ldflags" goto userldflags
\r
141 if "%1" == "--lib" goto extrauserlibs
\r
142 if "%1" == "--without-png" goto withoutpng
\r
143 if "%1" == "--without-jpeg" goto withoutjpeg
\r
144 if "%1" == "--without-gif" goto withoutgif
\r
145 if "%1" == "--without-tiff" goto withouttiff
\r
146 if "%1" == "--without-gnutls" goto withoutgnutls
\r
147 if "%1" == "--without-libxml2" goto withoutlibxml2
\r
148 if "%1" == "--without-xpm" goto withoutxpm
\r
149 if "%1" == "--with-svg" goto withsvg
\r
150 if "%1" == "--distfiles" goto distfiles
\r
151 if "%1" == "" goto checkutils
\r
154 echo Usage: configure [options]
\r
156 echo. --prefix PREFIX install Emacs in directory PREFIX
\r
157 echo. --with-gcc use GCC to compile Emacs
\r
158 echo. --with-msvc use MSVC to compile Emacs
\r
159 echo. --no-debug exclude debug info from executables
\r
160 echo. --no-opt disable optimization
\r
161 echo. --enable-checking enable additional run-time checks
\r
162 echo. --profile enable profiling
\r
163 echo. --no-cygwin use -mno-cygwin option with GCC
\r
164 echo. --cflags FLAG pass FLAG to compiler
\r
165 echo. --ldflags FLAG pass FLAG to compiler when linking
\r
166 echo. --lib LIB link to extra library LIB
\r
167 echo. --without-png do not use PNG library even if it is installed
\r
168 echo. --without-jpeg do not use JPEG library even if it is installed
\r
169 echo. --without-gif do not use GIF library even if it is installed
\r
170 echo. --without-tiff do not use TIFF library even if it is installed
\r
171 echo. --without-xpm do not use XPM library even if it is installed
\r
172 echo. --without-gnutls do not use GnuTLS library even if it is installed
\r
173 echo. --without-libxml2 do not use libxml2 library even if it is installed
\r
174 echo. --with-svg use the RSVG library (experimental)
\r
175 echo. --distfiles path to files for make dist, e.g. libXpm.dll
\r
176 if "%use_extensions%" == "0" goto end
\r
178 echo. The cflags and ldflags arguments support parameters that include the =
\r
179 echo. character. However, since the = character is normally treated as a
\r
180 echo. separator character you will need to enclose any parameter that includes
\r
181 echo. the = character in quotes. For example, to include
\r
182 echo. -DSITELOAD_PURESIZE_EXTRA=100000 as one of the cflags you would run
\r
183 echo. configure.bat as follows:
\r
184 echo. configure.bat --cflags "-DSITELOAD_PURESIZE_EXTRA=100000"
\r
186 echo. Note that this capability of processing parameters that include the =
\r
187 echo. character depends on command extensions. This batch file attempts to
\r
188 echo. enable command extensions. If command extensions cannot be enabled, a
\r
189 echo. warning message will be displayed.
\r
191 echo. IMPORTANT: This method of building Emacs for MS-Windows is deprecated,
\r
192 echo. and could be removed in a future version of Emacs. The preferred way
\r
193 echo to build Emacs for MS-Windows from now on is using the MSYS environment
\r
194 echo. and MinGW development tools. Please see nt/INSTALL for details.
\r
197 rem ----------------------------------------------------------------------
\r
205 rem ----------------------------------------------------------------------
\r
212 rem ----------------------------------------------------------------------
\r
219 rem ----------------------------------------------------------------------
\r
226 rem ----------------------------------------------------------------------
\r
233 rem ----------------------------------------------------------------------
\r
236 set enablechecking=Y
\r
240 rem ----------------------------------------------------------------------
\r
247 rem ----------------------------------------------------------------------
\r
254 rem ----------------------------------------------------------------------
\r
257 if "%use_extensions%" == "1" goto ucflagex
\r
262 set usercflags=%usercflags%%sep1%%~1
\r
263 set escusercflags=%usercflags:"=\"%
\r
264 set sep1= %nothing%
\r
270 set usercflags=%usercflags%%sep1%%1
\r
271 set escusercflags=%usercflags%
\r
272 set sep1= %nothing%
\r
278 echo. extrauserlibs: %extrauserlibs%
\r
279 set extrauserlibs=%extrauserlibs%%sep4%%1
\r
280 set sep4= %nothing%
\r
284 rem ----------------------------------------------------------------------
\r
287 if "%use_extensions%" == "1" goto ulflagex
\r
292 set userldflags=%userldflags%%sep2%%~1
\r
293 set escuserldflags=%userldflags:"=\"%
\r
294 set sep2= %nothing%
\r
300 set userldflags=%userldflags%%sep2%%1
\r
301 set escuserldflags=%userldflags%
\r
302 set sep2= %nothing%
\r
306 rem ----------------------------------------------------------------------
\r
314 rem ----------------------------------------------------------------------
\r
322 rem ----------------------------------------------------------------------
\r
330 rem ----------------------------------------------------------------------
\r
338 rem ----------------------------------------------------------------------
\r
341 set libxml2support=N
\r
346 rem ----------------------------------------------------------------------
\r
354 rem ----------------------------------------------------------------------
\r
367 rem ----------------------------------------------------------------------
\r
370 set HAVE_DISTFILES=1
\r
372 set distfiles=%distfiles%%sep3%%1
\r
373 set sep3= %nothing%
\r
377 rem ----------------------------------------------------------------------
\r
378 rem Check that necessary utilities (cp and rm) are present.
\r
381 echo Checking for 'cp'...
\r
382 cp configure.bat junk.bat
\r
383 if not exist junk.bat goto needcp
\r
384 echo Checking for 'rm'...
\r
386 if exist junk.bat goto needrm
\r
390 echo You need 'cp' (the Unix file copy program) to build Emacs.
\r
395 echo You need 'rm' (the Unix file delete program) to build Emacs.
\r
398 rem ----------------------------------------------------------------------
\r
399 rem Auto-detect compiler if not specified, and validate GCC if chosen.
\r
402 if (%COMPILER%)==(cl) goto compilercheckdone
\r
403 if (%COMPILER%)==(gcc) goto checkgcc
\r
405 echo Checking whether 'gcc' is available...
\r
406 echo main(){} >junk.c
\r
408 if exist junk.o goto checkgcc
\r
410 echo Checking whether 'cl' is available...
\r
411 cl -nologo -c junk.c
\r
412 if exist junk.obj goto clOK
\r
416 if exist junk.o del junk.o
\r
417 Rem WARNING -- COMMAND.COM on some systems only looks at the first
\r
418 Rem 8 characters of a label. So do NOT be tempted to change
\r
419 Rem chkapi* into something fancier like checkw32api
\r
420 Rem You HAVE been warned!
\r
421 if (%nocygwin%) == (Y) goto chkapiN
\r
422 echo Checking whether gcc requires '-mno-cygwin'...
\r
423 echo #include "cygwin/version.h" >junk.c
\r
424 echo main(){} >>junk.c
\r
425 echo gcc -c junk.c >>config.log
\r
426 gcc -c junk.c >>config.log 2>&1
\r
427 if not exist junk.o goto chkapi
\r
428 echo gcc -mno-cygwin -c junk.c >>config.log
\r
429 gcc -mno-cygwin -c junk.c >>config.log 2>&1
\r
430 if exist junk.o set nocygwin=Y
\r
433 echo The failed program was: >>config.log
\r
434 type junk.c >>config.log
\r
437 rm -f junk.c junk.o
\r
438 rem ----------------------------------------------------------------------
\r
439 rem Older versions of the Windows API headers either don't have any of
\r
440 rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1
\r
441 rem are like this), or have a typo in the definition of
\r
442 rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this
\r
443 rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros
\r
444 rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.
\r
445 rem Beginning with Emacs 23, we need usp10.h.
\r
447 echo Checking whether Windows API headers are too old...
\r
448 echo #include "windows.h" >junk.c
\r
449 echo #include "usp10.h" >>junk.c
\r
450 echo void test(PIMAGE_NT_HEADERS pHeader) >>junk.c
\r
451 echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c
\r
452 if (%nocygwin%) == (Y) goto chkapi1
\r
453 set cf=%usercflags%
\r
457 set cf=%usercflags% -mno-cygwin
\r
463 @echo gcc %cf% -c junk.c >>config.log
\r
464 gcc %cf% -c junk.c >>config.log 2>&1
\r
466 if exist junk.o goto chkuser
\r
467 echo The failed program was: >>config.log
\r
468 type junk.c >>config.log
\r
473 echo int main (int argc, char *argv[]) {>junk.c
\r
474 echo char *usercflags = "%escusercflags%";>>junk.c
\r
476 echo gcc -Werror -c junk.c >>config.log
\r
477 gcc -Werror -c junk.c >>config.log 2>&1
\r
478 if exist junk.o goto gccOk
\r
480 echo Error in --cflags argument: %usercflags%
\r
481 echo Backslashes and quotes cannot be used with --cflags. Please use forward
\r
482 echo slashes for filenames and paths (e.g. when passing directories to -I).
\r
488 echo Configure failed.
\r
489 echo To configure Emacs for Windows, you need to have either
\r
490 echo gcc-2.95 or later with Mingw32 and the Windows API headers,
\r
491 echo or MSVC 2.x or later.
\r
498 rm -f junk.c junk.o
\r
499 Rem It is not clear what GCC version began supporting -mtune
\r
500 Rem and pentium4 on x86, so check this explicitly.
\r
501 echo main(){} >junk.c
\r
502 echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log
\r
503 gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1
\r
504 if not errorlevel 1 goto gccMtuneOk
\r
505 echo The failed program was: >>config.log
\r
506 type junk.c >>config.log
\r
508 rm -f junk.c junk.o
\r
512 echo GCC supports -mtune=pentium4 >>config.log
\r
513 set mf=-mtune=pentium4
\r
514 rm -f junk.c junk.o
\r
517 rem Check for DWARF-2 debug info support, else default to stabs
\r
518 echo main(){} >junk.c
\r
519 echo gcc -c -gdwarf-2 -g3 junk.c >>config.log
\r
520 gcc -c -gdwarf-2 -g3 junk.c >>config.log 2>&1
\r
521 if not errorlevel 1 goto gccdwarf
\r
522 echo The failed program was: >>config.log
\r
523 type junk.c >>config.log
\r
524 set dbginfo=-gstabs+
\r
525 rm -f junk.c junk.o
\r
526 goto compilercheckdone
\r
529 echo GCC supports DWARF-2 >>config.log
\r
530 set dbginfo=-gdwarf-2 -g3
\r
531 rm -f junk.c junk.o
\r
532 goto compilercheckdone
\r
536 rm -f junk.c junk.obj
\r
541 rem ----------------------------------------------------------------------
\r
542 rem Check for external image libraries. Since they are loaded
\r
543 rem dynamically, the libraries themselves do not need to be present
\r
544 rem at compile time, but the header files are required.
\r
548 if (%nocygwin%) == (N) goto flagsOK
\r
549 set mingwflag=-mno-cygwin
\r
553 if (%pngsupport%) == (N) goto pngDone
\r
555 echo Checking for libpng...
\r
556 echo #include "png.h" >junk.c
\r
557 echo main (){} >>junk.c
\r
558 rem -o option is ignored with cl, but allows result to be consistent.
\r
559 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
560 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
561 if exist junk.obj goto havePng
\r
563 echo ...png.h not found, building without PNG support.
\r
564 echo The failed program was: >>config.log
\r
565 type junk.c >>config.log
\r
570 echo ...PNG header available, building with PNG support.
\r
574 rm -f junk.c junk.obj
\r
576 if (%tlssupport%) == (N) goto tlsDone
\r
578 rem this is a copy of the PNG detection
\r
579 echo Checking for libgnutls...
\r
580 echo #include "gnutls/gnutls.h" >junk.c
\r
581 echo main (){} >>junk.c
\r
582 rem -o option is ignored with cl, but allows result to be consistent.
\r
583 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
584 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
585 if exist junk.obj goto haveTls
\r
587 echo ...gnutls.h not found, building without TLS support.
\r
588 echo The failed program was: >>config.log
\r
589 type junk.c >>config.log
\r
594 echo ...GnuTLS header available, building with GnuTLS support.
\r
598 rm -f junk.c junk.obj
\r
600 if (%libxml2support%) == (N) goto xml2Done
\r
602 echo Checking for libxml2....
\r
603 echo #include "libxml/HTMLparser.h" >junk.c
\r
604 echo main(){} >>junk.c
\r
605 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
606 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
607 if exist junk.obj goto havelibxml2
\r
609 echo ...libxml/HTMLparser.h not found, building without libxml2 support
\r
610 echo The failed program was: >>config.log
\r
611 type junk.c >>config.log
\r
616 echo ...libxml2 header available, building with libxml2 support
\r
620 rm -f junk.c junk.obj
\r
622 if (%jpegsupport%) == (N) goto jpegDone
\r
624 echo Checking for jpeg-6b...
\r
625 echo #include "jconfig.h" >junk.c
\r
626 echo main (){} >>junk.c
\r
627 rem -o option is ignored with cl, but allows result to be consistent.
\r
628 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
629 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
630 if exist junk.obj goto haveJpeg
\r
632 echo ...jconfig.h not found, building without JPEG support.
\r
633 echo The failed program was: >>config.log
\r
634 type junk.c >>config.log
\r
639 echo ...JPEG header available, building with JPEG support.
\r
643 rm -f junk.c junk.obj
\r
645 if (%gifsupport%) == (N) goto gifDone
\r
647 echo Checking for libgif...
\r
648 rem giflib-5.0.0 needs size_t defined before gif_lib.h is included
\r
649 rem redirection characters need to be protected from the shell
\r
650 echo #include ^<stddef.h^> >junk.c
\r
651 echo #include "gif_lib.h" >>junk.c
\r
652 echo main (){} >>junk.c
\r
653 rem -o option is ignored with cl, but allows result to be consistent.
\r
654 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
655 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
656 if exist junk.obj goto haveGif
\r
658 echo ...gif_lib.h not found, building without GIF support.
\r
659 echo The failed program was: >>config.log
\r
660 type junk.c >>config.log
\r
665 echo ...GIF header available, building with GIF support.
\r
669 rm -f junk.c junk.obj
\r
671 if (%tiffsupport%) == (N) goto tiffDone
\r
673 echo Checking for tiff...
\r
674 echo #include "tiffio.h" >junk.c
\r
675 echo main (){} >>junk.c
\r
676 rem -o option is ignored with cl, but allows result to be consistent.
\r
677 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
678 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
679 if exist junk.obj goto haveTiff
\r
681 echo ...tiffio.h not found, building without TIFF support.
\r
682 echo The failed program was: >>config.log
\r
683 type junk.c >>config.log
\r
688 echo ...TIFF header available, building with TIFF support.
\r
692 rm -f junk.c junk.obj
\r
694 if (%xpmsupport%) == (N) goto xpmDone
\r
696 echo Checking for libXpm...
\r
697 echo #define FOR_MSW 1 >junk.c
\r
698 echo #include "X11/xpm.h" >>junk.c
\r
699 echo main (){} >>junk.c
\r
700 rem -o option is ignored with cl, but allows result to be consistent.
\r
701 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
702 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
703 if exist junk.obj goto haveXpm
\r
705 echo ...X11/xpm.h not found, building without XPM support.
\r
706 echo The failed program was: >>config.log
\r
707 type junk.c >>config.log
\r
712 echo ...XPM header available, building with XPM support.
\r
716 rm -f junk.c junk.obj
\r
718 if not (%svgsupport%) == (Y) goto :svgDone
\r
719 echo Checking for librsvg...
\r
720 echo #include "librsvg/rsvg.h" >junk.c
\r
721 echo main (){} >>junk.c
\r
722 rem -o option is ignored with cl, but allows result to be consistent.
\r
723 echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
\r
724 %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
\r
725 if exist junk.obj goto haveSvg
\r
727 echo ...librsvg/rsvg.h or dependencies not found, building without SVG support.
\r
728 echo The failed program was: >>config.log
\r
729 type junk.c >>config.log
\r
734 echo ...librsvg header available, building with SVG support (EXPERIMENTAL).
\r
738 rm -f junk.c junk.obj junk.err junk.out
\r
740 rem Any distfiles provided for building distribution? If no, we're done.
\r
741 if "(%HAVE_DISTFILES%)"=="()" goto :distFilesDone
\r
743 rem Any arguments to --distfiles specified? If no, we're done.
\r
744 if not "%distfiles%"=="" goto :checkDistFiles
\r
746 echo No arguments specified for option --distfiles!
\r
750 echo Checking for distfiles...
\r
751 rem Check if all specified distfiles exist
\r
753 for %%d in (%distfiles%) do if not exist %%d set fileNotFound=%%d
\r
754 if not "%fileNotFound%"=="" goto distFilesNotFound
\r
757 echo ...all distfiles found.
\r
758 goto :distFilesDone
\r
762 echo ...%fileNotFound% not found.
\r
764 goto :distfilesDone
\r
769 rem ----------------------------------------------------------------------
\r
772 echo Generating makefiles
\r
773 if %COMPILER% == gcc set MAKECMD=gmake
\r
774 if %COMPILER% == cl set MAKECMD=nmake
\r
776 rem Pass on chosen settings to makefiles.
\r
778 rem The weird place we put the redirection is to make sure no extra
\r
779 rem whitespace winds up at the end of the Make variables, since some
\r
780 rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will
\r
781 rem write the blanks between the end of command arguments and the
\r
782 rem redirection symbol to the file. OTOH, we cannot put the
\r
783 rem redirection immediately after the last character of the command,
\r
784 rem because environment variable expansion can yield a digit there,
\r
785 rem which will then be misinterpreted as the file descriptor to
\r
787 echo # Start of settings from configure.bat >config.settings
\r
788 >>config.settings echo COMPILER=%COMPILER%
\r
789 if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf%
\r
790 if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo%
\r
791 if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1
\r
792 if (%noopt%) == (Y) >>config.settings echo NOOPT=1
\r
793 if (%profile%) == (Y) >>config.settings echo PROFILE=1
\r
794 if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1
\r
795 if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix%
\r
796 if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles%
\r
797 rem We go thru docflags because usercflags could be "-DFOO=bar" -something
\r
798 rem and the if command cannot cope with this
\r
799 for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
\r
800 if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags%
\r
801 if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags%
\r
802 for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
\r
803 if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags%
\r
804 for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y
\r
805 if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs%
\r
806 echo # End of settings from configure.bat>>config.settings
\r
807 echo. >>config.settings
\r
809 copy config.nt config.tmp
\r
811 echo /* Start of settings from configure.bat. */ >>config.tmp
\r
812 rem We write USER_CFLAGS and USER_LDFLAGS starting with a space to simplify
\r
813 rem processing of compiler options in w32.c:get_emacs_configuration_options
\r
814 if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%" >>config.tmp
\r
815 if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%" >>config.tmp
\r
816 if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp
\r
817 if (%enablechecking%) == (Y) echo #define ENABLE_CHECKING 1 >>config.tmp
\r
818 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp
\r
819 if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp
\r
820 if not "(%HAVE_LIBXML2%)" == "()" echo #define HAVE_LIBXML2 1 >>config.tmp
\r
821 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp
\r
822 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp
\r
823 if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp
\r
824 if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp
\r
825 if "(%HAVE_RSVG%)" == "(1)" echo #define HAVE_RSVG 1 >>config.tmp
\r
827 echo /* End of settings from configure.bat. */ >>config.tmp
\r
829 Rem See if fc.exe returns a meaningful exit status. If it does, we
\r
830 Rem might as well avoid unnecessary overwriting of config.h and epaths.h,
\r
831 Rem since this forces recompilation of every source file.
\r
832 if exist foo.bar del foo.bar
\r
833 fc /b foo.bar foo.bar >nul 2>&1
\r
834 if not errorlevel 2 goto doCopy
\r
835 fc /b config.tmp ..\src\config.h >nul 2>&1
\r
836 if errorlevel 1 goto doCopy
\r
837 fc /b paths.h ..\src\epaths.h >nul 2>&1
\r
838 if not errorlevel 1 goto dontCopy
\r
841 copy config.tmp ..\src\config.h
\r
842 copy paths.h ..\src\epaths.h
\r
845 if exist config.tmp del config.tmp
\r
846 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile
\r
847 if exist ..\admin\unidata copy /b config.settings+%MAKECMD%.defs+..\admin\unidata\makefile.w32-in ..\admin\unidata\makefile
\r
848 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile
\r
849 copy /b config.settings+%MAKECMD%.defs+..\lib\makefile.w32-in ..\lib\makefile
\r
850 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile
\r
851 copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile
\r
852 copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in ..\doc\misc\makefile
\r
853 copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in ..\doc\lispref\makefile
\r
854 copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in ..\doc\lispintro\makefile
\r
855 if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile
\r
856 copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile
\r
857 rem Use the default (no-op) Makefile.in if the nt version is not present.
\r
858 if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile
\r
859 if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile
\r
860 del config.settings
\r
862 Rem Some people use WinZip which doesn't create empty directories!
\r
863 if not exist ..\site-lisp\nul mkdir ..\site-lisp\
\r
864 Rem Update subdirs.el only if it is different or fc.exe doesn't work.
\r
865 if exist foo.bar del foo.bar
\r
866 fc /b foo.bar foo.bar >nul 2>&1
\r
867 if not errorlevel 2 goto doUpdateSubdirs
\r
868 fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1
\r
869 if not errorlevel 1 goto dontUpdateSubdirs
\r
872 if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el
\r
873 copy subdirs.el ..\site-lisp\subdirs.el
\r
878 rem check that we have all the libraries we need.
\r
881 if not "(%HAVE_XPM%)" == "()" goto checkpng
\r
882 if (%xpmsupport%) == (N) goto checkpng
\r
884 echo XPM support is missing. It is required for color icons in the toolbar.
\r
885 echo Install libXpm development files or use --without-xpm
\r
888 if not "(%HAVE_PNG%)" == "()" goto checkjpeg
\r
889 if (%pngsupport%) == (N) goto checkjpeg
\r
891 echo PNG support is missing.
\r
892 echo Install libpng development files or use --without-png
\r
895 if not "(%HAVE_JPEG%)" == "()" goto checktiff
\r
896 if (%jpegsupport%) == (N) goto checktiff
\r
898 echo JPEG support is missing.
\r
899 echo Install jpeg development files or use --without-jpeg
\r
902 if not "(%HAVE_TIFF%)" == "()" goto checkgif
\r
903 if (%tiffsupport%) == (N) goto checkgif
\r
905 echo TIFF support is missing.
\r
906 echo Install libtiff development files or use --without-tiff
\r
909 if not "(%HAVE_GIF%)" == "()" goto checkdistfiles
\r
910 if (%gifsupport%) == (N) goto checkdistfiles
\r
912 echo GIF support is missing.
\r
913 echo Install giflib or libungif development files or use --without-gif
\r
916 if "(%HAVE_DISTFILES%)" == "()" goto donelibchecks
\r
917 if (%distFilesOk%) == (1) goto donelibchecks
\r
919 echo Files specified with option --distfiles could not be found.
\r
920 echo Fix these issues before running make dist
\r
923 if (%libsOK%) == (1) goto success
\r
925 echo Important libraries are missing. Fix these issues before running make.
\r
929 echo Emacs successfully configured.
\r
930 echo Emacs successfully configured. >>config.log
\r
931 if (%MAKECMD%) == (gmake) set MAKECMD=make
\r
932 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.
\r
936 echo Your environment size is too small. Please enlarge it and rerun configure.
\r
937 echo For example, type "command.com /e:2048" to have 2048 bytes available.
\r
944 set enablechecking=
\r
956 set HAVE_DISTFILES=
\r
960 set libxml2support=
\r
974 set use_extensions=
\r