#!/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 " GNAT/RTEMS Source packages setup"
|
echo " GNAT/RTEMS 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 gnat version : $gnat_version"
|
echo "5 gnat version : $gnat_version"
|
echo "6 gnat patch version : $gnat_patch_version"
|
echo "6 gnat patch version : $gnat_patch_version"
|
echo "7 newlib version : $newlib_version"
|
echo "7 newlib version : $newlib_version"
|
echo "8 newlib patch version : $newlib_patch_version"
|
echo "8 newlib patch version : $newlib_patch_version"
|
echo "9 gnat/newlib rpm release : $gnatnewlib_rpm_release"
|
echo "9 gnat/newlib rpm release : $gnatnewlib_rpm_release"
|
echo "a gdb version : $gdb_version"
|
echo "a gdb version : $gdb_version"
|
echo "b gdb patch version : $gdb_patch_version"
|
echo "b gdb patch version : $gdb_patch_version"
|
echo "c gdb rpm release : $gdb_rpm_release"
|
echo "c gdb rpm release : $gdb_rpm_release"
|
echo "d rtems version : $rtems_version"
|
echo "d rtems version : $rtems_version"
|
echo "e rtems rpm release : $rtems_rpm_release"
|
echo "e rtems rpm release : $rtems_rpm_release"
|
echo "f rpm build root : $rpm_build_root"
|
echo "f rpm build root : $rpm_build_root"
|
echo
|
echo
|
|
|
echo -n "[0-9a-f] or any other key to quit >"
|
echo -n "[0-9a-f] or any other key to quit >"
|
read sel
|
read sel
|
case $sel in
|
case $sel in
|
0) echo -n "BINUTILS source >" ; read binutils_version ;;
|
0) echo -n "BINUTILS source >" ; read binutils_version ;;
|
1) echo -n "BINUTILS patch version >" ; read binutils_patch_version ;;
|
1) echo -n "BINUTILS patch version >" ; read binutils_patch_version ;;
|
2) echo -n "BINUTILS RPM release >" ; read binutils_rpm_release ;;
|
2) echo -n "BINUTILS RPM release >" ; read binutils_rpm_release ;;
|
3) echo -n "GCC source >" ; read gcc_version ;;
|
3) echo -n "GCC source >" ; read gcc_version ;;
|
4) echo -n "GCC patch version>" ; read gcc_patch_version ;;
|
4) echo -n "GCC patch version>" ; read gcc_patch_version ;;
|
5) echo -n "GNAT source >" ; read gnat_version ;;
|
5) echo -n "GNAT source >" ; read gnat_version ;;
|
6) echo -n "GNAT patch version>" ; read gnat_patch_version ;;
|
6) echo -n "GNAT patch version>" ; read gnat_patch_version ;;
|
7) echo -n "NEWLIB source >" ; read newlib_version ;;
|
7) echo -n "NEWLIB source >" ; read newlib_version ;;
|
8) echo -n "NEWLIB patch version>" ; read newlib_patch_version ;;
|
8) echo -n "NEWLIB patch version>" ; read newlib_patch_version ;;
|
9) echo -n "GNAT/NEWLIB RPM release >" ; read gnatnewlib_rpm_release ;;
|
9) echo -n "GNAT/NEWLIB RPM release >" ; read gnatnewlib_rpm_release ;;
|
a) echo -n "GDB source >" ; read gdb_version ;;
|
a) echo -n "GDB source >" ; read gdb_version ;;
|
b) echo -n "GDB patch version>" ; read gdb_patch_version ;;
|
b) echo -n "GDB patch version>" ; read gdb_patch_version ;;
|
c) echo -n "GDB RPM release >" ; read gdb_rpm_release ;;
|
c) echo -n "GDB RPM release >" ; read gdb_rpm_release ;;
|
d) echo -n "RTEMS source >" ; read rtems_version ;;
|
d) echo -n "RTEMS source >" ; read rtems_version ;;
|
e) echo -n "RTEMS RPM release >" ; read rtems_rpm_release ;;
|
e) echo -n "RTEMS RPM release >" ; read rtems_rpm_release ;;
|
f) echo -n "RPM build root >" ; read rpm_build_root ;;
|
f) echo -n "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 "gnat_version=$gnat_version" >> $CFG
|
echo "gnat_version=$gnat_version" >> $CFG
|
echo "gnat_patch_version=$gnat_patch_version" >> $CFG
|
echo "gnat_patch_version=$gnat_patch_version" >> $CFG
|
echo "gnatnewlib_rpm_release=$gnatnewlib_rpm_release" >> $CFG
|
echo "gnatnewlib_rpm_release=$gnatnewlib_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
|
|
|