Skip to content

Commit 712903b

Browse files
committed
Remove the --64-bit argument from scripts in favor of them detecting when 64-bit should be preferred.
Reviewed by Timothy Hatcher. The scripts will automatically target 64-bit if the system and hardware support it. This can be overridden by passing --32-bit to individual scripts, or using set-webkit-configuration --32-bit to make the override persistent. * Scripts/build-webkit: Remove architecture-related code. * Scripts/gdb-safari: Remove architecture-related code, and clean up how the environment variables are passed to gdb. * Scripts/run-javascriptcore-tests: Remove architecture-related code. * Scripts/run-safari: Ditto. * Scripts/run-webkit-tests: Ditto. * Scripts/set-webkit-configuration: Handle the --32-bit and --64-bit arguments. The --32-bit argument will set the architecture preference to the 32-bit architecture of the machine. The --64-bit argument will remove any architecture override that is in effect so that 64-bit support will be automatically detected. * Scripts/webkitdirs.pm: Add auto-detection of the best architecture for the machine, and the ability to override the auto-detection. Canonical link: https://commits.webkit.org/33755@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent e2a7f0a commit 712903b

8 files changed

Lines changed: 151 additions & 158 deletions

File tree

WebKitTools/ChangeLog

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2009-03-13 Mark Rowe <mrowe@apple.com>
2+
3+
Reviewed by Timothy Hatcher.
4+
5+
Remove the --64-bit argument from scripts in favor of them detecting when 64-bit should be preferred.
6+
7+
The scripts will automatically target 64-bit if the system and hardware support it. This can be
8+
overridden by passing --32-bit to individual scripts, or using set-webkit-configuration --32-bit
9+
to make the override persistent.
10+
11+
* Scripts/build-webkit: Remove architecture-related code.
12+
* Scripts/gdb-safari: Remove architecture-related code, and clean up how the environment variables are passed to gdb.
13+
* Scripts/run-javascriptcore-tests: Remove architecture-related code.
14+
* Scripts/run-safari: Ditto.
15+
* Scripts/run-webkit-tests: Ditto.
16+
* Scripts/set-webkit-configuration: Handle the --32-bit and --64-bit arguments. The --32-bit argument will set the
17+
architecture preference to the 32-bit architecture of the machine. The --64-bit argument will remove any architecture
18+
override that is in effect so that 64-bit support will be automatically detected.
19+
* Scripts/webkitdirs.pm: Add auto-detection of the best architecture for the machine, and the ability to override the
20+
auto-detection.
21+
122
2009-03-13 Anders Carlsson <andersca@apple.com>
223

324
Reviewed by Dan Bernstein.

WebKitTools/Scripts/build-webkit

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ my $workersSupport = (isAppleWebKit() || isGtk()); # Enable by default for Apple
6161
my $geolocationSupport = (isAppleMacWebKit() && !isTiger() && !isLeopard());
6262
my $showHelp = 0;
6363
my $clean = 0;
64-
my $buildUniversal = 0;
65-
my $buildSixtyFourBit = 0;
6664
my $threeDTransformsSupport = 0;
6765

6866
my $programName = basename($0);
@@ -73,8 +71,6 @@ Usage: $programName [options] [options to pass to build system]
7371
--chromium Build the Chromium port on Mac/Win/Linux
7472
--clean Cleanup the build directory
7573
--gtk Build the GTK+ port
76-
--universal Build 2-way universal (PPC and Intel 32-bit)
77-
--64-bit Build 64-bit, combine with --universal to build 4-way universal
7874
--[no-]3d-transforms Toggle 3D Transforms support (default: $threeDTransformsSupport)
7975
--[no-]channel-messaging Toggle MessageChannel and MessagePort support (default: $channelMessagingSupport)
8076
--[no-]offline-web-applications Toggle Offline Web Application Support (default : $offlineWebApplicationSupport)
@@ -121,8 +117,6 @@ GetOptions(
121117
'geolocation!' => \$geolocationSupport,
122118
'coverage!' => \$coverageSupport,
123119
'help' => \$showHelp,
124-
'universal' => \$buildUniversal,
125-
'64-bit' => \$buildSixtyFourBit,
126120
'clean' => \$clean);
127121

