use bash for sys/msdos/fetch-cross-compiler.sh
bash allows arrays thus preventing duplication during fetching
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -z "${TF_BUILD}" ]; then
|
||||
set -x
|
||||
@@ -60,6 +60,7 @@ fi
|
||||
|
||||
cd lib
|
||||
if [ ! -f "$DJGPP_FILE" ]; then
|
||||
echo "fetching djgpp cross-compiler int lib/djgpp"
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
#Mac
|
||||
curl -L $DJGPP_URL -o $DJGPP_FILE
|
||||
@@ -69,12 +70,14 @@ if [ ! -f "$DJGPP_FILE" ]; then
|
||||
fi
|
||||
|
||||
if [ ! -d djgpp/i586-pc-msdosdjgpp ]; then
|
||||
echo "extracting djgpp from $DJGPP_FILE"
|
||||
tar xjf "$DJGPP_FILE"
|
||||
#rm -f $DJGPP_FILE
|
||||
fi
|
||||
|
||||
# DOS-extender for use with djgpp
|
||||
if [ ! -d djgpp/cwsdpmi ]; then
|
||||
echo "fetching DOS extender for use with djgpp"
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
#Mac
|
||||
curl http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip -o csdpmi7b.zip
|
||||
@@ -94,18 +97,18 @@ fi
|
||||
|
||||
# PDCurses (non-Unicode build uses this)
|
||||
if [ ! -d "pdcurses" ]; then
|
||||
echo "Getting ../pdcurses from https://github.com/wmcbrine/PDCurses.git" ; \
|
||||
echo "fetching ../pdcurses from https://github.com/wmcbrine/PDCurses.git" ; \
|
||||
git clone --depth 1 https://github.com/wmcbrine/PDCurses.git pdcurses
|
||||
fi
|
||||
|
||||
# PDCursesMod (Unicode build uses this)
|
||||
if [ ! -d "pdcursesmod" ]; then
|
||||
echo "Getting ../pdcursesmod from https://github.com/Bill-Gray/PDCursesMod.git" ; \
|
||||
echo "fetching ../pdcursesmod from https://github.com/Bill-Gray/PDCursesMod.git" ; \
|
||||
git clone --depth 1 https://github.com/Bill-Gray/PDCursesMod.git pdcursesmod
|
||||
fi
|
||||
|
||||
if [ ! -d djgpp/djgpp-patch ]; then
|
||||
echo "Getting djlsr205.zip" ;
|
||||
echo "fetching djlsr205.zip" ;
|
||||
cd djgpp
|
||||
mkdir -p djgpp-patch
|
||||
cd djgpp-patch
|
||||
@@ -132,62 +135,70 @@ if [ ! -d djgpp/djgpp-patch ]; then
|
||||
mkdir -p src/libc/go32
|
||||
unzip -p djlsr205.zip src/libc/go32/exceptn.S >src/libc/go32/exceptn.S
|
||||
patch -p0 -l -i ../../../sys/msdos/exceptn.S.patch
|
||||
echo "djgpp patch applied"
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
# create a directory hold native DOS executables that might get deployed
|
||||
# create a directory to hold some native DOS executables that might get deployed
|
||||
if [ ! -d djgpp/target ]; then
|
||||
cd djgpp
|
||||
mkdir -p target
|
||||
cd ../
|
||||
fi
|
||||
|
||||
# These 4 arrays must have their elements kept in synch.
|
||||
#
|
||||
# full URL for the remote zip file to fetch
|
||||
zipurl=(
|
||||
"http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djdev205.zip"
|
||||
"http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2gnu/gdb801b.zip"
|
||||
)
|
||||
# name of zip file upon landing here
|
||||
ziplocal=(
|
||||
"djdev205.zip"
|
||||
"gdb801b.zip"
|
||||
)
|
||||
# name of file after extraction from zip file
|
||||
exesought=(
|
||||
"symify.exe"
|
||||
"gdb.exe"
|
||||
)
|
||||
# stored full path inside zip file
|
||||
exepathinzip=(
|
||||
"bin/symify.exe"
|
||||
"bin/gdb.exe"
|
||||
)
|
||||
|
||||
if [ -d djgpp/target ]; then
|
||||
cd djgpp/target
|
||||
# symify to make bug reports more useful
|
||||
if [ ! -f symify.exe ]; then
|
||||
if [ ! -f djdev205.zip ]; then
|
||||
echo "Getting djdev205.zip" ;
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
#Mac
|
||||
curl --output djdev205.zip http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djdev205.zip
|
||||
export cmdstatus=$?
|
||||
else
|
||||
wget --quiet --no-hsts http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djdev205.zip
|
||||
export cmdstatus=$?
|
||||
fi
|
||||
if [ $cmdstatus -eq 0 ]; then
|
||||
echo "fetch of djdev205.zip was successful"
|
||||
fi
|
||||
fi
|
||||
if [ -f djdev205.zip ]; then
|
||||
echo "unzipping djdev205.zip"
|
||||
unzip -p djdev205.zip bin/symify.exe >./symify.exe
|
||||
fi
|
||||
fi
|
||||
# gdb
|
||||
if [ ! -f gdb.exe ]; then
|
||||
if [ ! -f gdb801b.zip ]; then
|
||||
echo "getting gdb801b.zip" ;
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
#Mac
|
||||
curl --output gdb801b.zip http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2gnu/gdb801b.zip
|
||||
export cmdstatus=$?
|
||||
else
|
||||
wget --quiet --no-hsts http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2gnu/gdb801b.zip
|
||||
export cmdstatus=$?
|
||||
fi
|
||||
if [ $cmdstatus -eq 0 ]; then
|
||||
echo "fetch of gdb801b.zip was successful"
|
||||
fi
|
||||
fi
|
||||
if [ -f gdb801b.zip ]; then
|
||||
echo "unzipping gdb801b.zip"
|
||||
unzip -p gdb801b.zip bin/gdb.exe >./gdb.exe
|
||||
fi
|
||||
fi
|
||||
echo "Native DOS executables:"
|
||||
ls -l *.exe
|
||||
cd ../../
|
||||
cd djgpp/target
|
||||
count=0
|
||||
while [ "x${zipurl[count]}" != "x" ]
|
||||
do
|
||||
if [ ! -f ${exesought[count]} ]; then
|
||||
if [ ! -f ${ziplocal[count]} ]; then
|
||||
echo "Getting ${ziplocal[count]}" ;
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
#Mac
|
||||
curl --output ${ziplocal[count]} ${zipurl[count]}
|
||||
export cmdstatus=$?
|
||||
else
|
||||
wget --quiet --no-hsts ${zipurl[count]}
|
||||
export cmdstatus=$?
|
||||
fi
|
||||
if [ $cmdstatus -eq 0 ]; then
|
||||
echo "fetch of ${ziplocal[count]} was successful"
|
||||
fi
|
||||
fi
|
||||
if [ -f ${ziplocal[count]} ]; then
|
||||
echo "unzipping ${ziplocal[count]}"
|
||||
unzip -p ${ziplocal[count]} ${exepathinzip[count]} >./${exesought[count]}
|
||||
fi
|
||||
fi
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
echo "Native DOS executables in lib/djgpp/target:"
|
||||
ls -l *.exe
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
FONT_VERSION="4.49"
|
||||
@@ -207,6 +218,8 @@ if [ ! -d "$FONT_LFILE" ]; then
|
||||
fi
|
||||
tar -xvf $FONT_RFILE
|
||||
rm $FONT_RFILE
|
||||
else
|
||||
echo "terminus fonts are already available in lib/$FONT_LFILE"
|
||||
fi
|
||||
|
||||
cd ../
|
||||
|
||||
Reference in New Issue
Block a user