@echo off\r
rem ----------------------------------------------------------------------\r
-rem Configuration script for MS Windows 95/98/Me and NT/2000/XP\r
+rem Configuration script for MS Windows operating systems\r
rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,\r
rem 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.\r
\r
rem ----------------------------------------------------------------------\r
rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
rem\r
-rem + MS Windows 95/98/Me or NT/2000/XP\r
+rem + MS Windows 95, NT or later\r
rem + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75\r
rem or later) and the Mingw32 and W32 API headers and libraries.\r
rem + Visual Studio 2005 is not supported at this time.\r
if "%1" == "--with-svg" goto withsvg\r
if "%1" == "--distfiles" goto distfiles\r
if "%1" == "" goto checkutils\r
+\r
:usage\r
echo Usage: configure [options]\r
echo Options:\r
echo. --with-svg use the RSVG library (experimental)\r
echo. --distfiles path to files for make dist, e.g. libXpm.dll\r
goto end\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:setprefix\r
shift\r
set prefix=%1\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:withgcc\r
set COMPILER=gcc\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:withmsvc\r
set COMPILER=cl\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:nodebug\r
set nodebug=Y\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:noopt\r
set noopt=Y\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:enablechecking\r
set enablechecking=Y\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:profile\r
set profile=Y\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:nocygwin\r
set nocygwin=Y\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:usercflags\r
shift\r
set usercflags=%usercflags%%sep1%%1\r
set sep1= %nothing%\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
+\r
:userldflags\r
shift\r
set userldflags=%userldflags%%sep2%%1\r
set sep2= %nothing%\r
shift\r
goto again\r
+\r
rem ----------------------------------------------------------------------\r
\r
:withoutpng\r
\r
rem ----------------------------------------------------------------------\r
rem Check that necessary utilities (cp and rm) are present.\r
+\r
:checkutils\r
echo Checking for 'cp'...\r
cp configure.bat junk.bat\r
rm junk.bat\r
if exist junk.bat goto needrm\r
goto checkcompiler\r
+\r
:needcp\r
echo You need 'cp' (the Unix file copy program) to build Emacs.\r
goto end\r
+\r
:needrm\r
del junk.bat\r
echo You need 'rm' (the Unix file delete program) to build Emacs.\r
\r
rem ----------------------------------------------------------------------\r
rem Auto-detect compiler if not specified, and validate GCC if chosen.\r
+\r
:checkcompiler\r
if (%COMPILER%)==(cl) goto compilercheckdone\r
if (%COMPILER%)==(gcc) goto checkgcc\r
:chkapi\r
echo The failed program was: >>config.log\r
type junk.c >>config.log\r
+\r
:chkapiN\r
rm -f junk.c junk.o\r
rem ----------------------------------------------------------------------\r
if (%nocygwin%) == (Y) goto chkapi1\r
set cf=%usercflags%\r
goto chkapi2\r
+\r
:chkapi1\r
set cf=%usercflags% -mno-cygwin\r
+\r
:chkapi2\r
echo on\r
gcc %cf% -c junk.c\r
set mf=-mcpu=i686\r
rm -f junk.c junk.o\r
goto gccdebug\r
+\r
:gccMtuneOk\r
echo GCC supports -mtune=pentium4 >>config.log\r
set mf=-mtune=pentium4\r
rm -f junk.c junk.o\r
+\r
:gccdebug\r
rem Check for DWARF-2 debug info support, else default to stabs\r
echo main(){} >junk.c\r
set dbginfo=-gstabs+\r
rm -f junk.c junk.o\r
goto compilercheckdone\r
+\r
:gccdwarf\r
echo GCC supports DWARF-2 >>config.log\r
set dbginfo=-gdwarf-2 -g3\r
set fileNotFound=\r
\r
rem ----------------------------------------------------------------------\r
+\r
:genmakefiles\r
echo Generating makefiles\r
if %COMPILER% == gcc set MAKECMD=gmake\r
if errorlevel 1 goto doCopy\r
fc /b paths.h ..\src\epaths.h >nul 2>&1\r
if errorlevel 0 goto dontCopy\r
+\r
:doCopy\r
copy config.tmp ..\src\config.h\r
copy paths.h ..\src\epaths.h\r
if not errorlevel 2 goto doUpdateSubdirs\r
fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1\r
if not errorlevel 1 goto dontUpdateSubdirs\r
+\r
:doUpdateSubdirs\r
if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el\r
copy subdirs.el ..\site-lisp\subdirs.el\r
echo Your environment size is too small. Please enlarge it and rerun configure.\r
echo For example, type "command.com /e:2048" to have 2048 bytes available.\r
set $foo$=\r
+\r
:end\r
set prefix=\r
set nodebug=\r