Changeset 141515 in webkit


Ignore:
Timestamp:
Jan 31, 2013 5:34:04 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Provide a sensible default architecture when building on iOS SDKs
https://bugs.webkit.org/show_bug.cgi?id=108395

Patch by David Farler <dfarler@apple.com> on 2013-01-31
Reviewed by Joseph Pecoraro.

  • Scripts/webkitdirs.pm:

(determineArchitecture):
Check for iphoneos and iphonesimulator SDKs for a default arch.
(determineXcodeSDK): Added.
(xcodeSDK): Added.
(XcodeOptions): Add ARCHS= if defined.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r141514 r141515  
     12013-01-31  David Farler  <dfarler@apple.com>
     2
     3        Provide a sensible default architecture when building on iOS SDKs
     4        https://bugs.webkit.org/show_bug.cgi?id=108395
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * Scripts/webkitdirs.pm:
     9        (determineArchitecture):
     10        Check for iphoneos and iphonesimulator SDKs for a default arch.
     11        (determineXcodeSDK): Added.
     12        (xcodeSDK): Added.
     13        (XcodeOptions): Add ARCHS= if defined.
     14
    1152013-01-31  Christopher Cameron  <ccameron@chromium.org>
    216
  • trunk/Tools/Scripts/webkitdirs.pm

    r141137 r141515  
    8181my @baseProductDirOption;
    8282my $configuration;
     83my $xcodeSDK;
    8384my $configurationForVisualStudio;
    8485my $configurationProductDir;
     
    302303
    303304    determineBaseProductDir();
     305    determineXcodeSDK();
    304306
    305307    if (isGtk()) {
     
    318320            chomp $architecture;
    319321        } else {
    320             my $supports64Bit = `sysctl -n hw.optional.x86_64`;
    321             chomp $supports64Bit;
    322             $architecture = 'x86_64' if $supports64Bit;
     322            if (not defined $xcodeSDK or $xcodeSDK =~ /\/|macosx/) {
     323                my $supports64Bit = `sysctl -n hw.optional.x86_64`;
     324                chomp $supports64Bit;
     325                $architecture = 'x86_64' if $supports64Bit;
     326            } elsif ($xcodeSDK =~ /iphonesimulator/) {
     327                $architecture = 'i386';
     328            } elsif ($xcodeSDK =~ /iphoneos/) {
     329                $architecture = 'armv7';
     330            }
    323331        }
    324332    } elsif (isEfl()) {
     
    397405}
    398406
     407sub determineXcodeSDK
     408{
     409    return if defined $xcodeSDK;
     410    for (my $i = 0; $i <= $#ARGV; $i++) {
     411        my $opt = $ARGV[$i];
     412        if ($opt =~ /^--sdk$/i) {
     413            splice(@ARGV, $i, 1);
     414            $xcodeSDK = splice(@ARGV, $i, 1);
     415        } elsif ($opt =~ /^--device$/i) {
     416            splice(@ARGV, $i, 1);
     417            $xcodeSDK = 'iphoneos.internal';
     418        } elsif ($opt =~ /^--sim(ulator)?/i) {
     419            splice(@ARGV, $i, 1);
     420            $xcodeSDK = 'iphonesimulator';
     421        }
     422    }
     423}
     424
     425sub xcodeSDK
     426{
     427    determineXcodeSDK();
     428    return $xcodeSDK;
     429}
     430
    399431sub determineConfigurationForVisualStudio
    400432{
     
    521553    determineConfiguration();
    522554    determineArchitecture();
    523     return (@baseProductDirOption, "-configuration", $configuration, "ARCHS=$architecture", argumentsForXcode());
     555    determineXcodeSDK();
     556
     557    my @sdkOption = ($xcodeSDK ? "SDKROOT=$xcodeSDK" : ());
     558    my @architectureOption = ($architecture ? "ARCHS=$architecture" : ());
     559
     560    return (@baseProductDirOption, "-configuration", $configuration, @architectureOption, @sdkOption, argumentsForXcode());
    524561}
    525562
Note: See TracChangeset for help on using the changeset viewer.