From ef9b7e889db97402b55a94e3e0a6d5e7b7f91dfb Mon Sep 17 00:00:00 2001 From: Greg V Date: Tue, 10 Jul 2018 14:00:11 +0300 Subject: [PATCH] Use getprogname() when program_invocation_short_name is not defined --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index e3d81dae..931681a9 100644 --- a/meson.build +++ b/meson.build @@ -87,6 +87,12 @@ if cc.has_header_symbol('dirent.h', 'versionsort', prefix : prefix) config_h.set('HAVE_VERSIONSORT', '1') endif +if not cc.has_header_symbol('errno.h', 'program_invocation_short_name', prefix : prefix) + if cc.has_header_symbol('stdlib.h', 'getprogname') + config_h.set('program_invocation_short_name', 'getprogname()') + endif +endif + if cc.has_header('xlocale.h') config_h.set('HAVE_XLOCALE_H', '1') endif