Compare commits

...

27 Commits

Author SHA1 Message Date
Andrew Johnson
dc61957963 Set SNAPSHOT for R3.14.12.5 2015-03-24 09:57:35 -05:00
Janet Anderson
583108e42a Set version number to R3.14.12.5. 2015-03-24 08:50:39 -05:00
Andrew Johnson
9470830091 catools: Fix printing -ve DBF_LONG values on 64-bit 2015-03-23 15:59:11 -05:00
Andrew Johnson
e84e7b930f Release notes for ao-convert changes 2015-03-20 17:05:16 -05:00
Andrew Johnson
f498b36438 Prevent overflows in ao value conversion.
Also makes ROFF fields unsigned, needed for ROFF=0x80000000
2015-03-20 16:34:14 -05:00
Andrew Johnson
d927afe257 Make including cfg/CONFIG* files unconditional 2015-03-19 10:18:23 -05:00
Andrew Johnson
f994944531 libCom/posix: Remove pthread_setcanceltype() 2015-03-18 11:36:06 -05:00
Andrew Johnson
5ffda58351 ca: Fix missing guard argument 2015-03-13 11:08:05 -05:00
Andrew Johnson
f6373093a5 Fix Windows linkage warning in alarmString.h 2015-03-13 10:56:03 -05:00
Andrew Johnson
8215244a28 Fix Windows time discontinuity report 2015-03-13 10:06:23 -05:00
Andrew Johnson
de298da94c Fix Jenkins instability on Windows 2015-03-11 10:53:37 -05:00
Andrew Johnson
753bfcc579 Check sender threads are starting 2015-03-10 18:14:11 -05:00
Andrew Johnson
4568cd3616 Chasing Jenkins instability on Windows 2015-03-10 14:17:28 -05:00
Andrew Johnson
e75ec5f85b Set snapshot to -rc1-DEV 2015-03-09 14:33:17 -05:00
Andrew Johnson
657f726527 Fix FIND_TOOL 2015-03-09 14:24:44 -05:00
Janet Anderson
0f0a8cbbe5 Set version to 3.14.12.5-rc1 2015-03-09 12:34:42 -05:00
Andrew Johnson
84e74d0924 Fix 'Can't find convertRelease.pl' problem 2015-03-09 11:33:50 -05:00
Andrew Johnson
2a6714fd03 configure: Cosmetic changes only, comments & spacing. 2015-03-06 18:14:59 -06:00
Andrew Johnson
5610b07068 configure: Support for cfg/TOP_RULES* and cfg/DIR_RULES*
Idea and initial implementation from Benjamin Franksen,
I added the DIR_RULES and ACTIONS support.
Reverses the order in which cfg/CONFIG* files are included.
2015-03-06 17:43:26 -06:00
Andrew Johnson
d26654674c Fix the RTEMS override of the ECHO variable 2015-03-03 11:53:23 -06:00
Benjamin Franksen
5f638805dd Improved "Installing ..." messages in RULES.Db 2015-03-03 11:47:37 -06:00
Benjamin Franksen
bc52c8e374 Fixed RELEASE_PERL_MODULE_DIRS 2015-03-03 11:45:23 -06:00
Andrew Johnson
fb1a0c2b1e Clean up g++ warnings in repeater.cpp 2015-02-28 20:20:56 -06:00
Andrew Johnson
2378d465d1 Update supported targets lists in CONFIG_SITE 2015-02-27 16:07:07 -06:00
Janet Anderson
2799f1cf3f Fixed incorrect comment lines 2015-02-26 13:26:56 -06:00
Janet Anderson
91c8ba592d Added directory change comment for Older Xcode 2015-02-26 13:24:29 -06:00
Andrew Johnson
004e7237c3 Snapshot to -pre1-DEV 2015-02-25 16:24:28 -06:00
33 changed files with 339 additions and 204 deletions

View File

@@ -14,17 +14,17 @@
#
ifneq ($(wildcard $(TOP)/configure/CONFIG_BASE_VERSION),)
EPICS_BASE = $(INSTALL_LOCATION)
CONFIG = $(TOP)/configure
BASE_TOP=YES
EPICS_BASE = $(INSTALL_LOCATION)
CONFIG = $(TOP)/configure
BASE_TOP=YES
else
CONFIG ?= $(EPICS_BASE)/configure
CONFIG ?= $(EPICS_BASE)/configure
endif
# Provide a default if the user hasn't set EPICS_HOST_ARCH
ifeq ($(origin EPICS_HOST_ARCH), undefined)
# NB: Must use a simply expanded variable here for performance:
EPICS_HOST_ARCH := $(shell $(CONFIG)/../startup/EpicsHostArch.pl)
# NB: We use a simply expanded variable here for performance:
EPICS_HOST_ARCH := $(shell $(CONFIG)/../startup/EpicsHostArch.pl)
endif
#
@@ -34,8 +34,8 @@ endif
-include $(CONFIG)/RELEASE.$(EPICS_HOST_ARCH)
-include $(CONFIG)/RELEASE.$(EPICS_HOST_ARCH).Common
ifdef T_A
-include $(CONFIG)/RELEASE.Common.$(T_A)
-include $(CONFIG)/RELEASE.$(EPICS_HOST_ARCH).$(T_A)
-include $(CONFIG)/RELEASE.Common.$(T_A)
-include $(CONFIG)/RELEASE.$(EPICS_HOST_ARCH).$(T_A)
endif
include $(CONFIG)/CONFIG_COMMON
@@ -58,58 +58,64 @@ include $(CONFIG)/CONFIG_BASE_VERSION
include $(CONFIG)/os/CONFIG.$(EPICS_HOST_ARCH).Common
-include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).Common
RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops)
ifdef T_A
# Cross compile specific definitions
#
ifneq ($(EPICS_HOST_ARCH),$(T_A))
include $(CONFIG)/CONFIG.CrossCommon
endif
# Cross compile specific definitions
#
ifneq ($(EPICS_HOST_ARCH),$(T_A))
include $(CONFIG)/CONFIG.CrossCommon
endif
# Target architecture specific definitions
#
-include $(CONFIG)/os/CONFIG.Common.$(T_A)
# Target architecture specific definitions
#
-include $(CONFIG)/os/CONFIG.Common.$(T_A)
# Host-Target architecture specific definitions
#
-include $(CONFIG)/os/CONFIG.$(EPICS_HOST_ARCH).$(T_A)
# Host-Target architecture specific definitions
#
-include $(CONFIG)/os/CONFIG.$(EPICS_HOST_ARCH).$(T_A)
# RELEASE file specific definitions
#
ifneq ($(CONFIG),$(TOP)/configure)
-include $(CONFIG)/CONFIG_APP_INCLUDE
endif
# RELEASE file specific definitions
#
ifneq ($(CONFIG),$(TOP)/configure)
-include $(CONFIG)/CONFIG_APP_INCLUDE
endif
# Site specific target and host-target definitions
#
-include $(CONFIG)/os/CONFIG_SITE.Common.$(T_A)
-include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
endif # ifdef T_A
# Site specific target and host-target definitions
#
-include $(CONFIG)/os/CONFIG_SITE.Common.$(T_A)
-include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
# Include <top>/cfg/CONFIG* definitions from tops defined in RELEASE* files
#
ifneq ($(CONFIG),$(TOP)/configure)
RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops)
RELEASE_CFG_CONFIGS = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/cfg/CONFIG*))
ifneq ($(RELEASE_CFG_CONFIGS),)
include $(RELEASE_CFG_CONFIGS)
endif
RELEASE_TOPS_REVERSE := $(shell \
$(PERL) -e '$$,=" ";print reverse @ARGV' $(RELEASE_TOPS))
RELEASE_CFG_CONFIGS = $(foreach top, $(RELEASE_TOPS_REVERSE), \
$(wildcard $($(top))/cfg/CONFIG*))
ifneq ($(RELEASE_CFG_CONFIGS),)
include $(RELEASE_CFG_CONFIGS)
endif
endif
# Include $(INSTALL_CFG)/CONFIG* definitions
#
TOP_CFG_CONFIGS = $(wildcard $(INSTALL_CFG)/CONFIG*)
ifneq ($(TOP_CFG_CONFIGS),)
include $(TOP_CFG_CONFIGS)
include $(TOP_CFG_CONFIGS)
endif
endif # ifdef T_A
# User specific definitions
#
-include $(HOME)/configure/CONFIG_USER
-include $(HOME)/configure/CONFIG_USER.$(EPICS_HOST_ARCH)
ifdef T_A
-include $(HOME)/configure/CONFIG_USER.Common.$(T_A)
-include $(HOME)/configure/CONFIG_USER.$(EPICS_HOST_ARCH).$(T_A)
-include $(HOME)/configure/CONFIG_USER.Common.$(T_A)
-include $(HOME)/configure/CONFIG_USER.$(EPICS_HOST_ARCH).$(T_A)
endif

