automake-patches
[Top][All Lists]
Advanced

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

Re: depcomp deficiency


From: Ralf Wildenhues
Subject: Re: depcomp deficiency
Date: Sat, 14 Oct 2006 19:10:47 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

* Alexandre Duret-Lutz wrote on Sat, Oct 14, 2006 at 04:54:46PM CEST:
> >>> "RW" == Ralf Wildenhues <address@hidden> writes:

>  RW> - For aesthetics, it is desirable to have the source file name appear at
>  RW> the end of the command lines at compile time
>  RW> (see the comment in automake/lib/am/depend2.am for a rationale).
> 
> Plus some tools (like libtool) assume that the last argument is
> the source file.

Oh, yes (strictly speaking, at least).  Thanks.

>  RW> - The gcc3 depmode, when issued with help of the `depcomp' script, will
>  RW> be slowed down somewhat now.  This isn't really an issue for makefiles
>  RW> generated by Automake, as they bypass the script at compile time with
>  RW> the %FASTDEP% switch. 
> 
> Agreed.  Could you add a short comment in depcomp's gcc3 mode to
> explain that while you are at it?

Done, applied like this.

Cheers,
Ralf

2006-10-14  Ralf Wildenhues  <address@hidden>

        * lib/depcomp (gcc3): Put dependency extraction flags before the
        `-c' flag, so they appear at the same position as in %FASTDEP%
        mode in depend2.am.  Fixes build failure for FreeBSD's c89,
        which ignores unknown options only after the first non-option.
        Bug report against M4 by Nelson H. F. Beebe.

Index: lib/depcomp
===================================================================
RCS file: /cvs/automake/automake/lib/depcomp,v
retrieving revision 1.58
diff -u -r1.58 depcomp
--- lib/depcomp 9 Jul 2006 16:09:43 -0000       1.58
+++ lib/depcomp 14 Oct 2006 17:10:08 -0000
@@ -92,7 +92,20 @@
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
   stat=$?
   if test $stat -eq 0; then :
   else




reply via email to

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