Subject: bug#10261: 24.0.92; The "dist" makefile target & the "--distfiles" configure option

From: Dani Moncayo <[email-masked]>
Date: Fri, 23 Mar 2012 19:59:38 +0100

Hi,

In this bug report, the "dist" target of the nt/makefile was fixed
because it failed when no --distfiles argument was given to configure
(it always tried to run the "cp" command, and in this case failed).

Well, now I've tried to build Emacs in my system, but this time giving
a --distfiles argument to configure (for including the libXpm.dll in
the binary distribution).

I've found that the zip file has been generated without errors, but
the dll file has not been included in the "bin" subdirectory.

After doing a few experiments, I've found that the problem is in the
"maybe-copy-distfiles-SH" target.  Currently the target is defined
like this:
-------------------------
maybe-copy-distfiles-SH: doit

	@if [ ! $(ARGQUOTE)$(DIST_FILES)$(ARGQUOTE)=="" ] ; then \

	  $(CP_DIR) $(DIST_FILES) $(TMP_DIST_DIR)/bin ; \

	fi
-------------------------

and I've seen that the "if" condition never evaluates to true, so that
my distfiles are never copied to the bin subdirectory (regardless of
the value of DIST_FILES).

I think I've found a solution (I've tested it): write the "if"
condition like this:
   if [ -n $(ARGQUOTE)$(DIST_FILES)$(ARGQUOTE) ] ; then \

This is the corresponding patch:

=== modified file 'nt/makefile.w32-in'
--- nt/makefile.w32-in  2012-02-27 03:20:00 +0000
+++ nt/makefile.w32-in  2012-03-23 18:57:00 +0000
@@ -263,7 +263,7 @@
        @if not $(ARGQUOTE)$(DIST_FILES)$(ARGQUOTE)=="" $(CP_DIR)
$(DIST_FILES) $(TMP_DIST_DIR)/bin

 maybe-copy-distfiles-SH: doit
-       @if [ ! $(ARGQUOTE)$(DIST_FILES)$(ARGQUOTE)=="" ] ; then \
+       @if [ -n $(ARGQUOTE)$(DIST_FILES)$(ARGQUOTE) ] ; then \
          $(CP_DIR) $(DIST_FILES) $(TMP_DIST_DIR)/bin ; \
        fi

Do you find it correct?  If so, please install it.

Thanks.

-- 
Dani Moncayo