View File

@@ -26,7 +26,6 @@
# USR_CFLAGS C flags
# USR_CXXFLAGS C++ flags
# USR_CPPFLAGS c preprocesser flags
# INC include-files to install
# SRCS source files for building libraries and prods
# USR_SRCS source files for building libraries and prods
# PROD_SRCS source files for building prods

View File

@@ -1,24 +1,34 @@
export TOP
export IOCAPPS
#*************************************************************************
# Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution.
#*************************************************************************
#
# $Revision-Id$
#
RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops)
export TOP
ifneq ($(RELEASE_TOPS),)
define RELEASE_FLAGS_template
export $(1)
$(1)_HOST_BIN = $$(strip $$($(1)))/bin/$$(EPICS_HOST_ARCH)
$(1)_HOST_LIB = $$(strip $$($(1)))/lib/$$(EPICS_HOST_ARCH)
$(1)_BIN = $$(wildcard $$(strip $$($(1)))/bin/$$(T_A))
$(1)_LIB = $$(wildcard $$(strip $$($(1)))/lib/$$(T_A))
$(1)_HOST_BIN = $$(strip $$($(1)))/bin/$(EPICS_HOST_ARCH)
$(1)_HOST_LIB = $$(strip $$($(1)))/lib/$(EPICS_HOST_ARCH)
$(1)_BIN = $$(wildcard $$(strip $$($(1)))/bin/$(T_A))
$(1)_LIB = $$(wildcard $$(strip $$($(1)))/lib/$(T_A))
SHRLIB_SEARCH_DIRS += $$($(1)_LIB)
RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include/os/$$(OS_CLASS)))
RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include/os/$(OS_CLASS)))
RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include))
RELEASE_DBD_DIRS += $$(wildcard $$(strip $$($(1)))/dbd)
RELEASE_DB_DIRS += $$(wildcard $$(strip $$($(1)))/db)
RELEASE_PERL_MODULE_DIRS += $$(wildcard $$($(1)_LIB)/perl)
RELEASE_PERL_MODULE_DIRS += $$(wildcard $$(strip $$($(1)))/lib/perl)
endef
$(foreach top, $(RELEASE_TOPS), $(eval $(call RELEASE_FLAGS_template,$(top)) ))
$(foreach top, $(RELEASE_TOPS), \
$(eval $(call RELEASE_FLAGS_template,$(top))))
endif

View File

@@ -54,6 +54,7 @@ BASE_CPPFLAGS += $(OSITHREAD_DEFAULT_STACK_FLAGS_$(OSITHREAD_USE_DEFAULT_STACK))
# Where to find the installed build tools
TOOLS = $(EPICS_BASE_HOST_BIN)
FIND_TOOL = $(firstword $(wildcard $(TOOLS)/$(1) $(TOP)/src/tools/$(1)))
#---------------------------------------------------------------
# Epics base build tools and tool flags
@@ -63,7 +64,7 @@ DBEXPAND = $(call PATH_FILTER, $(TOOLS)/dbExpand$(HOSTEXE))
DBTORECORDTYPEH = $(call PATH_FILTER, $(TOOLS)/dbToRecordtypeH$(HOSTEXE))
DBTOMENUH = $(call PATH_FILTER, $(TOOLS)/dbToMenuH$(HOSTEXE))
REGISTERRECORDDEVICEDRIVER = $(PERL) $(TOOLS)/registerRecordDeviceDriver.pl
CONVERTRELEASE = $(PERL) $(TOOLS)/convertRelease.pl
CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl)
FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl
#-------------------------------------------------------

View File

@@ -34,7 +34,7 @@ EPICS_PATCH_LEVEL = 5
# This will end in -DEV between official releases
#EPICS_DEV_SNAPSHOT=-DEV
EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
@@ -42,7 +42,7 @@ EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
#EPICS_DEV_SNAPSHOT=
EPICS_DEV_SNAPSHOT=
# No changes should be needed below here

View File

