diff --git a/configure/os/CONFIG.Common.linux-cris b/configure/os/CONFIG.Common.linux-cris new file mode 100644 index 000000000..d419b23e8 --- /dev/null +++ b/configure/os/CONFIG.Common.linux-cris @@ -0,0 +1,58 @@ +# CONFIG.Common.linux-cris +# +# Author: Peter Zumbruch +# GSI +# P.Zumbruch@gsi.de +# +# Definitions for linux-cris target builds +# Sites may override these definitions in CONFIG_SITE.Common.linux-cris +#------------------------------------------------------- + +# Include definitions common to all linux targets +include $(CONFIG)/os/CONFIG.Common.linuxCommon + +ARCH_CLASS = cris + +ifeq ($(BUILD_CLASS),CROSS) + GNU_TARGET = cris-axis-linux-gnu + + # prefix of compiler tools + CMPLR_SUFFIX = + CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET)) + + # CROSS_TOP_DIR + # usually AXIS_TOP_DIR is defined via + # the init_env script of the SDK provided by Axis + # + ## AXIS_TOP_DIR defined? Make missing mandatory variable visible + AXIS_TOP_DIR?=UNDEFINED_ENV__AXIS_TOP_DIR + AXIS_SDK_DIR?=$(AXIS_TOP_DIR) + + # CROSS_INCLUDES + AXIS_SDK_TARGET_INCLUDE_DIR = $(AXIS_SDK_DIR)/target/$(GNU_TARGET)/include + AXIS_SDK_TARGET_INCLUDE_DIR +=$(AXIS_SDK_DIR)/target/$(GNU_TARGET)/usr/include + + CROSS_INCLUDES = $(addprefix -isystem ,$(AXIS_SDK_TARGET_INCLUDE_DIR)) + + # CROSS_LDFLAGS + AXIS_SDK_TARGET_LIB_DIR = $(AXIS_SDK_DIR)/target/$(GNU_TARGET)/lib + AXIS_SDK_TARGET_LIB_DIR += $(AXIS_SDK_DIR)/target/$(GNU_TARGET)/usr/lib + + CROSS_LDFLAGS = $(addprefix -L,$(AXIS_SDK_TARGET_LIB_DIR)) + +-include $(CONFIG)/os/CONFIG_SITE.Common.linux-cris +ifeq ($(EPICS_HOST_ARCH), linux-x86) +-include $(CONFIG)/os/CONFIG.linux-x86.linux-cris +-include $(CONFIG)/os/CONFIG_SITE.linux-x86.linux-cris +endif +endif + +SHARED_LIBRARIES=NO +STATIC_BUILD=YES + +ARCH_DEP_CFLAGS += -mno-mul-bug-workaround +OP_SYS_CFLAGS += -mlinux +ARCH_DEP_CPPFLAGS += -D_cris_ -mlinux + +#uncomment CRIS_COMPILER_DEBUG for debugging cris-compiled code +#CRIS_COMPILER_DEBUG diff --git a/configure/os/CONFIG.linux-x86.linux-cris b/configure/os/CONFIG.linux-x86.linux-cris new file mode 100644 index 000000000..03e2a6fe6 --- /dev/null +++ b/configure/os/CONFIG.linux-x86.linux-cris @@ -0,0 +1,44 @@ +# CONFIG.linux-x86.linux-cris +# +# Author: Peter Zumbruch +# GSI +# P.Zumbruch@gsi.de +# +# Definitions for linux-x86 host - linux-cris target builds +# Sites may override these definitions in CONFIG_SITE.linux-x86.linux-cris +#------------------------------------------------------- + +# Include common gnu compiler definitions +include $(CONFIG)/CONFIG.gnuCommon + +GNU_DIR = $(CRIS_CROSS_COMPILER) + +#STATIC_... +STATIC_LDFLAGS_YES= -Wl,-Bstatic + +## debian-gcc Bug#438641 +GNU_LDLIBS_YES = +STATIC_LDFLAGS_YES += -static-libgcc + +# if not in debug mode strip all symbols +ifndef CRIS_COMPILER_DEBUG +STATIC_LDFLAGS_YES += -Wl,--strip-all +endif + +ifeq ($(GNU),YES) +STATIC_LDFLAGS_NO = -lgcc +else +STATIC_LDFLAGS_NO = +endif + +STATIC_LDLIBS_YES= +STATIC_LDLIBS_NO= + +SHRLIB_LDFLAGS += -shared -fPIC +LOADABLE_SHRLIB_LDFLAGS = -shared -fPIC + +OPT_CXXFLAGS_YES = -Os + +ifeq ($(STATIC_BUILD), YES) + $(shell echo yes) +endif diff --git a/configure/os/CONFIG.linux-x86.linux-cris_v10 b/configure/os/CONFIG.linux-x86.linux-cris_v10 new file mode 100644 index 000000000..a227ac07c --- /dev/null +++ b/configure/os/CONFIG.linux-x86.linux-cris_v10 @@ -0,0 +1,20 @@ +# CONFIG.linux-x86.linux-cris_v10 +# +# Author: Peter Zumbruch +# GSI +# P.Zumbruch@gsi.de +# +# Definitions for linux-x86 host - linux-cris_v10 target builds +# Sites may override these definitions in CONFIG_SITE.linux-x86.linux-cris_v10 +#------------------------------------------------------- + +# Include definitions common to all linux-cris targets +include $(CONFIG)/os/CONFIG.Common.linux-cris + +GNU_TARGET = cris-axis-linux-gnu + +ARCH_DEP_CFLAGS += -march=v10 + +# if you are using different places for cris_v10 cris_v32 +# you have to define for each architecture +# AXIS_SDK_DIR= diff --git a/configure/os/CONFIG.linux-x86.linux-cris_v32 b/configure/os/CONFIG.linux-x86.linux-cris_v32 new file mode 100644 index 000000000..eee8f3344 --- /dev/null +++ b/configure/os/CONFIG.linux-x86.linux-cris_v32 @@ -0,0 +1,20 @@ +# CONFIG.linux-x86.linux-cris_v32 +# +# Author: Peter Zumbruch +# GSI +# P.Zumbruch@gsi.de +# +# Definitions for linux-x86 host - linux-cris_v32 target builds +# Sites may override these definitions in CONFIG_SITE.linux-x86.linux-cris_v32 +#------------------------------------------------------- + +# Include definitions common to all linux-cris targets +include $(CONFIG)/os/CONFIG.Common.linux-cris + +GNU_TARGET = crisv32-axis-linux-gnu + +ARCH_DEP_CFLAGS += -march=v32 + +# if you are using different places for cris_v10 cris_v32 +# you have to define for each architecture +# AXIS_SDK_DIR= diff --git a/configure/os/CONFIG_SITE.Common.linux-cris b/configure/os/CONFIG_SITE.Common.linux-cris new file mode 100644 index 000000000..27681a390 --- /dev/null +++ b/configure/os/CONFIG_SITE.Common.linux-cris @@ -0,0 +1,23 @@ +# CONFIG_SITE.Common.linux-cris +# +# Site Specific definitions for linux-cris target +# Only the local epics system manager should modify this file + +# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the +# shared libraries will be found automatically. However if the .so +# files are installed at a different path to their compile-time path +# then in order to be found at runtime do one of these: +# a) LD_LIBRARY_PATH must include the full absolute pathname to +# $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) when invoking base +# executables. +# b) Add the runtime path to SHRLIB_DEPLIB_DIRS and PROD_DEPLIB_DIRS, which +# will add the named directory to the list contained in the executables. +# c) Add the runtime path to /etc/ld.so.conf and run ldconfig +# to inform the system of the shared library location. + +# If readline is not installed comment the following line +# to omit command-line editing and history support + +#COMMANDLINE_LIBRARY = READLINE +OP_SYS_CFLAGS += -g + diff --git a/configure/os/CONFIG_SITE.linux-x86.linux-cris b/configure/os/CONFIG_SITE.linux-x86.linux-cris new file mode 100644 index 000000000..eb756ca8a --- /dev/null +++ b/configure/os/CONFIG_SITE.linux-x86.linux-cris @@ -0,0 +1,14 @@ +# CONFIG_SITE.linux-x86.linux-cris +# +# Author: Peter Zumbruch +# GSI +# P.Zumbruch@gsi.de +# +# Site specific definitions for linux-x86 host - linux-cris target builds +#------------------------------------------------------- + +# define site specific location of cris cross compiler's gnu directory +# but without bin sub directory, this will be added automatically. + +CRIS_CROSS_COMPILER ?= UNDEFINED_ENV__CRIS_CROSS_COMPILER + diff --git a/documentation/README.cris b/documentation/README.cris new file mode 100644 index 000000000..c44f31bb0 --- /dev/null +++ b/documentation/README.cris @@ -0,0 +1,67 @@ +cross compiling EPICS and + building IOC Applications for cris architectures + (linux-cris_v10, linux-cris_v32) +====================================================================== + +Please mail questions, comments, corrections, etc. ... +to P.Zumbruch@gsi.de +November 2007 + +Tools needed +------------ + + o Axis SDK + - Overview: + http://developer.axis.com/wiki/doku.php?id=axis:sdk + - Download: + http://www.axis.com/products/dev_sdk/download_dist.php + - Install HOWTO: + http://developer.axis.com/wiki/doku.php?id=axis:software_distribution_install_howto + o Axis GNU gcc release for cross compiling + - Download: + http://www.axis.com/products/dev_sdk/download_compiler.php + - Install HOWTO: + http://developer.axis.com/wiki/doku.php?id=axis:compiler_install + +Environment +----------- + + o CRIS_CROSS_COMPILER + - path to top directory of cris cross compiler, + where binaries are in sub directory bin/ + - if not set, the make process will stop at place + UNDEFINED_ENV__CRIS_CROSS_COMPILER + o AXIS_TOP_DIR?=UNDEFINED_ENV__AXIS_TOP_DIR + - path to axis SDK top directory + - if not set compile and link commands will contain references to + UNDEFINED_ENV__AXIS_TOP_DIR + - to set the necessary variables, execute + . ./init_env + in the top directory of the SDK provided here. + o CRIS_COMPILER_DEBUG + - if defined symbols won't be stripped, + resulting in comparably large files + +Building +-------- + + o Edit the CONFIG_SITE files + - CONFIG_SITE.linux-x86.Common: + for CROSS_COMPILER_TARGET_ARCHS += linux-cris_v10 + for CROSS_COMPILER_TARGET_ARCHS += linux-cris_v32 + - optionally CONFIG_SITE.linux-x86.linux-cris + for setting CRIS_CROSS_COMPILER + - optionally create CONFIG_SITE.linux-x86.linux-cris_v10 + - optionally create CONFIG_SITE.linux-x86.linux-cris_v32 + o "make". + +Shared Libraries +---------------- + +Generating shared libraries is not supported. + + +Please feel free to contact me if you +encounter serious problems. + +Peter