summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-08-01 14:53:07 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-08-07 11:24:54 +1000
commit0a4563280dc36fb21194e55c5f0f1c7cf7de5767 (patch)
tree4b387b271c845c22241a0a794483e322d9dc3e00
parenta1ef27ff62dc53ac0328db2f4e83e5af4b2f928c (diff)
downloadtalos-petitboot-0a4563280dc36fb21194e55c5f0f1c7cf7de5767.tar.gz
talos-petitboot-0a4563280dc36fb21194e55c5f0f1c7cf7de5767.zip
docker: Pass extra options to configure
Pass extra configure options and CFLAGS/LDFLAGS to docker to enable building multiple configurations. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rwxr-xr-xdocker/build-pb30
1 files changed, 20 insertions, 10 deletions
diff --git a/docker/build-pb b/docker/build-pb
index ad08ef9..6ed2af6 100755
--- a/docker/build-pb
+++ b/docker/build-pb
@@ -12,21 +12,24 @@ usage () {
echo "${name} - Builds the petitboot programs using a pb-builder container." >&2
echo "Usage: ${name} [flags]" >&2
echo "Option flags:" >&2
- echo " -c --check - Run 'make check'." >&2
- echo " -d --dry-run - Do not run docker commands." >&2
- echo " -h --help - Show this help and exit." >&2
- echo " -i --interactive - Run an interactive pb-builder container." >&2
- echo " -t --tag - Print Docker tag to stdout and exit." >&2
- echo " -v --verbose - Verbose execution." >&2
+ echo " -c --check - Run 'make check'." >&2
+ echo " -d --dry-run - Do not run docker commands." >&2
+ echo " -h --help - Show this help and exit." >&2
+ echo " -i --interactive - Run an interactive pb-builder container." >&2
+ echo " -o --configure-opts - Extra arguments for configure." >&2
+ echo " -t --tag - Print Docker tag to stdout and exit." >&2
+ echo " -v --verbose - Verbose execution." >&2
echo "Environment:" >&2
- echo " DOCKER_TAG - Default: '${DOCKER_TAG}'" >&2
+ echo " DOCKER_TAG - Default: '${DOCKER_TAG}'" >&2
+ echo " CFLAGS - Default: '${CFLAGS}'" >&2
+ echo " LDFLAGS - Default: '${LDFLAGS}'" >&2
echo "Examples:" >&2
echo " ${name} -vc"
echo " ${name} -v"
}
-short_opts="cdhitv"
-long_opts="check,dry-run,help,interactive,tag,verbose"
+short_opts="cdhio:tv"
+long_opts="check,dry-run,help,interactive,configure-opts:,tag,verbose"
opts=$(getopt --options ${short_opts} --long ${long_opts} -n "${name}" -- "$@")
@@ -55,6 +58,11 @@ while true ; do
interactive=1
shift
;;
+ -o | --configure-opts)
+ shift
+ configure_opts=${1}
+ shift
+ ;;
-t | --tag)
tag=1
shift
@@ -112,8 +120,10 @@ else
docker_extra="true"
fi
+flags="CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS}"
+
cd "${TOP_DIR}"
docker_args="${docker_base_args} ${docker_user_args}"
run_cmd "docker run ${docker_args} ${DOCKER_TAG} /bin/bash \
-e ${bash_debug} \
- -c './bootstrap && ./configure --with-ncurses && make && ${docker_extra}'"
+ -c './bootstrap && ${flags} ./configure ${configure_opts[@]} && make && ${docker_extra}'"
OpenPOWER on IntegriCloud