* lib/am/depend2.am (%FASTDEP%): Put dependency extraction flags at the end of the command line, for FreeBSD's c89. Bug report against M4 by Nelson H. F. Beebe. Index: lib/am/depend2.am =================================================================== RCS file: /cvs/automake/automake/lib/am/depend2.am,v retrieving revision 1.61 diff -u -r1.61 depend2.am --- lib/am/depend2.am 31 Aug 2006 04:49:24 -0000 1.61 +++ lib/am/depend2.am 27 Sep 2006 16:49:07 -0000 @@ -57,7 +57,9 @@ ## would be a good compromise. Actually we use two line rather than one, ## because this way %SOURCE% is always located at the end of the first ## line and is therefore easier to spot. (We need an extra line when -## depbase is used.) +## depbase is used.) Unfortunately, FreeBSD's c89 errors out if the +## -M flags (of gcc3 depmode) appear before the source file name, +## so we can't use that in this case. if %?NONLIBTOOL% ?GENERIC?%EXT%.o: @@ -65,10 +67,10 @@ if %FASTDEP% ## In fast-dep mode, we can always use -o. ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%. -?!GENERIC? %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -?GENERIC??!SUBDIROBJ? %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCE% +?!GENERIC? %COMPILE% %-c% -o %OBJ% `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo +?GENERIC??!SUBDIROBJ? %COMPILE% %-c% -o %OBJ% %SOURCE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo ?GENERIC??SUBDIROBJ? depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCE% &&\ +?GENERIC??SUBDIROBJ? %COMPILE% %-c% -o %OBJ% %SOURCE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo &&\ mv -f %DEPBASE%.Tpo %DEPBASE%.Po else !%FASTDEP% if %AMDEP% @@ -90,10 +92,10 @@ if %FASTDEP% ## In fast-dep mode, we can always use -o. ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%. -?!GENERIC? %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi` -?GENERIC??!SUBDIROBJ? %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `$(CYGPATH_W) '%SOURCE%'` +?!GENERIC? %COMPILE% %-c% -o %OBJOBJ% `if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi` -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo +?GENERIC??!SUBDIROBJ? %COMPILE% %-c% -o %OBJOBJ% `$(CYGPATH_W) '%SOURCE%'` -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo ?GENERIC??SUBDIROBJ? depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `$(CYGPATH_W) '%SOURCE%'` &&\ +?GENERIC??SUBDIROBJ? %COMPILE% %-c% -o %OBJOBJ% `$(CYGPATH_W) '%SOURCE%'` -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo &&\ mv -f %DEPBASE%.Tpo %DEPBASE%.Po else !%FASTDEP% if %AMDEP% @@ -117,10 +119,10 @@ if %FASTDEP% ## In fast-dep mode, we can always use -o. ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%. -?!GENERIC? %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -?GENERIC??!SUBDIROBJ? %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCE% +?!GENERIC? %LTCOMPILE% %-c% -o %LTOBJ% `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo +?GENERIC??!SUBDIROBJ? %LTCOMPILE% %-c% -o %LTOBJ% %SOURCE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo ?GENERIC??SUBDIROBJ? depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -?GENERIC??SUBDIROBJ? %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCE% &&\ +?GENERIC??SUBDIROBJ? %LTCOMPILE% %-c% -o %LTOBJ% %SOURCE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo &&\ mv -f %DEPBASE%.Tpo %DEPBASE%.Plo else !%FASTDEP% if %AMDEP%