diff options
| author | Oxore <oxore@protonmail.com> | 2022-06-18 20:34:10 +0300 |
|---|---|---|
| committer | Oxore <oxore@protonmail.com> | 2022-06-18 20:34:10 +0300 |
| commit | 18b217ea11efa74e3fcf04abaaae1ebd32210440 (patch) | |
| tree | 7a7b9d44181480ce241ef225ff28f04ab63b4e84 /5-build-newlib.sh | |
| parent | 5cddfc7214117a2a8e5c4a11429a33dde50edd19 (diff) | |
Compile with soft floating point support
Diffstat (limited to '5-build-newlib.sh')
| -rw-r--r-- | 5-build-newlib.sh | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/5-build-newlib.sh b/5-build-newlib.sh index ddbc704..87cdc6f 100644 --- a/5-build-newlib.sh +++ b/5-build-newlib.sh @@ -2,18 +2,44 @@ source ./common export PATH="$prefix_dir/bin:${PATH:+:${PATH}}" +options_do_configure=1 +options_do_build=1 +options_do_install=1 + +if [ "$0" == "-i" ]; then + options_do_configure= + options_do_build= + options_do_install=1 +fi + mkdir -p build/newlib-$newlib_ver cd build/newlib-$newlib_ver -echo "Configuring newlib-${newlib_ver}" -../../unpacked/newlib-$newlib_ver/configure --prefix=$prefix_dir --target=$target >configure.log 2>&1 -ret=$? -if [ $ret -ne 0 ]; then less configure.log; exit 1; fi -echo "Building newlib-$newlib_ver" -make -j$jobs >build.log 2>&1 -ret=$? -if [ $ret -ne 0 ]; then less build.log; exit 1; fi -echo "Installing newlib-$newlib_ver" -make install >install.log 2>&1 -ret=$? -if [ $ret -ne 0 ]; then less install.log; exit 1; fi -echo "Done with newlib-$newlib_ver" +if [ -n "$options_do_configure" ]; then + echo "Configuring newlib-${newlib_ver}" + CFLAGS_FOR_TARGET="-g -O2 -msoft-float -march=m4k" \ + ../../unpacked/newlib-$newlib_ver/configure \ + --prefix=$prefix_dir \ + --target=$target \ + --with-float=soft \ + --enable-soft-float \ + >configure.log 2>&1 + ret=$? + if [ $ret -ne 0 ]; then less configure.log; exit 1; fi +fi +if [ -n "$options_do_build" ]; then + echo "Building newlib-$newlib_ver" + make -j$jobs >build.log 2>&1 + ret=$? + if [ $ret -ne 0 ]; then less build.log; exit 1; fi +fi +if [ -n "$options_do_install" ]; then + echo "Installing newlib-$newlib_ver" + make install >install.log 2>&1 + ret=$? + if [ $ret -ne 0 ]; then less install.log; exit 1; fi +fi +if [ -z "$options_do_configure$options_do_build$options_do_install" ]; then + echo "Nothing to be done for newlib-$newlib_ver" +else + echo "Done with newlib-$newlib_ver" +fi |
