X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/84eb0351d8be4811897c8cf62a69757ff5d14001..9078ead6ce0237eb566a2779016560c85fff5768:/nt/configure.bat diff --git a/nt/configure.bat b/nt/configure.bat index 1450650304..db587b0299 100755 --- a/nt/configure.bat +++ b/nt/configure.bat @@ -1,7 +1,7 @@ @echo off rem ---------------------------------------------------------------------- rem Configuration script for MS Windows operating systems -rem Copyright (C) 1999-2011 Free Software Foundation, Inc. +rem Copyright (C) 1999-2012 Free Software Foundation, Inc. rem This file is part of GNU Emacs. @@ -74,6 +74,19 @@ echo You must run configure from the nt subdirectory. goto end :start +rem ---------------------------------------------------------------------- +rem Attempt to enable command extensions. Set use_extensions to 1 if +rem they are available and 0 if they are not available. +set use_extensions=1 +setlocal ENABLEEXTENSIONS +if "%CMDEXTVERSION%" == "" set use_extensions=0 +if "%use_extensions%" == "1" goto afterext + +echo. Command extensions are not available. Using parameters that include the = +echo. character by enclosing them in quotes will not be supported. + +:afterext + rem ---------------------------------------------------------------------- rem Default settings. set prefix= @@ -84,12 +97,17 @@ set profile=N set nocygwin=N set COMPILER= set usercflags= +set escusercflags= set docflags= set userldflags= +set escuserldflags= +set extrauserlibs= set doldflags= +set doextralibs= set sep1= set sep2= set sep3= +set sep4= set distfiles= rem ---------------------------------------------------------------------- @@ -107,10 +125,13 @@ if "%1" == "--profile" goto profile if "%1" == "--no-cygwin" goto nocygwin if "%1" == "--cflags" goto usercflags if "%1" == "--ldflags" goto userldflags +if "%1" == "--lib" goto extrauserlibs if "%1" == "--without-png" goto withoutpng if "%1" == "--without-jpeg" goto withoutjpeg if "%1" == "--without-gif" goto withoutgif if "%1" == "--without-tiff" goto withouttiff +if "%1" == "--without-gnutls" goto withoutgnutls +if "%1" == "--without-libxml2" goto withoutlibxml2 if "%1" == "--without-xpm" goto withoutxpm if "%1" == "--with-svg" goto withsvg if "%1" == "--distfiles" goto distfiles @@ -129,13 +150,30 @@ echo. --profile enable profiling echo. --no-cygwin use -mno-cygwin option with GCC echo. --cflags FLAG pass FLAG to compiler echo. --ldflags FLAG pass FLAG to compiler when linking +echo. --lib LIB link to extra library LIB echo. --without-png do not use PNG library even if it is installed 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 echo. --without-tiff do not use TIFF library even if it is installed echo. --without-xpm do not use XPM library even if it is installed +echo. --without-gnutls do not use GnuTLS library even if it is installed +echo. --without-libxml2 do not use libxml2 library even if it is installed echo. --with-svg use the RSVG library (experimental) echo. --distfiles path to files for make dist, e.g. libXpm.dll +if "%use_extensions%" == "0" goto end +echo. +echo. The cflags and ldflags arguments support parameters that include the = +echo. character. However, since the = character is normally treated as a +echo. separator character you will need to enclose any parameter that includes +echo. the = character in quotes. For example, to include +echo. -DSITELOAD_PURESIZE_EXTRA=100000 as one of the cflags you would run +echo. configure.bat as follows: +echo. configure.bat --cflags "-DSITELOAD_PURESIZE_EXTRA=100000" +echo. +echo. Note that this capability of processing parameters that include the = +echo. character depends on command extensions. This batch file attempts to +echo. enable command extensions. If command extensions cannot be enabled, a +echo. warning message will be displayed. goto end rem ---------------------------------------------------------------------- @@ -198,17 +236,51 @@ goto again rem ---------------------------------------------------------------------- :usercflags +if "%use_extensions%" == "1" goto ucflagex +goto ucflagne + +:ucflagex +shift +set usercflags=%usercflags%%sep1%%~1 +set escusercflags=%usercflags:"=\"% +set sep1= %nothing% +shift +goto again + +:ucflagne shift set usercflags=%usercflags%%sep1%%1 +set escusercflags=%usercflags% set sep1= %nothing% shift goto again +:extrauserlibs +shift +echo. extrauserlibs: %extrauserlibs% +set extrauserlibs=%extrauserlibs%%sep4%%1 +set sep4= %nothing% +shift +goto again + rem ---------------------------------------------------------------------- :userldflags +if "%use_extensions%" == "1" goto ulflagex +goto ulflagne + +:ulflagex +shift +set userldflags=%userldflags%%sep2%%~1 +set escuserldflags=%userldflags:"=\"% +set sep2= %nothing% +shift +goto again + +:ulflagne shift set userldflags=%userldflags%%sep2%%1 +set escuserldflags=%userldflags% set sep2= %nothing% shift goto again @@ -239,6 +311,22 @@ goto again rem ---------------------------------------------------------------------- +:withoutgnutls +set tlssupport=N +set HAVE_GNUTLS= +shift +goto again + +rem ---------------------------------------------------------------------- + +:withoutlibxml2 +set libxml2support=N +set HAVE_LIBXML2= +shift +goto again + +rem ---------------------------------------------------------------------- + :withouttiff set tiffsupport=N set HAVE_TIFF= @@ -365,7 +453,7 @@ goto nocompiler :chkuser rm -f junk.o echo int main (int argc, char *argv[]) {>junk.c -echo char *usercflags = "%usercflags%";>>junk.c +echo char *usercflags = "%escusercflags%";>>junk.c echo }>>junk.c echo gcc -Werror -c junk.c >>config.log gcc -Werror -c junk.c >>config.log 2>&1 @@ -467,6 +555,52 @@ set HAVE_PNG=1 :pngDone rm -f junk.c junk.obj +if (%tlssupport%) == (N) goto tlsDone + +rem this is a copy of the PNG detection +echo Checking for libgnutls... +echo #include "gnutls/gnutls.h" >junk.c +echo main (){} >>junk.c +rem -o option is ignored with cl, but allows result to be consistent. +echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log +%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log +if exist junk.obj goto haveTls + +echo ...gnutls.h not found, building without TLS support. +echo The failed program was: >>config.log +type junk.c >>config.log +set HAVE_GNUTLS= +goto :tlsDone + +:haveTls +echo ...GnuTLS header available, building with GnuTLS support. +set HAVE_GNUTLS=1 + +:tlsDone +rm -f junk.c junk.obj + +if (%libxml2support%) == (N) goto xml2Done + +echo Checking for libxml2.... +echo #include "libxml/HTMLparser.h" >junk.c +echo main(){} >>junk.c +echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log +%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log +if exist junk.obj goto havelibxml2 + +echo ...libxml/HTMLparser.h not found, building without libxml2 support +echo The failed program was: >>config.log +type junk.c >>config.log +set HAVE_LIBXML2= +goto xml2Done + +:havelibxml2 +echo ...libxml2 header available, building with libxml2 support +set HAVE_LIBXML2=1 + +:xml2Done +rm -f junk.c junk.obj + if (%jpegsupport%) == (N) goto jpegDone echo Checking for jpeg-6b... @@ -637,8 +771,11 @@ rem We go thru docflags because usercflags could be "-DFOO=bar" -something rem and the if command cannot cope with this for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags%>>config.settings +if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags%>>config.settings for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings +for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y +if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs%>>config.settings echo # End of settings from configure.bat>>config.settings echo. >>config.settings @@ -647,10 +784,12 @@ echo. >>config.tmp echo /* Start of settings from configure.bat. */ >>config.tmp rem We write USER_CFLAGS and USER_LDFLAGS starting with a space to simplify rem processing of compiler options in w32.c:get_emacs_configuration_options -if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp -if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp +if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%">>config.tmp +if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%">>config.tmp if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp +if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp +if not "(%HAVE_LIBXML2%)" == "()" echo #define HAVE_LIBXML2 1 >>config.tmp if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp @@ -789,6 +928,8 @@ set distfiles= set HAVE_DISTFILES= set distFilesOk= set pngsupport= +set tlssupport= +set libxml2support= set jpegsupport= set gifsupport= set tiffsupport=