IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23117


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

Updating version functions to match psLib.

Location:
trunk/psModules/src/config
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/Makefile.am

    r18905 r23117  
    11noinst_LTLIBRARIES = libpsmodulesconfig.la
    22
    3 libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS)
     3PSMODULES_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
     4PSMODULES_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`
     5PSMODULES_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
     6
     7# Force recompilation of pmVersion.c, since it gets the version information
     8pmVersion.c: FORCE
     9        touch pmVersion.c
     10FORCE: ;
     11
     12libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS) -DPSMODULES_VERSION=\"$(PSMODULES_VERSION)\" -DPSMODULES_BRANCH=\"$(PSMODULES_BRANCH)\" -DPSMODULES_SOURCE=\"$(PSMODULES_SOURCE)\"
    413libpsmodulesconfig_la_LDFLAGS  = -release $(PACKAGE_VERSION)
    514libpsmodulesconfig_la_SOURCES  = \
  • trunk/psModules/src/config/pmVersion.c

    r10291 r23117  
    88#include "pmVersion.h"
    99
    10 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
    11 
    1210psString psModulesVersion(void)
    1311{
    14     psString version = NULL;            // Version, to return
    15     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    16     return version;
     12#ifndef PSMODULES_VERSION
     13#error "PSMODULES_VERSION is not set"
     14#endif
     15#ifndef PSMODULES_BRANCH
     16#error "PSMODULES_BRANCH is not set"
     17#endif
     18    return psStringCopy(PSMODULES_BRANCH "@" PSMODULES_VERSION);
    1719}
     20
     21psString psModulesSource(void)
     22{
     23#ifndef PSMODULES_SOURCE
     24#error "PSMODULES_SOURCE is not set"
     25#endif
     26    return psStringCopy(PSMODULES_SOURCE);
     27}
     28
    1829
    1930psString psModulesVersionLong(void)
    2031{
    21     psString version = psModulesVersion(); // Version, to return
    22     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
     32    psString version = psModulesVersion();  // Version, to return
     33    psString source = psModulesSource();    // Source
    2334
    24     psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
     35    psStringPrepend(&version, "psModules ");
     36    psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__);
     37    psFree(source);
    2538
    26     psFree(tag);
     39#ifdef __OPTIMIZE__
     40    psStringAppend(&version, " optimised");
     41#else
     42    psStringAppend(&version, " unoptimised");
     43#endif
     44
    2745    return version;
    28 }
     46};
  • trunk/psModules/src/config/pmVersion.h

    r12696 r23117  
    11/*  @file pmVersion.h
    22 *  @brief Version functions
    3  * 
     3 *
    44 *  @author Paul Price, IfA
    55 *  @author Eugene Magnier, IfA
    6  * 
     6 *
    77 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    88 *  @date $Date: 2007-03-30 21:12:56 $
     
    2222 *  @return psString: String with version name.
    2323 */
    24 psString psModulesVersion(
    25     void
    26 );
     24psString psModulesVersion(void);
     25
     26/** Get current psModules source
     27 *
     28 *  Returns the current psModules source as a string.
     29 *
     30 *  @return psString: String with source.
     31 */
     32psString psModulesSource(void);
    2733
    2834/** Get current psModules version (full identification)
Note: See TracChangeset for help on using the changeset viewer.