From d1d2a1bac80fb234b95984916e1189c427f002eb Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Fri, 25 Jul 2003 19:43:41 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'B3.14'. --- configure/os/CONFIG.Common.linux-x86-borland | 33 +++ configure/os/CONFIG.linux-x86-borland.Common | 13 ++ ...CONFIG.linux-x86-borland.linux-x86-borland | 214 ++++++++++++++++++ .../os/CONFIG_SITE.linux-x86-borland.Common | 12 + src/vxWorks/src/logMsgToErrlog.cpp | 99 ++++++++ 5 files changed, 371 insertions(+) create mode 100644 configure/os/CONFIG.Common.linux-x86-borland create mode 100644 configure/os/CONFIG.linux-x86-borland.Common create mode 100644 configure/os/CONFIG.linux-x86-borland.linux-x86-borland create mode 100644 configure/os/CONFIG_SITE.linux-x86-borland.Common create mode 100644 src/vxWorks/src/logMsgToErrlog.cpp diff --git a/configure/os/CONFIG.Common.linux-x86-borland b/configure/os/CONFIG.Common.linux-x86-borland new file mode 100644 index 000000000..3f336be3e --- /dev/null +++ b/configure/os/CONFIG.Common.linux-x86-borland @@ -0,0 +1,33 @@ +# CONFIG.Common.linux-x86-borland +# +# $Id$ +# This file is maintained by the build community. +# +# Definitions for linux-x86 target builds +# Sites may override these definitions in CONFIG_SITE.Common.linux-x86-borland +#------------------------------------------------------- + +# Include definitions common to all Unix targets +include $(CONFIG)/os/CONFIG.Common.UnixCommon + +OS_CLASS = Linux +ARCH_CLASS = x86 + +POSIX_CPPFLAGS_NO = +POSIX_LDLIBS_YES = libpthread.so + +OP_SYS_CPPFLAGS += -D_BSD_SOURCE +OP_SYS_CPPFLAGS += -Dlinux +OP_SYS_LDLIBS = libc.so libm.so libdl.so librt.so + +ARCH_DEP_CPPFLAGS += -D_X86_ +ARCH_DEP_CFLAGS += -mcpu=pentium + +RUNTIME_LDFLAGS += $(RUNTIME_LDFLAGS_$(SHARED_LIBRARIES)) + +ifdef CROSS + GNU_TARGET=i586-pc-linux-gnu + CMPLR_SUFFIX= + CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET)) +endif + diff --git a/configure/os/CONFIG.linux-x86-borland.Common b/configure/os/CONFIG.linux-x86-borland.Common new file mode 100644 index 000000000..9239e8fd4 --- /dev/null +++ b/configure/os/CONFIG.linux-x86-borland.Common @@ -0,0 +1,13 @@ +# CONFIG.linux-x86-borland.Common +# +# $Id$ +# This file is maintained by the build community. +# +# Definitions for linux-x86-borland host builds +# Sites may override these definitions in CONFIG_SITE.linux-x86-borland.Common +#------------------------------------------------------- + +#Include definitions common to unix hosts +include $(CONFIG)/os/CONFIG.UnixCommon.Common + +WIND_HOST_TYPE = i386-linux2 diff --git a/configure/os/CONFIG.linux-x86-borland.linux-x86-borland b/configure/os/CONFIG.linux-x86-borland.linux-x86-borland new file mode 100644 index 000000000..089bdcdf0 --- /dev/null +++ b/configure/os/CONFIG.linux-x86-borland.linux-x86-borland @@ -0,0 +1,214 @@ +# CONFIG.linux-x86-borland.linux-x86-borland +# +# $Id$ +# +# Definitions for linux-x86-borland host - linux-x86-borland target builds +# Sites may override these definitions in CONFIG_SITE.linux-x86-borland.linux-x86-borland +#------------------------------------------------------- + +# Include common gnu compiler definitions +include $(CONFIG)/CONFIG.gnuCommon +SHRLIB_CFLAGS = + +GNU_DIR = /usr + +KYLIX=1 + +BORLAND_INC_STLPORT = $(BORLAND)/include/stlport +BORLAND_INC = $(BORLAND)/include +BORLAND_LIB = $(BORLAND)/lib +BORLAND_BIN = $(BORLAND)/bin + +WINLINK = $(BORLAND_BIN)/ilink -q +# +# Configure Borland C compiler +# -q suppress compiler identification banner +# -a8 quad word alignment +#CCLINKOPT = -q -a8 -I/usr/include +CCLINKOPT = -q -a8 +CC = $(BORLAND_BIN)/bc++ $(CCLINKOPT) +LD = $(BORLAND_BIN)/bc++ -r + +# +# __STDC__=0 works but not as cleanly as with +# Microsoft Visual C++. +# The Borland header files use ifdef __STDC__ +# to disable many nice things. This is overridden +# by defining NO_BORLAND_STDC in the Makefile. +# +ifdef NO_BORLAND_STDC +CONFORM_CFLAGS_ANSI = +CONFORM_CFLAGS_STRICT = +else +CONFORM_CFLAGS_ANSI = -D__STDC__=0 +CONFORM_CFLAGS_STRICT = -D__STDC__=0 +endif +CONFORM_CFLAGS_TRAD = + +# -w display warnings on +# -g0 no limit to warning messages +# some warning message here are always disabled because they are +# trivial and numerous +# -w-8012 Comparing signed and unsigned values +# -w-8060 Possibly incorrect assignment +# -w-8071 Conversion may lose significant digits +WARN_CFLAGS_YES = -w -g0 -w-8012 -w-8060 -w-8071 +# -w- display warnings off +WARN_CFLAGS_NO = -w- + +# +# -k- turn off standard stack frame +# -H- turn off precompiled headers +# -R- don't include browser info in .obj files +# -O1 optimization for size +# -v- turn off source debugging +# -vi control expansion of inline functions +OPT_CFLAGS_YES = -k- -H- -R- -O1 -v- -vi +# +OPT_CFLAGS_NO = + +# OS vendor c preprocessor +CPP = $(BORLAND_BIN)/bcpp + +# Configure OS vendor C++ compiler +# +# __STDC__=0 works but not as cleanly as with +# Microsoft Visual C++. +# The Borland header files use ifdef __STDC__ +# to disable many nice things. This is overridden +# by defining NO_BORLAND_STDC in the Makefile. +# +CCC = $(BORLAND_BIN)/bc++ $(CCLINKOPT) +ifndef NO_BORLAND_STDC +CONFORM_CXXFLAGS_NORMAL = -D__STDC__=0 +CONFORM_CXXFLAGS_STRICT = -D__STDC__=0 +endif + +# -w display warnings on +# -g0 no limit to warning messages +# -w-8012 Comparing signed and unsigned values +# -w-8060 Possibly incorrect assignment +# -w-8071 Conversion may lose significant digits +# -w-8008 Condition is always true or always false (compile time +# know template parameters causes this to spew garbage) +# -w-8027 Functions containing reserved words are not expanded inline +# (Some compilers are better than others with inline) +# -w-8066 Unreachable code (compile time know template parameters +# causes this to spew garbage) +# -w-8080 'identifier' declared but never used +# (instantiating unused static const external parameters is +# anachronistic compiler practice) +# -w-8004 'identifier' is assigned a value that is never used +# (compile time know template parameters +# causes this to spew garbage) +# -w-8026 Functions with exception specifications are not expanded inline +# +WARN_CXXFLAGS_YES = -w -g0 -w-8012 -w-8060 -w-8071 -w-8008 -w-8027 -w-8066 -w-8080 -w-8004 -w-8026 +# -w- display warnings off +WARN_CXXFLAGS_NO = -w- + +# +# -k- turn off standard stack frame +# -H- Turn off precompiled headers +# -R- Don't include browser info in .obj files +# -O1 optimization for size +# -v- turn off source debugging +# -vi control expansion of inline functions +OPT_CXXFLAGS_YES = -k- -H- -R- -O1 -v- -vi +# +OPT_CXXFLAGS_NO = + +# -c case sensitive linking +# -C clear state before linking +# -Gi generate import library +# -Gn no state files +# -Tpd targets a Windows .DLL file +# -x no map +# -w display warnings on +#LINK_OPT_FLAGS_YES = -c -C -Gi -Gn -Tpd -x -w +#LINK_OPT_FLAGS_NO = -c -C -Gi -Gn -Tpd -x -w- +#Linux_DLLFLAGS = $(LINK_OPT_FLAGS_$(HOST_OPT)) $(TARGET_LDFLAGS) $(LIB_LDFLAGS) +OPT_LDFLAGS = + +ARCH_DEP_CFLAGS= + +# to identify the general architecture class: +# should be BSD, SYSV, WIN32, ... +# is: WIN32, sun4, hpux, linux, ... +# +OS_CLASS=Linux + + +OBJ=.o + +# Problem: BorlandC does not recognize *.cc as C++ source, +# we have to compile xx.cc using the flag -P xx.cc, +SOURCE_CXXFLAG = -P + +# Operating system flags +OP_SYS_CFLAGS = + +# +# Borland specific include files +# +OP_SYS_INCLUDES = -I/usr/include +# + +#------------------------------------------------------- +# Prod: DEPLIBS, LDFLAGS, and LDLIBS definitions + +PROD_DEPLIBS= $(foreach lib,$(PROD_LIBS) $(USR_LIBS), \ + $(firstword $(wildcard $(addsuffix /$(LIB_PREFIX)$(lib).so, \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \ + $(wildcard $(addsuffix /$(LIB_PREFIX)$(lib).a, \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \ + $(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_EXT), \ + $(firstword $($(lib)_DIR) $(INSTALL_LIB))))) + +SHRLIB_DEPLIBS= $(foreach lib,$(LIB_LIBS) $(USR_LIBS), \ + $(firstword $(wildcard $(addsuffix /$(LIB_PREFIX)$(lib).so, \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \ + $(wildcard $(addsuffix /$(LIB_PREFIX)$(lib).a, \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \ + $(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_EXT), \ + $(firstword $($(lib)_DIR) $(INSTALL_LIB))))) + +PROD_LDLIBS = $(addprefix lib, $($*_LDLIBS)) \ + $(notdir $(PROD_DEPLIBS)) \ + $(addprefix lib, $($*_SYS_LIBS) $(PROD_SYS_LIBS) $(USR_SYS_LIBS)) + +SHRLIB_LDLIBS = $(addprefix lib, $($*_LDLIBS)) \ + $(notdir $(SHRLIB_DEPLIBS)) \ + $(addprefix lib, $($*_SYS_LIBS) $(LIB_SYS_LIBS) $(USR_SYS_LIBS)) $(LDLIBS) + +LDLIBS_STATIC_YES = LDLIBS +LDLIBS_SHARED_NO = LDLIBS +LDLIBS_SHARED_YES = LDLIBS +PROD_LDLIBS += $($(firstword $(LDLIBS_STATIC_$(STATIC_BUILD)) \ + $(LDLIBS_SHARED_$(SHARED_LIBRARIES)))) + +empty:= +space:= $(empty) $(empty) +PROD_DEPLIB_DIRS = $(dir $($*_DEPLIBS)) $(dir $(PROD_DEPLIBS)) +SHRLIB_DEPLIB_DIRS = $(dir $($*_DEPLIBS)) $(dir $(SHRLIB_DEPLIBS)) + +PRODDIR_LDFLAGS = -L$(subst $(space),:,$(sort $(PROD_DEPLIB_DIRS) $(BORLAND_LIB))) +SHRLIBDIR_LDFLAGS = -L$(subst $(space),:,$(sort $(SHRLIB_DEPLIB_DIRS) $(BORLAND_LIB))) + +# -c case sensitive linking +# -C clear state before linking +# -Gn no state files +# -Tpe targets a Windows .EXE file +# -x no map +# -w display warnings on +LDFLAGS += -c -C -Gn -x -w +LINKLIBS=rtl.a visualclx.a rtle.a libborcrtl.a libborstl.a libborunwind.a + +LINK.cpp = $(WINLINK) $(STATIC_LDFLAGS) $(PRODDIR_LDFLAGS) $(LDFLAGS) -Tpe +LINK.cpp += $(PROD_LDFLAGS) borinit.o /usr/lib/crt1.o $(PROD_LD_OBJS) +LINK.cpp += , $@ ,,$(LINKLIBS) $(PROD_LDLIBS) + +LINK.shrlib = $(WINLINK) $(STATIC_LDFLAGS) $(SHRLIBDIR_LDFLAGS) $(LDFLAGS) -Tpd -Gi +LINK.shrlib+= $(LIB_LDFLAGS) borinitso.o $(LIBRARY_LD_OBJS) +LINK.shrlib+= , $@ ,,$(LINKLIBS) $(SHRLIB_LDLIBS) + diff --git a/configure/os/CONFIG_SITE.linux-x86-borland.Common b/configure/os/CONFIG_SITE.linux-x86-borland.Common new file mode 100644 index 000000000..7428c8217 --- /dev/null +++ b/configure/os/CONFIG_SITE.linux-x86-borland.Common @@ -0,0 +1,12 @@ +# CONFIG_SITE.linux-x86-borland.Common +# +# $Id$ +# This file is maintained by the build community. +# +# Site override definitions for linux-x86-borland host builds +#------------------------------------------------------- + +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 solaris-sparc +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 + +BORLAND = /share2/kylix3 diff --git a/src/vxWorks/src/logMsgToErrlog.cpp b/src/vxWorks/src/logMsgToErrlog.cpp new file mode 100644 index 000000000..5e1c26ee4 --- /dev/null +++ b/src/vxWorks/src/logMsgToErrlog.cpp @@ -0,0 +1,99 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, 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 Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +/* + * $Id$ + * + * route vxWorks logMsg messages into the EPICS logging system + * + * Author: Jeff Hill + * + */ + +#include +#include + +#include +#include +#include + +#include "errlog.h" + +static class errlogDevTimeInit +{ +public: + errlogDevTimeInit (); +} errlogDevInstance; + +static int errlogOpen ( DEV_HDR *, const char *, int ) +{ + return OK; +} + +static int errlogWrite ( DEV_HDR *, const char * pInBuf, int nbytes ) +{ + errlogPrintf ( "%.*s", nbytes, pInBuf ); + return nbytes; +} + +errlogDevTimeInit::errlogDevTimeInit () +{ + int errlogNo = iosDrvInstall ( + 0, // create not supported + 0, // remove not supported + reinterpret_cast < FUNCPTR > ( errlogOpen ), + 0, // close is a noop + 0, // read not supported + reinterpret_cast < FUNCPTR > ( errlogWrite ), + 0 // ioctl not supported + ); + if ( errlogNo == ERROR ) { + errlogPrintf ( + "Unable to install driver routing the vxWorks " + "logging system to the EPICS logging system because \"%s\"\n", + strerror ( errno ) ); + return; + } + DEV_HDR * pDev = static_cast < DEV_HDR * > ( calloc ( 1, sizeof ( *pDev ) ) ); + if ( ! pDev ) { + errlogPrintf ( + "Unable to create driver data structure for routing the vxWorks " + "logging system to the EPICS logging system because \"%s\"\n", + strerror ( errno ) ); + return; + } + int status = iosDevAdd ( pDev, "/errlog/", errlogNo ); + if ( status < 0 ) { + errlogPrintf ( + "Unable to install device routing the vxWorks " + "logging system to the EPICS logging system because \"%s\"\n", + strerror ( errno ) ); + free ( pDev ); + return; + } + int fd = open ( "/errlog/any", O_WRONLY, 0 ); + if ( fd < 0 ) { + errlogPrintf ( + "Unable to open fd routing the vxWorks " + "logging system to the EPICS logging system because \"%s\"\n", + strerror ( errno ) ); + return; + } + status = logFdAdd ( fd ); + if ( status != OK) { + errlogPrintf ( + "Unable to install fd routing the vxWorks " + "logging system to the EPICS logging system because \"%s\"\n", + strerror ( errno ) ); + close ( fd ); + return; + } +} +