app-crypt/libb2: addUSE=native-cflags to control feature guessing
authorFabian Groffen <grobian@gentoo.org>
Mon, 27 Nov 2017 13:54:44 +0000 (14:54 +0100)
committerFabian Groffen <grobian@gentoo.org>
Mon, 27 Nov 2017 13:54:58 +0000 (14:54 +0100)
Package-Manager: Portage-2.3.13, Repoman-2.3.3

app-crypt/libb2/libb2-0.98.ebuild
app-crypt/libb2/metadata.xml

index 08bf237662f2bc1800a0215ca465cedaf3c09b74..b42921bc69d2fb0f643efd571948e2f01e45d4c6 100644 (file)
@@ -13,7 +13,7 @@ SRC_URI="https://github.com/BLAKE2/libb2/archive/${GITHASH}.tar.gz -> ${P}.tar.g
 LICENSE="CC0-1.0"
 SLOT="0"
 KEYWORDS="~amd64 ~ppc64"
-IUSE="static"
+IUSE="static native-cflags"
 
 DEPEND=""
 RDEPEND="${DEPEND}"
@@ -28,12 +28,14 @@ src_prepare() {
 }
 
 src_configure() {
-       econf $(use_enable static)
+       econf \
+               $(use_enable static) \
+               $(use_enable native-cflags native)
 }
 
 src_compile() {
-       # respect our CFLAGS
-       emake CFLAGS="${CFLAGS}"
+       # respect our CFLAGS when native-cflags is not in effect
+       emake $(use native-cflags && echo no)CFLAGS="${CFLAGS}"
 }
 
 src_install() {
index 5ef83e989e931c2f0e444b1f4ff25d51312321e3..76fd7590acbbbfa51d4d455cada8f4d0299a863d 100644 (file)
 
                Official implementations from BLAKE2 project.
        </longdescription>
+       <use>
+               <flag name="native-cflags">
+               Use CFLAGS as determined by configure script.  These flags will
+               enable all CPU specific features it find available, to further
+               optimise the implementation.  This discards any existing CFLAGS
+               set in make.conf or similar.
+               </flag>
+       </use>
 </pkgmetadata>