]> git.stg.codes - stg.git/blobdiff - projects/stargazer/build
Added necessary headers in netlink/nfq checks.
[stg.git] / projects / stargazer / build
index 83f62b4647ae9aaea3650e728c03afe3100f0fec..f8fb73633a1adbe75363327aad3754479e4ca5c9 100755 (executable)
@@ -27,7 +27,8 @@ OWNER=root
 
 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"
@@ -54,14 +55,13 @@ LDFLAGS="$LDFLAGS -L/usr/local/lib"
 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;;
@@ -346,7 +346,7 @@ else
 fi
 
 printf "Checking for -lnfnetlink... "
-printf "#include <linux/netfilter.h>\nint main() { return 0; }\n" > build_check.c
+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
@@ -359,7 +359,7 @@ fi
 rm -f fake
 
 printf "Checking for -lnetfilter_queue... "
-printf "#include <libnetfilter_queue/libnetfilter_queue.h>\nint main() { return 0; }\n" > build_check.c
+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