From ee2e367dad2c449ab91b7e2660b27b256ca6cd15 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 5 Aug 2011 08:57:15 -0600 Subject: [PATCH] o added CMPL_CLASD definition to CONFIG.gnuCommon, CONFIG.solarisCommon.solarisCommon, configure/os/CONFIG.win32-x86.win32-x86 o added CMPLR_SRC_DIRS to ALL_SRC_DIRS, and added compiler/$CMPLR_CLASS) to INSTALL_INCLUDES in CONFIG_COMMON o added additional compiler specific rule deciding where things are installed to in CONFIG_COMMON o added compiler specific include install to RULES_BUILD o changed configure/os/CONFIG.linux-x86.linux-x86 to specify minimum arch is 586 (pentium circa 1995) o changed configure/os/CONFIG.win32-x86-cygwin.win32-x86-cygwin to specify minimum arch is 586 (pentium circa 1995) o added epicsAtoimic facility to libCom/Makefile o added testing and performance measurement to libCom/test/Makefile --- configure/CONFIG.gnuCommon | 2 ++ configure/CONFIG_COMMON | 22 +++++++++++++++---- configure/RULES_BUILD | 4 ++++ configure/os/CONFIG.linux-x86.linux-x86 | 5 +++++ .../os/CONFIG.solarisCommon.solarisCommon | 2 ++ .../CONFIG.win32-x86-cygwin.win32-x86-cygwin | 5 +++++ .../os/CONFIG.win32-x86-mingw.win32-x86-mingw | 5 +++++ configure/os/CONFIG.win32-x86.win32-x86 | 4 +++- src/libCom/Makefile | 7 ++++++ src/libCom/test/Makefile | 9 ++++++++ 10 files changed, 60 insertions(+), 5 deletions(-) diff --git a/configure/CONFIG.gnuCommon b/configure/CONFIG.gnuCommon index f0548024e..94d1286e0 100644 --- a/configure/CONFIG.gnuCommon +++ b/configure/CONFIG.gnuCommon @@ -12,6 +12,8 @@ GNU = YES +CMPLR_CLASS = gcc + GNU_BIN = $(GNU_DIR)/bin GNU_LIB = $(GNU_DIR)/lib diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON index 4bd8737f3..d142723a4 100644 --- a/configure/CONFIG_COMMON +++ b/configure/CONFIG_COMMON @@ -133,11 +133,14 @@ POSIX_YES = os/posix GENERIC_SRC_DIRS = .. $(SRC_DIRS) OS_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \ $(addprefix $(dir)/, os/$(OS_CLASS) $(POSIX_$(POSIX)) os/default )) -ALL_SRC_DIRS = $(OS_SRC_DIRS) $(GENERIC_SRC_DIRS) +CMPLR_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \ + $(addprefix $(dir)/, compiler/$(CMPLR_CLASS) compiler/default )) +ALL_SRC_DIRS = $(CMPLR_SRC_DIRS) $(OS_SRC_DIRS) $(GENERIC_SRC_DIRS) #-------------------------------------------------- # compile line include directories INSTALL_INCLUDES += \ + -I$(INSTALL_INCLUDE)/compiler/$(CMPLR_CLASS) \ -I$(INSTALL_INCLUDE)/os/$(OS_CLASS) \ -I$(INSTALL_INCLUDE) SRC_INCLUDES = -I$(COMMON_DIR) $(addprefix -I, $(wildcard $(ALL_SRC_DIRS))) @@ -379,24 +382,35 @@ INSTALL_PERMISSIONS = 444 # # auto determine the directory paths that things are installed to # RULES: -# 1) found in any one of several os specific area +# 0) found in any one of several compiler specific area +# => install to $(INSTALL_INCLUDE)/compiler/$(CMPLR_CLASS) +# 1) not found in (0) and found in any one of several os specific area # => install to $(INSTALL_INCLUDE)/os/$(OS_CLASS) -# 2) not foundin (1) and found in generic area +# 2) not found in (1) and found in generic area # => install to $(INSTALL_INCLUDE) # 3) not found in (1) or (2) then may be (not yet) computer generated # => install into $(INSTALL_INCLUDE)/os/$(OS_CLASS) and let # build rules work on vpath # # These rules guarantee that the users include from -# no more than two directories +# no more than three directories # INSTALL_INC += $(foreach inc, $(INC), \ $(firstword \ + $(CMPLR_INSTALL_INC) \ $(OS_INSTALL_INC) \ $(GENERIC_INSTALL_INC) \ $(GENERATED_INSTALL_INC) ) ) INSTALL_INC += $(addprefix $(INSTALL_INCLUDE)/os/$(OS_CLASS)/, $(INC_$(OS_CLASS)) ) +# +# Rule 0 +# +CMPLR_INSTALL_INC = $(addprefix $(INSTALL_INCLUDE)/compiler/$(CMPLR_CLASS)/, $(INSTALL_INC_jjj) ) +INSTALL_INC_jjj = $(foreach dir, $(CMPLR_SRC_DIRS), $(INSTALL_INC_iii) ) +INSTALL_INC_iii = $(subst $(dir)/, , $(INSTALL_INC_hhh) ) +INSTALL_INC_hhh = $(wildcard $(addsuffix /$(inc), $(dir)) ) + # # Rule 1 # diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index f7247a5be..54ddd9ac4 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -417,6 +417,10 @@ $(INSTALL_INCLUDE)/% : % $(INSTALL_INCLUDE)/os/$(OS_CLASS)/% : % $(ECHO) "Installing os dependent include file $@" @$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D) + +$(INSTALL_INCLUDE)/compiler/$(CMPLR_CLASS)/% : % + $(ECHO) "Installing compiler dependent include file $@" + @$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D) $(INSTALL_DOC)/%: % $(ECHO) "Installing doc $@" diff --git a/configure/os/CONFIG.linux-x86.linux-x86 b/configure/os/CONFIG.linux-x86.linux-x86 index 6414b5ab0..775680e11 100644 --- a/configure/os/CONFIG.linux-x86.linux-x86 +++ b/configure/os/CONFIG.linux-x86.linux-x86 @@ -16,3 +16,8 @@ STATIC_LDLIBS_NO= SHRLIB_LDFLAGS += -Wl,-h$@ LOADABLE_SHRLIB_LDFLAGS += -Wl,-h$@ + +# this means that atomic instrnsics are available, but that +# users with 486 processors and earlier will need specialized +# configure files +ARCH_DEP_CFLAGS += -march=i586 \ No newline at end of file diff --git a/configure/os/CONFIG.solarisCommon.solarisCommon b/configure/os/CONFIG.solarisCommon.solarisCommon index c38fc92d8..117957575 100644 --- a/configure/os/CONFIG.solarisCommon.solarisCommon +++ b/configure/os/CONFIG.solarisCommon.solarisCommon @@ -7,6 +7,8 @@ # Sites may override these definitions in CONFIG_SITE.solaris-sparc.solaris-sparc #------------------------------------------------------- +CMPLR_CLASS = solStudio + SPARCWORKS = /opt/SUNWspro GNU = NO diff --git a/configure/os/CONFIG.win32-x86-cygwin.win32-x86-cygwin b/configure/os/CONFIG.win32-x86-cygwin.win32-x86-cygwin index aa29f4d7a..5dca1b714 100644 --- a/configure/os/CONFIG.win32-x86-cygwin.win32-x86-cygwin +++ b/configure/os/CONFIG.win32-x86-cygwin.win32-x86-cygwin @@ -23,6 +23,11 @@ SHRLIB_CFLAGS = SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX) LOADABLE_SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX) +# this means that atomic instrnsics are available, but that +# users with 486 processors and earlier will need specialized +# configure files +ARCH_DEP_CFLAGS += -march=i586 + # Override linking with gcc library from CONFIG.gnuCommon GNU_LDLIBS_YES = diff --git a/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw b/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw index 8309f8b45..32a6733ad 100644 --- a/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw +++ b/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw @@ -18,6 +18,11 @@ RANLIB = ranlib RES=.coff RCCMD = windres $(INCLUDES) $< $@ +# this means that atomic instrnsics are available, but that +# users with 486 processors and earlier will need specialized +# configure files +ARCH_DEP_CFLAGS += -march=i586 + # No -fPIC avoids "-fPIC ignored for target (all code is position independent)" SHRLIB_CFLAGS = SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX) diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86 index 4f55f943d..29b27cf42 100644 --- a/configure/os/CONFIG.win32-x86.win32-x86 +++ b/configure/os/CONFIG.win32-x86.win32-x86 @@ -11,6 +11,8 @@ VALID_BUILDS = Host Ioc +CMPLR_CLASS = msvc + # convert UNIX path to native path PATH_FILTER = $(subst /,\\,$(1)) @@ -120,7 +122,7 @@ OPT_CXXFLAGS_YES = /Ox /GL # /D_CRTDBG_MAP_ALLOC # /RTCsu catch bugs occurring only in optimized code # /DEPICS_FREELIST_DEBUG good for detecting mem mrg bugs -OPT_CXXFLAGS_NO = /RTCsu /Zi +OPT_CXXFLAGS_NO = /RTCsu /Zi # specify object file name and location OBJ_CXXFLAG = /Fo diff --git a/src/libCom/Makefile b/src/libCom/Makefile index 57c2f7ab0..02efe9348 100644 --- a/src/libCom/Makefile +++ b/src/libCom/Makefile @@ -184,6 +184,10 @@ INC += osiUnistd.h INC += osiWireFormat.h INC += osdWireFormat.h INC += osdWireConfig.h +INC += epicsAtomic.h +INC += epicsAtomicLocked.h +INC += epicsAtomicOSD.h +INC += epicsAtomicCD.h INC += epicsEndian.h INC += epicsReadline.h INC += epicsMessageQueue.h @@ -202,6 +206,8 @@ SRCS += epicsEvent.cpp SRCS += epicsTime.cpp SRCS += epicsMessageQueue.cpp SRCS += epicsMath.cpp +SRCS += epicsAtomicLocked.cpp +SRCS += epicsAtomicOSD.cpp SRCS += epicsGeneralTime.c SRCS += osiClockTime.c @@ -222,6 +228,7 @@ SRCS += epicsTempFile.cpp SRCS += epicsStdio.c SRCS += osdStdio.c + osdEnv_CFLAGS_WIN32= -U__STDC__ SRCS += osdThread.c diff --git a/src/libCom/test/Makefile b/src/libCom/test/Makefile index 9bf92f528..07a4276c0 100644 --- a/src/libCom/test/Makefile +++ b/src/libCom/test/Makefile @@ -107,6 +107,11 @@ epicsMutexTest_SRCS += epicsMutexTest.cpp testHarness_SRCS += epicsMutexTest.cpp TESTS += epicsMutexTest +TESTPROD_HOST += epicsAtomicTest +epicsAtomicTest_SRCS += epicsAtomicTest.c +testHarness_SRCS += epicsAtomicTest.c +TESTS += epicsAtomicTest + TESTPROD_HOST += epicsExceptionTest epicsExceptionTest_SRCS += epicsExceptionTest.cpp testHarness_SRCS += epicsExceptionTest.cpp @@ -177,6 +182,10 @@ fdmgrTest_SRCS += fdmgrTest.c fdmgrTest_LIBS += ca # FIXME: program never exits. +TESTPROD_HOST += epicsAtomicPerform +epicsAtomicPerform_SRCS += epicsAtomicPerform.cpp +testHarness_SRCS += epicsAtomicPerform.cpp + TESTPROD_HOST += cvtFastPerform cvtFastPerform_SRCS += cvtFastPerform.cpp testHarness_SRCS += cvtFastPerform.cpp