Bug 10976 - rpcsvc/yp_prot.h: No such file or directory
Summary: rpcsvc/yp_prot.h: No such file or directory
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.1.13
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-29 18:06 UTC by Xuefer
Modified: 2018-01-22 16:43 UTC (History)
2 users (show)

See Also:


Attachments
fix false positive for yp_prot (545 bytes, patch)
2017-04-25 03:49 UTC, Xuefer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xuefer 2014-11-29 18:06:54 UTC
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
 #include <rpcsvc/yp_prot.h>
                            ^

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
Comment 1 Martin von Gagern 2017-02-06 22:44:10 UTC
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.
Comment 2 Xuefer 2017-04-25 03:38:39 UTC
(In reply to Martin von Gagern from comment #1)
you're right

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
Comment 3 Xuefer 2017-04-25 03:49:36 UTC
Created attachment 13172 [details]
fix false positive for yp_prot
Comment 4 Andreas Schneider 2018-01-22 16:43:16 UTC
Fixed with bug #13238