1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

configure.ac: Fix libuuid and uuid_create detection

--with-libuuid now explictly asks for libuuid.
--without-libuuid ignores libuuid and tries to use libc builtin functions.
Else try builtin functions first, libuuid second and fallback to Wget's own
function.
This commit is contained in:
Tim Rühsen 2014-12-17 10:29:12 +01:00
parent ec5e0f421c
commit 05d73a926a

View File

@ -648,27 +648,36 @@ dnl
AC_ARG_WITH(libuuid, AC_HELP_STRING([--without-libuuid], AC_ARG_WITH(libuuid, AC_HELP_STRING([--without-libuuid],
[Generate UUIDs for WARC files via libuuid])) [Generate UUIDs for WARC files via libuuid]))
AS_IF([test "X$with_libuuid" != "Xno"],[ AS_IF([test "x$with_libuuid" = xyes], [
# libuuid was explicitly requested
PKG_CHECK_MODULES([UUID], uuid, [ PKG_CHECK_MODULES([UUID], uuid, [
LIBS="$UUID_LIBS $LIBS" LIBS="$UUID_LIBS $LIBS"
CFLAGS="$UUID_CFLAGS $CFLAGS" CFLAGS="$UUID_CFLAGS $CFLAGS"
AC_DEFINE([HAVE_LIBUUID], [1], [Define if using libuuid.]) uuid_mode=1
], [
AC_SEARCH_LIBS(uuid_generate, uuid,
[uuid_mode=1],
[AC_MSG_ERROR(*** libuuid was explicitly requested but wasn't found.)])
])
], [test "x$with_libuuid" = xno], [
# libuuid was explicitly *not* requested
AC_CHECK_HEADER(uuid.h,
AC_CHECK_FUNC(uuid_create, [uuid_mode=2]))
], [
# default:
AC_CHECK_HEADER(uuid.h, [
AC_CHECK_FUNC(uuid_create, [uuid_mode=2])
], [ ], [
AC_CHECK_HEADER(uuid/uuid.h, AC_CHECK_HEADER(uuid/uuid.h,
AC_CHECK_LIB(uuid, uuid_generate, AC_SEARCH_LIBS(uuid_generate, uuid, [uuid_mode=1]))
[LIBS="${LIBS} -luuid"
AC_DEFINE([HAVE_LIBUUID], 1,
[Define if libuuid is available.])
])
)
]) ])
]) ])
AC_CHECK_HEADER(uuid.h, AS_IF([test "x$uuid_mode" = x1], [
AC_CHECK_FUNC(uuid_create, AC_DEFINE([HAVE_LIBUUID], [1], [Define if using libuuid.])
[AC_DEFINE([HAVE_UUID_CREATE], 1, [Define if uuid_create is available.])] ], [test "x$uuid_mode" = x2], [
) AC_DEFINE([HAVE_UUID_CREATE], 1, [Define if uuid_create is available.])
) ])
dnl dnl
dnl Check for PCRE dnl Check for PCRE