]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] build: switch ebtree users to use new ebtree version
authorWilly Tarreau <w@1wt.eu>
Mon, 26 Oct 2009 20:10:04 +0000 (21:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Oct 2009 20:10:04 +0000 (21:10 +0100)
All files referencing the previous ebtree code were changed to point
to the new one in the ebtree directory. A makefile variable (EBTREE_DIR)
is also available to use files from another directory.

The ability to build the libebtree library temporarily remains disabled
because it can have an impact on some existing toolchains and does not
appear worth it in the medium term if we add support for multi-criteria
stickiness for instance.

20 files changed:
Makefile
Makefile.bsd
Makefile.osx
contrib/halog/Makefile
contrib/halog/halog.c
include/common/standard.h
include/proto/task.h
include/types/lb_chash.h
include/types/lb_fwlc.h
include/types/lb_fwrr.h
include/types/protocols.h
include/types/proxy.h
include/types/server.h
include/types/task.h
src/lb_chash.c
src/lb_fwlc.c
src/lb_fwrr.c
src/lb_map.c
src/standard.c
src/task.c

index 46b762c297a1690d6b4b66e7c1a606f8947e779a..824e8e19b646a4bad41637037f56b5c4b3e63cce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -410,10 +410,12 @@ OPTIONS_LDFLAGS += -L$(PCREDIR)/lib -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynami
 BUILD_OPTIONS   += $(call ignore_implicit,USE_STATIC_PCRE)
 endif
 
+# This one can be changed to look for ebtree files in an external directory
+EBTREE_DIR := ebtree
 
 #### Global compile options
 VERBOSE_CFLAGS = $(CFLAGS) $(TARGET_CFLAGS) $(SMALL_OPTS) $(DEFINE)
-COPTS  = -Iinclude -Wall
+COPTS  = -Iinclude -I$(EBTREE_DIR) -Wall
 COPTS += $(CFLAGS) $(TARGET_CFLAGS) $(SMALL_OPTS) $(DEFINE) $(SILENT_DEFINE)
 COPTS += $(DEBUG) $(OPTIONS_CFLAGS) $(ADDINC)
 
@@ -462,12 +464,22 @@ OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \
        src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o \
        src/stream_interface.o src/dumpstats.o src/proto_tcp.o \
        src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \
-       src/acl.o src/memory.o src/freq_ctr.o \
-       src/ebtree.o src/eb32tree.o
+       src/acl.o src/memory.o src/freq_ctr.o
 
-haproxy: $(OBJS) $(OPTIONS_OBJS)
+EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
+              $(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
+              $(EBTREE_DIR)/ebmbtree.o $(EBTREE_DIR)/ebsttree.o \
+              $(EBTREE_DIR)/ebimtree.o $(EBTREE_DIR)/ebistree.o
+
+# Not used right now
+LIB_EBTREE = $(EBTREE_DIR)/libebtree.a
+
+haproxy: $(OBJS) $(OPTIONS_OBJS) $(EBTREE_OBJS)
        $(LD) $(LDFLAGS) -o $@ $^ $(LDOPTS)
 
+$(LIB_EBTREE): $(EBTREE_OBJS)
+       $(AR) rv $@ $^
+
 objsize: haproxy
        @objdump -t $^|grep ' g '|grep -F '.text'|awk '{print $$5 FS $$6}'|sort
 
@@ -504,8 +516,8 @@ install-bin: haproxy
 install: install-bin install-man install-doc
 
 clean:
-       rm -f *.[oas] src/*.[oas] core haproxy test
-       for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done
+       rm -f *.[oas] src/*.[oas] ebtree/*.[oas] haproxy test
+       for dir in . src include/* doc ebtree; do rm -f $$dir/*~ $$dir/*.rej $$dir/core; done
        rm -f haproxy-$(VERSION).tar.gz haproxy-$(VERSION)$(SUBVERS).tar.gz
        rm -f haproxy-$(VERSION) nohup.out gmon.out
 
index 7957f9427b442276431b86e105f5c7897aa216e2..015a3651b5754c0f2080e97518ae883c474a98c3 100644 (file)
@@ -92,8 +92,11 @@ VERDATE != cat VERDATE 2>/dev/null || touch VERDATE
 VER_OPTS := -DCONFIG_HAPROXY_VERSION=\"$(VERSION)$(SUBVERS)\" \
             -DCONFIG_HAPROXY_DATE=\"$(VERDATE)\"
 
-COPTS   = -Iinclude $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) $(REGEX_OPTS) \
-          $(SMALL_OPTS) $(VER_OPTS) $(DEFINE)
+# This one can be changed to look for ebtree files in an external directory
+EBTREE_DIR := ebtree
+
+COPTS   = -Iinclude -I$(EBTREE_DIR) $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) \
+          $(REGEX_OPTS) $(SMALL_OPTS) $(VER_OPTS) $(DEFINE)
 LIBS    = $(LIBS.$(TARGET)) $(LIBS.$(REGEX)) $(ADDLIB)
 CFLAGS  = -Wall $(COPTS) $(DEBUG)
 LDFLAGS = -g
@@ -107,12 +110,16 @@ OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \
        src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \
        src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o \
        src/ev_poll.o src/ev_kqueue.o \
-       src/acl.o src/memory.o src/freq_ctr.o \
-       src/ebtree.o src/eb32tree.o
+       src/acl.o src/memory.o src/freq_ctr.o
+
+EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
+              $(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
+              $(EBTREE_DIR)/ebmbtree.o $(EBTREE_DIR)/ebsttree.o \
+              $(EBTREE_DIR)/ebimtree.o $(EBTREE_DIR)/ebistree.o
 
 all: haproxy
 
-haproxy: $(OBJS) $(OPT_OBJS)
+haproxy: $(OBJS) $(OPT_OBJS) $(EBTREE_OBJS)
        $(LD) $(LDFLAGS) -o $@ $> $(LIBS)
 
 .SUFFIXES: .c.o
@@ -129,8 +136,8 @@ src/dlmalloc.o: $(DLMALLOC_SRC)
        $(CC) $(CFLAGS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $>
 
 clean:
-       rm -f *.[oas] src/*.[oas] core haproxy test
-       for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done
+       rm -f *.[oas] src/*.[oas] ebtree/*.[oas] haproxy test
+       for dir in . src include/* doc ebtree; do rm -f $$dir/*~ $$dir/*.rej $$dir/core; done
        rm -f haproxy-$(VERSION).tar.gz haproxy-$(VERSION) nohup.out gmon.out
 
 version:
index 19fb720608e6e57cd5b45fa5e1afdb886d9c51f1..5fa0da025043f0fa46ea40d5d7c76fcfe9dcafbf 100644 (file)
@@ -31,6 +31,9 @@ LD = gcc
 PCREDIR!= pcre-config --prefix 2>/dev/null || :
 #PCREDIR=/usr/local
 
+# This one can be changed to look for ebtree files in an external directory
+EBTREE_DIR = ebtree
+
 # This is for darwin 3.0 and above
 COPTS.darwin = -DENABLE_POLL -DENABLE_KQUEUE
 LIBS.darwin =
@@ -89,8 +92,8 @@ VERDATE != cat VERDATE 2>/dev/null || touch VERDATE
 VER_OPTS := -DCONFIG_HAPROXY_VERSION=\"$(VERSION)$(SUBVERS)\" \
             -DCONFIG_HAPROXY_DATE=\"$(VERDATE)\"
 
-COPTS   = -Iinclude $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) $(REGEX_OPTS) \
-          $(SMALL_OPTS) $(VER_OPTS) $(DEFINE)
+COPTS   = -Iinclude -I$(EBTREE_DIR) $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) \
+          $(REGEX_OPTS) $(SMALL_OPTS) $(VER_OPTS) $(DEFINE)
 LIBS    = $(LIBS.$(TARGET)) $(LIBS.$(REGEX)) $(ADDLIB)
 CFLAGS  = -Wall $(COPTS) $(DEBUG) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4
 LDFLAGS = -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4
@@ -104,13 +107,17 @@ OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \
        src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \
        src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o \
        src/ev_poll.o \
-       src/acl.o src/memory.o src/freq_ctr.o \
-       src/ebtree.o src/eb32tree.o
+       src/acl.o src/memory.o src/freq_ctr.o
+
+EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
+              $(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
+              $(EBTREE_DIR)/ebmbtree.o $(EBTREE_DIR)/ebsttree.o \
+              $(EBTREE_DIR)/ebimtree.o $(EBTREE_DIR)/ebistree.o
 
 all: haproxy
 
-haproxy: $(OBJS)
-       $(LD) $(LDFLAGS) $(OBJS) -o $@
+haproxy: $(OBJS) $(EBTREE_OBJS)
+       $(LD) $(LDFLAGS) $(OBJS) $(EBTREE_OBJS) -o $@
 
 .SUFFIXES: .c.o
 
@@ -126,8 +133,8 @@ src/dlmalloc.o: $(DLMALLOC_SRC)
        $(CC) $(CFLAGS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $<
 
 clean:
-       rm -f *.[oas] src/*.[oas] core haproxy test
-       for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done
+       rm -f *.[oas] src/*.[oas] ebtree/*.[oas] haproxy test
+       for dir in . src include/* doc ebtree; do rm -f $$dir/*~ $$dir/*.rej $$dir/core; done
        rm -f haproxy-$(VERSION).tar.gz haproxy-$(VERSION) nohup.out gmon.out
 
 version:
index 2215e03a9a2161c6d0ad0e17db35841ae2020128..f85acc7c17e12f3cb34263262ee5146bdae4268d 100644 (file)
@@ -1,13 +1,14 @@
-INCLUDE  = -I../../include
-OPTIMIZE = -O3 -mtune=pentium-m
+EBTREE_DIR = ../../ebtree
+INCLUDE  = -I$(EBTREE_DIR)
+OPTIMIZE = -O3 #-mtune=pentium-m
 
 OBJS     = halog halog64
 
 halog: halog.c fgets2.c
-       $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) ../../src/ebtree.c ../../src/eb32tree.c $^
+       $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) $(EBTREE_DIR)/ebtree.c $(EBTREE_DIR)/eb32tree.c $^
 
 halog64: halog.c fgets2-64.c
-       $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) ../../src/ebtree.c ../../src/eb32tree.c $^
+       $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) $(EBTREE_DIR)/ebtree.c $(EBTREE_DIR)/eb32tree.c $^
 
 clean:
        rm -vf $(OBJS)
index 27e09617db95bff04461277f231cc1b229cf7526..fcf99c49d11810038f109e8e402e0a672cc95f2c 100644 (file)
@@ -27,7 +27,7 @@
 #include <unistd.h>
 #include <ctype.h>
 
-#include <common/eb32tree.h>
+#include <eb32tree.h>
 
 #define ACCEPT_FIELD 6
 #define TIME_FIELD 9
index ce70f2e5fa8ae855274a94c2d388a89d047d7b17..0a6b68bf9d61da40e75cd184b1850b802f65a4a9 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <common/config.h>
-#include <common/eb32tree.h>
+#include <eb32tree.h>
 #include <proto/fd.h>
 
 /****** string-specific macros and functions ******/
index 62f83e3f54f6e4bd719cdaaf05ad96c631e75899..0cfe28f2094ef322de920a2ba2f91e0cb92c895e 100644 (file)
 #include <sys/time.h>
 
 #include <common/config.h>
-#include <common/eb32tree.h>
 #include <common/memory.h>
 #include <common/mini-clist.h>
 #include <common/standard.h>
 #include <common/ticks.h>
+#include <eb32tree.h>
 
 #include <types/task.h>
 
index 3eee12c401a22d8cbb2ccd86c685c40e8cf73849..5991ce961b7a519bea707b7ff46b0883d01656dd 100644 (file)
@@ -23,8 +23,8 @@
 #define _TYPES_LB_CHASH_H
 
 #include <common/config.h>
-#include <common/ebtree.h>
-#include <common/eb32tree.h>
+#include <ebtree.h>
+#include <eb32tree.h>
 
 struct lb_chash {
        struct eb_root act;     /* weighted chash entries of active servers */
index cad4d134b6fd8dc03cb1f4cf7ce01ec552f8a22d..170eb241c590851d3dc0935c367b56108fb98e1d 100644 (file)
@@ -23,7 +23,7 @@
 #define _TYPES_LB_FWLC_H
 
 #include <common/config.h>
-#include <common/ebtree.h>
+#include <ebtree.h>
 
 struct lb_fwlc {
        struct eb_root act;     /* weighted least conns on the active servers */
index 600a511a1c93e7a0131241b28dd17dedcae1999e..731f055f9db157a46285e02ef7f6bceecfe9e229 100644 (file)
@@ -23,7 +23,7 @@
 #define _TYPES_LB_FWRR_H
 
 #include <common/config.h>
-#include <common/ebtree.h>
+#include <ebtree.h>
 
 /* This structure is used to apply fast weighted round robin on a server group */
 struct fwrr_group {
index 66c742b0933f76b472e44ea0bbbadeda1438417d..c13c73d361b8c1193475e1eb72cd2c3fd4567168 100644 (file)
@@ -28,8 +28,8 @@
 #include <sys/un.h>
 
 #include <common/config.h>
-#include <common/eb32tree.h>
 #include <common/mini-clist.h>
+#include <eb32tree.h>
 
 #include <types/counters.h>
 #include <types/task.h>
index ec00d741ee21877dc8e8c50d5de64c5c1b5d7373..8348f92ed317b24d286125c133b95eb98093f416 100644 (file)
 
 #include <common/appsession.h>
 #include <common/config.h>
-#include <common/eb32tree.h>
 #include <common/mini-clist.h>
 #include <common/regex.h>
 #include <common/sessionhash.h>
 #include <common/tools.h>
+#include <eb32tree.h>
 
 #include <types/acl.h>
 #include <types/backend.h>
index b3fe83dc7100b19c026507852da9504af6bdc6c0..935992d40cc75c06dd047b2f439775375421bfde 100644 (file)
@@ -26,8 +26,8 @@
 #include <arpa/inet.h>
 
 #include <common/config.h>
-#include <common/eb32tree.h>
 #include <common/mini-clist.h>
+#include <eb32tree.h>
 
 #include <types/buffers.h>
 #include <types/counters.h>
index 641cb17cd9ce0fe62fd08b33e9ac6336033adefd..41f889c88c31e66f813b8988caa44b30d63930c2 100644 (file)
@@ -25,8 +25,8 @@
 #include <sys/time.h>
 
 #include <common/config.h>
-#include <common/eb32tree.h>
 #include <common/mini-clist.h>
+#include <eb32tree.h>
 
 /* values for task->state */
 #define TASK_SLEEPING     0x00  /* task sleeping */
index bfd4cd0470c8ea0defa86296d359f8d9357fc6df..58c029a4ad3392bc05c30f6923f91dc6a87f4172 100644 (file)
@@ -19,7 +19,7 @@
 #include <common/compat.h>
 #include <common/config.h>
 #include <common/debug.h>
-#include <common/eb32tree.h>
+#include <eb32tree.h>
 
 #include <types/global.h>
 #include <types/server.h>
index 5d1a31be2e61643f421600b568331ebb72e51a8e..c2fcb4efe7830cb35c42eea4784e382af636ea84 100644 (file)
@@ -13,7 +13,7 @@
 #include <common/compat.h>
 #include <common/config.h>
 #include <common/debug.h>
-#include <common/eb32tree.h>
+#include <eb32tree.h>
 
 #include <types/global.h>
 #include <types/server.h>
index 84d179da3f75cc6eab456469f70cc5ea0f18e932..d92b6eb827eaccb516d3ce8fe24e3b678ef6ed1f 100644 (file)
@@ -13,7 +13,7 @@
 #include <common/compat.h>
 #include <common/config.h>
 #include <common/debug.h>
-#include <common/eb32tree.h>
+#include <eb32tree.h>
 
 #include <types/global.h>
 #include <types/server.h>
index 2918c26be753769915cb6af959553eb26675a4c7..d3264bb6bafd319310e787d308211b75b2fc574b 100644 (file)
@@ -13,7 +13,7 @@
 #include <common/compat.h>
 #include <common/config.h>
 #include <common/debug.h>
-#include <common/eb32tree.h>
+#include <eb32tree.h>
 
 #include <types/global.h>
 #include <types/server.h>
index 6b0be2d0a16f0bcc197f18d4d38c2db959b7b6fa..6a8724a86c4c853ab68870775c9f17d3bc92ed50 100644 (file)
@@ -20,8 +20,8 @@
 #include <arpa/inet.h>
 
 #include <common/config.h>
-#include <common/eb32tree.h>
 #include <common/standard.h>
+#include <eb32tree.h>
 #include <proto/log.h>
 
 /* enough to store 10 integers of :
index cc455f58fec790adf20e65eaed22ce6c759b6209..9b21fd9df7e83fb46af8bc84372e8cbb98df2afc 100644 (file)
 #include <string.h>
 
 #include <common/config.h>
-#include <common/eb32tree.h>
 #include <common/memory.h>
 #include <common/mini-clist.h>
 #include <common/standard.h>
 #include <common/time.h>
+#include <eb32tree.h>
 
 #include <proto/proxy.h>
 #include <proto/session.h>