--- trunk/include/multilib.sminc 2017/10/12 08:49:24 29788 +++ trunk/include/multilib.sminc 2017/10/12 11:37:16 29792 @@ -7,6 +7,9 @@ # be verbose or nor (true|false} : ${MULTILIB_VERBOSE="true"} +# enter SRCDIR of each abi an abi runs +: ${ABI_DO_NOT_ENTER_SRCDIR="true"} + # multilib should call all dependant includes, which gets overridden sminclude mtools @@ -182,7 +185,10 @@ # export this for mpatch etc (to repect only-${abi}) export MULTILIB_ONLY_ABI=${abi} - cd ${SRCDIR}-${abi}/${SRCSUBDIR} + if [[ ${ABI_DO_NOT_ENTER_SRCDIR} != true ]] + then + cd ${SRCDIR}-${abi}/${SRCSUBDIR} + fi abi-${abi} $@ || die # unset this is very important @@ -203,7 +209,10 @@ # export this for mpatch etc (to repect only-${abi}) export MULTILIB_ONLY_ABI=${abi} - cd ${SRCDIR}-${abi}/${SRCSUBDIR} + if [[ ${ABI_DO_NOT_ENTER_SRCDIR} != true ]] + then + cd ${SRCDIR}-${abi}/${SRCSUBDIR} + fi abi-${abi} $@ || die # unset this is very important @@ -217,7 +226,10 @@ local abi for abi in ${MULTILIB_ABIS} do - cd ${SRCDIR}-${abi}/${SRCSUBDIR} + if [[ ${ABI_DO_NOT_ENTER_SRCDIR} != true ]] + then + cd ${SRCDIR}-${abi}/${SRCSUBDIR} + fi abi-${abi} $@ || die done } @@ -399,151 +411,6 @@ done } fi - -if [[ ! -z $(typeset -f mninja) ]] -then - # rename the old one - old_mninja=old$(typeset -f mninja) - eval "${old_mninja}" - -mninja() -{ - local abi - local abis_to_run="${MULTILIB_ABIS}" - - # respect MULTILIB_ONLY_ABI variable - [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" - - for abi in ${abis_to_run} - do - echo -e "${COLBLUE}*** ${COLGREEN}compiling for ABI -${abi}${COLDEFAULT}" - cd ${SRCDIR}-${abi}/${SRCSUBDIR} - abi-${abi} oldmninja $@ || die - done -} -fi - -if [[ ! -z $(typeset -f meson_configure) ]] -then - # rename the old one - old_meson_configure=old$(typeset -f meson_configure) - eval "${old_meson_configure}" - -meson_configure() -{ - local abi - local abis_to_run="${MULTILIB_ABIS}" - - # respect MULTILIB_ONLY_ABI variable - [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" - - local saved_SRCDIR="${SRCDIR}" - for abi in ${abis_to_run} - do - SRCDIR="${saved_SRCDIR}-${abi}" - # honor inside and outside build-dir builds - if [ -d ${BUILDDIR}/build-${abi} ] - then - cd ${BUILDDIR}/build-${abi} - else - cd ${SRCDIR} - fi - abi-${abi} oldmeson_configure $@ || die - done - # restore SRCDIR - SRCDIR="${saved_SRCDIR}" -} -fi - -if [[ ! -z $(typeset -f meson_src_compile) ]] -then - # rename the old one - old_meson_src_compile=old$(typeset -f meson_src_compile) - eval "${old_meson_src_compile}" - -meson_src_compile() -{ - local abi - local abis_to_run="${MULTILIB_ABIS}" - - # respect MULTILIB_ONLY_ABI variable - [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" - - for abi in ${abis_to_run} - do - # remove build dir if exist - [[ -d ${BUILDDIR}/build-${abi} ]] && rm -rf ${BUILDDIR}/build-${abi} - - # build outside of the source dir - install -d ${BUILDDIR}/build-${abi} || die - cd ${BUILDDIR}/build-${abi} - done - - meson_configure || die - - for abi in ${abis_to_run} - do - cd ${BUILDDIR}/build-${abi} - abi-${abi} oldmninja $@ || die - done -} -fi - -if [[ ! -z $(typeset -f meson_src_check) ]] -then - # rename the old one - old_meson_src_check=old$(typeset -f meson_src_check) - eval "${old_meson_check}" - -meson_src_check() -{ - local abi - local abis_to_run="${MULTILIB_ABIS}" - - # respect MULTILIB_ONLY_ABI variable - [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" - - for abi in ${abis_to_run} - do - # honor inside and outside build-dir builds - if [ -d ${BUILDDIR}/build-${abi} ] - then - cd ${BUILDDIR}/build-${abi} - else - cd ${SRCDIR}-${abi} - fi - meson test || die - done -} -fi - -if [[ ! -z $(typeset -f meson_src_install) ]] -then - # rename the old one - old_meson_src_install=old$(typeset -f meson_src_install) - eval "${old_meson_install}" - -meson_src_install() -{ - local abi - local abis_to_run="${MULTILIB_ABIS}" - - # respect MULTILIB_ONLY_ABI variable - [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" - - for abi in ${abis_to_run} - do - # honor inside and outside build-dir builds - if [ -d ${BUILDDIR}/build-${abi} ] - then - cd ${BUILDDIR}/build-${abi} - else - cd ${SRCDIR}-${abi} - fi - abi-${abi} DESTDIR=${BINDIR} oldmninja $@ install || die - done -} -fi if [[ ! -z $(typeset -f munpack) ]] then