[PATCH] configure.ac: Add checks for libflash and libdevmapper

Samuel Mendoza-Jonas sam at mendozajonas.com
Tue Apr 5 15:02:05 AEST 2016


libdevmapper is a hard dependency since snapshots were introduced, so
add an unconditional configure-time check for it.
Also add a check for libflash library and headers if --enable-mtd is
set.

Signed-off-by: Samuel Mendoza-Jonas <sam at mendozajonas.com>
---
 configure.ac | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/configure.ac b/configure.ac
index 08685ec..3f6853d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,11 @@ AC_CHECK_LIB([udev], [udev_new],
 	[AC_MSG_FAILURE([The libudev development library is required by petitboot.  Try installing the package libudev-dev or libudev-devel.])]
 )
 
+AC_CHECK_LIB([devmapper], [dm_task_create],
+	[],
+	[AC_MSG_FAILURE([The libdevmapper development library is required by petitboot.  Try installing the package libdevmapper-dev or libdevmapper-devel.])]
+)
+
 AC_ARG_WITH([fdt],
 	AS_HELP_STRING([--without-fdt],
 		[Build without libfdt (default: no)]))
@@ -186,6 +191,19 @@ AS_IF([test "x$enable_mtd" = "xyes"],
       []
 )
 
+AS_IF([test "x$enable_mtd" = "xyes"],
+	AC_CHECK_LIB([flash], [arch_flash_init],
+		[],
+		[AC_MSG_FAILURE([--enable-mtd requires the libflash library])]
+	)
+)
+AS_IF([test "x$enable_mtd" = "xyes"],
+	AC_CHECK_HEADERS([libflash/libflash.h],
+		[],
+		[AC_MSG_FAILURE([--enable-mtd given but libflash/libflash.h not found])]
+	)
+)
+
 AC_ARG_ENABLE(
 	[ps3],
 	[AS_HELP_STRING(
-- 
2.8.0



More information about the Petitboot mailing list