Support builds when sys/param.h is missing

An option is added to the Makefile to skip the inclusion of sys/param.h. The only known platform with this condition thus far is the z/OS UNIX System Services environment. 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 6ede720529b00115abe46b8ab524bf06c58047e2
3 files changed +13
Makefile
+5
@@ -165,6 +165,8 @@ all::
165 # Define NO_POLL if you do not have or don't want to use poll().
166 # This also implies NO_SYS_POLL_H.
167 #
168 +# Define NO_SYS_PARAM_H if you don't have sys/param.h.
169 +#
170 # Define NO_PTHREADS if you do not have or do not want to use Pthreads.
171 #
172 # Define NO_PREAD if you have a problem with pread() system call (e.g.
@@ -1739,6 +1741,9 @@ endif
1741 ifdef NO_SYS_POLL_H
1742 BASIC_CFLAGS += -DNO_SYS_POLL_H
1743 endif
1744 +ifdef NO_SYS_PARAM_H
1745 + BASIC_CFLAGS += -DNO_SYS_PARAM_H
1746 +endif
1747 ifdef NO_INTTYPES_H
1748 BASIC_CFLAGS += -DNO_INTTYPES_H
1749 endif
configure.ac
+6
@@ -699,6 +699,12 @@ AC_CHECK_HEADER([sys/poll.h],
699 [NO_SYS_POLL_H=UnfortunatelyYes])
700 GIT_CONF_SUBST([NO_SYS_POLL_H])
701 #
702 +# Define NO_SYS_PARAM_H if you don't have sys/param.h
703 +AC_CHECK_HEADER([sys/param.h],
704 +[NO_SYS_PARAM_H=],
705 +[NO_SYS_PARAM_H=UnfortunatelyYes])
706 +GIT_CONF_SUBST([NO_SYS_PARAM_H])
707 +#
708 # Define NO_INTTYPES_H if you don't have inttypes.h
709 AC_CHECK_HEADER([inttypes.h],
710 [NO_INTTYPES_H=],
git-compat-util.h
+2
@@ -104,7 +104,9 @@
104 #endif
105 #include <errno.h>
106 #include <limits.h>
107 +#ifndef NO_SYS_PARAM_H
108 #include <sys/param.h>
109 +#endif
110 #include <sys/types.h>
111 #include <dirent.h>
112 #include <sys/time.h>