AM_CONDITIONAL([HAVE_CXX], [test "$HAVE_CXX11" = "1"])
+## ##
+## Header checks ##
+## ##
+
+AC_HEADER_STDBOOL
+AC_CHECK_HEADERS([ \
+ arpa/inet.h \
+ dlfcn.h \
+ fcntl.h \
+ float.h \
+ limits.h \
+ linux/perf_event.h \
+ locale.h \
+ stddef.h \
+ sys/socket.h \
+ sys/time.h \
+ wchar.h \
+])
+
+# Check for dlinfo() by testing for RTLD_DI_LINKMAP in dlfcn.h
+AS_IF([test "x$ac_cv_header_dlfcn_h" = "xyes"], [
+ AC_CHECK_DECL([RTLD_DI_LINKMAP], [], [], [[#include <dlfcn.h>]])
+])
+
+
# Checks for programs.
AM_PROG_AR
AC_PROG_SED
# AC_FUNC_MALLOC causes problems when cross-compiling.
#AC_FUNC_MALLOC
-# Checks for header files.
-AC_HEADER_STDBOOL
-AC_CHECK_HEADERS([ \
- arpa/inet.h \
- fcntl.h \
- float.h \
- limits.h \
- locale.h \
- stddef.h \
- sys/socket.h \
- sys/time.h \
- wchar.h \
-])
-
# Set architecture specific options
AS_CASE([$host_cpu],
[i[[3456]]86], [],
[AC_DEFINE([HAVE_DLMOPEN], [1])]
)
-# Check for dlfcn.h
-AC_CHECK_HEADER([dlfcn.h])
-AS_IF([test "x${ac_cv_header_dlfcn_h}" = "xyes"], [
- AC_CHECK_DECLS([RTLD_DI_LINKMAP], [], [], [
- #include <dlfcn.h>
- ])
-], [
- ac_cv_have_decl_RTLD_DI_LINKMAP="no"
-])
-
AM_CONDITIONAL([ENABLE_UST_DL], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])
# Require URCU >= 0.12 for DEFINE_URCU_TLS_INIT
])
AM_CONDITIONAL([ENABLE_NUMA], [test "x$have_libnuma" = "xyes"])
-# optional linux/perf_event.h
-AC_CHECK_HEADERS([linux/perf_event.h], [have_perf_event=yes], [])
-
-# Perf event counters are supported on all architectures supported by
-# perf, using the read system call as fallback.
-AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$have_perf_event" = "xyes"])
-
-AH_TEMPLATE([HAVE_PERF_EVENT], ["Perf event integration via perf_event.h"])
-AS_IF([test "x$have_perf_event" = "xyes"], [
- AC_DEFINE([HAVE_PERF_EVENT], [1])
-])
+AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$ac_cv_header_linux_perf_event_h" = "xyes"])
# Check for JNI header files if requested
AC_ARG_ENABLE([jni-interface], [
test "x$python_agent" = xyes && value=1 || value=0
PPRINT_PROP_BOOL_CUSTOM([Python agent], $value, [use --enable-python-agent])
-test "x$have_perf_event" = "xyes" && value=1 || value=0
+test "x$ac_cv_header_linux_perf_event_h" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL_CUSTOM([Perf event integration], $value)
test "x$enable_numa" = xyes && value=1 || value=0
__attribute__((visibility("hidden")))
void lttng_counter_transport_unregister(struct lttng_counter_transport *transport);
-#ifdef HAVE_PERF_EVENT
+#ifdef HAVE_LINUX_PERF_EVENT_H
__attribute__((visibility("hidden")))
void lttng_ust_fixup_perf_counter_tls(void);
__attribute__((visibility("hidden")))
void lttng_perf_unlock(void);
-#else /* #ifdef HAVE_PERF_EVENT */
+#else /* #ifdef HAVE_LINUX_PERF_EVENT_H */
static inline
void lttng_ust_fixup_perf_counter_tls(void)
{
void lttng_perf_unlock(void)
{
}
-#endif /* #else #ifdef HAVE_PERF_EVENT */
+#endif /* #else #ifdef HAVE_LINUX_PERF_EVENT_H */
#endif /* _LTTNG_TRACER_CORE_H */
const char *counter_transport_name,
size_t number_dimensions, const struct lttng_counter_dimension *dimensions);
-#ifdef HAVE_PERF_EVENT
+#ifdef HAVE_LINUX_PERF_EVENT_H
__attribute__((visibility("hidden")))
int lttng_add_perf_counter_to_ctx(uint32_t type,
__attribute__((visibility("hidden")))
void lttng_perf_counter_exit(void);
-#else /* #ifdef HAVE_PERF_EVENT */
+#else /* #ifdef HAVE_LINUX_PERF_EVENT_H */
static inline
int lttng_add_perf_counter_to_ctx(uint32_t type,
void lttng_perf_counter_exit(void)
{
}
-#endif /* #else #ifdef HAVE_PERF_EVENT */
+#endif /* #else #ifdef HAVE_LINUX_PERF_EVENT_H */
__attribute__((visibility("hidden")))
int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list *list);