Commit 87232260 authored by Guillem Jover's avatar Guillem Jover

Use system __progname variable in progname module if available

parent b5cc17d6
......@@ -37,6 +37,15 @@ AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Checks for library functions.
AC_MSG_CHECKING([for __progname])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]],
[[extern char *__progname;
const char *p = __progname;]])],
[AC_DEFINE([HAVE___PROGNAME], [1], [Define to 1 if you have __progname])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AC_CHECK_FUNCS([getexecname])
AC_CONFIG_FILES([
......
......@@ -33,7 +33,11 @@
#include <string.h>
#include <stdlib.h>
#ifdef HAVE___PROGNAME
extern const char *__progname;
#else
static const char *__progname = NULL;
#endif
const char *
getprogname(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment