Skip to content

Commit 324dfac

Browse files
committed
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
2 parents 0266f46 + b2d05e0 commit 324dfac

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ all::
7474
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
7575
# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
7676
#
77+
# Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp.
78+
#
7779
# Define NO_STRCASESTR if you don't have strcasestr.
7880
#
7981
# Define NO_MEMMEM if you don't have memmem.
@@ -165,6 +167,10 @@ all::
165167
# Define NO_POLL if you do not have or don't want to use poll().
166168
# This also implies NO_SYS_POLL_H.
167169
#
170+
# Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile,
171+
# *PLEASE* REPORT to [email protected] if your platform needs this;
172+
# we want to know more about the issue.
173+
#
168174
# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
169175
#
170176
# Define NO_PREAD if you have a problem with pread() system call (e.g.
@@ -1353,6 +1359,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
13531359
# Added manually, see above.
13541360
NEEDS_SSL_WITH_CURL = YesPlease
13551361
HAVE_LIBCHARSET_H = YesPlease
1362+
HAVE_STRINGS_H = YesPlease
13561363
NEEDS_LIBICONV = YesPlease
13571364
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
13581365
NO_SYS_SELECT_H = UnfortunatelyYes
@@ -1655,6 +1662,9 @@ endif
16551662
ifdef NO_D_INO_IN_DIRENT
16561663
BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
16571664
endif
1665+
ifdef NO_GECOS_IN_PWENT
1666+
BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
1667+
endif
16581668
ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
16591669
BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
16601670
endif
@@ -1748,6 +1758,9 @@ endif
17481758
ifdef NO_SYS_POLL_H
17491759
BASIC_CFLAGS += -DNO_SYS_POLL_H
17501760
endif
1761+
ifdef NEEDS_SYS_PARAM_H
1762+
BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H
1763+
endif
17511764
ifdef NO_INTTYPES_H
17521765
BASIC_CFLAGS += -DNO_INTTYPES_H
17531766
endif
@@ -1884,6 +1897,10 @@ ifdef HAVE_LIBCHARSET_H
18841897
EXTLIBS += $(CHARSET_LIB)
18851898
endif
18861899

1900+
ifdef HAVE_STRINGS_H
1901+
BASIC_CFLAGS += -DHAVE_STRINGS_H
1902+
endif
1903+
18871904
ifdef HAVE_DEV_TTY
18881905
BASIC_CFLAGS += -DHAVE_DEV_TTY
18891906
endif

configure.ac

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,14 @@ AC_CHECK_MEMBER(struct dirent.d_type,
753753
[#include <dirent.h>])
754754
GIT_CONF_SUBST([NO_D_TYPE_IN_DIRENT])
755755
#
756+
# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
757+
# in the C library.
758+
AC_CHECK_MEMBER(struct passwd.pw_gecos,
759+
[NO_GECOS_IN_PWENT=],
760+
[NO_GECOS_IN_PWENT=YesPlease],
761+
[#include <pwd.h>])
762+
GIT_CONF_SUBST([NO_GECOS_IN_PWENT])
763+
#
756764
# Define NO_SOCKADDR_STORAGE if your platform does not have struct
757765
# sockaddr_storage.
758766
AC_CHECK_TYPE(struct sockaddr_storage,
@@ -872,6 +880,12 @@ AC_CHECK_HEADER([libcharset.h],
872880
[HAVE_LIBCHARSET_H=YesPlease],
873881
[HAVE_LIBCHARSET_H=])
874882
GIT_CONF_SUBST([HAVE_LIBCHARSET_H])
883+
#
884+
# Define HAVE_STRINGS_H if you have strings.h
885+
AC_CHECK_HEADER([strings.h],
886+
[HAVE_STRINGS_H=YesPlease],
887+
[HAVE_STRINGS_H=])
888+
GIT_CONF_SUBST([HAVE_STRINGS_H])
875889
# Define CHARSET_LIB if libiconv does not export the locale_charset symbol
876890
# and libcharset does
877891
CHARSET_LIB=

git-compat-util.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@
9999
#include <stdlib.h>
100100
#include <stdarg.h>
101101
#include <string.h>
102-
#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */
102+
#ifdef HAVE_STRINGS_H
103103
#include <strings.h> /* for strcasecmp() */
104104
#endif
105105
#include <errno.h>
106106
#include <limits.h>
107+
#ifdef NEEDS_SYS_PARAM_H
107108
#include <sys/param.h>
109+
#endif
108110
#include <sys/types.h>
109111
#include <dirent.h>
110112
#include <sys/time.h>

0 commit comments

Comments
 (0)