diff --git a/legacy/eina/acinclude.m4 b/legacy/eina/acinclude.m4 deleted file mode 100644 index cfc0859e6e..0000000000 --- a/legacy/eina/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/legacy/eina/configure.ac b/legacy/eina/configure.ac index 19022f5aa9..0b626a72d4 100644 --- a/legacy/eina/configure.ac +++ b/legacy/eina/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/legacy/eina/m4/common/efl_tests.m4 b/legacy/eina/m4/common/efl_tests.m4 index edd57f2199..d8554e1539 100644 --- a/legacy/eina/m4/common/efl_tests.m4 +++ b/legacy/eina/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])