Files
gentoo/dev-python/numpy/files/replace_cpuflags.awk
Benda Xu ea2987349e dev-python/numpy: expose the CPU_FALGS_X86 switches.
This patch allows users to switch the CPU flags.  It saves
distutils-probing time and avoids build errors when distutils figures
out a wrong CPU-feature set.

I do not have a good understanding of the CPU flags in the new
dev-python/meson-python build system.  Therefore 1.25.0 is not
touched.

Signed-off-by: Benda Xu <heroxbd@gentoo.org>
2023-07-08 19:30:11 +08:00

15 lines
405 B
Awk

#!/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;
}