blob: 9d9b1bfeeba18d9e6c86f729d08037b2a83013b7 [file] [log] [blame]
Miroslav Zagorac70230c62020-12-09 16:54:31 +01001# USE_OT : enable the OpenTracing filter
2# OT_DEBUG : compile the OpenTracing filter in debug mode
3# OT_INC : force the include path to libopentracing-c-wrapper
4# OT_LIB : force the lib path to libopentracing-c-wrapper
5# OT_RUNPATH : add libopentracing-c-wrapper RUNPATH to haproxy executable
6
7OT_DEFINE =
8OT_CFLAGS =
9OT_LDFLAGS =
10OT_DEBUG_EXT =
11OTC_WRAPPER = opentracing-c-wrapper
12
13ifneq ($(OT_DEBUG),)
14OT_DEBUG_EXT = _dbg
15OT_DEFINE = -DDEBUG_OT
16endif
17
18ifeq ($(OT_INC),)
19OT_CFLAGS = $(shell pkg-config --silence-errors --cflags $(OTC_WRAPPER)$(OT_DEBUG_EXT))
20else
21ifneq ($(wildcard $(OT_INC)/$(OTC_WRAPPER)/.*),)
22OT_CFLAGS = -I$(OT_INC) $(if $(OT_DEBUG),-DOTC_DBG_MEM)
23endif
24endif
25
26ifeq ($(OT_CFLAGS),)
27$(error OpenTracing C wrapper : can't find headers)
28endif
29
30ifeq ($(OT_LIB),)
31OT_LDFLAGS = $(shell pkg-config --silence-errors --libs $(OTC_WRAPPER)$(OT_DEBUG_EXT))
32else
33ifneq ($(wildcard $(OT_LIB)/lib$(OTC_WRAPPER).*),)
34OT_LDFLAGS = -L$(OT_LIB) -l$(OTC_WRAPPER)$(OT_DEBUG_EXT)
35ifneq ($(OT_RUNPATH),)
36OT_LDFLAGS += -Wl,--rpath,$(OT_LIB)
37endif
38endif
39endif
40
41ifeq ($(OT_LDFLAGS),)
42$(error OpenTracing C wrapper : can't find library)
43endif
44
45OPTIONS_OBJS += \
Willy Tarreaua63d1a02021-04-02 17:16:46 +020046 addons/ot/src/cli.o \
47 addons/ot/src/conf.o \
48 addons/ot/src/event.o \
49 addons/ot/src/filter.o \
50 addons/ot/src/group.o \
51 addons/ot/src/http.o \
52 addons/ot/src/opentracing.o \
53 addons/ot/src/parser.o \
54 addons/ot/src/pool.o \
55 addons/ot/src/scope.o \
56 addons/ot/src/util.o \
57 addons/ot/src/vars.o
Miroslav Zagorac70230c62020-12-09 16:54:31 +010058
Willy Tarreaua63d1a02021-04-02 17:16:46 +020059OPTIONS_CFLAGS += $(OT_CFLAGS) -Iaddons/ot/include
Miroslav Zagorac70230c62020-12-09 16:54:31 +010060OPTIONS_LDFLAGS += $(OT_LDFLAGS)
61OPTIONS_CFLAGS += $(OT_DEFINE)