])
-UTIL_CHECK_LIB(uuid, uuid_is_null)
-if test "x$have_uuid" = xno; then
- AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
+AC_ARG_ENABLE([libuuid],
+ AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
+ [], enable_libuuid=yes
+)
+AC_SUBST(LIBUUID_VERSION)
+AM_CONDITIONAL(BUILD_LIBUUID, test "x$enable_libuuid" = xyes)
+have_uuid=yes
+
+if test "x$enable_libuuid" = xno; then
+ # Check for external (e2fsprogs) libuuid
+ PKG_CHECK_MODULES(UUID, uuid, [have_uuid=yes], [have_uuid=no])
+ if test "x$have_uuid" = xno; then
+ # system without pkg-config or so, try classic check
+ AC_CHECK_LIB(uuid, uuid_is_null, [have_uuid=yes], [have_uuid=no])
+ fi
+ if test "x$have_uuid" = xyes; then
+ UTIL_SET_FLAGS($UUID_CFLAGS, $UUID_CFLAGS, $UUID_LIBS)
+ AC_CHECK_HEADERS([uuid.h uuid/uuid.h], [break], [])
+ UTIL_RESTORE_FLAGS
+ fi
+else
+ # internal librray
+ AC_DEFINE(HAVE_UUID_H, 1, [Define to 1 if you have the <uuid.h> header file.])
fi
-UTIL_CHECK_LIB(util, openpty)
-UTIL_CHECK_LIB(termcap, tgetnum)
+if test "x$have_uuid" = xyes; then
+ AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
+else
+ AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
+fi
+AM_CONDITIONAL(HAVE_UUID, test "x$have_uuid" = xyes)
+# default
+: ${UUID_LIBS='-luuid'}
AC_ARG_WITH([fsprobe],
AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes)
-AC_ARG_ENABLE([libuuid],
- AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
- [], enable_libuuid=yes
-)
-AC_SUBST(LIBUUID_VERSION)
-AM_CONDITIONAL(BUILD_LIBUUID, test "x$enable_libuuid" = xyes)
-
-
AC_ARG_ENABLE([fsck],
AS_HELP_STRING([--enable-fsck], [do build fsck]),
[], enable_fsck=no
AM_CONDITIONAL(BUILD_FSCK, test "x$enable_fsck" = xyes)
+
+
dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
dnl ----------------------------------
AC_DEFUN([UTIL_PKG_STATIC], [
fi
])
+
# These default values should work in most cases:
: ${BLKID_LIBS='-lblkid -luuid'}
: ${VOLUME_ID_LIBS='-lvolume_id'}
AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
AC_ARG_VAR([VOLUME_ID_LIBS_STATIC], [-l options for linking statically with volume_id])
+UTIL_CHECK_LIB(util, openpty)
+UTIL_CHECK_LIB(termcap, tgetnum)
AM_GNU_GETTEXT_VERSION([0.14.1])
AM_GNU_GETTEXT([external])