# $Id$ # gcc toolchain functions # helper functions lang_enabled() { local lang="$1" if [[ ${MyLanguages//${lang}} != ${MyLanguages} ]] then return 0 else return 1 fi } install_gcc_library() { local library="$1" cd ${SRCDIR}/build mmake -C ${CHOST}/${library} DESTDIR=${BINDIR} install-toolexeclibLTLIBRARIES || die if [[ $(mlibdir) != lib ]] then if [ -d ${CHOST}/32/${library} ] then mmake -C ${CHOST}/32/${library} DESTDIR=${BINDIR} install-toolexeclibLTLIBRARIES || die fi fi } uninstall_gcc_library() { local library="$1" cd ${SRCDIR}/build mmake -C ${CHOST}/${library} DESTDIR=${BINDIR} uninstall-toolexeclibLTLIBRARIES || die if [[ $(mlibdir) != lib ]] then if [ -d ${CHOST}/32/${library} ] then mmake -C ${CHOST}/32/${library} DESTDIR=${BINDIR} uninstall-toolexeclibLTLIBRARIES || die fi fi } versionize_all_bins() { local bin for bin in $(find ${BINDIR}/usr/bin -type f) do # only rename unversionized bins if [[ ${bin//${PVER}} = ${bin} ]] && [[ ! -e ${bin}-${PVER} ]] then echo ${bin} mv ${bin} ${bin}-${PVER} || die ln -snf $(basename ${bin}-${PVER}) ${bin} || die fi done } keep_dev_package_libs() { local libs="$@" # run zapmost only if the directories exists, which fixes empy libvtv issues if [[ -d ${BINDIR}/usr/$(mlibdir) ]] then # cleanup, only keep the libs, everything else get provided by the dev-package zapmost ${BINDIR}/usr/$(mlibdir) "${libs}" || die fi # multilib as well if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] then zapmost ${BINDIR}/usr/lib "${libs}" || die fi # cleanup the rest, keep only libs zapmost ${BINDIR} /usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "/usr/lib") || die } delete_dev_package_libs() { local libs="$@" local i # cleanup, the solibs are provided by the non-dev package for i in ${libs} do # run cleanup only if the directories exists, which fixes empy libvtv issues if [[ -d ${BINDIR}/usr/$(mlibdir) ]] then rm ${BINDIR}/usr/$(mlibdir)/${i} || die fi # multilib as well if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] then rm ${BINDIR}/usr/lib/${i} || die fi done }