* Ralf Wildenhues wrote on Wed, Jan 04, 2006 at 08:10:11PM CET: > > Below, there's also a hack for depmodes hp/gcc to not output `foo.c :' > lines. It's a hack because `grep -v "^$source$"' is bad when $source > contains regex-active characters, but was the simplest I could come up > with. Better suggestions welcome. The tests expose the failure on > HPUX non-ia64.
Maybe better like this? The rationale is: backslashes are only necessary on w32 systems, `echo' there usually does not interpret them, and `read -r' usually works there. Not really sure though what I'd prefer. Most likely isn't much of an issue except for `hp' depmode: the majority of users will already use a gcc which can do `gcc3' depmode. Cheers, Ralf > * lib/depcomp (hp, gcc depmode): Do not output a dummy > dependency for the primary source file. Index: lib/depcomp =================================================================== RCS file: /cvs/automake/automake/lib/depcomp,v retrieving revision 1.55 diff -u -r1.55 depcomp --- lib/depcomp 9 Jul 2005 09:24:40 -0000 1.55 +++ lib/depcomp 5 Jan 2006 15:41:14 -0000 @@ -127,6 +127,13 @@ ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## We need `read -r' for w32 systems. + if echo bt | tr b '\\' | { read -r line; test "X$line" = 'X\t'; } 2>/dev/null + then + read_r='read -r' + else + read_r=read + fi ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is @@ -134,7 +141,9 @@ ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' -' < "$tmpdepfile" | +' < "$tmpdepfile" | +## Do not add dummy dependencies for the source file + ( while $read_r file; do test "X$file" = "X$source" || echo "$file"; done ) | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well.