1 AC_DEFUN([RFX_CHECK_FFTW],
3 OLDCPPFLAGS="${CPPFLAGS}"
6 AC_CHECK_LIB(fftw3, fftw_plan_dft_r2c_2d, [HAVE_LIBFFTW3=1],)
7 AC_CHECK_HEADERS(fftw3.h,[HAVE_FFTW3_H=1])
9 if test "x${HAVE_LIBFFTW3}" != "x";then
10 if test "x${HAVE_FFTW3_H}" != "x";then
15 if test "x${HAVE_FFTW3}" = "x1"; then
17 AC_MSG_CHECKING([whether we can compile the fftw3 test program])
19 cat > conftest.c << EOF
25 fftw_plan plan = fftw_plan_dft_2d(600, 800, (fftw_complex*)data, (fftw_complex*)data, FFTW_FORWARD, FFTW_ESTIMATE);
26 plan = fftw_plan_dft_r2c_2d(600, 800, (double*)data, (fftw_complex*)data, FFTW_ESTIMATE);
27 plan = fftw_plan_dft_c2r_2d(600, 800, (fftw_complex*)data, (double*)data, FFTW_ESTIMATE);
29 fftw_destroy_plan(plan);
33 ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
34 if { (eval echo fftw3.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
36 AC_DEFINE([HAVE_FFTW3], [1], [Define if fftw3 is available])
38 echo "configure: failed program was:" >&5
46 # if the above didn't work out, reset all changes to the compiler variables.
47 if test "x${HAVE_FFTW3}" "!=" "x1"; then