]> code.delx.au - gnu-emacs/blobdiff - nt/configure.bat
Merge from mainline.
[gnu-emacs] / nt / configure.bat
index 4da259276738288496630f5b68b938a871b8cb94..7642d8244f829938755b9a5a43fd48716e664db2 100755 (executable)
@@ -1,8 +1,7 @@
 @echo off\r
 rem   ----------------------------------------------------------------------\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
+rem   Copyright (C) 1999-2011  Free Software Foundation, Inc.\r
 \r
 rem   This file is part of GNU Emacs.\r
 \r
@@ -75,6 +74,19 @@ echo You must run configure from the nt subdirectory.
 goto end\r
 \r
 :start\r
+rem ----------------------------------------------------------------------\r
+rem   Attempt to enable command extensions.  Set use_extensions to 1 if\r
+rem   they are available and 0 if they are not available.\r
+set use_extensions=1\r
+setlocal ENABLEEXTENSIONS\r
+if "%CMDEXTVERSION%" == "" set use_extensions=0\r
+if "%use_extensions%" == "1" goto afterext\r
+\r
+echo. Command extensions are not available.  Using parameters that include the =\r
+echo. character by enclosing them in quotes will not be supported.\r
+\r
+:afterext\r
+\r
 rem ----------------------------------------------------------------------\r
 rem   Default settings.\r
 set prefix=\r
@@ -87,10 +99,13 @@ set COMPILER=
 set usercflags=\r
 set docflags=\r
 set userldflags=\r
+set extrauserlibs=\r
 set doldflags=\r
+set doextralibs=\r
 set sep1=\r
 set sep2=\r
 set sep3=\r
+set sep4=\r
 set distfiles=\r
 \r
 rem ----------------------------------------------------------------------\r
@@ -108,10 +123,12 @@ if "%1" == "--profile" goto profile
 if "%1" == "--no-cygwin" goto nocygwin\r
 if "%1" == "--cflags" goto usercflags\r
 if "%1" == "--ldflags" goto userldflags\r
+if "%1" == "--lib" goto extrauserlibs\r
 if "%1" == "--without-png" goto withoutpng\r
 if "%1" == "--without-jpeg" goto withoutjpeg\r
 if "%1" == "--without-gif" goto withoutgif\r
 if "%1" == "--without-tiff" goto withouttiff\r
+if "%1" == "--without-gnutls" goto withoutgnutls\r
 if "%1" == "--without-xpm" goto withoutxpm\r
 if "%1" == "--with-svg" goto withsvg\r
 if "%1" == "--distfiles" goto distfiles\r
@@ -130,13 +147,29 @@ echo.   --profile               enable profiling
 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.   --lib LIB               link to extra library LIB\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.   --without-gnutls        do not use GNUTLS library even if it is installed\r
 echo.   --with-svg              use the RSVG library (experimental)\r
 echo.   --distfiles             path to files for make dist, e.g. libXpm.dll\r
+if "%use_extensions%" == "0" goto end\r
+echo.\r
+echo. The cflags and ldflags arguments support parameters that include the =\r
+echo. character.  However, since the = character is normally treated as a\r
+echo. separator character you will need to enclose any parameter that includes\r
+echo. the = character in quotes.  For example, to include\r
+echo. -DSITELOAD_PURESIZE_EXTRA=100000 as one of the cflags you would run\r
+echo. configure.bat as follows:\r
+echo. configure.bat --cflags "-DSITELOAD_PURESIZE_EXTRA=100000"\r
+echo.\r
+echo. Note that this capability of processing parameters that include the =\r
+echo. character depends on command extensions.  This batch file attempts to\r
+echo. enable command extensions.  If command extensions cannot be enabled, a\r
+echo. warning message will be displayed.\r
 goto end\r
 \r
 rem ----------------------------------------------------------------------\r
@@ -199,15 +232,45 @@ goto again
 rem ----------------------------------------------------------------------\r
 \r
 :usercflags\r
+if "%use_extensions%" == "1" goto ucflagex\r
+goto ucflagne\r
+\r
+:ucflagex\r
+shift\r
+set usercflags=%usercflags%%sep1%%~1\r
+set sep1= %nothing%\r
+shift\r
+goto again\r
+\r
+:ucflagne\r
 shift\r
 set usercflags=%usercflags%%sep1%%1\r
 set sep1= %nothing%\r
 shift\r
 goto again\r
 \r
+:extrauserlibs\r
+shift\r
+echo. extrauserlibs: %extrauserlibs%\r
+set extrauserlibs=%extrauserlibs%%sep4%%1\r
+set sep4= %nothing%\r
+shift\r
+goto again\r
+\r
 rem ----------------------------------------------------------------------\r
 \r
 :userldflags\r
+if "%use_extensions%" == "1" goto ulflagex\r
+goto ulflagne\r
+\r
+:ulflagex\r
+shift\r
+set userldflags=%userldflags%%sep2%%~1\r
+set sep2= %nothing%\r
+shift\r
+goto again\r
+\r
+:ulflagne\r
 shift\r
 set userldflags=%userldflags%%sep2%%1\r
 set sep2= %nothing%\r
@@ -240,6 +303,14 @@ goto again
 \r
 rem ----------------------------------------------------------------------\r
 \r
+:withoutgnutls\r
+set tlssupport=N\r
+set HAVE_GNUTLS=\r
+shift\r
+goto again\r
+\r
+rem ----------------------------------------------------------------------\r
+\r
 :withouttiff\r
 set tiffsupport=N\r
 set HAVE_TIFF=\r
@@ -468,6 +539,30 @@ set HAVE_PNG=1
 :pngDone\r
 rm -f junk.c junk.obj\r
 \r
+if (%tlssupport%) == (N) goto tlsDone\r
+\r
+rem this is a copy of the PNG detection\r
+echo Checking for libgnutls...\r
+echo #include "gnutls/gnutls.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 haveTls\r
+\r
+echo ...gnutls.h not found, building without TLS support.\r
+echo The failed program was: >>config.log\r
+type junk.c >>config.log\r
+set HAVE_GNUTLS=\r
+goto :tlsDone\r
+\r
+:haveTls\r
+echo ...GNUTLS header available, building with GNUTLS support.\r
+set HAVE_GNUTLS=1\r
+\r
+:tlsDone\r
+rm -f junk.c junk.obj\r
+\r
 if (%jpegsupport%) == (N) goto jpegDone\r
 \r
 echo Checking for jpeg-6b...\r
@@ -640,6 +735,8 @@ 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
+for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y\r
+if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs%>>config.settings\r
 echo # End of settings from configure.bat>>config.settings\r
 echo. >>config.settings\r
 \r
@@ -652,6 +749,7 @@ if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp
 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_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 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
@@ -680,6 +778,7 @@ if exist config.tmp del config.tmp
 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+..\lib\makefile.w32-in ..\lib\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+..\doc\misc\makefile.w32-in ..\doc\misc\makefile\r
@@ -788,7 +887,18 @@ set mf=
 set distfiles=\r
 set HAVE_DISTFILES=\r
 set distFilesOk=\r
+set pngsupport=\r
+set tlssupport=\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
-:skipArchTag\r