diff options
-rw-r--r-- | base/compat_execinfo.h | 34 | ||||
-rw-r--r-- | base/file_util_posix.cc | 8 | ||||
-rw-r--r-- | build/common.gypi | 42 | ||||
-rw-r--r-- | o3d/DEPS_gyp | 2 |
4 files changed, 48 insertions, 38 deletions
diff --git a/base/compat_execinfo.h b/base/compat_execinfo.h index 472fa5e..c615cf2 100644 --- a/base/compat_execinfo.h +++ b/base/compat_execinfo.h @@ -1,29 +1,33 @@ // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// A file you can include instead of <execinfo.h> if your project might have -// been compiled with our SUPPORT_MACOSX_10_4 flag defined. -// If SUPPORT_MACOSX_10_4 is not defined it just includes execinfo.h as normal, -// otherwise it defines the symbols itself as weak linked imports, which enables -// launching on 10.4 where they are not defined. + +// A file you can include instead of <execinfo.h> if your project might need +// to run on Mac OS X 10.4. #ifndef BASE_COMPAT_EXECINFO_H #define BASE_COMPAT_EXECINFO_H -#ifdef SUPPORT_MACOSX_10_4 +#include "build/build_config.h" + +#if defined(OS_MACOSX) +#include <AvailabilityMacros.h> +#endif + +#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 // Manually define these here as weak imports, rather than including execinfo.h. // This lets us launch on 10.4 which does not have these calls. extern "C" { - extern int backtrace(void**, int) __attribute__((weak_import)); - extern char** backtrace_symbols(void* const*, int) - __attribute__((weak_import)); - extern void backtrace_symbols_fd(void* const*, int, int) - __attribute__((weak_import)); -} + +extern int backtrace(void**, int) __attribute__((weak_import)); +extern char** backtrace_symbols(void* const*, int) + __attribute__((weak_import)); +extern void backtrace_symbols_fd(void* const*, int, int) + __attribute__((weak_import)); + +} // extern "C" #else #include <execinfo.h> #endif -#endif // BASE_COMPAT_EXECINFO_H - +#endif // BASE_COMPAT_EXECINFO_H diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 7c212c0..7274d76 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -18,6 +18,10 @@ #include <time.h> #include <unistd.h> +#if defined(OS_MACOSX) +#include <AvailabilityMacros.h> +#endif + #include <fstream> #include "base/basictypes.h" @@ -83,7 +87,9 @@ class LocaleAwareComparator { namespace file_util { -#if defined(OS_FREEBSD) || defined(SUPPORT_MACOSX_10_4) +#if defined(OS_FREEBSD) || \ + (defined(OS_MACOSX) && \ + MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) typedef struct stat stat_wrapper_t; static int CallStat(const char *path, stat_wrapper_t *sb) { return stat(path, sb); diff --git a/build/common.gypi b/build/common.gypi index 5b2d0b6..5f09ea6 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -55,15 +55,22 @@ # Linux-Mac cross compiler distcc farm. 'chromium_mac_pch%': 1, - # We normally expect MacOS X 10.5 at runtime in the product generated. - # Set to 1 to enable MacOS X 10.4 support where possible. - # Harmless to set on other platforms, as it has no effect. - # This is designed so that products such as O3D can use some Chrome source - # without losing 10.4 support. - # Look for support_macosx_10_4 later in the file to see where it turns on - # compile flags, defines SUPPORT_MACOSX_10_4 in the C preprocessor, - # and changes the Xcode deployment target setting. - 'support_macosx_10_4%': 0, + # Mac OS X SDK and deployment target support. + # The SDK identifies the version of the system headers that will be used, + # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro. + # "Maximum allowed" refers to the operating system version whose APIs are + # available in the headers. + # The deployment target identifies the minimum system version that the + # built products are expected to function on. It corresponds to the + # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. + # To ensure these macros are available, #include <AvailabilityMacros.h>. + # Additional documentation on these macros is available at + # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3 + # Chrome normally builds with the Mac OS X 10.5 SDK and sets the + # deployment target to 10.5. Other projects, such as O3D, may override + # these defaults. + 'mac_sdk%': '10.5', + 'mac_deployment_target%': '10.5', # Set to 1 to enable code coverage. In addition to build changes # (e.g. extra CFLAGS), also creates a new target in the src/chrome @@ -610,31 +617,24 @@ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings - 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden + # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror 'GCC_VERSION': '4.2', 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof - 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5 + # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min + 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', 'PREBINDING': 'NO', # No -Wl,-prebind - 'SDKROOT': 'macosx10.5', # -isysroot + 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot 'USE_HEADERMAP': 'NO', 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'], 'conditions': [ ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'} ], - ['support_macosx_10_4', - { - 'OTHER_CFLAGS': ['-D', 'SUPPORT_MACOSX_10_4',], - 'MACOSX_DEPLOYMENT_TARGET': '10.4', # mmacosx-version-min=10.4 - }, - { - 'MACOSX_DEPLOYMENT_TARGET': '10.5', # mmacosx-version-min=10.5 - } - ], ], }, 'target_conditions': [ diff --git a/o3d/DEPS_gyp b/o3d/DEPS_gyp index 737f78c..c8fef5c 100644 --- a/o3d/DEPS_gyp +++ b/o3d/DEPS_gyp @@ -146,6 +146,6 @@ hooks = [ # A change to a .gyp, .gypi, or to GYP itself shound run the generator. "pattern": "\\.gypi?$|[/\\\\]src[/\\\\]tools[/\\\\]gyp[/\\\\]|MANIFEST$", "action": ["python", "build/gyp_o3d", "build/all.gyp", "--depth", ".", - "-D", "support_macosx_10_4=1"], + "-D", "mac_deployment_target=10.4"], }, ] |