forked from Imagelibrary/rtems
2001-01-22 Joel Sherrill <joel@OARcorp.com>
* buildalltar.in: Modified to support Canadian cross builds. It was testing using a RedHat 7.2 host to build *-rtems tools that run on an i386-cygwin host.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2001-01-22 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* buildalltar.in: Modified to support Canadian cross builds.
|
||||||
|
It was testing using a RedHat 7.2 host to build *-rtems tools
|
||||||
|
that run on an i386-cygwin host.
|
||||||
|
|
||||||
2001-11-15 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2001-11-15 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* configure.ac: Fix typo to allow custom RPM_SPECSdirs.
|
* configure.ac: Fix typo to allow custom RPM_SPECSdirs.
|
||||||
|
|||||||
@@ -17,16 +17,35 @@ usage()
|
|||||||
echo " -b -- build binutils"
|
echo " -b -- build binutils"
|
||||||
echo " -g -- build gcc/newlib"
|
echo " -g -- build gcc/newlib"
|
||||||
echo " -d -- build gdb"
|
echo " -d -- build gdb"
|
||||||
|
echo " -C HOST -- build canadian cross for HOST "
|
||||||
echo " -t -- enable test/debug mode"
|
echo " -t -- enable test/debug mode"
|
||||||
echo " -cfg <setup.cache>"
|
echo " -cfg <setup.cache>"
|
||||||
echo " -o <rpm-spec-dir>"
|
echo " -o <rpm-spec-dir>"
|
||||||
exit 1 ;
|
exit 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Checks the status returned by executables and exits if it is non-zero.
|
||||||
|
#
|
||||||
|
check_fatal()
|
||||||
|
{
|
||||||
|
if [ $1 -ne 0 ] ; then
|
||||||
|
shift
|
||||||
|
echo "ERROR: $*" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
#echo
|
||||||
|
#echo "End of $*"
|
||||||
|
#echo -n "Press return to continue> "
|
||||||
|
#echo
|
||||||
|
#read line
|
||||||
|
}
|
||||||
|
|
||||||
testing=no
|
testing=no
|
||||||
do_binutils=no
|
do_binutils=no
|
||||||
do_gccnewlib=no
|
do_gccnewlib=no
|
||||||
do_gdb=no
|
do_gdb=no
|
||||||
|
cdn_cross=no
|
||||||
|
|
||||||
while test $# -ge 1; do
|
while test $# -ge 1; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -46,6 +65,18 @@ while test $# -ge 1; do
|
|||||||
dst=$1
|
dst=$1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-C)
|
||||||
|
test $# -ge 2 || usage
|
||||||
|
shift
|
||||||
|
build=$1
|
||||||
|
shift
|
||||||
|
if ! test -x ${RTEMS_DIR}/../config.guess ; then
|
||||||
|
echo "Missing ${RTEMS_DIR}/../config.guess!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
CDN_ARGS="--build=`${RTEMS_DIR}/../config.guess` --host=${build}"
|
||||||
|
cdn_cross=yes
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
echo "invalid option $1";
|
echo "invalid option $1";
|
||||||
usage
|
usage
|
||||||
@@ -130,38 +161,54 @@ fi
|
|||||||
cd ${dst}
|
cd ${dst}
|
||||||
test -d log || mkdir log
|
test -d log || mkdir log
|
||||||
|
|
||||||
|
if [ "X${rpm_build_root}" = "X" ] ; then
|
||||||
|
echo rpm_build_root NOT set!
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CWD=`pwd`
|
||||||
|
test -d tarballs || mkdir tarballs
|
||||||
|
|
||||||
|
OUT=${CWD}/tarballs
|
||||||
|
|
||||||
# do all the tools
|
# do all the tools
|
||||||
for target in ${TARGETS}
|
for target in ${TARGETS}
|
||||||
do
|
do
|
||||||
bintarfile=${PWD}/${target}-binutils-${binutils}-${binutils_rpm_release}.tar
|
bintarfile=${OUT}/${target}-binutils-${binutils}-${binutils_rpm_release}.tar
|
||||||
if [ ${do_binutils} = yes ] ; then
|
if [ ${do_binutils} = yes ] ; then
|
||||||
# this part is for RPMS
|
logfile=${CWD}/log/${target}-binutils
|
||||||
logfile=log/${target}-binutils
|
|
||||||
#specfile=${dst}/${target}-binutils-${binutils}.spec
|
|
||||||
#echo "rpm -ba ${specfile} >${logfile} 2>&1"
|
|
||||||
#if [ ${testing} = no ] ; then
|
|
||||||
# rpm -ba ${specfile} >${logfile} 2>&1
|
|
||||||
#fi
|
|
||||||
#${ECHO} rm -rf ${dst}/../BUILD/${target}-binutils*
|
|
||||||
|
|
||||||
|
|
||||||
# this part is for tar.bz2
|
# this part is for tar.bz2
|
||||||
PWD=`pwd`
|
cd ${CWD}
|
||||||
mkdir b-${target}
|
if [ ! -d binutils-${binutils} ] ; then
|
||||||
cd b-${target}
|
echo Could not find binutils-${binutils}!
|
||||||
../binutils-${binutils}/configure --target=${target} \
|
exit 1
|
||||||
--verbose --prefix=/opt/rtems
|
fi
|
||||||
make all
|
rm -rf b-${target}-bin
|
||||||
make info
|
mkdir b-${target}-bin
|
||||||
make prefix=${rpm_build_root}/opt/rtems install
|
cd b-${target}-bin
|
||||||
make prefix=${rpm_build_root}/opt/rtems install-info
|
echo "Building binutils-${binutils} for ${target}"
|
||||||
|
../binutils-${binutils}/configure ${CDN_ARGS} --target=${target} \
|
||||||
|
--verbose --prefix=/opt/rtems >${logfile} 2>&1
|
||||||
|
check_fatal $? "binutils configure"
|
||||||
|
|
||||||
|
make all >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make all"
|
||||||
|
|
||||||
|
make info >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make info"
|
||||||
|
|
||||||
|
make prefix=${rpm_build_root}/opt/rtems install >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make install"
|
||||||
|
|
||||||
|
make prefix=${rpm_build_root}/opt/rtems install-info >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make install-info"
|
||||||
|
|
||||||
cd ${buildroot}
|
cd ${buildroot}
|
||||||
tar cf ${PWD}/${target}-binutils-${binutils}-${binutils_rpm_release}.tar opt
|
tar cjf ${bintarfile}.bz2 opt
|
||||||
cd ${PWD}
|
cd ${CWD}
|
||||||
bzip2 -9 ${target}-binutils-${binutils}.tar
|
rm -rf b-${target}-bin
|
||||||
${ECHO} rm -rf ${rpm_build_root}/opt
|
${ECHO} rm -rf ${rpm_build_root}/opt
|
||||||
rm -rf ${rpm_build_root}/opt/rtems
|
#rm -rf ${rpm_build_root}/opt
|
||||||
rm -rf b-${target}
|
|
||||||
else
|
else
|
||||||
echo Skipping binutils for ${target}
|
echo Skipping binutils for ${target}
|
||||||
fi
|
fi
|
||||||
@@ -171,62 +218,55 @@ do
|
|||||||
#
|
#
|
||||||
|
|
||||||
if [ ${do_gccnewlib} = yes ] ; then
|
if [ ${do_gccnewlib} = yes ] ; then
|
||||||
|
logfile=${CWD}/log/${target}-gccnewlib
|
||||||
# now build gcc/newlib
|
# now build gcc/newlib
|
||||||
# NOTE: This requires having binutils installed and we immediately
|
|
||||||
# remove it once finished.
|
|
||||||
#base_binutils_rpm=${dst}/../RPMS/${rpm_cpu}/rtems-base-binutils-${binutils}-${binutils_rpm_release}.${rpm_cpu}.rpm
|
|
||||||
#binutils_rpm=${dst}/../RPMS/${rpm_cpu}/${target}-binutils-${binutils}-${binutils_rpm_release}.${rpm_cpu}.rpm
|
|
||||||
#if [ ! -f ${binutils_rpm} ] ; then
|
|
||||||
# echo There is no RPM for binutils for ${target}.
|
|
||||||
# echo Looked for ${binutils_rpm}.
|
|
||||||
#fi
|
|
||||||
#${ECHO} rpm -i ${base_binutils_rpm}
|
|
||||||
#${ECHO} rpm -i ${binutils_rpm}
|
|
||||||
|
|
||||||
#logfile=log/${target}-gccnewlib
|
|
||||||
#specfile=${dst}/${target}-gcc-${gcc}-newlib-${newlib}.spec
|
|
||||||
#echo "rpm -ba ${specfile} >${logfile} 2>&1"
|
|
||||||
#if [ ${testing} = no ] ; then
|
|
||||||
# rpm -ba ${specfile} >${logfile} 2>&1
|
|
||||||
#fi
|
|
||||||
#${ECHO} rm -rf ${dst}/../BUILD/${target}-gcc*
|
|
||||||
#${ECHO} rm -rf ${buildroot}/opt/rtems
|
|
||||||
|
|
||||||
#echo uninstalling binutils for ${target}
|
|
||||||
#if [ ${testing} = no ] ; then
|
|
||||||
# rpm -e `rpm -qa | grep rtems`
|
|
||||||
# rm -rf /opt/rtems/*
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# this part is for tar.bz2
|
# this part is for tar.bz2
|
||||||
PWD=`pwd`
|
|
||||||
|
|
||||||
gcctarfile=${PWD}/${target}-gcc-${gcc}-newlib-${newlib}-${gccnewlib_rpm_release}.tar
|
gcctarfile=${OUT}/${target}-gcc-${gcc}-newlib-${newlib}-${gccnewlib_rpm_release}.tar
|
||||||
bintarfile=${dst}/binaries/binutils-${binutils}-${binutils_rpm_release}/${target}-binutils-${binutils}-${binutils_rpm_release}.tar
|
if [ ${cdn_cross} = "no" ] ; then
|
||||||
cd /
|
bintarfile=${dst}/binaries/binutils-${binutils}-${binutils_rpm_release}/${target}-binutils-${binutils}-${binutils_rpm_release}.tar
|
||||||
rm -rf /opt/*
|
cd /
|
||||||
bzcat ${bintarfile}.bz2 | tar xf -
|
rm -rf /opt/*
|
||||||
|
tar xjf ${bintarfile}.bz2
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ${CWD}
|
||||||
|
if [ ! -d gcc-${gcc} ] ; then
|
||||||
|
echo Could not find gcc-${gcc}!
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -d gcc-${gcc}/newlib ] ; then
|
||||||
|
echo Could not find gcc-${gcc}/newlib!
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
rm -rf b-${target}-gccnewlib
|
||||||
|
mkdir b-${target}-gccnewlib
|
||||||
|
cd b-${target}-gccnewlib
|
||||||
|
echo "Building gcc-${gcc} for ${target}"
|
||||||
|
../gcc-${gcc}/configure ${CDN_ARGS} --target=${target} \
|
||||||
|
--with-gnu-as --with-gnu-ld --with-newlib --verbose --enable-threads \
|
||||||
|
--prefix=/opt/rtems '--enable-languages=c,c++' >${logfile} 2>&1
|
||||||
|
check_fatal $? "gcc configure"
|
||||||
|
|
||||||
|
make all >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make all"
|
||||||
|
|
||||||
|
make info >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make info"
|
||||||
|
|
||||||
|
make prefix=${rpm_build_root}/opt/rtems install >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make install"
|
||||||
|
|
||||||
cd ${PWD}
|
|
||||||
rm -rf b-${target}
|
|
||||||
mkdir b-${target}
|
|
||||||
cd b-${target}
|
|
||||||
../gcc-${gcc}/configure --target=${target} \
|
|
||||||
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
|
|
||||||
--enable-threads --prefix=/opt/rtems '--enable-languages=c,c++'
|
|
||||||
make all
|
|
||||||
make info
|
|
||||||
make prefix=${rpm_build_root}/opt/rtems install
|
|
||||||
make prefix=${rpm_build_root}/opt/rtems install-info
|
|
||||||
cd ${target}/newlib
|
cd ${target}/newlib
|
||||||
make prefix=${rpm_build_root}/opt/rtems install-info
|
make prefix=${rpm_build_root}/opt/rtems install-info >>${logfile} 2>&1
|
||||||
|
check_fatal $? "newlib make install-info"
|
||||||
|
|
||||||
cd ${buildroot}
|
cd ${buildroot}
|
||||||
tar cf ${gcctarfile} opt
|
tar cjf ${gcctarfile}.bz2 opt
|
||||||
cd ${PWD}
|
cd ${CWD}
|
||||||
bzip2 -9 ${gcctarfile}
|
|
||||||
rm -rf ${rpm_build_root}/opt
|
rm -rf ${rpm_build_root}/opt
|
||||||
rm -rf ${rpm_build_root}/opt/rtems
|
rm -rf ${rpm_build_root}/opt/rtems
|
||||||
rm -rf b-${target}
|
rm -rf b-${target}-gccnewlib
|
||||||
else
|
else
|
||||||
echo Skipping gcc/newlib for ${target}
|
echo Skipping gcc/newlib for ${target}
|
||||||
fi
|
fi
|
||||||
@@ -237,20 +277,17 @@ do
|
|||||||
|
|
||||||
if [ ${do_gdb} = yes ] ; then
|
if [ ${do_gdb} = yes ] ; then
|
||||||
# now build gdb
|
# now build gdb
|
||||||
#logfile=log/${target}-gdb
|
gdbtarfile=${OUT}/${target}-gdb-${gdb}-${gdb_rpm_release}.tar
|
||||||
#specfile=${dst}/${target}-gdb-${gdb}.spec
|
logfile=${CWD}/log/${target}-gdb
|
||||||
#echo "rpm -ba ${specfile} >${logfile} 2>&1"
|
|
||||||
#if [ ${testing} = no ] ; then
|
|
||||||
# rpm -ba ${specfile} >${logfile} 2>&1
|
|
||||||
#fi
|
|
||||||
#${ECHO} rm -rf ${dst}/../BUILD/${target}-gdb*
|
|
||||||
#${ECHO} rm -rf ${buildroot}/opt/rtems
|
|
||||||
|
|
||||||
# this part is for tar.bz2
|
# this part is for tar.bz2
|
||||||
|
|
||||||
PWD=`pwd`
|
if [ ! -d gdb-${gdb} ] ; then
|
||||||
mkdir b-${target}
|
echo Could not find gdb-${gdb}!
|
||||||
cd b-${target}
|
exit 1
|
||||||
|
fi
|
||||||
|
mkdir b-${target}-gdb
|
||||||
|
cd b-${target}-gdb
|
||||||
case ${target} in
|
case ${target} in
|
||||||
arm* | d10v* | d30v* | erc32* | fr30* | h8300* | h8500* | i960* | \
|
arm* | d10v* | d30v* | erc32* | fr30* | h8300* | h8500* | i960* | \
|
||||||
m32r* | mcore* | mips* | mn10200* | mn10300* | sh* | sparc*| v850* | \
|
m32r* | mcore* | mips* | mn10200* | mn10300* | sh* | sparc*| v850* | \
|
||||||
@@ -266,19 +303,29 @@ do
|
|||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
../gdb-${gdb}/configure --target=${target} \
|
echo "Building gdb-${gdb}/configure ${CDN_ARGS} --target=${target}"
|
||||||
${extra_configure_arguments} --verbose --prefix=/opt/rtems
|
../gdb-${gdb}/configure ${CDN_ARGS} --target=${target} \
|
||||||
make all
|
${extra_configure_arguments} --verbose --prefix=/opt/rtems >${logfile} 2>&1
|
||||||
make info
|
check_fatal $? "make info"
|
||||||
make prefix=${rpm_build_root}/opt/rtems install
|
|
||||||
make prefix=${rpm_build_root}/opt/rtems install-info
|
make all >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make all"
|
||||||
|
|
||||||
|
make info >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make info"
|
||||||
|
|
||||||
|
make prefix=${rpm_build_root}/opt/rtems install >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make install"
|
||||||
|
|
||||||
|
make prefix=${rpm_build_root}/opt/rtems install-info >>${logfile} 2>&1
|
||||||
|
check_fatal $? "make install-info"
|
||||||
|
|
||||||
cd ${buildroot}
|
cd ${buildroot}
|
||||||
tar cf ${PWD}/${target}-gdb-${gdb}-${gdb_rpm_release}.tar opt
|
tar cjf ${gdbtarfile}.bz2 opt
|
||||||
cd ${PWD}
|
cd ${CWD}
|
||||||
bzip2 -9 ${target}-gdb-${gdb}.tar
|
|
||||||
${ECHO} rm -rf ${rpm_build_root}/opt
|
${ECHO} rm -rf ${rpm_build_root}/opt
|
||||||
rm -rf ${rpm_build_root}/opt/rtems
|
rm -rf ${rpm_build_root}/opt/rtems
|
||||||
rm -rf b-${target}
|
rm -rf b-${target}-gdb
|
||||||
else
|
else
|
||||||
echo Skipping gdb for ${target}
|
echo Skipping gdb for ${target}
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user