[syslog-ng]Problems compiling on Solaris 2.6

Chad Walstrom chewie@wookimus.net
Tue, 17 Dec 2002 13:29:56 -0600


I'm having issues compiling syslog-ng-1.5.23 on Sparc Solaris 2.6 (yes,
I know we should upgrade at some point).  It looks like the resolv
library on solaris 2.6 doesn't have a macro that syslog-ng is expecting.
The resolv.h file contained a version reference line in the #pragma:

	#pragma ident   "@(#)resolv.h   1.12    96/09/12 SMI"

It looks to be a file from BIND 4.9.4.  There was no #define MAXDNAME in
/usr/include/resolv.h, but there were these MAXD* defines:

#define MAXDFLSRCH              3       /* # default domain levels to try */
#define MAXDNSRCH               6       /* max # domains in search path */

I find it very strange that the MAXDNAME macro is not there.  Is it
possible that the file's been corrupted? It's being referenced in line
140 of /usr/include/resolv.h.

/*
 * NOTE: the "__res_state" struct replaces the "state" struct used in
 * previous versions of BIND. These two structures are only partially
 * compatible.
 */

struct __res_state {
        int     retrans;                /* retransmition time interval */
        int     retry;                  /* number of times to retransmit */
        u_long  options;                /* option flags - see below. */
        int     nscount;                /* number of name servers */
        struct sockaddr_in
                nsaddr_list[MAXNS];     /* address of name server */
#define nsaddr  nsaddr_list[0]          /* for backward compatibility */
        u_short id;                     /* current packet id */
        char    *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
        char    defdname[MAXDNAME];     /* default domain */
        u_long  pfcode;                 /* RES_PRF_ flags - see below.  */
        unsigned ndots:4;               /* threshold for initial abs.  query */
        unsigned nsort:4;               /* number of elements in sort_list[] */
        char    unused[3];
        struct {
                struct in_addr  addr;
/* BIND 4.9.3 original: u_int32_t       mask; */
                unsigned int    mask;
        } sort_list[MAXRESOLVSORT];
        char    pad[72];                /* On an i38this means 512b total. */
};

I could add a CFLAG=-DMAXDNAME=255.  If so, what length should I use?
Does anyone have a reference to what this value is supposed to be?

Installed Software (all under /usr/local):
  GNU Make version 3.75
  autoconf (GNU Autoconf) 2.53
  autoheader (GNU Autoconf) 2.53 (produced some warnings in make below)
  automake (GNU automake) 1.6.3
  libol 0.3.5

Config parameters:
  ./configure --prefix=/usr/local --enable-sun-streams --enable-sun-door \
	--with-libol=/usr/local/bin

--- BEGIN MAKE OUTPUT ---
Making all in src
make[2]: Entering directory
`/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23/src'
cd
/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23
&& autoheader
WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
WARNING: and `config.h.top', to define templates for `config.h.in'
WARNING: is deprecated and discouraged.

WARNING: Using the third argument of `AC_DEFINE' and
WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
WARNING: `acconfig.h':

WARNING:   AC_DEFINE([NEED_MAIN], 1,
WARNING:             [Define if a function `main' is needed.])

WARNING: More sophisticated templates can also be produced, see the
WARNING: documentation.
configure.in:56: warning: AC_PROG_LEX invoked multiple times
autoheader: `src/config.h.in' is updated
cd .. \
  && CONFIG_FILES= CONFIG_HEADERS=src/config.h \
     /bin/sh ./config.status
creating src/config.h
make  all-recursive
make[3]: Entering directory
`/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23/src'
Making all in .
make[4]: Entering directory
`/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23/src'
gcc -DHAVE_CONFIG_H -I.
-I/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23/src
-I.     -g -O2 -Wall
-I/home/cbscs/people/chad/checkout/cbs/hosts/biosci/libol/libol-0.3.5/src
-D_GNU_SOURCE -c main.c
In file included from main.c:44:
/usr/include/resolv.h:140: `MAXDNAME' undeclared here (not in a
function)
make[4]: *** [main.o] Error 1
make[4]: Leaving directory
`/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23/src'
make[2]: *** [all-recursive-am] Error 2
make[2]: Leaving directory
`/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/cbscs/people/chad/checkout/cbs/hosts/biosci/syslog-ng/syslog-ng-1.5.23'
make: *** [build-stamp] Error 2

--- END MAKE OUTPUT ---
-- 
Chad Walstrom <chewie@wookimus.net>           http://www.wookimus.net/
           assert(expired(knowledge)); /* core dump */