mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 03:35:33 +00:00
Fixed #1171
This commit is contained in:
parent
1b5dc2db4d
commit
112c35c3a1
@ -119,6 +119,14 @@ elif [ -z "$CFLAGS" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat > test.c <<'CTEST'
|
||||||
|
#include <stdio.h>
|
||||||
|
main(){
|
||||||
|
printf("Hello world\n");
|
||||||
|
}
|
||||||
|
CTEST
|
||||||
|
|
||||||
|
|
||||||
type $CC >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"$CC\""; read -p "Press [Enter] to continue..."; exit 1; }
|
type $CC >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"$CC\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
|
|
||||||
[ -z "$THREADS" ] && THREADS=1;
|
[ -z "$THREADS" ] && THREADS=1;
|
||||||
@ -128,11 +136,23 @@ type $CC >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"$CC\
|
|||||||
[ -z "$LDFLAGS" ] && LDFLAGS="";
|
[ -z "$LDFLAGS" ] && LDFLAGS="";
|
||||||
[ -z "$CONFIGURE_FLAGS" ] && CONFIGURE_FLAGS="";
|
[ -z "$CONFIGURE_FLAGS" ] && CONFIGURE_FLAGS="";
|
||||||
|
|
||||||
|
|
||||||
if [ "$mtune" != "none" ]; then
|
if [ "$mtune" != "none" ]; then
|
||||||
export CFLAGS="-O2 -march=$march -mtune=$mtune -fno-gcse $CFLAGS"
|
$CC -march=$march -mtune=$mtune $CFLAGS -o test test.c >> "$DIR/install.log" 2>&1
|
||||||
else
|
if [ $? -eq 0 ]; then
|
||||||
export CFLAGS="-O2 -march=$march -fno-gcse $CFLAGS"
|
CFLAGS="-march=$march -mtune=$mtune -fno-gcse $CFLAGS"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
$CC -march=$march $CFLAGS -o test test.c >> "$DIR/install.log" 2>&1
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
CFLAGS="-march=$march -fno-gcse $CFLAGS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm test >> "$DIR/install.log" 2>&1
|
||||||
|
rm test.c >> "$DIR/install.log" 2>&1
|
||||||
|
|
||||||
|
export CFLAGS="-O2 $CFLAGS"
|
||||||
export LDFLAGS="$LDFLAGS"
|
export LDFLAGS="$LDFLAGS"
|
||||||
|
|
||||||
rm -r -f install_data/ >> "$DIR/install.log" 2>&1
|
rm -r -f install_data/ >> "$DIR/install.log" 2>&1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user