128122
if ($showHelp) {
@@ -190,21 +184,6 @@ for my $dir (@projects, @otherDirs) {
190184

191185
my @options = ();
192186

193-
if ($buildSixtyFourBit && isAppleMacWebKit()) {
194-
my $cpuVendor = `sysctl -n machdep.cpu.vendor`;
195-
chomp $cpuVendor;
196-
197-
if ($buildUniversal) {
198-
push(@options, "ARCHS=ppc ppc64 i386 x86_64");
199-
} elsif ($cpuVendor eq "GenuineIntel") {
200-
push(@options, "ARCHS=i386 x86_64");
201-
} else {
202-
push(@options, "ARCHS=ppc ppc64");
203-
}
204-
} elsif ($buildUniversal && isAppleMacWebKit()) {
205-
push(@options, "ARCHS=ppc i386");
206-
}
207-
208187
# enable autotool options accordingly
209188
if (isGtk()) {
210189
push @options, autotoolsFlag($databaseSupport, "database");

WebKitTools/Scripts/gdb-safari

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,9 @@
3131
use strict;
3232
use File::Temp qw/:mktemp/;
3333
use FindBin;
34-
use Getopt::Long qw(:config pass_through);
3534
use lib $FindBin::Bin;
3635
use webkitdirs;
3736

38-
my $programName = basename($0);
39-
my $showHelp = 0;
40-
my $run64Bit;
41-
42-
my $usage = <<EOF;
43-
Usage: $programName [options]
44-
--help Show this help message
45-
--64-bit Run in 64-bit mode
46-
EOF
47-
48-
my $getOptionsResult = GetOptions(
49-
'help' => \$showHelp,
50-
'64-bit!' => \$run64Bit
51-
);
52-
53-
if (!$getOptionsResult || $showHelp) {
54-
print STDERR $usage;
55-
exit 1;
56-
}
57-
58-
setRun64Bit($run64Bit);
5937
setConfiguration();
6038
my $productDir = productDir();
6139
my $safariPath = safariPath();
@@ -67,17 +45,9 @@ die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath;
6745
# Check to see that all the frameworks are built.
6846
checkFrameworks();
6947

70-
# Put a command to set DYLD_FRAMEWORK_PATH in a temp file.
71-
# Also set WEBKIT_UNSET_DYLD_FRAMEWORK_PATH to YES in this environment, so that
72-
# executables launched by Safari don't inherit using the new frameworks.
73-
my ($fh, $path) = mkstemp("/tmp/gdb-safari-XXXX");
74-
print $fh "set env DYLD_FRAMEWORK_PATH $productDir\n";
75-
print $fh "set env WEBKIT_UNSET_DYLD_FRAMEWORK_PATH YES\n";
76-
77-
my @architectureFlags = ("-arch", preferredArchitecture()) if isAppleMacWebKit() && !isTiger();
78-
# Start up Safari.
79-
print "Start Safari under gdb with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
80-
exec $gdbPath, "-x", $path, @architectureFlags, $safariPath or die;
48+
$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
49+
$ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = 'YES';
8150

82-
# Delete the temporary file.
83-
unlink0($fh, $path) or die "Error unlinking file $path safely";
51+
print "Starting Safari under gdb with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
52+
my @architectureFlags = ("-arch", architecture()) if !isTiger();
53+
exec $gdbPath, @architectureFlags, $safariPath or die;

WebKitTools/Scripts/run-javascriptcore-tests

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,22 @@ use webkitdirs;
3737
use POSIX;
3838

3939
# determine configuration
40-
my $configuration;
4140
setConfiguration();
42-
$configuration = configuration();
41+
my $configuration = configuration();
4342

4443
my $jsDriverArgs = "";
4544
my $root; # intentionally left undefined
46-
my $run64Bit = 0;
4745
my $showHelp = 0;
4846

4947
my $programName = basename($0);
5048
my $usage = <<EOF;
5149
Usage: $programName [options] [options to pass to build system]
5250
--help Show this help message
53-
--64-bit Use the 64bit jsc binary
5451
--jsDriver-args= A string of arguments to pass to jsDriver.pl
5552
--root= Path to pre-built root containing jsc
5653
EOF
5754

5855
GetOptions(
59-
'64-bit' => \$run64Bit,
6056
'j|jsDriver-args=s' => \$jsDriverArgs,
6157
'root=s' => \$root,
6258
'help' => \$showHelp
@@ -75,22 +71,10 @@ if ($showHelp) {
7571

7672
setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
7773

78-
if (isAppleMacWebKit() && !isTiger()) {
79-
my $preferredArch = preferredArchitecture("JavaScriptCore");
80-
setRun64Bit($run64Bit);
81-
my $arch = preferredArchitecture("JavaScriptCore");
82-
if ($arch ne $preferredArch) {
83-
push(@jsArgs, "-a", $arch);
84-
}
85-
}
86-
8774
if (!defined($root)){
8875
chdirWebKit();
8976

9077
push(@buildArgs, argumentsForConfiguration());
91-
92-
my $arch = preferredArchitecture("JavaScriptCore");
93-
push(@buildArgs, "ARCHS=$arch") if (isAppleMacWebKit());
9478

9579
print "Running: build-jsc " . join(" ", @buildArgs) . "\n";
9680
my $buildResult = system "perl", "WebKitTools/Scripts/build-jsc", @buildArgs;

WebKitTools/Scripts/run-safari

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,9 @@
3030

3131
use strict;
3232
use FindBin;
33-
use Getopt::Long qw(:config pass_through);
3433
use lib $FindBin::Bin;
3534
use webkitdirs;
3635

37-
my $programName = basename($0);
38-
my $showHelp = 0;
39-
my $run64Bit;
40-
41-
my $usage = <<EOF;
42-
Usage: $programName [options]
43-
--help Show this help message
44-
--64-bit Run in 64-bit mode
45-
EOF
46-
47-
my $getOptionsResult = GetOptions(
48-
'help' => \$showHelp,
49-
'64-bit!' => \$run64Bit
50-
);
51-
52-
if (!$getOptionsResult || $showHelp) {
53-
print STDERR $usage;
54-
exit 1;
55-
}
56-
57-
setRun64Bit($run64Bit);
5836
setConfiguration();
5937

6038
# Check to see that all the frameworks are built.

WebKitTools/Scripts/run-webkit-tests

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ sub writeToFile($$);
103103
# Argument handling
104104
my $addPlatformExceptions = 0;
105105
my $complexText = 0;
106-
my $configuration = configuration();
107106
my $guardMalloc = '';
108107
my $httpdPort = 8000;
109108
my $httpdSSLPort = 8443;
@@ -134,7 +133,6 @@ my $reverseTests = 0;
134133
my $randomizeTests = 0;
135134
my $mergeDepth;
136135
my @leaksFilenames;
137-
my $run64Bit;
138136

139137
# Default to --no-http for Qt, Gtk and wx for now.
140138
$testHTTP = 0 if (isQt() || isGtk() || isWx());
@@ -209,15 +207,12 @@ Usage: $programName [options] [testdir|testpath ...]
209207
--valgrind Run DumpRenderTree inside valgrind (Qt/Linux only)
210208
-v|--verbose More verbose output (overrides --quiet)
211209
-m|--merge-leak-depth arg Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg. Defaults to 5.
212-
--64-bit run in 64bit mode
213210
EOF
214211

215-
# Process @ARGV for configuration switches before calling GetOptions()
216-
$configuration = passedConfiguration() || configuration();
212+
setConfiguration();
217213

218214
my $getOptionsResult = GetOptions(
219215
'complex-text' => \$complexText,
220-
'c|configuration=s' => \$configuration,
221216
'guard-malloc|g' => \$guardMalloc,
222217
'help' => \$showHelp,
223218
'http!' => \$testHTTP,
@@ -247,7 +242,6 @@ my $getOptionsResult = GetOptions(
247242
'root=s' => \$root,
248243
'add-platform-exceptions' => \$addPlatformExceptions,
249244
'merge-leak-depth|m:5' => \$mergeDepth,
250-
'64-bit!' => \$run64Bit
251245
);
252246

253247
if (!$getOptionsResult || $showHelp) {
@@ -260,7 +254,7 @@ my $skippedOnly = $treatSkipped eq "only";
260254

261255
!$skippedOnly || @ARGV == 0 or die "--skipped=only cannot be used when tests are specified on the command line.";
262256

263-
setConfiguration($configuration);
257+
my $configuration = configuration();
264258

265259
$testsPerDumpTool = 1000 if !$testsPerDumpTool;
266260

@@ -277,19 +271,13 @@ setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
277271
my $productDir = productDir();
278272
$productDir .= "/bin" if isQt();
279273
$productDir .= "/Programs" if isGtk();
280-
setRun64Bit($run64Bit);
281274

282275
chdirWebKit();
283276

284277
if (!defined($root)) {
285278
# Push the parameters to build-dumprendertree as an array
286279
my @args = argumentsForConfiguration();
287280

288-
if (isAppleMacWebKit()) {
289-
my $arch = preferredArchitecture();
290-
push(@args, "ARCHS=$arch");
291-
}
292-
293281
my $buildResult = system "WebKitTools/Scripts/build-dumprendertree", @args;
294282
if ($buildResult) {
295283
print STDERR "Compiling DumpRenderTree failed!\n";
@@ -1246,13 +1234,8 @@ sub openDumpTool()
12461234
setPathForRunningWebKitApp(\%ENV) if isCygwin();
12471235
}
12481236

1249-
exportArchPreference();
1237+
my @args = ($dumpTool, @toolArgs);
12501238

1251-
my @args = @toolArgs;
1252-
unshift @args, $dumpTool;
1253-
if (isAppleMacWebKit and !isTiger()) {
1254-
unshift @args, "arch";
1255-
}
12561239
if ($useValgrind) {
12571240
unshift @args, "valgrind";
12581241
}

WebKitTools/Scripts/set-webkit-configuration

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,49 @@ use FindBin;
3131
use lib $FindBin::Bin;
3232
use webkitdirs;
3333

34+
my $programName = basename($0);
35+
my $usage = <<EOF;
36+
Usage: $programName [options]
37+
--32-bit Set the default architecture to 32-bit
38+
--64-bit Set the default architecture to 64-bit
39+
--debug Set the default configuration to debug
40+
--release Set the default configuration to release
41+
EOF
42+
3443
my $configuration = passedConfiguration();
35-
die "Please specify either --debug or --release.\n" if !$configuration;
44+
my $architecture = passedArchitecture();
45+
46+
if (!$architecture) {
47+
# Handle --64-bit explicitly here, as we don't want our other scripts to accept it
48+
for my $i (0 .. $#ARGV) {
49+
my $opt = $ARGV[$i];
50+
if ($opt =~ /^--64-bit$/i) {
51+
splice(@ARGV, $i, 1);
52+
$architecture = 'x86_64';
53+
}
54+
}
55+
}
56+
57+
if (!$configuration && !$architecture) {
58+
print STDERR $usage;
59+
exit 1;
60+
}
3661

3762
my $baseProductDir = baseProductDir();
3863
system "mkdir", "-p", "$baseProductDir";
39-
open CONFIGURATION, ">", "$baseProductDir/Configuration" or die;
40-
print CONFIGURATION $configuration;
41-
close CONFIGURATION;
64+
65+
if ($configuration) {
66+
open CONFIGURATION, ">", "$baseProductDir/Configuration" or die;
67+
print CONFIGURATION $configuration;
68+
close CONFIGURATION;
69+
}
70+
71+
if ($architecture) {
72+
if ($architecture ne "x86_64") {
73+
open ARCHITECTURE, ">", "$baseProductDir/Architecture" or die;
74+
print ARCHITECTURE $architecture;
75+
close ARCHITECTURE;
76+
} else {
77+
unlink "$baseProductDir/Architecture";
78+
}
79+
}

0 commit comments

Comments
 (0)