]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
fix for wxStatusBar wrongly reporting field rects inside EVT_SIZE handler
[wxWidgets.git] / configure.in
index 34f751659c4a5e378da3c59d05c8cac7b7075392..f9383cabb7a4ee6c228435595ae177bccb5ca24a 100644 (file)
@@ -2822,6 +2822,35 @@ fi
 dnl check for vfork() (even if it's the same as fork() in modern Unices)
 AC_CHECK_FUNCS(vfork)
 
 dnl check for vfork() (even if it's the same as fork() in modern Unices)
 AC_CHECK_FUNCS(vfork)
 
+dnl get the library function to use for wxGetDiskSpace()
+AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
+    AC_TRY_COMPILE(
+        [
+             #include <sys/vfs.h>
+        ],
+        [
+             long l;
+             struct statfs fs;
+             statfs("/", &fs);
+             l = fs.f_bsize;
+             l += fs.f_blocks;
+             l += fs.f_bavail;
+        ],
+        [
+             wx_cv_func_statfs=yes
+        ],
+        [
+             wx_cv_func_statfs=no
+        ]
+    )
+)
+
+if test "$wx_cv_func_statfs" = "yes"; then
+    AC_DEFINE(HAVE_STATFS)
+else
+    AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()])
+fi
+
 dnl check for fcntl() or at least flock() needed by Unix implementation of
 dnl wxSingleInstanceChecker
 if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
 dnl check for fcntl() or at least flock() needed by Unix implementation of
 dnl wxSingleInstanceChecker
 if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
@@ -3071,10 +3100,12 @@ if test "$wxUSE_THREADS" = "yes" ; then
   dnl defined, we do it by directly assigned
   dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
 
   dnl defined, we do it by directly assigned
   dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
 
-  dnl we need to define _XOPEN_SOURCE=500 to get PTHREAD_MUTEX_RECURSIVE
-  dnl with glibc 2.1+, it probably shouldn't hurt elsewhere?
+  dnl we need _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+
+  dnl (strictly speaking we only need _XOPEN_SOURCE=500 but just defining
+  dnl this disables _BSD_SOURCE which breaks libtiff compilation, so it is
+  dnl simpler to just define _GNU_SOURCE to get everything)
   if test "x$wx_lib_glibc21" = "xyes"; then
   if test "x$wx_lib_glibc21" = "xyes"; then
-      CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
+      CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
   fi
 
   AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
   fi
 
   AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
@@ -3569,7 +3600,7 @@ if test "$wxUSE_STREAMS" = "yes" ; then
   AC_DEFINE(wxUSE_STREAMS)
 fi
 
   AC_DEFINE(wxUSE_STREAMS)
 fi
 
-dnl ------------------------------------------------------------------------
+dnl ---------------------------------------------------------------------------
 dnl time/date functions
 dnl ------------------------------------------------------------------------
 
 dnl time/date functions
 dnl ------------------------------------------------------------------------
 
@@ -3674,8 +3705,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
                 ],
                 [
                     struct timeval tv;
                 ],
                 [
                     struct timeval tv;
-                    struct timezone tz;
-                    gettimeofday(&tv, &tz);
+                    gettimeofday(&tv, NULL);
                 ],
                 wx_cv_func_gettimeofday_has_2_args=yes,
                 AC_TRY_COMPILE(
                 ],
                 wx_cv_func_gettimeofday_has_2_args=yes,
                 AC_TRY_COMPILE(
@@ -3688,7 +3718,10 @@ if test "$wxUSE_DATETIME" = "yes"; then
                         gettimeofday(&tv);
                     ],
                     wx_cv_func_gettimeofday_has_2_args=no,
                         gettimeofday(&tv);
                     ],
                     wx_cv_func_gettimeofday_has_2_args=no,
-                    wx_cv_func_gettimeofday_has_2_args=unknown
+                    [
+                        AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
+                        wx_cv_func_gettimeofday_has_2_args=unknown
+                    ]
                 )
             )
             AC_LANG_RESTORE
                 )
             )
             AC_LANG_RESTORE
@@ -3978,7 +4011,7 @@ if test "$wxUSE_HELP" = "yes"; then
                 AC_DEFINE(wxUSE_MS_HTML_HELP)
             ],
             [
                 AC_DEFINE(wxUSE_MS_HTML_HELP)
             ],
             [
-                AC_MSG_WARN(MS HTML Help cannot be used without htmlhelp.h so it won't be compiled without it)
+                AC_MSG_WARN([MS HTML Help cannot be used without htmlhelp.h, disabled])
                 wxUSE_MS_HTML_HELP=no
             ])
       fi
                 wxUSE_MS_HTML_HELP=no
             ])
       fi
