Merge branch 'libevent' of https://github.com/noloader/unbound into noloader-libevent

This commit is contained in:
Ralph Dolmans 2020-03-19 17:57:35 +01:00
commit 1cf77d4255
3 changed files with 68 additions and 21 deletions

View file

@ -23,69 +23,111 @@ jobs:
name: GCC on Linux, Amd64 name: GCC on Linux, Amd64
compiler: gcc compiler: gcc
arch: amd64 arch: amd64
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, Amd64 name: Clang on Linux, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: osx - os: osx
name: Clang on OS X, Amd64 name: Clang on OS X, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
env: TEST_OSX=yes env:
- TEST_OSX=yes
- CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/"
- os: linux
name: Libevent, GCC on Linux, Amd64
compiler: gcc
arch: amd64
env:
- TEST_LIBEVENT=yes
- CONFIG_OPTS="--with-libevent"
- os: linux
name: Libevent, Clang on Linux, Amd64
compiler: clang
arch: amd64
- TEST_LIBEVENT=yes
- CONFIG_OPTS="--with-libevent"
- os: osx
name: Libevent, Clang on OS X, Amd64
compiler: clang
arch: amd64
- TEST_OSX=yes
- TEST_LIBEVENT=yes
- CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl/ --with-libevent=/usr/local/opt/libevent/"
- os: linux - os: linux
name: UBsan, GCC on Linux, Amd64 name: UBsan, GCC on Linux, Amd64
compiler: gcc compiler: gcc
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_UBSAN=yes env:
- TEST_UBSAN=yes
- os: linux - os: linux
name: UBsan, Clang on Linux, Amd64 name: UBsan, Clang on Linux, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_UBSAN=yes env:
- TEST_UBSAN=yes
- os: linux - os: linux
name: Asan, GCC on Linux, Amd64 name: Asan, GCC on Linux, Amd64
compiler: gcc compiler: gcc
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_ASAN=yes env:
- TEST_ASAN=yes
- os: linux - os: linux
name: Asan, Clang on Linux, Amd64 name: Asan, Clang on Linux, Amd64
compiler: clang compiler: clang
arch: amd64 arch: amd64
dist: bionic dist: bionic
env: TEST_ASAN=yes env:
- TEST_ASAN=yes
- os: linux - os: linux
name: GCC on Linux, Aarch64 name: GCC on Linux, Aarch64
compiler: gcc compiler: gcc
arch: arm64 arch: arm64
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, Aarch64 name: Clang on Linux, Aarch64
compiler: clang compiler: clang
arch: arm64 arch: arm64
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: GCC on Linux, PowerPC64 name: GCC on Linux, PowerPC64
compiler: gcc compiler: gcc
arch: ppc64le arch: ppc64le
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, PowerPC64 name: Clang on Linux, PowerPC64
compiler: clang compiler: clang
arch: ppc64le arch: ppc64le
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: GCC on Linux, s390x name: GCC on Linux, s390x
compiler: gcc compiler: gcc
arch: s390x arch: s390x
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: linux - os: linux
name: Clang on Linux, s390x name: Clang on Linux, s390x
compiler: clang compiler: clang
arch: s390x arch: s390x
dist: bionic dist: bionic
env:
- CONFIG_OPTS="--enable-debug --disable-flto"
- os: osx - os: osx
osx_image: xcode10 osx_image: xcode10
name: Apple iPhone on iOS, armv7 name: Apple iPhone on iOS, armv7
@ -293,7 +335,7 @@ script:
make test make test
(cd testdata/clang-analysis.tdir; bash clang-analysis.test) (cd testdata/clang-analysis.tdir; bash clang-analysis.test)
else else
./configure --enable-debug --disable-flto ./configure ${CONFIG_OPTS}
make -j 2 make -j 2
make test make test
(cd testdata/clang-analysis.tdir; bash clang-analysis.test) (cd testdata/clang-analysis.tdir; bash clang-analysis.test)

View file

@ -1218,13 +1218,14 @@ esac
# check for libevent # check for libevent
AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname], AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
[use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]), [use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]),
[ ],[ withval="no" ]) [ ],[ with_libevent="no" ])
if test x_$withval = x_yes -o x_$withval != x_no; then if test "x_$with_libevent" != x_no; then
AC_DEFINE([USE_LIBEVENT], [1], [Define if you enable libevent])
AC_MSG_CHECKING(for libevent) AC_MSG_CHECKING(for libevent)
if test x_$withval = x_ -o x_$withval = x_yes; then if test "x_$with_libevent" = x_ -o "x_$with_libevent" = x_yes; then
withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" with_libevent="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr"
fi fi
for dir in $withval; do for dir in $with_libevent; do
thedir="$dir" thedir="$dir"
if test -f "$dir/include/event.h" -o -f "$dir/include/event2/event.h"; then if test -f "$dir/include/event.h" -o -f "$dir/include/event2/event.h"; then
found_libevent="yes" found_libevent="yes"
@ -1255,7 +1256,7 @@ if test x_$withval = x_yes -o x_$withval != x_no; then
LATE_LDFLAGS="build/libevent/*.lo -lm" LATE_LDFLAGS="build/libevent/*.lo -lm"
LDFLAGS="build/libevent/*.o $LDFLAGS -lm" LDFLAGS="build/libevent/*.o $LDFLAGS -lm"
else else
AC_MSG_ERROR([Cannot find the libevent library in $withval AC_MSG_ERROR([Cannot find the libevent library in $with_libevent
You can restart ./configure --with-libevent=no to use a builtin alternative. You can restart ./configure --with-libevent=no to use a builtin alternative.
Please note that this alternative is not as capable as libevent when using Please note that this alternative is not as capable as libevent when using
large outgoing port ranges. ]) large outgoing port ranges. ])

View file

@ -867,7 +867,11 @@ main(int argc, char* argv[])
printf("\tperforms unit tests.\n"); printf("\tperforms unit tests.\n");
return 1; return 1;
} }
#ifdef USE_LIBEVENT
printf("Start of %s+libevent unit test.\n", PACKAGE_STRING);
#else
printf("Start of %s unit test.\n", PACKAGE_STRING); printf("Start of %s unit test.\n", PACKAGE_STRING);
#endif
#ifdef HAVE_SSL #ifdef HAVE_SSL
# ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS # ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS
ERR_load_crypto_strings(); ERR_load_crypto_strings();