From dd96406afba5884b07b655cd21f89885fb9073d8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 10 Feb 2012 12:07:30 +0000 Subject: [PATCH 1/2] Set configure defaults from --enable-developer, 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. The desired effect is that developers building from git normally get tests and assertions, while distribution packagers don't. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34671 Signed-off-by: Simon McVittie --- autogen.sh | 2 +- configure.ac | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/autogen.sh b/autogen.sh index d139fa4..f66e778 100755 --- a/autogen.sh +++ b/autogen.sh @@ -101,7 +101,7 @@ else fi if $run_configure; then - $srcdir/configure --enable-maintainer-mode --config-cache "$@" + $srcdir/configure --enable-maintainer-mode --enable-developer --config-cache "$@" echo echo "Now type 'make' to compile $PROJECT." else diff --git a/configure.ac b/configure.ac index 29f45d2..a56ef15 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])]) @@ -122,9 +121,15 @@ 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]) + 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=$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(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) @@ -155,7 +160,7 @@ AC_ARG_WITH(dbus_session_bus_default_address, AS_HELP_STRING([--with-dbus-sessio 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]) + [], [enable_embedded_tests=$enable_developer]) AC_ARG_ENABLE([modular-tests], AS_HELP_STRING([--enable-modular-tests], [enable modular regression tests (requires GLib)]), @@ -1283,9 +1288,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 - 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$USE_MAINTAINER_MODE = xyes], + [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$enable_developer = xyes], dnl Enable these warnings if possible: [all \ @@ -1729,7 +1734,7 @@ echo " man2html: ${MAN2HTML:-not found}" echo " - Maintainer mode: ${USE_MAINTAINER_MODE} + Rebuilding generated files: ${USE_MAINTAINER_MODE} gcc coverage profiling: ${enable_compiler_coverage} Building embedded tests: ${enable_embedded_tests} Building modular tests: ${enable_modular_tests} -- 1.7.9