freebsd-ports/net/ser/files/patch-Makefile.defs
Maxim Sobolev 33cbf3a9c2 Add new WITH_SYSTEM_MALLOC knob, which results in system malloc being used
for memory allocation instead of SER's own one. Stress tests failed to
show any considerable difference in the performance, while system version
provides much better scalability and in future should also provide some
benefits on SMP systems.
2006-11-02 21:59:45 +00:00

171 lines
4.6 KiB
Text

$FreeBSD$
--- Makefile.defs.orig
+++ Makefile.defs
@@ -169,10 +169,11 @@
INSTALL-TOUCH = touch # used to create the file first (good to
# make solaris install work)
INSTALL-CFG = $(INSTALL) -m 644
-INSTALL-BIN = $(INSTALL) -m 755
-INSTALL-MODULES = $(INSTALL) -m 755
-INSTALL-DOC = $(INSTALL) -m 644
-INSTALL-MAN = $(INSTALL) -m 644
+INSTALL-BIN = $(BSD_INSTALL_PROGRAM)
+INSTALL-MODULES = $(BSD_INSTALL_PROGRAM)
+INSTALL-DOC = $(BSD_INSTALL_MAN)
+INSTALL-MAN = $(BSD_INSTALL_MAN)
+INSTALL-SCRIPT = $(BSD_INSTALL_SCRIPT)
#set some vars from the environment (and not make builtins)
CC := $(shell echo "$${CC}")
@@ -321,14 +322,14 @@
-DNAME='"$(MAIN_NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
-DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"' -D__CPU_$(ARCH) -D__OS_$(OS) \
-DCFG_DIR='"$(cfg-target)"'\
- -DPKG_MALLOC \
-DSHM_MEM -DSHM_MMAP \
-DDNS_IP_HACK \
-DUSE_IPV6 \
-DUSE_MCAST \
-DUSE_TCP \
-DDISABLE_NAGLE \
- -DF_MALLOC \
+ #-DPKG_MALLOC \
+ #-DF_MALLOC \
#-DDBG_QM_MALLOC \
#-DDBG_F_MALLOC \
#-DNO_DEBUG \
@@ -464,8 +465,8 @@
found_lock_method=yes
endif
-CFLAGS=
-LDFLAGS=
+#CFLAGS=
+#LDFLAGS=
# setting CFLAGS
ifeq ($(mode), release)
#if i386
@@ -473,15 +474,14 @@
# if gcc
ifeq ($(CC_NAME), gcc)
#common stuff
- CFLAGS=-g -O9 -funroll-loops -Wcast-align $(PROFILE) \
+ CFLAGS+=-funroll-loops -Wcast-align $(PROFILE) \
-Wall
#if gcc 4.0+
ifeq ($(CC_SHORTVER), 4.x)
CPU ?= athlon64
CFLAGS+=-minline-all-stringops -malign-double \
-falign-loops \
- -ftree-vectorize \
- -mtune=$(CPU)
+ -ftree-vectorize
else
#if gcc 3.4+
ifeq ($(CC_SHORTVER), 3.4)
@@ -515,7 +515,7 @@
else # CC_NAME, gcc
ifeq ($(CC_NAME), icc)
- CFLAGS=-g -O3 -ipo -ipo_obj -unroll $(PROFILE) \
+ CFLAGS+=-ipo -ipo_obj -unroll $(PROFILE) \
-tpp6 -xK #-openmp #optimize for PIII
# -prefetch doesn't seem to work
#( ty to inline acroos files, unroll loops,prefetch,
@@ -533,7 +533,7 @@
# if gcc
ifeq ($(CC_NAME), gcc)
#common stuff
- CFLAGS=-g -O9 -funroll-loops -Wcast-align $(PROFILE) \
+ CFLAGS+=-funroll-loops -Wcast-align $(PROFILE) \
-Wall
#if gcc 4.0+
ifeq ($(CC_SHORTVER), 4.x)
@@ -575,7 +575,7 @@
else # CC_NAME, gcc
ifeq ($(CC_NAME), icc)
- CFLAGS=-g -O3 -ipo -ipo_obj -unroll $(PROFILE) \
+ CFLAGS+=-ipo -ipo_obj -unroll $(PROFILE) \
-tpp6 -xK #-openmp #optimize for PIII
# -prefetch doesn't seem to work
#( ty to inline acroos files, unroll loops,prefetch,
@@ -593,7 +593,7 @@
#if gcc
ifeq ($(CC_NAME), gcc)
#common stuff
- CFLAGS=-g -O9 -funroll-loops $(PROFILE) \
+ CFLAGS+=-funroll-loops $(PROFILE) \
-Wall\
#-Wcast-align \
#-Wmissing-prototypes
@@ -667,7 +667,7 @@
# if gcc
ifeq ($(CC_NAME), gcc)
#common stuff
- CFLAGS=-O9 -funroll-loops -Wcast-align $(PROFILE) \
+ CFLAGS+=-funroll-loops -Wcast-align $(PROFILE) \
-Wall
#if gcc 4.x+
ifeq ($(CC_SHORTVER), 4.x)
@@ -709,7 +709,7 @@
# if gcc
ifeq ($(CC_NAME), gcc)
#common stuff
- CFLAGS=-O9 -funroll-loops -Wcast-align $(PROFILE) \
+ CFLAGS+=-funroll-loops -Wcast-align $(PROFILE) \
-Wall
#if gcc 4.0+
ifeq ($(CC_SHORTVER), 4.x)
@@ -751,7 +751,7 @@
# if gcc
ifeq ($(CC_NAME), gcc)
#common stuff
- CFLAGS= -mips2 -O9 -funroll-loops $(PROFILE) \
+ CFLAGS+= -mips2 -funroll-loops $(PROFILE) \
-Wall
#if gcc 4.0+
ifeq ($(CC_SHORTVER), 4.x)
@@ -932,7 +932,7 @@
# -andrei
else #mode,release
ifeq ($(CC_NAME), gcc)
- CFLAGS=-g -Wcast-align $(PROFILE)
+ CFLAGS+=-Wcast-align $(PROFILE)
ifeq ($(ARCH), sparc64)
CFLAGS+= -mcpu=ultrasparc
endif
@@ -947,12 +947,12 @@
endif
endif
ifeq ($(CC_NAME), icc)
- CFLAGS=-g $(PROFILE)
+ CFLAGS+=$(PROFILE)
LDFLAGS+=-g -Wl,-E $(PROFILE)
MOD_LDFLAGS=-shared $(LDFLAGS)
endif
ifeq ($(CC_NAME), suncc)
- CFLAGS= -g $(PROFILE)
+ CFLAGS+= $(PROFILE)
LDFLAGS+=-g $(PROFILE)
MOD_LDFLAGS=-G $(LDFLAGS)
endif
@@ -1028,13 +1028,14 @@
ifeq ($(OS), freebsd)
DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN \
- -DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG
+ -DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG \
+ -I$(LOCALBASE)/include
ifneq ($(found_lock_method), yes)
DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems
found_lock_method=yes
LIBS= -pthread -lfl #dlopen is in libc
else
- LIBS= -lfl #dlopen is in libc
+ LIBS= -lfl -L$(LOCALBASE)/lib #dlopen is in libc
endif
YACC=yacc
endif