summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHenrik Grimler <henrik@grimler.se>2021-05-26 15:45:02 +0200
committerCraig Small <csmall@dropbear.xyz>2021-05-29 16:14:52 +1000
commitc63c712134e4e580b51c30a275dd4f32ff15331e (patch)
treeb4ca17a3deb588e50c8dcdd634491cf7ac17dcc0 /configure.ac
parentd293b686e4ebba4a9e2ce22ea521204010d1ed13 (diff)
downloadprocps-ng-c63c712134e4e580b51c30a275dd4f32ff15331e.tar.gz
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.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 88831b3..1d303b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,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 <stdio.h>
+ #include <stdlib.h>
+ 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 <errno.h>],
[program_invocation_name = "test";],