aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am8
-rw-r--r--configure.ac19
2 files changed, 12 insertions, 15 deletions
diff --git a/Makefile.am b/Makefile.am
index 5f73f3b..65c48c5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,12 +31,6 @@ else
GITVERSION_FLAGS =
endif
-if HAVE_SSE
-SIMD_CFLAGS = -msse -msse2
-else
-SIMD_CFLAGS =
-endif
-
bin_PROGRAMS = odr-dabmod
FFT_DIR=lib/kiss_fft129
@@ -71,7 +65,7 @@ FFT_FLG=
endif
odr_dabmod_CPPFLAGS = -Wall -Isrc \
- $(FFT_INC) $(FFT_FLG) $(SIMD_CFLAGS) $(GITVERSION_FLAGS)
+ $(FFT_INC) $(FFT_FLG) $(GITVERSION_FLAGS)
odr_dabmod_LDADD = $(FFT_LDADD)
odr_dabmod_SOURCES = src/DabMod.cpp \
src/PcDebug.h \
diff --git a/configure.ac b/configure.ac
index 821ba1f..5c3235c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,21 +164,24 @@ AC_LANG_POP([C++])
# Check for SSE
AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
-AC_LINK_IFELSE([
-AC_LANG_PROGRAM([[
+
+save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -msse"
+AC_MSG_CHECKING([whether we need to add -msse])
+AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[
#include <xmmintrin.h>
__m128 testfunc(float *a, float *b) {
return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
}
]])],
-[
-has_sse=yes
-],
-[
-has_sse=no
-]
+[has_sse=yes],
+[has_sse=no]
)
AC_MSG_RESULT($has_sse)
+if test x"$has_sse" = xno; then
+ CXXFLAGS="$save_CXXFLAGS"
+fi
+
AM_CONDITIONAL([HAVE_SSE], [test "x$has_sse" = "xyes"])