diff --git a/configure.ac b/configure.ac index 9efd17d..ee54296 100644 --- a/configure.ac +++ b/configure.ac @@ -45,10 +45,6 @@ dnl starting automake AM_INIT_AUTOMAKE([dejagnu dist-bzip2]) dnl gettext & libtool -AC_ARG_VAR([LT_LDFLAGS], -[You can use this variable to pass an option -to libtool when it is in linking mode (for -example, "-all-static")]) AC_PROG_LIBTOOL AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.14.1]) @@ -67,6 +63,20 @@ AC_CHECK_CXXFLAG([CXXFLAGS], [Wextra]) AC_CHECK_CXXFLAG([CXXFLAGS], [Wno-long-long]) AC_CHECK_LDFLAG([LDFLAGS],[--as-needed]) +dnl see if we've to enable debug flags +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], + [turn on debug compiler flags. Disabled by default]), + [enable_debug="$enableval"], [enable_debug="no"]) + +if test "$enable_debug" = "yes"; then + AC_CHECK_CXXFLAG([CXXFLAGS], [O0]) + AC_CHECK_CXXFLAG([CXXFLAGS], [g3]) +else + AC_CHECK_CXXFLAG([CXXFLAGS], [DNDEBUG]) +fi + + AC_PROG_INSTALL dnl make diff --git a/plugins/pyloader/configure.ac b/plugins/pyloader/configure.ac index 1a06b02..bbdc37d 100644 --- a/plugins/pyloader/configure.ac +++ b/plugins/pyloader/configure.ac @@ -45,10 +45,6 @@ dnl starting automake AM_INIT_AUTOMAKE([dejagnu dist-bzip2]) dnl gettext & libtool -AC_ARG_VAR([LT_LDFLAGS], -[You can use this variable to pass an option -to libtool when it is in linking mode (for -example, "-all-static")]) AC_PROG_LIBTOOL AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.14.1]) @@ -67,6 +63,19 @@ AC_CHECK_CXXFLAG([CXXFLAGS], [Wextra]) AC_CHECK_CXXFLAG([CXXFLAGS], [Wno-long-long]) AC_CHECK_LDFLAG([LDFLAGS], [--as-needed]) +dnl see if we've to enable debug flags +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], + [turn on debug compiler flags. Disabled by default]), + [enable_debug="$enableval"], [enable_debug="no"]) + +if test "$enable_debug" = "yes"; then + AC_CHECK_CXXFLAG([CXXFLAGS], [O0]) + AC_CHECK_CXXFLAG([CXXFLAGS], [g3]) +else + AC_CHECK_CXXFLAG([CXXFLAGS], [DNDEBUG]) +fi + AC_PROG_INSTALL dnl make diff --git a/plugins/xmlsave/configure.ac b/plugins/xmlsave/configure.ac index d57e932..f7bd32d 100644 --- a/plugins/xmlsave/configure.ac +++ b/plugins/xmlsave/configure.ac @@ -45,10 +45,6 @@ dnl starting automake AM_INIT_AUTOMAKE([dejagnu dist-bzip2]) dnl gettext & libtool -AC_ARG_VAR([LT_LDFLAGS], -[You can use this variable to pass an option -to libtool when it is in linking mode (for -example, "-all-static")]) AC_PROG_LIBTOOL AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.14.1]) @@ -67,6 +63,19 @@ AC_CHECK_CXXFLAG([CXXFLAGS], [Wextra]) AC_CHECK_CXXFLAG([CXXFLAGS], [Wno-long-long]) AC_CHECK_LDFLAG([LDFLAGS], [--as-needed]) +dnl see if we've to enable debug flags +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], + [turn on debug compiler flags. Disabled by default]), + [enable_debug="$enableval"], [enable_debug="no"]) + +if test "$enable_debug" = "yes"; then + AC_CHECK_CXXFLAG([CXXFLAGS], [O0]) + AC_CHECK_CXXFLAG([CXXFLAGS], [g3]) +else + AC_CHECK_CXXFLAG([CXXFLAGS], [DNDEBUG]) +fi + AC_PROG_INSTALL dnl make