add -Qunused-arguments option to clang

This commit is contained in:
Jehan Monnier 2013-11-12 10:27:45 +01:00
parent e316b02b88
commit 95c3e2b2e8
2 changed files with 27 additions and 5 deletions

View file

@ -35,9 +35,17 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_SUBST([docdir], [${datadir}/doc])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
case $target in
*apple-darwin*)
AC_PROG_CXX(["xcrun clang++" g++])
AC_PROG_CC(["xcrun clang" gcc])
;;
*)
AC_PROG_CC
AC_PROG_CXX
;;
esac
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AC_C_INLINE
AC_HEADER_STDC
AM_PROG_CC_C_O
@ -73,6 +81,9 @@ case $target in
esac
AC_SUBST(ACLOCAL_MACOS_FLAGS)
AC_SUBST(CONSOLE_FLAGS)
AC_SUBST(GUI_FLAGS)
@ -598,8 +609,20 @@ AC_ARG_ENABLE(strict,
[strictness=yes]
)
STRICT_OPTIONS="-Wall "
STRICT_OPTIONS="-Wall"
#for clang
LDFLAGS_SAV=$LDFLAGS
LDFLAGS="$LDFLAGS -Qunused-arguments -Wall -Werror"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
[[]])]
, [cc_option_q_allowed=yes]
, [cc_option_q_allowed=no])
LD_FLAGS=$LDFLAGS_SAV
if test $cc_option_q_allowed = "yes"; then
STRICT_OPTIONS="$STRICT_OPTIONS -Qunused-arguments"
fi
if test "$strictness" = "yes" ; then
STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
CFLAGS="$CFLAGS -fno-strict-aliasing"

View file

@ -2,8 +2,7 @@
AM_CPPFLAGS=\
-I$(top_srcdir) \
-I$(top_srcdir)/coreapi \
-I$(top_srcdir)/exosip
-I$(top_srcdir)/coreapi
COMMON_CFLAGS=\
-DIN_LINPHONE \