2001-08-31 10:31:22 +00:00
|
|
|
@echo off
|
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
rem Configuration script for MS Windows operating systems
|
2012-01-05 09:46:05 +00:00
|
|
|
rem Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
2001-08-31 10:31:22 +00:00
|
|
|
|
|
|
|
rem This file is part of GNU Emacs.
|
|
|
|
|
2008-05-09 05:14:16 +00:00
|
|
|
rem GNU Emacs is free software: you can redistribute it and/or modify
|
2001-08-31 10:31:22 +00:00
|
|
|
rem it under the terms of the GNU General Public License as published by
|
2008-05-09 05:14:16 +00:00
|
|
|
rem the Free Software Foundation, either version 3 of the License, or
|
|
|
|
rem (at your option) any later version.
|
2001-08-31 10:31:22 +00:00
|
|
|
|
|
|
|
rem GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
rem GNU General Public License for more details.
|
|
|
|
|
|
|
|
rem You should have received a copy of the GNU General Public License
|
2008-05-09 05:14:16 +00:00
|
|
|
rem along with GNU Emacs. If not, see http://www.gnu.org/licenses/.
|
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
|
|
|
|
rem
|
2010-09-22 01:30:05 +00:00
|
|
|
rem + MS Windows 95, NT or later
|
2008-04-21 21:31:53 +00:00
|
|
|
rem + either MSVC 2.x or later, or gcc-2.95 or later (with GNU make 3.75
|
2006-12-27 13:53:39 +00:00
|
|
|
rem or later) and the Mingw32 and W32 API headers and libraries.
|
|
|
|
rem + Visual Studio 2005 is not supported at this time.
|
2001-08-31 10:31:22 +00:00
|
|
|
rem
|
2008-04-21 21:31:53 +00:00
|
|
|
rem For reference, here is a list of which builds of GNU make are known to
|
2001-08-31 10:31:22 +00:00
|
|
|
rem work or not, and whether they work in the presence and/or absence of
|
|
|
|
rem sh.exe.
|
2003-01-27 09:40:40 +00:00
|
|
|
rem
|
2001-08-31 10:31:22 +00:00
|
|
|
rem sh exists no sh
|
2006-12-27 13:53:39 +00:00
|
|
|
rem cygwin b20.1 make (3.75): fails[1,5] fails[2,5]
|
2001-08-31 10:31:22 +00:00
|
|
|
rem MSVC compiled gmake 3.77: okay okay
|
|
|
|
rem MSVC compiled gmake 3.78.1: okay okay
|
|
|
|
rem MSVC compiled gmake 3.79.1: okay okay
|
2006-12-27 13:53:39 +00:00
|
|
|
rem mingw32/gcc-2.92.2 make (3.77): okay okay[4]
|
|
|
|
rem cygwin compiled gmake 3.77: fails[1,5] fails[2,5]
|
|
|
|
rem cygwin compiled gmake 3.78.1: fails[5] fails[2,5]
|
|
|
|
rem cygwin compiled gmake 3.79.1: fails[3,5] fails[2?,5]
|
2007-05-04 13:43:21 +00:00
|
|
|
rem cygwin compiled make 3.80: okay[6] fails?[7]
|
|
|
|
rem cygwin compiled make 3.81: fails fails?[7]
|
2006-12-27 13:53:39 +00:00
|
|
|
rem mingw32 compiled make 3.79.1: okay okay
|
2007-05-04 13:43:21 +00:00
|
|
|
rem mingw32 compiled make 3.80: okay okay?[7]
|
|
|
|
rem mingw32 compiled make 3.81: okay okay[8]
|
2001-08-31 10:31:22 +00:00
|
|
|
rem
|
|
|
|
rem [1] doesn't cope with makefiles with DOS line endings, so must mount
|
|
|
|
rem emacs source with text!=binary.
|
|
|
|
rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.
|
2006-12-27 13:53:39 +00:00
|
|
|
rem [3] requires LC_MESSAGES support to build; cannot build with early
|
|
|
|
rem versions of cygwin.
|
|
|
|
rem [4] may fail on Windows 9X and Windows ME; if so, install Bash.
|
|
|
|
rem [5] fails when building leim due to the use of cygwin style paths.
|
|
|
|
rem May work if building emacs without leim.
|
2007-05-04 13:43:21 +00:00
|
|
|
rem [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath';
|
|
|
|
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.
|
2001-08-31 10:31:22 +00:00
|
|
|
rem
|
|
|
|
|
2005-06-11 10:56:49 +00:00
|
|
|
if exist config.log del config.log
|
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem See if the environment is large enough. We need 43 (?) bytes.
|
|
|
|
set $foo$=123456789_123456789_123456789_123456789_123
|
|
|
|
if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv
|
|
|
|
set $foo$=
|
|
|
|
|
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem Make sure we are running in the nt subdir
|
|
|
|
if exist configure.bat goto start
|
|
|
|
echo You must run configure from the nt subdirectory.
|
|
|
|
goto end
|
|
|
|
|
|
|
|
:start
|
2011-04-15 22:48:00 +00:00
|
|
|
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
|
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem Default settings.
|
|
|
|
set prefix=
|
|
|
|
set nodebug=N
|
|
|
|
set noopt=N
|
2010-07-18 09:41:48 +00:00
|
|
|
set enablechecking=N
|
2008-07-23 15:41:23 +00:00
|
|
|
set profile=N
|
2001-08-31 10:31:22 +00:00
|
|
|
set nocygwin=N
|
|
|
|
set COMPILER=
|
|
|
|
set usercflags=
|
2011-05-07 04:00:12 +00:00
|
|
|
set escusercflags=
|
2007-10-20 12:28:52 +00:00
|
|
|
set docflags=
|
2001-08-31 10:31:22 +00:00
|
|
|
set userldflags=
|
2011-05-07 04:00:12 +00:00
|
|
|
set escuserldflags=
|
2011-04-25 01:29:31 +00:00
|
|
|
set extrauserlibs=
|
2007-10-20 12:28:52 +00:00
|
|
|
set doldflags=
|
2011-04-25 01:29:31 +00:00
|
|
|
set doextralibs=
|
2001-08-31 10:31:22 +00:00
|
|
|
set sep1=
|
|
|
|
set sep2=
|
2010-07-24 13:35:31 +00:00
|
|
|
set sep3=
|
2011-04-25 01:29:31 +00:00
|
|
|
set sep4=
|
2010-07-24 13:35:31 +00:00
|
|
|
set distfiles=
|
2001-08-31 10:31:22 +00:00
|
|
|
|
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem Handle arguments.
|
|
|
|
:again
|
|
|
|
if "%1" == "-h" goto usage
|
|
|
|
if "%1" == "--help" goto usage
|
|
|
|
if "%1" == "--prefix" goto setprefix
|
|
|
|
if "%1" == "--with-gcc" goto withgcc
|
|
|
|
if "%1" == "--with-msvc" goto withmsvc
|
|
|
|
if "%1" == "--no-debug" goto nodebug
|
|
|
|
if "%1" == "--no-opt" goto noopt
|
2010-07-18 09:41:48 +00:00
|
|
|
if "%1" == "--enable-checking" goto enablechecking
|
2008-07-23 15:41:23 +00:00
|
|
|
if "%1" == "--profile" goto profile
|
2001-08-31 10:31:22 +00:00
|
|
|
if "%1" == "--no-cygwin" goto nocygwin
|
|
|
|
if "%1" == "--cflags" goto usercflags
|
|
|
|
if "%1" == "--ldflags" goto userldflags
|
2011-04-25 01:29:31 +00:00
|
|
|
if "%1" == "--lib" goto extrauserlibs
|
2003-01-25 20:50:48 +00:00
|
|
|
if "%1" == "--without-png" goto withoutpng
|
2003-01-26 01:25:49 +00:00
|
|
|
if "%1" == "--without-jpeg" goto withoutjpeg
|
2003-01-31 07:23:20 +00:00
|
|
|
if "%1" == "--without-gif" goto withoutgif
|
2003-01-31 11:03:11 +00:00
|
|
|
if "%1" == "--without-tiff" goto withouttiff
|
2011-04-25 01:29:31 +00:00
|
|
|
if "%1" == "--without-gnutls" goto withoutgnutls
|
2003-02-02 00:01:25 +00:00
|
|
|
if "%1" == "--without-xpm" goto withoutxpm
|
2009-01-03 12:57:28 +00:00
|
|
|
if "%1" == "--with-svg" goto withsvg
|
2010-07-24 13:35:31 +00:00
|
|
|
if "%1" == "--distfiles" goto distfiles
|
2001-08-31 10:31:22 +00:00
|
|
|
if "%1" == "" goto checkutils
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:usage
|
|
|
|
echo Usage: configure [options]
|
|
|
|
echo Options:
|
|
|
|
echo. --prefix PREFIX install Emacs in directory PREFIX
|
|
|
|
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
|
2010-07-18 09:41:48 +00:00
|
|
|
echo. --enable-checking enable checks and assertions
|
2008-07-23 15:41:23 +00:00
|
|
|
echo. --profile enable profiling
|
2001-08-31 10:31:22 +00:00
|
|
|
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
|
2011-04-25 01:29:31 +00:00
|
|
|
echo. --lib LIB link to extra library LIB
|
2008-02-05 16:02:55 +00:00
|
|
|
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
|
2011-11-25 13:26:30 +00:00
|
|
|
echo. --without-gnutls do not use GnuTLS library even if it is installed
|
2009-01-03 15:25:47 +00:00
|
|
|
echo. --with-svg use the RSVG library (experimental)
|
2010-07-24 13:35:31 +00:00
|
|
|
echo. --distfiles path to files for make dist, e.g. libXpm.dll
|
2011-04-15 22:48:00 +00:00
|
|
|
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.
|
2001-08-31 10:31:22 +00:00
|
|
|
goto end
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:setprefix
|
|
|
|
shift
|
|
|
|
set prefix=%1
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:withgcc
|
|
|
|
set COMPILER=gcc
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:withmsvc
|
|
|
|
set COMPILER=cl
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:nodebug
|
|
|
|
set nodebug=Y
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:noopt
|
|
|
|
set noopt=Y
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2010-07-18 09:41:48 +00:00
|
|
|
:enablechecking
|
|
|
|
set enablechecking=Y
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2010-07-18 09:41:48 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2008-07-23 15:41:23 +00:00
|
|
|
:profile
|
|
|
|
set profile=Y
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2008-07-23 15:41:23 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:nocygwin
|
|
|
|
set nocygwin=Y
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:usercflags
|
2011-04-15 22:48:00 +00:00
|
|
|
if "%use_extensions%" == "1" goto ucflagex
|
|
|
|
goto ucflagne
|
|
|
|
|
|
|
|
:ucflagex
|
|
|
|
shift
|
|
|
|
set usercflags=%usercflags%%sep1%%~1
|
2011-05-07 04:00:12 +00:00
|
|
|
set escusercflags=%usercflags:"=\"%
|
2011-04-15 22:48:00 +00:00
|
|
|
set sep1= %nothing%
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
|
|
|
:ucflagne
|
2001-08-31 10:31:22 +00:00
|
|
|
shift
|
|
|
|
set usercflags=%usercflags%%sep1%%1
|
2011-05-07 04:00:12 +00:00
|
|
|
set escusercflags=%usercflags%
|
2001-08-31 10:31:22 +00:00
|
|
|
set sep1= %nothing%
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2011-04-25 01:29:31 +00:00
|
|
|
:extrauserlibs
|
|
|
|
shift
|
|
|
|
echo. extrauserlibs: %extrauserlibs%
|
|
|
|
set extrauserlibs=%extrauserlibs%%sep4%%1
|
|
|
|
set sep4= %nothing%
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:userldflags
|
2011-04-15 22:48:00 +00:00
|
|
|
if "%use_extensions%" == "1" goto ulflagex
|
|
|
|
goto ulflagne
|
|
|
|
|
|
|
|
:ulflagex
|
|
|
|
shift
|
|
|
|
set userldflags=%userldflags%%sep2%%~1
|
2011-05-07 04:00:12 +00:00
|
|
|
set escuserldflags=%userldflags:"=\"%
|
2011-04-15 22:48:00 +00:00
|
|
|
set sep2= %nothing%
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
|
|
|
:ulflagne
|
2001-08-31 10:31:22 +00:00
|
|
|
shift
|
|
|
|
set userldflags=%userldflags%%sep2%%1
|
2011-05-07 04:00:12 +00:00
|
|
|
set escuserldflags=%userldflags%
|
2001-08-31 10:31:22 +00:00
|
|
|
set sep2= %nothing%
|
|
|
|
shift
|
|
|
|
goto again
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2003-01-25 20:50:48 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
:withoutpng
|
|
|
|
set pngsupport=N
|
|
|
|
set HAVE_PNG=
|
2003-01-29 07:37:34 +00:00
|
|
|
shift
|
2003-01-25 20:50:48 +00:00
|
|
|
goto again
|
2001-08-31 10:31:22 +00:00
|
|
|
|
2003-01-26 01:25:49 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
:withoutjpeg
|
|
|
|
set jpegsupport=N
|
|
|
|
set HAVE_JPEG=
|
2003-01-29 07:37:34 +00:00
|
|
|
shift
|
2003-01-26 01:25:49 +00:00
|
|
|
goto again
|
|
|
|
|
2003-01-31 07:23:20 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
:withoutgif
|
|
|
|
set gifsupport=N
|
|
|
|
set HAVE_GIF=
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
2003-01-31 11:03:11 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
|
2011-04-25 01:29:31 +00:00
|
|
|
:withoutgnutls
|
|
|
|
set tlssupport=N
|
|
|
|
set HAVE_GNUTLS=
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
|
2003-01-31 11:03:11 +00:00
|
|
|
:withouttiff
|
|
|
|
set tiffsupport=N
|
|
|
|
set HAVE_TIFF=
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
:withoutxpm
|
|
|
|
set xpmsupport=N
|
|
|
|
set HAVE_XPM=
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
2009-01-03 12:57:28 +00:00
|
|
|
:withsvg
|
|
|
|
shift
|
|
|
|
set svgsupport=Y
|
|
|
|
goto again
|
|
|
|
|
2010-07-24 13:35:31 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
:distfiles
|
|
|
|
set HAVE_DISTFILES=1
|
|
|
|
shift
|
|
|
|
set distfiles=%distfiles%%sep3%%1
|
|
|
|
set sep3= %nothing%
|
|
|
|
shift
|
|
|
|
goto again
|
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem Check that necessary utilities (cp and rm) are present.
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:checkutils
|
|
|
|
echo Checking for 'cp'...
|
|
|
|
cp configure.bat junk.bat
|
|
|
|
if not exist junk.bat goto needcp
|
|
|
|
echo Checking for 'rm'...
|
|
|
|
rm junk.bat
|
|
|
|
if exist junk.bat goto needrm
|
|
|
|
goto checkcompiler
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:needcp
|
|
|
|
echo You need 'cp' (the Unix file copy program) to build Emacs.
|
|
|
|
goto end
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:needrm
|
|
|
|
del junk.bat
|
|
|
|
echo You need 'rm' (the Unix file delete program) to build Emacs.
|
|
|
|
goto end
|
|
|
|
|
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem Auto-detect compiler if not specified, and validate GCC if chosen.
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:checkcompiler
|
2003-01-25 20:50:48 +00:00
|
|
|
if (%COMPILER%)==(cl) goto compilercheckdone
|
2001-08-31 10:31:22 +00:00
|
|
|
if (%COMPILER%)==(gcc) goto checkgcc
|
|
|
|
|
|
|
|
echo Checking whether 'gcc' is available...
|
2008-02-03 21:59:56 +00:00
|
|
|
echo main(){} >junk.c
|
2001-08-31 10:31:22 +00:00
|
|
|
gcc -c junk.c
|
2008-02-03 21:59:56 +00:00
|
|
|
if exist junk.o goto checkgcc
|
2001-08-31 10:31:22 +00:00
|
|
|
|
2008-02-03 21:59:56 +00:00
|
|
|
echo Checking whether 'cl' is available...
|
|
|
|
cl -nologo -c junk.c
|
|
|
|
if exist junk.obj goto clOK
|
|
|
|
goto nocompiler
|
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:checkgcc
|
2008-02-11 21:18:06 +00:00
|
|
|
if exist junk.o del junk.o
|
2001-08-31 10:31:22 +00:00
|
|
|
Rem WARNING -- COMMAND.COM on some systems only looks at the first
|
|
|
|
Rem 8 characters of a label. So do NOT be tempted to change
|
|
|
|
Rem chkapi* into something fancier like checkw32api
|
|
|
|
Rem You HAVE been warned!
|
2008-02-11 21:18:06 +00:00
|
|
|
if (%nocygwin%) == (Y) goto chkapiN
|
2001-08-31 10:31:22 +00:00
|
|
|
echo Checking whether gcc requires '-mno-cygwin'...
|
|
|
|
echo #include "cygwin/version.h" >junk.c
|
|
|
|
echo main(){} >>junk.c
|
2005-06-11 10:56:49 +00:00
|
|
|
echo gcc -c junk.c >>config.log
|
|
|
|
gcc -c junk.c >>config.log 2>&1
|
2001-08-31 10:31:22 +00:00
|
|
|
if not exist junk.o goto chkapi
|
2005-06-11 10:56:49 +00:00
|
|
|
echo gcc -mno-cygwin -c junk.c >>config.log
|
|
|
|
gcc -mno-cygwin -c junk.c >>config.log 2>&1
|
2001-08-31 10:31:22 +00:00
|
|
|
if exist junk.o set nocygwin=Y
|
|
|
|
|
|
|
|
:chkapi
|
2005-06-11 10:56:49 +00:00
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2008-02-11 21:18:06 +00:00
|
|
|
:chkapiN
|
|
|
|
rm -f junk.c junk.o
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem Older versions of the Windows API headers either don't have any of
|
|
|
|
rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1
|
|
|
|
rem are like this), or have a typo in the definition of
|
|
|
|
rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this
|
|
|
|
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.
|
2008-04-05 08:17:20 +00:00
|
|
|
rem Beginning with Emacs 23, we need usp10.h.
|
2001-08-31 10:31:22 +00:00
|
|
|
rem
|
|
|
|
echo Checking whether W32 API headers are too old...
|
|
|
|
echo #include "windows.h" >junk.c
|
2008-04-05 08:17:20 +00:00
|
|
|
echo #include "usp10.h" >>junk.c
|
2001-08-31 10:31:22 +00:00
|
|
|
echo 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%
|
|
|
|
goto chkapi2
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:chkapi1
|
|
|
|
set cf=%usercflags% -mno-cygwin
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:chkapi2
|
|
|
|
echo on
|
|
|
|
gcc %cf% -c junk.c
|
2005-06-11 10:56:49 +00:00
|
|
|
@echo off
|
|
|
|
@echo gcc %cf% -c junk.c >>config.log
|
|
|
|
gcc %cf% -c junk.c >>config.log 2>&1
|
2001-08-31 10:31:22 +00:00
|
|
|
set cf=
|
2010-09-22 23:14:00 +00:00
|
|
|
if exist junk.o goto chkuser
|
2005-06-11 10:56:49 +00:00
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
2010-09-22 23:14:00 +00:00
|
|
|
goto nocompiler
|
|
|
|
|
|
|
|
:chkuser
|
|
|
|
rm -f junk.o
|
|
|
|
echo int main (int argc, char *argv[]) {>junk.c
|
2011-05-07 04:00:12 +00:00
|
|
|
echo char *usercflags = "%escusercflags%";>>junk.c
|
2010-09-22 23:14:00 +00:00
|
|
|
echo }>>junk.c
|
|
|
|
echo gcc -Werror -c junk.c >>config.log
|
|
|
|
gcc -Werror -c junk.c >>config.log 2>&1
|
|
|
|
if exist junk.o goto gccOk
|
|
|
|
echo.
|
|
|
|
echo Error in --cflags argument: %usercflags%
|
|
|
|
echo Backslashes and quotes cannot be used with --cflags. Please use forward
|
|
|
|
echo slashes for filenames and paths (e.g. when passing directories to -I).
|
|
|
|
rm -f junk.c
|
|
|
|
goto end
|
2001-08-31 10:31:22 +00:00
|
|
|
|
|
|
|
:nocompiler
|
|
|
|
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 or MSVC 2.x or later.
|
|
|
|
del junk.c
|
|
|
|
goto end
|
|
|
|
|
|
|
|
:gccOk
|
|
|
|
set COMPILER=gcc
|
|
|
|
echo Using 'gcc'
|
2005-06-11 10:56:49 +00:00
|
|
|
rm -f junk.c junk.o
|
|
|
|
Rem It is not clear what GCC version began supporting -mtune
|
|
|
|
Rem and pentium4 on x86, so check this explicitly.
|
|
|
|
echo main(){} >junk.c
|
|
|
|
echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log
|
|
|
|
gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1
|
|
|
|
if not errorlevel 1 goto gccMtuneOk
|
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
|
|
|
set mf=-mcpu=i686
|
|
|
|
rm -f junk.c junk.o
|
2008-06-23 21:34:24 +00:00
|
|
|
goto gccdebug
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2005-06-11 10:56:49 +00:00
|
|
|
:gccMtuneOk
|
|
|
|
echo GCC supports -mtune=pentium4 >>config.log
|
|
|
|
set mf=-mtune=pentium4
|
|
|
|
rm -f junk.c junk.o
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2008-06-23 21:34:24 +00:00
|
|
|
:gccdebug
|
|
|
|
rem Check for DWARF-2 debug info support, else default to stabs
|
|
|
|
echo main(){} >junk.c
|
|
|
|
echo gcc -c -gdwarf-2 -g3 junk.c >>config.log
|
|
|
|
gcc -c -gdwarf-2 -g3 junk.c >>config.log 2>&1
|
|
|
|
if not errorlevel 1 goto gccdwarf
|
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
|
|
|
set dbginfo=-gstabs+
|
|
|
|
rm -f junk.c junk.o
|
|
|
|
goto compilercheckdone
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2008-06-23 21:34:24 +00:00
|
|
|
:gccdwarf
|
|
|
|
echo GCC supports DWARF-2 >>config.log
|
|
|
|
set dbginfo=-gdwarf-2 -g3
|
|
|
|
rm -f junk.c junk.o
|
2003-01-25 20:50:48 +00:00
|
|
|
goto compilercheckdone
|
2001-08-31 10:31:22 +00:00
|
|
|
|
|
|
|
:clOk
|
|
|
|
set COMPILER=cl
|
|
|
|
rm -f junk.c junk.obj
|
|
|
|
echo Using 'MSVC'
|
2003-01-25 20:50:48 +00:00
|
|
|
|
|
|
|
:compilercheckdone
|
|
|
|
|
|
|
|
rem ----------------------------------------------------------------------
|
|
|
|
rem Check for external image libraries. Since they are loaded
|
|
|
|
rem dynamically, the libraries themselves do not need to be present
|
|
|
|
rem at compile time, but the header files are required.
|
|
|
|
|
2004-05-06 19:18:34 +00:00
|
|
|
set mingwflag=
|
|
|
|
|
|
|
|
if (%nocygwin%) == (N) goto flagsOK
|
|
|
|
set mingwflag=-mno-cygwin
|
|
|
|
|
|
|
|
:flagsOK
|
|
|
|
|
2003-01-25 20:50:48 +00:00
|
|
|
if (%pngsupport%) == (N) goto pngDone
|
|
|
|
|
|
|
|
echo Checking for libpng...
|
|
|
|
echo #include "png.h" >junk.c
|
|
|
|
echo main (){} >>junk.c
|
|
|
|
rem -o option is ignored with cl, but allows result to be consistent.
|
2005-06-11 10:56:49 +00:00
|
|
|
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
|
2003-01-25 20:50:48 +00:00
|
|
|
if exist junk.obj goto havePng
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
echo ...png.h not found, building without PNG support.
|
2005-06-11 10:56:49 +00:00
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
2003-01-25 20:50:48 +00:00
|
|
|
set HAVE_PNG=
|
|
|
|
goto :pngDone
|
|
|
|
|
|
|
|
:havePng
|
|
|
|
echo ...PNG header available, building with PNG support.
|
|
|
|
set HAVE_PNG=1
|
|
|
|
|
|
|
|
:pngDone
|
|
|
|
rm -f junk.c junk.obj
|
2001-08-31 10:31:22 +00:00
|
|
|
|
2011-04-25 01:29:31 +00:00
|
|
|
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
|
2011-11-25 13:26:30 +00:00
|
|
|
echo ...GnuTLS header available, building with GnuTLS support.
|
2011-04-25 01:29:31 +00:00
|
|
|
set HAVE_GNUTLS=1
|
|
|
|
|
|
|
|
:tlsDone
|
|
|
|
rm -f junk.c junk.obj
|
|
|
|
|
2003-01-26 01:25:49 +00:00
|
|
|
if (%jpegsupport%) == (N) goto jpegDone
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
echo Checking for jpeg-6b...
|
2003-01-26 01:25:49 +00:00
|
|
|
echo #include "jconfig.h" >junk.c
|
|
|
|
echo main (){} >>junk.c
|
|
|
|
rem -o option is ignored with cl, but allows result to be consistent.
|
2005-06-11 10:56:49 +00:00
|
|
|
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
|
2003-01-26 01:25:49 +00:00
|
|
|
if exist junk.obj goto haveJpeg
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
echo ...jconfig.h not found, building without JPEG support.
|
2005-06-11 10:56:49 +00:00
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
2003-01-26 01:25:49 +00:00
|
|
|
set HAVE_JPEG=
|
|
|
|
goto :jpegDone
|
|
|
|
|
|
|
|
:haveJpeg
|
|
|
|
echo ...JPEG header available, building with JPEG support.
|
|
|
|
set HAVE_JPEG=1
|
|
|
|
|
|
|
|
:jpegDone
|
|
|
|
rm -f junk.c junk.obj
|
|
|
|
|
2003-01-31 07:23:20 +00:00
|
|
|
if (%gifsupport%) == (N) goto gifDone
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
echo Checking for libgif...
|
2003-01-31 07:23:20 +00:00
|
|
|
echo #include "gif_lib.h" >junk.c
|
|
|
|
echo main (){} >>junk.c
|
|
|
|
rem -o option is ignored with cl, but allows result to be consistent.
|
2005-06-11 10:56:49 +00:00
|
|
|
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
|
2003-01-31 07:23:20 +00:00
|
|
|
if exist junk.obj goto haveGif
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
echo ...gif_lib.h not found, building without GIF support.
|
2005-06-11 10:56:49 +00:00
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
2003-01-31 07:23:20 +00:00
|
|
|
set HAVE_GIF=
|
|
|
|
goto :gifDone
|
|
|
|
|
|
|
|
:haveGif
|
|
|
|
echo ...GIF header available, building with GIF support.
|
|
|
|
set HAVE_GIF=1
|
|
|
|
|
|
|
|
:gifDone
|
|
|
|
rm -f junk.c junk.obj
|
|
|
|
|
2003-01-31 11:03:11 +00:00
|
|
|
if (%tiffsupport%) == (N) goto tiffDone
|
|
|
|
|
|
|
|
echo Checking for tiff...
|
|
|
|
echo #include "tiffio.h" >junk.c
|
|
|
|
echo main (){} >>junk.c
|
|
|
|
rem -o option is ignored with cl, but allows result to be consistent.
|
2005-06-11 10:56:49 +00:00
|
|
|
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
|
2003-01-31 11:03:11 +00:00
|
|
|
if exist junk.obj goto haveTiff
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
echo ...tiffio.h not found, building without TIFF support.
|
2005-06-11 10:56:49 +00:00
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
2003-01-31 11:03:11 +00:00
|
|
|
set HAVE_TIFF=
|
|
|
|
goto :tiffDone
|
|
|
|
|
|
|
|
:haveTiff
|
|
|
|
echo ...TIFF header available, building with TIFF support.
|
|
|
|
set HAVE_TIFF=1
|
|
|
|
|
|
|
|
:tiffDone
|
|
|
|
rm -f junk.c junk.obj
|
|
|
|
|
2003-02-02 00:01:25 +00:00
|
|
|
if (%xpmsupport%) == (N) goto xpmDone
|
|
|
|
|
|
|
|
echo Checking for libXpm...
|
|
|
|
echo #define FOR_MSW 1 >junk.c
|
|
|
|
echo #include "X11/xpm.h" >>junk.c
|
|
|
|
echo main (){} >>junk.c
|
|
|
|
rem -o option is ignored with cl, but allows result to be consistent.
|
2005-06-11 10:56:49 +00:00
|
|
|
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
|
2003-02-02 00:01:25 +00:00
|
|
|
if exist junk.obj goto haveXpm
|
|
|
|
|
|
|
|
echo ...X11/xpm.h not found, building without XPM support.
|
2005-06-11 10:56:49 +00:00
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
2003-02-02 00:01:25 +00:00
|
|
|
set HAVE_XPM=
|
|
|
|
goto :xpmDone
|
|
|
|
|
|
|
|
:haveXpm
|
|
|
|
echo ...XPM header available, building with XPM support.
|
|
|
|
set HAVE_XPM=1
|
|
|
|
|
|
|
|
:xpmDone
|
2009-01-03 12:57:28 +00:00
|
|
|
rm -f junk.c junk.obj
|
|
|
|
|
|
|
|
if not (%svgsupport%) == (Y) goto :svgDone
|
|
|
|
echo Checking for librsvg...
|
|
|
|
echo #include "librsvg/rsvg.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 haveSvg
|
|
|
|
|
|
|
|
echo ...librsvg/rsvg.h or dependencies not found, building without SVG support.
|
|
|
|
echo The failed program was: >>config.log
|
|
|
|
type junk.c >>config.log
|
|
|
|
set HAVE_RSVG=
|
|
|
|
goto :svgDone
|
|
|
|
|
|
|
|
:haveSvg
|
|
|
|
echo ...librsvg header available, building with SVG support (EXPERIMENTAL).
|
|
|
|
set HAVE_RSVG=1
|
|
|
|
|
|
|
|
:svgDone
|
2003-02-02 00:01:25 +00:00
|
|
|
rm -f junk.c junk.obj junk.err junk.out
|
|
|
|
|
2010-07-24 13:35:31 +00:00
|
|
|
rem Any distfiles provided for building distribution? If no, we're done.
|
|
|
|
if "(%HAVE_DISTFILES%)"=="()" goto :distFilesDone
|
|
|
|
|
|
|
|
rem Any arguments to --distfiles specified? If no, we're done.
|
|
|
|
if not "%distfiles%"=="" goto :checkDistFiles
|
|
|
|
set distFilesOk=0
|
|
|
|
echo No arguments specified for option --distfiles!
|
|
|
|
goto distfilesDone
|
|
|
|
|
|
|
|
:checkDistFiles
|
|
|
|
echo Checking for distfiles...
|
|
|
|
rem Check if all specified distfiles exist
|
|
|
|
set fileNotFound=
|
|
|
|
for %%d in (%distfiles%) do if not exist %%d set fileNotFound=%%d
|
|
|
|
if not "%fileNotFound%"=="" goto distFilesNotFound
|
|
|
|
|
|
|
|
set distFilesOK=1
|
|
|
|
echo ...all distfiles found.
|
|
|
|
goto :distFilesDone
|
|
|
|
|
|
|
|
:distFilesNotFound
|
|
|
|
set distFilesOk=0
|
|
|
|
echo ...%fileNotFound% not found.
|
|
|
|
set distfiles=
|
|
|
|
goto :distfilesDone
|
|
|
|
|
|
|
|
:distFilesDone
|
|
|
|
set fileNotFound=
|
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
rem ----------------------------------------------------------------------
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:genmakefiles
|
|
|
|
echo Generating makefiles
|
|
|
|
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
|
|
|
|
echo # Start of settings from configure.bat >config.settings
|
|
|
|
echo COMPILER=%COMPILER%>>config.settings
|
2005-06-11 10:56:49 +00:00
|
|
|
if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings
|
2008-06-23 21:34:24 +00:00
|
|
|
if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo%>>config.settings
|
2001-08-31 10:31:22 +00:00
|
|
|
if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings
|
|
|
|
if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
|
2010-07-18 09:41:48 +00:00
|
|
|
if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings
|
2008-07-23 15:41:23 +00:00
|
|
|
if (%profile%) == (Y) echo PROFILE=1 >>config.settings
|
2001-08-31 10:31:22 +00:00
|
|
|
if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
|
|
|
|
if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings
|
2010-07-24 13:35:31 +00:00
|
|
|
if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles%>>config.settings
|
2007-10-20 12:28:52 +00:00
|
|
|
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
|
2011-05-07 04:00:12 +00:00
|
|
|
if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags%>>config.settings
|
2007-10-20 12:28:52 +00:00
|
|
|
for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
|
|
|
|
if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings
|
2011-04-25 01:29:31 +00:00
|
|
|
for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y
|
|
|
|
if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs%>>config.settings
|
2001-08-31 10:31:22 +00:00
|
|
|
echo # End of settings from configure.bat>>config.settings
|
|
|
|
echo. >>config.settings
|
|
|
|
|
2005-06-11 14:50:00 +00:00
|
|
|
copy config.nt config.tmp
|
|
|
|
echo. >>config.tmp
|
|
|
|
echo /* Start of settings from configure.bat. */ >>config.tmp
|
2010-09-22 17:26:02 +00:00
|
|
|
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
|
2011-05-07 04:00:12 +00:00
|
|
|
if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%">>config.tmp
|
|
|
|
if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%">>config.tmp
|
2009-09-14 23:00:52 +00:00
|
|
|
if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp
|
2005-06-11 14:50:00 +00:00
|
|
|
if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp
|
2011-04-25 01:29:31 +00:00
|
|
|
if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp
|
2005-06-11 14:50:00 +00:00
|
|
|
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
|
|
|
|
if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp
|
2009-01-03 12:57:28 +00:00
|
|
|
if "(%HAVE_RSVG%)" == "(1)" echo #define HAVE_RSVG 1 >>config.tmp
|
|
|
|
|
2005-06-11 14:50:00 +00:00
|
|
|
echo /* End of settings from configure.bat. */ >>config.tmp
|
|
|
|
|
|
|
|
Rem See if fc.exe returns a meaningful exit status. If it does, we
|
|
|
|
Rem might as well avoid unnecessary overwriting of config.h and epaths.h,
|
|
|
|
Rem since this forces recompilation of every source file.
|
|
|
|
if exist foo.bar del foo.bar
|
|
|
|
fc /b foo.bar foo.bar >nul 2>&1
|
|
|
|
if not errorlevel 2 goto doCopy
|
|
|
|
fc /b config.tmp ..\src\config.h >nul 2>&1
|
|
|
|
if errorlevel 1 goto doCopy
|
|
|
|
fc /b paths.h ..\src\epaths.h >nul 2>&1
|
2010-09-29 13:58:11 +00:00
|
|
|
if not errorlevel 1 goto dontCopy
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2005-06-11 14:50:00 +00:00
|
|
|
:doCopy
|
|
|
|
copy config.tmp ..\src\config.h
|
2001-08-31 10:31:22 +00:00
|
|
|
copy paths.h ..\src\epaths.h
|
|
|
|
|
2005-06-11 14:50:00 +00:00
|
|
|
:dontCopy
|
|
|
|
if exist config.tmp del config.tmp
|
2001-08-31 10:31:22 +00:00
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile
|
2008-02-02 15:06:00 +00:00
|
|
|
if exist ..\admin\unidata copy /b config.settings+%MAKECMD%.defs+..\admin\unidata\makefile.w32-in ..\admin\unidata\makefile
|
2001-08-31 10:31:22 +00:00
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile
|
Fix the MS-Windows build broken by 2011-01-17T19:01:01Z!eggert@cs.ucla.edu and emacs-23/2010-05-21T19:51:48Z!acm@muc.de.
lib/makefile.w32-in:
lib/getopt_.h: New files.
src/s/ms-w32.h (HAVE_MKTIME): Remove.
src/makefile.w32-in (LOCAL_FLAGS): Add -I../lib.
(GNULIB): New variable.
(LIBS): Add $(GNULIB).
$(TEMACS): Depend on $(GNULIB).
<top-level>: Fix font-lock disrupted by a lone `"'.
src/makefile.w32-in (LOCAL_FLAGS): Add -I../lib.
(GETOPTOBJS, GETOPTDEPS): Remove targets.
(MOVEMAILOBJS): Replace $(GETOPTOBJS) with ../lib/$(BLD)/libgnu.$(A).
($(BLD)/movemail.exe): Depend on ../lib/getopt.h.
(ECLIENTOBJS, ETAGSOBJ, CTAGSOBJ, EBROWSEOBJ): Replace getopt.o
and getopt1.o with ../lib/$(BLD)/libgnu.$(A).
(clean): Don't remove getopt.h.
(getopt.h, $(BLD)/getopt.$(O), $(BLD)/getopt1.$(O)): Remove targets.
($(BLD)/ctags.$(O), $(BLD)/etags.$(O)): Replace getopt.h with
$(EMACS_ROOT)/lib/getopt.h.
nt/makefile.w32-in (all-other-dirs-nmake, all-other-dirs-gmake)
(bootstrap-nmake, bootstrap-gmake, bootstrap-clean-nmake)
(bootstrap-clean-gmake, clean-other-dirs-nmake)
(clean-other-dirs-gmake, cleanall-other-dirs-nmake)
(cleanall-other-dirs-gmake, distclean-other-dirs-nmake)
(distclean-other-dirs-gmake, maintainer-clean-other-dirs-nmake)
(maintainer-clean-other-dirs-gmake): Recurse into ../lib as well.
nt/configure.bat: Create lib/makefile.
nt/config.nt (HAVE_MKTIME, BROKEN_MKTIME): Remove.
(HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE_DECL_GETENV)
(HAVE_DECL_LOCALTIME_R, HAVE_WCHAR_T, PACKAGE, VERSION, inline)
(_GL_UNUSED, _UNUSED_PARAMETER_): Add definitions, for gnulib.
2011-01-29 12:36:11 +00:00
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\lib\makefile.w32-in ..\lib\makefile
|
2001-08-31 10:31:22 +00:00
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile
|
2007-09-06 07:32:52 +00:00
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\doc\emacs\makefile.w32-in ..\doc\emacs\makefile
|
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\doc\misc\makefile.w32-in ..\doc\misc\makefile
|
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\doc\lispref\makefile.w32-in ..\doc\lispref\makefile
|
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\doc\lispintro\makefile.w32-in ..\doc\lispintro\makefile
|
2001-08-31 10:31:22 +00:00
|
|
|
if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile
|
|
|
|
copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile
|
|
|
|
rem Use the default (no-op) Makefile.in if the nt version is not present.
|
|
|
|
if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile
|
|
|
|
if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile
|
|
|
|
del config.settings
|
|
|
|
|
2001-09-06 08:12:53 +00:00
|
|
|
Rem Some people use WinZip which doesn't create empty directories!
|
|
|
|
if not exist ..\site-lisp\nul mkdir ..\site-lisp\
|
2007-01-31 10:04:15 +00:00
|
|
|
Rem Update subdirs.el only if it is different or fc.exe doesn't work.
|
|
|
|
if exist foo.bar del foo.bar
|
|
|
|
fc /b foo.bar foo.bar >nul 2>&1
|
|
|
|
if not errorlevel 2 goto doUpdateSubdirs
|
|
|
|
fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1
|
|
|
|
if not errorlevel 1 goto dontUpdateSubdirs
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2007-01-31 10:04:15 +00:00
|
|
|
:doUpdateSubdirs
|
|
|
|
if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el
|
|
|
|
copy subdirs.el ..\site-lisp\subdirs.el
|
|
|
|
|
|
|
|
:dontUpdateSubdirs
|
2001-08-31 10:31:22 +00:00
|
|
|
echo.
|
2007-06-20 22:10:31 +00:00
|
|
|
|
|
|
|
rem check that we have all the libraries we need.
|
|
|
|
set libsOK=1
|
|
|
|
|
|
|
|
if not "(%HAVE_XPM%)" == "()" goto checkpng
|
|
|
|
if (%xpmsupport%) == (N) goto checkpng
|
|
|
|
set libsOK=0
|
|
|
|
echo XPM support is missing. It is required for color icons in the toolbar.
|
|
|
|
echo Install libXpm development files or use --without-xpm
|
|
|
|
|
|
|
|
:checkpng
|
|
|
|
if not "(%HAVE_PNG%)" == "()" goto checkjpeg
|
|
|
|
if (%pngsupport%) == (N) goto checkjpeg
|
|
|
|
set libsOK=0
|
|
|
|
echo PNG support is missing.
|
|
|
|
echo Install libpng development files or use --without-png
|
|
|
|
|
|
|
|
:checkjpeg
|
|
|
|
if not "(%HAVE_JPEG%)" == "()" goto checktiff
|
|
|
|
if (%jpegsupport%) == (N) goto checktiff
|
|
|
|
set libsOK=0
|
|
|
|
echo JPEG support is missing.
|
|
|
|
echo Install jpeg development files or use --without-jpeg
|
|
|
|
|
|
|
|
:checktiff
|
|
|
|
if not "(%HAVE_TIFF%)" == "()" goto checkgif
|
|
|
|
if (%tiffsupport%) == (N) goto checkgif
|
|
|
|
set libsOK=0
|
|
|
|
echo TIFF support is missing.
|
|
|
|
echo Install libtiff development files or use --without-tiff
|
|
|
|
|
|
|
|
:checkgif
|
2010-07-24 13:35:31 +00:00
|
|
|
if not "(%HAVE_GIF%)" == "()" goto checkdistfiles
|
|
|
|
if (%gifsupport%) == (N) goto checkdistfiles
|
2007-06-20 22:10:31 +00:00
|
|
|
set libsOK=0
|
|
|
|
echo GIF support is missing.
|
|
|
|
echo Install giflib or libungif development files or use --without-gif
|
|
|
|
|
2010-07-24 13:35:31 +00:00
|
|
|
:checkdistfiles
|
|
|
|
if "(%HAVE_DISTFILES%)" == "()" goto donelibchecks
|
|
|
|
if (%distFilesOk%) == (1) goto donelibchecks
|
|
|
|
echo.
|
|
|
|
echo Files specified with option --distfiles could not be found.
|
|
|
|
echo Fix these issues before running make dist
|
|
|
|
|
2007-06-20 22:10:31 +00:00
|
|
|
:donelibchecks
|
|
|
|
if (%libsOK%) == (1) goto success
|
|
|
|
echo.
|
|
|
|
echo Important libraries are missing. Fix these issues before running make.
|
|
|
|
goto end
|
|
|
|
|
|
|
|
:success
|
2001-08-31 10:31:22 +00:00
|
|
|
echo Emacs successfully configured.
|
2005-07-16 12:37:06 +00:00
|
|
|
echo Emacs successfully configured. >>config.log
|
2008-04-21 21:31:53 +00:00
|
|
|
if (%MAKECMD%) == (gmake) set MAKECMD=make
|
2001-08-31 10:31:22 +00:00
|
|
|
echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.
|
|
|
|
goto end
|
|
|
|
|
|
|
|
:SmallEnv
|
|
|
|
echo Your environment size is too small. Please enlarge it and rerun configure.
|
|
|
|
echo For example, type "command.com /e:2048" to have 2048 bytes available.
|
|
|
|
set $foo$=
|
2010-09-22 01:30:05 +00:00
|
|
|
|
2001-08-31 10:31:22 +00:00
|
|
|
:end
|
|
|
|
set prefix=
|
|
|
|
set nodebug=
|
|
|
|
set noopt=
|
2010-07-18 09:41:48 +00:00
|
|
|
set enablechecking=
|
2008-07-23 15:41:23 +00:00
|
|
|
set profile=
|
2001-08-31 10:31:22 +00:00
|
|
|
set nocygwin=
|
|
|
|
set COMPILER=
|
|
|
|
set MAKECMD=
|
|
|
|
set usercflags=
|
2007-10-20 12:28:52 +00:00
|
|
|
set docflags=
|
2001-08-31 10:31:22 +00:00
|
|
|
set userldflags=
|
2007-10-20 12:28:52 +00:00
|
|
|
set doldflags=
|
2004-05-06 19:18:34 +00:00
|
|
|
set mingwflag=
|
2005-06-11 10:56:49 +00:00
|
|
|
set mf=
|
2010-07-24 13:35:31 +00:00
|
|
|
set distfiles=
|
|
|
|
set HAVE_DISTFILES=
|
|
|
|
set distFilesOk=
|
2010-12-31 13:12:11 +00:00
|
|
|
set pngsupport=
|
2011-04-25 01:29:31 +00:00
|
|
|
set tlssupport=
|
2010-12-31 13:12:11 +00:00
|
|
|
set jpegsupport=
|
|
|
|
set gifsupport=
|
|
|
|
set tiffsupport=
|
|
|
|
set xpmsupport=
|
|
|
|
set svgsupport=
|
|
|
|
set libsOK=
|
|
|
|
set HAVE_GIF=
|
|
|
|
set HAVE_JPEG=
|
|
|
|
set HAVE_PNG=
|
|
|
|
set HAVE_TIFF=
|
|
|
|
set HAVE_XPM=
|
|
|
|
set dbginfo=
|
2003-09-02 19:14:00 +00:00
|
|
|
|