From 0df485c9283a3a49cf95f1e64f7e403757178a0a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 18 Jul 2020 17:07:22 +0200 Subject: [PATCH] Fix caching of inotify() availability check in configure Commit 0fe1146b19 (Cache the result of inotify check in configure, 2020-04-15) was wrong as it defined wxHAS_INOTIFY inside the AC_CACHE_CHECK(), meaning that this wasn't done at all if the value was already cached. Fix this by crrectly defining wxHAS_INOTIFY if inotify() availability was either detected or cached. --- configure | 8 +++++--- configure.in | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 933b2c52ad..568533f824 100755 --- a/configure +++ b/configure @@ -33166,8 +33166,7 @@ else int main() { return inotify_init(); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - wx_cv_inotify_usable=yes; $as_echo "#define wxHAS_INOTIFY 1" >>confdefs.h - + wx_cv_inotify_usable=yes else wx_cv_inotify_usable=no @@ -33178,7 +33177,10 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_inotify_usable" >&5 $as_echo "$wx_cv_inotify_usable" >&6; } - if test "$wx_cv_inotify_usable" = "no"; then + if test "$wx_cv_inotify_usable" = "yes"; then + $as_echo "#define wxHAS_INOTIFY 1" >>confdefs.h + + else for ac_header in sys/event.h do : ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default diff --git a/configure.in b/configure.in index 728af3eb7e..3ff854e79d 100644 --- a/configure.in +++ b/configure.in @@ -5604,11 +5604,13 @@ if test "$wxUSE_FSWATCHER" = "yes"; then wx_cv_inotify_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=yes], [wx_cv_inotify_usable=no] ) ) - if test "$wx_cv_inotify_usable" = "no"; then + if test "$wx_cv_inotify_usable" = "yes"; then + AC_DEFINE(wxHAS_INOTIFY) + else AC_CHECK_HEADERS(sys/event.h,,, [AC_INCLUDES_DEFAULT()]) if test "$ac_cv_header_sys_event_h" = "yes"; then AC_DEFINE(wxHAS_KQUEUE)