]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
move to svn
[wxWidgets.git] / configure.in
index 06a9b8a14421f7581a660b1559a2f7154034ed2b..8f44affcb83dbecd8393f11f04562d454da74234 100644 (file)
@@ -536,6 +536,7 @@ if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_DISPLAY=no
   DEFAULT_wxUSE_DETECT_SM=no
   DEFAULT_wxUSE_DIRPICKERCTRL=no
+  DEFAULT_wxUSE_EDITABLELISTBOX=no
   DEFAULT_wxUSE_FILEPICKERCTRL=no
   DEFAULT_wxUSE_FONTPICKERCTRL=no
   DEFAULT_wxUSE_GAUGE=no
@@ -574,8 +575,10 @@ if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_POPUPWIN=no
   DEFAULT_wxUSE_TIPWINDOW=no
 
-  DEFAULT_wxUSE_UNICODE=no
+  DEFAULT_wxUSE_UNICODE=yes
   DEFAULT_wxUSE_UNICODE_MSLU=no
+  DEFAULT_wxUSE_UNICODE_UTF8=auto
+  DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
   DEFAULT_wxUSE_WCSRTOMBS=no
 
   DEFAULT_wxUSE_PALETTE=no
@@ -761,6 +764,7 @@ else
   DEFAULT_wxUSE_DISPLAY=yes
   DEFAULT_wxUSE_DETECT_SM=yes
   DEFAULT_wxUSE_DIRPICKERCTRL=yes
+  DEFAULT_wxUSE_EDITABLELISTBOX=yes
   DEFAULT_wxUSE_FILEPICKERCTRL=yes
   DEFAULT_wxUSE_FONTPICKERCTRL=yes
   DEFAULT_wxUSE_GAUGE=yes
@@ -799,8 +803,10 @@ else
   DEFAULT_wxUSE_POPUPWIN=yes
   DEFAULT_wxUSE_TIPWINDOW=yes
 
-  DEFAULT_wxUSE_UNICODE=no
+  DEFAULT_wxUSE_UNICODE=yes
   DEFAULT_wxUSE_UNICODE_MSLU=yes
+  DEFAULT_wxUSE_UNICODE_UTF8=auto
+  DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
   DEFAULT_wxUSE_WCSRTOMBS=no
 
   DEFAULT_wxUSE_PALETTE=yes
@@ -822,6 +828,9 @@ else
   DEFAULT_wxUSE_GTK2=yes
 fi
 
+dnl Always default to no. Only special cases require this.
+DEFAULT_wxUSE_OBJC_UNIQUIFYING=no
+
 
 dnl WX_ARG_WITH should be used to select whether an external package will be
 dnl used or not, to configure compile-time features of this package itself,
