- FEATURES=installsources from Olivier Crete an extention of splitdebug for better...
authorNed Ludd <solar@gentoo.org>
Sat, 7 Jan 2006 13:13:31 +0000 (13:13 -0000)
committerNed Ludd <solar@gentoo.org>
Sat, 7 Jan 2006 13:13:31 +0000 (13:13 -0000)
svn path=/main/trunk/; revision=2542

bin/prepstrip

index 343a53353be32d8c7a351a60d49b8ab3c8cc2de2..47130e694ba6d2eede24a3b7a3bfc25f1860d248 100755 (executable)
@@ -24,6 +24,16 @@ save_elf_debug() {
        mkdir -p $(dirname ${y})
        ${CHOST}-objcopy --only-keep-debug ${x} ${y}.debug
        ${CHOST}-objcopy --add-gnu-debuglink=${y}.debug ${x}
+
+       [ "${FEATURES//*installsources*/true}" != "true" ] && return 0
+
+       if [ -x /usr/bin/debugedit ] ; then
+               debugedit -b ${WORKDIR} -d /usr/src/debug/${P} -l ${T}/debug.sources "$x"
+               if [ -s ${T}/debug.sources ]; then 
+                       [ -d ${D}/usr/src/debug/${P} ] || mkdir -p ${D}/usr/src/debug/${P}
+                       cat ${T}/debug.sources | (cd ${WORKDIR}; LANG=C sort -z -u | xargs -0 -- cp --parents -p --target-directory="${D}/usr/src/debug/${P}" )
+               fi
+       fi
 }
 
 for x in $(scanelf -yRBF%F "$@") $(for y in "$@"; do find $y -type f -name '*.a' -print0 ; done); do