Make wxCocoa compile on Tiger.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott 2005-03-14 04:47:28 +00:00
parent e605541c36
commit 1d1af5eaf0
5 changed files with 186 additions and 0 deletions

View File

@ -78,6 +78,18 @@ XLCXX=`test $wx_compiler_xlc = yes && echo yes`
AC_LANG_POP(C++)
])
dnl ===========================================================================
dnl Objective-C(++) related macros
dnl ===========================================================================
m4_define([AC_WX_LANG_OBJECTIVEC],
[AC_LANG(C)
ac_ext=m
])
m4_define([AC_WX_LANG_OBJECTIVECPLUSPLUS],
[AC_LANG(C++)
ac_ext=mm
])
dnl ===========================================================================
dnl macros to find the a file in the list of include/lib paths

12
aclocal.m4 vendored
View File

@ -91,6 +91,18 @@ XLCXX=`test $wx_compiler_xlc = yes && echo yes`
AC_LANG_POP(C++)
])
dnl ===========================================================================
dnl Objective-C(++) related macros
dnl ===========================================================================
m4_define([AC_WX_LANG_OBJECTIVEC],
[AC_LANG(C)
ac_ext=m
])
m4_define([AC_WX_LANG_OBJECTIVECPLUSPLUS],
[AC_LANG(C++)
ac_ext=mm
])
dnl ===========================================================================
dnl macros to find the a file in the list of include/lib paths

130
configure vendored
View File

@ -29360,6 +29360,136 @@ WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_u
if test "$wxUSE_COCOA" = 1; then
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=m
echo "$as_me:$LINENO: checking if AppKit/NSEvent.h conflicts with CoreFoundation" >&5
echo $ECHO_N "checking if AppKit/NSEvent.h conflicts with CoreFoundation... $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 <AppKit/NSEvent.h>
#include <CoreFoundation/CoreFoundation.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: no" >&5
echo "${ECHO_T}no" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
echo "$as_me:$LINENO: checking if defining __Point__ will fix it" >&5
echo $ECHO_N "checking if defining __Point__ will fix it... $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 __Point__ 1
#include <AppKit/NSEvent.h>
#include <CoreFoundation/CoreFoundation.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
cat >>confdefs.h <<\_ACEOF
#define __Point__ 1
_ACEOF
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { echo "$as_me:$LINENO: error: no
See \`config.log' for more details." >&5
echo "$as_me: error: no
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
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then
WX_RESOURCES_MACOSX_ASCII="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.r"
WX_RESOURCES_MACOSX_DATA="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.rsrc"

View File

@ -3520,6 +3520,35 @@ WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_u
if test "$wxUSE_COCOA" = 1; then
AC_LANG_SAVE
AC_WX_LANG_OBJECTIVEC
dnl Recent AppKit/NSEvent.h include parts of IOKit which eventually
dnl gets IOKit/graphics/IOGraphicsTypes.h included which typedefs
dnl Point but only if MacTypes.h was not included first. Of course,
dnl if MacTypes.h is included later then you're screwed when it
dnl tries to typedef Point. Defining __Point__ will cause IOGraphicsTypes.h
dnl to not typedef Point and thus fix the problem.
AC_MSG_CHECKING([if AppKit/NSEvent.h conflicts with CoreFoundation])
AC_TRY_COMPILE([#include <AppKit/NSEvent.h>
#include <CoreFoundation/CoreFoundation.h>
],[],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
AC_MSG_CHECKING([if defining __Point__ will fix it])
AC_TRY_COMPILE([#define __Point__ 1
#include <AppKit/NSEvent.h>
#include <CoreFoundation/CoreFoundation.h>
],[],
[AC_MSG_RESULT([yes])
AC_DEFINE(__Point__)
],
[AC_MSG_FAILURE([no])]
)]
)
AC_LANG_RESTORE
fi
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then
dnl base name of the resource file for wxMac must be the same
dnl as library installation base name (-install_name)

View File

@ -110,6 +110,9 @@
#undef __POWERPC__
#undef TARGET_CARBON
/* Hack to make IOGraphicsTypes.h not define Point conflicting with MacTypes */
#undef __Point__
/* MS-DOS with DJGPP */
#undef __DOS__