build: Conditionalize only id-from-name functions not the entire pwcache 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
diff --git a/configure.ac b/configure.ac
index 624494e..9b2c277 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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" && \
diff --git a/man/Makefile.am b/man/Makefile.am
index 91499e1..118ab2d 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -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
diff --git a/src/Makefile.am b/src/Makefile.am
index 3e26159..0648b03 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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 \
diff --git a/test/Makefile.am b/test/Makefile.am
index 13c2ae1..459012c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -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