0415ba8
--- Makefile.defs~	2009-01-20 21:02:34.000000000 +0300
0415ba8
+++ Makefile.defs	2009-04-19 20:45:30.208412422 +0400
0415ba8
@@ -1,10 +1,3 @@
0415ba8
-ifeq ($(makefile_defs), 1)
0415ba8
-else
0415ba8
-makefile_defs=1
0415ba8
-export makefile_defs
0415ba8
-
0415ba8
-SVN_REV?=r$(shell svnversion -n .)
0415ba8
-
0415ba8
 #version number
0415ba8
 VERSION = 1
0415ba8
 PATCHLEVEL = 1
0415ba8
@@ -14,153 +7,19 @@
0415ba8
 REL_VERSION=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)
0415ba8
 RELEASE=$(REL_VERSION)$(EXTRAVERSION)
0415ba8
 
0415ba8
-CPPFLAGS += -D_DEBUG \
0415ba8
-	  -D_THREAD_SAFE -D_REENTRANT \
0415ba8
-	  -DSEMS_VERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"'\
0415ba8
-	  -DOS='"$(OS)"' 	\
0415ba8
-#         -DMAX_RTP_SESSIONS=8192 \
0415ba8
-#         -DOpenSER \
0415ba8
-#	  -DSUPPORT_IPV6 \
0415ba8
-#	  -DNO_THREADID_LOG \
0415ba8
-
0415ba8
-# compile with spandsp DTMF detection? see soft-switch.org
0415ba8
-#   this needs a fairly new version of spandsp - tested with 0.0.4pre11
0415ba8
-#   will not work with spandsp 0.0.2 .
0415ba8
-#   (which means that current debian and gentoo packages don't work)
0415ba8
-#   
0415ba8
-#USE_SPANDSP    = yes
0415ba8
-# statically link spandsp library? 
0415ba8
-#   (might need adjusting spandsp lib path LIBSPANDSP_LDIR - may be /usr/lib)
0415ba8
-#LIBSPANDSP_STATIC = yes
0415ba8
-#LIBSPANDSP_LDIR = /usr/local/lib/
0415ba8
-
0415ba8
-
0415ba8
-# compile with sample rate conversion from secret rabbit code? 
0415ba8
-# (see http://www.mega-nerd.com/SRC/)
0415ba8
-#
0415ba8
-#USE_LIBSAMPLERATE = yes
0415ba8
-
0415ba8
-#
0415ba8
-# ZRTP support? (see zfoneproject.com)
0415ba8
-#WITH_ZRTP = yes
0415ba8
-
0415ba8
-#
0415ba8
-# exclude some modules from compilation?
0415ba8
-# e.g. python modules:
0415ba8
-#exclude_modules ?= py_sems ivr mailbox pin_collect conf_auth mp3 examples
0415ba8
-
0415ba8
 LDFLAGS += -lm
0415ba8
 
0415ba8
 OS     = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
0415ba8
 
