]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
added wxChoice:: and wxCombobox::GetCurrentSelection()
[wxWidgets.git] / configure.in
index 2fa602b9697db3abbc585b48190b03bdea1eff88..48e3f3edac7b0d00c60f78fa887713ca5b3ed300 100644 (file)
@@ -1873,13 +1873,35 @@ if test "x$wx_largefile" = "xyes"; then
     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"
@@ -2187,7 +2209,7 @@ if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then
         AC_TRY_COMPILE([#include <features.h>],
             [
                 #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1)
-                    #error not glibc2.1
+                not glibc 2.1
                 #endif
             ],
             [
@@ -2783,7 +2805,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
                            ],
                            [
                             #if !GTK_CHECK_VERSION(2,4,0)
-                            #error "Not GTK+ 2.4"
+                            Not GTK+ 2.4
                             #endif
                            ],
                            [
@@ -3149,7 +3171,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
                        ],
                        [
                         #if XmVersion < 2000
-                        #error "Not Motif 2"
+                        Not Motif 2
                         #endif
                        ],
                        [
@@ -3167,7 +3189,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
                        ],
                        [
                         #if !defined(LesstifVersion) || LesstifVersion <= 0
-                        #error "Not Lesstif"
+                        Not Lesstif
                         #endif
                        ],
                        [
@@ -3941,7 +3963,7 @@ dnl stupidly, provides a dummy function declaration inside its extension)
 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
@@ -3979,6 +4001,38 @@ if test "$ac_cv_func_vsnprintf" = "yes"; then
     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)
@@ -4112,10 +4166,10 @@ AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
     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
         ],
         [
@@ -4126,16 +4180,39 @@ AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
              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
@@ -4420,10 +4497,10 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
                 ;;
           *-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
@@ -6836,7 +6913,7 @@ else
         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"
@@ -6861,7 +6938,7 @@ else
                         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"
@@ -6877,7 +6954,7 @@ else
                         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"