[Snort-devel] Compiling Snort 1.8.4 with Sun WorkShop C++

Richard van den Berg richard at ...1198...
Sat Mar 16 11:39:07 EST 2002

Hi there,

First off, many thanks for creating and maintaining snort. Excellent IDS.

I just compiled 1.8.4 (build 99) on my Sunblade 100 (UltraSPARC-IIe) using
Sun WorkShop 6 update 2 C 5.3 2001/05/15 (formerly known as Forte).
It did not quite work out of the box. These are the changes I had to make
to the snort source:

configure (line 2929):
-q is not a valid switch for /usr/bin/grep under Solaris 8 (it is for
/usr/xpg4/bin/grep). I simply removed the -q switch.

__inline__ is unknown to Sun Workshop, I added a simple:
#define __inline__

__inline is unknown to Sun Workshop, I added a simple:
#define __inline

decode.h (line 380):
#define EXTRACT_32BITS(p)  ({ u_int32_t __tmp; memmove(&__tmp, (p), sizeof(u_int32_t)); (u_int32_t) ntohl(__tmp);})
This is quite a dirty hack since EXTRACT_32BITS() is used as an argument of
fprintf. I am surprised that inserting a block of C code as an argument
actually works with gcc. I created a __EXTRACT_32BITS() function of this
block which I put at the end of log.c. There is probably a better .c file to
put such an architecture dependent function though.

After the above alterations, everything compiled just fine, and snort runs

What's with those "win32" directories, btw? Don't tell me snort was developed
on a Windows platform and then ported to Unix.


Richard van den Berg

More information about the Snort-devel mailing list