From 6816a5cb0ae2e7b7ee9e6b460629f89a2f4f99e6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 23 Feb 2012 08:01:42 -0500 Subject: [PATCH] Freebsd support: check for libc/libdl dlopen Signed-off-by: Mathieu Desnoyers --- configure.ac | 18 ++++++++++++++++++ tests/ust-nevents/Makefile.am | 9 ++++++++- tests/ust-nprocesses/Makefile.am | 9 ++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c07052a0f..f8af52c1e 100644 --- a/configure.ac +++ b/configure.ac @@ -116,6 +116,24 @@ AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl AC_CHECK_FUNCS([sched_getcpu sysconf]) +# check for dlopen +AC_CHECK_LIB([dl], [dlopen], +[ + have_libdl=yes +], +[ + #libdl not found, check for dlopen in libc. + AC_CHECK_LIB([c], [dlopen], + [ + have_libc_dl=yes + ], + [ + AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.]) + ]) +]) +AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"]) +AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"]) + # Option to only build the consumer daemon and its libraries AC_ARG_WITH([consumerd-only], AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]), diff --git a/tests/ust-nevents/Makefile.am b/tests/ust-nevents/Makefile.am index 8b7a914ee..3cec0ed63 100644 --- a/tests/ust-nevents/Makefile.am +++ b/tests/ust-nevents/Makefile.am @@ -1,5 +1,12 @@ AM_CFLAGS = -I. -O2 -AM_LDFLAGS = -llttng-ust -ldl +AM_LDFLAGS = -llttng-ust + +if LTTNG_TOOLS_BUILD_WITH_LIBDL +AM_CFLAGS += -ldl +endif +if LTTNG_TOOLS_BUILD_WITH_LIBC_DL +AM_CFLAGS += -lc +endif noinst_PROGRAMS = gen-nevents gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h diff --git a/tests/ust-nprocesses/Makefile.am b/tests/ust-nprocesses/Makefile.am index 39168d6a2..abdc7ff64 100644 --- a/tests/ust-nprocesses/Makefile.am +++ b/tests/ust-nprocesses/Makefile.am @@ -1,5 +1,12 @@ AM_CFLAGS = -I. -O2 -AM_LDFLAGS = -llttng-ust -ldl +AM_LDFLAGS = -llttng-ust + +if LTTNG_TOOLS_BUILD_WITH_LIBDL +AM_CFLAGS += -ldl +endif +if LTTNG_TOOLS_BUILD_WITH_LIBC_DL +AM_CFLAGS += -lc +endif noinst_PROGRAMS = gen-events-time gen_events_time_SOURCES = gen-events-time.c tp.c ust_gen_event.h -- 2.34.1