+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
+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();
+ ],
+ [
+ UuidCreate@4();
+ UuidToStringA@8();
+ ],
+ need_rpcrt=yes, need_rpcrt=no)
+ if test $need_rpcrt = yes; then
+ SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
+ fi
+ LIBS="$save_LIBS"
+ AC_MSG_RESULT($need_rpcrt)
+fi
+