summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac26
-rw-r--r--discover/Makefile.am2
-rw-r--r--lib/Makefile.am2
3 files changed, 28 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 08685ec..1b9b980 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],
+ [DEVMAPPER_LIBS=-ldevmapper],
+ [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,25 @@ AS_IF([test "x$enable_mtd" = "xyes"],
[]
)
+AS_IF(
+ [test "x$enable_mtd" = "xyes"],
+ AC_CHECK_LIB([flash], [arch_flash_init],
+ [LIBFLASH_LIBS=-lflash],
+ [AC_MSG_FAILURE([--enable-mtd requires the libflash library])]
+ )
+)
+AS_IF(
+ [test "x$enable_mtd" = "xyes"],
+ [SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $libflash_CFLAGS"
+ AC_CHECK_HEADERS(
+ [libflash/libflash.h],
+ [],
+ [AC_MSG_FAILURE([--enable-mtd given but libflash/libflash.h not found])]
+ )
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ ]
+)
+
AC_ARG_ENABLE(
[ps3],
[AS_HELP_STRING(
@@ -285,7 +309,9 @@ AS_IF(
)
AC_SUBST([UDEV_LIBS])
+AC_SUBST([DEVMAPPER_LIBS])
AC_SUBST([FDT_LIBS])
+AC_SUBST([LIBFLASH_LIBS])
AC_SUBST([LIBTOOL_DEPS])
AC_SUBST([DESTDIR])
AC_SUBST([pkgsysconfdir], ["${sysconfdir}/${package}"])
diff --git a/discover/Makefile.am b/discover/Makefile.am
index f55f1cd..899c9a6 100644
--- a/discover/Makefile.am
+++ b/discover/Makefile.am
@@ -62,7 +62,7 @@ discover_pb_discover_LDADD = \
discover_pb_discover_LDFLAGS = \
$(AM_LDFLAGS) \
- -ldevmapper
+ $(DEVMAPPER_LIBS)
discover_pb_discover_CPPFLAGS = \
$(AM_CPPFLAGS) \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index a3ae943..09bc1aa 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -61,7 +61,7 @@ lib_libpbcore_la_CPPFLAGS += \
lib_libpbcore_la_LDFLAGS = \
$(AM_LDFLAGS) \
- -l:libflash.so
+ $(LIBFLASH_LIBS)
lib_libpbcore_la_SOURCES += \
lib/flash/flash.c
OpenPOWER on IntegriCloud