Check usability of inotify before selecting it
A libinotify compatibility library exists for BSD systems. If this was installed, configure would find sys/inotify.h but the build would fail to link unless the library was added to the link line. By also checking for inotify_init() this problem can be avoided. Given that there is native support for kqueue, there is no need to handle linking with libinotify.
This commit is contained in:
15
configure.in
15
configure.in
@@ -5476,10 +5476,17 @@ if test "$wxUSE_FSWATCHER" = "yes"; then
|
||||
dnl includes OS X which does have kqueue but no other platforms)
|
||||
if test "$USE_WIN32" != 1; then
|
||||
if test "$wxUSE_UNIX" = "yes"; then
|
||||
AC_CHECK_HEADERS(sys/inotify.h,,, [AC_INCLUDES_DEFAULT()])
|
||||
if test "$ac_cv_header_sys_inotify_h" = "yes"; then
|
||||
AC_DEFINE(wxHAS_INOTIFY)
|
||||
else
|
||||
dnl inotify header may be present from a compatibility library so
|
||||
dnl check that the function is usable. We don't try to link with,
|
||||
dnl e.g. -linotify so native kqueue support is used in preference.
|
||||
AC_MSG_CHECKING([whether inotify is usable])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_SOURCE([int main() { return inotify_init(); }])],
|
||||
[wx_cv_inotify_usable=yes; AC_DEFINE(wxHAS_INOTIFY) ],
|
||||
[wx_cv_inotify_usable=no]
|
||||
)
|
||||
AC_MSG_RESULT($wx_cv_inotify_usable)
|
||||
if test "$wx_cv_inotify_usable" = "no"; then
|
||||
AC_CHECK_HEADERS(sys/event.h,,, [AC_INCLUDES_DEFAULT()])
|
||||
if test "$ac_cv_header_sys_event_h" = "yes"; then
|
||||
AC_DEFINE(wxHAS_KQUEUE)
|
||||
|
Reference in New Issue
Block a user