summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-02-06 13:47:30 +0100
committerMichał Górny <mgorny@gentoo.org>2016-02-06 14:57:46 +0100
commit4c79662e251bea1bfbe18d4374a69bf47aa7a1c6 (patch)
tree967749853f1f3743c1d8dc5f8ce8b1168a8b4916 /m4
parentMerge pull request #2531 from whot/hwdb-updates (diff)
downloadsystemd-4c79662e251bea1bfbe18d4374a69bf47aa7a1c6.tar.xz
systemd-4c79662e251bea1bfbe18d4374a69bf47aa7a1c6.zip
build-sys: Perform flag tests in context to existing flags
Fix the CC_CHECK_FLAG_APPEND macro to test appended flags in context to current flag values. Otherwise, it is possible to append flags colliding with user's *FLAGS or even previously appended flags that will cause the build to fail.
Diffstat (limited to 'm4')
-rw-r--r--m4/attributes.m42
1 files changed, 1 insertions, 1 deletions
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index db5df250f4..51ac88be61 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -43,7 +43,7 @@ AC_DEFUN([CC_CHECK_FLAG_APPEND], [
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
AS_TR_SH([cc_cv_$2_$3]),
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
- eval "AS_TR_SH([$2])='-Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
+ eval "AS_TR_SH([$2])='${cc_save_$2} -Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
AC_LINK_IFELSE([AC_LANG_SOURCE(ifelse([$4], [],
[int main(void) { return 0; } ],
[$4]))],