[systemd-devel] [patch] build: do not touch CFLAGS

Jan Engelhardt jengelh at medozas.de
Fri Jan 6 17:18:58 PST 2012


parent ba1d5596354e3299d5b9b995bb0fa9b3bdd285cc (v37-278-gba1d559)
commit 7aee03e8cd7cf1ab9de14dc293c6f994970ce9fa
Author: Jan Engelhardt <jengelh at medozas.de>
Date:   Fri Jan 6 12:02:55 2012 +0100

build: do not touch CFLAGS

Per the automake manual section 3.6 "Variables reserved for the user",
CFLAGS should _not_ be touched. Right now, one cannot successfully
complete `make CFLAGS=-fvisibility=default`, because systemd flags are
always appended and thus override the user's wish. Furthermore,
it overrides per_target_CFLAGS, which is also undesired.
---
 configure.ac |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index ef9bfc1..43a8ab6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,6 +66,8 @@ if test -z "$GPERF" ; then
         AC_MSG_ERROR([*** gperf not found])
 fi
 
+saved_CFLAGS="$CFLAGS"
+CFLAGS=""
 CC_CHECK_CFLAGS_APPEND([ \
         -pipe \
         -Wall \
@@ -110,6 +112,9 @@ CC_CHECK_CFLAGS_APPEND([ \
         -fdata-sections \
         -Wl,--as-needed \
         -Wl,--gc-sections])
+AM_CFLAGS="$CFLAGS"
+CFLAGS="$saved_CFLAGS"
+AC_SUBST([AM_CFLAGS])
 
 LT_PREREQ(2.2)
 LT_INIT
-- 
# Created with git-export-patch



More information about the systemd-devel mailing list