Eina: fix CFLAGS value when --enable-assert is used
authorcaro <caro>
Sun, 1 Jul 2012 13:34:34 +0000 (13:34 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 1 Jul 2012 13:34:34 +0000 (13:34 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@73112 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

acinclude.m4 [deleted file]
configure.ac
m4/common/efl_tests.m4

diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644 (file)
index cfc0859..0000000
+++ /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)])
-])
-])
index 19022f5..0b626a7 100644 (file)
@@ -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],
index edd57f2..d8554e1 100644 (file)
@@ -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])