@@ -25,6 +25,7 @@
# darwin-x86 (Intel based Apple running OSX)
# freebsd-x86 (GNU compiler used for host builds)
# freebsd-x86_64 (GNU compiler used for host builds)
# linux-arm (GNU compiler used for host builds)
# linux-ppc (GNU compiler used for host builds)
# linux-ppc64 (GNU compiler used for host builds)
# linux-x86 (GNU compiler used for host builds)
@@ -41,10 +42,13 @@
# win32-x86 (MS Visual C++ compiler used for host builds)
# win32-x86-cygwin (WIN32 API with cygwin GNU compiler used for host builds)
# win32-x86-mingw (MinGW compiler used for host builds)
# win32-x86-static (MS Visual C++ compiler used for host builds)
# windows-x64 (MS Visual C++ compiler used for host builds)
# windows-x64-mingw (MinGW compiler used for host builds)
# windows-x64-static (MS Visual C++ compiler used for host builds)
# Debugging builds
# Debugging builds:
# linux-arm-debug (GNU compiler used for host builds)
# linux-x86-debug (GNU compiler with -g option for host builds)
# linux-x86_64-debug (GNU compiler with -g option for host builds)
# solaris-sparc-debug (sun compiler no optimization,-g for debugging info)
@@ -61,13 +65,13 @@
#
# Currently Supporting:
# ios-arm
# ios-386
# ios-arm (darwin-x86 host)
# ios-386 (darwin-x86 host)
# linux-386 (linux-x86 host)
# linux-486 (linux-x86 host)
# linux-586 (linux-x86 host)
# linux-686 (linux-x86 host)
# linux-arm (linux-x86 host)
# linux-arm (linux-x86 or -x86_64 host)
# linux-arm_eb (linux-x86 host)
# linux-arm_el (linux-x86 host)
# linux-athlon (linux-x86 host)
@@ -102,6 +106,7 @@
# RTEMS-pc386
# RTEMS-psim
# RTEMS-uC5282
# win32-x86-mingw (linux-x86 or -x86_64 host)
#
# Definitions of CROSS_COMPILER_TARGET_ARCHS in

View File

@@ -199,7 +199,7 @@ $(COMMON_DIR)/%.substitutions:
endif
$(INSTALL_DB)/%.substitutions: %.substitutions
$(ECHO) "Installing db file $@"
$(ECHO) "Installing substitution file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
.PRECIOUS: $(COMMON_DIR)/%.substitutions
@@ -213,7 +213,7 @@ $(COMMON_DIR)/%.template: $(COMMON_DIR)/%.edf
@$(RM) $@.VAR
$(INSTALL_DB)/%.template: %.template
$(ECHO) "Installing db file $@"
$(ECHO) "Installing template file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
.PRECIOUS: $(COMMON_DIR)/%.template
@@ -351,7 +351,7 @@ $(COMMON_DIR)/%.db: $(COMMON_DIR)/%.db$(RAW)
else
$(INSTALL_DB)/%: %
$(ECHO) "Installing db file $@"
$(ECHO) "Installing $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
endif

View File

@@ -20,38 +20,37 @@ ACTIONS += browse
ACTIONS += runtests tapfiles
#ACTIONS += rebuild
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
actionArchTargets = $(foreach action, $(ACTIONS), \
$(foreach arch, $(BUILD_ARCHS), \
$(action)$(DIVIDER)$(arch)))
actionArchTargets = $(foreach x, $(ACTIONS),\
$(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))
cleanArchTargets = $(foreach arch,$(BUILD_ARCHS), clean$(DIVIDER)$(arch))
cleanArchTargets = $(foreach arch, $(BUILD_ARCHS), \
clean$(DIVIDER)$(arch))
buildDirs = $(addprefix O.,$(BUILD_ARCHS))
#*************************************************************************
# Create epics_host_arch dependancies for GNU make -j option
# Only works with GNU make 3.81 or later (uses eval function)
# Include <top>/cfg/DIR_RULES* files from tops defined in RELEASE* files
# Do this here so they can add ACTIONS
#
RELEASE_CFG_DIR_RULES = $(foreach top, $(RELEASE_TOPS), \
$(wildcard $($(top))/cfg/DIR_RULES*))
ifneq ($(RELEASE_CFG_DIR_RULES),)
include $(RELEASE_CFG_DIR_RULES)
endif
# Create EPICS_HOST_ARCH dependancies for GNU make -j option.
# Needed in dirs where EPICS_HOST_ARCH build creates a tool used in
# cross arch builds
CROSS_ARCHS += $(CROSS1) $(CROSS2)
# j is NOT found in MAKEFLAGS when using make 3.81
# Hope to uncomment this for GNU make 3.82
#ifeq ($(findstring j,$(MAKEFLAGS)),j)
define DEP_template
$(2): $$(EPICS_HOST_ARCH)
$(1)$$(DIVIDER)$(2): $(1)$$(DIVIDER)$$(EPICS_HOST_ARCH) O.$(2)
endef
$(foreach action, $(ACTIONS), $(foreach arch,\
$(CROSS_ARCHS),$(eval $(call DEP_template,$(action),$(arch)))))
#endif
#*************************************************************************
$(foreach action, $(ACTIONS), \
$(foreach arch, $(CROSS_ARCHS), \
$(eval $(call DEP_template,$(action),$(arch)))))
# Allows rebuild to work with parallel builds option, -j.
ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS)))
@@ -59,8 +58,11 @@ $(buildDirs) O.Common : clean
rebuild: install
endif
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
$(actionArchTargets) : $(buildDirs) O.Common
$(MAKE) -C O.$(archPart) -f ../Makefile TOP=$(TOP)/.. T_A=$(archPart) $(actionPart)
$(MAKE) -C O.$(archPart) -f ../Makefile TOP=$(TOP)/.. \
T_A=$(archPart) $(actionPart)
$(BUILD_ARCHS) : % : O.% O.Common
$(MAKE) -C O.$@ -f ../Makefile TOP=$(TOP)/.. T_A=$@
@@ -73,8 +75,7 @@ $(buildDirs):
O.Common:
$(MKDIR) O.Common
#
# special clean rule
# Clean rules
#
clean ::
$(RMDIR) $(addprefix O.,$(BUILD_ARCHS)) O.Common
@@ -92,3 +93,7 @@ realclean ::
.PHONY : $(cleanArchTargets)
.PHONY : $(BUILD_ARCHS) rebuild
.PHONY : $(ACTIONS) clean realclean archclean all
# User specific rules
#
-include $(HOME)/configure/RULES_USER

