diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 11:19:14 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 11:19:14 +0100 |
| commit | a9ce50120b68db3669aaadeac348db8926bc15c4 (patch) | |
| tree | 33cd118de37634970503553197370776564bce10 /configure.sh | |
| parent | c5fb4d1c0f0ecc30673a46e517dc82c5af2af5ef (diff) | |
| download | nissy-core-a9ce50120b68db3669aaadeac348db8926bc15c4.tar.gz nissy-core-a9ce50120b68db3669aaadeac348db8926bc15c4.zip | |
Improved architecture detection
Diffstat (limited to 'configure.sh')
| -rwxr-xr-x | configure.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.sh b/configure.sh index 9a790ca..b9779c2 100755 --- a/configure.sh +++ b/configure.sh | |||
| @@ -1,8 +1,13 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | cc -mavx2 utils/detect-immintrin.c && detected="AVX2" && rm a.out | 3 | detect() { cc -march=native -dM -E - < /dev/null | grep "$1"; } |
| 4 | |||
| 5 | [ -n "$(detect __AVX2__)" ] && detected="AVX2" | ||
| 6 | |||
| 4 | TYPE=${TYPE-"$detected"} | 7 | TYPE=${TYPE-"$detected"} |
| 5 | 8 | ||
| 9 | echo "Using CUBE_$TYPE" | ||
| 10 | |||
| 6 | STD="-std=c99" | 11 | STD="-std=c99" |
| 7 | WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" | 12 | WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" |
| 8 | [ "$TYPE" = "AVX2" ] && AVX="-mavx2" | 13 | [ "$TYPE" = "AVX2" ] && AVX="-mavx2" |
