When host is OS X (PowerPC Darwin) check if compiler defines __POWERPC__

before defining it in setup.h and if -D__CF_USE_FRAMEWORK_INCLUDES__ is
required for CoreFoundation headers (MW).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2005-02-19 06:58:25 +00:00
parent e327fddf5f
commit 4d7ec9f1e7
2 changed files with 203 additions and 5 deletions

174
configure vendored
View File

@@ -1980,10 +1980,6 @@ _ACEOF
cat >>confdefs.h <<\_ACEOF
#define __DARWIN__ 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define __POWERPC__ 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
@@ -12630,6 +12626,176 @@ fi
case "${host}" in
powerpc-*-darwin* )
echo "$as_me:$LINENO: checking if __POWERPC__ is already defined" >&5
echo $ECHO_N "checking if __POWERPC__ is already defined... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
#ifndef __POWERPC__
choke me for lack of PowerPC
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 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); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
cat >>confdefs.h <<\_ACEOF
#define __POWERPC__ 1
_ACEOF
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: checking if CoreFoundation/CFBase.h is usable" >&5
echo $ECHO_N "checking if CoreFoundation/CFBase.h is usable... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <CoreFoundation/CFBase.h>
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 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); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
echo "$as_me:$LINENO: checking if __CF_USE_FRAMEWORK_INCLUDES__ is required" >&5
echo $ECHO_N "checking if __CF_USE_FRAMEWORK_INCLUDES__ is required... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define __CF_USE_FRAMEWORK_INCLUDES__
#include <CoreFoundation/CFBase.h>
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 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); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
CPPFLAGS="$CPPFLAGS -D__CF_USE_FRAMEWORK_INCLUDES__"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { echo "$as_me:$LINENO: error: no. CoreFoundation not available.
See \`config.log' for more details." >&5
echo "$as_me: error: no. CoreFoundation not available.
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
;;
esac
case "${host}" in
*-pc-os2_emx | *-pc-os2-emx )
if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then

View File

@@ -328,7 +328,6 @@ case "${host}" in
SO_SUFFIX=dylib
AC_DEFINE(__BSD__)
AC_DEFINE(__DARWIN__)
AC_DEFINE(__POWERPC__)
AC_DEFINE(TARGET_CARBON)
DEFAULT_DEFAULT_wxUSE_MAC=1
;;
@@ -1495,6 +1494,39 @@ dnl ------------------------------------------------------------------------
dnl Platform specific tests
dnl ------------------------------------------------------------------------
dnl This case is for OS X vs. everything else
case "${host}" in
powerpc-*-darwin* )
AC_MSG_CHECKING([if __POWERPC__ is already defined])
AC_TRY_COMPILE([],[#ifndef __POWERPC__
choke me for lack of PowerPC
#endif
],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_DEFINE(__POWERPC__)
])
AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
],[],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required])
AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
#include <CoreFoundation/CFBase.h>
],[],
[AC_MSG_RESULT([yes])
dnl We must use -D so source files that don't include wx/setup.h
dnl but do include CFBase will work.
CPPFLAGS="$CPPFLAGS -D__CF_USE_FRAMEWORK_INCLUDES__"],
[AC_MSG_FAILURE([no. CoreFoundation not available.])]
)
]
)
;;
esac
dnl This case is for OS/2 vs. everything else
case "${host}" in
*-pc-os2_emx | *-pc-os2-emx )
dnl ---------------------------------------------------------------------