"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Anna Vyalkova <cyber+misc@sysrq.in>
Subject:
[PATCH 4/4] portable: check for libbsd-ctor
To:
gameoftrees@openbsd.org
Date:
Wed, 22 Mar 2023 21:58:37 +0500

Download raw body.

Thread
This library is needed for libbsd's setprocitle(3) to work.
---
 configure.ac | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9e363bbde..a983b6d88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,14 +109,25 @@ if test "$PLATFORM" = "linux"; then
 		[
 			AC_MSG_ERROR("*** couldn't find libbsd-overlay via pkg-config")
 		]
+	)
 
+	PKG_CHECK_MODULES(
+		LIBBSD_CTOR,
+		libbsd-ctor,
+		[
+		 	libbsd_CFLAGS="$libbsd_CFLAGS $LIBBSD_CTOR_CFLAGS"
+			libbsd_LIBS="$libbsd_LIBS $LIBBSD_CTOR_LIBS"
+			AC_SUBST(libbsd_CFLAGS)
+			AC_SUBST(libbsd_LIBS)
+		],
+		[]
 	)
 
 	# Add LIBBSD_{CFLAGS,LIBS} to the environment here, as libbsd puts its
 	# header files in a non-standard location, which means the overlay for
 	# <sys/tree.h> and <sys/queue.h> won't be found.
-	CFLAGS="$CFLAGS $LIBBSD_CFLAGS"
-	LIBS="$LIBS $LIBBSD_LIBS"
+	CFLAGS="$CFLAGS $LIBBSD_CFLAGS $LIBBSD_CTOR_CFLAGS"
+	LIBS="$LIBS $LIBBSD_LIBS $LIBBSD_CTOR_LIBS"
 fi
 
 # Checks for header files.
-- 
2.40.0