From 117a81eddb1375dd1d08d7e7b57c585354dd2d90 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Dec 2013 23:09:24 +0000 Subject: extconf: avoid unnecessary linkage against libkqueue The check for libkqueue may succeed out-of-the-box on Debian systems where libkqueue-dev is installed. However, libkqueue-dev on Debian installs sys/event.h in a non-standard include path (/usr/include/kqueue), so it is not picked up by default and kqueue support is never compiled. So only check for (and link to) libkqueue if we are configured to detect sys/event.h. This should not affect users on *BSD platforms with native kqueue support. --- ext/sleepy_penguin/extconf.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/sleepy_penguin/extconf.rb b/ext/sleepy_penguin/extconf.rb index 3a6152b..407c947 100644 --- a/ext/sleepy_penguin/extconf.rb +++ b/ext/sleepy_penguin/extconf.rb @@ -1,8 +1,9 @@ require 'mkmf' have_header('sys/epoll.h') dir_config('kqueue') -have_library('kqueue') -have_header('sys/event.h') +if have_header('sys/event.h') + have_library('kqueue') +end have_header('sys/mount.h') have_header('sys/eventfd.h') -- cgit v1.2.3-24-ge0c7