haikuwebkit/Tools/ccache/ccache-clang

38 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

Replace hard-coded paths in shebangs with #!/usr/bin/env https://bugs.webkit.org/show_bug.cgi?id=181040 Patch by Ting-Wei Lan <lantw44@gmail.com> on 2018-01-03 Reviewed by Alex Christensen. .: * Source/cmake/tools/scripts/auto-version.pl: * Source/cmake/tools/scripts/feature-defines.pl: * Source/cmake/tools/scripts/version-stamp.pl: Source/JavaScriptCore: * Scripts/UpdateContents.py: * Scripts/cssmin.py: * Scripts/generate-combined-inspector-json.py: * Scripts/xxd.pl: * create_hash_table: * generate-bytecode-files: * wasm/generateWasm.py: * wasm/generateWasmOpsHeader.py: * yarr/generateYarrCanonicalizeUnicode: Source/WebCore: * bindings/scripts/InFilesCompiler.pm: * bindings/scripts/InFilesParser.pm: * bindings/scripts/generate-bindings-all.pl: * bindings/scripts/generate-bindings.pl: * bindings/scripts/preprocess-idls.pl: * css/make-css-file-arrays.pl: * css/makeprop.pl: * css/makevalues.pl: * dom/make_event_factory.pl: * dom/make_names.pl: * extract-localizable-strings.pl: * make-hash-tools.pl: Source/WebCore/PAL: * AVFoundationSupport.py: Source/WebInspectorUI: * Scripts/combine-resources.pl: * Scripts/copy-user-interface-resources-dryrun.rb: * Scripts/copy-user-interface-resources.pl: * Scripts/fix-worker-imports-for-optimized-builds.pl: * Scripts/remove-console-asserts-dryrun.rb: * Scripts/remove-console-asserts.pl: * Scripts/update-LegacyInspectorBackendCommands.rb: * Scripts/update-codemirror-resources.rb: * WebInspectorUI.vcxproj/build-webinspectorui.pl: Source/WebKit: * Scripts/generate-forwarding-headers.pl: Source/WebKitLegacy: * scripts/generate-webkitversion.pl: Tools: * BuildSlaveSupport/build-launcher-app: * BuildSlaveSupport/build-launcher-dmg: * BuildSlaveSupport/build.webkit.org-config/steps_unittest.py: * BuildSlaveSupport/built-product-archive: * BuildSlaveSupport/clean-build: * BuildSlaveSupport/delete-stale-build-files: * BuildSlaveSupport/download-built-product: * BuildSlaveSupport/gtk/buildbot/log/run: * BuildSlaveSupport/gtk/buildbot/run: * BuildSlaveSupport/gtk/pulseaudio/run: * BuildSlaveSupport/kill-old-processes: * BuildSlaveSupport/test-result-archive: * BuildSlaveSupport/win/kill-old-processes: * Scripts/SpacingHeuristics.pm: * Scripts/add-include: * Scripts/build-api-tests: * Scripts/build-dumprendertree: * Scripts/build-imagediff: * Scripts/build-jsc: * Scripts/build-webkit: * Scripts/build-webkittestrunner: * Scripts/check-Xcode-source-file-types: * Scripts/check-dom-results: * Scripts/check-for-exit-time-destructors: * Scripts/check-for-global-initializers: * Scripts/check-for-inappropriate-objc-class-names: * Scripts/check-for-weak-vtables-and-externals: * Scripts/clean-header-guards: * Scripts/compare-timing-files: * Scripts/configure-xcode-for-ios-development: * Scripts/copy-webkitlibraries-to-product-directory: * Scripts/create-exports: * Scripts/debug-minibrowser: * Scripts/debug-safari: * Scripts/debug-test-runner: * Scripts/do-file-rename: * Scripts/do-webcore-rename: * Scripts/dump-webkit-tests-run: * Scripts/ensure-valid-python: * Scripts/execAppWithEnv: * Scripts/extract-localizable-js-strings: * Scripts/filter-build-webkit: * Scripts/find-extra-includes: * Scripts/fix-blink-patch: * Scripts/generate-coverage-data: * Scripts/git-add-reviewer: * Scripts/jsc-stress-test-helpers/js-exception-fuzz: * Scripts/jsc-stress-test-helpers/js-executable-allocation-fuzz: * Scripts/jsc-stress-test-helpers/js-osr-exit-fuzz: * Scripts/make-new-script-test: * Scripts/make-script-test-wrappers: * Scripts/package-root: * Scripts/parse-malloc-history: * Scripts/report-include-statistics: * Scripts/resolve-ChangeLogs: * Scripts/run-api-tests: * Scripts/run-bindings-tests: * Scripts/run-content-extension-tester: * Scripts/run-iexploder-tests: * Scripts/run-javascriptcore-tests: * Scripts/run-jsc: * Scripts/run-leaks: * Scripts/run-mangleme-tests: * Scripts/run-minibrowser: * Scripts/run-pageloadtest: * Scripts/run-regexp-tests: * Scripts/run-safari: * Scripts/run-sunspider: * Scripts/run-test-runner: * Scripts/run-webkit-app: * Scripts/run-webkit-httpd: * Scripts/run-webkit-websocketserver: * Scripts/set-webkit-configuration: * Scripts/show-pretty-diff: * Scripts/sort-Xcode-project-file: * Scripts/split-file-by-class: * Scripts/sunspider-compare-results: * Scripts/svn-apply: * Scripts/svn-unapply: * Scripts/test-webkit-scripts: * Scripts/test-webkitperl: * Scripts/update-iexploder-cssproperties: * Scripts/update-javascriptcore-test-results: * Scripts/update-webkit: * Scripts/update-webkit-auxiliary-libs: * Scripts/update-webkit-dependency: * Scripts/update-webkit-libs-jhbuild: * Scripts/update-webkit-localizable-strings: * Scripts/update-webkit-support-libs: * Scripts/update-webkitgtk-libs: * Scripts/update-webkitwpe-libs: * Scripts/webkit-build-directory: * Scripts/webkitperl/LoadAsModule.pm: * Scripts/webkitperl/VCSUtils_unittest/decodeGitBinaryPatch.pl: * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl: * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatchThenSetChangeLogDateAndReviewer.pl: * Scripts/webkitperl/VCSUtils_unittest/fixSVNPatchForAdditionWithHistory.pl: * Scripts/webkitperl/VCSUtils_unittest/generatePatchCommand.pl: * Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl: * Scripts/webkitperl/VCSUtils_unittest/parseChunkRange.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiffWithMockFiles.pl: * Scripts/webkitperl/VCSUtils_unittest/parseFirstEOL.pl: * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl: * Scripts/webkitperl/VCSUtils_unittest/parseUnifiedDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/prepareParsedPatch.pl: * Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl: * Scripts/webkitperl/VCSUtils_unittest/runCommand.pl: * Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl: * Scripts/webkitperl/VCSUtils_unittest/setChangeLogDateAndReviewer.pl: * Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: * Scripts/webkitperl/auto-version_unittest/versionStampTests.pl: * Scripts/webkitperl/filter-build-webkit_unittest/shouldIgnoreLine_unittests.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/extractLineRangeBeforeAndAfterChange.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/fetchRadarURLFromBugXMLData.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl: * Scripts/webkitperl/run-leaks_unittest/run-leaks-report-v1.0.pl: * Scripts/webkitperl/run-leaks_unittest/run-leaks-report-v2.0-new.pl: * Scripts/webkitperl/run-leaks_unittest/run-leaks-report-v2.0-old.pl: * Scripts/webkitperl/webkitdirs_unittest/appendToEnvironmentVariableList.pl: * Scripts/webkitperl/webkitdirs_unittest/checkForArgumentAndRemoveFromArrayRef.pl: * Scripts/webkitperl/webkitdirs_unittest/checkForArgumentAndRemoveFromArrayRefGettingValue.pl: * Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl: * Scripts/webkitperl/webkitdirs_unittest/prependToEnvironmentVariableList.pl: * Scripts/webkitpy/layout_tests/servers/run_webkit_httpd.py: * ccache/ccache-clang: * ccache/ccache-clang++: * ccache/ccache-wrapper: * gtk/install-dependencies: * iExploder/iexploder-1.3.2/htdocs/iexploder.cgi: * iExploder/iexploder-1.3.2/htdocs/webserver.rb: * iExploder/iexploder-1.3.2/tools/lasthit.rb: * iExploder/iexploder-1.3.2/tools/osx_last_crash.rb: * iExploder/iexploder-1.3.2/tools/showtest.rb: * iExploder/iexploder-1.7.2/src/browser_harness.rb: * iExploder/iexploder-1.7.2/src/iexploder.cgi: * iExploder/iexploder-1.7.2/src/webserver.rb: * iExploder/iexploder-1.7.2/tools/lasthit.rb: * iExploder/iexploder-1.7.2/tools/osx_last_crash.rb: * wpe/install-dependencies: Canonical link: https://commits.webkit.org/197118@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-04 07:18:18 +00:00
#!/usr/bin/env bash
[Xcode] Add an experimental setting to build with ccache https://bugs.webkit.org/show_bug.cgi?id=173875 Reviewed by Tim Horton. Source/bmalloc: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/WebCore: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/WebKit/mac: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/WebKit2: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Source/WTF: * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. Tools: On systems that already have ccache(1) installed, this patch adds experimental support for it to Xcode builds. It can be enabled with the WK_USE_CCACHE build setting. When ccache is enabled, CC is overridden to invoke Tools/ccache/ccache-clang. This script finds the "-isysroot" argument to determine the active SDK, uses xcrun(1) and the SDK to find the toolchain from which to run clang, and then invokes ccache with the required arguments. ccache is invoked with CCACHE_SLOPPINESS="pch_defines,time_macros", which is required for precompiled headers to work properly [1]. LDPLUSPLUS is overridden to invoke Tools/ccache/ccache-clang++. It behaves the same as ccache-clang, except it tells ccache to execute clang++ instead of clang. This is important during linking. [1] https://ccache.samba.org/manual.html#_precompiled_headers * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. * MiniBrowser/Configurations/DebugRelease.xcconfig: Ditto. * MobileMiniBrowser/Configurations/DebugRelease.xcconfig: Ditto. * TestWebKitAPI/Configurations/DebugRelease.xcconfig: Ditto. * WebKitTestRunner/Configurations/DebugRelease.xcconfig: Ditto. * ccache/README.md: Added. * ccache/ccache-clang: Added. * ccache/ccache-clang++: Added. * ccache/ccache.xcconfig: Added. Overrides CC and LDPLUSPLUS when WK_USE_CACHE=YES. Canonical link: https://commits.webkit.org/190934@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-03 18:36:06 +00:00
# Copyright (C) 2017 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
position=1
while [[ $position -le $# ]]; do
case "${!position}" in
-isysroot)
position=$(($position + 1))
sdk="${!position}"
break
;;
esac
position=$(($position + 1))
done
$(dirname "$0")/ccache-wrapper $(xcrun -f -sdk "$sdk" "${_XCRUN_TOOL:-clang}") "$@"