Fix uuid on FreeBSD

In FreeBSD, just as in DARWIN, uuid functions are in libc and no external libuuid is required.
The API is quite different from Linux's though, so a different implementation of uuid () (util.cpp) is needed.
This commit is contained in:
Pietro Cerutti 2013-09-13 08:03:50 +02:00 committed by Paul Beckingham
parent 05afa911d3
commit da7cc6eed7
3 changed files with 31 additions and 4 deletions

View file

@ -90,10 +90,10 @@ check_struct_has_member ("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
check_struct_has_member ("struct stat" st_birthtime "sys/types.h;sys/stat.h" HAVE_ST_BIRTHTIME)
message ("-- Looking for libuuid")
if (DARWIN)
# Apple includes the uuid functions in their libc, rather than libuuid
if (DARWIN OR FREEBSD)
# Apple and FreeBSD include the uuid functions in their libc, rather than libuuid
check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER)
else (DARWIN)
else (DARWIN OR FREEBSD)
find_path (UUID_INCLUDE_DIR uuid/uuid.h)
find_library (UUID_LIBRARY NAMES uuid)
if (UUID_INCLUDE_DIR AND UUID_LIBRARY)
@ -106,7 +106,7 @@ else (DARWIN)
else (UUID_INCLUDE_DIR AND UUID_LIBRARY)
message (FATAL_ERROR "-- libuuid not found.")
endif (UUID_INCLUDE_DIR AND UUID_LIBRARY)
endif (DARWIN)
endif (DARWIN OR FREEBSD)
if (HAVE_UUID_UNPARSE_LOWER)
message ("-- Found libuuid")