IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23143


Ignore:
Timestamp:
Mar 3, 2009, 3:55:15 PM (17 years ago)
Author:
Paul Price
Message:

Adding version functions to match psLib.

Location:
trunk/ppStack/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/Makefile.am

    r19337 r23143  
    11bin_PROGRAMS = ppStack
    22
    3 ppStack_CFLAGS  = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PPSTATS_CFLAGS) $(PPSTACK_CFLAGS)
     3PPSTACK_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
     4PPSTACK_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`
     5PPSTACK_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
     6
     7# Force recompilation of ppStackVersion.c, since it gets the version information
     8ppStackVersion.c: FORCE
     9        touch ppStackVersion.c
     10FORCE: ;
     11
     12ppStack_CFLAGS  = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PPSTATS_CFLAGS) $(PPSTACK_CFLAGS) -DPPSTACK_VERSION=\"$(PPSTACK_VERSION)\" -DPPSTACK_BRANCH=\"$(PPSTACK_BRANCH)\" -DPPSTACK_SOURCE=\"$(PPSTACK_SOURCE)\"
    413ppStack_LDFLAGS = $(PSLIB_LIBS)   $(PSMODULE_LIBS)   $(PSPHOT_LIBS)   $(PPSTATS_LIBS)   $(PPSTACK_LIBS)
    514
  • trunk/ppStack/src/ppStack.h

    r21477 r23143  
    134134psString ppStackVersion(void);
    135135
     136/// Return software source
     137psString ppStackSource(void);
     138
    136139// Return long description of software version
    137140psString ppStackVersionLong(void);
  • trunk/ppStack/src/ppStackVersion.c

    r18419 r23143  
    1010#include "ppStack.h"
    1111
    12 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
    13 
    1412psString ppStackVersion(void)
    1513{
    16     psString version = NULL;            // Version, to return
    17     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    18     return version;
     14#ifndef PPSTACK_VERSION
     15#error "PPSTACK_VERSION is not set"
     16#endif
     17#ifndef PPSTACK_BRANCH
     18#error "PPSTACK_BRANCH is not set"
     19#endif
     20    return psStringCopy(PPSTACK_BRANCH "@" PPSTACK_VERSION);
     21}
     22
     23psString ppStackSource(void)
     24{
     25#ifndef PPSTACK_SOURCE
     26#error "PPSTACK_SOURCE is not set"
     27#endif
     28    return psStringCopy(PPSTACK_SOURCE);
    1929}
    2030
    2131psString ppStackVersionLong(void)
    2232{
    23     psString version = ppStackVersion(); // Version, to return
    24     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
    25     psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
    26     psFree(tag);
     33    psString version = ppStackVersion();  // Version, to return
     34    psString source = ppStackSource();    // Source
     35
     36    psStringPrepend(&version, "ppStack ");
     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
    2746    return version;
    28 }
     47};
    2948
    3049
Note: See TracChangeset for help on using the changeset viewer.