diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-10-20 17:28:22 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-10-21 14:22:41 +0300 |
commit | b99800a301ce85262a9e33e17d5a137610375c24 (patch) | |
tree | cf6402924723d6f2c12c4e483cf05db8820a4910 /m4 | |
parent | ad590e741cb175b3836834dceb66024bb086e77b (diff) |
Don't disable assertions for releases and provide a new GST_ENABLE_EXTRA_CHECKS #define
Assertions are useful to have in any case, and we were abusing the #define for
adding extra checks to our code. Let's do it properly!
https://bugzilla.gnome.org/show_bug.cgi?id=756870
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gst-args.m4 | 26 | ||||
-rw-r--r-- | m4/gst-glib2.m4 | 13 |
2 files changed, 28 insertions, 11 deletions
diff --git a/m4/gst-args.m4 b/m4/gst-args.m4 index b478c82..0628123 100644 --- a/m4/gst-args.m4 +++ b/m4/gst-args.m4 @@ -358,3 +358,29 @@ AC_DEFUN([AG_GST_ARG_DISABLE_FATAL_WARNINGS], fi ]) ]) + +dnl Enable extra checks by default only for development versions +AC_DEFUN([AG_GST_ARG_ENABLE_EXTRA_CHECKS], +[ + AC_ARG_ENABLE(extra-check, + AC_HELP_STRING([--enable-extra-checks], + [Enable extra runtime checks]), + [ + case "${enableval}" in + yes) EXTRA_CHECKS=yes ;; + no) EXTRA_CHECKS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-checks) ;; + esac + ], + [ + if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then + EXTRA_CHECKS=yes + else + EXTRA_CHECKS=no + fi + ]) + + if test "x$EXTRA_CHECKS" = "xyes"; then + AC_DEFINE(GST_ENABLE_EXTRA_CHECKS, 1, [Define if extra runtime checks should be enabled]) + fi +]) diff --git a/m4/gst-glib2.m4 b/m4/gst-glib2.m4 index 5b9cd8b..5b72507 100644 --- a/m4/gst-glib2.m4 +++ b/m4/gst-glib2.m4 @@ -51,18 +51,9 @@ AC_DEFUN([AG_GST_GLIB_CHECK], fi AC_ARG_ENABLE(glib-asserts, - AS_HELP_STRING([--enable-glib-asserts[=@<:@no/auto/yes@:>@]], + AS_HELP_STRING([--enable-glib-asserts[=@<:@no/yes@:>@]], [Enable GLib assertion]),[enable_glib_assertions=$enableval], - [enable_glib_assertions=auto]) - - if test "x$enable_glib_assertions" = "xauto"; then - dnl Enable assertions only for development versions - if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then - enable_glib_assertions=yes - else - enable_glib_assertions=no - fi - fi + [enable_glib_assertions=yes]) if test "x$enable_glib_assertions" = "xno"; then GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT" |