A question on bit_X scripts
"Michael P. Collins" on korat
mcollins at hawkeye.sps.mot.com
Fri Oct 6 21:13:38 UTC 2000
Alfredo Macias wrote:
> I'm trying to install rtems on my linux box for development, my target is
> m68k. I have gone over the documentation on how to build the toolset and
> rtems itself.
> It's still not clear to me what bit scripts I need to run, and if I have to
> follow certain order. I have ./bit, ./bit_rtems, and ./bit_gdb.
> The "Unarchiving the tools" page mentions that the bit_gdb and bit_rtems
> scripts will create corresponding subdirectories "later", but the "Running
> the bit script" page indicates to run the ./bit script first, which fails
> when it cannot find m68k-rtems-gcc.
I've built m68k-rtems many times from source on a Debian system, and
offhand don't know of any problems you might encounter if you follow the
instructions in the "Getting Started with RTEMS for C/C++ Users" document,
at least to the point of getting the compiler suite built. There is one
little gotcha I know of associated with building RTEMS -- before "bit_rtems"
is invoked, you must create a symbolic link from "rtems-4.5.0-beta3a" to
"4.5.0-beta3a".
Appended is a simple script[2] which I use during regression testing to
recreate the entire RTEMS environment on my machine. It makes some
assumptions:
1. The script is invoked from the directory above "tools".
2. An directory named "archive" exists in the parent directory of
"tools" and the RTEMS archive files named within the script
are available in this directory.
3. The directory which will eventually contain the m68k-rtems
executables is in your PATH variable.
4. Hans Peter Jepsen's bit script patch[3] is present in the
file "bit.patch".
During execution, the script creates comprehensive log files for
all activities. Should you encounter any problems, mail me the log
file and I'll take a look.
On my systems, I use the following tree[1]:
"/usr/local/packages/rtems" - Top level directory for source and builds
"/usr/local/packages/rtems/archive" - Archive directory
"/usr/local/packages/rtems/tools" - Tools and build directory
"/usr/local/rtems" - Destination for builds as specified in "user.cfg"
The second two directories are in place exactly as described in the
"Getting started" document. I keep my scripts along with "user.cfg" in
"/usr/local/packages/rtems" and as mentioned above, I invoke the scripts
from this directory. You could, of course, substitute "/opt" or any other
directory name for "/usr/local" provided you make the appropriate change
to "user.cfg" and keep point 3 above in mind.
Hope this helps.
-- MC --
1. Actually, "/usr/local/packages/rtems" is a symbolic link to
"/usr/local/packages/rtems-4.5.0-beta3a" and "/usr/local/rtems" is
a symlink to "/usr/local/rtems-4.5.0-beta3a". This simplifies revision
management somewhat. I also have symbolic links between
"/usr/local/rtems/bin/m68k-rtems-*" and "/usr/local/bin" so that only
the latter is needed in my PATH variable.
2. RTEMS tools build script:
#!/bin/sh
#
# Execute from top RTEMS directory. "archive" is assumed to be an
# exisitng link to a directory containing tarfiles downloaded from
# OAR.
#
date "+%Y-%m-%d %k:%M:%S"
echo
echo Creating tools directory...
mkdir tools
cd tools
echo Creating binutils-2.9.5.0.24 tree...
tar zxf ../archive/binutils-2.9.5.0.24.tar.gz
echo Creating gcc-2.95.2 tree...
tar zxf ../archive/gcc-2.95.2.tar.gz
echo Creating newlib-1.8.2 tree...
tar zxf ../archive/newlib-1.8.2.tar.gz
echo Unpacking c_build_scripts-4.5.0-beta3a...
tar zxf ../archive/c_build_scripts-4.5.0-beta3a.tgz
echo
echo Patching gcc-2.95.2...
cd gcc-2.95.2
zcat ../../archive/gcc-2.95.2-rtems-20000531.diff.gz | patch -p1 > \
Patch.log 2>&1
find . -name \*.rej
cd ..
echo Patching binutils-2.9.5.0.24...
cd binutils-2.9.5.0.24
zcat ../../archive/binutils-2.9.5.0.24-rtems-20000207.diff.gz | patch -p1 > \
Patch.log 2>&1
find . -name \*.rej
cd ..
echo Patching newlib-1.8.2...
cd newlib-1.8.2
zcat ../../archive/newlib-1.8.2-rtems-20000606.diff.gz | patch -p1 > \
Patch.log 2>&1
find . -name \*.rej
cd ..
echo Patching bit script...
cat ../bit.patch | patch -p1 > Bit_patch.log 2>&1
echo Creating link to local user.cfg file...
mv user.cfg user.cfg_original
ln -s ../user.cfg .
echo Building support environment...
time ./bit m68k > Bit.log 2>&1
3. "bit.patch"
*** bit.orig Tue Jun 20 08:11:43 2000
--- bit Wed Jun 28 13:13:47 2000
***************
*** 151,159 ****
--- 151,163 ----
check_fatal $? "**** FAILED **** unable to make build tree"
cd ${BUILDDIR}
+ echo BIT: Running in `pwd`:
+ ( set -x
+
../${BINUTILS}/configure --target=${target} \
--verbose \
--prefix=${INSTALL_POINT}
+ )
check_fatal $? "**** FAILED **** unable to configure binutils"
***************
*** 160,166 ****
--- 164,175 ----
if [ ${do_build} = no ] ; then
echo "**** SKIPPING BUILD OF BINUTILS ****"
else
+ echo BIT: Running in `pwd`:
+ ( set -x
+
${MAKE} all ${MAKE_DOCS} install
+
+ )
check_fatal $? "**** FAILED **** unable to build binutils"
fi
***************
*** 176,188 ****
check_fatal $? "**** FAILED **** unable to make build tree"
cd ${BUILDDIR}
# Configure to build the target requested
../${GCC}/configure --target=${target} \
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
! --prefix=${INSTALL_POINT}
- # --enable-languages='c c++'
-
if [ ${do_build} = no ] ; then
echo "**** SKIPPING BUILD OF GCC AND NEWLIB ****"
my_exit 0
--- 185,208 ----
check_fatal $? "**** FAILED **** unable to make build tree"
cd ${BUILDDIR}
+ # make installed binutils available on PATH
+ PATH=${INSTALL_POINT}/bin:{$PATH}
+ export PATH
+
+ if [ x${BUILD_OTHER_LANGUAGES} = xno ] ; then
+ LANGUAGE_OPTION=--enable-languages=c,c++
+ fi
+
+
# Configure to build the target requested
+ echo BIT: Running in `pwd`:
+ ( set -x
+
../${GCC}/configure --target=${target} \
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
! ${LANGUAGE_OPTION} --prefix=${INSTALL_POINT}
! )
if [ ${do_build} = no ] ; then
echo "**** SKIPPING BUILD OF GCC AND NEWLIB ****"
my_exit 0
***************
*** 195,202 ****
if [ x${CFLAGS_ARG} = x ] ; then
CFLAGS_ARG="-O2 -g"
fi
! echo "BIT: starting base build (step 1)"
${MAKE} CC=${GCC_ARG} CFLAGS="${CFLAGS_ARG}" all ${MAKE_DOCS} install
check_fatal $? "**** FAILED **** base build (step 1)"
echo "BIT: completed base build (step 1)"
--- 215,226 ----
if [ x${CFLAGS_ARG} = x ] ; then
CFLAGS_ARG="-O2 -g"
fi
!
! echo "BIT: starting base build (step 1) in `pwd`:"
! ( set -x
!
${MAKE} CC=${GCC_ARG} CFLAGS="${CFLAGS_ARG}" all ${MAKE_DOCS} install
+ )
check_fatal $? "**** FAILED **** base build (step 1)"
echo "BIT: completed base build (step 1)"
--
mcollins at wdc.sps.mot.com
More information about the users
mailing list