aboutsummaryrefslogtreecommitdiff
path: root/configure.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-09-05 10:17:39 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-09-05 10:17:39 +0200
commite419ca484e62f2771766a87bfaedf75a5f99c2b1 (patch)
tree60bfdccf6c5f51ca4716ce9daece9fb40a9128ff /configure.sh
parentb17411249b17133f35833c202e6c2e4bf43b3298 (diff)
downloadnissy-core-e419ca484e62f2771766a87bfaedf75a5f99c2b1.tar.gz
nissy-core-e419ca484e62f2771766a87bfaedf75a5f99c2b1.zip
Changed build options TYPE -> ARCH
Diffstat (limited to 'configure.sh')
-rwxr-xr-xconfigure.sh18
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
16TYPE=${TYPE-"$detected"} 17ARCH=${ARCH-"$detected"}
18
19case "$ARCH" in
20AVX2|NEON|PORTABLE)
21 ;;
22*)
23 echo "Error: architecture $ARCH not supported"
24 exit 1
25 ;;
26esac
17 27
18STD="-std=c99" 28STD="-std=c99"
19WFLAGS="-pedantic -Wall -Wextra" 29WFLAGS="-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
22WNOFLAGS="-Wno-unused-parameter -Wno-unused-function -Wno-stringop-overflow" 32WNOFLAGS="-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"
26SAN="$ADDR $UNDEF" 36SAN="$ADDR $UNDEF"
@@ -29,11 +39,11 @@ LIBS="-lpthread"
29CFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $AVX -O3" 39CFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $AVX -O3"
30DBGFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $SAN $AVX -g3 -DDEBUG" 40DBGFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $SAN $AVX -g3 -DDEBUG"
31 41
32echo "Cube type: CUBE_$TYPE" 42echo "Selected architecture: $ARCH"
33echo "Compiler: ${CC:-cc}" 43echo "Compiler: ${CC:-cc}"
34 44
35{ 45{
36echo "CUBETYPE = CUBE_$TYPE"; 46echo "ARCH = $ARCH";
37echo ""; 47echo "";
38echo "CFLAGS = $CFLAGS"; 48echo "CFLAGS = $CFLAGS";
39echo "DBGFLAGS = $DBGFLAGS"; 49echo "DBGFLAGS = $DBGFLAGS";

Generated with cgit - Back to sebastiano.tronto.net