Chromium Code Reviews| Index: tools/gn/bootstrap/bootstrap.py |
| diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py |
| index 937427c6b4ce98e0d3d11bf26bfbc7864517e6da..8a16147ee7c2235a716fa555f3de7879c34d3191 100755 |
| --- a/tools/gn/bootstrap/bootstrap.py |
| +++ b/tools/gn/bootstrap/bootstrap.py |
| @@ -32,7 +32,8 @@ SRC_ROOT = os.path.dirname(os.path.dirname(GN_ROOT)) |
| is_win = sys.platform.startswith('win') |
| is_linux = sys.platform.startswith('linux') |
| is_mac = sys.platform.startswith('darwin') |
| -is_posix = is_linux or is_mac |
| +is_aix = sys.platform.startswith('aix') |
| +is_posix = is_linux or is_mac or is_aix |
| def check_call(cmd, **kwargs): |
| logging.debug('Running: %s', ' '.join(cmd)) |
| @@ -222,6 +223,8 @@ def write_generic_ninja(path, static_libraries, executables, |
| template_filename = 'build_vs.ninja.template' |
| elif is_mac: |
| template_filename = 'build_mac.ninja.template' |
| + elif is_aix: |
| + template_filename = 'build_aix.ninja.template' |
| else: |
| template_filename = 'build.ninja.template' |
| @@ -297,6 +300,11 @@ def write_gn_ninja(path, root_gen_dir, options): |
| cxx = os.environ.get('CXX', 'cl.exe') |
| ld = os.environ.get('LD', 'link.exe') |
| ar = os.environ.get('AR', 'lib.exe') |
| + elif is_aix: |
| + cc = os.environ.get('CC', 'gcc') |
| + cxx = os.environ.get('CXX', 'c++') |
| + ld = os.environ.get('LD', cxx) |
| + ar = os.environ.get('AR', 'ar -X64') |
| else: |
| cc = os.environ.get('CC', 'cc') |
| cxx = os.environ.get('CXX', 'c++') |
| @@ -317,6 +325,8 @@ def write_gn_ninja(path, root_gen_dir, options): |
| if options.debug: |
| cflags.extend(['-O0', '-g']) |
| else: |
| + # The linux::ppc64 BE binary doesn't "work" when |
| + # optimization level is set to 2 (0 works fine). |
|
Dirk Pranke
2017/04/14 01:19:33
This comment confuses me. If this is true, doesn't
rayb
2017/04/19 19:51:50
The current bootstrap script has no way of detecti
|
| cflags.extend(['-O2', '-g0']) |
| cflags.extend([ |
| @@ -327,6 +337,9 @@ def write_gn_ninja(path, root_gen_dir, options): |
| '-fno-exceptions' |
| ]) |
| cflags_cc.extend(['-std=c++11', '-Wno-c++11-narrowing']) |
| + if is_aix: |
| + cflags.extend(['-maix64']) |
| + ldflags.extend([ '-maix64 -Wl,-bbigtoc' ]) |
| elif is_win: |
| if not options.debug: |
| cflags.extend(['/Ox', '/DNDEBUG', '/GL']) |
| @@ -596,8 +609,7 @@ def write_gn_ninja(path, root_gen_dir, options): |
| 'cflags': cflags + ['-DHAVE_CONFIG_H'], |
| } |
| - if is_linux: |
| - libs.extend(['-lrt', '-latomic']) |
| + if is_linux or is_aix: |
| ldflags.extend(['-pthread']) |
| static_libraries['xdg_user_dirs'] = { |
| @@ -624,13 +636,25 @@ def write_gn_ninja(path, root_gen_dir, options): |
| 'base/threading/platform_thread_linux.cc', |
| 'base/trace_event/malloc_dump_provider.cc', |
| ]) |
| - static_libraries['libevent']['include_dirs'].extend([ |
| - os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'linux') |
| - ]) |
| - static_libraries['libevent']['sources'].extend([ |
| - 'base/third_party/libevent/epoll.c', |
| - ]) |
| - |
| + if is_linux: |
| + libs.extend(['-lrt', '-latomic']) |
| + static_libraries['libevent']['include_dirs'].extend([ |
| + os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'linux') |
| + ]) |
| + static_libraries['libevent']['sources'].extend([ |
| + 'base/third_party/libevent/epoll.c', |
| + ]) |
| + else: |
| + libs.extend(['-lrt']) |
| + static_libraries['base']['sources'].extend([ |
| + 'base/process/internal_aix.cc' |
| + ]) |
| + static_libraries['libevent']['include_dirs'].extend([ |
| + os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'aix') |
| + ]) |
| + static_libraries['libevent']['include_dirs'].extend([ |
| + os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'compat') |
| + ]) |
| if is_mac: |
| static_libraries['base']['sources'].extend([ |