diff options
Diffstat (limited to 'test/m4/miscellaneous.m4')
-rw-r--r-- | test/m4/miscellaneous.m4 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/m4/miscellaneous.m4 b/test/m4/miscellaneous.m4 new file mode 100644 index 000000000..62178c9f2 --- /dev/null +++ b/test/m4/miscellaneous.m4 @@ -0,0 +1,23 @@ +########################################################################## +# Enable/disable test-cpp +########################################################################## +AC_ARG_ENABLE([test-cpp], + [AS_HELP_STRING([--disable-test-cpp], [run basic test against cpp] + [[default=enable-if-cpp-works]])], + [test_cpp=$enableval], + [test_cpp=check]) + +if test "x$test_cpp" != "xno" ; then + AC_CACHE_CHECK([if C++ compiler works], [odp_cv_cxx_works], + [AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [odp_cv_cxx_works=yes], + [odp_cv_cxx_works=no]) + AC_LANG_POP([C++])]) + AS_IF([test "x$test_cpp$odp_cv_cxx_works" = "xyesno"], + [AC_MSG_FAILURE([C++ compiler test failed])], + [test "x$test_cpp$odp_cv_cxx_works" = "xcheckno"], + [AC_MSG_NOTICE([disabling C++ test]) ; test_cpp=no], + [test_cpp=yes]) +fi + +AM_CONDITIONAL([test_cpp], [test x$test_cpp = xyes ]) |