0415ba8
-ifdef USE_SPANDSP
0415ba8
-ifneq ($(spandsp_defs), 1)
0415ba8
-spandsp_defs=1
0415ba8
-export spandsp_defs
0415ba8
-CPPFLAGS += -DUSE_SPANDSP -D__STDC_LIMIT_MACROS
0415ba8
-endif
0415ba8
-endif
0415ba8
-
0415ba8
-ifdef USE_LIBSAMPLERATE
0415ba8
-ifneq ($(libsrc_defs), 1)
0415ba8
-libsrc_defs=1
0415ba8
-export libsrc_defs
0415ba8
-CPPFLAGS += -DUSE_LIBSAMPLERATE
0415ba8
-endif
0415ba8
-endif
0415ba8
-
0415ba8
-# Additions for Solaris support.
0415ba8
-ifeq ($(OS),solaris)
0415ba8
-	GETARCH=uname -p
0415ba8
-	CPPFLAGS += -DHAVE_SYS_SOCKIO_H -DBSD_COMP -fPIC -include compat/solaris.h
0415ba8
-        CFLAGS += -DHAVE_SYS_SOCKIO_H -DBSD_COMP -fPIC -include compat/solaris.h
0415ba8
-        # For nanosleep.
0415ba8
-        LDFLAGS += -lrt
0415ba8
-        # For inet_aton.
0415ba8
-        LDFLAGS += -lresolv
0415ba8
-
0415ba8
-	# I don't have libspeex installed.
0415ba8
-	# binrpcctrl does some really weird header stuff that doesn't work.
0415ba8
-	exclude_modules += binrpcctrl ilbc speex
0415ba8
-else
0415ba8
-	GETARCH=uname -m
0415ba8
-endif
0415ba8
-
0415ba8
-ARCH ?= $(shell $(GETARCH) |sed -e s/i.86/i386/ -e s/sun4u/sparc64/  \
0415ba8
-			-e s/armv4l/arm/ -e "s/Power Macintosh/ppc/" \
0415ba8
-			-e "s/cobalt/mips2/" \
0415ba8
-			-e s/amd64/x86_64/ )
0415ba8
-
0415ba8
-# fix sparc -> sparc64
0415ba8
-ifeq ($(ARCH),sparc)
0415ba8
-	ifeq ($(shell uname -m),sun4u)
0415ba8
-		ARCH := sparc64
0415ba8
-	endif
0415ba8
-endif
0415ba8
-
0415ba8
 # need OS specific for this ?
0415ba8
 CXX = g++
0415ba8
 CC = gcc
0415ba8
 LD = $(CC)
0415ba8
 
0415ba8
-
0415ba8
-CXXFLAGS += -Wall -Wno-reorder -fPIC -g \
0415ba8
-	    -O2 $(EXTRA_CXXFLAGS)
0415ba8
-         
0415ba8
-CFLAGS += -Wall -fPIC -g -O2 $(EXTRA_CFLAGS)
0415ba8
-
0415ba8
-ifeq ($(DEBUG_PLAYOUT), yes)
0415ba8
-CPPFLAGS +=  -DDEBUG_PLAYOUTBUF
0415ba8
-endif
0415ba8
-
0415ba8
-ifdef WITH_ZRTP
0415ba8
-CPPFLAGS += -DWITH_ZRTP \
0415ba8
-	    -DBUILD_ZRTP_MUTEXES \
0415ba8
-	    -DBUILD_DEFAULT_CACHE -DBUILD_DEFAULT_TIMER -DUNIX -DBUILD_ZRTP_MUTEXES \
0415ba8
-	    -I/usr/local/include/zrtp 
0415ba8
-endif
0415ba8
-
0415ba8
 TARGET =
0415ba8
 LIB_LDFLAGS = -shared
0415ba8
 
0415ba8
-ifeq ($(OS), linux)
0415ba8
-	LDFLAGS +=  -ldl -rdynamic -lpthread
0415ba8
-else
0415ba8
-ifeq ($(OS), freebsd)
0415ba8
-	LDFLAGS += -rdynamic -pthread
0415ba8
-else
0415ba8
-ifeq ($(OS), openbsd)
0415ba8
-	LDFLAGS += -rdynamic -pthread
0415ba8
-else
0415ba8
-ifeq ($(OS), netbsd)
0415ba8
-	LDFLAGS += -rdynamic -pthread
0415ba8
-else
0415ba8
-ifeq ($(OS), darwin)
0415ba8
-	LDFLAGS += -rdynamic -pthread
0415ba8
-	LIB_LDFLAGS = -flat_namespace -undefined suppress -bundle
0415ba8
-	CXXFLAGS += -fno-common
0415ba8
-	CFLAGS += -fno-common
0415ba8
-
0415ba8
-	#necessary for sa_len|ss_len|sin_len
0415ba8
-	# may be needed on other *BSD
0415ba8
-	CPPFLAGS += -DBSD44SOCKETS
0415ba8
-
0415ba8
-	# add the DarwinPorts directory
0415ba8
-	ifneq ($(ARCH), iphone)
0415ba8
-	      CPPFLAGS += -D__DARWIN_UNIX03
0415ba8
-	      CPPFLAGS += -I /opt/local/include
0415ba8
-	      LDFLAGS += -L/opt/local/lib
0415ba8
-	endif	      
0415ba8
-
0415ba8
-	override exclude_modules += binrpcctrl mp3 examples py_sems
0415ba8
-else
0415ba8
-	LDFLAGS+= -fPIC -ldl -lsocket -lnsl -lpthread
0415ba8
-	TARGET=solaris
0415ba8
-endif
0415ba8
-endif
0415ba8
-endif
0415ba8
-endif
0415ba8
-endif
0415ba8
+LDFLAGS +=  -ldl -rdynamic -lpthread
0415ba8
 
