summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-09-23 17:06:34 +1000
committerAllan McRae <allan@archlinux.org>2012-11-27 15:16:15 +1000
commit6c22ef2c8287ef16f57fba08077520ad0c68dff8 (patch)
tree4cb4e729d613f7178510e5757b0113274e777214 /scripts
parent7199fb3b1aab6ec36e56af8a3ab1949c7510c767 (diff)
downloadpacman-6c22ef2c8287ef16f57fba08077520ad0c68dff8.tar.xz
makepkg: add option to include debugging compiler flags
Add a "debug" option that appends the compiler flags specified in the variables DEBUG_CFLAGS and DEBUG_CXXFLAGS in makepkg.conf to their counterpart buildflags. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d4d435f0..238d3408 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -44,7 +44,8 @@ declare -r confdir='@sysconfdir@'
declare -r BUILDSCRIPT='@BUILDSCRIPT@'
declare -r startdir="$PWD"
-packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge' 'upx')
+packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge' 'upx' \
+ 'debug')
other_options=('ccache' 'distcc' 'buildflags' 'makeflags')
splitpkg_overrides=('pkgver' 'pkgrel' 'epoch' 'pkgdesc' 'arch' 'url' 'license' \
'groups' 'depends' 'optdepends' 'provides' 'conflicts' \
@@ -1340,6 +1341,11 @@ run_function() {
unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
fi
+ if check_option "debug" "y"; then
+ CFLAGS+=" $DEBUG_CFLAGS"
+ CXXFLAGS+=" $DEBUG_CXXFLAGS"
+ fi
+
# clear user-specified makeflags if requested
if check_option "makeflags" "n"; then
unset MAKEFLAGS