| OLD | NEW |
| 1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 | 6 |
| 7 # Protobuffer compilation | 7 # Protobuffer compilation |
| 8 def ProtocolBufferEmitter(target, source, env): | 8 def ProtocolBufferEmitter(target, source, env): |
| 9 """ Inputs: | 9 """ Inputs: |
| 10 target: list of targets to compile to | 10 target: list of targets to compile to |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 pthread | 166 pthread |
| 167 ssl | 167 ssl |
| 168 xml2 | 168 xml2 |
| 169 z""") | 169 z""") |
| 170 env['CPPPATH'] = ['..', '../../third_party/chrome/files', '../../common'] | 170 env['CPPPATH'] = ['..', '../../third_party/chrome/files', '../../common'] |
| 171 env['LIBPATH'] = ['../../third_party/chrome'] | 171 env['LIBPATH'] = ['../../third_party/chrome'] |
| 172 env['BUILDERS']['ProtocolBuffer'] = proto_builder | 172 env['BUILDERS']['ProtocolBuffer'] = proto_builder |
| 173 env['BUILDERS']['DbusBindings'] = dbus_bindings_builder | 173 env['BUILDERS']['DbusBindings'] = dbus_bindings_builder |
| 174 env['BUILDERS']['GlibMarshal'] = glib_marshal_builder | 174 env['BUILDERS']['GlibMarshal'] = glib_marshal_builder |
| 175 | 175 |
| 176 # Hack to fix dependencies from auto generated headers. | |
| 177 # Some files indirectly included update_metatadata.pb.h | |
| 178 # which is built as a side effect of building update_metadata.pb.cc | |
| 179 env.Depends('bzip_extent_writer_unittest.cc', 'update_metadata.pb.cc'); | |
| 180 env.Depends('bzip_extent_writer.cc', 'update_metadata.pb.cc'); | |
| 181 env.Depends('cycle_breaker.cc', 'update_metadata.pb.cc'); | |
| 182 | |
| 183 # Some files indirectly include marshal.glibmarshal.h | |
| 184 # which is built as a side effect of the .c file | |
| 185 env.Depends('dbus_service.cc', 'marshal.glibmarshal.c'); | |
| 186 | |
| 187 # Some files indirectly include update_engine.dbusserver.h | |
| 188 # which is built as a side effect of the dbusclient.h file | |
| 189 env.Depends('mock_http_fetcher.cc', 'update_engine.dbusclient.h'); | |
| 190 env.Depends('main.cc', 'update_engine.dbusclient.h'); | |
| 191 | |
| 192 # Fix issue with scons not passing pkg-config vars through the environment. | 176 # Fix issue with scons not passing pkg-config vars through the environment. |
| 193 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): | 177 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): |
| 194 if os.environ.has_key(key): | 178 if os.environ.has_key(key): |
| 195 env['ENV'][key] = os.environ[key] | 179 env['ENV'][key] = os.environ[key] |
| 196 | 180 |
| 197 env.ParseConfig('pkg-config --cflags --libs ' | 181 env.ParseConfig('pkg-config --cflags --libs ' |
| 198 'dbus-1 dbus-glib-1 gio-2.0 gio-unix-2.0 glib-2.0') | 182 'dbus-1 dbus-glib-1 gio-2.0 gio-unix-2.0 glib-2.0') |
| 199 env.ProtocolBuffer('update_metadata.pb.cc', 'update_metadata.proto') | 183 env.ProtocolBuffer('update_metadata.pb.cc', 'update_metadata.proto') |
| 200 | 184 |
| 201 env.DbusBindings('update_engine.dbusclient.h', 'update_engine.xml') | 185 env.DbusBindings('update_engine.dbusclient.h', 'update_engine.xml') |
| (...skipping 27 matching lines...) Expand all Loading... |
| 229 omaha_response_handler_action.cc | 213 omaha_response_handler_action.cc |
| 230 postinstall_runner_action.cc | 214 postinstall_runner_action.cc |
| 231 set_bootable_flag_action.cc | 215 set_bootable_flag_action.cc |
| 232 simple_key_value_store.cc | 216 simple_key_value_store.cc |
| 233 split_file_writer.cc | 217 split_file_writer.cc |
| 234 subprocess.cc | 218 subprocess.cc |
| 235 tarjan.cc | 219 tarjan.cc |
| 236 topological_sort.cc | 220 topological_sort.cc |
| 237 update_attempter.cc | 221 update_attempter.cc |
| 238 update_check_action.cc | 222 update_check_action.cc |
| 239 » » update_metadata.pb.cc | 223 update_metadata.pb.cc |
| 240 » » utils.cc""") | 224 utils.cc""") |
| 241 main = ['main.cc'] | 225 main = ['main.cc'] |
| 242 | 226 |
| 243 unittest_sources = Split("""action_unittest.cc | 227 unittest_sources = Split("""action_unittest.cc |
| 244 action_pipe_unittest.cc | 228 action_pipe_unittest.cc |
| 245 action_processor_unittest.cc | 229 action_processor_unittest.cc |
| 246 bzip_extent_writer_unittest.cc | 230 bzip_extent_writer_unittest.cc |
| 247 cycle_breaker_unittest.cc | 231 cycle_breaker_unittest.cc |
| 248 decompressing_file_writer_unittest.cc | 232 decompressing_file_writer_unittest.cc |
| 249 delta_diff_generator_unittest.cc | 233 delta_diff_generator_unittest.cc |
| 250 delta_performer_unittest.cc | 234 delta_performer_unittest.cc |
| (...skipping 19 matching lines...) Expand all Loading... |
| 270 topological_sort_unittest.cc | 254 topological_sort_unittest.cc |
| 271 update_check_action_unittest.cc | 255 update_check_action_unittest.cc |
| 272 utils_unittest.cc | 256 utils_unittest.cc |
| 273 zip_unittest.cc""") | 257 zip_unittest.cc""") |
| 274 unittest_main = ['testrunner.cc'] | 258 unittest_main = ['testrunner.cc'] |
| 275 | 259 |
| 276 client_main = ['update_engine_client.cc'] | 260 client_main = ['update_engine_client.cc'] |
| 277 | 261 |
| 278 delta_generator_main = ['generate_delta_main.cc'] | 262 delta_generator_main = ['generate_delta_main.cc'] |
| 279 | 263 |
| 264 # Hack to generate header files first. They are generated as a side effect |
| 265 # of generating other files (usually their corresponding .c(c) files), |
| 266 # so we make all sources depend on those other files. |
| 267 all_sources = [] |
| 268 all_sources.extend(sources) |
| 269 all_sources.extend(unittest_sources) |
| 270 all_sources.extend(main) |
| 271 all_sources.extend(unittest_main) |
| 272 all_sources.extend(client_main) |
| 273 all_sources.extend(delta_generator_main) |
| 274 for source in all_sources: |
| 275 if source.endswith('.glibmarshal.c') or source.endswith('.pb.cc'): |
| 276 continue |
| 277 env.Depends(source, 'update_metadata.pb.cc') |
| 278 env.Depends(source, 'marshal.glibmarshal.c') |
| 279 env.Depends(source, 'update_engine.dbusclient.h') |
| 280 | 280 |
| 281 update_engine_core = env.Library('update_engine_core', sources) | 281 update_engine_core = env.Library('update_engine_core', sources) |
| 282 env.Prepend(LIBS=[update_engine_core]) | 282 env.Prepend(LIBS=[update_engine_core]) |
| 283 | 283 |
| 284 env.Program('update_engine', main) | 284 env.Program('update_engine', main) |
| 285 | 285 |
| 286 client_cmd = env.Program('update_engine_client', client_main); | 286 client_cmd = env.Program('update_engine_client', client_main); |
| 287 | 287 |
| 288 delta_generator_cmd = env.Program('delta_generator', | 288 delta_generator_cmd = env.Program('delta_generator', |
| 289 delta_generator_main) | 289 delta_generator_main) |
| 290 | 290 |
| 291 http_server_cmd = env.Program('test_http_server', 'test_http_server.cc') | 291 http_server_cmd = env.Program('test_http_server', 'test_http_server.cc') |
| 292 | 292 |
| 293 unittest_env = env.Clone() | 293 unittest_env = env.Clone() |
| 294 unittest_env.Append(LIBS=['gtest']) | 294 unittest_env.Append(LIBS=['gtest']) |
| 295 unittest_cmd = unittest_env.Program('update_engine_unittests', | 295 unittest_cmd = unittest_env.Program('update_engine_unittests', |
| 296 unittest_sources + unittest_main) | 296 unittest_sources + unittest_main) |
| 297 Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + | 297 Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + |
| 298 Split('html app.info')) | 298 Split('html app.info')) |
| OLD | NEW |