From: William Lallemand Date: Thu, 28 May 2026 14:17:57 +0000 (+0200) Subject: BUILD: addons: convert 51d addon to EXTRA_MAKE X-Git-Tag: v3.4.0~72 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=6ebf0d4c952451c841f2ad439cc2be81a2ed0747;p=thirdparty%2Fhaproxy.git BUILD: addons: convert 51d addon to EXTRA_MAKE Move the 51degrees Makefile part to addons/51degrees/Makefile.mk so it can be used with EXTRA_MAKE and allow to cleanup the main Makefile. EXTRA_MAKE paths are appended with /Makefile.mk via addsuffix, so the path must not have a trailing slash. Shouldn't have impact on the build system, every build variable previously used are the same. --- diff --git a/Makefile b/Makefile index 0ab2e39eb..e799a19ac 100644 --- a/Makefile +++ b/Makefile @@ -732,44 +732,8 @@ ifneq ($(USE_DEVICEATLAS:0=),) OPTIONS_OBJS += addons/deviceatlas/da.o endif -# Use 51DEGREES_SRC and possibly 51DEGREES_INC and 51DEGREES_LIB to force path -# to 51degrees v3/v4 headers and libraries if needed. Note that the SRC/INC/ -# LIB/CFLAGS/LDFLAGS variables names all use 51DEGREES as the prefix, -# regardless of the version since they are mutually exclusive. The version -# (51DEGREES_VER) must be either 3 or 4, and defaults to 3 if not set. -51DEGREES_INC = $(51DEGREES_SRC) -51DEGREES_LIB = $(51DEGREES_SRC) -51DEGREES_VER = 3 - ifneq ($(USE_51DEGREES:0=),) - ifeq ($(51DEGREES_VER),4) # v4 here - _51DEGREES_SRC = $(shell find $(51DEGREES_LIB) -maxdepth 2 -name '*.c') - OPTIONS_OBJS += $(_51DEGREES_SRC:%.c=%.o) - 51DEGREES_CFLAGS += -DUSE_51DEGREES_V4 - ifeq ($(USE_THREAD:0=),) - 51DEGREES_CFLAGS += -DFIFTYONEDEGREES_NO_THREADING -DFIFTYONE_DEGREES_NO_THREADING - endif - USE_LIBATOMIC = implicit - endif # 51DEGREES_VER==4 - - ifeq ($(51DEGREES_VER),3) # v3 here - OPTIONS_OBJS += $(51DEGREES_LIB)/../cityhash/city.o - OPTIONS_OBJS += $(51DEGREES_LIB)/51Degrees.o - ifeq ($(USE_THREAD:0=),) - 51DEGREES_CFLAGS += -DFIFTYONEDEGREES_NO_THREADING - else - OPTIONS_OBJS += $(51DEGREES_LIB)/../threading.o - endif - else - ifneq ($(51DEGREES_VER),4) - $(error 51Degrees version (51DEGREES_VER) must be either 3 or 4) - endif - endif # 51DEGREES_VER==3 - - OPTIONS_OBJS += addons/51degrees/51d.o - 51DEGREES_CFLAGS += $(if $(51DEGREES_INC),-I$(51DEGREES_INC)) - 51DEGREES_LDFLAGS += $(if $(51DEGREES_LIB),-L$(51DEGREES_LIB)) - USE_MATH = implicit + EXTRA_MAKE += addons/51degrees endif # USE_51DEGREES ifneq ($(USE_WURFL:0=),) diff --git a/addons/51degrees/Makefile.mk b/addons/51degrees/Makefile.mk new file mode 100644 index 000000000..93157dbdd --- /dev/null +++ b/addons/51degrees/Makefile.mk @@ -0,0 +1,37 @@ +# Use 51DEGREES_SRC and possibly 51DEGREES_INC and 51DEGREES_LIB to force path +# to 51degrees v3/v4 headers and libraries if needed. Note that the SRC/INC/ +# LIB/CFLAGS/LDFLAGS variables names all use 51DEGREES as the prefix, +# regardless of the version since they are mutually exclusive. The version +# (51DEGREES_VER) must be either 3 or 4, and defaults to 3 if not set. +51DEGREES_INC = $(51DEGREES_SRC) +51DEGREES_LIB = $(51DEGREES_SRC) +51DEGREES_VER = 3 + +ifeq ($(51DEGREES_VER),4) # v4 here + _51DEGREES_SRC = $(shell find $(51DEGREES_LIB) -maxdepth 2 -name '*.c') + OPTIONS_OBJS += $(_51DEGREES_SRC:%.c=%.o) + 51DEGREES_CFLAGS += -DUSE_51DEGREES_V4 + ifeq ($(USE_THREAD:0=),) + 51DEGREES_CFLAGS += -DFIFTYONEDEGREES_NO_THREADING -DFIFTYONE_DEGREES_NO_THREADING + endif + USE_LIBATOMIC = implicit +endif # 51DEGREES_VER==4 + +ifeq ($(51DEGREES_VER),3) # v3 here + OPTIONS_OBJS += $(51DEGREES_LIB)/../cityhash/city.o + OPTIONS_OBJS += $(51DEGREES_LIB)/51Degrees.o + ifeq ($(USE_THREAD:0=),) + 51DEGREES_CFLAGS += -DFIFTYONEDEGREES_NO_THREADING + else + OPTIONS_OBJS += $(51DEGREES_LIB)/../threading.o + endif +else + ifneq ($(51DEGREES_VER),4) + $(error 51Degrees version (51DEGREES_VER) must be either 3 or 4) + endif +endif # 51DEGREES_VER==3 + +OPTIONS_OBJS += addons/51degrees/51d.o +51DEGREES_CFLAGS += $(if $(51DEGREES_INC),-I$(51DEGREES_INC)) +51DEGREES_LDFLAGS += $(if $(51DEGREES_LIB),-L$(51DEGREES_LIB)) +USE_MATH = implicit