[Snort-users] QUERY:Building snort statically

William Fitzgerald wfitzgerald at ...9307...
Wed Feb 16 02:00:00 EST 2005


Hi Senthil,

Again thanks for the speedy response.

I will take on board what you and Joshua have said.
I am running snort-2.1.1 and not snort-2.3.0 so the makefile in the src
directory is different.

(1)So first I will rename all the /usr/local/lib files temporarily.
(Senthil)
(2)make libraries static: LDFLAGS =  -static -L/usr/local/lib -lpcre
(Joshua)
(3)I reckon I must also as -static as follows: CFLAGS = -g -O2 -Wall
-DWIRELESS -static in the makefile also.
What do you think about (3)?

Regards,
Will



-----Original Message-----
From: Senthil Prabu.S [mailto:prabu333 at ...8908...] 
Sent: 16 February 2005 05:02
To: wfitzgerald at ...9307...; 'Joshua Berry'
Cc: snort-users at lists.sourceforge.net
Subject: Re: [Snort-users] QUERY:Building snort statically


Hi William,
         As Joshnu said, plz make the following change in the
src/Makefile along with the changes that I mentioned in my first mail.
This would not only build snort with static dependent libraries, but
aslo a static version of snort 
binary.


> I went to the snort-2.1.1/src/Makefile and done a search for 
> snort_LDFLAGS and found one occurance of it in this section:
> snort$(EXEEXT): $(snort_OBJECTS) $(snort_DEPENDENCIES)
> @rm -f snort$(EXEEXT)
> $(LINK) $(snort_LDFLAGS) $(snort_OBJECTS) $(snort_LDADD) $(LIBS)
>
> I could not find what snort_LDFLAGS was assigned to inorder to change 
> it to be static.
>
> I then looked at the makefile one directory up, that is snort-2.1.1 
> and no snort_LDFLAGS was found. However I did find a LDFLAGS 
> parameter: LDFLAGS =  -L/usr/local/lib -lpcre

No, you are wrong, here LDFLAGS is defined to look for the path of
libprce library. Also in snort-2.1.1, under src/Makefile, I am able to
find the 
snort_LDFLAGS
The details and modificaton is given below. Also this flag is available
in 
snort-2.3.0.

File : src/Makefile
Line Number: 161

BEFORE:
        preprocessors/flow/libflow.a parser/libparser.a \
        preprocessors/HttpInspect/libhttp_inspect.a sfutil/libsfutil.a
snort_LDFLAGS =

      DEFS = -DHAVE_CONFIG_H
      DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)

AFTER:
        preprocessors/flow/libflow.a parser/libparser.a \
        preprocessors/HttpInspect/libhttp_inspect.a sfutil/libsfutil.a
snort_LDFLAGS = -lstatic

      DEFS = -DHAVE_CONFIG_H
      DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)

--
Senthil Prabu.S


If you are smart enough to know that you're not smart enough to be an
Engineer, then you're in Business.
_________________________________________________________________







More information about the Snort-users mailing list