]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
Fix for GetValue
[wxWidgets.git] / configure.in
index 29f11262644fd8c5920854426b1c35ed2655f6f4..21099a736f5ed483897ae41f77fd77a1f0ba46f7 100644 (file)
@@ -224,6 +224,9 @@ case "${host}" in
     USE_AIX=1
     USE_SYSV=1
     USE_SVR4=1
     USE_AIX=1
     USE_SYSV=1
     USE_SVR4=1
+    dnl Irvin Probst <irvin.probst@fr.thalesgroup.com> reports that the shared
+    dnl libraries under AIX have the same suffix as the normal ones
+    SO_SUFFIX=a
     AC_DEFINE(__AIX__)
     AC_DEFINE(__SYSV__)
     AC_DEFINE(__SVR4__)
     AC_DEFINE(__AIX__)
     AC_DEFINE(__SYSV__)
     AC_DEFINE(__SVR4__)
@@ -286,28 +289,6 @@ if test "$USE_UNIX" = 1 ; then
     AC_DEFINE(__UNIX__)
 fi
 
     AC_DEFINE(__UNIX__)
 fi
 
-dnl check for glibc version
-if test "$USE_LINUX" = 1; then
-    AC_CACHE_CHECK([for glibc 2.1 or later], wx_lib_glibc21,[
-        AC_TRY_COMPILE([#include <features.h>],
-            [
-                #if !__GLIBC_PREREQ(2, 1)
-                    #error not glibc2.1
-                #endif
-            ],
-            [
-                wx_lib_glibc21=yes
-            ],
-            [
-                wx_lib_glibc21=no
-            ]
-        )
-    ])
-    if test "$wx_lib_glibc21" = "yes"; then
-        AC_DEFINE(wxHAVE_GLIBC2)
-    fi
-fi
-
 dnl ---------------------------------------------------------------------------
 dnl command line options for configure
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl command line options for configure
 dnl ---------------------------------------------------------------------------
@@ -335,8 +316,8 @@ if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_OPTIMISE=no
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
   DEFAULT_wxUSE_OPTIMISE=no
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
-  DEFAULT_wxUSE_NO_RTTI=yes
-  DEFAULT_wxUSE_NO_EXCEPTIONS=yes
+  DEFAULT_wxUSE_NO_RTTI=no
+  DEFAULT_wxUSE_NO_EXCEPTIONS=no
   DEFAULT_wxUSE_PERMISSIVE=no
   DEFAULT_wxUSE_DEBUG_FLAG=yes
   DEFAULT_wxUSE_DEBUG_INFO=yes
   DEFAULT_wxUSE_PERMISSIVE=no
   DEFAULT_wxUSE_DEBUG_FLAG=yes
   DEFAULT_wxUSE_DEBUG_INFO=yes
@@ -509,8 +490,8 @@ else
   DEFAULT_wxUSE_OPTIMISE=yes
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
   DEFAULT_wxUSE_OPTIMISE=yes
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
-  DEFAULT_wxUSE_NO_RTTI=yes
-  DEFAULT_wxUSE_NO_EXCEPTIONS=yes
+  DEFAULT_wxUSE_NO_RTTI=no
+  DEFAULT_wxUSE_NO_EXCEPTIONS=no
   DEFAULT_wxUSE_PERMISSIVE=no
   DEFAULT_wxUSE_DEBUG_FLAG=no
   DEFAULT_wxUSE_DEBUG_INFO=no
   DEFAULT_wxUSE_PERMISSIVE=no
   DEFAULT_wxUSE_DEBUG_FLAG=no
   DEFAULT_wxUSE_DEBUG_INFO=no
@@ -708,9 +689,9 @@ AC_ARG_WITH(gtk,           [  --with-gtk              use GTK+], [wxUSE_GTK="$wi
 AC_ARG_WITH(motif,         [  --with-motif            use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(mac,           [  --with-mac              use Mac OS X], [wxUSE_MAC="$withval" TOOLKIT_GIVEN=1])
 AC_ARG_WITH(wine,          [  --with-wine             use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(motif,         [  --with-motif            use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(mac,           [  --with-mac              use Mac OS X], [wxUSE_MAC="$withval" TOOLKIT_GIVEN=1])
 AC_ARG_WITH(wine,          [  --with-wine             use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
-AC_ARG_WITH(msw,           [  --with-msw              use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW TOOLKIT_GIVEN=1])
+AC_ARG_WITH(msw,           [  --with-msw              use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(pm,            [  --with-pm               use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(pm,            [  --with-pm               use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
-AC_ARG_WITH(mgl,           [  --with-mgl              use SciTech MGL], [wxUSE_MGL="$withval" CACHE_MGL=1 TOOLKIT_GIVEN=1])
+AC_ARG_WITH(mgl,           [  --with-mgl              use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(microwin,      [  --with-microwin         use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(x11,           [  --with-x11              use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
 WX_ARG_ENABLE(nanox,       [  --enable-nanox          use NanoX], wxUSE_NANOX)
 AC_ARG_WITH(microwin,      [  --with-microwin         use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(x11,           [  --with-x11              use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
 WX_ARG_ENABLE(nanox,       [  --enable-nanox          use NanoX], wxUSE_NANOX)
@@ -1170,6 +1151,11 @@ dnl   defines CC with the compiler to use
 dnl   defines GCC with yes if using gcc
 dnl   defines GCC empty if not using gcc
 dnl   defines CFLAGS
 dnl   defines GCC with yes if using gcc
 dnl   defines GCC empty if not using gcc
 dnl   defines CFLAGS
+dnl
+dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
+dnl default CFLAGS (something like "-g -O2") - we don't need this as add
+dnl -g and -O flags ourselves below
+CFLAGS=${CFLAGS:=}
 AC_PROG_CC
 
 dnl is -traditional needed for correct compilations
 AC_PROG_CC
 
 dnl is -traditional needed for correct compilations
@@ -1184,6 +1170,9 @@ dnl   defines CXX with the compiler to use
 dnl   defines GXX with yes if using gxx
 dnl   defines GXX empty if not using gxx
 dnl   defines CXXFLAGS
 dnl   defines GXX with yes if using gxx
 dnl   defines GXX empty if not using gxx
 dnl   defines CXXFLAGS
+dnl
+dnl see CFLAGS line above
+CXXFLAGS=${CXXFLAGS:=}
 AC_PROG_CXX
 
 AC_LANG_RESTORE
 AC_PROG_CXX
 
 AC_LANG_RESTORE
@@ -1199,6 +1188,16 @@ AC_CHECK_PROG(AR, ar, ar, ar)
 dnl install checks
 dnl   defines INSTALL with the appropriate command
 AC_PROG_INSTALL
 dnl install checks
 dnl   defines INSTALL with the appropriate command
 AC_PROG_INSTALL
+
+dnl   make install path absolute (if not already); will fail with MSDOS paths
+case ${INSTALL} in
+  /* ) # Absolute
+     ;;
+  *)     
+     INSTALL=`pwd`/${INSTALL} ;;
+esac
+
+
 case "${host}" in
 
     dnl The other BSD's should probably go in here too, since this is
 case "${host}" in
 
     dnl The other BSD's should probably go in here too, since this is
@@ -1288,6 +1287,125 @@ AC_PROG_LEX
 dnl needed for making link to setup.h
 AC_PROG_LN_S
 
 dnl needed for making link to setup.h
 AC_PROG_LN_S
 
+dnl ------------------------------------------------------------------------
+dnl Check for headers
+dnl ------------------------------------------------------------------------
+
+dnl test for strings.h needed under AIX, but do not check for it wxMac as
+dnl it exists but is only a simple redirection to string.h and it is in
+dnl conflict with Strings.h in FlatCarbon headers
+if test "$wxUSE_MAC" != 1; then
+  dnl defines HAVE_STRINGS_H
+  AC_CHECK_HEADERS(strings.h)
+fi
+
+dnl defines HAVE_STDLIB_H
+AC_CHECK_HEADERS(stdlib.h)
+dnl defines HAVE_MALLOC_H
+AC_CHECK_HEADERS(malloc.h)
+dnl defines HAVE_UNISTD_H
+AC_CHECK_HEADERS(unistd.h)
+dnl defines HAVE_WCHAR_H
+AC_CHECK_HEADERS(wchar.h)
+
+dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
+if test "$ac_cv_header_wchar_h" != "yes"; then
+    dnl defines HAVE_WCSTR_H
+    AC_CHECK_HEADERS(wcstr.h)
+fi
+
+dnl checking for wctype.h is useless as we need wcslen(), not just wchar_t and
+dnl this function is never provided by it
+dnl AC_CHECK_HEADERS(wctype.h)
+
+dnl defines HAVE_FNMATCH_H
+AC_CHECK_HEADERS(fnmatch.h)
+
+if test "x$ac_cv_header_fnmatch_h" = "xyes"; then
+    AC_CHECK_FUNCS(fnmatch)
+fi
+
+dnl defines HAVE_LANGINFO_H (GNU libc locale parameters)
+AC_CHECK_HEADERS(langinfo.h)
+
+if test "$wxUSE_GUI" = "yes"; then
+    if test "$wxUSE_UNIX" = "yes"; then
+        dnl defines HAVE_X11_XKBLIB_H
+        AC_CHECK_HEADERS(X11/XKBlib.h)
+    fi
+fi
+
+dnl ---------------------------------------------------------------------------
+dnl Checks for compiler characteristics
+dnl ---------------------------------------------------------------------------
+
+dnl defines const to be empty if c-compiler does not support const fully
+AC_C_CONST
+dnl defines inline to a sensible value for the c-compiler
+AC_C_INLINE
+
+dnl check the sizes of integral types (give some reasonable default values for
+dnl cross-compiling)
+dnl   defines the size of certain types of variables in SIZEOF_<TYPE>
+AC_CHECK_SIZEOF(char, 1)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(void *, 4)
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
+
+case "${host}" in
+    arm-*-linux* )
+        AC_CHECK_SIZEOF(long long, 8)
+    ;;
+    * )
+        AC_CHECK_SIZEOF(long long, 0)
+esac
+
+dnl we have to do it ourselves because SGI/Irix's stdio.h does not include
+dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h
+dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
+AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t,
+[
+    AC_TRY_RUN(
+        [
+            #ifdef HAVE_WCHAR_H
+            #  ifdef __CYGWIN__
+            #    include <stddef.h>
+            #  endif
+            #  include <wchar.h>
+            #endif
+            #ifdef HAVE_STDLIB_H
+            #  include <stdlib.h>
+            #endif
+            #include <stdio.h>
+            int main()
+            {
+                FILE *f=fopen("conftestval", "w");
+                if (!f) exit(1);
+                fprintf(f, "%i", sizeof(wchar_t));
+                exit(0);
+            }
+        ],
+        wx_cv_sizeof_wchar_t=`cat conftestval`,
+        wx_cv_sizeof_wchar_t=0,
+        wx_cv_sizeof_wchar_t=4
+    )
+])
+
+AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t)
+
+dnl check for large file support
+AC_SYS_LARGEFILE
+
+dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
+WX_C_BIGENDIAN
+
+dnl check for iostream (as opposed to iostream.h) standard header
+WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
+
+dnl check whether C++ compiler supports bool built-in type
+WX_CPP_BOOL
+
 dnl ---------------------------------------------------------------------------
 dnl Define search path for includes and libraries: all headers and libs will be
 dnl looked for in all directories of this path
 dnl ---------------------------------------------------------------------------
 dnl Define search path for includes and libraries: all headers and libs will be
 dnl looked for in all directories of this path
@@ -1376,6 +1494,31 @@ dnl ------------------------------------------------------------------------
 dnl flush the cache because checking for libraries below might abort
 AC_CACHE_SAVE
 
 dnl flush the cache because checking for libraries below might abort
 AC_CACHE_SAVE
 
+dnl check for glibc version
+dnl
+dnl VZ: I have no idea why had this check been there originally, but now
+dnl     it is only used to get the recursive mutexes under Linux
+if test "$USE_LINUX" = 1; then
+    AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[
+        AC_TRY_COMPILE([#include <features.h>],
+            [
+                #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1)
+                    #error not glibc2.1
+                #endif
+            ],
+            [
+                wx_cv_lib_glibc21=yes
+            ],
+            [
+                wx_cv_lib_glibc21=no
+            ]
+        )
+    ])
+    if test "$wx_cv_lib_glibc21" = "yes"; then
+        AC_DEFINE(wxHAVE_GLIBC2)
+    fi
+fi
+
 dnl ---------------------------------------------------------------------------
 dnl Optional libraries
 dnl
 dnl ---------------------------------------------------------------------------
 dnl Optional libraries
 dnl
@@ -1804,6 +1947,8 @@ equivalent variable and GTK+ is version 1.2.3 or above.
             fi
         fi
 
             fi
         fi
 
+        wxUSE_UNIVERSAL="yes"
+
         TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
         GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm"
 
         TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
         GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm"
 
@@ -1830,11 +1975,13 @@ equivalent variable and GTK+ is version 1.2.3 or above.
         TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
         GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
 
         TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
         GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
 
+        wxUSE_UNIVERSAL="yes"
+
         AFMINSTALL=afminstall
         TOOLKIT=MICROWIN
         GUIDIST=MICROWIN_DIST
         AFMINSTALL=afminstall
         TOOLKIT=MICROWIN
         GUIDIST=MICROWIN_DIST
-        
-        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__ -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
+
+        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
     fi
 
     if test "$wxUSE_X11" = 1; then
     fi
 
     if test "$wxUSE_X11" = 1; then
@@ -1893,6 +2040,8 @@ equivalent variable and GTK+ is version 1.2.3 or above.
             )
         fi
 
             )
         fi
 
+        wxUSE_UNIVERSAL="yes"
+
         if test "$wxUSE_NANOX" = "yes"; then
             TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
             TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DLINUX=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
         if test "$wxUSE_NANOX" = "yes"; then
             TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
             TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DLINUX=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
@@ -2054,6 +2203,8 @@ equivalent variable and GTK+ is version 1.2.3 or above.
     if test "$wxUSE_MAC" = 1; then
         if test "$wxUSE_PRECOMP" = "yes"; then
             CPPFLAGS="$CPPFLAGS -cpp-precomp"
     if test "$wxUSE_MAC" = 1; then
         if test "$wxUSE_PRECOMP" = "yes"; then
             CPPFLAGS="$CPPFLAGS -cpp-precomp"
+        else
+            CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
         fi
         CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon -I\${top_srcdir}/src/mac/morefile"
         CFLAGS="$CFLAGS -fpascal-strings"
         fi
         CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon -I\${top_srcdir}/src/mac/morefile"
         CFLAGS="$CFLAGS -fpascal-strings"
@@ -2175,11 +2326,13 @@ fi
 dnl ---------------------------------------------------------------------------
 dnl OpenGL libraries
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl OpenGL libraries
 dnl ---------------------------------------------------------------------------
+
 if test "$wxUSE_OPENGL" = "yes"; then
     if test "$wxUSE_MAC" = 1; then
         OPENGL_LIBS="-framework OpenGL -framework AGL"
 if test "$wxUSE_OPENGL" = "yes"; then
     if test "$wxUSE_MAC" = 1; then
         OPENGL_LIBS="-framework OpenGL -framework AGL"
+    elif test "$wxUSE_MSW" = 1; then
+        OPENGL_LIBS="-lopengl32 -lglu32"
     else
     else
-
         AC_CHECK_HEADER(GL/gl.h,
             [
                 AC_MSG_CHECKING([for -lGL])
         AC_CHECK_HEADER(GL/gl.h,
             [
                 AC_MSG_CHECKING([for -lGL])
@@ -2208,26 +2361,6 @@ if test "$wxUSE_OPENGL" = "yes"; then
                 fi
             ])
 
                 fi
             ])
 
-    dnl check for OpenGL libs availability first
-    dnl -lGL requires -lm with soem OpenGL versions
-
-#    AC_CHECK_HEADER(GL/gl.h,
-#        [
-#            AC_CHECK_LIB(GL, glFlush,
-#                [
-#                    OPENGL_LIBS="-lGL -lGLU"
-#                ],
-#                [
-#                    AC_CHECK_LIB(MesaGL, glFlush,
-#                        [
-#                            OPENGL_LIBS="-lMesaGL -lMesaGLU"
-#                        ],
-#                        [],
-#                        [-lm])
-#                ],
-#                [-lm])
-#        ])
-
         if test "x$OPENGL_LIBS" = "x"; then
             dnl it should be an error and not a warning because OpenGL is not on
             dnl by default and so if it had been explicitely requested, we
         if test "x$OPENGL_LIBS" = "x"; then
             dnl it should be an error and not a warning because OpenGL is not on
             dnl by default and so if it had been explicitely requested, we
@@ -2284,10 +2417,6 @@ WX_LIBRARY_LINK2="lib${WX_LIBRARY}.${SO_SUFFIX}"
 WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}"
 WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
 
 WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}"
 WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
 
-dnl the name of the resources file for wxMac
-WX_RESOURCES_MACOSX="lib${WX_LIBRARY}.rsrc"
-WX_RESOURCES_MACOSX_COMPILED="lib${WX_LIBRARY}.r"
-
 case "${host}" in
     *-*-cygwin* | *-*-mingw32* )
 
 case "${host}" in
     *-*-cygwin* | *-*-mingw32* )
 
@@ -2306,7 +2435,17 @@ case "${host}" in
             WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}"
             WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
         fi
             WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}"
             WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
         fi
+        ;;
 
 
+    *-*-darwin* )
+        dnl Under Mac OS X, we should build real frameworks instead of simple
+        dnl dynamic shared libraries (in order to embed the resources)
+        if test "$wxUSE_MAC" = 1; then
+            dnl the name of the resources file for wxMac
+            WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.r" 
+            WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.rsrc"
+        fi
+        ;;
 esac
 
 dnl the name of the static library
 esac
 
 dnl the name of the static library
@@ -2421,16 +2560,25 @@ if test "$wxUSE_SHARED" = "yes"; then
       *-*-darwin* )
         dnl For Unix to MacOS X porting instructions, see:
         dnl http://fink.sourceforge.net/doc/porting/porting.html
       *-*-darwin* )
         dnl For Unix to MacOS X porting instructions, see:
         dnl http://fink.sourceforge.net/doc/porting/porting.html
-        CFLAGS="$CFLAGS -fno-common -DDYLIB_INIT"
-        CXXFLAGS="$CXXFLAGS -fno-common -DDYLIB_INIT"
-        SHARED_LD="$CXX -dynamiclib -init _wxWindowsDylibInit -o"
+        CFLAGS="$CFLAGS -fno-common -DWXMAKINGDLL"
+        CXXFLAGS="$CXXFLAGS -fno-common -DWXMAKINGDLL"
+        dnl wxWindows must be fully binded (lazy binding breaks RTTI classinfo)
+        dnl this can be done either with the exe linker flag -Wl,-bind_at_load
+        dnl or with a double stage link in order to create a single module
+        dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
+        SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace -o"
         PIC_FLAG="-dynamic -fPIC"
         SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION}"
         SONAME_FLAGS_GL=${SONAME_FLAGS}
       ;;
 
       *-*-aix* )
         PIC_FLAG="-dynamic -fPIC"
         SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION}"
         SONAME_FLAGS_GL=${SONAME_FLAGS}
       ;;
 
       *-*-aix* )
-        SHARED_LD="/usr/lpp/xlC/bin/makeC++SharedLib -p 0 -o"
+        dnl the abs path below used to be hardcoded here so I guess it must
+        dnl be some sort of standard location under AIX?
+        AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib,
+                      makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib)
+
+        SHARED_LD="$(AIX_CXX_LD) -p 0 -o"
       ;;
 
       *-*-cygwin* | *-*-mingw32* )
       ;;
 
       *-*-cygwin* | *-*-mingw32* )
@@ -2510,63 +2658,27 @@ fi
 
 if test "$wxUSE_MAC" = 1; then
     dnl add the resources target for wxMac
 
 if test "$wxUSE_MAC" = 1; then
     dnl add the resources target for wxMac
-    WX_ALL="${WX_ALL} \$(build_libdir)/lib${WX_LIBRARY}.r"
+    LIBWXMACRES="\$(top_builddir)/lib/${WX_RESOURCES_MACOSX_ASCII}"
+    WX_ALL="${WX_ALL} ${LIBWXMACRES}"
     WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_res"
     AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez)
     AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
     MACOSX_BUNDLE="bundle"
     WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_res"
     AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez)
     AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
     MACOSX_BUNDLE="bundle"
-    LIBWXMACRES="\$(top_builddir)/lib/lib${WX_LIBRARY}.r"
-    LIBWXMACRESCOMP="\$(RESCOMP) Carbon.r -t APPL ${LIBWXMACRES} -o \$(BIN_PROGRAM)"
-    LIBWXMACRESWXCONFIG="${RESCOMP} Carbon.r -t APPL \${prefix}/lib/${WX_RESOURCES_MACOSX_COMPILED} -o"
+    if test "$wxUSE_SHARED" = "yes"; then
+        dnl resources are bundled with shared library, not with applications
+        LIBWXMACRESCOMP="\$(RESCOMP) -t APPL Carbon.r -o \$(BIN_PROGRAM)"
+        LIBWXMACRESWXCONFIG="${RESCOMP} -t APPL Carbon.r -o"
+    else
+        dnl resources are bundled with applications, not with static library
+        LIBWXMACRESCOMP="\$(RESCOMP) -t APPL Carbon.r ${LIBWXMACRES} -o \$(BIN_PROGRAM)"
+        LIBWXMACRESWXCONFIG="${RESCOMP} -t APPL Carbon.r \${prefix}/lib/${WX_RESOURCES_MACOSX_ASCII} -o"
+    fi
 else
     if test "$wxUSE_PM" = 1; then
         LIBWXMACRESCOMP="emxbind -ep \$(BIN_PROGRAM)"
     fi
 fi
 
 else
     if test "$wxUSE_PM" = 1; then
         LIBWXMACRESCOMP="emxbind -ep \$(BIN_PROGRAM)"
     fi
 fi
 
-dnl ------------------------------------------------------------------------
-dnl Check for headers
-dnl ------------------------------------------------------------------------
-
-dnl test for strings.h needed under AIX, but do not check for it wxMac as
-dnl it exists but is only a simple redirection to string.h and it is in
-dnl conflict with Strings.h in FlatCarbon headers
-if test "$wxUSE_MAC" != 1; then
-  dnl defines HAVE_STRINGS_H
-  AC_CHECK_HEADERS(strings.h)
-fi
-
-dnl defines HAVE_STDLIB_H
-AC_CHECK_HEADERS(stdlib.h)
-dnl defines HAVE_MALLOC_H
-AC_CHECK_HEADERS(malloc.h)
-dnl defines HAVE_UNISTD_H
-AC_CHECK_HEADERS(unistd.h)
-dnl defines HAVE_WCHAR_H
-AC_CHECK_HEADERS(wchar.h)
-
-dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
-if test "$ac_cv_header_wchar_h" != "yes"; then
-    dnl defines HAVE_WCSTR_H
-    AC_CHECK_HEADERS(wcstr.h)
-fi
-
-dnl checking for wctype.h is useless as we need wcslen(), not just wchar_t and
-dnl this function is never provided by it
-dnl AC_CHECK_HEADERS(wctype.h)
-
-dnl defines HAVE_FNMATCH_H
-AC_CHECK_HEADERS(fnmatch.h)
-dnl defines HAVE_LANGINFO_H (GNU libc locale parameters)
-AC_CHECK_HEADERS(langinfo.h)
-
-if test "$wxUSE_GUI" = "yes"; then
-    if test "$wxUSE_UNIX" = "yes"; then
-        dnl defines HAVE_X11_XKBLIB_H
-        AC_CHECK_HEADERS(X11/XKBlib.h)
-    fi
-fi
-
 dnl ---------------------------------------------------------------------------
 dnl Checks for typedefs
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl Checks for typedefs
 dnl ---------------------------------------------------------------------------
@@ -2582,37 +2694,6 @@ AC_TYPE_SIZE_T
 dnl   defines uid_t and gid_t if not already defined
 AC_TYPE_UID_T
 
 dnl   defines uid_t and gid_t if not already defined
 AC_TYPE_UID_T
 
-dnl   check for wchar_t
-dnl   Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
-dnl   on Cygwin wchar.h needs stddef.h to be #included by hand
-AC_CACHE_CHECK([for wchar_t], wx_cv_type_wchar_t,
-[
-    AC_TRY_COMPILE(
-        [
-            #ifdef HAVE_WCHAR_H
-            #  ifdef __CYGWIN__
-            #    include <stddef.h>
-            #  endif
-            #  include <wchar.h>
-            #endif
-            #ifdef HAVE_STDLIB_H
-            #  include <stdlib.h>
-            #endif
-        ],
-        [
-            wchar_t wc, *ws;
-            wc = L'a';
-            ws = L"Hello, world!";
-        ],
-        wx_cv_type_wchar_t=yes,
-        wx_cv_type_wchar_t=no
-    )
-])
-
-if test "$wx_cv_type_wchar_t" = "yes"; then
-    AC_DEFINE(wxUSE_WCHAR_T)
-fi
-
 dnl check what exactly size_t is on this machine - this is necessary to avoid
 dnl ambiguos overloads in several places, notably wx/string.h and wx/array.h
 AC_LANG_SAVE
 dnl check what exactly size_t is on this machine - this is necessary to avoid
 dnl ambiguos overloads in several places, notably wx/string.h and wx/array.h
 AC_LANG_SAVE
@@ -2690,98 +2771,52 @@ if test "$wx_cv_struct_pw_gecos" = "yes"; then
     AC_DEFINE(HAVE_PW_GECOS)
 fi
 
     AC_DEFINE(HAVE_PW_GECOS)
 fi
 
-dnl ---------------------------------------------------------------------------
-dnl Checks for compiler characteristics
-dnl ---------------------------------------------------------------------------
-
-dnl defines const to be empty if c-compiler does not support const fully
-AC_C_CONST
-dnl defines inline to a sensible value for the c-compiler
-AC_C_INLINE
-
-dnl check the sizes of integral types (give some reasonable default values for
-dnl cross-compiling)
-dnl   defines the size of certain types of variables in SIZEOF_<TYPE>
-AC_CHECK_SIZEOF(char, 1)
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(void *, 4)
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(long, 4)
-
-case "${host}" in
-    arm-*-linux* )
-        AC_CHECK_SIZEOF(long long, 8)
-    ;;
-    * )
-        AC_CHECK_SIZEOF(long long, 0)
-esac
-
-
-dnl we have to do it ourselves because SGI/Irix's stdio.h does not include
-dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h
-dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
-AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t,
-[
-    AC_TRY_RUN(
-        [
-            #ifdef HAVE_WCHAR_H
-            #  ifdef __CYGWIN__
-            #    include <stddef.h>
-            #  endif
-            #  include <wchar.h>
-            #endif
-            #ifdef HAVE_STDLIB_H
-            #  include <stdlib.h>
-            #endif
-            #include <stdio.h>
-            int main()
-            {
-                FILE *f=fopen("conftestval", "w");
-                if (!f) exit(1);
-                fprintf(f, "%i", sizeof(wchar_t));
-                exit(0);
-            }
-        ],
-        wx_cv_sizeof_wchar_t=`cat conftestval`,
-        wx_cv_sizeof_wchar_t=0,
-        wx_cv_sizeof_wchar_t=4
-    )
-])
-
-AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t)
-
-dnl for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
-WX_C_BIGENDIAN
-
-dnl check for iostream (as opposed to iostream.h) standard header
-WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
-
-dnl check whether C++ compiler supports bool built-in type
-WX_CPP_BOOL
-
 dnl ---------------------------------------------------------------------------
 dnl Check for functions
 dnl ---------------------------------------------------------------------------
 
 dnl ---------------------------------------------------------------------------
 dnl Check for functions
 dnl ---------------------------------------------------------------------------
 
-dnl check for wcslen
-AC_CHECK_LIB(c, wcslen, [
-            AC_DEFINE(HAVE_WCSLEN)
-            WCHAR_LINK=
-        ], [
-            AC_CHECK_LIB(w, wcslen, [
-                AC_DEFINE(HAVE_WCSLEN)
-                WCHAR_LINK=" -lw"
-            ], [
-                AC_CHECK_LIB(msvcrt, wcslen, [
+dnl don't check for wchar_t functions if we haven't got wchar_t itself
+WCHAR_OK=0
+if test "$wx_cv_sizeof_wchar_t" != "0"; then
+    dnl check for wcslen
+    WCHAR_LINK=
+    AC_CHECK_FUNCS(wcslen, [
                     AC_DEFINE(HAVE_WCSLEN)
                     AC_DEFINE(HAVE_WCSLEN)
-                    WCHAR_LINK=
-                ])
+                    WCHAR_OK=1
+                  ])
+
+    if test "$WCHAR_OK" = 0; then
+        if test "$TOOLKIT" = "MSW"; then
+            AC_CHECK_LIB(msvcrt, wcslen, [
+                AC_DEFINE(HAVE_WCSLEN)
+                WCHAR_OK=1
             ])
             ])
-        ])
+        else
+            AC_CHECK_LIB(w, wcslen, [
+                            AC_DEFINE(HAVE_WCSLEN)
+                            WCHAR_LINK=" -lw"
+                            WCHAR_OK=1
+                        ])
+        fi
+    fi
+fi
 
 
-dnl use wcsrtombs instead of wcstombs which is buggy in old GNU libc versions
-dnl if possible
-AC_CHECK_FUNCS(wcsrtombs)
+dnl we need at least the definition of wchar_t itself and wcslen() to compile
+dnl with wchar_t support -- turn it off if we don't have this
+if test "$WCHAR_OK" = 1; then
+    AC_DEFINE(wxUSE_WCHAR_T)
+
+    dnl also try to use wcsrtombs instead of wcstombs which is buggy in old GNU
+    dnl libc versions if possible
+    AC_CHECK_FUNCS(wcsrtombs)
+else
+    dnl use built-in wcslen for Darwin (what about other BSD based systems?)
+    if test "$USE_DARWIN" = 1; then
+        AC_DEFINE(wxUSE_WCHAR_T)
+    else
+        AC_MSG_WARN([Wide character support is unavailable])
+    fi
+fi
 
 dnl check for vprintf/vsprintf() which are GNU extensions
 AC_FUNC_VPRINTF
 
 dnl check for vprintf/vsprintf() which are GNU extensions
 AC_FUNC_VPRINTF
@@ -3158,8 +3193,8 @@ if test "$TOOLKIT" != "MSW"; then
         case "${host}" in
           *-*-solaris2* | *-*-sunos4* )
                 if test "x$GCC" = "xyes"; then
         case "${host}" in
           *-*-solaris2* | *-*-sunos4* )
                 if test "x$GCC" = "xyes"; then
-                    dnl apparently some Solaris/gcc combinations use this one
-                    THREAD_OPTS="$THREAD_OPTS -pthreads"
+                    dnl Solaris/gcc combination use this one for some reason
+                    THREAD_OPTS="-pthreads $THREAD_OPTS"
                 else
                     THREAD_OPTS="-mt $THREAD_OPTS"
                 fi
                 else
                     THREAD_OPTS="-mt $THREAD_OPTS"
                 fi
@@ -3169,16 +3204,21 @@ if test "$TOOLKIT" != "MSW"; then
                 dnl and finally the userland threads
                 THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
                 ;;
                 dnl and finally the userland threads
                 THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
                 ;;
-          *-*-aix* )
+          *-*-darwin*)
+                dnl Darwin / Mac OS X just uses -lpthread tested below
+                THREAD_OPTS=""
+                ;;
+          *-*-aix*)
                 dnl AIX calls the library libpthreads - thanks IBM!
                 THREAD_OPTS="pthreads"
                 ;;
                 dnl AIX calls the library libpthreads - thanks IBM!
                 THREAD_OPTS="pthreads"
                 ;;
-          *)
-                dnl the default is ok but if it doesn't work try without it
-                dnl just in case
-                THREAD_OPTS="$THREAD_OPTS none"
         esac
 
         esac
 
+        dnl simply linking with libpthread should make the test below work but
+        dnl it's far from certain that the threaded programs compiled without
+        dnl any special switches actually work, so try it after all the others
+        THREAD_OPTS="$THREAD_OPTS pthread none"
+
         dnl now test for all possibilities
         THREADS_OK=no
         for flag in $THREAD_OPTS; do
         dnl now test for all possibilities
         THREADS_OK=no
         for flag in $THREAD_OPTS; do
@@ -3201,7 +3241,7 @@ if test "$TOOLKIT" != "MSW"; then
               save_LIBS="$LIBS"
               save_CFLAGS="$CFLAGS"
               LIBS="$THREADS_LINK $LIBS"
               save_LIBS="$LIBS"
               save_CFLAGS="$CFLAGS"
               LIBS="$THREADS_LINK $LIBS"
-              CFLAGS="$CFLAGS $THREADS_CFLAGS"
+              CFLAGS="$THREADS_CFLAGS $CFLAGS"
 
               AC_TRY_LINK([#include <pthread.h>],
                           [pthread_create(0,0,0,0);],
 
               AC_TRY_LINK([#include <pthread.h>],
                           [pthread_create(0,0,0,0);],
@@ -3223,6 +3263,10 @@ if test "$TOOLKIT" != "MSW"; then
           wxUSE_THREADS=no
           AC_MSG_WARN([No thread support on this system... disabled])
       else
           wxUSE_THREADS=no
           AC_MSG_WARN([No thread support on this system... disabled])
       else
+          dnl yes, these special compiler flags should be used with the
+          dnl linker as well
+          LIBS="$THREADS_LINK $THREADS_CFLAGS $LIBS"
+
           AC_MSG_CHECKING([if more special flags are required for pthreads])
           flag=no
           case "${host}" in
           AC_MSG_CHECKING([if more special flags are required for pthreads])
           flag=no
           case "${host}" in
@@ -3235,14 +3279,11 @@ if test "$TOOLKIT" != "MSW"; then
           esac
           AC_MSG_RESULT(${flag})
           if test "x$flag" != xno; then
           esac
           AC_MSG_RESULT(${flag})
           if test "x$flag" != xno; then
-              THREADS_CFLAGS="$flag $THREADS_CFLAGS"
-          fi
-
-          if test "x$THREADS_LINK" != "x"; then
-            LIBS="$THREADS_LINK $LIBS"
+              THREADS_CFLAGS="$THREADS_CFLAGS $flag"
           fi
 
           if test "x$THREADS_CFLAGS" != "x"; then
           fi
 
           if test "x$THREADS_CFLAGS" != "x"; then
+            dnl don't add these options to CPPFLAGS as cpp might not know them
             CFLAGS="$CFLAGS $THREADS_CFLAGS"
             CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS"
           fi
             CFLAGS="$CFLAGS $THREADS_CFLAGS"
             CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS"
           fi
@@ -3328,7 +3369,7 @@ if test "$TOOLKIT" != "MSW"; then
       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)
       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_cv_lib_glibc21" = "xyes"; then
           CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
       fi
 
           CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
       fi
 
@@ -3378,9 +3419,6 @@ fi
 if test "$wxUSE_THREADS" = "yes"; then
   AC_DEFINE(wxUSE_THREADS)
 
 if test "$wxUSE_THREADS" = "yes"; then
   AC_DEFINE(wxUSE_THREADS)
 
-  dnl we must define _REENTRANT or something along these lines for MT code
-  TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS $THREADS_CFLAGS"
-
   SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
 else
   dnl on some systems, _REENTRANT should be defined if we want to use any _r()
   SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
 else
   dnl on some systems, _REENTRANT should be defined if we want to use any _r()
@@ -3464,11 +3502,20 @@ if test "$GCC" = "yes" ; then
         # they had a reason, right??
         CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fno-pcc-struct-return"
     fi
         # they had a reason, right??
         CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fno-pcc-struct-return"
     fi
-fi
 
 
+    dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before
+    dnl 3.0 overflow the table of contents on rs6000 as they create an entry
+    dnl for each subroutine by default -- using the switch below only creates
+    dnl one entry per file instead at the price of minor performance penalty
+    dnl
+    dnl TODO: test for the gcc version here (how?)
+    case "${host}" in
+      powerpc*-*-aix* )
+        CODE_GEN_FLAGS="$CODE_GEN_FLAGS -mminimal-toc"
+        ;;
+    esac
+fi
 
 
-CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
-CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
 if test "$wxUSE_OPTIMISE" = "no" ; then
     OPTIMISE=
 else
 if test "$wxUSE_OPTIMISE" = "no" ; then
     OPTIMISE=
 else
@@ -3669,6 +3716,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
     AC_CHECK_FUNCS(strptime)
 
     dnl check for timezone variable
     AC_CHECK_FUNCS(strptime)
 
     dnl check for timezone variable
+    dnl   doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead
     AC_CACHE_CHECK(for timezone variable in <time.h>,
                    wx_cv_var_timezone,
                    [
     AC_CACHE_CHECK(for timezone variable in <time.h>,
                    wx_cv_var_timezone,
                    [
@@ -3709,7 +3757,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
                                             ],
                                             [
                                                 if test "$USE_DOS" = 0 ; then
                                             ],
                                             [
                                                 if test "$USE_DOS" = 0 ; then
-                                                    AC_MSG_ERROR(no timezone variable)
+                                                    AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead)
                                                 fi
                                             ]
                                         )
                                                 fi
                                             ]
                                         )
@@ -3808,10 +3856,15 @@ dnl ------------------------------------------------------------------------
 
 dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11
 if test "$wxUSE_SOCKETS" = "yes"; then
 
 dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11
 if test "$wxUSE_SOCKETS" = "yes"; then
-    if test "$TOOLKIT" = "X11"; then
+    if test "$wxUSE_X11" = "1"; then
         AC_MSG_WARN([wxSocket not yet supported under X11... disabled])
         wxUSE_SOCKETS="no"
     fi
         AC_MSG_WARN([wxSocket not yet supported under X11... disabled])
         wxUSE_SOCKETS="no"
     fi
+
+    if test "$wxUSE_MGL" = "1"; then
+        AC_MSG_WARN([wxSocket not yet supported under MGL... disabled])
+        wxUSE_SOCKETS="no"
+    fi
 fi
 
 if test "$wxUSE_SOCKETS" = "yes"; then
 fi
 
 if test "$wxUSE_SOCKETS" = "yes"; then
@@ -4184,10 +4237,17 @@ if test "$wxUSE_IPC" = "yes"; then
 fi
 
 if test "$wxUSE_CLIPBOARD" = "yes"; then
 fi
 
 if test "$wxUSE_CLIPBOARD" = "yes"; then
-    AC_DEFINE(wxUSE_CLIPBOARD)
+    if test "$wxUSE_MGL" = 1; then
+        AC_MSG_WARN([Clipboard not yet supported under MGL... disabled])
+        wxUSE_CLIPBOARD=no
+    fi
 
 
-    dnl required by clipboard code in configuration check
-    AC_DEFINE(wxUSE_DATAOBJ)
+    if test "$wxUSE_CLIPBOARD" = "yes"; then
+        AC_DEFINE(wxUSE_CLIPBOARD)
+
+        dnl required by clipboard code in configuration check
+        AC_DEFINE(wxUSE_DATAOBJ)
+    fi
 fi
 
 if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
 fi
 
 if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
@@ -4208,6 +4268,11 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
         wxUSE_DRAG_AND_DROP=no
     fi
 
         wxUSE_DRAG_AND_DROP=no
     fi
 
+    if test "$wxUSE_MGL" = 1; then
+        AC_MSG_WARN([Drag and drop not yet supported under MGL... disabled])
+        wxUSE_DRAG_AND_DROP=no
+    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"
@@ -4532,6 +4597,10 @@ fi
 
 if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
     AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
 
 if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
     AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
+if test "$TOOLKIT" = "MSW"; then
+    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar"
+fi
+
 fi
 
 if test "$wxUSE_PROTOCOL" = "yes"; then
 fi
 
 if test "$wxUSE_PROTOCOL" = "yes"; then
@@ -4753,8 +4822,16 @@ fi
 
 
 dnl all -I options we must pass to the compiler
 
 
 dnl all -I options we must pass to the compiler
-INCLUDES="-I\${top_builddir}/lib/wx/include/${TOOLCHAIN_NAME} -I\${top_srcdir}/include \
-$REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE"
+dnl
+dnl note that the order is somewhat important, in particular the ZLIB_INCLUDE
+dnl and other stuff for the built in libraries should come first to avoid
+dnl including the system headers with the same name (it is particularly
+dnl important for zlib because XFree 4.2.0 has its own, horribly old and
+dnl incompatible, zlib.h) and the wxWindows headers should come first anyhow
+INCLUDES="-I\${top_builddir}/lib/wx/include/${TOOLCHAIN_NAME} \
+-I\${top_srcdir}/include \
+$REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE \
+$TOOLKIT_INCLUDE"
 
 dnl wxGTK does not need TOOLKIT includes in wx-config
 if test "$wxUSE_GTK" = 1; then
 
 dnl wxGTK does not need TOOLKIT includes in wx-config
 if test "$wxUSE_GTK" = 1; then
@@ -4780,10 +4857,12 @@ fi
 
 EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
 
 
 EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
 
+dnl remove the extra white space from the cc/c++/ld options
 CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
 CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
 CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
 CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
+LIBS=`echo $LIBS | sed 's/ \+/ /g'`
 
 
-LDFLAGS="$LDFLAGS$PROFILE"
+LDFLAGS="$LDFLAGS $PROFILE"
 
 dnl for convenience, sort the samples in alphabetical order
 dnl
 
 dnl for convenience, sort the samples in alphabetical order
 dnl
@@ -4870,6 +4949,7 @@ AC_SUBST(SAMPLES_SUBDIRS)
 dnl additional libraries and linker settings
 AC_SUBST(LDFLAGS)
 AC_SUBST(LDFLAGS_GL)
 dnl additional libraries and linker settings
 AC_SUBST(LDFLAGS)
 AC_SUBST(LDFLAGS_GL)
+AC_SUBST(LDFLAGS_EXE)
 AC_SUBST(OPENGL_LIBS)
 AC_SUBST(DMALLOC_LIBS)
 AC_SUBST(EXTRADEFS)
 AC_SUBST(OPENGL_LIBS)
 AC_SUBST(DMALLOC_LIBS)
 AC_SUBST(EXTRADEFS)
@@ -4878,8 +4958,8 @@ dnl additional resurces settings
 AC_SUBST(RESCOMP)
 AC_SUBST(RESFLAGS)
 AC_SUBST(RESPROGRAMOBJ)
 AC_SUBST(RESCOMP)
 AC_SUBST(RESFLAGS)
 AC_SUBST(RESPROGRAMOBJ)
-AC_SUBST(WX_RESOURCES_MACOSX)
-AC_SUBST(WX_RESOURCES_MACOSX_COMPILED)
+AC_SUBST(WX_RESOURCES_MACOSX_ASCII)
+AC_SUBST(WX_RESOURCES_MACOSX_DATA)
 
 dnl additional for Mac OS X
 AC_SUBST(DEREZ)
 
 dnl additional for Mac OS X
 AC_SUBST(DEREZ)
@@ -4908,24 +4988,22 @@ fi
 
 AC_CONFIG_HEADER(setup.h:setup.h.in)
 
 
 AC_CONFIG_HEADER(setup.h:setup.h.in)
 
-dnl some more GUI only things
-if test "$wxUSE_GUI" = "yes"; then
-    dnl we need to pass SAMPLES_SUBDIRS (and some other) to the configure in
-    dnl samples and the only way to do it is, again, use the cache
-    wx_cv_path_samplesubdirs=$SAMPLES_SUBDIRS
-    wx_cv_if_gnu_make=$IF_GNU_MAKE
-    wx_cv_path_ifs=$PATH_IFS
-    wx_cv_program_ext=$PROGRAM_EXT
-    wx_cv_target_library=$WX_TARGET_LIBRARY
-    wx_cv_target_library_gl=$WX_TARGET_LIBRARY_GL
-    wx_cv_target_libtype=$WX_TARGET_LIBRARY_TYPE
-    dnl we need to export them because passing them through cache won't
-    dnl work when cache=/dev/null (which is default for autoconf 2.50)
-    export wx_cv_path_samplesubdirs wx_cv_if_gnu_make \
-           wx_cv_path_ifs wx_cv_program_ext \
-           wx_cv_target_library wx_cv_target_library_gl wx_cv_target_libtype
-    AC_CONFIG_SUBDIRS(demos samples utils contrib mobile)
-fi
+dnl we need to pass SAMPLES_SUBDIRS (and some other) to the configure in
+dnl samples and the only way to do it is to use the environment (another
+dnl idea could have been to use the cache but this wouldn't work when
+dnl configure doesn't use cache at all which is the default with autoconf 2.50)
+wx_cv_path_samplesubdirs=$SAMPLES_SUBDIRS
+wx_cv_if_gnu_make=$IF_GNU_MAKE
+wx_cv_path_ifs=$PATH_IFS
+wx_cv_program_ext=$PROGRAM_EXT
+wx_cv_target_library=$WX_TARGET_LIBRARY
+wx_cv_target_library_gl=$WX_TARGET_LIBRARY_GL
+wx_cv_target_libtype=$WX_TARGET_LIBRARY_TYPE
+export wx_cv_path_samplesubdirs wx_cv_if_gnu_make \
+       wx_cv_path_ifs wx_cv_program_ext \
+       wx_cv_target_library wx_cv_target_library_gl wx_cv_target_libtype
+
+AC_CONFIG_SUBDIRS(demos samples utils contrib)
 
 dnl create each of the files in the space separated list from the file.in
 dnl (the original file name may be overriden by appending another name after a
 
 dnl create each of the files in the space separated list from the file.in
 dnl (the original file name may be overriden by appending another name after a