summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac23
-rw-r--r--sbuild/sbuild-util.cc4
2 files changed, 17 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index e242367f..b5989606 100644
--- a/configure.ac
+++ b/configure.ac
@@ -331,8 +331,7 @@ AC_DEFINE_UNQUOTED(SBUILD_HOST_CPU, ["$host_cpu"])
# Checks for libraries.
PKG_CHECK_MODULES([UUID], [uuid],
- [AC_DEFINE(HAVE_UUID)
- HAVE_UUID=yes],
+ [HAVE_UUID=yes],
[HAVE_UUID=no])
AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=yes])
@@ -418,17 +417,25 @@ fi
AC_MSG_CHECKING([whether to build UUID support])
BUILD_UUID="yes"
-if test "$enable_uuid" = "yes"; then
- BUILD_UUID="no"
-fi
-if test "$HAVE_UUID" = "no"; then
+if test "$enable_uuid" = "no"; then
BUILD_UUID="no"
+elif test "$enable_uuid" = "yes"; then
+ if test "$HAVE_UUID" = "no"; then
+ AC_MSG_FAILURE([libuuid (e2fsprogs) is not installed, but is required by schroot])
+ fi
+elif test "$enable_uuid" = "auto"; then
+ if test "$HAVE_UUID" = "no"; then
+ BUILD_UUID="no"
+ fi
fi
AC_MSG_RESULT([$BUILD_UUID])
-AH_TEMPLATE(HAVE_UUID, [Set if UUID support is available])
+AM_CONDITIONAL([BUILD_UUID], [test "$BUILD_UUID" = "yes"])
+AH_TEMPLATE(SBUILD_USE_UUID, [Set if uuid support is present])
if test "$BUILD_UUID" = "yes"; then
- AC_DEFINE(HAVE_UUID, 1)
+ AC_DEFINE(SBUILD_USE_UUID, 1)
+else
+ UUID_LIBS=""
fi
AC_MSG_CHECKING([whether to build PAM support])
diff --git a/sbuild/sbuild-util.cc b/sbuild/sbuild-util.cc
index 987ee96b..06358674 100644
--- a/sbuild/sbuild-util.cc
+++ b/sbuild/sbuild-util.cc
@@ -29,7 +29,7 @@
#include <sys/stat.h>
#include <unistd.h>
-#ifdef HAVE_UUID
+#ifdef SBUILD_USE_UUID
#include <uuid/uuid.h>
#else
#include <time.h>
@@ -237,7 +237,7 @@ sbuild::unique_identifier ()
std::ostringstream id;
id.imbue(std::locale::classic());
-#ifdef HAVE_UUID
+#ifdef SBUILD_USE_UUID
uuid_t uuid;
char uuid_str[37];
uuid_generate(uuid);