Changeset 83225 in webkit
- Timestamp:
- Apr 7, 2011 4:03:43 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r83223 r83225 1 2011-04-07 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Add stub support for generating Gtk build system from gyp 6 https://bugs.webkit.org/show_bug.cgi?id=58086 7 8 This adds support for a new --port argument and plumbs through 9 the necessary paths to allow generating for a port other than Mac. 10 11 * Source/gyp/configure: 12 1 13 2011-04-07 Andrew Scherkus <scherkus@chromium.org> 2 14 -
trunk/Source/JavaScriptCore/ChangeLog
r83223 r83225 1 2011-04-07 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Add stub support for generating Gtk build system from gyp 6 https://bugs.webkit.org/show_bug.cgi?id=58086 7 8 This does not produce a buildable JavaScriptCore, but it 9 does allow running gyp/configure --port=gtk and having 10 it generate a gtk.Makefile which we can use for testing 11 the rest of the plumbing. 12 13 * gyp/gtk.gyp: Added. 14 1 15 2011-04-07 Andrew Scherkus <scherkus@chromium.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r83223 r83225 1 2011-04-07 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Add stub support for generating Gtk build system from gyp 6 https://bugs.webkit.org/show_bug.cgi?id=58086 7 8 This does not produce a buildable WebCore, but it 9 does allow running gyp/configure --port=gtk and having 10 it generate a gtk.Makefile which we can use for testing 11 the rest of the plumbing. 12 13 * gyp/gtk.gyp: Added. 14 1 15 2011-04-07 David Hyatt <hyatt@apple.com> 2 16 -
trunk/Source/gyp/configure
r82030 r83225 41 41 return os.path.join('ThirdParty', 'gyp', 'gyp') 42 42 43 43 44 class Project: 44 45 def __init__(self, name): … … 48 49 return self._name 49 50 50 def inputs(self): 51 def _gyp_directory(self): 52 return os.path.join(self._name, 'gyp') 53 54 def _gyp_file_for_port(self, port): 55 # Gyp uses the gyp file name as the XCode proj file name, so for now "apple-mac" must be ProjectName.gyp 56 if port == "mac": 57 return '%s.gyp' % self._name 58 return "%s.gyp" % port 59 60 def inputs(self, port): 51 61 return [ 52 os.path.join(self._ name, 'gyp', self._name + '.gyp'),62 os.path.join(self._gyp_directory(), self._gyp_file_for_port(port)), 53 63 os.path.join(self._name, self._name + '.gypi'), 54 64 os.path.join('gyp', 'common.gypi'), 55 65 ] 56 66 57 def output(self): 58 return os.path.join(self._name, 'gyp', self._name + '.xcodeproj', 'project.pbxproj') 67 def _output_for_port(self, port): 68 format = format_for_port(port) 69 return { 70 'filelist': '%s.am' % port, 71 'xcode': os.path.join(self._name + '.xcodeproj', 'project.pbxproj'), 72 }[format] 59 73 60 def should_generate(self): 61 if not os.path.exists(self.output()): 74 def output(self, port): 75 return os.path.join(self._gyp_directory(), self._output_for_port(port)) 76 77 def should_generate(self, port): 78 if not os.path.exists(self.output(port)): 62 79 return True 63 return os.path.getmtime(self.output( )) < self._newest(self.inputs())80 return os.path.getmtime(self.output(port)) < self._newest(self.inputs(port)) 64 81 65 def generate(self): 66 subprocess.call([ 82 def _extra_args_for_format(self, format): 83 if format == "xcode": 84 return ['-G', 'xcode_list_excluded_files=0'] 85 return [] 86 87 def generate(self, port): 88 args = [ 67 89 gyp(), 68 self.inputs()[0], 69 '-G', 70 'xcode_list_excluded_files=0', 90 self.inputs(port)[0], 71 91 '--depth=.', 72 ]) 92 ] 93 format = format_for_port(port) 94 args.append('--format=%s' % format) 95 args += self._extra_args_for_format(format) 96 97 subprocess.call(args) 73 98 # GYP doesn't always touch the output file, but we want to touch the 74 99 # file so that we don't keep trying to regenerate it. 75 os.utime(self.output( ), None)100 os.utime(self.output(port), None) 76 101 77 102 @staticmethod 78 103 def _newest(paths): 79 104 return max([os.path.getmtime(path) for path in paths]) 105 106 107 def format_for_port(port): 108 return { 109 'mac': 'xcode', 110 'gtk': 'filelist', 111 'win': 'msvs', 112 }[port] # Valid port is required. 113 80 114 81 115 PROJECTS = [ … … 84 118 ] 85 119 86 def projects_to_generate( ):87 should_generate = [project for project in PROJECTS if project.should_generate( )]120 def projects_to_generate(port): 121 should_generate = [project for project in PROJECTS if project.should_generate(port)] 88 122 already_generated = [project.name() for project in set(PROJECTS) - set(should_generate)] 89 123 … … 94 128 return should_generate 95 129 130 96 131 def main(): 97 132 chdir_to_source() 98 133 99 134 parser = OptionParser() 100 # FIXME: The user should be able to pass which port on the command line. 135 parser.add_option("--port", dest="port", action="store", default="mac", # Default to Mac for now 136 help="Which port to generate for.") 101 137 parser.add_option("--regenerate-projects", dest="regenerate_projects", 102 138 default=False, action="store_true", … … 106 142 projects = PROJECTS 107 143 if not options.regenerate_projects: 108 projects = projects_to_generate( )144 projects = projects_to_generate(options.port) 109 145 110 146 for project in projects: 111 147 print "Generating %s." % project.name() 112 project.generate() 148 project.generate(options.port) 149 113 150 114 151 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.