Compare commits

...

3 Commits

9 changed files with 47 additions and 56 deletions

1
.gitignore vendored
View File

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

View File

@ -21,21 +21,10 @@
# along with StreamDevice. If not, see https://www.gnu.org/licenses/. # 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 = . TOP = .
DIRS = configure DIRS = configure
src_DEPEND_DIRS := $(DIRS) src_DEPEND_DIRS := $(DIRS)
include $(TOP)/configure/CONFIG include $(TOP)/configure/CONFIG
endif
DIRS += src DIRS += src
DIRS += streamApp DIRS += streamApp

View File

@ -54,15 +54,17 @@ git clone https://github.com/paulscherrerinstitute/StreamDevice.git
<p class="new"> <p class="new">
<em>StreamDevice</em> now comes with a standard <em>StreamDevice</em> now comes with a standard
<kbd>configure</kbd> directory. <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. directory as in previous versions.
It will automatically detect <em>&lt;top&gt;</em> locations It will automatically detect <em>&lt;top&gt;</em> locations
from the presence of <kbd>../configure</kbd> or <kbd>../config</kbd> 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>
<p class="new"> <p class="new">
Edit the <kbd>configure/RELEASE</kbd> file to specify the install location 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> <pre>
EPICS_BASE=/home/epics/base-3.16.1 EPICS_BASE=/home/epics/base-3.16.1
</pre> </pre>

View File

@ -21,16 +21,8 @@
# along with StreamDevice. If not, see https://www.gnu.org/licenses/. # 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= .. TOP= ..
include $(TOP)/configure/CONFIG include $(TOP)/configure/CONFIG
endif
-include CONFIG_STREAM -include CONFIG_STREAM
-include ../CONFIG_STREAM -include ../CONFIG_STREAM
@ -89,7 +81,7 @@ CPPFLAGS += -DSTREAM_INTERNAL
# Update version string whenever something changed. # Update version string whenever something changed.
StreamVersion$(OBJ): $(COMMON_DIR)/StreamVersion.h $(filter-out StreamVersion$(OBJ),$(LIBOBJS) $(LIBRARY_OBJS)) ../CONFIG_STREAM 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)) $(COMMON_DIR)/StreamVersion.h: ../../.VERSION $(SRCS) $(filter-out StreamVersion.h, $(INC))
@echo Creating $@ @echo Creating $@
$(PERL) ../makeStreamVersion.pl $@ $(PERL) ../makeStreamVersion.pl $@

View File

@ -189,7 +189,10 @@ parse(const char* filename, const char* _protocolname)
protocolname = _protocolname; protocolname = _protocolname;
// extract substitutions from protocolname "name ( sub1, sub2 ) " // extract substitutions from protocolname "name ( sub1, sub2 ) "
ssize_t i = protocolname.find('('); 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()) while (i < (ssize_t)protocolname.length())
{ {

View File

@ -26,10 +26,16 @@
#define STR(x) STR2(x) #define STR(x) STR2(x)
const char StreamVersion [] = const char StreamVersion [] =
"StreamDevice" "StreamDevice"
#if STREAM_MAJOR+0 #ifdef STREAM_MAJOR
" " STR(STREAM_MAJOR) " " STR(STREAM_MAJOR)
"." STR(STREAM_MINOR) "." STR(STREAM_MINOR)
"." STR(STREAM_PATCHLEVEL) "." STR(STREAM_PATCHLEVEL)
STREAM_DEV STREAM_DEV
#endif #endif
" commit:" STREAM_COMMIT_HASH; #ifdef STREAM_COMMIT_DATE
" " STREAM_COMMIT_DATE
#endif
#ifdef STREAM_COMMIT_HASH
"\n commit: " STREAM_COMMIT_HASH
#endif
;

View File

@ -23,7 +23,7 @@
use strict; use strict;
my ( $major, $minor, $patch, $dev, $branch, $date, $hash ); my ( $major, $minor, $patch, $dev, $date, $hash );
if (my $version = `git describe --tags --abbrev=0 --dirty --match "[0-9]*" 2>/dev/null`) { if (my $version = `git describe --tags --abbrev=0 --dirty --match "[0-9]*" 2>/dev/null`) {
if ($version =~ m/(\d+)\.(\d+)\.(\d+)?(.*)?/) { if ($version =~ m/(\d+)\.(\d+)\.(\d+)?(.*)?/) {
@ -39,10 +39,10 @@ if (!$major) {
if ($line =~ m/COMMIT: *([[:xdigit:]]+)/) { if ($line =~ m/COMMIT: *([[:xdigit:]]+)/) {
$hash = $1; $hash = $1;
} }
if ($line =~ m/REFS: *tag: *((\d+)\.(\d+)\.(\d+)?,)? *(.*)/) { if ($line =~ m/REFS: .*tag: *(\d+)\.(\d+)\.?(\d+)?/) {
$major = $2; $minor = $3; $patch = $4; $branch = $5; $major = $1; $minor = $2; $patch = $3 or $patch = 0;
} }
if ($line =~ m/DATE: *(.+)/) { if ($line =~ m/DATE: *([-0-9:+ ]*)/) {
$date = $1; $date = $1;
} }
} }
@ -58,14 +58,20 @@ print $out <<EOF;
#ifndef StreamVersion_h #ifndef StreamVersion_h
#define StreamVersion_h #define StreamVersion_h
EOF
if ($major) {
print $out <<EOF;
#define STREAM_MAJOR $major #define STREAM_MAJOR $major
#define STREAM_MINOR $minor #define STREAM_MINOR $minor
#define STREAM_PATCHLEVEL $patch #define STREAM_PATCHLEVEL $patch
#define STREAM_DEV "$dev" #define STREAM_DEV "$dev"
#define STREAM_COMMIT_HASH "$hash"
#define STREAM_COMMIT_DATE "$date"
#endif /* StreamVersion_h */
EOF 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 close $out

View File

@ -21,16 +21,8 @@
# along with StreamDevice. If not, see https://www.gnu.org/licenses/. # 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= .. TOP= ..
include $(TOP)/configure/CONFIG include $(TOP)/configure/CONFIG
endif
PROD = streamApp PROD = streamApp
DBD = streamApp.dbd DBD = streamApp.dbd