diff --git a/configure.in b/configure.in index 96a9d16796..1c3b363277 100644 --- a/configure.in +++ b/configure.in @@ -563,30 +563,19 @@ AC_CHECK_LIB(supc++, main, XE_APPEND(-lsupc++, STATIC_CXXSUPPORT_LIB)) AC_CHECK_LIB(gcc_eh, main, XE_APPEND(-lgcc_eh, STATIC_CXXSUPPORT_LIB)) AC_SUBST(STATIC_CXXSUPPORT_LIB) +AC_LANG_PUSH(C++) dnl check for INFINITY in math.h -dnl _ISOC99_SOURCE is defined to emulate C++ compilation in plain-C conftest.c -AC_TRY_COMPILE([#define _ISOC99_SOURCE 1 -#include ], - [double x = INFINITY;], - [AC_DEFINE(HAVE_INFINITY, 1, - [Define this if INFINITY is defined in math.h])]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], [[double x = INFINITY;]])], + AC_DEFINE(HAVE_INFINITY, 1, [Define this if INFINITY is defined in math.h])) dnl check for va_copy() in stdarg.h -dnl _ISOC99_SOURCE is defined to emulate C++ compilation in plain-C conftest.c -AC_TRY_COMPILE([#define _ISOC99_SOURCE 1 -#include -void vafun(const char* fmt, ...) -{ - va_list par, par2; - va_start(par, fmt); - va_copy(par2, par); - va_end(par2); - va_end(par); -} -], - [exit(0);], - [AC_DEFINE(HAVE_VA_COPY, 1, - [Define this if va_copy() is defined in stdarg.h])]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + void vafun(const char* fmt, ...) {va_list par, par2; va_start(par, fmt); va_copy(par2, par); va_end(par2); va_end(par);}]], + [[return 0;]])], + AC_DEFINE(HAVE_VA_COPY, 1, [Define this if va_copy() is defined in stdarg.h])) +AC_LANG_POP(C++) dnl Check for functions AC_CHECK_FUNCS(gettimeofday)