From ae2c0d40ae61f56994c8d0fc4613ec9758dc2f08 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 19 Sep 2022 11:31:27 +0000 Subject: [PATCH 1/2] setpgrp cmake check: use #if, not #if defined. I still haven't got out of the habit of doing this the autotools way, which doesn't work in cmake. cmake's HAVE_FOO variables are always defined, and they take values 0 or 1, so testing them with 'defined' will return the wrong value. --- unix/pageant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/pageant.c b/unix/pageant.c index 6d125fce..4558cd37 100644 --- a/unix/pageant.c +++ b/unix/pageant.c @@ -330,9 +330,9 @@ void pageant_fork_and_print_env(bool retain_tty) /* Get out of our previous process group, to avoid being * blasted by passing signals. But keep our controlling tty, * so we can keep checking to see if we still have one. */ -#if defined HAVE_NULLARY_SETPGRP +#if HAVE_NULLARY_SETPGRP setpgrp(); -#elif defined HAVE_BINARY_SETPGRP +#elif HAVE_BINARY_SETPGRP setpgrp(0, 0); #endif } else { From 864b4c27fa67a95b2daa095923878bdba9fc6fcf Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 19 Sep 2022 11:34:21 +0000 Subject: [PATCH 2/2] Use GTK_LDFLAGS when testing for Pango. On FreeBSD, the GTK libraries aren't stored on the standard library path, so pkg-config has to emit a -L option as well as -l options. This worked fine during the main build, but the -L option wasn't being passed through to check_symbol_exists() for the tests of Pango API function availability. --- cmake/gtk.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/gtk.cmake b/cmake/gtk.cmake index 34396d2f..13ff7705 100644 --- a/cmake/gtk.cmake +++ b/cmake/gtk.cmake @@ -74,6 +74,7 @@ if(GTK_FOUND) # Check for some particular Pango functions. function(pango_check_subscope) set(CMAKE_REQUIRED_INCLUDES ${GTK_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LINK_OPTIONS ${GTK_LDFLAGS}) set(CMAKE_REQUIRED_LIBRARIES ${GTK_LIBRARIES}) check_symbol_exists(pango_font_family_is_monospace "pango/pango.h" HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)