From 81f93e4aafbb83adf3c8b44b0cb81e1f3bac9776 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 3 Apr 2015 08:53:21 +0000 Subject: Fix warnings in C++ codes; check for additional C++ compiler options. --- config/open-axiom.m4 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'config') diff --git a/config/open-axiom.m4 b/config/open-axiom.m4 index 706f5919..c7b4250f 100644 --- a/config/open-axiom.m4 +++ b/config/open-axiom.m4 @@ -254,6 +254,31 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_ERROR([OpenAxiom requires a C++11 compiler])]) ]) +dnl ------------------------------- +dnl -- OPENAXIOM_CXX_GROK_OPTION -- +dnl ------------------------------- +dnl Check whether the C++ compiler accepts a given option. +dnl In case of success, augment the accumulator passed in +dnl (optional) second argument -- default: CXXFLAGS. +AC_DEFUN([OPENAXIOM_CXX_GROK_OPTION], [ +opt=$1 # mandatory +accumulator=$2 # optional +if test -z $accumulator; then + accumulator=CXXFLAGS +fi +current_options=\$${accumulator} +oa_saved_cxxflags="$CXXFLAGS" +AC_MSG_CHECKING([whether $CXX supports "$opt"]) +CXXFLAGS="$CXXFLAGS $opt" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [CXXFLAGS=$oa_saved_cxxflags] + [eval "$accumulator=\"$current_options $opt\""], + [AC_MSG_RESULT([no])] + [CXXFLAGS=$oa_saved_cxxflags]) +]) + + dnl -------------------------- dnl -- OPENAXIOM_CHECK_LLVM -- dnl -------------------------- @@ -325,6 +350,17 @@ OPENAXIOM_CPPFLAGS_FOR_VENDOR_LOCK_INS OPENAXIOM_CHECK_LLVM ]) +dnl --------------------------------- +dnl -- OPENAXIOM_CXX_EXTRA_OPTIONS -- +dnl --------------------------------- +AC_DEFUN([OPENAXIOM_EXTRA_CXX_OPTIONS], [ +oa_extra_cxxflags= +OPENAXIOM_CXX_GROK_OPTIONS([-Wno-mismatch-tags],[oa_extra_cxxflags]) +OPENAXIOM_CXX_GROK_OPTIONS([-Wno-string-plus-int],[oa_extra_cxxflags]) + +AC_SUBST(oa_extra_cxxflags) +]) + dnl --------------------------------- dnl -- OPENAXIOM_SATISFY_GCL_NEEDS -- dnl --------------------------------- -- cgit v1.2.3