--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,8 @@
+
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(fftw/planner.c)
 AM_INIT_AUTOMAKE(fftw, 2.1.5)
+AM_MAINTAINER_MODE
 
 dnl This is the version info according to the libtool versioning system.
 dnl It does *not* correspond to the release number.
@@ -27,7 +29,7 @@
 
 AC_ARG_ENABLE(float, [  --enable-float          compile fftw for single precision], enable_float=$enableval, enable_float=no)
 if test "$enable_float" = "yes"; then
-	AC_DEFINE(FFTW_ENABLE_FLOAT)
+	AC_DEFINE(FFTW_ENABLE_FLOAT,1,[Compile fftw for single precision])
 fi
 
 FFTW_PREFIX=""
@@ -56,27 +58,27 @@
 
 AC_ARG_ENABLE(i386-hacks, [  --enable-i386-hacks     enable gcc/x86 specific performance hacks], ok=$enableval, ok=no)
 if test "$ok" = "yes"; then
-	AC_DEFINE(FFTW_ENABLE_I386_HACKS)
+	AC_DEFINE(FFTW_ENABLE_I386_HACKS,1,[Enable x86 specific performance hacks])
 fi
 
 AC_ARG_ENABLE(pentium-timer, [  --enable-pentium-timer  enable high resolution Pentium timer], ok=$enableval, ok=no)
 if test "$ok" = "yes"; then
-	AC_DEFINE(FFTW_ENABLE_PENTIUM_TIMER)
+	AC_DEFINE(FFTW_ENABLE_PENTIUM_TIMER,1,[Enable high resolution Pentium timer])
 fi
 
 AC_ARG_ENABLE(debug, [  --enable-debug          compile fftw with extra runtime checks for debugging], ok=$enableval, ok=no)
 if test "$ok" = "yes"; then
-	AC_DEFINE(FFTW_DEBUG)
+	AC_DEFINE(FFTW_DEBUG,1,[Compile with extra rutime checks for debugging])
 fi
 
 AC_ARG_ENABLE(debug-alignment, [  --enable-debug-alignment          enable runtime checks for alignment on x86], ok=$enableval, ok=no)
 if test "$ok" = "yes"; then
-	AC_DEFINE(FFTW_DEBUG_ALIGNMENT)
+	AC_DEFINE(FFTW_DEBUG_ALIGNMENT,1,[Enable rutime checks for alignment on x86])
 fi
 
 AC_ARG_ENABLE(vec-recurse, [  --enable-vec-recurse    enable experimental performance hack], ok=$enableval, ok=no)
 if test "$ok" = "yes"; then
-	AC_DEFINE(FFTW_ENABLE_VECTOR_RECURSE)
+	AC_DEFINE(FFTW_ENABLE_VECTOR_RECURSE,1,[Enable experimental performance hack])
 fi
 
 dnl -----------------------------------------------------------------------
@@ -90,7 +92,6 @@
 ACX_PROG_CC_EGCS
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
-AC_PROG_RANLIB
 AC_PROG_LN_S
 AM_PROG_LIBTOOL
 AC_CHECK_PROG(PERL, perl, perl, echo perl)
@@ -115,7 +116,7 @@
 dnl -----------------------------------------------------------------------
 
 AC_SUBST(SHARED_VERSION_INFO)
-AC_DEFINE_UNQUOTED(FFTW_VERSION, "$VERSION")
+AC_DEFINE_UNQUOTED(FFTW_VERSION, "$VERSION",[Fftw Version])
 
 # Get the version number that will be appended to shared libraries:
 SHARED_VERSION=`echo $SHARED_VERSION_INFO | awk -F':' '{ print $1 "." $3 "." $2 }'`
@@ -123,7 +124,7 @@
 
 ACX_PROG_CC_MAXOPT
 
