1#!/usr/bin/env bash
2
3scriptdir="$(dirname "$0")"
4export NOAUTODEPS=1
5export SNMP_VERBOSE=1
6case "$(uname -a)" in
7    MSYS*|MINGW*)
8	pacman --noconfirm --remove mingw-w64-x86_64-gcc-ada
9	pacman --noconfirm --remove mingw-w64-x86_64-gcc-fortran
10	pacman --noconfirm --remove mingw-w64-x86_64-gcc-libgfortran
11	pacman --noconfirm --remove mingw-w64-x86_64-gcc-objc
12	pacman --noconfirm --sync --refresh
13	pacman --noconfirm --sync --needed diffutils
14	pacman --noconfirm --sync --needed make
15	pacman --noconfirm --sync --needed perl-ExtUtils-MakeMaker
16	pacman --noconfirm --sync --needed perl-Test-Harness
17	;;
18esac
19case "$(uname -a)" in
20    MSYS*x86_64*)
21	pacman --noconfirm --sync --needed openssl-devel
22	;;
23    MINGW64*)
24	pacman --noconfirm --sync --needed mingw-w64-x86_64-libmariadbclient
25	pacman --noconfirm --sync --needed mingw-w64-x86_64-gcc
26	pacman --noconfirm --sync --needed mingw-w64-x86_64-openssl
27	export PATH="/mingw64/bin:$PATH"
28	;;
29esac
30echo "compiler path: $(type -p gcc)"
31"${scriptdir}"/net-snmp-configure V5-8-patches || exit $?
32make -s                                  || exit $?
33case "$MODE" in
34    disable-set|mini*|read-only)
35        exit 0;;
36esac
37[ -n "$APPVEYOR" ]			 && exit 0
38"${scriptdir}"/net-snmp-run-tests        || exit $?
39