From: Martin Matuska Date: Tue, 22 Jan 2019 00:50:16 +0000 (+0100) Subject: CI build: allow BS as a shortcut for BUILD_SYSTEM variable X-Git-Tag: v3.4.0~132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74a5f9ac8155bcf12b7a049c41febe94e1708e05;p=thirdparty%2Flibarchive.git CI build: allow BS as a shortcut for BUILD_SYSTEM variable --- diff --git a/.cirrus.yml b/.cirrus.yml index ea804e791..a41cf07e6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,9 +16,9 @@ task: image: high-sierra-xcode-10.0 matrix: env: - BUILD_SYSTEM: autotools + BS: autotools env: - BUILD_SYSTEM: cmake + BS: cmake install_script: - ./build/ci/cirrus_ci.sh install script: diff --git a/.travis.yml b/.travis.yml index 9f262b64a..03abab2b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ compiler: - gcc - clang env: - - BUILD_SYSTEM=cmake - - BUILD_SYSTEM=autotools + - BS=cmake + - BS=autotools matrix: exclude: - os: osx diff --git a/build/ci_build.sh b/build/ci_build.sh index c184a6f16..9449edd4a 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" ;;