Set various EPICS_VERSION_* environment variables

These are set at the same time as the ARCH variable.
Had to add EPICS_VERSION_SHORT and EPICS_VERSION_FULL to epicsVersion.h.

This uses more uniform names, should we change epicsVersion.h names?
We would continue to support the old names in parallel for some time.
This commit is contained in:
Andrew Johnson
2016-04-28 18:58:07 -05:00
parent 0e5dc2a21c
commit 5a605fa0c3
2 changed files with 24 additions and 1 deletions
+15
View File
@@ -8,6 +8,7 @@
\*************************************************************************/
#include "envDefs.h"
#include "epicsVersion.h"
#include "iocsh.h"
#include "libComRegister.h"
@@ -22,15 +23,29 @@
#include "registryIocRegister.h"
#include "rsrvIocRegister.h"
#define quote(v) #v
#define str(v) quote(v)
void iocshRegisterCommon(void)
{
iocshPpdbbase = &pdbbase;
const char *targetArch = envGetConfigParamPtr(&EPICS_BUILD_TARGET_ARCH);
/* This uses a config param so the user can override it */
if (targetArch) {
epicsEnvSet("ARCH", targetArch);
}
/* Base build version variables */
epicsEnvSet("EPICS_VERSION_MAJOR", str(EPICS_VERSION));
epicsEnvSet("EPICS_VERSION_MIDDLE", str(EPICS_REVISION));
epicsEnvSet("EPICS_VERSION_MINOR", str(EPICS_MODIFICATION));
epicsEnvSet("EPICS_VERSION_PATCH", str(EPICS_PATCH_LEVEL));
epicsEnvSet("EPICS_VERSION_SNAPSHOT", EPICS_DEV_SNAPSHOT);
epicsEnvSet("EPICS_VERSION_SITE", EPICS_SITE_VERSION);
epicsEnvSet("EPICS_VERSION_SHORT", EPICS_VERSION_SHORT);
epicsEnvSet("EPICS_VERSION_FULL", EPICS_VERSION_FULL);
dbStaticIocRegister();
registryIocRegister();
dbIocRegister();