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