git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43251
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit"
fi
CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit"
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
if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then
if test "$wxUSE_UNICODE" = "yes"; then
dnl check for std::string or std::wstring
if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then
if test "$wxUSE_UNICODE" = "yes"; then
- dnl check if <string> declares std::wstring
+ dnl check if <string> declares std::[w]string
AC_MSG_CHECKING([for $std_string in <string>])
AC_TRY_COMPILE([#include <string>],
[$std_string foo;],
AC_MSG_CHECKING([for $std_string in <string>])
AC_TRY_COMPILE([#include <string>],
[$std_string foo;],
+dnl pop C++
+AC_LANG_POP()
+
dnl ---------------------------------------------------------------------------
dnl Define search path for includes and libraries: all headers and libs will be
dnl looked for in all directories of this path
dnl ---------------------------------------------------------------------------
dnl Define search path for includes and libraries: all headers and libs will be
dnl looked for in all directories of this path
AC_CACHE_CHECK([if expat.h is valid C++ header],
wx_cv_expat_is_not_broken,
[
AC_CACHE_CHECK([if expat.h is valid C++ header],
wx_cv_expat_is_not_broken,
[
AC_TRY_COMPILE([#include <expat.h>],[],
wx_cv_expat_is_not_broken=yes,
wx_cv_expat_is_not_broken=no
)
AC_TRY_COMPILE([#include <expat.h>],[],
wx_cv_expat_is_not_broken=yes,
wx_cv_expat_is_not_broken=no
)
]
)
if test "$wx_cv_expat_is_not_broken" = "yes" ; then
]
)
if test "$wx_cv_expat_is_not_broken" = "yes" ; then
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 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
+AC_LANG_PUSH(C++) dnl tests below use overloaded functions and so need C++
AC_CACHE_CHECK([if size_t is unsigned int],
wx_cv_size_t_is_uint,
[
AC_CACHE_CHECK([if size_t is unsigned int],
wx_cv_size_t_is_uint,
[
dnl ---------------------------------------------------------------------------
dnl Checks for structures
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl Checks for structures
dnl ---------------------------------------------------------------------------
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
[
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
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>],
[
extern void testSigHandler(int);
AC_TRY_COMPILE([#include <signal.h>],
[
extern void testSigHandler(int);
], [
wx_cv_type_sa_handler=void
])
], [
wx_cv_type_sa_handler=void
])
])
AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
])
AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
[
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
[
AC_TRY_COMPILE([#include <execinfo.h>],
[
void *trace[1];
AC_TRY_COMPILE([#include <execinfo.h>],
[
void *trace[1];
wx_cv_func_backtrace=yes,
wx_cv_func_backtrace=no
)
wx_cv_func_backtrace=yes,
wx_cv_func_backtrace=no
)
else
AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
[
else
AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
[
AC_TRY_LINK([#include <cxxabi.h>],
[
int rc;
AC_TRY_LINK([#include <cxxabi.h>],
[
int rc;
wx_cv_func_cxa_demangle=yes,
wx_cv_func_cxa_demangle=no
)
wx_cv_func_cxa_demangle=yes,
wx_cv_func_cxa_demangle=no
)
if test "$wx_cv_func_statfs" = "yes"; then
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,
if test "$wx_cv_func_statfs" = "yes"; then
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_TRY_COMPILE(
[
#if defined(__BSD__)
AC_TRY_COMPILE(
[
#if defined(__BSD__)
wx_cv_func_statfs_decl=yes,
wx_cv_func_statfs_decl=no
)
wx_cv_func_statfs_decl=yes,
wx_cv_func_statfs_decl=no
)
)
if test "$wx_cv_func_statfs_decl" = "yes"; then
)
if test "$wx_cv_func_statfs_decl" = "yes"; then
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
AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t,
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
AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t,
AC_TRY_COMPILE(
[
#include <sys/statvfs.h>
AC_TRY_COMPILE(
[
#include <sys/statvfs.h>
)
if test "$wx_cv_type_statvfs_t" != "unknown"; then
)
if test "$wx_cv_type_statvfs_t" != "unknown"; then
if test "$wxUSE_DATETIME" = "yes"; then
dnl check for strptime and for its declaration as some systems lack it
if test "$wxUSE_DATETIME" = "yes"; then
dnl check for strptime and for its declaration as some systems lack it
+ dnl FIXME: use WX_CHECK_FUNCS instead
AC_CHECK_FUNCS(strptime)
if test "$ac_cv_func_strptime" = "yes"; then
AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl,
[
AC_CHECK_FUNCS(strptime)
if test "$ac_cv_func_strptime" = "yes"; then
AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl,
[
AC_TRY_COMPILE(
[
#include <time.h>
AC_TRY_COMPILE(
[
#include <time.h>
wx_cv_func_strptime_decl=yes,
wx_cv_func_strptime_decl=no
)
wx_cv_func_strptime_decl=yes,
wx_cv_func_strptime_decl=no
)
AC_CACHE_CHECK([what is the type of the third argument of getsockname],
wx_cv_type_getsockname3,
[
AC_CACHE_CHECK([what is the type of the third argument of getsockname],
wx_cv_type_getsockname3,
[
AC_TRY_COMPILE(
[
#include <sys/types.h>
AC_TRY_COMPILE(
[
#include <sys/types.h>
CXXFLAGS="$CXXFLAGS_OLD"
]
)
CXXFLAGS="$CXXFLAGS_OLD"
]
)
])
if test "$wx_cv_type_getsockname3" = "unknown"; then
])
if test "$wx_cv_type_getsockname3" = "unknown"; then
if test "$USE_DARWIN" = 1; then
dnl check for a bug in the headers, some have bad setEventCallout
AC_MSG_CHECKING([headers have declarations needed for joystick support])
if test "$USE_DARWIN" = 1; then
dnl check for a bug in the headers, some have bad setEventCallout
AC_MSG_CHECKING([headers have declarations needed for joystick support])
AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ],
[ IOHIDQueueInterface *qi = NULL;
IOHIDCallbackFunction cb = NULL;
qi->setEventCallout(NULL, cb, NULL, NULL); ],
[ wxUSE_JOYSTICK=yes ]
)
AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ],
[ IOHIDQueueInterface *qi = NULL;
IOHIDCallbackFunction cb = NULL;
qi->setEventCallout(NULL, cb, NULL, NULL); ],
[ wxUSE_JOYSTICK=yes ]
)
AC_MSG_RESULT($wxUSE_JOYSTICK)
fi
AC_MSG_RESULT($wxUSE_JOYSTICK)
fi