Makefile.defs: option to disable raw sockets at compile time
authorDaniel-Constantin Mierla <miconda@gmail.com>
Sat, 15 Oct 2016 16:47:38 +0000 (18:47 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Sat, 15 Oct 2016 16:47:38 +0000 (18:47 +0200)
make RAW_SOCKS=no ...

Makefile.defs

index 715a13a..582fb38 100644 (file)
@@ -89,6 +89,11 @@ endif
 WITHAS ?= 1
 # enable core hooks for SCTP
 SCTP ?= 1
+# enable raw sockets
+RAW_SOCKS ?= yes
+ifeq ($(RAW_SOCKS),1)
+       RAW_SOCKS = yes
+endif
 
 # what to install
 INSTALL_FLAVOUR=$(FLAVOUR)
@@ -1717,7 +1722,10 @@ ifeq ($(OS), linux)
        use_futex= yes
        C_DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
                        -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
-                       -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DUSE_RAW_SOCKS
+                       -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER
+       ifneq ($(RAW_SOCKS), yes)
+               C_DEFS+= -DUSE_RAW_SOCKS
+       endif
        ifneq ($(found_lock_method), yes)
                #C_DEFS+= -DUSE_POSIX_SEM
                C_DEFS+=-DUSE_PTHREAD_MUTEX
@@ -1764,7 +1772,10 @@ ifeq ($(OS), gnu_kfreebsd)
        use_futex= yes
        C_DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
                        -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
-                       -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DUSE_RAW_SOCKS
+                       -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER
+       ifneq ($(RAW_SOCKS), yes)
+               C_DEFS+= -DUSE_RAW_SOCKS
+       endif
        ifneq ($(found_lock_method), yes)
                #C_DEFS+= -DUSE_POSIX_SEM
                C_DEFS+=-DUSE_PTHREAD_MUTEX
@@ -1845,7 +1856,10 @@ ifeq ($(OS), freebsd)
        C_DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN \
                -DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL \
                -DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM \
-               -DHAVE_NETINET_IN_SYSTM -DUSE_RAW_SOCKS
+               -DHAVE_NETINET_IN_SYSTM
+       ifneq ($(RAW_SOCKS), yes)
+               C_DEFS+= -DUSE_RAW_SOCKS
+       endif
        ifneq ($(found_lock_method), yes)
                C_DEFS+= -DUSE_PTHREAD_MUTEX  # try pthread sems
                found_lock_method=yes