diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-05 10:17:39 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-05 10:17:39 +0200 |
| commit | e419ca484e62f2771766a87bfaedf75a5f99c2b1 (patch) | |
| tree | 60bfdccf6c5f51ca4716ce9daece9fb40a9128ff /configure.sh | |
| parent | b17411249b17133f35833c202e6c2e4bf43b3298 (diff) | |
| download | nissy-core-e419ca484e62f2771766a87bfaedf75a5f99c2b1.tar.gz nissy-core-e419ca484e62f2771766a87bfaedf75a5f99c2b1.zip | |
Changed build options TYPE -> ARCH
Diffstat (limited to 'configure.sh')
| -rwxr-xr-x | configure.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/configure.sh b/configure.sh index e12dc06..2b68478 100755 --- a/configure.sh +++ b/configure.sh | |||
| @@ -12,15 +12,25 @@ detectsan() { | |||
| 12 | 12 | ||
| 13 | [ -n "$(detectarch __AVX2__)" ] && detected="AVX2" | 13 | [ -n "$(detectarch __AVX2__)" ] && detected="AVX2" |
| 14 | [ -n "$(detectarch __ARM_NEON)" ] && detected="NEON" | 14 | [ -n "$(detectarch __ARM_NEON)" ] && detected="NEON" |
| 15 | [ -z "$detected" ] && detected="PORTABLE" | ||
| 15 | 16 | ||
| 16 | TYPE=${TYPE-"$detected"} | 17 | ARCH=${ARCH-"$detected"} |
| 18 | |||
| 19 | case "$ARCH" in | ||
| 20 | AVX2|NEON|PORTABLE) | ||
| 21 | ;; | ||
| 22 | *) | ||
| 23 | echo "Error: architecture $ARCH not supported" | ||
| 24 | exit 1 | ||
| 25 | ;; | ||
| 26 | esac | ||
| 17 | 27 | ||
| 18 | STD="-std=c99" | 28 | STD="-std=c99" |
| 19 | WFLAGS="-pedantic -Wall -Wextra" | 29 | WFLAGS="-pedantic -Wall -Wextra" |
| 20 | # -Wstringop-overflow seems to be causing problems when combined with -O3 | 30 | # -Wstringop-overflow seems to be causing problems when combined with -O3 |
| 21 | # Someone else complained here: https://access.redhat.com/solutions/6755371 | 31 | # Someone else complained here: https://access.redhat.com/solutions/6755371 |
| 22 | WNOFLAGS="-Wno-unused-parameter -Wno-unused-function -Wno-stringop-overflow" | 32 | WNOFLAGS="-Wno-unused-parameter -Wno-unused-function -Wno-stringop-overflow" |
| 23 | [ "$TYPE" = "AVX2" ] && AVX="-mavx2" | 33 | [ "$ARCH" = "AVX2" ] && AVX="-mavx2" |
| 24 | [ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" | 34 | [ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" |
| 25 | [ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" | 35 | [ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" |
| 26 | SAN="$ADDR $UNDEF" | 36 | SAN="$ADDR $UNDEF" |
| @@ -29,11 +39,11 @@ LIBS="-lpthread" | |||
| 29 | CFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $AVX -O3" | 39 | CFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $AVX -O3" |
| 30 | DBGFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $SAN $AVX -g3 -DDEBUG" | 40 | DBGFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $SAN $AVX -g3 -DDEBUG" |
| 31 | 41 | ||
| 32 | echo "Cube type: CUBE_$TYPE" | 42 | echo "Selected architecture: $ARCH" |
| 33 | echo "Compiler: ${CC:-cc}" | 43 | echo "Compiler: ${CC:-cc}" |
| 34 | 44 | ||
| 35 | { | 45 | { |
| 36 | echo "CUBETYPE = CUBE_$TYPE"; | 46 | echo "ARCH = $ARCH"; |
| 37 | echo ""; | 47 | echo ""; |
| 38 | echo "CFLAGS = $CFLAGS"; | 48 | echo "CFLAGS = $CFLAGS"; |
| 39 | echo "DBGFLAGS = $DBGFLAGS"; | 49 | echo "DBGFLAGS = $DBGFLAGS"; |
