|
Lines 1-97
Link Here
|
| 1 |
--- Makefile.bsd.orig Mon Apr 16 00:33:37 2007 |
1 |
--- Makefile.bsd.orig 2007-12-06 00:25:44.000000000 +0000 |
| 2 |
+++ Makefile.bsd Fri May 4 04:05:12 2007 |
2 |
+++ Makefile.bsd 2007-12-11 15:07:31.578883070 +0000 |
| 3 |
@@ -1,4 +1,4 @@ |
3 |
@@ -1,7 +1,4 @@ |
| 4 |
-# This makefile is dedicated to OpenBSD (and possibly other BSDs) |
4 |
-# This makefile is dedicated to OpenBSD (and possibly other BSDs) |
| 5 |
+# This makefile is dedicated to FreeBSD (and possibly other BSDs) |
5 |
-# You should use it this way : |
| 6 |
# You should use it this way : |
6 |
-# make TARGET=os CPU=cpu |
| 7 |
# make TARGET=os CPU=cpu |
7 |
-# |
| 8 |
|
8 |
+# This makefile is dedicated to FreeBSD |
| 9 |
@@ -6,31 +6,31 @@ |
9 |
# Some optional components may be added, such as DLMALLOC : |
| 10 |
|
10 |
# |
|
|
11 |
# make TARGET=freebsd CPU=i686 DLMALLOC_SRC=/usr/local/src/dlmalloc.c \ |
| 12 |
@@ -9,7 +6,7 @@ |
| 13 |
|
| 11 |
# Select target OS. TARGET must match a system for which COPTS and LIBS are |
14 |
# Select target OS. TARGET must match a system for which COPTS and LIBS are |
| 12 |
# correctly defined below. |
15 |
# correctly defined below. |
| 13 |
-TARGET = openbsd |
16 |
-TARGET = openbsd |
| 14 |
+TARGET = freebsd |
17 |
+TARGET = freebsd |
| 15 |
|
18 |
|
| 16 |
# pass CPU=<cpu_name> to make to optimize for a particular CPU |
19 |
# pass CPU=<cpu_name> to make to optimize for a particular CPU |
| 17 |
-CPU = generic |
20 |
CPU = generic |
| 18 |
+#CPU = generic |
21 |
@@ -24,26 +21,25 @@ |
| 19 |
#CPU = i586 |
|
|
| 20 |
#CPU = i686 |
| 21 |
#CPU = ultrasparc |
| 22 |
|
| 23 |
# By default, we use libc's regex. WARNING! On Solaris 8/Sparc, group |
| 24 |
# references seem broken using libc ! Use pcre instead. |
| 25 |
-REGEX=libc |
| 26 |
+REGEX?=libc |
| 27 |
#REGEX=pcre |
| 28 |
#REGEX=static-pcre |
22 |
#REGEX=static-pcre |
| 29 |
|
23 |
|
| 30 |
# tools options |
24 |
# tools options |
| 31 |
-CC = gcc |
25 |
-CC = gcc |
| 32 |
-LD = gcc |
26 |
-LD = gcc |
| 33 |
+CC? = gcc |
27 |
+CC = cc |
| 34 |
+LD? = gcc |
28 |
+LD = cc |
| 35 |
|
29 |
|
| 36 |
# This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre |
30 |
# This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre |
| 37 |
-PCREDIR!= pcre-config --prefix 2>/dev/null || : |
31 |
PCREDIR!= pcre-config --prefix 2>/dev/null || : |
| 38 |
-#PCREDIR=/usr/local |
32 |
#PCREDIR=/usr/local |
| 39 |
+#PCREDIR!= pcre-config --prefix 2>/dev/null || : |
33 |
|
| 40 |
+PCREDIR=${LOCALBASE} |
|
|
| 41 |
|
| 42 |
-# This is for OpenBSD 3.0 and above |
34 |
-# This is for OpenBSD 3.0 and above |
| 43 |
-COPTS.openbsd = -DENABLE_POLL -DENABLE_KQUEUE |
35 |
-COPTS.openbsd = -DENABLE_POLL -DENABLE_KQUEUE |
| 44 |
-LIBS.openbsd = |
36 |
-LIBS.openbsd = |
| 45 |
+# This is for FreeBSD |
|
|
| 46 |
+COPTS.freebsd = -DENABLE_POLL -DENABLE_KQUEUE |
37 |
+COPTS.freebsd = -DENABLE_POLL -DENABLE_KQUEUE |
| 47 |
+LIBS.freebsd = |
38 |
+LIBS.freebsd = |
| 48 |
|
39 |
|
| 49 |
# CPU dependant optimizations |
40 |
# CPU dependant optimizations |
| 50 |
COPTS.generic = -O2 |
41 |
-COPTS.generic = -O2 |
| 51 |
@@ -52,7 +52,7 @@ |
42 |
-COPTS.i586 = -O2 -march=i586 |
| 52 |
|
43 |
-COPTS.i686 = -O2 -march=i686 |
|
|
44 |
-COPTS.ultrasparc = -O6 -mcpu=v9 -mtune=ultrasparc |
| 45 |
+#COPTS.generic = -O2 |
| 46 |
+#COPTS.i586 = -O2 -march=i586 |
| 47 |
+#COPTS.i686 = -O2 -march=i686 |
| 48 |
+#COPTS.ultrasparc = -O6 -mcpu=v9 -mtune=ultrasparc |
| 49 |
|
| 50 |
# options for standard regex library |
| 51 |
-COPTS.libc= |
| 52 |
-LIBS.libc= |
| 53 |
+#COPTS.libc= |
| 54 |
+#LIBS.libc= |
| 55 |
|
| 56 |
# options for libpcre |
| 57 |
COPTS.pcre=-DUSE_PCRE -I$(PCREDIR)/include |
| 58 |
@@ -55,7 +51,7 @@ |
| 59 |
|
| 53 |
# you can enable debug arguments with "DEBUG=-g" or disable them with "DEBUG=" |
60 |
# you can enable debug arguments with "DEBUG=-g" or disable them with "DEBUG=" |
| 54 |
#DEBUG = -g -DDEBUG_MEMORY -DDEBUG_FULL |
61 |
#DEBUG = -g -DDEBUG_MEMORY -DDEBUG_FULL |
| 55 |
-DEBUG = -g |
62 |
-DEBUG = -g |
| 56 |
+#DEBUG = -g |
63 |
+#DEBUG = -g |
| 57 |
|
64 |
|
| 58 |
# if small memory footprint is required, you can reduce the buffer size. There |
65 |
# if small memory footprint is required, you can reduce the buffer size. There |
| 59 |
# are 2 buffers per concurrent session, so 16 kB buffers will eat 32 MB memory |
66 |
# are 2 buffers per concurrent session, so 16 kB buffers will eat 32 MB memory |
| 60 |
@@ -60,7 +60,7 @@ |
67 |
@@ -63,19 +59,19 @@ |
| 61 |
# will avoid the additionnal paramters to overflow a page. 8030 bytes is |
68 |
# will avoid the additionnal paramters to overflow a page. 8030 bytes is |
| 62 |
# exactly 5.5 TCP segments of 1460 bytes. |
69 |
# exactly 5.5 TCP segments of 1460 bytes. |
| 63 |
#SMALL_OPTS = |
70 |
#SMALL_OPTS = |
| 64 |
-SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024 |
71 |
-SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024 |
| 65 |
+#SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024 |
72 |
+#SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024 |
| 66 |
|
73 |
|
| 67 |
# redefine this if you want to add some special PATH to include/libs |
74 |
# redefine this if you want to add some special PATH to include/libs |
| 68 |
ADDINC = |
75 |
-ADDINC = |
| 69 |
@@ -69,7 +69,7 @@ |
76 |
-ADDLIB = |
|
|
77 |
+#ADDINC = |
| 78 |
+#ADDLIB = |
| 79 |
|
| 80 |
# redefine this if you want to add some special .o files |
| 81 |
-OPT_OBJS = |
| 82 |
+#OPT_OBJS = |
| 83 |
|
| 70 |
# set some defines when needed. |
84 |
# set some defines when needed. |
| 71 |
# Known ones are -DENABLE_POLL |
85 |
# Known ones are -DENABLE_POLL |
| 72 |
# - use -DTPROXY to compile with transparent proxy support. |
86 |
# - use -DTPROXY to compile with transparent proxy support. |
| 73 |
-DEFINE = -DTPROXY |
87 |
-DEFINE = -DTPROXY |
| 74 |
+#DEFINE = -DTPROXY |
88 |
+#DEFINE = -DTPROXY |
| 75 |
|
89 |
|
| 76 |
# global options |
90 |
# May be changed to patch PAGE_SIZE on every platform when using dlmalloc |
| 77 |
TARGET_OPTS=$(COPTS.$(TARGET)) |
91 |
DLMALLOC_THRES=4096 |
| 78 |
@@ -79,7 +79,7 @@ |
92 |
@@ -95,7 +91,7 @@ |
| 79 |
COPTS=-Iinclude $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) $(REGEX_OPTS) $(SMALL_OPTS) $(DEFINE) |
93 |
COPTS = -Iinclude $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) $(REGEX_OPTS) \ |
| 80 |
LIBS=$(LIBS.$(TARGET)) $(LIBS.$(REGEX)) $(ADDLIB) |
94 |
$(SMALL_OPTS) $(VER_OPTS) $(DEFINE) |
| 81 |
|
95 |
LIBS = $(LIBS.$(TARGET)) $(LIBS.$(REGEX)) $(ADDLIB) |
| 82 |
-CFLAGS = -Wall $(COPTS) $(DEBUG) |
96 |
-CFLAGS = -Wall $(COPTS) $(DEBUG) |
| 83 |
+CFLAGS += -Wall $(COPTS) |
97 |
+CFLAGS += -Wall $(COPTS) $(DEBUG) |
| 84 |
LDFLAGS = -g |
98 |
LDFLAGS = -g |
| 85 |
|
99 |
|
| 86 |
OBJS = src/haproxy.o src/list.o src/chtbl.o src/hashpjw.o src/base64.o \ |
100 |
OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \ |
| 87 |
@@ -93,7 +93,9 @@ |
101 |
|
| 88 |
all: haproxy |
|
|
| 89 |
|
| 90 |
haproxy: $(OBJS) |
| 91 |
- $(LD) $(LDFLAGS) -o $@ $> $(LIBS) |
| 92 |
+# $(LD) $(LDFLAGS) -o $@ $> $(LIBS) |
| 93 |
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $> $(LIBS) |
| 94 |
+ |
| 95 |
|
| 96 |
.SUFFIXES: .c.o |
| 97 |
|