Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

4.3.9 build problems.

4.3.9 build problems.

2011-08-28 by Mart Pirita

Tere.

RedHat 9 based distro, with 2.6.28.10 kernel, yes, it's ancient, but 
quite a lot (all important stuff) is manually updated (self made 
packages) and so far all works well, as remote upgrade isn't so easy.

4.3.7 builds fine with options:

./configure --with-user=postfix --without-db --without-drac-db 
--with-conffile=/etc/greylist/greylist.conf 
--with-dumpfile=/var/spool/greylist/greylist.db --bindir=/usr/local/sbin 
--disable-dnsrbl --disable-drac --enable-postfix

4.3.9 does not:

gcc -g -O2 -Wall -Ino/include -DHAVE_DATA_CALLBACK -D_XOPEN_SOURCE=500 
-DUSE_DNSRBL -DUSE_POSTFIX -DCONFFILE=\"/etc/greylist/greylist.conf\" 
-DDUMPFILE=\"/var/spool/greylist/greylist.db\" -DDRACDB=\"no\" 
-D_BSD_SOURCE -I. -I.    -c -o dnsrbl.o dnsrbl.c
dnsrbl.c: In function `dnsrbl_check_source':
dnsrbl.c:120: error: `ns_msg' undeclared (first use in this function)
dnsrbl.c:120: error: (Each undeclared identifier is reported only once
dnsrbl.c:120: error: for each function it appears in.)
dnsrbl.c:120: error: syntax error before "handle"
dnsrbl.c:121: error: `ns_rr' undeclared (first use in this function)
dnsrbl.c:205: warning: implicit declaration of function `ns_initparse'
dnsrbl.c:205: error: `handle' undeclared (first use in this function)
dnsrbl.c:210: warning: implicit declaration of function `ns_msg_count'
dnsrbl.c:210: error: `ns_s_an' undeclared (first use in this function)
dnsrbl.c:211: warning: implicit declaration of function `ns_parserr'
dnsrbl.c:211: error: `rr' undeclared (first use in this function)
make: *** [dnsrbl.o] Error 1

Removing the  --disable-dnsrbl removes errors.

Adding --disable-mx gives new errors:

gcc -g -O2 -Wall -Ino/include -DHAVE_DATA_CALLBACK -D_XOPEN_SOURCE=500 
-DUSE_MX -DUSE_POSTFIX -DCONFFILE=\"/etc/greylist/greylist.conf\" 
-DDUMPFILE=\"/var/spool/greylist/greylist.db\" -DDRACDB=\"no\" 
-D_BSD_SOURCE -I. -I.    -c -o mx.o mx.c
mx.c: In function `mx_check':
mx.c:80: error: `ns_msg' undeclared (first use in this function)
mx.c:80: error: (Each undeclared identifier is reported only once
mx.c:80: error: for each function it appears in.)
mx.c:80: error: syntax error before "handle"
mx.c:81: error: `ns_rr' undeclared (first use in this function)
mx.c:167: warning: implicit declaration of function `ns_initparse'
mx.c:167: error: `handle' undeclared (first use in this function)
mx.c:172: warning: implicit declaration of function `ns_msg_count'
mx.c:172: error: `ns_s_an' undeclared (first use in this function)
mx.c:173: warning: implicit declaration of function `ns_parserr'
mx.c:173: error: `rr' undeclared (first use in this function)
mx.c:177: warning: implicit declaration of function `ns_rr_type'
mx.c:182: warning: implicit declaration of function `ns_name_uncompress'
mx.c:182: warning: implicit declaration of function `ns_msg_base'
mx.c:183: warning: implicit declaration of function `ns_msg_end'
mx.c:184: warning: implicit declaration of function `ns_rr_rdata'
mx.c:210: error: `handle2' undeclared (first use in this function)
mx.c:216: error: `rr2' undeclared (first use in this function)
mx.c:223: warning: implicit declaration of function `ns_rr_rdlen'
mx.c:236: warning: passing arg 2 of `memcpy' makes pointer from integer 
without a cast
mx.c:253: warning: passing arg 2 of `memcpy' makes pointer from integer 
without a cast
make: *** [mx.o] Error 1

Removing the  --disable-mxl removes errors.

Normally --disable-xxx disables some functionality in build, but seems 
milter-greylist build does in in opposite way?

Is this a bug?

And how to find out what did options build did include? Can't find such 
key in milter-greylist?

I did send private email to Emmanuel and he asked:

 > do you get something with grep -r ns_msg /usr/include
 >

Yes:

