@echo off\r
rem ----------------------------------------------------------------------\r
rem Configuration script for MS Windows 95/98/Me and NT/2000/XP\r
-rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 \r
-rem Free Software Foundation, Inc.\r
+rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,\r
+rem 2006, 2007 Free Software Foundation, Inc.\r
\r
rem This file is part of GNU Emacs.\r
\r
rem GNU Emacs is free software; you can redistribute it and/or modify\r
rem it under the terms of the GNU General Public License as published by\r
-rem the Free Software Foundation; either version 2, or (at your option)\r
+rem the Free Software Foundation; either version 3, or (at your option)\r
rem any later version.\r
\r
rem GNU Emacs is distributed in the hope that it will be useful,\r
rem\r
rem + MS Windows 95/98/Me or NT/2000/XP\r
rem + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 3.75\r
-rem or later) and the Mingw32 and W32 API headers and libraries\r
+rem or later) and the Mingw32 and W32 API headers and libraries.\r
+rem + Visual Studio 2005 is not supported at this time.\r
rem\r
rem For reference, here is a list of which builds of gmake are known to\r
rem work or not, and whether they work in the presence and/or absence of\r
rem sh.exe.\r
rem\r
rem sh exists no sh\r
-rem cygwin b20.1 make (3.75): okay[1] fails[2]\r
+rem cygwin b20.1 make (3.75): fails[1,5] fails[2,5]\r
rem MSVC compiled gmake 3.77: okay okay\r
rem MSVC compiled gmake 3.78.1: okay okay\r
rem MSVC compiled gmake 3.79.1: okay okay\r
-rem mingw32/gcc-2.92.2 make (3.77): okay okay\r
-rem cygwin compiled gmake 3.77: okay[1] fails[2]\r
-rem cygwin compiled gmake 3.78.1: okay fails[2]\r
-rem cygwin compiled gmake 3.79.1: couldn't build make[3]\r
+rem mingw32/gcc-2.92.2 make (3.77): okay okay[4]\r
+rem cygwin compiled gmake 3.77: fails[1,5] fails[2,5]\r
+rem cygwin compiled gmake 3.78.1: fails[5] fails[2,5]\r
+rem cygwin compiled gmake 3.79.1: fails[3,5] fails[2?,5]\r
+rem cygwin compiled make 3.80: okay[6] fails?[7]\r
+rem cygwin compiled make 3.81: fails fails?[7]\r
+rem mingw32 compiled make 3.79.1: okay okay\r
+rem mingw32 compiled make 3.80: okay okay?[7]\r
+rem mingw32 compiled make 3.81: okay okay[8]\r
rem\r
rem [1] doesn't cope with makefiles with DOS line endings, so must mount\r
rem emacs source with text!=binary.\r
rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.\r
-rem [3] requires LC_MESSAGES support to build; maybe 2.95.x update to\r
-rem cygwin provides this?\r
+rem [3] requires LC_MESSAGES support to build; cannot build with early\r
+rem versions of cygwin.\r
+rem [4] may fail on Windows 9X and Windows ME; if so, install Bash.\r
+rem [5] fails when building leim due to the use of cygwin style paths.\r
+rem May work if building emacs without leim.\r
+rem [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath';\r
+rem look for "cygpath" near line 85 of gmake.defs.\r
+rem [7] not recommended; please report if you try this combination.\r
+rem [8] tested only on Windows XP.\r
rem\r
\r
if exist config.log del config.log\r
set nocygwin=N\r
set COMPILER=\r
set usercflags=\r
+set docflags=\r
set userldflags=\r
+set doldflags=\r
set sep1=\r
set sep2=\r
\r
if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
-if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings\r
-if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings\r
+rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r
+rem and the if command cannot cope with this\r
+for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y\r
+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
echo # End of settings from configure.bat>>config.settings\r
echo. >>config.settings\r
\r
copy config.nt config.tmp\r
echo. >>config.tmp\r
echo /* Start of settings from configure.bat. */ >>config.tmp\r
-if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>config.tmp\r
-if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>config.tmp\r
+if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp\r
+if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp\r
if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 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
copy /b config.settings+%MAKECMD%.defs+..\man\makefile.w32-in ..\man\makefile\r
copy /b config.settings+%MAKECMD%.defs+..\lispref\makefile.w32-in ..\lispref\makefile\r
copy /b config.settings+%MAKECMD%.defs+..\lispintro\makefile.w32-in ..\lispintro\makefile\r
-if not exist ..\lisp\Makefile.unix rename ..\lisp\Makefile.in Makefile.unix\r
if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile\r
copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile\r
rem Use the default (no-op) Makefile.in if the nt version is not present.\r
\r
Rem Some people use WinZip which doesn't create empty directories!\r
if not exist ..\site-lisp\nul mkdir ..\site-lisp\\r
-if not exist ..\site-lisp\subdirs.el copy subdirs.el ..\site-lisp\subdirs.el\r
-\r
+Rem Update subdirs.el only if it is different or fc.exe doesn't work.\r
+if exist foo.bar del foo.bar\r
+fc /b foo.bar foo.bar >nul 2>&1\r
+if not errorlevel 2 goto doUpdateSubdirs\r
+fc /b subdirs.el ..\site-lisp\subdirs.el >nul 2>&1\r
+if not errorlevel 1 goto dontUpdateSubdirs\r
+:doUpdateSubdirs\r
+if exist ..\site-lisp\subdirs.el del ..\site-lisp\subdirs.el\r
+copy subdirs.el ..\site-lisp\subdirs.el\r
+\r
+:dontUpdateSubdirs\r
echo.\r
echo Emacs successfully configured.\r
echo Emacs successfully configured. >>config.log\r