mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Add uuid_to_str() detection.
This commit is contained in:
parent
defed68e82
commit
a9cf0f5c08
4 changed files with 967 additions and 823 deletions
36
configure.in
36
configure.in
|
|
@ -895,11 +895,30 @@ if test "$ol_cv_c_posix_regex" = no ; then
|
|||
fi
|
||||
|
||||
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
|
||||
AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lrpcrt4"
|
||||
AC_TRY_LINK([
|
||||
if test $have_uuid = no ; then
|
||||
AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lrpcrt4"
|
||||
AC_TRY_LINK([
|
||||
char UuidCreate@4();
|
||||
char UuidToStringA@8();
|
||||
],
|
||||
|
|
@ -908,11 +927,12 @@ AC_TRY_LINK([
|
|||
UuidToStringA@8();
|
||||
],
|
||||
need_rpcrt=yes, need_rpcrt=no)
|
||||
if test $need_rpcrt = yes; then
|
||||
SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
|
||||
if test $need_rpcrt = yes; then
|
||||
SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
AC_MSG_RESULT($need_rpcrt)
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
AC_MSG_RESULT($need_rpcrt)
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl Check for resolver routines
|
||||
|
|
|
|||
|
|
@ -536,6 +536,9 @@
|
|||
/* Define if you have the <sys/un.h> header file. */
|
||||
#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. */
|
||||
#undef HAVE_SYSEXITS_H
|
||||
|
||||
|
|
@ -641,6 +644,9 @@
|
|||
/* define if you have winsock2 */
|
||||
#undef HAVE_WINSOCK2
|
||||
|
||||
/* define if you have uuid_to_str() */
|
||||
#undef HAVE_UUID_TO_STR
|
||||
|
||||
/* define if you have res_query() */
|
||||
#undef HAVE_RES_QUERY
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <ac/stdlib.h>
|
||||
|
||||
#ifdef HAVE_SYS_UUID_H
|
||||
#ifdef HAVE_UUID_TO_STR
|
||||
# include <sys/uuid.h>
|
||||
#elif defined( _WIN32 )
|
||||
# include <rpc.h>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
#include <lutil.h>
|
||||
|
||||
/* not needed for Windows */
|
||||
#if !defined(HAVE_SYS_UUID_H) && !defined(_WIN32)
|
||||
#if !defined(HAVE_UUID_TO_STR) && !defined(_WIN32)
|
||||
static unsigned char *
|
||||
lutil_eaddr( void )
|
||||
{
|
||||
|
|
@ -182,7 +182,7 @@ lutil_eaddr( void )
|
|||
size_t
|
||||
lutil_uuidstr( char *buf, size_t len )
|
||||
{
|
||||
#ifdef HAVE_SYS_UUID_H
|
||||
#ifdef HAVE_UUID_TO_STR
|
||||
uuid_t uu = {0};
|
||||
unsigned rc;
|
||||
char *s;
|
||||
|
|
@ -283,7 +283,7 @@ main(int argc, char **argv)
|
|||
{
|
||||
char buf1[8], buf2[64];
|
||||
|
||||
#ifndef HAVE_SYS_UUID_H
|
||||
#ifndef HAVE_UUID_TO_STR
|
||||
unsigned char *p = lutil_eaddr();
|
||||
|
||||
if( p ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue