--- branches/magellan-next/include/multilib.sminc 2011/11/26 13:37:05 9334 +++ trunk/include/multilib.sminc 2012/03/12 20:54:11 11544 @@ -1,9 +1,15 @@ # $Id$ # multilib abis +# tell that we are doing a multilib build +export MULITLIB_BUILD="true" + # be verbose or nor (true|false} : ${MULTILIB_VERBOSE="true"} +# multilib should call all dependant includes, which gets overridden +sminclude mtools + # do not define EMUL_LINUX_32 after inherit of multlib !! # it may break i*86 builds @@ -66,7 +72,8 @@ export ABI_LIBDIR="lib" if [[ ${EXPORT_ABI_LDFLAGS} != false ]] then - export LDFLAGS="-L/${ABI_LIBDIR} -L/usr/${ABI_LIBDIR}" + local saved_ldflags="${LDFLAGS}" + export LDFLAGS="${LDFLAGS} -L/${ABI_LIBDIR} -L/usr/${ABI_LIBDIR}" fi # keep pkgconfig clean local orig_pkg_config_path="${PKG_CONFIG_PATH}" @@ -85,6 +92,8 @@ else echo -e "${COLBLUE}*** ${COLGREEN} LDFLAGS${COLDEFAULT}='${COLYELLOW}not exported${COLDEFAULT}'" fi + echo -e "${COLBLUE}*** ${COLGREEN} CHOST${COLDEFAULT}='${CHOST}'" + echo -e "${COLBLUE}*** ${COLGREEN} SRCDIR${COLDEFAULT}='${SRCDIR}/${SRCSUBDIR}'" echo -e "${COLBLUE}*** ${COLGREEN} PKG_CONFIG_PATH${COLDEFAULT}='${PKG_CONFIG_PATH}'" fi @@ -106,9 +115,10 @@ # run any given command eval $@ || die - unset ABI CC CXX ABI_LIBDIR LDFLAGS + unset ABI CC CXX ABI_LIBDIR # keep pkgconfig clean export PKG_CONFIG_PATH="${orig_pkg_config_path}" + export LDFLAGS="${saved_ldflags}" # restore original settings if [[ ${EMUL_LINUX_32} = true ]] @@ -126,6 +136,7 @@ export ABI_LIBDIR="lib64" if [[ ${EXPORT_ABI_LDFLAGS} != false ]] then + local saved_ldflags="${LDFLAGS}" export LDFLAGS="-L/${ABI_LIBDIR} -L/usr/${ABI_LIBDIR}" fi # keep pkgconfig clean @@ -146,15 +157,17 @@ echo -e "${COLBLUE}*** ${COLGREEN} LDFLAGS${COLDEFAULT}='${COLYELLOW}not exported${COLDEFAULT}'" fi echo -e "${COLBLUE}*** ${COLGREEN} CHOST${COLDEFAULT}='${CHOST}'" + echo -e "${COLBLUE}*** ${COLGREEN} SRCDIR${COLDEFAULT}='${SRCDIR}/${SRCSUBDIR}'" echo -e "${COLBLUE}*** ${COLGREEN} PKG_CONFIG_PATH${COLDEFAULT}='${PKG_CONFIG_PATH}'" fi # run any given command eval $@ || die - unset ABI CC CXX ABI_LIBDIR LDFLAGS + unset ABI CC CXX ABI_LIBDIR # keep pkgconfig clean export PKG_CONFIG_PATH="${orig_pkg_config_path}" + export LDFLAGS="${saved_ldflags}" } only-m32() @@ -169,7 +182,7 @@ # export this for mpatch etc (to repect only-${abi}) export MULTILIB_ONLY_ABI=${abi} - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} abi-${abi} $@ || die # unset this is very important @@ -190,7 +203,7 @@ # export this for mpatch etc (to repect only-${abi}) export MULTILIB_ONLY_ABI=${abi} - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} abi-${abi} $@ || die # unset this is very important @@ -204,7 +217,7 @@ local abi for abi in ${MULTILIB_ABIS} do - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} abi-${abi} $@ || die done } @@ -234,7 +247,7 @@ for abi in ${abis_to_run} do - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} abi-${abi} oldmconfigure $@ || die done } @@ -257,9 +270,11 @@ for abi in ${abis_to_run} do SRCDIR="${saved_SRCDIR}-${abi}" - cd ${SRCDIR} + cd ${SRCDIR}/${SRCSUBDIR} abi-${abi} oldcmake_configure $@ || die done + # restore SRCDIR + SRCDIR="${saved_SRCDIR}" } if [[ ! -z $(typeset -f munpack) ]] @@ -301,7 +316,7 @@ for abi in ${abis_to_run} do echo -e "${COLBLUE}*** ${COLGREEN}compiling for ABI -${abi}${COLDEFAULT}" - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} abi-${abi} oldmmake $@ || die done } @@ -323,7 +338,7 @@ for abi in ${abis_to_run} do echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} abi-${abi} oldminstall $@ || die done } @@ -339,7 +354,7 @@ for abi in ${abis_to_run} do echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} make DESTDIR=${BINDIR} $@ install || die done } @@ -361,7 +376,7 @@ for abi in ${abis_to_run} do echo -e "${COLBLUE}*** ${COLGREEN}appling patch for ABI -${abi}${COLDEFAULT}" - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} oldmpatch $@ || die done } @@ -383,7 +398,7 @@ for abi in ${abis_to_run} do echo -e "${COLBLUE}*** ${COLGREEN}running mlibtoolize for ABI -${abi}${COLDEFAULT}" - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} oldmlibtoolize $@ || die done } @@ -405,7 +420,7 @@ for abi in ${abis_to_run} do echo -e "${COLBLUE}*** ${COLGREEN}running mautoreconf for ABI -${abi}${COLDEFAULT}" - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} oldmautoreconf $@ || die done } @@ -420,7 +435,6 @@ { local abi local docfiles - docfiles="$@" local abis_to_run="${MULTILIB_ABIS}" @@ -429,18 +443,8 @@ for abi in ${abis_to_run} do - cd ${SRCDIR}-${abi} - if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ] - then - install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs." - fi - - for i in ${docfiles} - do - cat ${SRCDIR}-${abi}/${i} | gzip -9c > ${SRCDIR}-${abi}/${i}.gz || die "gzipping docs." - install -m 0644 ${SRCDIR}-${abi}/${i}.gz \ - ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "coping docs." - done + cd ${SRCDIR}-${abi}/${SRCSUBDIR} + oldminstalldocs $@ || die done } @@ -458,6 +462,11 @@ mmake } +multilib_src_check() +{ + mmake -j1 -k check || die +} + multilib_src_install() { minstall_destdir @@ -465,7 +474,7 @@ local i for abi in ${MULTILIB_ABIS} do - cd ${SRCDIR}-${abi} + cd ${SRCDIR}-${abi}/${SRCSUBDIR} for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ FAQ LICENSE NEWS README TODO do @@ -477,4 +486,4 @@ done } -export_inherits multilib src_prepare src_compile src_install +export_inherits multilib src_prepare src_compile src_check src_install