automake-patches
[Top][All Lists]
Advanced

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

Re: depcomp deficiency [was: m4-1.4.7 build feedback]


From: Ralf Wildenhues
Subject: Re: depcomp deficiency [was: m4-1.4.7 build feedback]
Date: Wed, 27 Sep 2006 18:55:50 +0200
User-agent: Mutt/1.5.13 (2006-09-08)

[ dropping bug-m4 and automake, adding automake-patches list; this is
  http://thread.gmane.org/gmane.comp.gnu.m4.bugs/2012/focus=7639 ]

> > 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

There are two possible ways to go: try to move the -M<X> flags to the
end at the compile stage (to fool the c89 wrapper and still use fastdep
mode), or do the test with the flags added earlier on the command line.

Notes:
- For aesthetics, it is desirable to have the source file name appear at
  the end of the command lines at compile time
  (see the comment in automake/lib/am/depend2.am for a rationale).
- Putting the flags early will cause the `gcc' depmode to be used.
  This mode is still good enough, and, as all other modes != gcc3, does
  not exhibit the inconsistency wrt. depflag position.
- The gcc3 depmode, when issued with help of the `depcomp' script, will
  be slowed down somewhat now.  This isn't really an issue for makefiles
  generated by Automake, as they bypass the script at compile time with
  the %FASTDEP% switch.  It may, however, affect some people out there
  that have decided to operate the dependency tracking algorithm out of
  Automake (and use only the former but not the latter).  Oh well, I
  don't think we need to care too much here.
- Thus, it is IMHO rather safe to just add the flags right before we
  find a `-c' argument in `depcomp': the only time we actually use that
  is while determining `depmode' at configure time, and then we have
  good control over the command line anyway.
- AFAICS, there should be no issues with Libtool here.

Attached are two alternative patches, both of which should fix the
issue.  OK to install the second, and drop the first?

By the way, there is at least one Autoconf issue here, too, and I think
this is what Eric hinted at: $GCC gets set to yes due to __GNUC__ being
defined, which causes _AC_PROG_CC_G to add `-O2' to the command line.
But `c89', unlike `c99', only understands `-O', not `-O <NUM>'.  Oh
well,
  ./configure CFLAGS='-g -O'

serves as an easy workaround, I guess...

Cheers,
Ralf

Attachment: fbsd-c89-depend2.diff
Description: Text document

Attachment: fbsd-c89-depcomp.diff
Description: Text document


reply via email to

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