use C++ compiler for the tests which do require it (from rev 1.1118 a.k.a. BEFORE_LANG_CXX)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-11-10 00:40:27 +00:00
parent f79a95423b
commit 224d4f6d7c

View File

@@ -2116,6 +2116,10 @@ if test "x$COMPAQCXX" = "xyes"; then
CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit" CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit"
fi fi
dnl the next few tests are all for C++ features and so need to be done using
dnl C++ compiler
AC_LANG_PUSH(C++)
dnl check for std::string or std::wstring dnl check for std::string or std::wstring
if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then
if test "$wxUSE_UNICODE" = "yes"; then if test "$wxUSE_UNICODE" = "yes"; then
@@ -2126,7 +2130,7 @@ if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then
char_type="char" char_type="char"
fi fi
dnl check if <string> declares std::wstring dnl check if <string> declares std::[w]string
AC_MSG_CHECKING([for $std_string in <string>]) AC_MSG_CHECKING([for $std_string in <string>])
AC_TRY_COMPILE([#include <string>], AC_TRY_COMPILE([#include <string>],
[$std_string foo;], [$std_string foo;],
@@ -2235,6 +2239,9 @@ if test "$wxUSE_STL" = "yes"; then
]) ])
fi fi
dnl pop C++
AC_LANG_POP()
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Define search path for includes and libraries: all headers and libs will be dnl Define search path for includes and libraries: all headers and libs will be
dnl looked for in all directories of this path dnl looked for in all directories of this path
@@ -2797,10 +2804,12 @@ if test "$wxUSE_EXPAT" != "no"; then
AC_CACHE_CHECK([if expat.h is valid C++ header], AC_CACHE_CHECK([if expat.h is valid C++ header],
wx_cv_expat_is_not_broken, wx_cv_expat_is_not_broken,
[ [
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([#include <expat.h>],[], AC_TRY_COMPILE([#include <expat.h>],[],
wx_cv_expat_is_not_broken=yes, wx_cv_expat_is_not_broken=yes,
wx_cv_expat_is_not_broken=no wx_cv_expat_is_not_broken=no
) )
AC_LANG_POP()
] ]
) )
if test "$wx_cv_expat_is_not_broken" = "yes" ; then if test "$wx_cv_expat_is_not_broken" = "yes" ; then
@@ -4185,6 +4194,7 @@ AC_CHECK_TYPES(ssize_t)
dnl check what exactly size_t is on this machine - this is necessary to avoid dnl check what exactly size_t is on this machine - this is necessary to avoid
dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h
AC_LANG_PUSH(C++) dnl tests below use overloaded functions and so need C++
AC_CACHE_CHECK([if size_t is unsigned int], AC_CACHE_CHECK([if size_t is unsigned int],
wx_cv_size_t_is_uint, wx_cv_size_t_is_uint,
[ [
@@ -4231,6 +4241,8 @@ else
fi fi
fi fi
AC_LANG_POP() dnl C++
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Checks for structures dnl Checks for structures
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
@@ -4573,6 +4585,8 @@ if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler, AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
[ [
dnl C compiler happily compiles the code even if there is type mismatch
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([#include <signal.h>], AC_TRY_COMPILE([#include <signal.h>],
[ [
extern void testSigHandler(int); extern void testSigHandler(int);
@@ -4584,6 +4598,7 @@ if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
], [ ], [
wx_cv_type_sa_handler=void wx_cv_type_sa_handler=void
]) ])
AC_LANG_POP()
]) ])
AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler) AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
@@ -4594,6 +4609,7 @@ dnl backtrace() and backtrace_symbols() for wxStackWalker
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace, AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
[ [
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([#include <execinfo.h>], AC_TRY_COMPILE([#include <execinfo.h>],
[ [
void *trace[1]; void *trace[1];
@@ -4605,6 +4621,7 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
wx_cv_func_backtrace=yes, wx_cv_func_backtrace=yes,
wx_cv_func_backtrace=no wx_cv_func_backtrace=no
) )
AC_LANG_POP()
] ]
) )
@@ -4615,6 +4632,7 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
else else
AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle, AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
[ [
AC_LANG_PUSH(C++)
AC_TRY_LINK([#include <cxxabi.h>], AC_TRY_LINK([#include <cxxabi.h>],
[ [
int rc; int rc;
@@ -4623,6 +4641,7 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
wx_cv_func_cxa_demangle=yes, wx_cv_func_cxa_demangle=yes,
wx_cv_func_cxa_demangle=no wx_cv_func_cxa_demangle=no
) )
AC_LANG_POP()
] ]
) )
@@ -4669,6 +4688,7 @@ AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
if test "$wx_cv_func_statfs" = "yes"; then if test "$wx_cv_func_statfs" = "yes"; then
dnl check whether we have its dcelaration too: some systems (AIX 4) lack it dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl, AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl,
AC_LANG_PUSH(C++)
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#if defined(__BSD__) #if defined(__BSD__)
@@ -4685,6 +4705,7 @@ if test "$wx_cv_func_statfs" = "yes"; then
wx_cv_func_statfs_decl=yes, wx_cv_func_statfs_decl=yes,
wx_cv_func_statfs_decl=no wx_cv_func_statfs_decl=no
) )
AC_LANG_POP()
) )
if test "$wx_cv_func_statfs_decl" = "yes"; then if test "$wx_cv_func_statfs_decl" = "yes"; then
@@ -4717,6 +4738,7 @@ else
dnl for this check C++ compiler has to be used as passing incompatible dnl for this check C++ compiler has to be used as passing incompatible
dnl pointers is just a warning and not an error in C dnl pointers is just a warning and not an error in C
AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t, AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t,
AC_LANG_PUSH(C++)
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#include <sys/statvfs.h> #include <sys/statvfs.h>
@@ -4748,6 +4770,7 @@ else
) )
] ]
) )
AC_LANG_POP()
) )
if test "$wx_cv_type_statvfs_t" != "unknown"; then if test "$wx_cv_type_statvfs_t" != "unknown"; then
@@ -5904,10 +5927,12 @@ dnl ---------------------------------------------------------------------------
if test "$wxUSE_DATETIME" = "yes"; then if test "$wxUSE_DATETIME" = "yes"; then
dnl check for strptime and for its declaration as some systems lack it dnl check for strptime and for its declaration as some systems lack it
dnl FIXME: use WX_CHECK_FUNCS instead
AC_CHECK_FUNCS(strptime) AC_CHECK_FUNCS(strptime)
if test "$ac_cv_func_strptime" = "yes"; then if test "$ac_cv_func_strptime" = "yes"; then
AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl, AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl,
[ [
AC_LANG_PUSH(C++)
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#include <time.h> #include <time.h>
@@ -5919,6 +5944,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
wx_cv_func_strptime_decl=yes, wx_cv_func_strptime_decl=yes,
wx_cv_func_strptime_decl=no wx_cv_func_strptime_decl=no
) )
AC_LANG_POP()
] ]
) )
fi fi
@@ -6100,6 +6126,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
AC_CACHE_CHECK([what is the type of the third argument of getsockname], AC_CACHE_CHECK([what is the type of the third argument of getsockname],
wx_cv_type_getsockname3, wx_cv_type_getsockname3,
[ [
AC_LANG_PUSH(C++)
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#include <sys/types.h> #include <sys/types.h>
@@ -6149,6 +6176,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
CXXFLAGS="$CXXFLAGS_OLD" CXXFLAGS="$CXXFLAGS_OLD"
] ]
) )
AC_LANG_POP()
]) ])
if test "$wx_cv_type_getsockname3" = "unknown"; then if test "$wx_cv_type_getsockname3" = "unknown"; then
@@ -6286,12 +6314,14 @@ if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then
if test "$USE_DARWIN" = 1; then if test "$USE_DARWIN" = 1; then
dnl check for a bug in the headers, some have bad setEventCallout dnl check for a bug in the headers, some have bad setEventCallout
AC_MSG_CHECKING([headers have declarations needed for joystick support]) AC_MSG_CHECKING([headers have declarations needed for joystick support])
AC_LANG_PUSH(C++)
AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ], AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ],
[ IOHIDQueueInterface *qi = NULL; [ IOHIDQueueInterface *qi = NULL;
IOHIDCallbackFunction cb = NULL; IOHIDCallbackFunction cb = NULL;
qi->setEventCallout(NULL, cb, NULL, NULL); ], qi->setEventCallout(NULL, cb, NULL, NULL); ],
[ wxUSE_JOYSTICK=yes ] [ wxUSE_JOYSTICK=yes ]
) )
AC_LANG_POP()
AC_MSG_RESULT($wxUSE_JOYSTICK) AC_MSG_RESULT($wxUSE_JOYSTICK)
fi fi