diff options
author | Michael Weber <xmw@gentoo.org> | 2016-06-17 14:36:26 +0200 |
---|---|---|
committer | Michael Weber <xmw@gentoo.org> | 2016-06-17 14:36:51 +0200 |
commit | faf6a5dea44a39636633495e64450175b369e419 (patch) | |
tree | 19294011c31ba819ea5e5de0d59ba0180bb213a5 /dev-libs/libsodium | |
parent | sys-cluster/ceph: remove dependency on libedit. (diff) | |
download | gentoo-faf6a5dea44a39636633495e64450175b369e419.tar.gz gentoo-faf6a5dea44a39636633495e64450175b369e419.tar.bz2 gentoo-faf6a5dea44a39636633495e64450175b369e419.zip |
dev-libs/libsodium: Add IUSE="cpu_flags_x86_sse4_1 cpu_flags_x86_aes"
Package-Manager: portage-2.2.28
Diffstat (limited to 'dev-libs/libsodium')
-rw-r--r-- | dev-libs/libsodium/files/libsodium-1.0.10-cpuflags.patch | 40 | ||||
-rw-r--r-- | dev-libs/libsodium/libsodium-1.0.10.ebuild | 15 |
2 files changed, 52 insertions, 3 deletions
diff --git a/dev-libs/libsodium/files/libsodium-1.0.10-cpuflags.patch b/dev-libs/libsodium/files/libsodium-1.0.10-cpuflags.patch new file mode 100644 index 000000000000..09e5c01618c5 --- /dev/null +++ b/dev-libs/libsodium/files/libsodium-1.0.10-cpuflags.patch @@ -0,0 +1,40 @@ +--- libsodium-1.0.10/configure.ac ++++ libsodium-1.0.10/configure.ac +@@ -344,6 +344,10 @@ + [AC_MSG_RESULT(no)]) + CFLAGS="$oldcflags" + ++AC_ARG_ENABLE(sse4_1, [AS_HELP_STRING(--disable-sse4_1,Do not use sse4.1 code)], ++ AS_IF([test "x$enableval" = "xyes"], check_sse4_1="yes", check_sse4_1="no"), ++ check_sse4_1="yes") ++AS_IF([test "$check_sse4_1" = "yes"],[ + oldcflags="$CFLAGS" + AX_CHECK_COMPILE_FLAG([-msse4.1], [CFLAGS="$CFLAGS -msse4.1"]) + AC_MSG_CHECKING(for SSE4.1 instructions set) +@@ -356,6 +360,7 @@ + AX_CHECK_COMPILE_FLAG([-msse4.1], [CFLAGS_SSE41="-msse4.1"])], + [AC_MSG_RESULT(no)]) + CFLAGS="$oldcflags" ++ ]) + + oldcflags="$CFLAGS" + AX_CHECK_COMPILE_FLAG([-mavx], [CFLAGS="$CFLAGS -mavx"]) +@@ -393,6 +398,10 @@ + [AC_MSG_RESULT(no)]) + CFLAGS="$oldcflags" + ++AC_ARG_ENABLE(aesni, [AS_HELP_STRING(--disable-aesni,Do not use aesni code)], ++ AS_IF([test "x$enableval" = "xyes"], check_aeni="yes", check_aesni="no"), ++ check_aesni="yes") ++AS_IF([test "$check_aesni" = "yes"],[ + oldcflags="$CFLAGS" + AX_CHECK_COMPILE_FLAG([-maes], [CFLAGS="$CFLAGS -maes"]) + AX_CHECK_COMPILE_FLAG([-mpclmul], [CFLAGS="$CFLAGS -mpclmul"]) +@@ -410,6 +419,7 @@ + ], + [AC_MSG_RESULT(no)]) + CFLAGS="$oldcflags" ++ ]) + + ]) + diff --git a/dev-libs/libsodium/libsodium-1.0.10.ebuild b/dev-libs/libsodium/libsodium-1.0.10.ebuild index 0c748770e447..14854439230e 100644 --- a/dev-libs/libsodium/libsodium-1.0.10.ebuild +++ b/dev-libs/libsodium/libsodium-1.0.10.ebuild @@ -2,9 +2,9 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -EAPI=5 +EAPI=6 -inherit eutils +inherit eutils autotools DESCRIPTION="A portable fork of NaCl, a higher-level cryptographic library" HOMEPAGE="https://github.com/jedisct1/libsodium" @@ -13,7 +13,14 @@ SRC_URI="http://download.libsodium.org/${PN}/releases/${P}.tar.gz" LICENSE="ISC" SLOT="0/18" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux" -IUSE="+asm minimal static-libs +urandom" +IUSE="+asm minimal static-libs +urandom cpu_flags_x86_sse4_1 cpu_flags_x86_aes" + +PATCHES=( "${FILESDIR}"/${P}-cpuflags.patch ) + +src_prepare() { + default + eautoreconf +} src_configure() { local myconf @@ -26,6 +33,8 @@ src_configure() { $(use_enable minimal) \ $(use_enable !urandom blocking-random) \ $(use_enable static-libs static) \ + $(use_enable cpu_flags_x86_sse4_1 sse4_1) \ + $(use_enable cpu_flags_x86_aes aesni) \ ${myconf} } |