build-dumprendertree revision 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5
1563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#!/usr/bin/perl -w 2563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 30bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# 5563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# Redistribution and use in source and binary forms, with or without 6563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# modification, are permitted provided that the following conditions 7563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# are met: 8563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# 9563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# 1. Redistributions of source code must retain the above copyright 10563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# notice, this list of conditions and the following disclaimer. 11563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# 2. Redistributions in binary form must reproduce the above copyright 12563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# notice, this list of conditions and the following disclaimer in the 13563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# documentation and/or other materials provided with the distribution. 14563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 15563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# its contributors may be used to endorse or promote products derived 16563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# from this software without specific prior written permission. 17563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# 18563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 19563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 29563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkuse strict; 300bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochuse File::Basename; 31563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkuse FindBin; 320bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochuse Getopt::Long qw(:config pass_through); 33563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkuse lib $FindBin::Bin; 34563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkuse webkitdirs; 35563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkuse POSIX; 36563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 370bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochmy $showHelp = 0; 380bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochmy $clean = 0; 390bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 400bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochmy $programName = basename($0); 410bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochmy $usage = <<EOF; 420bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben MurdochUsage: $programName [options] [options to pass to build system] 430bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch --help Show this help message 440bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch --clean Clean up the build directory 450bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch --gtk Build the GTK+ port 460bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch --qt Build the Qt port 470bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch --wx Build the wxWindows port 480bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben MurdochEOF 490bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 500bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben MurdochGetOptions( 510bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 'help' => \$showHelp, 520bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 'clean' => \$clean, 530bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch); 540bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 550bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochif ($showHelp) { 560bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch print STDERR $usage; 570bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch exit 1; 580bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch} 590bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 60563af33bc48281d19dce701398dbb88cb54fd7ecCary ClarkcheckRequiredSystemConfig(); 61563af33bc48281d19dce701398dbb88cb54fd7ecCary ClarksetConfiguration(); 62563af33bc48281d19dce701398dbb88cb54fd7ecCary ClarkchdirWebKit(); 63563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 64563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark# Build 65563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkchdir "WebKitTools/DumpRenderTree" or die; 660bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 67563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkmy $result; 68563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkif (isAppleMacWebKit()) { 690bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch $result = buildXCodeProject("DumpRenderTree", $clean, XcodeOptions(), @ARGV); 70563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark} elsif (isAppleWinWebKit()) { 710bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch $result = buildVisualStudioProject("DumpRenderTree.sln", $clean); 720bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch} elsif (isQt() || isGtk() || isWx()) { 730bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch # Qt, Gtk and wxWindows build everything in one shot. No need to build anything here. 74563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark $result = 0; 75563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark} else { 76563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark die "Building not defined for this platform!\n"; 77563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark} 780bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 79563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkexit exitStatus($result); 80