#!/bin/bash
|
#!/bin/bash
|
|
|
CFG=setup.cache
|
CFG=setup.cache
|
|
|
# RTEMS tools setup
|
# RTEMS tools setup
|
|
|
if test ! -f ./$CFG;
|
if test ! -f ./$CFG;
|
then
|
then
|
echo -n "restoring default setup.cache .."
|
echo -n "restoring default setup.cache .."
|
cp ./setup.def ./$CFG
|
cp ./setup.def ./$CFG
|
echo " done"
|
echo " done"
|
fi
|
fi
|
|
|
echo -n "loading setup from ./$CFG .."
|
echo -n "loading setup from ./$CFG .."
|
. ./$CFG
|
. ./$CFG
|
echo " done"
|
echo " done"
|
echo
|
echo
|
|
|
menu_setup()
|
menu_setup()
|
{
|
{
|
while true;
|
while true;
|
do
|
do
|
echo
|
echo
|
echo " Source packages setup"
|
echo " Source packages setup"
|
echo
|
echo
|
echo "0 binutils version : $binutils_version"
|
echo "0 binutils version : $binutils_version"
|
echo "1 binutils patch version : $binutils_patch_version"
|
echo "1 binutils patch version : $binutils_patch_version"
|
echo "2 binutils rpm release : $binutils_rpm_release"
|
echo "2 binutils rpm release : $binutils_rpm_release"
|
echo "3 gcc version : $gcc_version"
|
echo "3 gcc version : $gcc_version"
|
echo "4 gcc patch version : $gcc_patch_version"
|
echo "4 gcc patch version : $gcc_patch_version"
|
echo "5 newlib version : $newlib_version"
|
echo "5 newlib version : $newlib_version"
|
echo "6 newlib patch version : $newlib_patch_version"
|
echo "6 newlib patch version : $newlib_patch_version"
|
echo "7 gcc/newlib rpm release : $gccnewlib_rpm_release"
|
echo "7 gcc/newlib rpm release : $gccnewlib_rpm_release"
|
echo "8 gdb version : $gdb_version"
|
echo "8 gdb version : $gdb_version"
|
echo "9 gdb patch version : $gdb_patch_version"
|
echo "9 gdb patch version : $gdb_patch_version"
|
echo "a gdb rpm release : $gdb_rpm_release"
|
echo "a gdb rpm release : $gdb_rpm_release"
|
echo "b rtems version : $rtems_version"
|
echo "b rtems version : $rtems_version"
|
echo "c rtems rpm release : $rtems_rpm_release"
|
echo "c rtems rpm release : $rtems_rpm_release"
|
echo "d rpm build root : $rpm_build_root"
|
echo "d rpm build root : $rpm_build_root"
|
echo
|
echo
|
|
|
echo -n "[0-9a-d] or any other key to quit >"
|
echo -n "[0-9a-d] or any other key to quit >"
|
read sel
|
read sel
|
case $sel in
|
case $sel in
|
0) echo -n "BINUTILS source >"
|
0) echo -n "BINUTILS source >"
|
read binutils_version ;;
|
read binutils_version ;;
|
1) echo -n "BINUTILS patch version >"
|
1) echo -n "BINUTILS patch version >"
|
read binutils_patch_version ;;
|
read binutils_patch_version ;;
|
2) echo -n "BINUTILS RPM release >"
|
2) echo -n "BINUTILS RPM release >"
|
read binutils_rpm_release ;;
|
read binutils_rpm_release ;;
|
3) echo -n "GCC source >"
|
3) echo -n "GCC source >"
|
read gcc_version ;;
|
read gcc_version ;;
|
4) echo -n "GCC patch version>"
|
4) echo -n "GCC patch version>"
|
read gcc_patch_version ;;
|
read gcc_patch_version ;;
|
5) echo -n "NEWLIB source >"
|
5) echo -n "NEWLIB source >"
|
read newlib_version ;;
|
read newlib_version ;;
|
6) echo -n "NEWLIB patch version>"
|
6) echo -n "NEWLIB patch version>"
|
read newlib_patch_version ;;
|
read newlib_patch_version ;;
|
7) echo -n "GCC/NEWLIB RPM release >"
|
7) echo -n "GCC/NEWLIB RPM release >"
|
read gccnewlib_rpm_release ;;
|
read gccnewlib_rpm_release ;;
|
8) echo -n "GDB source >"
|
8) echo -n "GDB source >"
|
read gdb_version ;;
|
read gdb_version ;;
|
9) echo -n "GDB patch version>"
|
9) echo -n "GDB patch version>"
|
read gdb_patch_version ;;
|
read gdb_patch_version ;;
|
a) echo -n "GDB RPM release >"
|
a) echo -n "GDB RPM release >"
|
read gdb_rpm_release ;;
|
read gdb_rpm_release ;;
|
b) echo -n "RTEMS source >"
|
b) echo -n "RTEMS source >"
|
read rtems_version ;;
|
read rtems_version ;;
|
c) echo -n "RTEMS RPM release >"
|
c) echo -n "RTEMS RPM release >"
|
read rtems_rpm_release ;;
|
read rtems_rpm_release ;;
|
d) echo -n "RPM build root >"
|
d) echo -n "RPM build root >"
|
read rpm_build_root ;;
|
read rpm_build_root ;;
|
*)
|
*)
|
return 0 ;;
|
return 0 ;;
|
esac
|
esac
|
done
|
done
|
}
|
}
|
|
|
|
|
save_setup()
|
save_setup()
|
{
|
{
|
echo -n "saving setup to $CFG .."
|
echo -n "saving setup to $CFG .."
|
|
|
echo "# RTEMS tools setup" > $CFG
|
echo "# RTEMS tools setup" > $CFG
|
echo "binutils_version=$binutils_version" >> $CFG
|
echo "binutils_version=$binutils_version" >> $CFG
|
echo "binutils_patch_version=$binutils_patch_version" >> $CFG
|
echo "binutils_patch_version=$binutils_patch_version" >> $CFG
|
echo "binutils_rpm_release=$binutils_rpm_release" >> $CFG
|
echo "binutils_rpm_release=$binutils_rpm_release" >> $CFG
|
echo "newlib_version=$newlib_version" >> $CFG
|
echo "newlib_version=$newlib_version" >> $CFG
|
echo "newlib_patch_version=$newlib_patch_version" >> $CFG
|
echo "newlib_patch_version=$newlib_patch_version" >> $CFG
|
echo "gcc_version=$gcc_version" >> $CFG
|
echo "gcc_version=$gcc_version" >> $CFG
|
echo "gcc_patch_version=$gcc_patch_version" >> $CFG
|
echo "gcc_patch_version=$gcc_patch_version" >> $CFG
|
echo "gccnewlib_rpm_release=$gccnewlib_rpm_release" >> $CFG
|
echo "gccnewlib_rpm_release=$gccnewlib_rpm_release" >> $CFG
|
echo "gdb_version=$gdb_version" >> $CFG
|
echo "gdb_version=$gdb_version" >> $CFG
|
echo "gdb_patch_version=$gdb_patch_version" >> $CFG
|
echo "gdb_patch_version=$gdb_patch_version" >> $CFG
|
echo "gdb_rpm_release=$gdb_rpm_release" >> $CFG
|
echo "gdb_rpm_release=$gdb_rpm_release" >> $CFG
|
echo "rtems_version=$rtems_version" >> $CFG
|
echo "rtems_version=$rtems_version" >> $CFG
|
echo "rtems_rpm_release=$rtems_rpm_release" >> $CFG
|
echo "rtems_rpm_release=$rtems_rpm_release" >> $CFG
|
echo "rpm_build_root=$rpm_build_root" >> $CFG
|
echo "rpm_build_root=$rpm_build_root" >> $CFG
|
|
|
echo " done"
|
echo " done"
|
test -f Makefile || ./configure
|
test -f Makefile || ./configure
|
}
|
}
|
|
|
menu_setup
|
menu_setup
|
|
|
echo
|
echo
|
echo -n "Save setup [y|n] >"
|
echo -n "Save setup [y|n] >"
|
read sel
|
read sel
|
case $sel in
|
case $sel in
|
''|y*|Y*) save_setup ;;
|
''|y*|Y*) save_setup ;;
|
*) ;;
|
*) ;;
|
esac
|
esac
|
|
|