configure.ac: check for an existing liburcu-cds symbol
[lttng-tools.git] / configure.ac
index b0cc5f76d31858bec20b6c5242b35106192f6dfe..47b794f9bc493b5de8207b1a8991d6bc69e75e6d 100644 (file)
@@ -14,6 +14,8 @@ AM_MAINTAINER_MODE([enable])
 # Enable silent rules if available (Introduced in AM 1.11)
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+AC_REQUIRE_AUX_FILE([tap-driver.sh])
+
 # Checks for C compiler
 AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
@@ -279,33 +281,29 @@ AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
 
 # URCU library version needed or newer
-liburcu_version=">= 0.8.0"
+m4_define([WRONG_LIBURCU_MSG], [Userspace RCU (liburcu) >= 0.8.0 is needed])
 
 # Check liburcu needed function calls
 AC_CHECK_DECL([cds_list_add], [],
-       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
-)
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/list.h>]])
 AC_CHECK_DECL([cds_wfcq_init], [],
-       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfcqueue.h>]]
-)
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/wfcqueue.h>]])
 AC_CHECK_DECL([cds_wfcq_dequeue_blocking], [],
-    [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfcqueue.h>]]
-)
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/wfcqueue.h>]])
 AC_CHECK_DECL([futex_async], [],
-       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
-)
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/futex.h>]])
 AC_CHECK_DECL([rcu_thread_offline], [],
-       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
-)
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]])
 AC_CHECK_DECL([rcu_thread_online], [],
-       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
-)
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]])
 AC_CHECK_DECL([caa_likely], [],
-       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
-)
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]])
+AC_CHECK_LIB([urcu-cds], [_cds_lfht_new], [],
+       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])])
+
 #Function added in urcu 0.7.0
 AC_CHECK_DECL([cmm_smp_mb__before_uatomic_or], [],
-        [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
+        [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]]
 )
 
 # Check kmod library
@@ -415,6 +413,7 @@ AM_CONDITIONAL([PYTHON_BINDING], [test "x${enable_python_binding:-yes}" = xyes])
 
 if test "x${enable_python_binding:-yes}" = xyes; then
   AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
+  AS_IF([test x$enable_shared = xno], [ AC_MSG_ERROR([Python bindings require shared libraries.]) ])
   AM_PATH_PYTHON([3.0])
 
   AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
@@ -502,15 +501,15 @@ AC_ARG_ENABLE(
                [--disable-build-man-pages],
                [Build man pages (already built in a distributed tarball)]
        ),
-       [enable_build_man_pages=no],
-       [enable_build_man_pages=yes]
+       [build_man_pages=$enableval],
+       [build_man_pages=yes]
 )
 
 # export man page build condition
-AM_CONDITIONAL([BUILD_MAN_PAGES], [test "x$enable_build_man_pages" != "xno"])
+AM_CONDITIONAL([BUILD_MAN_PAGES], [test "x$build_man_pages" != "xno"])
 
 # check for asciidoc and xmlto if we enabled building the man pages
-AS_IF([test "x$enable_build_man_pages" = "xyes"], [
+AS_IF([test "x$build_man_pages" = "xyes"], [
        AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
        AC_PATH_PROG([XMLTO], [xmlto], [no])
 
@@ -994,8 +993,7 @@ AS_ECHO
 PPRINT_SUBTITLE([Man pages])
 
 # man pages build enabled/disabled
-test "x$enable_build_man_pages" = "xyes" && value=1 || value=0
-AS_IF([test "x$enable_build_man_pages" = "xyes"], [
+AS_IF([test "x$build_man_pages" = "xyes"], [
        PPRINT_PROP_BOOL([Build man pages], 1)
 ], [
        AS_IF([test "x$in_git_repo" = "xyes"], [
@@ -1006,7 +1004,7 @@ AS_IF([test "x$enable_build_man_pages" = "xyes"], [
 ])
 
 # man pages install enabled/disabled (always true in tarball)
-test "x$enable_build_man_pages" = "xno" && test "x$in_git_repo" = "xyes" && value=0 || value=1
+test "x$build_man_pages" != "xyes" && test "x$in_git_repo" = "xyes" && value=0 || value=1
 PPRINT_PROP_BOOL([Install man pages], $value)
 
 report_bindir="`eval eval echo $bindir`"
This page took 0.024899 seconds and 4 git commands to generate.