Просмотр исходного кода

build: cleanup configure.ac for non-linux OS'es

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@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto 13 лет назад
Родитель
Сommit
3ca6853d25
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      configure.ac

+ 4 - 3
configure.ac

@@ -408,22 +408,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])