commit:     9843f6b6b71ca7b82c28685105a08a172e767c1c
Author:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 11 17:43:36 2015 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Thu Jun 11 17:43:36 2015 +0000
URL:        https://gitweb.gentoo.org/proj/qt.git/commit/?id=9843f6b6

[qt5-build] Disable instruction set when the corresponding flag is present.

We now detect if the user disabled one or more instruction sets,
and pass the corresponding -no-foo option to configure.

Heavily based on commit 1dec9f625b40e91fcf680d8bfd80f8d876ea8ee5
that did the same for qt4-build-multilib.eclass.

 eclass/qt5-build.eclass | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 14fbb78..6f10824 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -321,14 +321,13 @@ qt5-build_pkg_postrm() {
 ######  Public helpers  ######
 
 # @FUNCTION: qt_use
-# @USAGE: <flag> [feature] [enableopt]
+# @USAGE: <flag> [feature] [enableval]
 # @DESCRIPTION:
 # <flag> is the name of a flag in IUSE.
 #
-# Echoes "-${enableopt}-${feature}" if <flag> is enabled, or "-no-${feature}"
-# if it is disabled. If [feature] is not specified, it defaults to the value
-# of <flag>. If [enableopt] is not specified, the whole "-${enableopt}" prefix
-# is omitted.
+# Outputs "-${enableval}-${feature}" if <flag> is enabled, "-no-${feature}"
+# otherwise. If [feature] is not specified, <flag> is used in its place.
+# If [enableval] is not specified, the "-${enableval}" prefix is omitted.
 qt_use() {
        [[ $# -ge 1 ]] || die "${FUNCNAME}() requires at least one argument"
 
@@ -517,6 +516,17 @@ qt5_base_configure() {
                # obsolete flag, does nothing
                #-qml-debug
 
+               # instruction set support
+               $(is-flagq -mno-sse2    && echo -no-sse2)
+               $(is-flagq -mno-sse3    && echo -no-sse3)
+               $(is-flagq -mno-ssse3   && echo -no-ssse3)
+               $(is-flagq -mno-sse4.1  && echo -no-sse4.1)
+               $(is-flagq -mno-sse4.2  && echo -no-sse4.2)
+               $(is-flagq -mno-avx     && echo -no-avx)
+               $(is-flagq -mno-avx2    && echo -no-avx2)
+               $(is-flagq -mno-dsp     && echo -no-mips_dsp)
+               $(is-flagq -mno-dspr2   && echo -no-mips_dspr2)
+
                # use pkg-config to detect include and library paths
                -pkg-config
 

Reply via email to