echo # End of settings from configure.bat>>config.settings\r
echo. >>config.settings\r
\r
-copy config.nt ..\src\config.h\r
-echo. >>..\src\config.h\r
-echo /* Start of settings from configure.bat. */ >>..\src\config.h\r
-if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h\r
-if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h\r
-if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h\r
-if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h\r
-if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h\r
-if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h\r
-if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>..\src\config.h\r
-echo /* End of settings from configure.bat. */ >>..\src\config.h\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 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
+if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp\r
+if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp\r
+echo /* End of settings from configure.bat. */ >>config.tmp\r
+\r
+Rem See if fc.exe returns a meaningful exit status. If it does, we\r
+Rem might as well avoid unnecessary overwriting of config.h and epaths.h,\r
+Rem since this forces recompilation of every source file.\r
+if exist foo.bar del foo.bar\r
+fc /b foo.bar foo.bar >nul 2>&1\r
+if not errorlevel 2 goto doCopy\r
+fc /b config.tmp ..\src\config.h >nul 2>&1\r
+if errorlevel 1 goto doCopy\r
+fc /b paths.h ..\src\epaths.h >nul 2>&1\r
+if errorlevel 0 goto dontCopy\r
+:doCopy\r
+copy config.tmp ..\src\config.h\r
copy paths.h ..\src\epaths.h\r
\r
+:dontCopy\r
+if exist config.tmp del config.tmp\r
copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r
copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r
copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r