@@ -945,6 +954,7 @@ WX_ARG_ENABLE(compat28,      [  --disable-compat28      disable wxWidgets 2.8 co
 
 WX_ARG_ENABLE(rpath,         [  --disable-rpath         disable use of rpath for uninstalled builds], wxUSE_RPATH)
 
+WX_ARG_ENABLE(objc_uniquifying,[  --enable-objc_uniquifying enable Objective-C class name uniquifying], wxUSE_OBJC_UNIQUIFYING)
 
 dnl ---------------------------------------------------------------------------
 dnl (small) optional non GUI classes
@@ -987,6 +997,8 @@ WX_ARG_ENABLE(log,           [  --enable-log            use logging system], wxU
 WX_ARG_ENABLE(longlong,      [  --enable-longlong       use wxLongLong class], wxUSE_LONGLONG)
 WX_ARG_ENABLE(mimetype,      [  --enable-mimetype       use wxMimeTypesManager], wxUSE_MIMETYPE)
 WX_ARG_ENABLE(mslu,          [  --enable-mslu           use MS Layer for Unicode on Windows 9x (Win32 only)], wxUSE_UNICODE_MSLU)
+WX_ARG_ENABLE_PARAM(utf8,          [  --enable-utf8           use UTF-8 representation for strings (Unix only)], wxUSE_UNICODE_UTF8)
+WX_ARG_ENABLE(utf8only,      [  --enable-utf8only      only support UTF-8 locales in UTF-8 build (Unix only)], wxUSE_UNICODE_UTF8_LOCALE)
 WX_ARG_ENABLE(snglinst,      [  --enable-snglinst       use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER)
 WX_ARG_ENABLE(std_iostreams, [  --enable-std_iostreams  use standard C++ stream classes], wxUSE_STD_IOSTREAM)
 WX_ARG_ENABLE(std_string,    [  --enable-std_string     use standard C++ string classes], wxUSE_STD_STRING)
@@ -998,7 +1010,7 @@ WX_ARG_ENABLE(tarstream,     [  --enable-tarstream      use wxTar streams], wxUS
 WX_ARG_ENABLE(textbuf,       [  --enable-textbuf        use wxTextBuffer class], wxUSE_TEXTBUFFER)
 WX_ARG_ENABLE(textfile,      [  --enable-textfile       use wxTextFile class], wxUSE_TEXTFILE)
 WX_ARG_ENABLE(timer,         [  --enable-timer          use wxTimer class], wxUSE_TIMER)
-WX_ARG_ENABLE(unicode,       [  --enable-unicode        compile wxString with Unicode support], wxUSE_UNICODE)
+WX_ARG_ENABLE(unicode,       [  --enable-unicode       compile without Unicode support], wxUSE_UNICODE)
 WX_ARG_ENABLE(sound,         [  --enable-sound          use wxSound class], wxUSE_SOUND)
 WX_ARG_ENABLE(mediactrl,     [  --enable-mediactrl      use wxMediaCtrl class], wxUSE_MEDIACTRL)
 WX_ARG_ENABLE(gstreamer8,    [  --enable-gstreamer8     force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8)
@@ -1199,6 +1211,7 @@ WX_ARG_ENABLE(datepick,    [  --enable-datepick       use wxDatePickerCtrl class
 WX_ARG_ENABLE(dirpicker,   [  --enable-dirpicker      use wxDirPickerCtrl class], wxUSE_DIRPICKERCTRL)
 WX_ARG_ENABLE(display,     [  --enable-display        use wxDisplay class], wxUSE_DISPLAY)
 WX_ARG_ENABLE(detect_sm,   [  --enable-detect_sm      use code to detect X11 session manager], wxUSE_DETECT_SM)
+WX_ARG_ENABLE(editablebox, [  --enable-editablebox    use wxEditableListBox class], wxUSE_EDITABLELISTBOX)
 WX_ARG_ENABLE(filepicker,  [  --enable-filepicker     use wxFilePickerCtrl class], wxUSE_FILEPICKERCTRL)
 WX_ARG_ENABLE(fontpicker,  [  --enable-fontpicker     use wxFontPickerCtrl class], wxUSE_FONTPICKERCTRL)
 WX_ARG_ENABLE(gauge,       [  --enable-gauge          use wxGauge class], wxUSE_GAUGE)
@@ -1461,6 +1474,13 @@ dnl see CFLAGS line above
 CXXFLAGS=${CXXFLAGS:=}
 AC_BAKEFILE_PROG_CXX
 
+dnl configure always sets CXX to something as it falls back to g++ even if no
+dnl C++ compiler was found, but we prefer to abort now with a clear error
+dnl message rather than give errors about all tests failures below
+if test "$CXX" = "g++" -a "$GXX" != "yes"; then
+    AC_MSG_ERROR([C++ compiler is needed to build wxWidgets])
+fi
+
 dnl ranlib command
 dnl   defines RANLIB with the appropriate command
 AC_PROG_RANLIB
@@ -1855,6 +1875,9 @@ if test "$USE_UNIX" = 1 ; then
     AC_CHECK_HEADER([sys/select.h],,, [AC_INCLUDES_DEFAULT()])
 fi
 
+dnl defines HAVE_SYS_EPOLL_H - for epoll mainloop implementation in wxbase
+AC_CHECK_HEADERS(sys/epoll.h)
+
 dnl ---------------------------------------------------------------------------
 dnl Checks for compiler characteristics
 dnl ---------------------------------------------------------------------------
@@ -1918,6 +1941,7 @@ dnl checks needed to define wxVaCopy
 AC_CACHE_CHECK([for va_copy],
     wx_cv_func_va_copy,
     [
+        AC_LANG_PUSH(C++)
         AC_LINK_IFELSE([
             #include <stdarg.h>
             void foo(char *f, ...)
@@ -1936,6 +1960,7 @@ AC_CACHE_CHECK([for va_copy],
             wx_cv_func_va_copy=yes,
             wx_cv_func_va_copy=no
         )
+        AC_LANG_POP()
     ]
 )
 
@@ -3074,26 +3099,21 @@ if test "$wxUSE_GUI" = "yes"; then
                 wx_cv_lib_gtk=
                 if test "x$wxGTK_VERSION" != "x1"
                 then
-                    dnl The gthread.pc that ships with solaris returns '-mt',
+                    dnl The gthread.pc that ships with Solaris returns '-mt',
                     dnl it's correct for Sun CC, but gcc requires '-pthreads'.
                     dnl So disable the compile check and remove the -mt below.
                     case "${host}" in
                         *-*-solaris2* )
                             if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then
-                            enable_gtktest=no
+                                enable_gtktest=no
                             fi
                     esac
 
                     AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
 
-                    dnl Remove the '-mt' for gcc on solaris
+                    dnl Solaris also requires -lX11 for static lib
                     case "${host}" in
                         *-*-solaris2* )
-                            if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then
-                                GTK_CFLAGS=`echo $GTK_CFLAGS | sed 's/-mt//'`
-                                GTK_LIBS=`echo $GTK_LIBS | sed 's/-mt//'`
-                            fi
-                            dnl solaris also requires -lX11 for static lib
                             if test "$wxUSE_SHARED" != "yes"; then
                                 GTK_LIBS="$GTK_LIBS -lX11"
                             fi
@@ -3822,6 +3842,28 @@ else
     DISTDIR="wxBase"
 fi
 
+
+dnl ---------------------------------------------------------------------------
+dnl UTF-8 support
+dnl ---------------------------------------------------------------------------
+
+dnl If UTF-8 support wasn't explicitly enabled or disabled, enable it only
+dnl for ports where it makes sense by default (GTK+, DirectFB):
+if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_UTF8" = "auto" ; then
+    if test "$TOOLKIT" = "DFB" ; then
+        wxUSE_UNICODE_UTF8=yes
+    elif test "$TOOLKIT" = "GTK" -a "$WXGTK20" = "1" ; then
+        wxUSE_UNICODE_UTF8=yes
+    elif test "$USE_OS2" = "1" ; then
+        dnl wide char support is quite incomplete in libc;
+        dnl UTF-8 might actually work when evaluating/setting
+        dnl code pages correctly, even for ports other than GTK20.
+        wxUSE_UNICODE_UTF8=yes
+    else
+        wxUSE_UNICODE_UTF8=no
+    fi
+fi
+
 dnl ---------------------------------------------------------------------------
 dnl Optional libraries included when system library is not used
 dnl ---------------------------------------------------------------------------
@@ -4085,6 +4127,11 @@ if test "$wxUSE_SHARED" = "yes"; then
     dnl use versioned symbols if available on the platform
     WX_VERSIONED_SYMBOLS([\$(wx_top_builddir)/version-script])
 
+    dnl test for Sun CC which can be used under both Solaris and Linux
+    if test "x$SUNCXX" = xyes; then
+        SAMPLES_RPATH_FLAG="-R\$(wx_top_builddir)/lib"
+        WXCONFIG_RPATH="-R\$libdir"
+    else
     case "${host}" in
       *-*-linux* | *-*-gnu* )
         SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
@@ -4092,41 +4139,39 @@ if test "$wxUSE_SHARED" = "yes"; then
         ;;
 
       *-*-solaris2* )
-        if test "$GCC" = yes ; then
-            dnl newer versions of gcc need -isystem to compile X headers on
-            dnl Solaris (which use old style C syntax)
-            CPPFLAGS="-isystem /usr/openwin/include $CPPFLAGS"
-
-            dnl gcc may use Sun's ld, in which case -rpath gives a confusing
-            dnl error message. We have to try both -Wl,-rpath and -Wl,-R:
-            saveLdflags="$LDFLAGS"
-            LDFLAGS="$saveLdflags -Wl,-rpath,/"
-            AC_MSG_CHECKING([if the linker accepts -rpath])
-            AC_TRY_LINK(
-                [],[],
-                [
-                    AC_MSG_RESULT([yes])
-                    SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
-                    WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
-                ],[
-                    AC_MSG_RESULT([no])
-                    AC_MSG_CHECKING([if the linker accepts -R])
-                    LDFLAGS="$saveLdflags -Wl,-R,/"
-                    AC_TRY_LINK(
-                        [],[],
-                        [
-                            AC_MSG_RESULT([yes])
-                            SAMPLES_RPATH_FLAG="-Wl,-R,\$(wx_top_builddir)/lib"
-                            WXCONFIG_RPATH="-Wl,-R,\$libdir"
-                        ],[
-                            AC_MSG_RESULT([no])
-                        ])
-                ])
-            LDFLAGS="$saveLdflags"
-        else
-            SAMPLES_RPATH_FLAG="-R\$(wx_top_builddir)/lib"
-            WXCONFIG_RPATH="-R\$libdir"
-        fi
+        dnl here we know that Sun CC is not used as we tested for it above,
+        dnl hence we must be using gcc
+
+        dnl newer versions of gcc need -isystem to compile X headers on
+        dnl Solaris (which use old style C syntax)
+        CPPFLAGS="-isystem /usr/openwin/include $CPPFLAGS"
+
+        dnl gcc may use Sun's ld, in which case -rpath gives a confusing
+        dnl error message. We have to try both -Wl,-rpath and -Wl,-R:
+        saveLdflags="$LDFLAGS"
+        LDFLAGS="$saveLdflags -Wl,-rpath,/"
+        AC_MSG_CHECKING([if the linker accepts -rpath])
+        AC_TRY_LINK(
+            [],[],
+            [
+                AC_MSG_RESULT([yes])
+                SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
+                WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
+            ],[
+                AC_MSG_RESULT([no])
+                AC_MSG_CHECKING([if the linker accepts -R])
+                LDFLAGS="$saveLdflags -Wl,-R,/"
+                AC_TRY_LINK(
+                    [],[],
+                    [
+                        AC_MSG_RESULT([yes])
+                        SAMPLES_RPATH_FLAG="-Wl,-R,\$(wx_top_builddir)/lib"
+                        WXCONFIG_RPATH="-Wl,-R,\$libdir"
+                    ],[
+                        AC_MSG_RESULT([no])
+                    ])
+            ])
+        LDFLAGS="$saveLdflags"
       ;;
 
       *-*-darwin* )
@@ -4158,6 +4203,7 @@ EOF
         ;;
 
     esac
+    fi
 
     if test $wxUSE_RPATH = "no"; then
         SAMPLES_RPATH_FLAG=''
@@ -4365,6 +4411,30 @@ else
     fi
 fi
 
+AC_CACHE_CHECK([if wchar_t is separate type],
+    wx_cv_wchar_t_is_separate_type,
+    AC_TRY_COMPILE([#include <wchar.h>],
+        [
+            return 0; }
+
+            struct Foo { void foo(wchar_t);
+                         void foo(unsigned short);
+                         void foo(unsigned int);
+                         void foo(unsigned long); };
+
+            int bar() {
+        ],
+        wx_cv_wchar_t_is_separate_type=yes,
+        wx_cv_wchar_t_is_separate_type=no
+    )
+)
+
+if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then
+    AC_DEFINE(wxWCHAR_T_IS_SEPARATE_TYPE, 1)
+else
+    AC_DEFINE(wxWCHAR_T_IS_SEPARATE_TYPE, 0)
+fi
+
 AC_LANG_POP() dnl C++
 
 dnl ---------------------------------------------------------------------------
@@ -4422,6 +4492,8 @@ if test "$wxUSE_WCHAR_T" = "yes"; then
         AC_DEFINE(HAVE_WCSLEN)
     fi
 
+    AC_CHECK_FUNCS([wcsdup])
+
     dnl On HP-UX aCC need this define to find mbstrtowcs() &c
     dnl Can't be used for g++ since the mbstate_t in wchar.h can conflict
     dnl with g++'s in <cwchar> (unless -D_INCLUDE__STDC_A1_SOURCE is in the
@@ -4687,7 +4759,11 @@ if test "$wxUSE_FILE" = "yes"; then
     WX_CHECK_FUNCS(fsync)
 fi
 
+dnl at least under IRIX with mipsPro the C99 round() function is available when
+dnl building using the C compiler but not when using C++ one
+AC_LANG_PUSH(C++)
 WX_CHECK_FUNCS(round,,,[#include <math.h>])
+AC_LANG_POP()
 
 dnl the following tests are for Unix(like) systems only
 if test "$TOOLKIT" != "MSW"; then
@@ -5060,13 +5136,15 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
         dnl with the convention that anything starting with '-' is a cpp flag
         dnl while anything else is a library (i.e. there is an implicit "-l")
         THREAD_OPTS="-pthread"
+        if test "x$SUNCXX" = xyes; then
+            THREAD_OPTS="-mt lthread $THREAD_OPTS"
+        fi
+
         case "${host}" in
           *-*-solaris2* | *-*-sunos4* )
                 if test "x$GCC" = "xyes"; then
                     dnl Solaris/gcc combination use this one for some reason
                     THREAD_OPTS="-pthreads $THREAD_OPTS"
-                else
-                    THREAD_OPTS="-mt $THREAD_OPTS"
                 fi
                 ;;
           *-*-freebsd*)
@@ -5211,6 +5289,10 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
       dnl wouldn't be found by it
       AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup,
       [
+        dnl C compiler may treat pthread_cleanup_push() as an undeclared
+        dnl function and not give a warning even if it's unavailable, so use
+        dnl the C++ one for this test
+        AC_LANG_PUSH(C++)
         AC_TRY_COMPILE([#include <pthread.h>
                void ThreadCleanupFunc(void *p);
             ],
@@ -5224,6 +5306,7 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
                wx_cv_func_pthread_cleanup=no
             ]
         )
+        AC_LANG_POP()
       ])
       if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then
         AC_DEFINE(wxHAVE_PTHREAD_CLEANUP)
@@ -6031,6 +6114,9 @@ if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
   AC_DEFINE(wxUSE_PRINTF_POS_PARAMS)
 fi
 
+if test "$wxUSE_OBJC_UNIQUIFYING" = "yes"; then
+  AC_DEFINE(wxUSE_OBJC_UNIQUIFYING)
+fi
 
 dnl ---------------------------------------------------------------------------
 dnl time/date functions
@@ -6038,8 +6124,7 @@ dnl ---------------------------------------------------------------------------
 
 if test "$wxUSE_DATETIME" = "yes"; then
     dnl check for strptime and for its declaration as some systems lack it
-    dnl FIXME: use WX_CHECK_FUNCS instead
-    AC_CHECK_FUNCS(strptime)
+    AC_CHECK_FUNC(strptime)
     if test "$ac_cv_func_strptime" = "yes"; then
         AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl,
             [
@@ -6061,6 +6146,40 @@ if test "$wxUSE_DATETIME" = "yes"; then
     fi
     if test "$wx_cv_func_strptime_decl" = "yes"; then
         AC_DEFINE(HAVE_STRPTIME_DECL)
+    else
+        wx_strptime_decl="extern char *strptime(const char *, const char *, struct tm *);"
+    fi
+    if test "$ac_cv_func_strptime" = "yes"; then
+        dnl strptime() behaviour doesn't conform to POSIX under Mac OS X <
+        dnl 10.5 and possibly other BSD variants, check that strptime() we
+        dnl have fails to parse format when the string doesn't match it instea
+        dnl of just stopping immediately and returning non-NULL
+        AC_CACHE_CHECK([whether strptime() fails on invalid strings],
+            wx_cv_func_strptime_ok,
+            [AC_RUN_IFELSE(
+                [
+                    #include <stdlib.h>
+                    #include <time.h>
+                    #include "confdefs.h"
+
+                    $wx_strptime_decl
+
+                    int main()
+                    {
+                        struct tm t;
+                        return !!strptime("", "%x", &t);
+                    }
+                ],
+                wx_cv_func_strptime_ok=yes,
+                wx_cv_func_strptime_ok=no,
+                dnl be pessimistic when cross-compiling
+                wx_cv_func_strptime_ok=no
+            )]
+        )
+
+        if test "$wx_cv_func_strptime_ok" = "yes"; then
+            AC_DEFINE(HAVE_STRPTIME)
+        fi
     fi
 
     dnl check for timezone variable
@@ -6483,6 +6602,14 @@ if test "$wxUSE_UNICODE" = "yes" ; then
     fi
 fi
 
+if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_UTF8" = "yes"; then
+    AC_DEFINE(wxUSE_UNICODE_UTF8)
+
+    if test "$wxUSE_UNICODE_UTF8_LOCALE" = "yes"; then
+        AC_DEFINE(wxUSE_UTF8_LOCALE_ONLY)
+    fi
+fi
+
 if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
   AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
 fi
@@ -6855,6 +6982,12 @@ if test "$wxUSE_LISTCTRL" = "yes"; then
     fi
 fi
 
+if test "$wxUSE_EDITABLELISTBOX" = "yes"; then
+    AC_DEFINE(wxUSE_EDITABLELISTBOX)
+    USES_CONTROLS=1
+    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS editlbox"
+fi
+
 if test "$wxUSE_NOTEBOOK" = "yes"; then
     AC_DEFINE(wxUSE_NOTEBOOK)
     USES_CONTROLS=1
@@ -7377,16 +7510,6 @@ if test "$wxUSE_MEDIACTRL" = "yes"; then
 
 
         if test "$wxUSE_GSTREAMER" = "yes"; then
-            dnl system gstreamer package is compiled with Sun CC and outputs
-            dnl CC-specific "-mt" in its flags, remove it for gcc compilation
-            case "${host}" in
-                *-*-solaris2* )
-                    if "$GCC" = yes; then
-                        GST_CFLAGS=`echo $GST_CFLAGS | sed 's/-mt//'`
-                        GST_LIBS=`echo $GST_LIBS | sed 's/-mt//'`
-                    fi
-            esac
-
             CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
             LIBS="$GST_LIBS $LIBS"
 
@@ -7585,7 +7708,7 @@ CPPFLAGS=`echo $WXCONFIG_CPPFLAGS \
 
 C_AND_CXX_FLAGS="$DEBUG_CFLAGS $PROFILE_FLAGS $OPTIMISE_CFLAGS"
 CFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $CFLAGS `
-CXXFLAGS=`echo $WXCONFIG_CXXFLAGS $CXXWARNINGS $C_AND_CXX_FLAGS $CXXFLAGS `
+CXXFLAGS=`echo $WXCONFIG_CXXFLAGS $C_AND_CXX_FLAGS $CXXFLAGS `
 
 dnl now that we added WXCONFIG_CPPFLAGS to CPPFLAGS we can add the wx-config
 dnl only stuff to it
@@ -7717,6 +7840,7 @@ AC_SUBST(WXUNIV)
 AC_SUBST(MONOLITHIC)
 AC_SUBST(USE_PLUGINS)
 AC_SUBST(LIBS)
+AC_SUBST(CXXWARNINGS)
 AC_SUBST(EXTRALIBS)
 AC_SUBST(EXTRALIBS_XML)
 AC_SUBST(EXTRALIBS_HTML)
@@ -7919,6 +8043,38 @@ fi
 dnl TOOLCHAIN_DEFS should be used for both wx and client code
 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $TOOLCHAIN_DEFS"
 
+
+dnl Sun cc is compatible with gcc and so either of them can use the C
+dnl libraries built with the other, i.e. gcc can be used to build wxGTK under
+dnl Solaris where GTK+ is compiled using cc and cc can be used under Linux
+dnl where GTK+ is built with gcc
+dnl
+dnl However the compiler options are not compatible at all and in particular
+dnl gcc doesn't like cc -mt option and cc doesn't like -pthread. We simply
+dnl filter them out as we already have the correct options for multithreaded
+dnl programs if we're using threads (and if we don't, it shouldn't matter)
+case "${host}" in
+    *-*-solaris2* )
+        dnl system packages are compiled with Sun CC and so pkg-config outputs
+        dnl CC-specific "-mt" flag, remove it when using gcc
+        if "$GCC" = yes; then
+            CPPFLAGS=`echo $CPPFLAGS | sed 's/-mt//'`
+            LIBS=`echo $LIBS | sed 's/-mt//'`
+            EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-mt//'`
+        fi
+        ;;
+
+    *-*-linux* )
+        dnl OTOH when using Sun CC under Linux, the flags contain gcc-specific
+        dnl -pthreads which Sun CC doesn't know about
+        if test "x$SUNCXX" = xyes; then
+            CPPFLAGS=`echo $CPPFLAGS | sed 's/-pthread//'`
+            LIBS=`echo $LIBS | sed 's/-pthread//'`
+            EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-pthread//'`
+        fi
+        ;;
+esac
+
 dnl for convenience, sort the samples in alphabetical order
 dnl
 dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
@@ -8134,7 +8290,16 @@ echo "  Should wxWidgets be compiled into single library?       ${wxUSE_MONOLITH
 
 echo "  Should wxWidgets be compiled in debug mode?             ${wxUSE_DEBUG:-no}"
 echo "  Should wxWidgets be linked as a shared library?         ${wxUSE_SHARED:-no}"
-echo "  Should wxWidgets be compiled in Unicode mode?           ${wxUSE_UNICODE:-no}"
+echo -n "  Should wxWidgets support Unicode?                       ${wxUSE_UNICODE:-no}"
+if test "$wxUSE_UNICODE" = "yes"; then
+    if test "$wxUSE_UNICODE_UTF8" = "yes"; then
+        echo " (using UTF-8)"
+    else
+        echo " (using wchar_t)"
+    fi
+else
+    echo
+fi
 
 echo "  What level of wxWidgets compatibility should be enabled?"
 echo "                                       wxWidgets 2.6      ${WXWIN_COMPATIBILITY_2_6:-no}"