Changeset 23117
- Timestamp:
- Mar 3, 2009, 3:06:41 PM (17 years ago)
- Location:
- trunk/psModules/src/config
- Files:
-
- 3 edited
-
Makefile.am (modified) (1 diff)
-
pmVersion.c (modified) (1 diff)
-
pmVersion.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/Makefile.am
r18905 r23117 1 1 noinst_LTLIBRARIES = libpsmodulesconfig.la 2 2 3 libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS) 3 PSMODULES_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSMODULES_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 PSMODULES_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 7 # Force recompilation of pmVersion.c, since it gets the version information 8 pmVersion.c: FORCE 9 touch pmVersion.c 10 FORCE: ; 11 12 libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS) -DPSMODULES_VERSION=\"$(PSMODULES_VERSION)\" -DPSMODULES_BRANCH=\"$(PSMODULES_BRANCH)\" -DPSMODULES_SOURCE=\"$(PSMODULES_SOURCE)\" 4 13 libpsmodulesconfig_la_LDFLAGS = -release $(PACKAGE_VERSION) 5 14 libpsmodulesconfig_la_SOURCES = \ -
trunk/psModules/src/config/pmVersion.c
r10291 r23117 8 8 #include "pmVersion.h" 9 9 10 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name11 12 10 psString psModulesVersion(void) 13 11 { 14 psString version = NULL; // Version, to return 15 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 16 return version; 12 #ifndef PSMODULES_VERSION 13 #error "PSMODULES_VERSION is not set" 14 #endif 15 #ifndef PSMODULES_BRANCH 16 #error "PSMODULES_BRANCH is not set" 17 #endif 18 return psStringCopy(PSMODULES_BRANCH "@" PSMODULES_VERSION); 17 19 } 20 21 psString psModulesSource(void) 22 { 23 #ifndef PSMODULES_SOURCE 24 #error "PSMODULES_SOURCE is not set" 25 #endif 26 return psStringCopy(PSMODULES_SOURCE); 27 } 28 18 29 19 30 psString psModulesVersionLong(void) 20 31 { 21 psString version = psModulesVersion(); // Version, to return22 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag32 psString version = psModulesVersion(); // Version, to return 33 psString source = psModulesSource(); // Source 23 34 24 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 35 psStringPrepend(&version, "psModules "); 36 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 37 psFree(source); 25 38 26 psFree(tag); 39 #ifdef __OPTIMIZE__ 40 psStringAppend(&version, " optimised"); 41 #else 42 psStringAppend(&version, " unoptimised"); 43 #endif 44 27 45 return version; 28 } 46 }; -
trunk/psModules/src/config/pmVersion.h
r12696 r23117 1 1 /* @file pmVersion.h 2 2 * @brief Version functions 3 * 3 * 4 4 * @author Paul Price, IfA 5 5 * @author Eugene Magnier, IfA 6 * 6 * 7 7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 8 8 * @date $Date: 2007-03-30 21:12:56 $ … … 22 22 * @return psString: String with version name. 23 23 */ 24 psString psModulesVersion( 25 void 26 ); 24 psString psModulesVersion(void); 25 26 /** Get current psModules source 27 * 28 * Returns the current psModules source as a string. 29 * 30 * @return psString: String with source. 31 */ 32 psString psModulesSource(void); 27 33 28 34 /** Get current psModules version (full identification)
Note:
See TracChangeset
for help on using the changeset viewer.
