| 1 | AC_INIT([lttng-tools],[2.1.0-rc3],[dgoulet@efficios.com],[],[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 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 8 | |
| 9 | version_name="Basse Messe" |
| 10 | version_description="Light coloured German ale whose style was named after the city Cologne (Koln) where it was first brewed. It is a rather simple beer with lightly fruity aromas and a delicate hoppy fragrance. The beer has a pronounced malty taste with a subtle bitter aftertaste" |
| 11 | |
| 12 | AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "") |
| 13 | AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], "") |
| 14 | |
| 15 | AC_CONFIG_HEADERS([include/config.h]) |
| 16 | |
| 17 | AC_PROG_GREP |
| 18 | # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321. |
| 19 | AC_ARG_ENABLE(libtool-linkdep-fixup, |
| 20 | AS_HELP_STRING([--disable-libtool-linkdep-fixup], |
| 21 | [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]), |
| 22 | libtool_fixup=$enableval, |
| 23 | libtool_fixup=yes) |
| 24 | |
| 25 | AS_IF([test "x$libtool_fixup" = "xyes"], |
| 26 | [ |
| 27 | libtool_m4="$srcdir/config/libtool.m4" |
| 28 | libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" |
| 29 | AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) |
| 30 | libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) |
| 31 | AS_IF([test $libtool_flag_pattern_count -ne 0], |
| 32 | [ |
| 33 | AC_MSG_RESULT([$libtool_flag_pattern_count]) |
| 34 | AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) |
| 35 | sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 |
| 36 | ], |
| 37 | [ |
| 38 | AC_MSG_RESULT([none]) |
| 39 | ]) |
| 40 | ]) |
| 41 | |
| 42 | AC_CHECK_HEADERS([ \ |
| 43 | sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \ |
| 44 | signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \ |
| 45 | getopt.h sys/ipc.h sys/shm.h popt.h grp.h \ |
| 46 | ]) |
| 47 | |
| 48 | # Babeltrace viewer check |
| 49 | AC_ARG_WITH([babeltrace-bin], |
| 50 | AS_HELP_STRING([--with-babeltrace-bin], |
| 51 | [Location of the babeltrace viewer executable (including the filename)]), |
| 52 | [BABELTRACE_BIN="$withval"], |
| 53 | [BABELTRACE_BIN='']) |
| 54 | AC_SUBST([BABELTRACE_BIN]) |
| 55 | |
| 56 | # lttv-gui |
| 57 | AC_ARG_WITH([lttv-gui-bin], |
| 58 | AS_HELP_STRING([--with-lttv-gui-bin], |
| 59 | [Location of the lttv GUI viewer executable (including the filename)]), |
| 60 | [LTTV_GUI_BIN="$withval"], |
| 61 | [LTTV_GUI_BIN='']) |
| 62 | AC_SUBST([LTTV_GUI_BIN]) |
| 63 | |
| 64 | AC_ARG_WITH([consumerd32-bin], |
| 65 | AS_HELP_STRING([--with-consumerd32-bin], |
| 66 | [Location of the 32-bit consumerd executable (including the filename)]), |
| 67 | [CONSUMERD32_BIN="$withval"], |
| 68 | [CONSUMERD32_BIN='']) |
| 69 | AC_SUBST([CONSUMERD32_BIN]) |
| 70 | |
| 71 | AC_ARG_WITH([consumerd64-bin], |
| 72 | AS_HELP_STRING([--with-consumerd64-bin], |
| 73 | [Location of the 64-bit consumerd executable (including the filename)]), |
| 74 | [CONSUMERD64_BIN="$withval"], |
| 75 | [CONSUMERD64_BIN='']) |
| 76 | AC_SUBST([CONSUMERD64_BIN]) |
| 77 | |
| 78 | AC_ARG_WITH([consumerd32-libdir], |
| 79 | AS_HELP_STRING([--with-consumerd32-libdir], |
| 80 | [Directory containing the 32-bit consumerd libraries]), |
| 81 | [CONSUMERD32_LIBDIR="$withval"], |
| 82 | [CONSUMERD32_LIBDIR='']) |
| 83 | AC_SUBST([CONSUMERD32_LIBDIR]) |
| 84 | |
| 85 | AC_ARG_WITH([consumerd64-libdir], |
| 86 | AS_HELP_STRING([--with-consumerd64-libdir], |
| 87 | [Directory containing the 64-bit consumerd libraries]), |
| 88 | [CONSUMERD64_LIBDIR="$withval"], |
| 89 | [CONSUMERD64_LIBDIR='']) |
| 90 | AC_SUBST([CONSUMERD64_LIBDIR]) |
| 91 | |
| 92 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.]) |
| 93 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable]) |
| 94 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.]) |
| 95 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.]) |
| 96 | AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.]) |
| 97 | AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.]) |
| 98 | |
| 99 | # Check for pthread |
| 100 | AC_CHECK_LIB([pthread], [pthread_create], [], |
| 101 | [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] |
| 102 | ) |
| 103 | |
| 104 | # Check libpopt |
| 105 | AC_CHECK_LIB([popt], [poptGetContext], [], |
| 106 | [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])] |
| 107 | ) |
| 108 | |
| 109 | # URCU library version needed or newer |
| 110 | liburcu_version=">= 0.6.7" |
| 111 | |
| 112 | # Check liburcu needed function calls |
| 113 | AC_CHECK_DECL([cds_list_add], [], |
| 114 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]] |
| 115 | ) |
| 116 | AC_CHECK_DECL([cds_wfq_init], [], |
| 117 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]] |
| 118 | ) |
| 119 | AC_CHECK_DECL([cds_wfq_dequeue_blocking], [], |
| 120 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]] |
| 121 | ) |
| 122 | AC_CHECK_DECL([futex_async], [], |
| 123 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]] |
| 124 | ) |
| 125 | AC_CHECK_DECL([rcu_thread_offline], [], |
| 126 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] |
| 127 | ) |
| 128 | AC_CHECK_DECL([rcu_thread_online], [], |
| 129 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] |
| 130 | ) |
| 131 | AC_CHECK_DECL([caa_likely], [], |
| 132 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] |
| 133 | ) |
| 134 | |
| 135 | # Check liblttng-ust-ctl library |
| 136 | AC_ARG_ENABLE(lttng-ust, |
| 137 | AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]), |
| 138 | lttng_ust_support=$enableval, lttng_ust_support=yes) |
| 139 | |
| 140 | AS_IF([test "x$lttng_ust_support" = "xyes"], [ |
| 141 | AC_CHECK_LIB([lttng-ust-ctl], [ustctl_set_filter], |
| 142 | [ |
| 143 | AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) |
| 144 | lttng_ust_ctl_found=yes |
| 145 | ], |
| 146 | [AC_MSG_ERROR([Cannot find LTTng-UST. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], |
| 147 | [-lurcu-common -lurcu-bp -lurcu-cds] |
| 148 | ) |
| 149 | ]) |
| 150 | AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) |
| 151 | AC_CHECK_FUNCS([sched_getcpu sysconf]) |
| 152 | |
| 153 | # check for dlopen |
| 154 | AC_CHECK_LIB([dl], [dlopen], |
| 155 | [ |
| 156 | have_libdl=yes |
| 157 | ], |
| 158 | [ |
| 159 | #libdl not found, check for dlopen in libc. |
| 160 | AC_CHECK_LIB([c], [dlopen], |
| 161 | [ |
| 162 | have_libc_dl=yes |
| 163 | ], |
| 164 | [ |
| 165 | AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.]) |
| 166 | ]) |
| 167 | ]) |
| 168 | AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"]) |
| 169 | AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"]) |
| 170 | |
| 171 | # Check for fmemopen |
| 172 | AC_CHECK_LIB([c], [fmemopen], |
| 173 | [ |
| 174 | AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.]) |
| 175 | ] |
| 176 | ) |
| 177 | |
| 178 | # Check for open_memstream |
| 179 | AC_CHECK_LIB([c], [open_memstream], |
| 180 | [ |
| 181 | AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.]) |
| 182 | ] |
| 183 | ) |
| 184 | |
| 185 | # For Python |
| 186 | # SWIG version needed or newer: |
| 187 | swig_version=2.0.0 |
| 188 | |
| 189 | AC_ARG_ENABLE([python-bindings], |
| 190 | [AC_HELP_STRING([--enable-python-bindings], |
| 191 | [compile Python bindings])], |
| 192 | [enable_python=yes], [enable_python=no]) |
| 193 | |
| 194 | AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes]) |
| 195 | |
| 196 | if test "x${enable_python:-yes}" = xyes; then |
| 197 | AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ]) |
| 198 | AM_PATH_PYTHON |
| 199 | |
| 200 | AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) |
| 201 | AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) |
| 202 | AS_IF([test -z "$PYTHON_INCLUDE"], [ |
| 203 | AS_IF([test -z "$PYTHON_CONFIG"], [ |
| 204 | AC_PATH_PROGS([PYTHON_CONFIG], |
| 205 | [python$PYTHON_VERSION-config python-config], |
| 206 | [no], |
| 207 | [`dirname $PYTHON`]) |
| 208 | AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])]) |
| 209 | ]) |
| 210 | AC_MSG_CHECKING([python include flags]) |
| 211 | PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` |
| 212 | AC_MSG_RESULT([$PYTHON_INCLUDE]) |
| 213 | ]) |
| 214 | |
| 215 | else |
| 216 | AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl |
| 217 | [if you want Python bindings.]) |
| 218 | |
| 219 | fi |
| 220 | |
| 221 | # Option to only build the consumer daemon and its libraries |
| 222 | AC_ARG_WITH([consumerd-only], |
| 223 | AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]), |
| 224 | [consumerd_only=$withval], |
| 225 | [consumerd_only=no]) |
| 226 | AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) |
| 227 | |
| 228 | # Epoll check. If not present, the build will fallback on poll() API |
| 229 | AX_HAVE_EPOLL( |
| 230 | [AX_CONFIG_FEATURE_ENABLE(epoll)], |
| 231 | [AX_CONFIG_FEATURE_DISABLE(epoll)] |
| 232 | ) |
| 233 | AX_CONFIG_FEATURE( |
| 234 | [epoll], [This platform supports epoll(7)], |
| 235 | [HAVE_EPOLL], [This platform supports epoll(7).], |
| 236 | [enable_epoll="yes"], [enable_epoll="no"] |
| 237 | ) |
| 238 | AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) |
| 239 | |
| 240 | AC_SYS_LARGEFILE |
| 241 | AC_PROG_CC |
| 242 | LT_INIT |
| 243 | AC_PROG_YACC |
| 244 | AC_PROG_LEX |
| 245 | |
| 246 | AC_DEFUN([AC_PROG_BISON], [AC_CHECK_PROGS(BISON, bison, bison)]) |
| 247 | |
| 248 | CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing" |
| 249 | |
| 250 | DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h" |
| 251 | |
| 252 | lttngincludedir="${includedir}/lttng" |
| 253 | |
| 254 | AC_SUBST(lttngincludedir) |
| 255 | AC_SUBST(DEFAULT_INCLUDES) |
| 256 | |
| 257 | lttnglibexecdir="${libdir}/lttng/libexec" |
| 258 | AC_SUBST(lttnglibexecdir) |
| 259 | |
| 260 | AC_CONFIG_FILES([ |
| 261 | Makefile |
| 262 | doc/Makefile |
| 263 | doc/man/Makefile |
| 264 | include/Makefile |
| 265 | extras/Makefile |
| 266 | extras/bindings/Makefile |
| 267 | extras/bindings/swig/Makefile |
| 268 | extras/bindings/swig/python/Makefile |
| 269 | src/Makefile |
| 270 | src/common/Makefile |
| 271 | src/common/kernel-ctl/Makefile |
| 272 | src/common/kernel-consumer/Makefile |
| 273 | src/common/ust-consumer/Makefile |
| 274 | src/common/hashtable/Makefile |
| 275 | src/common/sessiond-comm/Makefile |
| 276 | src/common/compat/Makefile |
| 277 | src/common/relayd/Makefile |
| 278 | src/lib/Makefile |
| 279 | src/lib/lttng-ctl/Makefile |
| 280 | src/lib/lttng-ctl/filter/Makefile |
| 281 | src/bin/Makefile |
| 282 | src/bin/lttng-consumerd/Makefile |
| 283 | src/bin/lttng-sessiond/Makefile |
| 284 | src/bin/lttng-relayd/Makefile |
| 285 | src/bin/lttng/Makefile |
| 286 | tests/Makefile |
| 287 | tests/kernel/Makefile |
| 288 | tests/tools/Makefile |
| 289 | tests/tools/streaming/Makefile |
| 290 | tests/ust/Makefile |
| 291 | tests/ust/nprocesses/Makefile |
| 292 | tests/ust/high-throughput/Makefile |
| 293 | tests/ust/low-throughput/Makefile |
| 294 | tests/ust/before-after/Makefile |
| 295 | tests/ust/multi-session/Makefile |
| 296 | ]) |
| 297 | |
| 298 | AC_OUTPUT |
| 299 | |
| 300 | # |
| 301 | # Mini-report on what will be built |
| 302 | # |
| 303 | AS_ECHO() |
| 304 | |
| 305 | AS_ECHO("Version name: $version_name") |
| 306 | AS_ECHO("$version_description") |
| 307 | |
| 308 | AS_ECHO() |
| 309 | |
| 310 | # Target architecture we're building for |
| 311 | target_arch=$host_cpu |
| 312 | [ |
| 313 | for f in $CFLAGS; do |
| 314 | if test $f = "-m32"; then |
| 315 | target_arch="32-bit" |
| 316 | elif test $f = "-m64"; then |
| 317 | target_arch="64-bit" |
| 318 | fi |
| 319 | done |
| 320 | ] |
| 321 | AS_ECHO_N("Target architecture: ") |
| 322 | AS_ECHO($target_arch) |
| 323 | |
| 324 | # LTTng-UST enabled/disabled |
| 325 | AS_ECHO_N("Lttng-UST support: ") |
| 326 | AS_IF([test "x$lttng_ust_support" = "xyes"],[ |
| 327 | AS_ECHO("Enabled") |
| 328 | ],[ |
| 329 | AS_ECHO("Disabled") |
| 330 | ]) |
| 331 | |
| 332 | #Python binding enabled/disabled |
| 333 | AS_ECHO_N("Python binding: ") |
| 334 | AS_IF([test "x${enable_python:-yes}" = xyes], [ |
| 335 | AS_ECHO("Enabled") |
| 336 | ],[ |
| 337 | AS_ECHO("Disabled") |
| 338 | ]) |
| 339 | |
| 340 | # Do we build only the consumerd, or everything |
| 341 | AS_IF([test "x$consumerd_only" = "xyes"],[ |
| 342 | AS_ECHO("Only the consumerd daemon will be built.") |
| 343 | ],[ |
| 344 | AS_ECHO("All binaries will be built.") |
| 345 | ]) |
| 346 | |
| 347 | # Print the bindir and libdir this `make install' will install into. |
| 348 | AS_ECHO() |
| 349 | AS_ECHO_N("Binaries will be installed in: ") |
| 350 | AS_ECHO("`eval eval echo $bindir`") |
| 351 | AS_ECHO_N("Libraries will be installed in: ") |
| 352 | AS_ECHO("`eval eval echo $libdir`") |
| 353 | |
| 354 | # If we build the sessiond, print the paths it will use |
| 355 | AS_IF([test "x$consumerd_only" = "xno"],[ |
| 356 | AS_ECHO() |
| 357 | AS_ECHO("The sessiond daemon will look in the following directories: ") |
| 358 | AS_ECHO_N("32-bit consumerd executable at: ") |
| 359 | AS_IF([test "$CONSUMERD32_BIN" = ""],[ |
| 360 | AS_ECHO_N("`eval eval echo $lttnglibexecdir`") |
| 361 | AS_ECHO("/lttng-consumerd") |
| 362 | ],[ |
| 363 | AS_ECHO("$CONSUMERD32_BIN") |
| 364 | ]) |
| 365 | |
| 366 | AS_ECHO_N("32-bit consumer libraries in: ") |
| 367 | AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[ |
| 368 | AS_ECHO("`eval eval echo $libdir`") |
| 369 | ],[ |
| 370 | AS_ECHO("$CONSUMERD32_LIBDIR") |
| 371 | ]) |
| 372 | |
| 373 | AS_ECHO_N("64-bit consumerd executable at: ") |
| 374 | AS_IF([test "$CONSUMERD64_BIN" = ""],[ |
| 375 | AS_ECHO_N("`eval eval echo $lttnglibexecdir`") |
| 376 | AS_ECHO("/lttng-consumerd") |
| 377 | ],[ |
| 378 | AS_ECHO("$CONSUMERD64_BIN") |
| 379 | ]) |
| 380 | |
| 381 | AS_ECHO_N("64-bit consumer libraries in: ") |
| 382 | AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[ |
| 383 | AS_ECHO("`eval eval echo $libdir`") |
| 384 | ],[ |
| 385 | AS_ECHO("$CONSUMERD64_LIBDIR") |
| 386 | ]) |
| 387 | ]) |
| 388 | |
| 389 | AS_ECHO() |
| 390 | |