Title: [140912] trunk
Revision
140912
Author
[email protected]
Date
2013-01-26 08:34:55 -0800 (Sat, 26 Jan 2013)

Log Message

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

Patch by David Farler <[email protected]> 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 <[email protected]> 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.

Modified Paths

Diff

Modified: trunk/ChangeLog (140911 => 140912)


--- trunk/ChangeLog	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/ChangeLog	2013-01-26 16:34:55 UTC (rev 140912)
@@ -1,3 +1,17 @@
+2013-01-26  David Farler  <[email protected]>
+
+        Allow building with arbitrary SDK and ARCHS with make + Xcode
+        https://bugs.webkit.org/show_bug.cgi?id=107863
+
+        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.
+
 2013-01-25  Jussi Kukkonen  <[email protected]>
 
         [CMake][EFL] Build ThirdParty/leveldb when IndexedDB is enabled

Modified: trunk/Makefile (140911 => 140912)


--- trunk/Makefile	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/Makefile	2013-01-26 16:34:55 UTC (rev 140912)
@@ -4,11 +4,11 @@
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 
-debug d development dev develop:
+debug d:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 
-release r deployment dep deploy:
+release r:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 

Modified: trunk/Makefile.shared (140911 => 140912)


--- trunk/Makefile.shared	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/Makefile.shared	2013-01-26 16:34:55 UTC (rev 140912)
@@ -1,6 +1,18 @@
 SCRIPTS_PATH ?= ../Tools/Scripts
-XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()'` $(ARGS)
 
+SDK = /
+
+ifneq (,$(findstring iphoneos,$(SDK)))
+	ARCHS = armv7
+else ifneq (,$(findstring iphonesimulator,$(SDK)))
+	ARCHS = i386
+else ifneq (,$(findstring macosx,$(SDK)))
+	ARCHS = x86_64
+else
+	ARCHS = x86_64
+endif
+
+ARCH_FLAGS=$(addprefix --arch ,$(ARCHS))
 DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default")
 VERBOSITY ?= $(DEFAULT_VERBOSITY)
 
@@ -14,18 +26,22 @@
 endif
 endif
 
