[lttng-dev] Question about use libbabeltrace

Hui Zhu teawater at gmail.com
Thu Dec 13 00:54:46 EST 2012


Hi guys,

Maybe you had known that I am working on add CTF support to GDB that
use libbabeltrace from my prev mail.

I use libbabeltrace in this patch
http://sourceware.org/ml/gdb-patches/2012-11/msg00717.html

What I check if current machine have libbabeltrace in following way:
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$LIBS -lbabeltrace -lbabeltrace-ctf"
+      rm -f conf.glibtest
+      if test "$cross_compiling" = yes; then :
+  $as_echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <babeltrace/babeltrace.h>
+#include <babeltrace/types.h>
+#include <babeltrace/ctf/events.h>
+#include <babeltrace/ctf/iterator.h>
+
+int
+main ()
+{
+  if (!bt_context_create())
+    return 1;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  no_glib=yes
+fi

Just try to build example with -lbabeltrace -lbabeltrace-ctf.

My question is does libbabeltrace have better way to handle it?  For
example: pkg-config

Thanks,
Hui



More information about the lttng-dev mailing list