Changeset 23120
- Timestamp:
- Mar 3, 2009, 3:32:19 PM (17 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 3 edited
-
Makefile.am (modified) (1 diff)
-
psastro.h (modified) (1 diff)
-
psastroVersion.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/Makefile.am
r21422 r23120 1 lib_LTLIBRARIES = libpsastro.la 1 2 2 lib_LTLIBRARIES = libpsastro.la 3 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 3 PSASTRO_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSASTRO_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` 5 PSASTRO_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 7 # Force recompilation of psastroVersion.c, since it gets the version information 8 psastroVersion.c: FORCE 9 touch psastroVersion.c 10 FORCE: ; 11 12 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSASTRO_VERSION=\"$(PSASTRO_VERSION)\" -DPSASTRO_BRANCH=\"$(PSASTRO_BRANCH)\" -DPSASTRO_SOURCE=\"$(PSASTRO_SOURCE)\" 4 13 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 5 14 -
trunk/psastro/src/psastro.h
r21422 r23120 95 95 // Return version strings. 96 96 psString psastroVersion(void); 97 psString psastroSource(void); 97 98 psString psastroVersionLong(void); 98 99 -
trunk/psastro/src/psastroVersion.c
r21409 r23120 5 5 * @ingroup libpsastro 6 6 * 7 * @author IfA8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-07 02:03:34 $10 7 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 8 */ … … 13 10 #include "psastroInternal.h" 14 11 15 static const char *cvsTag = "$Name: not supported by cvs2svn $";///< CVS tag name16 17 12 psString psastroVersion(void) 18 13 { 19 psString version = NULL; // Version, to return 20 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 21 return version; 14 #ifndef PSASTRO_VERSION 15 #error "PSASTRO_VERSION is not set" 16 #endif 17 #ifndef PSASTRO_BRANCH 18 #error "PSASTRO_BRANCH is not set" 19 #endif 20 return psStringCopy(PSASTRO_BRANCH "@" PSASTRO_VERSION); 21 } 22 23 psString psastroSource(void) 24 { 25 #ifndef PSASTRO_SOURCE 26 #error "PSASTRO_SOURCE is not set" 27 #endif 28 return psStringCopy(PSASTRO_SOURCE); 22 29 } 23 30 24 31 psString psastroVersionLong(void) 25 32 { 26 psString version = psastroVersion(); // Version, to return 27 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 28 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 29 psFree(tag); 33 psString version = psastroVersion(); // Version, to return 34 psString source = psastroSource(); // Source 35 36 psStringPrepend(&version, "psastro "); 37 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 38 psFree(source); 39 40 #ifdef __OPTIMIZE__ 41 psStringAppend(&version, " optimised"); 42 #else 43 psStringAppend(&version, " unoptimised"); 44 #endif 45 30 46 return version; 31 } 32 47 };
Note:
See TracChangeset
for help on using the changeset viewer.