View File

@@ -15,26 +15,30 @@ ARCHS += $(BUILD_ARCHS)
ACTIONS += inc build install buildInstall clean realclean archclean
ACTIONS += runtests tapfiles
dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@))))
actionArchPart = $(join $(word 2, $(subst $(DIVIDER), ,$(notdir $@))), \
$(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@)))))
dirActionArchTargets = $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(foreach arch, $(ARCHS), \
$(dir)$(DIVIDER)$(action)$(DIVIDER)$(arch))))
$(foreach action, $(ACTIONS), \
$(foreach arch, $(ARCHS), \
$(dir)$(DIVIDER)$(action)$(DIVIDER)$(arch))))
dirArchTargets += $(foreach dir, $(DIRS), \
$(foreach arch, $(ARCHS),\
$(dir)$(DIVIDER)$(arch)))
$(foreach arch, $(ARCHS), \
$(dir)$(DIVIDER)$(arch)))
dirActionTargets += $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(dir)$(DIVIDER)$(action)))
actionArchTargets = $(foreach action, $(ACTIONS),\
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
$(foreach action, $(ACTIONS), \
$(dir)$(DIVIDER)$(action)))
actionArchTargets = $(foreach action, $(ACTIONS), \
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
all : install
all: install
# Include <top>/cfg/DIR_RULES* files from tops defined in RELEASE* files
# Do this here so they can add ACTIONS
#
RELEASE_CFG_DIR_RULES = $(foreach top, $(RELEASE_TOPS), \
$(wildcard $($(top))/cfg/DIR_RULES*))
ifneq ($(RELEASE_CFG_DIR_RULES),)
include $(RELEASE_CFG_DIR_RULES)
endif
# Allows rebuild to work with parallel builds option, -j.
ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS)))
@@ -48,30 +52,42 @@ endif
define DEP_template1
$(1): $$($(1)_DEPEND_DIRS)
endef
$(foreach dir, $(DIRS),$(eval $(call DEP_template1,$(dir))))
$(foreach dir, $(DIRS), \
$(eval $(call DEP_template1,$(dir))))
define DEP_template2
$(1)$$(DIVIDER)$(2) : $$(foreach ddir, $$($(1)_DEPEND_DIRS),$$(addsuffix $$(DIVIDER)$(2),$$(ddir)))
$(1)$$(DIVIDER)$(2) : $$(foreach ddir, $$($(1)_DEPEND_DIRS), \
$$(addsuffix $$(DIVIDER)$(2),$$(ddir)))
endef
$(foreach action, $(ACTIONS), $(foreach dir, $(DIRS),$(eval $(call DEP_template2,$(dir),$(action)))))
$(foreach action, $(ACTIONS), \
$(foreach dir, $(DIRS), \
$(eval $(call DEP_template2,$(dir),$(action)))))
define DEP_template3
$(1)$$(DIVIDER)$(2) : $$(foreach ddir, $$($(1)_DEPEND_DIRS),$$(addsuffix $$(DIVIDER)$(2),$$(ddir)))
$(1)$$(DIVIDER)$(2) : $$(foreach ddir, $$($(1)_DEPEND_DIRS), \
$$(addsuffix $$(DIVIDER)$(2),$$(ddir)))
endef
$(foreach arch, $(ARCHS), $(foreach dir, $(DIRS),$(eval $(call DEP_template3,$(dir),$(arch)))))
$(foreach arch, $(ARCHS), \
$(foreach dir, $(DIRS), \
$(eval $(call DEP_template3,$(dir),$(arch)))))
define DEP_template4
$(1)$$(DIVIDER)$(2)$$(DIVIDER)$(3) : $$(foreach ddir, $$($(1)_DEPEND_DIRS),$$(addsuffix $$(DIVIDER)$(2)$$(DIVIDER)$(3),$$(ddir)))
$(1)$$(DIVIDER)$(2)$$(DIVIDER)$(3) : $$(foreach ddir, $$($(1)_DEPEND_DIRS), \
$$(addsuffix $$(DIVIDER)$(2)$$(DIVIDER)$(3),$$(ddir)))
endef
$(foreach arch, $(ARCHS), $(foreach action, $(ACTIONS), $(foreach dir, $(DIRS), \
$(eval $(call DEP_template4,$(dir),$(action),$(arch))))))
$(foreach arch, $(ARCHS), \
$(foreach action, $(ACTIONS), \
$(foreach dir, $(DIRS), \
$(eval $(call DEP_template4,$(dir),$(action),$(arch))))))
dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@))))
actionArchPart = $(join $(word 2, $(subst $(DIVIDER), ,$(notdir $@))), \
$(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@)))))
$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets) :
$(MAKE) -C $(dirPart) $(actionArchPart)
$(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
.PHONY : $(DIRS) all rebuild
.PHONY : $(ARCHS) $(ACTIONS)
@@ -79,3 +95,7 @@ $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
.PHONY : $(dirActionArchTargets)
.PHONY : $(actionArchTargets)
# User specific rules
#
-include $(HOME)/configure/RULES_USER

View File

@@ -6,27 +6,27 @@
# EPICS BASE is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution.
#*************************************************************************
#
# $Revision-Id$
#
#---------------------------------------------------------------
# Include <top>/configure/RULES_BUILD definitions from tops defined in RELEASE* files
# Include <top>/configure/RULES_BUILD from tops defined in RELEASE* files
#
RELEASE_RULES_BUILDS = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/configure/RULES_BUILD))
RELEASE_RULES_BUILDS = $(foreach top, $(RELEASE_TOPS), \
$(wildcard $($(top))/configure/RULES_BUILD))
ifneq ($(RELEASE_RULES_BUILDS),)
include $(RELEASE_RULES_BUILDS)
endif
#---------------------------------------------------------------
# Include <top>/cfg/RULES* definitions from tops defined in RELEASE* files
# Include <top>/cfg/RULES* files from tops defined in RELEASE* files
#
RELEASE_CFG_RULES = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/cfg/RULES*))
RELEASE_CFG_RULES = $(foreach top, $(RELEASE_TOPS), \
$(wildcard $($(top))/cfg/RULES*))
ifneq ($(RELEASE_CFG_RULES),)
include $(RELEASE_CFG_RULES)
endif
#---------------------------------------------------------------
# If this is not BASE then include TOP/configure/RULES_BUILD definitions
# If this is not BASE then include <TOP>/configure/RULES_BUILD
#
ifeq ($(wildcard $(TOP)/configure/CONFIG_BASE_VERSION),)
TOP_RULES_BUILDS = $(wildcard $(TOP)/configure/RULES_BUILD)
@@ -35,37 +35,38 @@ ifneq ($(TOP_RULES_BUILDS),)
endif
endif
#---------------------------------------------
# Include our own $(INSTALL_CFG)/RULES* definitions
# Include our own $(INSTALL_CFG)/RULES* files
#
TOP_CFG_RULES = $(wildcard $(INSTALL_CFG)/RULES*)
ifneq ($(TOP_CFG_RULES),)
include $(TOP_CFG_RULES)
endif
#---------------------------------------------------------------
# Rules to install each FILE_TYPE
#
define FILE_TYPE_template
$(1) += $$(if $$(strip $$($(1)_$$(OS_CLASS))),$$(subst -nil-,,$$($(1)_$$(OS_CLASS))), $$($(1)_DEFAULT))
$(1) += $$(if $$(strip $$($(1)_$(OS_CLASS))), \
$$(subst -nil-,,$$($(1)_$(OS_CLASS))), \
$$($(1)_DEFAULT))
INSTALLS_$(1) = $$($(1):%=$$(INSTALL_$(1))/%)
$$(INSTALL_$(1))/%: ../%
$(ECHO) "Installing $(1) file $$@"
@$$(INSTALL) -d -m $$(INSTALL_PERMISSIONS) $$< $$(dir $$@)
$$(INSTALL_$(1))/%: %
$(ECHO) "Installing $(1) file $$@"
@$$(INSTALL) -d -m $$(INSTALL_PERMISSIONS) $$< $$(dir $$@)
buildInstall : $$(INSTALLS_$(1))
buildInstall: $$(INSTALLS_$(1))
endef
$(foreach type, $(FILE_TYPE), \
$(eval $(call FILE_TYPE_template,$(strip $(type)))))
$(foreach type, $(FILE_TYPE),$(eval $(call FILE_TYPE_template,$(strip $(type)))))
#---------------------------------------------
# Cleaning FILE_TYPE files
#
clean::
@$(RM) $(foreach type, $(FILE_TYPE), $($(type)))
# User specific rules
#
-include $(HOME)/configure/RULES_USER

