Build server builds non-debug versions of JoeyLib and apps.
This commit is contained in:
parent
862bfc5f71
commit
99b1ac8e6d
4 changed files with 104 additions and 31 deletions
|
@ -151,6 +151,9 @@ void jlDrawSurfaceSet(jlSurfaceT target) {
|
|||
jbool _jlImgCreate(jlImgT **img, jint16 line, char *file) {
|
||||
jlImgT *t = NULL;
|
||||
|
||||
(void)line;
|
||||
(void)file;
|
||||
|
||||
// Are we loading into a new image?
|
||||
if (*img == NULL) {
|
||||
t = (jlImgT *)jlMallocEx(sizeof(jlImgT), line, file);
|
||||
|
|
|
@ -639,6 +639,10 @@ jbool jlGameGetButton(jbyte which) {
|
|||
#ifndef JL_HAS_IMGCOPY
|
||||
jbool _jlImgCopy(jlImgT **target, jlImgT *source, jint16 line, char *file) {
|
||||
jlImgT *t = NULL;
|
||||
|
||||
(void)line;
|
||||
(void)file;
|
||||
|
||||
// Are we copying into a new image?
|
||||
if (*target == NULL) {
|
||||
t = (jlImgT *)jlMallocEx(sizeof(jlImgT), line, file);
|
||||
|
@ -685,6 +689,9 @@ jbool _jlImgLoad(jlImgT **img, char *filename, jint16 line, char *file) {
|
|||
jlImgT *s = NULL;
|
||||
FILE *f = NULL;
|
||||
|
||||
(void)line;
|
||||
(void)file;
|
||||
|
||||
// Are we loading into a new image?
|
||||
if (*img == NULL) {
|
||||
s = (jlImgT *)jlMallocEx(sizeof(jlImgT), line, file);
|
||||
|
@ -915,6 +922,9 @@ jbool _jlStnLoad(jlStnT **stn, char *filename, jint16 line, char *file) {
|
|||
jlStnT *s = NULL;
|
||||
FILE *f = NULL;
|
||||
|
||||
(void)line;
|
||||
(void)file;
|
||||
|
||||
// Are we loading into a new stencil?
|
||||
if (*stn == NULL) {
|
||||
s = (jlStnT *)jlMallocEx(sizeof(jlStnT), line, file);
|
||||
|
@ -943,10 +953,12 @@ jbool _jlStnLoad(jlStnT **stn, char *filename, jint16 line, char *file) {
|
|||
#ifndef JL_HAS_UTILDIE
|
||||
__attribute__((__format__ (__printf__, 1, 0)))
|
||||
void jlUtilDie(const char *why, ...) {
|
||||
jint16 i;
|
||||
char msg[2048];
|
||||
va_list va;
|
||||
static jbool alreadyDead = jfalse;
|
||||
#ifdef JOEY_DEBUG
|
||||
jint16 i;
|
||||
#endif
|
||||
|
||||
if (!alreadyDead) {
|
||||
alreadyDead = jtrue;
|
||||
|
@ -955,6 +967,7 @@ void jlUtilDie(const char *why, ...) {
|
|||
vsprintf(msg, why, va);
|
||||
va_end(va);
|
||||
|
||||
#ifdef JOEY_DEBUG
|
||||
jlUtilSay("JoeyLib Statistics");
|
||||
jlUtilSay("");
|
||||
jlUtilSay(" Allocations: %ld", _jlTotalAllocations);
|
||||
|
@ -969,6 +982,8 @@ void jlUtilDie(const char *why, ...) {
|
|||
}
|
||||
}
|
||||
jlUtilSay("");
|
||||
#endif
|
||||
|
||||
jlUtilSay("%s", msg);
|
||||
|
||||
#ifndef JL_HAS_UTILMUSTEXIT
|
||||
|
@ -1240,6 +1255,10 @@ void *_jlUtilStackPop(jlStackT **stack) {
|
|||
#ifndef JL_HAS_UTILSTACKPUSH
|
||||
void _jlUtilStackPush(jlStackT **stack, void *data, jint16 line, char *file) {
|
||||
jlStackT *s = NULL;
|
||||
|
||||
(void)line;
|
||||
(void)file;
|
||||
|
||||
s = (jlStackT *)jlMallocEx(sizeof(jlStackT), line, file);
|
||||
s->previous = *stack;
|
||||
s->data = data;
|
||||
|
@ -1408,6 +1427,9 @@ jbool _jlVecLoad(jlVecT **vec, char *filename, jint16 line, char *file) {
|
|||
FILE *f = NULL;
|
||||
long size;
|
||||
|
||||
(void)line;
|
||||
(void)file;
|
||||
|
||||
// Are we loading into a new image?
|
||||
if (*vec != NULL) {
|
||||
jlVecFree(*vec);
|
||||
|
|
|
@ -28,7 +28,9 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
|
||||
#define JOEY_DEBUG
|
||||
#ifndef BUILD_SERVER
|
||||
//#define JOEY_DEBUG
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -397,8 +399,9 @@ void *_jlRealloc(void *pointer, size_t size);
|
|||
|
||||
#else
|
||||
|
||||
#define jlFree(p) free(p); p = 0
|
||||
#define jlMalloc malloc
|
||||
#define jlFree(p) free(p); p = 0
|
||||
#define jlMalloc malloc
|
||||
#define jlMallocEx(s, l, f) malloc(s)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -22,13 +22,28 @@
|
|||
#
|
||||
|
||||
|
||||
SRC=${HOME}/joeylib/joeylib/src
|
||||
IIGS=${HOME}/cross/gsos-wdc-orca
|
||||
NAME=
|
||||
ARCH=
|
||||
BACKEND=
|
||||
INSTALLED=
|
||||
TRIPLE=
|
||||
BUILD_PROJECT=
|
||||
BUILD_PLATFORMS=
|
||||
BUILD_RESULTS=
|
||||
|
||||
EHOME=$(getent passwd $(logname) | cut -d: -f6)
|
||||
SRC=${EHOME}/joeylib/joeylib/src
|
||||
IIGS=${EHOME}/cross/gsos-wdc-orca
|
||||
CADIUS=${IIGS}/cadius/cadius
|
||||
SDL2_OLD=25f9ed87ff6947d9576fc9d79dee0784e638ac58
|
||||
SDL2_NEW=97a5e744497ff7cc93edc5119d67cad3ee86dd57
|
||||
OLD_PATH=${PATH}
|
||||
|
||||
export CC=
|
||||
export AR=
|
||||
export CFLAGS=
|
||||
export LD_LIBRARY_PATH=
|
||||
|
||||
export GOLDEN_GATE=${IIGS}/ORCA
|
||||
|
||||
|
||||
|
@ -186,8 +201,7 @@ function buildIIgsSDK() {
|
|||
|
||||
function buildJoeyLib() {
|
||||
local OUT=
|
||||
|
||||
OLD_CFLAGS=${CFLAGS}
|
||||
local OLD_CFLAGS=${CFLAGS}
|
||||
|
||||
if [[ ! -d joeylib ]]; then
|
||||
git clone https://skunkworks.kangaroopunch.com/skunkworks/joeylib.git
|
||||
|
@ -216,7 +230,7 @@ function buildJoeyLib() {
|
|||
;;
|
||||
|
||||
SDL2)
|
||||
export CFLAGS="${CFLAGS} -Wall -D_REENTRANT_ -I${SRC} -I${INSTALLED}/include -c"
|
||||
export CFLAGS="${CFLAGS} -DBUILD_SERVER -Wall -D_REENTRANT_ -I${SRC} -I${INSTALLED}/include -c"
|
||||
${CC} ${CFLAGS} -o jPixBuf.o ${SRC}/jPixBuf.c
|
||||
${CC} ${CFLAGS} -o jSDL2.o ${SRC}/jSDL2.c
|
||||
${CC} ${CFLAGS} -o joey.o ${SRC}/joey.c
|
||||
|
@ -238,7 +252,7 @@ function buildJoeyLib() {
|
|||
|
||||
function buildMacOSSDK() {
|
||||
local SDK=$1
|
||||
local NAME=$2
|
||||
local PLATFORM=$2
|
||||
|
||||
if [[ ! -d osxcross ]]; then
|
||||
git clone https://skunkworks.kangaroopunch.com/mirrors/osxcross.git
|
||||
|
@ -248,9 +262,9 @@ function buildMacOSSDK() {
|
|||
cp -f ../"${SDK}" tarballs/.
|
||||
UNATTENDED=1 ./build.sh
|
||||
sudo ENABLE_COMPILER_RT_INSTALL=1 ./build_compiler_rt.sh
|
||||
mkdir -p ../cross/${NAME}
|
||||
mv -f target/* ../cross/${NAME}
|
||||
sudo mv -f /usr/lib/llvm-10/lib/clang/10.0.0/lib/darwin ../cross/${NAME}/.
|
||||
mkdir -p ../cross/${PLATFORM}
|
||||
mv -f target/* ../cross/${PLATFORM}
|
||||
sudo mv -f /usr/lib/llvm-10/lib/clang/10.0.0/lib/darwin ../cross/${PLATFORM}/.
|
||||
./cleanup.sh
|
||||
popd
|
||||
}
|
||||
|
@ -312,7 +326,7 @@ function delBuildUser() {
|
|||
|
||||
function doBuild() {
|
||||
local DIST=$1
|
||||
local SRC=$2
|
||||
local SOURCE=$2
|
||||
local LINE=
|
||||
local DATA=()
|
||||
local CFILES=()
|
||||
|
@ -325,8 +339,10 @@ function doBuild() {
|
|||
local LIB=
|
||||
local O=
|
||||
local DISK=
|
||||
local EXT=
|
||||
local OLD_CFLAGS=${CFLAGS}
|
||||
|
||||
pushd "${SRC}"
|
||||
pushd "${SOURCE}"
|
||||
|
||||
# Are there old reults to clean up?
|
||||
if [[ -f build.finished ]]; then
|
||||
|
@ -336,7 +352,7 @@ function doBuild() {
|
|||
rm -rf results
|
||||
fi
|
||||
mkdir -p results
|
||||
BUILD_RESULTS=${SRC}/results
|
||||
BUILD_RESULTS=${SOURCE}/results
|
||||
|
||||
# Read project information.
|
||||
BUILD_PLATFORMS="["
|
||||
|
@ -362,41 +378,49 @@ function doBuild() {
|
|||
setCompiler gsos 816
|
||||
TARGET="${GOLDEN_GATE}/out/build"
|
||||
GSTARGET="31:/out/build"
|
||||
EXT=
|
||||
;;
|
||||
|
||||
linux32)
|
||||
setCompiler linux i386
|
||||
TARGET="${SRC}/temp"
|
||||
TARGET="${SOURCE}/temp"
|
||||
EXT=
|
||||
;;
|
||||
|
||||
linux64)
|
||||
setCompiler linux x86_64
|
||||
TARGET="${SRC}/temp"
|
||||
TARGET="${SOURCE}/temp"
|
||||
EXT=
|
||||
;;
|
||||
|
||||
macosx32)
|
||||
setCompiler macos i386
|
||||
TARGET="${SRC}/temp"
|
||||
TARGET="${SOURCE}/temp"
|
||||
EXT=
|
||||
;;
|
||||
|
||||
macosx64)
|
||||
setCompiler macos x86_64
|
||||
TARGET="${SRC}/temp"
|
||||
TARGET="${SOURCE}/temp"
|
||||
EXT=
|
||||
;;
|
||||
|
||||
macosa64)
|
||||
setCompiler macos arm
|
||||
TARGET="${SRC}/temp"
|
||||
TARGET="${SOURCE}/temp"
|
||||
EXT=
|
||||
;;
|
||||
|
||||
win32)
|
||||
setCompiler windows i386
|
||||
TARGET="${SRC}/temp"
|
||||
TARGET="${SOURCE}/temp"
|
||||
EXT=.exe
|
||||
;;
|
||||
|
||||
win64)
|
||||
setCompiler windows x86_64
|
||||
TARGET="${SRC}/temp"
|
||||
TARGET="${SOURCE}/temp"
|
||||
EXT=.exe
|
||||
;;
|
||||
|
||||
esac
|
||||
|
@ -406,12 +430,15 @@ function doBuild() {
|
|||
|
||||
[[ -d "${TARGET}" ]] && rm -rf "${TARGET}"
|
||||
mkdir -p "${TARGET}"
|
||||
|
||||
mkdir -p ${BUILD_RESULTS}/${LINE,,}
|
||||
|
||||
# Make sure we have the official JoeyLib header.
|
||||
cp -f "${DIST}/joey.h" "${TARGET}/."
|
||||
cp -f "${DIST}/joey.h" "${SOURCE}/."
|
||||
|
||||
case ${BACKEND} in
|
||||
orca)
|
||||
#***TODO*** Somehow pass in -DBUILD_SERVER
|
||||
# Compile C files and generate object list.
|
||||
OFILES=""
|
||||
for FILE in "${CFILES[@]}"; do
|
||||
|
@ -436,20 +463,36 @@ function doBuild() {
|
|||
iix -DKeepType=S16 link ${OFILES} keep=${GSTARGET}/${BUILD_PROJECT}#b3db03
|
||||
# Create disk image, setting known file types
|
||||
DISK=${BUILD_RESULTS}/${LINE,,}/build.po
|
||||
${CADIUS} createvolume ${DISK} ${BUILD_PROJECT} 32MB > /dev/null
|
||||
${CADIUS} createfolder ${DISK} ${BUILD_PROJECT}/data > /dev/null
|
||||
${CADIUS} addfile ${DISK} ${BUILD_PROJECT} ${TARGET}/${BUILD_PROJECT}#b3db03 > /dev/null
|
||||
${CADIUS} addfile ${DISK} ${BUILD_PROJECT}/data ${LIB}/Tool222#ba0000 > /dev/null
|
||||
${CADIUS} createvolume ${DISK} ${BUILD_PROJECT} 32MB
|
||||
${CADIUS} createfolder ${DISK} ${BUILD_PROJECT}/data
|
||||
${CADIUS} addfile ${DISK} ${BUILD_PROJECT} ${TARGET}/${BUILD_PROJECT}#b3db03
|
||||
${CADIUS} addfile ${DISK} ${BUILD_PROJECT}/data ${LIB}/Tool222#ba0000
|
||||
# Copy game data.
|
||||
for FILE in "${DATA[@]}"; do
|
||||
#***TODO*** Data conversion here!
|
||||
O=`basename ${FILE}`#060000
|
||||
cp -f ${FILE} ${O}
|
||||
${CADIUS} addfile ${DISK} ${BUILD_PROJECT}/data ${O} > /dev/null
|
||||
${CADIUS} addfile ${DISK} ${BUILD_PROJECT}/data ${O}
|
||||
rm ${O}
|
||||
done
|
||||
;;
|
||||
|
||||
SDL2)
|
||||
export CFLAGS="${CFLAGS} -DBUILD_SERVER -Wall -D_REENTRANT_ -I${DIST}"
|
||||
# Compile C files and generate object list.
|
||||
OFILES=""
|
||||
for FILE in "${CFILES[@]}"; do
|
||||
O=${FILE%.*}.o
|
||||
OFILES="${OFILES} ${TARGET}/${O}"
|
||||
${CC} ${CFLAGS} -c ${FILE} -o ${TARGET}/${O}
|
||||
done
|
||||
# Link.
|
||||
${CC} ${CFLAGS} -o ${BUILD_RESULTS}/${LINE,,}/${BUILD_PROJECT}${EXT} ${OFILES} ${LIB}/libjoeylib.a -lm -ldl -lpthread
|
||||
# Copy game data.
|
||||
for FILE in "${DATA[@]}"; do
|
||||
#***TODO*** Data conversion here!
|
||||
cp -f ${FILE} ${BUILD_RESULTS}/${LINE,,}/.
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
@ -458,6 +501,8 @@ function doBuild() {
|
|||
BUILD_PLATFORMS="${BUILD_PLATFORMS}]"
|
||||
|
||||
popd
|
||||
|
||||
export CFLAGS=${OLD_CFLAGS}
|
||||
}
|
||||
|
||||
|
||||
|
@ -702,7 +747,7 @@ function startBuildServer() {
|
|||
|
||||
doBuild "${DIST}" "${USERNAME}/build"
|
||||
|
||||
pushd "${USERNAME}/build" &> /dev/null
|
||||
pushd "${USERNAME}/build"
|
||||
|
||||
# Compress the results.
|
||||
tar cJf build.temp results
|
||||
|
@ -722,7 +767,7 @@ function startBuildServer() {
|
|||
# Log it.
|
||||
echo "$(date) - Compiled ${BUILD_PROJECT} for ${USERNAME} on ${BUILD_PLATFORMS}" >> ${LOG}
|
||||
|
||||
popd &> /dev/null
|
||||
popd
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue