siliconsam / imp2022

IMP77 compiler for Linux
1 stars 0 forks source link

one-step install script #2

Open gtoal opened 10 months ago

gtoal commented 10 months ago

I've made a start at a script to do the initial build of imp77 from your repo. It works on my ubuntu - will undoubtedly need work for other flavours of unix. It does attempt to check that the tools your system uses are present. There may be some issues with gcc as you unconditionally add -m32 to most of the commands. This is OK on 64 bit systems where it is needed but on an older 32-bit linux the -m32 is not needed and is very likely to not be recognised. I do check for that at the start of the script but just exit if this is the case - the proper fix would be to alter the many instances where -m32 is used and replace it with $M32 which would be set to expand to nothing on systems where that option causes an error. Anyway I hope this is something you can build on as the compiler gets more user testing in different environments. I did try to keep it simple by, for example, using linux utilities that are normally pre-installed such as sed, rather than using programs such as ecce for editing text which would need to be compiled first. The main thing this script does is allow a user to install into a usr/local hierarchy in his own file area rather than the system-wide /usr/local, so that an unprivileged user can install it or so that a system admin can create an unprivileged user to test the imp77 compiler in relative safety. It'll also make it easier for us to install multiple versions of imp such as ABD's original, and your previous release along side this new release.

I thought I was going to be able to attach the script to this message but I can't see how, so here's a temporary link to a copy instead. build-linux.sh

G PS It's only a one-step install if it all works first time. If not there are more steps needed :-)

siliconsam commented 10 months ago

Good sugestion about use of $M32. Will amend my various makefiles to use it. In the interim, I'll set up my development environment to define $M32 as -m32 I'll test out the build-linux.sh script after I've fixed the bugs I'm hiding from you!!

gtoal commented 10 months ago

When you test it, fetch the current version. I fixed a mistake where I had created the patch file after patching so it picked up my directory name rather than ${RELEASEDIR}. And if you're changing a lot before you try it, watch out for changes that break the patches. Actually if you could make the "pass3elf" changes to the Makefile directly, and also the addition of -L to the LINK_OPT symbol, that would be quite a bit that could be removed from the install script. Ideally the install script just does the customisation of RELEASEDIR if needed before calling the items you describe in your README. By the way, the script hits several problems under WSL. I'm working on the right now.

gtoal commented 3 months ago

Similar script for current imp2022 repo contents at https://gtoal.com/imp2022/install-imp77 as discussed on our email forum,