# HG changeset patch # User rosfran # Date 1178722874 -3600 # Node ID b2ebfaeb18c195a506ddf5fe6c4c20c757fe433b # Parent e3895362340582e1ff173fc1a2283ad479583a29 [svn r645] Added checkings to the Gnu coverage and profiling tools. diff -r e38953623405 -r b2ebfaeb18c1 gmyth/configure.ac --- a/gmyth/configure.ac Tue May 08 21:01:03 2007 +0100 +++ b/gmyth/configure.ac Wed May 09 16:01:14 2007 +0100 @@ -131,6 +131,24 @@ LDFLAGS="$LDFLAGS -lmudflapth" fi +AC_ARG_ENABLE(profiling, + AS_HELP_STRING([--enable-profiling], + [enable GNU profiling (default = no)]), + [ + if test $enableval = no; then + USE_PROFILING=no; + else + USE_PROFILING=yes; + fi + ],[ + USE_PROFILING=no; + ] +) + +if [ test $USE_PROFILING = yes ]; then + CFLAGS="$CFLAGS -pg" +fi + # Check for pkgconfig AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) # Give error and exit if we don't have pkgconfig @@ -220,6 +238,38 @@ #dnl Enable gtk-doc #GTK_DOC_CHECK(1.4) +# checks if the indent tool can be found +AC_CHECK_PROG(HAVE_INDENT, indent, [Found!]) +if test -z "$HAVE_INDENT"; then + AC_DEFINE(HAVE_INDENT, 1, [AutoIndent found!]) +fi + +AM_CONDITIONAL(HAVE_INDENT, test -z "$HAVE_INDENT") + +# checks if the gprof tool can be found +AC_CHECK_PROG(HAVE_GPROF, gprof, [Found!]) +if test -z "$HAVE_GPROF"; then + AC_DEFINE(HAVE_GPROF, 1, [Gnu Profiling tool found!]) +fi + +AM_CONDITIONAL(HAVE_GPROF, test -z "$HAVE_GPROF") + +# checks if the gcov tool can be found +AC_CHECK_PROG(HAVE_GCOV, gcov, [Found!]) +if test -z "$HAVE_GCOV"; then + AC_DEFINE(HAVE_GCOV, 1, [Gnu Coverage tool found!]) +fi + +AM_CONDITIONAL(HAVE_GCOV, test -z "$HAVE_GCOV") + +# checks if the genhtml tool can be found +AC_CHECK_PROG(HAVE_GENHTML, genhtml, [Found!]) +if test -z "$HAVE_GENHTML"; then + AC_DEFINE(HAVE_GENHTML, 1, [Gnu Coverage HTML report generator found!]) +fi + +AM_CONDITIONAL(HAVE_GENHTML, test -z "$HAVE_GENHTML") + AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LIBS) diff -r e38953623405 -r b2ebfaeb18c1 gmyth/src/Makefile.am --- a/gmyth/src/Makefile.am Tue May 08 21:01:03 2007 +0100 +++ b/gmyth/src/Makefile.am Wed May 09 16:01:14 2007 +0100 @@ -97,6 +97,7 @@ gmyth_file.h \ gmyth_file_local.h +if HAVE_INDENT indent: for src_file in $(libgmyth_la_SOURCES); do \ indent -gnu -i4 -l80 -bfda -nut -pcs -psl -bli0 -cs -cli4 -nbfda -sai -saw -saf -sbi4 -npro -nfca $$src_file; \ @@ -104,8 +105,12 @@ for inc_file in $(libgmyth_include_HEADERS); do \ indent -gnu -i4 -l80 -bfda -nut -pcs -psl -bli0 -cs -cli4 -nbfda -sai -saw -saf -sbi4 -npro -nfca $$inc_file; \ done; +endif -CLEANFILES = $(BUILT_SOURCES) \ - *.gcda \ +CLEANFILES = $(BUILT_SOURCES) + +if HAVE_GCOV +CLEANFILES += *.gcda \ *.gcno \ *.gcov +endif