Beginning ST development.

This commit is contained in:
Scott Duensing 2019-10-24 20:13:45 -05:00
parent 44712241fb
commit 7565c30b2a
5 changed files with 122 additions and 34 deletions

View file

@ -1,7 +1,5 @@
#!/bin/bash -e #!/bin/bash -e
#***TODO*** Move "installed" into SDKs folders
# Amiga # Amiga
# https://github.com/bebbo/amiga-gcc # https://github.com/bebbo/amiga-gcc
# m68k-amigaos-gcc -idirafter /home/scott/joey/sdks/amiga/m68k-amigaos/sys-include/machine -c ../src/joey.c # m68k-amigaos-gcc -idirafter /home/scott/joey/sdks/amiga/m68k-amigaos/sys-include/machine -c ../src/joey.c
@ -137,7 +135,7 @@ function doPCBuild() {
createBuildAndDist createBuildAndDist
pushd "${BUILD}" pushd "${BUILD}"
"${CC}" ${CFLAGS} ${G_CFLAGS} -o jPC.o "${SRC}/jPC.c" "${CC}" ${CFLAGS} ${G_CFLAGS} -o jSDL2.o "${SRC}/jSDL2.c"
"${CC}" ${CFLAGS} ${G_CFLAGS} -o joey.o "${SRC}/joey.c" "${CC}" ${CFLAGS} ${G_CFLAGS} -o joey.o "${SRC}/joey.c"
ar x "${INSTALLED}/lib/libSDL2.a" ar x "${INSTALLED}/lib/libSDL2.a"
ar x "${INSTALLED}/lib/libSDL2_mixer.a" ar x "${INSTALLED}/lib/libSDL2_mixer.a"
@ -228,6 +226,9 @@ if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "stx" ]]; then
pushd "${BUILD}" pushd "${BUILD}"
m68k-atari-mint-gcc -c "${SRC}/joey.c" m68k-atari-mint-gcc -c "${SRC}/joey.c"
m68k-atari-mint-gcc -c "${SRC}/jST.c" m68k-atari-mint-gcc -c "${SRC}/jST.c"
m68k-atari-mint-ar x "${DEPS}/st/lib/libSDL.a"
m68k-atari-mint-ar x "${DEPS}/st/lib/libSDL_mixer.a"
m68k-atari-mint-ar x "${DEPS}/st/lib/libmikmod.a"
m68k-atari-mint-ar rcs "${DIST}/libjoeylib.a" *.o m68k-atari-mint-ar rcs "${DIST}/libjoeylib.a" *.o
popd popd
clearBuild clearBuild

View file

@ -1,11 +1,14 @@
JOEY = /home/scott/joey
CONFIG += SDL12
#CONFIG += SDL2
TEMPLATE = app TEMPLATE = app
CONFIG += console CONFIG += console
CONFIG -= \ CONFIG -= \
app_bundle \ app_bundle \
qt qt
JOEY = /home/scott/joey
QMAKE_CFLAGS += \ QMAKE_CFLAGS += \
-I$$PWD/src \ -I$$PWD/src \
-D_REENTRANT -D_REENTRANT
@ -16,22 +19,26 @@ HEADERS += \
SOURCES += \ SOURCES += \
src/joey.c \ src/joey.c \
src/jPC.c \
src/test.c src/test.c
OTHER_FILES += \ SDL12 {
src/jBlank.c \ SOURCES += src/jSDL12.c
src/jST.c \
src/jAmiga.c \
src/jIIgs.c \
src/jIIgs.asm \
src/jIIgs.macro \
build-IIgs.sh \
build-IIgs.helper.sh \
build-PC.sh
SDL_LIBS = \ LIBS += \
-L$$JOEY/SDL2/installed/linux/x64/lib \ -L$$JOEY/sdks/linux/x64/lib \
-lSDL \
-lSDL_mixer \
-lmikmod \
-lm \
-ldl \
-lsndio
}
SDL2 {
SOURCES += src/jSDL2.c
LIBS += \
-L$$JOEY/sdks/linux/x64/lib \
-Wl,--enable-new-dtags \ -Wl,--enable-new-dtags \
-lSDL2 \ -lSDL2 \
-lSDL2_mixer \ -lSDL2_mixer \
@ -41,9 +48,12 @@ SDL_LIBS = \
-ldl \ -ldl \
-lpthread \ -lpthread \
-lrt -lrt
}
LIBS += \ OTHER_FILES += \
$$SDL_LIBS src/jBlankcd ..c \
src/jAmiga.c \
DISTFILES += \ src/jIIgs.c \
src/jIIgs.asm \
src/jIIgs.macro \
joey.pri joey.pri

View file

