summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in35
1 files changed, 34 insertions, 1 deletions
diff --git a/abuild.in b/abuild.in
index c37af4d..0876380 100755
--- a/abuild.in
+++ b/abuild.in
@@ -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