From: Maryam Tahhan Date: Tue, 7 Jun 2016 11:31:44 +0000 (+0100) Subject: configure: check AVX support X-Git-Tag: collectd-5.7.0~73^2~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b64c0510b32bb6a03c1b43d8a4718067f08e70aa;p=collectd.git configure: check AVX support Check AVX support before adding -mavx flag. Change-Id: I2de2a12704126590ef991de89880ad5bd5c3805e Signed-off-by: Maryam Tahhan --- diff --git a/configure.ac b/configure.ac index 09882996..5b7a9505 100644 --- a/configure.ac +++ b/configure.ac @@ -2457,7 +2457,25 @@ then then AC_MSG_ERROR([cannot link with dpdk in $DPDK_LIB_DIR]) fi - BUILD_WITH_DPDK_CFLAGS="-mavx -fPIC -I$DPDK_INCLUDE" + BUILD_WITH_DPDK_CFLAGS="" + AC_MSG_NOTICE([Checking for avx instructions]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( +[[ +#include +]], +[[ +__m128i zero = _mm_setzero_si128(); +]] + )], + [HAVE_AVX=true], [HAVE_AVX=false]) + if test "x$HAVE_AVX" = "xtrue" + then + BUILD_WITH_DPDK_CFLAGS="-mavx " + AC_MSG_NOTICE([avx instructions supported]) + fi + + BUILD_WITH_DPDK_CFLAGS+="-fPIC -I$DPDK_INCLUDE" if test "x$LOCAL_DPDK_INSTALL" != "xtrue" then BUILD_WITH_DPDK_LDFLAGS="-Wl,--no-as-needed"