mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 03:08:38 +01:00
Use system __progname variable in progname module if available
This commit is contained in:
parent
b5cc17d664
commit
8723226040
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user