View File

@@ -4,17 +4,17 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
# in the file LICENSE that is included with this distribution.
#*************************************************************************
#
# $Revision-Id$
# $Revision-Id$
#
include $(CONFIG)/RULES_DIRS
distclean: realclean cvsclean realuninstall
CVSCLEAN=$(firstword $(wildcard $(TOOLS)/cvsclean.pl $(TOP)/src/tools/cvsclean.pl))
CVSCLEAN = $(call FIND_TOOL,cvsclean.pl)
cvsclean:
$(PERL) $(CVSCLEAN)
@@ -22,17 +22,15 @@ realuninstall: uninstallDirs
$(RMDIR) $(INSTALL_LOCATION_BIN)
$(RMDIR) $(INSTALL_LOCATION_LIB)
UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC)\
$(INSTALL_HTML) $(INSTALL_JAVA) $(INSTALL_TEMPLATES) \
$(INSTALL_DB)
UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC) \
$(INSTALL_HTML) $(INSTALL_JAVA) $(INSTALL_TEMPLATES) $(INSTALL_DB)
UNINSTALL_DIRS += $(DIRECTORY_TARGETS)
uninstallDirs:
$(RMDIR) $(UNINSTALL_DIRS)
uninstall: archuninstall uninstallDirs
archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))
@$(MAKE) -f Makefile cleandirs
archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS)) | cleandirs
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
uninstall$(DIVIDER)%:
@@ -40,14 +38,14 @@ uninstall$(DIVIDER)%:
$(RMDIR) $(INSTALL_LOCATION_LIB)/$(archPart)
cleandirs:
@$(NOP)
ifeq ($(wildcard $(INSTALL_LOCATION_BIN)/*),)
$(RMDIR) $(INSTALL_LOCATION_BIN)
endif
ifeq ($(wildcard $(INSTALL_LOCATION_LIB)/*),)
$(RMDIR) $(INSTALL_LOCATION_LIB)
endif
@echo
# The echo above stops a "nothing to be done for cleandirs" message
help:
@echo "Usage: gnumake [options] [target] ..."
@@ -82,3 +80,10 @@ help:
.PHONY: cleandirs distclean cvsclean realuninstall archuninstall uninstallDirs
.PHONY: uninstall help
# Include <top>/cfg/TOP_RULES* files from tops defined in RELEASE* files
#
RELEASE_CFG_TOP_RULES = $(foreach top, $(RELEASE_TOPS), \
$(wildcard $($(top))/cfg/TOP_RULES*))
ifneq ($(RELEASE_CFG_TOP_RULES),)
include $(RELEASE_CFG_TOP_RULES)
endif

View File

@@ -73,6 +73,8 @@ CPPFLAGS += $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS) $(OPT_CPPFLAGS)\
$(USR_CPPFLAGS) $(CMD_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) $(OP_SYS_CPPFLAGS)\
$(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),$(NOP),echo)
#--------------------------------------------------
# Although RTEMS uses gcc, it wants to use gcc its own way
CROSS_CPPFLAGS =

View File

@@ -1,5 +1,5 @@
#
# CONFIG.Common.RTEMS-mvme3100
# CONFIG.Common.RTEMS-mvme2100
# $Revision-Id$
# Author: W. Eric Norum <wenorum@lbl.gov>
#

View File

@@ -4,7 +4,7 @@
# This file is maintained by the build community.
#
# Definitions for cygwin-x86 target builds
# Sites may override these definitions in CONFIG_SITE.Common.cygwin-x86
# Sites may override these definitions in CONFIG_SITE.Common.win32-x86-cygwin
#-------------------------------------------------------
# Include definitions common to all Unix targets

View File

@@ -3,7 +3,7 @@
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for solaris-sparc Sun compiler host builds
# Definitions for solaris-sparc64 Sun compiler host builds
# Sites may override these definitions in CONFIG_SITE.solaris-sparc64.Common
#-------------------------------------------------------

View File

@@ -3,7 +3,7 @@
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for solaris-sparc Sun compiler host - solaris-sparc Sun compiler target builds
# Definitions for solaris-sparc64 compiler host - solaris-sparc64 compiler target builds
# Sites may override these definitions in CONFIG_SITE.solaris-sparc64.solaris-sparc64
#-------------------------------------------------------

View File

@@ -3,8 +3,8 @@
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for solaris-sparc host - solaris-sparc target build
# Sites may override these definitions in CONFIG_SITE.solaris-sparc.solaris-sparc
# Definitions for solaris host - solaris target build
# Sites may override these definitions in CONFIG_SITE.solarisCommon.solarisCommon
#-------------------------------------------------------
GNU = NO

View File

@@ -4,7 +4,7 @@
# This file is maintained by the build community.
#
# Definitions for win32-x86-cygwin host archs
# Sites may override these definitions in CONFIG_SITE.win32-x86-cygwin.Common
# Sites may override these definitions in CONFIG_SITE.win32-x86-mingw.Common
#-------------------------------------------------------
#Include definitions common to unix hosts

View File

@@ -13,7 +13,7 @@
ARCH_DEP_CPPFLAGS += /favor:blend
#ARCH_DEP_CPPFLAGS += /Wp64
# /favor:blend both AMD64 and INTEL64
# /favor:blend both AMD64 and INTEL64 This is the default
# /favor:AMD64
# /favor:INTEL64 (new value)
# /favor:EN64T (old value)

View File

@@ -12,10 +12,14 @@
#IOS_DEPLOYMENT_TARGET = 5.1
#IOS_DEPLOYMENT_TARGET = 6.0
#IOS_DEPLOYMENT_TARGET = 6.1
IOS_DEPLOYMENT_TARGET = 7.0
#IOS_DEPLOYMENT_TARGET = 8.0
#IOS_DEPLOYMENT_TARGET = 7.0
#IOS_DEPLOYMENT_TARGET = 7.1
IOS_DEPLOYMENT_TARGET = 8.0
#IOS_DEPLOYMENT_TARGET = 8.1
# Older versions of Xcode may require this SDK_DIR definition
#SDK_DIR = $(PLATFORM_DIR)/Developer/SDKs/$(IOS_PLATFORM)$(IOS_DEPLOYMENT_TARGET).sdk
# Which compiler to use:
# CLANG is required for Xcode 5.0 and later

View File

@@ -2,6 +2,6 @@
#
# $Revision-Id$
#
# Site Specific definitions for cygwin-x86 target
# Site Specific definitions for win32-x86-cygwin target
# Only the local epics system manager should modify this file

View File

@@ -13,6 +13,39 @@
<!-- Insert new items immediately below here ... -->
<h3>aoRecord raw conversion overflows</h3>
<p>The ao record type now checks converted raw values and limits them to the
32-bit integer range before writing them to the RVAL field. Previously value
overflows relied on Undefined Behaviour which could give different results on
different platforms. The ROFF fields of the ao and ai record types are now
DBF_ULONG to allow an ROFF setting of 0x80000000 to work properly.</p>
<h3>Changes to &lt;top&gt;/cfg/* files</h3>
<p>The order in which cfg/CONFIG* and cfg/RULES* files are included from support
applications listed in the configure/RELEASE* files has been changed. Previously
these files were included in the order in which the top areas are listed in the
RELEASE file, but it makes more sense to load them in reverse order since later
entries override earlier ones in Makefiles but the release file order is
supposed to allow earlier entries to take precedence over later ones. The same
change has been made to the inclusion of the &lt;top&gt;/configure/RULES_BUILD
files.</p>
<p>Two new file types can also be provided in a module's cfg directory. Files
named TOP_RULES* will be included by the top-level Makefile of other modules
that refer to this module; files name DIR_RULES* will be included by all
Makefiles that merely descend into lower-level directories. The cfg/RULES* files
are only included when make is building code inside the O.&lt;arch&gt;
directories.</p>
<p>The new cfg/DIR_RULES* file inclusion was designed to permit new recursive
make actions to be implemented by appending the name of the new action to the
ACTIONS variable. There must be a matching rule in one of the cfg/RULES* files
when doing this. Similar rules may also be defined in the cfg/TOP_RULES* and/or
cfg/DIR_RULES* files, but these should only state prerequisites and not directly
provide commands to be executed.</p>
<h3>MinGW Cross-builds from Linux</h3>
<p>Build configuration files have been back-ported from the 3.15 branch that

View File

@@ -591,7 +591,7 @@ void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO (
}
else {
// dont reverse the lock hierarchy
epicsGuardRelease < epicsMutex > guardRelease ();
epicsGuardRelease < epicsMutex > guardRelease ( guard );
{
//
// we will definately stall out here if all of the

View File

@@ -89,14 +89,10 @@ static const unsigned short PORT_ANY = 0u;
*/
static int makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
{
int status;
union {
struct sockaddr_in ia;
struct sockaddr sa;
} bd;
SOCKET sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, 0 );
if ( sock == INVALID_SOCKET ) {
*pSock = sock;
return SOCKERRNO;
}
@@ -104,6 +100,11 @@ static int makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
* no need to bind if unconstrained
*/
if ( port != PORT_ANY ) {
int status;
union {
struct sockaddr_in ia;
struct sockaddr sa;
} bd;
memset ( (char *) &bd, 0, sizeof (bd) );
bd.ia.sin_family = AF_INET;

View File

@@ -87,7 +87,8 @@ static void sprint_long (char *ret, dbr_long_t val, IntFormatT outType)
"0x%lX" /* hex */
};
sprintf(ret, fmt[outType], val);
/* Formats have long modifier, pass value as a long */
sprintf(ret, fmt[outType], (long) val);
}
}

