From 518d51211351e6a189fe2bff250febdb55ad1189 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sun, 1 Jul 2012 13:34:34 +0000 Subject: Eina: fix CFLAGS value when --enable-assert is used SVN revision: 73112 --- acinclude.m4 | 14 -------------- configure.ac | 13 +++++++++++++ m4/common/efl_tests.m4 | 10 +++++----- 3 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 acinclude.m4 diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index cfc0859..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,14 +0,0 @@ -m4_ifndef([AC_HEADER_ASSERT], [ -# AC_HEADER_ASSERT -# ---------------- -# Check whether to enable assertions. -AC_DEFUN([AC_HEADER_ASSERT], -[ - AC_MSG_CHECKING([whether to enable assertions]) - AC_ARG_ENABLE([assert], - [ --disable-assert turn off assertions], - [AC_MSG_RESULT([no]) - AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])], - [AC_MSG_RESULT(yes)]) -]) -]) diff --git a/configure.ac b/configure.ac index 19022f5..0b626a7 100644 --- a/configure.ac +++ b/configure.ac @@ -229,6 +229,19 @@ if test "x${have_stringshare_usage}" = "xyes"; then AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern]) fi +# Assert or fail. + +AC_ARG_ENABLE([assert], + [AC_HELP_STRING([--enable-assert], [enable assert, @<:@default=no@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + prefer_assert="yes" + else + prefer_assert="no" + fi + ], + [prefer_assert="no"]) + # Check if we want to benchmark on real data enable_benchmark_e17="no" AC_ARG_ENABLE([e17], diff --git a/m4/common/efl_tests.m4 b/m4/common/efl_tests.m4 index edd57f2..d8554e1 100644 --- a/m4/common/efl_tests.m4 +++ b/m4/common/efl_tests.m4 @@ -44,17 +44,17 @@ if test "x${_efl_enable_tests}" = "xyes" ; then m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -fprofile-arcs -ftest-coverage" m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} -lgcov" # remove any optimisation flag and force debug symbols - m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -g -O0 -DDEBUG" + if test "x${prefer_assert}" = "xno"; then + m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -DNDEBUG" + else + m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -g -O0 -DDEBUG" + fi efl_enable_coverage="yes" else AC_MSG_WARN([lcov is not found, disable profiling instrumentation]) fi fi -dnl Substitution -AC_SUBST(EFL_COVERAGE_CFLAGS) -AC_SUBST(EFL_COVERAGE_LIBS) - AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_efl_enable_tests}" = "xyes") AS_IF([test "x$_efl_enable_tests" = "xyes"], [$2], [$3]) -- cgit v1.2.1