Brian writes: > I've tried, unsuccessfully, to list out unused macros in my acsite.m4 used > in the autotools. There is probably an easy way to do this but I'm not all > that familiar with m4.Any help would be appreciated > > > Here was my latest unsuccessful attempt: > > unused: > > @ if [ -e /tmp/unused_macros.log ]; then rm -f > > /tmp/unused_macros.log; fi > > @ m4 -dta -R/usr/share/autoconf/autoconf/autoconf.m4f `ls *.m4` > > -o/tmp/unused_macros.log > > @ grep AC_DEFUN /tmp/unused_macros.log | sed -r > > 's/m4trace:.*AC_DEFUN\(([A-Z_]*),\s|$|./\1/g' | sort | uniq > > > /tmp/unused_macros.log > > @ cat *.m4 | grep AC_DEFUN | sed -r > > 's/.*AC_DEFUN\(\[(.*)\]\,.*/\1/' >> /tmp/unused_macros.log > > @ echo Unused macros: "`cat /tmp/unused_macros.log | tr "\n" "\\n > > " | sort | uniq -u`" > >
Brian, Depending on what shell you use, doing grep FILE | ... > FILE will erase the contents of FILE before grep gets a chance to read it. John B. > > > -- > Brian Mingus > AIM, Skype: BReflection > Google talk: [EMAIL PROTECTED] > Phone: (720) 771-2599 > I've tried, unsuccessfully, to list out unused macros in my acsite.m4 > used in the autotools. There is probably an easy way to do this but I'm > not all that familiar with m4.Any help would be appreciated <br> > <br> > <br> > Here was my latest unsuccessful attempt:<br> > <br> > <blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt > 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">unused:<br> > @ if [ -e /tmp/unused_macros.log > ]; then rm -f /tmp/unused_macros.log; fi<br> > @ m4 -dta > -R/usr/share/autoconf/autoconf/autoconf.m4f `ls *.m4` > -o/tmp/unused_macros.log<br> > @ grep AC_DEFUN > /tmp/unused_macros.log | sed -r > 's/m4trace:.*AC_DEFUN\(([A-Z_]*),\s|$|./\1/g' | sort | uniq > > /tmp/unused_macros.log<br> > @ cat *.m4 | grep AC_DEFUN | > sed -r 's/.*AC_DEFUN\(\[(.*)\]\,.*/\1/' >> /tmp/unused_macros.log<br> > @ echo Unused macros: "`cat > /tmp/unused_macros.log | tr "\n" "\\n " | sort | uniq > -u`"<br> > <br> > </blockquote> > <br>-- <br>Brian Mingus<br>AIM, Skype: BReflection<br>Google talk: <a > href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a><br>Phone: (720) > 771-2599 > _______________________________________________ > M4-discuss mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/m4-discuss -- John Brzustowski - http://www.ProgramOrPerish.com _______________________________________________ M4-discuss mailing list [email protected] http://lists.gnu.org/mailman/listinfo/m4-discuss
