| 1 | AC_INIT([lttng-tools], [2.0-pre14], [david.goulet@polymtl.ca], ,[http://lttng.org]) |
| 2 | AC_CONFIG_AUX_DIR([config]) |
| 3 | AC_CANONICAL_TARGET |
| 4 | AC_CANONICAL_HOST |
| 5 | AC_CONFIG_MACRO_DIR([config]) |
| 6 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
| 9 | AC_CONFIG_HEADERS([include/config.h]) |
| 10 | |
| 11 | AH_TEMPLATE([CONFIG_LTTNG_TOOLS_HAVE_UST], [Defined on systems where UST headers can be found.]) |
| 12 | |
| 13 | AC_CHECK_HEADERS([ \ |
| 14 | sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \ |
| 15 | signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \ |
| 16 | getopt.h sys/ipc.h sys/shm.h popt.h grp.h \ |
| 17 | ]) |
| 18 | |
| 19 | # URCU library version needed or newer |
| 20 | liburcu_version=">= 0.6.5" |
| 21 | |
| 22 | # Check for pthread |
| 23 | AC_CHECK_LIB([pthread], [pthread_create], [], |
| 24 | [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] |
| 25 | ) |
| 26 | |
| 27 | # Check libpopt |
| 28 | AC_CHECK_LIB([popt], [poptGetContext], [], |
| 29 | [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])] |
| 30 | ) |
| 31 | |
| 32 | # Check liburcu needed function calls |
| 33 | AC_CHECK_DECL([cds_list_add], [], |
| 34 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]] |
| 35 | ) |
| 36 | AC_CHECK_DECL([cds_wfq_init], [], |
| 37 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]] |
| 38 | ) |
| 39 | AC_CHECK_DECL([futex_async], [], |
| 40 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]] |
| 41 | ) |
| 42 | AC_CHECK_DECL([rcu_thread_offline], [], |
| 43 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] |
| 44 | ) |
| 45 | AC_CHECK_DECL([rcu_thread_online], [], |
| 46 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] |
| 47 | ) |
| 48 | AC_CHECK_DECL([ustctl_create_session], |
| 49 | [ |
| 50 | AC_DEFINE([CONFIG_LTTNG_TOOLS_HAVE_UST], 1) |
| 51 | have_ust_test=1 |
| 52 | ], |
| 53 | [ |
| 54 | AC_MSG_WARN([UST header not found. Building without UST support.]) |
| 55 | have_ust_test=0 |
| 56 | ], |
| 57 | [[#include <ust/lttng-ust-ctl.h>]] |
| 58 | ) |
| 59 | |
| 60 | AM_CONDITIONAL([LTTNG_TOOLS_HAVE_UST], [ test "x$have_ust_test" = "x1" ]) |
| 61 | |
| 62 | AC_CHECK_FUNCS([sched_getcpu sysconf]) |
| 63 | |
| 64 | # Epoll check. If not present, the build will fallback on poll() API |
| 65 | AX_HAVE_EPOLL( |
| 66 | [AX_CONFIG_FEATURE_ENABLE(epoll)], |
| 67 | [AX_CONFIG_FEATURE_DISABLE(epoll)] |
| 68 | ) |
| 69 | AX_CONFIG_FEATURE( |
| 70 | [epoll], [This platform supports epoll(7)], |
| 71 | [HAVE_EPOLL], [This platform supports epoll(7).], |
| 72 | [enable_epoll="yes"], [enable_epoll="no"] |
| 73 | ) |
| 74 | AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) |
| 75 | |
| 76 | AC_PROG_CC |
| 77 | AC_PROG_LIBTOOL |
| 78 | |
| 79 | CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing" |
| 80 | |
| 81 | DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir)" |
| 82 | |
| 83 | lttngincludedir="${includedir}/lttng" |
| 84 | |
| 85 | AC_SUBST(lttngincludedir) |
| 86 | AC_SUBST(DEFAULT_INCLUDES) |
| 87 | |
| 88 | AC_CONFIG_FILES([ |
| 89 | Makefile |
| 90 | include/Makefile |
| 91 | libkernelctl/Makefile |
| 92 | liblttng-consumer/Makefile |
| 93 | liblttng-kconsumer/Makefile |
| 94 | liblttng-ustconsumer/Makefile |
| 95 | liblttngctl/Makefile |
| 96 | liblttng-sessiond-comm/Makefile |
| 97 | lttng-consumerd/Makefile |
| 98 | ltt-sessiond/Makefile |
| 99 | lttng/Makefile |
| 100 | tests/Makefile |
| 101 | doc/Makefile |
| 102 | ]) |
| 103 | |
| 104 | AC_OUTPUT |