]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Generalize the inclusion of strings.h
authorDavid Michael <fedora.dm0@gmail.com>
Fri, 14 Dec 2012 19:57:01 +0000 (14:57 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 15 Dec 2012 18:17:39 +0000 (10:17 -0800)
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>
Makefile
configure.ac
git-compat-util.h

index e953951be89cde3c8e746f43db939f4d3a620b99..5cd1de02c78167fae20e0b11c8cad5f34dd6f2c7 100644 (file)
--- 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
index 66d0c91ece108ef812c2547658369e901e2f316b..e3ab6fe2826c1732ea7e6c4131d6396d86ba26fe 100644 (file)
@@ -886,6 +886,12 @@ AC_CHECK_HEADER([libcharset.h],
 [HAVE_LIBCHARSET_H=YesPlease],
 [HAVE_LIBCHARSET_H=])
 GIT_CONF_SUBST([HAVE_LIBCHARSET_H])
+#
+# Define HAVE_STRINGS_H if you have strings.h
+AC_CHECK_HEADER([strings.h],
+[HAVE_STRINGS_H=YesPlease],
+[HAVE_STRINGS_H=])
+GIT_CONF_SUBST([HAVE_STRINGS_H])
 # Define CHARSET_LIB if libiconv does not export the locale_charset symbol
 # and libcharset does
 CHARSET_LIB=
index ace154901fa397885e2eae24d7b5b9da3663eca2..d7359ef87f14214f7bd0fd0f24078dc4abf6735a 100644 (file)
@@ -99,7 +99,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
-#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */
+#ifdef HAVE_STRINGS_H
 #include <strings.h> /* for strcasecmp() */
 #endif
 #include <errno.h>