From: Simon Josefsson Date: Mon, 25 Sep 2006 10:46:17 +0000 (+0000) Subject: Improve the C++ test, to handle CXX env. variables, suggested by X-Git-Tag: gnutls_1_5_2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c281184fde1564fbb76166cefd1ed39e7e5ebba;p=thirdparty%2Fgnutls.git Improve the C++ test, to handle CXX env. variables, suggested by Andreas Metzler . --- diff --git a/configure.in b/configure.in index db5f5db83b..03751e121d 100644 --- a/configure.in +++ b/configure.in @@ -93,17 +93,6 @@ AC_PROG_CXX AC_PROG_LN_S GTK_DOC_CHECK(1.1) -AC_ARG_ENABLE(cxx, - AS_HELP_STRING([--disable-cxx], - [unconditionally disable the C++ library]), - ac_enable_cxx=$enableval, ac_enable_cxx=yes) -if test -z "$ac_cv_prog_ac_ct_CXX"; then - ac_enable_cxx=no -fi -AM_CONDITIONAL(ENABLE_CXX, test "$ac_enable_cxx" != "no") -AC_MSG_CHECKING([whether to build C++ library]) -AC_MSG_RESULT($ac_enable_cxx) - AC_MSG_RESULT([*** *** Detecting compiler options... ]) @@ -112,6 +101,19 @@ gl_EARLY AC_C_CONST AC_C_INLINE +AC_ARG_ENABLE(cxx, + AS_HELP_STRING([--disable-cxx], + [unconditionally disable the C++ library]), + use_cxx=$enableval, use_cxx=yes) +if test "$use_cxx" != "no"; then + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no) + AC_LANG_POP(C++) +fi +AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no") +AC_MSG_CHECKING([whether to build C++ library]) +AC_MSG_RESULT($use_cxx) + AC_MSG_CHECKING([whether C99 macros are supported]) AC_TRY_COMPILE(,[ #define test_mac(...)