From: Eli Zaretskii <eliz@gnu.org>
To: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
Cc: 11578-done@debbugs.gnu.org
Subject: bug#11578: 24.1.50; Can't 'make install' on Windows
Date: Tue, 29 May 2012 18:57:29 +0300 [thread overview]
Message-ID: <837gvv2d5i.fsf@gnu.org> (raw)
In-Reply-To: <20120529140342.03EA134803A@msa103.auone-net.jp>
> Date: Tue, 29 May 2012 23:03:37 +0900
> From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
>
> When I run configure.bat with --prefix option, 'make install' with
> MinGW fails.
>
> > make: Circular D:/bin/emacs_trunk <- D:/bin/emacs_trunk dependency dropped.
> > make -C ../lib-src install
> > [Please ignore a syntax error on the next line - it is intentional]
> > /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
> > /bin/sh: -c: line 1: syntax error: unexpected end of file
> > make[1]: Entering directory `/f/build/emacs-trunk/lib-src'
> > mkdir "D:/bin/emacs_trunk /bin"
> > mkdir: cannot create directory `D:/bin/emacs_trunk /bin': No such file or directory
> > make[1]: [install] Error 1 (ignored)
> > cp -f oo-spd/i386/etags.exe D:/bin/emacs_trunk /bin
> > cp: omitting directory `D:/bin/emacs_trunk'
> > make[1]: *** [install] Error 1
> > make[1]: Leaving directory `/f/build/emacs-trunk/lib-src'
> > make: *** [install-other-dirs-gmake] Error 2
This was reported to me yesterday off-list, and I fixed it on the
emacs-24 branch in revision 108019. The patch is below, if you cannot
wait for the next merge from emacs-24 to the trunk.
> In the above, 'D:/bin/emacs_trunk' is argument of --prefix option. It
> seems that makefile.w32-in does not assume INSTALL_DIR has trailing
> space.
No, the problem is a subtlety of the cmd.exe "echo" command. If you
say
echo foo=bar >>file
the blank between "bar" and the redirection symbol winds up in the
file. The fix for that, which doesn't re-introduce a different, but
related bug fixed in r108005, is somewhat tricky, as you see below.
A workaround is not to use --prefix at configure time and instead set
INSTALL_DIR at "make install" time, like this:
make install INSTALL_DIR=d:/bin/emacs_trunk
(If you are installing in the source tree, you need neither --prefix
nor INSTALL_DIR= at "make install" time, since that's the default
INSTALL_DIR anyway.)
=== modified file 'nt/ChangeLog'
--- nt/ChangeLog 2012-05-18 08:21:19 +0000
+++ nt/ChangeLog 2012-05-28 16:17:35 +0000
@@ -1,3 +1,12 @@
+2012-05-28 Eli Zaretskii <eliz@gnu.org>
+
+ * 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.
+
2012-05-18 Eli Zaretskii <eliz@gnu.org>
* configure.bat: Ensure a space between %var% expansion and
=== modified file 'nt/configure.bat'
--- nt/configure.bat 2012-05-18 08:21:19 +0000
+++ nt/configure.bat 2012-05-28 16:17:35 +0000
@@ -721,29 +721,36 @@ 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
+rem The weird place we put the redirection is to make sure no extra
+rem whitespace winds up at the end of the Make variables, since some
+rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will
+rem write the blanks between the end of command arguments and the
+rem redirection symbol to the file. OTOH, we cannot put the
+rem redirection immediately after the last character of the command,
+rem because environment variable expansion can yield a digit there,
+rem which will then be misinterpreted as the file descriptor to
+rem redirect...
echo # Start of settings from configure.bat >config.settings
-echo COMPILER=%COMPILER% >>config.settings
-if not "(%mf%)" == "()" echo MCPU_FLAG=%mf% >>config.settings
-if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo% >>config.settings
-if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings
-if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
-if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings
-if (%profile%) == (Y) echo PROFILE=1 >>config.settings
-if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
-if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix% >>config.settings
-if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles% >>config.settings
+>>config.settings echo COMPILER=%COMPILER%
+if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf%
+if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo%
+if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1
+if (%noopt%) == (Y) >>config.settings echo NOOPT=1
+if (%enablechecking%) == (Y) >>config.settings echo ENABLECHECKS=1
+if (%profile%) == (Y) >>config.settings echo PROFILE=1
+if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1
+if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix%
+if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles%
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
-if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags% >>config.settings
+if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags%
+if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags%
for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
-if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags% >>config.settings
+if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags%
for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y
-if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs% >>config.settings
+if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs%
echo # End of settings from configure.bat>>config.settings
echo. >>config.settings
prev parent reply other threads:[~2012-05-29 15:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-29 14:03 bug#11578: 24.1.50; Can't 'make install' on Windows Kazuhiro Ito
2012-05-29 15:57 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=837gvv2d5i.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=11578-done@debbugs.gnu.org \
--cc=kzhr@d1.dion.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).