mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Ticket #3134: fix cflags check when using clang compiler.
With clang invalid cflags usage result in exit 0, we expect exit 1. $ clang -c -Wmaybe-uninitialized conftest.c ; echo $? warning: unknown warning option '-Wmaybe-uninitialized'; did you mean '-Wuninitialized'? [-Wunknown-warning-option] 1 warning generated. 0 solution with -Werror on cflags check $ clang -c -Werror -Wmaybe-uninitialized conftest.c ; echo $? error: unknown warning option '-Wmaybe-uninitialized'; did you mean '-Wuninitialized'? [-Werror,-Wunknown-warning-option] 1 (Tested with clang 3.6.) Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
850073cbbb
commit
495b4d662f
@ -12,7 +12,15 @@ AC_DEFUN([MC_CHECK_ONE_CFLAG],[
|
||||
AC_MSG_CHECKING([whether ${CC} accepts $1])
|
||||
|
||||
safe_CFLAGS=$CFLAGS
|
||||
|
||||
case "$CC" in
|
||||
clang*)
|
||||
CFLAGS="-Werror $1"
|
||||
;;
|
||||
*)
|
||||
CFLAGS="$1"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([], [[return 0;]])],
|
||||
|
Loading…
Reference in New Issue
Block a user