From 9826ce899d18c0893d15f16b5182df786afcf1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 25 Nov 2004 18:33:18 +0000 Subject: [PATCH] support for function tracing which does not yet work (bug in OpenC++) --- configure.in | 28 ++++++++++++++++++++++++++-- mrw/makefile.am | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 2c0cd29..aa280c1 100644 --- a/configure.in +++ b/configure.in @@ -9,6 +9,9 @@ ## @license LGPL, see file COPYING ## ## $Log$ +## Revision 1.15 2004/11/25 18:33:18 marc +## support for function tracing which does not yet work (bug in OpenC++) +## ## Revision 1.14 2004/10/13 11:19:54 marc ## *** empty log message *** ## @@ -53,7 +56,7 @@ AC_INIT([mrw/mrw.hpp.in]) PACKAGENAME=mrw-c++ m4_define(x_major, 1) m4_define(x_minor, 2) -m4_define(x_least, 1) +m4_define(x_least, 2) AM_INIT_AUTOMAKE(@PACKAGENAME@, @MAJOR@.@MINOR@.@LEAST@, [marc@waeckerlin.org]) # copy M4 to shell @@ -98,9 +101,21 @@ AC_CHECK_HEADER(log4cxx/logger.h, [have_log4cxx=yes]) # Arguments AM_MAINTAINER_MODE +AC_ARG_WITH(tracer, + [ --with-tracer=name add additional tracing output to this library itself], + [with_tracer="$withval"], [with_tracer="no"]) +AM_CONDITIONAL(TRACER, test "$with_tracer" != "no") +if test "$with_tracer" != "no"; then + if test "$with_tracer" != "yes"; then + TRACE=$with_tracer + else + TRACE="trace" + fi + AC_SUBST(TRACE) +fi AC_ARG_ENABLE(pedantic, [ --enable-pedantic enable all warnings and checks, abort on warnings], - [test "$enableval" = "yes" && \ + [have_pedantic="$enableval"; test "$enableval" = "yes" && \ AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"]) dnl problem in libs: -Wshadow -Wcast-qual dnl auto.hpp: -Wno-ctor-dtor-privacy (removed) @@ -149,6 +164,15 @@ if test "$have_dot" = "no"; then AC_MSG_WARN([Missing program dot! - when you rebild documentation with make doc, there are no generated images - there are precompiled derieved files in the distribution]); fi +if test "$have_pedantic" == "yes"; then +AC_MSG_NOTICE([Pedantic compile mode enabled! + - all warnings for GNU g++ are enabled + - all warnings result in an error + - doxygen warnings are treated as error too]); fi +if test "$have_tracer" != "no"; then +AC_MSG_NOTICE([Verbose tracing is enabled! + - function traces will be printed for all methods in the library + - tracer is: $TRACE]); fi if test "$have_log4cxx" != "yes"; then AC_MSG_WARN([Library log4cxx will not be used! - if you want it, download it from: diff --git a/mrw/makefile.am b/mrw/makefile.am index a249c0c..3bb7f7a 100644 --- a/mrw/makefile.am +++ b/mrw/makefile.am @@ -9,6 +9,9 @@ ## @license LGPL, see file COPYING ## ## $Log$ +## Revision 1.13 2004/11/25 18:33:18 marc +## support for function tracing which does not yet work (bug in OpenC++) +## ## Revision 1.12 2004/10/13 11:17:21 marc ## new file stdext.cpp ## @@ -67,7 +70,19 @@ if HAVE_LOG4CXX endif endif -libmrw_la_SOURCES = mrw.hpp version.cpp \ +if TRACER + tmp_src = \ + mrw.hpp version.cpp \ + arg.cpp arg.hpp auto.hpp deque.hpp \ + exception.cpp exception.hpp \ + exec.cpp exec.hpp list.hpp \ + map.hpp multimap.hpp multiset.hpp \ + set.hpp simpletrace.hpp \ + smartpointer.hpp stdext.cpp stdext.hpp \ + string.hpp unistd.hpp vector.hpp +else + libmrw_la_SOURCES = \ + mrw.hpp version.cpp \ arg.cpp arg.hpp auto.hpp deque.hpp \ exception.cpp exception.hpp \ exec.cpp exec.hpp list.hpp \ @@ -75,10 +90,23 @@ libmrw_la_SOURCES = mrw.hpp version.cpp \ set.hpp simpletrace.hpp \ smartpointer.hpp stdext.cpp stdext.hpp \ string.hpp unistd.hpp vector.hpp +endif if HAVE_STACKTRACE - libmrw_la_SOURCES += stacktrace.hpp stacktrace.cpp +if TRACER + tmp_src += \ + stacktrace.hpp stacktrace.cpp +else + libmrw_la_SOURCES += \ + stacktrace.hpp stacktrace.cpp +endif endif libmrw_la_LDFLAGS = -version-info @LIB_VERSION@ + +if TRACER + BUILT_SOURCES = ${tmp_src:.cpp=.ii} + libmrw_la_SOURCES = ${BUILT_SOURCES} +endif + if HAVE_STACKTRACE libmrwexcstderr_la_SOURCES = autostacktracestderr.cpp version.cpp libmrwexcstderr_la_LDFLAGS = -version-info @LIB_VERSION@ @@ -154,3 +182,8 @@ clean-local: distclean-local: - rm -r doc/html/* doc/latex/* - rm makefile makefile.in doxygen.err libmrw.doxytag + +if TRACER +%.ii: %.cpp; ${TRACE} -E -- $< +%.o: %.ii; ${CXX} -c ${CPPFLAGS} ${CXXFLAGS} -o $@ $< +endif \ No newline at end of file