diff --git a/build-djgpp.sh b/build-djgpp.sh index d9d1556..080608a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -62,9 +62,6 @@ fi cd ${BASE}/build/ || exit 1 -echo "Removing old specs file" -${SUDO} rm -f ${PREFIX}/lib/gcc/${TARGET}/$(get_version gcc)/specs - if [ ! -z ${WATT32_VERSION} ]; then export WATT_ROOT=${BASE}/build/Watt-32 cd ${WATT_ROOT} || exit 1 diff --git a/script/download.sh b/script/download.sh index d2ba63e..059dcd9 100644 --- a/script/download.sh +++ b/script/download.sh @@ -125,5 +125,18 @@ echo "Creating install directory: ${DST}" export PATH="${DST}/bin:${PREFIX}/bin:$PATH" +remove_if_exists() +{ + if [ -e $1 ]; then + ${SUDO} rm -f $1 || exit 1 + fi +} + +if which ${TARGET}-gcc 2>&1 > /dev/null; then + echo "Removing previously-installed specs file" + remove_if_exists "${DST}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs" + remove_if_exists "${PREFIX}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs" +fi + rm -rf ${BASE}/tests mkdir -p ${BASE}/tests