[llvm-commits] [llvm] r85147 - in /llvm/trunk: Makefile.config.in autoconf/configure.ac autoconf/m4/cxx_flag_check.m4
Julien Lerouge
jlerouge at apple.com
Mon Oct 26 12:58:45 PDT 2009
Author: jlerouge
Date: Mon Oct 26 14:58:44 2009
New Revision: 85147
URL: http://llvm.org/viewvc/llvm-project?rev=85147&view=rev
Log:
Add an autoconf test to check for optional compiler flags like
-Wno-missing-field-initializers or -Wno-variadic-macros.
Added:
llvm/trunk/autoconf/m4/cxx_flag_check.m4
Modified:
llvm/trunk/Makefile.config.in
llvm/trunk/autoconf/configure.ac
Modified: llvm/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=85147&r1=85146&r2=85147&view=diff
==============================================================================
--- llvm/trunk/Makefile.config.in (original)
+++ llvm/trunk/Makefile.config.in Mon Oct 26 14:58:44 2009
@@ -320,3 +320,9 @@
# 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@
Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=85147&r1=85146&r2=85147&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Mon Oct 26 14:58:44 2009
@@ -943,6 +943,12 @@
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
Added: llvm/trunk/autoconf/m4/cxx_flag_check.m4
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/m4/cxx_flag_check.m4?rev=85147&view=auto
==============================================================================
--- llvm/trunk/autoconf/m4/cxx_flag_check.m4 (added)
+++ llvm/trunk/autoconf/m4/cxx_flag_check.m4 Mon Oct 26 14:58:44 2009
@@ -0,0 +1,2 @@
+AC_DEFUN([CXX_FLAG_CHECK],
+ [AC_SUBST($1, `$CXX $2 -fsyntax-only -xc /dev/null 2>/dev/null && echo $2`)])
More information about the llvm-commits
mailing list