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'. */
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,
strlen(iface) + 1) == -1)
{
@ -53,11 +53,11 @@ void owl_use_iface(const int sockfd, const char *const iface)
perror("") ;
fprintf(stderr, "Sending through the default interface.\n") ;
}
#else // __GLIBC__
#else // linux && __GLIBC__
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) ;
#endif // __GLIBC__
#endif // linux && __GLIBC__
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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