1 # Copyright 2008, Google Inc.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
14 # * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 # TODO: there is an unreferenced file ldt_unittest.cc in this directory
37 '$SOURCE_ROOT/googleclient/third_party/npapi/files/include',
43 '$SOURCE_ROOT/googleclient',
44 '$SOURCE_ROOT/googleclient/third_party/libxt/include',
52 'google_nacl_npruntime',
57 if not env.Bit('mac'):
58 env['COMPONENT_STATIC'] = False
78 CPPPATH = ['/Developer/Headers/FlatCarbon'],
86 ['TARGET_API_MAC_CARBON', '1'],
93 # TODO: it's a little awkward to, when you want a bundle:
94 # 1) add -bundle to your LINKFLAGS
95 # 2) create a "program" (which shows up in all_programs target)
96 # 3) create a bundle out of it, specifying the bundle extension
97 # Ideally that all happens inside a CompleteBundlePseudoBuilder().
99 '-bundle', '-framework', 'Foundation'
104 if env.Bit('windows'):
110 'XP_WIN', 'WIN32', '_WINDOWS'
117 env.Tool('atlmfc_vc80')
120 nacl_npplugin_inputs = [
122 env.ComponentObject('np_entry',
123 '$MAIN_DIR/third_party/npapi_plugin/np_entry.cc'),
124 env.ComponentObject('npn_gate',
125 '$MAIN_DIR/third_party/npapi_plugin/npn_gate.cc'),
128 # NPAPI remote support
129 'npapi_bridge/npmodule.cc',
134 'srpc/connected_socket.cc',
135 'srpc/shared_memory.cc',
136 'srpc/socket_address.cc',
137 'srpc/srpc_client.cc',
138 'srpc/service_runtime_interface.cc',
139 'srpc/unknown_handle.cc',
141 # generic URL-origin / same-domain handling
145 if env['TARGET_PLATFORM'] == 'WINDOWS':
146 nacl_npplugin_inputs += [
147 'npapi_bridge/win/npmodule_win.cc',
149 env.RES('nacl_plugin.rc'),
152 nacl_npplugin_inputs += [
153 'npapi_bridge/linux/npmodule_linux.cc'
156 if env['TARGET_PLATFORM'] == 'MAC':
157 nacl_npplugin_inputs += [
158 'npapi_bridge/osx/npmodule_osx.cc'
162 npGoogleNaClPlugin = 'npGoogleNaClPlugin'
164 if not env.Bit('mac'):
165 exe = env.ComponentLibrary(npGoogleNaClPlugin, nacl_npplugin_inputs,
166 no_import_lib = True)
168 REZ = '/Developer/Tools/Rez'
169 env.Command(target='npGoogleNaClPlugin.rsrc',
170 source='npGoogleNaClPlugin.r',
171 action=[Action(REZ + ' -o $TARGET $SOURCE -useDF')])
172 exe = env.ComponentProgram(npGoogleNaClPlugin, nacl_npplugin_inputs,
173 no_import_lib = True)
174 # Bundle pattern can be found in
175 # //depot/googleclient/tools/hammer/site_scons/site_tools/target_platform_mac.py
176 env.Bundle('$STAGING_DIR/' + npGoogleNaClPlugin + '.bundle',
178 BUNDLE_PKGINFO_FILENAME = 0,
179 BUNDLE_RESOURCES = 'npGoogleNaClPlugin.rsrc')