1 |
commit: 54111dad825a87510e3896218cb0e111554f82b1 |
2 |
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org> |
3 |
AuthorDate: Sat Sep 28 02:08:18 2019 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 29 02:56:12 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54111dad |
7 |
|
8 |
dev-libs/marisa: Automatic detection of CPU features enabled by CXXFLAGS. |
9 |
|
10 |
cpu_flags_x86_* USE flags are no longer needed. |
11 |
|
12 |
https://github.com/s-yata/marisa-trie/commit/d93f1b67f3aaa2d56bf20089c0ce9ef216da6cb7 |
13 |
|
14 |
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org> |
15 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
16 |
|
17 |
.../files/marisa-0.2.5-cpu_features_check.patch | 157 +++++++++++++++++++++ |
18 |
dev-libs/marisa/marisa-0.2.5.ebuild | 32 +++-- |
19 |
2 files changed, 174 insertions(+), 15 deletions(-) |
20 |
|
21 |
diff --git a/dev-libs/marisa/files/marisa-0.2.5-cpu_features_check.patch b/dev-libs/marisa/files/marisa-0.2.5-cpu_features_check.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..dba677221a1 |
24 |
--- /dev/null |
25 |
+++ b/dev-libs/marisa/files/marisa-0.2.5-cpu_features_check.patch |
26 |
@@ -0,0 +1,157 @@ |
27 |
+https://github.com/s-yata/marisa-trie/commit/d93f1b67f3aaa2d56bf20089c0ce9ef216da6cb7 |
28 |
+ |
29 |
+--- /configure.ac |
30 |
++++ /configure.ac |
31 |
+@@ -13,6 +13,56 @@ |
32 |
+ |
33 |
+ AC_CONFIG_MACRO_DIR([m4]) |
34 |
+ |
35 |
++# Macros for SSE availability check. |
36 |
++AC_DEFUN([MARISA_ENABLE_SSE2], |
37 |
++ [AC_EGREP_CPP([yes], [ |
38 |
++#ifdef __SSE2__ |
39 |
++yes |
40 |
++#endif |
41 |
++ ], [enable_sse2="yes"], [enable_sse2="no"])]) |
42 |
++AC_DEFUN([MARISA_ENABLE_SSE3], |
43 |
++ [AC_EGREP_CPP([yes], [ |
44 |
++#ifdef __SSE3__ |
45 |
++yes |
46 |
++#endif |
47 |
++ ], [enable_sse3="yes"], [enable_sse3="no"])]) |
48 |
++AC_DEFUN([MARISA_ENABLE_SSSE3], |
49 |
++ [AC_EGREP_CPP([yes], [ |
50 |
++#ifdef __SSSE3__ |
51 |
++yes |
52 |
++#endif |
53 |
++ ], [enable_ssse3="yes"], [enable_ssse3="no"])]) |
54 |
++AC_DEFUN([MARISA_ENABLE_SSE4_1], |
55 |
++ [AC_EGREP_CPP([yes], [ |
56 |
++#ifdef __SSE4_1__ |
57 |
++yes |
58 |
++#endif |
59 |
++ ], [enable_sse4_1="yes"], [enable_sse4_1="no"])]) |
60 |
++AC_DEFUN([MARISA_ENABLE_SSE4_2], |
61 |
++ [AC_EGREP_CPP([yes], [ |
62 |
++#ifdef __SSE4_2__ |
63 |
++yes |
64 |
++#endif |
65 |
++ ], [enable_sse4_2="yes"], [enable_sse4_2="no"])]) |
66 |
++AC_DEFUN([MARISA_ENABLE_SSE4], |
67 |
++ [AC_EGREP_CPP([yes], [ |
68 |
++#if defined(__POPCNT__) && defined(__SSE4_2__) |
69 |
++yes |
70 |
++#endif |
71 |
++ ], [enable_sse4="yes"], [enable_sse4="no"])]) |
72 |
++AC_DEFUN([MARISA_ENABLE_SSE4A], |
73 |
++ [AC_EGREP_CPP([yes], [ |
74 |
++#ifdef __SSE4A__ |
75 |
++yes |
76 |
++#endif |
77 |
++ ], [enable_sse4a="yes"], [enable_sse4a="no"])]) |
78 |
++AC_DEFUN([MARISA_ENABLE_POPCNT], |
79 |
++ [AC_EGREP_CPP([yes], [ |
80 |
++#ifdef __POPCNT__ |
81 |
++yes |
82 |
++#endif |
83 |
++ ], [enable_popcnt="yes"], [enable_popcnt="no"])]) |
84 |
++ |
85 |
+ # Checks for SSE availability. |
86 |
+ AC_MSG_CHECKING([whether to use SSE2]) |
87 |
+ AC_ARG_ENABLE([sse2], |
88 |
+@@ -20,9 +70,7 @@ |
89 |
+ [use SSE2 [default=no]])], |
90 |
+ [], |
91 |
+ [enable_sse2="no"]) |
92 |
+-AS_IF([test "x${enable_sse2}" != "xno"], [ |
93 |
+- enable_sse2="yes" |
94 |
+-]) |
95 |
++AS_IF([test "x${enable_sse2}" != "xno"], [MARISA_ENABLE_SSE2]) |
96 |
+ AC_MSG_RESULT([${enable_sse2}]) |
97 |
+ |
98 |
+ AC_MSG_CHECKING([whether to use SSE3]) |
99 |
+@@ -31,9 +79,7 @@ |
100 |
+ [use SSE3 [default=no]])], |
101 |
+ [], |
102 |
+ [enable_sse3="no"]) |
103 |
+-AS_IF([test "x${enable_sse3}" != "xno"], [ |
104 |
+- enable_sse3="yes" |
105 |
+-]) |
106 |
++AS_IF([test "x${enable_sse3}" != "xno"], [MARISA_ENABLE_SSE3]) |
107 |
+ AC_MSG_RESULT([${enable_sse3}]) |
108 |
+ |
109 |
+ AC_MSG_CHECKING([whether to use SSSE3]) |
110 |
+@@ -42,9 +88,7 @@ |
111 |
+ [use SSSE3 [default=no]])], |
112 |
+ [], |
113 |
+ [enable_ssse3="no"]) |
114 |
+-AS_IF([test "x${enable_ssse3}" != "xno"], [ |
115 |
+- enable_ssse3="yes" |
116 |
+-]) |
117 |
++AS_IF([test "x${enable_ssse3}" != "xno"], [MARISA_ENABLE_SSSE3]) |
118 |
+ AC_MSG_RESULT([${enable_ssse3}]) |
119 |
+ |
120 |
+ AC_MSG_CHECKING([whether to use SSE4.1]) |
121 |
+@@ -53,9 +97,7 @@ |
122 |
+ [use SSE4.1 [default=no]])], |
123 |
+ [], |
124 |
+ [enable_sse4_1="no"]) |
125 |
+-AS_IF([test "x${enable_sse4_1}" != "xno"], [ |
126 |
+- enable_sse4_1="yes" |
127 |
+-]) |
128 |
++AS_IF([test "x${enable_sse4_1}" != "xno"], [MARISA_ENABLE_SSE4_1]) |
129 |
+ AC_MSG_RESULT([${enable_sse4_1}]) |
130 |
+ |
131 |
+ AC_MSG_CHECKING([whether to use SSE4.2]) |
132 |
+@@ -64,9 +106,7 @@ |
133 |
+ [use SSE4.2 [default=no]])], |
134 |
+ [], |
135 |
+ [enable_sse4_2="no"]) |
136 |
+-AS_IF([test "x${enable_sse4_2}" != "xno"], [ |
137 |
+- enable_sse4_2="yes" |
138 |
+-]) |
139 |
++AS_IF([test "x${enable_sse4_2}" != "xno"], [MARISA_ENABLE_SSE4_2]) |
140 |
+ AC_MSG_RESULT([${enable_sse4_2}]) |
141 |
+ |
142 |
+ AC_MSG_CHECKING([whether to use SSE4]) |
143 |
+@@ -75,9 +115,7 @@ |
144 |
+ [use SSE4 [default=no]])], |
145 |
+ [], |
146 |
+ [enable_sse4="no"]) |
147 |
+-AS_IF([test "x${enable_sse4}" != "xno"], [ |
148 |
+- enable_sse4="yes" |
149 |
+-]) |
150 |
++AS_IF([test "x${enable_sse4}" != "xno"], [MARISA_ENABLE_SSE4]) |
151 |
+ AC_MSG_RESULT([${enable_sse4}]) |
152 |
+ |
153 |
+ AC_MSG_CHECKING([whether to use SSE4a]) |
154 |
+@@ -86,9 +124,7 @@ |
155 |
+ [use SSE4a [default=no]])], |
156 |
+ [], |
157 |
+ [enable_sse4a="no"]) |
158 |
+-AS_IF([test "x${enable_sse4a}" != "xno"], [ |
159 |
+- enable_sse4a="yes" |
160 |
+-]) |
161 |
++AS_IF([test "x${enable_sse4a}" != "xno"], [MARISA_ENABLE_SSE4A]) |
162 |
+ AC_MSG_RESULT([${enable_sse4a}]) |
163 |
+ |
164 |
+ AC_MSG_CHECKING([whether to use popcnt]) |
165 |
+@@ -97,9 +133,7 @@ |
166 |
+ [use POPCNT [default=no]])], |
167 |
+ [], |
168 |
+ [enable_popcnt="no"]) |
169 |
+-AS_IF([test "x${enable_popcnt}" != "xno"], [ |
170 |
+- enable_popcnt="yes" |
171 |
+-]) |
172 |
++AS_IF([test "x${enable_popcnt}" != "xno"], [MARISA_ENABLE_POPCNT]) |
173 |
+ AC_MSG_RESULT([${enable_popcnt}]) |
174 |
+ |
175 |
+ AS_IF([test "x${enable_popcnt}" != "xno"], [ |
176 |
+@@ -170,6 +204,7 @@ |
177 |
+ AS_ECHO([" LDFLAGS: ${LDFLAGS}"]) |
178 |
+ AS_ECHO([" PREFIX: ${prefix}"]) |
179 |
+ AS_ECHO([]) |
180 |
++AS_ECHO([" NATIVE: ${enable_native_code}"]) |
181 |
+ AS_ECHO([" SSE2: ${enable_sse2}"]) |
182 |
+ AS_ECHO([" SSE3: ${enable_sse3}"]) |
183 |
+ AS_ECHO([" SSSE3: ${enable_ssse3}"]) |
184 |
|
185 |
diff --git a/dev-libs/marisa/marisa-0.2.5.ebuild b/dev-libs/marisa/marisa-0.2.5.ebuild |
186 |
index e7ec8bf4f0d..90b71175c86 100644 |
187 |
--- a/dev-libs/marisa/marisa-0.2.5.ebuild |
188 |
+++ b/dev-libs/marisa/marisa-0.2.5.ebuild |
189 |
@@ -24,14 +24,8 @@ fi |
190 |
LICENSE="|| ( BSD-2 LGPL-2.1+ )" |
191 |
SLOT="0" |
192 |
KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~sparc ~x86" |
193 |
-IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 cpu_flags_x86_sse4_2 cpu_flags_x86_sse4a cpu_flags_x86_popcnt python static-libs" |
194 |
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) |
195 |
- cpu_flags_x86_sse3? ( cpu_flags_x86_sse2 ) |
196 |
- cpu_flags_x86_ssse3? ( cpu_flags_x86_sse3 ) |
197 |
- cpu_flags_x86_sse4_1? ( cpu_flags_x86_ssse3 ) |
198 |
- cpu_flags_x86_sse4_2? ( cpu_flags_x86_popcnt cpu_flags_x86_sse4_1 ) |
199 |
- cpu_flags_x86_sse4a? ( cpu_flags_x86_popcnt cpu_flags_x86_sse3 ) |
200 |
- cpu_flags_x86_popcnt? ( cpu_flags_x86_sse3 )" |
201 |
+IUSE="python static-libs" |
202 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
203 |
|
204 |
BDEPEND="python? ( |
205 |
${PYTHON_DEPS} |
206 |
@@ -44,6 +38,10 @@ if [[ "${PV}" != "9999" ]]; then |
207 |
S="${WORKDIR}/marisa-trie-${PV}" |
208 |
fi |
209 |
|
210 |
+PATCHES=( |
211 |
+ "${FILESDIR}/${P}-cpu_features_check.patch" |
212 |
+) |
213 |
+ |
214 |
src_prepare() { |
215 |
default |
216 |
eautoreconf |
217 |
@@ -58,14 +56,18 @@ src_prepare() { |
218 |
} |
219 |
|
220 |
src_configure() { |
221 |
+ local -x CPPFLAGS="${CPPFLAGS} ${CXXFLAGS}" |
222 |
+ |
223 |
local options=( |
224 |
- $(use_enable cpu_flags_x86_sse2 sse2) |
225 |
- $(use_enable cpu_flags_x86_sse3 sse3) |
226 |
- $(use_enable cpu_flags_x86_ssse3 ssse3) |
227 |
- $(use_enable cpu_flags_x86_sse4_1 sse4.1) |
228 |
- $(use_enable cpu_flags_x86_sse4_2 sse4.2) |
229 |
- $(use_enable cpu_flags_x86_sse4a sse4a) |
230 |
- $(use_enable cpu_flags_x86_popcnt popcnt) |
231 |
+ # Preprocessor macros dependent on CPPFLAGS are checked. |
232 |
+ --enable-sse2 |
233 |
+ --enable-sse3 |
234 |
+ --enable-ssse3 |
235 |
+ --enable-sse4.1 |
236 |
+ --enable-sse4.2 |
237 |
+ --enable-sse4 |
238 |
+ --enable-sse4a |
239 |
+ --enable-popcnt |
240 |
$(use_enable static-libs static) |
241 |
) |