grep -r ns_msg /usr/include
/usr/include/arpa_last/nameser.h:typedef struct __ns_msg {
/usr/include/arpa_last/nameser.h:} ns_msg;
/usr/include/arpa_last/nameser.h:#define ns_msg_getflag(handle, flag) ( \
/usr/include/arpa_last/nameser.h:#define ns_msg_id(handle) ((handle)._id 
+ 0)
/usr/include/arpa_last/nameser.h:#define ns_msg_base(handle) 
((handle)._msg + 0)
/usr/include/arpa_last/nameser.h:#define ns_msg_end(handle) 
((handle)._eom + 0)
/usr/include/arpa_last/nameser.h:#define ns_msg_size(handle) 
((handle)._eom - (handle)._msg)
/usr/include/arpa_last/nameser.h:#define ns_msg_count(handle, section) 
((handle)._counts[section] + 0)
/usr/include/arpa_last/nameser.h:int        ns_initparse __P((const 
u_char *, int, ns_msg *));
/usr/include/arpa_last/nameser.h:int        ns_parserr __P((ns_msg *, 
ns_sect, int, ns_rr *));
/usr/include/arpa_last/nameser.h:int        ns_sprintrr __P((const 
ns_msg *, const ns_rr *,
/usr/include/bind/dns/lib.h:LIBDNS_EXTERNAL_DATA extern isc_msgcat_t 
*dns_msgcat;
/usr/include/bind/dns/lib.h: * Initialize the DNS library's message 
catalog, dns_msgcat, if it
/usr/include/bind/dns/message.h:typedef struct dns_msgblock dns_msgblock_t;
/usr/include/bind/dns/message.h:    ISC_LIST(dns_msgblock_t)    rdatas;
/usr/include/bind/dns/message.h:    ISC_LIST(dns_msgblock_t)    rdatalists;
/usr/include/bind/dns/message.h:    ISC_LIST(dns_msgblock_t)    offsets;

Emmanuel suggested (haven't tested yet):

 > Add #include <arpa_last/nameser.h> in dnsrbl.c
 >

And asked post the whole story here. So I did.


-- 
Mart

Re: [milter-greylist] 4.3.9 build problems.

2011-08-28 by manu@netbsd.org

Mart Pirita <mart@...> wrote:

> Emmanuel suggested (haven't tested yet):
>  > Add #include <arpa_last/nameser.h> in dnsrbl.c

So how does it works?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] 4.3.9 build problems.

2011-08-28 by Mart Pirita

manu@... kirjutas:
>> Emmanuel suggested (haven't tested yet):
>>   >  Add #include<arpa_last/nameser.h>  in dnsrbl.c
> So how does it works?
>
Turned out, that I had /usr/include/arpa and /usr/include/arpa_last, I 
remember, that some compilations needed older stuff (arpa_last is 
actually newer) so now I activated the newer again, and so this #include 
<arpa_last/nameser.h> was useless, however with new test options:

./configure --with-user=postfix --without-db --without-drac-db 
--with-libbind=/usr/lib --with-conffile=/etc/greylist/greylist.conf 
--with-dumpfile=/var/spool/greylist/greylist.db --bindir=/usr/local/sbin 
--disable-dnsrbl --disable-drac --disable-mx --disable-spamassassin 
--enable-postfix

Give new errors:

gcc -g -O2 -Wall -Ino/include -DHAVE_DATA_CALLBACK -D_XOPEN_SOURCE=500 
-DUSE_DNSRBL -DUSE_MX -DUSE_POSTFIX 
-DCONFFILE=\"/etc/greylist/greylist.conf\" 
-DDUMPFILE=\"/var/spool/greylist/greylist.db\" -DDRACDB=\"no\" 
-D_BSD_SOURCE -I. -I.    -c -o ratelimit.o ratelimit.c
gcc -o milter-greylist milter-greylist.o pending.o sync.o dnsrbl.o 
list.o macro.o conf_yacc.o dump_yacc.o conf.o store.o dump.o spf.o acl.o 
urlcheck.o stat.o clock.o geoip.o fd_pool.o prop.o ldapcheck.o 
dkimcheck.o p0f.o spamd.o mx.o ratelimit.o -Lno/lib -Wl,--rpath=no/lib 
-lpthread -lresolv -lnsl -lmilter
dnsrbl.o: In function `dnsrbl_check_source':
/home/soft/milter-greylist-4.3.9/dnsrbl.c:205: undefined reference to 
`__ns_initparse'
/home/soft/milter-greylist-4.3.9/dnsrbl.c:211: undefined reference to 
`__ns_parserr'
mx.o: In function `mx_check':
/home/soft/milter-greylist-4.3.9/mx.c:167: undefined reference to 
`__ns_initparse'
/home/soft/milter-greylist-4.3.9/mx.c:173: undefined reference to 
`__ns_parserr'
/home/soft/milter-greylist-4.3.9/mx.c:182: undefined reference to 
`__ns_name_uncompress'
/home/soft/milter-greylist-4.3.9/mx.c:210: undefined reference to 
`__ns_initparse'
/home/soft/milter-greylist-4.3.9/mx.c:216: undefined reference to 
`__ns_parserr'
collect2: ld returned 1 exit status
make: *** [milter-greylist] Error 1

-- 
Mart

Re: [milter-greylist] 4.3.9 build problems.

2011-08-29 by manu@netbsd.org

Mart Pirita <mart@...> wrote:

> Turned out, that I had /usr/include/arpa and /usr/include/arpa_last, I
> remember, that some compilations needed older stuff (arpa_last is 
> actually newer) so now I activated the newer again, and so this #include
> <arpa_last/nameser.h> was useless, however with new test options:

Right, that probably means there is no need to tweak the configure
script, since this setup is unique to your machine.
 
> /home/soft/milter-greylist-4.3.9/dnsrbl.c:205: undefined reference to
> `__ns_initparse'

You are linking with the wrong libresolv and/or libnsl. 

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] 4.3.9 build problems.

2011-08-29 by Mart Pirita

manu@... kirjutas:
>
> Right, that probably means there is no need to tweak the configure
> script, since this setup is unique to your machine.
Yes.
>
> You are linking with the wrong libresolv and/or libnsl.
>
Hmm, seems this change in 4.3.8 is the reason:

Look for liresolv in ${libdir} instead of /usr/lib (DUFRESNE VINCENT)

How to link it right with ./configure?

I have in /lib:

-rwxr-xr-x    1 root     root        60716 Nov  5  2003 libresolv-2.3.2.so
lrwxrwxrwx    1 root     root           20 Dec 10  2010 libresolv.a -> 
/usr/lib/libresolv.a
lrwxrwxrwx    1 root     root           18 Dec 10  2010 libresolv.so.2 
-> libresolv-2.3.2.so

And in /usr/lib:

-rw-r--r--    1 root     root        76030 Nov  5  2003 libresolv.a
-rw-r--r--    1 root     root        80002 Nov  5  2003 libresolv_p.a
lrwxrwxrwx    1 root     root           24 Dec 10  2010 libresolv.so -> 
../../lib/libresolv.so.2


-- 
Mart

Re: [milter-greylist] 4.3.9 build problems.

2011-08-29 by Mart Pirita

manu@... kirjutas:
>
> Right, that probably means there is no need to tweak the configure
> script, since this setup is unique to your machine.
Yes.
>
> You are linking with the wrong libresolv and/or libnsl.
>

Ok, adding before ./configure:

export LDFLAGS 

LDFLAGS=-L/lib

fixes the problem. But as seems I'm not the only one with te same 
problem - 
http://tech.dir.groups.yahoo.com/group/milter-greylist/message/5789

So if possible You should fix the configure script.

-- 
Mart

Re: [milter-greylist] 4.3.9 build problems.

2011-08-29 by Emmanuel Dreyfus

On Mon, Aug 29, 2011 at 08:56:10AM +0300, Mart Pirita wrote:
> I have in /lib:
> -rwxr-xr-x    1 root     root        60716 Nov  5  2003 libresolv-2.3.2.so
> lrwxrwxrwx    1 root     root           20 Dec 10  2010 libresolv.a -> 
> /usr/lib/libresolv.a
> lrwxrwxrwx    1 root     root           18 Dec 10  2010 libresolv.so.2 
> -> libresolv-2.3.2.so
> 
> And in /usr/lib:
> -rw-r--r--    1 root     root        76030 Nov  5  2003 libresolv.a
> -rw-r--r--    1 root     root        80002 Nov  5  2003 libresolv_p.a
> lrwxrwxrwx    1 root     root           24 Dec 10  2010 libresolv.so -> 
> ../../lib/libresolv.so.2

They are all the same, but where is the libresolv that matches
/usr/include/arpa_last headers?

-- 
Emmanuel Dreyfus
manu@...

Re: [milter-greylist] 4.3.9 build problems.

2011-08-29 by manu@netbsd.org

Mart Pirita <mart@...> wrote:

> But as seems I'm not the only one with te same 
> problem - 
> http://tech.dir.groups.yahoo.com/group/milter-greylist/message/5789
> So if possible You should fix the configure script.

It is the same symptom, but not the same problem. Fixing for your
problem would be difficult since you manually moved headers: your setup
is unique.
 


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.