Simplify FEATURE_DEFINES definition
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Apr 2009 23:11:46 +0000 (23:11 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Apr 2009 23:11:46 +0000 (23:11 +0000)
        Reviewed by Darin Adler.

        This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
        variables to their own FeatureDefines.xcconfig file.  It also
        extracts a new ENABLE_GEOLOCATION variable so that
        FEATURE_DEFINES only needs to be defined once.

JavaScriptCore:

        * Configurations/FeatureDefines.xcconfig: Added.
        * Configurations/JavaScriptCore.xcconfig: Removed definition of
        ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES.  Added include
        of FeatureDefines.xcconfig.
        * JavaScriptCore.xcodeproj/project.pbxproj: Added
        FeatureDefines.xcconfig file.

WebCore:

        * Configurations/FeatureDefines.xcconfig: Added.
        * Configurations/WebCore.xcconfig: Removed definition of
        ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES.  Added include
        of FeatureDefines.xcconfig.
        * WebCore.xcodeproj/project.pbxproj: Added
        FeatureDefines.xcconfig file.
        * bindings/scripts/CodeGeneratorObjC.pm: When creating a list of
        command-line macro definitions, split on one-or-more spaces
        instead of a single space since the FEATURE_DEFINES macro may
        now contain more than one space between macros if some macros
        aren't defined.

WebKit:

        * WebKit.xcodeproj/project.pbxproj: Added
        FeatureDefines.xcconfig file.

WebKit/mac:

        * Configurations/FeatureDefines.xcconfig: Added.
        * Configurations/WebKit.xcconfig: Removed definition of
        ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES.  Added include
        of FeatureDefines.xcconfig.

WebKitTools:

        * Scripts/build-webkit: Realphabetized code related to enabling
        Geolation features for WebKit.  Also set ENABLE_GEOLOCATION
        variable for xcodebuild.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@42631 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/Configurations/FeatureDefines.xcconfig [new file with mode: 0644]
JavaScriptCore/Configurations/JavaScriptCore.xcconfig
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
WebCore/ChangeLog
WebCore/Configurations/FeatureDefines.xcconfig [new file with mode: 0644]
WebCore/Configurations/WebCore.xcconfig
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/scripts/CodeGeneratorObjC.pm
WebKit/ChangeLog
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/mac/ChangeLog
WebKit/mac/Configurations/FeatureDefines.xcconfig [new file with mode: 0644]
WebKit/mac/Configurations/WebKit.xcconfig
WebKitTools/ChangeLog
WebKitTools/Scripts/build-webkit

index 8cca4ff..891a49f 100644 (file)
@@ -1,3 +1,21 @@
+2009-04-17  David Kilzer  <ddkilzer@apple.com>
+
+        Simplify FEATURE_DEFINES definition
+
+        Reviewed by Darin Adler.
+
+        This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
+        variables to their own FeatureDefines.xcconfig file.  It also
+        extracts a new ENABLE_GEOLOCATION variable so that
+        FEATURE_DEFINES only needs to be defined once.
+
+        * Configurations/FeatureDefines.xcconfig: Added.
+        * Configurations/JavaScriptCore.xcconfig: Removed definition of
+        ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES.  Added include
+        of FeatureDefines.xcconfig.
+        * JavaScriptCore.xcodeproj/project.pbxproj: Added
+        FeatureDefines.xcconfig file.
+
 2009-04-08  Mihnea Ovidenie  <mihnea@adobe.com>
 
         Reviewed by Oliver Hunt.
diff --git a/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
new file mode 100644 (file)
index 0000000..72496c9
--- /dev/null
@@ -0,0 +1,17 @@
+// The contents of this file must be kept in sync with FeatureDefines.xcconfig in JavaScriptCore,
+// WebCore and WebKit.  Also the default values of the ENABLE_FEATURE_NAME macros in build-webkit
+// should match the values below, but they do not need to be in the same order.
+
+// Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
+
+ENABLE_GEOLOCATION = $(ENABLE_GEOLOCATION_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_GEOLOCATION_ = $(ENABLE_GEOLOCATION_1040);
+ENABLE_GEOLOCATION_1040 = ;
+ENABLE_GEOLOCATION_1050 = ;
+ENABLE_GEOLOCATION_1060 = ENABLE_GEOLOCATION;
+
+ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS;
+
+// For now this needs to be kept sorted and in sync with FEATURE_DEFINES in the default settings
+// for build-webkit to prevent needless rebuilding when using both Xcode and build-webkit.
+FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE $(ENABLE_GEOLOCATION) ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE $(ENABLE_SVG_DOM_OBJC_BINDINGS) ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
index 41a7ab9..d60c8d6 100644 (file)
@@ -1,4 +1,6 @@
+#include "FeatureDefines.xcconfig"
 #include "Version.xcconfig"
+
 EXPORTED_SYMBOLS_FILE = $(EXPORTED_SYMBOLS_FILE_$(CURRENT_ARCH));
 EXPORTED_SYMBOLS_FILE_ = JavaScriptCore.exp;
 EXPORTED_SYMBOLS_FILE_i386 = JavaScriptCore.exp;
@@ -12,18 +14,6 @@ INFOPLIST_FILE = Info.plist;
 INSTALL_PATH = $(SYSTEM_LIBRARY_DIR)/Frameworks;
 PRODUCT_NAME = JavaScriptCore;
 
-// Set to an empty string to disable this feature
-ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS;
-
-// This needs to be kept sorted, and in sync with FEATURE_DEFINES in WebCore.xcconfig, WebKit.xcconfig and
-// the default settings of build-webkit to prevent needless rebuilding when using both Xcode and build-webkit.
-FEATURE_DEFINES = $(FEATURE_DEFINES_$(MAC_OS_X_VERSION_MAJOR));
-FEATURE_DEFINES_BASE = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE $(ENABLE_SVG_DOM_OBJC_BINDINGS) ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
-FEATURE_DEFINES_ = $(FEATURE_DEFINES_1040);
-FEATURE_DEFINES_1040 = $(FEATURE_DEFINES_BASE);
-FEATURE_DEFINES_1050 = $(FEATURE_DEFINES_BASE);
-FEATURE_DEFINES_1060 = $(FEATURE_DEFINES_BASE) ENABLE_GEOLOCATION;
-
 OTHER_CFLAGS = $(OTHER_CFLAGS_$(CONFIGURATION)_$(CURRENT_VARIANT));
 OTHER_CFLAGS_Release_normal = $(OTHER_CFLAGS_normal_$(XCODE_VERSION_ACTUAL));
 OTHER_CFLAGS_Production_normal = $(OTHER_CFLAGS_normal_$(XCODE_VERSION_ACTUAL));
index 1adbd06..a97d22f 100644 (file)
                1C9051450BA9E8A70081E9D0 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
                1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScript.h; sourceTree = "<group>"; };
                1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCore.h; sourceTree = "<group>"; };
