OSDN Git Service

Merge changes I347b2c80,I9e3185de
[android-x86/external-webkit.git] / WebKitTools / Scripts / build-dumprendertree
index 46e86e0..72e81b0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
 use strict;
+use File::Basename;
 use FindBin;
+use Getopt::Long qw(:config pass_through);
 use lib $FindBin::Bin;
 use webkitdirs;
 use POSIX;
 
+my $showHelp = 0;
+my $clean = 0;
+
+my $programName = basename($0);
+my $usage = <<EOF;
+Usage: $programName [options] [options to pass to build system]
+  --help        Show this help message
+  --clean       Clean up the build directory
+  --gtk         Build the GTK+ port
+  --qt          Build the Qt port
+  --wx          Build the wxWindows port
+EOF
+
+GetOptions(
+    'help' => \$showHelp,
+    'clean' => \$clean,
+);
+
+if ($showHelp) {
+   print STDERR $usage;
+   exit 1;
+}
+
 checkRequiredSystemConfig();
 setConfiguration();
 chdirWebKit();
-my @options = XcodeOptions();
 
 # Build
 chdir "WebKitTools/DumpRenderTree" or die;
+
 my $result;
 if (isAppleMacWebKit()) {
-    $result = system "xcodebuild", "-project", "DumpRenderTree.xcodeproj", @options, @ARGV;
+    $result = buildXCodeProject("DumpRenderTree", $clean, XcodeOptions(), @ARGV);
 } elsif (isAppleWinWebKit()) {
-    $result = buildVisualStudioProject("DumpRenderTree.sln");
-} elsif (isQt() || isGtk()) {
-    # Qt and Gtk build everything in one shot. No need to build anything here.
+    $result = buildVisualStudioProject("DumpRenderTree.sln", $clean);
+} elsif (isQt() || isGtk() || isWx()) {
+    # Qt, Gtk and wxWindows build everything in one shot. No need to build anything here.
     $result = 0;
 } else {
     die "Building not defined for this platform!\n";
 }
+
 exit exitStatus($result);