diff --git a/configure.ac b/configure.ac index a256f3d4..458735e6 100644 --- a/configure.ac +++ b/configure.ac @@ -845,7 +845,18 @@ if test "${OPTIMIZECPU}" = "yes"; then # Try to autodetect cpu type CPU_NAME="unknown" CPU_TYPE="unknown" -if test -e "/proc/cpuinfo" ; then +if test -e "/proc/device-tree/model"; then + # explicit test for RPI3 as /proc/cpuinfo reports armv7 even though + # it is armv8 + RPI3=`grep "Raspberry Pi 3 Model" /proc/device-tree/model` + if test "x${RPI3}" != "x"; then + CPU_NAME="Raspberry Pi 3" + CPU_TYPE="Raspberry Pi 3" + CPU_OPTIONS="-mcpu=cortex-a53 -mfpu=neon-fp-armv8" + fi +fi + +if test "x${CPU_TYPE}" = "xunknown" && test -e "/proc/cpuinfo" ; then intel[[30]]="-march=i386" intel[[32]]="-march=i386" intel[[34]]="-march=i386" @@ -1045,11 +1056,11 @@ rm -f $TMPO rm -f $TMPC -if test "x${TMP}" = "x1" ; then +if test "x${TMP}" = "x0" ; then + echo "CPU optimization: $CPU_OPTIONS" +else CPU_OPTIONS="" echo "No CPU optimizations will be added" -else - echo "CPU optimization: $CPU_OPTIONS" fi else