Index: trunk/psLib/configure.in
===================================================================
--- trunk/psLib/configure.in	(revision 3127)
+++ trunk/psLib/configure.in	(revision 3136)
@@ -20,9 +20,9 @@
 CFLAGS="${CFLAGS=} -Wall -std=c99 -D_GNU_SOURCE"
 FFLAGS="-fno-second-underscore -O -fno-f2c"
-LDFLAGS=-release 5
+LDFLAGS="-release 5"
 
 dnl Setup the info for psLib for pkg-config
 PSLIB_CFLAGS="-I${includedir=}"
-PSLIB_LIBS="-L$libdir -lpslib"
+PSLIB_LIBS="-L${libdir} -lpslib"
 
 dnl ----------------- CFITSIO options --------------------
@@ -39,4 +39,6 @@
 CFLAGS="${CFLAGS=} $CFITSIO_CFLAGS"
 PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio"
+AC_CHECK_HEADERS([fitsio.h],[],
+   [AC_MSG_ERROR([CFITSIO is required.  Obtain it at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])])
 
 dnl ------------------ FFTW3 options ---------------------
@@ -53,36 +55,34 @@
 CFLAGS="${CFLAGS=} $FFTW3_CFLAGS"
 PSLIB_LIBS="${PSLIB_LIBS=} $FFTW3_LDFLAGS -lfftw3f"
+AC_CHECK_HEADERS([fftw3.h],[],
+   [AC_MSG_ERROR([FFTW version 3 with float support is required.  Obtain it at http://www.fftw.org/or use --with-fftw3 to specify location.])])
 
 dnl -------------------- GSL options ---------------------
-AC_ARG_WITH(gsl,
-[AS_HELP_STRING([--with-gsl=DIR],[Specify location of GSL.])],
-[AC_CHECK_PROG(GSL_CONFIG, $withval/bin/gsl-config, $withval/bin/gsl-config)],
-[AC_CHECK_PROG(GSL_CONFIG, gsl-config, `which gsl-config`)])
-if test "$GSL_CONFIG" != ""
-then
-    CFLAGS="${CFLAGS=} `${GSL_CONFIG} --cflags`"
-    PSLIB_LIBS="${PSLIB_LIBS=} `${GSL_CONFIG} --libs`"
-fi
-
+AC_ARG_WITH(gsl-config,
+[AS_HELP_STRING([--with-gsl-config=FILE],[Specify location of gsl-config.])],
+[GSL_CONFIG=$withval],
+[GSL_CONFIG=`which gsl-config`])
+AC_CHECK_FILE($GSL_CONFIG,[],
+    [AC_MSG_ERROR([GSL is required.  Obtain it at http://www.gnu.org/software/gsl or use --with-gsl-config to specify location.])])
+CFLAGS="${CFLAGS=} `${GSL_CONFIG} --cflags`"
+PSLIB_LIBS="${PSLIB_LIBS=} `${GSL_CONFIG} --libs`"
+   
 dnl ------------------- XML2 options ---------------------
-AC_ARG_WITH(xml,
-[AS_HELP_STRING([--with-xml=DIR],[Specify location of libxml2.])],
-[AC_CHECK_PROG(XML_CONFIG, $withval/bin/xml2-config, $withval/bin/xml2-config)],
-[AC_CHECK_PROG(XML_CONFIG, xml2-config, `which xml2-config`)])
-if test "$XML_CONFIG" != ""
-then
-    CFLAGS="${CFLAGS=} `${XML_CONFIG} --cflags`"
-    PSLIB_LIBS="${PSLIB_LIBS=} `${XML_CONFIG} --libs`"
-fi
+AC_ARG_WITH(xml2-config,
+[AS_HELP_STRING([--with-xml2-config=FILE],[Specify location of xml2-config.])],
+[XML_CONFIG=$withval],
+[XML_CONFIG=`which xml2-config`])
+AC_CHECK_FILE($XML_CONFIG,[],
+    [AC_MSG_ERROR([GNOME XML C parser is required.  Obtain it at http://www.xmlsoft.org or use --with-xml2-config to specify location.])])
+CFLAGS="${CFLAGS=} `${XML_CONFIG} --cflags`"
+PSLIB_LIBS="${PSLIB_LIBS=} `${XML_CONFIG} --libs`"
 
 dnl ------------------- SWIG options ---------------------
 AC_ARG_WITH(swig,
 [AS_HELP_STRING([--with-swig=FILE],[Specify location of SWIG executable.])],
-[AC_CHECK_PROG(SWIG, $withval, $withval)],
-[AC_CHECK_PROG(SWIG, swig, `which swig`)])
-if test "$SWIG" == ""
-then
-     AC_MSG_ERROR([SWIG is required.  Obtain it at www.swig.org or use --with-swig to specify its install location.]);
-fi
+[SWIG=$withval],
+[SWIG=`which swig`])
+AC_CHECK_FILE($SWIG,[],
+     [AC_MSG_ERROR([SWIG is required.  Obtain it at www.swig.org or use --with-swig to specify its install location.])])
 AC_SUBST(SWIG,$SWIG)
 
@@ -94,5 +94,5 @@
 if test "$PERL" == ""
 then
-     AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.]);
+     AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.])
 fi
 AC_SUBST(PERL,$PERL)
