emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112322: Replace AC_PROG_LN_S by a le


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112322: Replace AC_PROG_LN_S by a less strict configure test
Date: Wed, 17 Apr 2013 22:03:53 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112322
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2013-04-17 22:03:53 -0700
message:
  Replace AC_PROG_LN_S by a less strict configure test
  
  * configure.ac (AC_PROG_LN_S): Remove, too restrictive.
  (LN_S_FILEONLY): New output variable.
  * Makefile.in (LN_S): Remove.
  (LN_S_FILEONLY): New, set by configure.
  (install-arch-dep): Use LN_S_FILEONLY rather than LN_S.
modified:
  ChangeLog
  Makefile.in
  configure.ac
=== modified file 'ChangeLog'
--- a/ChangeLog 2013-04-12 13:00:57 +0000
+++ b/ChangeLog 2013-04-18 05:03:53 +0000
@@ -1,3 +1,11 @@
+2013-04-18  Glenn Morris  <address@hidden>
+
+       * configure.ac (AC_PROG_LN_S): Remove, too restrictive.
+       (LN_S_FILEONLY): New output variable.
+       * Makefile.in (LN_S): Remove.
+       (LN_S_FILEONLY): New, set by configure.
+       (install-arch-dep): Use LN_S_FILEONLY rather than LN_S.
+
 2013-04-12  Ken Brown  <address@hidden>
 
        * configure.ac (canonical): Adapt to 64-bit Cygwin, for which

=== modified file 'Makefile.in'
--- a/Makefile.in       2013-03-18 21:02:34 +0000
+++ b/Makefile.in       2013-04-18 05:03:53 +0000
@@ -253,7 +253,8 @@
 # By default, we uphold the dignity of our programs.
 INSTALL_STRIP =
 MKDIR_P = @MKDIR_P@
-LN_S = @LN_S@
+# Create a link to a file in the same directory as the target.
+LN_S_FILEONLY = @LN_S_FILEONLY@
 
 # We use gzip to compress installed .el files.
 GZIP_PROG = @GZIP_PROG@
@@ -455,7 +456,7 @@
          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); \
+           cd $(DESTDIR)${bindir} && $(LN_S_FILEONLY) $(EMACSFULL) $(EMACS); \
          fi; \
        else \
          subdir=${ns_appresdir}/site-lisp; \

=== modified file 'configure.ac'
--- a/configure.ac      2013-04-12 13:00:57 +0000
+++ b/configure.ac      2013-04-18 05:03:53 +0000
@@ -799,7 +799,38 @@
 dnl if test "x$RANLIB" = x; then
 dnl   AC_PROG_RANLIB
 dnl fi
-AC_PROG_LN_S
+
+
+dnl Sadly, AC_PROG_LN_S is too restrictive.  It also tests whether links
+dnl can be made to directories.  This is not relevant for our usage, and
+dnl excludes some cases that work fine for us.  Eg MS Windows or files
+dnl hosted on AFS, both examples where simple links work, but links to
+dnl directories fail.  We use a cut-down version instead.
+dnl AC_PROG_LN_S
+
+AC_MSG_CHECKING([whether ln -s works for files in the same directory])
+rm -f conf$$ conf$$.file
+
+LN_S_FILEONLY='cp -p'
+
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    LN_S_FILEONLY='ln -s'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    LN_S_FILEONLY=ln
+  fi
+fi
+
+rm -f conf$$ conf$$.file
+
+if test "$LN_S_FILEONLY" = "ln -s"; then
+   AC_MSG_RESULT([yes])
+else
+   AC_MSG_RESULT([no, using $LN_S_FILEONLY])
+fi
+
+AC_SUBST(LN_S_FILEONLY)
+
 
 AC_PATH_PROG(INSTALL_INFO, install-info, :,
   $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]