BUILD: remove the obsolete BSD and OSX makefiles

These makefiles were aging, with no support for SSL nor zlib, and
they were hard to maintain. GNU make is packaged and provided with
all systems which were relying on these makefiles, so better simply
delete them and enable the new features for everyone.
This commit is contained in:
Willy Tarreau 2014-05-10 09:12:46 +02:00
parent b1dd9bf308
commit 3543cdbd17
3 changed files with 10 additions and 318 deletions

View File

@ -1,153 +0,0 @@
# This makefile is dedicated to OpenBSD (and possibly other BSDs)
# You should use it this way :
# make TARGET=os CPU=cpu
#
# Some optional components may be added, such as DLMALLOC :
#
# make TARGET=freebsd CPU=i686 DLMALLOC_SRC=/usr/local/src/dlmalloc.c \
# OPT_OBJS=src/dlmalloc.o
# Select target OS. TARGET must match a system for which COPTS and LIBS are
# correctly defined below.
TARGET = openbsd
# pass CPU=<cpu_name> to make to optimize for a particular CPU
CPU = generic
#CPU = native
#CPU = i586
#CPU = i686
#CPU = ultrasparc
# By default, we use libc's regex. WARNING! On Solaris 8/Sparc, group
# references seem broken using libc ! Use pcre instead.
REGEX=libc
#REGEX=pcre
#REGEX=static-pcre
# tools options
CC = gcc
LD = gcc
# This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre
PCREDIR!= pcre-config --prefix 2>/dev/null || :
#PCREDIR=/usr/local
# This is for OpenBSD 3.0 and above
COPTS.openbsd = -DENABLE_POLL -DENABLE_KQUEUE
LIBS.openbsd =
# CPU dependant optimizations
COPTS.generic = -O2
COPTS.native = -O2 -march=native
COPTS.i586 = -O2 -march=i586
COPTS.i686 = -O2 -march=i686
COPTS.ultrasparc = -O6 -mcpu=v9 -mtune=ultrasparc
# options for standard regex library
COPTS.libc=
LIBS.libc=
# options for libpcre
COPTS.pcre=-DUSE_PCRE -I$(PCREDIR)/include
LIBS.pcre=-L$(PCREDIR)/lib -lpcreposix -lpcre
# options for static libpcre
COPTS.static-pcre=-DUSE_PCRE -I$(PCREDIR)/include
LIBS.static-pcre=-L$(PCREDIR)/lib -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynamic
# you can enable debug arguments with "DEBUG=-g" or disable them with "DEBUG="
#DEBUG = -g -DDEBUG_MEMORY -DDEBUG_FULL
DEBUG = -g
# if small memory footprint is required, you can reduce the buffer size. There
# are 2 buffers per concurrent session, so 16 kB buffers will eat 32 MB memory
# with 1000 concurrent sessions. Putting it slightly lower than a page size
# will avoid the additionnal paramters to overflow a page. 8030 bytes is
# exactly 5.5 TCP segments of 1460 bytes.
#SMALL_OPTS =
SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024
# redefine this if you want to add some special PATH to include/libs
ADDINC =
ADDLIB =
# redefine this if you want to add some special .o files
OPT_OBJS =
# set some defines when needed.
# Known ones are -DENABLE_POLL
# - use -DTPROXY to compile with transparent proxy support.
# - use -DUSE_GETADDRINFO to use of getaddrinfo() to resolve IPv6 host names
DEFINE = -DTPROXY
# May be changed to patch PAGE_SIZE on every platform when using dlmalloc
DLMALLOC_THRES=4096
# global options
TARGET_OPTS=$(COPTS.$(TARGET))
REGEX_OPTS=$(COPTS.$(REGEX))
CPU_OPTS=$(COPTS.$(CPU))
SPEC_OPTS=-fno-strict-aliasing
VERSION != cat VERSION 2>/dev/null || touch VERSION
SUBVERS != cat SUBVERS 2>/dev/null || touch SUBVERS
VERDATE != cat VERDATE 2>/dev/null || touch VERDATE
VER_OPTS := -DCONFIG_HAPROXY_VERSION=\"$(VERSION)$(SUBVERS)\" \
-DCONFIG_HAPROXY_DATE=\"$(VERDATE)\"
# 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) \
$(SPEC_OPTS) $(REGEX_OPTS) $(SMALL_OPTS) $(VER_OPTS) $(DEFINE)
LIBS = $(LIBS.$(TARGET)) $(LIBS.$(REGEX)) $(ADDLIB)
CFLAGS = -Wall $(COPTS) $(DEBUG)
LDFLAGS = -g
OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocol.o \
src/uri_auth.o src/standard.o src/buffer.o src/log.o src/task.o \
src/chunk.o src/channel.o src/listener.o \
src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \
src/checks.o src/queue.o src/frontend.o src/proxy.o src/proto_uxst.o \
src/proto_http.o src/raw_sock.o src/appsession.o src/backend.o \
src/peers.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/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \
src/ev_poll.o src/ev_kqueue.o src/connection.o \
src/arg.o src/acl.o src/memory.o src/freq_ctr.o src/payload.o \
src/auth.o src/stick_table.o src/sample.o src/compression.o \
src/hash.o src/pattern.o src/map.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) $(EBTREE_OBJS)
$(LD) $(LDFLAGS) -o $@ $> $(LIBS)
.SUFFIXES: .c.o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $>
src/haproxy.o: src/haproxy.c
$(CC) $(CFLAGS) -DBUILD_TARGET='"$(TARGET)"' -DBUILD_CC='"$(CC)"' \
-DBUILD_CPU='"$(CPU)"' -DBUILD_REGEX='"$(REGEX)"' \
-DBUILD_OPTS='"$(COPTS)"' -c -o $@ $>
src/dlmalloc.o: $(DLMALLOC_SRC)
$(CC) $(CFLAGS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $>
clean:
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:
@echo "VERSION: $(VERSION)"
@echo "SUBVERS: $(SUBVERS)"
@echo "VERDATE: $(VERDATE)"

View File

@ -1,150 +0,0 @@
# This makefile is dedicated to darwin (and possibly other BSDs)
# You should use it this way :
# make TARGET=os CPU=cpu
#
# Some optional components may be added, such as DLMALLOC :
#
# make DLMALLOC_SRC=/usr/local/src/dlmalloc.c \
# OPT_OBJS=src/dlmalloc.o
# Select target OS. TARGET must match a system for which COPTS and LIBS are
# correctly defined below.
TARGET = generic
# pass CPU=<cpu_name> to make to optimize for a particular CPU
CPU = generic
#CPU = native
#CPU = i586
#CPU = i686
#CPU = ultrasparc
# By default, we use libc's regex. WARNING! On Solaris 8/Sparc, group
# references seem broken using libc ! Use pcre instead.
REGEX=libc
#REGEX=pcre
#REGEX=static-pcre
# tools options
CC = gcc
LD = gcc
# This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre
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 =
# CPU dependant optimizations
COPTS.generic = -O2
COPTS.native = -O2 -march=native
COPTS.i586 = -O2 -march=i586
COPTS.i686 = -O2 -march=i686
COPTS.ultrasparc = -O6 -mcpu=v9 -mtune=ultrasparc
# options for standard regex library
COPTS.libc=
LIBS.libc=
# options for libpcre
COPTS.pcre=-DUSE_PCRE -I$(PCREDIR)/include
LIBS.pcre=-L$(PCREDIR)/lib -lpcreposix -lpcre
# options for static libpcre
COPTS.static-pcre=-DUSE_PCRE -I$(PCREDIR)/include
LIBS.static-pcre=-L$(PCREDIR)/lib -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynamic
# you can enable debug arguments with "DEBUG=-g" or disable them with "DEBUG="
#DEBUG = -g -DDEBUG_MEMORY -DDEBUG_FULL
DEBUG = -g
# if small memory footprint is required, you can reduce the buffer size. There
# are 2 buffers per concurrent session, so 16 kB buffers will eat 32 MB memory
# with 1000 concurrent sessions. Putting it slightly lower than a page size
# will avoid the additionnal paramters to overflow a page. 8030 bytes is
# exactly 5.5 TCP segments of 1460 bytes.
#SMALL_OPTS =
SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024
# redefine this if you want to add some special PATH to include/libs
ADDINC =
ADDLIB =
# set some defines when needed.
# Known ones are -DENABLE_POLL
# - use -DTPROXY to compile with transparent proxy support.
# - use -DUSE_GETADDRINFO to use of getaddrinfo() to resolve IPv6 host names
DEFINE = -DTPROXY
# May be changed to patch PAGE_SIZE on every platform when using dlmalloc
DLMALLOC_THRES=4096
# global options
TARGET_OPTS=$(COPTS.$(TARGET))
REGEX_OPTS=$(COPTS.$(REGEX))
CPU_OPTS=$(COPTS.$(CPU))
SPEC_OPTS=-fno-strict-aliasing
VERSION != cat VERSION 2>/dev/null || touch VERSION
SUBVERS != cat SUBVERS 2>/dev/null || touch SUBVERS
VERDATE != cat VERDATE 2>/dev/null || touch VERDATE
VER_OPTS := -DCONFIG_HAPROXY_VERSION=\"$(VERSION)$(SUBVERS)\" \
-DCONFIG_HAPROXY_DATE=\"$(VERDATE)\"
COPTS = -Iinclude -I$(EBTREE_DIR) $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) \
$(SPEC_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
OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocol.o \
src/uri_auth.o src/standard.o src/buffer.o src/log.o src/task.o \
src/chunk.o src/channel.o src/listener.o \
src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \
src/checks.o src/queue.o src/frontend.o src/proxy.o src/proto_uxst.o \
src/proto_http.o src/raw_sock.o src/appsession.o src/backend.o \
src/peers.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/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \
src/ev_poll.o src/connection.o src/payload.o \
src/arg.o src/acl.o src/memory.o src/freq_ctr.o \
src/auth.o src/stick_table.o src/sample.o src/compression.o \
src/hash.o src/pattern.o src/map.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) $(EBTREE_OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(EBTREE_OBJS) -o $@
.SUFFIXES: .c.o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
src/haproxy.o: src/haproxy.c
$(CC) $(CFLAGS) -DBUILD_TARGET='"$(TARGET)"' -DBUILD_CC='"$(CC)"' \
-DBUILD_CPU='"$(CPU)"' -DBUILD_REGEX='"$(REGEX)"' \
-DBUILD_OPTS='"$(COPTS)"' -c -o $@ $<
src/dlmalloc.o: $(DLMALLOC_SRC)
$(CC) $(CFLAGS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $<
clean:
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:
@echo "VERSION: $(VERSION)"
@echo "SUBVERS: $(SUBVERS)"
@echo "VERDATE: $(VERDATE)"

25
README
View File

@ -11,7 +11,8 @@
To build haproxy, you will need :
- GNU make. Neither Solaris nor OpenBSD's make work with the GNU Makefile.
However, specific Makefiles for BSD and OSX are provided.
If you get many syntax errors when running "make", you may want to retry
with "gmake" which is the name commonly used for GNU make on BSD systems.
- GCC between 2.91 and 4.7. Others may work, but not tested.
- GNU ld
@ -85,11 +86,11 @@ it. This is the recommended option for most Linux distro packagers since it's
working fine on all recent mainstream distros. It is automatically enabled on
Solaris 8 and above, as it's known to work.
It is possible to add native support for SSL using the GNU makefile only, and
by passing "USE_OPENSSL=1" on the make commande line. The libssl and libcrypto
will automatically be linked with haproxy. Some systems also require libz, so
if the build fails due to missing symbols such as deflateInit(), then try again
with "ADDLIB=-lz".
It is possible to add native support for SSL using the GNU makefile, by passing
"USE_OPENSSL=1" on the make command line. The libssl and libcrypto will
automatically be linked with haproxy. Some systems also require libz, so if the
build fails due to missing symbols such as deflateInit(), then try again with
"ADDLIB=-lz".
To link OpenSSL statically against haproxy, build OpenSSL with the no-shared
keyword and install it to a local directory, so your system is not affected :
@ -100,6 +101,7 @@ keyword and install it to a local directory, so your system is not affected :
When building haproxy, pass that path via SSL_INC and SSL_LIB to make and
include additional libs with ADDLIB if needed (in this case for example libdl):
$ make TARGET=linux26 USE_OPENSSL=1 SSL_INC=$STATICLIBSSL/include SSL_LIB=$STATICLIBSSL/lib ADDLIB=-ldl
It is also possible to include native support for ZLIB to benefit from HTTP
@ -117,7 +119,7 @@ For example, I use this to build for Solaris 8 :
And I build it this way on OpenBSD or FreeBSD :
$ make -f Makefile.bsd REGEX=pcre DEBUG= COPTS.generic="-Os -fomit-frame-pointer -mgnu"
$ gmake TARGET=freebsd USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1
And on a classic Linux with SSL and ZLIB support (eg: Red Hat 5.x) :
@ -169,16 +171,9 @@ If none of these mechanisms is supported by your platform, you may need to
build with USE_PRIVATE_CACHE=1 to totally disable SSL cache sharing. Then
it is better not to run SSL on multiple processes.
The BSD and OSX makefiles do not support build options for OpenSSL nor zlib.
If you want to enable these options, you need to use GNU make with the default
makefile as follows :
$ gmake TARGET=openbsd USE_OPENSSL=1 USE_ZLIB=1 USE_PRIVATE_CACHE=1
If you need to pass other defines, includes, libraries, etc... then please
check the Makefile to see which ones will be available in your case, and
use the USE_* variables in the GNU Makefile, or ADDINC, ADDLIB, and DEFINE
variables in the BSD makefiles.
use the USE_* variables in the Makefile.
AIX 5.3 is known to work with the generic target. However, for the binary to
also run on 5.2 or earlier, you need to build with DEFINE="-D_MSGQSUPPORT",