]> code.delx.au - gnu-emacs/blobdiff - nt/configure.bat
Bump version to 23.2.92.
[gnu-emacs] / nt / configure.bat
index ef0a746949bac5e8a1fada9c2e7cdde6eac25224..ff1d84abc51165c6e0b116c23583f3de793e1be4 100755 (executable)
@@ -2,14 +2,14 @@
 rem   ----------------------------------------------------------------------\r
 rem   Configuration script for MS Windows 95/98/Me and NT/2000/XP\r
 rem   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,\r
 rem   ----------------------------------------------------------------------\r
 rem   Configuration script for MS Windows 95/98/Me and NT/2000/XP\r
 rem   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,\r
-rem      2006, 2007 Free Software Foundation, Inc.\r
+rem      2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.\r
 \r
 rem   This file is part of GNU Emacs.\r
 \r
 \r
 rem   This file is part of GNU Emacs.\r
 \r
-rem   GNU Emacs is free software; you can redistribute it and/or modify\r
+rem   GNU Emacs is free software: you can redistribute it and/or modify\r
 rem   it under the terms of the GNU General Public License as published by\r
 rem   it under the terms of the GNU General Public License as published by\r
-rem   the Free Software Foundation; either version 3, or (at your option)\r
-rem   any later version.\r
+rem   the Free Software Foundation, either version 3 of the License, or\r
+rem   (at your option) any later version.\r
 \r
 rem   GNU Emacs is distributed in the hope that it will be useful,\r
 rem   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
 \r
 rem   GNU Emacs is distributed in the hope that it will be useful,\r
 rem   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
@@ -17,18 +17,17 @@ rem   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 rem   GNU General Public License for more details.\r
 \r
 rem   You should have received a copy of the GNU General Public License\r
 rem   GNU General Public License for more details.\r
 \r
 rem   You should have received a copy of the GNU General Public License\r
-rem   along with GNU Emacs; see the file COPYING.  If not, write to the\r
-rem   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\r
-rem   Boston, MA 02110-1301, USA.\r
+rem   along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.\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   ----------------------------------------------------------------------\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   + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 3.75\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
 rem\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
 rem\r
-rem For reference, here is a list of which builds of gmake are known to\r
+rem For reference, here is a list of which builds of GNU make are known to\r
 rem work or not, and whether they work in the presence and/or absence of\r
 rem sh.exe.\r
 rem\r
 rem work or not, and whether they work in the presence and/or absence of\r
 rem sh.exe.\r
 rem\r
@@ -81,6 +80,7 @@ rem   Default settings.
 set prefix=\r
 set nodebug=N\r
 set noopt=N\r
 set prefix=\r
 set nodebug=N\r
 set noopt=N\r
+set profile=N\r
 set nocygwin=N\r
 set COMPILER=\r
 set usercflags=\r
 set nocygwin=N\r
 set COMPILER=\r
 set usercflags=\r
@@ -100,6 +100,7 @@ if "%1" == "--with-gcc" goto withgcc
 if "%1" == "--with-msvc" goto withmsvc\r
 if "%1" == "--no-debug" goto nodebug\r
 if "%1" == "--no-opt" goto noopt\r
 if "%1" == "--with-msvc" goto withmsvc\r
 if "%1" == "--no-debug" goto nodebug\r
 if "%1" == "--no-opt" goto noopt\r
+if "%1" == "--profile" goto profile\r
 if "%1" == "--no-cygwin" goto nocygwin\r
 if "%1" == "--cflags" goto usercflags\r
 if "%1" == "--ldflags" goto userldflags\r
 if "%1" == "--no-cygwin" goto nocygwin\r
 if "%1" == "--cflags" goto usercflags\r
 if "%1" == "--ldflags" goto userldflags\r
@@ -108,6 +109,7 @@ if "%1" == "--without-jpeg" goto withoutjpeg
 if "%1" == "--without-gif" goto withoutgif\r
 if "%1" == "--without-tiff" goto withouttiff\r
 if "%1" == "--without-xpm" goto withoutxpm\r
 if "%1" == "--without-gif" goto withoutgif\r
 if "%1" == "--without-tiff" goto withouttiff\r
 if "%1" == "--without-xpm" goto withoutxpm\r
+if "%1" == "--with-svg" goto withsvg\r
 if "%1" == "" goto checkutils\r
 :usage\r
 echo Usage: configure [options]\r
 if "%1" == "" goto checkutils\r
 :usage\r
 echo Usage: configure [options]\r
