Skip to content

configure: add macro to check for __PROGNAME

Henrik Grimler requested to merge Grimler/procps:progname into master

Hi,

In include/c.h we check for different ways to get the program name:

#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
# ifdef HAVE___PROGNAME
extern char *__progname;
#  define program_invocation_short_name __progname
# else
#  ifdef HAVE_GETEXECNAME
#   define program_invocation_short_name \
		prog_inv_sh_nm_from_file(getexecname(), 0)
#  else
#   define program_invocation_short_name \
		prog_inv_sh_nm_from_file(__FILE__, 1)
#  endif
static char prog_inv_sh_nm_buf[256];

However, the macro for setting HAVE__PROGNAME seem to be missing from configure.ac, only way to use __progname is to modify the code or define HAVE__PROGNAME with some compiler flag.

This PR adds the missing macro, taken from tmux.

Related issue: #209 (closed)

Merge request reports