X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=configure.ac;h=213e4a0c5eeaa34d0825c98668e4186d7ee5dcd7;hb=afa28e0364b5132f3473ff08d9bca2026e723b41;hp=075fe521bff11761c206b291e43e024025601b77;hpb=6cb88bc04f67ebc3264d3832f4ce5cca2c642ab4;p=ust.git diff --git a/configure.ac b/configure.ac index 075fe52..213e4a0 100644 --- a/configure.ac +++ b/configure.ac @@ -49,11 +49,38 @@ AC_C_INLINE AC_FUNC_MALLOC AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol]) -AC_ARG_WITH(urcu, [ --with-urcu path Path to userspace RCU source], URCU_PATH="$withval", AC_MSG_ERROR([Must specify urcu path.])) -AC_ARG_WITH(kcompat, [ --with-kcompat path Path to userspace kcompat source], KCOMPAT_PATH="$withval", AC_MSG_ERROR([Must specify kcompat path.])) -AC_SUBST(URCU_PATH) +KCOMPAT_PATH= +AC_ARG_WITH(kcompat, [ --with-kcompat path Path to userspace kcompat source], [ + AC_CHECK_FILE(["$withval/kcompat.h"], KCOMPAT_PATH="$withval", [ + AC_MSG_ERROR([Cannot find kcompat.h in kcompat directory]) + ]) +]) +if test -n "${KCOMPAT_PATH}" ; then + CPPFLAGS="-I$KCOMPAT_PATH/ $CPPFLAGS" + AC_SUBST(CPPFLAGS) +fi +AC_CHECK_HEADER([kcompat.h], , AC_MSG_ERROR([Must specify kcompat path.])) AC_SUBST(KCOMPAT_PATH) +URCU_LIB= +AC_CHECK_HEADER([urcu.h], [ + AC_CHECK_LIB(urcu, synchronize_rcu, [ + URCU_PATH= + URCU_LIB="-lurcu" + ]) +]) +AC_ARG_WITH(urcu, [ --with-urcu path Path to userspace RCU source], [ + AC_CHECK_FILE(["$withval/urcu.h"], [ + URCU_PATH="$withval" + URCU_LIB="/liburcu.la" ], + AC_MSG_ERROR([Cannot find urcu.h in urcu directory])) +]) +if test -z "${URCU_LIB}" ; then + AC_MSG_ERROR([Must specify urcu path.]) +fi +AC_SUBST(URCU_PATH) +AC_SUBST(URCU_LIB) + #AC_CONFIG_FILES([Makefile # hello/Makefile # libmallocwrap/Makefile @@ -63,5 +90,5 @@ AC_SUBST(KCOMPAT_PATH) # ust/Makefile # ustd/Makefile]) -AC_CONFIG_FILES([Makefile libust/Makefile hello/Makefile libmallocwrap/Makefile ustd/Makefile]) +AC_CONFIG_FILES([Makefile libust/Makefile hello/Makefile libmallocwrap/Makefile ustd/Makefile ust/Makefile]) AC_OUTPUT