#!/bin/bash # # JoeyBuild # Copyright (C) 2018-2023 Scott Duensing # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. # M_SDL2_TAG=97a5e744497ff7cc93edc5119d67cad3ee86dd57 M_TRIPLE= source ${G_EHOME}/helpers/SDL2.helper function architectures() { echo "i686 x86_64" } function assemble() { local -n AFILES=$1 local PASS=$2 local LOG=$3 } function buildJoeyLib() { local ARCH=$1 local PASS=$2 export CFLAGS="-Dmain=SDL_main -Wall -static-libgcc -I${G_SRC} -I${G_INSTALLED}/include -c" export LDFLAGS="-mwindows -Wl,--dynamicbase -Wl,--nxcompat -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid" if [[ "${PASS}" == "debug" ]]; then export CFLAGS="-DJOEY_DEBUG ${CFLAGS}" fi setCompiler ${ARCH} ${PASS} buildJoeyLibSDL2 ${PASS} unSetCompiler } function compile() { local -n CFILES=$1 local PASS=$2 local LOG=$3 } function enabled() { echo 0 } function friendlyName() { echo "Windows XP+" } function install() { local ARCH=$1 local PASS=$2 # Do not call setCompiler here! buildSDL2 ${M_SDL2_TAG} "${ARCH}-w64-mingw32" } function link() { local -n OFILES=$1 local PASS=$2 local LOG=$3 } function package() { local -n DFILES=$1 local PASS=$2 local LOG=$3 } function setCompiler() { local ARCH=$1 local PASS=$2 M_TRIPLE="${ARCH}-w64-mingw32" export CC=${M_TRIPLE}-gcc export LD=${M_TRIPLE}-gcc export AR=${M_TRIPLE}-ar } function unSetCompiler() { export CC= export LD= export AR= export LDFLAGS= export CFLAGS= }