+define xcode-options
+	 $(shell perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()' -- --sdk $(SDK) $1 $(ARCH_FLAGS) $(ARGS))
+endef
+
 all:
-	( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+	xcodebuild $(OTHER_OPTIONS) $(call xcode-options,) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
 
-debug d development dev develop: force
+debug d: force
 	$(SCRIPTS_PATH)/set-webkit-configuration --debug
-	( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+	xcodebuild $(OTHER_OPTIONS) $(call xcode-options, --configuration Debug) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
 
-release r deployment dep deploy: force
+release r: force
 	$(SCRIPTS_PATH)/set-webkit-configuration --release
-	( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+	xcodebuild $(OTHER_OPTIONS) $(call xcode-options, --configuration Release) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
 
 clean:
-	( xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+	xcodebuild $(OTHER_OPTIONS) -alltargets clean $(call xcode-options,) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]}
 
 force: ;

Modified: trunk/Source/Makefile (140911 => 140912)


--- trunk/Source/Makefile	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/Source/Makefile	2013-01-26 16:34:55 UTC (rev 140912)
@@ -1,14 +1,22 @@
 MODULES = WTF _javascript_Core ThirdParty/ANGLE WebCore WebKit WebKit2
 
+IOS_DONT_BUILD = WebKit2
+
+ifneq (,$(findstring iphoneos,$(SDK)))
+	MODULES = $(filter-out $(IOS_DONT_BUILD),$(MODULES))
+else ifneq (,$(findstring iphonesimulator,$(SDK)))
+	MODULES = $(subst $(IOS_DONT_BUILD),$(MODULES))
+endif
+
 all:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 
-debug d development dev develop:
+debug d:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 
-release r deployment dep deploy:
+release r:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 

Modified: trunk/Tools/ChangeLog (140911 => 140912)


--- trunk/Tools/ChangeLog	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/Tools/ChangeLog	2013-01-26 16:34:55 UTC (rev 140912)
@@ -1,3 +1,27 @@
+2013-01-26  David Farler  <[email protected]>
+
+        Makefiles should work for arbitrary SDKs and architectures on Apple ports
+        https://bugs.webkit.org/show_bug.cgi?id=107863
+
+        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.
+
 2013-01-25  Jochen Eisinger  <[email protected]>
 
         [chromium] move tracking of the top loading frame to TestRunner library

Modified: trunk/Tools/DumpRenderTree/Makefile (140911 => 140912)


--- trunk/Tools/DumpRenderTree/Makefile	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/Tools/DumpRenderTree/Makefile	2013-01-26 16:34:55 UTC (rev 140912)
@@ -1,2 +1,9 @@
 SCRIPTS_PATH = ../Scripts
+
+ifneq (,$(findstring iphoneos,$(SDK)))
+	OTHER_OPTIONS += -target All-iOS
+else ifneq (,$(findstring iphonesimulator,$(SDK)))
+	OTHER_OPTIONS += -target All-iOS
+endif
+
 include ../../Makefile.shared

Modified: trunk/Tools/Makefile (140911 => 140912)


--- trunk/Tools/Makefile	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/Tools/Makefile	2013-01-26 16:34:55 UTC (rev 140912)
@@ -1,14 +1,24 @@
 MODULES = DumpRenderTree WebKitTestRunner MiniBrowser ../Source/ThirdParty/gtest/xcode TestWebKitAPI
 
+IOS_DONT_BUILD = WebKitTestRunner MiniBrowser TestWebKitAPI
+IPHONEOS_DONT_BUILD = DumpRenderTree
+
+ifneq (,$(findstring iphoneos,$(SDK)))
+	MODULES = $(filter-out $(IOS_DONT_BUILD),$(MODULES))
+	MODULES = $(filter-out $(IPHONEOS_DONT_BUILD),$(MODULES))
+else ifneq (,$(findstring iphonesimulator,$(SDK)))
+	MODULES = $(filter-out $(IOS_DONT_BUILD),$(MODULES))
+endif
+
 all:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 
-debug d development dev develop:
+debug d:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 
-release r deployment dep deploy:
+release r:
 	@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
 	if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
 

Modified: trunk/Tools/Scripts/webkitdirs.pm (140911 => 140912)


--- trunk/Tools/Scripts/webkitdirs.pm	2013-01-26 16:08:41 UTC (rev 140911)
+++ trunk/Tools/Scripts/webkitdirs.pm	2013-01-26 16:34:55 UTC (rev 140912)
@@ -80,6 +80,8 @@
 my $baseProductDir;
 my @baseProductDirOption;
 my $configuration;
+my $xcodeSDK;
+my $xcodeSDKVersion;
 my $configurationForVisualStudio;
 my $configurationProductDir;
 my $sourceDir;
@@ -273,6 +275,17 @@
 sub determineConfiguration
 {
     return if defined $configuration;
+
+    # Look for explicit setting first
+    for (my $i = 0; $i <= $#ARGV; $i++) {
+        my $opt = $ARGV[$i];
+        if ($opt =~ /^--config(uration)$/) {
+            splice(@ARGV, $i, 1);
+            $configuration = splice(@ARGV, $i, 1);
+            return;
+        }
+    }
+
     determineBaseProductDir();
     if (open CONFIGURATION, "$baseProductDir/Configuration") {
         $configuration = <CONFIGURATION>;
@@ -302,6 +315,30 @@
 
     determineBaseProductDir();
 
+    # Look for explicit setting first
+    my @explicitArchs;
+    for (my $i = 0; $i <= $#ARGV; $i++) {
+        my $opt = $ARGV[$i];
+
+        if ($opt =~ /^--arch(itecture)?$/) {
+            splice(@ARGV, $i, 1);
+            push @explicitArchs, splice(@ARGV, $i--, 1);
+        } elsif ($opt =~ /^ARCHS=(.*)$/) {
+            push @explicitArchs, split(/\w/, $1);
+            splice(@ARGV, $i--, 1);
+        }
+    }
+
+    # Make explicit arch settings forgiving – remove duplicate settings
+    # and allow for specifying architectures with both --arch and appending
+    # Xcode-style ARCHS=(.*)
+    @explicitArchs = sort keys %{{ map { $_ => 1 } @explicitArchs }};
+
+    if (scalar(@explicitArchs)) {
+        $architecture = join(' ', @explicitArchs) if @explicitArchs;
+        return;
+    }
+
     if (isGtk()) {
         determineConfigurationProductDir();
         my $host_triple = `grep -E '^host = ' $configurationProductDir/GNUmakefile`;
@@ -383,6 +420,7 @@
     push(@args, '--debug') if $configuration eq "Debug";
     push(@args, '--release') if $configuration eq "Release";
     push(@args, '--32-bit') if $architecture ne "x86_64";
+    push(@args, '--sdk', $xcodeSDK) if defined $xcodeSDK;
     push(@args, '--qt') if isQt();
     push(@args, '--gtk') if isGtk();
     push(@args, '--efl') if isEfl();
@@ -396,6 +434,33 @@
     return @args;
 }
 
+sub determineXcodeSDK
+{
+    return if defined $xcodeSDK;
+    for (my $i = 0; $i <= $#ARGV; $i++) {
+        my $opt = $ARGV[$i];
+        if ($opt =~ /^--sdk$/i) {
+            splice(@ARGV, $i, 1);
+            $xcodeSDK = splice(@ARGV, $i, 1);
+        } elsif ($opt =~ /^--device$/i) {
+            splice(@ARGV, $i, 1);
+            $xcodeSDK = 'iphoneos.internal';
+        } elsif ($opt =~ /^--sim(ulator)?/i) {
+            splice(@ARGV, $i, 1);
+            $xcodeSDK = 'iphonesimulator';
+        }
+    }
+    $xcodeSDK ||= '/';
+
+    chomp $xcodeSDK;
+}
+
+sub xcodeSDK
+{
+    determineXcodeSDK();
+    return $xcodeSDK;
+}
+
 sub determineConfigurationForVisualStudio
 {
     return if defined $configurationForVisualStudio;
@@ -520,7 +585,9 @@
     determineBaseProductDir();
     determineConfiguration();
     determineArchitecture();
-    return (@baseProductDirOption, "-configuration", $configuration, "ARCHS=$architecture", argumentsForXcode());
+    determineXcodeSDK();
+    my @archFlags = map { ('-arch', $_) } split(/ /, $architecture);
+    return (@baseProductDirOption, "-configuration", $configuration, "-sdk", $xcodeSDK, @archFlags, argumentsForXcode());
 }
 
 sub XcodeOptionString
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to