]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/depcomp (gcc3): Put dependency extraction flags before the
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Oct 2006 17:10:39 +0000 (17:10 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Oct 2006 17:10:39 +0000 (17:10 +0000)
`-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.

ChangeLog
lib/depcomp

index 6040559b75b445834a0b643b7730003d7f43722f..0c94bb5107c9a18be451eb1f943e5b9e66a116d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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.
+
 2006-10-14  Bruno Haible  <bruno@clisp.org>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
index ffe5461bdead5741ab8de333fb015a950d090a0d..7d409372d7d37c9fd35052f1b11623517e15c1be 100755 (executable)
@@ -92,7 +92,20 @@ gcc3)
 ## 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