Working on Windows and IIgs build systems.
This commit is contained in:
parent
d5a480cafe
commit
991bf65af6
4 changed files with 394 additions and 93 deletions
185
buildPCDeps.sh
Executable file
185
buildPCDeps.sh
Executable file
|
@ -0,0 +1,185 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
function clearBuild() {
|
||||
if [ -d ${JOEY}/SDL2/build ]; then
|
||||
rm -rf ${JOEY}/SDL2/build
|
||||
fi
|
||||
mkdir -p ${JOEY}/SDL2/build
|
||||
}
|
||||
|
||||
|
||||
function clearInstalled() {
|
||||
if [ -d ${JOEY}/SDL2/installed ]; then
|
||||
rm -rf ${JOEY}/SDL2/installed
|
||||
fi
|
||||
mkdir -p ${JOEY}/SDL2/installed
|
||||
}
|
||||
|
||||
|
||||
function checkFiles() {
|
||||
if [ ! -d SDL ]; then
|
||||
hg clone http://hg.libsdl.org/SDL
|
||||
cd SDL
|
||||
#hg up release-2.0.9
|
||||
cd ..
|
||||
fi
|
||||
if [ ! -d libmodplug ]; then
|
||||
git clone https://github.com/Konstanty/libmodplug.git
|
||||
cd libmodplug
|
||||
libtoolize --force
|
||||
aclocal
|
||||
autoheader
|
||||
automake --force-missing --add-missing
|
||||
autoconf
|
||||
cd ..
|
||||
fi
|
||||
if [ ! -d SDL_mixer ]; then
|
||||
hg clone http://hg.libsdl.org/SDL_mixer
|
||||
cd SDL_mixer
|
||||
#hg up release-2.0.4
|
||||
cd ..
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function doBuild() {
|
||||
clearBuild
|
||||
cd build
|
||||
../SDL/configure \
|
||||
--target="${CROSS}" \
|
||||
--host="${CROSS}" \
|
||||
--build=x86_64-linux \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--prefix=${PREFIX}
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
clearBuild
|
||||
cd build
|
||||
../libmodplug/configure \
|
||||
--target="${CROSS}" \
|
||||
--host="${CROSS}" \
|
||||
--build=x86_64-linux \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--prefix=${PREFIX}
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
clearBuild
|
||||
cd build
|
||||
MODPLUG_CFLAGS="-I${PREFIX}/include -DMODPLUG_STATIC" \
|
||||
MODPLUG_LIBS="-L${PREFIX}/lib -lmodplug -lstdc++ -lm" \
|
||||
../SDL_mixer/configure \
|
||||
--target="${CROSS}" \
|
||||
--host="${CROSS}" \
|
||||
--build=x86_64-linux \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--prefix=${PREFIX} \
|
||||
--with-sdl-prefix=${PREFIX} \
|
||||
--disable-music-cmd \
|
||||
--disable-music-wave \
|
||||
--enable-music-mod-modplug \
|
||||
--disable-music-mod-modplug-shared \
|
||||
--disable-music-mod-mikmod \
|
||||
--disable-music-midi \
|
||||
--disable-music-ogg \
|
||||
--disable-music-flac \
|
||||
--disable-music-opus \
|
||||
--disable-music-mp3 \
|
||||
--disable-music-mp3-mpg123
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
}
|
||||
|
||||
|
||||
ARCH=$1
|
||||
|
||||
if [ "${ARCH}x" == "x" ]; then
|
||||
echo "$0 [arch | \"all\"] | [reset]"
|
||||
echo '(Where "arch" is linux32, linux64, windows32, windows64, macos32, or macos64.)'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
mkdir -p ${JOEY}/SDL2
|
||||
pushd ${JOEY}/SDL2
|
||||
|
||||
checkFiles
|
||||
|
||||
if [ "${ARCH}x" == "resetx" ]; then
|
||||
clearInstalled
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux64x" ]; then
|
||||
TARGET=${JOEY}/joeylib/joeylib/lib/linux/x64
|
||||
PREFIX=${JOEY}/SDL2/installed/linux/x64
|
||||
CROSS=x86_64-linux-gnu
|
||||
export CC="${CROSS}-gcc"
|
||||
export CXX="${CROSS}-g++"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux32x" ]; then
|
||||
TARGET=${JOEY}/joeylib/joeylib/lib/linux/x86
|
||||
PREFIX=${JOEY}/SDL2/installed/linux/x86
|
||||
CROSS=x86_64-linux-gnu
|
||||
export CC="${CROSS}-gcc -m32"
|
||||
export CXX="${CROSS}-g++ -m32"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows64x" ]; then
|
||||
TARGET=${JOEY}/joeylib/joeylib/lib/windows/x64
|
||||
PREFIX=${JOEY}/SDL2/installed/windows/x64
|
||||
CROSS=x86_64-w64-mingw32
|
||||
export CC="${CROSS}-gcc -static-libgcc"
|
||||
export CXX="${CROSS}-g++ -static-libstdc++"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows32x" ]; then
|
||||
TARGET=${JOEY}/joeylib/joeylib/lib/windows/x86
|
||||
PREFIX=${JOEY}/SDL2/installed/windows/x86
|
||||
CROSS=i686-w64-mingw32
|
||||
export CC="${CROSS}-gcc -static-libgcc"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos64x" ]; then
|
||||
TARGET=${JOEY}/joeylib/joeylib/lib/macos/x64
|
||||
PREFIX=${JOEY}/SDL2/installed/macos/x64
|
||||
CROSS=x86_64-apple-darwin15
|
||||
export CC="o64-clang"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos32x" ]; then
|
||||
TARGET=${JOEY}/joeylib/joeylib/lib/macos/x86
|
||||
PREFIX=${JOEY}/SDL2/installed/macos/x86
|
||||
CROSS=i386-apple-darwin15
|
||||
export CC="o32-clang"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
#if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "raspbian" ]; then
|
||||
#***FIX***
|
||||
#TARGET=${JOEY}/joeylib/joeylib/pi/raspbian
|
||||
#PREFIX=${JOEY}/SDL2/installed/pi/raspbian
|
||||
#CROSS=arm-linux-gnueabihf
|
||||
#export CC="${CROSS}-gcc -static-libgcc --sysroot=${JOEY}/sdks/pi/raspbian -I${PREFIX}/include -L${PREFIX}/lib"
|
||||
#doBuild
|
||||
#fi
|
||||
|
||||
export CXX=""
|
||||
export CC=""
|
||||
rm -rf build
|
||||
popd
|
||||
set +x
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
# --- HERE BE DRAGONS ---
|
||||
|
||||
function buildIIgs() {
|
||||
TARGET=${JOEY}/sdks/iix/IIgs/out/${PROJECT}
|
||||
GSTARGET=31:/out/${PROJECT}
|
||||
CADIUS=${JOEY}/sdks/iix/cadius-git/bin/release/cadius
|
||||
|
@ -50,8 +51,6 @@ iix -DKeepType=S16 link +L ${OFILES} keep=${GSTARGET}/${PROJECT}#b30000 > ${PROJ
|
|||
iix dumpobj +D ${GSTARGET}/${PROJECT}#b30000 &> ${PROJECT}.dis || true
|
||||
echo ${OFILES} > ${PROJECT}.lnk
|
||||
|
||||
# Did they ask for GSPlus to be executed?
|
||||
if [ ! -z $1 ]; then
|
||||
# Be sure our work directories exists
|
||||
mkdir -p ${WORK}/{data,source}
|
||||
|
||||
|
@ -75,6 +74,11 @@ if [ ! -z $1 ]; then
|
|||
done
|
||||
done
|
||||
|
||||
mkdir -p ${JOEY}/builds/${PROJECT}/IIgs/
|
||||
cp ${IMPORT} ${JOEY}/builds/${PROJECT}/IIgs/${PROJECT}.po
|
||||
|
||||
# Did they ask for GSPlus to be executed?
|
||||
if [ ! -z $1 ]; then
|
||||
# Launch GSPlus
|
||||
pushd ${JOEY}/sdks/iix/gsplus
|
||||
./gsplus -resizeable -config IIgsTest.cfg || true
|
||||
|
@ -88,3 +92,4 @@ if [ ! -z $1 ]; then
|
|||
echo ""
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
91
joeylib/build-PC.helper.sh
Normal file
91
joeylib/build-PC.helper.sh
Normal file
|
@ -0,0 +1,91 @@
|
|||
# --- HERE BE DRAGONS ---
|
||||
|
||||
TARGET=${JOEY}/builds/${PROJECT}
|
||||
WORK=/tmp/PC
|
||||
|
||||
|
||||
function doPCBuild() {
|
||||
|
||||
local OSNAME=$1
|
||||
local OSARCH=$2
|
||||
|
||||
local DEST=${TARGET}/${OSNAME}/${OSARCH}
|
||||
local G_CFLAGS="-Wall -D_REENTRANT_ -I${JOEY}/dist"
|
||||
|
||||
# Clean up target and working directories
|
||||
if [ -d ${DEST} ]; then
|
||||
rm -rf ${DEST}
|
||||
fi
|
||||
mkdir -p ${DEST}
|
||||
if [ -d ${WORK} ]; then
|
||||
rm -rf ${WORK}
|
||||
fi
|
||||
mkdir -p ${WORK}
|
||||
|
||||
# Make a list of files to compile, iterate over them
|
||||
CFILES=($(ls -1 *.c))
|
||||
OFILES=""
|
||||
for F in "${CFILES[@]}"; do
|
||||
O=${F%.*}
|
||||
OFILES="${OFILES} ${WORK}/${O}.o"
|
||||
echo "Compiling ${F}..."
|
||||
${CC} ${CFLAGS} ${G_CFLAGS} -c ${F} -o ${WORK}/${O}.o
|
||||
done
|
||||
|
||||
# Link source & JoeyLib
|
||||
${CC} -o ${DEST}/${PROJECT} ${OFILES} ${JOEY}/dist/${OSNAME}/${OSARCH}/libjoeylib.a -lstdc++ ${LDFLAGS}
|
||||
|
||||
# Copy game data
|
||||
mkdir -p ${DEST}/data
|
||||
for F in "${DATA[@]}"; do
|
||||
cp -f ${F} ${DEST}/data/.
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function buildLinux32() {
|
||||
CC="gcc"
|
||||
CFLAGS="-m32"
|
||||
LDFLAGS=""
|
||||
doPCBuild linux x86
|
||||
}
|
||||
|
||||
|
||||
function buildLinux64() {
|
||||
CC="gcc"
|
||||
CFLAGS=""
|
||||
LDFLAGS="-lm -lpthread -ldl"
|
||||
doPCBuild linux x64
|
||||
}
|
||||
|
||||
|
||||
function buildWindows32() {
|
||||
CC="i686-w64-mingw32-gcc"
|
||||
CFLAGS=""
|
||||
LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi"
|
||||
doPCBuild windows x86
|
||||
}
|
||||
|
||||
|
||||
function buildWindows64() {
|
||||
CC="x86_64-w64-mingw32-gcc"
|
||||
CFLAGS=""
|
||||
LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi"
|
||||
doPCBuild windows x64
|
||||
}
|
||||
|
||||
|
||||
function buildmacOS32() {
|
||||
CC="o32-clang"
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
doPCBuild macos x86
|
||||
}
|
||||
|
||||
|
||||
function buildmacOS64() {
|
||||
CC="o64-clang"
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
doPCBuild macos x64
|
||||
}
|
|
@ -35,47 +35,67 @@ function doBuild() {
|
|||
fi
|
||||
}
|
||||
|
||||
ARCH=$1
|
||||
|
||||
if [ "${ARCH}x" == "x" ]; then
|
||||
echo "$0 [arch | \"all\"]"
|
||||
echo '(Where "arch" is linux32, linux64, windows32, windows64, macos32, or macos64.)'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux64x" ]; then
|
||||
CC="gcc"
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
DIST="${JOEY}/dist/linux/x64"
|
||||
INSTALLED="${JOEY}/SDL2/installed/linux/x64/lib"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux32x" ]; then
|
||||
CC="gcc"
|
||||
CFLAGS="-m32"
|
||||
LDFLAGS=""
|
||||
DIST="${JOEY}/dist/linux/x86"
|
||||
INSTALLED="${JOEY}/SDL2/installed/linux/x86/lib"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows64x" ]; then
|
||||
CC="x86_64-w64-mingw32-gcc"
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
DIST="${JOEY}/dist/windows/x64"
|
||||
INSTALLED="${JOEY}/SDL2/installed/windows/x64/lib"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows32x" ]; then
|
||||
CC="i686-w64-mingw32-gcc"
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
DIST="${JOEY}/dist/windows/x86"
|
||||
INSTALLED="${JOEY}/SDL2/installed/windows/x86/lib"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos32x" ]; then
|
||||
CC="o32-clang"
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
DIST="${JOEY}/dist/macos/x86"
|
||||
INSTALLED="${JOEY}/SDL2/installed/macos/x86/lib"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos64x" ]; then
|
||||
CC="o64-clang"
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
DIST="${JOEY}/dist/macos/x64"
|
||||
INSTALLED="${JOEY}/SDL2/installed/macos/x64/lib"
|
||||
doBuild
|
||||
fi
|
||||
|
||||
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
|
||||
cp -f ${JOEY}/joeylib/joeylib/joey.pri ${JOEY}/dist/.
|
||||
|
|
Loading…
Add table
Reference in a new issue