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 <fedora.dm0@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Michael committed Dec 14, 2012 at 14:56 UTC 110d6985463886ecc53dbafe32e626704ec612cb
2 files changed +11
Makefile
+3
@@ -1648,6 +1648,9 @@ endif
1648 ifdef NO_D_INO_IN_DIRENT
1649 BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
1650 endif
1651 +ifdef NO_GECOS_IN_PWENT
1652 + BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
1653 +endif
1654 ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
1655 BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
1656 endif
configure.ac
+8
@@ -759,6 +759,14 @@ AC_CHECK_MEMBER(struct dirent.d_type,
759 [#include <dirent.h>])
760 GIT_CONF_SUBST([NO_D_TYPE_IN_DIRENT])
761 #
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 +#
770 # Define NO_SOCKADDR_STORAGE if your platform does not have struct
771 # sockaddr_storage.
772 AC_CHECK_TYPE(struct sockaddr_storage,