diff --git a/ChangeLog b/ChangeLog index a4257993..3475f6f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * configure.ac: Use pkg-config to check for zlib presence and fallback to the previous code if that doesn't work. + * configure.ac: Use pkg-config to check for libuuid presence and + fallback to the previous code if that doesn't work. + 2014-07-28 Ángel González * contrib: Created contrib folder. * contrib/tsocked-wget: Added wrapper for usage with socks proxy. diff --git a/configure.ac b/configure.ac index 23048ba3..ad88c597 100644 --- a/configure.ac +++ b/configure.ac @@ -569,20 +569,32 @@ fi dnl dnl Check for UUID dnl -AC_CHECK_HEADER(uuid.h, - AC_CHECK_FUNC(uuid, uuid_create, - [AC_DEFINE([HAVE_UUID_CREATE], 1, - [Define if uuid_create is available.]) - ]) -) -AC_CHECK_HEADER(uuid/uuid.h, - AC_CHECK_LIB(uuid, uuid_generate, - [LIBS="${LIBS} -luuid" - AC_DEFINE([HAVE_LIBUUID], 1, - [Define if libuuid is available.]) - ]) -) +AC_ARG_WITH(libuuid, AC_HELP_STRING([--without-libuuid], + [Generate UUIDs for WARC files via libuuid])) + +AS_IF([test "X$with_libuuid" != "Xno"],[ + PKG_CHECK_MODULES([UUID], uuid, [ + LIBS="$UUID_LIBS $LIBS" + CFLAGS="$UUID_CFLAGS $CFLAGS" + AC_DEFINE([HAVE_LIBUUID], [1], [Define if using libuuid.]) + ], [ + AC_CHECK_HEADER(uuid.h, + AC_CHECK_FUNC(uuid, uuid_create, + [AC_DEFINE([HAVE_UUID_CREATE], 1, + [Define if uuid_create is available.]) + ]) + ) + + AC_CHECK_HEADER(uuid/uuid.h, + AC_CHECK_LIB(uuid, uuid_generate, + [LIBS="${LIBS} -luuid" + AC_DEFINE([HAVE_LIBUUID], 1, + [Define if libuuid is available.]) + ]) + ) + ]) +]) dnl dnl Check for PCRE