Compare commits

..

11 Commits

Author SHA1 Message Date
8b9359723a fix problem with extra spaces after protocol name in link 2020-08-18 14:46:16 +02:00
bf55d4c202 Do not use upper level configure and do not install to upper level any more. Drops backward compatibility to Stream 2.7 2020-07-30 17:55:17 +02:00
1cace82a70 make version generation more robust 2020-07-30 17:15:47 +02:00
85e8632b02 fix version string in case that no version number is available 2020-07-22 10:48:10 +02:00
1994912271 Merge branch 'master' of github.com:paulscherrerinstitute/StreamDevice 2020-07-22 09:32:15 +02:00
98fa595753 fix Windows branch macro 2020-07-22 09:27:50 +02:00
f6640b3418 Generate version header for zip exports as well 2020-07-22 09:16:37 +02:00
4747bb5bc7 Merge pull request #53 from henrique-silva/fix-seq-link
Link streamApp against seq and pv libs when SNCSEQ is defined
2020-05-28 17:35:00 +02:00
bd9ee1c660 Merge pull request #51 from FreddieAkeroyd/remote_no_host_opt
Remove HOST_OPT=NO
2020-05-28 17:33:45 +02:00
1c9278812b Link streamApp against seq and pv libs when SNCSEQ is defined
This avoids linking problems if the calc lib has been compiled with seq
support.
2020-04-01 14:04:58 +02:00
2ea014ae46 Remove HOST_OPT=NO
On Windows changing HOST_OPT changes the compiler flags
potentially resulting in the mixing of debug and release
libraries in the final IOC
2020-03-26 20:32:53 +00:00
14 changed files with 94 additions and 73 deletions

3
.VERSION Normal file
View File

@ -0,0 +1,3 @@
COMMIT: $Format:%H$
REFS: $Format:%D$
DATE: $Format:%ci$

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
GNUmakefile export-ignore
.VERSION export-subst

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ include
*.pdf
*.*log
StreamVersion.h
*.local

View File

@ -26,16 +26,14 @@ HEADERS += src/StreamBuffer.h
HEADERS += src/StreamError.h
HEADERS += src/StreamVersion.h
CPPFLAGS += -DSTREAM_INTERNAL
CPPFLAGS += -DSTREAM_INTERNAL -I$(COMMON_DIR)
# Update version string (contains __DATE__ and __TIME__)
# each time anything changed.
StreamVersion$(OBJ): StreamVersion.h $(filter-out StreamVersion$(OBJ) stream_exportAddress$(OBJ),$(LIBOBJS) $(LIBRARY_OBJS))
# Update version string each time anything changes
StreamVersion$(OBJ) StreamVersion$(DEP): $(COMMON_DIR)/StreamVersion.h $(filter-out StreamVersion$(OBJ) stream_exportAddress$(OBJ),$(LIBOBJS) $(LIBRARY_OBJS))
MAKE_FIRST=src/StreamVersion.h
src/StreamVersion.h: $(SOURCES) $(filter-out %StreamVersion.h, $(HEADERS))
@echo Creating $@ from git tag
$(PERL) src/makeStreamVersion.pl > $@
$(COMMON_DIR)/StreamVersion.h: $(filter-out StreamVersion.h,$(notdir $(SOURCES) $(HEADERS)))
@echo Creating $@
$(PERL) ../src/makeStreamVersion.pl $@
StreamCore$(OBJ) StreamCore$(DEP): streamReferences
streamReferences:

View File

@ -21,21 +21,10 @@
# along with StreamDevice. If not, see https://www.gnu.org/licenses/.
#########################################################################/
TOP = ..
ifneq ($(wildcard ../configure),)
# We are in an EPICS R3.14+ <TOP> location
include $(TOP)/configure/CONFIG
else ifneq ($(wildcard ../config),)
# We are in an EPICS R3.13 <TOP> location
CONFIG = $(TOP)/config
include $(TOP)/config/CONFIG_APP
else
# Using our own local configuration
TOP = .
DIRS = configure
src_DEPEND_DIRS := $(DIRS)
include $(TOP)/configure/CONFIG
endif
TOP = .
DIRS = configure
src_DEPEND_DIRS := $(DIRS)
include $(TOP)/configure/CONFIG
DIRS += src
DIRS += streamApp

