automake
[Top][All Lists]
Advanced

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

depcomp deficiency [was: m4-1.4.7 build feedback]


From: Eric Blake
Subject: depcomp deficiency [was: m4-1.4.7 build feedback]
Date: Tue, 26 Sep 2006 20:21:27 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Nelson H. F. Beebe on 9/26/2006 8:51 AM:
> Machinetype:            Sun W40z (4 CPUs, 2400 MHz AMD64 Opteron, 8GB RAM); 
> FreeBSD 6.1-RELEASE #0
> Configure environment:  CC=/usr/bin/c89 CFLAGS=-I/usr/local/include 
> CXX=/usr/bin/g++
> 
> if /usr/bin/c89 -DHAVE_CONFIG_H -I. -I. -I..  -I../lib -I../lib   
> -I/usr/local/include -MT m4.o -MD -MP -MF ".deps/m4.Tpo" -c -o m4.o m4.c; \
>       then mv -f ".deps/m4.Tpo" ".deps/m4.Po"; else rm -f ".deps/m4.Tpo"; 
> exit 1; fi
> c89: illegal option -- M
> usage: c89 [-cEgOs] [-D name[=value]] ... [-I directory] ... [-L directory] 
> ...
>            [-o outfile] [-U name] ... operand ...
> 
>        where operand is one or more of file.c, file.o, file.a
>        or -llibrary
> make[2]: *** [m4.o] Error 1
> 
> This also happens with c99.  Their manual pages say
> 
>       NAME
>            c89 -- POSIX.2 C language compiler
> 
>       SYNOPSIS
>            c89 [-cEgOs] [-D name[=value]] ... [-I directory] ... [-L 
> directory] ...
>                [-o outfile] [-U name] ... operand ...
> 
>       DESCRIPTION
>            This is the name of the C language compiler as required by the 
> IEEE Std
>            1003.2 (``POSIX.2'') standard.
> 
>       NAME
>            c99 -- standard C language compiler
> 
>       SYNOPSIS
>            c99 [-cEgs] [-D name[=value]] ... [-I directory] ... [-L 
> directory] ...
>                [-o outfile] [-O optlevel] [-U name] ... operand ...
> 
>       DESCRIPTION
>            This is the name of the C language compiler as required by the 
> IEEE Std
>            1003.1-2001 (``POSIX.1'') standard.
> 
> They recognize only the very limited set of options show in the
> synopses, but under the hood, they invoke /usr/bin/cc, which is
> gcc 3.4.4.

What a wimpy compiler wrapper.  If they're going to wrap gcc, they might
as well recognize options that are pure POSIX extensions rather than
crashing on them.

> 
> Tests with c89 and c99 show that they define the symbol __GNUC__ to 3,
> so configure concludes they are gcc:
> 
>       checking for gcc... /usr/bin/c89
>       checking whether we are using the GNU C compiler... yes
>       checking dependency style of /usr/bin/c89... gcc3
> 
> The src/Makefile has the rule
> 
> .c.o:
>         if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
>         then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f 
> "$(DEPDIR)/$*.Tpo"; exit 1; fi
> 
> but that fails because of the limited option repertoire of c89 and
> c99.
> 
> It is probably not worth trying to fix this, although doing so would
> likely enhance portability to a wider range of c89 and c99 compilers
> on other systems.

In short, the problem here is that the depcomp algorithm for determining
what dependency checking to request is being fooled by the fact that your
compiler claims to be gcc thanks to its definition of __GNUC__, then fails
to recognize -M options for dependency checking.  A fix would have to come
from automake, which maintains depcomp, to gracefully try whether -M
actually works before deciding that a compiler is really gcc3 compatible.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFGeAn84KuGfSFAYARArfkAKCZ4w4Yu7fxcI8BFvZV3VDnrGgRKwCgv8BR
uTnxBu2fYqylmLtvoxSrtuM=
=p+uu
-----END PGP SIGNATURE-----




reply via email to

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