]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
nanosleep() detection works for Solaris
[wxWidgets.git] / configure.in
index 337b3ac2ee1e9f34ab4cef1ee7cd27d39320d047..9888dd7f0978582fc8b72bdb31c2d8886c8659a7 100644 (file)
@@ -245,7 +245,8 @@ SEARCH_INCLUDE="\
                               \
     /usr/Motif1.2/include     \
     /usr/dt/include           \
-                             \
+    /usr/include/Xm           \
+                                         \
     /usr/X11R6/include        \
     /usr/X11R5/include        \
     /usr/X11R4/include        \
@@ -449,7 +450,13 @@ AC_SUBST(GTK_JOYSTICK)
 dnl check for vprintf/vsprintf() which are GNU extensions
 AC_FUNC_VPRINTF
 dnl check for vsnprintf() which is another GNU extension
-AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
+AC_CHECK_FUNCS(vsnprintf)
+
+dnl check for usleep() and nanosleep() which is better in MT programs
+AC_CHECK_FUNCS(nanosleep,
+        AC_DEFINE(HAVE_NANOSLEEP),
+        [AC_CHECK_LIB(posix4, nanosleep, AC_DEFINE(HAVE_NANOSLEEP))])
+AC_CHECK_FUNCS(usleep)
 
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
@@ -759,7 +766,9 @@ DEFAULT_wxUSE_TIMEDATE=1
 DEFAULT_wxUSE_INTL=1
 DEFAULT_wxUSE_CONFIG=1
 DEFAULT_wxUSE_STREAMS=1
+DEFAULT_wxUSE_SOCKETS=1
 DEFAULT_wxUSE_SERIAL=1
+DEFAULT_wxUSE_DYNLIB_CLASS=1
 
 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=1
 DEFAULT_WX_NORMALIZED_PS_FONTS=1
@@ -843,6 +852,10 @@ AC_OVERRIDES(threads,threads,
 **--with-threads          for enabling threads,
 wxUSE_THREADS)
 
+AC_OVERRIDES(dynlib,dynlib,
+**--with-dynlib           to compile wxLibrary class,
+wxUSE_DYNLIB_CLASS)
+
 dnl ----------------------------------------------------------------
 dnl user options for libraries
 dnl ----------------------------------------------------------------
@@ -887,6 +900,10 @@ AC_OVERRIDES(serial,serial,
 **--with-serial           use class serialization,
 wxUSE_SERIAL)
 
+AC_OVERRIDES(sockets,sockets,
+**--with-sockets         use wxSocket etc classes,
+wxUSE_SOCKETS)
+
 dnl ----------------------------------------------------------------
 dnl user options for PostScript
 dnl ----------------------------------------------------------------
@@ -1227,10 +1244,39 @@ if test "$wxUSE_STREAMS" = 1 ; then
   AC_DEFINE_UNQUOTED(wxUSE_STREAMS,$wxUSE_STREAMS)
 fi
 
+if test "$wxUSE_SOCKETS" = 1 ; then
+  AC_DEFINE_UNQUOTED(wxUSE_SOCKETS,$wxUSE_SOCKETS)
+fi
+
 if test "$wxUSE_SERIAL" = 1 ; then
   AC_DEFINE_UNQUOTED(wxUSE_SERIAL,$wxUSE_SERIAL)
 fi
 
+dnl ------------------------------------------------------------------------
+dnl wxLibrary class
+dnl ------------------------------------------------------------------------
+
+HAVE_DL_FUNCS=0
+if test "$wxUSE_DYNLIB_CLASS" = "1"; then
+    dnl the test is a bit complicated because we check for dlopen() both with
+    dnl and without -ldl
+    AC_CHECK_FUNCS(dlopen,
+        [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1],
+        [AC_CHECK_LIB(dl, dlopen,
+            [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1])])
+    AC_CHECK_FUNCS(shl_load, [AC_DEFINE(HAVE_SHL_LOAD) HAVE_DL_FUNCS=1])
+
+    if test "$HAVE_DL_FUNCS" = 0; then
+        AC_MSG_WARN("--with-dynlib will be disabled because no function was found to load a shared library on this platform")
+
+        wxUSE_DYNLIB_CLASS=0
+    fi
+fi
+
+if test "$wxUSE_DYNLIB_CLASS" = 1 ; then
+  AC_DEFINE_UNQUOTED(wxUSE_DYNLIB_CLASS,$wxUSE_DYNLIB_CLASS)
+fi
+
 dnl ----------------------------------------------------------------
 dnl Register Prolog and Resources options for makefiles and setup.h
 dnl ----------------------------------------------------------------