* 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 27 Sep 2006 16:49:19 -0000 @@ -90,9 +90,21 @@ case "$depmode" in 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: + 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