From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8C67C1381F3 for ; Tue, 18 Jun 2013 12:57:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 05049E0965; Tue, 18 Jun 2013 12:57:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 94471E0965 for ; Tue, 18 Jun 2013 12:57:32 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AED3333E5B3 for ; Tue, 18 Jun 2013 12:57:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 34F8BE545C for ; Tue, 18 Jun 2013 12:57:29 +0000 (UTC) From: "Yuta SATOH" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Yuta SATOH" Message-ID: <1371560060.0b66a93ccb2be4bbde9c88c43443a56eb8f13031.yuta_satoh@gentoo> Subject: [gentoo-commits] proj/gentoo-bsd:master commit in: eclass/ X-VCS-Repository: proj/gentoo-bsd X-VCS-Files: eclass/freebsd.eclass X-VCS-Directories: eclass/ X-VCS-Committer: yuta_satoh X-VCS-Committer-Name: Yuta SATOH X-VCS-Revision: 0b66a93ccb2be4bbde9c88c43443a56eb8f13031 X-VCS-Branch: master Date: Tue, 18 Jun 2013 12:57:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 7ed3b551-c8cd-456c-8cc8-1f79ccfa872a X-Archives-Hash: fb8caed44ce441be7fab264fabbc1644 commit: 0b66a93ccb2be4bbde9c88c43443a56eb8f13031 Author: Yuta SATOH gentoo gr jp> AuthorDate: Tue Jun 18 12:54:20 2013 +0000 Commit: Yuta SATOH 0x100 com> CommitDate: Tue Jun 18 12:54:20 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bsd.git;a=commit;h=0b66a93c freebsd.eclass: sync to latest tree --- eclass/freebsd.eclass | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/eclass/freebsd.eclass b/eclass/freebsd.eclass index 04ac641..fc45b4c 100644 --- a/eclass/freebsd.eclass +++ b/eclass/freebsd.eclass @@ -150,6 +150,51 @@ freebsd_src_compile() { bsdmk_src_compile } +# Helper function to make a multilib build with FreeBSD Makefiles. +# Usage: +# MULTIBUILD_VARIANTS=( $(get_all_abis) ) +# multibuild_foreach_variant freebsd_multilib_multibuild_wrapper my_function +# +# Important note: To use this function you _have_ to: +# - inherit multilib.eclass and multibuild.eclass +# - set MULTILIB_VARIANTS +# - have a multilib useflag in IUSE + +freebsd_multilib_multibuild_wrapper() { + # Get the ABI from multibuild.eclass + # This assumes MULTILIB_VARIANTS contains only valid ABIs. + local ABI=${MULTIBUILD_VARIANT} + + # First, save the variables: CFLAGS, CXXFLAGS, LDFLAGS, LDADD and mymakeopts. + for i in CFLAGS CXXFLAGS LDFLAGS LDADD mymakeopts ; do + export ${i}_SAVE="${!i}" + done + + # Setup the variables specific to this ABI. + multilib_toolchain_setup "${ABI}" + + local target="$(tc-arch-kernel ${CHOST})" + mymakeopts="${mymakeopts} TARGET=${target} MACHINE=${target} MACHINE_ARCH=${target} SHLIBDIR=/usr/$(get_libdir) LIBDIR=/usr/$(get_libdir)" + if use multilib && [ "${ABI}" != "${DEFAULT_ABI}" ] ; then + mymakeopts="${mymakeopts} COMPAT_32BIT=" + fi + + einfo "Building for ABI=${ABI} and TARGET=${target}" + + export MAKEOBJDIRPREFIX="${BUILD_DIR}" + if [ ! -d "${MAKEOBJDIRPREFIX}" ] ; then + mkdir "${MAKEOBJDIRPREFIX}" || die "Could not create ${MAKEOBJDIRPREFIX}." + fi + + CTARGET="${CHOST}" "$@" + + # Restore the variables now. + for i in CFLAGS CXXFLAGS LDFLAGS LDADD mymakeopts ; do + ii="${i}_SAVE" + export ${i}="${!ii}" + done +} + freebsd_src_install() { use profile || mymakeopts="${mymakeopts} NO_PROFILE= "