public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Jonathan Callen <jcallen@gentoo.org>
To: Gentoo Dev <gentoo-dev@lists.gentoo.org>, multilib@gentoo.org
Subject: [gentoo-dev] Patches for multilib-build.eclass
Date: Sun, 27 Jul 2014 20:19:13 -0400	[thread overview]
Message-ID: <53D59701.7080002@gentoo.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 315 bytes --]

The attached patches (attached so that Thunderbird won't mangle them)
fix some of the documentation for multilib-build.eclass, then add a
couple new functions to simplify some use cases where a flag would be
unconditionally enabled for native builds and disabled for non-native
builds.

-- 
Jonathan Callen

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-multilib-build-docs.patch --]
[-- Type: text/x-diff; name="0001-multilib-build-docs.patch", Size: 1476 bytes --]

--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -567,9 +567,6 @@
 # @DESCRIPTION:
 # Determine whether the currently built ABI is the profile native.
 # Return true status (0) if that is true, otherwise false (1).
-#
-# This function is not intended to be used directly. Please use
-# multilib_build_binaries instead.
 multilib_is_native_abi() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -580,14 +577,7 @@
 
 # @FUNCTION: multilib_build_binaries
 # @DESCRIPTION:
-# Determine whether to build binaries for the currently built ABI.
-# Returns true status (0) if the currently built ABI is the profile
-# native or COMPLETE_MULTILIB variable is set to 'yes', otherwise
-# false (1).
-#
-# This is often useful for configure calls when some of the options are
-# supposed to be disabled for multilib ABIs (like those used for
-# executables only).
+# Deprecated synonym for multilib_is_native_abi
 multilib_build_binaries() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -615,7 +605,7 @@
 # @FUNCTION: multilib_native_use_enable
 # @USAGE: <flag> [<opt-name> [<opt-value>]]
 # @DESCRIPTION:
-# Output --enable configure option alike use_with if USE <flag>
+# Output --enable configure option alike use_enable if USE <flag>
 # is enabled and executables are being built (multilib_is_native_abi
 # is true). Otherwise, outputs --disable configure option. Arguments are
 # the same as for use_enable in the EAPI.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-multilib-build-new-functions.patch --]
[-- Type: text/x-diff; name="0002-multilib-build-new-functions.patch", Size: 1004 bytes --]

--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -617,6 +617,34 @@
 	fi
 }
 
+# @FUNCTION: multilib_native_enable
+# @USAGE: <opt-name> [<opt-value>]
+# @DESCRIPTION:
+# Output --enable configure option if executables are being built
+# (multilib_is_native_abi is true). Otherwise, output --disable configure
+# option.
+multilib_native_enable() {
+	if multilib_is_native_abi; then
+		echo "--enable-${1}${2+=${2}}"
+	else
+		echo "--disable-${1}"
+	fi
+}
+
+# @FUNCTION: multilib_native_with
+# @USAGE: <opt-name> [<opt-value>]
+# @DESCRIPTION:
+# Output --with configure option if executables are being built
+# (multilib_is_native_abi is true). Otherwise, output --without configure
+# option.
+multilib_native_with() {
+	if multilib_is_native_abi; then
+		echo "--with-${1}${2+=${2}}"
+	else
+		echo "--without-${1}"
+	fi
+}
+
 # @FUNCTION: multilib_native_usex
 # @USAGE: <flag> [<true1> [<false1> [<true2> [<false2>]]]]
 # @DESCRIPTION:

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

                 reply	other threads:[~2014-07-27 20:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=53D59701.7080002@gentoo.org \
    --to=jcallen@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=multilib@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