@@ -4020,6 +4053,40 @@ dnl ---------------------------------------------------------------------------
 dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
 dnl ---------------------------------------------------------------------------
 
 dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
 dnl ---------------------------------------------------------------------------
 
+dnl check for ole headers and disable a few features requiring it if not
+dnl present (earlier versions of mingw32 don't have ole2.h)
+if test "$USE_WIN32" = 1; then
+    AC_CHECK_HEADERS(ole2.h)
+
+    if test "$ac_cv_header_ole2_h" = "yes" ; then
+        if test "$GCC" = yes ; then
+            ALL_OBJECTS="$ALL_OBJECTS \$(OLEOBJS)"
+            ALL_DEPFILES="$ALL_DEPFILES \$(OLEDEPS)"
+            CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fvtable-thunks"
+            LIBS="$LIBS -lrpcrt4 -loleaut32 -lole32 -luuid"
+            AC_DEFINE(wxUSE_OLE)
+
+        fi
+
+        dnl for OLE clipboard and dnd
+        AC_DEFINE(wxUSE_DATAOBJ)
+    else
+        AC_MSG_WARN([Some features disabled because OLE headers not found])
+
+        wxUSE_CLIPBOARD=no
+        wxUSE_DRAG_AND_DROP=no
+        wxUSE_DATAOBJ=no
+    fi
+
+    dnl this is for MSW only, so we test for it inside "if USE_WIN32"
+    if test "$wxUSE_METAFILE" = "yes"; then
+        AC_DEFINE(wxUSE_METAFILE)
+
+        dnl this one should probably be made separately configurable
+        AC_DEFINE(wxUSE_ENH_METAFILE)
+    fi
+fi
+
 if test "$wxUSE_IPC" = "yes"; then
     if test "$wxUSE_SOCKETS" != "yes"; then
         AC_MSG_WARN(wxWindows IPC classes require sockets, disabled)
 if test "$wxUSE_IPC" = "yes"; then
     if test "$wxUSE_SOCKETS" != "yes"; then
         AC_MSG_WARN(wxWindows IPC classes require sockets, disabled)
@@ -4030,6 +4097,8 @@ fi
 
 if test "$wxUSE_CLIPBOARD" = "yes"; then
     AC_DEFINE(wxUSE_CLIPBOARD)
 
 if test "$wxUSE_CLIPBOARD" = "yes"; then
     AC_DEFINE(wxUSE_CLIPBOARD)
+
+    dnl required by clipboard code in configuration check
     AC_DEFINE(wxUSE_DATAOBJ)
 fi
 
     AC_DEFINE(wxUSE_DATAOBJ)
 fi
 
@@ -4051,34 +4120,6 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
         wxUSE_DRAG_AND_DROP=no
     fi
 
         wxUSE_DRAG_AND_DROP=no
     fi
 
-    if test "$USE_WIN32" = 1; then
-        dnl check for ole headers and disable DnD if not present (earlier
-        dnl versions of mingw32 don't have them)
-
-        AC_CHECK_HEADERS(ole2.h)
-
-        if test "$ac_cv_header_ole2_h" = "yes" ; then
-            if test "$GCC" = yes ; then
-                ALL_OBJECTS="$ALL_OBJECTS \$(OLEOBJS)"
-                ALL_DEPFILES="$ALL_DEPFILES \$(OLEDEPS)"
-                CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fvtable-thunks"
-                LIBS="$LIBS -lrpcrt4 -loleaut32 -lole32 -luuid"
-                AC_DEFINE(wxUSE_OLE)
-
-                dnl metafiles need the ole code, right??  if not this
-                dnl doesn't need to be in here.
-                if test "$wxUSE_METAFILE" = "yes"; then
-                    AC_DEFINE(wxUSE_METAFILE)
-                    dnl this one should probably be made separately configurable
-                    AC_DEFINE(wxUSE_ENH_METAFILE)
-                fi
-            fi
-        else
-            AC_MSG_WARN(Drag and drop disabled because OLE headers not found)
-            wxUSE_DRAG_AND_DROP=no
-        fi
-    fi
-
     if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
         AC_DEFINE(wxUSE_DRAG_AND_DROP)
         SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
     if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
         AC_DEFINE(wxUSE_DRAG_AND_DROP)
         SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
@@ -4504,6 +4545,18 @@ fi
 
 AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
 
 
 AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
 
+dnl ---------------------------------------------------------------------------
+dnl define the variable containing the installation prefix (used in dcpsg.cpp)
+dnl ---------------------------------------------------------------------------
+
+if test "x$prefix" != "xNONE"; then
+    wxPREFIX=$prefix
+else
+    wxPREFIX=$ac_default_prefix
+fi
+
+AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
+
 dnl ---------------------------------------------------------------------------
 dnl Output the makefiles and such from the results found above
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl Output the makefiles and such from the results found above
 dnl ---------------------------------------------------------------------------