From 66e2ded783ecc414144ccbe13008fe1745139520 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 30 Apr 2020 11:14:00 +0200 Subject: [PATCH] support for 4 digit EPICS versions --- GNUmakefile | 2 +- iocsh | 8 ++++++-- require.c | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index e530ba9..cd2e3a1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -26,7 +26,7 @@ HEADERS += require.h USR_INCLUDES_Linux=-idirafter ${EPICS_BASE}/include # Pass T_A to the code -USR_CFLAGS += -DT_A='"${T_A}"' +USR_CFLAGS += -DT_A='"${T_A}"' -DEPICSVERSION='"${EPICSVERSION}"' # This should really go into some global WIN32 config file USR_CFLAGS_WIN32 += /D_WIN32_WINNT=0x502 diff --git a/iocsh b/iocsh index 67713d4..62b0b3a 100755 --- a/iocsh +++ b/iocsh @@ -176,16 +176,20 @@ then /^[ \t]*EPICS_VERSION[ \t]*=/ {v=$2} /^[ \t]*EPICS_REVISION[ \t]*=/ {r=$2} /^[ \t]*EPICS_MODIFICATION[ \t]*=/ {m=$2+0} - END {print "BASE="v"."r"."m";BASECODE="v*10000+r*100+m} + END {print "XBASE="v"."r"."m";BASECODE="v*10000+r*100+m} ' < $EPICS_BASE/configure/CONFIG_BASE_VERSION) elif [ -f $EPICS_BASE/lib/$EPICS_HOST_ARCH/${LIBPREFIX}Com$LIBPOSTFIX ] then eval $(strings $EPICS_BASE/lib/$EPICS_HOST_ARCH/${LIBPREFIX}Com$LIBPOSTFIX | awk -F'[.R-]' ' - /EPICS R[0-9]/ {print "BASE="$2"."$3"."$4";BASECODE="$2*10000+$3*100+$4 }') + /EPICS R[0-9]/ {print "XBASE="$2"."$3"."$4";BASECODE="$2*10000+$3*100+$4 }') else echo "Cannot guess EPICS base version." >&2 exit 1; fi +if [ ${BASE#$XBASE} = $BASE ] +then + BASE=$XBASE +fi # IOC name derives from hostname # (trailing possible '\r' under cygwin) diff --git a/require.c b/require.c index 2ae4023..4552680 100644 --- a/require.c +++ b/require.c @@ -266,7 +266,11 @@ int requireDebug; #define TOSTR(s) TOSTR2(s) #define TOSTR2(s) #s -const char epicsRelease[] = TOSTR(EPICS_VERSION)"."TOSTR(EPICS_REVISION)"."TOSTR(EPICS_MODIFICATION); + +#ifndef EPICSVERSION +#error EPICSVERSION not defined: Compile with USR_CFLAGS += -DEPICSVERSION='"${EPICSVERSION}"' +#endif +const char epicsRelease[] = EPICSVERSION; const char epicsBasetype[] = TOSTR(EPICS_VERSION)"."TOSTR(EPICS_REVISION); #ifndef T_A