summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.org>2019-01-22 01:50:16 +0100
committerMartin Matuska <martin@matuska.org>2019-01-23 00:08:37 +0100
commit74a5f9ac8155bcf12b7a049c41febe94e1708e05 (patch)
treed5fa643d6ec880a5f9c649d39694b3d5d117ae84 /build
parent4891f608cbb749d819c30ab47dfd2bcde021e93c (diff)
downloadlibarchive-74a5f9ac8155bcf12b7a049c41febe94e1708e05.tar.gz
CI build: allow BS as a shortcut for BUILD_SYSTEM variable
Diffstat (limited to 'build')
-rwxr-xr-xbuild/ci_build.sh32
1 files changed, 17 insertions, 15 deletions
diff --git a/build/ci_build.sh b/build/ci_build.sh
index c184a6f1..9449edd4 100755
--- a/build/ci_build.sh
+++ b/build/ci_build.sh
@@ -3,15 +3,17 @@
# Automated build and test of libarchive on CI systems
#
# Variables that can be passed via environment:
-# BUILD_SYSTEM=
-# BUILDDIR=
-# SRCDIR=
-# CONFIGURE_ARGS=
-# MAKE_ARGS=
-#
+# BS= # build system (autotools or cmake)
+# BUILDDIR= # build directory
+# SRCDIR= # source directory
+# CONFIGURE_ARGS= # configure arguments
+# MAKE_ARGS= # make arguments
ACTIONS=
-BUILD_SYSTEM="${BUILD_SYSTEM:-autotools}"
+if [ -n "${BUILD_SYSTEM}" ]; then
+ BS="${BUILD_SYSTEM}"
+fi
+BS="${BS:-autotools}"
MAKE="${MAKE:-make}"
CMAKE="${CMAKE:-cmake}"
CURDIR=`pwd`
@@ -38,8 +40,8 @@ while getopts a:b:d:s: opt; do
esac
ACTIONS="${ACTIONS} ${OPTARG}"
;;
- b) BUILD_SYSTEM="${OPTARG}"
- case "${BUILD_SYSTEM}" in
+ b) BS="${OPTARG}"
+ case "${BS}" in
autotools) ;;
cmake) ;;
*) inputerror "Invalid build system (-b)" ;;
@@ -59,18 +61,18 @@ done
if [ -z "${ACTIONS}" ]; then
ACTIONS="autogen configure build test"
fi
-if [ -z "${BUILD_SYSTEM}" ]; then
- inputerror "Missing type (-t) parameter"
+if [ -z "${BS}" ]; then
+ inputerror "Missing build system (-b) parameter"
fi
if [ -z "${BUILDDIR}" ]; then
- BUILDDIR="${CURDIR}/build_ci/${BUILD_SYSTEM}"
+ BUILDDIR="${CURDIR}/build_ci/${BS}"
fi
mkdir -p "${BUILDDIR}"
for action in ${ACTIONS}; do
cd "${BUILDDIR}"
case "${action}" in
autogen)
- case "${BUILD_SYSTEM}" in
+ case "${BS}" in
autotools)
cd "${SRCDIR}"
sh build/autogen.sh
@@ -79,7 +81,7 @@ for action in ${ACTIONS}; do
esac
;;
configure)
- case "${BUILD_SYSTEM}" in
+ case "${BS}" in
autotools) "${SRCDIR}/configure" ${CONFIGURE_ARGS} ;;
cmake) ${CMAKE} ${CONFIGURE_ARGS} "${SRCDIR}" ;;
esac
@@ -90,7 +92,7 @@ for action in ${ACTIONS}; do
RET="$?"
;;
test)
- case "${BUILD_SYSTEM}" in
+ case "${BS}" in
autotools)
${MAKE} ${MAKE_ARGS} check LOG_DRIVER="${SRCDIR}/build/ci_test_driver"
;;