From b9c8be390750a96ff79e727342d0639ad235be7b Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 Aug 2016 22:53:46 +0200 Subject: Replace configure option '--enable-developer' by '--enable-debug' The command-line option '--enable-debug' works with macros from the Autoconf archive. By default, its value is determined from the result of AX_IS_RELEASE. Signed-off-by: Thomas Zimmermann --- autogen.sh | 2 +- configure.ac | 23 ++++++++++++----------- tools/ci-build.sh | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/autogen.sh b/autogen.sh index 6de735f..f80b8d7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -104,5 +104,5 @@ else fi if $run_configure; then - $srcdir/configure --enable-developer --config-cache "$@" + $srcdir/configure --enable-debug=yes --config-cache "$@" fi diff --git a/configure.ac b/configure.ac index 460b32b..13cb9fd 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,9 @@ m4_define([dbus_micro_version], [5]) m4_define([dbus_version], [dbus_major_version.dbus_minor_version.dbus_micro_version]) AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus]) + +AX_IS_RELEASE([git-directory]) + AC_CONFIG_AUX_DIR([build-aux]) m4_pattern_forbid([^AX_], @@ -64,6 +67,11 @@ AC_SUBST(DBUS_MINOR_VERSION) AC_SUBST(DBUS_MICRO_VERSION) AC_SUBST(DBUS_VERSION) +# The debugging check must run before the compiler tests. Other command-line +# options also use it to set their defaults. We enable debugging by default, +# expect for release builds; see AX_IS_RELEASE above. +AX_CHECK_ENABLE_DEBUG([yes]) + AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX @@ -149,13 +157,6 @@ AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes) AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes) AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes) -# this must come first: other options use this to set their defaults -AC_ARG_ENABLE([developer], - [AS_HELP_STRING([--enable-developer], - [set defaults to be appropriate for a D-Bus developer instead of a distribution/end-user])], - [], - [enable_developer=no]) - DBUS_STATIC_BUILD_CPPFLAGS= if test "x$enable_shared" = xno; then # On Windows, linking against the static library requires special effort @@ -167,8 +168,8 @@ fi AC_SUBST([DBUS_STATIC_BUILD_CPPFLAGS]) AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no) -AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$enable_developer) -AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$enable_developer) +AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$ax_enable_debug) +AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$ax_enable_debug) AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes) AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentation (requires xmlto)]),enable_xml_docs=$enableval,enable_xml_docs=auto) AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto) @@ -206,7 +207,7 @@ AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Di AC_ARG_ENABLE([embedded-tests], AS_HELP_STRING([--enable-embedded-tests], [enable unit test code in the library and binaries]), - [], [enable_embedded_tests=$enable_developer]) + [], [enable_embedded_tests=$ax_enable_debug]) AC_ARG_ENABLE([modular-tests], AS_HELP_STRING([--enable-modular-tests], [enable modular regression tests (requires GLib)]), @@ -1328,7 +1329,7 @@ TP_COMPILER_WARNINGS([WARNING_CFLAGS], dnl - we're not on Windows (too many warnings), and dnl - we're in developer mode (a D-Bus developer, not a distro or end-user) dnl Override with --enable-Werror or --disable-Werror - [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$enable_developer = xyes], + [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$ax_enable_debug = xyes], dnl Enable these warnings if possible: [all \ diff --git a/tools/ci-build.sh b/tools/ci-build.sh index a2abc0b..9fa8dcd 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -61,7 +61,7 @@ case "$dbus_ci_buildsys" in (debug) # Full developer/debug build. set _ "$@" - set "$@" --enable-developer --enable-tests + set "$@" --enable-debug=yes --enable-tests shift # The test coverage for OOM-safety is too # verbose to be useful on travis-ci. -- 2.7.4