- if cpu == 'powerpc' and conf.env['build_target'] != 'none':
- #
- # Apple/PowerPC optimization options
- #
- # -mcpu=7450 does not reliably work with gcc 3.*
- #
- if opt.dist_target == 'panther' or opt.dist_target == 'tiger':
- if platform == 'darwin':
- # optimization_flags.extend ([ "-mcpu=7450", "-faltivec"])
- # to support g3s but still have some optimization for above
- compiler_flags.extend ([ "-mcpu=G3", "-mtune=7450"])
- else:
- compiler_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
- else:
- compiler_flags.extend([ "-mcpu=750", "-mmultiple" ])
- compiler_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
- optimization_flags.extend (["-Os"])
+ if conf.options.cxx11 or conf.env['build_host'] in [ 'mavericks', 'yosemite' ]:
+ conf.check_cxx(cxxflags=["-std=c++11"])
+ cxx_flags.append('-std=c++11')
+ if platform == "darwin":
+ cxx_flags.append('--stdlib=libstdc++')
+ # Mavericks and later changed the syntax to be used when including Carbon headers,
+ # from requiring a full path to requiring just the header name.
+ cxx_flags.append('-DCARBON_FLAT_HEADERS')
+ linker_flags.append('--stdlib=libstdc++')
+ # Prevents visibility issues in standard headers
+ conf.define("_DARWIN_C_SOURCE", 1)
+
+ if (is_clang and platform == "darwin") or conf.env['build_host'] in ['mavericks', 'yosemite']:
+ # Silence warnings about the non-existing osx clang compiler flags
+ # -compatibility_version and -current_version. These are Waf
+ # generated and not needed with clang
+ c_flags.append("-Qunused-arguments")
+ cxx_flags.append("-Qunused-arguments")