Subject: bug#13233: [PATCH] Fix make install (ignore error with chmod 1755)

From: "Akinori MUSHA" <[email-masked]>
Date: Thu, 20 Dec 2012 14:52:22 +0900

On FreeBSD, "make install" stops with an error at the almost final
command, which can be fixed by the attached patch.  I found this
problem on the emacs-24 branch but the situation is the same on the
trunk.

The chmod command line used to be guarded with a `-' prefix, but it
was lost when the block was rewritten to a shell command block in the
following commit:

	http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/108256

% make install
(...)
if test "no" = "no"; then  /usr/bin/install -c  src/emacs /home/knu/arch/freebsd9/mach/amd64/bin/`echo emacs-24.2.91 | sed 's,x,x,'` || exit 1 ;  chmod 1755 /home/knu/arch/freebsd9/mach/amd64/bin/`echo emacs-24.2.91 | sed 's,x,x,'` ;  if test "x" = x; then  rm -f /home/knu/arch/freebsd9/mach/amd64/bin/`echo emacs | sed 's,x,x,'` ;  cd /home/knu/arch/freebsd9/mach/amd64/bin && ln -s `echo emacs-24.2.91 | sed 's,x,x,'` `echo emacs | sed 's,x,x,'`;  fi;  else  subdir=/site-lisp;  if [ -f ${subdir}/subdirs.el ];  then true;  else  umask 022;  /usr/local/bin/gmkdir -p ${subdir};  (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)";  echo "    (normal-top-level-add-subdirs-to-load-path))")  > ${subdir}/subdirs.el;  fi || exit 1;  rm -rf /share;  fi
chmod: /home/knu/arch/freebsd9/mach/amd64/bin/emacs-24.2.91: Inappropriate file type or format
*** [install-arch-dep] Error code 1

Stop in /home/knu/src/github/emacs/.build.freebsd9-amd64.

---
 ChangeLog   | 6 ++++++
 Makefile.in | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 1d6a2af..4224806 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-20  Akinori MUSHA  <[email-masked]>
+
+	* Makefile.in (install-arch-dep): Ignore error in trying to set a
+	sticky bit on an emacs executable.  Chmod 1755 on a regular file
+	fails on such platforms as FreeBSD.
+
 2012-12-16  Romain Francoise  <[email-masked]>
 
 	* configure.ac (acl): New option.
diff --git a/Makefile.in b/Makefile.in
index bc9b01c..1e3966f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -445,7 +445,7 @@ install-arch-dep: src install-arch-indep install-doc
 	    INSTALL_STRIP=${INSTALL_STRIP}
 	if test "${ns_self_contained}" = "no"; then \
 	  ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL) || exit 1 ; \
-	  chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) ; \
+	  chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) || true ; \
 	  if test "x${NO_BIN_LINK}" = x; then \
 	    rm -f $(DESTDIR)${bindir}/$(EMACS) ; \
 	    cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \
-- 
1.8.0.2

-- 
Akinori MUSHA / http://akinori.org/