summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Meerwald <p.meerwald@bct-electronic.com>2013-03-28 14:46:48 +0100
committerTanu Kaskinen <tanuk@iki.fi>2013-03-29 10:32:57 +0200
commit300a43a1070cc41d691c8d14cbb3260abdfeb6f9 (patch)
tree6f2c34a36bcb74c85a6ae7dcbde06f71c06930e4
parenta6c27a1fe523f35edc618a1b0bcfc52f594ea3c2 (diff)
build: make ARM NEON check in configure.ac more strict
the check for NEON so far only checked if -mfpu=neon is understood by the compiler, however, this is not enough: (i) #include <arm_neon.h> should be checked (ii) -mfpu=neon must be passed before CFLAGS because eventually the per-library CFLAGS for NEON code in src/Makefile.am are passed to the compiler before the global CFLAGS in case the build environment passes CFLAGS to configure and we try to set conflicting CFLAGS option, the former take precedence; CFLAGS cannot be overridden this does not fix http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-December/015570.html but at least makes the build fail in configure (and not while compiling stuff) and gives better diagnostics Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
-rw-r--r--configure.ac6
1 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 82b88162..ba9111aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -325,9 +325,9 @@ AC_ARG_ENABLE([neon-opt],
AS_HELP_STRING([--enable-neon-opt], [Enable NEON optimisations on ARM CPUs that support it]))
AS_IF([test "x$enable_neon_opt" != "xno"],
- [save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -mfpu=neon"
+ [save_CFLAGS="$CFLAGS"; CFLAGS="-mfpu=neon $CFLAGS"
AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([], []),
+ AC_LANG_PROGRAM([[#include <arm_neon.h>]], []),
[
HAVE_NEON=1
NEON_CFLAGS="-mfpu=neon"
@@ -341,7 +341,7 @@ AS_IF([test "x$enable_neon_opt" != "xno"],
[HAVE_NEON=0])
AS_IF([test "x$enable_neon_opt" = "xyes" && test "x$HAVE_NEON" = "x0"],
- [AC_MSG_ERROR([*** Compiler does not support -mfpu=neon])])
+ [AC_MSG_ERROR([*** Compiler does not support -mfpu=neon or CFLAGS override -mfpu])])
AC_SUBST(HAVE_NEON)
AC_SUBST(NEON_CFLAGS)