Changeset 83225 in webkit


Ignore:
Timestamp:
Apr 7, 2011 4:03:43 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-04-07 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Add stub support for generating Gtk build system from gyp
https://bugs.webkit.org/show_bug.cgi?id=58086

This adds support for a new --port argument and plumbs through
the necessary paths to allow generating for a port other than Mac.

  • Source/gyp/configure:

2011-04-07 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Add stub support for generating Gtk build system from gyp
https://bugs.webkit.org/show_bug.cgi?id=58086

This does not produce a buildable JavaScriptCore, but it
does allow running gyp/configure --port=gtk and having
it generate a gtk.Makefile which we can use for testing
the rest of the plumbing.

  • gyp/gtk.gyp: Added.

2011-04-07 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Add stub support for generating Gtk build system from gyp
https://bugs.webkit.org/show_bug.cgi?id=58086

This does not produce a buildable WebCore, but it
does allow running gyp/configure --port=gtk and having
it generate a gtk.Makefile which we can use for testing
the rest of the plumbing.

  • gyp/gtk.gyp: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r83223 r83225  
     12011-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
    1132011-04-07  Andrew Scherkus  <scherkus@chromium.org>
    214
  • trunk/Source/JavaScriptCore/ChangeLog

    r83223 r83225  
     12011-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
    1152011-04-07  Andrew Scherkus  <scherkus@chromium.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r83223 r83225  
     12011-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
    1152011-04-07  David Hyatt  <hyatt@apple.com>
    216
  • trunk/Source/gyp/configure

    r82030 r83225  
    4141    return os.path.join('ThirdParty', 'gyp', 'gyp')
    4242
     43
    4344class Project:
    4445    def __init__(self, name):
     
    4849        return self._name
    4950
    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):
    5161        return [
    52             os.path.join(self._name, 'gyp', self._name + '.gyp'),
     62            os.path.join(self._gyp_directory(), self._gyp_file_for_port(port)),
    5363            os.path.join(self._name, self._name + '.gypi'),
    5464            os.path.join('gyp', 'common.gypi'),
    5565        ]
    5666
    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]
    5973
    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)):
    6279            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))
    6481
    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 = [
    6789            gyp(),
    68             self.inputs()[0],
    69             '-G',
    70             'xcode_list_excluded_files=0',
     90            self.inputs(port)[0],
    7191            '--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)
    7398        # GYP doesn't always touch the output file, but we want to touch the
    7499        # file so that we don't keep trying to regenerate it.
    75         os.utime(self.output(), None)
     100        os.utime(self.output(port), None)
    76101
    77102    @staticmethod
    78103    def _newest(paths):
    79104        return max([os.path.getmtime(path) for path in paths])
     105
     106
     107def format_for_port(port):
     108    return {
     109        'mac': 'xcode',
     110        'gtk': 'filelist',
     111        'win': 'msvs',
     112    }[port] # Valid port is required.
     113
    80114
    81115PROJECTS = [
     
    84118]
    85119
    86 def projects_to_generate():
    87     should_generate = [project for project in PROJECTS if project.should_generate()]
     120def projects_to_generate(port):
     121    should_generate = [project for project in PROJECTS if project.should_generate(port)]
    88122    already_generated = [project.name() for project in set(PROJECTS) - set(should_generate)]
    89123
     
    94128    return should_generate
    95129
     130
    96131def main():
    97132    chdir_to_source()
    98133
    99134    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.")
    101137    parser.add_option("--regenerate-projects", dest="regenerate_projects",
    102138                      default=False, action="store_true",
     
    106142    projects = PROJECTS
    107143    if not options.regenerate_projects:
    108         projects = projects_to_generate()
     144        projects = projects_to_generate(options.port)
    109145
    110146    for project in projects:
    111147        print "Generating %s." % project.name()
    112         project.generate()
     148        project.generate(options.port)
     149
    113150
    114151if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.