summaryrefslogtreecommitdiff
path: root/.private
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2020-03-31 15:47:31 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2020-03-31 15:47:31 -0700
commit1ce667ff7be902e376647ea81d812b75f3e43a00 (patch)
tree33e15e8a48a3f2ab3f82663c3d2f64fa0c12378d /.private
parent09d0312fbb466ce2457df94e314ba1348039138d (diff)
downloadlibusb-1ce667ff7be902e376647ea81d812b75f3e43a00.tar.gz
Move CI-related files into .private directory and add unified build script
The files needed for Continuous Integration (AppVeyor, Travis) are not meant for public consumption, so clean up the root directory by moving these files underneath .private. Create a single build script that is leveraged by both AppVeyor and Travis. This script replaces the previous 'travis-autogen.sh' file and enables additional compiler warnings that should provide additional coverage for all build environments. Update the Travis configuration file to absorb the Brewfile and update the Xcode images. Per warnings from Travis, Xcode6.4 is obsolete, thus replace it with Xcode7.3. Additionally remove the "gcc" variants for the macOS builds. The builds never used gcc to begin with and actually using gcc causes build errors due to Clang-specific pragmas in the IOKit header files. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to '.private')
-rwxr-xr-x.private/appveyor_build.sh22
-rwxr-xr-x[-rw-r--r--].private/bm.sh0
-rwxr-xr-x.private/ci-build.sh67
3 files changed, 89 insertions, 0 deletions
diff --git a/.private/appveyor_build.sh b/.private/appveyor_build.sh
new file mode 100755
index 0000000..44ca46b
--- /dev/null
+++ b/.private/appveyor_build.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -eu
+
+buildsys="${1}-${Platform}"
+
+if [ "${buildsys}" == "MinGW-Win32" ]; then
+ export PATH="/c/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/bin:${PATH}"
+elif [ "${buildsys}" == "MinGW-x64" ]; then
+ export PATH="/c/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin:${PATH}"
+fi
+
+builddir="build-${buildsys}"
+installdir="${PWD}/libusb-${buildsys}"
+
+cd libusb
+
+echo "Bootstrapping ..."
+./bootstrap.sh
+echo ""
+
+exec .private/ci-build.sh --build-dir "${builddir}" --install -- "--prefix=${installdir}"
diff --git a/.private/bm.sh b/.private/bm.sh
index 0f45a98..0f45a98 100644..100755
--- a/.private/bm.sh
+++ b/.private/bm.sh
diff --git a/.private/ci-build.sh b/.private/ci-build.sh
new file mode 100755
index 0000000..8a0da6b
--- /dev/null
+++ b/.private/ci-build.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+set -e
+
+builddir=
+install=no
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --build-dir)
+ if [ $# -lt 2 ]; then
+ echo "ERROR: missing argument for --build-dir option" >&2
+ exit 1
+ fi
+ builddir=$2
+ shift 2
+ ;;
+ --install)
+ install=yes
+ shift
+ ;;
+ --)
+ shift
+ break;
+ ;;
+ *)
+ echo "ERROR: Unexpected argument: $1" >&2
+ exit 1
+ esac
+done
+
+if [ -z "${builddir}" ]; then
+ echo "ERROR: --build-dir option not specified" >&2
+ exit 1
+fi
+
+if [ -e "${builddir}" ]; then
+ echo "ERROR: directory entry named '${builddir}' already exists" >&2
+ exit 1
+fi
+
+mkdir "${builddir}"
+cd "${builddir}"
+
+cflags="-O2"
+
+# enable extra warnings
+cflags+=" -Winline"
+cflags+=" -Wmissing-include-dirs"
+cflags+=" -Wnested-externs"
+cflags+=" -Wpointer-arith"
+cflags+=" -Wredundant-decls"
+cflags+=" -Wswitch-enum"
+
+echo ""
+echo "Configuring ..."
+CFLAGS="${cflags}" ../configure --enable-examples-build --enable-tests-build "$@"
+
+echo ""
+echo "Building ..."
+make -j4 -k
+
+if [ "${install}" = "yes" ]; then
+ echo ""
+ echo "Installing ..."
+ make install
+fi