@ -116,7 +116,7 @@ function buildPCDeps() {
hg clone http://hg.libsdl.org/SDL hg clone http://hg.libsdl.org/SDL
fi fi
if [[ ! -e "${PREFIX}/lib/libSDL2.a" ]]; then if [[ ! -e "${PREFIX}/lib/libSDL2.a" ]]; then
clearPCDepsBuild clearDepsBuild
pushd build &> /dev/null pushd build &> /dev/null
../SDL/configure \ ../SDL/configure \
--target="${CROSS}" \ --target="${CROSS}" \
@ -145,7 +145,7 @@ function buildPCDeps() {
popd &> /dev/null popd &> /dev/null
fi fi
if [[ ! -e "${PREFIX}/lib/libmodplug.a" ]]; then if [[ ! -e "${PREFIX}/lib/libmodplug.a" ]]; then
clearPCDepsBuild clearDepsBuild
pushd build &> /dev/null pushd build &> /dev/null
../libmodplug/configure \ ../libmodplug/configure \
--target="${CROSS}" \ --target="${CROSS}" \
@ -165,7 +165,7 @@ function buildPCDeps() {
hg clone http://hg.libsdl.org/SDL_mixer hg clone http://hg.libsdl.org/SDL_mixer
fi fi
if [[ ! -e "${PREFIX}/lib/libSDL2_mixer.a" ]]; then if [[ ! -e "${PREFIX}/lib/libSDL2_mixer.a" ]]; then
clearPCDepsBuild clearDepsBuild
pushd build &> /dev/null pushd build &> /dev/null
MODPLUG_CFLAGS="-I${PREFIX}/include -DMODPLUG_STATIC" \ MODPLUG_CFLAGS="-I${PREFIX}/include -DMODPLUG_STATIC" \
MODPLUG_LIBS="-L${PREFIX}/lib -lmodplug -lstdc++ -lm" \ MODPLUG_LIBS="-L${PREFIX}/lib -lmodplug -lstdc++ -lm" \
@ -204,7 +204,80 @@ function buildPCDeps() {
} }
function clearPCDepsBuild() { function buildSDL12() {
local CROSS=$1
local PREFIX=$2
mkdir -p deps
pushd deps &> /dev/null
purple "Building SDL"
if [[ ! -d SDL-1.2 ]]; then
hg clone http://hg.libsdl.org/SDL SDL-1.2 -r SDL-1.2
fi
if [[ ! -e "${PREFIX}/lib/libSDL.a" ]]; then
clearDepsBuild
pushd build &> /dev/null
CC="${CROSS}-gcc" \
../SDL-1.2/configure \
--target="${CROSS}" \
--host="${CROSS}" \
--build=x86_64-linux \
--enable-static \
--disable-shared \
--disable-threads \
--disable-video-opengl \
--prefix="${PREFIX}"
make
make install
popd &> /dev/null # build
fi
purple "Building SDL_mixer and libMikMod"
if [[ ! -d SDL_mixer-1.2 ]]; then
hg clone http://hg.libsdl.org/SDL_mixer SDL_mixer-1.2 -r SDL-1.2
fi
if [[ ! -e "${PREFIX}/lib/libmikmod.a" ]]; then
clearDepsBuild
pushd build &> /dev/null
unzip ../SDL_mixer-1.2/libmikmod-*.zip
mv libmikmod-* libmikmod
CC="${CROSS}-gcc" \
libmikmod/configure \
--target="${CROSS}" \
--host="${CROSS}" \
--build=x86_64-linux \
--enable-static \
--disable-shared \
--prefix="${PREFIX}"
make
make install
popd &> /dev/null # build
fi
if [[ ! -e "${PREFIX}/lib/libSDL_mixer.a" ]]; then
clearDepsBuild
pushd build &> /dev/null
SDL_CONFIG="${PREFIX}/bin/sdl-config" \
LIBMIKMOD_CONFIG="${PREFIX}/bin/libmikmod-config" \
CC="${CROSS}-gcc" \
../SDL_mixer-1.2/configure \
--target="${CROSS}" \
--host="${CROSS}" \
--build=x86_64-linux \
--enable-static \
--disable-shared \
--disable-music-midi \
--enable-music-mod \
--disable-music-mod-shared \
--prefix="${PREFIX}"
make
make install
popd &> /dev/null # build
fi
}
function clearDepsBuild() {
if [[ -d $(pwd)/build ]]; then if [[ -d $(pwd)/build ]]; then
rm -rf $(pwd)/build rm -rf $(pwd)/build
fi fi
@ -573,6 +646,7 @@ function installLinux64() {
"x86_64-linux-gnu-gcc" \ "x86_64-linux-gnu-gcc" \
"x86_64-linux-gnu-g++" \ "x86_64-linux-gnu-g++" \
"" ""
buildSDL12 "x86_64-linux-gnu" "${JOEY}/sdks/linux/x64"
} }
@ -680,7 +754,7 @@ function installST() {
popd &> /dev/null popd &> /dev/null
fi fi
#***TODO*** SDL & Friends buildSDL12 "m68k-atari-mint" "${ST}"
purple "Building JoeyLib" purple "Building JoeyLib"
"${G_PARENT}/joeylib/joeylib/build.sh" st &> /dev/null "${G_PARENT}/joeylib/joeylib/build.sh" st &> /dev/null
@ -898,6 +972,7 @@ function start() {
sed \ sed \
tar \ tar \
texinfo \ texinfo \
unzip \
uuid-dev \ uuid-dev \
wget \ wget \
xcftools \ xcftools \
@ -936,6 +1011,7 @@ function start() {
echo "" echo ""
tBoldBox tBLUE "Downloading JoeyLib source..." tBoldBox tBLUE "Downloading JoeyLib source..."
git clone https://skunkworks.kangaroopunch.com/skunkworks/joeylib.git ${G_PARENT}/joeylib &> /dev/null git clone https://skunkworks.kangaroopunch.com/skunkworks/joeylib.git ${G_PARENT}/joeylib &> /dev/null
#***TODO*** Swap the manually downloaded install script for the one in the archive with a symlink.
fi fi
mainMenu mainMenu
@ -954,6 +1030,7 @@ function start() {
G_PARENT=$(pwd) G_PARENT=$(pwd)
G_SCRIPT=$(basename -- "$0") G_SCRIPT=$(basename -- "$0")
# Set this in case we don't have a config file yet.
export JOEY=${G_PARENT} export JOEY=${G_PARENT}
# Is SUDO after us? # Is SUDO after us?