aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-01-03 10:28:21 -0800
committerJunio C Hamano <gitster@pobox.com>2013-01-03 10:28:21 -0800
commit324dfac8c990c38b1f8eb5a736be4e9e6b490e48 (patch)
treeb2c8bcbfd14e3d193a921625af120fea710d7164
parent0266f4688ce2eab25629a2aa4ccd5032944311c8 (diff)
parentb2d05e0653f29a75b57260c4d963d560ad65691b (diff)
downloadgit-324dfac8c990c38b1f8eb5a736be4e9e6b490e48.tar.gz
git-324dfac8c990c38b1f8eb5a736be4e9e6b490e48.tar.xz
Merge branch 'dm/port'
Add a few more knobs for new platform ports can tweak. * dm/port: git-compat-util.h: do not #include <sys/param.h> by default Generalize the inclusion of strings.h Detect when the passwd struct is missing pw_gecos Support builds when sys/param.h is missing
-rw-r--r--Makefile17
-rw-r--r--configure.ac14
-rw-r--r--git-compat-util.h4
3 files changed, 34 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 736ecd45b..6ecf66e81 100644
--- a/Makefile
+++ b/Makefile
@@ -74,6 +74,8 @@ all::
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
#
+# Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp.
+#
# Define NO_STRCASESTR if you don't have strcasestr.
#
# Define NO_MEMMEM if you don't have memmem.
@@ -165,6 +167,10 @@ all::
# Define NO_POLL if you do not have or don't want to use poll().
# This also implies NO_SYS_POLL_H.
#
+# Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile,
+# *PLEASE* REPORT to git@vger.kernel.org if your platform needs this;
+# we want to know more about the issue.
+#
# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
#
# Define NO_PREAD if you have a problem with pread() system call (e.g.
@@ -1353,6 +1359,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
# Added manually, see above.
NEEDS_SSL_WITH_CURL = YesPlease
HAVE_LIBCHARSET_H = YesPlease
+ HAVE_STRINGS_H = YesPlease
NEEDS_LIBICONV = YesPlease
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
NO_SYS_SELECT_H = UnfortunatelyYes
@@ -1655,6 +1662,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
@@ -1748,6 +1758,9 @@ endif
ifdef NO_SYS_POLL_H
BASIC_CFLAGS += -DNO_SYS_POLL_H
endif
+ifdef NEEDS_SYS_PARAM_H
+ BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H
+endif
ifdef NO_INTTYPES_H
BASIC_CFLAGS += -DNO_INTTYPES_H
endif
@@ -1884,6 +1897,10 @@ ifdef HAVE_LIBCHARSET_H
EXTLIBS += $(CHARSET_LIB)
endif
+ifdef HAVE_STRINGS_H
+ BASIC_CFLAGS += -DHAVE_STRINGS_H
+endif
+
ifdef HAVE_DEV_TTY
BASIC_CFLAGS += -DHAVE_DEV_TTY
endif
diff --git a/configure.ac b/configure.ac
index ad215cc4a..dc6925f11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -753,6 +753,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,
@@ -872,6 +880,12 @@ AC_CHECK_HEADER([libcharset.h],
[HAVE_LIBCHARSET_H=YesPlease],
[HAVE_LIBCHARSET_H=])
GIT_CONF_SUBST([HAVE_LIBCHARSET_H])
+#
+# Define HAVE_STRINGS_H if you have strings.h
+AC_CHECK_HEADER([strings.h],
+[HAVE_STRINGS_H=YesPlease],
+[HAVE_STRINGS_H=])
+GIT_CONF_SUBST([HAVE_STRINGS_H])
# Define CHARSET_LIB if libiconv does not export the locale_charset symbol
# and libcharset does
CHARSET_LIB=
diff --git a/git-compat-util.h b/git-compat-util.h
index 2e79b8a2f..a88147b2d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -99,12 +99,14 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
-#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */
+#ifdef HAVE_STRINGS_H
#include <strings.h> /* for strcasecmp() */
#endif
#include <errno.h>
#include <limits.h>
+#ifdef NEEDS_SYS_PARAM_H
#include <sys/param.h>
+#endif
#include <sys/types.h>
#include <dirent.h>
#include <sys/time.h>