2020-02-14 06:50:52 -05:00
|
|
|
#!/usr/bin/env bash
|
2016-09-03 17:26:14 -04:00
|
|
|
|
2020-12-21 10:07:58 -05:00
|
|
|
log_content()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo "Content of $1:"
|
|
|
|
cat "$1"
|
|
|
|
}
|
|
|
|
|
2016-09-03 17:26:14 -04:00
|
|
|
error_handler()
|
|
|
|
{
|
|
|
|
ERR_CODE=$?
|
2020-12-21 10:07:58 -05:00
|
|
|
|
|
|
|
log_content ./config.log
|
|
|
|
log_content ./test-suite.log
|
|
|
|
|
2016-09-03 17:26:14 -04:00
|
|
|
echo
|
2020-02-14 06:50:52 -05:00
|
|
|
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
|
2016-09-03 17:26:14 -04:00
|
|
|
echo
|
2020-02-14 06:50:52 -05:00
|
|
|
exit ${ERR_CODE}
|
2016-09-03 17:26:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
trap error_handler ERR
|
|
|
|
|
2020-04-01 08:21:12 -04:00
|
|
|
num_cores()
|
|
|
|
{
|
|
|
|
# Check for cores, for systems with:
|
|
|
|
# Line 1. Linux w/ coreutils, or...
|
|
|
|
# Line 2. OpenBSD, FreeBSD, NetBSD or macOS, or...
|
|
|
|
# Line 3. Fallback for Linux w/o coreutils (glibc).
|
|
|
|
nproc \
|
|
|
|
|| sysctl -n hw.ncpu \
|
|
|
|
|| getconf _NPROCESSORS_ONLN 2>/dev/null
|
|
|
|
}
|
|
|
|
|
2016-09-03 17:26:14 -04:00
|
|
|
./bootstrap.sh
|
|
|
|
|
2019-06-04 07:45:17 -04:00
|
|
|
tests=()
|
2020-04-01 08:21:12 -04:00
|
|
|
MAKE="make --quiet -j$(num_cores)"
|
2020-02-14 06:50:52 -05:00
|
|
|
CC="gcc"
|
|
|
|
|
2019-06-04 07:45:17 -04:00
|
|
|
case $(uname | tr '[:upper:]' '[:lower:]') in
|
|
|
|
linux*)
|
|
|
|
tests=(
|
2020-02-08 03:28:41 -05:00
|
|
|
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
|
2019-06-04 07:45:17 -04:00
|
|
|
--enable-omemo --enable-plugins --enable-c-plugins
|
|
|
|
--enable-python-plugins --with-xscreensaver"
|
2021-10-16 11:51:38 -04:00
|
|
|
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
|
2019-06-04 07:45:17 -04:00
|
|
|
--disable-omemo --disable-plugins --disable-c-plugins
|
|
|
|
--disable-python-plugins --without-xscreensaver"
|
|
|
|
"--disable-notifications"
|
2021-10-16 11:51:38 -04:00
|
|
|
"--disable-icons-and-clipboard"
|
2019-06-04 07:45:17 -04:00
|
|
|
"--disable-otr"
|
|
|
|
"--disable-pgp"
|
|
|
|
"--disable-omemo"
|
|
|
|
"--disable-pgp --disable-otr"
|
|
|
|
"--disable-pgp --disable-otr --disable-omemo"
|
|
|
|
"--disable-plugins"
|
|
|
|
"--disable-python-plugins"
|
|
|
|
"--disable-c-plugins"
|
|
|
|
"--disable-c-plugins --disable-python-plugins"
|
|
|
|
"--without-xscreensaver"
|
|
|
|
"")
|
|
|
|
;;
|
|
|
|
darwin*)
|
2020-02-14 06:50:52 -05:00
|
|
|
tests=(
|
|
|
|
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
|
|
|
|
--enable-omemo --enable-plugins --enable-c-plugins
|
|
|
|
--enable-python-plugins"
|
2021-10-16 11:51:38 -04:00
|
|
|
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
|
2020-02-14 06:50:52 -05:00
|
|
|
--disable-omemo --disable-plugins --disable-c-plugins
|
|
|
|
--disable-python-plugins"
|
|
|
|
"--disable-notifications"
|
2021-10-16 11:51:38 -04:00
|
|
|
"--disable-icons-and-clipboard"
|
2020-02-14 06:50:52 -05:00
|
|
|
"--disable-otr"
|
|
|
|
"--disable-pgp"
|
|
|
|
"--disable-omemo"
|
|
|
|
"--disable-pgp --disable-otr"
|
|
|
|
"--disable-pgp --disable-otr --disable-omemo"
|
|
|
|
"--disable-plugins"
|
|
|
|
"--disable-python-plugins"
|
|
|
|
"--disable-c-plugins"
|
|
|
|
"--disable-c-plugins --disable-python-plugins"
|
|
|
|
"")
|
|
|
|
;;
|
|
|
|
openbsd*)
|
|
|
|
MAKE="gmake"
|
|
|
|
# TODO(#1231):
|
|
|
|
# `-std=gnu99 -fexec-charset=UTF-8` to silence:
|
|
|
|
# src/event/server_events.c:1453:19: error: universal character names are only valid in C++ and C99
|
|
|
|
# src/event/server_events.c:1454:19: error: universal character names are only valid in C++ and C99
|
2021-12-24 07:49:07 -05:00
|
|
|
CC="egcc -std=gnu99 -fexec-charset=UTF-8"
|
2020-02-14 06:50:52 -05:00
|
|
|
|
2019-06-04 07:45:17 -04:00
|
|
|
tests=(
|
2020-02-08 03:28:41 -05:00
|
|
|
"--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp
|
2019-06-04 07:45:17 -04:00
|
|
|
--enable-omemo --enable-plugins --enable-c-plugins
|
|
|
|
--enable-python-plugins"
|
2021-10-16 11:51:38 -04:00
|
|
|
"--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp
|
2019-06-04 07:45:17 -04:00
|
|
|
--disable-omemo --disable-plugins --disable-c-plugins
|
|
|
|
--disable-python-plugins"
|
|
|
|
"--disable-notifications"
|
2021-10-16 11:51:38 -04:00
|
|
|
"--disable-icons-and-clipboard"
|
2019-06-04 07:45:17 -04:00
|
|
|
"--disable-otr"
|
|
|
|
"--disable-pgp"
|
|
|
|
"--disable-omemo"
|
|
|
|
"--disable-pgp --disable-otr"
|
|
|
|
"--disable-pgp --disable-otr --disable-omemo"
|
|
|
|
"--disable-plugins"
|
|
|
|
"--disable-python-plugins"
|
|
|
|
"--disable-c-plugins"
|
|
|
|
"--disable-c-plugins --disable-python-plugins"
|
|
|
|
"")
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-02-14 06:50:52 -05:00
|
|
|
for features in "${tests[@]}"
|
2019-06-04 07:45:17 -04:00
|
|
|
do
|
|
|
|
echo
|
2020-02-14 06:50:52 -05:00
|
|
|
echo "--> Building with ./configure ${features}"
|
2019-06-04 07:45:17 -04:00
|
|
|
echo
|
2020-02-14 06:50:52 -05:00
|
|
|
|
2019-06-04 07:45:17 -04:00
|
|
|
# shellcheck disable=SC2086
|
2020-02-14 06:50:52 -05:00
|
|
|
./configure $features
|
|
|
|
|
|
|
|
$MAKE CC="${CC}"
|
|
|
|
$MAKE check
|
|
|
|
|
|
|
|
./profanity -v
|
|
|
|
$MAKE clean
|
2019-06-04 07:45:17 -04:00
|
|
|
done
|