[build] move openthread-system.h under openthread (#4593)

This commit moves openthread-system.h to a directory named openthread
so that projects depends on OpenThread can use it without installing
OpenThread project.
This commit is contained in:
Yakun Xu
2020-02-24 13:16:03 -08:00
committed by GitHub
parent 87126b2b59
commit 24a24f1f9e
10 changed files with 49 additions and 38 deletions
+11 -5
View File
@@ -104,6 +104,7 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/src/core \
$(LOCAL_PATH)/src/ncp \
$(LOCAL_PATH)/src/posix/platform \
$(LOCAL_PATH)/src/posix/platform/include \
$(LOCAL_PATH)/third_party \
$(LOCAL_PATH)/third_party/mbedtls \
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
@@ -297,6 +298,7 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/src/cli \
$(LOCAL_PATH)/src/core \
$(LOCAL_PATH)/src/posix/platform \
$(LOCAL_PATH)/src/posix/platform/include \
$(LOCAL_PATH)/third_party/mbedtls \
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
$(NULL)
@@ -339,6 +341,7 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/src/cli \
$(LOCAL_PATH)/src/core \
$(LOCAL_PATH)/src/posix/platform \
$(LOCAL_PATH)/src/posix/platform/include \
$(LOCAL_PATH)/third_party/mbedtls \
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
$(NULL)
@@ -376,6 +379,7 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/src/core \
$(LOCAL_PATH)/src/ncp \
$(LOCAL_PATH)/src/posix/platform \
$(LOCAL_PATH)/src/posix/platform/include \
$(LOCAL_PATH)/third_party/mbedtls \
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
$(NULL)
@@ -414,6 +418,7 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/src/core \
$(LOCAL_PATH)/src/ncp \
$(LOCAL_PATH)/src/posix/platform \
$(LOCAL_PATH)/src/posix/platform/include \
$(LOCAL_PATH)/third_party/mbedtls \
$(LOCAL_PATH)/third_party/mbedtls/repo/include \
$(NULL)
@@ -449,11 +454,12 @@ LOCAL_CFLAGS := \
-DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\> \
$(NULL)
LOCAL_C_INCLUDES := \
$(OPENTHREAD_PROJECT_INCLUDES) \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/src/core \
$(LOCAL_PATH)/src/posix/platform \
LOCAL_C_INCLUDES := \
$(OPENTHREAD_PROJECT_INCLUDES) \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/src/core \
$(LOCAL_PATH)/src/posix/platform \
$(LOCAL_PATH)/src/posix/platform/include \
$(NULL)
LOCAL_SRC_FILES := src/posix/client.cpp
+1
View File
@@ -31,6 +31,7 @@ set(COMMON_INCLUDES
${OT_PRIVATE_INCLUDES}
${PROJECT_SOURCE_DIR}/src/core
${PROJECT_SOURCE_DIR}/src/posix/platform
${PROJECT_SOURCE_DIR}/src/posix/platform/include
)
if(OT_DAEMON)
+1
View File
@@ -50,6 +50,7 @@ CPPFLAGS_COMMON = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/core \
-I$(top_srcdir)/src/posix/platform \
-I$(top_srcdir)/src/posix/platform/include \
-D_GNU_SOURCE \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_MTD=0 \
+1 -1
View File
@@ -33,7 +33,7 @@
#include <stdint.h>
#include "openthread-system.h"
#include <openthread/openthread-system.h>
#ifdef __cplusplus
extern "C" {
+1 -1
View File
@@ -73,7 +73,7 @@
#else
#error "Unknown posix app type!"
#endif
#include <openthread-system.h>
#include <openthread/openthread-system.h>
#ifndef OPENTHREAD_ENABLE_COVERAGE
#define OPENTHREAD_ENABLE_COVERAGE 0
+2 -1
View File
@@ -73,6 +73,7 @@ target_include_directories(openthread-posix PRIVATE
${OT_PRIVATE_INCLUDES}
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/core
${PROJECT_SOURCE_DIR}/src/posix/platform
${PROJECT_SOURCE_DIR}/third_party/mbedtls/repo/include
PUBLIC
${PROJECT_SOURCE_DIR}/src/posix/platform/include
)
+17 -15
View File
@@ -30,15 +30,16 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
lib_LIBRARIES = libopenthread-posix.a
libopenthread_posix_a_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/core \
-I$(top_srcdir)/src/posix/platform \
-D_GNU_SOURCE \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_MTD=0 \
-DOPENTHREAD_RADIO=0 \
libopenthread_posix_a_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/core \
-I$(top_srcdir)/src/posix/platform \
-I$(top_srcdir)/src/posix/platform/include \
-D_GNU_SOURCE \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_MTD=0 \
-DOPENTHREAD_RADIO=0 \
$(NULL)
libopenthread_posix_a_SOURCES = \
@@ -66,7 +67,7 @@ noinst_HEADERS = \
$(NULL)
openthread_HEADERS = \
openthread-system.h \
include/openthread/openthread-system.h \
$(NULL)
openthreaddir = $(includedir)/openthread
@@ -84,11 +85,12 @@ endif # OPENTHREAD_BUILD_COVERAGE
check_PROGRAMS = test-settings
test_settings_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/core \
-DOPENTHREAD_CONFIG_LOG_PLATFORM=0 \
-DSELF_TEST \
test_settings_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/core \
-I$(top_srcdir)/src/posix/platform/include \
-DOPENTHREAD_CONFIG_LOG_PLATFORM=0 \
-DSELF_TEST \
$(NULL)
test_settings_SOURCES = \
+1 -1
View File
@@ -43,9 +43,9 @@
#include <sys/select.h>
#include <sys/time.h>
#include <openthread-system.h>
#include <openthread/error.h>
#include <openthread/instance.h>
#include <openthread/openthread-system.h>
#include "common/logging.hpp"
+14 -14
View File
@@ -39,7 +39,7 @@
#include "spinel_interface.hpp"
#include "ncp/hdlc.hpp"
#include <openthread-system.h>
#include <openthread/openthread-system.h>
#if OPENTHREAD_POSIX_RCP_SPI_ENABLE
@@ -153,22 +153,22 @@ private:
bool CheckInterrupt(void);
void HandleReceivedFrame(Ncp::SpiFrame &aSpiFrame);
void LogStats(void);
void LogError(const char * aString);
void LogError(const char *aString);
void LogBuffer(const char *aDesc, const uint8_t *aBuffer, uint16_t aLength, bool aForce);
enum
{
kSpiModeMax = 3,
kSpiAlignAllowanceMax = 16,
kSpiFrameHeaderSize = 5,
kSpiBitsPerWord = 8,
kSpiTxRefuseWarnCount = 30,
kSpiTxRefuseExitCount = 100,
kImmediateRetryCount = 5,
kFastRetryCount = 15,
kDebugBytesPerLine = 16,
kGpioIntAssertState = 0,
kGpioResetAssertState = 0,
kSpiModeMax = 3,
kSpiAlignAllowanceMax = 16,
kSpiFrameHeaderSize = 5,
kSpiBitsPerWord = 8,
kSpiTxRefuseWarnCount = 30,
kSpiTxRefuseExitCount = 100,
kImmediateRetryCount = 5,
kFastRetryCount = 15,
kDebugBytesPerLine = 16,
kGpioIntAssertState = 0,
kGpioResetAssertState = 0,
};
enum
@@ -212,7 +212,7 @@ private:
uint64_t mSpiTxFrameCount;
uint64_t mSpiTxFrameByteCount;
uint8_t mSpiRxFrameBuffer[kMaxFrameSize + kSpiAlignAllowanceMax];
uint8_t mSpiRxFrameBuffer[kMaxFrameSize + kSpiAlignAllowanceMax];
bool mSpiTxIsReady;
uint16_t mSpiTxRefusedCount;