Merge pull request #151573 from ncfavier/make-binary-wrapper/mkdir

This commit is contained in:
Doron Behar 2021-12-21 20:37:06 +02:00 committed by GitHub
commit 203bc068e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,13 +33,20 @@ assertExecutable() {
# To troubleshoot a binary wrapper after you compiled it,
# use the `strings` command or open the binary file in a text editor.
makeWrapper() {
assertExecutable "$1"
makeDocumentedCWrapper "$1" "${@:3}" | \
local original="$1"
local wrapper="$2"
shift 2
assertExecutable "$original"
mkdir -p "$(dirname "$wrapper")"
makeDocumentedCWrapper "$original" "$@" | \
@CC@ \
-Wall -Werror -Wpedantic \
-Os \
-x c \
-o "$2" -
-o "$wrapper" -
}
# Syntax: wrapProgram <PROGRAM> <MAKE-WRAPPER FLAGS...>