mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Add support of IPv6 disabling
This commit is contained in:
parent
d037f93811
commit
b39cc55d37
|
@ -148,6 +148,11 @@ else()
|
|||
add_dllflag("-Wl,-z,defs")
|
||||
endif()
|
||||
|
||||
option(USE_IPV6 "Use IPv6 in tests" ON)
|
||||
if(NOT USE_IPV6)
|
||||
add_definitions(-DUSE_IPV6=0)
|
||||
endif()
|
||||
|
||||
option(BUILD_TOXAV "Whether to build the tox AV library" ON)
|
||||
|
||||
include(Dependencies)
|
||||
|
|
10
configure.ac
10
configure.ac
|
@ -193,6 +193,16 @@ AC_ARG_ENABLE([[epoll]],
|
|||
[enable_epoll='auto']
|
||||
)
|
||||
|
||||
AC_ARG_ENABLE([[ipv6]],
|
||||
[AS_HELP_STRING([[--disable-ipv6[=ARG]]], [use ipv4 in tests (yes, no, auto) [auto]])],
|
||||
[use_ipv6=${enableval}],
|
||||
[use_ipv6='auto']
|
||||
)
|
||||
|
||||
if test "$use_ipv6" != "yes"; then
|
||||
AC_DEFINE([USE_IPV6],[0],[define to 0 to force ipv4])
|
||||
fi
|
||||
|
||||
AX_HAVE_EPOLL
|
||||
if test "$enable_epoll" != "no"; then
|
||||
if test "${ax_cv_have_epoll}" = "yes"; then
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
if perl -e '
|
||||
use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK);
|
||||
|
||||
socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1;
|
||||
bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1;
|
||||
'; then
|
||||
IPV6_FLAG="--enable-ipv6"
|
||||
else
|
||||
IPV6_FLAG="--disable-ipv6"
|
||||
fi
|
||||
|
||||
# Build toxcore with some custom flags here. Note that this does *not* run the
|
||||
# tests, so any flags passed here are irrelevant to testing. This only checks
|
||||
# that we can build toxcore with the specified flags. Tests run with default
|
||||
|
@ -12,6 +23,7 @@
|
|||
--enable-daemon \
|
||||
--enable-logging \
|
||||
--enable-ntox \
|
||||
$IPV6_FLAG \
|
||||
--with-log-level=TRACE
|
||||
|
||||
# We use make instead of RUN $MAKE here, because the autotools build will only
|
||||
|
|
|
@ -22,6 +22,18 @@ for i in `seq 0 7`; do
|
|||
RUN rm -rf $BUILD_DIR
|
||||
done
|
||||
|
||||
if perl -e '
|
||||
use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK);
|
||||
|
||||
socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1;
|
||||
bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1;
|
||||
'; then
|
||||
USE_IPV6=yes
|
||||
else
|
||||
USE_IPV6=no
|
||||
fi
|
||||
|
||||
|
||||
# Build toxcore and run tests.
|
||||
RUN $CMAKE \
|
||||
-B$BUILD_DIR \
|
||||
|
@ -32,6 +44,7 @@ RUN $CMAKE \
|
|||
-DSTRICT_ABI=ON \
|
||||
-DTEST_TIMEOUT_SECONDS=120 \
|
||||
-DTRACE=ON \
|
||||
-DUSE_IPV6=$USE_IPV6 \
|
||||
$CMAKE_EXTRA_FLAGS
|
||||
|
||||
export CTEST_OUTPUT_ON_FAILURE=1
|
||||
|
|
Loading…
Reference in New Issue
Block a user