[Mac] Pass sandbox profiles through preprocessor
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2012 23:49:12 +0000 (23:49 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2012 23:49:12 +0000 (23:49 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=80651

        Reviewed by Mark Rowe.

        * DerivedSources.make: Preprocess sandbox profiles.

        * PluginProcess/mac/com.apple.WebKit.PluginProcess.sb: Removed.
        * PluginProcess/mac/com.apple.WebKit.PluginProcess.sb.in: Copied from Source/WebKit2/PluginProcess/mac/com.apple.WebKit.PluginProcess.sb.
        * WebProcess/com.apple.WebProcess.sb: Removed.
        * WebProcess/com.apple.WebProcess.sb.in: Copied from Source/WebKit2/WebProcess/com.apple.WebProcess.sb.
        Renamed to avoid make finding the wrong original in default paths.

        * WebKit2.xcodeproj/project.pbxproj: Copy preprocessed files to Resources, not originals.
        Also, changed DerivedSources target to use BaseTarget.xcconfig to have correct include paths.

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

Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/PluginProcess/mac/com.apple.WebKit.PluginProcess.sb.in [moved from Source/WebKit2/PluginProcess/mac/com.apple.WebKit.PluginProcess.sb with 100% similarity]
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in [moved from Source/WebKit2/WebProcess/com.apple.WebProcess.sb with 100% similarity]

index c177150..c9f02bf 100644 (file)
@@ -1,3 +1,21 @@
+2012-03-09  Alexey Proskuryakov  <ap@apple.com>
+
+        [Mac] Pass sandbox profiles through preprocessor
+        https://bugs.webkit.org/show_bug.cgi?id=80651
+
+        Reviewed by Mark Rowe.
+
+        * DerivedSources.make: Preprocess sandbox profiles.
+
+        * PluginProcess/mac/com.apple.WebKit.PluginProcess.sb: Removed.
+        * PluginProcess/mac/com.apple.WebKit.PluginProcess.sb.in: Copied from Source/WebKit2/PluginProcess/mac/com.apple.WebKit.PluginProcess.sb.
+        * WebProcess/com.apple.WebProcess.sb: Removed.
+        * WebProcess/com.apple.WebProcess.sb.in: Copied from Source/WebKit2/WebProcess/com.apple.WebProcess.sb.
+        Renamed to avoid make finding the wrong original in default paths.
+
+        * WebKit2.xcodeproj/project.pbxproj: Copy preprocessed files to Resources, not originals.
+        Also, changed DerivedSources target to use BaseTarget.xcconfig to have correct include paths.
+
 2012-03-09  Jon Lee  <jonlee@apple.com>
 
         Add support for ENABLE(LEGACY_NOTIFICATIONS)
index abe2621..f1101fb 100644 (file)
@@ -23,6 +23,7 @@
 VPATH = \
     $(WebKit2) \
     $(WebKit2)/PluginProcess \
+    $(WebKit2)/PluginProcess/mac \
     $(WebKit2)/Shared/Plugins \
     $(WebKit2)/WebProcess/ApplicationCache \
     $(WebKit2)/WebProcess/Authentication \
@@ -110,6 +111,25 @@ all : \
        @echo Generating message receiver for $*...
        @python $(WebKit2)/Scripts/generate-messages-header.py $< > $@
 
+# Mac-specific rules
+
+ifeq ($(OS),MACOS)
+
+FRAMEWORK_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(FRAMEWORK_SEARCH_PATHS) | perl -e 'print "-F " . join(" -F ", split(" ", <>));')
+HEADER_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(HEADER_SEARCH_PATHS) | perl -e 'print "-I" . join(" -I", split(" ", <>));')
+
+SANDBOX_PROFILES = \
+       com.apple.WebProcess.sb \
+       com.apple.WebKit.PluginProcess.sb
+
+all: $(SANDBOX_PROFILES)
+
+%.sb : %.sb.in
+       @echo Pre-processing $* sandbox profile...
+       $(CC) -E -P -w -x c -std=c89 $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" $< > $@
+
+endif # MACOS
+
 # ------------------------
 
 # Windows-specific rules
index be661b2..7c94bee 100644 (file)
                6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; };
                659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; };
                65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */; };
                6EE849C81368D9390038D481 /* WKInspectorPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7801C099142290C400FAF9AF /* WebHitTestResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7801C095142290C400FAF9AF /* WebHitTestResult.cpp */; };
                E179FD9F134D38250015B883 /* ArgumentCodersMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E179FD9E134D38250015B883 /* ArgumentCodersMac.mm */; };
                E17BF99614D0A73E00A5A069 /* NetscapeSandboxFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E17BF99514D0A73E00A5A069 /* NetscapeSandboxFunctions.h */; };
                E17BF99814D0AA8300A5A069 /* NetscapeSandboxFunctions.mm in Sources */ = {isa = PBXBuildFile; fileRef = E17BF99714D0AA8300A5A069 /* NetscapeSandboxFunctions.mm */; };
-               E17BF99A14D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = E17BF99914D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb */; };
                E18C92F412DB9E7100CF2AEB /* PrintInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */; };