0415ba8
 LIB_LDFLAGS += $(LDFLAGS)
0415ba8
 
0415ba8
@@ -201,28 +60,8 @@
0415ba8
 
0415ba8
 ser-cfg-dir = etc/ser/
0415ba8
 
0415ba8
-ifeq ($(OS), linux)
0415ba8
-	doc-dir = share/doc/sems/
0415ba8
-	man-dir = share/man/
0415ba8
-else
0415ba8
-ifeq ($(OS), freebsd)
0415ba8
-	doc-dir = share/doc/sems/
0415ba8
-	man-dir = man/
0415ba8
-else
0415ba8
-ifeq ($(OS), openbsd)
0415ba8
-	doc-dir = share/doc/sems/
0415ba8
-	man-dir = man/
0415ba8
-else
0415ba8
-ifeq ($(OS), netbsd)
0415ba8
-	doc-dir = share/doc/sems
0415ba8
-	man-dir = man/
0415ba8
-else
0415ba8
-	doc-dir = doc/sems/
0415ba8
-	man-dir = man/
0415ba8
-endif
0415ba8
-endif
0415ba8
-endif
0415ba8
-endif
0415ba8
+doc-dir = share/doc/sems/
0415ba8
+man-dir = share/man/
0415ba8
 
0415ba8
 # target dirs for various stuff
0415ba8
 bin-target = $(prefix)/$(bin-dir)
0415ba8
@@ -232,14 +71,8 @@
0415ba8
 ser-cfg-target =$(ser-prefix)/$(ser-cfg-dir)
0415ba8
 lib-target = $(prefix)/$(lib-dir)
0415ba8
 
0415ba8
-ifeq ($(OS), solaris)
0415ba8
-#use GNU versions
0415ba8
-INSTALL ?= ginstall
0415ba8
-TAR ?= gtar
0415ba8
-else
0415ba8
 INSTALL ?= install 
0415ba8
 TAR ?= tar
0415ba8
-endif
0415ba8
 
0415ba8
 INSTALL-TOUCH = touch          # used to create the file first (good to 
0415ba8
                                #  make solaris install work)
0415ba8
@@ -251,7 +84,7 @@
0415ba8
 
0415ba8
 #export stuff to sub-makes
0415ba8
 export REL_VERSION RELEASE OS
0415ba8
-export CPPFLAGS CXXFLAGS LDFLAGS CFLAGS LIB_LDFLAGS
0415ba8
+export LDFLAGS LIB_LDFLAGS
0415ba8
 export CXX CC LD
0415ba8
 export DESTDIR PREFIX prefix basedir ser-prefix
0415ba8
 export start-script
0415ba8
@@ -260,12 +93,6 @@
0415ba8
 export bin-target cfg-target modules-target audio-target ser-cfg-target lib-target
0415ba8
 export INSTALL TAR INSTALL-TOUCH INSTALL-CFG INSTALL-BIN INSTALL-MODULES INSTALL-DOC INSTALL-AUDIO
0415ba8
 
0415ba8
-export USE_SPANDSP LIBSPANDSP_STATIC LIBSPANDSP_LDIR
0415ba8
-export USE_LIBSAMPLERATE
0415ba8
-export WITH_ZRTP
0415ba8
-
0415ba8
-endif  # ifeq ($(makefile_defs, 1)
0415ba8
-
0415ba8
 mk-install-dirs: $(DESTDIR)$(cfg-target) \
0415ba8
 		 $(DESTDIR)$(bin-prefix)/$(bin-dir) \
0415ba8
 		 $(DESTDIR)$(modules-prefix)/$(modules-dir) \