[Snort-users] static compilation

Andreas Krennmair ak at ...3855...
Wed Jul 24 01:03:03 EDT 2002

funky wrote:
> I already tried that but nothing has changed. I've
> made the CFLAGS "-static" in "Makefile" but the size
> of the file is still 1053882 bytes . When i control
> with "file snort" , it still says "dynamically
> compiled" :((((
> Where can be the mistake!??!?!

You cannot "statically compile" a program, you compile it and then 
statically _link_ it. So, first you have to use LDFLAGS instead of 
CFLAGS, and another good trick with autoconf based source trees is 
setting this already during the configure process, e.g.:

LDFLAGS="-static" ./configure

and then go on just as before, i.e. make && make install. Before make 
install, you can check the binary with ldd and file whether it is really 
statically linked, but it should be anyway (I tried it out right now).

Andreas Krennmair

More information about the Snort-users mailing list