Index: trunk/psModules/configure
===================================================================
--- trunk/psModules/configure	(revision 1779)
+++ trunk/psModules/configure	(revision 1786)
@@ -464,5 +464,5 @@
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL GSL_CONFIG LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
@@ -1037,8 +1037,4 @@
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-psLib            Specify location of psLib files
-  --with-sla              Specify location of SLA.
-  --with-psLib-includes   Specify location of psLib header files
-  --with-psLib-lib        Specify location of psLib library file
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
@@ -1046,4 +1042,9 @@
   --with-tags[=TAGS]
                           include additional configurations [automatic]
+  --with-psLib=DIR        Specify location of psLib files
+  --with-sla=DIR          Specify location of SLA.
+  --with-cfitsio=DIR      Specify location of CFITSIO.
+  --with-fftw3=DIR        Specify location of FFTW version 3.
+  --with-gsl=DIR          Specify location of GSL.
 
 Some influential environment variables:
@@ -3034,45 +3035,7 @@
 
 
+
+
 CFLAGS="${CFLAGS=} -g2 -Wall -std=c99 -D_GNU_SOURCE"
-
-
-# Check whether --with-psLib or --without-psLib was given.
-if test "${with_psLib+set}" = set; then
-  withval="$with_psLib"
-
-CFLAGS="$CFLAGS -I$withval/include"
-LDFLAGS="$LDFLAGS -L$withval/lib"
-psLib_prefix=$withval
-
-fi;
-
-
-# Check whether --with-sla or --without-sla was given.
-if test "${with_sla+set}" = set; then
-  withval="$with_sla"
-
-CFLAGS="$CFLAGS -I$withval/include"
-SLA_LINK = `$withval/bin/sla_link`
-LDFLAGS="$LDFLAGS $SLA_LINK"
-psLib_prefix=$withval
-
-fi;
-
-
-# Check whether --with-psLib-includes or --without-psLib-includes was given.
-if test "${with_psLib_includes+set}" = set; then
-  withval="$with_psLib_includes"
-  \
-    CFLAGS="$CFLAGS -I$withval"
-fi;
-
-
-# Check whether --with-psLib-lib or --without-psLib-lib was given.
-if test "${with_psLib_lib+set}" = set; then
-  withval="$with_psLib_lib"
-  \
-    LDFLAGS="$LDFLAGS -L$withval"
-fi;
-
 
 # Find a good install program.  We prefer a C program (faster),
@@ -3154,5 +3117,4 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
 
 # Check whether --enable-shared or --disable-shared was given.
@@ -3764,5 +3726,5 @@
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3766 "configure"' > conftest.$ac_ext
+  echo '#line 3728 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -5331,5 +5293,5 @@
 
 # Provide some information about the compiler.
-echo "$as_me:5333:" \
+echo "$as_me:5295:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
@@ -6365,9 +6327,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6367: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6329: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6371: \$? = $ac_status" >&5
+   echo "$as_me:6333: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -6598,9 +6560,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6600: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6562: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6604: \$? = $ac_status" >&5
+   echo "$as_me:6566: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -6658,9 +6620,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6660: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6622: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6664: \$? = $ac_status" >&5
+   echo "$as_me:6626: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -7992,5 +7954,5 @@
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 7994 "configure"' > conftest.$ac_ext
+    echo '#line 7956 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -8863,5 +8825,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8865 "configure"
+#line 8827 "configure"
 #include "confdefs.h"
 
@@ -8961,5 +8923,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8963 "configure"
+#line 8925 "configure"
 #include "confdefs.h"
 
@@ -11140,9 +11102,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11142: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11104: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11146: \$? = $ac_status" >&5
+   echo "$as_me:11108: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -11200,9 +11162,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11202: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11164: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11206: \$? = $ac_status" >&5
+   echo "$as_me:11168: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -11711,5 +11673,5 @@
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 11713 "configure"' > conftest.$ac_ext
+    echo '#line 11675 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -12582,5 +12544,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12584 "configure"
+#line 12546 "configure"
 #include "confdefs.h"
 
