IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23144


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

Adding version functions to match psLib.

Location:
trunk/ppSub/src
Files:
2 edited

Legend:

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

    r21257 r23144  
    11bin_PROGRAMS = ppSub ppSubKernel
    22
    3 ppSub_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPSUB_CFLAGS)
     3PPSUB_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
     4PPSUB_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`
     5PPSUB_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
     6
     7# Force recompilation of ppSubVersion.c, since it gets the version information
     8ppSubVersion.c: FORCE
     9        touch ppSubVersion.c
     10FORCE: ;
     11
     12ppSub_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPSUB_CFLAGS) -DPPSUB_VERSION=\"$(PPSUB_VERSION)\" -DPPSUB_BRANCH=\"$(PPSUB_BRANCH)\" -DPPSUB_SOURCE=\"$(PPSUB_SOURCE)\"
    413ppSub_LDFLAGS  = $(PSLIB_LIBS)   $(PSMODULE_LIBS)   $(PPSTATS_LIBS)   $(PSPHOT_LIBS)   $(PPSUB_LIBS)
    514
  • trunk/ppSub/src/ppSubVersion.c

    r21524 r23144  
    2222#include "ppSub.h"
    2323
    24 static const char *cvsTag = "$Name: not supported by cvs2svn $";///< CVS tag name
    25 
    2624psString ppSubVersion(void)
    2725{
    28     psString version = NULL;            // Version, to return
    29     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    30     return version;
     26#ifndef PPSUB_VERSION
     27#error "PPSUB_VERSION is not set"
     28#endif
     29#ifndef PPSUB_BRANCH
     30#error "PPSUB_BRANCH is not set"
     31#endif
     32    return psStringCopy(PPSUB_BRANCH "@" PPSUB_VERSION);
     33}
     34
     35psString ppSubSource(void)
     36{
     37#ifndef PPSUB_SOURCE
     38#error "PPSUB_SOURCE is not set"
     39#endif
     40    return psStringCopy(PPSUB_SOURCE);
    3141}
    3242
    3343psString ppSubVersionLong(void)
    3444{
    35     psString version = ppSubVersion(); // Version, to return
    36     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
    37     psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
    38     psFree(tag);
     45    psString version = ppSubVersion();  // Version, to return
     46    psString source = ppSubSource();    // Source
     47
     48    psStringPrepend(&version, "ppSub ");
     49    psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__);
     50    psFree(source);
     51
     52#ifdef __OPTIMIZE__
     53    psStringAppend(&version, " optimised");
     54#else
     55    psStringAppend(&version, " unoptimised");
     56#endif
     57
    3958    return version;
    40 }
     59};
    4160
    4261
Note: See TracChangeset for help on using the changeset viewer.