View File

@@ -43,7 +43,7 @@ typedef enum {
#define INVALID_ALARM epicsSevInvalid
#define lastEpicsAlarmSev epicsSevInvalid
epicsShareExtern const char *epicsAlarmSeverityStrings [ALARM_NSEV];
extern const char *epicsAlarmSeverityStrings [ALARM_NSEV];
/* ALARM STATUS - must match menuAlarmStat.dbd */
@@ -98,7 +98,7 @@ typedef enum {
#define WRITE_ACCESS_ALARM epicsAlarmWriteAccess
#define lastEpicsAlarmCond epicsAlarmWriteAccess
epicsShareExtern const char *epicsAlarmConditionStrings [ALARM_NSTATUS];
extern const char *epicsAlarmConditionStrings [ALARM_NSTATUS];
#ifdef __cplusplus
}

View File

@@ -366,7 +366,7 @@ void currentTime::getCurrentTime ( epicsTimeStamp & dest )
LONGLONG epicsTimeCurrent = this->epicsTimeLast + offset;
if ( this->epicsTimeLast > epicsTimeCurrent ) {
double diff = static_cast < double >
( this->epicsTimeLast - epicsTimeCurrent );
( this->epicsTimeLast - epicsTimeCurrent ) / EPICS_TIME_TICKS_PER_SEC;
errlogPrintf (
"currentTime::getCurrentTime(): %f sec "
"time discontinuity detected\n",

View File

@@ -368,20 +368,17 @@ static void once(void)
checkStatusOnce(status,"atexit");
epicsThreadOnceCalled = 1;
}
static void * start_routine(void *arg)
{
epicsThreadOSD *pthreadInfo = (epicsThreadOSD *)arg;
int status;
int oldtype;
sigset_t blockAllSig;
sigfillset(&blockAllSig);
pthread_sigmask(SIG_SETMASK,&blockAllSig,NULL);
status = pthread_setspecific(getpthreadInfo,arg);
checkStatusQuit(status,"pthread_setspecific","start_routine");
status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,&oldtype);
checkStatusQuit(status,"pthread_setcanceltype","start_routine");
status = mutexLock(&listLock);
checkStatusQuit(status,"pthread_mutex_lock","start_routine");
ellAdd(&pthreadList,&pthreadInfo->node);

View File

@@ -25,8 +25,10 @@
#include "testMain.h"
static const char *msg1 = "1234567890This is a very long message.";
static volatile int testExit = 0;
static volatile int sendExit = 0;
static volatile int recvExit = 0;
static epicsEventId finished;
static unsigned int mediumStack;
/*
* In Numerical Recipes in C: The Art of Scientific Computing (William H.
@@ -77,6 +79,7 @@ extern "C" void
receiver(void *arg)
{
epicsMessageQueue *q = (epicsMessageQueue *)arg;
const char *myName = epicsThreadGetNameSelf();
char cbuf[80];
int expectmsg[4];
int len;
@@ -85,10 +88,10 @@ receiver(void *arg)
for (sender = 1 ; sender <= 4 ; sender++)
expectmsg[sender-1] = 1;
while (!testExit) {
while (!recvExit) {
cbuf[0] = '\0';
len = q->receive(cbuf, sizeof cbuf, 2.0);
if (len < 0 && !testExit) {
if (len < 0 && !recvExit) {
testDiag("receiver() received unexpected timeout");
++errors;
}
@@ -96,7 +99,8 @@ receiver(void *arg)
sender >= 1 && sender <= 4) {
if (expectmsg[sender-1] != msgNum) {
++errors;
testDiag("%s received %d '%.*s' -- expected %d", epicsThreadGetNameSelf(), len, len, cbuf, expectmsg[sender-1]);
testDiag("%s received %d '%.*s' -- expected %d",
myName, len, len, cbuf, expectmsg[sender-1]);
}
expectmsg[sender-1] = msgNum + 1;
epicsThreadSleep(0.001 * (randBelow(20)));
@@ -104,10 +108,11 @@ receiver(void *arg)
}
for (sender = 1 ; sender <= 4 ; sender++) {
if (expectmsg[sender-1] > 1)
testDiag("Sender %d -- %d messages", sender, expectmsg[sender-1]-1);
testDiag("Received %d messages from Sender %d",
expectmsg[sender-1]-1, sender);
}
testOk1(errors == 0);
testDiag("Receiver finished");
testDiag("%s exiting", myName);
epicsEventSignal(finished);
}
@@ -119,17 +124,18 @@ sender(void *arg)
int len;
int i = 0;
while (!testExit) {
while (!sendExit) {
len = sprintf(cbuf, "%s -- %d.", epicsThreadGetNameSelf(), ++i);
while (q->trySend((void *)cbuf, len) < 0)
epicsThreadSleep(0.005 * (randBelow(5)));
epicsThreadSleep(0.005 * (randBelow(20)));
}
testDiag("%s exiting, sent %d messages", epicsThreadGetNameSelf(), i-1);
testDiag("%s exiting, sent %d messages", epicsThreadGetNameSelf(), i);
}
extern "C" void messageQueueTest(void *parm)
{
epicsThreadId myThreadId = epicsThreadGetIdSelf();
unsigned int i;
char cbuf[80];
int len;
@@ -153,20 +159,23 @@ extern "C" void messageQueueTest(void *parm)
len = q1->receive(cbuf, sizeof cbuf);
testOk1(q1->pending() == 3);
if (!testOk1((len == want) && (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
want++;
len = q1->receive(cbuf, sizeof cbuf);
testOk1(q1->pending() == 2);
if (!testOk1((len == want) && (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
q1->trySend((void *)msg1, i++);
want++;
len = q1->receive(cbuf, sizeof cbuf);
testOk1(q1->pending() == 2);
if (!testOk1((len == want) && (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
q1->trySend((void *)msg1, i++);
testOk1(q1->pending() == 3);
@@ -176,7 +185,8 @@ extern "C" void messageQueueTest(void *parm)
testOk(q1->pending() == i, "q1->pending() == %d", i);
want++;
if (!testOk1((len == want) & (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
}
testOk1(q1->pending() == 0);
@@ -194,20 +204,23 @@ extern "C" void messageQueueTest(void *parm)
len = q1->receive(cbuf, sizeof cbuf);
testOk1(q1->pending() == 3);
if (!testOk1((len == want) && (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
want++;
len = q1->receive(cbuf, sizeof cbuf);
testOk1(q1->pending() == 2);
if (!testOk1((len == want) && (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
q1->send((void *)msg1, i++, 1.0);
want++;
len = q1->receive(cbuf, sizeof cbuf);
testOk1(q1->pending() == 2);
if (!testOk1((len == want) && (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
q1->send((void *)msg1, i++, 1.0);
testOk1(q1->pending() == 3);
@@ -217,7 +230,8 @@ extern "C" void messageQueueTest(void *parm)
testOk(q1->pending() == i, "q1->pending() == %d", i);
want++;
if (!testOk1((len == want) && (strncmp(msg1, cbuf, len) == 0)))
testDiag("wanted:%d '%.*s' got:%d '%.*s'", want, want, msg1, len, len, cbuf);
testDiag("wanted:%d '%.*s' got:%d '%.*s'",
want, want, msg1, len, len, cbuf);
}
testOk1(q1->pending() == 0);
@@ -233,7 +247,8 @@ extern "C" void messageQueueTest(void *parm)
testOk1(q1->pending() == 0);
testDiag("Single receiver with invalid size, single sender tests:");
epicsThreadCreate("Bad Receiver", epicsThreadPriorityMedium, epicsThreadGetStackSize(epicsThreadStackMedium), badReceiver, q1);
epicsThreadCreate("Bad Receiver", epicsThreadPriorityMedium,
mediumStack, badReceiver, q1);
epicsThreadSleep(1.0);
testOk(q1->send((void *)msg1, 10) == 0, "Send with waiting receiver");
epicsThreadSleep(2.0);
@@ -241,8 +256,9 @@ extern "C" void messageQueueTest(void *parm)
epicsThreadSleep(2.0);
testDiag("Single receiver, single sender tests:");
epicsThreadSetPriority(epicsThreadGetIdSelf(), epicsThreadPriorityHigh);
epicsThreadCreate("Receiver one", epicsThreadPriorityMedium, epicsThreadGetStackSize(epicsThreadStackMedium), receiver, q1);
epicsThreadSetPriority(myThreadId, epicsThreadPriorityHigh);
epicsThreadCreate("Receiver one", epicsThreadPriorityMedium,
mediumStack, receiver, q1);
for (pass = 1 ; pass <= 3 ; pass++) {
for (i = 0 ; i < 10 ; i++) {
if (q1->trySend((void *)msg1, i) < 0)
@@ -254,7 +270,7 @@ extern "C" void messageQueueTest(void *parm)
case 1:
if (i<6)
testDiag(" priority-based scheduler, sent %d messages", i);
epicsThreadSetPriority(epicsThreadGetIdSelf(), epicsThreadPriorityLow);
epicsThreadSetPriority(myThreadId, epicsThreadPriorityLow);
break;
case 2:
if (i<10)
@@ -274,27 +290,42 @@ extern "C" void messageQueueTest(void *parm)
*/
testDiag("Single receiver, multiple sender tests:");
testDiag("This test lasts 60 seconds...");
epicsThreadCreate("Sender 1", epicsThreadPriorityLow, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
epicsThreadCreate("Sender 2", epicsThreadPriorityMedium, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
epicsThreadCreate("Sender 3", epicsThreadPriorityHigh, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
epicsThreadCreate("Sender 4", epicsThreadPriorityHigh, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
testOk(!!epicsThreadCreate("Sender 1", epicsThreadPriorityLow,
mediumStack, sender, q1),
"Created Sender 1");
testOk(!!epicsThreadCreate("Sender 2", epicsThreadPriorityMedium,
mediumStack, sender, q1),
"Created Sender 2");
testOk(!!epicsThreadCreate("Sender 3", epicsThreadPriorityHigh,
mediumStack, sender, q1),
"Created Sender 3");
testOk(!!epicsThreadCreate("Sender 4", epicsThreadPriorityHigh,
mediumStack, sender, q1),
"Created Sender 4");
epicsThreadSleep(60.0);
for (i = 0; i < 10; i++) {
testDiag("... %2d", 10 - i);
epicsThreadSleep(6.0);
}
testExit = 1;
sendExit = 1;
epicsThreadSleep(1.0);
recvExit = 1;
testDiag("Scheduler exiting");
}
MAIN(epicsMessageQueueTest)
{
testPlan(58);
testPlan(62);
finished = epicsEventMustCreate(epicsEventEmpty);
mediumStack = epicsThreadGetStackSize(epicsThreadStackMedium);
epicsThreadCreate("messageQueueTest", epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
messageQueueTest, NULL);
mediumStack, messageQueueTest, NULL);
epicsEventWait(finished);
epicsEventMustWait(finished);
testDiag("Main thread signalled");
epicsThreadSleep(1.0);
return testDone();

View File

@@ -176,8 +176,8 @@ recordtype(ai) {
pp(TRUE)
interest(2)
}
field(ROFF,DBF_LONG) {
prompt("Raw Offset, obsolete")
field(ROFF,DBF_ULONG) {
prompt("Raw Offset")
pp(TRUE)
interest(2)
}

View File

@@ -469,10 +469,20 @@ static void convert(aoRecord *prec, double value)
}
value -= prec->aoff;
if (prec->aslo != 0) value /= prec->aslo;
if (value >= 0.0)
prec->rval = (epicsInt32)(value + 0.5) - prec->roff;
else
prec->rval = (epicsInt32)(value - 0.5) - prec->roff;
/* Apply raw offset and limits, round to 32-bit integer */
value -= prec->roff;
if (value >= 0.0) {
if (value >= (0x7fffffff - 0.5))
prec->rval = 0x7fffffff;
else
prec->rval = (epicsInt32)(value + 0.5);
} else {
if (value > (0.5 - 0x80000000))
prec->rval = (epicsInt32)(value - 0.5);
else
prec->rval = 0x80000000;
}
}

View File

@@ -82,8 +82,8 @@ recordtype(ao) {
interest(1)
size(16)
}
field(ROFF,DBF_LONG) {
prompt("Raw Offset, obsolete")
field(ROFF,DBF_ULONG) {
prompt("Raw Offset")
pp(TRUE)
interest(2)
}

View File

@@ -10,7 +10,7 @@
# The makeTestfile.pl script generates a file $target.t which is needed
# because some versions of the Perl test harness can only run test scripts
# that are actually written in Perl. The script we generate execs the
# that are actually written in Perl. The script we generate runs the
# real test program which must be in the same directory as the .t file.
# If the script is given an argument -tap it sets HARNESS_ACTIVE in the
# environment to make the epicsUnitTest code generate strict TAP output.
@@ -23,12 +23,16 @@ use strict;
my ($target, $exe) = @ARGV;
# Use system on Windows, exec doesn't work the same there and
# GNUmake thinks the test has finished as soon as Perl exits.
my $exec = $^O eq 'MSWin32' ? "system('./$exe') == 0" : "exec './$exe'";
open(my $OUT, '>', $target) or die "Can't create $target: $!\n";
print $OUT <<EOF;
#!/usr/bin/perl
\$ENV{HARNESS_ACTIVE} = 1 if scalar \@ARGV && shift eq '-tap';
exec './$exe' or die 'exec failed';
$exec or die "Can't run $exe: \$!\\n";
EOF
close $OUT or die "Can't close $target: $!\n";