2 # Process this file with autoconf to produce a configure script.
4 AC_INIT([lttngtop],[0.2],[julien dot desfossez at efficios dot com])
5 AC_CONFIG_AUX_DIR([config])
8 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
11 AC_CONFIG_MACRO_DIR([m4])
13 AC_CONFIG_HEADERS([config.h])
15 # Checks for programs.
22 # Checks for typedefs, structures, and compiler characteristics.
27 # Checks for library functions.
30 AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul])
33 AC_CHECK_LIB([uuid], [uuid_generate], [],
34 [AC_MSG_ERROR([Cannot find the libuuid library.])]
38 AC_CHECK_LIB([popt], [poptGetContext], [],
39 [AC_MSG_ERROR([Cannot find the popt library.])]
42 # Check for libncurses
43 AC_CHECK_LIB([ncurses], [initscr], [], [HAVE_NCURSES=0]
46 # Check for libpanel, also part of libncurses
47 # (but this check will add the required -lpanel flag)
48 AC_CHECK_LIB([panel], [update_panels], [], [HAVE_PANELS=0]
51 # Check for libbabeltrace
52 AC_CHECK_LIB([babeltrace], [bt_context_create], [],
53 [AC_MSG_ERROR([Cannot find the babeltrace library.])]
56 # Check for libbabeltrace-ctf
57 AC_CHECK_LIB([babeltrace-ctf], [bt_ctf_iter_create], [],
58 [AC_MSG_ERROR([Cannot find the babeltrace-ctf library.])]
61 # Check for Glib. It needs to be installed anyway or this macro will not be defined.
62 AM_PATH_GLIB_2_0([2.22.0], [],
63 [AC_MSG_ERROR([Glib 2.22 is required in order to compile LTTngTop.
64 Please install the Glib development files.])], [gmodule]
67 pkg_modules="gmodule-2.0 >= 2.0.0"
68 PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
69 AC_SUBST(PACKAGE_LIBS)
70 LIBS="$LIBS $GMODULE_LIBS"
72 PACKAGE_CFLAGS="$GMODULE_CFLAGS -Wall -Werror=format-security"
73 AC_SUBST(PACKAGE_CFLAGS)
83 AS_IF([test "x$HAVE_NCURSES" = "x0"],[
85 AS_ECHO_N("Ncurses GUI won't be compiled install ncurses if you want it.")
87 CURSES_LIBS="-lcurses -lpanel"
90 AS_ECHO_N("Ncurses GUI will be compiled.")