From da5444cee5b09e7503953fe0709c33d63c43cf59 Mon Sep 17 00:00:00 2001
From: Ben Collins <bcollins@openldap.org>
Date: Mon, 15 Mar 1999 00:16:25 +0000
Subject: [PATCH] Define OL_DECL_STRDUP, the current declaration conflicts with
 GLIBC 2.1's macro definition. If the declaration errors, then we don't
 declare it in ac/string.h

---
 build/openldap.m4 | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/build/openldap.m4 b/build/openldap.m4
index 570381e7ae..124a02962e 100644
--- a/build/openldap.m4
+++ b/build/openldap.m4
@@ -412,7 +412,7 @@ AC_MSG_RESULT($ol_cv_dcl_sys_errlist)
 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
 if test $ol_cv_dcl_sys_errlist = no ; then
 	AC_DEFINE(DECL_SYS_ERRLIST,1,
-		[define if sys_errlist is declared in stdio.h or errno.h])
+		[define if sys_errlist is not declared in stdio.h or errno.h])
 	AC_MSG_CHECKING([existence of sys_errlist])
 	AC_CACHE_VAL(ol_cv_have_sys_errlist,[
 		AC_TRY_LINK([#include <errno.h>],
@@ -426,6 +426,25 @@ if test $ol_cv_dcl_sys_errlist = no ; then
 	fi
 fi
 ])dnl
+dnl
+dnl ====================================================================
+dnl Check to see if we should not declare strdup if we have it
+dnl
+AC_DEFUN([OL_DECL_STRDUP],
+[
+AC_MSG_CHECKING([strdup decleration])
+AC_CACHE_VAL(ol_cv_dcl_strdup,[
+	AC_TRY_COMPILE([
+#include <string.h> ],
+	[extern char *strdup()],
+	[ol_cv_dcl_strdup=yes],
+	[ol_cv_dcl_strdup=no])])
+AC_MSG_RESULT($ol_cv_dcl_strdup)
+if test $ol_cv_dcl_strdup = yes ; then
+	AC_DEFINE(DECL_STRDUP,1,
+		[define if you have strdup() but it's not declared])
+fi
+])dnl
 
 dnl ====================================================================
 dnl Early MIPS compilers (used in Ultrix 4.2) don't like
-- 
GitLab