require libuuid

- require libuuid at build time and remove insufficiently seeded
  replacement for uuid()
This commit is contained in:
Martin Natano
2013-07-20 21:18:20 +02:00
committed by Paul Beckingham
parent 779e32540a
commit fcfd50bd25
8 changed files with 12 additions and 52 deletions

View File

@@ -94,29 +94,27 @@ check_struct_has_member ("struct stat" st_birthtime "sys/types.h;sys/stat.h" HAV
message ("-- Looking for libuuid")
if (DARWIN)
# Apple includes the uuid functions in their libc, rather than libuuid
set (HAVE_UUID true)
check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER)
else (DARWIN)
find_path (UUID_INCLUDE_DIR uuid/uuid.h)
find_library (UUID_LIBRARY NAMES uuid)
if (UUID_INCLUDE_DIR AND UUID_LIBRARY)
set (HAVE_UUID true)
set (TASK_INCLUDE_DIRS ${TASK_INCLUDE_DIRS} ${UUID_INCLUDE_DIR})
set (TASK_LIBRARIES ${TASK_LIBRARIES} ${UUID_LIBRARY})
# Look for uuid_unparse_lower
set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${UUID_INCLUDE_DIR})
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${UUID_LIBRARY})
check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER)
else (UUID_INCLUDE_DIR AND UUID_LIBRARY)
message (FATAL_ERROR "-- libuuid not found.")
endif (UUID_INCLUDE_DIR AND UUID_LIBRARY)
endif (DARWIN)
if (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER)
if (HAVE_UUID_UNPARSE_LOWER)
message ("-- Found libuuid")
elseif (HAVE_UUID AND NOT HAVE_UUID_UNPARSE_LOWER)
else (HAVE_UUID_UNPARSE_LOWER)
message ("-- Found libuuid, using internal uuid_unparse_lower")
else (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER)
message ("-- libuuid not found, using internal uuid")
endif (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER)
endif (HAVE_UUID_UNPARSE_LOWER)
# Set the package language.
if (LANGUAGE)