Install build failure when using SYSTEM_CONTENT_PATH
https://bugs.webkit.org/show_bug.cgi?id=235609

Reviewed by Filip Pizlo.

Source/ThirdParty/libwebrtc:

Change the Create Symlinks to Alternate Root script to create the links for the headers
for both the install headers and install phases.

* Scripts/create-symlink-to-altroot.sh:

Source/WebKit:

Eliminated the Output Files of the Create Symlink to Alt Root Path script for the targets
adattributiond, GPU, Networking, WebAuthn, webpushd, and the various WebContent targets,
since the symlink to WebKit.framework will be created by the "WebKit" target.
Also fixed the INSTALL_PATH for adattributiond and webpushd to follow the difference between
macOS and iOS.

* Configurations/adattributiond.xcconfig:
* Configurations/webpushd.xcconfig:
* WebKit.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@288593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog
index 627bce1..2e5a7f7 100644
--- a/Source/ThirdParty/libwebrtc/ChangeLog
+++ b/Source/ThirdParty/libwebrtc/ChangeLog
@@ -1,3 +1,15 @@
+2022-01-25  Michael Saboff  <msaboff@apple.com>
+
+        Install build failure when using SYSTEM_CONTENT_PATH
+        https://bugs.webkit.org/show_bug.cgi?id=235609
+
+        Reviewed by Filip Pizlo.
+
+        Change the Create Symlinks to Alternate Root script to create the links for the headers
+        for both the install headers and install phases.
+
+        * Scripts/create-symlink-to-altroot.sh:
+
 2022-01-24  Youenn Fablet  <youenn@apple.com>
 
         Cherry-pick WebRTC 235826 change
diff --git a/Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh b/Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh
index 5b7a891..d10239a 100755
--- a/Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh
+++ b/Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh
@@ -2,18 +2,14 @@
 
 set -e
 
-if [[ "${ACTION}" == "installhdrs" && ( -z "${SYSTEM_PUBLIC_HEADER_PREFIX}" || -z "${HEADER_FOLDER_LIST}" ) ]]; then
-    exit 0
-fi
-
-if [[ "${ACTION}" == "install" && ( -z "${SYSTEM_PUBLIC_LIBRARY_PREFIX}" || -z "${LIBRARY_LIST}" ) ]]; then
-    exit 0
-fi
-
 if [[ "${SKIP_INSTALL}" == "YES" ]]; then
     exit 0
 fi
 
+if [[ -z "${SYSTEM_PUBLIC_HEADER_PREFIX}" || -z "${HEADER_FOLDER_LIST}" || -z "${SYSTEM_PUBLIC_LIBRARY_PREFIX}" || -z "${LIBRARY_LIST}" ]]; then
+    exit 0
+fi
+
 create_symlink_if_needed()
 {
     INSTALL_FOLDER_PREFIX=$1
@@ -43,7 +39,7 @@
     ln -sf "${SYMLINK_VALUE}" "${SYSTEM_HEADER_PATH}"
 }
 
-if [[ "${ACTION}" == "installhdrs" ]]
+if [[ "${ACTION}" == "installhdrs" || "${ACTION}" == "install" ]]
 then
     if [[ ! -d ${SYSTEM_PUBLIC_HEADER_PREFIX} ]]; then
         mkdir -p ${SYSTEM_PUBLIC_HEADER_PREFIX}
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 39e645a..9dd8567 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2022-01-25  Michael Saboff  <msaboff@apple.com>
+
+        Install build failure when using SYSTEM_CONTENT_PATH
+        https://bugs.webkit.org/show_bug.cgi?id=235609
+
+        Reviewed by Filip Pizlo.
+
+        Eliminated the Output Files of the Create Symlink to Alt Root Path script for the targets
+        adattributiond, GPU, Networking, WebAuthn, webpushd, and the various WebContent targets,
+        since the symlink to WebKit.framework will be created by the "WebKit" target.
+        Also fixed the INSTALL_PATH for adattributiond and webpushd to follow the difference between
+        macOS and iOS.
+
+        * Configurations/adattributiond.xcconfig:
+        * Configurations/webpushd.xcconfig:
+        * WebKit.xcodeproj/project.pbxproj:
+
 2022-01-25  Per Arne Vollan  <pvollan@apple.com>
  
          [macOS][WP] Allow mach extension to service
diff --git a/Source/WebKit/Configurations/adattributiond.xcconfig b/Source/WebKit/Configurations/adattributiond.xcconfig
index 2f8fe5c..4f83553 100644
--- a/Source/WebKit/Configurations/adattributiond.xcconfig
+++ b/Source/WebKit/Configurations/adattributiond.xcconfig
@@ -37,7 +37,7 @@
 INSTALL_PATH[sdk=iphone*] = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Daemons;
 INSTALL_PATH[sdk=macosx*] = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/Daemons;
 
-ALTERNATE_ROOT_PATH = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Daemons;
+ALTERNATE_ROOT_PATH = $(INSTALL_PATH);
 
 OUTPUT_ALTERNATE_ROOT_PATH = $(OUTPUT_ALTERNATE_ROOT_PATH_$(USE_SYSTEM_CONTENT_PATH));
 OUTPUT_ALTERNATE_ROOT_PATH_YES = $(DSTROOT)$(ALTERNATE_ROOT_PATH)/$(FULL_PRODUCT_NAME);
diff --git a/Source/WebKit/Configurations/webpushd.xcconfig b/Source/WebKit/Configurations/webpushd.xcconfig
index dea6f52..d1b7933 100644
--- a/Source/WebKit/Configurations/webpushd.xcconfig
+++ b/Source/WebKit/Configurations/webpushd.xcconfig
@@ -44,7 +44,7 @@
 INSTALL_PATH[sdk=iphone*] = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Daemons;
 INSTALL_PATH[sdk=macosx*] = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/Daemons;
 
-ALTERNATE_ROOT_PATH = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Daemons;
+ALTERNATE_ROOT_PATH = $(INSTALL_PATH);
 
 OUTPUT_ALTERNATE_ROOT_PATH = $(OUTPUT_ALTERNATE_ROOT_PATH_$(USE_SYSTEM_CONTENT_PATH));
 OUTPUT_ALTERNATE_ROOT_PATH_YES = $(DSTROOT)$(ALTERNATE_ROOT_PATH)/$(FULL_PRODUCT_NAME);
diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
index a115c88..716c6a6 100644
--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -14954,7 +14954,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -14973,7 +14972,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -14992,7 +14990,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -15011,7 +15008,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -15030,7 +15026,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -15049,7 +15044,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -15068,7 +15062,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -15087,7 +15080,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -15106,7 +15098,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;
@@ -15125,7 +15116,6 @@
 			outputFileListPaths = (
 			);
 			outputPaths = (
-				"${OUTPUT_ALTERNATE_ROOT_PATH}",
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 			shellPath = /bin/zsh;