+               449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
                45E12D8806A49B0F00E9DF84 /* jsc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsc.cpp; sourceTree = "<group>"; tabWidth = 4; };
                5186111D0CC824830081412B /* Deque.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Deque.h; sourceTree = "<group>"; };
                51F0EB6105C86C6B00E6DF1B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
                        children = (
                                1C9051450BA9E8A70081E9D0 /* Base.xcconfig */,
                                1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */,
+                               449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */,
                                1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */,
                                1C9051420BA9E8A70081E9D0 /* Version.xcconfig */,
                        );
index 6477bfa..7d161fa 100644 (file)
@@ -1,3 +1,26 @@
+2009-04-17  David Kilzer  <ddkilzer@apple.com>
+
+        Simplify FEATURE_DEFINES definition
+
+        Reviewed by Darin Adler.
+
+        This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
+        variables to their own FeatureDefines.xcconfig file.  It also
+        extracts a new ENABLE_GEOLOCATION variable so that
+        FEATURE_DEFINES only needs to be defined once.
+
+        * Configurations/FeatureDefines.xcconfig: Added.
+        * Configurations/WebCore.xcconfig: Removed definition of
+        ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES.  Added include
+        of FeatureDefines.xcconfig.
+        * WebCore.xcodeproj/project.pbxproj: Added
+        FeatureDefines.xcconfig file.
+        * bindings/scripts/CodeGeneratorObjC.pm: When creating a list of
+        command-line macro definitions, split on one-or-more spaces
+        instead of a single space since the FEATURE_DEFINES macro may
+        now contain more than one space between macros if some macros
+        aren't defined.
+
 2009-04-17  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Mark Rowe
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
new file mode 100644 (file)
index 0000000..72496c9
--- /dev/null
@@ -0,0 +1,17 @@
+// The contents of this file must be kept in sync with FeatureDefines.xcconfig in JavaScriptCore,
+// WebCore and WebKit.  Also the default values of the ENABLE_FEATURE_NAME macros in build-webkit
+// should match the values below, but they do not need to be in the same order.
+
+// Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
+
+ENABLE_GEOLOCATION = $(ENABLE_GEOLOCATION_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_GEOLOCATION_ = $(ENABLE_GEOLOCATION_1040);
+ENABLE_GEOLOCATION_1040 = ;
+ENABLE_GEOLOCATION_1050 = ;
+ENABLE_GEOLOCATION_1060 = ENABLE_GEOLOCATION;
+
+ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS;
+
+// For now this needs to be kept sorted and in sync with FEATURE_DEFINES in the default settings
+// for build-webkit to prevent needless rebuilding when using both Xcode and build-webkit.
+FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE $(ENABLE_GEOLOCATION) ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE $(ENABLE_SVG_DOM_OBJC_BINDINGS) ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
index fd72617..85b7bbc 100644 (file)
@@ -1,4 +1,6 @@
+#include "FeatureDefines.xcconfig"
 #include "Version.xcconfig"
+
 EXPORTED_SYMBOLS_FILE = $(EXPORTED_SYMBOLS_FILE_$(CURRENT_ARCH));
 EXPORTED_SYMBOLS_FILE_ = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.exp;
 EXPORTED_SYMBOLS_FILE_i386 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.exp;
@@ -26,18 +28,6 @@ EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(ENABLE_SVG_DOM_OBJC_
 EXCLUDED_SOURCE_FILE_NAMES_ = DOMSVG*.* DOMHTMLFrameElementPrivate.h DOMHTMLIFrameElementPrivate.h;
 EXCLUDED_SOURCE_FILE_NAMES_ENABLE_SVG_DOM_OBJC_BINDINGS = ;
 
-// Set to an empty string to disable this feature
-ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS;
-
-// This needs to be kept sorted, and in sync with FEATURE_DEFINES in JavaScriptCore.xcconfig, WebKit.xcconfig and
-// the default settings of build-webkit to prevent needless rebuilding when using both Xcode and build-webkit.
-FEATURE_DEFINES = $(FEATURE_DEFINES_$(MAC_OS_X_VERSION_MAJOR));
-FEATURE_DEFINES_BASE = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE $(ENABLE_SVG_DOM_OBJC_BINDINGS) ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
-FEATURE_DEFINES_ = $(FEATURE_DEFINES_1040);
-FEATURE_DEFINES_1040 = $(FEATURE_DEFINES_BASE);
-FEATURE_DEFINES_1050 = $(FEATURE_DEFINES_BASE);
-FEATURE_DEFINES_1060 = $(FEATURE_DEFINES_BASE) ENABLE_GEOLOCATION;
-
 SQLITE3_LIBRARY = $(SQLITE3_LIBRARY_$(MAC_OS_X_VERSION_MAJOR));
 SQLITE3_LIBRARY_ = WebCoreSQLite3;
 SQLITE3_LIBRARY_1040 = WebCoreSQLite3;
index a5d448c..8f6875b 100644 (file)
                448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionsCollection.h; sourceTree = "<group>"; };
                448A29BE0A46D9CB0030759F /* JSHTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionsCollection.cpp; sourceTree = "<group>"; };
                448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionsCollectionCustom.cpp; sourceTree = "<group>"; };
+               449098B10F8F82520076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
                4614A1FD0B23A8D600446E1C /* copyCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = copyCursor.png; sourceTree = "<group>"; };
                464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = crossHairCursor.png; sourceTree = "<group>"; };
                464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notAllowedCursor.png; sourceTree = "<group>"; };
                        children = (
                                1CDD45E60BA9C84600F90147 /* Base.xcconfig */,
                                1CDD45E40BA9C84600F90147 /* DebugRelease.xcconfig */,
+                               449098B10F8F82520076A327 /* FeatureDefines.xcconfig */,
                                1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */,
                                1CDD45E50BA9C84600F90147 /* WebCore.xcconfig */,
                        );