@@ -117,14 +119,16 @@ echo.   --with-gcc              use GCC to compile Emacs
 echo.   --with-msvc             use MSVC to compile Emacs\r
 echo.   --no-debug              exclude debug info from executables\r
 echo.   --no-opt                disable optimization\r
 echo.   --with-msvc             use MSVC to compile Emacs\r
 echo.   --no-debug              exclude debug info from executables\r
 echo.   --no-opt                disable optimization\r
+echo.   --profile               enable profiling\r
 echo.   --no-cygwin             use -mno-cygwin option with GCC\r
 echo.   --cflags FLAG           pass FLAG to compiler\r
 echo.   --ldflags FLAG          pass FLAG to compiler when linking\r
 echo.   --no-cygwin             use -mno-cygwin option with GCC\r
 echo.   --cflags FLAG           pass FLAG to compiler\r
 echo.   --ldflags FLAG          pass FLAG to compiler when linking\r
-echo.   --without-png           do not use libpng\r
-echo.   --without-jpeg          do not use jpeg-6b\r
-echo.   --without-gif           do not use giflib or libungif\r
-echo.   --without-tiff          do not use libtiff\r
-echo.   --without-xpm           do not use libXpm\r
+echo.   --without-png           do not use PNG library even if it is installed\r
+echo.   --without-jpeg          do not use JPEG library even if it is installed\r
+echo.   --without-gif           do not use GIF library even if it is installed\r
+echo.   --without-tiff          do not use TIFF library even if it is installed\r
+echo.   --without-xpm           do not use XPM library even if it is installed\r
+echo.   --with-svg              use the RSVG library (experimental)\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
@@ -153,6 +157,11 @@ set noopt=Y
 shift\r
 goto again\r
 rem ----------------------------------------------------------------------\r
 shift\r
 goto again\r
 rem ----------------------------------------------------------------------\r
+:profile\r
+set profile=Y\r
+shift\r
+goto again\r
+rem ----------------------------------------------------------------------\r
 :nocygwin\r
 set nocygwin=Y\r
 shift\r
 :nocygwin\r
 set nocygwin=Y\r
 shift\r
@@ -211,6 +220,11 @@ set HAVE_XPM=
 shift\r
 goto again\r
 \r
 shift\r
 goto again\r
 \r
+:withsvg\r
+shift\r
+set svgsupport=Y\r
+goto again\r
+\r
 rem ----------------------------------------------------------------------\r
 rem    Check that necessary utilities (cp and rm) are present.\r
 :checkutils\r
 rem ----------------------------------------------------------------------\r
 rem    Check that necessary utilities (cp and rm) are present.\r
 :checkutils\r
@@ -235,22 +249,23 @@ rem   Auto-detect compiler if not specified, and validate GCC if chosen.
 if (%COMPILER%)==(cl) goto compilercheckdone\r
 if (%COMPILER%)==(gcc) goto checkgcc\r
 \r
 if (%COMPILER%)==(cl) goto compilercheckdone\r
 if (%COMPILER%)==(gcc) goto checkgcc\r
 \r
-echo Checking whether 'cl' is available...\r
+echo Checking whether 'gcc' is available...\r
 echo main(){} >junk.c\r
 echo main(){} >junk.c\r
+gcc -c junk.c\r
+if exist junk.o goto checkgcc\r
+\r
+echo Checking whether 'cl' is available...\r
 cl -nologo -c junk.c\r
 if exist junk.obj goto clOK\r
 cl -nologo -c junk.c\r
 if exist junk.obj goto clOK\r
-\r
-echo Checking whether 'gcc' is available...\r
-gcc -c junk.c\r
-if not exist junk.o goto nocompiler\r
-del junk.o\r
+goto nocompiler\r
 \r
 :checkgcc\r
 \r
 :checkgcc\r
+if exist junk.o del junk.o\r
 Rem WARNING -- COMMAND.COM on some systems only looks at the first\r
 Rem            8 characters of a label.  So do NOT be tempted to change\r
 Rem            chkapi* into something fancier like checkw32api\r
 Rem You HAVE been warned!\r
 Rem WARNING -- COMMAND.COM on some systems only looks at the first\r
 Rem            8 characters of a label.  So do NOT be tempted to change\r
 Rem            chkapi* into something fancier like checkw32api\r
 Rem You HAVE been warned!\r
