[Buildroot] [PATCH] package/libpqxx: needs C++17

James Knight james.d.knight at live.com
Sat May 20 17:58:44 UTC 2023


libpqxx's v7.x series requires C++17 support. Adjust the configuration
selection to require a newer toolchain, as well as force a C++17
standard to ensure libpqxx's custom C++ standard check [1] passes.

Fixes:
 - http://autobuild.buildroot.net/results/a79cb93aec74acc8e32809530c09e26bebaf16e4/
 - http://autobuild.buildroot.net/results/ae1a02b5238b650cdc79edb298c398b078882cfc/

[1]: https://github.com/jtv/libpqxx/blob/7.7.5/configure.ac#L106-L124

Signed-off-by: James Knight <james.d.knight at live.com>
---
 package/libpqxx/Config.in  | 6 +++---
 package/libpqxx/libpqxx.mk | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/libpqxx/Config.in b/package/libpqxx/Config.in
index d06451d7928ec9adf21bbfc8535f0787899343d4..f5fe2b38079fb3c619710e387c4676d7744a2416 100644
--- a/package/libpqxx/Config.in
+++ b/package/libpqxx/Config.in
@@ -2,7 +2,7 @@ config BR2_PACKAGE_LIBPQXX
 	bool "libpqxx"
 	depends on BR2_PACKAGE_POSTGRESQL
 	depends on BR2_TOOLCHAIN_HAS_THREADS
-	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17
 	depends on BR2_INSTALL_LIBSTDCPP
 	help
 	  libpqxx is the official C++ client API for PostgreSQL, the
@@ -10,8 +10,8 @@ config BR2_PACKAGE_LIBPQXX
 
 	  http://pqxx.org/development/libpqxx/
 
-comment "libpqxx needs toolchain w/ C++, gcc >= 4.9, threads"
+comment "libpqxx needs toolchain w/ C++, gcc >= 7, threads"
 	depends on BR2_PACKAGE_POSTGRESQL
 	depends on !BR2_INSTALL_LIBSTDCPP || \
-		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \
 		!BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/libpqxx/libpqxx.mk b/package/libpqxx/libpqxx.mk
index b280f5a52a15b7c60d3da16ad326dbedac123137..434cefd06950e1a467fa31d23f9155764e8e12e8 100644
--- a/package/libpqxx/libpqxx.mk
+++ b/package/libpqxx/libpqxx.mk
@@ -11,6 +11,8 @@ LIBPQXX_DEPENDENCIES = postgresql
 LIBPQXX_LICENSE = BSD-3-Clause
 LIBPQXX_LICENSE_FILES = COPYING
 
-LIBPQXX_CONF_ENV += ac_cv_path_PG_CONFIG=$(STAGING_DIR)/usr/bin/pg_config
+LIBPQXX_CONF_ENV = \
+	ac_cv_path_PG_CONFIG=$(STAGING_DIR)/usr/bin/pg_config \
+	CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++17"
 
 $(eval $(autotools-package))
-- 
2.40.1.windows.1




More information about the buildroot mailing list