Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Side by Side Diff: site_scons/site_tools/component_builders.py

Issue 7265001: Build and use libraries locally in the nacl build, not requiring "partial SDK" (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: windows .s/.S horror Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python2.4 1 #!/usr/bin/python2.4
2 # Copyright 2009, Google Inc. 2 # Copyright 2009, Google Inc.
3 # All rights reserved. 3 # All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 # This supports a NaCl convention that was previously supported with a 127 # This supports a NaCl convention that was previously supported with a
128 # modification to SCons. Previously, EXTRA_LIBS was interpolated into LIBS 128 # modification to SCons. Previously, EXTRA_LIBS was interpolated into LIBS
129 # using the ${EXTRA_LIBS} syntax. It appears, however, that SCons naturally 129 # using the ${EXTRA_LIBS} syntax. It appears, however, that SCons naturally
130 # computes library dependencies before interpolation, so EXTRA_LIBS will not 130 # computes library dependencies before interpolation, so EXTRA_LIBS will not
131 # be correctly depended upon if interpolated. In the past, SCons was modified 131 # be correctly depended upon if interpolated. In the past, SCons was modified
132 # to force interpolation before library dependencies were computed. This new 132 # to force interpolation before library dependencies were computed. This new
133 # approach allows us to use an unmodified version of SCons. 133 # approach allows us to use an unmodified version of SCons.
134 # In general, the use of EXTRA_LIBS is discouraged. 134 # In general, the use of EXTRA_LIBS is discouraged.
135 if 'EXTRA_LIBS' in env: 135 if 'EXTRA_LIBS' in env:
136 env['LIBS'] = env['EXTRA_LIBS'] + env['LIBS'] 136 # The SubstList2 method expands and flattens so that scons will
137 # correctly know about the library dependencies in cases like
138 # EXTRA_LIBS=['${FOO_LIBS}', 'bar'].
139 env['LIBS'] = env.SubstList2('${EXTRA_LIBS}', '${LIBS}')
137 140
138 # Call platform-specific component setup function, if any 141 # Call platform-specific component setup function, if any
139 if env.get('COMPONENT_PLATFORM_SETUP'): 142 if env.get('COMPONENT_PLATFORM_SETUP'):
140 env['COMPONENT_PLATFORM_SETUP'](env, builder_name) 143 env['COMPONENT_PLATFORM_SETUP'](env, builder_name)
141 144
142 # Return the modified environment 145 # Return the modified environment
143 return env 146 return env
144 147
145 #------------------------------------------------------------------------------ 148 #------------------------------------------------------------------------------
146 149
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 # Clone and modify environment 463 # Clone and modify environment
461 env = _ComponentPlatformSetup(self, 'ComponentProgram', **kwargs) 464 env = _ComponentPlatformSetup(self, 'ComponentProgram', **kwargs)
462 465
463 env['PROGRAM_BASENAME'] = prog_name 466 env['PROGRAM_BASENAME'] = prog_name
464 467
465 # Call env.Program() 468 # Call env.Program()
466 out_nodes = env.Program(prog_name, *args, **kwargs) 469 out_nodes = env.Program(prog_name, *args, **kwargs)
467 470
468 # Add dependencies on includes 471 # Add dependencies on includes
469 env.Depends(out_nodes, env['INCLUDES']) 472 env.Depends(out_nodes, env['INCLUDES'])
470 473
robertm 2011/06/27 14:55:15 can you add some markers here to indicate that thi
474 # Add dependencies on libraries marked as implicitly included in the link.
475 # These are libraries that are not passed on the command line, but are
476 # always linked in by the toolchain, i.e. startup files and -lc and such.
477 if 'IMPLICIT_LIBS' in env:
478 env.Depends(out_nodes, env['IMPLICIT_LIBS'])
479
471 # Publish output 480 # Publish output
472 env.Publish(prog_name, 'run', out_nodes[0]) 481 env.Publish(prog_name, 'run', out_nodes[0])
473 env.Publish(prog_name, 'debug', out_nodes[1:]) 482 env.Publish(prog_name, 'debug', out_nodes[1:])
474 483
475 # Add an alias to build the program to the right groups 484 # Add an alias to build the program to the right groups
476 a = env.Alias(prog_name, out_nodes) 485 a = env.Alias(prog_name, out_nodes)
477 for group in env['COMPONENT_PROGRAM_GROUPS']: 486 for group in env['COMPONENT_PROGRAM_GROUPS']:
478 SCons.Script.Alias(group, a) 487 SCons.Script.Alias(group, a)
479 488
480 # Store list of components for this program 489 # Store list of components for this program
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 # Add our target groups 629 # Add our target groups
621 AddTargetGroup('all_libraries', 'libraries can be built') 630 AddTargetGroup('all_libraries', 'libraries can be built')
622 AddTargetGroup('all_programs', 'programs can be built') 631 AddTargetGroup('all_programs', 'programs can be built')
623 AddTargetGroup('all_test_programs', 'tests can be built') 632 AddTargetGroup('all_test_programs', 'tests can be built')
624 AddTargetGroup('all_packages', 'packages can be built') 633 AddTargetGroup('all_packages', 'packages can be built')
625 AddTargetGroup('run_all_tests', 'tests can be run') 634 AddTargetGroup('run_all_tests', 'tests can be run')
626 AddTargetGroup('run_disabled_tests', 'tests are disabled') 635 AddTargetGroup('run_disabled_tests', 'tests are disabled')
627 AddTargetGroup('run_small_tests', 'small tests can be run') 636 AddTargetGroup('run_small_tests', 'small tests can be run')
628 AddTargetGroup('run_medium_tests', 'medium tests can be run') 637 AddTargetGroup('run_medium_tests', 'medium tests can be run')
629 AddTargetGroup('run_large_tests', 'large tests can be run') 638 AddTargetGroup('run_large_tests', 'large tests can be run')
630
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698