Files
nethack/outdated/sys/unix/cross-amiga.sh
nhmall bb01c6378a last known Amiga cross-compile -> outdated
Place the last known Amiga cross-compile effort into the outdated folder
tree.

This shell script was meant to be run from the top of the NetHack tree:
    outdated/sys/unix/cross-amiga.sh
It attempts two things:
1. obtain the source-code for the Amiga cross compiler and build it
   from scratch. Warning: it pulls a number of the required packages
   from the internet and installs them. (Linux was tested, but the macOS
   usage never was).
2. move the outdated hints file and hints include files for Amiga
   into the live tree for someone attempting to resurrect an Amiga port.
   It doesn't tinker with any of the files needed for the NetHack-3.7
   work-in-progess for other platforms.

Once the shell script completes those things, the cross-compile build
steps would be:
  i) cd sys/unix ; sh setup.sh hints/cross-amiga ; cd ../..
 ii) make CROSS_TO_AMIGA=1 all
iii) make CROSS_TO_AMIGA=1 package
2022-02-01 16:43:39 -05:00

41 lines
1.2 KiB
Bash

#!/bin/sh
# outdated/sys/unix/cross-amiga.sh
set -x
cp outdated/sys/unix/hints/cross-amiga sys/unix/hints
cp outdated/sys/unix/hints/include/cross-amiga-post sys/unix/hints/include
cp outdated/sys/unix/hints/include/cross-amiga-pre sys/unix/hints/include
CROSSCOMPILER_REPO="https://github.com/bebbo/amiga-gcc"
if [ ! -d "/opt/amiga/bin" ]; then
export myname="$USER"
sudo mkdir -p /opt/amiga
sudo chown $myname /opt/amiga
mkdir -p lib
cd lib
git clone $CROSSCOMPILER_REPO
cd amiga-gcc
if [ "$(uname)" = "Darwin" ]; then
#Mac (git, Xcode and Homebrew assumed to already be installed)
platform=macOS
brew install bash wget make lhasa gmp mpfr libmpc flex gettext gnu-sed \
texinfo gcc@11 make autoconf
CC=gcc-11 CXX=g++-11 gmake all SHELL=$(brew --prefix)/bin/bash
special1=$(brew --prefix)/bin/bash
special=SHELL=$special1
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then
#Linux (git gcc, g++ assumed to already be installed)
platform=Linux
sudo apt install make wget git lhasa libgmp-dev libmpfr-dev \
libmpc-dev flex bison gettext texinfo ncurses-dev autoconf rsync
else
echo "No Amiga cross-compiler for you, sorry."
exit 1
fi
make clean
make clean-prefix
make all
cd ../..
fi