build: Conditionalize getprogname()/setprogname on macOS

These functions are provided by the system libc, so there is no need for
us to provide them.
This commit is contained in:
Guillem Jover 2023-04-22 22:47:10 +02:00
parent 8f998d1d20
commit edc746ea7b
4 changed files with 16 additions and 3 deletions

View File

@ -320,6 +320,7 @@ AC_CHECK_FUNCS([\
need_arc4random=yes
need_bsd_getopt=yes
need_progname=yes
need_md5=yes
need_nlist=yes
need_strl=yes
@ -348,6 +349,7 @@ AS_CASE([$host_os],
# there, so we can avoid providing these with no ABI breakage.
need_arc4random=no
need_bsd_getopt=no
need_progname=no
need_transparent_libmd=no
need_md5=no
need_nlist=no
@ -364,6 +366,7 @@ AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xyes"])
AM_CONDITIONAL([NEED_ARC4RANDOM], [test "x$need_arc4random" = "xyes"])
AM_CONDITIONAL([NEED_BSD_GETOPT], [test "x$need_bsd_getopt" = "xyes"])
AM_CONDITIONAL([NEED_PROGNAME], [test "x$need_progname" = "xyes"])
AM_CONDITIONAL([NEED_TRANSPARENT_LIBMD], [test "x$need_transparent_libmd" = "xyes"])
AM_CONDITIONAL([NEED_MD5], [test "x$need_md5" = "xyes"])
AM_CONDITIONAL([NEED_NLIST], [test "x$need_nlist" = "xyes"])

View File

@ -65,8 +65,10 @@ void arc4random_addrandom(unsigned char *dat, int datlen);
int dehumanize_number(const char *str, int64_t *size);
#if !defined(__APPLE__)
const char *getprogname(void);
void setprogname(const char *);
#endif
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
int mergesort(void *base, size_t nmemb, size_t size,

View File

@ -180,7 +180,6 @@ dist_man_MANS = \
getbsize.3bsd \
getmode.3bsd \
getpeereid.3bsd \
getprogname.3bsd \
heapsort.3bsd \
humanize_number.3bsd \
le16dec.3bsd \
@ -205,7 +204,6 @@ dist_man_MANS = \
setmode.3bsd \
setproctitle.3bsd \
setproctitle_init.3bsd \
setprogname.3bsd \
sl_add.3bsd \
sl_delete.3bsd \
sl_find.3bsd \
@ -241,6 +239,13 @@ dist_man_MANS = \
wcslcpy.3bsd \
# EOL
if NEED_PROGNAME
dist_man_MANS += \
getprogname.3bsd \
setprogname.3bsd \
# EOL
endif
if NEED_MD5
dist_man_MANS += \
md5.3bsd \

View File

@ -41,7 +41,6 @@ check_PROGRAMS = \
fgetln \
fparseln \
proctitle-init \
progname \
setmode \
strnstr \
strtonum \
@ -49,6 +48,10 @@ check_PROGRAMS = \
vis-openbsd \
# EOL
if NEED_PROGNAME
check_PROGRAMS += progname
endif
if NEED_NLIST
check_PROGRAMS += nlist
endif