From 83d6c266f0cc5351442e89fe43543ae317c44f3e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 26 Sep 2011 15:50:51 +0100 Subject: [PATCH 1/2] Set configure defaults from odd/even micro, not Automake maintainer mode Automake maintainer mode isn't about whether you're a maintainer or not (although its name would suggest that), it's about whether files that are normally distributed in the tarball get regenerated. As such, it's not really appropriate to use it to drive defaults for things like assertions and extra test code. Basing those defaults on whether you're building a random snapshot from git (odd micro version) or a tagged release (even micro version) gives the desired effect: developers building from git normally get tests and assertions, distribution packagers don't. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34671 Signed-off-by: Simon McVittie --- configure.ac | 39 +++++++++++++++++++++++++++++---------- 1 files changed, 29 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 0e11a86..cd09654 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,6 @@ GETTEXT_PACKAGE=dbus-1 AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain]) - ## must come before we use the $USE_MAINTAINER_MODE variable later AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) @@ -57,6 +56,17 @@ AC_SUBST(DBUS_MINOR_VERSION) AC_SUBST(DBUS_MICRO_VERSION) AC_SUBST(DBUS_VERSION) +# Various things use is_snapshot as a default. They should all be +# overridable using command-line arguments. +case "$DBUS_MICRO_VERSION" in + (*0|*2|*4|*6|*8) + is_snapshot=no + ;; + (*) + is_snapshot=yes + ;; +esac + AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX @@ -123,8 +133,12 @@ AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes) AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes) 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=$USE_MAINTAINER_MODE) -AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE) +AC_ARG_ENABLE([verbose-mode], + [AS_HELP_STRING([--enable-verbose-mode], [support verbose debug mode])], + [], [enable_verbose_mode="$is_snapshot"]) +AC_ARG_ENABLE([asserts], + [AS_HELP_STRING([--enable-asserts], [include assertion checks])], + [], [enable_asserts="$is_snapshot"]) 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) @@ -151,9 +165,9 @@ AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=],[User for runnin AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon])) AC_ARG_ENABLE([embedded-tests], - AS_HELP_STRING([--enable-embedded-tests], - [enable unit test code in the library and binaries]), - [], [enable_embedded_tests=$USE_MAINTAINER_MODE]) + [AS_HELP_STRING([--enable-embedded-tests], + [enable unit test code in the library and binaries])], + [], [enable_embedded_tests="$is_snapshot"]) AC_ARG_ENABLE([modular-tests], AS_HELP_STRING([--enable-modular-tests], [enable modular regression tests (requires GLib)]), @@ -1212,9 +1226,9 @@ cc_supports_flag() { TP_COMPILER_WARNINGS([WARNING_CFLAGS], dnl Use -Werror by default if: dnl - we're not on Windows (too many warnings), and - dnl - we're in maintainer mode (a D-Bus developer, not a distro or end-user) + dnl - this is an odd micro version (not a real release) dnl Override with --enable-Werror or --disable-Werror - [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$USE_MAINTAINER_MODE = xyes], + [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$is_snapshot = xyes], dnl enable these warnings if possible: [all \ @@ -1609,9 +1623,15 @@ test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.s ]) AC_OUTPUT +if test "x$is_snapshot" = xyes; then + maybe_snapshot=" (development snapshot)" +else + maybe_snapshot= +fi + dnl ========================================================================== echo " - D-Bus $VERSION + D-Bus $VERSION$maybe_snapshot ============== prefix: ${EXPANDED_PREFIX} @@ -1635,7 +1655,6 @@ echo " man2html: ${MAN2HTML:-not found}" echo " - Maintainer mode: ${USE_MAINTAINER_MODE} gcc coverage profiling: ${enable_compiler_coverage} Building embedded tests: ${enable_embedded_tests} Building modular tests: ${enable_modular_tests} -- 1.7.6.3