From d9184abd6220cb05cda6012c949f5897180a10a6 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 16 Dec 2005 16:47:52 +0000 Subject: [PATCH] Version numbering system change. --- config/CONFIG_BASE_VERSION | 22 +--------- configure/CONFIG_BASE_VERSION | 42 ++++++++++++++----- configure/CONFIG_SITE | 4 ++ configure/os/CONFIG.darwin-ppc.darwin-ppc | 6 +-- configure/os/CONFIG_SITE.Common.hpux-parisc | 10 ++--- src/libCom/Makefile | 2 +- src/libCom/misc/makeEpicsVersion.pl | 45 +++++++++++---------- 7 files changed, 71 insertions(+), 60 deletions(-) diff --git a/config/CONFIG_BASE_VERSION b/config/CONFIG_BASE_VERSION index 094f18c3d..4d295f6d6 100644 --- a/config/CONFIG_BASE_VERSION +++ b/config/CONFIG_BASE_VERSION @@ -10,24 +10,6 @@ # # $Id$ # -# EPICS Version information -# -# This file is interpreted by the Bourne Shell (MakeRelease), so spaces are -# not allowed around the '=' signs or in unquoted values. -# +# EPICS Version information now comes from configure... -EPICS_VERSION=3 -EPICS_REVISION=14 -EPICS_MODIFICATION=8 -EPICS_UPDATE_NAME= -EPICS_UPDATE_LEVEL=0 - -EPICS_LOCAL_NAME=B -EPICS_LOCAL_VERSION=0 - -EPICS_VERSION_STRING="EPICS Version ${EPICS_VERSION}.${EPICS_REVISION}.${EPICS_MODIFICATION}.${EPICS_UPDATE_NAME}${EPICS_UPDATE_LEVEL}.$(EPICS_LOCAL_NAME)$(EPICS_LOCAL_VERSION)" - -CVS_DATE="\$$Date$$" -CVS_TAG="\$$Name$$" - -BASE_3_14=YES +include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION index f37bff572..968099841 100644 --- a/configure/CONFIG_BASE_VERSION +++ b/configure/CONFIG_BASE_VERSION @@ -12,19 +12,41 @@ # # EPICS Version information # -# This file is interpreted by the Bourne Shell (MakeRelease), so spaces are -# not allowed around the '=' signs or in unquoted values. +# Only the person making an official EPICS release should make changes in +# this file. # +# EPICS_SITE_VERSION is defined in CONFIG_SITE for sites that want a local +# version number to be included in the reported version string. -EPICS_VERSION=3 -EPICS_REVISION=14 -EPICS_MODIFICATION=8 -EPICS_UPDATE_NAME= -EPICS_UPDATE_LEVEL=0 +BASE_3_14=YES -EPICS_VERSION_STRING="EPICS Version ${EPICS_VERSION}.${EPICS_REVISION}.${EPICS_MODIFICATION}.${EPICS_UPDATE_NAME}${EPICS_UPDATE_LEVEL}" +EPICS_VERSION = 3 +EPICS_REVISION = 14 + +# This part may contain letters, eg 0beta1 +EPICS_MODIFICATION = 8 + +# Not included if zero +EPICS_PATCH_LEVEL = 0 + +# This will be -CVS or empty at an official release point +EPICS_CVS_SNAPSHOT=-CVS +#EPICS_CVS_SNAPSHOT= + + +# No changes should be needed below here + +ifneq ($(EPICS_PATCH_LEVEL),0) + EPICS_PATCH_VSTRING=.$(EPICS_PATCH_LEVEL) +endif + +ifneq ($(strip $(EPICS_SITE_VERSION)),) + EPICS_SITE_VSTRING=-$(EPICS_SITE_VERSION) +endif + +EPICS_SHORT_VERSION=$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)$(EPICS_PATCH_VSTRING) +EPICS_VERSION_NUMBER=$(EPICS_SHORT_VERSION)$(EPICS_CVS_SNAPSHOT)$(EPICS_SITE_VSTRING) +EPICS_VERSION_STRING="EPICS Version $(EPICS_VERSION_NUMBER)" CVS_DATE="\$$Date$$" CVS_TAG="\$$Name$$" - -BASE_3_14=YES diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 3f6b279e1..b60b0d26a 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -174,3 +174,7 @@ COMPAT_313=NO # Use POSIX thread priority scheduling (YES or NO) USE_POSIX_THREAD_PRIORITY_SCHEDULING = NO +# Site version number, if set will append '-' and this string to the +# EPICS version number string that is reported by many tools +EPICS_SITE_VERSION = + diff --git a/configure/os/CONFIG.darwin-ppc.darwin-ppc b/configure/os/CONFIG.darwin-ppc.darwin-ppc index 70e02ed73..492d06d37 100644 --- a/configure/os/CONFIG.darwin-ppc.darwin-ppc +++ b/configure/os/CONFIG.darwin-ppc.darwin-ppc @@ -17,12 +17,12 @@ CCC = $(GNU_BIN)/c++ # # Darwin shared libraries # +SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION) SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined suppress \ -install_name $(firstword $(SHRLIB_SEARCH_FULLPATHDIRS))/$@ \ -compatibility_version $(EPICS_VERSION).$(EPICS_REVISION) \ - -current_version $(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION) -SHRLIB_SUFFIX = .$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION).dylib -SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION) + -current_version $(SHRLIB_VERSION) +SHRLIB_SUFFIX = .$(SHRLIB_VERSION).dylib LOADABLE_SHRLIB_LDFLAGS = -bundle -flat_namespace -undefined suppress diff --git a/configure/os/CONFIG_SITE.Common.hpux-parisc b/configure/os/CONFIG_SITE.Common.hpux-parisc index 24e282555..2e54cfb29 100644 --- a/configure/os/CONFIG_SITE.Common.hpux-parisc +++ b/configure/os/CONFIG_SITE.Common.hpux-parisc @@ -5,14 +5,14 @@ # Site Specific definitions for hpux-parisc target # Only the local epics system manager should modify this file -# NOTE for SHARED_LIBRARIES: If YES (which is the default now) then either -# a) SHLIB_PATH must include the full absolute pathname to -# $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) (or wherever you install +# NOTE: If SHARED_LIBRARIES=YES (now the default) then +# a) Environment variable SHLIB_PATH must include the full absolute pathname +# to $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) (or wherever you install # the EPICS shared libraries on your system) when invoking base -# executables. +# executables, or # b) Add the path to SHRLIB_SEARCH_FULLPATHDIRS below, which will burn # the runtime search path into the executables. #SHARED_LIBRARIES=YES # This is the absolute path to the generic INSTALL_LOCATION, for SHARED_LIBRARY searches. -SHRLIB_SEARCH_FULLPATHDIRS += /opt/epics/R$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)/base/$(EPICS_VERSION)-$(EPICS_REVISION)-$(EPICS_MODIFICATION)-$(EPICS_UPDATE_NAME)$(EPICS_UPDATE_LEVEL)/lib/$(EPICS_HOST_ARCH) +SHRLIB_SEARCH_FULLPATHDIRS += /opt/epics/R$(EPICS_SHORT_VERSION)/base/$(EPICS_VERSION)-$(EPICS_REVISION)-$(EPICS_MODIFICATION)-$(EPICS_PATCH_LEVEL)$(EPICS_CVS_SNAPSHOT)$(EPICS_SITE_VSTRING)/lib/$(EPICS_HOST_ARCH) diff --git a/src/libCom/Makefile b/src/libCom/Makefile index a2f775202..4d500746c 100644 --- a/src/libCom/Makefile +++ b/src/libCom/Makefile @@ -305,7 +305,7 @@ errSymTbl.c: $(ERR_S_FILES) $(LIBCOM)/error/makeStatTbl.pl $(PERL) $(LIBCOM)/error/makeStatTbl.pl $(ERR_S_FILES) $(COMMON_DIR)/epicsVersion.h: $(CONFIG)/CONFIG_BASE_VERSION - $(PERL) $(LIBCOM)/misc/makeEpicsVersion.pl $(CONFIG)/CONFIG_BASE_VERSION $(@D) + $(PERL) $(LIBCOM)/misc/makeEpicsVersion.pl $(CONFIG)/CONFIG_BASE_VERSION $(@D) $(EPICS_SITE_VERSION) clean:: @$(RM) errSymTbl.c envData.c diff --git a/src/libCom/misc/makeEpicsVersion.pl b/src/libCom/misc/makeEpicsVersion.pl index b1e115972..eb54293ff 100644 --- a/src/libCom/misc/makeEpicsVersion.pl +++ b/src/libCom/misc/makeEpicsVersion.pl @@ -8,45 +8,48 @@ # and higher are distributed subject to a Software License Agreement found # in file LICENSE that is included with this distribution. #************************************************************************* -# -# Usage: perl makeEpicsVersion.pl CONFIG_BASE_VERSION outdir -print "Building epicsVersion.h from CONFIG_BASE_VERSION\n"; +($infile, $outdir, $site_ver) = @ARGV; -die unless $#ARGV==1; +die "Usage: perl makeEpicsVersion.pl CONFIG_BASE_VERSION outdir siteversion" + unless ($infile && $outdir); -open VARS, $ARGV[0] or die "Cannot get variables from $ARGV[0]"; +print "Building epicsVersion.h from $infile\n"; + +open VARS, $infile or die "Can't open $infile: $!\n"; while () { - s/\s+$//; # remove trailing white space and carriage return - if (/EPICS_VERSION=(.*)/) { $ver = $1; } - if (/EPICS_REVISION=(.*)/) { $rev = $1; } - if (/EPICS_MODIFICATION=(.*)/) { $mod = $1; } - if (/EPICS_UPDATE_NAME=(.*)/) { $upd_name = $1; } - if (/EPICS_UPDATE_LEVEL=(.*)/) { $upd_level = $1; } - if (/CVS_DATE="\\(.*)"/) { $cvs_date = $1; } - if (/CVS_TAG="\\(.*)"/) { $cvs_tag = $1; } + chomp; + next if m/^#/; # Skip comments + if (m/^EPICS_VERSION\s*=\s*(.*)\s*/) { $ver = $1; } + if (m/^EPICS_REVISION\s*=\s*(.*)\s*/) { $rev = $1; } + if (m/^EPICS_MODIFICATION\s*=\s*(.*)\s*/) { $mod = $1; } + if (m/^EPICS_PATCH_LEVEL\s*=\s*(.*)\s*/) { $patch = $1; } + if (m/^EPICS_CVS_SNAPSHOT\s*=\s*(.*)\s*/) { $snapshot = $1; } + if (m/^CVS_DATE\s*=\s*"\\(.*)"\s*/) { $cvs_date = $1; } + if (m/^CVS_TAG\s*=\s*"\\(.*)"\s*/) { $cvs_tag = $1; } } $ver_str = "$ver.$rev.$mod"; -$ver_str = "$ver_str.$upd_name" if $upd_name; -$ver_str = "$ver_str.$upd_level" if $upd_level; +$ver_str .= ".$patch" if $patch > 0; +$ver_str .= $snapshot if $snapshot ne ''; +$ver_str .= "-$site_ver" if $site_ver; print "Found EPICS Version $ver_str\n"; -$dir = $ARGV[1]; -$epicsVersion="$dir/epicsVersion.h"; +$epicsVersion="$outdir/epicsVersion.h"; -mkdir ($dir, 0777) unless -d $dir; +mkdir ($outdir, 0777) unless -d $outdir; -open OUT, "> $epicsVersion" or die "Cannot create $epicsVersion"; +open OUT, "> $epicsVersion" or die "Cannot create $epicsVersion: $!\n"; print OUT "#define EPICS_VERSION $ver\n"; print OUT "#define EPICS_REVISION $rev\n"; print OUT "#define EPICS_MODIFICATION $mod\n"; -print OUT "#define EPICS_UPDATE_NAME $upd_name\n"; -print OUT "#define EPICS_UPDATE_LEVEL $upd_level\n"; +print OUT "#define EPICS_PATCH_LEVEL $patch\n"; +print OUT "#define EPICS_CVS_SNAPSHOT \"$snapshot\"\n"; +print OUT "#define EPICS_SITE_VERSION \"$site_ver\"\n"; print OUT "#define EPICS_VERSION_STRING \"EPICS $ver_str\"\n"; print OUT "#define epicsReleaseVersion \"EPICS R$ver_str $cvs_tag $cvs_date\"\n";