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 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
- 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,
AC_DEFINE(wxUSE_STREAMS)
fi
-dnl ------------------------------------------------------------------------
+dnl ---------------------------------------------------------------------------
dnl time/date functions
dnl ------------------------------------------------------------------------
],
[
struct timeval tv;
- struct timezone tz;
- gettimeofday(&tv, &tz);
+ gettimeofday(&tv, NULL);
],
wx_cv_func_gettimeofday_has_2_args=yes,
AC_TRY_COMPILE(
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_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
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_CLIPBOARD" = "yes"; then
AC_DEFINE(wxUSE_CLIPBOARD)
+
+ dnl required by clipboard code in configuration check
AC_DEFINE(wxUSE_DATAOBJ)
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"
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 ---------------------------------------------------------------------------