Browse Source

[build] detect inotify header <sys/inotify.h>

master
Glenn Strauss 6 months ago
parent
commit
7ce8b22cb2
  1. 3
      SConstruct
  2. 5
      configure.ac
  3. 3
      src/CMakeLists.txt
  4. 3
      src/meson.build

3
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(

5
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"

3
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)

3
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 <fam.h>'))
error('Couldn\'t find fam.h or FAMOpen2 in lib fam')

Loading…
Cancel
Save