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
37 # NOTE: currently needed for env.ComponentObject magic below
39 CPPPATH=['$SOURCE_ROOT/googleclient/third_party/npapi/files/include']
42 # NOTE: needed for a bunch of includes from X11/Intrinsic.h
44 CPPPATH=['$SOURCE_ROOT/googleclient/third_party/libxt/include']
54 'google_nacl_npruntime',
59 if not env.Bit('mac'):
60 env['COMPONENT_STATIC'] = False
64 # because of: nacl_av_priv.h:55: error: ISO C++ prohibits anonymous structs
66 env.FilterOut(CCFLAGS=['-pedantic'])
92 ['TARGET_API_MAC_CARBON', '1'],
99 # TODO: it's a little awkward to, when you want a bundle:
100 # 1) add -bundle to your LINKFLAGS
101 # 2) create a "program" (which shows up in all_programs target)
102 # 3) create a bundle out of it, specifying the bundle extension
103 # Ideally that all happens inside a CompleteBundlePseudoBuilder().
105 '-bundle', '-framework', 'Foundation'
110 if env.Bit('windows'):
116 'XP_WIN', 'WIN32', '_WINDOWS'
123 env.Tool('atlmfc_vc80')
126 nacl_npplugin_inputs = [
127 # TODO: we should put a scons file in third_party/npapi_plugin
128 # which exports a library which is then linked in.
129 # I tried this but got link time symbol clashes
131 env.ComponentObject('np_entry',
132 '$MAIN_DIR/third_party/npapi_plugin/np_entry.cc'),
133 env.ComponentObject('npn_gate',
134 '$MAIN_DIR/third_party/npapi_plugin/npn_gate.cc'),
137 # NPAPI remote support
138 'npapi_bridge/npmodule.cc',
141 'srpc/npapi_native.cc',
144 'srpc/connected_socket.cc',
145 'srpc/multimedia_socket.cc',
146 'srpc/shared_memory.cc',
147 'srpc/socket_address.cc',
148 'srpc/srpc_client.cc',
149 'srpc/service_runtime_interface.cc',
150 'srpc/srt_socket.cc',
151 'srpc/unknown_handle.cc',
153 # generic URL-origin / same-domain handling
157 if env['TARGET_PLATFORM'] == 'WINDOWS':
158 nacl_npplugin_inputs += [
159 'npapi_bridge/win/npmodule_win.cc',
161 env.RES('nacl_plugin.rc'),
164 nacl_npplugin_inputs += [
165 'npapi_bridge/linux/npmodule_linux.cc'
168 if env['TARGET_PLATFORM'] == 'MAC':
169 nacl_npplugin_inputs += [
170 'npapi_bridge/osx/npmodule_osx.cc'
174 npGoogleNaClPlugin = 'npGoogleNaClPlugin'
176 if not env.Bit('mac'):
177 exe = env.ComponentLibrary(npGoogleNaClPlugin, nacl_npplugin_inputs,
178 no_import_lib = True)
180 REZ = '/Developer/Tools/Rez'
181 env.Command(target='npGoogleNaClPlugin.rsrc',
182 source='npGoogleNaClPlugin.r',
183 action=[Action(REZ + ' -o $TARGET $SOURCE -useDF')])
184 exe = env.ComponentProgram(npGoogleNaClPlugin, nacl_npplugin_inputs,
185 no_import_lib = True)
186 # Bundle pattern can be found in
187 # //depot/googleclient/tools/hammer/site_scons/site_tools/target_platform_mac.py
188 env.Bundle('$STAGING_DIR/' + npGoogleNaClPlugin + '.bundle',
190 BUNDLE_PKGINFO_FILENAME = 0,
191 BUNDLE_RESOURCES = 'npGoogleNaClPlugin.rsrc')