m4-discuss
[Top][All Lists]
Advanced

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

Generating a list of defined but unused macros


From: Brian
Subject: Generating a list of defined but unused macros
Date: Thu, 2 Feb 2006 17:23:21 -0700

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 Mingus
AIM, Skype: BReflection
Google talk: address@hidden
Phone: (720) 771-2599
reply via email to

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