Hi,
I don't if this is the right list to post this message, but in case someone has the same problem, she can resolve it manually before we fix in in the configure script. (Vern, I can't find project Bro on either Mantis or bugzilla.)
I am trying to compile Bro on a Mac OS X and encounter the following two problems, both related to nb_dns.c:
The first is compile error. It is because the header file arpa/nameser.h does not define HEADER, which is defined in arpa/nameser_compat.h. nameser_compat.h will be included by nameser.h only if BIND_8_COMPAT is defined, but I don't know if we should define that. After including nameser_compat.h in nb_dns.c, it is able to compile correctly.
gcc -I. -Ilibedit -O -c nb_dns.c
nb_dns.c: In function `_nb_dns_mkquery':
nb_dns.c:255: error: syntax error before '*' token
nb_dns.c:306: error: `hp' undeclared (first use in this function)
nb_dns.c:306: error: (Each undeclared identifier is reported only once
nb_dns.c:306: error: for each function it appears in.)
nb_dns.c:306: error: `HEADER' undeclared (first use in this function)
nb_dns.c:306: error: parse error before ')' token
nb_dns.c: In function `nb_dns_host_request2':
nb_dns.c:340: error: `T_A' undeclared (first use in this function)
nb_dns.c:345: error: `T_AAAA' undeclared (first use in this function)
nb_dns.c: In function `nb_dns_addr_request2':
nb_dns.c:412: error: `T_PTR' undeclared (first use in this function)
nb_dns.c: In function `nb_dns_activity':
nb_dns.c:468: error: `HFIXEDSZ' undeclared (first use in this function)
nb_dns.c:576: error: `T_A' undeclared (first use in this function)
nb_dns.c:577: error: `T_AAAA' undeclared (first use in this function)
nb_dns.c:605: error: `T_PTR' undeclared (first use in this function)
make: *** [nb_dns.o] Error 1
Next came the link error:
ld: Undefined symbols:
_res_9_dn_expand
_res_9_init
_res_9_mkquery
_res_9_ns_initparse
_res_9_ns_msg_getflag
_res_9_ns_parserr
This is because libresolv is not linked. Looking at the configure script reveals that it looks for libresolv.a, but only libresolv.dylib is available. Just adding '-lresolv' to Makefile solves the problem.
Ruoming