Changeset 23115
- Timestamp:
- Mar 3, 2009, 1:00:45 PM (17 years ago)
- Location:
- trunk/psLib/src/sys
- Files:
-
- 3 edited
-
Makefile.am (modified) (1 diff)
-
psConfigure.c (modified) (3 diffs)
-
psConfigure.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/Makefile.am
r19056 r23115 3 3 noinst_LTLIBRARIES = libpslibsys.la 4 4 5 libpslibsys_la_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS) $(CFITSIO_CFLAGS) 5 PSLIB_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 6 PSLIB_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 7 PSLIB_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 8 9 # Force recompilation of psConfigure.c, since it gets the version information 10 psConfigure.c: FORCE 11 touch psConfigure.c 12 FORCE: ; 13 14 libpslibsys_la_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS) $(CFITSIO_CFLAGS) -DPSLIB_VERSION=\"$(PSLIB_VERSION)\" -DPSLIB_BRANCH=\"$(PSLIB_BRANCH)\" -DPSLIB_SOURCE=\"$(PSLIB_SOURCE)\" 6 15 libpslibsys_la_SOURCES = \ 7 16 psAbort.c \ -
trunk/psLib/src/sys/psConfigure.c
r18953 r23115 12 12 * @author Ross Harman, MHPCC 13 13 * @author Robert DeSonia, MHPCC 14 * @author Paul Price, IfA 14 15 * 15 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2008-08-08 18:05:08 $ 17 * 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 16 * Copyright 2004-2009 Institute for Astronomy, University of Hawaii 19 17 */ 20 18 … … 26 24 #include <stdlib.h> 27 25 #include <string.h> 26 27 #include <fitsio.h> 28 #include <longnam.h> 29 #include <fftw3.h> 30 #include <gsl/gsl_version.h> 31 #ifdef HAVE_PSDB 32 #include <mysql.h> 33 #endif 28 34 29 35 #include "psAbort.h" … … 41 47 static FILE *memCheckFile = NULL; // File to which to write results of mem check 42 48 43 static const char *cvsTag = "$Name: not supported by cvs2svn $"; // CVS tag name44 49 45 50 psString psLibVersion(void) 46 51 { 47 psString version = NULL; // Version, to return 48 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 49 return version; 52 #ifndef PSLIB_VERSION 53 #error "PSLIB_VERSION is not set" 54 #endif 55 #ifndef PSLIB_BRANCH 56 #error "PSLIB_BRANCH is not set" 57 #endif 58 return psStringCopy(PSLIB_BRANCH "@" PSLIB_VERSION); 59 } 60 61 psString psLibSource(void) 62 { 63 #ifndef PSLIB_SOURCE 64 #error "PSLIB_SOURCE is not set" 65 #endif 66 return psStringCopy(PSLIB_SOURCE); 50 67 } 51 68 52 69 psString psLibVersionLong(void) 53 70 { 54 psString version = psLibVersion(); // Version, to return 55 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 71 psString version = psLibVersion(); // Version, to return 72 psString source = psLibSource(); // Source 73 74 float cfitsioVersion; // CFITSIO version number 75 76 psStringPrepend(&version, "psLib "); 77 psStringAppend(&version, " from %s, built %s, %s with cfitsio (%.3f), gsl (%s), fftw (%s)", 78 source, __DATE__, __TIME__, fits_get_version(&cfitsioVersion), gsl_version, 79 fftwf_version); 80 psFree(source); 56 81 57 82 #ifdef HAVE_PSDB 58 psStringAppend(&version, " (cvs tag %s), %s, %s with psDB", tag, __DATE__, __TIME__); 83 psStringAppend(&version, ", mysql (%s)", mysql_get_client_info()); 84 #endif 85 86 #ifdef __OPTIMIZE__ 87 psStringAppend(&version, " optimised"); 59 88 #else 60 psStringAppend(&version, " (cvs tag %s), %s, %s without psDB", tag, __DATE__, __TIME__);89 psStringAppend(&version, " unoptimised"); 61 90 #endif 62 psFree(tag); 91 92 #ifdef PS_NO_TRACE 93 psStringAppend(&version, " without trace"); 94 #else 95 psStringAppend(&version, " with trace"); 96 #endif 97 63 98 return version; 64 } 99 }; 65 100 66 101 // Check the memory; intended for use on exit, but might be used elsewhere -
trunk/psLib/src/sys/psConfigure.h
r13950 r23115 29 29 * @return psString: String with version name. 30 30 */ 31 psString psLibVersion( 32 void 33 ); 31 psString psLibVersion(void); 34 32 33 /** Get current psLib source 34 * 35 * Returns the current psLib source name as a string. 36 * 37 * @return psString: String with source name. 38 */ 39 psString psLibSource(void); 35 40 36 41 /** Get current psLib version (full identification)
Note:
See TracChangeset
for help on using the changeset viewer.
