1
0
forked from 0ad/0ad
0ad/build/premake/build.sh
Stan 5da05ae15c Add a custom script to build premake, like NVTT, FCollada, and Spidermonkey.
Fix an issue on newer GNU/Linux and macOS where the build would fail due
to missing unistd includes.
Fixes: #6847
Accepted by: @vv221
Comments by: @sera
Differential Revision: https://code.wildfiregames.com/D4894
This was SVN commit r28187.
2024-08-10 11:46:03 +00:00

36 lines
821 B
Bash
Executable File

#!/bin/sh
set -e
LIB_VERSION="premake-5-alpha-14+wildfiregames.1"
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]
then
echo "Premake 5 is already up to date."
exit
fi
JOBS=${JOBS:="-j2"}
MAKE=${MAKE:="make"}
CFLAGS="${CFLAGS:=""} -Wno-error=implicit-function-declaration"
OS="${OS:=$(uname -s)}"
echo "Building Premake 5..."
echo
PREMAKE_BUILD_DIR=premake5/build/gmake2.unix
# BSD and OS X need different Makefiles
case "$OS" in
"GNU/kFreeBSD" )
# use default gmake2.unix (needs -ldl as we have a GNU userland and libc)
;;
*"BSD" )
PREMAKE_BUILD_DIR=premake5/build/gmake2.bsd
;;
"Darwin" )
PREMAKE_BUILD_DIR=premake5/build/gmake2.macosx
;;
esac
${MAKE} -C "${PREMAKE_BUILD_DIR}" "${JOBS}" CFLAGS="$CFLAGS" config=release
echo "${LIB_VERSION}" > .already-built