if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
WX_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
- dnl we get "Large Files (ILP32) not supported in strict ANSI mode."
- dnl #error from HP standard headers when compiling with g++ without this
- dnl
- dnl NB: gcc defines __STDC_EXT__=1 for C code, but not for C++, hence
- dnl we do this only for CXXFLAGS and not CPPFLAGS
+ dnl We get "Large Files (ILP32) not supported in strict ANSI mode."
+ dnl #error from HP standard headers unless __STDC_EXT__ is defined.
+ dnl The compiler should define it automatically, but some old g++
+ dnl versions don't define it, so test and add it if necessary. AFAIK
+ dnl the problem only affects the C++ compiler so it is added to
+ dnl CXXFLAGS only.
if test "$USE_HPUX" = 1 -a "$GXX" = "yes"; then
- CXXFLAGS="$CXXFLAGS -D__STDC_EXT__=1"
+ AC_CACHE_CHECK(
+ [if -D__STDC_EXT__ is required],
+ wx_cv_STDC_EXT_required,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(
+ [],
+ [
+ #ifndef __STDC_EXT__
+ choke me
+ #endif
+ ],
+ wx_cv_STDC_EXT_required=no,
+ wx_cv_STDC_EXT_required=yes
+ )
+ AC_LANG_RESTORE
+ ]
+ )
+ if test "x$wx_cv_STDC_EXT_required" = "xyes"; then
+ CXXFLAGS="$CXXFLAGS -D__STDC_EXT__"
+ fi
fi
else
WX_LARGEFILE_FLAGS="-D_LARGE_FILES"
AC_TRY_COMPILE([#include <features.h>],
[
#if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1)
- #error not glibc2.1
+ not glibc 2.1
#endif
],
[
],
[
#if !GTK_CHECK_VERSION(2,4,0)
- #error "Not GTK+ 2.4"
+ Not GTK+ 2.4
#endif
],
[
],
[
#if XmVersion < 2000
- #error "Not Motif 2"
+ Not Motif 2
#endif
],
[
],
[
#if !defined(LesstifVersion) || LesstifVersion <= 0
- #error "Not Lesstif"
+ Not Lesstif
#endif
],
[
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
-AC_CHECK_FUNCS(vsnprintf)
+AC_CHECK_FUNCS(snprintf vsnprintf)
if test "$ac_cv_func_vsnprintf" = "yes"; then
dnl yes it is -- now check if it is in the headers
fi
fi
+dnl the same as above but for snprintf() now: it's not present in at least AIX
+dnl 4.2 headers
+if test "$ac_cv_func_snprintf" = "yes"; then
+ AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl,
+ [
+ AC_TRY_COMPILE(
+ [
+ #include <stdio.h>
+ #include <stdarg.h>
+ #ifdef __MSL__
+ #if __MSL__ >= 0x6000
+ namespace std {}
+ using namespace std;
+ #endif
+ #endif
+ ],
+ [
+ char *buf;
+ const char *fmt = "%s";
+ snprintf(buf, 10u, fmt, "wx");
+ ],
+ wx_cv_func_snprintf_decl=yes,
+ wx_cv_func_snprintf_decl=no
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_snprintf_decl" = "yes"; then
+ AC_DEFINE(HAVE_SNPRINTF_DECL)
+ fi
+fi
+
if test "$wxUSE_UNICODE" = yes; then
dnl also look if we have wide char IO functions
AC_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
AC_TRY_COMPILE(
[
#if defined(__BSD__)
- #include <sys/param.h>
- #include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/mount.h>
#else
- #include <sys/vfs.h>
+ #include <sys/vfs.h>
#endif
],
[
l += fs.f_blocks;
l += fs.f_bavail;
],
- [
- wx_cv_func_statfs=yes
- ],
- [
- wx_cv_func_statfs=no
- ]
+ wx_cv_func_statfs=yes,
+ wx_cv_func_statfs=no
)
)
if test "$wx_cv_func_statfs" = "yes"; then
+ dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl,
+ AC_TRY_COMPILE(
+ [
+ #if defined(__BSD__)
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ #else
+ #include <sys/vfs.h>
+ #endif
+ ],
+ [
+ struct statfs fs;
+ statfs("", &fs);
+ ],
+ wx_cv_func_statfs_decl=yes,
+ wx_cv_func_statfs_decl=no
+ )
+ )
+ AC_LANG_RESTORE
+
+ if test "$wx_cv_func_statfs_decl" = "yes"; then
+ AC_DEFINE(HAVE_STATFS_DECL)
+ fi
+
wx_cv_type_statvfs_t="struct statfs"
AC_DEFINE(HAVE_STATFS)
else
;;
*-hp-hpux* )
if test "x$GCC" = "xyes"; then
- dnl the correct option for gcc is -threads, at least under
- dnl HP-UX 11.00
- THREAD_OPTS="-threads"
- fi
+ dnl g++ versions before 3.3.2 don't support -pthread.
+ $CXX -dumpspecs | grep 'pthread:' >/dev/null ||
+ THREAD_OPTS=""
+ else
dnl HP-UX aCC only gives a warning, not an error about
dnl -pthread but it doesn't work and we have to use
dnl -lpthread there
AC_MSG_CHECKING([if this GCC version is >= 4.0 and needs -DNO_GCC_PRAGMA])
AC_TRY_COMPILE([],
[#if (__GNUC__ < 4)
- #error "Not GCC 4.0 or greater"
+ Not GCC 4.0 or greater
#endif
],
[GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
AC_MSG_CHECKING([if this MinGW version needs -DNO_GCC_PRAGMA])
AC_TRY_COMPILE([],
[#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
- #error "Not GCC 3.2 or greater"
+ Not GCC 3.2 or greater
#endif
],
[GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
AC_MSG_CHECKING([if this gcc version needs -DNO_GCC_PRAGMA])
AC_TRY_COMPILE([],
[#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
- #error "Not GCC 3.2 or greater"
+ Not GCC 3.2 or greater
#endif
],
[GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"