diff options
| author | Eli Zaretskii | 2012-05-28 19:17:35 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-05-28 19:17:35 +0300 |
| commit | e383e32d7a00bf286db1dc6b05b6219f0eaab8dc (patch) | |
| tree | 6fa3e4d1e1be554159b0819687701b7e27a9dfd5 /nt | |
| parent | 5221ccb96e8dde4c0c3164f9517aa7b54e539d0d (diff) | |
| download | emacs-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.
Diffstat (limited to 'nt')
| -rw-r--r-- | nt/ChangeLog | 9 | ||||
| -rwxr-xr-x | nt/configure.bat | 39 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-05-18 Eli Zaretskii <eliz@gnu.org> | 10 | 2012-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 | |||
| 721 | if %COMPILER% == cl set MAKECMD=nmake | 721 | if %COMPILER% == cl set MAKECMD=nmake |
| 722 | 722 | ||
| 723 | rem Pass on chosen settings to makefiles. | 723 | rem Pass on chosen settings to makefiles. |
| 724 | rem NB. Be very careful to not have a space before redirection symbols | ||
| 725 | rem except when there is a preceding digit, when a space is required. | ||
| 726 | rem | 724 | rem |
| 725 | rem The weird place we put the redirection is to make sure no extra | ||
| 726 | rem whitespace winds up at the end of the Make variables, since some | ||
| 727 | rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will | ||
| 728 | rem write the blanks between the end of command arguments and the | ||
| 729 | rem redirection symbol to the file. OTOH, we cannot put the | ||
| 730 | rem redirection immediately after the last character of the command, | ||
| 731 | rem because environment variable expansion can yield a digit there, | ||
| 732 | rem which will then be misinterpreted as the file descriptor to | ||
| 733 | rem redirect... | ||
| 727 | echo # Start of settings from configure.bat >config.settings | 734 | echo # Start of settings from configure.bat >config.settings |
| 728 | echo COMPILER=%COMPILER% >>config.settings | 735 | >>config.settings echo COMPILER=%COMPILER% |
| 729 | if not "(%mf%)" == "()" echo MCPU_FLAG=%mf% >>config.settings | 736 | if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf% |
| 730 | if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo% >>config.settings | 737 | if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo% |
| 731 | if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings | 738 | if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1 |
| 732 | if (%noopt%) == (Y) echo NOOPT=1 >>config.settings | 739 | if (%noopt%) == (Y) >>config.settings echo NOOPT=1 |
| 733 | if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings | 740 | if (%enablechecking%) == (Y) >>config.settings echo ENABLECHECKS=1 |
| 734 | if (%profile%) == (Y) echo PROFILE=1 >>config.settings | 741 | if (%profile%) == (Y) >>config.settings echo PROFILE=1 |
| 735 | if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings | 742 | if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1 |
| 736 | if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix% >>config.settings | 743 | if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix% |
| 737 | if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles% >>config.settings | 744 | if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles% |
| 738 | rem We go thru docflags because usercflags could be "-DFOO=bar" -something | 745 | rem We go thru docflags because usercflags could be "-DFOO=bar" -something |
| 739 | rem and the if command cannot cope with this | 746 | rem and the if command cannot cope with this |
| 740 | for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y | 747 | for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y |
| 741 | if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags% >>config.settings | 748 | if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags% |
| 742 | if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags% >>config.settings | 749 | if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags% |
| 743 | for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y | 750 | for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y |
| 744 | if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags% >>config.settings | 751 | if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags% |
| 745 | for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y | 752 | for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y |
| 746 | if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs% >>config.settings | 753 | if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs% |
| 747 | echo # End of settings from configure.bat>>config.settings | 754 | echo # End of settings from configure.bat>>config.settings |
| 748 | echo. >>config.settings | 755 | echo. >>config.settings |
| 749 | 756 | ||