123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #!/bin/sh
- SCRIPTPATH=`perl -MCwd -e 'print Cwd::abs_path shift' "$0"`
- case "$SCRIPTPATH" in
- *\ * )
- die "Absolute path contains whitespace, which will break the build - move the game to a path without spaces" ;;
- esac
- JOBS=${JOBS:="-j2"}
- case "`uname -s`" in
- "FreeBSD" | "OpenBSD" )
- MAKE=${MAKE:="gmake"}
- ;;
- * )
- MAKE=${MAKE:="make"}
- ;;
- esac
- premake_args=""
- without_nvtt=false
- with_system_nvtt=false
- with_system_mozjs38=false
- enable_atlas=true
- for i in "$@"
- do
- case $i in
- --without-nvtt ) without_nvtt=true; premake_args="${premake_args} --without-nvtt" ;;
- --with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;;
- --with-system-mozjs38 ) with_system_mozjs38=true; premake_args="${premake_args} --with-system-mozjs38" ;;
- --enable-atlas ) enable_atlas=true ;;
- --disable-atlas ) enable_atlas=false ;;
- -j* ) JOBS=$i ;;
-
- --* ) premake_args="${premake_args} $i" ;;
- esac
- done
- premake_args="${premake_args} --collada"
- if [ "$enable_atlas" = "true" ]; then
- premake_args="${premake_args} --atlas"
- fi
- cd "$(dirname $0)"
- if [ "`uname -s`" = "Darwin" ]; then
-
- export GLOOX_CONFIG=${GLOOX_CONFIG:="$(pwd)/../../libraries/osx/gloox/bin/gloox-config"}
- export ICU_CONFIG=${ICU_CONFIG:="$(pwd)/../../libraries/osx/icu/bin/icu-config"}
- export SDL2_CONFIG=${SDL2_CONFIG:="$(pwd)/../../libraries/osx/sdl2/bin/sdl2-config"}
- export WX_CONFIG=${WX_CONFIG:="$(pwd)/../../libraries/osx/wxwidgets/bin/wx-config"}
- export XML2_CONFIG=${XML2_CONFIG:="$(pwd)/../../libraries/osx/libxml2/bin/xml2-config"}
- fi
- if [ "`uname -s`" != "Darwin" ]; then
- echo "Updating bundled third-party dependencies..."
- echo
-
- (cd ../../libraries/source/fcollada/src && ${MAKE} ${JOBS}) || die "FCollada build failed"
- echo
- if [ "$with_system_mozjs38" = "false" ]; then
- (cd ../../libraries/source/spidermonkey && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
- fi
- echo
- if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
- (cd ../../libraries/source/nvtt && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "NVTT build failed"
- fi
- echo
- fi
- cd ../premake/premake4
- PREMAKE_BUILD_DIR=build/gmake.unix
- case "`uname -s`" in
- "GNU/kFreeBSD" )
-
- ;;
- *"BSD" )
- PREMAKE_BUILD_DIR=build/gmake.bsd
- ;;
- "Darwin" )
- PREMAKE_BUILD_DIR=build/gmake.macosx
- ;;
- esac
- ${MAKE} -C $PREMAKE_BUILD_DIR ${JOBS} || die "Premake build failed"
- echo
- cd ..
- export HOSTTYPE="$HOSTTYPE"
- echo "Premake args: ${premake_args}"
- premake4/bin/release/premake4 --file="premake4.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake || die "Premake failed"
- premake4/bin/release/premake4 --file="premake4.lua" --outpath="../workspaces/codeblocks/" ${premake_args} codeblocks || die "Premake failed"
- if [ "`uname -s`" = "Darwin" ]; then
- premake4/bin/release/premake4 --file="premake4.lua" --outpath="../workspaces/xcode3" ${premake_args} xcode3 || die "Premake failed"
- premake4/bin/release/premake4 --file="premake4.lua" --outpath="../workspaces/xcode4" ${premake_args} xcode4 || die "Premake failed"
- fi
- rm -f ../../source/test_root.cpp
|