-if (%nocygwin%) == (Y) goto chkapi\r
+if (%nocygwin%) == (Y) goto chkapiN\r
 echo Checking whether gcc requires '-mno-cygwin'...\r
 echo #include "cygwin/version.h" >junk.c\r
 echo main(){} >>junk.c\r
 echo Checking whether gcc requires '-mno-cygwin'...\r
 echo #include "cygwin/version.h" >junk.c\r
 echo main(){} >>junk.c\r
@@ -260,11 +275,12 @@ if not exist junk.o goto chkapi
 echo gcc -mno-cygwin -c junk.c >>config.log\r
 gcc -mno-cygwin -c junk.c >>config.log 2>&1\r
 if exist junk.o set nocygwin=Y\r
 echo gcc -mno-cygwin -c junk.c >>config.log\r
 gcc -mno-cygwin -c junk.c >>config.log 2>&1\r
 if exist junk.o set nocygwin=Y\r
-rm -f junk.c junk.o\r
 \r
 :chkapi\r
 echo The failed program was: >>config.log\r
 type junk.c >>config.log\r
 \r
 :chkapi\r
 echo The failed program was: >>config.log\r
 type junk.c >>config.log\r
+:chkapiN\r
+rm -f junk.c junk.o\r
 rem ----------------------------------------------------------------------\r
 rem   Older versions of the Windows API headers either don't have any of\r
 rem   the IMAGE_xxx definitions (the headers that come with Cygwin b20.1\r
 rem ----------------------------------------------------------------------\r
 rem   Older versions of the Windows API headers either don't have any of\r
 rem   the IMAGE_xxx definitions (the headers that come with Cygwin b20.1\r
@@ -272,9 +288,11 @@ rem   are like this), or have a typo in the definition of
 rem   IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this\r
 rem   problem).  The gcc/mingw32 2.95.2 headers are okay, as are distros\r
 rem   of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.\r
 rem   IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this\r
 rem   problem).  The gcc/mingw32 2.95.2 headers are okay, as are distros\r
 rem   of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.\r
+rem   Beginning with Emacs 23, we need usp10.h.\r
 rem\r
 echo Checking whether W32 API headers are too old...\r
 echo #include "windows.h" >junk.c\r
 rem\r
 echo Checking whether W32 API headers are too old...\r
 echo #include "windows.h" >junk.c\r
+echo #include "usp10.h" >>junk.c\r
 echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c\r
 echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c\r
 if (%nocygwin%) == (Y) goto chkapi1\r
 echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c\r
 echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c\r
 if (%nocygwin%) == (Y) goto chkapi1\r
@@ -316,11 +334,26 @@ echo The failed program was: >>config.log
 type junk.c >>config.log\r
 set mf=-mcpu=i686\r
 rm -f junk.c junk.o\r
 type junk.c >>config.log\r
 set mf=-mcpu=i686\r
 rm -f junk.c junk.o\r
-goto compilercheckdone\r
+goto gccdebug\r
 :gccMtuneOk\r
 echo GCC supports -mtune=pentium4 >>config.log\r
 set mf=-mtune=pentium4\r
 rm -f junk.c junk.o\r
 :gccMtuneOk\r
 echo GCC supports -mtune=pentium4 >>config.log\r
 set mf=-mtune=pentium4\r
 rm -f junk.c junk.o\r
+:gccdebug\r
+rem Check for DWARF-2 debug info support, else default to stabs\r
+echo main(){} >junk.c\r
+echo gcc -c -gdwarf-2 -g3 junk.c >>config.log\r
+gcc -c -gdwarf-2 -g3 junk.c >>config.log 2>&1\r
+if not errorlevel 1 goto gccdwarf\r
+echo The failed program was: >>config.log\r
+type junk.c >>config.log\r
+set dbginfo=-gstabs+\r
+rm -f junk.c junk.o\r
+goto compilercheckdone\r
+:gccdwarf\r
+echo GCC supports DWARF-2 >>config.log\r
+set dbginfo=-gdwarf-2 -g3\r
+rm -f junk.c junk.o\r
 goto compilercheckdone\r
 \r
 :clOk\r
 goto compilercheckdone\r
 \r
 :clOk\r
@@ -456,6 +489,28 @@ echo ...XPM header available, building with XPM support.
 set HAVE_XPM=1\r
 \r
 :xpmDone\r
 set HAVE_XPM=1\r
 \r
 :xpmDone\r
