]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Improve the C++ test, to handle CXX env. variables, suggested by
authorSimon Josefsson <simon@josefsson.org>
Mon, 25 Sep 2006 10:46:17 +0000 (10:46 +0000)
committerSimon Josefsson <simon@josefsson.org>
Mon, 25 Sep 2006 10:46:17 +0000 (10:46 +0000)
Andreas Metzler <ametzler@downhill.at.eu.org>.

configure.in

index db5f5db83b8d40d73dad34a0fe9d6e24e3467693..03751e121d8bf1dd11f14863cf08cc829ffdacd6 100644 (file)
@@ -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(...)