summaryrefslogtreecommitdiff
path: root/dev-python/numpy/files/replace_cpuflags.awk
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/numpy/files/replace_cpuflags.awk')
-rw-r--r--dev-python/numpy/files/replace_cpuflags.awk14
1 files changed, 14 insertions, 0 deletions
diff --git a/dev-python/numpy/files/replace_cpuflags.awk b/dev-python/numpy/files/replace_cpuflags.awk
new file mode 100644
index 000000000000..11b8bd53b2c3
--- /dev/null
+++ b/dev-python/numpy/files/replace_cpuflags.awk
@@ -0,0 +1,14 @@
+#!/usr/bin/awk -f
+
+{
+ GENTOO_ENABLE=1;
+ if (match($0, /flags="([^"=]*)"/, cflags)) {
+ split(cflags[1], fields);
+ for (i in fields) {
+ if (match(fields[i], /-m([[:graph:]]*)/, inst)) {
+ if (!index(enabled_flags, inst[1])) {
+ GENTOO_ENABLE=0;
+ }}}}
+ if (!GENTOO_ENABLE) { sub(cflags[1], "-mGENTOO_DISABLE"); }
+ print;
+}