From 859b63f815767a05efc3170da7ff22d2da232a30 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Wed, 26 May 2021 15:45:02 +0200 Subject: [PATCH] configure: add macro to check for __PROGNAME in include/c.h we check if HAVE___PROGNAME is defined, but the corresponding macro for setting (or not setting) it is missing from the configure script. This commit adds the missing macro, by copying it from the macro in tmux. --- configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 3e83fb88..659e57b5 100644 --- a/configure.ac +++ b/configure.ac @@ -116,6 +116,22 @@ AC_CHECK_HEADERS(error.h, [], [], AC_INCLUDES_DEFAULT) AC_CHECK_HEADERS(stdio_ext.h, [], [], AC_INCLUDES_DEFAULT) +AC_MSG_CHECKING(for __progname) +AC_LINK_IFELSE([AC_LANG_SOURCE( + [ + #include + #include + extern char *__progname; + int main(void) { + const char *cp = __progname; + printf("%s\n", cp); + exit(0); + } + ])], + AC_DEFINE(HAVE___PROGNAME, 1, [Define if __progname exists]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + AC_MSG_CHECKING(whether program_invocation_name is defined) AC_TRY_COMPILE([#include ], [program_invocation_name = "test";], -- 2.40.0