1 From 42fe4864a0c8e2846007ffee532fe0cf4b321cdd Mon Sep 17 00:00:00 2001
2 From: Allan McRae <allan@archlinux.org>
3 Date: Sun, 9 Jan 2022 12:45:58 +1000
4 Subject: [PATCH] libmakepkg: add extra buildflags only when buildflags is not
7 This means options=('!buildflags') will disable the addition of CFLAG
8 etc for LTO and debug building.
10 Signed-off-by: Allan McRae <allan@archlinux.org>
12 scripts/libmakepkg/buildenv/debugflags.sh.in | 2 +-
13 scripts/libmakepkg/buildenv/lto.sh.in | 2 +-
14 2 files changed, 2 insertions(+), 2 deletions(-)
16 diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in
17 index 84ca7b71..1cb58613 100644
18 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in
19 +++ b/scripts/libmakepkg/buildenv/debugflags.sh.in
20 @@ -29,7 +29,7 @@ source "$LIBRARY/util/option.sh"
21 buildenv_functions+=('buildenv_debugflags')
23 buildenv_debugflags() {
24 - if check_option "debug" "y"; then
25 + if check_option "debug" "y" && ! check_option "buildflags" "n"; then
26 DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
27 DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
28 DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
29 diff --git a/scripts/libmakepkg/buildenv/lto.sh.in b/scripts/libmakepkg/buildenv/lto.sh.in
30 index 081d5648..6e500eab 100644
31 --- a/scripts/libmakepkg/buildenv/lto.sh.in
32 +++ b/scripts/libmakepkg/buildenv/lto.sh.in
33 @@ -30,7 +30,7 @@ build_options+=('lto')
34 buildenv_functions+=('buildenv_lto')
37 - if check_option "lto" "y"; then
38 + if check_option "lto" "y" && ! check_option "buildflags" "n"; then