Building Toolshed Project’s binaries for Windows on a Raspberry Pi

Yes that is right, you read the title correctly. In this post I am going to be building the Toolshed Project’s binaries targeted for Windows on a Raspberry Pi.

So the first thing I had to do was use apt-get to install the mingw packages I needed for building Windows 32bit binaries. So the command line option I had to enter is:
sudo apt-get install -y mingw32 mingw32-binutils mingw32-runtime

Now I need to install “git” and “mercurial” so I can download git or mercurial source code repos:
sudo apt-get install -y git mercurial

Now the next thing I am going to have to do is I need to create a “src” folder in my home folder. So I will issue the following command:
mkdir ~/src

Now I need to change to the directory so I can get ready to use mercurial to download the sources for Toolshed Project from the repo.
cd ~/src

So now that I have the “src” directory selected I can now start the download of the sources for the Toolshed Project. I do this with the following command:
hg clone toolshed-code

Once that is done I will change my active directory to toolshed-code with the following command:
cd toolshed-code

Now that is done. I can now build the project’s windows binaries. I did the following commands:
make -C build/unix clean
make -C build/unix -j4 CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib LD=i586-mingw32msvc-ld
make -C build/unix -j4 CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib LD=i586-mingw32msvc-ld package

Now depending on which version release of Toolshed the sources are set to the following might change:
cd build/unix

Now I can look through the directory listing. Now I look for a entry that starts with toolshed- and what did I find? I found toolshed-2.1 in my case. So I changed my active directory to toolshed-2.1 with the following command:
cd toolshed-2.1

Now I can get a directory listing using:

In my case I get the following listing:
cecb decb makewav mamou os9 tocgen

Well I found out that the binaries here did not have the standard .exe extension. So I decided to verify that these were indeed Windows binaries so I issued the following command and got in return:
$ file os9
os9: PE32 executable (console) Intel 80386, for MS Windows

So I was happy that indeed the binaries are Windows 32bit binaries. So now I need to rename these binaries to have the .exe extension on them with the follow:
mv cecb cecb.exe
mv decb decb.exe
mv makewav makewav.exe
mv mamou mamou.exe
mv os9 os9.exe
mv tocgen tocgen.exe

Ah now that step is done I need to zip these up so I can move it to my Windows system. Here is the command I used to zip up the files:
zip -9 *.exe

Ok now that is done. I can move the tip file to my Windows system. At this point I know how to do that and there are plenty of examples on the internet of transfering files between a Raspberry Pi and a Windows PC. So I think at this point there is no need for me to cover that in this post. Thank you for reading along in my adventure. Have a great day.

PS: I give credit to Tormod Volden for helping me getting started on this project.