summaryrefslogtreecommitdiffstats
path: root/gears
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-21 23:59:03 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-21 23:59:03 +0000
commitb0faad6b7aa2597115c07ca6fc3d6273c3c18191 (patch)
tree86b8e235ff0305b6eb586b707af9a58e8e7b0d26 /gears
parent6ea74bed6ddfe8f9f993a3770e303a7b5c6743ed (diff)
downloadchromium_src-b0faad6b7aa2597115c07ca6fc3d6273c3c18191.zip
chromium_src-b0faad6b7aa2597115c07ca6fc3d6273c3c18191.tar.gz
chromium_src-b0faad6b7aa2597115c07ca6fc3d6273c3c18191.tar.bz2
First cut at compiling Gears for Safari.
This contains the file list and correct compilation flags for the files. This doesn't yet link, but is only missing one custom builder. Review URL: http://codereview.chromium.org/8041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears')
-rw-r--r--gears/SConscript126
-rw-r--r--gears/SConscript.common7
-rw-r--r--gears/SConscript.dll185
-rw-r--r--gears/SConscript.libbreakpad_osx27
-rw-r--r--gears/SConscript.libgd2
-rw-r--r--gears/SConscript.libjpeg4
-rw-r--r--gears/SConscript.libmozjs113
-rw-r--r--gears/SConscript.portaudio18
-rw-r--r--gears/SConscript.sqlite10
9 files changed, 459 insertions, 33 deletions
diff --git a/gears/SConscript b/gears/SConscript
index 89224c4..f373024 100644
--- a/gears/SConscript
+++ b/gears/SConscript
@@ -6,6 +6,8 @@
# This assumes you have a working gears checkout from p4 in the current dir.
# Steps for this:
# > echo %USER%-chromegears > p4config
+# or on linux/osx:
+# > echo $USER-chromegears > p4config
# > set P4CONFIG=p4config
# > g4 client -p //depot/googleclient/gears/p4_depot_paths
# > g4 sync
@@ -56,7 +58,7 @@ os_browsers_map = {
'win32': ['IE', 'FF2', 'FF3', 'NPAPI'],
'wince': ['IE'],
'linux': ['FF2', 'FF3'],
- 'osx': ['SF'],
+ 'osx': ['SF', 'FF2', 'FF3'],
'android': ['NPAPI'],
}
@@ -98,7 +100,7 @@ env.Replace(
)
# Platform
-# TODO: OSX and Symbian builds will override this value.
+# TODO: Symbian builds will override this value.
# For other platforms we set just one value.
if env['OS'] in ['wince', 'android']:
env.Replace(ARCH = 'arm')
@@ -123,6 +125,18 @@ env.Replace(
COMMON_GENFILES_DIR = "$COMMON_OUTDIR/genfiles",
)
+# Library flags
+env.Replace(
+ MOZJS_INCLUDE_PATHS = [
+ '$MOZJS_DIR',
+ '$THIRD_PARTY_DIR/spidermonkey/nspr/pr/include',
+ '$THIRD_PARTY_DIR/spidermonkey/nspr/pr/include/private',
+ '$THIRD_PARTY_DIR/spidermonkey/nspr/pr/include/obsolete',
+ '$OSX_SDK_ROOT/Developer/Headers/FlatCarbon/',
+ ],
+ MOZJS_DIR = '$THIRD_PARTY_DIR/spidermonkey',
+)
+
# Add our tools to the PATH.
if os.path.exists(env.Dir('#/$PRIVATE_THIRD_PARTY_DIR').abspath):
paths = []
@@ -236,7 +250,6 @@ env.Replace(
'$OPEN_DIR',
'$OPEN_DIR/..',
'$THIRD_PARTY_DIR',
- '$THIRD_PARTY_DIR/breakpad/src',
'$THIRD_PARTY_DIR/googleurl',
'$THIRD_PARTY_DIR/npapi',
'$THIRD_PARTY_DIR/zlib',
@@ -247,10 +260,20 @@ env.Replace(
LIBPATH = [
'$LIBS_DIR',
],
+ CFLAGS = [],
CCFLAGS = [],
- CPPDEFINES = [],
+ CXXFLAGS = [],
+ CPPDEFINES = [
+ # SpiderMonkey (the Firefox JS engine)'s JS_GET_CLASS macro in jsapi.h needs
+ # this defined to work with the gecko SDK that we've built.
+ # The definition of JS_THREADSAFE must be kept in sync with MOZJS_CPPFLAGS.
+ 'JS_THREADSAFE'
+ ],
+ FRAMEWORKPATH = [],
+ FRAMEWORKS = [],
LIBS = [],
LINKFLAGS = [],
+ SHLINKFLAGS = [],
)
if env['MODE'] == 'dbg':
@@ -399,6 +422,7 @@ if env['OS'] in ['win32', 'wince']:
],
CPPPATH = [
'$VC80_CPPPATH',
+ '$THIRD_PARTY_DIR/breakpad/src',
],
LIBPATH = [
'$VC80_LIBPATH',
@@ -511,6 +535,7 @@ if env['OS'] in ['win32', 'wince']:
'/OPT:ICF',
],
)
+#--------------------------- LINUX ---------------------------
elif env['OS'] == 'linux':
env.Append(
CPPDEFINES = [
@@ -575,19 +600,108 @@ elif env['OS'] == 'linux':
'-O2',
],
)
+#--------------------------- OSX ---------------------------
+elif env['OS'] == 'osx':
+# Gears uses the 10.4 SDK, so we need to build with g++-4.0.
+# Chrome uses g++-4.2 so we override this here.
+ env['CC'] = 'gcc-4.0'
+ env['CXX'] = 'g++-4.0'
+# Compile assembly files with the same command line as C files.
+ env['ASCOM'] = '$CCCOM'
+
+ env.Append(OSX_SDK_ROOT = '/Developer/SDKs/MacOSX10.4u.sdk')
+ env.Append(
+ CPPDEFINES = [
+ 'OSX',
+ 'OS_MACOSX',
+# for breakpad
+ 'USE_PROTECTED_ALLOCATIONS=1',
+ ],
+ CPPPATH = [
+# Breakpad assumes it is in the include path
+ '$THIRD_PARTY_DIR/breakpad_osx/src',
+ ],
+ CCFLAGS = [
+ ('-arch', 'ppc'),
+ ('-arch', 'i386'),
+ '-fPIC',
+ '-fmessage-length=0',
+# TODO
+# '-Wall',
+# NS_LITERAL_STRING does not work properly without this compiler option
+ '-fshort-wchar',
+ '-fvisibility=hidden',
+# Breakpad on OSX needs debug symbols to use the STABS format, rather than the
+# default DWARF debug symbols format. Note that we enable gstabs for debug &
+# opt; we strip them later in opt.
+ '-gstabs+',
+ ],
+ CXXFLAGS = [
+ '-fvisibility-inlines-hidden',
+ '-fno-exceptions',
+ '-fno-rtti',
+ ('-Wall',
+ '-Wno-non-virtual-dtor',
+ '-Wno-ctor-dtor-privacy',
+ '-Wno-char-subscripts',
+# When a function is deprecated in gcc, it stupidly warns about all functions
+# and member functions that have the same name, regardless of signature.
+# Example: Standard osx headers deprecate 'SetPort', which causes a warning for
+# url_canon::Replacements::SetPort().
+ '-Wno-deprecated-declarations',
+ ),
+ '-funsigned-char',
+ ('-include', env.File('#/$OPEN_DIR/base/safari/prefix_header.h').abspath),
+ ('-isysroot', '$OSX_SDK_ROOT')
+ ],
+ LINKFLAGS = [
+ '-fPIC',
+ '-Bsymbolic',
+ '-arch',
+ 'ppc',
+ '-arch',
+ 'i386',
+ '-isysroot',
+ '$OSX_SDK_ROOT',
+ '-Wl,-dead_strip'
+ ],
+ )
+ if env['MODE'] == 'dbg':
+ env.Append(
+ CPPFLAGS = [
+ '-g',
+ '-O0',
+ ],
+ )
+ else: # MODE=opt
+ env.Append(
+ CPPFLAGS = [
+ '-O2',
+ ],
+ )
+
# Load all the components
sconscripts = [
'SConscript.googleurl',
- 'SConscript.libgd',
'SConscript.libjpeg',
'SConscript.libpng',
- 'SConscript.portaudio',
+ 'SConscript.libmozjs',
'SConscript.sqlite',
'SConscript.zlib',
]
+if env['OS'] == 'osx':
+ sconscripts += [
+ 'SConscript.libbreakpad_osx',
+ ]
+
+if env['OS'] != 'osx':
+ sconscripts += [
+ 'SConscript.libgd',
+ 'SConscript.portaudio',
+ ]
for each in sconscripts:
env.SConscript(each,
diff --git a/gears/SConscript.common b/gears/SConscript.common
index cfb7364..a497601 100644
--- a/gears/SConscript.common
+++ b/gears/SConscript.common
@@ -156,7 +156,8 @@ if env['OS'] == 'win32':
crash_sender = env.Program('crash_sender', crash_sender_srcs,
LIBS = Split('advapi32.lib shell32.lib wininet.lib'))
elif env['OS'] == 'osx':
- crash_sender = env.Program('crash_sender', crash_sender_srcs,
- FRAMEWORKS = Split('Carbon Cocoa Foundation IOKit SystemConfiguration'),
- LIBS='stdc++')
+ pass
+ # crash_sender = env.Program('crash_sender', crash_sender_srcs,
+ # FRAMEWORKS = Split('Carbon Cocoa Foundation IOKit SystemConfiguration'),
+ # LIBS='stdc++')
env.Alias('gears', crash_sender)
diff --git a/gears/SConscript.dll b/gears/SConscript.dll
index cdefdca..8136e54 100644
--- a/gears/SConscript.dll
+++ b/gears/SConscript.dll
@@ -9,6 +9,8 @@ Import('env')
env = env.Clone()
+env['USING_NPAPI'] = env['BROWSER'] in ['SF', 'NPAPI']
+
# TODO: move all these builders out to site_scons or somesuch.
# Building .stab files, using M4FLAGS.
@@ -70,6 +72,28 @@ elif env['BROWSER'] in ['FF2', 'FF3']:
env['GECKO_BASE'] = '$THIRD_PARTY_DIR/gecko_1.9'
env.PrependENVPath('PATH', env.Dir('#/$GECKO_BIN').abspath)
+elif env['BROWSER'] == 'SF':
+ env.Replace(
+# Enable breakpad for Safari on MacOSX.
+ USING_BREAKPAD_OSX = '1')
+
+ env.Append(
+ CPPDEFINES = [
+# Remove these - During development, it was convenient to have these defined in
+# the Safari port. Before release we want to clean this up, and replace these
+# with a single BROWSER_SF symbol.
+# We also want to consolidate the include paths, so we don't have to add these
+# paths here.
+ 'BROWSER_NPAPI',
+ 'BROWSER_WEBKIT',
+ 'BROWSER_SAFARI'
+ ],
+ CCFLAGS = [
+# These flags are needed so that instead of exporting all symbols defined in
+# the code, we just export those specifically marked, this reduces the output size.
+ '-fvisibility=hidden'
+ ],
+ CPPPATH = ['$THIRD_PARTY/spidermonkey/nspr/pr/include'])
def MyIdlEmitter(target, source, env):
"""Produce the list of outputs generated by our IDL compiler. Outputs
@@ -106,15 +130,18 @@ if env['BROWSER'] in ['FF2', 'FF3']:
env.Prepend(
CPPDEFINES = [
'BROWSER_${BROWSER}=1',
-# SpiderMonkey (the Firefox JS engine)'s JS_GET_CLASS macro in jsapi.h needs
-# this defined to work with the gecko SDK that we've built.
-# The definition of JS_THREADSAFE must be kept in sync with MOZJS_CPPFLAGS.
-# TODO(mpcomplete): we only need this for FF and SF, I think.
- 'JS_THREADSAFE',
],
)
if env['BROWSER'] in ['FF2', 'FF3']:
+
+ if env['OS'] == 'osx':
+ env.Prepend(
+ CPPDEFINES = [
+ 'LINUX'
+ ]
+ )
+
env.Prepend(
CPPDEFINES = [
# TODO(cprince): Update source files so we don't need this compatibility define?
@@ -157,6 +184,30 @@ env.Append(
],
)
+if env['OS'] == 'osx':
+ env.Append(
+ LINKFLAGS = [
+ '-mmacosx-version-min=10.4',
+ '-bundle'
+ ],
+ LIBS = [
+ 'mozjs-gears',
+ 'curl',
+ 'crypto',
+ 'leopard_support',
+ 'breakpad_osx-gears'
+ ],
+ LIBPATH = [
+ '$OPEN_DIR/tools/osx'
+ ],
+ FRAMEWORKS = [
+ 'Carbon',
+ 'CoreServices',
+ 'Cocoa',
+ 'WebKit',
+ ]
+ )
+
# Add in libraries for in-development APIs for non-official builds.
if not env['OFFICIAL_BUILD']:
if env['OS'] != 'wince':
@@ -296,6 +347,24 @@ if env['OS'] == 'win32':
# TODO: move to breakpad
env.Append(CPPFLAGS = ['/wd4018'])
+# Extra per-browser files
+browser_specific_objects = []
+
+if env['BROWSER'] == 'SF':
+ mozjs_sources = [
+ '$MOZJS_DIR/gears_npapi_bindings/mozjs_npruntime.cc',
+ '$MOZJS_DIR/gears_npapi_bindings/mozjs_npruntime_utils.cc',
+ '$OPEN_DIR/base/common/js_standalone_engine_mozjs.cc',
+ '$MOZJS_DIR/gears_npapi_bindings/mozjs_npapi_storage.cc'
+ ]
+ mozjs_objects = env.SharedObject(
+ mozjs_sources,
+ CPPPATH = env['CPPPATH'] + env['MOZJS_INCLUDE_PATHS'])
+ browser_specific_objects += mozjs_objects
+
+# TODO(playmobil): Create builder to generate required header files.
+# browser_specific_objects += \
+# env.SharedObject('$OPEN_DIR/base/safari/resource_archive.cc')
# Input file lists
def NewInputs():
@@ -341,6 +410,16 @@ if env['OS'] == 'win32':
]
#-----------------------------------------------------------------------------
+# third_party/breakpad_osx
+srcs['SF'] += [
+ '$OPEN_DIR/base/common/exception_handler_osx.mm',
+ '$OPEN_DIR/base/common/exception_handler_osx/google_breakpad.mm',
+ '$OPEN_DIR/base/common/exception_handler_osx/mach_ipc.mm',
+ '$OPEN_DIR/base/common/exception_handler_osx/on_demand_server.mm',
+ '$OPEN_DIR/base/common/exception_handler_osx/simple_string_dictionary.mm'
+]
+
+#-----------------------------------------------------------------------------
# third_party/v8/bindings
srcs['NPAPI'] += [
@@ -446,6 +525,13 @@ srcs['all'] += [
'$OPEN_DIR/base/common/vista_utils.cc',
]
+if env['OS'] == 'osx':
+ srcs['all'] += [
+ '$OPEN_DIR/base/common/common_osx.mm',
+ '$OPEN_DIR/base/safari/nsstring_utils.mm',
+ '$OPEN_DIR/base/common/user_config_osx.cc'
+ ]
+
#-----------------------------------------------------------------------------
# base/firefox
@@ -554,6 +640,33 @@ if env['OS'] == 'win32':
]
#-----------------------------------------------------------------------------
+# base/safari
+srcs['SF'] += [
+ '$OPEN_DIR/base/common/common_sf.mm',
+ '$OPEN_DIR/base/common/detect_version_collision_osx.cc',
+ '$OPEN_DIR/base/common/file_posix.cc',
+ '$OPEN_DIR/base/common/html_event_monitor_np.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_linux.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test_osx.mm',
+ '$OPEN_DIR/base/common/js_runner_np.cc',
+ '$OPEN_DIR/base/common/message_queue_sf.cc',
+ '$OPEN_DIR/base/common/paths_sf.mm',
+ '$OPEN_DIR/base/common/paths_sf_more.mm',
+ '$OPEN_DIR/base/npapi/browser_utils.cc',
+ '$OPEN_DIR/base/npapi/module.cc',
+ '$OPEN_DIR/base/npapi/np_utils.cc',
+ '$OPEN_DIR/base/npapi/npn_bindings.cc',
+ '$OPEN_DIR/base/npapi/npp_bindings.cc',
+ '$OPEN_DIR/base/npapi/plugin.cc',
+ '$OPEN_DIR/base/safari/browser_load_hook.mm',
+ '$OPEN_DIR/base/safari/browser_utils_sf.cc',
+ '$OPEN_DIR/base/safari/curl_downloader.mm',
+ '$OPEN_DIR/base/safari/messagebox.mm',
+ '$OPEN_DIR/base/safari/safari_workarounds.m',
+]
+
+#-----------------------------------------------------------------------------
# console
srcs['all'] += [
@@ -675,9 +788,12 @@ srcs['FF3'] += [
'$OPEN_DIR/localserver/common/http_cookies.cc',
]
+srcs['SF'] += [
+ '$OPEN_DIR/localserver/common/http_cookies.cc',
+]
+
#-----------------------------------------------------------------------------
# localserver/chrome + npapi
-# TODO: safari
srcs['NPAPI'] += [
'$OPEN_DIR/localserver/chrome/gears_protocol_handler.cc',
@@ -690,6 +806,22 @@ srcs['NPAPI'] += [
]
#-----------------------------------------------------------------------------
+# localserver/safari
+
+srcs['SF'] += [
+ '$OPEN_DIR/localserver/safari/async_task_sf.mm',
+ '$OPEN_DIR/localserver/safari/http_cookies_sf.mm',
+ '$OPEN_DIR/localserver/safari/http_handler.mm',
+ '$OPEN_DIR/localserver/safari/http_request_delegate.mm',
+ '$OPEN_DIR/localserver/safari/http_request_sf.mm',
+ '$OPEN_DIR/localserver/safari/localserver_db_proxy.mm',
+ '$OPEN_DIR/localserver/common/progress_event.cc',
+ '$OPEN_DIR/localserver/safari/progress_input_stream.mm',
+ '$OPEN_DIR/localserver/common/safe_http_request.cc',
+ '$OPEN_DIR/localserver/safari/ui_thread.cc'
+]
+
+#-----------------------------------------------------------------------------
# localserver/firefox
srcs['FF3'] += [
@@ -767,6 +899,10 @@ srcs['FF3'] += [
'$OPEN_DIR/ui/common/settings_dialog.cc',
]
+srcs['SF'] += [
+ '$OPEN_DIR/ui/common/settings_dialog.cc',
+]
+
stabsrcs['all'] = [
'$OPEN_DIR/ui/common/permissions_dialog.js.stab',
'$OPEN_DIR/ui/common/settings_dialog.js.stab',
@@ -775,7 +911,6 @@ stabsrcs['all'] = [
#-----------------------------------------------------------------------------
# ui/npapi
-# TODO: safari
m4srcs['all'] += [
'$OPEN_DIR/ui/ie/ui_resources.rc.m4',
@@ -790,6 +925,16 @@ srcs['NPAPI'] += [
]
#-----------------------------------------------------------------------------
+# ui/safari
+
+srcs['SF'] += [
+ '$OPEN_DIR/ui/safari/html_dialog_sf.mm',
+ '$OPEN_DIR/ui/safari/html_modeless_dialog_sf.mm',
+ '$OPEN_DIR/ui/safari/native_dialogs_osx.mm',
+ '$OPEN_DIR/ui/safari/settings_menu.mm',
+]
+
+#-----------------------------------------------------------------------------
# ui/factory
m4srcs['FF3'] += [
@@ -850,13 +995,12 @@ elif env['OS'] == 'wince':
#-----------------------------------------------------------------------------
# workerpool/npapi
-# TODO: safari
-
-srcs['NPAPI'] += [
- '$OPEN_DIR/workerpool/common/workerpool_utils.cc',
- '$OPEN_DIR/workerpool/npapi/pool_threads_manager.cc',
- '$OPEN_DIR/workerpool/workerpool.cc',
-]
+if env['USING_NPAPI']:
+ srcs['all'] += [
+ '$OPEN_DIR/workerpool/common/workerpool_utils.cc',
+ '$OPEN_DIR/workerpool/npapi/pool_threads_manager.cc',
+ '$OPEN_DIR/workerpool/workerpool.cc',
+ ]
#-----------------------------------------------------------------------------
# workerpool/firefox
@@ -959,11 +1103,12 @@ if not env['OFFICIAL_BUILD'] and env['OS'] != 'wince':
#-----------------------------------------------------------------------------
# factory/npapi
-srcs['NPAPI'] += [
- '$OPEN_DIR/factory/factory_impl.cc',
- '$OPEN_DIR/factory/factory_np.cc',
- '$OPEN_DIR/factory/factory_utils.cc',
-]
+if env['USING_NPAPI']:
+ srcs['all'] += [
+ '$OPEN_DIR/factory/factory_impl.cc',
+ '$OPEN_DIR/factory/factory_np.cc',
+ '$OPEN_DIR/factory/factory_utils.cc',
+ ]
#-----------------------------------------------------------------------------
# factory/firefox
@@ -1180,7 +1325,7 @@ if env['OS'] in ['win32', 'wince']:
env.Depends(module_res, m4s)
module = env.ChromeSharedLibrary('gears',
- srcs['all'] + libs + dll_resources)
+ srcs['all'] + libs + dll_resources + browser_specific_objects)
env.Alias('gears', module)
if env['OS'] == 'wince':
diff --git a/gears/SConscript.libbreakpad_osx b/gears/SConscript.libbreakpad_osx
new file mode 100644
index 0000000..7a8bff4
--- /dev/null
+++ b/gears/SConscript.libbreakpad_osx
@@ -0,0 +1,27 @@
+# Copyright (c) 2008 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.
+
+Import('env')
+
+env = env.Clone(
+)
+
+env.Append(
+)
+
+input_files = [
+ '$THIRD_PARTY_DIR/breakpad_osx/src/client/mac/handler/dynamic_images.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/client/mac/handler/exception_handler.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/common/mac/file_id.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/common/mac/macho_id.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/common/mac/macho_utilities.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/common/mac/macho_walker.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/client/minidump_file_writer.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/client/mac/handler/minidump_generator.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/client/mac/handler/protected_memory_allocator.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/common/string_conversion.cc',
+ '$THIRD_PARTY_DIR/breakpad_osx/src/common/mac/string_utilities.cc',
+]
+
+env.ChromeStaticLibrary('breakpad_osx-gears', input_files)
diff --git a/gears/SConscript.libgd b/gears/SConscript.libgd
index a857721..79c1961 100644
--- a/gears/SConscript.libgd
+++ b/gears/SConscript.libgd
@@ -45,7 +45,7 @@ if env['OS'] == 'win32':
'/wd4102',
],
)
-elif env['OS'] == 'linux':
+elif env['OS'] in ['linux', 'osx']:
env.Append(
CPPFLAGS = [
'-Wno-unused-variable',
diff --git a/gears/SConscript.libjpeg b/gears/SConscript.libjpeg
index c6c7da6..167f026 100644
--- a/gears/SConscript.libjpeg
+++ b/gears/SConscript.libjpeg
@@ -18,9 +18,9 @@ env.Replace(
],
)
-if env['OS'] == 'linux':
+if env['OS'] in ['osx', 'linux']:
env.Append(
- CCFLAGS = [
+ CFLAGS = [
'-Wno-main',
],
)
diff --git a/gears/SConscript.libmozjs b/gears/SConscript.libmozjs
new file mode 100644
index 0000000..bc7ac9c
--- /dev/null
+++ b/gears/SConscript.libmozjs
@@ -0,0 +1,113 @@
+# Copyright (c) 2008 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.
+
+Import('env')
+
+env = env.Clone(
+)
+
+env.Append(
+ CPPDEFINES = [
+ 'JS_THREADSAFE',
+ 'XP_UNIX',
+ 'DARWIN',
+ 'HAVE_BSD_FLOCK',
+ 'XP_MACOSX',
+ 'HAVE_LCHOWN',
+ 'HAVE_STRERROR',
+ 'FORCE_PR_LOG',
+ '_PR_PTHREADS',
+ 'UHAVE_CVAR_BUILT_ON_SEM',
+ '_NSPR_BUILD_',
+ 'OSARCH=Darwin',
+ 'STATIC_JS_API',
+ 'JS_USE_SAFE_ARENA',
+ 'TRIMMED',
+ 'JS_HAS_EXPORT_IMPORT'
+ ],
+ CPPPATH = '$MOZJS_INCLUDE_PATHS',
+)
+
+input_files = [
+ # Common Files
+ '$MOZJS_DIR/nspr/pr/src/md/unix/darwin.c',
+ '$MOZJS_DIR/js/src/jsapi.c',
+ '$MOZJS_DIR/js/src/jsarena.c',
+ '$MOZJS_DIR/js/src/jsarray.c',
+ '$MOZJS_DIR/js/src/jsatom.c',
+ '$MOZJS_DIR/js/src/jsbool.c',
+ '$MOZJS_DIR/js/src/jscntxt.c',
+ '$MOZJS_DIR/js/src/jsdate.c',
+ '$MOZJS_DIR/js/src/jsdbgapi.c',
+ '$MOZJS_DIR/js/src/jsdhash.c',
+ '$MOZJS_DIR/js/src/jsdtoa.c',
+ '$MOZJS_DIR/js/src/jsemit.c',
+ '$MOZJS_DIR/js/src/jsexn.c',
+ '$MOZJS_DIR/js/src/jsfun.c',
+ '$MOZJS_DIR/js/src/jsgc.c',
+ '$MOZJS_DIR/js/src/jshash.c',
+ '$MOZJS_DIR/js/src/jsinterp.c',
+ '$MOZJS_DIR/js/src/jsinvoke.c',
+ '$MOZJS_DIR/js/src/jsiter.c',
+ '$MOZJS_DIR/js/src/jskwgen.c',
+ '$MOZJS_DIR/js/src/jslock.c',
+ '$MOZJS_DIR/js/src/jslog2.c',
+ '$MOZJS_DIR/js/src/jslong.c',
+ '$MOZJS_DIR/js/src/jsmath.c',
+ '$MOZJS_DIR/js/src/jsnum.c',
+ '$MOZJS_DIR/js/src/jsobj.c',
+ '$MOZJS_DIR/js/src/jsopcode.c',
+ '$MOZJS_DIR/js/src/jsparse.c',
+ '$MOZJS_DIR/js/src/jsprf.c',
+ '$MOZJS_DIR/js/src/jsregexp.c',
+ '$MOZJS_DIR/js/src/jsscan.c',
+ '$MOZJS_DIR/js/src/jsscope.c',
+ '$MOZJS_DIR/js/src/jsscript.c',
+ '$MOZJS_DIR/js/src/jsstr.c',
+ '$MOZJS_DIR/js/src/jsutil.c',
+ '$MOZJS_DIR/js/src/jsxdrapi.c',
+ '$MOZJS_DIR/js/src/jsxml.c',
+ '$MOZJS_DIR/xpcom/glue/pldhash.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/pratom.c',
+ '$MOZJS_DIR/nspr/pr/src/threads/prcmon.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prdtoa.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prenv.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prerr.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prerror.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prerrortable.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prfdcach.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prinit.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prinrval.c',
+ '$MOZJS_DIR/nspr/pr/src/io/priometh.c',
+ '$MOZJS_DIR/nspr/pr/src/io/pripv6.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prlayer.c',
+ '$MOZJS_DIR/nspr/pr/src/linking/prlink.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prlog.c',
+ '$MOZJS_DIR/nspr/pr/src/malloc/prmalloc.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prmapopt.c',
+ '$MOZJS_DIR/nspr/pr/src/malloc/prmem.c',
+ '$MOZJS_DIR/js/src/prmjtime.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prmmap.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prmwait.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prnetdb.c',
+ '$MOZJS_DIR/nspr/pr/src/md/prosdep.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prprf.c',
+ '$MOZJS_DIR/nspr/pr/src/threads/prrwlock.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prscanf.c',
+ '$MOZJS_DIR/nspr/pr/src/memory/prseg.c',
+ '$MOZJS_DIR/nspr/pr/src/io/prstdio.c',
+ '$MOZJS_DIR/nspr/pr/src/misc/prtime.c',
+ '$MOZJS_DIR/nspr/pr/src/threads/prtpd.c',
+ '$MOZJS_DIR/nspr/pr/src/pthreads/ptio.c',
+ '$MOZJS_DIR/nspr/pr/src/pthreads/ptmisc.c',
+ '$MOZJS_DIR/nspr/pr/src/pthreads/ptsynch.c',
+ '$MOZJS_DIR/nspr/pr/src/pthreads/ptthread.c',
+ '$MOZJS_DIR/nspr/pr/src/md/unix/unix.c',
+ '$MOZJS_DIR/nspr/pr/src/md/unix/unix_errors.c',
+ '$MOZJS_DIR/nspr/pr/src/md/unix/uxproces.c',
+ '$MOZJS_DIR/nspr/pr/src/md/unix/os_Darwin_ppc.s',
+ '$MOZJS_DIR/nspr/pr/src/md/unix/os_Darwin_x86.s',
+]
+
+env.ChromeStaticLibrary('mozjs-gears', input_files)
diff --git a/gears/SConscript.portaudio b/gears/SConscript.portaudio
index 888ef1d..612d8f1 100644
--- a/gears/SConscript.portaudio
+++ b/gears/SConscript.portaudio
@@ -50,7 +50,23 @@ elif env['OS'] == 'linux':
'HAVE_SYS_SOUNDCARD_H=1',
],
)
-
+elif env['OS'] == 'osx':
+ env.Append(
+ CPPPATH = [
+ '$PA_DIR/src/hostapi/coreaudio',
+ '$PA_DIR/src/hostapi/mac_osx',
+ '$PA_DIR/src/os/unix',
+ ],
+ CPPFLAGS = [
+# disable some warnings
+ '-Wno-unused-variable',
+ '-Wno-uninitialized',
+ ],
+ CPPDEFINES = [
+ 'PA_USE_COREAUDIO',
+ ],
+ )
+
input_files = [
'$PA_DIR/src/common/pa_allocation.c',
'$PA_DIR/src/common/pa_converters.c',
diff --git a/gears/SConscript.sqlite b/gears/SConscript.sqlite
index 9fb9c3f..09fe8fa9 100644
--- a/gears/SConscript.sqlite
+++ b/gears/SConscript.sqlite
@@ -73,6 +73,16 @@ elif env['OS'] == 'linux':
'HAVE_USLEEP=1',
],
)
+elif env['OS'] == 'osx':
+ env.Append(
+ CFLAGS = [
+ '-Wno-uninitialized',
+ '-Wno-pointer-sign',
+ ],
+ CPPDEFINES = [
+ 'HAVE_USLEEP=1',
+ ],
+ )
input_files = [
'$SQLITE_DIR/src/alter.c',