diff --git a/Makefile.in b/Makefile.in index 68f79c0ad..8870f6cc0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,7 +89,6 @@ datarootdir = @datarootdir@ CFG_WITH_CCWARN = @CFG_WITH_CCWARN@ CFG_WITH_DEFENV = @CFG_WITH_DEFENV@ CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@ -CFG_WITH_THREADED = @CFG_WITH_THREADED@ PACKAGE_VERSION = @PACKAGE_VERSION@ #### End of system configuration section. #### @@ -546,9 +545,6 @@ dist-file-list: @echo $(wildcard $(DISTFILES)) @echo "end-dist-file-list:"; # Scripts look for this -print-cfg-with-threaded: - @echo $(CFG_WITH_THREADED) - ###################################################################### # Distributions diff --git a/configure.ac b/configure.ac index e0c7b9983..de9d56c13 100644 --- a/configure.ac +++ b/configure.ac @@ -394,12 +394,17 @@ _MY_LDLIBS_CHECK_IFELSE( fi]) AC_SUBST(CFG_LIBS) -# Set CFG_WITH_THREADED if can support threading -AC_MSG_CHECKING(whether $CXX supports Verilated threads) -ACO_SAVE_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD_NEWEST $CFG_CXXFLAGS_NO_UNUSED" -AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], [[ ]])], +# Need C++11 at least +#Alternative: AX_CXX_COMPILE_STDCXX([11]) +AC_DEFUN([_MY_CXX_CHECK_CXX_VER], + [# _MY_CXX_CHECK_CXX_VER(flag) -- Check if compiler runs C++11 + # Set $_my_result + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include +#if (__cplusplus < 201103L) +# error "Too old" +#endif + ], [[ ]])], [_my_result=yes if test -s conftest.err; then if grep -e "$1" conftest.err >/dev/null; then @@ -407,13 +412,18 @@ AC_LINK_IFELSE( fi fi], [_my_result=no]) -CFG_WITH_THREADED=$_my_result -AC_SUBST(CFG_WITH_THREADED) -AC_MSG_RESULT($CFG_WITH_THREADED) -CXXFLAGS="$ACO_SAVE_CXXFLAGS" + ]) -# Check compiler flag -if test "$CFG_WITH_THREADED" = "no" ; then +AC_MSG_CHECKING(whether $CXX supports C++11) +_MY_CXX_CHECK_CXX_VER() +AC_MSG_RESULT($_my_result) +if test "$_my_result" = "no" ; then + CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD_NEWEST" + AC_MSG_CHECKING(whether $CXX supports C++11 with $CFG_CXXFLAGS_STD_NEWEST) + _MY_CXX_CHECK_CXX_VER() + AC_MSG_RESULT($_my_result) +fi +if test "$_my_result" = "no" ; then AC_MSG_NOTICE([[]]) AC_MSG_ERROR([[the $CXX compiler appears to not support C++11. diff --git a/include/verilatedos.h b/include/verilatedos.h index 4ababb153..7ba4ff55c 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -122,7 +122,7 @@ # if defined(_MSC_VER) && _MSC_VER >= 1900 # define VL_THREAD_LOCAL thread_local # elif defined(__GNUC__) -# if (__cplusplus < 201103L) && !defined(VL_THREADED_NO_C11_WARNING) +# if (__cplusplus < 201103L) # error "VL_THREADED/--threads support requires C++-11 or newer only; use newer compiler" # endif # else diff --git a/test_regress/driver.pl b/test_regress/driver.pl index d4b12ddb5..4e668eee6 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -2250,10 +2250,8 @@ sub cxx_version { return $_Cxx_Version; } -our $_Cfg_With_Threaded; sub cfg_with_threaded { - $_Cfg_With_Threaded ||= `$ENV{MAKE} -C $ENV{VERILATOR_ROOT} -f Makefile print-cfg-with-threaded`; - return ($_Cfg_With_Threaded =~ /yes/i) ? 1:0; + return 1; # C++11 now always required } sub tries {