mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-30 14:58:50 +00:00
de093c2913
`clang++ -dumpversion` always outputs 4.2.1 as it was designed to be compatible with `g++` in that version. So parse `clang++ --version` for `clang++` instead.
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
QUNUSED_ARGUMENTS=""
|
|
WNO_SELF_ASSIGN=""
|
|
WNO_MISMATCHED_TAGS=""
|
|
WLOGICAL_OP=""
|
|
|
|
if test x"$ac_cv_compiler_is_clang" = xyes; then
|
|
QUNUSED_ARGUMENTS="-Qunused-arguments"
|
|
WNO_SELF_ASSIGN="-Wno-self-assign"
|
|
WNO_MISMATCHED_TAGS="-Wno-mismatched-tags"
|
|
FSTACK_PROTECTOR=""
|
|
|
|
ac_save_CXXFLAGS="$CXXFLAGS"
|
|
AC_LANG_PUSH(C++)
|
|
|
|
CXXFLAGS="$ac_save_CXXFLAGS -Werror -Wno-inconsistent-missing-override"
|
|
AC_TRY_COMPILE([],[],[ WNO_INCONSISTENT_MISSING_OVERRIDE="-Wno-inconsistent-missing-override" ],[])
|
|
|
|
CXXFLAGS="$ac_save_CXXFLAGS -Werror -Wno-potentially-evaluated-expression"
|
|
AC_TRY_COMPILE([],[],[ WNO_POTENTIALLY_EVALUATED_EXPRESSION="-Wno-potentially-evaluated-expression" ],[])
|
|
|
|
AC_LANG_POP()
|
|
CXXFLAGS="$ac_save_CXXFLAGS"
|
|
|
|
else
|
|
WNO_MAYBE_UNINITIALIZED="-Wno-maybe-uninitialized"
|
|
FSTACK_PROTECTOR="-fstack-protector"
|
|
|
|
if check_version 4.9.0 $ac_cv_compiler_version ; then
|
|
FSTACK_PROTECTOR="-fstack-protector-strong"
|
|
|
|
elif check_version 4.8.0 $ac_cv_compiler_version ; then
|
|
WLOGICAL_OP="-Wlogical-op"
|
|
fi
|
|
fi
|
|
|
|
AC_SUBST(FSTACK_PROTECTOR)
|
|
AC_SUBST(QUNUSED_ARGUMENTS)
|
|
AC_SUBST(WNO_SELF_ASSIGN)
|
|
AC_SUBST(WNO_MISMATCHED_TAGS)
|
|
AC_SUBST(WLOGICAL_OP)
|
|
AC_SUBST(WNO_INCONSISTENT_MISSING_OVERRIDE)
|
|
AC_SUBST(WNO_POTENTIALLY_EVALUATED_EXPRESSION)
|
|
AC_SUBST(WNO_MAYBE_UNINITIALIZED)
|