Commit b336a930 authored by Ulrich Huber's avatar Ulrich Huber Committed by Oliver Horst
Browse files

[add] Add syslog component with implementation for lwIP

parent 9bf3b1d1
add_subdirectory(elfloader)
add_subdirectory(hal)
add_subdirectory(syslog)
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
option(ENABLE_INSTALL "Enable target installation possibility" ON)
option(WITH_HEADERS "Enable build of separate header library" ON)
project(
toki-syslog-config-headers
#
VERSION 0.1
LANGUAGES C ASM
)
add_library(
toki-syslog-config-headers
#
INTERFACE
)
target_include_directories(
toki-syslog-config-headers
#
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:include>
)
if (ENABLE_INSTALL)
# Configure and install the following files:
# - ${PROJECT_NAME}-config.cmake,
# - ${PROJECT_NAME}-config-version.cmake,
include(CMakePackageConfigHelpers)
set(ConfigPackageLocation lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION})
# ${PROJECT_NAME}-config.cmake
configure_package_config_file(
${PROJECT_NAME}-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${ConfigPackageLocation}
)
# ${PROJECT_NAME}-config-config-version.cmake
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
COMPATIBILITY SameMajorVersion
)
# Install exported CMake target files
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
ARCHIVE DESTINATION lib
)
install(
EXPORT ${PROJECT_NAME}-targets
DESTINATION ${ConfigPackageLocation}
EXPORT_LINK_INTERFACE_LIBRARIES
)
# Install package/module configuration files
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION ${ConfigPackageLocation}
)
# If desired install all header files of the current project
get_target_property(PROJECT_INCLUDE_DIRECTORIES ${PROJECT_NAME} INTERFACE_INCLUDE_DIRECTORIES)
foreach(DIR ${PROJECT_INCLUDE_DIRECTORIES})
string(REGEX MATCH "^.<BUILD_INTERFACE:(.*)>$" EXTRACTED_DIR ${DIR})
if (CMAKE_MATCH_1)
set(EXTRACTED_DIR "${CMAKE_MATCH_1}")
file(
GLOB_RECURSE
#
HEADER_FILES
#
FOLLOW_SYMLINKS
LIST_DIRECTORIES FALSE
RELATIVE "${EXTRACTED_DIR}"
#
"${EXTRACTED_DIR}/*.h"
"${EXTRACTED_DIR}/*.hpp"
)
foreach(FILE ${HEADER_FILES})
get_filename_component(INSTALL_PATH ${FILE} DIRECTORY)
install(
FILES ${EXTRACTED_DIR}/${FILE}
DESTINATION include/${INSTALL_PATH}
)
endforeach()
endif()
endforeach()
endif()
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# Import targets
include(${CMAKE_CURRENT_LIST_DIR}/toki-syslog-config-headers-targets.cmake)
check_required_components(toki-syslog-config-headers)
#ifndef TOKI_SYSLOG_LWIP_CONFIG_H
#define TOKI_SYSLOG_LWIP_CONFIG_H
/*******************************************************************************
* lwIP logging configuration
******************************************************************************/
#define TOKI_SYSLOG_COMPONENT_LWIP_ENABLED 1
#define TOKI_SYSLOG_COMPONENT_LWIP_FACILITY "lwIP"
/**
* lwIP logging level (messages with a lower level are disabled)
* Component specific logging level takes precedence!
*
* Levels (0..7): Debug, Info, Notice, Warning, Error, Critical, Alert, Emergency
*/
#define TOKI_SYSLOG_COMPONENT_LWIP_LEVEL 0
/*******************************************************************************
* lwIP internal debug logging configuration
******************************************************************************/
/**
* Whether to enable debug messages in lwIP.
* Do not modify this. Instead modify TOKI_SYSLOG_COMPONENT_LWIP_LEVEL.
*/
#define LWIP_DEBUG (TOKI_SYSLOG_COMPONENT_LWIP_LEVEL <= 0)
/**
* Minimum level of debug messages
* See: include/lwip/debug.h:51
*/
#define LWIP_DBG_MIN_LEVEL 0x00 // ALL
/**
* What types of debug messages to print
* See: include/lwip/debug.h:70
*/
#define LWIP_DBG_TYPES_ON 0x80U // Enable debug messages
/**
* Different components of lwIP
* On: 0x80U | Off: 0x00U
* See: include/lwip/debug.h:70
*/
#define ETHARP_DEBUG 0x80U
#define NETIF_DEBUG 0x80U
#define PBUF_DEBUG 0x80U
#define API_LIB_DEBUG 0x80U
#define API_MSG_DEBUG 0x80U
#define SOCKETS_DEBUG 0x80U
#define ICMP_DEBUG 0x80U
#define IGMP_DEBUG 0x80U
#define INET_DEBUG 0x80U
#define IP_DEBUG 0x80U
#define IP_REASS_DEBUG 0x80U
#define RAW_DEBUG 0x80U
#define MEM_DEBUG 0x80U
#define MEMP_DEBUG 0x80U
#define SYS_DEBUG 0x80U
#define TIMERS_DEBUG 0x80U
#define TCP_DEBUG 0x80U
#define TCP_INPUT_DEBUG 0x80U
#define TCP_FR_DEBUG 0x80U
#define TCP_RTO_DEBUG 0x80U
#define TCP_CWND_DEBUG 0x80U
#define TCP_WND_DEBUG 0x80U
#define TCP_OUTPUT_DEBUG 0x80U
#define TCP_RST_DEBUG 0x80U
#define TCP_QLEN_DEBUG 0x80U
#define UDP_DEBUG 0x80U
#define TCPIP_DEBUG 0x80U
#define SLIP_DEBUG 0x80U
#define DHCP_DEBUG 0x80U
#define AUTOIP_DEBUG 0x80U
#define DNS_DEBUG 0x80U
#define IP6_DEBUG 0x80U
#define DHCP6_DEBUG 0x80U
#endif /* TOKI_SYSLOG_LWIP_CONFIG_H */
#ifndef TOKI_SYSLOG_CONFIG_H
#define TOKI_SYSLOG_CONFIG_H
/*******************************************************************************
* Global logging configuration
******************************************************************************/
#define TOKI_SYSLOG 1
#endif /* TOKI_SYSLOG_CONFIG_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment