X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/7be1c708c5abc7dea388d45454bd19bff07b7943..c400516ab1d827d08225ffb3e1bc1969c73cc45e:/nt/configure.bat diff --git a/nt/configure.bat b/nt/configure.bat index 45d966fc34..5460f4c92d 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-2014 Free Software Foundation, Inc. rem This file is part of GNU Emacs. @@ -23,7 +23,7 @@ rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS: rem rem + MS Windows 95, NT or later rem + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75 -rem or later) and the Mingw32 and W32 API headers and libraries. +rem or later) and the Mingw32 and Windows API headers and libraries. rem + Visual Studio 2005 is not supported at this time. rem rem For reference, here is a list of which builds of GNU make are known to @@ -58,7 +58,20 @@ rem look for "cygpath" near line 85 of gmake.defs. rem [7] not recommended; please report if you try this combination. rem [8] tested only on Windows XP. rem - +echo **************************************************************** +echo *** THIS METHOD OF BUILDING EMACS IS NO LONGER SUPPORTED. ** +echo *** INSTEAD, FOLLOW THE INSTRUCTIONS FROM INSTALL. ** +echo **************************************************************** +:confirm_continue +set /p answer=Continue running this script at your own risks ? (Y/N) +if x%answer% == xy (goto confirm_continue_y) +if x%answer% == xY (goto confirm_continue_y) +if x%answer% == xn (goto end) +if x%answer% == xN (goto end) +echo Please answer by Y or N +goto confirm_continue + +:confirm_continue_y if exist config.log del config.log rem ---------------------------------------------------------------------- @@ -131,6 +144,7 @@ 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 @@ -144,7 +158,7 @@ echo. --with-gcc use GCC to compile Emacs echo. --with-msvc use MSVC to compile Emacs echo. --no-debug exclude debug info from executables echo. --no-opt disable optimization -echo. --enable-checking enable checks and assertions +echo. --enable-checking enable additional run-time checks echo. --profile enable profiling echo. --no-cygwin use -mno-cygwin option with GCC echo. --cflags FLAG pass FLAG to compiler @@ -155,7 +169,8 @@ 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-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 @@ -172,6 +187,11 @@ 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. +echo. +echo. IMPORTANT: This method of building Emacs for MS-Windows is deprecated, +echo. and could be removed in a future version of Emacs. The preferred way +echo to build Emacs for MS-Windows from now on is using the MSYS environment +echo. and MinGW development tools. Please see nt/INSTALL for details. goto end rem ---------------------------------------------------------------------- @@ -317,6 +337,14 @@ goto again rem ---------------------------------------------------------------------- +:withoutlibxml2 +set libxml2support=N +set HAVE_LIBXML2= +shift +goto again + +rem ---------------------------------------------------------------------- + :withouttiff set tiffsupport=N set HAVE_TIFF= @@ -416,10 +444,10 @@ rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least. rem Beginning with Emacs 23, we need usp10.h. rem -echo Checking whether W32 API headers are too old... +echo Checking whether Windows API headers are too old... echo #include "windows.h" >junk.c echo #include "usp10.h" >>junk.c -echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c +echo void test(PIMAGE_NT_HEADERS pHeader) >>junk.c echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c if (%nocygwin%) == (Y) goto chkapi1 set cf=%usercflags% @@ -459,7 +487,7 @@ goto end echo. echo Configure failed. echo To configure Emacs for Windows, you need to have either -echo gcc-2.95 or later with Mingw32 and the W32 API headers, +echo gcc-2.95 or later with Mingw32 and the Windows API headers, echo or MSVC 2.x or later. del junk.c goto end @@ -563,12 +591,34 @@ set HAVE_GNUTLS= goto :tlsDone :haveTls -echo ...GNUTLS header available, building with GNUTLS support. +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... @@ -595,7 +645,10 @@ rm -f junk.c junk.obj if (%gifsupport%) == (N) goto gifDone echo Checking for libgif... -echo #include "gif_lib.h" >junk.c +rem giflib-5.0.0 needs size_t defined before gif_lib.h is included +rem redirection characters need to be protected from the shell +echo #include ^ >junk.c +echo #include "gif_lib.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 @@ -721,29 +774,35 @@ if %COMPILER% == gcc set MAKECMD=gmake if %COMPILER% == cl set MAKECMD=nmake rem Pass on chosen settings to makefiles. -rem NB. Be very careful to not have a space before redirection symbols -rem except when there is a preceding digit, when a space is required. rem +rem The weird place we put the redirection is to make sure no extra +rem whitespace winds up at the end of the Make variables, since some +rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will +rem write the blanks between the end of command arguments and the +rem redirection symbol to the file. OTOH, we cannot put the +rem redirection immediately after the last character of the command, +rem because environment variable expansion can yield a digit there, +rem which will then be misinterpreted as the file descriptor to +rem redirect... echo # Start of settings from configure.bat >config.settings -echo COMPILER=%COMPILER%>>config.settings -if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings -if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo%>>config.settings -if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings -if (%noopt%) == (Y) echo NOOPT=1 >>config.settings -if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings -if (%profile%) == (Y) echo PROFILE=1 >>config.settings -if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings -if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings -if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles%>>config.settings +>>config.settings echo COMPILER=%COMPILER% +if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf% +if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo% +if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1 +if (%noopt%) == (Y) >>config.settings echo NOOPT=1 +if (%profile%) == (Y) >>config.settings echo PROFILE=1 +if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1 +if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix% +if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles% 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 +if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags% +if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags% for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y -if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings +if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags% for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y -if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs%>>config.settings +if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs% echo # End of settings from configure.bat>>config.settings echo. >>config.settings @@ -752,11 +811,13 @@ 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 " %escusercflags%">>config.tmp -if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%">>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 (%enablechecking%) == (Y) echo #define ENABLE_CHECKING 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 @@ -896,6 +957,7 @@ set HAVE_DISTFILES= set distFilesOk= set pngsupport= set tlssupport= +set libxml2support= set jpegsupport= set gifsupport= set tiffsupport= @@ -908,4 +970,5 @@ set HAVE_PNG= set HAVE_TIFF= set HAVE_XPM= set dbginfo= - +endlocal +set use_extensions=