use C compiler for tests again, it's useless to use the C++ one for AC_CHECK_FUNCS() test anyhow; do use WX_CHECK_FUNCS() instead of several AC_CHECK_FUNCS() where we need to make sure that the function declaration is available

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-11-09 15:30:37 +00:00
parent 83bef83edd
commit fd5199d66b
3 changed files with 7244 additions and 7524 deletions

View File

@@ -23,6 +23,9 @@ AC_DEFUN([AC_raf_FUNC_WHICH_GETSERVBYNAME_R],
AC_CACHE_CHECK(how many arguments getservbyname_r() takes, AC_CACHE_CHECK(how many arguments getservbyname_r() takes,
ac_cv_func_which_getservbyname_r, ac_cv_func_which_getservbyname_r,
[ [
dnl we need to use C++ to detect missing prototypes
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([#include <netdb.h>], AC_TRY_COMPILE([#include <netdb.h>],
[ [
char *name; char *name;
@@ -60,6 +63,7 @@ AC_CACHE_CHECK(how many arguments getservbyname_r() takes,
) )
] ]
) )
AC_LANG_POP()
] ]
) )

14723
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1444,12 +1444,6 @@ dnl is -traditional needed for correct compilations
dnl adds -traditional for gcc if needed dnl adds -traditional for gcc if needed
AC_PROG_GCC_TRADITIONAL 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 C++-compiler checks
dnl defines CXX with the compiler to use dnl defines CXX with the compiler to use
dnl defines GXX with yes if using gxx dnl defines GXX with yes if using gxx
@@ -1715,7 +1709,6 @@ case "${host}" in
dnl not "g++/c++". dnl not "g++/c++".
dnl --------------------------------------------------------------------- dnl ---------------------------------------------------------------------
dnl (OS/2-only piece) dnl (OS/2-only piece)
AC_LANG_PUSH(C)
if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
dnl More complete Unix emulation for unix-like ports dnl More complete Unix emulation for unix-like ports
dnl by linking in POSIX/2's cExt (if available). dnl by linking in POSIX/2's cExt (if available).
@@ -1759,7 +1752,6 @@ case "${host}" in
wx_cv_gccversion="EMX2" wx_cv_gccversion="EMX2"
) )
]) ])
AC_LANG_POP
if test "$wx_cv_gccversion" = "EMX2"; then if test "$wx_cv_gccversion" = "EMX2"; then
LIBS="$LIBS -lstdcpp" LIBS="$LIBS -lstdcpp"
LDFLAGS="$LDFLAGS -Zsysv-signals" LDFLAGS="$LDFLAGS -Zsysv-signals"
@@ -2495,9 +2487,9 @@ fi
dnl check for C99 string to long long conversion functions, assume that if we 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 dnl have the unsigned variants, then we have the signed ones as well
if test "wxUSE_UNICODE" = "yes"; then if test "wxUSE_UNICODE" = "yes"; then
AC_CHECK_FUNCS(wcstoull) WX_CHECK_FUNCS(wcstoull)
else else
AC_CHECK_FUNCS(strtoull) WX_CHECK_FUNCS(strtoull)
fi fi
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
@@ -2972,8 +2964,6 @@ if test "$wxUSE_GUI" = "yes"; then
if test "$wxUSE_GTK" = 1; then if test "$wxUSE_GTK" = 1; then
dnl GTK+ test program must be compiled with C compiler dnl GTK+ test program must be compiled with C compiler
AC_LANG_PUSH(C)
AC_MSG_CHECKING([for GTK+ version]) AC_MSG_CHECKING([for GTK+ version])
gtk_version_cached=1 gtk_version_cached=1
@@ -3137,8 +3127,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM)) AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
fi fi
AC_LANG_POP
dnl we need poll() in src/gtk/app.cpp (we know that Darwin doesn't 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) dnl have it but we do the check for the others)
if test "$USE_DARWIN" != 1; then if test "$USE_DARWIN" != 1; then
@@ -4339,6 +4327,8 @@ dnl stupidly, provides a dummy function declaration inside its extension)
dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails
dnl dnl
dnl so we first check if the function is in the library 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) AC_CHECK_FUNCS(snprintf vsnprintf)
if test "$ac_cv_func_vsnprintf" = "yes"; then if test "$ac_cv_func_vsnprintf" = "yes"; then
@@ -4540,8 +4530,7 @@ if test "$wxUSE_UNICODE" = yes; then
fi fi
fi fi
dnl also look if we have wide char IO functions WX_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
AC_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
dnl MinGW has a vswprintf with a different prototype, and dnl MinGW has a vswprintf with a different prototype, and
dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
@@ -4555,18 +4544,14 @@ if test "$wxUSE_UNICODE" = yes; then
fi fi
if test "x$ac_cv_header_fnmatch_h" = "xyes"; then if test "x$ac_cv_header_fnmatch_h" = "xyes"; then
AC_CHECK_FUNCS(fnmatch) WX_CHECK_FUNCS(fnmatch)
fi fi
if test "$wxUSE_FILE" = "yes"; then if test "$wxUSE_FILE" = "yes"; then
AC_CHECK_FUNCS(fsync) WX_CHECK_FUNCS(fsync)
fi
AC_CHECK_FUNCS(round)
if test "$ac_cv_func_round" = yes; then
AC_CHECK_DECLS(round,,,[#include <math.h>])
fi fi
WX_CHECK_FUNCS(round,,,[#include <math.h>])
dnl the following tests are for Unix(like) systems only dnl the following tests are for Unix(like) systems only
if test "$TOOLKIT" != "MSW"; then if test "$TOOLKIT" != "MSW"; then
@@ -4824,9 +4809,8 @@ if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
POSIX4_LINK=" -lposix4" POSIX4_LINK=" -lposix4"
], ],
[ [
AC_CHECK_FUNCS(usleep, WX_CHECK_FUNCS(usleep,,
AC_DEFINE(HAVE_USLEEP), AC_MSG_WARN([wxSleep() function will not work])
AC_MSG_WARN([wxSleep() function will not work])
) )
] ]
) )
@@ -4835,7 +4819,7 @@ if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
fi fi
dnl check for uname (POSIX) and gethostname (BSD) 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]) WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT])
@@ -7328,9 +7312,6 @@ dnl ---------------------------------------------------------------------------
dnl Output the makefiles and such from the results found above dnl Output the makefiles and such from the results found above
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl no more tests from here
AC_LANG_POP
dnl all additional libraries (except wxWidgets itself) we link with dnl all additional libraries (except wxWidgets itself) we link with
if test "$wxUSE_MAC" = 1 ; then if test "$wxUSE_MAC" = 1 ; then