--- trunk/include/mtools.sminc 2012/06/26 16:15:58 12655 +++ trunk/include/mtools.sminc 2012/11/12 15:56:03 14029 @@ -1,4 +1,4 @@ -# $Header: /magellan-cvs/smage/include/mtools.sminc,v 1.39 2008/04/20 08:28:23 niro Exp $ +# $Id$ # some special build tools # automatical inherit mtools.minc @@ -589,7 +589,7 @@ local dest local verbose="-v" - # check for busybox as it doesn'tz support 'ln -v' + # check for busybox as it doesn't support 'ln -v' [[ $(readlink $(which ln)) = */busybox ]] && verbose="" [[ -z $1 ]] && die "No file given" @@ -616,16 +616,30 @@ # install our library install -v -m 0755 -o root -g root ${file} ${BINDIR}/${dest} || die - # create libtool symlinks - # 1. - library.so.1.0.0 -> library.so.1.0 - if [ "${file%.*}" != *.so ] + # prefer scanelf + if [[ -x $(type -P scanelf) ]] then - ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*}) - fi - # 2. - library.so.1.0.0 -> library.so.1 - if [ "${file%.*.*}" != *.so ] - then - ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*}) + local soname="$(scanelf -SB ${file} | cut -d' ' -f2)" + ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/${soname} || die + else + echo -e "${COLYELLOW}minstalllib(): Warning: scanelf not found, using fallback symlink method${COLDEFAULT}" + + # create libtool symlinks + # 1. - library.so.1.0.0 -> library.so.1.0 + if [ "${file%.*}" != *.so ] + then + ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*}) || die + fi + # 2. - library.so.1.0.0 -> library.so.1 + if [ "${file%.*.*}" != *.so ] + then + ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*}) || die + fi + # 3. - library.so.1.0.0.0 -> library.so.1 + if [ "${file%.*.*.*}" != *.so ] + then + ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*.*}) || die + fi fi }