Can't build Samba with inotify support on Gentoo. Get warnings during configure: =============================================== configure: WARNING: linux/inotify.h: present but cannot be compiled configure: WARNING: linux/inotify.h: check for missing prerequisite headers? configure: WARNING: linux/inotify.h: see the Autoconf documentation configure: WARNING: linux/inotify.h: section "Present But Cannot Be Compiled" configure: WARNING: linux/inotify.h: proceeding with the compiler's result configure: WARNING: ## ---------------------------------------- ## configure: WARNING: ## Report this to samba-technical@samba.org ## configure: WARNING: ## ---------------------------------------- ## =============================================== First posted this problem to the mailing list on 3/13/2010 in reference to samba-3.5.1, it still exists today with samba-3.6.1. The error points to this documentation: http://www.gnu.org/s/hello/manual/autoconf/Present-But-Cannot-Be-Compiled.html I do not get the same error testing this under Ubuntu, but it does appear that inotify is working correctly for other applications.
can you please attach your config.log that was created by the configure run?
Created attachment 7063 [details] requested config.log Same things happens on my Gentoo x86 installs as well and has been happening since at least March 2010 with various versions of Samba, glibc, gcc. As noted previously it doesn't occur with an Ubuntu 11.10 installation and have now tested with an out-of-date Gentoo box (with gcc-4.3 and glibc-2.7) and the error does not occur there either. Not knowing where the problem may lie I also filed a Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=389651
we need a new resolved reason in Bugzilla: RESOLVED: GENTOO ;-)
(In reply to comment #3) > we need a new resolved reason in Bugzilla: RESOLVED: GENTOO ;-) Yes :) Most definitely a Gentoo bug.
the samba code is slightly broken: source3/wscript: # Check for inotify support conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h') conf.CHECK_FUNCS('inotify_init') if "HAVE_LINUX_INOTIFY_H" in conf.env and "HAVE_INOTIFY_INIT" in conf.env: conf.DEFINE('HAVE_INOTIFY', 1) if sys/inotify.h exists, then linux/inotify.h is not necessary. the source4 tree seems to have this fixed already: source4/ntvfs/sysdep/wscript_configure: if (conf.CONFIG_SET('HAVE___NR_INOTIFY_INIT') and (conf.CONFIG_SET('HAVE_LINUX_INOTIFY_H') or conf.CONFIG_SET('HAVE_SYS_INOTIFY_H'))): conf.DEFINE('HAVE_LINUX_INOTIFY', 1)
reopening due to Mike's comment #5
the waf build is officially not supported in s3, only in s4. Please only use the auto tools buildsystem for s3. Günther, shall s3/waf issues be fixed at all, I guess not...(?)
the autotools code is broken in the same way source3/configure.in: if test x"$ac_cv_func_inotify_init" = x"yes" -a x"$ac_cv_header_linux_inotify_h" = x"yes"; then AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel has inotify support]) fi missing ac_cv_header_sys_inotify_h checking
Created attachment 7066 [details] proposed fix for bug 8580 On my Gentoo I get a "redefinition of ‘struct f_owner_ex’" on the kernel inotify test. The sys inotify test is working fine. My patch enables HAVE_INOTIFY if sys inotify OR kernel is working. It's working on my Gentoo with the broken kernel inotify test. The patch is also working on a SLES10 with working kernel inotify.
(In reply to comment #7) > the waf build is officially not supported in s3, only in s4. Please only use > the auto tools buildsystem for s3. > > Günther, shall s3/waf issues be fixed at all, I guess not...(?) For 3.6.x probably not but for master we definitely need to fix this for the waf build as well (as long as we want to have working inotify support in the final samba 4.0).
Created attachment 7070 [details] Patches for v3-6-test
Comment on attachment 7070 [details] Patches for v3-6-test looks good
Pushed to v3-6-test. Closing out bug report. Thanks!