diff --git a/libowlps-client/libowlps-client.c b/libowlps-client/libowlps-client.c index 3cbce49..f173f71 100644 --- a/libowlps-client/libowlps-client.c +++ b/libowlps-client/libowlps-client.c @@ -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__ } diff --git a/libowlps-resultreader/Makefile b/libowlps-resultreader/Makefile index e73d80d..451eb68 100644 --- a/libowlps-resultreader/Makefile +++ b/libowlps-resultreader/Makefile @@ -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 diff --git a/owlps-aggregator/Makefile b/owlps-aggregator/Makefile index 0133b9d..8dc17ff 100644 --- a/owlps-aggregator/Makefile +++ b/owlps-aggregator/Makefile @@ -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 diff --git a/owlps-client/Makefile b/owlps-client/Makefile index c1bea96..3c0dcdc 100644 --- a/owlps-client/Makefile +++ b/owlps-client/Makefile @@ -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 diff --git a/owlps-listener/Makefile b/owlps-listener/Makefile index 840badb..238ead4 100644 --- a/owlps-listener/Makefile +++ b/owlps-listener/Makefile @@ -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 diff --git a/owlps-positioning/Makefile b/owlps-positioning/Makefile index 7e10374..6d19b4f 100644 --- a/owlps-positioning/Makefile +++ b/owlps-positioning/Makefile @@ -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 diff --git a/owlps-udp-to-http/Makefile b/owlps-udp-to-http/Makefile index f487da4..ae1c5d1 100644 --- a/owlps-udp-to-http/Makefile +++ b/owlps-udp-to-http/Makefile @@ -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