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
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=no
+ DEFAULT_wxUSE_UNICODE_UTF8=auto
+ DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
DEFAULT_wxUSE_WCSRTOMBS=no
DEFAULT_wxUSE_PALETTE=no
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
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=no
+ DEFAULT_wxUSE_UNICODE_UTF8=auto
+ DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
DEFAULT_wxUSE_WCSRTOMBS=no
DEFAULT_wxUSE_PALETTE=yes
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,
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
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)
-dnl FIXME-UTF8: make UTF8 automatic
-WX_ARG_ENABLE(utf8, [ --enable-utf8 use UTF-8 representation for strings (Unix only)], wxUSE_UNICODE_UTF8)
+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)
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)
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)
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
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 ---------------------------------------------------------------------------
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, ...)
wx_cv_func_va_copy=yes,
wx_cv_func_va_copy=no
)
+ AC_LANG_POP()
]
)
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
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 ---------------------------------------------------------------------------
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"
;;
*-*-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* )
;;
esac
+ fi
if test $wxUSE_RPATH = "no"; then
SAMPLES_RPATH_FLAG=''
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 ---------------------------------------------------------------------------
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
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
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*)
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);
],
wx_cv_func_pthread_cleanup=no
]
)
+ AC_LANG_POP()
])
if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then
AC_DEFINE(wxHAVE_PTHREAD_CLEANUP)
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
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,
[
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
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
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
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"
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
AC_SUBST(MONOLITHIC)
AC_SUBST(USE_PLUGINS)
AC_SUBST(LIBS)
+AC_SUBST(CXXWARNINGS)
AC_SUBST(EXTRALIBS)
AC_SUBST(EXTRALIBS_XML)
AC_SUBST(EXTRALIBS_HTML)
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
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}"