2009-07-16 18:57:59 +02:00
|
|
|
#!/bin/sh
|
2004-06-07 12:45:48 +02:00
|
|
|
|
2009-08-08 13:22:42 +02:00
|
|
|
die()
|
|
|
|
{
|
2010-09-10 22:15:49 +02:00
|
|
|
echo ERROR: $*
|
|
|
|
exit 1
|
2009-08-08 13:22:42 +02:00
|
|
|
}
|
|
|
|
|
2011-05-04 01:54:29 +02:00
|
|
|
JOBS=${JOBS:="-j2"}
|
|
|
|
|
2010-09-10 22:15:49 +02:00
|
|
|
with_system_nvtt=false
|
|
|
|
for i in "$@"
|
|
|
|
do
|
|
|
|
case $i in
|
|
|
|
--with-system-nvtt ) with_system_nvtt=true ;;
|
2011-05-04 01:54:29 +02:00
|
|
|
-j* ) JOBS=$i ;;
|
2010-09-10 22:15:49 +02:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2009-07-18 00:07:09 +02:00
|
|
|
cd "$(dirname $0)"
|
|
|
|
# Now in build/workspaces/ (where we assume this script resides)
|
2004-06-07 12:45:48 +02:00
|
|
|
|
2010-03-26 11:31:47 +01:00
|
|
|
echo "Updating bundled third-party dependencies..."
|
|
|
|
echo
|
|
|
|
|
2009-08-08 13:22:42 +02:00
|
|
|
# Build/update bundled external libraries
|
2011-05-04 01:54:29 +02:00
|
|
|
(cd ../../libraries/fcollada/src && make ${JOBS}) || die "FCollada build failed"
|
2010-09-10 22:15:49 +02:00
|
|
|
echo
|
2011-05-04 01:54:29 +02:00
|
|
|
(cd ../../libraries/spidermonkey-tip && JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
|
2010-09-10 22:15:49 +02:00
|
|
|
echo
|
|
|
|
if [ "$with_system_nvtt" = "false" ]; then
|
2011-05-04 01:54:29 +02:00
|
|
|
(cd ../../libraries/nvtt && JOBS=${JOBS} ./build.sh) || die "NVTT build failed"
|
2010-09-10 22:15:49 +02:00
|
|
|
fi
|
|
|
|
echo
|
2009-08-08 13:22:42 +02:00
|
|
|
|
2009-07-18 00:07:09 +02:00
|
|
|
# Make sure workspaces/gcc exists.
|
|
|
|
mkdir -p gcc
|
2004-12-11 22:50:03 +01:00
|
|
|
|
2009-07-18 00:07:09 +02:00
|
|
|
# Now build premake and run it to create the makefiles
|
|
|
|
cd ../premake
|
2011-05-04 01:54:29 +02:00
|
|
|
make -C src ${JOBS} || die "Premake build failed"
|
2010-03-26 11:31:47 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
|
2010-04-15 22:15:16 +02:00
|
|
|
# If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection
|
|
|
|
export HOSTTYPE="$HOSTTYPE"
|
|
|
|
|
2009-08-08 13:22:42 +02:00
|
|
|
src/bin/premake --outpath ../workspaces/gcc --atlas --collada "$@" --target gnu || die "Premake failed"
|