Index: trunk/psLib/configure.ac
===================================================================
--- trunk/psLib/configure.ac	(revision 18958)
+++ trunk/psLib/configure.ac	(revision 18959)
@@ -189,10 +189,25 @@
 LDFLAGS="${LDFLAGS} ${FFTW3_LDFLAGS}"
 
+AC_CHECK_LIB(fftw3f,fftwf_plan_dft_2d,[],
+  [AC_MSG_ERROR([FFTW version 3 (--enable-float) library not found.  Obtain it at http://www.fftw.org/ or use --with-fftw3 to specify location.])])
+
+FFTW_THREADS=0
+AC_CHECK_LIB(fftw3f,fftwf_init_threads,[FFTW_THREADS=1],
+  [AC_CHECK_LIB(fftw3f_threads,fftwf_init_threads, [
+    FFTW_THREADS=1
+    PSLIB_LIBS="${PSLIB_LIBS=} -lfftw3f_threads"],
+   AC_MSG_WARN([FFTW version 3 not compiled with thread support (--enable-threads)])
+   )]
+)
+
+dnl AC_CHECK_LIB(fftw3f,fftwf_plan_dft_2d,[],
+dnl   [AC_MSG_ERROR([FFTW version 3 (--enable-float) library not found.  Obtain it at http://www.fftw.org/ or use --with-fftw3 to specify location.])],[-lm]
+dnl )
+
 AC_CHECK_HEADERS([fftw3.h],[],
   [AC_MSG_ERROR([FFTW version 3 (--enable-float) headers not found.  Obtain it at http://www.fftw.org/ or use --with-fftw3 to specify location.])]
 )
-AC_CHECK_LIB(fftw3f,fftwf_plan_dft_2d,[],
-  [AC_MSG_ERROR([FFTW version 3 (--enable-float) library not found.  Obtain it at http://www.fftw.org/ or use --with-fftw3 to specify location.])],[-lm]
-)
+
+AC_DEFINE_UNQUOTED([HAVE_FFTW_THREADS],${FFTW_THREADS},[Define to 1 if you have FFTW compiled with thread support])
 
 AC_SUBST([FFTW3_CFLAGS])
