<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
The following info is dated back in Feb. So perhaps it is outdated.&nbsp;
The work was based on Solaris 10, but should also work with
OpenSolaris.&nbsp; Feel free to let me know any question. <br>
<br>
<h3>LIBNET </h3>
<ul>
  <li> Suricata requires libnet-1.1.x.so; the package available at
<a class="moz-txt-link-abbreviated" href="http://www.sunfreeware.com">www.sunfreeware.com</a> has libnet.a only. </li>
  <li> Instead, download libnet tarball from <a class="moz-txt-link-abbreviated" href="http://www.sunfreeware.com">www.sunfreeware.com</a>
  </li>
  <li> /usr/sfw/bin/gtar xzf libnet-1.1.2.1.tar.gz
  </li>
  <li> Get the patch files from D.Mehra's <span class="twikiNewLink">OpenSolaris</span>
package and build<br>
  </li>
</ul>
<pre>wget <a class="moz-txt-link-freetext" href="http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/libnet_link_dlpi.c.patch">http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/libnet_link_dlpi.c.patch</a>
wget <a class="moz-txt-link-freetext" href="http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.am.patch">http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.am.patch</a>
wget <a class="moz-txt-link-freetext" href="http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.in.patch">http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.in.patch</a>
patch -b -d src libnet_link_dlpi.c &lt; libnet_link_dlpi.c.patch
patch -b -d src Makefile.am &lt; makefile.am.patch
patch -b -p1 -d src Makefile.in &lt; makefile.in.patch

export CFLAGS="-g -fPIC"
export PATH=/opt/gccfss/bin:$PATH
./configure
gmake
gmake install
</pre>
<br>
<h3>Modify configure.in and configure to add a new OS label SUNOS </h3>
<pre>    case "$host" in
            *-*-*freebsd*)
                    CFLAGS="${CFLAGS} -DOS_FREEBSD"
                    CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet11"
                    LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/local/lib/libnet11"
                    ;;
           *darwin*|*Darwin*)
                    CFLAGS="${CFLAGS} -DOS_DARWIN"
                    CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
                    LDFLAGS="${LDFLAGS} -L/opt/local/lib"
                    ;;
           *SunOS*)
                    CFLAGS="${CFLAGS} -DOS_SUNOS"
                    CPPLAGS="${CPPFLAGS} -I/usr/sfw/include"
                    LDFLAGS="${LDFLAGS} -L/usr/sfw/lib"
                    ;;
           *-*-linux*)
                    #for now do nothing
                    ;;
           *)
</pre>
<h3>Modify src<br>
</h3>
<ul>
  <li> cd ./src
  </li>
  <li> source-pcap-file.c: replace u_int8_t with uint8_t as u_int8_t is
only defined in linux kernel header file, not POSIX standard
  </li>
  <li> util-debug.c: #define LOG_AUTHPRIV to LOG_AUTH and LOG_FTP
to LOG_DAEMON since there is neither LOG_AUTHPRIV nor LOG_FTP in
Solaris
  </li>
  <li> stream-tcp.c: same as previous item, replace u_int8_t with
uint8_t as u_int8_t
  </li>
  <li> suricata-common.h: include &lt;strings.h&gt; to pick up
definition of index() </li>
  <li> tm-threads.c: replace syscall(SYS_gettid) with pthread_self();
replace sched_setaffinity() with processor_bind()
  </li>
  <li> util-debug.c: replace syscall(SYS_gettid) with pthread_self()
  </li>
  <li> util-debug-filters.c: replace syscall(SYS_gettid) with
pthread_self()
  </li>
  <li> stream-tcp-reassemble.h: replace u_int8_t with uint8_t
  </li>
  <li> util-daemon.c: include &lt;signal.h&gt;
  </li>
