AC_SUBST(SRD_LIB_VERSION)
AC_SUBST(SRD_LIB_LDFLAGS)
+# assume we can build tests/runtc unless proven otherwise
+build_runtc="yes"
+
# Checks for libraries.
# libglib-2.0 is always needed.
LIBS="$LIBS $check_LIBS"], [have_check="no"])
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
+# Protocol decoder test framework
PKG_CHECK_MODULES([libsigrok], [libsigrok >= 0.2.0],
- [have_libsigrok="yes";
- LIBSIGROK_CFLAGS="$libsigrok_CFLAGS";
- LIBSIGROK_LIBS="$libsigrok_LIBS"],
- [have_libsigrok="no"])
-AM_CONDITIONAL(HAVE_LIBSIGROK, test x"$have_libsigrok" = "xyes")
+ [LIBSIGROK_CFLAGS="$libsigrok_CFLAGS"; LIBSIGROK_LIBS="$libsigrok_LIBS"],
+ [build_runtc="no"])
AC_SUBST([LIBSIGROK_CFLAGS])
AC_SUBST([LIBSIGROK_LIBS])
# Checks for header files.
# These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h.
-# AC_CHECK_HEADERS([])
+AC_CHECK_HEADER([sys/resource.h], [], [build_runtc="no"])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_SUBST(SRD_PACKAGE_VERSION_MICRO)
AC_SUBST(SRD_PACKAGE_VERSION)
+AM_CONDITIONAL(BUILD_RUNTC, test x"$build_runtc" = "xyes")
+
AC_CONFIG_FILES([Makefile
version.h
libsigrokdecode.pc
echo " - Prefix: $prefix"
echo " - Building on: $build"
echo " - Building for: $host"
+echo " - Building protocol decoder test framework: $build_runtc"
echo
echo "Detected libraries:"
echo
}
-int get_stats(int stats[2])
-{
- FILE *f;
- size_t len;
- int tmp;
- char *buf;
-
- stats[0] = stats[1] = -1;
- if (!(f = fopen("/proc/self/status", "r")))
- return FALSE;
- len = 128;
- buf = malloc(len);
- while (getline(&buf, &len, f) != -1) {
- if (strcasestr(buf, "vmpeak:")) {
- stats[0] = strtoul(buf + 10, NULL, 10);
- } else if (strcasestr(buf, "vmsize:")) {
- tmp = strtoul(buf + 10, NULL, 10);
- if (tmp > stats[0])
- stats[0] = tmp;
- } else if (strcasestr(buf, "vmhwm:")) {
- stats[1] = strtoul(buf + 6, NULL, 10);
- } else if (strcasestr(buf, "vmrss:")) {
- tmp = strtoul(buf + 10, NULL, 10);
- if (tmp > stats[0])
- stats[0] = tmp;
- }
- }
- free(buf);
- fclose(f);
-
- return TRUE;
-}
-
static int run_testcase(char *infile, GSList *pdlist, struct output *op)
{
struct srd_session *sess;