summaryrefslogtreecommitdiff
path: root/scripts/build.sh
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-01-31 13:23:24 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-01-31 13:23:24 -0500
commita16452a5187314523a0d3d1431d589463e3f281d (patch)
treeff05a63c43942f6b21420660df6cf7e3d023836b /scripts/build.sh
downloaddocker-base-a16452a5187314523a0d3d1431d589463e3f281d.tar.gz
Initial commit
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-xscripts/build.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
new file mode 100755
index 0000000..9575888
--- /dev/null
+++ b/scripts/build.sh
@@ -0,0 +1,33 @@
+#!/bin/bash -x
+
+prefix="${TOOLCHAIN}"
+taskdir=${TOOLCHAIN_BUILD}/etc/tasks
+
+export _maxjobs=$(getconf _NPROCESSORS_ONLN)
+export PATH="${prefix}/bin:${PATH}"
+export CFLAGS="-I${prefix}/include"
+export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib"
+export PKG_CONFIG_PATH="${prefix}/lib/pkgconfig"
+export PREFIX="${prefix}"
+
+if [[ ! -d ${taskdir} ]]; then
+ echo "No tasks. ${taskdir} does not exist."
+ exit 1
+fi
+
+for task in ${taskdir}/*
+do
+ # Check for execution permission
+ if [[ ! -x ${task} ]]; then
+ echo "Skipping: ${task}"
+ continue
+ fi
+ echo "Executing: ${task}"
+ hash -r
+ ${task}
+ retval=$?
+ if [[ ${retval} != 0 ]]; then
+ echo "TASK FAILED: ${task}"
+ exit ${retval}
+ fi
+done