Update eclass

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@315 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one 2007-12-02 12:01:59 +00:00
parent 61c0cd1312
commit f4aa884715
2 changed files with 35 additions and 11 deletions

View File

@ -16,31 +16,31 @@ DESCRIPTION="Based on the ${ECLASS} eclass"
FEATURES=${FEATURES/multilib-strict/} FEATURES=${FEATURES/multilib-strict/}
toolchain_pkg_setup() { toolchain-gcc_pkg_setup() {
gcc_pkg_setup gcc_pkg_setup
} }
toolchain_src_unpack() { toolchain-gcc_src_unpack() {
gcc_src_unpack gcc_src_unpack
} }
toolchain_src_compile() { toolchain-gcc_src_compile() {
gcc_src_compile gcc_src_compile
} }
toolchain_src_test() { toolchain-gcc_src_test() {
gcc_src_test gcc_src_test
} }
toolchain_pkg_preinst() { toolchain-gcc_pkg_preinst() {
${ETYPE}_pkg_preinst ${ETYPE}_pkg_preinst
} }
toolchain_src_install() { toolchain-gcc_src_install() {
${ETYPE}_src_install ${ETYPE}_src_install
} }
toolchain_pkg_postinst() { toolchain-gcc_pkg_postinst() {
${ETYPE}_pkg_postinst ${ETYPE}_pkg_postinst
} }
toolchain_pkg_prerm() { toolchain-gcc_pkg_prerm() {
${ETYPE}_pkg_prerm ${ETYPE}_pkg_prerm
} }
toolchain_pkg_postrm() { toolchain-gcc_pkg_postrm() {
${ETYPE}_pkg_postrm ${ETYPE}_pkg_postrm
} }
#----<< eclass stuff >>---- #----<< eclass stuff >>----
@ -142,6 +142,7 @@ else
[[ -n ${PIE_VER} ]] && IUSE="${IUSE} nopie" [[ -n ${PIE_VER} ]] && IUSE="${IUSE} nopie"
[[ -n ${PP_VER} ]] && IUSE="${IUSE} nossp" [[ -n ${PP_VER} ]] && IUSE="${IUSE} nossp"
[[ -n ${HTB_VER} ]] && IUSE="${IUSE} boundschecking" [[ -n ${HTB_VER} ]] && IUSE="${IUSE} boundschecking"
[[ -n ${LLVM_VER} ]] && IUSE="${IUSE} llvm"
[[ -n ${D_VER} ]] && IUSE="${IUSE} d" [[ -n ${D_VER} ]] && IUSE="${IUSE} d"
if version_is_at_least 3 ; then if version_is_at_least 3 ; then
@ -485,7 +486,7 @@ _want_stuff() {
return 1 return 1
} }
want_boundschecking() { _want_stuff HTB_VER boundschecking ; } want_boundschecking() { _want_stuff HTB_VER boundschecking ; }
want_llvm() { _want_stuff LLVM_VER Low Level Virtual Machine ; } want_llvm() { _want_stuff LLVM_VER llvm ; }
want_pie() { _want_stuff PIE_VER !nopie ; } want_pie() { _want_stuff PIE_VER !nopie ; }
want_ssp() { _want_stuff PP_VER !nossp ; } want_ssp() { _want_stuff PP_VER !nossp ; }
@ -1268,6 +1269,23 @@ gcc_do_configure() {
confgcc="${confgcc} --disable-nls" confgcc="${confgcc} --disable-nls"
fi fi
# LLVM Support
if use llvm && ! use build ; then
einfo "Enabling LLVM"
confgcc="${confgcc} --enable-checking --program-prefix=llvm-"
sed -e 's,^LLVMSRCDIR.*,LLVMSRCDIR := $(shell llvm-config --src-root),' \
-e 's,\$(LLVMSRCDIR)/include,$(shell llvm-config --includedir),g' \
-e 's,^LLVMOBJDIR.*,LLVMOBJDIR := $(shell llvm-config --obj-root),' \
-e 's,\$(LLVMOBJDIR)/include,$(shell llvm-config --includedir),g' \
-e 's,^LLVMBINPATH.*,LLVMBINPATH = $(shell llvm-config --bindir),' \
-e 's,\$(LLVMBINPATH)/llvm-config,llvm-config,' \
-i "${S}"/gcc/Makefile.in || die "sed failed"
sed -e 's,^LLVMBASEPATH.*,LLVMBASEPATH = $(shell llvm-config --obj-root),' \
-i "${S}"/libcpp/Makefile.in || die "sed failed"
fi
# reasonably sane globals (hopefully) # reasonably sane globals (hopefully)
# --disable-libunwind-exceptions needed till unwind sections get fixed. see ps.m for details # --disable-libunwind-exceptions needed till unwind sections get fixed. see ps.m for details
confgcc="${confgcc} \ confgcc="${confgcc} \
@ -1416,7 +1434,7 @@ gcc_do_make() {
else else
STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"} STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"}
fi fi
if is_crosscompile; then if is_crosscompile; then
# In 3.4, BOOT_CFLAGS is never used on a crosscompile... # In 3.4, BOOT_CFLAGS is never used on a crosscompile...
# but I'll leave this in anyways as someone might have had # but I'll leave this in anyways as someone might have had
@ -1985,6 +2003,11 @@ do_gcc_HTB_patches() {
} }
do_gcc_LLVM_patches() { do_gcc_LLVM_patches() {
if ! want_llvm
then
return 0
fi
epatch "${WORKDIR}/gcc-${LLVM_GCC_VER}-llvm${LLVM_VER}.patch" epatch "${WORKDIR}/gcc-${LLVM_GCC_VER}-llvm${LLVM_VER}.patch"
release_version="${release_version}, LLVM-${LLVM_GCC_VER}-${LLVM_VER}" release_version="${release_version}, LLVM-${LLVM_GCC_VER}-${LLVM_VER}"
} }

View File

@ -198,6 +198,7 @@ toolchain-llvm_src_compile() {
--enable-assertions \ --enable-assertions \
--enable-shared \ --enable-shared \
--enable-optimized \ --enable-optimized \
--enable-pic \
${myconf} ${EXTRA_ECONF}" ${myconf} ${EXTRA_ECONF}"
echo ./configure ${myconf} echo ./configure ${myconf}
"${S}"/configure ${myconf} || die "configure failed" "${S}"/configure ${myconf} || die "configure failed"