diff --git a/ChangeLog b/ChangeLog index 2cfba9798..109aaa601 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ easier comparison by month of tasks added versus completed and deleted. + "task version" command now reports unrecognized configuration variables, which may be spelling mistakes or deprecated variables. + + "configure --enable-debug" now supported to suppress compiler optimization + to allow debugging. ------ old releases ------------------------------ diff --git a/configure.ac b/configure.ac index 120a41cc0..364500f72 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,29 @@ AC_PREREQ(2.61) AC_INIT(task, 1.5.0, bugs@beckingham.net) + + +CFLAGS="${CFLAGS=}" +CXXFLAGS="${CXXFLAGS=}" +# this macro is used to get the arguments supplied +# to the configure script (./configure --enable-debug) +# Check if we have enable debug support. +AC_MSG_CHECKING(whether to enable debugging) +debug_default="yes" +AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging + [default=$debug_default]],, enable_debug=$debug_default) +# Yes, shell scripts can be used +if test "x$enable_debug" = "xyes"; then +CFLAGS="$CFLAGS -Wall -pedantic -ggdb3 -DDEBUG" +CXXFLAGS="$CFLAGS -Wall -pedantic -ggdb3 -DDEBUG" +AC_MSG_RESULT(yes) +else +CFLAGS="$CFLAGS -O3" +CXXFLAGS="$CFLAGS -O3" +AC_MSG_RESULT(no) +fi + + AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/task.cpp]) AC_CONFIG_HEADER([auto.h]) @@ -12,6 +35,8 @@ AC_PROG_CXX AC_PROG_CC AC_LANG(C++) +AC_SUBST(CFLAGS) + # Checks for libraries. AC_CHECK_LIB(ncurses,initscr) AC_CHECK_LIB(ncurses,endwin) diff --git a/html/task.html b/html/task.html index cd398f0a3..3a4bfd7f2 100644 --- a/html/task.html +++ b/html/task.html @@ -102,6 +102,8 @@ easier comparison by month of tasks added versus completed and deleted.
  • "task version" command now reports unrecognized configuration variables, which may be spelling mistakes or deprecated variables. +
  • "configure --enable-debug" now supported to suppress compiler optimization + to allow debugging.

    diff --git a/src/Makefile.am b/src/Makefile.am index eae651e2b..2e92854a2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,2 @@ bin_PROGRAMS = task task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp color.cpp parse.cpp task.cpp command.cpp report.cpp util.cpp text.cpp rules.cpp Config.h Date.h T.h TDB.h Table.h Grid.h color.h task.h -AM_CPPFLAGS = -Wall -pedantic -ggdb3 -fno-rtti diff --git a/src/Makefile.in b/src/Makefile.in index 120185c41..c8ca21f5f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -155,7 +155,6 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp color.cpp parse.cpp task.cpp command.cpp report.cpp util.cpp text.cpp rules.cpp Config.h Date.h T.h TDB.h Table.h Grid.h color.h task.h -AM_CPPFLAGS = -Wall -pedantic -ggdb3 -fno-rtti all: all-am .SUFFIXES: