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 <fedora.dm0@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Michael committed
Dec 14, 2012 at 14:57 UTC
b3e103dabeb01555f8766b74de73493f7a6ba048
3 files changed
+14
-1
Makefile
+7
@@ -74,6 +74,8 @@ all::
74
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
75
# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
76
#
77
+# Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp.
78
+#
79
# Define NO_STRCASESTR if you don't have strcasestr.
80
#
81
# Define NO_MEMMEM if you don't have memmem.
@@ -1350,6 +1352,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
1352
# Added manually, see above.
1353
NEEDS_SSL_WITH_CURL = YesPlease
1354
HAVE_LIBCHARSET_H = YesPlease
1355
+ HAVE_STRINGS_H = YesPlease
1356
NEEDS_LIBICONV = YesPlease
1357
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
1358
NO_SYS_SELECT_H = UnfortunatelyYes
@@ -1883,6 +1886,10 @@ ifdef HAVE_LIBCHARSET_H
1886
EXTLIBS += $(CHARSET_LIB)
1887
endif
1888
1889
+ifdef HAVE_STRINGS_H
1890
+ BASIC_CFLAGS += -DHAVE_STRINGS_H
1891
+endif
1892
+
1893
ifdef HAVE_DEV_TTY
1894
BASIC_CFLAGS += -DHAVE_DEV_TTY
1895
endif
configure.ac
+6
@@ -886,6 +886,12 @@ AC_CHECK_HEADER([libcharset.h],
886
[HAVE_LIBCHARSET_H=YesPlease],
887
[HAVE_LIBCHARSET_H=])
888
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])
895
# Define CHARSET_LIB if libiconv does not export the locale_charset symbol
896
# and libcharset does
897
CHARSET_LIB=
git-compat-util.h
+1
-1
@@ -99,7 +99,7 @@
99
#include <stdlib.h>
100
#include <stdarg.h>
101
#include <string.h>
102
-#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */
102
+#ifdef HAVE_STRINGS_H
103
#include <strings.h> /* for strcasecmp() */
104
#endif
105
#include <errno.h>