[Oisf-devel] suricata on solaris?
Yao-Min Chen
yaomin.chen at oracle.com
Sat May 22 00:55:30 UTC 2010
The following info is dated back in Feb. So perhaps it is outdated. The
work was based on Solaris 10, but should also work with OpenSolaris.
Feel free to let me know any question.
LIBNET
* Suricata requires libnet-1.1.x.so; the package available at
www.sunfreeware.com has libnet.a only.
* Instead, download libnet tarball from www.sunfreeware.com
* /usr/sfw/bin/gtar xzf libnet-1.1.2.1.tar.gz
* Get the patch files from D.Mehra's OpenSolaris package and build
wget http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/libnet_link_dlpi.c.patch
wget http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.am.patch
wget http://cr.opensolaris.org/~dmehra/libnet/raw_files/new/usr/src/lib/libnet/makefile.in.patch
patch -b -d src libnet_link_dlpi.c < libnet_link_dlpi.c.patch
patch -b -d src Makefile.am < makefile.am.patch
patch -b -p1 -d src Makefile.in < makefile.in.patch
export CFLAGS="-g -fPIC"
export PATH=/opt/gccfss/bin:$PATH
./configure
gmake
gmake install
Modify configure.in and configure to add a new OS label SUNOS
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
;;
*)
Modify src
* cd ./src
* 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
* 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
* stream-tcp.c: same as previous item, replace u_int8_t with uint8_t
as u_int8_t
* suricata-common.h: include <strings.h> to pick up definition of
index()
* tm-threads.c: replace syscall(SYS_gettid) with pthread_self();
replace sched_setaffinity() with processor_bind()
* util-debug.c: replace syscall(SYS_gettid) with pthread_self()
* util-debug-filters.c: replace syscall(SYS_gettid) with pthread_self()
* stream-tcp-reassemble.h: replace u_int8_t with uint8_t
* util-daemon.c: include <signal.h>
On 05/21/10 09:35 AM, Will Metcalf wrote:
> 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 <luis.mlists at gmail.com> wrote:
>
>> 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 all-recursive
>> Making all in libhtp
>> make all-recursive
>> Making all in htp
>> Making all in test
>> Making all in src
>> gcc -DHAVE_CONFIG_H -I. -I.. -I../libhtp -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 -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 \
>> case $f in \
>> *=* | --[!k]*);; \
>> *k*) failcom='fail=yes';; \
>> esac; \
>> done; \
>> dot_seen=no; \
>> target=`echo all-recursive | sed s/-recursive//`; \
>> list='libhtp src'; for subdir in $list; do \
>> echo "Making $target in $subdir"; \
>> if test "$subdir" = "."; then \
>> dot_seen=yes; \
>> local_target="$target-am"; \
>> else \
>> local_target="$target"; \
>> fi; \
>> (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target) \
>> || eval $failcom; \
>> done; \
>> if test "$dot_seen" = "no"; then \
>> make "$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
>> Oisf-devel at openinfosecfoundation.org
>> http://lists.openinfosecfoundation.org/mailman/listinfo/oisf-devel
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openinfosecfoundation.org/pipermail/oisf-devel/attachments/20100521/d2c65e96/attachment-0002.html>
More information about the Oisf-devel
mailing list