DEFAULT_wxUSE_ACCESSIBILITY=no
DEFAULT_wxUSE_IPV6=no
DEFAULT_wxUSE_GSTREAMER8=no
+DEFAULT_wxUSE_UNICODE_UTF8=no
+DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
dnl automatic features
DEFAULT_wxUSE_ARTPROVIDER_TANGO=auto
-DEFAULT_wxUSE_UNICODE_UTF8=auto
DEFAULT_wxUSE_OPENGL=auto
DEFAULT_wxUSE_MEDIACTRL=auto
DEFAULT_wxUSE_COMPILER_TLS=auto
DEFAULT_wxUSE_HOTKEY=auto
DEFAULT_wxUSE_METAFILE=auto
-DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
-
dnl Mac/Cocoa users need to enable building universal binaries explicitly
DEFAULT_wxUSE_UNIVERSAL_BINARY=no
DEFAULT_wxUSE_MAC_ARCH=no
WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
WX_ARG_DISABLE(vararg_macros,[ --disable-vararg_macros don't use vararg macros, even if they are supported], wxUSE_VARARG_MACROS)
-WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary create universal binary with Mac PPC and i386 (and x86_64 if using Cocoa) architectures ]], wxUSE_UNIVERSAL_BINARY)
+WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary=archs create universal binary for the specified (or all supported) architectures]], wxUSE_UNIVERSAL_BINARY)
WX_ARG_ENABLE_PARAM(macosx_arch, [[ --enable-macosx_arch=ARCH build for just the specified architecture]], wxUSE_MAC_ARCH)
WX_ARG_ENABLE(compat26, [ --enable-compat26 enable wxWidgets 2.6 compatibility], WXWIN_COMPATIBILITY_2_6)
retest_macosx_linking=no
OSX_ARCH_OPTS=""
-if test "x$wxUSE_MAC_ARCH" != xno; then
- OSX_ARCH_OPTS="-arch $wxUSE_MAC_ARCH"
-fi
-
-dnl Support the old --enable-universal_binary in case anyone was using it.
- if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then
- dnl --enable-universal_binary uses a default SDK (currently 10.4u)
- dnl --enable-universal_binary=SDK names a path to an SDK
- if test "x$wxUSE_UNIVERSAL_BINARY" == xyes; then
- # Implicitly turn on the new --with-macosx-sdk using the default
- # SDK which provides the behaviour this option has always had.
- if test "x$wxUSE_MACOSX_SDK" = "x"; then
- AC_MSG_WARN([Enabling default SDK due to --enable-universal_binary.])
- AC_MSG_WARN([If you don't want this, specify --without-macosx-sdk])
- wxUSE_MACOSX_SDK=yes
- fi
- else
- # Complain to user if he specified an argument to --enable-universal_binary
- # and also 1) specified --with-macosx-sdk using the default (yes) or
- # 2) specified --with-macosx-sdk using a path or 3) specified
- # --without-macosx-sdk (no).
- if test "x$wxUSE_MACOSX_SDK" != "x" ; then
- AC_MSG_FAILURE([Please specify the new --with-macosx-sdk=PATH and do not specify an arg to --enable-universal_binary])
- else
- # Put the SDK path into the wxUSE_MACOSX_SDK. We don't have to
- # special-case the empty string because the below test simply
- # converts "no" to the empty string anyway.
- wxUSE_MACOSX_SDK="$wxUSE_UNIVERSAL_BINARY"
- dnl Warn about deprecated usage.
- AC_MSG_WARN([Please use --with-macosx-sdk=PATH and --enable-universal_binary without an argument])
- fi
- fi
- dnl FIXME: I think it would be better to put this into CC, CXX, and LD rather than the flags.
- OSX_ARCH_OPTS="-arch ppc -arch i386"
- if test "$wxUSE_OSX_COCOA" = 1; then
- OSX_ARCH_OPTS="$OSX_ARCH_OPTS -arch x86_64"
+
+dnl Deal with architecture selection. By default, we compile for the current
+dnl architecture, whatever it is. With --enable-universal_binary the list of
+dnl architectures can be explicitly specified. If it isn't, we compile for all
+dnl supported ones.
+if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then
+ if test "x$wxUSE_MAC_ARCH" != xno; then
+ AC_MSG_WARN([--enable-macosx_arch is ignored when --enable-universal_binary is used.])
+ fi
+
+ if test "x$wxUSE_UNIVERSAL_BINARY" != xyes; then
+ OSX_ARCH_OPTS=$wxUSE_UNIVERSAL_BINARY
+ else dnl Use all architectures supported
+ OSX_ARCH_OPTS="ppc,i386"
+ if test "$wxUSE_OSX_COCOA" = 1; then
+ OSX_ARCH_OPTS="$OSX_ARCH_OPTS,x86_64"
fi
- AC_MSG_CHECKING([for universal binary architectures])
- AC_MSG_RESULT([$OSX_ARCH_OPTS])
-
- dnl NOTE: Only the compiler driver needs arch flags. The link editor
- dnl is incapable of using them but the compiler driver (which we use
- dnl as LD when building dynamic libraries) uses them to invoke the
- dnl real ld multiple times. If we moved to libtool -dynamic we would
- dnl need no arch flags because libtool automatically invokes ld for
- dnl every architecture found in the fat input files.
- dnl
- dnl For static library builds, AR/RANLIB automatically create proper
- dnl fat archives although AR is unable to update them once RANLIB has
- dnl made them into proper fat archives. Fortunately, our link process
- dnl simply removes the .a file before using ar to create a new one.
- dnl If we did move to libtool -static we still wouldn't need arch flags
- dnl because libtool automatically figures it out based on input.
- retest_macosx_linking=yes
-
- dnl HACK: PCH could be made to work by precompiling for each architecture into separate directories
- dnl and including all architecture directories with each compiler invocation.
- dnl That would require a major rework of Bakefile and at the same time it would be nice to have
- dnl Objective-C++ precompiled headers.
- AC_MSG_WARN([Disabling precompiled headers due to universal binary build.])
- bk_use_pch=no
fi
-CXXFLAGS="$OSX_ARCH_OPTS $CXXFLAGS"
-CFLAGS="$OSX_ARCH_OPTS $CFLAGS"
-OBJCXXFLAGS="$OSX_ARCH_OPTS $OBJCXXFLAGS"
-OBJCFLAGS="$OSX_ARCH_OPTS $OBJCFLAGS"
-LDFLAGS="$OSX_ARCH_OPTS $LDFLAGS"
+ AC_MSG_CHECKING([for architectures to use in universal binary])
+ AC_MSG_RESULT([$OSX_ARCH_OPTS])
+
+ dnl NOTE: Only the compiler driver needs arch flags. The link editor
+ dnl is incapable of using them but the compiler driver (which we use
+ dnl as LD when building dynamic libraries) uses them to invoke the
+ dnl real ld multiple times. If we moved to libtool -dynamic we would
+ dnl need no arch flags because libtool automatically invokes ld for
+ dnl every architecture found in the fat input files.
+ dnl
+ dnl For static library builds, AR/RANLIB automatically create proper
+ dnl fat archives although AR is unable to update them once RANLIB has
+ dnl made them into proper fat archives. Fortunately, our link process
+ dnl simply removes the .a file before using ar to create a new one.
+ dnl If we did move to libtool -static we still wouldn't need arch flags
+ dnl because libtool automatically figures it out based on input.
+ retest_macosx_linking=yes
+
+ dnl HACK: PCH could be made to work by precompiling for each architecture into separate directories
+ dnl and including all architecture directories with each compiler invocation.
+ dnl That would require a major rework of Bakefile and at the same time it would be nice to have
+ dnl Objective-C++ precompiled headers.
+ AC_MSG_WARN([Disabling precompiled headers due to universal binary build.])
+ bk_use_pch=no
+else
+ if test "x$wxUSE_MAC_ARCH" != xno; then
+ OSX_ARCH_OPTS=$wxUSE_MAC_ARCH
+ fi
+fi
+
+if test "x$OSX_ARCH_OPTS" != "x"; then
+ OSX_ARCH_OPTS=`echo $OSX_ARCH_OPTS | sed -e 's/^/-arch /' -e 's/,/ -arch /g'`
+
+ CXXFLAGS="$OSX_ARCH_OPTS $CXXFLAGS"
+ CFLAGS="$OSX_ARCH_OPTS $CFLAGS"
+ OBJCXXFLAGS="$OSX_ARCH_OPTS $OBJCXXFLAGS"
+ OBJCFLAGS="$OSX_ARCH_OPTS $OBJCFLAGS"
+ LDFLAGS="$OSX_ARCH_OPTS $LDFLAGS"
+fi
dnl Set up the Mac OS X SDK. We do this early so configure tests will occur
dnl with the SDK in place.
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 "$USE_UNIX" = 1 -a "$wxUSE_DARWIN" != 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 ---------------------------------------------------------------------------
AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl,
[
dnl our troubles are not over: HP-UX 11 prototypes vsnprintf() as
- dnl taking "char *" and not "const char *" while Metrowerks does
- dnl provide a correct vsnprintf declaration but in C++ mode it's
- dnl always in std namespace and so we have to bring it in scope
+ dnl taking "char *" and not "const char *" so test for this too
AC_TRY_COMPILE(
[
#include <stdio.h>
#include <stdarg.h>
- #ifdef __MSL__
- #if __MSL__ >= 0x6000
- namespace std {}
- using namespace std;
- #endif
- #endif
],
[
char *buf;
dnl do other tests only if we are using threads
if test "$wxUSE_THREADS" = "yes" ; then
- AC_CHECK_FUNCS(thr_setconcurrency)
+ AC_CHECK_FUNCS(pthread_setconcurrency,
+ AC_DEFINE(HAVE_PTHREAD_SET_CONCURRENCY),
+ [
+ AC_CHECK_FUNCS(thr_setconcurrency,
+ AC_DEFINE(HAVE_THR_SETCONCURRENCY),
+ AC_MSG_WARN(Setting thread concurrency will not work properly))
+ ])
dnl can't use AC_CHECK_FUNCS for this one as it's usually a macro and so
dnl wouldn't be found by it
if test "$wxUSE_TASKBARICON" = "yes"; then
AC_DEFINE(wxUSE_TASKBARICON)
+ dnl This is used under MSW, just enable it always without testing for the
+ dnl toolkit nor providing a separate option for it because it's totally
+ dnl harmless to have it defined even if it's unnecessary.
+ AC_DEFINE(wxUSE_TASKBARICON_BALLOONS)
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar"
fi
if test "$wxUSE_OSX_IPHONE" = 1; then
EXTRA_FRAMEWORKS="-framework IOKit -framework UIKit -framework CFNetwork -framework AudioToolbox -framework CoreFoundation -framework CoreGraphics -framework OpenGLES -framework Foundation -framework QuartzCore"
else
- EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -framework QuickTime"
+ EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL"
+
+ dnl The case of QuickTime framework is special: we only need it in
+ dnl 32 bit builds and not in 64 bit and, moreover, linking with it
+ dnl in 64 bit builds results in a warning because the framework is
+ dnl not available in 64 bits itself. So make an effort to avoid it
+ dnl when building for 64 bits only (i.e. not universal build).
+
+ if test "$cross_compiling" != "no"; then
+ dnl The check below doesn't work well when cross-compiling
+ dnl ("file" under non-OS X systems might not recognize
+ dnl universal binaries) so assume we do build for 32 bits as
+ dnl it's safer: at worst we'll get a warning when building in
+ dnl 64 bits only, but at least the build will still work.
+ wx_cv_target_x86_64=no
+ else
+ AC_CACHE_CHECK(
+ [if we target only x86_64],
+ wx_cv_target_x86_64,
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([int main() { return 0; }])],
+ if file conftest$ac_exeext|grep -q 'i386\|ppc'; then
+ wx_cv_target_x86_64=no
+ else
+ wx_cv_target_x86_64=yes
+ fi
+ )
+ )
+ fi
+
+ if test "$wx_cv_target_x86_64" != "yes"; then
+ EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework QuickTime"
+ fi
fi
fi
fi
dnl
dnl note that the order is somewhat important: wxWidgets headers should
dnl come first and the one with setup.h should be before $(top_srcdir)/include
-dnl in case the latter contains setup.h used by non-autoconf makefiles (e.g.
-dnl CodeWarrior):
+dnl in case the latter contains setup.h used by non-autoconf makefiles
CPPFLAGS=`echo $WXCONFIG_CPPFLAGS \
-I\\${wx_top_builddir}/lib/wx/include/${TOOLCHAIN_FULLNAME} \
-I\\${top_srcdir}/include $TOOLKIT_INCLUDE \