Skip to content

Commit 110d698

Browse files
dm0-gitster
authored andcommitted
Detect when the passwd struct is missing pw_gecos
NO_GECOS_IN_PWENT was documented with other Makefile variables but was only enforced by manually defining it to the C preprocessor. This adds support for detecting the condition with configure and defining the make variable. Signed-off-by: David Michael <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6ede720 commit 110d698

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,6 +1648,9 @@ endif
16481648
ifdef NO_D_INO_IN_DIRENT
16491649
BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
16501650
endif
1651+
ifdef NO_GECOS_IN_PWENT
1652+
BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
1653+
endif
16511654
ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
16521655
BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
16531656
endif

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,14 @@ AC_CHECK_MEMBER(struct dirent.d_type,
759759
[#include <dirent.h>])
760760
GIT_CONF_SUBST([NO_D_TYPE_IN_DIRENT])
761761
#
762+
# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
763+
# in the C library.
764+
AC_CHECK_MEMBER(struct passwd.pw_gecos,
765+
[NO_GECOS_IN_PWENT=],
766+
[NO_GECOS_IN_PWENT=YesPlease],
767+
[#include <pwd.h>])
768+
GIT_CONF_SUBST([NO_GECOS_IN_PWENT])
769+
#
762770
# Define NO_SOCKADDR_STORAGE if your platform does not have struct
763771
# sockaddr_storage.
764772
AC_CHECK_TYPE(struct sockaddr_storage,

0 commit comments

Comments
 (0)