+rm -f junk.c junk.obj\r
+\r
+if not (%svgsupport%) == (Y) goto :svgDone\r
+echo Checking for librsvg...\r
+echo #include "librsvg/rsvg.h" >junk.c\r
+echo main (){} >>junk.c\r
+rem   -o option is ignored with cl, but allows result to be consistent.\r
+echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log\r
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log\r
+if exist junk.obj goto haveSvg\r
+\r
+echo ...librsvg/rsvg.h or dependencies not found, building without SVG support.\r
+echo The failed program was: >>config.log\r
+type junk.c >>config.log\r
+set HAVE_RSVG=\r
+goto :svgDone\r
+\r
+:haveSvg\r
+echo ...librsvg header available, building with SVG support (EXPERIMENTAL).\r
+set HAVE_RSVG=1\r
+\r
+:svgDone\r
 rm -f junk.c junk.obj junk.err junk.out\r
 \r
 rem ----------------------------------------------------------------------\r
 rm -f junk.c junk.obj junk.err junk.out\r
 \r
 rem ----------------------------------------------------------------------\r
@@ -471,8 +526,10 @@ rem
 echo # Start of settings from configure.bat >config.settings\r
 echo COMPILER=%COMPILER%>>config.settings\r
 if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings\r
 echo # Start of settings from configure.bat >config.settings\r
 echo COMPILER=%COMPILER%>>config.settings\r
 if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings\r
+if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo%>>config.settings\r
 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings\r
 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings\r
 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
+if (%profile%) == (Y) echo PROFILE=1 >>config.settings\r
 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
 rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r
 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
 rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r
@@ -489,11 +546,14 @@ echo. >>config.tmp
 echo /* Start of settings from configure.bat.  */ >>config.tmp\r
 if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp\r
 if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp\r
 echo /* Start of settings from configure.bat.  */ >>config.tmp\r
 if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp\r
 if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp\r
+if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp\r
 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp\r
 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp\r
 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp\r
 if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r
 if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp\r
 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp\r
 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp\r
 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp\r
 if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r
 if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp\r
+if "(%HAVE_RSVG%)" == "(1)" echo #define HAVE_RSVG 1 >>config.tmp\r
+\r
 echo /* End of settings from configure.bat.  */ >>config.tmp\r
 \r
 Rem See if fc.exe returns a meaningful exit status.  If it does, we\r
 echo /* End of settings from configure.bat.  */ >>config.tmp\r
 \r
 Rem See if fc.exe returns a meaningful exit status.  If it does, we\r
@@ -513,6 +573,7 @@ copy paths.h ..\src\epaths.h
 :dontCopy\r
 if exist config.tmp del config.tmp\r
 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r
 :dontCopy\r
 if exist config.tmp del config.tmp\r
 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r
+if exist ..\admin\unidata copy /b config.settings+%MAKECMD%.defs+..\admin\unidata\makefile.w32-in ..\admin\unidata\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile\r
@@ -587,6 +648,7 @@ goto end
 :success\r
 echo Emacs successfully configured.\r
 echo Emacs successfully configured. >>config.log\r
 :success\r
 echo Emacs successfully configured.\r
 echo Emacs successfully configured. >>config.log\r
+if (%MAKECMD%) == (gmake) set MAKECMD=make\r
 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.\r
 goto end\r
 \r
 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.\r
 goto end\r
 \r
@@ -598,6 +660,7 @@ set $foo$=
 set prefix=\r
 set nodebug=\r
 set noopt=\r
 set prefix=\r
 set nodebug=\r
 set noopt=\r
+set profile=\r
 set nocygwin=\r
 set COMPILER=\r
 set MAKECMD=\r
 set nocygwin=\r
 set COMPILER=\r
 set MAKECMD=\r
@@ -607,6 +670,19 @@ set userldflags=
 set doldflags=\r
 set mingwflag=\r
 set mf=\r
 set doldflags=\r
 set mingwflag=\r
 set mf=\r
+set pngsupport=\r
+set jpegsupport=\r
+set gifsupport=\r
+set tiffsupport=\r
+set xpmsupport=\r
+set svgsupport=\r
+set libsOK=\r
+set HAVE_GIF=\r
+set HAVE_JPEG=\r
+set HAVE_PNG=\r
+set HAVE_TIFF=\r
+set HAVE_XPM=\r
+set dbginfo=\r
 \r
 goto skipArchTag\r
    arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c\r
 \r
 goto skipArchTag\r
    arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c\r