@@ -12680,5 +12642,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12682 "configure"
+#line 12644 "configure"
 #include "confdefs.h"
 
@@ -13507,9 +13469,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13509: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13471: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13513: \$? = $ac_status" >&5
+   echo "$as_me:13475: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -13567,9 +13529,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13569: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13531: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13573: \$? = $ac_status" >&5
+   echo "$as_me:13535: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -14881,5 +14843,5 @@
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 14883 "configure"' > conftest.$ac_ext
+    echo '#line 14845 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -15622,9 +15584,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15624: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15586: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15628: \$? = $ac_status" >&5
+   echo "$as_me:15590: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -15855,9 +15817,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15857: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15819: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15861: \$? = $ac_status" >&5
+   echo "$as_me:15823: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -15915,9 +15877,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15917: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15879: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15921: \$? = $ac_status" >&5
+   echo "$as_me:15883: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -17249,5 +17211,5 @@
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 17251 "configure"' > conftest.$ac_ext
+    echo '#line 17213 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -18120,5 +18082,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18122 "configure"
+#line 18084 "configure"
 #include "confdefs.h"
 
@@ -18218,5 +18180,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18220 "configure"
+#line 18182 "configure"
 #include "confdefs.h"
 
@@ -19231,4 +19193,570 @@
 
 
+
+
+
+# Check whether --with-psLib or --without-psLib was given.
+if test "${with_psLib+set}" = set; then
+  withval="$with_psLib"
+
+CFLAGS="${CFLAGS=} -I$withval/include"
+LDFLAGS="${LDFLAGS=} -L$withval/lib"
+
+else
+
+CFLAGS="${CFLAGS=} -I$PSLIB_ROOT/include"
+LDFLAGS="${LDFLAGS=} -L$PSLIB_ROOT/lib"
+
+fi;
+
+
+# Check whether --with-sla or --without-sla was given.
+if test "${with_sla+set}" = set; then
+  withval="$with_sla"
+
+CFLAGS="${CFLAGS=} -I$withval/include"
+LDFLAGS="${LDFLAGS=} -L$withval/lib"
+
+fi;
+
+
+# Check whether --with-cfitsio or --without-cfitsio was given.
+if test "${with_cfitsio+set}" = set; then
+  withval="$with_cfitsio"
+
+CFLAGS="${CFLAGS=} -I$withval/include"
+LDFLAGS="${LDFLAGS=} -L$withval/lib"
+
+fi;
+
+
+# Check whether --with-fftw3 or --without-fftw3 was given.
+if test "${with_fftw3+set}" = set; then
+  withval="$with_fftw3"
+
+CFLAGS="${CFLAGS=} -I$withval/include"
+LDFLAGS="${LDFLAGS=} -L$withval/lib"
+
+fi;
+
+
+# Check whether --with-gsl or --without-gsl was given.
+if test "${with_gsl+set}" = set; then
+  withval="$with_gsl"
+
+# Extract the first word of "$withval/bin/gsl-config", so it can be a program name with args.
+set dummy $withval/bin/gsl-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GSL_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GSL_CONFIG"; then
+  ac_cv_prog_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GSL_CONFIG="$withval/bin/gsl-config"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+GSL_CONFIG=$ac_cv_prog_GSL_CONFIG
+if test -n "$GSL_CONFIG"; then
+  echo "$as_me:$LINENO: result: $GSL_CONFIG" >&5
+echo "${ECHO_T}$GSL_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+else
+
+# Extract the first word of "gsl-config", so it can be a program name with args.
+set dummy gsl-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GSL_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GSL_CONFIG"; then
+  ac_cv_prog_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GSL_CONFIG="`which gsl-config`"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+GSL_CONFIG=$ac_cv_prog_GSL_CONFIG
+if test -n "$GSL_CONFIG"; then
+  echo "$as_me:$LINENO: result: $GSL_CONFIG" >&5
+echo "${ECHO_T}$GSL_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+fi;
+if test "$GSL_CONFIG" != ""
+then
+    GSL_PREFIX="`${GSL_CONFIG} --prefix`"
+    GSL_LIBS="`${GSL_CONFIG} --libs`"
+    LDFLAGS="${LDFLAGS=} -L$GSL_PREFIX/lib$GSL_LIBS"
+    CFLAGS="${CFLAGS=} -I$GSL_PREFIX/include"
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lsla" >&5
+echo $ECHO_N "checking for main in -lsla... $ECHO_C" >&6
+if test "${ac_cv_lib_sla_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsla  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_sla_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_sla_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_sla_main" >&5
+echo "${ECHO_T}$ac_cv_lib_sla_main" >&6
+if test $ac_cv_lib_sla_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSLA 1
+_ACEOF
+
+  LIBS="-lsla $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: SLA library required" >&5
+echo "$as_me: error: SLA library required" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lcfitsio" >&5
+echo $ECHO_N "checking for main in -lcfitsio... $ECHO_C" >&6
+if test "${ac_cv_lib_cfitsio_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcfitsio  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_cfitsio_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_cfitsio_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_cfitsio_main" >&5
+echo "${ECHO_T}$ac_cv_lib_cfitsio_main" >&6
+if test $ac_cv_lib_cfitsio_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCFITSIO 1
+_ACEOF
+
+  LIBS="-lcfitsio $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: CFITSIO library required" >&5
+echo "$as_me: error: CFITSIO library required" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lfftw3f" >&5
+echo $ECHO_N "checking for main in -lfftw3f... $ECHO_C" >&6
+if test "${ac_cv_lib_fftw3f_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfftw3f  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_fftw3f_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_fftw3f_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_fftw3f_main" >&5
+echo "${ECHO_T}$ac_cv_lib_fftw3f_main" >&6
+if test $ac_cv_lib_fftw3f_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBFFTW3F 1
+_ACEOF
+
+  LIBS="-lfftw3f $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: FFTW3 library required" >&5
+echo "$as_me: error: FFTW3 library required" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lgsl" >&5
+echo $ECHO_N "checking for main in -lgsl... $ECHO_C" >&6
+if test "${ac_cv_lib_gsl_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gsl_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_gsl_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_gsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_gsl_main" >&6
+if test $ac_cv_lib_gsl_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGSL 1
+_ACEOF
+
+  LIBS="-lgsl $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: GSL library required" >&5
+echo "$as_me: error: GSL library required" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lgslcblas" >&5
+echo $ECHO_N "checking for main in -lgslcblas... $ECHO_C" >&6
+if test "${ac_cv_lib_gslcblas_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgslcblas  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gslcblas_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_gslcblas_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_gslcblas_main" >&5
+echo "${ECHO_T}$ac_cv_lib_gslcblas_main" >&6
+if test $ac_cv_lib_gslcblas_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGSLCBLAS 1
+_ACEOF
+
+  LIBS="-lgslcblas $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: GSL CBLAS library required" >&5
+echo "$as_me: error: GSL CBLAS library required" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lpslib" >&5
+echo $ECHO_N "checking for main in -lpslib... $ECHO_C" >&6
+if test "${ac_cv_lib_pslib_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpslib  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pslib_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pslib_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pslib_main" >&5
+echo "${ECHO_T}$ac_cv_lib_pslib_main" >&6
+if test $ac_cv_lib_pslib_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPSLIB 1
+_ACEOF
+
+  LIBS="-lpslib $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: psLib library required" >&5
+echo "$as_me: error: psLib library required" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 
@@ -19942,4 +20470,5 @@
 s,@ac_ct_F77@,$ac_ct_F77,;t t
 s,@LIBTOOL@,$LIBTOOL,;t t
+s,@GSL_CONFIG@,$GSL_CONFIG,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
