public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Yuta SATOH" <nigoro.gentoo@0x100.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-bsd:master commit in: eclass/
Date: Tue, 18 Jun 2013 12:57:29 +0000 (UTC)	[thread overview]
Message-ID: <1371560060.0b66a93ccb2be4bbde9c88c43443a56eb8f13031.yuta_satoh@gentoo> (raw)

commit:     0b66a93ccb2be4bbde9c88c43443a56eb8f13031
Author:     Yuta SATOH <nigoro <AT> gentoo <DOT> gr <DOT> jp>
AuthorDate: Tue Jun 18 12:54:20 2013 +0000
Commit:     Yuta SATOH <nigoro.gentoo <AT> 0x100 <DOT> 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= "
 


             reply	other threads:[~2013-06-18 12:57 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 12:57 Yuta SATOH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-11 13:46 [gentoo-commits] proj/gentoo-bsd:master commit in: eclass/ Yuta SATOH
2016-10-09  9:18 Yuta SATOH
2016-10-09  8:28 Yuta SATOH
2016-10-09  8:28 Yuta SATOH
2016-10-09  8:28 Yuta SATOH
2016-10-07 12:12 Yuta SATOH
2016-09-28 12:25 Yuta SATOH
2016-09-28 12:25 Yuta SATOH
2015-07-11 23:32 Yuta SATOH
2014-10-28 12:03 Yuta SATOH
2013-10-31 17:08 Yuta SATOH
2013-08-31 16:01 Yuta SATOH
2013-08-30 18:30 Yuta SATOH
2013-08-30 18:30 Yuta SATOH
2013-08-30 18:30 Yuta SATOH
2013-08-29 13:46 Yuta SATOH
2013-08-13 13:06 Yuta SATOH
2013-07-23 16:14 Yuta SATOH
2013-07-11 15:11 Yuta SATOH
2013-06-20 12:20 Yuta SATOH
2013-02-16 15:05 Yuta SATOH
2013-02-11 11:26 Yuta SATOH
2013-02-07 15:56 Yuta SATOH
2013-02-07 15:48 Yuta SATOH
2013-02-01 11:25 Yuta SATOH
2013-01-10 11:58 Yuta SATOH
2013-01-08 13:55 Yuta SATOH
2013-01-08 11:56 Yuta SATOH
2013-01-06 11:19 Yuta SATOH
2013-01-04 10:59 Yuta SATOH
2013-01-01 15:10 Yuta SATOH
2012-12-31 10:04 Yuta SATOH
2012-12-31  9:51 Yuta SATOH
2012-12-31  9:51 Yuta SATOH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371560060.0b66a93ccb2be4bbde9c88c43443a56eb8f13031.yuta_satoh@gentoo \
    --to=nigoro.gentoo@0x100.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox