]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
build: Conditionalize getprogname()/setprogname on macOS
authorGuillem Jover <guillem@hadrons.org>
Sat, 22 Apr 2023 20:47:10 +0000 (22:47 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 22 Apr 2023 20:47:33 +0000 (22:47 +0200)
These functions are provided by the system libc, so there is no need for
us to provide them.

configure.ac
include/bsd/stdlib.h
man/Makefile.am
test/Makefile.am

index f0762f68074605acf486c0bd853eaf5802e21069..624494eb54aed0bf42bca014e16e34cb06f3ce2b 100644 (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"])
index bba13af2e532c092743fa20ed88f6729e8f1cae2..51c58e8c826a6145a31f69e5b8b43017e31ad1bd 100644 (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,
index bc30c87de4665fe9527a606916993f5e36bd239a..91499e1ab5b4a67b6bfef3a03cbfa1d97ff77064 100644 (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 \
index 7d220f703556fafa57ff42a939cf515cf8282721..13c2ae1a3daf89413291bef49bea0a2739b90f1b 100644 (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