initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,62 @@
From cf5a3177159ca832470e7f876cab0a1923fa666f Mon Sep 17 00:00:00 2001
From: Peter Seiderer <ps.report@gmx.net>
Date: Fri, 22 Oct 2021 20:17:36 +0200
Subject: [PATCH] pkg-config: fix gtest.pc/gmock.pc library names for the debug
build
In case CMAKE_BUILD_TYPE is set to Debug the gtest library is
name libgtestd.a but the link command returned from gtest.pc is
'-lgtest' (without the debug d) and so the linking of dependent
packages fails (see [1] for a buildroot failure example).
Enhance the gtest.pc ang gmock.pc generation to honour the debug 'd'.
[1] http://lists.busybox.net/pipermail/buildroot/2021-October/626382.html
[Upstream: https://github.com/google/googletest/pull/3625]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
googlemock/cmake/gmock.pc.in | 2 +-
googletest/cmake/gtest.pc.in | 2 +-
googletest/cmake/internal_utils.cmake | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/googlemock/cmake/gmock.pc.in b/googlemock/cmake/gmock.pc.in
index 23c67b5c..0f469857 100644
--- a/googlemock/cmake/gmock.pc.in
+++ b/googlemock/cmake/gmock.pc.in
@@ -6,5 +6,5 @@ Description: GoogleMock (without main() function)
Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
Requires: gtest = @PROJECT_VERSION@
-Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@
+Libs: -L${libdir} -lgmock@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/googletest/cmake/gtest.pc.in b/googletest/cmake/gtest.pc.in
index b4148fae..225bba81 100644
--- a/googletest/cmake/gtest.pc.in
+++ b/googletest/cmake/gtest.pc.in
@@ -5,5 +5,5 @@ Name: gtest
Description: GoogleTest (without main() function)
Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
-Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@
+Libs: -L${libdir} -lgtest@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
index 58fc9bfb..fd81b825 100644
--- a/googletest/cmake/internal_utils.cmake
+++ b/googletest/cmake/internal_utils.cmake
@@ -335,6 +335,9 @@ function(install_project)
# Configure and install pkgconfig files.
foreach(t ${ARGN})
set(configured_pc "${generated_dir}/${t}.pc")
+ if(CMAKE_BUILD_TYPE MATCHES Debug)
+ set(DEBUG_POSTFIX "d")
+ endif()
configure_file("${PROJECT_SOURCE_DIR}/cmake/${t}.pc.in"
"${configured_pc}" @ONLY)
install(FILES "${configured_pc}"
--
2.33.1
+56
View File
@@ -0,0 +1,56 @@
config BR2_PACKAGE_GTEST
bool "gtest"
depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11
depends on BR2_USE_MMU # fork()
help
Google's framework for writing C++ tests on a variety of
platforms (Linux, Mac OS X, Windows, Cygwin, Windows CE, and
Symbian). Based on the xUnit architecture. Supports
automatic test discovery, a rich set of assertions,
user-defined assertions, death tests, fatal and non-fatal
failures, value- and type-parameterized tests, various
options for running the tests, and XML test report
generation.
Gtest also allows to easily build testsuites for C programs.
This package allows running testsuites on the target which
might be advantageous in certain cases.
https://github.com/google/googletest
if BR2_PACKAGE_GTEST
config BR2_PACKAGE_GTEST_GMOCK
bool "gmock"
help
Inspired by jMock, EasyMock, and Hamcrest, and designed with
C++'s specifics in mind, Google C++ Mocking Framework (or
Google Mock for short) is a library for writing and using C++
mock classes.
Google Mock:
* lets you create mock classes trivially using simple
macros, supports a rich set of matchers and actions,
* handles unordered, partially ordered, or completely
ordered expectations,
* is extensible by users, and
* works on Linux, Mac OS X, Windows, Windows Mobile, minGW,
and Symbian.
There are both host and target packages. The target one has
include files required to compile the tests and the static
libraries required to link/run them. The host package installs
gmock_gen, a Python script used to generate code mocks.
endif # BR2_PACKAGE_GTEST
comment "gtest needs a toolchain w/ C++, wchar, threads, gcc >= 4.9"
depends on BR2_USE_MMU
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_INSTALL_LIBSTDCPP || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+3
View File
@@ -0,0 +1,3 @@
# Locally computed:
sha256 b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5 gtest-1.11.0.tar.gz
sha256 9702de7e4117a8e2b20dafab11ffda58c198aede066406496bef670d40a22138 LICENSE
+65
View File
@@ -0,0 +1,65 @@
################################################################################
#
# gtest
#
################################################################################
GTEST_VERSION = 1.11.0
GTEST_SITE = $(call github,google,googletest,release-$(GTEST_VERSION))
GTEST_INSTALL_STAGING = YES
GTEST_INSTALL_TARGET = NO
GTEST_LICENSE = BSD-3-Clause
GTEST_LICENSE_FILES = LICENSE
GTEST_CPE_ID_VENDOR = google
GTEST_CPE_ID_PRODUCT = google_test
ifeq ($(BR2_PACKAGE_GTEST_GMOCK),y)
GTEST_DEPENDENCIES += host-gtest
endif
HOST_GTEST_LICENSE = Apache-2.0
HOST_GTEST_LICENSE_FILES = googlemock/scripts/generator/LICENSE
ifeq ($(BR2_PACKAGE_PYTHON3),y)
HOST_GTEST_PYTHON_VERSION = $(PYTHON3_VERSION_MAJOR)
HOST_GTEST_DEPENDENCIES += host-python3
else
HOST_GTEST_PYTHON_VERSION = $(PYTHON_VERSION_MAJOR)
HOST_GTEST_DEPENDENCIES += host-python
endif
HOST_GTEST_GMOCK_PYTHONPATH = \
$(HOST_DIR)/lib/python$(HOST_GTEST_PYTHON_VERSION)/site-packages
# While it is possible to build gtest as shared library, using this gtest shared
# library requires to set some special configure option in the project using
# gtest.
# So, force to build gtest as a static library.
#
# For further details, refer to the explaination given in the README file from
# the gtest sources.
GTEST_CONF_OPTS = -DBUILD_SHARED_LIBS=OFF
# Ensure that GTest is compiled with -fPIC to allow linking the static
# libraries with dynamically linked programs. This is not a requirement
# for most architectures but is mandatory for ARM.
ifeq ($(BR2_STATIC_LIBS),)
GTEST_CONF_OPTS += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
endif
ifeq ($(BR2_PACKAGE_GTEST_GMOCK),y)
GTEST_CONF_OPTS += -DBUILD_GMOCK=ON
else
GTEST_CONF_OPTS += -DBUILD_GMOCK=OFF
endif
define HOST_GTEST_INSTALL_CMDS
$(INSTALL) -D -m 0755 $(@D)/googlemock/scripts/generator/gmock_gen.py \
$(HOST_DIR)/bin/gmock_gen
cp -rp $(@D)/googlemock/scripts/generator/cpp \
$(HOST_GTEST_GMOCK_PYTHONPATH)
endef
$(eval $(cmake-package))
# The host package does not build anything, just installs gmock_gen stuff, so
# it does not need to be a host-cmake-package.
$(eval $(host-generic-package))