IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23804 for trunk/psastro/src


Ignore:
Timestamp:
Apr 9, 2009, 10:51:54 PM (17 years ago)
Author:
Paul Price
Message:

Making version information not dependent upon running configure, but on make.

Location:
trunk/psastro/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src

    • Property svn:ignore
      •  

        old new  
        1717psastroModelFit
        1818psastroExtract
         19psastroVersionDefinitions.h
  • trunk/psastro/src/Makefile.am

    r23790 r23804  
    11lib_LTLIBRARIES = libpsastro.la
    22
    3 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSASTRO_VERSION=$(PSASTRO_VERSION) -DPSASTRO_BRANCH=$(PSASTRO_BRANCH) -DPSASTRO_SOURCE=$(PSASTRO_SOURCE)
    4 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
     3if HAVE_SVNVERSION
     4PSASTRO_VERSION=`$(SVNVERSION) ../..`
     5else
     6PSASTRO_VERSION="UNKNOWN"
     7endif
     8
     9if HAVE_SVN
     10PSASTRO_BRANCH=`$(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 }'`
     11PSASTRO_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
     12else
     13PSASTRO_BRANCH="UNKNOWN"
     14PSASTRO_SOURCE="UNKNOWN"
     15endif
    516
    617# Force recompilation of psastroVersion.c, since it gets the version information
    7 psastroVersion.c: FORCE
    8         touch psastroVersion.c
     18psastroVersion.c: psastroVersionDefinitions.h
     19psastroVersionDefinitions.h: psastroVersionDefinitions.h.in FORCE
     20        -$(RM) psastroVersionDefinitions.h
     21        $(SED) -e "s|@PSASTRO_VERSION@|\"$(PSASTRO_VERSION)\"|" -e "s|@PSASTRO_BRANCH@|\"$(PSASTRO_BRANCH)\"|" -e "s|@PSASTRO_SOURCE@|\"$(PSASTRO_SOURCE)\"|" psastroVersionDefinitions.h.in > psastroVersionDefinitions.h
    922FORCE: ;
     23
     24libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
     25libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
    1026
    1127bin_PROGRAMS = psastro psastroExtract psastroModel psastroModelFit gpcModel
     
    121137
    122138### Error codes.
    123 BUILT_SOURCES = psastroErrorCodes.h psastroErrorCodes.c
     139BUILT_SOURCES = psastroErrorCodes.h psastroErrorCodes.c psastroVersionDefinitions.h
    124140CLEANFILES = psastroErrorCodes.h psastroErrorCodes.c
    125141EXTRA_DIST = psastroErrorCodes.dat psastroErrorCodes.h.in psastroErrorCodes.c.in
  • trunk/psastro/src/psastroVersion.c

    r23289 r23804  
    99
    1010#include "psastroInternal.h"
     11#include "psastroVersionDefinitions.h"
    1112
    1213#ifndef PSASTRO_VERSION
     
    2021#endif
    2122
    22 #define xstr(s) str(s)
    23 #define str(s) #s
    24 
    2523psString psastroVersion(void)
    2624{
    2725    char *value = NULL;
    28     psStringAppend(&value, "%s@%s", xstr(PSASTRO_BRANCH), xstr(PSASTRO_VERSION));
     26    psStringAppend(&value, "%s@%s", PSASTRO_BRANCH, PSASTRO_VERSION);
    2927    return value;
    3028}
     
    3230psString psastroSource(void)
    3331{
    34   return psStringCopy(xstr(PSASTRO_SOURCE));
     32  return psStringCopy(PSASTRO_SOURCE);
    3533}
    3634
Note: See TracChangeset for help on using the changeset viewer.