BUILD: add 51degrees options to makefile.
To build with 51Degrees set USE_51DEGREES=1. 51DEGREES_INC, 51DEGREES_LIB,
and 51DEGREES_SRC will need to be set to the 51Degrees pattern header and
C file.
diff --git a/Makefile b/Makefile
index 0aa48a7..c353b03 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,7 @@
# USE_NS : enable network namespace support. Supported on Linux >= 2.6.24.
# USE_DL : enable it if your system requires -ldl. Automatic on Linux.
# USE_DEVICEATLAS : enable DeviceAtlas api.
+# USE_51DEGREES : enable third party device detection library from 51degrees
#
# Options can be forced by specifying "USE_xxx=1" or can be disabled by using
# "USE_xxx=" (empty string).
@@ -611,6 +612,15 @@
BUILD_OPTIONS += $(call ignore_implicit,USE_DEVICEATLAS)
endif
+ifneq ($(USE_51DEGREES),)
+# Use 51DEGREES_INC and 51DEGREES_LIB to force path to 51degrees headers and libraries if needed.
+51DEGREES_INC =
+51DEGREES_LIB =
+OPTIONS_CFLAGS += -DUSE_51DEGREES $(if $(51DEGREES_INC),-I$(51DEGREES_INC))
+BUILD_OPTIONS += $(call ignore_implicit,USE_51DEGREES)
+OPTIONS_LDFLAGS += $(if $(51DEGREES_LIB),-L$(51DEGREES_LIB)) -lz
+endif
+
ifneq ($(USE_PCRE)$(USE_STATIC_PCRE)$(USE_PCRE_JIT),)
# PCREDIR is used to automatically construct the PCRE_INC and PCRE_LIB paths,
# by appending /include and /lib respectively. If your system does not use the
@@ -729,6 +739,10 @@
OBJS += src/trace.o
endif
+ifneq ($(USE_51DEGREES),)
+OBJS += $(51DEGREES_SRC)/51Degrees.o
+endif
+
WRAPPER_OBJS = src/haproxy-systemd-wrapper.o
# Not used right now