~ubuntu-branches/ubuntu/trusty/haproxy/trusty-updates

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2010-04-15 20:00:34 UTC
  • mfrom: (1.1.8 upstream) (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100415200034-is2r38tyvmtvi3ml
Tags: 1.4.4-1
* New upstream release
* Add splice and tproxy support
* Add regparm optimization on i386
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#   USE_REGPARM          : enable regparm optimization. Recommended on x86.
18
18
#   USE_SEPOLL           : enable speculative epoll(). Automatic.
19
19
#   USE_STATIC_PCRE      : enable static libpcre. Recommended.
20
 
#   USE_TCPSPLICE        : enable tcp_splice() on Linux (needs kernel patch).
21
20
#   USE_TPROXY           : enable transparent proxy. Automatic.
22
21
#   USE_LINUX_TPROXY     : enable full transparent proxy (need kernel patch).
23
22
#   USE_LINUX_SPLICE     : enable kernel 2.6 splicing (broken on old kernels)
 
23
#   USE_LIBCRYPT         : enable crypted passwords using -lcrypt
 
24
#   USE_CRYPT_H          : set it if your system requires including crypt.h
24
25
#
25
26
# Options can be forced by specifying "USE_xxx=1" or can be disabled by using
26
27
# "USE_xxx=" (empty string).
109
110
#### Debug settings
110
111
# You can enable debugging on specific code parts by setting DEBUG=-DDEBUG_xxx.
111
112
# Currently defined DEBUG macros include DEBUG_FULL, DEBUG_MEMORY, DEBUG_FSM,
112
 
# and DEBUG_HASH. Please check sources for exact meaning or do not use at all.
 
113
# DEBUG_HASH and DEBUG_AUTH. Please check sources for exact meaning or do not
 
114
# use at all.
113
115
DEBUG =
114
116
 
115
117
#### Additional include and library dirs
171
173
  USE_GETSOCKNAME = implicit
172
174
  USE_POLL        = implicit
173
175
  USE_TPROXY      = implicit
 
176
  USE_LIBCRYPT    = implicit
174
177
else
175
178
ifeq ($(TARGET),linux24)
176
179
  # This is for standard Linux 2.4 with netfilter but without epoll()
178
181
  USE_NETFILTER   = implicit
179
182
  USE_POLL        = implicit
180
183
  USE_TPROXY      = implicit
 
184
  USE_LIBCRYPT    = implicit
181
185
else
182
186
ifeq ($(TARGET),linux24e)
183
187
  # This is for enhanced Linux 2.4 with netfilter and epoll() patch > 0.21
188
192
  USE_SEPOLL      = implicit
189
193
  USE_MY_EPOLL    = implicit
190
194
  USE_TPROXY      = implicit
 
195
  USE_LIBCRYPT    = implicit
191
196
else
192
197
ifeq ($(TARGET),linux26)
193
198
  # This is for standard Linux 2.6 with netfilter and standard epoll()
197
202
  USE_EPOLL       = implicit
198
203
  USE_SEPOLL      = implicit
199
204
  USE_TPROXY      = implicit
 
205
  USE_LIBCRYPT    = implicit
200
206
else
201
207
ifeq ($(TARGET),solaris)
202
208
  # This is for Solaris 8
204
210
  TARGET_CFLAGS  = -fomit-frame-pointer -DFD_SETSIZE=65536 -D_REENTRANT
205
211
  TARGET_LDFLAGS = -lnsl -lsocket
206
212
  USE_TPROXY     = implicit
 
213
  USE_LIBCRYPT    = implicit
 
214
  USE_CRYPT_H     = implicit
207
215
else
208
216
ifeq ($(TARGET),freebsd)
209
217
  # This is for FreeBSD
210
218
  USE_POLL       = implicit
211
219
  USE_KQUEUE     = implicit
212
220
  USE_TPROXY     = implicit
 
221
  USE_LIBCRYPT   = implicit
213
222
else
214
223
ifeq ($(TARGET),openbsd)
215
224
  # This is for OpenBSD >= 3.0
301
310
ignore_implicit = $(patsubst %=implicit,,$(1)=$($(1)))
302
311
 
303
312
ifneq ($(USE_TCPSPLICE),)
304
 
# This is the directory hosting libtcpsplice.[ah]
305
 
TCPSPLICEDIR    :=
306
 
OPTIONS_CFLAGS  += -DCONFIG_HAP_TCPSPLICE -I$(TCPSPLICEDIR)
307
 
OPTIONS_LDFLAGS += -L$(TCPSPLICEDIR) -ltcpsplice
308
 
BUILD_OPTIONS   += $(call ignore_implicit,USE_TCPSPLICE)
 
313
$(error experimental option USE_TCPSPLICE has been removed, check USE_LINUX_SPLICE)
309
314
endif
310
315
 
311
316
ifneq ($(USE_LINUX_SPLICE),)
329
334
BUILD_OPTIONS  += $(call ignore_implicit,USE_LINUX_TPROXY)
330
335
endif
331
336
 
 
337
ifneq ($(USE_LIBCRYPT),)
 
338
OPTIONS_CFLAGS  += -DCONFIG_HAP_CRYPT
 
339
BUILD_OPTIONS   += $(call ignore_implicit,USE_LIBCRYPT)
 
340
OPTIONS_LDFLAGS += -lcrypt
 
341
endif
 
342
 
 
343
ifneq ($(USE_CRYPT_H),)
 
344
OPTIONS_CFLAGS  += -DNEED_CRYPT_H
 
345
BUILD_OPTIONS   += $(call ignore_implicit,USE_CRYPT_H)
 
346
endif
 
347
 
332
348
ifneq ($(USE_POLL),)
333
349
OPTIONS_CFLAGS += -DENABLE_POLL
334
350
OPTIONS_OBJS   += src/ev_poll.o
369
385
endif
370
386
 
371
387
ifneq ($(USE_REGPARM),)
372
 
OPTIONS_CFLAGS += -DCONFIG_HAP_USE_REGPARM
 
388
OPTIONS_CFLAGS += -DCONFIG_REGPARM=3
373
389
BUILD_OPTIONS  += $(call ignore_implicit,USE_REGPARM)
374
390
endif
375
391
 
415
431
BUILD_OPTIONS   += $(call ignore_implicit,USE_STATIC_PCRE)
416
432
endif
417
433
 
 
434
# This one can be changed to look for ebtree files in an external directory
 
435
EBTREE_DIR := ebtree
418
436
 
419
437
#### Global compile options
420
438
VERBOSE_CFLAGS = $(CFLAGS) $(TARGET_CFLAGS) $(SMALL_OPTS) $(DEFINE)
421
 
COPTS  = -Iinclude -Wall
 
439
COPTS  = -Iinclude -I$(EBTREE_DIR) -Wall
422
440
COPTS += $(CFLAGS) $(TARGET_CFLAGS) $(SMALL_OPTS) $(DEFINE) $(SILENT_DEFINE)
423
441
COPTS += $(DEBUG) $(OPTIONS_CFLAGS) $(ADDINC)
424
442
 
462
480
OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \
463
481
       src/uri_auth.o src/standard.o src/buffers.o src/log.o src/task.o \
464
482
       src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \
465
 
       src/checks.o src/queue.o src/client.o src/proxy.o src/proto_uxst.o \
 
483
       src/checks.o src/queue.o src/client.o src/proxy.o src/stick_table.o src/proto_uxst.o \
466
484
       src/proto_http.o src/stream_sock.o src/appsession.o src/backend.o \
 
485
       src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o \
467
486
       src/stream_interface.o src/dumpstats.o src/proto_tcp.o \
468
487
       src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \
469
 
       src/acl.o src/memory.o src/freq_ctr.o \
470
 
       src/ebtree.o src/eb32tree.o
471
 
 
472
 
haproxy: $(OBJS) $(OPTIONS_OBJS)
 
488
       src/acl.o src/pattern.o src/memory.o src/freq_ctr.o src/auth.o
 
489
 
 
490
EBTREE_OBJS = $(EBTREE_DIR)/ebtree.o \
 
491
              $(EBTREE_DIR)/eb32tree.o $(EBTREE_DIR)/eb64tree.o \
 
492
              $(EBTREE_DIR)/ebmbtree.o $(EBTREE_DIR)/ebsttree.o \
 
493
              $(EBTREE_DIR)/ebimtree.o $(EBTREE_DIR)/ebistree.o
 
494
 
 
495
# Not used right now
 
496
LIB_EBTREE = $(EBTREE_DIR)/libebtree.a
 
497
 
 
498
haproxy: $(OBJS) $(OPTIONS_OBJS) $(EBTREE_OBJS)
473
499
        $(LD) $(LDFLAGS) -o $@ $^ $(LDOPTS)
474
500
 
 
501
$(LIB_EBTREE): $(EBTREE_OBJS)
 
502
        $(AR) rv $@ $^
 
503
 
475
504
objsize: haproxy
476
505
        @objdump -t $^|grep ' g '|grep -F '.text'|awk '{print $$5 FS $$6}'|sort
477
506
 
508
537
install: install-bin install-man install-doc
509
538
 
510
539
clean:
511
 
        rm -f *.[oas] src/*.[oas] core haproxy test
512
 
        for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done
 
540
        rm -f *.[oas] src/*.[oas] ebtree/*.[oas] haproxy test
 
541
        for dir in . src include/* doc ebtree; do rm -f $$dir/*~ $$dir/*.rej $$dir/core; done
513
542
        rm -f haproxy-$(VERSION).tar.gz haproxy-$(VERSION)$(SUBVERS).tar.gz
514
543
        rm -f haproxy-$(VERSION) nohup.out gmon.out
515
544
 
516
545
tags:
517
 
        find src include -name '*.c' -o -name '*.h' -print0 | \
 
546
        find src include \( -name '*.c' -o -name '*.h' \) -print0 | \
518
547
           xargs -0 etags --declarations --members
519
548
 
520
549
tar:    clean