diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2017-05-16 23:31:23 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-05-16 09:31:23 -0400 |
commit | 34b599ea3c994498b53ec1c9deb62914b9798b0b (patch) | |
tree | 213bd3cee844863197566b319e8958b67d03886e /build_posix | |
parent | 35d41e49f6a95804866ac8a791b267d005a3027d (diff) | |
download | mongo-34b599ea3c994498b53ec1c9deb62914b9798b0b.tar.gz |
WT-3142 Check if C++ works in autoconf, not just if a variable is set. (#3421)
Diffstat (limited to 'build_posix')
-rw-r--r-- | build_posix/configure.ac.in | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in index 68b4d84ba59..4de12d5161e 100644 --- a/build_posix/configure.ac.in +++ b/build_posix/configure.ac.in @@ -24,7 +24,16 @@ AM_PROG_AS(as gas) define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl -AM_CONDITIONAL([HAVE_CXX], [test "$CXX" != ""]) + +# Check whether the C++ compiler works by linking a trivial program. +AC_CACHE_CHECK([whether the C++ compiler works], + [wt_cv_prog_cxx_works], + [AC_LANG_PUSH([C++]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [wt_cv_prog_cxx_works=yes], + [wt_cv_prog_cxx_works=no]) + AC_LANG_POP([C++])]) +AM_CONDITIONAL([HAVE_CXX], [test "$wt_cv_prog_cxx_works" = "yes"]) LT_PREREQ(2.2.6) LT_INIT([pic-only]) |