Enable compilation on GNU/kFreeBSD

This commit is contained in:
Matteo Cypriani 2012-01-25 15:42:40 +01:00
parent a20156a45e
commit 2c1697b78a
7 changed files with 28 additions and 10 deletions

View File

@ -44,7 +44,7 @@ int owl_create_trx_socket(const char *const dest_ip,
/* Selects 'iface' as sending interface for the socket 'sockfd'. */ /* Selects 'iface' as sending interface for the socket 'sockfd'. */
void owl_use_iface(const int sockfd, const char *const iface) void owl_use_iface(const int sockfd, const char *const iface)
{ {
#ifdef __GLIBC__ #if defined(linux) && defined(__GLIBC__)
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, iface, if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, iface,
strlen(iface) + 1) == -1) strlen(iface) + 1) == -1)
{ {
@ -53,11 +53,11 @@ void owl_use_iface(const int sockfd, const char *const iface)
perror("") ; perror("") ;
fprintf(stderr, "Sending through the default interface.\n") ; fprintf(stderr, "Sending through the default interface.\n") ;
} }
#else // __GLIBC__ #else // linux && __GLIBC__
fprintf(stderr, "Cannot select interface %s to send the packet:" fprintf(stderr, "Cannot select interface %s to send the packet:"
" this option is currently GNU libc-specific.\n" " this option is currently Linux and GNU libc-specific.\n"
"Sending through the default interface.\n", iface) ; "Sending through the default interface.\n", iface) ;
#endif // __GLIBC__ #endif // linux && __GLIBC__
} }

View File

@ -36,7 +36,10 @@ PICFLAG = -fPIC
LIBS = -L$(LIBOWLPS_DIR) -lowlps LIBS = -L$(LIBOWLPS_DIR) -lowlps
OS := $(shell uname) OS := $(shell uname)
ifeq ("$(OS)", "Linux") ifeq "$(OS)" "Linux"
LIBS += -lrt
endif
ifeq "$(OS)" "GNU/kFreeBSD"
LIBS += -lrt LIBS += -lrt
endif endif

View File

@ -39,7 +39,10 @@ OWLPSFLAGS = -D OWLPS_VERSION=\"$(OWLPS_VERSION)\"
LIBS = -pthread -lconfuse -L$(LIBOWLPS_DIR) -lowlps LIBS = -pthread -lconfuse -L$(LIBOWLPS_DIR) -lowlps
OS := $(shell uname) OS := $(shell uname)
ifeq ("$(OS)", "Linux") ifeq "$(OS)" "Linux"
LIBS += -lrt
endif
ifeq "$(OS)" "GNU/kFreeBSD"
LIBS += -lrt LIBS += -lrt
endif endif

View File

@ -46,7 +46,10 @@ LIBS = -L$(LIBOWLPS_DIR) -lowlps \
-L$(LIBOWLPSCLIENT_DIR) -lowlps-client -L$(LIBOWLPSCLIENT_DIR) -lowlps-client
OS := $(shell uname) OS := $(shell uname)
ifeq ("$(OS)", "Linux") ifeq "$(OS)" "Linux"
LIBS += -lrt
endif
ifeq "$(OS)" "GNU/kFreeBSD"
LIBS += -lrt LIBS += -lrt
endif endif

View File

@ -46,7 +46,10 @@ LIBS = -L$(LIBOWLPS_DIR) -lowlps \
-lpcap -lpcap
OS := $(shell uname) OS := $(shell uname)
ifeq ("$(OS)", "Linux") ifeq "$(OS)" "Linux"
LIBS += -lrt
endif
ifeq "$(OS)" "GNU/kFreeBSD"
LIBS += -lrt LIBS += -lrt
endif endif

View File

@ -44,7 +44,10 @@ LDFLAGS = -lstdc++ -lm -lboost_program_options \
-L$(LIBOWLPS_DIR) -lowlps -L$(LIBOWLPS_DIR) -lowlps
OS := $(shell uname) OS := $(shell uname)
ifeq ("$(OS)", "Linux") ifeq "$(OS)" "Linux"
LDFLAGS += -lrt
endif
ifeq "$(OS)" "GNU/kFreeBSD"
LDFLAGS += -lrt LDFLAGS += -lrt
endif endif

View File

@ -41,7 +41,10 @@ LIBS = -pthread -L$(LIBOWLPS_DIR) -lowlps \
-L$(LIBOWLPSRESULTREADER_DIR) -lowlps-resultreader -L$(LIBOWLPSRESULTREADER_DIR) -lowlps-resultreader
OS := $(shell uname) OS := $(shell uname)
ifeq ("$(OS)", "Linux") ifeq "$(OS)" "Linux"
LIBS += -lrt
endif
ifeq "$(OS)" "GNU/kFreeBSD"
LIBS += -lrt LIBS += -lrt
endif endif