2008-01-02 22:48:34 +03:00
# This GNU Makefile supports different OS and CPU combinations.
#
2005-12-17 16:08:03 +03:00
# You should use it this way :
2009-04-11 21:45:50 +04:00
# [g]make TARGET=os ARCH=arch CPU=cpu USE_xxx=1 ...
2007-07-11 11:19:31 +04:00
#
2008-01-02 22:48:34 +03:00
# Valid USE_* options are the following. Most of them are automatically set by
# the TARGET, others have to be explictly specified :
# USE_CTTPROXY : enable CTTPROXY on Linux (needs kernel patch).
2008-02-19 12:53:32 +03:00
# USE_DLMALLOC : enable use of dlmalloc (see DLMALLOC_SRC)
2008-01-02 22:48:34 +03:00
# USE_EPOLL : enable epoll() on Linux 2.6. Automatic.
# USE_GETSOCKNAME : enable getsockname() on Linux 2.2. Automatic.
# USE_KQUEUE : enable kqueue() on BSD. Automatic.
# USE_MY_EPOLL : redefine epoll_* syscalls. Automatic.
2011-08-22 19:12:02 +04:00
# USE_MY_SPLICE : redefine the splice syscall if build fails without.
2008-01-02 22:48:34 +03:00
# USE_NETFILTER : enable netfilter on Linux. Automatic.
# USE_PCRE : enable use of libpcre for regex. Recommended.
2013-04-05 01:05:32 +04:00
# USE_PCRE_JIT : enable JIT for faster regex on libpcre >= 8.32
2008-01-02 22:48:34 +03:00
# USE_POLL : enable poll(). Automatic.
2012-09-25 13:11:16 +04:00
# USE_PRIVATE_CACHE : disable shared memory cache of ssl sessions.
2008-01-02 22:48:34 +03:00
# USE_REGPARM : enable regparm optimization. Recommended on x86.
# USE_STATIC_PCRE : enable static libpcre. Recommended.
# USE_TPROXY : enable transparent proxy. Automatic.
2012-06-04 02:42:09 +04:00
# USE_LINUX_TPROXY : enable full transparent proxy. Automatic.
# USE_LINUX_SPLICE : enable kernel 2.6 splicing. Automatic.
[BUILD] fix platform-dependant build issues related to crypt()
Holger Just and Ross West reported build issues on FreeBSD and
Solaris that were initially caused by the definition of
_XOPEN_SOURCE at the top of auth.c, which was required on Linux
to avoid a build warning.
Krzysztof Oledzki found that using _GNU_SOURCE instead also worked
on Linux and did not cause any issue on several versions of FreeBSD.
Solaris still reported a warning this time, which was fixed by
including <crypt.h>, which itself is not present on FreeBSD nor on
all Linux toolchains.
So by adding a new build option (NEED_CRYPT_H), we can get Solaris
to get crypt() working and stop complaining at the same time, without
impacting other platforms.
This fix was tested at least on several linux toolchains (at least
uclibc, glibc 2.2.5, 2.3.6 and 2.7), on FreeBSD 4 to 8, Solaris 8
(which needs crypt.h), and AIX 5.3 (without crypt.h).
Every time it builds without a warning.
2010-03-04 21:10:14 +03:00
# USE_LIBCRYPT : enable crypted passwords using -lcrypt
# USE_CRYPT_H : set it if your system requires including crypt.h
2010-11-14 19:09:33 +03:00
# USE_VSYSCALL : enable vsyscall on Linux x86, bypassing libc
2011-03-23 22:00:53 +03:00
# USE_GETADDRINFO : use getaddrinfo() to resolve IPv6 host names.
2012-05-18 17:48:30 +04:00
# USE_OPENSSL : enable use of OpenSSL. Recommended, but see below.
2012-09-03 13:14:36 +04:00
# USE_FUTEX : enable use of futex on kernel 2.6. Automatic.
2012-10-08 22:11:03 +04:00
# USE_ACCEPT4 : enable use of accept4() on linux. Automatic.
# USE_MY_ACCEPT4 : use own implemention of accept4() if glibc < 2.10.
MEDIUM: HTTP compression (zlib library support)
This commit introduces HTTP compression using the zlib library.
http_response_forward_body has been modified to call the compression
functions.
This feature includes 3 algorithms: identity, gzip and deflate:
* identity: this is mostly for debugging, and it was useful for
developping the compression feature. With Content-Length in input, it
is making each chunk with the data available in the current buffer.
With chunks in input, it is rechunking, the output chunks will be
bigger or smaller depending of the size of the input chunk and the
size of the buffer. Identity does not apply any change on data.
* gzip: same as identity, but applying a gzip compression. The data
are deflated using the Z_NO_FLUSH flag in zlib. When there is no more
data in the input buffer, it flushes the data in the output buffer
(Z_SYNC_FLUSH). At the end of data, when it receives the last chunk in
input, or when there is no more data to read, it writes the end of
data with Z_FINISH and the ending chunk.
* deflate: same as gzip, but with deflate algorithm and zlib format.
Note that this algorithm has ambiguous support on many browsers and
no support at all from recent ones. It is strongly recommended not
to use it for anything else than experimentation.
You can't choose the compression ratio at the moment, it will be set to
Z_BEST_SPEED (1), as tests have shown very little benefit in terms of
compression ration when going above for HTML contents, at the cost of
a massive CPU impact.
Compression will be activated depending of the Accept-Encoding request
header. With identity, it does not take care of that header.
To build HAProxy with zlib support, use USE_ZLIB=1 in the make
parameters.
This work was initially started by David Du Colombier at Exceliance.
2012-10-23 12:25:10 +04:00
# USE_ZLIB : enable zlib library support.
2012-11-16 19:12:27 +04:00
# USE_CPU_AFFINITY : enable pinning processes to CPU on Linux. Automatic.
2013-04-02 18:43:24 +04:00
# USE_TFO : enable TCP fast open. Supported on Linux >= 3.7.
2007-07-11 11:19:31 +04:00
#
2008-01-02 22:48:34 +03:00
# Options can be forced by specifying "USE_xxx=1" or can be disabled by using
# "USE_xxx=" (empty string).
#
# Variables useful for packagers :
# CC is set to "gcc" by default and is used for compilation only.
# LD is set to "gcc" by default and is used for linking only.
2009-04-11 21:45:50 +04:00
# ARCH may be useful to force build of 32-bit binary on 64-bit systems
2008-01-02 22:48:34 +03:00
# CFLAGS is automatically set for the specified CPU and may be overridden.
# LDFLAGS is automatically set to -g and may be overridden.
# SMALL_OPTS may be used to specify some options to shrink memory usage.
# DEBUG may be used to set some internal debugging options.
# ADDINC may be used to complete the include path in the form -Ipath.
# ADDLIB may be used to complete the library list in the form -Lpath -llib.
# DEFINE may be used to specify any additional define, which will be reported
# by "haproxy -vv" in CFLAGS.
# SILENT_DEFINE may be used to specify other defines which will not be
# reported by "haproxy -vv".
2008-03-12 16:25:35 +03:00
# DESTDIR is not set by default and is used for installation only.
# It might be useful to set DESTDIR if you want to install haproxy
# in a sandbox.
# PREFIX is set to "/usr/local" by default and is used for installation only.
# SBINDIR is set to "$(PREFIX)/sbin" by default and is used for installation
# only.
2008-03-12 16:57:54 +03:00
# MANDIR is set to "$(PREFIX)/share/man" by default and is used for
# installation only.
2008-03-12 18:24:49 +03:00
# DOCDIR is set to "$(PREFIX)/doc/haproxy" by default and is used for
# installation only.
2008-01-02 22:48:34 +03:00
#
# Other variables :
# DLMALLOC_SRC : build with dlmalloc, indicate the location of dlmalloc.c.
# DLMALLOC_THRES : should match PAGE_SIZE on every platform (default: 4096).
# PCREDIR : force the path to libpcre.
2013-02-13 15:39:06 +04:00
# PCRE_LIB : force the lib path to libpcre (defaults to $PCREDIR/lib).
# PCRE_INC : force the include path to libpcre ($PCREDIR/inc)
2013-09-17 17:26:39 +04:00
# SSL_LIB : force the lib path to libssl/libcrypto
# SSL_INC : force the include path to libssl/libcrypto
2008-01-02 22:48:34 +03:00
# IGNOREGIT : ignore GIT commit versions if set.
# VERSION : force haproxy version reporting.
# SUBVERS : add a sub-version (eg: platform, model, ...).
# VERDATE : force haproxy's release date.
2008-03-12 16:25:35 +03:00
#### Installation options.
DESTDIR =
PREFIX = /usr/local
SBINDIR = $( PREFIX) /sbin
2008-11-16 03:29:03 +03:00
MANDIR = $( PREFIX) /share/man
2008-03-12 18:24:49 +03:00
DOCDIR = $( PREFIX) /doc/haproxy
2008-01-02 22:48:34 +03:00
#### TARGET system
# Use TARGET=<target_name> to optimize for a specifc target OS among the
# following list (use the default "generic" if uncertain) :
2009-03-29 17:08:25 +04:00
# generic, linux22, linux24, linux24e, linux26, solaris,
2012-06-06 18:15:03 +04:00
# freebsd, openbsd, cygwin, custom, aix52
2008-03-11 08:37:39 +03:00
TARGET =
2008-01-02 22:48:34 +03:00
#### TARGET CPU
# Use CPU=<cpu_name> to optimize for a particular CPU, among the following
# list :
2010-11-28 09:41:00 +03:00
# generic, native, i586, i686, ultrasparc, custom
2005-12-17 16:08:03 +03:00
CPU = generic
2005-12-17 14:21:26 +03:00
2009-04-11 21:45:50 +04:00
#### Architecture, used when not building for native architecture
# Use ARCH=<arch_name> to force build for a specific architecture. Known
# architectures will lead to "-m32" or "-m64" being added to CFLAGS and
# LDFLAGS. This can be required to build 32-bit binaries on 64-bit targets.
2010-11-28 09:41:00 +03:00
# Currently, only 32, 64, x86_64, i386, i486, i586 and i686 are understood.
2009-04-11 21:45:50 +04:00
ARCH =
2008-01-02 22:48:34 +03:00
#### Toolchain options.
# GCC is normally used both for compiling and linking.
2005-12-17 16:08:03 +03:00
CC = gcc
2008-03-17 20:23:12 +03:00
LD = $( CC)
2005-12-17 16:08:03 +03:00
2008-01-02 22:48:34 +03:00
#### Debug flags (typically "-g").
# Those flags only feed CFLAGS so it is not mandatory to use this form.
DEBUG_CFLAGS = -g
2005-12-17 14:48:26 +03:00
2010-11-28 10:28:15 +03:00
#### Compiler-specific flags that may be used to disable some negative over-
# optimization or to silence some warnings. -fno-strict-aliasing is needed with
# gcc >= 4.4.
SPEC_CFLAGS = -fno-strict-aliasing
2008-01-02 22:48:34 +03:00
#### Memory usage tuning
# 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 prevent the additional parameters to go beyond a page. 8030 bytes is
# exactly 5.5 TCP segments of 1460 bytes and is generally good. Useful tuning
# macros include :
# SYSTEM_MAXCONN, BUFSIZE, MAXREWRITE, REQURI_LEN, CAPTURE_LEN.
# Example: SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024
SMALL_OPTS =
2005-12-17 14:21:26 +03:00
2008-01-02 22:48:34 +03:00
#### Debug settings
# You can enable debugging on specific code parts by setting DEBUG=-DDEBUG_xxx.
# Currently defined DEBUG macros include DEBUG_FULL, DEBUG_MEMORY, DEBUG_FSM,
2010-01-29 19:50:44 +03:00
# DEBUG_HASH and DEBUG_AUTH. Please check sources for exact meaning or do not
# use at all.
2008-01-02 22:48:34 +03:00
DEBUG =
2005-12-17 16:08:03 +03:00
2012-05-26 01:53:16 +04:00
#### Trace options
# Use TRACE=1 to trace function calls to file "trace.out" or to stderr if not
# possible.
TRACE =
2008-01-02 22:48:34 +03:00
#### Additional include and library dirs
# Redefine this if you want to add some special PATH to include/libs
ADDINC =
ADDLIB =
2005-12-17 15:46:33 +03:00
2008-01-02 22:48:34 +03:00
#### Specific macro definitions
# Use DEFINE=-Dxxx to set any tunable macro. Anything declared here will appear
# in the build options reported by "haproxy -vv". Use SILENT_DEFINE if you do
# not want to pollute the report with complex defines.
2012-10-05 17:47:31 +04:00
# The following settings might be of interest when SSL is enabled :
# LISTEN_DEFAULT_CIPHERS is a cipher suite string used to set the default SSL
# ciphers on "bind" lines instead of using OpenSSL's defaults.
# CONNECT_DEFAULT_CIPHERS is a cipher suite string used to set the default
# SSL ciphers on "server" lines instead of using OpenSSL's defaults.
2008-01-02 22:48:34 +03:00
DEFINE =
SILENT_DEFINE =
#### CPU dependant optimizations
# Some CFLAGS are set by default depending on the target CPU. Those flags only
# feed CPU_CFLAGS, which in turn feed CFLAGS, so it is not mandatory to use
# them. You should not have to change these options. Better use CPU_CFLAGS or
# even CFLAGS instead.
CPU_CFLAGS.generic = -O2
2010-11-28 09:41:00 +03:00
CPU_CFLAGS.native = -O2 -march= native
2008-01-02 22:48:34 +03:00
CPU_CFLAGS.i586 = -O2 -march= i586
CPU_CFLAGS.i686 = -O2 -march= i686
CPU_CFLAGS.ultrasparc = -O6 -mcpu= v9 -mtune= ultrasparc
CPU_CFLAGS = $( CPU_CFLAGS.$( CPU) )
2009-04-11 21:45:50 +04:00
#### ARCH dependant flags, may be overriden by CPU flags
2010-11-28 09:41:00 +03:00
ARCH_FLAGS.32 = -m32
ARCH_FLAGS.64 = -m64
2009-04-11 21:45:50 +04:00
ARCH_FLAGS.i386 = -m32 -march= i386
ARCH_FLAGS.i486 = -m32 -march= i486
ARCH_FLAGS.i586 = -m32 -march= i586
ARCH_FLAGS.i686 = -m32 -march= i686
ARCH_FLAGS.x86_64 = -m64 -march= x86-64
ARCH_FLAGS = $( ARCH_FLAGS.$( ARCH) )
2008-01-02 22:48:34 +03:00
#### Common CFLAGS
# These CFLAGS contain general optimization options, CPU-specific optimizations
# and debug flags. They may be overridden by some distributions which prefer to
# set all of them at once instead of playing with the CPU and DEBUG variables.
2010-11-28 10:28:15 +03:00
CFLAGS = $( ARCH_FLAGS) $( CPU_CFLAGS) $( DEBUG_CFLAGS) $( SPEC_CFLAGS)
2008-01-02 22:48:34 +03:00
#### Common LDFLAGS
# These LDFLAGS are used as the first "ld" options, regardless of any library
# path or any other option. They may be changed to add any linker-specific
# option at the beginning of the ld command line.
2009-04-11 21:45:50 +04:00
LDFLAGS = $( ARCH_FLAGS) -g
2005-12-17 15:46:33 +03:00
2008-01-02 22:48:34 +03:00
#### Target system options
# Depending on the target platform, some options are set, as well as some
# CFLAGS and LDFLAGS. The USE_* values are set to "implicit" so that they are
# not reported in the build options string. You should not have to change
2013-04-02 10:14:29 +04:00
# anything there. poll() is always supported, unless explicitly disabled by
# passing USE_POLL="" on the make command line.
USE_POLL = default
2008-01-02 22:48:34 +03:00
i f e q ( $( TARGET ) , g e n e r i c )
# generic system target has nothing specific
USE_POLL = implicit
USE_TPROXY = implicit
e l s e
i f e q ( $( TARGET ) , l i n u x 2 2 )
# This is for Linux 2.2
USE_GETSOCKNAME = implicit
USE_POLL = implicit
USE_TPROXY = implicit
2010-01-29 19:50:44 +03:00
USE_LIBCRYPT = implicit
2008-01-02 22:48:34 +03:00
e l s e
i f e q ( $( TARGET ) , l i n u x 2 4 )
# This is for standard Linux 2.4 with netfilter but without epoll()
USE_GETSOCKNAME = implicit
USE_NETFILTER = implicit
USE_POLL = implicit
USE_TPROXY = implicit
2010-01-29 19:50:44 +03:00
USE_LIBCRYPT = implicit
2008-01-02 22:48:34 +03:00
e l s e
i f e q ( $( TARGET ) , l i n u x 2 4 e )
# This is for enhanced Linux 2.4 with netfilter and epoll() patch > 0.21
USE_GETSOCKNAME = implicit
USE_NETFILTER = implicit
USE_POLL = implicit
USE_EPOLL = implicit
USE_MY_EPOLL = implicit
USE_TPROXY = implicit
2010-01-29 19:50:44 +03:00
USE_LIBCRYPT = implicit
2008-01-02 22:48:34 +03:00
e l s e
i f e q ( $( TARGET ) , l i n u x 2 6 )
# This is for standard Linux 2.6 with netfilter and standard epoll()
USE_GETSOCKNAME = implicit
USE_NETFILTER = implicit
USE_POLL = implicit
USE_EPOLL = implicit
USE_TPROXY = implicit
2010-01-29 19:50:44 +03:00
USE_LIBCRYPT = implicit
2012-09-03 13:14:36 +04:00
USE_FUTEX = implicit
2008-01-02 22:48:34 +03:00
e l s e
2012-06-04 02:42:09 +04:00
i f e q ( $( TARGET ) , l i n u x 2 6 2 8 )
# This is for standard Linux >= 2.6.28 with netfilter, epoll, tproxy and splice
USE_GETSOCKNAME = implicit
USE_NETFILTER = implicit
USE_POLL = implicit
USE_EPOLL = implicit
USE_TPROXY = implicit
USE_LIBCRYPT = implicit
USE_LINUX_SPLICE = implicit
USE_LINUX_TPROXY = implicit
2012-10-08 22:11:03 +04:00
USE_ACCEPT4 = implicit
2012-09-03 13:14:36 +04:00
USE_FUTEX = implicit
2012-11-16 19:12:27 +04:00
USE_CPU_AFFINITY = implicit
2013-01-07 19:57:09 +04:00
ASSUME_SPLICE_WORKS = implicit
2012-06-04 02:42:09 +04:00
e l s e
2008-01-02 22:48:34 +03:00
i f e q ( $( TARGET ) , s o l a r i s )
# This is for Solaris 8
2011-03-23 22:00:53 +03:00
# We also enable getaddrinfo() which works since solaris 8.
2008-01-02 22:48:34 +03:00
USE_POLL = implicit
TARGET_CFLAGS = -fomit-frame-pointer -DFD_SETSIZE= 65536 -D_REENTRANT
TARGET_LDFLAGS = -lnsl -lsocket
USE_TPROXY = implicit
[BUILD] fix platform-dependant build issues related to crypt()
Holger Just and Ross West reported build issues on FreeBSD and
Solaris that were initially caused by the definition of
_XOPEN_SOURCE at the top of auth.c, which was required on Linux
to avoid a build warning.
Krzysztof Oledzki found that using _GNU_SOURCE instead also worked
on Linux and did not cause any issue on several versions of FreeBSD.
Solaris still reported a warning this time, which was fixed by
including <crypt.h>, which itself is not present on FreeBSD nor on
all Linux toolchains.
So by adding a new build option (NEED_CRYPT_H), we can get Solaris
to get crypt() working and stop complaining at the same time, without
impacting other platforms.
This fix was tested at least on several linux toolchains (at least
uclibc, glibc 2.2.5, 2.3.6 and 2.7), on FreeBSD 4 to 8, Solaris 8
(which needs crypt.h), and AIX 5.3 (without crypt.h).
Every time it builds without a warning.
2010-03-04 21:10:14 +03:00
USE_LIBCRYPT = implicit
USE_CRYPT_H = implicit
2011-03-23 22:00:53 +03:00
USE_GETADDRINFO = implicit
2008-01-02 22:48:34 +03:00
e l s e
i f e q ( $( TARGET ) , f r e e b s d )
# This is for FreeBSD
USE_POLL = implicit
USE_KQUEUE = implicit
USE_TPROXY = implicit
2010-01-29 19:50:44 +03:00
USE_LIBCRYPT = implicit
2008-01-02 22:48:34 +03:00
e l s e
2013-04-02 10:17:43 +04:00
i f e q ( $( TARGET ) , o s x )
# This is for Mac OS/X
USE_POLL = implicit
USE_KQUEUE = implicit
USE_TPROXY = implicit
USE_LIBCRYPT = implicit
e l s e
2008-01-02 22:48:34 +03:00
i f e q ( $( TARGET ) , o p e n b s d )
# This is for OpenBSD >= 3.0
USE_POLL = implicit
USE_KQUEUE = implicit
USE_TPROXY = implicit
2009-06-14 20:27:54 +04:00
e l s e
2012-06-06 18:15:03 +04:00
i f e q ( $( TARGET ) , a i x 5 2 )
# This is for AIX 5.2 and later
USE_POLL = implicit
USE_LIBCRYPT = implicit
TARGET_CFLAGS = -D_MSGQSUPPORT
DEBUG_CFLAGS =
e l s e
2009-06-14 20:27:54 +04:00
i f e q ( $( TARGET ) , c y g w i n )
# This is for Cygwin
# Cygwin adds IPv6 support only in version 1.7 (in beta right now).
USE_POLL = implicit
USE_TPROXY = implicit
TARGET_CFLAGS = $( if $( filter 1.5.%, $( shell uname -r) ) , -DUSE_IPV6 -DAF_INET6= 23 -DINET6_ADDRSTRLEN= 46, )
e n d i f # cygwin
2012-06-06 18:15:03 +04:00
e n d i f # aix52
2008-01-02 22:48:34 +03:00
e n d i f # openbsd
2013-04-02 10:17:43 +04:00
e n d i f # osx
2008-01-02 22:48:34 +03:00
e n d i f # freebsd
e n d i f # solaris
2012-06-04 02:42:09 +04:00
e n d i f # linux2628
2008-01-02 22:48:34 +03:00
e n d i f # linux26
e n d i f # linux24e
e n d i f # linux24
e n d i f # linux22
e n d i f # generic
#### Old-style REGEX library settings for compatibility with previous setups.
# It is still possible to use REGEX=<regex_lib> to select an alternative regex
# library. By default, we use libc's regex. On Solaris 8/Sparc, grouping seems
# to be broken using libc, so consider using pcre instead. Supported values are
# "libc", "pcre", and "static-pcre". Use of this method is deprecated in favor
# of "USE_PCRE" and "USE_STATIC_PCRE" (see build options below).
REGEX = libc
i f e q ( $( REGEX ) , p c r e )
USE_PCRE = 1
$( warning WARNING ! use of "REGEX =pcre " is deprecated , consider using "USE_PCRE =1" instead .)
e n d i f
2005-12-18 03:32:31 +03:00
2008-01-02 22:48:34 +03:00
i f e q ( $( REGEX ) , s t a t i c - p c r e )
USE_STATIC_PCRE = 1
$( warning WARNING ! use of "REGEX =pcre -static " is deprecated , consider using "USE_STATIC_PCRE =1" instead .)
e n d i f
2005-12-17 14:29:56 +03:00
2008-01-02 22:48:34 +03:00
#### Old-style TPROXY settings
i f n e q ( $( findstring -DTPROXY ,$ ( DEFINE ) ) , )
USE_TPROXY = 1
$( warning WARNING ! use of "DEFINE =-DTPROXY " is deprecated , consider using "USE_TPROXY =1" instead .)
e n d i f
2005-12-18 03:02:42 +03:00
2005-12-18 03:11:29 +03:00
2008-01-02 22:48:34 +03:00
#### Determine version, sub-version and release date.
# If GIT is found, and IGNOREGIT is not set, VERSION, SUBVERS and VERDATE are
# extracted from the last commit. Otherwise, use the contents of the files
# holding the same names in the current directory.
2005-12-18 03:02:42 +03:00
2007-01-02 02:44:53 +03:00
i f e q ( $( IGNOREGIT ) , )
2013-12-10 12:31:06 +04:00
VERSION := $( shell [ -d .git/. ] && ref = ` ( git describe --tags --match 'v*' --abbrev= 0) 2>/dev/null` && ref = $$ { ref%-g*} && echo " $$ {ref\#v} " )
2006-12-23 13:12:04 +03:00
i f n e q ( $( VERSION ) , )
# OK git is there and works.
2013-12-10 12:31:06 +04:00
SUBVERS := $( shell comms = ` git log --format= oneline --no-merges v$( VERSION) .. 2>/dev/null | wc -l` ; [ $$ comms -gt 0 ] && echo " - $$ comms " )
VERDATE := $( shell git log -1 --pretty= format:%ci | cut -f1 -d' ' | tr '-' '/' )
2007-09-10 01:31:11 +04:00
e n d i f
e n d i f
2008-01-02 22:48:34 +03:00
# Last commit version not found, take it from the files.
2007-09-10 01:31:11 +04:00
i f e q ( $( VERSION ) , )
VERSION := $( shell cat VERSION 2>/dev/null || touch VERSION)
e n d i f
i f e q ( $( SUBVERS ) , )
2013-12-16 04:34:39 +04:00
SUBVERS := $( shell ( grep -v '\$$Format' SUBVERS 2>/dev/null || touch SUBVERS) | head -n 1)
2007-09-10 01:31:11 +04:00
e n d i f
i f e q ( $( VERDATE ) , )
2014-01-26 03:39:22 +04:00
VERDATE := $( shell ( grep -v '^\$$Format' VERDATE 2>/dev/null || touch VERDATE) | head -n 1 | cut -f1 -d' ' | tr '-' '/' )
2006-12-23 13:12:04 +03:00
e n d i f
2006-11-13 01:57:19 +03:00
2008-01-02 22:48:34 +03:00
#### Build options
# Do not change these ones, enable USE_* variables instead.
OPTIONS_CFLAGS =
OPTIONS_LDFLAGS =
OPTIONS_OBJS =
# This variable collects all USE_* values except those set to "implicit". This
# is used to report a list of all flags which were used to build this version.
# Do not assign anything to it.
BUILD_OPTIONS =
2006-11-13 01:57:19 +03:00
2008-01-02 22:48:34 +03:00
# Return USE_xxx=$(USE_xxx) unless $(USE_xxx) = "implicit"
# Usage:
# BUILD_OPTIONS += $(call ignore_implicit,USE_xxx)
ignore_implicit = $( patsubst %= implicit,,$( 1) = $( $( 1) ) )
2006-11-13 01:57:19 +03:00
2007-01-07 04:03:04 +03:00
i f n e q ( $( USE_TCPSPLICE ) , )
2009-08-16 15:20:32 +04:00
$( error experimental option USE_TCPSPLICE has been removed , check USE_LINUX_SPLICE )
2007-01-07 04:03:04 +03:00
e n d i f
2009-01-25 18:13:42 +03:00
i f n e q ( $( USE_LINUX_SPLICE ) , )
OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_SPLICE
BUILD_OPTIONS += $( call ignore_implicit,USE_LINUX_SPLICE)
e n d i f
2006-11-13 01:57:19 +03:00
i f n e q ( $( USE_CTTPROXY ) , )
2008-01-02 22:48:34 +03:00
OPTIONS_CFLAGS += -DCONFIG_HAP_CTTPROXY
OPTIONS_OBJS += src/cttproxy.o
BUILD_OPTIONS += $( call ignore_implicit,USE_CTTPROXY)
2006-11-13 01:57:19 +03:00
e n d i f
i f n e q ( $( USE_TPROXY ) , )
2008-01-02 22:48:34 +03:00
OPTIONS_CFLAGS += -DTPROXY
BUILD_OPTIONS += $( call ignore_implicit,USE_TPROXY)
2006-11-13 01:57:19 +03:00
e n d i f
2008-01-13 16:49:51 +03:00
i f n e q ( $( USE_LINUX_TPROXY ) , )
OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_TPROXY
BUILD_OPTIONS += $( call ignore_implicit,USE_LINUX_TPROXY)
e n d i f
2010-01-29 19:50:44 +03:00
i f n e q ( $( USE_LIBCRYPT ) , )
OPTIONS_CFLAGS += -DCONFIG_HAP_CRYPT
BUILD_OPTIONS += $( call ignore_implicit,USE_LIBCRYPT)
OPTIONS_LDFLAGS += -lcrypt
e n d i f
[BUILD] fix platform-dependant build issues related to crypt()
Holger Just and Ross West reported build issues on FreeBSD and
Solaris that were initially caused by the definition of
_XOPEN_SOURCE at the top of auth.c, which was required on Linux
to avoid a build warning.
Krzysztof Oledzki found that using _GNU_SOURCE instead also worked
on Linux and did not cause any issue on several versions of FreeBSD.
Solaris still reported a warning this time, which was fixed by
including <crypt.h>, which itself is not present on FreeBSD nor on
all Linux toolchains.
So by adding a new build option (NEED_CRYPT_H), we can get Solaris
to get crypt() working and stop complaining at the same time, without
impacting other platforms.
This fix was tested at least on several linux toolchains (at least
uclibc, glibc 2.2.5, 2.3.6 and 2.7), on FreeBSD 4 to 8, Solaris 8
(which needs crypt.h), and AIX 5.3 (without crypt.h).
Every time it builds without a warning.
2010-03-04 21:10:14 +03:00
i f n e q ( $( USE_CRYPT_H ) , )
OPTIONS_CFLAGS += -DNEED_CRYPT_H
BUILD_OPTIONS += $( call ignore_implicit,USE_CRYPT_H)
e n d i f
2011-03-23 22:00:53 +03:00
i f n e q ( $( USE_GETADDRINFO ) , )
OPTIONS_CFLAGS += -DUSE_GETADDRINFO
BUILD_OPTIONS += $( call ignore_implicit,USE_GETADDRINFO)
e n d i f
MEDIUM: HTTP compression (zlib library support)
This commit introduces HTTP compression using the zlib library.
http_response_forward_body has been modified to call the compression
functions.
This feature includes 3 algorithms: identity, gzip and deflate:
* identity: this is mostly for debugging, and it was useful for
developping the compression feature. With Content-Length in input, it
is making each chunk with the data available in the current buffer.
With chunks in input, it is rechunking, the output chunks will be
bigger or smaller depending of the size of the input chunk and the
size of the buffer. Identity does not apply any change on data.
* gzip: same as identity, but applying a gzip compression. The data
are deflated using the Z_NO_FLUSH flag in zlib. When there is no more
data in the input buffer, it flushes the data in the output buffer
(Z_SYNC_FLUSH). At the end of data, when it receives the last chunk in
input, or when there is no more data to read, it writes the end of
data with Z_FINISH and the ending chunk.
* deflate: same as gzip, but with deflate algorithm and zlib format.
Note that this algorithm has ambiguous support on many browsers and
no support at all from recent ones. It is strongly recommended not
to use it for anything else than experimentation.
You can't choose the compression ratio at the moment, it will be set to
Z_BEST_SPEED (1), as tests have shown very little benefit in terms of
compression ration when going above for HTML contents, at the cost of
a massive CPU impact.
Compression will be activated depending of the Accept-Encoding request
header. With identity, it does not take care of that header.
To build HAProxy with zlib support, use USE_ZLIB=1 in the make
parameters.
This work was initially started by David Du Colombier at Exceliance.
2012-10-23 12:25:10 +04:00
i f n e q ( $( USE_ZLIB ) , )
2012-02-10 23:37:26 +04:00
# Use ZLIB_INC and ZLIB_LIB to force path to zlib.h and libz.{a,so} if needed.
ZLIB_INC =
ZLIB_LIB =
OPTIONS_CFLAGS += -DUSE_ZLIB $( if $( ZLIB_INC) ,-I$( ZLIB_INC) )
MEDIUM: HTTP compression (zlib library support)
This commit introduces HTTP compression using the zlib library.
http_response_forward_body has been modified to call the compression
functions.
This feature includes 3 algorithms: identity, gzip and deflate:
* identity: this is mostly for debugging, and it was useful for
developping the compression feature. With Content-Length in input, it
is making each chunk with the data available in the current buffer.
With chunks in input, it is rechunking, the output chunks will be
bigger or smaller depending of the size of the input chunk and the
size of the buffer. Identity does not apply any change on data.
* gzip: same as identity, but applying a gzip compression. The data
are deflated using the Z_NO_FLUSH flag in zlib. When there is no more
data in the input buffer, it flushes the data in the output buffer
(Z_SYNC_FLUSH). At the end of data, when it receives the last chunk in
input, or when there is no more data to read, it writes the end of
data with Z_FINISH and the ending chunk.
* deflate: same as gzip, but with deflate algorithm and zlib format.
Note that this algorithm has ambiguous support on many browsers and
no support at all from recent ones. It is strongly recommended not
to use it for anything else than experimentation.
You can't choose the compression ratio at the moment, it will be set to
Z_BEST_SPEED (1), as tests have shown very little benefit in terms of
compression ration when going above for HTML contents, at the cost of
a massive CPU impact.
Compression will be activated depending of the Accept-Encoding request
header. With identity, it does not take care of that header.
To build HAProxy with zlib support, use USE_ZLIB=1 in the make
parameters.
This work was initially started by David Du Colombier at Exceliance.
2012-10-23 12:25:10 +04:00
BUILD_OPTIONS += $( call ignore_implicit,USE_ZLIB)
2012-02-10 23:37:26 +04:00
OPTIONS_LDFLAGS += $( if $( ZLIB_LIB) ,-L$( ZLIB_LIB) ) -lz
MEDIUM: HTTP compression (zlib library support)
This commit introduces HTTP compression using the zlib library.
http_response_forward_body has been modified to call the compression
functions.
This feature includes 3 algorithms: identity, gzip and deflate:
* identity: this is mostly for debugging, and it was useful for
developping the compression feature. With Content-Length in input, it
is making each chunk with the data available in the current buffer.
With chunks in input, it is rechunking, the output chunks will be
bigger or smaller depending of the size of the input chunk and the
size of the buffer. Identity does not apply any change on data.
* gzip: same as identity, but applying a gzip compression. The data
are deflated using the Z_NO_FLUSH flag in zlib. When there is no more
data in the input buffer, it flushes the data in the output buffer
(Z_SYNC_FLUSH). At the end of data, when it receives the last chunk in
input, or when there is no more data to read, it writes the end of
data with Z_FINISH and the ending chunk.
* deflate: same as gzip, but with deflate algorithm and zlib format.
Note that this algorithm has ambiguous support on many browsers and
no support at all from recent ones. It is strongly recommended not
to use it for anything else than experimentation.
You can't choose the compression ratio at the moment, it will be set to
Z_BEST_SPEED (1), as tests have shown very little benefit in terms of
compression ration when going above for HTML contents, at the cost of
a massive CPU impact.
Compression will be activated depending of the Accept-Encoding request
header. With identity, it does not take care of that header.
To build HAProxy with zlib support, use USE_ZLIB=1 in the make
parameters.
This work was initially started by David Du Colombier at Exceliance.
2012-10-23 12:25:10 +04:00
e n d i f
2006-11-13 01:57:19 +03:00
i f n e q ( $( USE_POLL ) , )
2008-01-02 22:48:34 +03:00
OPTIONS_CFLAGS += -DENABLE_POLL
OPTIONS_OBJS += src/ev_poll.o
BUILD_OPTIONS += $( call ignore_implicit,USE_POLL)
2006-11-13 01:57:19 +03:00
e n d i f
i f n e q ( $( USE_EPOLL ) , )
2008-01-02 22:48:34 +03:00
OPTIONS_CFLAGS += -DENABLE_EPOLL
OPTIONS_OBJS += src/ev_epoll.o
BUILD_OPTIONS += $( call ignore_implicit,USE_EPOLL)
2006-11-13 01:57:19 +03:00
e n d i f
i f n e q ( $( USE_MY_EPOLL ) , )
2008-01-02 22:48:34 +03:00
OPTIONS_CFLAGS += -DUSE_MY_EPOLL
BUILD_OPTIONS += $( call ignore_implicit,USE_MY_EPOLL)
e n d i f
i f n e q ( $( USE_KQUEUE ) , )
OPTIONS_CFLAGS += -DENABLE_KQUEUE
OPTIONS_OBJS += src/ev_kqueue.o
BUILD_OPTIONS += $( call ignore_implicit,USE_KQUEUE)
2006-11-13 01:57:19 +03:00
e n d i f
2010-11-14 19:09:33 +03:00
i f n e q ( $( USE_VSYSCALL ) , )
OPTIONS_OBJS += src/i386-linux-vsys.o
OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_VSYSCALL
BUILD_OPTIONS += $( call ignore_implicit,USE_VSYSCALL)
e n d i f
2012-11-16 19:12:27 +04:00
i f n e q ( $( USE_CPU_AFFINITY ) , )
OPTIONS_CFLAGS += -DUSE_CPU_AFFINITY
BUILD_OPTIONS += $( call ignore_implicit,USE_CPU_AFFINITY)
e n d i f
2011-08-22 19:12:02 +04:00
i f n e q ( $( USE_MY_SPLICE ) , )
OPTIONS_CFLAGS += -DUSE_MY_SPLICE
BUILD_OPTIONS += $( call ignore_implicit,USE_MY_SPLICE)
e n d i f
2013-01-07 19:57:09 +04:00
i f n e q ( $( ASSUME_SPLICE_WORKS ) , )
OPTIONS_CFLAGS += -DASSUME_SPLICE_WORKS
BUILD_OPTIONS += $( call ignore_implicit,ASSUME_SPLICE_WORKS)
e n d i f
2012-10-08 22:11:03 +04:00
i f n e q ( $( USE_ACCEPT 4) , )
OPTIONS_CFLAGS += -DUSE_ACCEPT4
BUILD_OPTIONS += $( call ignore_implicit,USE_ACCEPT4)
e n d i f
i f n e q ( $( USE_MY_ACCEPT 4) , )
OPTIONS_CFLAGS += -DUSE_MY_ACCEPT4
BUILD_OPTIONS += $( call ignore_implicit,USE_MY_ACCEPT4)
e n d i f
2006-11-13 01:57:19 +03:00
i f n e q ( $( USE_NETFILTER ) , )
2008-01-02 22:48:34 +03:00
OPTIONS_CFLAGS += -DNETFILTER
BUILD_OPTIONS += $( call ignore_implicit,USE_NETFILTER)
2006-11-13 01:57:19 +03:00
e n d i f
i f n e q ( $( USE_GETSOCKNAME ) , )
2008-01-02 22:48:34 +03:00
OPTIONS_CFLAGS += -DUSE_GETSOCKNAME
BUILD_OPTIONS += $( call ignore_implicit,USE_GETSOCKNAME)
2006-11-13 01:57:19 +03:00
e n d i f
i f n e q ( $( USE_REGPARM ) , )
2009-10-27 23:40:18 +03:00
OPTIONS_CFLAGS += -DCONFIG_REGPARM= 3
2008-01-02 22:48:34 +03:00
BUILD_OPTIONS += $( call ignore_implicit,USE_REGPARM)
2006-11-13 01:57:19 +03:00
e n d i f
2008-03-07 12:02:14 +03:00
# report DLMALLOC_SRC only if explicitly specified
i f n e q ( $( DLMALLOC_SRC ) , )
BUILD_OPTIONS += DLMALLOC_SRC = $( DLMALLOC_SRC)
e n d i f
2008-02-19 12:53:32 +03:00
i f n e q ( $( USE_DLMALLOC ) , )
BUILD_OPTIONS += $( call ignore_implicit,USE_DLMALLOC)
i f e q ( $( DLMALLOC_SRC ) , )
DLMALLOC_SRC = src/dlmalloc.c
e n d i f
e n d i f
2007-07-11 11:19:31 +04:00
i f n e q ( $( DLMALLOC_SRC ) , )
2008-03-07 12:02:14 +03:00
# DLMALLOC_THRES may be changed to match PAGE_SIZE on every platform
2008-01-02 22:48:34 +03:00
DLMALLOC_THRES = 4096
OPTIONS_OBJS += src/dlmalloc.o
2007-07-11 11:19:31 +04:00
e n d i f
2012-05-18 17:48:30 +04:00
i f n e q ( $( USE_OPENSSL ) , )
# OpenSSL is packaged in various forms and with various dependences.
# In general -lssl is enough, but on some platforms, -lcrypto may be needed,
2012-09-10 11:11:22 +04:00
# reason why it's added by default. Some even need -lz, then you'll need to
2013-09-17 17:26:39 +04:00
# pass it in the "ADDLIB" variable if needed. If your SSL libraries are not
# in the usual path, use SSL_INC=/path/to/inc and SSL_LIB=/path/to/lib.
2012-09-08 13:28:56 +04:00
BUILD_OPTIONS += $( call ignore_implicit,USE_OPENSSL)
2013-09-17 17:26:39 +04:00
OPTIONS_CFLAGS += -DUSE_OPENSSL $( if $( SSL_INC) ,-I$( SSL_INC) )
OPTIONS_LDFLAGS += $( if $( SSL_LIB) ,-L$( SSL_LIB) ) -lssl -lcrypto
2012-09-03 13:14:36 +04:00
OPTIONS_OBJS += src/ssl_sock.o src/shctx.o
2012-09-25 13:11:16 +04:00
i f n e q ( $( USE_PRIVATE_CACHE ) , )
OPTIONS_CFLAGS += -DUSE_PRIVATE_CACHE
e l s e
2012-09-03 13:14:36 +04:00
i f n e q ( $( USE_FUTEX ) , )
OPTIONS_CFLAGS += -DUSE_SYSCALL_FUTEX
e l s e
OPTIONS_LDFLAGS += -lpthread
e n d i f
2012-05-18 17:48:30 +04:00
e n d i f
2012-09-25 13:11:16 +04:00
e n d i f
2012-05-18 17:48:30 +04:00
2013-01-13 10:00:42 +04:00
i f n e q ( $( USE_PCRE ) $( USE_STATIC_PCRE ) $( USE_PCRE_JIT ) , )
2013-02-13 15:39:06 +04:00
# PCREDIR is used to automatically construct the PCRE_INC and PCRE_LIB paths,
# by appending /include and /lib respectively. If your system does not use the
# same sub-directories, simply force these variables instead of PCREDIR. It is
# automatically detected but can be forced if required (for cross-compiling).
# Forcing PCREDIR to an empty string will let the compiler use the default
# locations.
2008-01-02 22:48:34 +03:00
PCREDIR := $( shell pcre-config --prefix 2>/dev/null || echo /usr/local)
2013-02-13 15:39:06 +04:00
i f n e q ( $( PCREDIR ) , )
PCRE_INC := $( PCREDIR) /include
PCRE_LIB := $( PCREDIR) /lib
2006-12-22 17:28:43 +03:00
e n d i f
2013-02-13 15:39:06 +04:00
2008-11-20 16:47:04 +03:00
i f e q ( $( USE_STATIC_PCRE ) , )
2013-02-13 15:39:06 +04:00
# dynamic PCRE
OPTIONS_CFLAGS += -DUSE_PCRE $( if $( PCRE_INC) ,-I$( PCRE_INC) )
OPTIONS_LDFLAGS += $( if $( PCRE_LIB) ,-L$( PCRE_LIB) ) -lpcreposix -lpcre
2008-01-02 22:48:34 +03:00
BUILD_OPTIONS += $( call ignore_implicit,USE_PCRE)
2013-02-13 15:39:06 +04:00
e l s e
# static PCRE
OPTIONS_CFLAGS += -DUSE_PCRE $( if $( PCRE_INC) ,-I$( PCRE_INC) )
OPTIONS_LDFLAGS += $( if $( PCRE_LIB) ,-L$( PCRE_LIB) ) -Wl,-Bstatic -lpcreposix -lpcre -Wl,-Bdynamic
2008-01-02 22:48:34 +03:00
BUILD_OPTIONS += $( call ignore_implicit,USE_STATIC_PCRE)
e n d i f
2013-01-13 10:00:42 +04:00
# JIT PCRE
i f n e q ( $( USE_PCRE_JIT ) , )
OPTIONS_CFLAGS += -DUSE_PCRE_JIT
2013-04-04 14:24:16 +04:00
BUILD_OPTIONS += $( call ignore_implicit,USE_PCRE_JIT)
2013-01-13 10:00:42 +04:00
e n d i f
2013-02-13 15:39:06 +04:00
e n d i f
2006-11-13 01:57:19 +03:00
2013-04-02 18:43:24 +04:00
# TCP Fast Open
i f n e q ( $( USE_TFO ) , )
OPTIONS_CFLAGS += -DUSE_TFO
BUILD_OPTIONS += $( call ignore_implicit,USE_TFO)
e n d i f
2009-10-26 23:10:04 +03:00
# This one can be changed to look for ebtree files in an external directory
EBTREE_DIR := ebtree
2006-11-13 01:57:19 +03:00
2008-01-02 22:48:34 +03:00
#### Global compile options
VERBOSE_CFLAGS = $( CFLAGS) $( TARGET_CFLAGS) $( SMALL_OPTS) $( DEFINE)
2009-10-26 23:10:04 +03:00
COPTS = -Iinclude -I$( EBTREE_DIR) -Wall
2008-01-02 22:48:34 +03:00
COPTS += $( CFLAGS) $( TARGET_CFLAGS) $( SMALL_OPTS) $( DEFINE) $( SILENT_DEFINE)
COPTS += $( DEBUG) $( OPTIONS_CFLAGS) $( ADDINC)
2005-12-17 16:08:03 +03:00
2008-01-02 22:48:34 +03:00
i f n e q ( $( VERSION ) $( SUBVERS ) , )
COPTS += -DCONFIG_HAPROXY_VERSION= \" $( VERSION) $( SUBVERS) \"
e n d i f
2007-01-07 04:03:04 +03:00
2008-01-02 22:48:34 +03:00
i f n e q ( $( VERDATE ) , )
COPTS += -DCONFIG_HAPROXY_DATE= \" $( VERDATE) \"
2007-01-07 04:03:04 +03:00
e n d i f
2012-05-26 01:53:16 +04:00
i f n e q ( $( TRACE ) , )
# if tracing is enabled, we want it to be as fast as possible
TRACE_COPTS := $( filter-out -O0 -O1 -O2 -pg -finstrument-functions,$( COPTS) ) -O3 -fomit-frame-pointer
COPTS += -finstrument-functions
e n d i f
2008-01-02 22:48:34 +03:00
#### Global link options
# These options are added at the end of the "ld" command line. Use LDFLAGS to
# add options at the beginning of the "ld" command line if needed.
LDOPTS = $( TARGET_LDFLAGS) $( OPTIONS_LDFLAGS) $( ADDLIB)
2005-12-17 14:29:56 +03:00
2008-03-11 08:37:39 +03:00
i f e q ( $( TARGET ) , )
all :
@echo
@echo "Due to too many reports of suboptimized setups, building without"
@echo "specifying the target is no longer supported. Please specify the"
@echo "target OS in the TARGET variable, in the following form:"
@echo
@echo " $ make TARGET=xxx "
@echo
@echo "Please choose the target among the following supported list :"
@echo
2012-06-04 02:42:09 +04:00
@echo " linux2628, linux26, linux24, linux24e, linux22, solaris"
2009-06-14 20:27:54 +04:00
@echo " freebsd, openbsd, cygwin, custom, generic"
2008-03-11 08:37:39 +03:00
@echo
@echo "Use \"generic\" if you don't want any optimization, \"custom\" if you"
@echo "want to precisely tweak every option, or choose the target which"
@echo "matches your OS the most in order to gain the maximum performance"
@echo "out of it. Please check the Makefile in case of doubts."
@echo
@exit 1
e l s e
MEDIUM: add haproxy-systemd-wrapper
Currently, to reload haproxy configuration, you have to use "-sf".
There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.
This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-12 13:53:53 +04:00
all : haproxy haproxy -systemd -wrapper
2008-03-11 08:37:39 +03:00
e n d i f
2005-12-17 14:21:26 +03:00
2012-09-13 00:58:11 +04:00
OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocol.o \
2012-08-24 21:22:53 +04:00
src/uri_auth.o src/standard.o src/buffer.o src/log.o src/task.o \
2012-09-13 00:58:11 +04:00
src/chunk.o src/channel.o src/listener.o \
2009-01-25 15:49:53 +03:00
src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \
2010-09-23 20:30:22 +04:00
src/checks.o src/queue.o src/frontend.o src/proxy.o src/peers.o \
2012-07-06 16:13:49 +04:00
src/arg.o src/stick_table.o src/proto_uxst.o src/connection.o \
2012-08-20 19:01:35 +04:00
src/proto_http.o src/raw_sock.o src/appsession.o src/backend.o \
2012-02-13 20:12:08 +04:00
src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \
2008-11-30 21:48:07 +03:00
src/stream_interface.o src/dumpstats.o src/proto_tcp.o \
2009-05-10 11:00:20 +04:00
src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \
2012-08-24 21:22:53 +04:00
src/acl.o src/sample.o src/memory.o src/freq_ctr.o src/auth.o \
MEDIUM: sample: add the "map" converter
Add a new converter with the following prototype :
map(<map_file>[,<default_value>])
map_<match_type>(<map_file>[,<default_value>])
map_<match_type>_<output_type>(<map_file>[,<default_value>])
It searches the for input value from <map_file> using the <match_type>
matching method, and return the associated value converted to the type
<output_type>. If the input value cannot be found in the <map_file>,
the converter returns the <default_value>. If the <default_value> is
not set, the converter fails and acts as if no input value could be
fetched. If the <match_type> is not set, it defaults to "str".
Likewise, if the <output_type> is not set, it defaults to "str". For
convenience, the "map" keyword is an alias for "map_str" and maps a
string to another string. The following array contains contains the
list of all the map* converters.
+----+----------+---------+-------------+------------+
| `-_ out | | | |
| input `-_ | str | int | ip |
| / match `-_ | | | |
+---------------+---------+-------------+------------+
| str / str | map_str | map_str_int | map_str_ip |
| str / sub | map_sub | map_sub_int | map_sub_ip |
| str / dir | map_dir | map_dir_int | map_dir_ip |
| str / dom | map_dom | map_dom_int | map_dom_ip |
| str / end | map_end | map_end_int | map_end_ip |
| str / reg | map_reg | map_reg_int | map_reg_ip |
| int / int | map_int | map_int_int | map_int_ip |
| ip / ip | map_ip | map_ip_int | map_ip_ip |
+---------------+---------+-------------+------------+
The names are intentionally chosen to reflect the same match methods
as ACLs use.
2013-11-26 14:52:33 +04:00
src/compression.o src/payload.o src/hash.o src/pattern.o src/map.o
2006-06-26 04:48:02 +04:00
2009-10-26 23:10:04 +03:00
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
2012-05-26 01:53:16 +04:00
i f n e q ( $( TRACE ) , )
OBJS += src/trace.o
e n d i f
MEDIUM: add haproxy-systemd-wrapper
Currently, to reload haproxy configuration, you have to use "-sf".
There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.
This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-12 13:53:53 +04:00
WRAPPER_OBJS = src/haproxy-systemd-wrapper.o
2009-10-26 23:10:04 +03:00
# Not used right now
LIB_EBTREE = $( EBTREE_DIR) /libebtree.a
haproxy : $( OBJS ) $( OPTIONS_OBJS ) $( EBTREE_OBJS )
2008-01-02 22:48:34 +03:00
$( LD) $( LDFLAGS) -o $@ $^ $( LDOPTS)
2005-12-17 14:21:26 +03:00
MEDIUM: add haproxy-systemd-wrapper
Currently, to reload haproxy configuration, you have to use "-sf".
There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.
This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-12 13:53:53 +04:00
haproxy-systemd-wrapper : $( WRAPPER_OBJS )
$( LD) $( LDFLAGS) -o $@ $^ $( LDOPTS)
2009-10-26 23:10:04 +03:00
$(LIB_EBTREE) : $( EBTREE_OBJS )
$( AR) rv $@ $^
2006-06-26 04:48:02 +04:00
objsize : haproxy
@objdump -t $^| grep ' g ' | grep -F '.text' | awk '{print $$5 FS $$6}' | sort
2005-12-17 14:21:26 +03:00
%.o : %.c
2008-01-02 22:48:34 +03:00
$( CC) $( COPTS) -c -o $@ $<
2005-12-17 14:21:26 +03:00
2012-05-26 01:53:16 +04:00
src/trace.o : src /trace .c
$( CC) $( TRACE_COPTS) -c -o $@ $<
2007-12-02 13:28:59 +03:00
src/haproxy.o : src /haproxy .c
2008-01-02 22:48:34 +03:00
$( CC) $( COPTS) \
-DBUILD_TARGET= '"$(strip $(TARGET))"' \
2009-04-11 21:45:50 +04:00
-DBUILD_ARCH= '"$(strip $(ARCH))"' \
2008-01-02 22:48:34 +03:00
-DBUILD_CPU= '"$(strip $(CPU))"' \
-DBUILD_CC= '"$(strip $(CC))"' \
-DBUILD_CFLAGS= '"$(strip $(VERBOSE_CFLAGS))"' \
-DBUILD_OPTIONS= '"$(strip $(BUILD_OPTIONS))"' \
-c -o $@ $<
2007-12-02 13:28:59 +03:00
MEDIUM: add haproxy-systemd-wrapper
Currently, to reload haproxy configuration, you have to use "-sf".
There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.
This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-12 13:53:53 +04:00
src/haproxy-systemd-wrapper.o : src /haproxy -systemd -wrapper .c
$( CC) $( COPTS) \
-DSBINDIR= '"$(strip $(SBINDIR))"' \
-c -o $@ $<
2007-07-11 11:19:31 +04:00
src/dlmalloc.o : $( DLMALLOC_SRC )
2008-01-02 22:48:34 +03:00
$( CC) $( COPTS) -DDEFAULT_MMAP_THRESHOLD= $( DLMALLOC_THRES) -c -o $@ $<
2007-07-11 11:19:31 +04:00
2008-03-12 16:57:54 +03:00
install-man :
2008-03-12 19:19:16 +03:00
install -d $( DESTDIR) $( MANDIR) /man1
install -m 644 doc/haproxy.1 $( DESTDIR) $( MANDIR) /man1
2008-03-12 16:57:54 +03:00
2008-03-12 18:24:49 +03:00
install-doc :
2008-03-12 19:19:16 +03:00
install -d $( DESTDIR) $( DOCDIR)
2008-03-12 18:24:49 +03:00
for x in configuration architecture haproxy-en haproxy-fr; do \
2008-03-12 19:19:16 +03:00
install -m 644 doc/$$ x.txt $( DESTDIR) $( DOCDIR) ; \
2008-03-12 18:24:49 +03:00
done
MEDIUM: add haproxy-systemd-wrapper
Currently, to reload haproxy configuration, you have to use "-sf".
There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.
This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-12 13:53:53 +04:00
install-bin : haproxy haproxy -systemd -wrapper
2008-03-12 19:19:16 +03:00
install -d $( DESTDIR) $( SBINDIR)
install haproxy $( DESTDIR) $( SBINDIR)
MEDIUM: add haproxy-systemd-wrapper
Currently, to reload haproxy configuration, you have to use "-sf".
There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.
This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-12 13:53:53 +04:00
install haproxy-systemd-wrapper $( DESTDIR) $( SBINDIR)
2008-03-12 16:25:35 +03:00
2008-03-12 19:28:13 +03:00
install : install -bin install -man install -doc
2008-03-12 17:21:05 +03:00
2005-12-17 14:21:26 +03:00
clean :
2009-10-26 23:10:04 +03:00
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
2006-12-23 13:12:04 +03:00
rm -f haproxy-$( VERSION) .tar.gz haproxy-$( VERSION) $( SUBVERS) .tar.gz
2013-12-10 12:31:06 +04:00
rm -f haproxy-$( VERSION) haproxy-$( VERSION) $( SUBVERS) nohup.out gmon.out
MEDIUM: add haproxy-systemd-wrapper
Currently, to reload haproxy configuration, you have to use "-sf".
There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.
This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-12 13:53:53 +04:00
rm -f haproxy-systemd-wrapper
2005-12-17 14:51:03 +03:00
2009-10-11 00:20:44 +04:00
tags :
2010-03-29 11:35:20 +04:00
find src include \( -name '*.c' -o -name '*.h' \) -print0 | \
2009-10-11 00:20:44 +04:00
xargs -0 etags --declarations --members
2013-10-18 18:26:39 +04:00
cscope :
find src include -name "*.[ch]" -print | cscope -q -b -i -
2006-03-19 23:30:14 +03:00
tar : clean
2013-12-10 12:31:06 +04:00
ln -s . haproxy-$( VERSION) $( SUBVERS)
tar --exclude= haproxy-$( VERSION) $( SUBVERS) /.git \
--exclude= haproxy-$( VERSION) $( SUBVERS) /haproxy-$( VERSION) $( SUBVERS) \
--exclude= haproxy-$( VERSION) $( SUBVERS) /haproxy-$( VERSION) $( SUBVERS) .tar.gz \
-cf - haproxy-$( VERSION) $( SUBVERS) /* | gzip -c9 >haproxy-$( VERSION) $( SUBVERS) .tar.gz
rm -f haproxy-$( VERSION) $( SUBVERS)
2006-03-19 23:16:26 +03:00
2012-12-20 18:00:44 +04:00
git-tar :
2013-12-10 12:31:06 +04:00
git archive --format= tar --prefix= " haproxy- $( VERSION) $( SUBVERS) / " HEAD | gzip -9 > haproxy-$( VERSION) $( SUBVERS) .tar.gz
2007-09-10 01:31:11 +04:00
version :
@echo " VERSION: $( VERSION) "
@echo " SUBVERS: $( SUBVERS) "
@echo " VERDATE: $( VERDATE) "
# never use this one if you don't know what it is used for.
update-version :
@echo "Ready to update the following versions :"
@echo " VERSION: $( VERSION) "
@echo " SUBVERS: $( SUBVERS) "
@echo " VERDATE: $( VERDATE) "
@echo "Press [ENTER] to continue or Ctrl-C to abort now." ; read
echo " $( VERSION) " > VERSION
echo " $( SUBVERS) " > SUBVERS
echo " $( VERDATE) " > VERDATE