autoconf-patches
[Top][All Lists]
Advanced

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

Re: autoconf and OS/2


From: Tim Van Holder
Subject: Re: autoconf and OS/2
Date: Sun, 30 Sep 2001 16:46:38 +0200

> Tim, would you write a AS_LN_S please?  Please, pay attention to the
> very special semantics of ln -s some/path an/other.  See
> AC_OUTPUT_LINKS for what must be done.

How's this?
I assume 'case ... esac || echo foo' is portable, i.e. errors are
properly propagated in all shells?

2001/09/30  Tim Van Holder  <address@hidden>

        * lib/m4sugar/m4sh.m4 (AS_LN_S): Invoke 'cp -p' using ln
        semantics.
        (_AS_LN_S_PREPARE): Fall back on 'ln' instead of 'cp -p' for
        DJGPP, to avoid the extra magic in AS_LN_S.
        * lib/autoconf/status.m4 (_AC_OUTPUT_LINKS): Use AS_LN_S.

Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvs/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.51
diff -u -r1.51 m4sh.m4
--- lib/m4sugar/m4sh.m4 2001/09/27 08:27:55     1.51
+++ lib/m4sugar/m4sh.m4 2001/09/30 14:29:18
@@ -451,6 +451,8 @@
 # would yield conftest.sym.exe for DJGPP < 2.04.  And don't use
`conftest'
 # as base name to avoid prohibiting concurrency (e.g., concurrent
 # config.statuses).
+# Note: any possible setting for $as_ln_s must have a corresponding
entry
+# in AS_LN_S.
 m4_defun([_AS_LN_S_PREPARE],
 [rm -f conf$$ conf$$.exe conf$$.file
 echo >conf$$.file
@@ -458,13 +460,14 @@
   # 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 conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
+    # Plain ln makes a copy, so we can use that and avoid the extra
magic in
+    # AS_LN_S
+    as_ln_s='ln'
   else
     as_ln_s='ln -s'
   fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  as_ln_s='ln'
 else
   as_ln_s='cp -p'
 fi
@@ -521,7 +524,11 @@
 # simulated with `ln' or `cp'?
 m4_defun([AS_LN_S],
 [m4_require([_AS_LN_S_PREPARE])dnl
-$as_ln_s $1 $2
+case "$as_ln_s" in
+ 'ln' | 'ln -s') $as_ln_s $1 $2;;
+ 'cp -p') $as_ln_s AS_DIRNAME($2)/$1 $2;;
+ *) AS_ERROR([[AS_LN_S] is not set up to handle `$as_ln_s' yet])
+esac
 ])
 
 Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvs/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.11
diff -u -r1.11 status.m4
--- lib/autoconf/status.m4      2001/09/23 17:17:47     1.11
+++ lib/autoconf/status.m4      2001/09/30 14:29:17
@@ -762,9 +762,7 @@
       *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
   esac
 
-  # Make a symlink if possible; otherwise try a hard link.
-  ln -s $ac_rel_source $ac_dest 2>/dev/null ||
-    ln $srcdir/$ac_source $ac_dest ||
+  AS_LN_S($ac_rel_source $ac_dest) ||
     AC_MSG_ERROR([cannot link $ac_dest to $srcdir/$ac_source])
 m4_ifset([AC_LIST_LINKS_COMMANDS],
 [  # Run the commands associated with the file.




reply via email to

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