diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 68 |
1 files changed, 42 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac index 9a1816a..9826a91 100644 --- a/configure.ac +++ b/configure.ac @@ -48,56 +48,74 @@ AC_PROG_MKDIR_P EXTRA="" AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--disable-debug], [Disable debugger symbols])], - [], [enable_debug=yes]) + [AS_HELP_STRING([--enable-debug], [Enable debugger symbols])], + [], [enable_debug=no]) AC_ARG_ENABLE([prof], [AS_HELP_STRING([--enable-prof], [Enable profiling])], [], [enable_prof=no]) AC_ARG_WITH([debug-malloc], - [AS_HELP_STRING([--with-debug-malloc[=yes|no|duma|efence|...]], + [AS_HELP_STRING([--with-debug-malloc[=no|yes|duma|efence|...]], [Add malloc debugger support])], - [], [with_debug_malloc=yes]) + [], [with_debug_malloc=no]) AC_ARG_ENABLE([trace], [AS_HELP_STRING([--enable-trace], [Enable trace output])], [], [enable_trace=no]) + +# Which FFT library to use AC_ARG_ENABLE([fft_simd], - [AS_HELP_STRING([--enable-fft-simd], [Enable SIMD instructions for kiss-fft (unstable)])], + [AS_HELP_STRING([--enable-fft-simd], + [Enable SIMD instructions for kiss-fft (unstable)])], [], [enable_fft_simd=no]) -AC_ARG_ENABLE([fftw], - [AS_HELP_STRING([--enable-fftw], [Use FFTW3 instead of Kiss FFT])], - [], [enable_fftw=no]) +AC_ARG_ENABLE([kiss_fft], + [AS_HELP_STRING([--enable-kiss-fft], [Prefer KISS FFT over FFTW3])], + [], [enable_kiss=no]) + # ZeroMQ message queue input AC_ARG_ENABLE([input_zeromq], AS_HELP_STRING([--enable-input-zeromq], [Enable ZeroMQ input])) + # UHD support control AC_ARG_ENABLE([output_uhd], [AS_HELP_STRING([--enable-output-uhd], [Enable UHD output])], [], [enable_output_uhd=yes]) +AS_IF([test "x$enable_kiss" = "xno"], + [PKG_CHECK_MODULES([FFTW], [fftw3f], enable_fftw=yes, enable_fftw=no)], + [enable_fftw=no]) + +AS_IF([test "x$enable_fftw" = "xyes"], + AC_MSG_NOTICE([Found FFTW3]), + AC_MSG_NOTICE([Using Kiss FFT]) ) + +echo "Checking input zeromq" + AS_IF([test "x$enable_input_zeromq" = "xyes"], [AC_DEFINE(HAVE_INPUT_ZEROMQ, [1], [Define if ZeroMQ input is enabled]) , AC_CHECK_LIB(zmq, zmq_init, ,[AC_MSG_ERROR([ZeroMQ libzmq is required])])]) AS_IF([test "x$enable_debug" = "xno"], [OPTIM="-O2" DEBUG="" EXTRA="$EXTRA -DNDEBUG"], - [OPTIM="-O0" DEBUG="-ggdb" EXTRA="$EXTRA -Wall"]) + [OPTIM="-O0" DEBUG="-ggdb" EXTRA="$EXTRA"]) AS_IF([test "x$enable_prof" != "xno"], [EXTRA="$EXTRA -pg"]) -AS_IF([test "x$enable_trace" != "xno"], - [EXTRA="$EXTRA -DDEBUG"]) -AS_IF([test "x$enable_fft_simd" != "xno"], - [EXTRA="$EXTRA -DUSE_SIMD"]) -AS_IF([test "x$enable_fftw" != "xno"], - [EXTRA="$EXTRA -DUSE_FFTW"]) +# Define conditionals for Makefile.am AM_CONDITIONAL([USE_KISS_FFT], [test "x$enable_fftw" = "xno"]) - +AM_CONDITIONAL([DEBUG], [test "x$enable_trace" = "xyes"]) AM_CONDITIONAL([HAVE_INPUT_ZEROMQ_TEST], [test "x$enable_input_zeromq" = "xyes"]) +AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git']) +# Defines for config.h +AS_IF([test "x$enable_fft_simd" = "xyes"], + [AC_DEFINE(USE_SIMD, [1], [Define to enable KISS FFT SIMD])]) +AS_IF([test "x$enable_fftw" = "xno"], + [AC_DEFINE(USE_KISS_FFT, [1], [Define to enable KISS])]) +AS_IF([test "x$enable_fftw" = "xyes"], + [AC_DEFINE(USE_FFTW, [1], [Define to enable FFTW])]) -AC_SUBST([CFLAGS], ["$OPTIM $DEBUG $EXTRA"]) -AC_SUBST([CXXFLAGS], ["$OPTIM $DEBUG $EXTRA"]) +AC_SUBST([CFLAGS], ["$OPTIM $DEBUG $EXTRA $FFTW_CFLAGS"]) +AC_SUBST([CXXFLAGS], ["$OPTIM $DEBUG $EXTRA $FFTW_LIBS"]) -# Checks for libraries. +# Checks for UHD. AS_IF([test "x$enable_output_uhd" = "xyes"], [AC_DEFINE(HAVE_OUTPUT_UHD, [1], [Define if UHD output is enabled]) , AC_CHECK_LIB([uhd], [main], [], [AC_MSG_ERROR([library uhd is missing])])]) @@ -110,11 +128,8 @@ AC_CHECK_LIB([boost_thread], [main], [], [AC_MSG_ERROR([library boost_thread is AC_CHECK_LIB([rt], [clock_gettime], [], [AC_MSG_ERROR([library rt is missing])]) -AS_IF([test "x$enable_fftw" != "xno"], - [AC_CHECK_LIB([fftw3f], [fftw_execute], - AC_MSG_NOTICE([Found FFTW3]), - AC_MSG_NOTICE([Failed to find FFTW3]) )] ) - +# Tests for different memory allocation debuggers. +# Valgrind doesn't need any. AS_IF([test "x$enable_debug" != "xno"], [AS_IF([test "x$with_debug_malloc" != "xno"], [AS_IF([test "x$with_debug_malloc" = "xyes"], @@ -145,6 +160,7 @@ AC_COMPILE_IFELSE( [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_DEFINE([M_PIl], [M_PI], [Replacing define])]) AC_LANG_POP([C++]) + # Check for SSE AC_MSG_CHECKING(for SSE in current arch/CFLAGS) AC_LINK_IFELSE([ @@ -165,7 +181,7 @@ AC_MSG_RESULT($has_sse) AM_CONDITIONAL([HAVE_SSE], [test "x$has_sse" = "xyes"]) -AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git']) +# TODO: Check for NEON AC_TYPE_SIGNAL AC_CHECK_FUNCS([bzero floor ftime gettimeofday memset sqrt strchr strerror strtol]) @@ -197,7 +213,7 @@ disabled="" for feat in with_debug_malloc has_sse do eval var=\$$feat - AS_IF([test "x$var" = "xyes"], + AS_IF([test "x$var" != "xno"], [enabled="$enabled $feat"], [disabled="$disabled $feat"]) done |