index 7ff06d1..fc265f9 100644 (file)
@@ -217,7 +217,7 @@ sub ReadPublicInterfaces
 
     my $fileName = "WebCore/bindings/objc/PublicDOMInterfaces.h";
     open FILE, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "objective-c", 
-        (map { "-D$_" } split(/ /, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName";
+        (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName";
     my @documentContent = <FILE>;
     close FILE;
 
index 4bfaad0..16177a3 100644 (file)
@@ -1,3 +1,17 @@
+2009-04-17  David Kilzer  <ddkilzer@apple.com>
+
+        Simplify FEATURE_DEFINES definition
+
+        Reviewed by Darin Adler.
+
+        This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
+        variables to their own FeatureDefines.xcconfig file.  It also
+        extracts a new ENABLE_GEOLOCATION variable so that
+        FEATURE_DEFINES only needs to be defined once.
+
+        * WebKit.xcodeproj/project.pbxproj: Added
+        FeatureDefines.xcconfig file.
+
 2009-04-10  Timothy Hatcher  <timothy@apple.com>
 
         Remove DOMDocumentPrivate.h now that <rdar://problem/6730996> is fixed.
index c1abf9f..a3958bb 100644 (file)
                3944607F020F50ED0ECA1767 /* WebHistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItem.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                39446080020F50ED0ECA1767 /* WebHistoryItem.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHistoryItem.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationInternal.h; sourceTree = "<group>"; };
+               449098B90F8F82DF0076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
                4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
                4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; };
                51079D140CED11B00077247D /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; };
                        children = (
                                1C904FD50BA9DD0F0081E9D0 /* Base.xcconfig */,
                                1C904FD40BA9DD0F0081E9D0 /* DebugRelease.xcconfig */,
+                               449098B90F8F82DF0076A327 /* FeatureDefines.xcconfig */,
                                1C904FD30BA9DD0F0081E9D0 /* Version.xcconfig */,
                                1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */,
                        );
index 4e34f04..178a1cf 100644 (file)
@@ -1,3 +1,19 @@
+2009-04-17  David Kilzer  <ddkilzer@apple.com>
+
+        Simplify FEATURE_DEFINES definition
+
+        Reviewed by Darin Adler.
+
+        This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
+        variables to their own FeatureDefines.xcconfig file.  It also
+        extracts a new ENABLE_GEOLOCATION variable so that
+        FEATURE_DEFINES only needs to be defined once.
+
+        * Configurations/FeatureDefines.xcconfig: Added.
+        * Configurations/WebKit.xcconfig: Removed definition of
+        ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES.  Added include
+        of FeatureDefines.xcconfig.
+
 2009-04-17  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
new file mode 100644 (file)
index 0000000..72496c9
--- /dev/null
@@ -0,0 +1,17 @@
+// The contents of this file must be kept in sync with FeatureDefines.xcconfig in JavaScriptCore,
+// WebCore and WebKit.  Also the default values of the ENABLE_FEATURE_NAME macros in build-webkit
+// should match the values below, but they do not need to be in the same order.
+
+// Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
+
+ENABLE_GEOLOCATION = $(ENABLE_GEOLOCATION_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_GEOLOCATION_ = $(ENABLE_GEOLOCATION_1040);
+ENABLE_GEOLOCATION_1040 = ;
+ENABLE_GEOLOCATION_1050 = ;
+ENABLE_GEOLOCATION_1060 = ENABLE_GEOLOCATION;
+
+ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS;
+
+// For now this needs to be kept sorted and in sync with FEATURE_DEFINES in the default settings
+// for build-webkit to prevent needless rebuilding when using both Xcode and build-webkit.
+FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE $(ENABLE_GEOLOCATION) ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE $(ENABLE_SVG_DOM_OBJC_BINDINGS) ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
index 89272b2..3a42e3b 100644 (file)
@@ -1,4 +1,6 @@
+#include "FeatureDefines.xcconfig"
 #include "Version.xcconfig"
+
 EXPORTED_SYMBOLS_FILE = $(EXPORTED_SYMBOLS_FILE_$(CURRENT_ARCH));
 EXPORTED_SYMBOLS_FILE_ = mac/WebKit.exp;
 EXPORTED_SYMBOLS_FILE_i386 = mac/WebKit.exp;
@@ -22,15 +24,3 @@ WEBCORE_PRIVATE_HEADERS_DIR_macosx_Release = $(WEBCORE_PRIVATE_HEADERS_engineeri
 WEBCORE_PRIVATE_HEADERS_DIR_macosx_Debug = $(WEBCORE_PRIVATE_HEADERS_engineering);
 WEBCORE_PRIVATE_HEADERS_DIR_macosx_Production = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
 WEBCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/WebCore.framework/PrivateHeaders;
-
-// Set to an empty string to disable this feature
-ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS;
-
-// This needs to be kept sorted, and in sync with FEATURE_DEFINES in JavaScriptCore.xcconfig, WebCore.xcconfig and
-// the default settings of build-webkit to prevent needless rebuilding when using both Xcode and build-webkit.
-FEATURE_DEFINES = $(FEATURE_DEFINES_$(MAC_OS_X_VERSION_MAJOR));
-FEATURE_DEFINES_BASE = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE $(ENABLE_SVG_DOM_OBJC_BINDINGS) ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT;
-FEATURE_DEFINES_ = $(FEATURE_DEFINES_1040);
-FEATURE_DEFINES_1040 = $(FEATURE_DEFINES_BASE);
-FEATURE_DEFINES_1050 = $(FEATURE_DEFINES_BASE);
-FEATURE_DEFINES_1060 = $(FEATURE_DEFINES_BASE) ENABLE_GEOLOCATION;
index bc3ee38..d35a381 100644 (file)
@@ -1,3 +1,18 @@
+2009-04-17  David Kilzer  <ddkilzer@apple.com>
+
+        Simplify FEATURE_DEFINES definition
+
+        Reviewed by Darin Adler.
+
+        This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
+        variables to their own FeatureDefines.xcconfig file.  It also
+        extracts a new ENABLE_GEOLOCATION variable so that
+        FEATURE_DEFINES only needs to be defined once.
+
+        * Scripts/build-webkit: Realphabetized code related to enabling
+        Geolation features for WebKit.  Also set ENABLE_GEOLOCATION
+        variable for xcodebuild.
+
 2009-04-16  Darin Fisher  <darin@chromium.org>
 
         Reviewed by Darin Adler.
index fef3056..c61aff2 100755 (executable)
@@ -42,6 +42,7 @@ my $originalWorkingDirectory = getcwd();
 my $channelMessagingSupport = 0;
 my $databaseSupport = 1;
 my $domStorageSupport = 1;
+my $geolocationSupport = (isAppleMacWebKit() && !isTiger() && !isLeopard());
 my $gnomeKeyringSupport = 0;
 my $iconDatabaseSupport = 1;
 my $offlineWebApplicationSupport = 1;
@@ -59,7 +60,6 @@ my $wmlSupport = 0;
 my $coverageSupport = 0;
 my $videoSupport = (isAppleWebKit() || isGtk()); # Enable by default for Apple's builds and Gtk+
 my $workersSupport = (isAppleWebKit() || isGtk()); # Enable by default for Apple's builds (mac/win) and Gtk+
-my $geolocationSupport = (isAppleMacWebKit() && !isTiger() && !isLeopard());
 my $showHelp = 0;
 my $clean = 0;
 my $threeDRenderingSupport = 0;
@@ -77,6 +77,7 @@ Usage: $programName [options] [options to pass to build system]
   --[no-]offline-web-applications   Toggle Offline Web Application Support (default : $offlineWebApplicationSupport)
   --[no-]database               Toggle Database Support (default: $databaseSupport)
   --[no-]dom-storage            Toggle DOM Storage Support (default: $domStorageSupport)
+  --[no-]geolocation            Toggle Geolocation support (default: $geolocationSupport)
   --[no-]gnomekeyring           Toggle GNOME Keyring Support (GTK+ port only) (default: $gnomeKeyringSupport)
   --[no-]icon-database          Toggle Icon database support (default: $iconDatabaseSupport)
   --[no-]svg                    Toggle SVG support (default: $svgSupport)
@@ -92,7 +93,6 @@ Usage: $programName [options] [options to pass to build system]
   --[no-]wml                    Toggle WML support (default: $wmlSupport)
   --[no-]video                  Toggle Video support (default: $videoSupport)
   --[no-]workers                Toggle Web Workers support (default: $workersSupport)
-  --[no-]geolocation            Toggle Geolocation support (default: $geolocationSupport)
   --[no-]coverage               Toggle code coverage support (default: $coverageSupport)
 EOF
 
@@ -101,6 +101,7 @@ GetOptions(
            'channel-messaging!' => \$channelMessagingSupport,
            'database!' => \$databaseSupport,
            'dom-storage!' => \$domStorageSupport,
+           'geolocation!' => \$geolocationSupport,
            'gnomekeyring!' => \$gnomeKeyringSupport,
            'icon-database!' => \$iconDatabaseSupport,
            'offline-web-applications!' => \$offlineWebApplicationSupport,
@@ -117,10 +118,10 @@ GetOptions(
            'wml!' => \$wmlSupport,
            'video!' => \$videoSupport,
            'workers!' => \$workersSupport,
-           'geolocation!' => \$geolocationSupport,
            'coverage!' => \$coverageSupport,
            'help' => \$showHelp,
-           'clean' => \$clean);
+           'clean' => \$clean,
+);
 
 if ($showHelp) {
    print STDERR $usage;
@@ -147,13 +148,14 @@ if (isWx()) {
 my $productDir = productDir();
 my @overrideFeatureDefinesOption = ();
 
-# This needs to be kept sorted, and in sync with FEATURE_DEFINES in JavaScriptCore.xcconfig, WebCore.xcconfig
-# and WebKit.xcconfig to prevent needless rebuilding when using both Xcode and build-webkit.
+# For now this needs to be kept sorted and in sync with FEATURE_DEFINES in FeatureDefines.xcconfig in
+# JavaScriptCore, WebCore and WebKit to prevent needless rebuilding when using both Xcode and build-webkit.
 
 push @overrideFeatureDefinesOption, "ENABLE_3D_RENDERING" if $threeDRenderingSupport;
 push @overrideFeatureDefinesOption, "ENABLE_CHANNEL_MESSAGING" if $channelMessagingSupport;
 push @overrideFeatureDefinesOption, "ENABLE_DATABASE" if $databaseSupport;
 push @overrideFeatureDefinesOption, "ENABLE_DOM_STORAGE" if $domStorageSupport;
+push @overrideFeatureDefinesOption, "ENABLE_GEOLOCATION" if $geolocationSupport;
 push @overrideFeatureDefinesOption, "ENABLE_ICONDATABASE" if $iconDatabaseSupport;
 push @overrideFeatureDefinesOption, "ENABLE_OFFLINE_WEB_APPLICATIONS" if $offlineWebApplicationSupport;
 push @overrideFeatureDefinesOption, "ENABLE_SVG" if $svgSupport;
@@ -169,7 +171,6 @@ push @overrideFeatureDefinesOption, "ENABLE_WORKERS" if $workersSupport;
 push @overrideFeatureDefinesOption, "ENABLE_XPATH" if $xpathSupport;
 push @overrideFeatureDefinesOption, "ENABLE_XSLT" if $xsltSupport;
 push @overrideFeatureDefinesOption, "ENABLE_WML" if $wmlSupport;
-push @overrideFeatureDefinesOption, "ENABLE_GEOLOCATION" if $geolocationSupport;
 my $overrideFeatureDefinesString = "FEATURE_DEFINES=" . join(" ", @overrideFeatureDefinesOption);
 
 my @coverageSupportOption = ($coverageSupport) ? XcodeCoverageSupportOptions() : ();
@@ -284,6 +285,7 @@ for my $dir (@projects) {
     } elsif (isAppleMacWebKit()) {
         my @xcodeOptions = ();
         push(@xcodeOptions, @options);
+        push(@xcodeOptions, "ENABLE_GEOLOCATION=" . ($geolocationSupport ? "ENABLE_GEOLOCATION" : ""));
         push(@xcodeOptions, "ENABLE_SVG_DOM_OBJC_BINDINGS=" . ($svgDOMObjCBindingsSupport ? "ENABLE_SVG_DOM_OBJC_BINDINGS" : ""));
         push(@xcodeOptions, $overrideFeatureDefinesString);
         push(@xcodeOptions, @coverageSupportOption);