[svn r645] Added checkings to the Gnu coverage and profiling tools.
1.1 --- a/gmyth/configure.ac Tue May 08 21:01:03 2007 +0100
1.2 +++ b/gmyth/configure.ac Wed May 09 16:01:14 2007 +0100
1.3 @@ -131,6 +131,24 @@
1.4 LDFLAGS="$LDFLAGS -lmudflapth"
1.5 fi
1.6
1.7 +AC_ARG_ENABLE(profiling,
1.8 + AS_HELP_STRING([--enable-profiling],
1.9 + [enable GNU profiling (default = no)]),
1.10 + [
1.11 + if test $enableval = no; then
1.12 + USE_PROFILING=no;
1.13 + else
1.14 + USE_PROFILING=yes;
1.15 + fi
1.16 + ],[
1.17 + USE_PROFILING=no;
1.18 + ]
1.19 +)
1.20 +
1.21 +if [ test $USE_PROFILING = yes ]; then
1.22 + CFLAGS="$CFLAGS -pg"
1.23 +fi
1.24 +
1.25 # Check for pkgconfig
1.26 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
1.27 # Give error and exit if we don't have pkgconfig
1.28 @@ -220,6 +238,38 @@
1.29 #dnl Enable gtk-doc
1.30 #GTK_DOC_CHECK(1.4)
1.31
1.32 +# checks if the indent tool can be found
1.33 +AC_CHECK_PROG(HAVE_INDENT, indent, [Found!])
1.34 +if test -z "$HAVE_INDENT"; then
1.35 + AC_DEFINE(HAVE_INDENT, 1, [AutoIndent found!])
1.36 +fi
1.37 +
1.38 +AM_CONDITIONAL(HAVE_INDENT, test -z "$HAVE_INDENT")
1.39 +
1.40 +# checks if the gprof tool can be found
1.41 +AC_CHECK_PROG(HAVE_GPROF, gprof, [Found!])
1.42 +if test -z "$HAVE_GPROF"; then
1.43 + AC_DEFINE(HAVE_GPROF, 1, [Gnu Profiling tool found!])
1.44 +fi
1.45 +
1.46 +AM_CONDITIONAL(HAVE_GPROF, test -z "$HAVE_GPROF")
1.47 +
1.48 +# checks if the gcov tool can be found
1.49 +AC_CHECK_PROG(HAVE_GCOV, gcov, [Found!])
1.50 +if test -z "$HAVE_GCOV"; then
1.51 + AC_DEFINE(HAVE_GCOV, 1, [Gnu Coverage tool found!])
1.52 +fi
1.53 +
1.54 +AM_CONDITIONAL(HAVE_GCOV, test -z "$HAVE_GCOV")
1.55 +
1.56 +# checks if the genhtml tool can be found
1.57 +AC_CHECK_PROG(HAVE_GENHTML, genhtml, [Found!])
1.58 +if test -z "$HAVE_GENHTML"; then
1.59 + AC_DEFINE(HAVE_GENHTML, 1, [Gnu Coverage HTML report generator found!])
1.60 +fi
1.61 +
1.62 +AM_CONDITIONAL(HAVE_GENHTML, test -z "$HAVE_GENHTML")
1.63 +
1.64 AC_SUBST(CFLAGS)
1.65 AC_SUBST(LDFLAGS)
1.66 AC_SUBST(LIBS)
2.1 --- a/gmyth/src/Makefile.am Tue May 08 21:01:03 2007 +0100
2.2 +++ b/gmyth/src/Makefile.am Wed May 09 16:01:14 2007 +0100
2.3 @@ -97,6 +97,7 @@
2.4 gmyth_file.h \
2.5 gmyth_file_local.h
2.6
2.7 +if HAVE_INDENT
2.8 indent:
2.9 for src_file in $(libgmyth_la_SOURCES); do \
2.10 indent -gnu -i4 -l80 -bfda -nut -pcs -psl -bli0 -cs -cli4 -nbfda -sai -saw -saf -sbi4 -npro -nfca $$src_file; \
2.11 @@ -104,8 +105,12 @@
2.12 for inc_file in $(libgmyth_include_HEADERS); do \
2.13 indent -gnu -i4 -l80 -bfda -nut -pcs -psl -bli0 -cs -cli4 -nbfda -sai -saw -saf -sbi4 -npro -nfca $$inc_file; \
2.14 done;
2.15 +endif
2.16
2.17 -CLEANFILES = $(BUILT_SOURCES) \
2.18 - *.gcda \
2.19 +CLEANFILES = $(BUILT_SOURCES)
2.20 +
2.21 +if HAVE_GCOV
2.22 +CLEANFILES += *.gcda \
2.23 *.gcno \
2.24 *.gcov
2.25 +endif