View File

@ -24,4 +24,3 @@ endif
# dbst based database optimization (default: NO)
DB_OPT = NO
HOST_OPT=NO

View File

@ -54,15 +54,17 @@ git clone https://github.com/paulscherrerinstitute/StreamDevice.git
<p class="new">
<em>StreamDevice</em> now comes with a standard
<kbd>configure</kbd> directory.
But it can still be built in an external <em>&lt;top&gt;</em>
<del>But it can still be built in an external <em>&lt;top&gt;</em>
directory as in previous versions.
It will automatically detect <em>&lt;top&gt;</em> locations
from the presence of <kbd>../configure</kbd> or <kbd>../config</kbd>
directories.
directories.</del> Using an upper level <kbd>../configure</kbd> is
no longer supported due to compatibility issues with <em>SynApps</em>.
</p>
<p class="new">
Edit the <kbd>configure/RELEASE</kbd> file to specify the install location
of EPICS base and of additional software modules, for example:
of EPICS base and of additional software modules or add a
<kbd>configure/RELEASE.local</kbd> file to overwrite, for example:
<pre>
EPICS_BASE=/home/epics/base-3.16.1
</pre>

View File

@ -21,16 +21,8 @@
# along with StreamDevice. If not, see https://www.gnu.org/licenses/.
#########################################################################/
TOP = ../..
ifneq ($(wildcard ../../configure),)
include $(TOP)/configure/CONFIG
else ifneq ($(wildcard ../../config),)
include $(TOP)/config/CONFIG_APP
include $(TOP)/config/RULES_ARCHS
else
TOP= ..
include $(TOP)/configure/CONFIG
endif
TOP= ..
include $(TOP)/configure/CONFIG
-include CONFIG_STREAM
-include ../CONFIG_STREAM
@ -89,9 +81,9 @@ CPPFLAGS += -DSTREAM_INTERNAL
# Update version string whenever something changed.
StreamVersion$(OBJ): $(COMMON_DIR)/StreamVersion.h $(filter-out StreamVersion$(OBJ),$(LIBOBJS) $(LIBRARY_OBJS)) ../CONFIG_STREAM
$(COMMON_DIR)/StreamVersion.h: $(SRCS) $(filter-out StreamVersion.h, $(INC))
@echo Creating $@ from git tag
$(PERL) ../makeStreamVersion.pl > $@
$(COMMON_DIR)/StreamVersion.h: ../../.VERSION $(SRCS) $(filter-out StreamVersion.h, $(INC))
@echo Creating $@
$(PERL) ../makeStreamVersion.pl $@
# Add references to all registrars to main file to avoid
# missing initialization.

View File

