automake-patches
[Top][All Lists]
Advanced

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

Re: automake 1.7.2b, tests/depcomp3.test and DJGPP


From: Richard Dawe
Subject: Re: automake 1.7.2b, tests/depcomp3.test and DJGPP
Date: Tue, 18 Feb 2003 23:03:43 +0000

Hello.

Alexandre Duret-Lutz wrote:
> 
> >>> "Richard" == Richard Dawe <address@hidden> writes:
> 
>  Richard> Some of the tests fail, because they use DESTDIR.
> 
> Huh?  What's wrong with DESTDIR?

Sorry, I should been more verbose. I sent a mail about this problem to
bug-automake before (10th January 2003) - I can forward it to you or resend
it, if you'd like. Below is a summary of the problem:

DESTDIR does not work with DJGPP. automake tries to create paths like
$(DESTDIR)/$(binprefix). $(DESTDIR) and $(binprefix), etc. usually contain
fully-qualified DOS-style paths (c:/some/file). When two fully-qualified
DOS-style paths are concatenated, they give a filename that doesn't make any
sense - c:/foo/c:/bar. This causes the DESTDIR-related stuff to fail.

>  Richard> On further examination of the depcomp3 failure, it
>  Richard> appears the problem is that gcc 3.2.1 (3.x perhaps?)
>  Richard> can generate multiple-line dependencies containing
>  Richard> MS-DOS-style paths:
> 
>  Richard> bash-2.04$ gcc -M src/sub.c
>  Richard> sub.o: src/sub.c c:/djgpp/lib/gcc-lib/djgpp/3.21/djgpp.ver \
>  Richard>   c:/djgpp/include/sys/version.h src/foo.h
> 
> [...]
> 
>  Richard> bash-2.04$ cat src/.deps/sub.Po
>  Richard> src/sub.o: src/sub.c c:/djgpp/lib/gcc-lib/djgpp/3.21/djgpp.ver \
>  Richard> src/sub.o: /djgpp/include/sys/version.h src/foo.h
>  Richard> src/sub.c :
>  Richard> c:/djgpp/lib/gcc-lib/djgpp/3.21/djgpp.ver :
>  Richard> /djgpp/include/sys/version.h :
>  Richard> src/foo.h :
> 
>  Richard> One solution that seems to work is to join the lines
>  Richard> together from the output of the
>  Richard> compiler/pre-processor.
> 
> Unfortunately this won't work with those compilers that output
> dependencies as follow.
> 
> src/sub.o: src/sub.c
> src/sub.o: src/sub.h
> 
> How about requiring the target to be at least two letters?  (Not
> that I find this particularly cunning, but I can't think of
> anything else right now.)

I think that's reasonable, as long as the target file has a file extension, so
that it copes with, say, dependencies in a.c.

> --- lib/depcomp 17 Feb 2003 14:55:22 -0000      1.35.2.5
> +++ lib/depcomp 18 Feb 2003 20:37:13 -0000
> @@ -315,7 +315,11 @@
>    done
> 
>    test -z "$dashmflag" && dashmflag=-M
> -  "$@" $dashmflag | sed 's:^[^:]*\:[   ]*:'"$object"'\: :' > "$tmpdepfile"
> +  # Require at least to characters before searching for `:'
> +  # in the target name.  This is to cope with DOS-style filenames:
> +  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
> +  "$@" $dashmflag |
> +    sed 's:^[  ]*..[^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
>    rm -f "$depfile"
>    cat < "$tmpdepfile" > "$depfile"
>    tr ' ' '

The patch above did not work for me. It seems like the "[  ]*" at the start is
not greedy, so the ".." matches some spaces and the target is seen to be 'c'
still.

Below is a patch that works for me. This should also cope with filenames that
have spaces in them.

--- orig/automake-1.7.2b/lib/depcomp    2003-02-11 21:00:26.000000000 +0000
+++ gnu.dev/automake-1.7.2b/lib/depcomp 2003-02-18 22:57:40.000000000 +0000
@@ -315,7 +315,11 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  "$@" $dashmflag | sed 's:^[^:]*\:[   ]*:'"$object"'\: :' > "$tmpdepfile"
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
   tr ' ' '

>  Richard> Note that I did not run the test suite again, after
>  Richard> applying the patch. The test suite takes 1-1.5 hours
>  Richard> and maybe this isn't the right fix.
> 
> It take the same amount of time here.  Unfortunately.

What kind of box do you have? I'm running an Athlon 850MHz. I've wondered for
a while if Linux is much faster than DJGPP, so I'd be interested to know what
kind of box you are using.

> As I can't afford a faster box (sight) I've learnt to run the
> testsuite with keywords:
>   make TESTS="`grep -l dashmstdout *.test | tr '\n' ' '`" check
>
> (Only two tests, depcomp3.test and pr307.test, exercize dashmstdout.)

Those tests pass with the patch I included above.

Thanks, bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]




reply via email to

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