xgo/docker/base/build_deps.sh

28 lines
992 B
Bash
Raw Normal View History

#!/bin/bash
#
# Contains the a dependency builder to iterate over all installed dependencies
# and cross compile them to the requested target platform.
2015-09-11 09:26:49 +00:00
#
2015-11-24 14:47:29 +00:00
# Usage: build_deps.sh <dependency folder> <configure arguments>
#
# Needed environment variables:
2015-09-11 09:26:49 +00:00
# CC - C cross compiler to use for the build
# HOST - Target platform to build (used to find the needed tool-chains)
# PREFIX - File-system path where to install the built binaries
set -e
# Remove any previous build leftovers, and copy a fresh working set (clean doesn't work for cross compiling)
rm -rf /deps-build && cp -r $1 /deps-build
# Build all the dependencies (no order for now)
for dep in `ls /deps-build`; do
echo "Configuring dependency $dep for $HOST..."
2015-11-24 14:47:29 +00:00
(cd /deps-build/$dep && ./configure --disable-shared --host=$HOST --prefix=$PREFIX --silent ${@:2})
echo "Building dependency $dep for $HOST..."
(cd /deps-build/$dep && make --silent -j install)
done
# Remove any build artifacts
rm -rf /deps-build