Add 2010 to copyright years.
[bpt/emacs.git] / nt / configure.bat
index 3dd9a7f..7317416 100755 (executable)
@@ -2,7 +2,7 @@
 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, 2010 Free Software Foundation, Inc.\r
 \r
 rem   This file is part of GNU Emacs.\r
 \r
@@ -80,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
@@ -99,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
@@ -107,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" == "--with-svg" goto withsvg\r
 if "%1" == "" goto checkutils\r
 :usage\r
 echo Usage: configure [options]\r
@@ -116,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
@@ -124,6 +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.   --with-svg              use the RSVG library (experimental)\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
@@ -152,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
@@ -210,6 +220,11 @@ set HAVE_XPM=
 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
@@ -474,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
@@ -492,6 +529,7 @@ if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings
 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
@@ -508,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
+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 "(%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
@@ -619,6 +660,7 @@ set $foo$=
 set prefix=\r
 set nodebug=\r
 set noopt=\r
+set profile=\r
 set nocygwin=\r
 set COMPILER=\r
 set MAKECMD=\r