initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
From 2e4cf095afdcf843e93d1bdea9dbd961558f09bd Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sun, 13 Jan 2019 21:01:19 +0100
|
||||
Subject: [PATCH] SerialPort.cpp: fix build when size_t is an unsigned int
|
||||
|
||||
size_t can be defined as an unsigned int instead of long unsigned int so
|
||||
replace 1UL to (size_t)1 when calling max function
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
[Upstream status: https://github.com/crayzeewulf/libserial/pull/126]
|
||||
---
|
||||
src/SerialPort.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/SerialPort.cpp b/src/SerialPort.cpp
|
||||
index e354fcb..75e762e 100644
|
||||
--- a/src/SerialPort.cpp
|
||||
+++ b/src/SerialPort.cpp
|
||||
@@ -2208,7 +2208,7 @@ namespace LibSerial
|
||||
|
||||
// Local variables.
|
||||
size_t number_of_bytes_read = 0 ;
|
||||
- size_t number_of_bytes_remaining = std::max(numberOfBytes, 1UL) ;
|
||||
+ size_t number_of_bytes_remaining = std::max(numberOfBytes, (size_t)1) ;
|
||||
size_t maximum_number_of_bytes = dataBuffer.max_size() ;
|
||||
|
||||
// Clear the data buffer and reserve enough space in the buffer to store the incoming data.
|
||||
@@ -2302,7 +2302,7 @@ namespace LibSerial
|
||||
|
||||
// Local variables.
|
||||
size_t number_of_bytes_read = 0 ;
|
||||
- size_t number_of_bytes_remaining = std::max(numberOfBytes, 1UL) ;
|
||||
+ size_t number_of_bytes_remaining = std::max(numberOfBytes, (size_t)1) ;
|
||||
size_t maximum_number_of_bytes = dataString.max_size() ;
|
||||
|
||||
// Clear the data buffer and reserve enough space in the buffer to store the incoming data.
|
||||
--
|
||||
2.14.1
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From fc0f031563146b91d255c752a61624f6dd3c14d4 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Tue, 15 Jan 2019 08:33:27 +0100
|
||||
Subject: [PATCH] SerialPort.cpp: don't use high baudrates when not available
|
||||
|
||||
On certain architectures (namely Sparc), the maximum baud rate exposed
|
||||
by the kernel headers is B2000000. Therefore, the current libserial
|
||||
code doesn't build for the Sparc and Sparc64 architectures due to
|
||||
this.
|
||||
|
||||
In order to address this problem, this patch tests the value of
|
||||
__MAX_BAUD. If it's higher than B2000000 then we assume we're on an
|
||||
architecture that supports all baud rates up to B4000000. Otherwise,
|
||||
we simply don't support the baud rates above B2000000.
|
||||
|
||||
Fixes build failures such as:
|
||||
|
||||
SerialPort.cpp: In member function 'int LibSerial::SerialPort::Implementation::GetBitRate(const LibSerial::BaudRate&) const':
|
||||
SerialPort.cpp:1226:14: error: 'BAUD_2000000' is not a member of 'LibSerial::BaudRate'
|
||||
case BaudRate::BAUD_2000000:
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.org/results/63ba95b6786464fa8e75af64593010df84530079
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
[Upstream status: https://github.com/crayzeewulf/libserial/pull/127]
|
||||
---
|
||||
src/SerialPort.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/SerialPort.cpp b/src/SerialPort.cpp
|
||||
index e3240eb..18daac0 100644
|
||||
--- a/src/SerialPort.cpp
|
||||
+++ b/src/SerialPort.cpp
|
||||
@@ -1223,6 +1223,7 @@ namespace LibSerial
|
||||
baud_rate_as_int = 1500000 ;
|
||||
break ;
|
||||
|
||||
+#if __MAX_BAUD > B2000000
|
||||
case BaudRate::BAUD_2000000:
|
||||
baud_rate_as_int = 2000000 ;
|
||||
break ;
|
||||
@@ -1242,6 +1243,7 @@ namespace LibSerial
|
||||
case BaudRate::BAUD_4000000:
|
||||
baud_rate_as_int = 4000000 ;
|
||||
break ;
|
||||
+#endif /* __MAX_BAUD */
|
||||
default:
|
||||
// If an incorrect baud rate was specified, throw an exception.
|
||||
throw std::runtime_error(ERR_MSG_INVALID_BAUD_RATE) ;
|
||||
--
|
||||
2.14.1
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
config BR2_PACKAGE_LIBSERIAL
|
||||
bool "libserial"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # C++14
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # boost
|
||||
depends on BR2_USE_WCHAR # boost
|
||||
select BR2_PACKAGE_BOOST
|
||||
help
|
||||
Simplified serial port programming in C++ under POSIX
|
||||
operating systems.
|
||||
|
||||
http://libserial.sourceforge.net/
|
||||
|
||||
comment "libserial needs a toolchain w/ C++, gcc >= 5, threads, wchar"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || \
|
||||
!BR2_TOOLCHAIN_GCC_AT_LEAST_5 || \
|
||||
!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 063142d6bfe08898316e9a6055f2ddeedef56de06f7cfc8dcdfecc6efabf4bdd libserial-1.0.0.tar.gz
|
||||
sha256 c42fdfe17c192cfdb900e22d40ef246db1b473f99165e405eda62b41be27f4bf LICENSE.txt
|
||||
@@ -0,0 +1,21 @@
|
||||
################################################################################
|
||||
#
|
||||
# libserial
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIBSERIAL_VERSION = 1.0.0
|
||||
LIBSERIAL_SITE = $(call github,crayzeewulf,libserial,v$(LIBSERIAL_VERSION))
|
||||
LIBSERIAL_INSTALL_STAGING = YES
|
||||
LIBSERIAL_LICENSE = BSD-3-Clause
|
||||
LIBSERIAL_LICENSE_FILES = LICENSE.txt
|
||||
LIBSERIAL_DEPENDENCIES = boost
|
||||
# From git
|
||||
LIBSERIAL_AUTORECONF = YES
|
||||
|
||||
LIBSERIAL_CONF_ENV = ac_cv_prog_DOCBOOK2PDF=no
|
||||
LIBSERIAL_CONF_OPTS = \
|
||||
--disable-tests \
|
||||
--without-python
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user