+               E1967E36150AB5D500C73169 /* com.apple.WebKit.PluginProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = E1967E35150AB5D500C73169 /* com.apple.WebKit.PluginProcess.sb */; };
+               E1967E38150AB5E200C73169 /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = E1967E37150AB5E200C73169 /* com.apple.WebProcess.sb */; };
                E199875E142C045400BB2DE7 /* BuiltInPDFView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E199875C142BFC9700BB2DE7 /* BuiltInPDFView.cpp */; };
                E1A31732134CEA6C007C9A4F /* AttributedString.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A31731134CEA6C007C9A4F /* AttributedString.h */; };
                E1A31735134CEA80007C9A4F /* AttributedString.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1A31734134CEA80007C9A4F /* AttributedString.mm */; };
                6546A82A13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; };
                65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleInspector.cpp; sourceTree = "<group>"; };
                65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleInspector.h; sourceTree = "<group>"; };
-               6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb; path = WebProcess/com.apple.WebProcess.sb; sourceTree = "<group>"; };
+               6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; name = com.apple.WebProcess.sb.in; path = WebProcess/com.apple.WebProcess.sb.in; sourceTree = "<group>"; };
                6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKInspectorPrivateMac.h; path = mac/WKInspectorPrivateMac.h; sourceTree = "<group>"; };
                762B7481120BBA0100819339 /* FontSmoothingLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingLevel.h; sourceTree = "<group>"; };
                762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = "<group>"; };
                E179FD9E134D38250015B883 /* ArgumentCodersMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ArgumentCodersMac.mm; sourceTree = "<group>"; };
                E17BF99514D0A73E00A5A069 /* NetscapeSandboxFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapeSandboxFunctions.h; sourceTree = "<group>"; };
                E17BF99714D0AA8300A5A069 /* NetscapeSandboxFunctions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapeSandboxFunctions.mm; sourceTree = "<group>"; };
-               E17BF99914D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebKit.PluginProcess.sb; sourceTree = "<group>"; };
+               E17BF99914D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; path = com.apple.WebKit.PluginProcess.sb.in; sourceTree = "<group>"; };
                E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintInfo.cpp; sourceTree = "<group>"; };
+               E1967E35150AB5D500C73169 /* com.apple.WebKit.PluginProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebKit.PluginProcess.sb; sourceTree = "<group>"; };
+               E1967E37150AB5E200C73169 /* com.apple.WebProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebProcess.sb; sourceTree = "<group>"; };
                E199875A142BF9B800BB2DE7 /* BuiltInPDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BuiltInPDFView.h; path = PDF/BuiltInPDFView.h; sourceTree = "<group>"; };
                E199875C142BFC9700BB2DE7 /* BuiltInPDFView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BuiltInPDFView.cpp; path = PDF/BuiltInPDFView.cpp; sourceTree = "<group>"; };
                E1A31731134CEA6C007C9A4F /* AttributedString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttributedString.h; sourceTree = "<group>"; };
                                BC122FA51327085D00F7EAC1 /* PluginProcess */,
                                BC8A500E11765AD400757573 /* WebKit2 */,
                                BC8A500F11765AE300757573 /* WebProcess */,
-                               6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */,
+                               6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */,
                                089C1666FE841158C02AAC07 /* InfoPlist.strings */,
                        );
                        name = Resources;
                                1A0EC802124BD41E007EF4A5 /* PluginProcessMainMac.mm */,
                                1AC25F8912A48E0300BD2671 /* PluginProcessShim.h */,
                                1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */,
-                               E17BF99914D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb */,
+                               E17BF99914D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb.in */,
                                E14E99F914D879C9001D221F /* add-entitlements.sh */,
                        );
                        path = mac;
                                33367652130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h */,
                                33367653130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp */,
                                33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */,
+                               E1967E35150AB5D500C73169 /* com.apple.WebKit.PluginProcess.sb */,
+                               E1967E37150AB5E200C73169 /* com.apple.WebProcess.sb */,
                        );
                        name = "Derived Sources";
                        path = DerivedSources/WebKit2;
                        isa = PBXResourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */,
                                1AA575FE1496B6F300A4EE06 /* EventDispatcher.messages.in in Resources */,
                                E133FD8A1423DD7F00FC7BFB /* WebKit.icns in Resources */,
+                               E1967E38150AB5E200C73169 /* com.apple.WebProcess.sb in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        isa = PBXResourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               E17BF99A14D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb in Resources */,
+                               E1967E36150AB5D500C73169 /* com.apple.WebKit.PluginProcess.sb in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                };
                C0CE72861247E66800BC0EC4 /* Debug */ = {
                        isa = XCBuildConfiguration;
+                       baseConfigurationReference = 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */;
                        buildSettings = {
                                COPY_PHASE_STRIP = NO;
                                GCC_DYNAMIC_NO_PIC = NO;
                };
                C0CE72871247E66800BC0EC4 /* Release */ = {
                        isa = XCBuildConfiguration;
+                       baseConfigurationReference = 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */;
                        buildSettings = {
                                COPY_PHASE_STRIP = YES;
                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
                };
                C0CE72881247E66800BC0EC4 /* Production */ = {
                        isa = XCBuildConfiguration;
+                       baseConfigurationReference = 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */;
                        buildSettings = {
                                PRODUCT_NAME = "Derived Sources";
                        };