[seed] Fix profiling for modules



commit 74de3a26e0e75dc8146b25d1bc7ef5bab092df85
Author: Tim Horton <hortont424 gmail com>
Date:   Fri Jul 3 22:08:44 2009 -0400

    Fix profiling for modules

 Makefile.am  |   18 +++++++++++++-----
 configure.ac |   35 ++++++++++++++++++++---------------
 2 files changed, 33 insertions(+), 20 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 4ef76e7..42dabde 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,18 +58,26 @@ endif
 	cd libseed/.libs ; gcov *.c
 
 if PROFILE_MODULES
-	cd modules/readline/.libs ; gcov *.c
+	cd modules/cairo/.libs ; gcov *.c
+	cd modules/canvas/.libs ; gcov *.c
+	cd modules/dbus/.libs ; gcov *.c
 	cd modules/example/.libs ; gcov *.c
+	cd modules/gettext/.libs ; gcov *.c
+	cd modules/gtkbuilder/.libs ; gcov *.c
+	cd modules/libxml/.libs ; gcov *.c
+	cd modules/os/.libs ; gcov *.c
+	cd modules/readline/.libs ; gcov *.c
+	cd modules/sandbox/.libs ; gcov *.c
 	cd modules/sqlite/.libs ; gcov *.c
-	cd modules/canvas/.libs ; gcov *.c
-	cd modules/Multiprocessing/.libs ; gcov *.c
 endif
 
 profile-gui: profile
+
 if PROFILE_MODULES
-	$mods_prof = --directory modules/readline/.libs --directory modules/example/.libs --directory modules/sqlite/.libs
+	lcov --directory libseed/.libs --directory modules/cairo/.libs --directory modules/canvas/.libs --directory modules/dbus/.libs --directory modules/example/.libs --directory modules/gettext/.libs --directory modules/gtkbuilder/.libs --directory modules/libxml/.libs --directory modules/os/.libs --directory modules/readline/.libs --directory modules/sandbox/.libs --directory modules/sqlite/.libs --capture --output-file seed.info
+else
+	lcov --directory libseed/.libs --capture --output-file seed.info
 endif
 
-	lcov --directory libseed/.libs $(mods_prof) --capture --output-file seed.info
 	cp seed.info /tmp/
 	cd /tmp ; genhtml seed.info ; gnome-open index.html
diff --git a/configure.ac b/configure.ac
index 1265437..977bb9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,21 +329,6 @@ AC_ARG_ENABLE(examples,
 AM_CONDITIONAL(BUILD_SEED_EXAMPLES, test "x$enable_examples" = "xyes")
 AC_SUBST(BUILD_SEED_EXAMPLES)
 
-dnl =============================Debug=========================================
-AC_ARG_ENABLE(debug,
-			  AC_HELP_STRING([--enable-debug],
-							 [enable verbose debugging. [default=no]]),
-			  [enable_debug="yes"],[enable_debug="no"])
-
-if test "x$enable_debug" = "xyes"; then
-	SEED_DEBUG_CFLAGS="-DSEED_ENABLE_DEBUG -g"
-	CFLAGS="-O0"
-else
-	SEED_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
-fi
-
-AC_SUBST(SEED_DEBUG_CFLAGS)
-
 dnl ===========================Profiling=======================================
 AC_ARG_ENABLE(profile,
 			  AC_HELP_STRING([--enable-profile],
@@ -359,6 +344,7 @@ if test "x$enable_profile" = "xyes"; then
 	SEED_PROFILE_CFLAGS="-fprofile-arcs -ftest-coverage"
 	SEED_PROFILE_LIBS="-lgcov"
 	CFLAGS="-O0"
+	[need_debug="yes"]
 fi
 
 if test "x$enable_profile" = "xno"; then
@@ -370,6 +356,25 @@ AC_SUBST(SEED_PROFILE_LIBS)
 
 AM_CONDITIONAL(PROFILE_MODULES, test "x$enable_profile_modules" = "xyes")
 
+dnl =============================Debug=========================================
+AC_ARG_ENABLE(debug,
+			  AC_HELP_STRING([--enable-debug],
+							 [enable verbose debugging. [default=no]]),
+			  [enable_debug="yes"],[enable_debug="no"])
+
+if test "x$enable_debug" = "xyes"; then
+	SEED_DEBUG_CFLAGS="-DSEED_ENABLE_DEBUG -g"
+	CFLAGS="-O0"
+else
+	SEED_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
+	
+	if test "x$need_debug" = "xyes"; then
+		AC_MSG_ERROR([debug must be enabled in order to enable profiling.])
+	fi
+fi
+
+AC_SUBST(SEED_DEBUG_CFLAGS)
+
 dnl ===========================Darwin Build====================================
 SEED_OSX_CFLAGS=
 SEED_OSX_LDFLAGS=



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