[Pkg-telepathy-commits] [telepathy-mission-control-6] 15/280: configure.ac: use AC_DEFINE instead of appending to CFLAGS
Simon McVittie
smcv at debian.org
Thu Mar 27 20:07:00 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.
commit 55ed19e0e2a7ae96bee58ef37c79e48241959d96
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Fri Jul 19 18:08:34 2013 +0100
configure.ac: use AC_DEFINE instead of appending to CFLAGS
In build systems that put CFLAGS in an environment variable rather
than a configure command-line argument (e.g. RPM, I think?), what we
put in CFLAGS will potentially take precedence, and the external
build system's chosen CFLAGS won't necessarily be used. Meanwhile,
if the build system puts CFLAGS on the make command line, it will
take precedence: in particular, debug logging could be disabled, which
is bad for debuggability. If we move to AC_DEFINE, they'll interact
properly.
There is one remaining use of CFLAGS in configure.ac, for code
coverage. RPMs and other production-quality builds shouldn't have
coverage instrumentation, so this doesn't really conflict.
Also use AS_IF instead of if/fi, while I'm touching these lines anyway:
it's better Autoconf style.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69822
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
configure.ac | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index fe10dd5..ef7985e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,24 +94,23 @@ AC_MSG_RESULT([$mc_want_twisted_tests])
AM_CONDITIONAL([WANT_TWISTED_TESTS], test yes = "$mc_want_twisted_tests")
AC_ARG_ENABLE(debug, [ --disable-debug compile without debug code],[enable_debug=${enableval}], enable_debug=yes )
-if test "x$enable_debug" = "xyes"; then
- CFLAGS="$CFLAGS -DENABLE_DEBUG"
-fi
+AS_IF([test "x$enable_debug" = "xyes"],
+ [AC_DEFINE([ENABLE_DEBUG], [1], [Define to compile in debug messages])])
AC_ARG_ENABLE(cast-checks, [ --disable-cast-checks compile with GLIB cast checks disabled],[cchecks=${enableval}],cchecks=yes)
-if test "x$cchecks" = "xno"; then
- CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"
-fi
+AS_IF([test "x$cchecks" = "xno"],
+ [AC_DEFINE([G_DISABLE_CAST_CHECKS], [1],
+ [Define to disable checked casts (not recommended)])])
AC_ARG_ENABLE(asserts, [ --disable-asserts compile with GLIB assertions disabled],[asserts=${enableval}],asserts=yes)
-if test "x$asserts" = "xno"; then
- CFLAGS="$CFLAGS -DG_DISABLE_ASSERTS"
-fi
+AS_IF([test "x$asserts" = "xno"],
+ [AC_DEFINE([G_DISABLE_ASSERTS], [1],
+ [Define to disable assertions (not recommended)])])
AC_ARG_ENABLE(checks, [ --disable-checks compile with GLIB checks disabled],[checks=${enableval}],checks=yes)
-if test "x$checks" = "xno"; then
- CFLAGS="$CFLAGS -DG_DISABLE_CHECKS"
-fi
+AS_IF([test "x$checks" = "xno"],
+ [AC_DEFINE([G_DISABLE_CHECKS], [1],
+ [Define to disable checks (not recommended)])])
AC_ARG_ENABLE(coverage, [ --enable-coverage compile with coverage info],[enable_coverage=${enableval}],enable_coverage=no)
if test "x$enable_coverage" = "xyes"; then
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git
More information about the Pkg-telepathy-commits
mailing list