Fix last changelog entry.
[bpt/emacs.git] / nt / configure.bat
index ff47f03..56b8570 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      2006, 2007, 2008 Free Software Foundation, Inc.\r
+rem      2006, 2007, 2008, 2009 Free Software Foundation, Inc.\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   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
@@ -17,9 +17,8 @@ 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   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
@@ -81,6 +80,7 @@ rem   Default settings.
 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
@@ -89,7 +89,6 @@ set userldflags=
 set doldflags=\r
 set sep1=\r
 set sep2=\r
-set usefontbackend=Y\r
 \r
 rem ----------------------------------------------------------------------\r
 rem   Handle arguments.\r
@@ -101,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" == "--profile" goto profile\r
 if "%1" == "--no-cygwin" goto nocygwin\r
 if "%1" == "--cflags" goto usercflags\r
 if "%1" == "--ldflags" goto userldflags\r
@@ -109,7 +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" == "--disable-font-backend" goto withoutfont\r
+if "%1" == "--with-svg" goto withsvg\r
 if "%1" == "" goto checkutils\r
 :usage\r
 echo Usage: configure [options]\r
@@ -119,6 +119,7 @@ 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.   --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
@@ -127,7 +128,7 @@ echo.   --without-jpeg          do not use JPEG library even if it is installed
 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.   --disable-font-backend  build without font backend support\r
+echo.   --with-svg              use the RSVG library (experimental)\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
@@ -156,6 +157,11 @@ set noopt=Y
 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
@@ -214,9 +220,9 @@ set HAVE_XPM=
 shift\r
 goto again\r
 \r
-:withoutfont\r
-set usefontbackend=N\r
+:withsvg\r
 shift\r
+set svgsupport=Y\r
 goto again\r
 \r
 rem ----------------------------------------------------------------------\r
@@ -328,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
-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
+: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
@@ -468,6 +489,28 @@ echo ...XPM header available, building with XPM support.
 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
@@ -483,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
+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 (%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
@@ -493,7 +538,6 @@ for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
 if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags%>>config.settings\r
 for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y\r
 if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings\r
-if (%usefontbackend%) == (Y) echo USE_FONTBACKEND=1 >>config.settings\r
 echo # End of settings from configure.bat>>config.settings\r
 echo. >>config.settings\r
 \r
@@ -507,6 +551,8 @@ if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp
 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
@@ -613,6 +659,7 @@ set $foo$=
 set prefix=\r
 set nodebug=\r
 set noopt=\r
+set profile=\r
 set nocygwin=\r
 set COMPILER=\r
 set MAKECMD=\r