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
This commit is contained in:
Vadim Zeitlin
2012-04-03 11:50:23 +00:00
parent 771563baee
commit fe1fd8d5d5
2 changed files with 94 additions and 2 deletions

62
configure vendored
View File

@@ -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

View File

@@ -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