Changeset 140912 in webkit


Ignore:
Timestamp:
Jan 26, 2013 8:34:55 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

.: Allow building with arbitrary SDK and ARCHS with make + Xcode
https://bugs.webkit.org/show_bug.cgi?id=107863

Patch by David Farler <dfarler@apple.com> on 2013-01-26
Reviewed by David Kilzer.

  • Makefile:

Removed references to legacy Xcode configurations.

  • Makefile.shared:

Added default ARCHS + SDK settings and parameterized xcodebuild calls.

  • Source/Makefile:

iOS does not build WebKit2.

Tools: Makefiles should work for arbitrary SDKs and architectures on Apple ports
https://bugs.webkit.org/show_bug.cgi?id=107863

Patch by David Farler <dfarler@apple.com> on 2013-01-26
Reviewed by David Kilzer.

  • Makefile:

Added temporary filters for projects not yet building on iOS.

  • DumpRenderTree/Makefile:

Building with iOS SDKs -> -target All-iOS

  • Scripts/webkitdirs.pm:

(determineConfiguration):
Added --configuration switch detection.
(determineArchitecture):
Added --architecture and ARCH=(.*) switch detection.
(argumentsForConfiguration):
(determineXcodeSDK):
Look for --device, --simulator, and --sdk switches.
(xcodeSDK):
Added.
(XcodeOptions):
Determine Xcode SDK and generate -arch switches.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r140804 r140912  
     12013-01-26  David Farler  <dfarler@apple.com>
     2
     3        Allow building with arbitrary SDK and ARCHS with make + Xcode
     4        https://bugs.webkit.org/show_bug.cgi?id=107863
     5
     6        Reviewed by David Kilzer.
     7
     8        * Makefile:
     9        Removed references to legacy Xcode configurations.
     10        * Makefile.shared:
     11        Added default ARCHS + SDK settings and parameterized xcodebuild calls.
     12        * Source/Makefile:
     13        iOS does not build WebKit2.
     14
    1152013-01-25  Jussi Kukkonen  <jussi.kukkonen@intel.com>
    216
  • trunk/Makefile

    r103773 r140912  
    55        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
    66
    7 debug d development dev develop:
     7debug d:
    88        @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    99        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
    1010
    11 release r deployment dep deploy:
     11release r:
    1212        @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    1313        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
  • trunk/Makefile.shared

    r106634 r140912  
    11SCRIPTS_PATH ?= ../Tools/Scripts
    2 XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()'` $(ARGS)
    32
     3SDK = /
     4
     5ifneq (,$(findstring iphoneos,$(SDK)))
     6        ARCHS = armv7
     7else ifneq (,$(findstring iphonesimulator,$(SDK)))
     8        ARCHS = i386
     9else ifneq (,$(findstring macosx,$(SDK)))
     10        ARCHS = x86_64
     11else
     12        ARCHS = x86_64
     13endif
     14
     15ARCH_FLAGS=$(addprefix --arch ,$(ARCHS))
    416DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default")
    517VERBOSITY ?= $(DEFAULT_VERBOSITY)
     
    1527endif
    1628
     29define xcode-options
     30         $(shell perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()' -- --sdk $(SDK) $1 $(ARCH_FLAGS) $(ARGS))
     31endef
     32
    1733all:
    18         ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     34        xcodebuild $(OTHER_OPTIONS) $(call xcode-options,) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
    1935
    20 debug d development dev develop: force
     36debug d: force
    2137        $(SCRIPTS_PATH)/set-webkit-configuration --debug
    22         ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     38        xcodebuild $(OTHER_OPTIONS) $(call xcode-options, --configuration Debug) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
    2339
    24 release r deployment dep deploy: force
     40release r: force
    2541        $(SCRIPTS_PATH)/set-webkit-configuration --release
    26         ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     42        xcodebuild $(OTHER_OPTIONS) $(call xcode-options, --configuration Release) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
    2743
    2844clean:
    29         ( xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     45        xcodebuild $(OTHER_OPTIONS) -alltargets clean $(call xcode-options,) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
    3046
    3147force: ;
  • trunk/Source/Makefile

    r110038 r140912  
    11MODULES = WTF JavaScriptCore ThirdParty/ANGLE WebCore WebKit WebKit2
     2
     3IOS_DONT_BUILD = WebKit2
     4
     5ifneq (,$(findstring iphoneos,$(SDK)))
     6        MODULES = $(filter-out $(IOS_DONT_BUILD),$(MODULES))
     7else ifneq (,$(findstring iphonesimulator,$(SDK)))
     8        MODULES = $(subst $(IOS_DONT_BUILD),$(MODULES))
     9endif
    210
    311all:
     
    513        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
    614
    7 debug d development dev develop:
     15debug d:
    816        @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    917        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
    1018
    11 release r deployment dep deploy:
     19release r:
    1220        @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    1321        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
  • trunk/Tools/ChangeLog

    r140889 r140912  
     12013-01-26  David Farler  <dfarler@apple.com>
     2
     3        Makefiles should work for arbitrary SDKs and architectures on Apple ports
     4        https://bugs.webkit.org/show_bug.cgi?id=107863
     5
     6        Reviewed by David Kilzer.
     7
     8        * Makefile:
     9        Added temporary filters for projects not yet building on iOS.
     10        * DumpRenderTree/Makefile:
     11        Building with iOS SDKs -> -target All-iOS
     12        * Scripts/webkitdirs.pm:
     13        (determineConfiguration):
     14        Added --configuration switch detection.
     15        (determineArchitecture):
     16        Added --architecture and ARCH=(.*) switch detection.
     17        (argumentsForConfiguration):
     18        (determineXcodeSDK):
     19        Look for --device, --simulator, and --sdk switches.
     20        (xcodeSDK):
     21        Added.
     22        (XcodeOptions):
     23        Determine Xcode SDK and generate -arch switches.
     24
    1252013-01-25  Jochen Eisinger  <jochen@chromium.org>
    226
  • trunk/Tools/DumpRenderTree/Makefile

    r24409 r140912  
    11SCRIPTS_PATH = ../Scripts
     2
     3ifneq (,$(findstring iphoneos,$(SDK)))
     4        OTHER_OPTIONS += -target All-iOS
     5else ifneq (,$(findstring iphonesimulator,$(SDK)))
     6        OTHER_OPTIONS += -target All-iOS
     7endif
     8
    29include ../../Makefile.shared
  • trunk/Tools/Makefile

    r86287 r140912  
    11MODULES = DumpRenderTree WebKitTestRunner MiniBrowser ../Source/ThirdParty/gtest/xcode TestWebKitAPI
     2
     3IOS_DONT_BUILD = WebKitTestRunner MiniBrowser TestWebKitAPI
     4IPHONEOS_DONT_BUILD = DumpRenderTree
     5
     6ifneq (,$(findstring iphoneos,$(SDK)))
     7        MODULES = $(filter-out $(IOS_DONT_BUILD),$(MODULES))
     8        MODULES = $(filter-out $(IPHONEOS_DONT_BUILD),$(MODULES))
     9else ifneq (,$(findstring iphonesimulator,$(SDK)))
     10        MODULES = $(filter-out $(IOS_DONT_BUILD),$(MODULES))
     11endif
    212
    313all:
     
    515        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
    616
    7 debug d development dev develop:
     17debug d:
    818        @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    919        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
    1020
    11 release r deployment dep deploy:
     21release r:
    1222        @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    1323        if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
  • trunk/Tools/Scripts/webkitdirs.pm

    r139961 r140912  
    8181my @baseProductDirOption;
    8282my $configuration;
     83my $xcodeSDK;
     84my $xcodeSDKVersion;
    8385my $configurationForVisualStudio;
    8486my $configurationProductDir;
     
    274276{
    275277    return if defined $configuration;
     278
     279    # Look for explicit setting first
     280    for (my $i = 0; $i <= $#ARGV; $i++) {
     281        my $opt = $ARGV[$i];
     282        if ($opt =~ /^--config(uration)$/) {
     283            splice(@ARGV, $i, 1);
     284            $configuration = splice(@ARGV, $i, 1);
     285            return;
     286        }
     287    }
     288
    276289    determineBaseProductDir();
    277290    if (open CONFIGURATION, "$baseProductDir/Configuration") {
     
    302315
    303316    determineBaseProductDir();
     317
     318    # Look for explicit setting first
     319    my @explicitArchs;
     320    for (my $i = 0; $i <= $#ARGV; $i++) {
     321        my $opt = $ARGV[$i];
     322
     323        if ($opt =~ /^--arch(itecture)?$/) {
     324            splice(@ARGV, $i, 1);
     325            push @explicitArchs, splice(@ARGV, $i--, 1);
     326        } elsif ($opt =~ /^ARCHS=(.*)$/) {
     327            push @explicitArchs, split(/\w/, $1);
     328            splice(@ARGV, $i--, 1);
     329        }
     330    }
     331
     332    # Make explicit arch settings forgiving – remove duplicate settings
     333    # and allow for specifying architectures with both --arch and appending
     334    # Xcode-style ARCHS=(.*)
     335    @explicitArchs = sort keys %{{ map { $_ => 1 } @explicitArchs }};
     336
     337    if (scalar(@explicitArchs)) {
     338        $architecture = join(' ', @explicitArchs) if @explicitArchs;
     339        return;
     340    }
    304341
    305342    if (isGtk()) {
     
    384421    push(@args, '--release') if $configuration eq "Release";
    385422    push(@args, '--32-bit') if $architecture ne "x86_64";
     423    push(@args, '--sdk', $xcodeSDK) if defined $xcodeSDK;
    386424    push(@args, '--qt') if isQt();
    387425    push(@args, '--gtk') if isGtk();
     
    397435}
    398436
     437sub determineXcodeSDK
     438{
     439    return if defined $xcodeSDK;
     440    for (my $i = 0; $i <= $#ARGV; $i++) {
     441        my $opt = $ARGV[$i];
     442        if ($opt =~ /^--sdk$/i) {
     443            splice(@ARGV, $i, 1);
     444            $xcodeSDK = splice(@ARGV, $i, 1);
     445        } elsif ($opt =~ /^--device$/i) {
     446            splice(@ARGV, $i, 1);
     447            $xcodeSDK = 'iphoneos.internal';
     448        } elsif ($opt =~ /^--sim(ulator)?/i) {
     449            splice(@ARGV, $i, 1);
     450            $xcodeSDK = 'iphonesimulator';
     451        }
     452    }
     453    $xcodeSDK ||= '/';
     454
     455    chomp $xcodeSDK;
     456}
     457
     458sub xcodeSDK
     459{
     460    determineXcodeSDK();
     461    return $xcodeSDK;
     462}
     463
    399464sub determineConfigurationForVisualStudio
    400465{
     
    521586    determineConfiguration();
    522587    determineArchitecture();
    523     return (@baseProductDirOption, "-configuration", $configuration, "ARCHS=$architecture", argumentsForXcode());
     588    determineXcodeSDK();
     589    my @archFlags = map { ('-arch', $_) } split(/ /, $architecture);
     590    return (@baseProductDirOption, "-configuration", $configuration, "-sdk", $xcodeSDK, @archFlags, argumentsForXcode());
    524591}
    525592
Note: See TracChangeset for help on using the changeset viewer.