configure.ac: check for both libuuid/libc uuid APIs
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 21 Feb 2012 13:46:52 +0000 (08:46 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Tue, 27 Nov 2012 21:09:35 +0000 (16:09 -0500)
commit 5e8445c48358d4d943c61e5cd94429fc75047d63 upstream.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
configure.ac

index b442a81dc271eb7bb1f10739d6e0defb04b49931..de1c0c5fd18c1a9e5236641b596c4c651952cb2a 100644 (file)
@@ -77,8 +77,20 @@ AC_CHECK_LIB([dl], [dlopen])
 AC_CHECK_LIB([pthread], [pthread_create])
 
 # Check for libuuid
-AC_CHECK_LIB([uuid], [uuid_generate], [],
-       [AC_MSG_ERROR([Cannot find libuuid. Use [LDFLAGS]=-Ldir to specify its location.])]
+AC_CHECK_LIB([uuid], [uuid_generate],
+[
+       AC_DEFINE_UNQUOTED([LTTNG_UST_HAVE_LIBUUID], 1, [Has libuuid support.])
+],
+[
+       # libuuid not found, check for uuid_create in libc.
+       AC_CHECK_LIB([c], [uuid_create],
+       [
+               AC_DEFINE_UNQUOTED([LTTNG_UST_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
+       ],
+       [
+               AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify its location.])
+       ])
+]
 )
 
 # Checks for header files.
This page took 0.02517 seconds and 4 git commands to generate.