fi
fi
+dnl Look for uuid_generate
+if test $have_uuid = no ; then
+ AC_CHECK_HEADERS(uuid/uuid.h)
+ if test $ac_cv_header_uuid_uuid_h = yes ; then
+ AC_CHECK_FUNCS( uuid_generate )
+ have_uuid=$ac_cv_func_uuid_generate
+ fi
+fi
+
dnl For windows, check for the need of RPCRT for UUID function support
if test $have_uuid = no ; then
AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
#ifdef HAVE_UUID_TO_STR
# include <sys/uuid.h>
+#elif defined( HAVE_UUID_GENERATE )
+# include <uuid/uuid.h>
#elif defined( _WIN32 )
# include <rpc.h>
#else
#include <lutil.h>
/* not needed for Windows */
-#if !defined(HAVE_UUID_TO_STR) && !defined(_WIN32)
+#if !defined(HAVE_UUID_TO_STR) && !defined(HAVE_UUID_GENERATE) && !defined(_WIN32)
static unsigned char *
lutil_eaddr( void )
{
#endif /* ULONG_MAX >= 64 bits || HAVE_LONG_LONG */
-#endif /* !HAVE_UUID_TO_STR && !_WIN32 */
+#endif /* !HAVE_UUID_TO_STR && !HAVE_UUID_GENERATE && !_WIN32 */
/*
** All we really care about is an ISO UUID string. The format of a UUID is:
return l;
+#elif defined( HAVE_UUID_GENERATE )
+ uuid_t uu;
+
+ uuid_generate( uu );
+ uuid_unparse_lower( uu, buf );
+ return strlen( buf );
+
#elif defined( _WIN32 )
UUID uuid;
unsigned char *uuidstr;