[milters] Archive

Lists Index Date Thread Search

Article: 1442
From: Anthony Howe
Date: 2007-02-10 07:40:59 -0500
Subject: Re: Libsnert build error with socket2.h/socket2.c

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support
--------------------------------------------------------

Matthew Huff wrote:
> Environment Solaris 10 Sparc
> Sendmail 8.13.8
> Berkley DB4.4
> SunCC v5.8

Hmmm.

> libsnert-1.62


> ***************************************************************
> =3D=3D> /usr/local/src/mail/snert/com/snert/src/lib/io
> ***************************************************************
> 
> cc -D_REENTRANT -I /usr/local/include/. -I../../../include  -o socket2.o
> -c socket2.c
> "../../../include/com/snert/lib/io/socket2.h", line 105: syntax error
> before or at: SOCKET

The section in question is probably

#ifdef __unix__
...
typedef int SOCKET;
...
#endif

...

typedef struct {
	SOCKET fd;
	...	
} Socket2;


The typedef of SOCKET to an int assumes that all unix derived systems 
will have the predefine macro __unix__. It would appear the SunOS has 
forgotten its roots and doesn't define __unix__. The reason for the 
SOCKET type in the first place is a cross-platform portability issues 
between Windows BSD socket support and unix/POSIX systems.

Assuming gcc is used try:

	cd com/snert/src/lib
	make predefines

will report the compiler's predefined macros. If you're using a Sun 
supplied C compiler, then there might be no way to find out the 
predefined macro list other than through some man page or use of 
strings(1).

If my theory is correct and __unix__ is not defined by default, then try 
explicitly defining missing macro:

	cd com/snert/src/lib
	CFLAGS='-D__unix__' ./configure (other options here)
	make clean build
	cd ../milter-NAME
	./configure
	make clean build
	sudo make install

If you can supply me the list of predefines, then I should be able to 
added some clever C macro work around / assertions for SunOS builds.

-- 
Anthony C Howe          Skype: SirWumpus                    SnertSoft
+33 6 11 89 73 78         AIM: SirWumpus    Sendmail Milter Solutions
http://www.snert.com/     ICQ: 7116561
     http://www.snertsoft.com/

Lists Index Date Thread Search