FreeBSD 8.1 --------------------------------------------- WAF_MAKE=1 python ./buildtools/bin/waf build Waf: Entering directory `/root/_build/samba/samba-4.6.0/bin' Selected embedded Heimdal build [ 562/3466] Compiling lib/socket/interfaces.c ../lib/socket/interfaces.c: In function '_get_interfaces': ../lib/socket/interfaces.c:203: error: 'IFF_UP' undeclared (first use in this function) ../lib/socket/interfaces.c:203: error: (Each undeclared identifier is reported only once ../lib/socket/interfaces.c:203: error: for each function it appears in.) ../lib/socket/interfaces.c:258: error: 'IFF_BROADCAST' undeclared (first use in this function) ../lib/socket/interfaces.c:258: error: 'IFF_LOOPBACK' undeclared (first use in this function) ../lib/socket/interfaces.c:262: error: 'IFF_POINTOPOINT' undeclared (first use in this function) Waf: Leaving directory `/root/_build/samba/samba-4.6.0/bin' --------------------------------------------- Config: --------------------------------------------- --enable-debug --docdir=[censored] --infodir=[censored] --mandir=[censored] --enable-fhs --prefix=[censored] --exec-prefix=[censored] --with-configdir=[censored] --with-piddir=[censored] --without-ad-dc --without-ldap --without-ads ---------------------------------------------
P.S. 4.5.* built just fine with the same environment and everything.
Same issue with 4.6.2
Problem solved by adding the following line: #include <net/if.h> to lib/socket/interfaces.c Please do it in your source, guys. It's PITA to do it manually every time.
Is it sensible to add a configure check for this? FreeBSD 11 seems to compile fine without it.
So far I identified a few more files where that header needs to be included for the compile to work properly. However, I do not see any reason not to do so, because once it's done, the project compiles and works just fine. Also, it 4.5.* compiled just fine as well, so in other words, this bug is a regression.
Further research shows that seemingly the variable HAVE_NET_IF_H does not get set by the configure script. When I set it manually by adding the line: conf.DEFINE('HAVE_NET_IF_H', 1, add_to_cflags=True) to 'wscript' file at line 93, then everything starts building correctly. Unfortunately, at this point my knowledge of python doesn't allow me to debug further, i.e. WHY the detection of this header fails. I suspect it has something to do with these lines: # these headers need to be tested as a group on freebsd conf.CHECK_HEADERS(headers='sys/socket.h net/if.h', together=True) in 'lib/replace/wscript'. Interestingly enough, I do not see the lines in the build log that would indicate the detection of these include files, although they are certainly present on my system (I manually checked!)