From 826aeb684d6066ba9302ea799cde7b2ad4dac4fd Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 4 Feb 2010 22:45:54 +0200 Subject: [PATCH] * Makefile.am, configure.ac: clear up the pmccabe stuff a bit --- Makefile.am | 6 +++--- configure.ac | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9e943a64..3f96f64a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,18 +28,18 @@ cleanupnote: tags: gtags + # this warns about function that have a cyclomatic complexity of > 10, # which is a sign that it needs some refactoring. requires the pmccabe # tool. If all is fine, it outputs nothing cc10: - @pmccabe `find -name '*.c' -o -name '*.cc'` | sort -nr | awk '($$1 > 10)' + @$(PMCCABE) `find -name '*.c' -o -name '*.cc'` | sort -nr | awk '($$1 > 10)' # this warns about functions that are over 33 non-comment lines long, which is a # sign that they need some refactoring. requires the pmccabe tool. if # all is fine, it outputs nothing line33: - @pmccabe -c `find -name '*.c' -o -name '*.cc'` | awk '($$5 > 33)' - + @$(PMCCABE) -c `find -name '*.c' -o -name '*.cc'` | awk '($$5 > 33)' EXTRA_DIST= \ TODO \ diff --git a/configure.ac b/configure.ac index 24b5d5af..008b684b 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,18 @@ AS_IF([test "x$PKG_CONFIG" = "xno"],[ *** The pkg-config script could not be found. Make sure it is *** in your path, or set the PKG_CONFIG environment variable *** to the full path to pkg-config.]) - ]) +]) + + +# check for pmccabe +AC_PATH_PROG([PMCCABE], [pmccabe], [no]) +AS_IF([test "x$PMCCABE" = "xno"],[ + AC_MSG_WARN([ + *** Developers: you don't seem to have the 'pmccabe' tool installed. + *** Please install it if you want to run the automated code checks]) +]) + + # # currently, we don' support systems without d_type in their struct @@ -110,11 +121,15 @@ man/Makefile ]) AC_OUTPUT + +echo +echo "mu configuration is complete." +echo "-----------------------------" + echo echo "Note: the Xapian database is no longer stored as /xapian-0.6" echo "but instead simply as /xapian. You can remove the older" echo "xapian-0.6 directory to save some disk space" echo -echo "mu configuration is complete." -echo "type 'make' to build mu, or 'make check' to perform the unit tests." +echo "type 'make' to build mu, or 'make check' to run the unit tests."