]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: addons: convert 51d addon to EXTRA_MAKE
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 28 May 2026 14:17:57 +0000 (16:17 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 28 May 2026 14:44:59 +0000 (16:44 +0200)
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.

Makefile
addons/51degrees/Makefile.mk [new file with mode: 0644]

index 0ab2e39eba4b425cbb5126979ed5b05bb6676afd..e799a19acc035c619f5049a77c448d6249d2322c 100644 (file)
--- 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 (file)
index 0000000..93157db
--- /dev/null
@@ -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