diff options
author | yaar@chromium.org <yaar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 17:40:11 +0000 |
---|---|---|
committer | yaar@chromium.org <yaar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 17:40:11 +0000 |
commit | 8b169411ecf3275bbff406d0a578681b9466595b (patch) | |
tree | e46a41dc75636d74f032786e4f0acb8dbc339733 /webkit/build | |
parent | 85d6e6a5c53f1b6cb246a4c12ce3601921c96c1e (diff) | |
download | chromium_src-8b169411ecf3275bbff406d0a578681b9466595b.zip chromium_src-8b169411ecf3275bbff406d0a578681b9466595b.tar.gz chromium_src-8b169411ecf3275bbff406d0a578681b9466595b.tar.bz2 |
Deleted webcore build scripts that were previously moved to webkit.org
Review URL: http://codereview.chromium.org/377003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31243 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/build')
-rw-r--r-- | webkit/build/action_csspropertynames.py | 142 | ||||
-rwxr-xr-x | webkit/build/action_cssvaluekeywords.py | 144 | ||||
-rwxr-xr-x | webkit/build/action_makenames.py | 147 | ||||
-rwxr-xr-x | webkit/build/action_maketokenizer.py | 74 | ||||
-rwxr-xr-x | webkit/build/action_useragentstylesheets.py | 74 | ||||
-rwxr-xr-x | webkit/build/rule_binding.py | 107 | ||||
-rwxr-xr-x | webkit/build/rule_bison.py | 75 | ||||
-rwxr-xr-x | webkit/build/rule_gperf.py | 57 |
8 files changed, 0 insertions, 820 deletions
diff --git a/webkit/build/action_csspropertynames.py b/webkit/build/action_csspropertynames.py deleted file mode 100644 index 8aa2b20..0000000 --- a/webkit/build/action_csspropertynames.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# action_csspropertynames.py is a harness script to connect actions sections of -# gyp-based builds to makeprop.pl. -# -# usage: action_makenames.py OUTPUTS -- INPUTS -# -# Exactly two outputs must be specified: a path to each of CSSPropertyNames.cpp -# and CSSPropertyNames.h. -# -# Multiple inputs may be specified. One input must have a basename of -# makeprop.pl; this is taken as the path to makeprop.pl. All other inputs are -# paths to .in files that are used as input to makeprop.pl; at least one, -# CSSPropertyNames.in, is required. - - -import os -import posixpath -import shutil -import subprocess -import sys - - -def SplitArgsIntoSections(args): - sections = [] - while len(args) > 0: - if not '--' in args: - # If there is no '--' left, everything remaining is an entire section. - dashes = len(args) - else: - dashes = args.index('--') - - sections.append(args[:dashes]) - - # Next time through the loop, look at everything after this '--'. - if dashes + 1 == len(args): - # If the '--' is at the end of the list, we won't come back through the - # loop again. Add an empty section now corresponding to the nothingness - # following the final '--'. - args = [] - sections.append(args) - else: - args = args[dashes + 1:] - - return sections - - -def main(args): - (outputs, inputs) = SplitArgsIntoSections(args[1:]) - - # Make all output pathnames absolute so that they can be accessed after - # changing directory. - for index in xrange(0, len(outputs)): - outputs[index] = os.path.abspath(outputs[index]) - - output_dir = os.path.dirname(outputs[0]) - - # Look at the inputs and figure out which one is makeprop.pl and which are - # inputs to that script. - makeprop_input = None - in_files = [] - for input in inputs: - # Make input pathnames absolute so they can be accessed after changing - # directory. On Windows, convert \ to / for inputs to the perl script to - # work around the intermix of activepython + cygwin perl. - input_abs = os.path.abspath(input) - input_abs_posix = input_abs.replace(os.path.sep, posixpath.sep) - input_basename = os.path.basename(input) - if input_basename == 'makeprop.pl': - assert makeprop_input == None - makeprop_input = input_abs - elif input_basename.endswith('.in'): - in_files.append(input_abs_posix) - else: - assert False - - assert makeprop_input != None - assert len(in_files) >= 1 - - # Change to the output directory because makeprop.pl puts output in its - # working directory. - os.chdir(output_dir) - - # Merge all in_files into a single file whose name will be the same as the - # first listed in_file, but in the output directory. - merged_path = os.path.basename(in_files[0]) - merged = open(merged_path, 'wb') # 'wb' to get \n only on windows - - # Make sure there aren't any duplicate lines in the in files. - line_dict = {} - for in_file_path in in_files: - in_file = open(in_file_path) - for line in in_file: - line = line.rstrip() - if line.startswith('#'): - line = '' - if line == '': - continue - if line in line_dict: - raise KeyError, 'Duplicate value %s' % line - line_dict[line] = True - print >>merged, line - in_file.close() - - merged.close() - - # Build up the command. - command = ['perl', makeprop_input] - - # Do it. check_call is new in 2.5, so simulate its behavior with call and - # assert. - return_code = subprocess.call(command) - assert return_code == 0 - - # Don't leave behind the merged file or the .gperf file created by - # makeprop. - (root, ext) = os.path.splitext(merged_path) - gperf_path = root + '.gperf' - os.unlink(gperf_path) - os.unlink(merged_path) - - # Go through the outputs. Any output that belongs in a different directory - # is moved. Do a copy and delete instead of rename for maximum portability. - # Note that all paths used in this section are still absolute. - for output in outputs: - this_output_dir = os.path.dirname(output) - if this_output_dir != output_dir: - output_basename = os.path.basename(output) - src = os.path.join(output_dir, output_basename) - dst = os.path.join(this_output_dir, output_basename) - shutil.copyfile(src, dst) - os.unlink(src) - - return return_code - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/webkit/build/action_cssvaluekeywords.py b/webkit/build/action_cssvaluekeywords.py deleted file mode 100755 index 12b0f40..0000000 --- a/webkit/build/action_cssvaluekeywords.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# action_cssvaluekeywords.py is a harness script to connect actions sections of -# gyp-based builds to makevalues.pl. -# -# usage: action_cssvaluekeywords.py OUTPUTS -- INPUTS -# -# Exactly two outputs must be specified: a path to each of CSSValueKeywords.c -# and CSSValueKeywords.h. -# -# Multiple inputs may be specified. One input must have a basename of -# makevalues.pl; this is taken as the path to makevalues.pl. All other inputs -# are paths to .in files that are used as input to makevalues.pl; at least -# one, CSSValueKeywords.in, is required. - - -import os -import posixpath -import shutil -import subprocess -import sys - - -def SplitArgsIntoSections(args): - sections = [] - while len(args) > 0: - if not '--' in args: - # If there is no '--' left, everything remaining is an entire section. - dashes = len(args) - else: - dashes = args.index('--') - - sections.append(args[:dashes]) - - # Next time through the loop, look at everything after this '--'. - if dashes + 1 == len(args): - # If the '--' is at the end of the list, we won't come back through the - # loop again. Add an empty section now corresponding to the nothingness - # following the final '--'. - args = [] - sections.append(args) - else: - args = args[dashes + 1:] - - return sections - - -def main(args): - (outputs, inputs) = SplitArgsIntoSections(args[1:]) - - # Make all output pathnames absolute so that they can be accessed after - # changing directory. - for index in xrange(0, len(outputs)): - outputs[index] = os.path.abspath(outputs[index]) - - output_dir = os.path.dirname(outputs[0]) - - # Look at the inputs and figure out which one is makevalues.pl and which are - # inputs to that script. - makevalues_input = None - in_files = [] - for input in inputs: - # Make input pathnames absolute so they can be accessed after changing - # directory. On Windows, convert \ to / for inputs to the perl script to - # work around the intermix of activepython + cygwin perl. - input_abs = os.path.abspath(input) - input_abs_posix = input_abs.replace(os.path.sep, posixpath.sep) - input_basename = os.path.basename(input) - if input_basename == 'makevalues.pl': - assert makevalues_input == None - makevalues_input = input_abs - elif input_basename.endswith('.in'): - in_files.append(input_abs_posix) - else: - assert False - - assert makevalues_input != None - assert len(in_files) >= 1 - - # Change to the output directory because makevalues.pl puts output in its - # working directory. - os.chdir(output_dir) - - # Merge all in_files into a single file whose name will be the same as the - # first listed in_file, but in the output directory. - merged_path = os.path.basename(in_files[0]) - merged = open(merged_path, 'wb') # 'wb' to get \n only on windows - - # Make sure there aren't any duplicate lines in the in files. Lowercase - # everything because CSS values are case-insensitive. - line_dict = {} - for in_file_path in in_files: - in_file = open(in_file_path) - for line in in_file: - line = line.rstrip() - if line.startswith('#'): - line = '' - if line == '': - continue - line = line.lower() - if line in line_dict: - raise KeyError, 'Duplicate value %s' % line - line_dict[line] = True - print >>merged, line - in_file.close() - - merged.close() - - # Build up the command. - command = ['perl', makevalues_input] - - # Do it. check_call is new in 2.5, so simulate its behavior with call and - # assert. - return_code = subprocess.call(command) - assert return_code == 0 - - # Don't leave behind the merged file or the .gperf file created by - # makevalues. - (root, ext) = os.path.splitext(merged_path) - gperf_path = root + '.gperf' - os.unlink(gperf_path) - os.unlink(merged_path) - - # Go through the outputs. Any output that belongs in a different directory - # is moved. Do a copy and delete instead of rename for maximum portability. - # Note that all paths used in this section are still absolute. - for output in outputs: - this_output_dir = os.path.dirname(output) - if this_output_dir != output_dir: - output_basename = os.path.basename(output) - src = os.path.join(output_dir, output_basename) - dst = os.path.join(this_output_dir, output_basename) - shutil.copyfile(src, dst) - os.unlink(src) - - return return_code - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/webkit/build/action_makenames.py b/webkit/build/action_makenames.py deleted file mode 100755 index fe95936..0000000 --- a/webkit/build/action_makenames.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# action_makenames.py is a harness script to connect actions sections of -# gyp-based builds to make_names.pl. -# -# usage: action_makenames.py OUTPUTS -- INPUTS [-- OPTIONS] -# -# Multiple OUTPUTS, INPUTS, and OPTIONS may be listed. The sections are -# separated by -- arguments. -# -# The directory name of the first output is chosen as the directory in which -# make_names will run. If the directory name for any subsequent output is -# different, those files will be moved to the desired directory. -# -# Multiple INPUTS may be listed. An input with a basename matching -# "make_names.pl" is taken as the path to that script. Inputs with names -# ending in TagNames.in or tags.in are taken as tag inputs. Inputs with names -# ending in AttributeNames.in or attrs.in are taken as attribute inputs. There -# may be at most one tag input and one attribute input. A make_names.pl input -# is required and at least one tag or attribute input must be present. -# -# OPTIONS is a list of additional options to pass to make_names.pl. This -# section need not be present. - - -import os -import posixpath -import shutil -import subprocess -import sys - - -def SplitArgsIntoSections(args): - sections = [] - while len(args) > 0: - if not '--' in args: - # If there is no '--' left, everything remaining is an entire section. - dashes = len(args) - else: - dashes = args.index('--') - - sections.append(args[:dashes]) - - # Next time through the loop, look at everything after this '--'. - if dashes + 1 == len(args): - # If the '--' is at the end of the list, we won't come back through the - # loop again. Add an empty section now corresponding to the nothingness - # following the final '--'. - args = [] - sections.append(args) - else: - args = args[dashes + 1:] - - return sections - - -def main(args): - sections = SplitArgsIntoSections(args[1:]) - assert len(sections) == 2 or len(sections) == 3 - (outputs, inputs) = sections[:2] - if len(sections) == 3: - options = sections[2] - else: - options = [] - - # Make all output pathnames absolute so that they can be accessed after - # changing directory. - for index in xrange(0, len(outputs)): - outputs[index] = os.path.abspath(outputs[index]) - - output_dir = os.path.dirname(outputs[0]) - - # Look at the inputs and figure out which ones are make_names.pl, tags, and - # attributes. There can be at most one of each, and those are the only - # input types supported. make_names.pl is required and at least one of tags - # and attributes is required. - make_names_input = None - tag_input = None - attr_input = None - for input in inputs: - # Make input pathnames absolute so they can be accessed after changing - # directory. On Windows, convert \ to / for inputs to the perl script to - # work around the intermix of activepython + cygwin perl. - input_abs = os.path.abspath(input) - input_abs_posix = input_abs.replace(os.path.sep, posixpath.sep) - input_basename = os.path.basename(input) - if input_basename == 'make_names.pl': - assert make_names_input == None - make_names_input = input_abs - elif input_basename.endswith('TagNames.in') or \ - input_basename.endswith('tags.in'): - assert tag_input == None - tag_input = input_abs_posix - elif input_basename.endswith('AttributeNames.in') or \ - input_basename.endswith('attrs.in'): - assert attr_input == None - attr_input = input_abs_posix - else: - assert False - - assert make_names_input != None - assert tag_input != None or attr_input != None - - # scripts_path is a Perl include directory, located relative to - # make_names_input. - scripts_path = os.path.normpath( - os.path.join(os.path.dirname(make_names_input), os.pardir, - 'bindings', 'scripts')) - - # Change to the output directory because make_names.pl puts output in its - # working directory. - os.chdir(output_dir) - - # Build up the command. - command = ['perl', '-I', scripts_path, make_names_input] - if tag_input != None: - command.extend(['--tags', tag_input]) - if attr_input != None: - command.extend(['--attrs', attr_input]) - command.extend(options) - - # Do it. check_call is new in 2.5, so simulate its behavior with call and - # assert. - return_code = subprocess.call(command) - assert return_code == 0 - - # Go through the outputs. Any output that belongs in a different directory - # is moved. Do a copy and delete instead of rename for maximum portability. - # Note that all paths used in this section are still absolute. - for output in outputs: - this_output_dir = os.path.dirname(output) - if this_output_dir != output_dir: - output_basename = os.path.basename(output) - src = os.path.join(output_dir, output_basename) - dst = os.path.join(this_output_dir, output_basename) - shutil.copyfile(src, dst) - os.unlink(src) - - return return_code - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/webkit/build/action_maketokenizer.py b/webkit/build/action_maketokenizer.py deleted file mode 100755 index 0c45265..0000000 --- a/webkit/build/action_maketokenizer.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# usage: action_maketokenizer.py OUTPUTS -- INPUTS -# -# Multiple INPUTS may be listed. The sections are separated by -- arguments. -# -# OUTPUTS must contain a single item: a path to tokenizer.cpp. -# -# INPUTS must contain exactly two items. The first item must be the path to -# maketokenizer. The second item must be the path to tokenizer.flex. - - -import os -import subprocess -import sys - - -def SplitArgsIntoSections(args): - sections = [] - while len(args) > 0: - if not '--' in args: - # If there is no '--' left, everything remaining is an entire section. - dashes = len(args) - else: - dashes = args.index('--') - - sections.append(args[:dashes]) - - # Next time through the loop, look at everything after this '--'. - if dashes + 1 == len(args): - # If the '--' is at the end of the list, we won't come back through the - # loop again. Add an empty section now corresponding to the nothingness - # following the final '--'. - args = [] - sections.append(args) - else: - args = args[dashes + 1:] - - return sections - - -def main(args): - sections = SplitArgsIntoSections(args[1:]) - assert len(sections) == 2 - (outputs, inputs) = sections - - assert len(outputs) == 1 - output = outputs[0] - - assert len(inputs) == 2 - maketokenizer = inputs[0] - flex_input = inputs[1] - - # Do it. check_call is new in 2.5, so simulate its behavior with call and - # assert. - outfile = open(output, 'wb') - p1 = subprocess.Popen(['flex', '-t', flex_input], stdout=subprocess.PIPE) - p2 = subprocess.Popen(['perl', maketokenizer], stdin=p1.stdout, - stdout=outfile) - - r1 = p1.wait() - r2 = p2.wait() - assert r1 == 0 - assert r2 == 0 - - return 0 - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/webkit/build/action_useragentstylesheets.py b/webkit/build/action_useragentstylesheets.py deleted file mode 100755 index 3394cb7..0000000 --- a/webkit/build/action_useragentstylesheets.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# usage: action_useragentstylesheets.py OUTPUTS -- INPUTS -# -# Multiple OUTPUTS and INPUTS may be listed. The sections are separated by -# -- arguments. -# -# OUTPUTS must contain two items, in order: a path to UserAgentStyleSheets.h -# and a path to UserAgentStyleSheetsData.cpp. -# -# INPUTS must contain at least two items. The first item must be the path to -# make-css-file-arrays.pl. The remaining items are paths to style sheets to -# be fed to that script. - - -import os -import subprocess -import sys - - -def SplitArgsIntoSections(args): - sections = [] - while len(args) > 0: - if not '--' in args: - # If there is no '--' left, everything remaining is an entire section. - dashes = len(args) - else: - dashes = args.index('--') - - sections.append(args[:dashes]) - - # Next time through the loop, look at everything after this '--'. - if dashes + 1 == len(args): - # If the '--' is at the end of the list, we won't come back through the - # loop again. Add an empty section now corresponding to the nothingness - # following the final '--'. - args = [] - sections.append(args) - else: - args = args[dashes + 1:] - - return sections - - -def main(args): - sections = SplitArgsIntoSections(args[1:]) - assert len(sections) == 2 - (outputs, inputs) = sections - - assert len(outputs) == 2 - output_h = outputs[0] - output_cpp = outputs[1] - - make_css_file_arrays = inputs[0] - style_sheets = inputs[1:] - - # Build up the command. - command = ['perl', make_css_file_arrays, output_h, output_cpp] - command.extend(style_sheets) - - # Do it. check_call is new in 2.5, so simulate its behavior with call and - # assert. - return_code = subprocess.call(command) - assert return_code == 0 - - return return_code - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/webkit/build/rule_binding.py b/webkit/build/rule_binding.py deleted file mode 100755 index 7c84155..0000000 --- a/webkit/build/rule_binding.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# usage: rule_binding.py INPUT CPPDIR HDIR -- INPUTS -- OPTIONS -# -# INPUT is an IDL file, such as Whatever.idl. -# -# CPPDIR is the directory into which V8Whatever.cpp will be placed. HDIR is -# the directory into which V8Whatever.h will be placed. -# -# The first item in INPUTS is the path to generate-bindings.pl. Remaining -# items in INPUTS are used to build the Perl module include path. -# -# OPTIONS are passed as-is to generate-bindings.pl as additional arguments. - - -import errno -import os -import shlex -import shutil -import subprocess -import sys - - -def SplitArgsIntoSections(args): - sections = [] - while len(args) > 0: - if not '--' in args: - # If there is no '--' left, everything remaining is an entire section. - dashes = len(args) - else: - dashes = args.index('--') - - sections.append(args[:dashes]) - - # Next time through the loop, look at everything after this '--'. - if dashes + 1 == len(args): - # If the '--' is at the end of the list, we won't come back through the - # loop again. Add an empty section now corresponding to the nothingness - # following the final '--'. - args = [] - sections.append(args) - else: - args = args[dashes + 1:] - - return sections - - -def main(args): - sections = SplitArgsIntoSections(args[1:]) - assert len(sections) == 3, sections - (base, inputs, options) = sections - - assert len(base) == 3, base - (input, cppdir, hdir) = base - - assert len(inputs) > 1, inputs - generate_bindings = inputs[0] - perl_modules = inputs[1:] - - include_dirs = [] - for perl_module in perl_modules: - include_dir = os.path.dirname(perl_module) - if not include_dir in include_dirs: - include_dirs.append(include_dir) - - # The defines come in as one flat string. Split it up into distinct arguments. - if '--defines' in options: - defines_index = options.index('--defines') - if defines_index + 1 < len(options): - split_options = shlex.split(options[defines_index + 1]) - if split_options: - options[defines_index + 1] = ' '.join(split_options) - - # Build up the command. - command = ['perl', '-w'] - for include_dir in include_dirs: - command.extend(['-I', include_dir]) - command.append(generate_bindings) - command.extend(options) - command.extend(['--outputDir', cppdir, input]) - - # Do it. check_call is new in 2.5, so simulate its behavior with call and - # assert. - return_code = subprocess.call(command) - assert return_code == 0 - - # Both the .cpp and .h were generated in cppdir, but if hdir is different, - # the .h needs to move. Copy it instead of using os.rename for maximum - # portability in all cases. - if cppdir != hdir: - input_basename = os.path.basename(input) - (root, ext) = os.path.splitext(input_basename) - hname = 'V8%s.h' % root - hsrc = os.path.join(cppdir, hname) - hdst = os.path.join(hdir, hname) - shutil.copyfile(hsrc, hdst) - os.unlink(hsrc) - - return return_code - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/webkit/build/rule_bison.py b/webkit/build/rule_bison.py deleted file mode 100755 index 5ba2b5a..0000000 --- a/webkit/build/rule_bison.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# usage: rule_bison.py INPUT_FILE OUTPUT_DIR -# INPUT_FILE is a path to either CSSGrammar.y or XPathGrammar.y. -# OUTPUT_DIR is where the bison-generated .cpp and .h files should be placed. - -import errno -import os -import os.path -import subprocess -import sys - -assert len(sys.argv) == 3 - -input_file = sys.argv[1] -output_dir = sys.argv[2] - -input_name = os.path.basename(input_file) -assert input_name == 'CSSGrammar.y' or input_name == 'XPathGrammar.y' -prefix = {'CSSGrammar.y': 'cssyy', 'XPathGrammar.y': 'xpathyy'}[input_name] - -(input_root, input_ext) = os.path.splitext(input_name) - -# The generated .h will be in a different location depending on the bison -# version. -output_h_tries = [ - os.path.join(output_dir, input_root + '.cpp.h'), - os.path.join(output_dir, input_root + '.hpp'), -] - -for output_h_try in output_h_tries: - try: - os.unlink(output_h_try) - except OSError, e: - if e.errno != errno.ENOENT: - raise - -output_cpp = os.path.join(output_dir, input_root + '.cpp') - -return_code = subprocess.call(['bison', '-d', '-p', prefix, input_file, - '-o', output_cpp]) -assert return_code == 0 - -# Find the name that bison used for the generated header file. -output_h_tmp = None -for output_h_try in output_h_tries: - try: - os.stat(output_h_try) - output_h_tmp = output_h_try - break - except OSError, e: - if e.errno != errno.ENOENT: - raise - -assert output_h_tmp != None - -# Read the header file in under the generated name and remove it. -output_h_file = open(output_h_tmp) -output_h_contents = output_h_file.read() -output_h_file.close() -os.unlink(output_h_tmp) - -# Rewrite the generated header with #include guards. -output_h = os.path.join(output_dir, input_root + '.h') - -output_h_file = open(output_h, 'w') -print >>output_h_file, '#ifndef %s_h' % input_root -print >>output_h_file, '#define %s_h' % input_root -print >>output_h_file, output_h_contents -print >>output_h_file, '#endif' -output_h_file.close() diff --git a/webkit/build/rule_gperf.py b/webkit/build/rule_gperf.py deleted file mode 100755 index ef24b40..0000000 --- a/webkit/build/rule_gperf.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# usage: rule_gperf.py INPUT_FILE OUTPUT_DIR -# INPUT_FILE is a path to DocTypeStrings.gperf, HTMLEntityNames.gperf, or -# ColorData.gperf. -# OUTPUT_DIR is where the gperf-generated .cpp file should be placed. Because -# some users want a .c file instead of a .cpp file, the .cpp file is copied -# to .c when done. - -import posixpath -import shutil -import subprocess -import sys - -assert len(sys.argv) == 3 - -input_file = sys.argv[1] -output_dir = sys.argv[2] - -gperf_commands = { - 'DocTypeStrings.gperf': [ - '-CEot', '-L', 'ANSI-C', '-k*', '-N', 'findDoctypeEntry', - '-F', ',PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards' - ], - 'HTMLEntityNames.gperf': [ - '-a', '-L', 'ANSI-C', '-C', '-G', '-c', '-o', '-t', '-k*', - '-N', 'findEntity', '-D', '-s', '2' - ], - 'ColorData.gperf': [ - '-CDEot', '-L', 'ANSI-C', '-k*', '-N', 'findColor', '-D', '-s', '2' - ], -} - -input_name = posixpath.basename(input_file) -assert input_name in gperf_commands - -(input_root, input_ext) = posixpath.splitext(input_name) -output_cpp = posixpath.join(output_dir, input_root + '.cpp') - -#command = ['gperf', '--output-file', output_cpp] -command = ['gperf'] -command.extend(gperf_commands[input_name]) -command.append(input_file) - -ofile = open(output_cpp, 'w') - -# Do it. check_call is new in 2.5, so simulate its behavior with call and -# assert. -return_code = subprocess.call(command, stdout=ofile.fileno()) -assert return_code == 0 - -output_c = posixpath.join(output_dir, input_root + '.c') -shutil.copyfile(output_cpp, output_c) |