Commit 7565c30b authored by Scott Duensing's avatar Scott Duensing

Beginning ST development.

parent 44712241
#!/bin/bash -e
#***TODO*** Move "installed" into SDKs folders
# Amiga
# https://github.com/bebbo/amiga-gcc
# 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
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"
ar x "${INSTALLED}/lib/libSDL2.a"
ar x "${INSTALLED}/lib/libSDL2_mixer.a"
......@@ -228,6 +226,9 @@ if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "stx" ]]; then
pushd "${BUILD}"
m68k-atari-mint-gcc -c "${SRC}/joey.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
popd
clearBuild
......
JOEY = /home/scott/joey
CONFIG += SDL12
#CONFIG += SDL2
TEMPLATE = app
CONFIG += console
CONFIG -= \
app_bundle \
qt
JOEY = /home/scott/joey
QMAKE_CFLAGS += \
-I$$PWD/src \
-D_REENTRANT
......@@ -16,34 +19,41 @@ HEADERS += \
SOURCES += \
src/joey.c \
src/jPC.c \
src/test.c
SDL12 {
SOURCES += src/jSDL12.c
LIBS += \
-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 \
-lSDL2 \
-lSDL2_mixer \
-lmodplug \
-Wl,--no-undefined \
-lm \
-ldl \
-lpthread \
-lrt
}
OTHER_FILES += \
src/jBlank.c \
src/jST.c \
src/jBlankcd ..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 = \
-L$$JOEY/SDL2/installed/linux/x64/lib \
-Wl,--enable-new-dtags \
-lSDL2 \
-lSDL2_mixer \
-lmodplug \
-Wl,--no-undefined \
-lm \
-ldl \
-lpthread \
-lrt
LIBS += \
$$SDL_LIBS
DISTFILES += \
joey.pri
joey.pri
......@@ -116,7 +116,7 @@ function buildPCDeps() {
hg clone http://hg.libsdl.org/SDL
fi
if [[ ! -e "${PREFIX}/lib/libSDL2.a" ]]; then
clearPCDepsBuild
clearDepsBuild
pushd build &> /dev/null
../SDL/configure \
--target="${CROSS}" \
......@@ -145,7 +145,7 @@ function buildPCDeps() {
popd &> /dev/null
fi
if [[ ! -e "${PREFIX}/lib/libmodplug.a" ]]; then
clearPCDepsBuild
clearDepsBuild
pushd build &> /dev/null
../libmodplug/configure \
--target="${CROSS}" \
......@@ -165,7 +165,7 @@ function buildPCDeps() {
hg clone http://hg.libsdl.org/SDL_mixer
fi
if [[ ! -e "${PREFIX}/lib/libSDL2_mixer.a" ]]; then
clearPCDepsBuild
clearDepsBuild
pushd build &> /dev/null
MODPLUG_CFLAGS="-I${PREFIX}/include -DMODPLUG_STATIC" \
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
rm -rf $(pwd)/build
fi
......@@ -573,6 +646,7 @@ function installLinux64() {
"x86_64-linux-gnu-gcc" \
"x86_64-linux-gnu-g++" \
""
buildSDL12 "x86_64-linux-gnu" "${JOEY}/sdks/linux/x64"
}
......@@ -680,7 +754,7 @@ function installST() {
popd &> /dev/null
fi
#***TODO*** SDL & Friends
buildSDL12 "m68k-atari-mint" "${ST}"
purple "Building JoeyLib"
"${G_PARENT}/joeylib/joeylib/build.sh" st &> /dev/null
......@@ -898,6 +972,7 @@ function start() {
sed \
tar \
texinfo \
unzip \
uuid-dev \
wget \
xcftools \
......@@ -936,6 +1011,7 @@ function start() {
echo ""
tBoldBox tBLUE "Downloading JoeyLib source..."
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
mainMenu
......@@ -954,6 +1030,7 @@ function start() {
G_PARENT=$(pwd)
G_SCRIPT=$(basename -- "$0")
# Set this in case we don't have a config file yet.
export JOEY=${G_PARENT}
# Is SUDO after us?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment