-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrmvlib_install.sh
More file actions
132 lines (100 loc) · 3.88 KB
/
rmvlib_install.sh
File metadata and controls
132 lines (100 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
#INSTRUCTIONS
#install cygwin 32-bit.
#During installation, add the following additional packages on top of the default packages that will be installed (latest versions):
# wget, make, gcc-core, git, libmpfr4, libmpc3, doxygen
#Clone the git repository for install script with the following command
# git clone https://github.com/lachoneus/windows-cygwin-rmvlib-install-scripts.git
#Navigate into the folder downloaded by git and run the following commands:
# cd windows-cygwin-rmvlib-install-scripts
# sh ./rmvlib_install.sh
#restart cygwin before testing so that the JAGPATH environment variable, installed by the script earlier, takes effect.
#Test your tool-chain by attempting to build the generic example program located at ~/Jaguar/example_programs/generic_example/. Run 'make' inside of this folder to test.
#Script
#setup our folders for our tools and build environment path
INSTALLDIRECTORYNAME='Jaguar'
INSTALLPATH="/home/$USER/$INSTALLDIRECTORYNAME"
i=0; n=0; progs=(wget make gcc git doxygen);
for p in "${progs[@]}"; do
if hash "$p" &>/dev/null
then
echo "$p is installed"
sleep 0.5
let c++
else
echo "$p is not installed"
sleep 0.5
let n++
fi
done
if [ "$n" -gt "0" ]
then
echo "One or more necessary applications has not been install through the Cygwin setup executable. (Read messages above to see which applications aren't installed)."
echo "Run Cygwin setup again, and make sure the follow packages are installed:"
echo " "
echo "wget, make, gcc-core, git, libmpfr4, libmpc3, doxygen"
exit
else
#download and install m-64k-atari-mint cross compiler tools
echo " Downloading and Installing Cross Compiler "
wget --no-check-certificate https://tho-otto.de/download/mint/m68k-atari-mint-base-20200501-cygwin32.tar.xz
tar -xvf ./m68k-atari-mint-base-20200501-cygwin32.tar.xz -C /
rm -rvf ./m68k-atari-mint-base-20200501-cygwin32.tar.xz
#setup our folders for our tools and build environment path
echo " Adding Tools Directory "
mkdir -vp $INSTALLPATH
mkdir -vp $INSTALLPATH/bin
mkdir -vp $INSTALLPATH/example_programs
mkdir -vp $INSTALLPATH/lib
mkdir -vp $INSTALLPATH/lib/lib
mkdir -vp $INSTALLPATH/lib/include
mkdir -vp $INSTALLPATH/src
echo " Copy Temporary Assets Directory "
cp -vr ./assets $INSTALLPATH
cd $INSTALLPATH/
echo " Setting Environment Variable JAGPATH "
export JAGPATH=$INSTALLPATH #export for the session the script is running so libraries install correctly
echo "export JAGPATH=/home/$USER/Jaguar" | tee -a $HOME/.bashrc #make environment variable persistent across sessions.
echo " Downloading RMAC/RLN Source From GIT Repositories "
cd $INSTALLPATH/src
git clone http://shamusworld.gotdns.org/git/rmac
git clone http://shamusworld.gotdns.org/git/rln
echo " Downloading jlibc/rmvlib Libraries From GIT Repositories "
git clone https://github.com/sbriais/jlibc.git
git clone https://github.com/sbriais/rmvlib.git
echo " Begin Building sources "
#modify and build rmac 2.0.0
echo " Building RMAC "
cd rmac
make
cp -vr rmac $INSTALLPATH/bin/mac #renaming to make more compatible with sebs makefiles
cd $INSTALLPATH/src
#patching and building rln
echo " Building RLN "
cd rln
make
cp -vr rln $INSTALLPATH/bin/aln #renaming to make more compatible with sebs makefiles
cd $INSTALLPATH/src
#modify and build jlibc
echo " Building JLIBC "
cd jlibc
make
make install
cd $INSTALLPATH/src
#modify and build rmvlib
echo " Building RMVLIB "
cd rmvlib
make
make install
cd $INSTALLPATH/src
#copy libgcc.a from m68k-mint-atari tools
echo " copy libgcc.a from m68k-mint-atari tools into lib folder "
cd $INSTALLPATH/lib/lib
find /usr/lib/gcc/m68k-atari-mint/ -type f -name "libgcc.a" -exec cp {} ./ \;
cd $INSTALLPATH
echo " copy example program "
mv -v ./assets/generic_example ./example_programs/
rm -rv ./assets
echo " DONE! "
echo " RESTART CYGWIN BEFORE BUILDING EXAMPLE PROGRAM! "
fi