autoconf
[Top][All Lists]
Advanced

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

Re: make -s, how to make it quiet?


From: Ralf Wildenhues
Subject: Re: make -s, how to make it quiet?
Date: Sat, 13 Sep 2008 10:54:26 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

* Joakim Tjernlund wrote on Sat, Sep 13, 2008 at 10:37:37AM CEST:
> > > Anyhow, I am upgrading to newer automake but I get a ton of:
> > > ecn_ss/ecn_ppp_bl/Makefile.am:52: pppd_LDADD must be set with `=' before 
> > > using `+='
> > > ne/ecn_ss/ecn_ppp_bl/Makefile.am:57: relayd_LDADD must be set with `=' 
> > > before using `+='
> > >
> > > Is there any way make newer automake accept those?
> > 
> > Well, these errors were added to help find typos in Makefile.am files.
> > You have to initialize the variables before adding to them:
> >   pppd_LDADD =
> >   pppd_LDADD += ...

> I know, but there are too many of those to be fixed manually. I guess
> I need to write a script(perhaps someone already has?, please send it
> my way :)

Here's a quick, completely untested stab.  Please backup your tree
before using it, any data loss is completely yours to handle.  Esp.
you might want to omit the 'rm' at the end for testing.

#! /bin/sh
set -e
LC_ALL=C
export LC_ALL
adds=adds.$$
inits=inits.$$
tmp=tmp.$$
for file in `find . -name Makefile.am`; do
  sed -n 's/^\([a-zA-Z_][a-zA-Z_0-9]*\) *+=.*/\1/p' "$file" | sort -u > $adds
  sed -n 's/^\([a-zA-Z_][a-zA-Z_0-9]*\) *=.*/\1/p' "$file" | sort -u > $inits
  needed=`join -v 1 $adds $inits`
  mv "$file" $tmp
  { echo "$needed" | sed 's/$/ =/'; cat $tmp; } > "$file"
done
rm $tmp $adds $inits

Cheers,
Ralf




reply via email to

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