mirror of
https://gitlab.com/xonotic/xonotic
synced 2025-03-05 02:47:33 +00:00
only add -mtune=native if it works
This commit is contained in:
parent
f5d0d12e73
commit
4f99f1701c
15
all
15
all
@ -951,7 +951,9 @@ case "$cmd" in
|
||||
[5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
|
||||
# gcc 4.3 or higher
|
||||
# -march=native is broken < 4.3
|
||||
export CC="$CC -mtune=native -march=native"
|
||||
if $CC -mtune=native -march=native misc/tools/conftest.c -o conftest >/dev/null 2>&1; then
|
||||
export CC="$CC -mtune=native -march=native"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [ -n "$WE_HATE_OUR_USERS" ]; then
|
||||
@ -1031,6 +1033,17 @@ case "$cmd" in
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if ! verbose $CC misc/tools/conftest.c -o conftest; then
|
||||
msg ""
|
||||
msg "COMPILER"
|
||||
msg ""
|
||||
msg "Y U NO COMPILE CODE?"
|
||||
msg ""
|
||||
exit 1
|
||||
fi
|
||||
rm -f conftest
|
||||
|
||||
verbose cd "$d0/d0_blind_id"
|
||||
if ! $compiled0; then
|
||||
# compilation of crypto library failed
|
||||
|
7
misc/tools/conftest.c
Normal file
7
misc/tools/conftest.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user