From fe1fd8d5d514c6c2d720719c1413f0dd3d2a1271 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Apr 2012 11:50:23 +0000 Subject: [PATCH] Don't link with QuickTime framework in 64 bit wxOSX builds. This framework doesn't exist in 64 bits and so using it results in a warning when building 64 bit libraries. Avoid this by omitting it if we are sure that we target 64 bits only. Closes #14144. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++- configure.in | 34 +++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 3f4ae9b284..90b0e3cf35 100755 --- a/configure +++ b/configure @@ -51725,7 +51725,67 @@ if test "$wxUSE_MAC" = 1 ; then 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" + + + if test "$cross_compiling" != "no"; then + wx_cv_target_x86_64=no + else + { echo "$as_me:$LINENO: checking if we target only x86_64" >&5 +echo $ECHO_N "checking if we target only x86_64... $ECHO_C" >&6; } +if test "${wx_cv_target_x86_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int main() { return 0; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + if file conftest$ac_exeext|grep -q 'i386\|ppc'; then + wx_cv_target_x86_64=no + else + wx_cv_target_x86_64=yes + fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $wx_cv_target_x86_64" >&5 +echo "${ECHO_T}$wx_cv_target_x86_64" >&6; } + fi + + if test "$wx_cv_target_x86_64" != "yes"; then + EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework QuickTime" + fi fi fi fi diff --git a/configure.in b/configure.in index 4e654c5c28..35d5048f14 100644 --- a/configure.in +++ b/configure.in @@ -7734,7 +7734,39 @@ if test "$wxUSE_MAC" = 1 ; then 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 -- 2.45.2