BUG/MINOR: contrib/mod_defender: build fix
authorDavid Carlier <devnexen@gmail.com>
Wed, 7 Jun 2017 11:39:16 +0000 (12:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Jul 2017 12:35:24 +0000 (14:35 +0200)
In similar manner than modsecurity, making the build possible under *BSD flavors, the -lm for ceilf function.

contrib/mod_defender/Makefile
contrib/mod_defender/spoa.h

index 119d824..ac17774 100644 (file)
@@ -2,10 +2,10 @@ DESTDIR    =
 PREFIX     = /usr/local
 BINDIR     = $(PREFIX)/bin
 
-CC = gcc
+CC ?= gcc
 LD = $(CC)
 
-CXX = g++
+CXX ?= g++
 
 ifeq ($(MOD_DEFENDER_SRC),)
 MOD_DEFENDER_SRC := ./mod_defender_src
@@ -19,9 +19,17 @@ ifeq ($(APR_INC),)
 APR_INC := /usr/include/apr-1.0
 endif
 
-CFLAGS  = -g -Wall -pthread
-LDFLAGS = -lpthread  -levent -levent_pthreads -lapr-1 -laprutil-1 -lstdc++
-INCS += -I../../include -I../../ebtree -I$(MOD_DEFENDER_SRC) -I$(APACHE2_INC) -I$(APR_INC)
+ifeq ($(EVENT_LIB),)
+EVENT_LIB := -levent
+endif
+
+ifeq ($(EVENT_INC),)
+EVENT_INC := /usr/include
+endif
+
+CFLAGS  += -g -Wall -pthread
+LDFLAGS += -lpthread  $(EVENT_LIB) -levent_pthreads -lapr-1 -laprutil-1 -lstdc++ -lm
+INCS += -I../../include -I../../ebtree -I$(MOD_DEFENDER_SRC) -I$(APACHE2_INC) -I$(APR_INC) -I$(EVENT_INC)
 LIBS =
 
 CXXFLAGS = -g -std=gnu++11
index 332f387..726007f 100644 (file)
@@ -16,6 +16,7 @@
 #define __SPOA_H__
 
 #include <sys/time.h>
+#undef LIST_HEAD
 
 #include <event2/util.h>
 #include <event2/event.h>