Epics Tips And Tricks Cris Axis Addtion For Several Epics Applications
cris-axis addition for several EPICS applications
HOWTO build flex (libfl) for cris-axis crisv32-axis
Since some of the EPICS extensions and modules rely on libfl flex and the standard distribution of AXIS SDK doesn't contain the libfl.a this has to be added:
Prerequisites
Build & Installation
- set some helper variables:
export SRC_DIR=<Source Directory>
export DOWNLOAD_DIR=<Download Directory>
# provided cross compiler and SDK are installed here export ETRAX_DIR=<ETRAX Tools Directory>
- download sources from http://sourceforge.net/projects/flex/ (version 2.5.35) via direct link to
$DOWNLOAD_DIR
- unpack to
$SRC_DIR
mkdir -p ${SRC_DIR:?undefined} &&
cd SRC_DIR &&
tar -jxvf flex-2.5.35.tar.bz
- Source
cris-axis-setup.sh
,defining environment variables, e.g. AXIS_TOP_DIR
, and extending PATH
, needs ETRAX_DIR
to be defined. or just take its main code: oldpwd=$OLDPWD
base=$(pwd)
cd ${ETRAX_DIR:?undefined)/SDK && cd $(ls --color=never -t -1 -d devbo* | head -n 1) && . ./init_env
cd $base
cd ${ETRAX_DIR:?undefined)/ETRAX/compiler && . ./setup.sh
cd $oldpwd
cd $base
unset scriptname base oldpwd epicsDir
- Change to source directory
$SRC_DIR
cd ${SRC_DIR:?undefined}
- Since
configure
automatically sets for cross-compilers 'ac_cv_func_malloc_0_nonnull' and 'ac_cv_func_realloc_0_nonnull' to 'no', (since it cannot check it) those have to be configured by hand:
- cris-axis
-
export myTARGET=cris-axis-linux-gnu
-
make clean
-
./configure --prefix=${AXIS_TOP_DIR:?undefined}/target/${myTARGET:?defined}/usr --host=${myTARGET} --build=i686-pc-linux-gnu ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes
-
make
-
make install
- crisv32-axis
-
export myTARGET=crisv32-axis-linux-gnu
-
make clean
-
./configure --prefix=${AXIS_TOP_DIR:?undefined}/target/${myTARGET:?defined}/usr --host=${myTARGET} --build=i686-pc-linux-gnu ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes
-
make
-
make install
Compact
export SRC_DIR=<Source Directory>
export DOWNLOAD_DIR=<Download Directory>
# provided cross compiler and SDK are installed here
export ETRAX_DIR=<ETRAX Tools Directory>
mkdir -p ${DOWNLOAD_DIR:?undefined} &&
wget http://prdownloads.sourceforge.net/flex/flex-2.5.35.tar.bz2?download
mkdir -p ${SRC_DIR:?undefined} &&
cd SRC_DIR &&
tar -jxvf flex-2.5.35.tar.bz
oldpwd=$OLDPWD
base=$(pwd)
cd ${ETRAX_DIR:?undefined)/SDK && cd $(ls --color=never -t -1 -d devbo* | head -n 1) && . ./init_env
cd $base
cd ${ETRAX_DIR:?undefined)/ETRAX/compiler && . ./setup.sh
cd $oldpwd
cd $base
unset scriptname base oldpwd epicsDir
# crisv-axis
export myTARGET=cris-axis-linux-gnu
cd ${SRC_DIR:?undefined} &&
make clean
./configure --prefix=${AXIS_TOP_DIR:?undefined}/target/${myTARGET:?defined}/usr --host=${myTARGET} --build=i686-pc-linux-gnu ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes &&
make && make install
# crisv32-axis
export myTARGET=crisv32-axis-linux-gnu
cd ${SRC_DIR:?undefined} &&
make clean
./configure --prefix=${AXIS_TOP_DIR:?undefined}/target/${myTARGET:?defined}/usr --host=${myTARGET} --build=i686-pc-linux-gnu ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes &&
make && make install