-ACX_GCC_ALIGNS_STACK(AC_DEFINE(FFTW_GCC_ALIGNS_STACK), [
+ACX_GCC_ALIGNS_STACK(AC_DEFINE(FFTW_GCC_ALIGNS_STACK,1,[Gcc align stack]), [
 	if test "$enable_i386_hacks" = yes; then
 	if test "${acx_gcc_stack_align_bug-no}" = yes; then
 		# we are using a gcc with a stack alignment bug, and we should
@@ -183,7 +184,7 @@
 AC_TRY_LINK([#include <math.h>
 ], if (!isnan(3.14159)) isnan(2.7183);, ok=yes, ok=no)
 if test "$ok" = "yes"; then
-	AC_DEFINE(HAVE_ISNAN)
+	AC_DEFINE(HAVE_ISNAN,1,[Have isnan])
 fi
 AC_MSG_RESULT(${ok})
 
@@ -196,7 +197,7 @@
 #endif
 ], [hrtime_t foobar;], ok=yes, ok=no)
 if test "$ok" = "yes"; then
-	AC_DEFINE(HAVE_HRTIME_T)
+	AC_DEFINE(HAVE_HRTIME_T,1,[Have hrtime_t type])
 fi
 AC_MSG_RESULT(${ok})
 
@@ -205,7 +206,7 @@
 
 AC_ARG_ENABLE(unsafe-mulmod, [  --enable-unsafe-mulmod  risk overflow for large prime sizes], enable_unsafe_mulmod=$enableval, enable_unsafe_mulmod=no)
 if test "$enable_unsafe_mulmod" = "yes"; then
-        AC_DEFINE(FFTW_ENABLE_UNSAFE_MULMOD)
+        AC_DEFINE(FFTW_ENABLE_UNSAFE_MULMOD,1,[Risk overflow  for lar prime sizes])
 fi
 
 
@@ -221,15 +222,25 @@
 FFTW_THREADS_INCLUDELIST=""
 FFTW_THREADS_PROGLIST=""
 THREADLIBS=""
+omp_enabler=unknown
 if test "$enable_threads" = "yes"; then
 	if test "$with_openmp"x != nox; then
 		AC_MSG_CHECKING(how to enable OpenMP)
-		omp_enabler=unknown
 		save_CFLAGS="$CFLAGS"
 		CFLAGS="$save_CFLAGS -omp"
 		AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS=" "
 			omp_enabler="$CC -omp")
 		if test -z "$THREADLIBS"; then
+			CFLAGS="$save_CFLAGS -fopenmp"
+			AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS="-lgomp"
+				omp_enabler="$CC -fopenmp")
+		fi
+		if test -z "$THREADLIBS"; then
+			CFLAGS="$save_CFLAGS -openmp"
+			AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS=" "
+				omp_enabler="$CC -openmp")
+		fi
+		if test -z "$THREADLIBS"; then
 			CFLAGS="$save_CFLAGS -mp"
 			AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS=" "
 				omp_enabler="$CC -mp")
@@ -240,68 +251,70 @@
 				omp_enabler="automatic")
 		fi
 		AC_MSG_RESULT($omp_enabler)
