Add uuid_to_str() detection.

This commit is contained in:
Kurt Zeilenga 2002-02-11 20:17:08 +00:00
parent defed68e82
commit a9cf0f5c08
4 changed files with 967 additions and 823 deletions

1740
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -895,11 +895,30 @@ if test "$ol_cv_c_posix_regex" = no ; then
fi fi
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
dnl UUID Support
have_uuid=no
AC_CHECK_HEADERS(sys/uuid.h)
if test $ac_cv_header_sys_uuid_h = yes ; then
save_LIBS="$LIBS"
AC_SEARCH_LIBS(uuid_to_str, uuid, [have_uuid=yes], :)
LIBS="$save_LIBS"
if test have_uuid = yes ; then
AC_DEFINE(HAVE_UUID_TO_STR,1,
[define if you have uuid_to_str()])
test "$ac_cv_search_uuid_to_str" = "none required" || \
SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
fi
fi
dnl For windows, check for the need of RPCRT for UUID function support dnl For windows, check for the need of RPCRT for UUID function support
AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support) if test $have_uuid = no ; then
save_LIBS="$LIBS" AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
LIBS="$LIBS -lrpcrt4" save_LIBS="$LIBS"
AC_TRY_LINK([ LIBS="$LIBS -lrpcrt4"
AC_TRY_LINK([
char UuidCreate@4(); char UuidCreate@4();
char UuidToStringA@8(); char UuidToStringA@8();
], ],
@ -908,11 +927,12 @@ AC_TRY_LINK([
UuidToStringA@8(); UuidToStringA@8();
], ],
need_rpcrt=yes, need_rpcrt=no) need_rpcrt=yes, need_rpcrt=no)
if test $need_rpcrt = yes; then if test $need_rpcrt = yes; then
SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4" SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
fi
LIBS="$save_LIBS"
AC_MSG_RESULT($need_rpcrt)
fi fi
LIBS="$save_LIBS"
AC_MSG_RESULT($need_rpcrt)
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
dnl Check for resolver routines dnl Check for resolver routines

View file

@ -536,6 +536,9 @@
/* Define if you have the <sys/un.h> header file. */ /* Define if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H #undef HAVE_SYS_UN_H
/* Define if you have the <sys/uuid.h> header file. */
#undef HAVE_SYS_UUID_H
/* Define if you have the <sysexits.h> header file. */ /* Define if you have the <sysexits.h> header file. */
#undef HAVE_SYSEXITS_H #undef HAVE_SYSEXITS_H
@ -641,6 +644,9 @@
/* define if you have winsock2 */ /* define if you have winsock2 */
#undef HAVE_WINSOCK2 #undef HAVE_WINSOCK2
/* define if you have uuid_to_str() */
#undef HAVE_UUID_TO_STR
/* define if you have res_query() */ /* define if you have res_query() */
#undef HAVE_RES_QUERY #undef HAVE_RES_QUERY

View file

@ -22,7 +22,7 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#ifdef HAVE_SYS_UUID_H #ifdef HAVE_UUID_TO_STR
# include <sys/uuid.h> # include <sys/uuid.h>
#elif defined( _WIN32 ) #elif defined( _WIN32 )
# include <rpc.h> # include <rpc.h>
@ -43,7 +43,7 @@
#include <lutil.h> #include <lutil.h>
/* not needed for Windows */ /* not needed for Windows */
#if !defined(HAVE_SYS_UUID_H) && !defined(_WIN32) #if !defined(HAVE_UUID_TO_STR) && !defined(_WIN32)
static unsigned char * static unsigned char *
lutil_eaddr( void ) lutil_eaddr( void )
{ {
@ -182,7 +182,7 @@ lutil_eaddr( void )
size_t size_t
lutil_uuidstr( char *buf, size_t len ) lutil_uuidstr( char *buf, size_t len )
{ {
#ifdef HAVE_SYS_UUID_H #ifdef HAVE_UUID_TO_STR
uuid_t uu = {0}; uuid_t uu = {0};
unsigned rc; unsigned rc;
char *s; char *s;
@ -283,7 +283,7 @@ main(int argc, char **argv)
{ {
char buf1[8], buf2[64]; char buf1[8], buf2[64];
#ifndef HAVE_SYS_UUID_H #ifndef HAVE_UUID_TO_STR
unsigned char *p = lutil_eaddr(); unsigned char *p = lutil_eaddr();
if( p ) { if( p ) {