From 1f7d9c3fcc429ea661eca6412d1056185be0dddc Mon Sep 17 00:00:00 2001 From: Ethan P Date: Sun, 4 Oct 2020 00:56:01 -0700 Subject: [PATCH] build.sh: Add option to prevent full executable paths from inlining --- build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.sh b/build.sh index e00d2a1..24bd7be 100755 --- a/build.sh +++ b/build.sh @@ -366,6 +366,7 @@ OPT_COMPRESS=false OPT_VERIFY=true OPT_BANNER=true OPT_MANUALS=false +OPT_INLINE=true OPT_MINIFY="lib" OPT_PREFIX="/usr/local" OPT_BAT="$(basename "$EXECUTABLE_BAT")" @@ -381,6 +382,7 @@ while shiftopt; do --manuals) OPT_MANUALS=true ;; --no-verify) OPT_VERIFY=false ;; --no-banner) OPT_BANNER=false ;; + --no-inline) OPT_INLINE=false ;; --prefix) shiftval; OPT_PREFIX="$OPT_VAL" ;; --alternate-executable) shiftval; OPT_BAT="$OPT_VAL" ;; --minify) shiftval; OPT_MINIFY="$OPT_VAL" ;; @@ -411,6 +413,13 @@ else printc_msg "%{YELLOW}Use %{BLUE}--install%{YELLOW} for a global install.%{CLEAR}\n\n" fi +if [[ "$OPT_INLINE" = false ]]; then + # Prevent full executable paths from being inlined. + while read -r exec; do + declare "$exec=$(basename "${!exec}")" + done < <(set | grep '^EXECUTABLE' | cut -d'=' -f1) +fi + # ----------------------------------------------------------------------------- # Check for resources.