]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
build: Conditionalize only id-from-name functions not the entire pwcache
authorGuillem Jover <guillem@hadrons.org>
Sun, 23 Apr 2023 00:00:10 +0000 (02:00 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 29 Apr 2023 01:52:42 +0000 (03:52 +0200)
On macOS the name-from-id functions are present, but not the
id-from-name ones, so we want to provide those instead of suppressing
the entire file.

configure.ac
man/Makefile.am
src/Makefile.am
test/Makefile.am

index 624494eb54aed0bf42bca014e16e34cb06f3ce2b..9b2c27777fb4d1b811abda3afc433c01482f2a83 100644 (file)
@@ -325,7 +325,7 @@ need_md5=yes
 need_nlist=yes
 need_strl=yes
 need_strmode=yes
-need_pwcache=yes
+need_id_from_name=yes
 need_fpurge=yes
 need_funopen=yes
 AS_CASE([$host_os],
@@ -355,7 +355,7 @@ AS_CASE([$host_os],
     need_nlist=no
     need_strl=no
     need_strmode=no
-    need_pwcache=no
+    need_id_from_name=no
     need_fpurge=no
     # On macOS we do not have fopencookie(), and cannot implement it.
     need_funopen=no
@@ -372,7 +372,7 @@ AM_CONDITIONAL([NEED_MD5], [test "x$need_md5" = "xyes"])
 AM_CONDITIONAL([NEED_NLIST], [test "x$need_nlist" = "xyes"])
 AM_CONDITIONAL([NEED_STRL], [test "x$need_strl" = "xyes"])
 AM_CONDITIONAL([NEED_STRMODE], [test "x$need_strmode" = "xyes"])
-AM_CONDITIONAL([NEED_PWCACHE], [test "x$need_pwcache" = "xyes"])
+AM_CONDITIONAL([NEED_ID_FROM_NAME], [test "x$need_id_from_name" = "xyes"])
 AM_CONDITIONAL([NEED_FPURGE], [test "x$need_fpurge" = "xyes"])
 AM_CONDITIONAL([NEED_FUNOPEN], [test "x$need_funopen" = "xyes"])
 AS_IF([test "x$need_funopen" = "xno" && \
index 91499e1ab5b4a67b6bfef3a03cbfa1d97ff77064..118ab2daae14e0632b23c2eeb756d3494301021e 100644 (file)
@@ -180,6 +180,7 @@ dist_man_MANS = \
        getbsize.3bsd \
        getmode.3bsd \
        getpeereid.3bsd \
+       group_from_gid.3bsd \
        heapsort.3bsd \
        humanize_number.3bsd \
        le16dec.3bsd \
@@ -195,6 +196,7 @@ dist_man_MANS = \
        pidfile_open.3bsd \
        pidfile_remove.3bsd \
        pidfile_write.3bsd \
+       pwcache.3bsd \
        queue.3bsd \
        radixsort.3bsd \
        readpassphrase.3bsd \
@@ -234,6 +236,7 @@ dist_man_MANS = \
        timeval.3bsd \
        tree.3bsd \
        unvis.3bsd \
+       user_from_uid.3bsd \
        vis.3bsd \
        wcslcat.3bsd \
        wcslcpy.3bsd \
@@ -271,13 +274,10 @@ dist_man_MANS += \
        # EOL
 endif
 
-if NEED_PWCACHE
+if NEED_ID_FROM_NAME
 dist_man_MANS += \
-       pwcache.3bsd \
        uid_from_user.3bsd \
-       user_from_uid.3bsd \
        gid_from_group.3bsd \
-       group_from_gid.3bsd \
        # EOL
 endif
 
index 3e26159a527c89f1fcb8e9462e890e1b5071ae1d..0648b03a972e1f06bd81433ee7aa84a32254fda2 100644 (file)
@@ -96,6 +96,7 @@ libbsd_la_SOURCES = \
        merge.c \
        pidfile.c \
        progname.c \
+       pwcache.c \
        radixsort.c \
        readpassphrase.c \
        reallocarray.c \
@@ -163,12 +164,6 @@ libbsd_la_SOURCES += \
        # EOL
 endif
 
-if NEED_PWCACHE
-libbsd_la_SOURCES += \
-       pwcache.c \
-       # EOL
-endif
-
 if NEED_FPURGE
 libbsd_la_SOURCES += \
        fpurge.c \
index 13c2ae1a3daf89413291bef49bea0a2739b90f1b..459012cd4084c7480776c3f216f5f9fcbffc0c3b 100644 (file)
@@ -41,6 +41,7 @@ check_PROGRAMS = \
        fgetln \
        fparseln \
        proctitle-init \
+       pwcache \
        setmode \
        strnstr \
        strtonum \
@@ -64,10 +65,6 @@ if NEED_STRMODE
 check_PROGRAMS += strmode
 endif
 
-if NEED_PWCACHE
-check_PROGRAMS += pwcache
-endif
-
 if NEED_FPURGE
 check_PROGRAMS += fpurge
 endif