1 |
# $Header: /magellan-cvs/smage/include/mtools.sminc,v 1.39 2008/04/20 08:28:23 niro Exp $ |
# $Id$ |
2 |
# some special build tools |
# some special build tools |
3 |
|
|
4 |
# automatical inherit mtools.minc |
# automatical inherit mtools.minc |
589 |
local dest |
local dest |
590 |
local verbose="-v" |
local verbose="-v" |
591 |
|
|
592 |
# check for busybox as it doesn'tz support 'ln -v' |
# check for busybox as it doesn't support 'ln -v' |
593 |
[[ $(readlink $(which ln)) = */busybox ]] && verbose="" |
[[ $(readlink $(which ln)) = */busybox ]] && verbose="" |
594 |
|
|
595 |
[[ -z $1 ]] && die "No file given" |
[[ -z $1 ]] && die "No file given" |
616 |
# install our library |
# install our library |
617 |
install -v -m 0755 -o root -g root ${file} ${BINDIR}/${dest} || die |
install -v -m 0755 -o root -g root ${file} ${BINDIR}/${dest} || die |
618 |
|
|
619 |
# create libtool symlinks |
# prefer scanelf |
620 |
# 1. - library.so.1.0.0 -> library.so.1.0 |
if [[ -x $(type -P scanelf) ]] |
|
if [ "${file%.*}" != *.so ] |
|
621 |
then |
then |
622 |
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*}) |
local soname="$(scanelf -SB ${file} | cut -d' ' -f2)" |
623 |
fi |
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/${soname} || die |
624 |
# 2. - library.so.1.0.0 -> library.so.1 |
else |
625 |
if [ "${file%.*.*}" != *.so ] |
echo -e "${COLYELLOW}minstalllib(): Warning: scanelf not found, using fallback symlink method${COLDEFAULT}" |
626 |
then |
|
627 |
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*}) |
# create libtool symlinks |
628 |
|
# 1. - library.so.1.0.0 -> library.so.1.0 |
629 |
|
if [ "${file%.*}" != *.so ] |
630 |
|
then |
631 |
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*}) || die |
632 |
|
fi |
633 |
|
# 2. - library.so.1.0.0 -> library.so.1 |
634 |
|
if [ "${file%.*.*}" != *.so ] |
635 |
|
then |
636 |
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*}) || die |
637 |
|
fi |
638 |
|
# 3. - library.so.1.0.0.0 -> library.so.1 |
639 |
|
if [ "${file%.*.*.*}" != *.so ] |
640 |
|
then |
641 |
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*.*}) || die |
642 |
|
fi |
643 |
fi |
fi |
644 |
} |
} |
645 |
|
|