Commit 9cb1ad3c authored by Natanael Copa's avatar Natanael Copa

abuild: implement -dbg subpackages

Patch from Andrew Manison.

ref #626
parent 8d600911
......@@ -1245,6 +1245,31 @@ doc() {
default_doc
}
# predefined splitfunc doc
default_dbg() {
local f
binfiles=$(scanelf -R "$pkgdir" | grep ET_DYN | sed "s:$pkgdir\/::g" | sed "s:ET_DYN ::g")
for f in $binfiles; do
srcdir=$(dirname $pkgdir/$f)
srcfile=$(basename $pkgdir/$f)
dstdir=$(dirname $subpkgdir/usr/lib/debug/$f.debug)
dstfile=$(basename $subpkgdir/usr/lib/debug/$f.debug)
if [ ! -d $dstdir ] ; then
mkdir -p $dstdir
fi
cd $srcdir
objcopy --only-keep-debug $srcfile $dstfile
objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
mv $dstfile $dstdir
strip $srcfile
done
return 0
}
dbg() {
default_dbg
}
# predefined splitfunc dev
default_dev() {
local i= j=
......@@ -1675,6 +1700,14 @@ subpackages_has() {
return 1
}
subpackage_types_has() {
local i
for i in $subpackages; do
[ "$1" = "${i##*-}" ] && return 0
done
return 1
}
list_has() {
local needle="$1"
local i
......@@ -1946,7 +1979,7 @@ else
fi
# if we want build debug package
if [ -n "$DEBUG" ]; then
if [ -n "$DEBUG" ] || subpackage_types_has "dbg"; then
CFLAGS="$CFLAGS -g"
options="$options !strip"
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment