From 6ede720529b00115abe46b8ab524bf06c58047e2 Mon Sep 17 00:00:00 2001 From: David Michael Date: Fri, 14 Dec 2012 14:56:58 -0500 Subject: 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 Signed-off-by: Junio C Hamano --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6b73c14aa0..81c12db274 100644 --- a/Makefile +++ b/Makefile @@ -165,6 +165,8 @@ all:: # Define NO_POLL if you do not have or don't want to use poll(). # This also implies NO_SYS_POLL_H. # +# Define NO_SYS_PARAM_H if you don't have sys/param.h. +# # 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. @@ -1739,6 +1741,9 @@ endif ifdef NO_SYS_POLL_H BASIC_CFLAGS += -DNO_SYS_POLL_H endif +ifdef NO_SYS_PARAM_H + BASIC_CFLAGS += -DNO_SYS_PARAM_H +endif ifdef NO_INTTYPES_H BASIC_CFLAGS += -DNO_INTTYPES_H endif -- cgit v1.2.1 From 110d6985463886ecc53dbafe32e626704ec612cb Mon Sep 17 00:00:00 2001 From: David Michael Date: Fri, 14 Dec 2012 14:56:59 -0500 Subject: 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 Signed-off-by: Junio C Hamano --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 81c12db274..e953951be8 100644 --- 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 -- cgit v1.2.1 From b3e103dabeb01555f8766b74de73493f7a6ba048 Mon Sep 17 00:00:00 2001 From: David Michael Date: Fri, 14 Dec 2012 14:57:01 -0500 Subject: Generalize the inclusion of strings.h The header strings.h was formerly only included for HP NonStop (aka Tandem) to define strcasecmp, but another platform requiring this inclusion has been found. The build system will now include the file based on its presence determined by configure. Signed-off-by: David Michael Signed-off-by: Junio C Hamano --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e953951be8..5cd1de02c7 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. @@ -1350,6 +1352,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 @@ -1883,6 +1886,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 -- cgit v1.2.1 From b2d05e0653f29a75b57260c4d963d560ad65691b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 18 Dec 2012 09:35:33 -0800 Subject: git-compat-util.h: do not #include by default Earlier we allowed platforms that lack not to include the header file from git-compat-util.h; we have included this header file since the early days back when we used MAXPATHLEN (which we no longer use) and also depended on it slurping ULONG_MAX (which we get by including stdint.h or inttypes.h these days). It turns out that we can compile our modern codebase just file without including it on many platforms (so far, Fedora, Debian, Ubuntu, MinGW, Mac OS X, Cygwin, HP-Nonstop, QNX and z/OS are reported to be OK). Let's stop including it by default, and on platforms that need it to be included, leave "make NEEDS_SYS_PARAM_H=YesPlease" as an escape hatch and ask them to report to us, so that we can find out about the real dependency and fix it in a more platform agnostic way. Signed-off-by: Junio C Hamano --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5cd1de02c7..2c1f04ff1a 100644 --- a/Makefile +++ b/Makefile @@ -167,7 +167,9 @@ all:: # Define NO_POLL if you do not have or don't want to use poll(). # This also implies NO_SYS_POLL_H. # -# Define NO_SYS_PARAM_H if you don't have sys/param.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. # @@ -1747,8 +1749,8 @@ endif ifdef NO_SYS_POLL_H BASIC_CFLAGS += -DNO_SYS_POLL_H endif -ifdef NO_SYS_PARAM_H - BASIC_CFLAGS += -DNO_SYS_PARAM_H +ifdef NEEDS_SYS_PARAM_H + BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H endif ifdef NO_INTTYPES_H BASIC_CFLAGS += -DNO_INTTYPES_H -- cgit v1.2.1