- updated Makefiles ( gcc-3.0 specific options, arch. specific defines section,
[sip-router] / Makefile.defs
index 431198d..3411123 100644 (file)
@@ -8,11 +8,12 @@
 #version number
 VERSION = 0
 PATCHLEVEL = 8
-SUBLEVEL = 5
+SUBLEVEL = 6
 EXTRAVERSION =
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-ARCH = $(shell uname -s)
+OS = $(shell uname -s)
+ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
 
 # compile-time options
 #
@@ -47,15 +48,22 @@ ARCH = $(shell uname -s)
 # -DVQ_MALLOC
 #              additional option to PKG_MALLOC which utilizes a fater then
 #              qm version
+#              (not true anymore, q_malloc performs approx. the same)
+# -DF_MALLOC
+#              an even faster malloc, not recommended for debugging
 # -DDBG_MALLOC
 #              issues additional debugging information if lock/unlock is called
+# -DFAST_LOCK
+#              uses fast arhitecture specific locking (see the arh. specific section)
 #
 
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
+        -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
         -DDNS_IP_HACK  -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP \
-        -DUSE_SYNONIM -DVQ_MALLOC\
-        #-DFAST_LOCK -Di386
-        #-DBRUT_HACK #-DEXTRA_DEBUG #-DSTATIC_TM
+        -DUSE_SYNONIM \
+        -DF_MALLOC
+       # -DVQ_MALLOC
+        #-DBRUT_HACK #-DEXTRA_DEBUG 
        #-DEXTRA_DEBUG -DBRUT_HACK \
        #-DVQ_MALLOC  -DDBG_LOCK  #-DSTATS
          #-DDBG_QM_MALLOC #-DVQ_MALLOC #-DNO_DEBUG
@@ -67,31 +75,43 @@ DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
 #-DNO_DEBUG#-DSTATS -DNO_DEBUG
 #-DNO_LOG
 
-PROFILE=  -pg #set this if you want profiling
-mode = debug
-#mode = release
+# arh. specific definitions
+ifeq ($(ARCH), i386)
+       DEFS+= -DFAST_LOCK
+endif
+
+
+#PROFILE=  -pg #set this if you want profiling
+#mode = debug
+mode = release
 
 # platform dependent settings
 
 
 #common
 CC=gcc
-LD=gcc
+LD= $(CC)
+CC_VER= $(CC) $(shell $(CC) --version)
 MKDEP=gcc -MM $(DEFS)
 MKTAGS=ctags -R .
 
 ifeq ($(mode), release)
-       CFLAGS=-O9 -funroll-loops  -Wcast-align $(PROFILE) -Winline\
-#                      -malign-double -malign-loops=4 -minline-all-stringops \
-#                      -march=athlon -mcpu=athlon
-       #-Wmissing-prototypes
-       LDFLAGS=-Wl,-O2 -Wl,-E $(PROFILE)
+       CFLAGS+=-O9 -funroll-loops  -Wcast-align $(PROFILE) -Winline\
+                       -malign-double -malign-loops=4
+                       #-Wmissing-prototypes \
+       
+ifneq (,$(findstring 3.0, $(CC_VER)))
+       CFLAGS+=-minline-all-stringops \
+                               -march=athlon \
+                               #-mcpu=athlon
+endif
+       LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE)
        # 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)
+       CFLAGS+=-g -Wcast-align -Winline $(PROFILE)
+       LDFLAGS+=-g -Wl,-E $(PROFILE)
 endif
 
 #*FLAGS used for compiling the modules
@@ -107,10 +127,10 @@ LIBS=-lfl -ldl
 
 
 #arch specific stuff
-ifeq ($(ARCH), Linux)
+ifeq ($(OS), Linux)
 
 endif
-ifeq  ($(ARCH), SunOS)
+ifeq  ($(OS), SunOS)
        ifeq ($(mode), release)
                LDFLAGS=-O2 $(PROFILE)
                MOD_LDFLAGS=-O2 -G
@@ -118,18 +138,18 @@ ifeq  ($(ARCH), SunOS)
                LDFLAGS=-g $(PROFILE)
                MOD_LDFLAGS=-g -G
        endif
-       
+
 YACC=yacc
 LIBS+=-L/usr/local/lib -lxnet # or -lnsl -lsocket or -lglibc ?
 
 endif
-ifeq ($(ARCH), FreeBSD)
+ifeq ($(OS), FreeBSD)
 
 YACC=yacc
 LIBS= -lfl  #dlopen is in libc
 
 endif
-ifneq (,$(findstring CYGWIN, $(ARCH)))
+ifneq (,$(findstring CYGWIN, $(OS)))
 
 #cygwin is the same as common