diff options
author | Mike Frysinger <vapier@gentoo.org> | 2004-12-02 21:22:15 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2004-12-02 21:22:15 +0000 |
commit | 4f25ecb3580e9f2c577f23f4488fd57623e266ee (patch) | |
tree | 1d36247764475a2d4a98ca37d31d68c46696d364 /eclass | |
parent | make the libc search more dynamic (ia64 has libc.so.6.1 atm :x) (diff) | |
download | gentoo-2-4f25ecb3580e9f2c577f23f4488fd57623e266ee.tar.gz gentoo-2-4f25ecb3580e9f2c577f23f4488fd57623e266ee.tar.bz2 gentoo-2-4f25ecb3580e9f2c577f23f4488fd57623e266ee.zip |
cross-compile support
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kernel-2.eclass | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index e41b60387fb7..921067f624ca 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.59 2004/12/02 20:34:29 dsd Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.60 2004/12/02 21:22:15 vapier Exp $ # Description: kernel.eclass rewrite for a clean base regarding the 2.6 # series of kernel with back-compatibility for 2.4 @@ -47,6 +47,8 @@ ECLASS="kernel-2" INHERITED="$INHERITED $ECLASS" EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst +export CTARGET="${CTARGET:-${CHOST}}" + HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/" LICENSE="GPL-2" IUSE="${IUSE} build doc" @@ -90,6 +92,12 @@ kernel_is_2_6() { return 0 || return 1 } +kernel_header_destdir() { + [ "${CTARGET}" = "${CHOST}" ] \ + && echo /usr/include \ + || echo /usr/${CTARGET}/include +} + # Capture the sources type and set DEPENDs if [ "${ETYPE}" == "sources" ] then @@ -191,20 +199,21 @@ install_universal() { install_headers() { [ $(kernel_is_2_4) $? == 0 ] && unpack_2_4 - + + local ddir=$(kernel_header_destdir) cd ${S} - dodir /usr/include/linux + dodir ${ddir}/linux ln -sf ${S}/include/asm-${ARCH} ${S}/include/asm - cp -ax ${S}/include/linux/* ${D}/usr/include/linux - rm -rf ${D}/usr/include/linux/modules + cp -ax ${S}/include/linux/* ${D}/${ddir}/linux + rm -rf ${D}/${ddir}/linux/modules - dodir /usr/include/asm - cp -ax ${S}/include/asm/* ${D}/usr/include/asm + dodir ${ddir}/asm + cp -ax ${S}/include/asm/* ${D}/${ddir}/asm if [ $(kernel_is_2_6) $? == 0 ] then - dodir /usr/include/asm-generic - cp -ax ${S}/include/asm-generic/* ${D}/usr/include/asm-generic + dodir ${ddir}/asm-generic + cp -ax ${S}/include/asm-generic/* ${D}/${ddir}/asm-generic fi } @@ -268,8 +277,9 @@ install_manpages() { # pkg_preinst functions #============================================================== preinst_headers() { - [ -L ${ROOT}usr/include/linux ] && rm ${ROOT}usr/include/linux - [ -L ${ROOT}usr/include/asm ] && rm ${ROOT}usr/include/asm + local ddir=$(kernel_header_destdir) + [[ -L ${ROOT}${ddir}/linux ]] && rm "${ROOT}"${ddir}/linux + [[ -L ${ROOT}${ddir}/asm ]] && rm "${ROOT}"${ddir}/asm } # pkg_postinst functions |