aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2015-04-03 08:53:21 +0000
committerdos-reis <gdr@axiomatics.org>2015-04-03 08:53:21 +0000
commit81f93e4aafbb83adf3c8b44b0cb81e1f3bac9776 (patch)
tree1b067c5485edc771d8d8b5bbaf6d8e882825a69e /config
parentb75f75e80ea1130b3d3f21d5c0da1789ce988d1c (diff)
downloadopen-axiom-81f93e4aafbb83adf3c8b44b0cb81e1f3bac9776.tar.gz
Fix warnings in C++ codes; check for additional C++ compiler options.
Diffstat (limited to 'config')
-rw-r--r--config/open-axiom.m436
1 files changed, 36 insertions, 0 deletions
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 --------------------------
@@ -326,6 +351,17 @@ 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 ---------------------------------
dnl GCL assumes that the C compiler is from GNU.