diff --git a/Android.mk b/Android.mk index 4e3fa7df0..4c3b2176c 100644 --- a/Android.mk +++ b/Android.mk @@ -35,17 +35,25 @@ OPENTHREAD_SOURCE_VERSION := $(shell git -C $(LOCAL_PATH) describe --always --ma OPENTHREAD_PROJECT_CFLAGS ?= \ -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \ - -DOPENTHREAD_CONFIG_FILE=\ \ $(NULL) OPENTHREAD_PUBLIC_CFLAGS := \ - -DOPENTHREAD_CONFIG_PING_SENDER_ENABLE=1 \ + -DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \ + -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \ + -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \ -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \ + -DOPENTHREAD_CONFIG_DTLS_ENABLE=1 \ -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 \ + -DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \ + -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \ -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 \ -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \ - -DOPENTHREAD_POSIX_CONFIG_RCP_PTY_ENABLE=1 \ + -DOPENTHREAD_CONFIG_NCP_HDLC_ENABLE=1 \ + -DOPENTHREAD_CONFIG_PING_SENDER_ENABLE=1 \ + -DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 \ -DOPENTHREAD_FTD=1 \ + -DOPENTHREAD_PLATFORM_POSIX=1 \ + -DOPENTHREAD_POSIX_CONFIG_RCP_PTY_ENABLE=1 \ -DOPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE=1 \ $(NULL) diff --git a/CMakeLists.txt b/CMakeLists.txt index 540550e4a..f311fc921 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,6 @@ if(OT_BIG_ENDIAN) target_compile_definitions(ot-config INTERFACE "BYTE_ORDER_BIG_ENDIAN=1") endif() -include("${PROJECT_SOURCE_DIR}/etc/cmake/checks.cmake") include("${PROJECT_SOURCE_DIR}/etc/cmake/options.cmake") include("${PROJECT_SOURCE_DIR}/etc/cmake/functions.cmake") diff --git a/configure.ac b/configure.ac index 04b18b2fa..8c0c7fcca 100644 --- a/configure.ac +++ b/configure.ac @@ -990,6 +990,7 @@ CPPFLAGS="${CPPFLAGS} ${NL_COVERAGE_CPPFLAGS}" LIBS="${LIBS} ${NL_COVERAGE_LIBS}" LDFLAGS="${LDFLAGS} ${NL_COVERAGE_LDFLAGS}" +CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_CONFIG_FILE='\"openthread-config-generic.h\"'" # At this point, we can restore the compiler flags to whatever the # user passed in, now that we're clear of an -Werror issues by # transforming -Wno-error back to -Werror. diff --git a/etc/cmake/checks.cmake b/etc/cmake/checks.cmake deleted file mode 100644 index ab7bb88b8..000000000 --- a/etc/cmake/checks.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -configure_file(${PROJECT_SOURCE_DIR}/etc/cmake/openthread-config-generic.h.in ${PROJECT_BINARY_DIR}/etc/cmake/openthread-config-generic.h) diff --git a/etc/cmake/openthread-config-generic.h.in b/etc/cmake/openthread-config-generic.h.in deleted file mode 100644 index 95c23b8b1..000000000 --- a/etc/cmake/openthread-config-generic.h.in +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ diff --git a/etc/gn/openthread.gni b/etc/gn/openthread.gni index 1a8f285ee..a64d83370 100644 --- a/etc/gn/openthread.gni +++ b/etc/gn/openthread.gni @@ -26,9 +26,6 @@ # _openthread_config_file = "" -if (current_os == "fuchsia") { - _openthread_config_file = "" -} declare_args() { # OpenThread config header. diff --git a/include/openthread-config-android.h b/include/openthread-config-android.h deleted file mode 100644 index 2accf06cb..000000000 --- a/include/openthread-config-android.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2018, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef OPENTHREAD_CONFIG_ANDROID_VERSION_HEADER_ENABLE -#include -#endif - -/* Define to 1 to enable the border agent feature. */ -#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 1 - -/* Define to 1 if you want to enable Border Router */ -#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 1 - -/* Define to 1 if you want to enable channel manager feature */ -#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0 - -/* Define to 1 if you want to use channel monitor feature */ -#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 - -/* Define to 1 if you want to use child supervision feature */ -#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE 1 - -/* Define to 1 to enable dtls support. */ -#define OPENTHREAD_CONFIG_DTLS_ENABLE 1 - -/* Define to 1 if you want to use jam detection feature */ -#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 1 - -/* Define to 1 to enable the joiner role. */ -#define OPENTHREAD_CONFIG_JOINER_ENABLE 1 - -/* Define to 1 to enable the NCP HDLC interface. */ -#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1 - -/* Define to 1 to enable posix platform. */ -#define OPENTHREAD_PLATFORM_POSIX 1 - -/* Define to 1 if you want to enable Service */ -#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1 - -/* OpenThread examples */ -#define OPENTHREAD_EXAMPLES none diff --git a/include/openthread/BUILD.gn b/include/openthread/BUILD.gn index 3d50969d9..1b89d9dba 100644 --- a/include/openthread/BUILD.gn +++ b/include/openthread/BUILD.gn @@ -27,27 +27,10 @@ import("../../etc/gn/openthread.gni") -copy("copy_openthread_config_generic") { - sources = [ "../../etc/cmake/openthread-config-generic.h.in" ] - outputs = [ "${root_gen_dir}/include/{{source_name_part}}" ] -} - -config("openthread_config_generic_config") { - include_dirs = [ "${root_gen_dir}/include" ] -} - -source_set("openthread_config_generic") { - sources = [ "${root_gen_dir}/include/openthread-config-generic.h" ] - deps = [ ":copy_openthread_config_generic" ] - public_configs = [ ":openthread_config_generic_config" ] -} - source_set("openthread_config") { public = [ "config.h" ] - if (openthread_config_file == "") { - public_deps = [ ":openthread_config_generic" ] - } else { + if (openthread_config_file != "") { public_deps = openthread_config_deps } diff --git a/include/openthread/config.h b/include/openthread/config.h index 2a5fd26b6..090532c03 100644 --- a/include/openthread/config.h +++ b/include/openthread/config.h @@ -41,10 +41,8 @@ * The OpenThread feature configuration file. * */ -#if !defined(OPENTHREAD_CONFIG_FILE) -#define OPENTHREAD_CONFIG_FILE +#if defined(OPENTHREAD_CONFIG_FILE) +#include OPENTHREAD_CONFIG_FILE #endif -#include OPENTHREAD_CONFIG_FILE - #endif // OPENTHREAD_CONFIG_H_ diff --git a/include/openthread/instance.h b/include/openthread/instance.h index 06800a5b7..2f6d5cadf 100644 --- a/include/openthread/instance.h +++ b/include/openthread/instance.h @@ -53,7 +53,7 @@ extern "C" { * @note This number versions both OpenThread platform and user APIs. * */ -#define OPENTHREAD_API_VERSION (193) +#define OPENTHREAD_API_VERSION (194) /** * @addtogroup api-instance diff --git a/script/check-android-build b/script/check-android-build index cf2055704..e76ea9f9f 100755 --- a/script/check-android-build +++ b/script/check-android-build @@ -51,7 +51,6 @@ check_datetime() datetime="$(date)" cat >openthread-config-datetime.h < #define OPENTHREAD_BUILD_DATETIME "$datetime" EOF