@@ -1,15 +1,14 @@ AC_DEFUN(DC_ASK_STATGRAB, [ -# AC_CHECK_LIB(statgrab, get_memory_stats, AC_DEFINE(HAVE_LIBSTATGRAB, [1], [Have get_memory_stats from libstatgrab])) + LIBSTATGRABFLAGS=`pkg-config --libs libstatgrab 2>/dev/null` + LIBSTATGRABCFLAGS=`pkg-config --cflags libstatgrab 2>/dev/null` AC_ARG_WITH(libstatgrab, [ --with-libstatgrab Support for libstatgrab], [ # Specified LIBSTATGRAB=$withval ], [ # Not specified - LIBSTATGRABFLAGS=`pkg-config --libs libstatgrab 2>/dev/null` - LIBSTATGRABCFLAGS=`pkg-config --cflags libstatgrab 2>/dev/null` - AC_CHECK_LIB(statgrab, get_memory_stats, [ + AC_CHECK_LIB(statgrab, sg_get_mem_stats, [ OLDCPPFLAGS="$CPPFLAGS" OLDCFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS $LIBSTATGRABCFLAGS" CFLAGS="$CFLAGS $LIBSTATGRABCFLAGS" AC_CHECK_HEADER(statgrab.h, [ @@ -31,20 +30,19 @@ *) if test ! "${LIBSTATGRAB}" = "yes"; then LIBSTATGRABFLAGS="-L${LIBSTATGRAB}/lib ${LIBSTATGRABFLAGS}" LIBSTATGRABCFLAGS="-I${LIBSTATGRAB}/include ${LIBSTATGRABCFLAGS}" fi - AC_CHECK_LIB(statgrab, get_memory_stats, [ + AC_CHECK_LIB(statgrab, sg_get_mem_stats, [ OLDCFLAGS="$CFLAGS" OLDCPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${LIBSTATGRABCFLAGS}" CFLAGS="$CFLAGS ${LIBSTATGRABCFLAGS}" AC_CHECK_HEADER(statgrab.h, [ AC_DEFINE(HAVE_LIBSTATGRAB_H, [1], [Define to 1 if you have the header file.]) - AC_DEFINE(HAVE_LIBSTATGRAB, [1], [Define to 1 if you have get_memory_stats from -lstatgrab]) - LDFLAGS="$LDFLAGS $LIBSTATGRABFLAGS" - LIBS="$LIBS -lstatgrab" + AC_DEFINE(HAVE_LIBSTATGRAB, [1], [Define to 1 if you have sg_get_mem_stats from -lstatgrab]) + LIBS="$LIBS $LIBSTATGRABFLAGS" AC_CHECK_LIB(statgrab, statgrab_drop_privileges, [ AC_DEFINE(HAVE_STATGRAB_DROP_PRIVILEGES, [1], [Define to 1 if you have statgrab_drop_privileges from -lstatgrab]) ]) ], [ CFLAGS="$OLDCFLAGS"