aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2012-05-28 19:17:35 +0300
committerEli Zaretskii2012-05-28 19:17:35 +0300
commite383e32d7a00bf286db1dc6b05b6219f0eaab8dc (patch)
tree6fa3e4d1e1be554159b0819687701b7e27a9dfd5
parent5221ccb96e8dde4c0c3164f9517aa7b54e539d0d (diff)
downloademacs-e383e32d7a00bf286db1dc6b05b6219f0eaab8dc.tar.gz
emacs-e383e32d7a00bf286db1dc6b05b6219f0eaab8dc.zip
Fix subtle problem with redirection in nt/configure.bat.
nt/configure.bat (genmakefiles): Move the redirection away from the end of the command, to avoid excess whitespace at the end of Make variables created at configure time, and also avoid things like "FOO1>>config.settings", where "1" gets interpreted as the file descriptor and eaten up. This fixes breakage introduced by the last change, without reintroducing the bug fixed by that change.
-rw-r--r--nt/ChangeLog9
-rwxr-xr-xnt/configure.bat39
2 files changed, 32 insertions, 16 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 15516c891cd..245f6b578f1 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,12 @@
12012-05-28 Eli Zaretskii <eliz@gnu.org>
2
3 * configure.bat (genmakefiles): Move the redirection away from the
4 end of the command, to avoid excess whitespace at the end of Make
5 variables created at configure time, and also avoid things like
6 "FOO1>>config.settings", where "1" gets interpreted as the file
7 descriptor and eaten up. This fixes breakage introduced by the
8 last change, without reintroducing the bug fixed by that change.
9
12012-05-18 Eli Zaretskii <eliz@gnu.org> 102012-05-18 Eli Zaretskii <eliz@gnu.org>
2 11
3 * configure.bat: Ensure a space between %var% expansion and 12 * configure.bat: Ensure a space between %var% expansion and
diff --git a/nt/configure.bat b/nt/configure.bat
index caee800bacf..91c5c3fa0bb 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -721,29 +721,36 @@ if %COMPILER% == gcc set MAKECMD=gmake
721if %COMPILER% == cl set MAKECMD=nmake 721if %COMPILER% == cl set MAKECMD=nmake
722 722
723rem Pass on chosen settings to makefiles. 723rem Pass on chosen settings to makefiles.
724rem NB. Be very careful to not have a space before redirection symbols
725rem except when there is a preceding digit, when a space is required.
726rem 724rem
725rem The weird place we put the redirection is to make sure no extra
726rem whitespace winds up at the end of the Make variables, since some
727rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will
728rem write the blanks between the end of command arguments and the
729rem redirection symbol to the file. OTOH, we cannot put the
730rem redirection immediately after the last character of the command,
731rem because environment variable expansion can yield a digit there,
732rem which will then be misinterpreted as the file descriptor to
733rem redirect...
727echo # Start of settings from configure.bat >config.settings 734echo # Start of settings from configure.bat >config.settings
728echo COMPILER=%COMPILER% >>config.settings 735>>config.settings echo COMPILER=%COMPILER%
729if not "(%mf%)" == "()" echo MCPU_FLAG=%mf% >>config.settings 736if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf%
730if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo% >>config.settings 737if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo%
731if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings 738if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1
732if (%noopt%) == (Y) echo NOOPT=1 >>config.settings 739if (%noopt%) == (Y) >>config.settings echo NOOPT=1
733if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings 740if (%enablechecking%) == (Y) >>config.settings echo ENABLECHECKS=1
734if (%profile%) == (Y) echo PROFILE=1 >>config.settings 741if (%profile%) == (Y) >>config.settings echo PROFILE=1
735if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings 742if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1
736if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix% >>config.settings 743if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix%
737if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles% >>config.settings 744if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles%
738rem We go thru docflags because usercflags could be "-DFOO=bar" -something 745rem We go thru docflags because usercflags could be "-DFOO=bar" -something
739rem and the if command cannot cope with this 746rem and the if command cannot cope with this
740for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y 747for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
741if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags% >>config.settings 748if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags%
742if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags% >>config.settings 749if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags%
743for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y 750for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
744if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags% >>config.settings 751if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags%
745for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y 752for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y
746if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs% >>config.settings 753if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs%
747echo # End of settings from configure.bat>>config.settings 754echo # End of settings from configure.bat>>config.settings
748echo. >>config.settings 755echo. >>config.settings
749 756