More build oddities

Nigel Spon nigel at adi.co.nz
Thu Apr 10 02:41:37 UTC 2008


On 08/04/2008, at 12:15 AM, Ralf Corsepius wrote:
> Another point: The auto*tools require a POSIX-compliant shell and  
> try to
> guess upon which POSIX-compliant shells might be installed on a  
> system.
> Here, the OP mentions to be using tcsh (a non-POSIX compliant)
> shell, ... leaves room for issues circulating around $SHELL,
> $CONFIG_SHELL and broken environments.

I had hoped I was avoiding exactly this kind of trouble by using a  
bash script to invoke the RTEMS make, but perhaps this is not enough.  
I actually have two scripts, the first builds the toolchain and  
configures RTEMS, the second builds RTEMS itself. The split is because  
I want to develop a BSP. The first script (which works, strangely  
enough), is:

#!/bin/bash
#----------------------------------------
#
# Top-level toolchain build & configure script for RTEMS 4.8
#
# This script assumes the XCode project directory is in the top-level  
RTEMS directory
# It assumes it will find specific versions of binutils,gcc,and rtems  
source in the ../tools directory
# It will build the toolchain and configure RTEMS in the XCode Build~~  
subdirectory
# This may take some time....
#
#---------------------------------------

CPU=powerpc
RTEMS_VERSION=4.8
BINUTILS_VERSION=2.17
GCC_VERSION=4.1.1

TARGET=$CPU-rtems$RTEMS_VERSION
TOPDIR=$PROJECT_DIR/..
TOOLDIR=$TOPDIR/tools

cd $BUILD_ROOT
if [ ! -e bin ]
then
	echo "\n\nBuilding binutils..."
	mkdir b-binutils
	cd b-binutils
	$TOOLDIR/binutils-$BINUTILS_VERSION/configure --target=$TARGET -- 
prefix=$BUILD_ROOT
	make all
	make info
	make install
fi

PATH=$PATH:$BUILD_ROOT/bin

cd $BUILD_ROOT
if [ ! -e bin/$TARGET-gcc ]
then
	echo "\n\n\nBuilding gcc"
	mkdir b-gcc
	cd b-gcc
	$TOOLDIR/gcc-$GCC_VERSION/configure --target=$TARGET --prefix= 
$BUILD_ROOT \
			--with-gnu-as --with-gnu-ld --with-newlib --verbose --enable- 
threads --enable-languages="c,c++"
	make all
	make info
	make install
fi

cd $BUILD_ROOT
if [ ! -e b-rtems ]
then
	echo "\n\n\nConfiguring RTEMS"
	mkdir b-rtems
	cd b-rtems
	$TOOLDIR/rtems-4.8.0/configure --target=$TARGET --prefix=$BUILD_ROOT  
--disable-sim --enable-cxx
fi

echo "Done!"



The second script, which isn't working, does:



#!/bin/bash
#----------------------------------------
#
# RTEMS build script
#
#---------------------------------------

BSP=virtex

cd $BUILD_ROOT
if [ -e b-rtems ]
then
	PATH="$BUILD_ROOT/bin:$PATH"
	export PATH
	cd b-rtems
	make RTEMS_BSP="$BSP" all install
else
	echo "No b-rtems directory! Build the MakeTools target"
fi



---
"Its only a model."

Michael Hamel
ADInstruments Ltd, Dunedin, NZ





More information about the users mailing list