Makefile.defs
247c2b65
 #
 # $Id$
 #
 # makefile defs (CC, LD,a.s.o)
 #
 
 
 #version number
 VERSION = 0
 PATCHLEVEL = 8
743aa966
 SUBLEVEL = 5
247c2b65
 EXTRAVERSION =
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 ARCH = $(shell uname -s)
 
 # compile-time options
efd6c2fe
 #
 # -DSTATS
 #		allows to print out number of packets processed on CTRL-C;
247c2b65
 # 		implementation still nasty and reports per-process
efd6c2fe
 # -DNO_DEBUG
247c2b65
 #		turns off some of the debug messages (DBG(...)).
efd6c2fe
 # -DNO_LOG
247c2b65
 #		completely turns of all the logging (and DBG(...))
efd6c2fe
 # -DEXTRA_DEBUG
247c2b65
 #		compiles in some extra debugging code
efd6c2fe
 # -DDNS_IP_HACK
247c2b65
 #		faster ip address resolver for ip strings (e.g "127.0.0.1")
efd6c2fe
 # -DSHM_MEM
247c2b65
 #		compiles in shared mem. support, needed by some modules and
 #		by USE_SHM_MEM
dcb5f364
 # -DSHM_MMAP
 #		use mmap instead of SYSV shared memory
efd6c2fe
 # -DPKG_MALLOC
247c2b65
 #		uses a faster malloc (exclusive w/ USE_SHM_MEM)
efd6c2fe
 # -DUSE_SHM_MEM
 #		all pkg_malloc => shm_malloc (most mallocs use a common sh.
247c2b65
 #		mem. segment); don't define PKG_MALLOC if you want this!
 # -DDBG_QM_MALLOC
 #		qm_malloc debug code, will cause pkg_malloc and shm_malloc
 #		to keep and display lot of debuging information: file name,
 #		function, line number of malloc/free call for each block,
 #		extra error checking (trying to free the same pointer
 #		twice, trying to free a pointer alloc'ed with a different
 #		malloc etc.)
dda9dab1
 # -DVQ_MALLOC
 #		additional option to PKG_MALLOC which utilizes a fater then
 #		qm version
ea6721d7
 # -DDBG_MALLOC
 #		issues additional debugging information if lock/unlock is called
dda9dab1
 #
 
404073d3
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
2c65bd8b
 	 -DDNS_IP_HACK  -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP \
eca7f442
 	 -DUSE_SYNONIM \
af9d50fc
 	 #-DFAST_LOCK -Di386
eca7f442
 	 #-DBRUT_HACK #-DEXTRA_DEBUG #-DSTATIC_TM
b0570a15
 	#-DEXTRA_DEBUG -DBRUT_HACK \
 	#-DVQ_MALLOC  -DDBG_LOCK  #-DSTATS
dda9dab1
 	  #-DDBG_QM_MALLOC #-DVQ_MALLOC #-DNO_DEBUG
502532c9
 	  #-DNO_DEBUG #-DDBG_QM_MALLOC
247c2b65
 #-DEXTRA_DEBUG
 # -DUSE_SHM_MEM
efd6c2fe
 #-DNO_DEBUG
247c2b65
 #-DPKG_MALLOC
efd6c2fe
 #-DNO_DEBUG#-DSTATS -DNO_DEBUG
247c2b65
 #-DNO_LOG
 
b0570a15
 #PROFILE=  -pg #set this if you want profiling
da3257c8
 #mode = debug
 mode = release
247c2b65
 
 # platform dependent settings
 
 
 #common
da3257c8
 CC=gcc
 LD=gcc
247c2b65
 MKDEP=gcc -MM $(DEFS)
3b06abf2
 MKTAGS=ctags -R .
247c2b65
 
 ifeq ($(mode), release)
36afd9b3
 	CFLAGS=-O9 -funroll-loops  -Wcast-align $(PROFILE) -Winline\
5740cd08
 #			-malign-double -malign-loops=4 -minline-all-stringops \
 #			-march=athlon -mcpu=athlon
3b06abf2
 	#-Wmissing-prototypes
5740cd08
 	LDFLAGS=-Wl,-O2 -Wl,-E $(PROFILE)
247c2b65
 	# we need -fPIC -DPIC only for shared objects, we don't need them for
 	# the executable file, because it's always loaded at a fixed address
 	# -andrei
 else
 	CFLAGS=-g -Wcast-align -Winline $(PROFILE)
 	LDFLAGS=-g -Wl,-E $(PROFILE)
 endif
 
 #*FLAGS used for compiling the modules
 MOD_CFLAGS=-fPIC -DPIC $(CFLAGS)
 MOD_LDFLAGS=-O2 -shared
 
 LEX=flex
 YACC=bison
 YACC_FLAGS=-d -b cfg
 # on linux and freebsd keep it empty (e.g. LIBS= )
 # on solaris add -lxnet (e.g. LIBS= -lxnet)
 LIBS=-lfl -ldl
 
 
 #arch specific stuff
 ifeq ($(ARCH), Linux)
 
 endif
 ifeq  ($(ARCH), SunOS)
 
 YACC=yacc
 LDFLAGS=-O2 $(PROFILE)
 MOD_LDFLAGS=-O2 -G
 LIBS+=-L/usr/local/lib -lxnet # or -lnsl -lsocket or -lglibc ?
 
 endif
 ifeq ($(ARCH), FreeBSD)
 
 YACC=yacc
 LIBS= -lfl  #dlopen is in libc
 
 endif
 ifneq (,$(findstring CYGWIN, $(ARCH)))
 
 #cygwin is the same as common
 
 endif