X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=configure.ac;h=0791682e62f97d8619ccf9357c1d491db868f004;hb=83dcc0261a9cb44d9c5a25318e057a1aec6518a0;hp=8e9a208e13bce7eb5208c79e49eda4aa75d5f7b2;hpb=009eade45d13e95430fcfaf2d21c05815ac40c92;p=lttng-tools.git diff --git a/configure.ac b/configure.ac index 8e9a208e1..0791682e6 100644 --- a/configure.ac +++ b/configure.ac @@ -411,31 +411,33 @@ AC_CHECK_DECL([urcu_ref_get_unless_zero], [], [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include ]] ) -# Check kmod library -AC_ARG_WITH(kmod-prefix, - AS_HELP_STRING([--with-kmod-prefix=PATH], - [Specify the installation prefix of the kmod library. - Headers must be in PATH/include; libraries in PATH/lib.]), - [ - AM_CPPFLAGS="$AM_CPPFLAGS -I${withval}/include" - LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib" - ]) - -AC_ARG_ENABLE(kmod, - AS_HELP_STRING([--disable-kmod],[build without kmod support]), - kmod_support=$enableval, kmod_support=yes) +# Check for libkmod, it will be auto-neabled if found but won't fail if it's not, +# it can be explicitly disabled with --without-kmod +AH_TEMPLATE([HAVE_KMOD], [Define if you have kmod support]) +AC_ARG_WITH([kmod], + [AS_HELP_STRING([--with-kmod], [build with lkmod support @<:@default=check@:>@])], + [], + [with_kmod=check] +) -AS_IF([test "x$kmod_support" = "xyes"], [ - AC_CHECK_LIB([kmod], [kmod_module_probe_insert_module], - [ - AC_DEFINE([HAVE_KMOD], [1], [has kmod support]) - LIBS="$LIBS -lkmod" - kmod_found=yes - ], - kmod_found=no - ) -]) -AM_CONDITIONAL([HAVE_KMOD], [test "x$kmod_found" = xyes]) +AS_IF([test "x$with_kmod" != "xno"], + [ + AC_CHECK_LIB([kmod], [kmod_module_probe_insert_module], + [ + AC_DEFINE([HAVE_KMOD], [1]) + KMOD_LIBS="-lkmod" + ], + [ + if test "x$with_kmod" != xcheck; then + AC_MSG_FAILURE([Cannot find libkmod. Use [LDFLAGS]=-Ldir and [CPPFLAGS]=-Idir to specify its location.]) + else + with_kmod=no + fi + ] + ) + ] +) +AC_SUBST(KMOD_LIBS) AC_ARG_WITH(lttng-ust-prefix, AS_HELP_STRING([--with-lttng-ust-prefix=PATH], @@ -466,21 +468,16 @@ AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range]) # 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"]) + [DL_LIBS="-ldl"], + [ + #libdl not found, check for dlopen in libc. + AC_CHECK_LIB([c], [dlopen], + [DL_LIBS="-lc"], + [AC_MSG_FAILURE([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])] + ) + ] +) +AC_SUBST(DL_LIBS) # Check for fmemopen AC_CHECK_LIB([c], [fmemopen], @@ -1131,7 +1128,7 @@ done PPRINT_PROP_STRING([Target architecture], $target_arch) # kmod enabled/disabled -test "x$kmod_found" = "xyes" && value=1 || value=0 +test "x$with_kmod" != "xno" && value=1 || value=0 PPRINT_PROP_BOOL([libkmod support], $value) # LTTng-UST enabled/disabled