From dfafd021cf516a9c58cf34cc8a97953d1db645d9 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 2 Jul 2014 13:33:47 -0700 Subject: [PATCH] GUAC-762: Check for ossp/uuid.h vs uuid.h. --- configure.ac | 11 +++++++++++ src/libguac/client.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index d69115da..cd3b49d0 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,17 @@ AC_CHECK_LIB([ossp-uuid], [uuid_make], [UUID_LIBS=-lossp-uuid], AC_CHECK_LIB([uuid], [uuid_make], [UUID_LIBS=-luuid], AC_MSG_ERROR("The OSSP UUID library is required"))) +# Check for and validate OSSP uuid.h header +AC_CHECK_HEADERS([ossp/uuid.h]) +AC_CHECK_DECL([uuid_make],, + AC_MSG_ERROR("No OSSP uuid.h found in include path"), + [#ifdef HAVE_OSSP_UUID_H + #include + #else + #include + #endif + ]) + # cunit AC_CHECK_LIB([cunit], [CU_run_test], [CUNIT_LIBS=-lcunit]) diff --git a/src/libguac/client.c b/src/libguac/client.c index 79200eae..d1d90a19 100644 --- a/src/libguac/client.c +++ b/src/libguac/client.c @@ -33,7 +33,11 @@ #include "stream.h" #include "timestamp.h" +#ifdef HAVE_OSSP_UUID_H #include +#else +#include +#endif #include #include