summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-11-03 18:43:52 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-11-03 18:43:52 +0000
commitdfda21e7a66a11a70c31c4cd625ae0d0988ed248 (patch)
tree55a98fb7ebac9be43cdf0423f5915923300815ef /config
parentb98ba2a04c07c451cb26a6865d7a9fae4659261d (diff)
downloadpostgresql-dfda21e7a66a11a70c31c4cd625ae0d0988ed248.tar.gz
Add configure check to see whether <string.h> and <strings.h> may both be
included, and then include <strings.h> if so. Several systems already needed <strings.h> anyway. Some new systems that claim to conform to the Unix 9x "standard" do not declare str[n]casemp() in string.h, and C99 compilers will not like that.
Diffstat (limited to 'config')
-rw-r--r--config/c-library.m429
1 files changed, 28 insertions, 1 deletions
diff --git a/config/c-library.m4 b/config/c-library.m4
index 144e58d182..5a14846f80 100644
--- a/config/c-library.m4
+++ b/config/c-library.m4
@@ -1,5 +1,5 @@
# Macros that test various C library quirks
-# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.4 2000/10/02 03:58:31 momjian Exp $
+# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.5 2000/11/03 18:43:51 petere Exp $
# PGAC_VAR_INT_TIMEZONE
@@ -96,3 +96,30 @@ if test x"$pgac_cv_func_posix_signals" = xyes ; then
fi
HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS
+
+
+# PGAC_HEADER_STRING
+# ------------------
+# Tests whether <string.h> and <strings.h> can both be included
+# (without generating warnings). This is mostly useful if you need
+# str[n]casecmp(), since this is not in the "standard" <string.h>
+# on some systems.
+AC_DEFUN([PGAC_HEADER_STRING],
+[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
+ [pgac_cv_header_strings_both],
+[AC_TRY_CPP(
+[#include <string.h>
+#include <strings.h>
+],
+[AC_TRY_COMPILE(
+[#include <string.h>
+#include <strings.h>
+],
+[int n = strcasecmp("a", "b");],
+[pgac_cv_header_strings_both=yes],
+[pgac_cv_header_strings_both=no])],
+[pgac_cv_header_strings_both=no])])
+if test x"$pgac_cv_header_strings_both" = x"yes"; then
+ AC_DEFINE([STRING_H_WITH_STRINGS_H], 1,
+ [Define if string.h and strings.h may both be included])
+fi])