Index: trunk/psLib/src/sys/psConfigure.c
===================================================================
--- trunk/psLib/src/sys/psConfigure.c	(revision 18953)
+++ trunk/psLib/src/sys/psConfigure.c	(revision 23115)
@@ -12,9 +12,7 @@
  *  @author Ross Harman, MHPCC
  *  @author Robert DeSonia, MHPCC
+ *  @author Paul Price, IfA
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-08-08 18:05:08 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
+ *  Copyright 2004-2009 Institute for Astronomy, University of Hawaii
  */
 
@@ -26,4 +24,12 @@
 #include <stdlib.h>
 #include <string.h>
+
+#include <fitsio.h>
+#include <longnam.h>
+#include <fftw3.h>
+#include <gsl/gsl_version.h>
+#ifdef HAVE_PSDB
+#include <mysql.h>
+#endif
 
 #include "psAbort.h"
@@ -41,26 +47,55 @@
 static FILE *memCheckFile = NULL;       // File to which to write results of mem check
 
-static const char *cvsTag = "$Name: not supported by cvs2svn $"; // CVS tag name
 
 psString psLibVersion(void)
 {
-    psString version = NULL;            // Version, to return
-    psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
-    return version;
+#ifndef PSLIB_VERSION
+#error "PSLIB_VERSION is not set"
+#endif
+#ifndef PSLIB_BRANCH
+#error "PSLIB_BRANCH is not set"
+#endif
+    return psStringCopy(PSLIB_BRANCH "@" PSLIB_VERSION);
+}
+
+psString psLibSource(void)
+{
+#ifndef PSLIB_SOURCE
+#error "PSLIB_SOURCE is not set"
+#endif
+    return psStringCopy(PSLIB_SOURCE);
 }
 
 psString psLibVersionLong(void)
 {
-    psString version = psLibVersion();    // Version, to return
-    psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
+    psString version = psLibVersion();  // Version, to return
+    psString source = psLibSource();    // Source
+
+    float cfitsioVersion;               // CFITSIO version number
+
+    psStringPrepend(&version, "psLib ");
+    psStringAppend(&version, " from %s, built %s, %s with cfitsio (%.3f), gsl (%s), fftw (%s)",
+                   source, __DATE__, __TIME__, fits_get_version(&cfitsioVersion), gsl_version,
+                   fftwf_version);
+    psFree(source);
 
 #ifdef HAVE_PSDB
-    psStringAppend(&version, " (cvs tag %s), %s, %s with psDB", tag, __DATE__, __TIME__);
+    psStringAppend(&version, ", mysql (%s)", mysql_get_client_info());
+#endif
+
+#ifdef __OPTIMIZE__
+    psStringAppend(&version, " optimised");
 #else
-    psStringAppend(&version, " (cvs tag %s), %s, %s without psDB", tag, __DATE__, __TIME__);
+    psStringAppend(&version, " unoptimised");
 #endif
-    psFree(tag);
+
+#ifdef PS_NO_TRACE
+    psStringAppend(&version, " without trace");
+#else
+    psStringAppend(&version, " with trace");
+#endif
+
     return version;
-}
+};
 
 // Check the memory; intended for use on exit, but might be used elsewhere
