From: Akim Demaille Date: Mon, 22 Jan 2001 19:21:58 +0000 (+0000) Subject: * acspecific.m4 (AC_PROG_LN_S): Detect DJGPP < 2.04, which only X-Git-Tag: autoconf-2.50~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58135fd6dc3c8d68306da8d2bd3cf2f08f5a9e16;p=thirdparty%2Fautoconf.git * acspecific.m4 (AC_PROG_LN_S): Detect DJGPP < 2.04, which only supports 'ln -s' for executables. --- diff --git a/ChangeLog b/ChangeLog index 43419e53b..21626002b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-01-22 Tim Van Holder + + * acspecific.m4 (AC_PROG_LN_S): Detect DJGPP < 2.04, which only + supports 'ln -s' for executables. + 2001-01-22 Akim Demaille * autoscan.pl ($dir, $autoconf): New. diff --git a/acspecific.m4 b/acspecific.m4 index f223ae59e..d4194f7b8 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -269,16 +269,25 @@ AC_SUBST(INSTALL_DATA)dnl AC_DEFUN([AC_PROG_LN_S], [AC_MSG_CHECKING([whether ln -s works]) AC_CACHE_VAL(ac_cv_prog_LN_S, -[rm -f conftest.sym conftest.file +[rm -f conftest conftest.exe conftest.file echo >conftest.file -if ln -s conftest.file conftest.sym 2>/dev/null; then - ac_cv_prog_LN_S="ln -s" -elif ln conftest.file conftest.sym 2>/dev/null; then +dnl Don't use conftest.sym to avoid filename issues on DJGPP, where this +dnl would yield conftest.sym.exe for DJGPP < 2.04. +if ln -s conftest.file conftest 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conftest.exe; then + ac_cv_prog_LN_S="cp -p" # Don't use ln at all; we don't have any links + else + ac_cv_prog_LN_S="ln -s" + fi +elif ln conftest.file conftest 2>/dev/null; then ac_cv_prog_LN_S=ln else ac_cv_prog_LN_S=cp fi -rm -f conftest.sym conftest.file])dnl +rm -f conftest conftest.exe conftest.file])dnl +ac_ln_s=$ac_cv_prog_LN_S AC_SUBST([LN_S], [$ac_cv_prog_LN_S]) if test "$ac_cv_prog_LN_S" = "ln -s"; then AC_MSG_RESULT([yes]) diff --git a/doc/autoconf.texi b/doc/autoconf.texi index abe0ef40d..d02692dc1 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -6287,12 +6287,13 @@ alternation and @code{egrep}. Don't rely on @command{ln} having a @option{-f} option. Symbolic links are not available on old systems, use @samp{ln} as a fall back. -The @sc{djgpp} @command{ln} emulates soft links for executables by -generating a stub that in turn calls the real program. This feature -also works with nonexistent files like in the Unix spec. So @samp{ln -s -src dst} will generate @file{src.exe} which will attempt to call -@file{dst.exe}. But this feature only works for executables, therefore, -don't rely on symbolic links on @sc{djgpp}. +For versions of the @sc{djgpp} before 2.04, @command{ln} emulates soft +links for executables by generating a stub that in turn calls the real +program. This feature also works with nonexistent files like in the +Unix spec. So @samp{ln -s src dst} will generate @file{src.exe}, which +will attempt to call @file{dst.exe} if run. But this feature only works +for executables, so @command{cp} @option{-p} is used instead for these +systems. @sc{djgpp} version 2.04 and later have full symlink support. @item @command{mv} diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index f223ae59e..d4194f7b8 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -269,16 +269,25 @@ AC_SUBST(INSTALL_DATA)dnl AC_DEFUN([AC_PROG_LN_S], [AC_MSG_CHECKING([whether ln -s works]) AC_CACHE_VAL(ac_cv_prog_LN_S, -[rm -f conftest.sym conftest.file +[rm -f conftest conftest.exe conftest.file echo >conftest.file -if ln -s conftest.file conftest.sym 2>/dev/null; then - ac_cv_prog_LN_S="ln -s" -elif ln conftest.file conftest.sym 2>/dev/null; then +dnl Don't use conftest.sym to avoid filename issues on DJGPP, where this +dnl would yield conftest.sym.exe for DJGPP < 2.04. +if ln -s conftest.file conftest 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conftest.exe; then + ac_cv_prog_LN_S="cp -p" # Don't use ln at all; we don't have any links + else + ac_cv_prog_LN_S="ln -s" + fi +elif ln conftest.file conftest 2>/dev/null; then ac_cv_prog_LN_S=ln else ac_cv_prog_LN_S=cp fi -rm -f conftest.sym conftest.file])dnl +rm -f conftest conftest.exe conftest.file])dnl +ac_ln_s=$ac_cv_prog_LN_S AC_SUBST([LN_S], [$ac_cv_prog_LN_S]) if test "$ac_cv_prog_LN_S" = "ln -s"; then AC_MSG_RESULT([yes])