From 536defd91c521bb2281b4fe79c595a5c71ff85dc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 3 Feb 2016 18:17:31 +0100 Subject: [PATCH] Get rid of TARGET_CARBON as well Don't define this symbol in configure and don't test for it. Also remove a stray reference to wxUSE_OSX_CARBON not removed by the previous commit. --- configure | 47 ++++++++---------- configure.in | 89 +++++++++++++++-------------------- include/wx/osx/config_xcode.h | 1 - include/wx/platform.h | 4 -- setup.h.in | 1 - 5 files changed, 56 insertions(+), 86 deletions(-) diff --git a/configure b/configure index a5ea8df5c3..99a323c245 100755 --- a/configure +++ b/configure @@ -3887,8 +3887,6 @@ case "${host}" in $as_echo "#define __DARWIN__ 1" >>confdefs.h - $as_echo "#define TARGET_CARBON 1" >>confdefs.h - DEFAULT_DEFAULT_wxUSE_OSX_COCOA=1 ;; @@ -23074,35 +23072,32 @@ if test "$wxUSE_ZLIB" != "no" ; then if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then - if test "$USE_DARWIN" = 1; then - system_zlib_h_ok="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib.h >= 1.1.4" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib.h >= 1.1.4" >&5 $as_echo_n "checking for zlib.h >= 1.1.4... " >&6; } if ${ac_cv_header_zlib_h+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - unset ac_cv_header_zlib_h + unset ac_cv_header_zlib_h else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include + #include + #include - int main() - { - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%s", - ZLIB_VERSION[0] == '1' && - (ZLIB_VERSION[2] > '1' || - (ZLIB_VERSION[2] == '1' && - ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); - exit(0); - } + int main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%s", + ZLIB_VERSION[0] == '1' && + (ZLIB_VERSION[2] > '1' || + (ZLIB_VERSION[2] == '1' && + ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); + exit(0); + } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -23118,7 +23113,7 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_zlib_h" >&5 $as_echo "$ac_cv_header_zlib_h" >&6; } - ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" " + ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" " " if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -23126,10 +23121,7 @@ fi - system_zlib_h_ok=$ac_cv_header_zlib_h - fi - - if test "$system_zlib_h_ok" = "yes"; then + if test "$ac_cv_header_zlib_h" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 $as_echo_n "checking for deflate in -lz... " >&6; } if ${ac_cv_lib_z_deflate+:} false; then : @@ -27015,7 +27007,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext TOOLKIT=OSX_COCOA GUIDIST=OSX_COCOA_DIST - TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__" + TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__" fi if test "$wxUSE_OSX_IPHONE" = 1; then @@ -37765,7 +37757,7 @@ if test "$wxUSE_MAC" = 1 ; then else EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL" - if test "$wxUSE_OSX_CARBON" = 1 -o "$wxUSE_MEDIACTRL" = "yes"; then + if "$wxUSE_MEDIACTRL" = "yes"; then if test "$cross_compiling" != "no"; then wx_cv_target_x86_64=no @@ -42637,4 +42629,3 @@ echo " libmspack ${wxUSE_LIBMSPAC echo " sdl ${wxUSE_LIBSDL}" echo "" - diff --git a/configure.in b/configure.in index 95e174db0e..237dade5d3 100644 --- a/configure.in +++ b/configure.in @@ -285,7 +285,6 @@ case "${host}" in USE_DARWIN=1 AC_DEFINE(__BSD__) AC_DEFINE(__DARWIN__) - AC_DEFINE(TARGET_CARBON) DEFAULT_DEFAULT_wxUSE_OSX_COCOA=1 ;; @@ -2309,53 +2308,42 @@ if test "$wxUSE_ZLIB" != "no" ; then AC_DEFINE(wxUSE_ZLIB) if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then - dnl don't test for zlib under Mac -- its verson there is 1.1.3 but we - dnl should still use it because hopefully (can someone confirm this?) - dnl Apple did fix the security problem in it and not using the system - dnl library results in a whole bunch of warnings when linking with - dnl Carbon framework - if test "$USE_DARWIN" = 1; then - system_zlib_h_ok="yes" - else - dnl we have troubles with ancient zlib versions (e.g. 1.0.4 is - dnl known to not work) and although I don't know which is - dnl the minimal required version it's safer to test for 1.1.4 as - dnl it fixes a security problem in 1.1.3 -- and hopefully nobody - dnl has anything more ancient (1.1.3 was released in July 1998) - dnl anyhow - AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h, - [AC_TRY_RUN( - dnl zlib.h defines ZLIB_VERSION="x.y.z" - [ - #include - #include + dnl we have troubles with ancient zlib versions (e.g. 1.0.4 is + dnl known to not work) and although I don't know which is + dnl the minimal required version it's safer to test for 1.1.4 as + dnl it fixes a security problem in 1.1.3 -- and hopefully nobody + dnl has anything more ancient (1.1.3 was released in July 1998) + dnl anyhow + AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h, + [AC_TRY_RUN( + dnl zlib.h defines ZLIB_VERSION="x.y.z" + [ + #include + #include - int main() - { - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%s", - ZLIB_VERSION[0] == '1' && - (ZLIB_VERSION[2] > '1' || - (ZLIB_VERSION[2] == '1' && - ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); - exit(0); - } - ], - ac_cv_header_zlib_h=`cat conftestval`, - ac_cv_header_zlib_h=no, - dnl cross-compiling: don't have an answer, try later - unset ac_cv_header_zlib_h - )] - ) - dnl If the test above did not come up with a value (e.g. cross - dnl compiling) then this should give a definitive answer - AC_CHECK_HEADER(zlib.h,,, [ ]) + int main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%s", + ZLIB_VERSION[0] == '1' && + (ZLIB_VERSION[2] > '1' || + (ZLIB_VERSION[2] == '1' && + ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); + exit(0); + } + ], + ac_cv_header_zlib_h=`cat conftestval`, + ac_cv_header_zlib_h=no, + dnl cross-compiling: don't have an answer, try later + unset ac_cv_header_zlib_h + )] + ) + dnl If the test above did not come up with a value (e.g. cross + dnl compiling) then this should give a definitive answer + AC_CHECK_HEADER(zlib.h,,, [ ]) - system_zlib_h_ok=$ac_cv_header_zlib_h - fi - - if test "$system_zlib_h_ok" = "yes"; then + if test "$ac_cv_header_zlib_h" = "yes"; then AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz") fi @@ -3273,7 +3261,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config TOOLKIT=OSX_COCOA GUIDIST=OSX_COCOA_DIST - dnl see the comment above in wxUSE_OSX_CARBON branch TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__" fi @@ -7410,10 +7397,8 @@ if test "$wxUSE_MAC" = 1 ; then dnl need it in 32 bit builds and not in 64 bit and, moreover, dnl linking with it in 64 bit builds results in a warning because dnl the framework is not available in 64 bits itself. So make an - dnl effort to avoid using it unnecessarily. Note that with Carbon - dnl we also need it for wxSound an as Carbon is itself not - dnl available in 64 bits anyhow, there is no reason to avoid it. - if test "$wxUSE_OSX_CARBON" = 1 -o "$wxUSE_MEDIACTRL" = "yes"; then + dnl effort to avoid using it unnecessarily. + if "$wxUSE_MEDIACTRL" = "yes"; then if test "$cross_compiling" != "no"; then dnl The check below doesn't work well when cross-compiling @@ -7524,7 +7509,7 @@ elif test "$GXX" = yes ; then AX_CXXFLAGS_GCC_OPTION(-Woverloaded-virtual, CXXWARNINGS) dnl when building under Mac we currently get hundreds of deprecation - dnl warnings for Carbon symbols from the standard headers -- disable them + dnl warnings for Cocoa symbols from the standard headers -- disable them dnl as we already know that they're deprecated and nothing else can be seen dnl with these warnings on if test "$wxUSE_MAC" = 1 ; then diff --git a/include/wx/osx/config_xcode.h b/include/wx/osx/config_xcode.h index 871d711efd..2f38214f8f 100644 --- a/include/wx/osx/config_xcode.h +++ b/include/wx/osx/config_xcode.h @@ -20,7 +20,6 @@ #define __BSD__ 1 #define __DARWIN__ 1 #define wx_USE_NANOX 0 -#define TARGET_CARBON 1 #define HAVE_EXPLICIT 1 #define HAVE_VA_COPY 1 diff --git a/include/wx/platform.h b/include/wx/platform.h index b2f65e763e..b490d52a96 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -289,10 +289,6 @@ /* __DARWIN__ is our own define to mean OS X or pure Darwin */ # ifndef __DARWIN__ # define __DARWIN__ 1 -# endif - /* NOTE: TARGET_CARBON is actually a 0/1 and must be 1 for OS X */ -# ifndef TARGET_CARBON -# define TARGET_CARBON 1 # endif /* OS X uses unsigned long size_t for both ILP32 and LP64 modes. */ # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) diff --git a/setup.h.in b/setup.h.in index ded9e5fd7c..439e42afa4 100644 --- a/setup.h.in +++ b/setup.h.in @@ -113,7 +113,6 @@ /* PowerPC Darwin & Mac OS X */ #undef __POWERPC__ -#undef TARGET_CARBON /* Hack to make IOGraphicsTypes.h not define Point conflicting with MacTypes */ #undef __Point__