]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: add 51degrees options to makefile.
authorThomas Holmes <tom@51degrees.com>
Tue, 12 May 2015 14:06:21 +0000 (15:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 2 Jun 2015 11:43:15 +0000 (13:43 +0200)
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.

Makefile

index 0aa48a7e8e66bb4c92449cfe66a6bebcd5ceafa6..c353b039c60d4027afe99c6d5d010dca0d2f31ad 100644 (file)
--- 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 @@ OPTIONS_CFLAGS += -DUSE_DEVICEATLAS $(if $(DEVICEATLAS_INC),-I$(DEVICEATLAS_INC)
 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 @@ ifneq ($(TRACE),)
 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