]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
A fix for wxTaskBarIcon (temporary wxFrame interfering with app shutdown);
[wxWidgets.git] / configure.in
index 32e622485d182ddaf5e47f136d477607832d6356..6e7fa23fe5266f7902d1f86b848fb09dea087c63 100644 (file)
@@ -18,7 +18,7 @@ dnl ---------------------------------------------------------------------------
 dnl the file passed to AC_INIT should be specific to our package
 AC_INIT(wx-config.in)
 
-AC_CANONICAL_HOST
+AC_CANONICAL_SYSTEM
 
 dnl When making releases do:
 dnl
@@ -770,11 +770,15 @@ AC_CACHE_SAVE
 dnl cross-compiling support: we're cross compiling if the build system is
 dnl different from the target one (assume host and target be always the same)
 if eval "test $host != $build"; then
-  if eval "test $build != NONE"; then
-    CC="$build-gcc"
-    CXX="$build-g++"
-    RANLIB="$build-ranlib"
-    NM="$build-nm"
+  if eval "test $host_alias != NONE"; then
+    CC=$host_alias-gcc 
+    CXX=$host_alias-c++ 
+    AR=$host_alias-ar
+    RANLIB=$host_alias-ranlib
+    DLLTOOL=$host_alias-dlltool 
+    LD=$host_alias-ld 
+    NM=$host_alias-nm
+    STRIP=$host_alias-strip
   fi
 fi
 
@@ -884,7 +888,53 @@ dnl DLLs under Win32.
 dnl AC_LIBTOOL_WIN32_DLL
 
 dnl disable static libs by default, this takes too much time...
-AM_DISABLE_STATIC
+dnl libtool doesn't work on anything but Linux and maybe
+dnl ***BSD
+
+case "${host}" in
+  *-hp-hpux* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-linux* )
+    AM_DISABLE_STATIC
+  ;;
+  *-*-irix5* | *-*-irix6* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-solaris2* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-sunos4* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-freebsd* | *-*-netbsd*)
+    AM_DISABLE_STATIC
+  ;;
+  *-*-osf* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-dgux5* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-sysv5* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-aix* )
+    AM_DISABLE_SHARED
+  ;;
+  *-*-cygwin32* )
+    AM_DISABLE_STATIC
+  ;;
+  *-*-mingw32* )
+    AM_DISABLE_STATIC
+  ;;
+  *-pc-os2_emx )
+    AM_DISABLE_SHARED
+  ;;
+  *)
+    AC_MSG_ERROR(unknown system type ${host}.)
+esac
+
 AM_PROG_LIBTOOL
 
 dnl ---------------------------------------------------------------------------
@@ -1200,6 +1250,9 @@ WX_CPP_BOOL
 dnl check whether overloading on size_t/int parameter works
 WX_CPP_SIZE_T_IS_NOT_INT
 
+dnl check whether we should define _GNU_SOURCE
+WX_GNU_EXTENSIONS
+
 dnl ---------------------------------------------------------------------------
 dnl Check for functions
 dnl ---------------------------------------------------------------------------
@@ -1224,6 +1277,32 @@ AC_CHECK_FUNCS(vsnprintf,
                AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
               )
 
+dnl check for vsscanf() - on some platforms (Linux, glibc 2.1.1) it's
+dnl available in the library but the prototype is missing, so we can't use
+dnl AC_CHECK_FUNCS here, do it manually
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
+[
+  AC_TRY_COMPILE(
+             [
+                #include <stdio.h>
+                #include <stdarg.h>
+             ],
+             [
+                va_list ap;
+                vsscanf("", "", ap);
+             ], [
+                wx_cv_func_vsscanf=yes
+                AC_DEFINE(HAVE_VSSCANF)
+             ], [
+                wx_cv_func_vsscanf=no
+             ])
+])
+
+AC_LANG_RESTORE
+
 dnl check for vfork() (even if it's the same as fork() in modern Unices)
 AC_CHECK_FUNCS(vfork)
 
@@ -1291,11 +1370,11 @@ if test "$wxUSE_THREADS" = "yes" ; then
                 ])
             ])
         ])
-fi
 
-if test -z "$THREADS_OBJ" ; then
-    wxUSE_THREADS=no
-    AC_MSG_WARN(No thread support on this system)
+    if test -z "$THREADS_OBJ" ; then
+        wxUSE_THREADS=no
+        AC_MSG_WARN(No thread support on this system)
+    fi
 fi
 
 dnl do other tests only if we are using threads
@@ -1685,9 +1764,6 @@ if test "$wxUSE_JOYSTICK" = 1; then
   fi
 fi
 
-
-AC_CHECK_FUNCS(vsscanf)
-
 dnl ------------------------------------------------------------------------
 dnl DLL support
 dnl ------------------------------------------------------------------------
@@ -1705,9 +1781,13 @@ if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
                     [AC_DEFINE(HAVE_SHL_LOAD) HAVE_DL_FUNCS=1 HAVE_SHL_FUNCS=1])
 
     if test "$HAVE_DL_FUNCS" = 0; then
-        AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support")
-        wxUSE_ODBC=no
-        wxUSE_DYNLIB_CLASS=no
+        if test "$USE_UNIX" = 1; then 
+            AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support")
+            wxUSE_ODBC=no
+            wxUSE_DYNLIB_CLASS=no
+       else
+           AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.")
+       fi    
     fi
 fi
 
@@ -2094,7 +2174,7 @@ if test "$wxUSE_GUI" = "yes"; then
     dnl TODO some samples are never built so far:
     dnl      mfc, nativdlg, oleauto, ownerdrw, proplist
     SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \
-                     forty fractal image richedit wxpoem"
+                     forty fractal image wxpoem"
 fi
 
 dnl for convenience, sort the files to build in alphabetical order
@@ -2162,6 +2242,7 @@ dnl (the original file name may be overriden by appending another name after a
 dnl colon)
 AC_OUTPUT([
             wx-config
+           makefile.unx
             Makefile
             src/Makefile
 
@@ -2207,29 +2288,20 @@ dnl             samples/Makefile samples/minimal/Makefile
             samples/help/Makefile
             samples/image/Makefile
             samples/internat/Makefile
-            samples/joytest/Makefile
             samples/layout/Makefile
             samples/listctrl/Makefile
             samples/mdi/Makefile
             samples/memcheck/Makefile
-            samples/mfc/Makefile
             samples/minifram/Makefile
             samples/minimal/Makefile
-            samples/nativdlg/Makefile
             samples/notebook/Makefile
-            samples/oleauto/Makefile
-            samples/ownerdrw/Makefile
             samples/png/Makefile
             samples/printing/Makefile
             samples/proplist/Makefile
-            samples/regtest/Makefile
             samples/resource/Makefile
-            samples/richedit/Makefile
             samples/sashtest/Makefile
             samples/scroll/Makefile
             samples/splitter/Makefile
-            samples/tab/Makefile
-            samples/taskbar/Makefile
             samples/text/Makefile
             samples/thread/Makefile
             samples/toolbar/Makefile