OS=unknown
sys=`uname -s`
-release=`uname -r | cut -b1`
+release=`uname -r`
+major=`printf "%s" "$release" | cut -d. -f1`
BUILD_DIR=`pwd`
CONFFILE="../../Makefile.conf"
VAR_DIR="./inst/var/stargazer"
if [ "$sys" = "Linux" ]
then
OS=linux
- release=""
ETC_DIR="./inst/linux/etc/stargazer"
MAKE="make"
fi
if [ "$sys" = "FreeBSD" ]
then
- case $release in
+ case $major in
4) OS=bsd;;
5) OS=bsd5;;
6) OS=bsd5;;
if [ "$OS" = "unknown" ]
then
printf "#############################################################################\n"
- printf "# Sorry, but stargazer currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #\n"
+ printf "# Sorry, but stargazer is currently supported by Linux, FreeBSD and Darwin. #\n"
printf "#############################################################################\n"
exit 1
fi
printf "#############################################################################\n"
STG_LIBS="logger.lib
- locker.lib
crypto.lib
common.lib
scriptexecuter.lib
rm -f fake
printf "Checking for -lexpat... "
-printf "int main() { return 0; }\n" > build_check.c
-$CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
+printf "#include <expat.h>\nint main() { return 0; }\n" > build_check.c
+$CXX $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
if [ $? != 0 ]
then
CHECK_EXPAT=no
rm -f fake
printf "Checking for -lfbclient... "
-$CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
+printf "int main() { return 0; }\n" > build_check.c
+$CXX $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
if [ $? != 0 ]
then
CHECK_FBCLIENT=no
rm -f fake
printf "Checking for mysql_config... "
+printf "#include <mysql.h>\nint main() { return 0; }\n" > build_check.c
MYSQL_VERSION=`mysql_config --version 2> /dev/null`
if [ $? != 0 ]
then
printf "no\n";
printf "Checking for -lmysqlclient... "
- $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
+ $CXX $CXXFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
if [ $? != 0 ]
then
CHECK_MYSQLCLIENT=no
fi
printf "Checking for pg_config... "
+printf "#include <libpq-fe.h>\nint main() { return 0; }\n" > build_check.c
PG_VERSION=`pg_config --version 2> /dev/null`
if [ $? != 0 ]
then
printf "no\n";
printf "Checking for -lpq... "
- $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
+ $CXX $CXXFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
if [ $? != 0 ]
then
CHECK_PQ=no
fi
printf "Checking for xmlrpc-c-config... "
+printf "#include <xmlrpc-c/base.hpp>\nint main() { return 0; }\n" > build_check.c
XMLRPCC_VERSION=`xmlrpc-c-config $XMLRPC_FEATURES --version 2> /dev/null`
if [ $? != 0 ]
then
printf "no\n";
printf "Checking for -lxmlrpc... "
- $CC $CFLAGS $LDFLAGS build_check.c -lxmlrpc $LIB_THREAD -o fake > /dev/null 2> /dev/null
+ $CXX $CXXFLAGS $LDFLAGS build_check.c -lxmlrpc $LIB_THREAD -o fake > /dev/null 2> /dev/null
if [ $? != 0 ]
then
CHECK_XMLRPC=no
fi
fi
+printf "Checking for -lnfnetlink... "
+printf "#include <stdint.h>\n#include <netinet/in.h>\n#include <linux/netfilter.h>\nint main() { return 0; }\n" > build_check.c
+$CXX $CXXFLAGS $LDFLAGS build_check.c -lnfnetlink -o fake > /dev/null 2> /dev/null
+if [ $? != 0 ]
+then
+ CHECK_NFNETLINK=no
+ printf "no\n"
+else
+ CHECK_NFNETLINK=yes
+ printf "yes\n"
+fi
+rm -f fake
+
+printf "Checking for -lnetfilter_queue... "
+printf "#include <stdint.h>\n#include <libnetfilter_queue/libnetfilter_queue.h>\nint main() { return 0; }\n" > build_check.c
+$CXX $CXXFLAGS $LDFLAGS build_check.c -lnetfilter_queue -o fake > /dev/null 2> /dev/null
+if [ $? != 0 ]
+then
+ CHECK_NFQ=no
+ printf "no\n"
+else
+ CHECK_NFQ=yes
+ printf "yes\n"
+fi
+rm -f fake
+
if [ "$OS" = "linux" ]
then
printf "Checking for linux/netfilter_ipv4/ip_queue.h... "
printf "#include <linux/types.h>\n" > build_check.c
printf "#include <linux/netfilter_ipv4/ip_queue.h>\n" >> build_check.c
printf "int main() { return 0; }\n" >> build_check.c
- $CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
+ $CXX $CXXFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
if [ $? != 0 ]
then
CHECK_IP_QUEUE_H=no
if [ "$CHECK_EXPAT" != "yes" ]
then
- printf "-lexpat not found!\n"
+ printf -- "-lexpat not found!\n"
exit 1
fi
configuration/rpcconfig"
fi
+if [ "$CHECK_NFNETLINK" = "yes" -a "$CHECK_NFQ" = "yes" ]
+then
+ PLUGINS="$PLUGINS
+ capture/nfqueue"
+ NFQ_LIBS="-lnfnetlink -lnetfilter_queue"
+fi
+
printf "OS=$OS\n" > $CONFFILE
printf "STG_TIME=yes\n" >> $CONFFILE
printf "DEBUG=$DEBUG\n" >> $CONFFILE
printf "CHECK_MYSQLCLIENT=$CHECK_MYSQLCLIENT\n" >> $CONFFILE
printf "CHECK_PQ=$CHECK_PQ\n" >> $CONFFILE
printf "CHECK_XMLRPC=$CHECK_XMLRPC\n" >> $CONFFILE
+printf "CHECK_NFNETLINK=$CHECK_NFNETLINK\n" >> $CONFFILE
+printf "CHECK_NFQ=$CHECK_NFQ\n" >> $CONFFILE
printf "DEFS=$DEFS\n" >> $CONFFILE
+printf "NFQ_LIBS=$NFQ_LIBS\n" >> $CONFFILE
printf "STG_LIBS=" >> $CONFFILE
for lib in $STG_LIBS
do