Skip to content

Commit b3e103d

Browse files
dm0-gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 110d698 commit b3e103d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Makefile

Lines changed: 7 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.
@@ -1350,6 +1352,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
13501352
# Added manually, see above.
13511353
NEEDS_SSL_WITH_CURL = YesPlease
13521354
HAVE_LIBCHARSET_H = YesPlease
1355+
HAVE_STRINGS_H = YesPlease
13531356
NEEDS_LIBICONV = YesPlease
13541357
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
13551358
NO_SYS_SELECT_H = UnfortunatelyYes
@@ -1883,6 +1886,10 @@ ifdef HAVE_LIBCHARSET_H
18831886
EXTLIBS += $(CHARSET_LIB)
18841887
endif
18851888

1889+
ifdef HAVE_STRINGS_H
1890+
BASIC_CFLAGS += -DHAVE_STRINGS_H
1891+
endif
1892+
18861893
ifdef HAVE_DEV_TTY
18871894
BASIC_CFLAGS += -DHAVE_DEV_TTY
18881895
endif

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,12 @@ AC_CHECK_HEADER([libcharset.h],
886886
[HAVE_LIBCHARSET_H=YesPlease],
887887
[HAVE_LIBCHARSET_H=])
888888
GIT_CONF_SUBST([HAVE_LIBCHARSET_H])
889+
#
890+
# Define HAVE_STRINGS_H if you have strings.h
891+
AC_CHECK_HEADER([strings.h],
892+
[HAVE_STRINGS_H=YesPlease],
893+
[HAVE_STRINGS_H=])
894+
GIT_CONF_SUBST([HAVE_STRINGS_H])
889895
# Define CHARSET_LIB if libiconv does not export the locale_charset symbol
890896
# and libcharset does
891897
CHARSET_LIB=

git-compat-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
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>

0 commit comments

Comments
 (0)