1 dnl ######################################################################
2 dnl check for external definition for an LDAP function (not external variables)
3 dnl Usage AMU_CHECK_EXTERN_LDAP(extern)
4 dnl Checks for external definition for "extern" that is delimited on the
5 dnl left and the right by a character that is not a valid symbol character.
7 dnl Note that $pattern below is very carefully crafted to match any system
8 dnl external definition, with __P posix prototypes, with or without an extern
9 dnl word, etc. Think twice before changing this.
10 AC_DEFUN([AMU_CHECK_EXTERN_LDAP],
12 # store variable name for external definition
13 ac_upcase_extern_name=`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14 ac_safe=HAVE_EXTERN_$ac_upcase_extern_name
15 # check for cached value and set it if needed
16 AMU_CACHE_CHECK_DYNAMIC(external function definition for $1,
19 # the old pattern assumed that the complete external definition is on one
20 # line but on some systems it is split over several lines, so only match
21 # beginning of the extern definition including the opening parenthesis.
22 #pattern="(extern)?.*[^a-zA-Z0-9_]$1[^a-zA-Z0-9_]?.*\(.*\).*;"
23 dnl This expression is a bit different than check_extern.m4 because of the
24 dnl way that openldap wrote their externs in <ldap.h>.
25 pattern="(extern)?.*([[^a-zA-Z0-9_]])?$1[[^a-zA-Z0-9_]]?.*\("
26 AC_EGREP_CPP(${pattern},
28 #ifdef HAVE_SYS_TYPES_H
29 # include <sys/types.h>
30 #endif /* HAVE_SYS_TYPES_H */
31 #ifdef HAVE_SYS_WAIT_H
32 # include <sys/wait.h>
33 #endif /* HAVE_SYS_WAIT_H */
34 #if TIME_WITH_SYS_TIME
35 # include <sys/time.h>
37 #else /* not TIME_WITH_SYS_TIME */
39 # include <sys/time.h>
40 # else /* not HAVE_SYS_TIME_H */
42 # endif /* not HAVE_SYS_TIME_H */
43 #endif /* not TIME_WITH_SYS_TIME */
47 #endif /* HAVE_STDIO_H */
50 #endif /* HAVE_STDLIB_H */
53 #endif /* HAVE_UNISTD_H */
56 #endif /* HAVE_STRING_H */
59 #endif /* HAVE_STRINGS_H */
62 #endif /* HAVE_NETDB_H */
65 #endif /* HAVE_CLUSTER_H */
68 * Turn on PORTMAP, so that additional header files would get included
69 * and the important definition for UDPMSGSIZE is included too.
73 # endif /* not PORTMAP */
75 # ifndef XDRPROC_T_TYPE
76 typedef bool_t (*xdrproc_t) __P ((XDR *, __ptr_t, ...));
77 # endif /* not XDRPROC_T_TYPE */
78 #endif /* HAVE_RPC_RPC_H */
80 #if defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP)
82 #endif /* defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP) */
86 #endif /* HAVE_LDAP_H */
89 #endif /* HAVE_LBER_H */
91 ], eval "ac_cv_extern_$1=yes", eval "ac_cv_extern_$1=no")
93 # check if need to define variable
94 if test "`eval echo '$''{ac_cv_extern_'$1'}'`" = yes
96 AC_DEFINE_UNQUOTED($ac_safe)
99 dnl ======================================================================