]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
CI build: allow BS as a shortcut for BUILD_SYSTEM variable
authorMartin Matuska <martin@matuska.org>
Tue, 22 Jan 2019 00:50:16 +0000 (01:50 +0100)
committerMartin Matuska <martin@matuska.org>
Tue, 22 Jan 2019 23:08:37 +0000 (00:08 +0100)
.cirrus.yml
.travis.yml
build/ci_build.sh

index ea804e7914687c14adbb8a263a7876538b99901d..a41cf07e6b4b34c576a3d189ad4a15c3e65809a6 100644 (file)
@@ -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:
index 9f262b64a1c78e4781cb213a3271ef5f5599524e..03abab2b260479a267ba78892958eacfffcf098b 100644 (file)
@@ -16,8 +16,8 @@ compiler:
   - gcc
   - clang
 env:
-  - BUILD_SYSTEM=cmake
-  - BUILD_SYSTEM=autotools
+  - BS=cmake
+  - BS=autotools
 matrix:
   exclude:
     - os: osx
index c184a6f168d9130e938d2785ba144e179e02adce..9449edd4a961f4a05d949d0c529280513cd09e26 100755 (executable)
@@ -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"
                                        ;;