Changeset 23118
- Timestamp:
- Mar 3, 2009, 3:20:48 PM (17 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 3 edited
-
Makefile.am (modified) (1 diff)
-
psphot.h (modified) (1 diff)
-
psphotVersion.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/Makefile.am
r21392 r23118 1 1 lib_LTLIBRARIES = libpsphot.la 2 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 2 3 PSPHOT_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSPHOT_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 PSPHOT_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 7 # Force recompilation of psphotVersion.c, since it gets the version information 8 psphotVersion.c: FORCE 9 touch psphotVersion.c 10 FORCE: ; 11 12 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSPHOT_VERSION=\"$(PSPHOT_VERSION)\" -DPSPHOT_BRANCH=\"$(PSPHOT_BRANCH)\" -DPSPHOT_SOURCE=\"$(PSPHOT_SOURCE)\" 3 13 libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 4 14 -
trunk/psphot/src/psphot.h
r21392 r23118 16 16 const char *psphotCVSName(void); 17 17 psString psphotVersion(void); 18 psString psphotSource(void); 18 19 psString psphotVersionLong(void); 19 20 -
trunk/psphot/src/psphotVersion.c
r12805 r23118 1 # include "psphotInternal.h"1 #include "psphotInternal.h" 2 2 3 # if (HAVE_KAPA) 4 # include <kapa.h> 5 # endif 6 7 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name 3 #ifdef HAVE_KAPA 4 #include <kapa.h> 5 #endif 8 6 9 7 psString psphotVersion(void) 10 8 { 11 psString version = NULL; // Version, to return 12 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 13 return version; 9 #ifndef PSPHOT_VERSION 10 #error "PSPHOT_VERSION is not set" 11 #endif 12 #ifndef PSPHOT_BRANCH 13 #error "PSPHOT_BRANCH is not set" 14 #endif 15 return psStringCopy(PSPHOT_BRANCH "@" PSPHOT_VERSION); 16 } 17 18 psString psphotSource(void) 19 { 20 #ifndef PSPHOT_SOURCE 21 #error "PSPHOT_SOURCE is not set" 22 #endif 23 return psStringCopy(PSPHOT_SOURCE); 14 24 } 15 25 16 26 psString psphotVersionLong(void) 17 27 { 18 psString version = psphotVersion(); // Version, to return 19 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 20 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 28 psString version = psLibVersion(); // Version, to return 29 psString source = psLibSource(); // Source 21 30 22 # if (HAVE_KAPA) 23 psString ohanaVersion = psStringStripCVS (ohana_version(), "Name");24 ps String libdvoVersion = psStringStripCVS (libdvo_version(), "Name");31 psStringPrepend(&version, "psphot "); 32 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 33 psFree(source); 25 34 26 psStringAppend (&version, " with libkapa (ohana %s, libdvo: %s)", ohanaVersion, libdvoVersion); 27 psFree (ohanaVersion); 28 psFree (libdvoVersion); 29 # else 30 psStringAppend (&version, " WITHOUT libkapa"); 31 # endif 35 #ifdef __OPTIMIZE__ 36 psStringAppend(&version, " optimised"); 37 #else 38 psStringAppend(&version, " unoptimised"); 39 #endif 32 40 33 psFree(tag); 41 #ifdef HAVE_KAPA 42 #if 0 43 // XXX Need to get ohana and libdvo versions 44 psString ohanaVersion = psStringStripCVS(ohana_version(), "Name"); 45 psString libdvoVersion = psStringStripCVS(libdvo_version(), "Name"); 46 psStringAppend(&version, " with libkapa (ohana %s, libdvo: %s)", ohanaVersion, libdvoVersion); 47 psFree(ohanaVersion); 48 psFree(libdvoVersion); 49 #else 50 psStringAppend(&version, " with libkapa"); 51 #endif 52 53 #else 54 psStringAppend (&version, " without libkapa"); 55 #endif 56 34 57 return version; 35 58 } 36 37 // Defined by RHL; leaving for backwards compatibility.38 const char *psphotCVSName(void) {39 return cvsTag;40 }
Note:
See TracChangeset
for help on using the changeset viewer.