@ -187,9 +187,12 @@ bool StreamCore::
parse(const char* filename, const char* _protocolname)
{
protocolname = _protocolname;
// extract substitutions from protocolname "name(sub1,sub2)"
// extract substitutions from protocolname "name ( sub1, sub2 ) "
ssize_t i = protocolname.find('(');
if (i >= 0)
if (i < 0) i = 0;
while (protocolname[i-1] == ' ')
protocolname.remove(--i, 1);
if (protocolname[i] == '(')
{
while (i < (ssize_t)protocolname.length())
{

View File

@ -157,7 +157,7 @@ StreamProtocolParser* StreamProtocolParser::
readFile(const char* filename)
{
FILE* file;
#ifdef windows
#ifdef _WIN32
const char pathseparator = ';';
const char dirseparator = '\\';
#else

View File

@ -25,8 +25,17 @@
#define STR2(x) #x
#define STR(x) STR2(x)
const char StreamVersion [] =
"StreamDevice " STR(STREAM_MAJOR)
"StreamDevice"
#ifdef STREAM_MAJOR
" " STR(STREAM_MAJOR)
"." STR(STREAM_MINOR)
"." STR(STREAM_PATCHLEVEL)
STREAM_DEV
" built " __DATE__ " " __TIME__;
#endif
#ifdef STREAM_COMMIT_DATE
" " STREAM_COMMIT_DATE
#endif
#ifdef STREAM_COMMIT_HASH
"\n commit: " STREAM_COMMIT_HASH
#endif
;

View File

@ -22,29 +22,56 @@
use strict;
my $dir = "O.Common";
my $versionfile = "StreamVersion.h";
my $version = `git describe --tags --dirty --match "[0-9]*"`
or die "Cannot run git.\n";
my ( $major, $minor, $patch, $dev, $date, $hash );
my ( $major, $minor, $patch, $dev );
if (my $version = `git describe --tags --abbrev=0 --dirty --match "[0-9]*" 2>/dev/null`) {
if ($version =~ m/(\d+)\.(\d+)\.(\d+)?(.*)?/) {
$major = $1; $minor = $2; $patch = $3; $dev = $4;
}
if (`git log -1 --format="%H %ci"`=~ m/([[:xdigit:]]+) (.+)/) {
$hash = $1; $date = $2;
}
}
if (!$major) {
if (open(my $fh, '<', '../../.VERSION')) {
while (my $line = <$fh>) {
if ($line =~ m/COMMIT: *([[:xdigit:]]+)/) {
$hash = $1;
}
if ($line =~ m/REFS: .*tag: *(\d+)\.(\d+)\.?(\d+)?/) {
$major = $1; $minor = $2; $patch = $3 or $patch = 0;
}
if ($line =~ m/DATE: *([-0-9:+ ]*)/) {
$date = $1;
}
}
} else {
print "neither git repo nor .VERSION file found\n";
}
}
$version =~ m/(\d+)\.(\d+)\.(\d+)?(.*)?/
or die "Unexpected git tag format $version\n";
$major = $1; $minor=$2; $patch=$3; $dev=$4;
print << "EOF";
/* Generated file $versionfile */
open my $out, '>', @ARGV or die $!;
print $out <<EOF;
/* Generated file */
#ifndef StreamVersion_h
#define StreamVersion_h
EOF
if ($major) {
print $out <<EOF;
#define STREAM_MAJOR $major
#define STREAM_MINOR $minor
#define STREAM_PATCHLEVEL $patch
#define STREAM_DEV "$dev"
#endif /* StreamVersion_h */
EOF
}
if ($hash) {
print $out "#define STREAM_COMMIT_HASH \"$hash\"\n";
}
if ($date) {
print $out "#define STREAM_COMMIT_DATE \"$date\"\n";
}
print $out "#endif /* StreamVersion_h */\n";
close $out

View File

@ -21,16 +21,8 @@
# along with StreamDevice. If not, see https://www.gnu.org/licenses/.
#########################################################################/
TOP = ../..
ifneq ($(wildcard ../../configure),)
include $(TOP)/configure/CONFIG
else ifneq ($(wildcard ../../config),)
include $(TOP)/config/CONFIG_APP
include $(TOP)/config/RULES_ARCHS
else
TOP= ..
include $(TOP)/configure/CONFIG
endif
TOP= ..
include $(TOP)/configure/CONFIG
PROD = streamApp
DBD = streamApp.dbd
@ -68,6 +60,10 @@ PROD_LIBS += sscan
endif
endif
ifneq ($(words $(SNCSEQ) $(SYNAPPS)), 0)
PROD_LIBS += seq pv
endif
streamApp_DBD += stream.dbd
ifdef PCRE

View File

@ -22,20 +22,20 @@
record (stringout, "$(P):cmd")
{
field (DTYP, "stream")
field (OUT, "@test.proto command terminal")
field (OUT, "@test.proto command terminal")
field (PRIO, "HIGH")
field (VAL, "")
}
record (stringout, "$(P):info")
{
field (DTYP, "stream")
field (OUT, "@test.proto info terminal")
field (OUT, "@test.proto info terminal ")
field (PRIO, "HIGH")
}
record (stringout, "$(P):request")
{
field (DTYP, "stream")
field (OUT, "@test.proto request($(P):reply.VAL) terminal")
field (OUT, "@test.proto request ($(P):reply.VAL) terminal")
field (PRIO, "HIGH")
}
record (stringin, "$(P):reply")
@ -44,7 +44,7 @@ record (stringin, "$(P):reply")
record (stringout, "$(P):checksum")
{
field (DTYP, "stream")
field (OUT, "@test.proto checksum($(CHKSUM=sum)) terminal")
field (OUT, "@test.proto checksum ($(CHKSUM=sum)) terminal")
}
record (stringin, "$(P):spy")
{