IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23805


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

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

Location:
trunk/psphot
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/configure.ac

    r23790 r23805  
    204204echo "PSPHOT_LIBS: $PSPHOT_LIBS"
    205205
    206 IPP_VERSION(PSPHOT)
    207 AC_SUBST(PSPHOT_VERSION,[$PSPHOT_VERSION])
    208 AC_SUBST(PSPHOT_BRANCH,[$PSPHOT_BRANCH])
    209 AC_SUBST(PSPHOT_SOURCE,[$PSPHOT_SOURCE])
     206IPP_VERSION
    210207
    211208AC_SUBST([PSPHOT_CFLAGS])
  • trunk/psphot/src

    • Property svn:ignore
      •  

        old new  
        1616polyfitTest
        1717growthTest
         18psphotVersionDefinitions.h
  • trunk/psphot/src/Makefile.am

    r23790 r23805  
    11lib_LTLIBRARIES = libpsphot.la
    22
     3if HAVE_SVNVERSION
     4PSPHOT_VERSION=`$(SVNVERSION) ../..`
     5else
     6PSPHOT_VERSION="UNKNOWN"
     7endif
     8
     9if HAVE_SVN
     10PSPHOT_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 }'`
     11PSPHOT_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
     12else
     13PSPHOT_BRANCH="UNKNOWN"
     14PSPHOT_SOURCE="UNKNOWN"
     15endif
     16
    317# Force recompilation of psphotVersion.c, since it gets the version information
    4 psphotVersion.c: FORCE
    5         touch psphotVersion.c
     18psphotVersion.c: psphotVersionDefinitions.h
     19psphotVersionDefinitions.h: psphotVersionDefinitions.h.in FORCE
     20        -$(RM) psphotVersionDefinitions.h
     21        $(SED) -e "s|@PSPHOT_VERSION@|\"$(PSPHOT_VERSION)\"|" -e "s|@PSPHOT_BRANCH@|\"$(PSPHOT_BRANCH)\"|" -e "s|@PSPHOT_SOURCE@|\"$(PSPHOT_SOURCE)\"|" psphotVersionDefinitions.h.in > psphotVersionDefinitions.h
    622FORCE: ;
    723
    8 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSPHOT_VERSION=$(PSPHOT_VERSION) -DPSPHOT_BRANCH=$(PSPHOT_BRANCH) -DPSPHOT_SOURCE=$(PSPHOT_SOURCE)
     24libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
    925libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
    1026
     
    125141
    126142# Error codes.
    127 BUILT_SOURCES = psphotErrorCodes.h psphotErrorCodes.c
     143BUILT_SOURCES = psphotErrorCodes.h psphotErrorCodes.c psphotVersionDefinitions.h
    128144CLEANFILES = psphotErrorCodes.h psphotErrorCodes.c
    129145EXTRA_DIST = psphotErrorCodes.dat psphotErrorCodes.c.in psphotErrorCodes.h.in \
  • trunk/psphot/src/psphotVersion.c

    r23289 r23805  
    11#include "psphotInternal.h"
     2#include "psphotVersionDefinitions.h"
    23
    34#ifdef HAVE_KAPA
     
    1516#endif
    1617
    17 #define xstr(s) str(s)
    18 #define str(s) #s
    19 
    2018psString psphotVersion(void)
    2119{
    2220    char *value = NULL;
    23     psStringAppend(&value, "%s@%s", xstr(PSPHOT_BRANCH), xstr(PSPHOT_VERSION));
     21    psStringAppend(&value, "%s@%s", PSPHOT_BRANCH, PSPHOT_VERSION);
    2422    return value;
    2523}
     
    2725psString psphotSource(void)
    2826{
    29     return psStringCopy(xstr(PSPHOT_SOURCE));
     27    return psStringCopy(PSPHOT_SOURCE);
    3028}
    3129
Note: See TracChangeset for help on using the changeset viewer.