Split exported build variables into buildenv_vars_exported.

This commit is contained in:
loqs 2024-01-16 22:29:14 +00:00
parent e41d018398
commit 3d7fb3213f
No known key found for this signature in database
3 changed files with 8 additions and 7 deletions

View file

@ -3,7 +3,7 @@
# buildenv.sh - functions for altering the build environment before # buildenv.sh - functions for altering the build environment before
# compilation # compilation
# #
# Copyright (c) 2015-2022 Pacman Development Team <pacman-dev@lists.archlinux.org> # Copyright (c) 2015-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -24,8 +24,8 @@ LIBMAKEPKG_BUILDENV_SH=1
MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
declare -a buildenv_functions build_options declare -a buildenv_functions buildenv_vars build_options
buildenv_vars=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST') buildenv_vars_exported=('CPPFLAGS' 'CFLAGS' 'CXXFLAGS' 'LDFLAGS' 'MAKEFLAGS' 'CHOST')
for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do for lib in "$MAKEPKG_LIBRARY/buildenv/"*.sh; do
source "$lib" source "$lib"
@ -55,5 +55,5 @@ prepare_buildenv() {
done done
# ensure all necessary build variables are exported # ensure all necessary build variables are exported
export ${buildenv_vars[@]} export ${buildenv_vars_exported[@]}
} }

View file

@ -2,7 +2,7 @@
# #
# buildflags.sh - Clear user-specified buildflags if requested # buildflags.sh - Clear user-specified buildflags if requested
# #
# Copyright (c) 2011-2022 Pacman Development Team <pacman-dev@lists.archlinux.org> # Copyright (c) 2011-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -29,6 +29,6 @@ build_options+=('buildflags')
buildenv_buildflags() { buildenv_buildflags() {
if check_option "buildflags" "n"; then if check_option "buildflags" "n"; then
unset ${buildenv_vars[@]} unset ${buildenv_vars_exported[@]}
fi fi
} }

View file

@ -26,7 +26,8 @@ MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'}
source "$MAKEPKG_LIBRARY/util/option.sh" source "$MAKEPKG_LIBRARY/util/option.sh"
source "$MAKEPKG_LIBRARY/util/util.sh" source "$MAKEPKG_LIBRARY/util/util.sh"
buildenv_vars+=('RUSTFLAGS' 'DEBUG_RUSTFLAGS') buildenv_vars+=('DEBUG_RUSTFLAGS')
buildenv_vars_exported+=('RUSTFLAGS')
buildenv_functions+=('buildenv_rust') buildenv_functions+=('buildenv_rust')
buildenv_rust() { buildenv_rust() {