-		if test -z "$THREADLIBS"; then
-			AC_MSG_ERROR([don't know how to enable OpenMP])
+		if test x"$omp_enabler" != x"unknown"; then
+		       AC_DEFINE(FFTW_USING_OPENMP_THREADS,1,[Using OpenMP threads])
+		else
+		       AC_MSG_WARN([don't know how to enable OpenMP, reverting to POSIX threads])
 		fi
-		AC_DEFINE(FFTW_USING_OPENMP_THREADS)
+
 	fi
 	if test "$with_sgimp"x != nox; then
 		AC_MSG_CHECKING(how to enable SGI MP)
 		mp_enabler=unknown
 		save_CFLAGS="$CFLAGS"
 		CFLAGS="$save_CFLAGS -mp"
-		AC_TRY_LINK_FUNC(mp_set_numthreads,THREADLIBS=" "
+		AC_TRY_LINK_FUNC(mp_set_numthreads,THREADLIBS=""
 			mp_enabler="$CC -mp")
 		if test -z "$THREADLIBS"; then
 			CFLAGS="$save_CFLAGS"
-			AC_TRY_LINK_FUNC(mp_numthreads,THREADLIBS=" "
+			AC_TRY_LINK_FUNC(mp_numthreads,THREADLIBS=""
 				mp_enabler="automatic")
 		fi
 		AC_MSG_RESULT($mp_enabler)
 		if test -z "$THREADLIBS"; then 
 			AC_MSG_ERROR([don't know how to enable SGI MP])
 		fi
-		AC_DEFINE(FFTW_USING_SGIMP_THREADS)
+		AC_DEFINE(FFTW_USING_SGIMP_THREADS,1,[Using SGIMP Threads])
 	fi
 
 	# POSIX threads, the default choice:
-	if test -z "$THREADLIBS"; then
+	if test x"$omp_enabler" = x"unknown" ; then
 		sinclude(acx_pthread.m4)
 		ACX_PTHREAD([THREADLIBS="$PTHREAD_LIBS "
 	                     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 	                     CC="$PTHREAD_CC"
-	                     AC_DEFINE(FFTW_USING_POSIX_THREADS)])
+	                     AC_DEFINE(FFTW_USING_POSIX_THREADS,1,[Using POSIX Threads])])
 	fi
 	# Solaris threads:
 	if test -z "$THREADLIBS"; then
 		AC_CHECK_LIB(thread, thr_create,
 		             [THREADLIBS="-lthread"
-                	      AC_DEFINE(FFTW_USING_SOLARIS_THREADS)])
+                	      AC_DEFINE(FFTW_USING_SOLARIS_THREADS,1,[Using SOLARIS Threads])])
 	fi
 	# Mach C threads:
 	if test -z "$THREADLIBS"; then
 		AC_CHECK_FUNC(cthread_fork,
 		             [THREADLIBS=" "
-                	      AC_DEFINE(FFTW_USING_MACH_THREADS)])
+                	      AC_DEFINE(FFTW_USING_MACH_THREADS,1,[Using Mach Threads])])
 		AC_CHECK_HEADERS(mach/cthreads.h cthreads.h cthread.h)
 	fi
 	if test -z "$THREADLIBS"; then
 		AC_CHECK_LIB(cthread, cthread_fork,
 		             [THREADLIBS="-lcthread"
-                	      AC_DEFINE(FFTW_USING_MACH_THREADS)])
+                	      AC_DEFINE(FFTW_USING_MACH_THREADS,1,[Using Mach Threads])])
 		AC_CHECK_HEADERS(mach/cthreads.h cthreads.h cthread.h)
 	fi
 	if test -z "$THREADLIBS"; then
 		AC_CHECK_LIB(cthreads, cthread_fork,
 		             [THREADLIBS="-lcthreads"
-                	      AC_DEFINE(FFTW_USING_MACH_THREADS)])
+                	      AC_DEFINE(FFTW_USING_MACH_THREADS,1,[Using Mach Threads])])
 		AC_CHECK_HEADERS(mach/cthreads.h cthreads.h cthread.h)
 	fi
 	# BeOS threads:
 	if test -z "$THREADLIBS"; then
 		AC_CHECK_FUNC(spawn_thread,
 		             [THREADLIBS=" "
-                	      AC_DEFINE(FFTW_USING_BEOS_THREADS)])
+                	      AC_DEFINE(FFTW_USING_BEOS_THREADS,1,[Using BEOS Threads])])
 	fi
 	if test -z "$THREADLIBS"; then
 		AC_MSG_ERROR(couldn't find threads library for --enable-threads)
@@ -334,7 +347,7 @@
 	CC="$MPICC"
 	ok=yes
 	AC_TRY_LINK([#include <mpi.h>
-	], [MPI_Comm_f2c(0);], [AC_DEFINE(HAVE_MPI_COMM_F2C)], [ok=no])
+	], [MPI_Comm_f2c(0);], [AC_DEFINE(HAVE_MPI_COMM_F2C,1,[Has MPI COMM F2C])], [ok=no])
 	AC_MSG_RESULT($ok)
 	CC="$save_CC"
 else
