[gnome-builder] library-template: Use AX_CHECK_ENABLE_DEBUG for debug compiler flags



commit fb9387cf4f0d753081ac9ec173b48082c4931c02
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Sun Jan 31 11:36:40 2016 +0100

    library-template: Use AX_CHECK_ENABLE_DEBUG for debug compiler flags
    
    This removes another load of boilerplate.
    
    http://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
    
    We use the AX_IS_RELEASE macro to check whether to enable debug by
    default, using the micro-version policy.
    
    http://www.gnu.org/software/autoconf-archive/ax_is_release.html
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761356

 .../library_template/shared-library/configure.ac   |   24 ++-----------------
 1 files changed, 3 insertions(+), 21 deletions(-)
---
diff --git a/plugins/library-template/library_template/shared-library/configure.ac 
b/plugins/library-template/library_template/shared-library/configure.ac
index fc9e75d..4514e52 100644
--- a/plugins/library-template/library_template/shared-library/configure.ac
+++ b/plugins/library-template/library_template/shared-library/configure.ac
@@ -11,6 +11,7 @@ m4_define([package_version],[major_version.minor_version.micro_version])
 m4_define([bug_report_url],[https://bugzilla.gnome.org/enter_bug.cgi?product={{name}}])
 m4_define([api_version],[0])
 
+AX_IS_RELEASE([micro-version])
 
 dnl ***********************************************************************
 dnl Initialize autoconf
@@ -82,27 +83,8 @@ PKG_CHECK_MODULES({{NAME}}, [{{packages}}])
 dnl ***********************************************************************
 dnl Add extra debugging with --enable-debug
 dnl ***********************************************************************
-m4_define([debug_default],[m4_if(m4_eval(minor_version%2),[1],[yes],[minimum])])
-AC_ARG_ENABLE([debug],
-              [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
-                              [turn on debugging @<:@default=debug_default@:>@])],
-              ,
-              enable_debug=debug_default)
-AS_CASE(["$enable_debug"],
-        [yes],[
-            CFLAGS="$CFLAGS -O0"
-            CFLAGS="$CFLAGS -g"
-        ],
-        [minimum],[
-            CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"
-        ],
-        [no],[
-            CFLAGS="$CFLAGS -DG_DISABLE_ASSERT"
-            CFLAGS="$CFLAGS -DG_DISABLE_CHECKS"
-            CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"
-        ],
-        [])
-AC_SUBST([CFLAGS])
+AX_CHECK_ENABLE_DEBUG([no],[]
+                      [G_DISABLE_ASSERT G_DISABLE_CHECKS G_DISABLE_CAST_CHECKS])
 
 
 dnl ***********************************************************************


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]