dnl adds -traditional for gcc if needed
AC_PROG_GCC_TRADITIONAL
-dnl do all checks from now on using the C++ compiler: this saves us a lot of
-dnl problems with various functions which may be available in libc but not
-dnl declared in the header and various pointer conversions which compile with
-dnl the C compiler but not in C++
-AC_LANG_PUSH(C++)
-
dnl C++-compiler checks
dnl defines CXX with the compiler to use
dnl defines GXX with yes if using gxx
dnl not "g++/c++".
dnl ---------------------------------------------------------------------
dnl (OS/2-only piece)
- AC_LANG_PUSH(C)
if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
dnl More complete Unix emulation for unix-like ports
dnl by linking in POSIX/2's cExt (if available).
wx_cv_gccversion="EMX2"
)
])
- AC_LANG_POP
if test "$wx_cv_gccversion" = "EMX2"; then
LIBS="$LIBS -lstdcpp"
LDFLAGS="$LDFLAGS -Zsysv-signals"
dnl Check for headers
dnl ------------------------------------------------------------------------
-dnl defines HAVE_STDLIB_H
-AC_CHECK_HEADERS(stdlib.h)
-dnl defines HAVE_MALLOC_H
-AC_CHECK_HEADERS(malloc.h)
-dnl defines HAVE_UNISTD_H
-AC_CHECK_HEADERS(unistd.h)
-dnl defines HAVE_WCHAR_H
-AC_CHECK_HEADERS(wchar.h)
+AC_CHECK_HEADERS(stdlib.h fnmatch.h langinfo.h malloc.h unistd.h wchar.h)
dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
if test "$ac_cv_header_wchar_h" != "yes"; then
- dnl defines HAVE_WCSTR_H
AC_CHECK_HEADERS(wcstr.h)
fi
-dnl defines HAVE_FNMATCH_H
-AC_CHECK_HEADERS(fnmatch.h)
-
-dnl defines HAVE_LANGINFO_H (GNU libc locale parameters)
-AC_CHECK_HEADERS(langinfo.h)
-
case "${host}" in
*-pc-os2_emx | *-pc-os2-emx )
dnl Explicitly link -lintl if langinfo.h is available
dnl check for C99 string to long long conversion functions, assume that if we
dnl have the unsigned variants, then we have the signed ones as well
if test "wxUSE_UNICODE" = "yes"; then
- AC_CHECK_FUNCS(wcstoull)
+ WX_CHECK_FUNCS(wcstoull)
else
- AC_CHECK_FUNCS(strtoull)
+ WX_CHECK_FUNCS(strtoull)
fi
dnl ---------------------------------------------------------------------------
if test "$wxUSE_GTK" = 1; then
dnl GTK+ test program must be compiled with C compiler
- AC_LANG_PUSH(C)
-
AC_MSG_CHECKING([for GTK+ version])
gtk_version_cached=1
AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
fi
- AC_LANG_POP
-
dnl we need poll() in src/gtk/app.cpp (we know that Darwin doesn't
dnl have it but we do the check for the others)
if test "$USE_DARWIN" != 1; then
dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails
dnl
dnl so we first check if the function is in the library
+dnl
+dnl FIXME: replace this mess with WX_CHECK_FUNCS()
AC_CHECK_FUNCS(snprintf vsnprintf)
if test "$ac_cv_func_vsnprintf" = "yes"; then
fi
fi
- dnl also look if we have wide char IO functions
- AC_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
+ dnl also look if we have wide char IO functions, notice that [f]putws are
+ dnl declared in special widec.h under Solaris
+ wchar_headers="#include <stdio.h>
+#include <wchar.h>"
+ case "${host}" in
+ *-*-solaris2* )
+ AC_CHECK_HEADERS(widec.h)
+ if test "$ac_cv_header_widec_h" = "yes"; then
+ wchar_headers="$wchar_headers
+#include <widec.h>"
+ fi
+ esac
+
+ WX_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf,,,
+ [$wchar_headers])
dnl MinGW has a vswprintf with a different prototype, and
dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
fi
if test "x$ac_cv_header_fnmatch_h" = "xyes"; then
- AC_CHECK_FUNCS(fnmatch)
+ WX_CHECK_FUNCS(fnmatch)
fi
if test "$wxUSE_FILE" = "yes"; then
- AC_CHECK_FUNCS(fsync)
-fi
-
-AC_CHECK_FUNCS(round)
-if test "$ac_cv_func_round" = yes; then
- AC_CHECK_DECLS(round,,,[#include <math.h>])
+ WX_CHECK_FUNCS(fsync)
fi
+WX_CHECK_FUNCS(round,,,[#include <math.h>])
dnl the following tests are for Unix(like) systems only
if test "$TOOLKIT" != "MSW"; then
POSIX4_LINK=" -lposix4"
],
[
- AC_CHECK_FUNCS(usleep,
- AC_DEFINE(HAVE_USLEEP),
- AC_MSG_WARN([wxSleep() function will not work])
+ WX_CHECK_FUNCS(usleep,,
+ AC_MSG_WARN([wxSleep() function will not work])
)
]
)
fi
dnl check for uname (POSIX) and gethostname (BSD)
-AC_CHECK_FUNCS(uname gethostname, break)
+WX_CHECK_FUNCS(uname gethostname, break)
WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT])
dnl Output the makefiles and such from the results found above
dnl ---------------------------------------------------------------------------
-dnl no more tests from here
-AC_LANG_POP
-
dnl all additional libraries (except wxWidgets itself) we link with
if test "$wxUSE_MAC" = 1 ; then