Timur Davydov has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/42689?usp=email )
Change subject: build: make timerfd usage optional ......................................................................
build: make timerfd usage optional
Check for sys/timerfd.h in configure and guard its usage with HAVE_SYS_TIMERFD_H.
This avoids build failures on platforms where timerfd is not available.
Change-Id: Id5a700c865f984e8f99199a1e365bb7f1462030a --- M configure.ac M src/osmo-bts-trx/scheduler_trx.c 2 files changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/89/42689/1
diff --git a/configure.ac b/configure.ac index d18d8b3..1d69bc3 100644 --- a/configure.ac +++ b/configure.ac @@ -326,6 +326,11 @@ AC_DEFINE(HAVE_LINUX_IF_PACKET_H, 1, [Define if we found linux/if_packet.h]) fi
+AC_CHECK_HEADER([sys/timerfd.h], [sys_timerfd_header="yes"], []) +if test "x$sys_timerfd_header" = "xyes" ; then + AC_DEFINE(HAVE_SYS_TIMERFD_H, 1, [Define if we found sys/timerfd.h]) +fi + # Generate manuals AC_ARG_ENABLE(manuals, [AS_HELP_STRING( diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index a9a53f6..99efdf6 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -28,7 +28,9 @@ #include <stdint.h> #include <ctype.h> #include <inttypes.h> +#ifdef HAVE_SYS_TIMERFD_H #include <sys/timerfd.h> +#endif
#include <osmocom/core/msgb.h> #include <osmocom/core/talloc.h>