--- portage/eclass/qt4-build.eclass 2010-07-08 18:05:52.000000000 +0200 +++ local/portage/eclass/qt4-build.eclass 2010-07-10 18:59:20.000000000 +0200 @@ -285,6 +285,10 @@ # strip predefined CFLAGS from qmake ( bug #312689 ) sed -i '/^QMAKE_CFLAGS_\(RELEASE\|DEBUG\)/s:+=.*:+=:' mkspecs/common/g++.conf + if tc-is-cross-compiler ; then #add a new target for cross-compilation + cp -R ${FILESDIR}/linux-cross-g++ ${S}/mkspecs + fi + base_src_prepare } @@ -300,6 +304,8 @@ use !elibc_glibc && [[ ${CHOST} != *-darwin* ]] && \ myconf+=" -liconv" + tc-is-cross-compiler && myconf="${myconf} -xplatform linux-cross-g++" + if has glib ${IUSE//+} && use glib; then # use -I, -L and -l from configure local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)" @@ -497,7 +503,11 @@ echo "${S}"/mkspecs/common/*.conf find "${S}" -name '*.pr[io]' } | xargs sed -i -e "s:\$\$\[QT_INSTALL_LIBS\]:${EPREFIX}/usr/$(get_libdir)/qt4:g" || die + if tc-is-cross-compiler ; then + "${S}"/bin/qmake "LIBS+=-L${ROOT}/usr/$(get_libdir)/qt4" "CONFIG+=nostrip" || die "qmake failed" + else "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed" + fi emake CC="$(tc-getCC)" \ CXX="$(tc-getCXX)" \ LINK="$(tc-getCXX)" || die "emake failed"