From: Glenn Morris Date: Thu, 18 Apr 2013 05:03:53 +0000 (-0700) Subject: Replace AC_PROG_LN_S by a less strict configure test X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~433 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4f8902cd02ff6c182dddf5217d2683cb6abdb728;p=emacs.git 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. --- diff --git a/ChangeLog b/ChangeLog index f8a3a5e0cca..573a8021eeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-04-18 Glenn Morris + + * 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 * configure.ac (canonical): Adapt to 64-bit Cygwin, for which diff --git a/Makefile.in b/Makefile.in index bd77fa6a70d..019460acf3c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -253,7 +253,8 @@ INSTALL_INFO = @INSTALL_INFO@ # 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 @@ install-arch-dep: src install-arch-indep install-doc 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; \ diff --git a/configure.ac b/configure.ac index c95072423b5..39a0477a693 100644 --- a/configure.ac +++ b/configure.ac @@ -799,7 +799,38 @@ dnl AC_PROG_MKDIR_P 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)