Skip to content

Commit

Permalink
build-sys: Perform flag tests in context to existing flags
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mgorny committed Feb 6, 2016
1 parent 784b22e commit 4c79662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion m4/attributes.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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]))],
Expand Down

0 comments on commit 4c79662

Please sign in to comment.