Changeset 23125
- Timestamp:
- Mar 3, 2009, 3:41:16 PM (17 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 3 edited
-
Makefile.am (modified) (1 diff)
-
ppImage.h (modified) (1 diff)
-
ppImageVersion.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/Makefile.am
r20774 r23125 4 4 ppImage.h 5 5 6 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 6 PPIMAGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 7 PPIMAGE_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` 8 PPIMAGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 9 10 # Force recompilation of ppImageVersion.c, since it gets the version information 11 ppImageVersion.c: FORCE 12 touch ppImageVersion.c 13 FORCE: ; 14 15 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPIMAGE_VERSION=\"$(PPIMAGE_VERSION)\" -DPPIMAGE_BRANCH=\"$(PPIMAGE_BRANCH)\" -DPPIMAGE_SOURCE=\"$(PPIMAGE_SOURCE)\" 7 16 ppImage_LDFLAGS = $(PPIMAGE_LIBS) $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 8 17 ppImage_SOURCES = \ -
trunk/ppImage/src/ppImage.h
r21364 r23125 208 208 psString ppImageVersion(void); 209 209 210 /// Return software source 211 psString ppImageSource(void); 212 210 213 /// Return long version information 211 214 psString ppImageVersionLong(void); -
trunk/ppImage/src/ppImageVersion.c
r14000 r23125 5 5 #include "ppImage.h" 6 6 7 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name8 9 7 psString ppImageVersion(void) 10 8 { 11 psString version = NULL; // Version, to return 12 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 13 return version; 9 #ifndef PPIMAGE_VERSION 10 #error "PPIMAGE_VERSION is not set" 11 #endif 12 #ifndef PPIMAGE_BRANCH 13 #error "PPIMAGE_BRANCH is not set" 14 #endif 15 return psStringCopy(PPIMAGE_BRANCH "@" PPIMAGE_VERSION); 16 } 17 18 psString ppImageSource(void) 19 { 20 #ifndef PPIMAGE_SOURCE 21 #error "PPIMAGE_SOURCE is not set" 22 #endif 23 return psStringCopy(PPIMAGE_SOURCE); 14 24 } 15 25 16 26 psString ppImageVersionLong(void) 17 27 { 18 psString version = ppImageVersion(); // Version, to return 19 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 20 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 21 psFree(tag); 28 psString version = ppImageVersion(); // Version, to return 29 psString source = ppImageSource(); // Source 30 31 psStringPrepend(&version, "ppImage "); 32 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 33 psFree(source); 34 35 #ifdef __OPTIMIZE__ 36 psStringAppend(&version, " optimised"); 37 #else 38 psStringAppend(&version, " unoptimised"); 39 #endif 40 22 41 return version; 23 } 24 42 }; 25 43 26 44 void ppImageVersionMetadata(psMetadata *metadata)
Note:
See TracChangeset
for help on using the changeset viewer.
