]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
build-sys: Perform flag tests in context to existing flags 2541/head
authorMichał Górny <mgorny@gentoo.org>
Sat, 6 Feb 2016 12:47:30 +0000 (13:47 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sat, 6 Feb 2016 13:57:46 +0000 (14:57 +0100)
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.

m4/attributes.m4

index db5df250f451054441b216f6372baa784b12502d..51ac88be61875444b52737cf85141d8de2255adf 100644 (file)
@@ -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]))],