IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23118


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

Updating version functions to match psLib.

Location:
trunk/psphot/src
Files:
3 edited

Legend:

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

    r21392 r23118  
    11lib_LTLIBRARIES = libpsphot.la
    2 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
     2
     3PSPHOT_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
     4PSPHOT_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`
     5PSPHOT_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
     8psphotVersion.c: FORCE
     9        touch psphotVersion.c
     10FORCE: ;
     11
     12libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSPHOT_VERSION=\"$(PSPHOT_VERSION)\" -DPSPHOT_BRANCH=\"$(PSPHOT_BRANCH)\" -DPSPHOT_SOURCE=\"$(PSPHOT_SOURCE)\"
    313libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
    414
  • trunk/psphot/src/psphot.h

    r21392 r23118  
    1616const char     *psphotCVSName(void);
    1717psString        psphotVersion(void);
     18psString        psphotSource(void);
    1819psString        psphotVersionLong(void);
    1920
  • trunk/psphot/src/psphotVersion.c

    r12805 r23118  
    1 # include "psphotInternal.h"
     1#include "psphotInternal.h"
    22
    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
    86
    97psString psphotVersion(void)
    108{
    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
     18psString psphotSource(void)
     19{
     20#ifndef PSPHOT_SOURCE
     21#error "PSPHOT_SOURCE is not set"
     22#endif
     23    return psStringCopy(PSPHOT_SOURCE);
    1424}
    1525
    1626psString psphotVersionLong(void)
    1727{
    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
    2130
    22 # if (HAVE_KAPA)
    23     psString ohanaVersion = psStringStripCVS (ohana_version(), "Name");
    24     psString libdvoVersion = psStringStripCVS (libdvo_version(), "Name");
     31    psStringPrepend(&version, "psphot ");
     32    psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__);
     33    psFree(source);
    2534
    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
    3240
    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
    3457    return version;
    3558}
    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.