]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: Makefile: add options to build with DeviceAtlas
authorDavid Carlier <dcarlier@afilias.info>
Mon, 1 Jun 2015 12:00:07 +0000 (14:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 2 Jun 2015 11:42:11 +0000 (13:42 +0200)
This diff updates the Makefile to compile conditionally via
some new sets of flags, USE_DEVICEATLAS to enable the module
and the couple DEVICEATLAS_INC/DEVICEATLAS_LIB which needs to
point to the API root folder in order to compile the API and
the module.

Makefile

index c0f4cb3b312fe73d4fe0daee497215e10e1de884..0aa48a7e8e66bb4c92449cfe66a6bebcd5ceafa6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,7 @@
 #   USE_TFO              : enable TCP fast open. Supported on Linux >= 3.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.
 #
 # Options can be forced by specifying "USE_xxx=1" or can be disabled by using
 # "USE_xxx=" (empty string).
@@ -600,6 +601,16 @@ OPTIONS_LDFLAGS += $(LUA_LD_FLAGS) -l$(LUA_LIB_NAME) -lm
 OPTIONS_OBJS    += src/hlua.o
 endif
 
+ifneq ($(USE_DEVICEATLAS),)
+DEVICEATLAS_INC =
+DEVICEATLAS_LIB =
+OPTIONS_OBJS   += $(DEVICEATLAS_LIB)/json.o
+OPTIONS_OBJS   += $(DEVICEATLAS_LIB)/dac.o
+OPTIONS_OBJS   += src/da.o
+OPTIONS_CFLAGS += -DUSE_DEVICEATLAS $(if $(DEVICEATLAS_INC),-I$(DEVICEATLAS_INC))
+BUILD_OPTIONS  += $(call ignore_implicit,USE_DEVICEATLAS)
+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