Detect when the passwd struct is missing pw_gecos
authorDavid Michael <fedora.dm0@gmail.com>
Fri, 14 Dec 2012 19:56:59 +0000 (14:56 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 15 Dec 2012 18:15:45 +0000 (10:15 -0800)
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 <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
configure.ac
index 81c12db274112fbe973c203eb5026dc197b9efbd..e953951be89cde3c8e746f43db939f4d3a620b99 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1648,6 +1648,9 @@ endif
 ifdef NO_D_INO_IN_DIRENT
        BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
 endif
+ifdef NO_GECOS_IN_PWENT
+       BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
+endif
 ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
        BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
 endif
index 1393aa336cd3addc72b327d8d38b91afdd867dbf..66d0c91ece108ef812c2547658369e901e2f316b 100644 (file)
@@ -759,6 +759,14 @@ AC_CHECK_MEMBER(struct dirent.d_type,
 [#include <dirent.h>])
 GIT_CONF_SUBST([NO_D_TYPE_IN_DIRENT])
 #
+# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
+# in the C library.
+AC_CHECK_MEMBER(struct passwd.pw_gecos,
+[NO_GECOS_IN_PWENT=],
+[NO_GECOS_IN_PWENT=YesPlease],
+[#include <pwd.h>])
+GIT_CONF_SUBST([NO_GECOS_IN_PWENT])
+#
 # Define NO_SOCKADDR_STORAGE if your platform does not have struct
 # sockaddr_storage.
 AC_CHECK_TYPE(struct sockaddr_storage,