Skip to content

Instantly share code, notes, and snippets.

@atiq-cs
Created September 29, 2016 19:41
Show Gist options
  • Save atiq-cs/3ecdf05c428663d510d2acef20c97968 to your computer and use it in GitHub Desktop.
Save atiq-cs/3ecdf05c428663d510d2acef20c97968 to your computer and use it in GitHub Desktop.
Modification of bootstrap.py for sparc solaris
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py
index e830454..0d6d817 100755
--- a/tools/gn/bootstrap/bootstrap.py
+++ b/tools/gn/bootstrap/bootstrap.py
@@ -31,8 +31,9 @@ SRC_ROOT = os.path.dirname(os.path.dirname(GN_ROOT))
is_win = sys.platform.startswith('win')
is_linux = sys.platform.startswith('linux')
+is_solaris = sys.platform.startswith('sunos')
is_mac = sys.platform.startswith('darwin')
-is_posix = is_linux or is_mac
+is_posix = is_linux or is_mac or is_solaris
def check_call(cmd, **kwargs):
logging.debug('Running: %s', ' '.join(cmd))
@@ -192,6 +193,7 @@ def build_gn_with_ninja_manually(tempdir, options):
else:
cmd.append('gn')
check_call(cmd)
def write_generic_ninja(path, static_libraries, executables,
@@ -593,6 +595,27 @@ def write_gn_ninja(path, root_gen_dir, options):
'base/third_party/libevent/epoll.c',
])
+ if is_solaris:
+ libs.extend(['-lrt', '-latomic'])
+ ldflags.extend(['-pthread'])
+
+ static_libraries['xdg_user_dirs'] = {
+ 'sources': [
+ 'base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
+ ],
+ 'tool': 'cxx',
+ }
+ static_libraries['base']['sources'].extend([
+ 'base/memory/shared_memory_posix.cc',
+ 'base/nix/xdg_util.cc',
+ 'base/process/internal_solaris.cc',
+ 'base/process/process_handle_solaris.cc',
+ 'base/strings/sys_string_conversions_posix.cc',
+ 'base/threading/platform_thread_solaris.cc',
+ ])
+ static_libraries['libevent']['include_dirs'].extend([
+ os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'solaris')
+ ])
if is_mac:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment