Subject: problems building mail/cyrus-imapd 2.1.9
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.ORG>
From: Greg A. Woods <>
List: tech-pkg
Date: 11/10/2002 12:16:50
A file supplied with cyrus-impad 2.1.9, but normally generated by a
host-build program, contains the following line (#39):

	#define snmp_increment_args(...)

This, of course, causes causes the compiler to complain:

cc -c -I. -I.. -I../sieve -I. -I./../lib -I./../acap -I../acap  -I./../sieve -I/usr/pkg/include/db3  -I/usr/include/krb5  -I/usr/pkg/include -I/usr/local/include -I/usr/pkg/include -I/usr/include -I/usr/pkg/include -DHAVE_CONFIG_H -Wall -O2 -g -pipe -I/usr/pkg/include  -I/usr/include/krb5  -I/usr/pkg/include  imapd.c
In file included from imapd.c:94:
pushstats.h:39: warning: invalid character in macro parameter name
pushstats.h:39: badly punctuated parameter list in `#define'

Removing that file causes it to be rebuilt, but it still contains
exactly the same warning.  (Unfortunately that damn program which
rebuilds pushstats.h is a bloody perl script.)

Worse though the compiler immediately gets a fatal error in the very
same file as above, caused by that very line in pushstats.h:

imapd.c: In function `cmd_login':
imapd.c:1765: warning: implicit declaration of function `snmp_increment_args'
imapd.c:1765: `AUTHENTICATION_NO' undeclared (first use in this function)
imapd.c:1765: (Each undeclared identifier is reported only once
imapd.c:1765: for each function it appears in.)
imapd.c:1766: `VARIABLE_AUTH' undeclared (first use in this function)
imapd.c:1767: `VARIABLE_LISTEND' undeclared (first use in this function)
imapd.c:1773: `AUTHENTICATION_YES' undeclared (first use in this function)
imapd.c: In function `cmd_authenticate':
imapd.c:1888: `AUTHENTICATION_NO' undeclared (first use in this function)
imapd.c:1889: `VARIABLE_AUTH' undeclared (first use in this function)
imapd.c:1890: `VARIABLE_LISTEND' undeclared (first use in this function)
imapd.c:1939: `AUTHENTICATION_YES' undeclared (first use in this function)
*** Error code 1

make: stopped in /var/obj/package/mail/cyrus-imapd21/work/cyrus-imapd-2.1.9/imap
*** Error code 1

What's curious is that SNMP support is supposed to be explicitly
disabled in the pkgsrc build.

I'm wondering how the heck anyone could ever have possibly managed to
build this package!

It looks like they're trying to use a very cheap CPP hack to make the
snmp*() calls "disappear" by turning them into macros with no body.
However that's clearly not working.  Is this a bug in my CPP?

$ cpp -v 
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
# 1 ""

I don't have a fix yet, so this isn't a PR.....

								Greg A. Woods

+1 416 218-0098;            <>;           <>
Planix, Inc. <>; VE3TCP; Secrets of the Weird <>