* configure.bat: Untabify help message.
[bpt/emacs.git] / nt / configure.bat
index 957ed14..49cbbad 100755 (executable)
@@ -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
@@ -319,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
@@ -459,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
@@ -474,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
@@ -497,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
@@ -603,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