From 95f946e314f1fcf8c4ccd4f3627fa0787d4344ef Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 5 Jul 2022 01:47:35 +0100 Subject: meson: set -D_GNU_SOURCE for updwtmpx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without setting GNU_SOURCE, we end up getting: ``` ../gdm-42.0/daemon/gdm-session-record.c:200:9: error: implicit declaration of function ‘updwtmpx’; did you mean ‘updwtmp’? [-Werror=implicit-function-declaration] updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record); ``` This ended up exposing a bug in updwtmp(3) (which is now fixed thanks to the man-pages maintainers!) as it didn't mention that updwtmpx is a GNU extension (and hence needs GNU_SOURCE in order to be available). Alternatively, we could just #define _GNU_SOURCE in gdm-session-record.c for updwtmpx. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216168 --- meson.build | 3 +++ 1 file changed, 3 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 845f673e..2c4f0060 100644 --- a/meson.build +++ b/meson.build @@ -12,6 +12,9 @@ i18n = import('i18n') # Compiler cc = meson.get_compiler('c') +# Use GNU extensions if available +add_project_arguments('-D_GNU_SOURCE', language: 'c') + # Options gdm_prefix = get_option('prefix') -- cgit v1.2.1