diff --git a/configure/CONFIG_PCAS_VERSION b/configure/CONFIG_PCAS_VERSION new file mode 100644 index 000000000..4ab8a1271 --- /dev/null +++ b/configure/CONFIG_PCAS_VERSION @@ -0,0 +1,14 @@ +EPICS_PCAS_MAJOR_VERSION = 4 +EPICS_PCAS_MINOR_VERSION = 13 +EPICS_PCAS_MAINTENANCE_VERSION = 0 +EPICS_PCAS_DEVELOPMENT_FLAG = 1 + +EXPANDVARS += EPICS_PCAS_MAJOR_VERSION +EXPANDVARS += EPICS_PCAS_MINOR_VERSION +EXPANDVARS += EPICS_PCAS_MAINTENANCE_VERSION +EXPANDVARS += EPICS_PCAS_DEVELOPMENT_FLAG + +EXPANDFLAGS += $(foreach var,$(EXPANDVARS),-D$(var)="$(strip $($(var)))") + +# shared library ABI version. +SHRLIB_VERSION = $(EPICS_PCAS_MAJOR_VERSION).$(EPICS_PCAS_MINOR_VERSION) diff --git a/src/gdd/Makefile b/src/gdd/Makefile index 0c8fde26d..640dd3781 100644 --- a/src/gdd/Makefile +++ b/src/gdd/Makefile @@ -11,6 +11,8 @@ TOP=../.. include $(TOP)/configure/CONFIG +include $(TOP)/configure/CONFIG_PCAS_VERSION + INC += gdd.h INC += gddI.h INC += gddContainer.h diff --git a/src/pcas/build/Makefile b/src/pcas/build/Makefile index b040bdf7a..6b72edf21 100644 --- a/src/pcas/build/Makefile +++ b/src/pcas/build/Makefile @@ -19,11 +19,15 @@ SRC_DIRS += $(SRC) SRC_DIRS += $(IOSRC) SRC_DIRS += $(STSRC) +include $(TOP)/configure/CONFIG_PCAS_VERSION + #USR_CXXFLAGS = $(USR_CFLAGS) INC += casdef.h INC += casEventMask.h INC += caNetAddr.h +INC += casVersion.h +INC += casVersionNum.h LIBSRCS += caServer.cc LIBSRCS += caServerI.cc @@ -85,3 +89,8 @@ cas_RCS = cas.rc CLEANS += Templates.DB include $(TOP)/configure/RULES + +# Can't use EXPAND as generated headers must appear +# in O.Common, but EXPAND emits rules for O.$(T_A) +../O.Common/casVersionNum.h: ../casVersionNum.h@ + $(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@ diff --git a/src/pcas/build/casVersionNum.h@ b/src/pcas/build/casVersionNum.h@ new file mode 100644 index 000000000..62cd7ecfb --- /dev/null +++ b/src/pcas/build/casVersionNum.h@ @@ -0,0 +1,9 @@ +#ifndef CASVERSION_H +# error include casVersion.h, not this header +#endif +#define EPICS_CAS_MAJOR_VERSION @EPICS_PCAS_MAJOR_VERSION@ +#define EPICS_CAS_MINOR_VERSION @EPICS_PCAS_MINOR_VERSION@ +#define EPICS_CAS_MAINTENANCE_VERSION @EPICS_PCAS_MAINTENANCE_VERSION@ +#define EPICS_CAS_DEVELOPMENT_FLAG @EPICS_PCAS_DEVELOPMENT_FLAG@ + +#define CAS_VERSION_STRING "PCAS @EPICS_PCAS_MAJOR_VERSION@.@EPICS_PCAS_MINOR_VERSION@.@EPICS_PCAS_MAINTENANCE_VERSION@@EPICS_PCAS_DEVELOPMENT_FLAG@" diff --git a/src/pcas/generic/caServerI.cc b/src/pcas/generic/caServerI.cc index e8609eb8a..0e66990f2 100644 --- a/src/pcas/generic/caServerI.cc +++ b/src/pcas/generic/caServerI.cc @@ -5,7 +5,7 @@ * Operator of Los Alamos National Laboratory. * EPICS BASE Versions 3.13.7 * and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* * Author Jeffrey O. Hill @@ -16,9 +16,9 @@ #include #include -#include "epicsGuard.h" -#include "epicsVersion.h" -#include "errlog.h" +#include +#include +#include #include "addrList.h" @@ -29,11 +29,12 @@ #include "beaconAnomalyGovernor.h" #include "casStreamOS.h" #include "casIntfOS.h" +#include "casVersion.h" // include a version string for POSIX systems -static const char pVersionCAS[] = - "@(#) " EPICS_VERSION_STRING - ", CA Portable Server Library "; +static const char pVersionCAS[] = + "@(#) " CAS_VERSION_STRING " (" EPICS_VERSION_STRING ")" + ", CA Portable Server Library"; caServerI::caServerI ( caServer & tool ) : adapter (tool), diff --git a/src/pcas/generic/casVersion.h b/src/pcas/generic/casVersion.h new file mode 100644 index 000000000..b7e0abb91 --- /dev/null +++ b/src/pcas/generic/casVersion.h @@ -0,0 +1,20 @@ +#ifndef CASVERSION_H +#define CASVERSION_H + +#include + +#ifndef VERSION_INT +# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P)) +#endif + +/* include generated headers with: + * EPICS_CAS_MAJOR_VERSION + * EPICS_CAS_MINOR_VERSION + * EPICS_CAS_MAINTENANCE_VERSION + * EPICS_CAS_DEVELOPMENT_FLAG + */ +#include + +#define CAS_VERSION_INT VERSION_INT(EPICS_CAS_MAJOR_VERSION, EPICS_CAS_MINOR_VERSION, EPICS_CAS_MAINTENANCE_VERSION, 0) + +#endif // CASVERSION_H