mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-16 08:25:29 +00:00
Pass compile options via env. variables
This commit is contained in:
parent
929c27e339
commit
d8f6e9ff0e
@ -22,10 +22,22 @@ type gcc >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"gcc\
|
|||||||
type m4 >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; read -p "Press [Enter] to continue..."; exit 1; }
|
type m4 >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
type wget >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"wget\""; read -p "Press [Enter] to continue..."; exit 1; }
|
type wget >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"wget\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
|
|
||||||
if gcc -O3 -march=native -mcpu=native -mtune=native -fno-gcse -pipe -Q --help=target >> "$DIR/install.log" 2>&1; then
|
[ -z "$march" ] && march="native";
|
||||||
export CFLAGS="-O3 -march=native -mcpu=native -mtune=native -fno-gcse -pipe"
|
[ -z "$mcpu" ] && mcpu="native";
|
||||||
|
[ -z "$mtune" ] && mtune="native";
|
||||||
|
[ -z "$mcpu" ] && mcpu="native";
|
||||||
|
[ -z "$CFLAGS" ] && CFLAGS="";
|
||||||
|
|
||||||
|
gcc -O3 -march="$march" -mcpu="$mcpu" -mtune="$mtune" -fno-gcse $CFLAGS -Q --help=target >> "$DIR/install.log" 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
gcc -O3 -fno-gcse $CFLAGS -Q --help=target >> "$DIR/install.log" 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
export CFLAGS="-O3 -fno-gcse "
|
||||||
|
else
|
||||||
|
export CFLAGS="-O3 -fno-gcse $CFLAGS"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
export CFLAGS="-O3 -pipe"
|
export CFLAGS="-O3 -march=\"$march\" -mcpu=\"$mcpu\" -mtune=\"$mtune\" -fno-gcse $CFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user