forked from OSchip/llvm-project
Add an autoconf test to check for optional compiler flags like
-Wno-missing-field-initializers or -Wno-variadic-macros. llvm-svn: 85147
This commit is contained in:
parent
661ea989e9
commit
e4492f6121
|
@ -320,3 +320,9 @@ ENABLE_LLVMC_DYNAMIC = 0
|
|||
# support (via the -load option).
|
||||
ENABLE_LLVMC_DYNAMIC_PLUGINS = 1
|
||||
#@ENABLE_LLVMC_DYNAMIC_PLUGINS@
|
||||
|
||||
# Optional flags supported by the compiler
|
||||
# -Wno-missing-field-initializers
|
||||
NO_MISSING_FIELD_INITIALIZERS = @NO_MISSING_FIELD_INITIALIZERS@
|
||||
# -Wno-variadic-macros
|
||||
NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
|
||||
|
|
|
@ -943,6 +943,12 @@ fi
|
|||
dnl Tool compatibility is okay if we make it here.
|
||||
AC_MSG_RESULT([ok])
|
||||
|
||||
dnl Check optional compiler flags.
|
||||
AC_MSG_CHECKING([optional compiler flags])
|
||||
CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])
|
||||
CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])
|
||||
AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS])
|
||||
|
||||
dnl===-----------------------------------------------------------------------===
|
||||
dnl===
|
||||
dnl=== SECTION 5: Check for libraries
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
AC_DEFUN([CXX_FLAG_CHECK],
|
||||
[AC_SUBST($1, `$CXX $2 -fsyntax-only -xc /dev/null 2>/dev/null && echo $2`)])
|
Loading…
Reference in New Issue