Currently "configure" adds -lrt to the link options if building for the FreeBSD platform (only). This is contrary to the spirit of having an automated build configuration: it should detect what build options are actually required, not base this assumption on the platform. I.e. if a small program using appropriate Dasynq functionality can be linked without -lrt then it should be assumed that -lrt isn't needed.
Activity
5That's only an appropriate test if Dasynq will actually use those functions - it doesn't on every platform. Better to test by actually creating a Dasynq timer.
(Edit: eg older versions of Linux required -lrt for timer_create, but Dasynq doesn't use timer_create on Linux by default. But also the Dasynq implementation may change down the line. For instance it might be possible to use kqueue timers when kqueue is available, and so there'd be no need for timer_create on some additional systems. But if you just check for timer_create then you don't capture that, and might end up linking against librt when it's not necessary).
After checking Dasynq timers, it looks like that Dasynq timers use timerfd on Linux and not POSIX timers. I think I can optimize the check to skip the check entirely when on Linux. Does this break anything?
POSIX timers are used on Linux if built with DASYNQ_HAVE_EPOLL=0.
POSIX timers are used on Linux if built with
DASYNQ_HAVE_EPOLL=0.
Right
I think a test program with a simple
timer_create()andtimer_delete()would be enough.