diff --git a/SConstruct b/SConstruct index 9db2ac2e..b044af66 100644 --- a/SConstruct +++ b/SConstruct @@ -371,6 +371,7 @@ if 1: 'sys/devpoll.h', 'sys/epoll.h', 'sys/filio.h', + 'sys/inotify.h', 'sys/loadavg.h', 'sys/poll.h', 'sys/port.h', @@ -519,7 +520,7 @@ if 1: LIBDBI = 'dbi', ) - if env['with_fam']: + if env['with_fam'] and not self.CheckCHeader('sys/inotify.h'): if not autoconf.CheckLibWithHeader('fam', 'fam.h', 'C'): fail("Couldn't find fam") autoconf.env.Append( diff --git a/configure.ac b/configure.ac index 246692a9..97ced9ea 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,7 @@ AC_CHECK_HEADERS([\ sys/epoll.h \ sys/event.h \ sys/filio.h \ + sys/inotify.h \ sys/loadavg.h \ sys/mman.h \ sys/poll.h \ @@ -1036,6 +1037,10 @@ AC_ARG_WITH([fam], ) AC_MSG_RESULT([$WITH_FAM]) +if test "$HAVE_SYS_NOTIFY_H" != no; then + WITH_FAM=no +fi + if test "$WITH_FAM" != no; then if test "$WITH_FAM" != yes; then FAM_LIBS="-L$WITH_FAM -lfam" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d6c24f72..491e6bd8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -91,6 +91,7 @@ check_include_files(sys/epoll.h HAVE_SYS_EPOLL_H) set(CMAKE_REQUIRED_FLAGS "-include sys/types.h") check_include_files(sys/event.h HAVE_SYS_EVENT_H) set(CMAKE_REQUIRED_FLAGS) +check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H) check_include_files(sys/mman.h HAVE_SYS_MMAN_H) check_include_files(sys/loadavg.h HAVE_SYS_LOADAVG_H) check_include_files(sys/poll.h HAVE_SYS_POLL_H) @@ -654,7 +655,7 @@ else() unset(HAVE_LUA_H) endif() -if(WITH_FAM) +if(WITH_FAM AND NOT HAVE_SYS_INOTIFY_H) check_include_files(fam.h HAVE_FAM_H) check_library_exists(fam FAMOpen2 "" HAVE_LIBFAM) if(HAVE_LIBFAM) diff --git a/src/meson.build b/src/meson.build index c618a3b7..71e4ec90 100644 --- a/src/meson.build +++ b/src/meson.build @@ -29,6 +29,7 @@ conf_data = configuration_data() conf_data.set('HAVE_SYS_DEVPOLL_H', compiler.has_header('sys/devpoll.h')) conf_data.set('HAVE_SYS_EPOLL_H', compiler.has_header('sys/epoll.h')) conf_data.set('HAVE_SYS_EVENT_H', compiler.has_header('sys/event.h')) +conf_data.set('HAVE_SYS_INOTIFY_H', compiler.has_header('sys/inotify.h')) conf_data.set('HAVE_SYS_LOADAVG_H', compiler.has_header('sys/loadavg.h')) conf_data.set('HAVE_SYS_MMAN_H', compiler.has_header('sys/mman.h')) conf_data.set('HAVE_SYS_POLL_H', compiler.has_header('sys/poll.h')) @@ -259,7 +260,7 @@ if get_option('with_dbi') endif libfam = [] -if get_option('with_fam') +if get_option('with_fam') and not(conf_data.get('HAVE_SYS_INOTIFY_H')) libfam = [ compiler.find_library('fam') ] if not(compiler.has_function('FAMOpen2', args: defs, dependencies: libfam, prefix: '#include ')) error('Couldn\'t find fam.h or FAMOpen2 in lib fam')