diff --git a/.travis.yml b/.travis.yml index 52b05ecff..965753d7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,11 @@ jobs: dist: trusty python: "2.7" # The old Android build system only supports python2 script: .travis/script.sh + - env: BUILD_TARGET="android-build" VERBOSE=1 USE_OTBR_DAEMON=1 + os: linux + dist: trusty + python: "2.7" # The old Android build system only supports python2 + script: .travis/script.sh - env: BUILD_TARGET="gn-build" VERBOSE=1 os: linux script: .travis/script.sh diff --git a/.travis/check-android-build b/.travis/check-android-build index 4e6706eca..a31c68dcb 100755 --- a/.travis/check-android-build +++ b/.travis/check-android-build @@ -96,14 +96,20 @@ EOF main() { android_prepare_build_system - make showcommands ot-core make showcommands ot-cli - make showcommands ot-ncp - make showcommands spi-hdlc-adapter - test -x out/target/product/generic/system/bin/ot-cli + + if test "${USE_OTBR_DAEMON}" = 1; then + make showcommands ot-ctl + test -x out/target/product/generic/system/bin/ot-ctl + fi + + make showcommands ot-ncp test -x out/target/product/generic/system/bin/ot-ncp + + make showcommands spi-hdlc-adapter test -x out/target/product/generic/system/bin/spi-hdlc-adapter + } main "$@" diff --git a/Android.mk b/Android.mk index 4c1337f59..b5176c16c 100644 --- a/Android.mk +++ b/Android.mk @@ -60,8 +60,14 @@ OPENTHREAD_COMMON_FLAGS += \ $(NULL) endif -ifneq ($(USE_OTBR_DAEMON), 1) -OPENTHREAD_COMMON_FLAGS += -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1 +ifeq ($(USE_OTBR_DAEMON), 1) +OPENTHREAD_COMMON_FLAGS += \ + -DOPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1 \ + -DOPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1 \ + -DOPENTHREAD_ENABLE_POSIX_APP_DAEMON \ + $(NULL) +else +OPENTHREAD_COMMON_FLAGS += -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1 endif # Enable all optional features for CI tests. @@ -432,3 +438,25 @@ LOCAL_LDLIBS := \ LOCAL_STATIC_LIBRARIES = libopenthread-ncp ot-core include $(BUILD_EXECUTABLE) + +ifeq ($(USE_OTBR_DAEMON), 1) +include $(CLEAR_VARS) + +LOCAL_MODULE := ot-ctl +LOCAL_MODULE_TAGS := eng + +LOCAL_CFLAGS := \ + -DOPENTHREAD_CONFIG_FILE=\ \ + $(NULL) + +LOCAL_C_INCLUDES := \ + $(OPENTHREAD_PROJECT_INCLUDES) \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/src/core \ + $(LOCAL_PATH)/src/posix/platform \ + $(NULL) + +LOCAL_SRC_FILES := src/posix/client.cpp + +include $(BUILD_EXECUTABLE) +endif # ($(USE_OTBR_DAEMON), 1) diff --git a/src/posix/platform/netif.cpp b/src/posix/platform/netif.cpp index 70f6a5c14..b2b9d2507 100644 --- a/src/posix/platform/netif.cpp +++ b/src/posix/platform/netif.cpp @@ -68,6 +68,8 @@ #define OPENTHREAD_POSIX_TUN_DEVICE "/dev/net/tun" #endif // OPENTHREAD_TUN_DEVICE +// Some platforms will include linux/ipv6.h in netinet/in.h +#if !defined(_IPV6_H) && !defined(_UAPI_IPV6_H) // from linux/ipv6.h struct in6_ifreq { @@ -75,6 +77,7 @@ struct in6_ifreq __u32 ifr6_prefixlen; int ifr6_ifindex; }; +#endif static otInstance * sInstance = NULL; static int sTunFd = -1; ///< Used to exchange IPv6 packets.