[PATCH 04/21] build: cleanup configure.ac for non-linux OS'es

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

libstatgrab ships with pkg-config file. Use it.

watchdog is implemented only on linux. Error out if necessary.

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
:100644 100644 5b9971f... 2e5b355... M	configure.ac
 configure.ac |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5b9971f..2e5b355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -433,22 +433,23 @@ fi
 
 if test "x${enable_monitoring}" = xyes; then
 
-	AC_CHECK_LIB([statgrab], [sg_get_mem_stats], have_libstatgrab="yes", have_libstatgrab="no")
+	PKG_CHECK_MODULES([statgrab], [libstatgrab], [have_libstatgrab="yes"], [have_libstatgrab="no"])
 
 	if test "x${have_libstatgrab}" = xyes; then
 		AC_DEFINE_UNQUOTED([HAVE_LIBSTATGRAB], 1, [have libstatgrab])
-		statgrab_LIBS="-lstatgrab"
 	else
 		if test "x${have_linux}" = xno; then
 			AC_MSG_ERROR(monitoring requires libstatgrab on non-linux systems)
 		fi
 	fi
-	AC_SUBST([statgrab_LIBS])
 	AC_DEFINE_UNQUOTED([HAVE_MONITORING], 1, [have resource monitoring])
 	PACKAGE_FEATURES="$PACKAGE_FEATURES monitoring"
 fi
 
 if test "x${enable_watchdog}" = xyes; then
+	if test "x${have_linux}" = xno; then
+		AC_MSG_ERROR(watchdog is only supported on linux systems)
+	fi
 	AC_CHECK_HEADER(linux/watchdog.h,,AC_MSG_ERROR(watchdog requires linux/watchdog.h))
 	AC_CHECK_HEADER(linux/reboot.h,,AC_MSG_ERROR(watchdog requires linux/reboot.h))
 	AC_DEFINE_UNQUOTED([HAVE_WATCHDOG], 1, [have watchdog])
-- 
1.7.7.6

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux