In file included from default/source3/librpc/gen_ndr/ndr_wbint.c:3:0:
../source3/include/includes.h:113:28: fatal error: rpcsvc/yp_prot.h: No such file or directory
this happens if rpcsvc/yp_prot.h is not provided by the toolchain/libs. it seems the check "conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')" is bogus, the missing header (rpcsvc/yp_prot.h) is always skipped to not be included in test code, in that case the empty code will compile and will define HAVE_RPCSVC_YP_PROT_H
I come here from https://bugs.gentoo.org/show_bug.cgi?id=606542 after I tried to build samba 4.5.5 on a Gentoo Linux with rpc left out of glibc. Reverting https://github.com/samba-team/samba/commit/debb2b2b9e9a495b0f9f31753ac5e75e4b2 helped me prevent the #include <rpcsvc_yp_prot.h>. Not sure what that does to FreeBSD, but the current state of affairs is indeed broken.
I also had to deal with the problem that yp_get_default_domain is present in libnsl on my system, but not mentioned in any public header. So although the linker check in https://github.com/samba-team/samba/blob/samba-4.5.5/source3/wscript#L123 succeeds the compiler will fail. I'd suggest revisiting the corresponding code in https://github.com/samba-team/samba/blob/samba-4.5.5/buildtools/wafsamba/samba_autoconf.py#L257-L270 to make sure the symbol is not only available at link time but a prototype is available at compile time, too.
It would be nice if samba could be made to compile on systems without rpc and nis built into glibc. Perhaps a configure switch to control this would be prudent, similar to the --without-nis which is still documented in https://github.com/samba-team/samba/blob/samba-4.5.5/docs-xml/using_samba/ch02.xml#L282-L300 but apparently no longer works that way.
(In reply to Martin von Gagern from comment #1)
conf.CHECK_CODE is using conf.check(header_list(headers)), but but header_list skip those header not found, which make
conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
**always** success defining HAVE_RPCSVC_YP_PROT_H because code is ''
CHECK_CODE always include
Created attachment 13172 [details]
fix false positive for yp_prot
Fixed with bug #13238