</ul>
<br>
<br>
On 05/21/10 09:35 AM, Will Metcalf wrote:
<blockquote
 cite="mid:AANLkTikWEM0O93P-vo7jrhw896D6WuEYA4ET23kIAeMP@mail.gmail.com"
 type="cite">
  <pre wrap="">We don't currently have any Solaris boxes setup for testing, probably
something we should look into ;-). Yao-Min, can you offer Lui any
assistance?

Regards,

Will

On Fri, May 21, 2010 at 11:29 AM, Lui Cat <a class="moz-txt-link-rfc2396E" href="mailto:luis.mlists@gmail.com">&lt;luis.mlists@gmail.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">hello there;

don't know if this is the right forum to ask this question, but I was
wondering if anyone has attempted to compile suricata on solaris (sparc or
x86)..
?

I'm currently stuck at the following:

bash-3.00$ make
make&nbsp; all-recursive
Making all in libhtp
make&nbsp; all-recursive
Making all in htp
Making all in test
Making all in src
gcc -DHAVE_CONFIG_H -I. -I..&nbsp; -I../libhtp&nbsp;&nbsp; -I/opt/PP2K/include
-I/opt/PP2K/include -I/opt/PP2K/include -I/opt/PP2K/include
-mcpu=ultrasparc -W -Wall -fno-strict-aliasing -Wno-unused-parameter
-DOS_SOLARIS -DHAVE_LIBNET11 -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD
-DHAVE_NET_ETHERNET_H&nbsp;&nbsp; -DLIBPCAP_VERSION_MAJOR=1 -MT source-pcap-file.o -MD
-MP -MF .deps/source-pcap-file.Tpo -c -o source-pcap-file.o
source-pcap-file.c
source-pcap-file.c:51: error: syntax error before "u_int8_t"
source-pcap-file.c: In function `ReceivePcapFileThreadInit':
source-pcap-file.c:208: warning: assignment from incompatible pointer type
source-pcap-file.c:211: warning: assignment from incompatible pointer type
source-pcap-file.c:214: warning: assignment from incompatible pointer type
source-pcap-file.c:217: warning: assignment from incompatible pointer type
*** Error code 1
make: Fatal error: Command failed for target `source-pcap-file.o'
Current working directory
/export/home/lcatacor/src/suricata/suricata-0.9.0/src
*** Error code 1
The following command caused the error:
fail= failcom='exit 1'; \
for f in x $MAKEFLAGS; do \
&nbsp; case $f in \
&nbsp;&nbsp;&nbsp; *=* | --[!k]*);; \
&nbsp;&nbsp;&nbsp; *k*) failcom='fail=yes';; \
&nbsp; esac; \
done; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='libhtp src'; for subdir in $list; do \
&nbsp; echo "Making $target in $subdir"; \
&nbsp; if test "$subdir" = "."; then \
&nbsp;&nbsp;&nbsp; dot_seen=yes; \
&nbsp;&nbsp;&nbsp; local_target="$target-am"; \
&nbsp; else \
&nbsp;&nbsp;&nbsp; local_target="$target"; \
&nbsp; fi; \
&nbsp; (CDPATH="${ZSH_VERSION+.}:" &amp;&amp; cd $subdir &amp;&amp; make&nbsp; $local_target) \
&nbsp; || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
&nbsp; make&nbsp; "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/lcatacor/src/suricata/suricata-0.9.0
*** Error code 1
make: Fatal error: Command failed for target `all'



To get this far, had to change the configure script to add a *solaris*
section to include a -DOS_SOLARIS and change the src/util-byte.h file to
include sys/byteorder.h


Any help would be appreciated


Thanks

Luis


_______________________________________________
Oisf-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Oisf-devel@openinfosecfoundation.org">Oisf-devel@openinfosecfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openinfosecfoundation.org/mailman/listinfo/oisf-devel">http://lists.openinfosecfoundation.org/mailman/listinfo/oisf-devel</a>


    </pre>
  </blockquote>
</blockquote>
<br>
</body>
</html>