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

Side by Side Diff: build/android/gyp/gcc_preprocess.py

Issue 23717023: Android: Add chrome-specific dynamic linker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trivial rebase. Created 7 years, 2 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import optparse 7 import optparse
8 import os 8 import os
9 import subprocess 9 import subprocess
10 import sys 10 import sys
11 11
12 from util import build_utils 12 from util import build_utils
13 13
14 def DoGcc(options): 14 def DoGcc(options):
15 build_utils.MakeDirectory(os.path.dirname(options.output)) 15 build_utils.MakeDirectory(os.path.dirname(options.output))
16 16
17 gcc_cmd = [ 17 gcc_cmd = [ 'gcc' ] # invoke host gcc.
18 'gcc', # invoke host gcc. 18 if options.D:
19 gcc_cmd.extend(sum(map(lambda w: ['-D', w], options.D), []))
20 gcc_cmd.extend([
21 '-D', 'ANDROID',
19 '-E', # stop after preprocessing. 22 '-E', # stop after preprocessing.
20 '-D', 'ANDROID', # Specify ANDROID define for pre-processor. 23 '-D', 'ANDROID', # Specify ANDROID define for pre-processor.
21 '-x', 'c-header', # treat sources as C header files 24 '-x', 'c-header', # treat sources as C header files
22 '-P', # disable line markers, i.e. '#line 309' 25 '-P', # disable line markers, i.e. '#line 309'
23 '-I', options.include_path, 26 '-I', options.include_path,
24 '-o', options.output, 27 '-o', options.output,
25 options.template 28 options.template
26 ] 29 ])
30
27 31
28 build_utils.CheckCallDie(gcc_cmd) 32 build_utils.CheckCallDie(gcc_cmd)
29 33
30 34
31 def main(argv): 35 def main(argv):
32 parser = optparse.OptionParser() 36 parser = optparse.OptionParser()
33 parser.add_option('--include-path', help='Include path for gcc.') 37 parser.add_option('--include-path', help='Include path for gcc.')
34 parser.add_option('--template', help='Path to template.') 38 parser.add_option('--template', help='Path to template.')
35 parser.add_option('--output', help='Path for generated file.') 39 parser.add_option('--output', help='Path for generated file.')
36 parser.add_option('--stamp', help='Path to touch on success.') 40 parser.add_option('--stamp', help='Path to touch on success.')
41 parser.add_option('-D', help='Pre-defines macros', action='append')
37 42
38 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. 43 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
39 parser.add_option('--ignore', help='Ignored.') 44 parser.add_option('--ignore', help='Ignored.')
40 45
41 options, _ = parser.parse_args() 46 options, _ = parser.parse_args()
42 47
43 DoGcc(options) 48 DoGcc(options)
44 49
45 if options.stamp: 50 if options.stamp:
46 build_utils.Touch(options.stamp) 51 build_utils.Touch(options.stamp)
47 52
48 53
49 if __name__ == '__main__': 54 if __name__ == '__main__':
50 sys.exit(main(sys.argv)) 55 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « base/android/sys_utils_constants.h ('k') | build/java_apk.gypi » ('j') | content/content.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698