[PATCH 3/4] Generalize the inclusion of strings.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The header strings.h was formerly only included for a particular platform 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@xxxxxxxxx>
---
 Makefile          | 6 ++++++
 configure.ac      | 6 ++++++
 git-compat-util.h | 2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 735a834..fb78f7f 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.
@@ -1892,6 +1894,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
diff --git a/configure.ac b/configure.ac
index 3347c17..4176db8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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=
diff --git a/git-compat-util.h b/git-compat-util.h
index ace1549..d7359ef 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -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>
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]