aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-31 16:33:00 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-31 16:33:00 +0000
commit4d4a7c00d7059211a2b10fbeca6d442fd58e8a77 (patch)
tree84d97a2ef137a860bc9d7d4c32d01ec8f0dbd6b2
parent28f0f8240e24ca71d123648b9078941eb3771be3 (diff)
More Asterisk sparc patches (courtesy Belgarath)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3693 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xMakefile11
-rwxr-xr-xcdr/Makefile12
-rwxr-xr-xchannels/Makefile10
-rwxr-xr-xchannels/chan_sip.c14
-rwxr-xr-xcodecs/gsm/Makefile9
-rwxr-xr-xcodecs/lpc10/Makefile7
-rwxr-xr-xdb1-ast/Makefile6
7 files changed, 58 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index c92295748..2457ea8ac 100755
--- a/Makefile
+++ b/Makefile
@@ -27,8 +27,15 @@ PROC=k8
OPTIONS+=-m64
endif
ifeq ($(PROC),sparc64)
+#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
+#This works for even old (2.96) versions of gcc and provides a small boost either way.
+#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
+#So we go lowest common available by gcc and go a step down, still a step up from
+#the default as we now have a better instruction set to work with. - Belgarath
PROC=ultrasparc
-CFLAGS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
+OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
+OPTIONS+=-fomit-frame-pointer
endif
endif
@@ -55,7 +62,7 @@ PWD=$(shell pwd)
#K6OPT = -DK6OPT
#Tell gcc to optimize the asterisk's code
-OPTIMIZE=-O6
+OPTIMIZE+=-O6
#Include debug symbols in the executables (-g) and profiling info (-pg)
DEBUG=-g #-pg
diff --git a/cdr/Makefile b/cdr/Makefile
index d2ba09cac..5430f5c5f 100755
--- a/cdr/Makefile
+++ b/cdr/Makefile
@@ -17,11 +17,23 @@ MODS=cdr_csv.so cdr_manager.so
CFLAGS+=-fPIC
+PROC=$(shell uname -m)
OSARCH=$(shell uname -s)
+
ifeq (${OSARCH},FreeBSD)
SOLINK+=-L/usr/local/lib
endif
+#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
+#This works for even old (2.96) versions of gcc and provides a small boost either way.
+#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn.t support it.
+#So we go lowest common available by gcc and go a step down, still a step up from
+#the default as we now have a better instruction set to work with. - Belgarath
+ifeq ($(PROC),sparc64)
+PROC=ultrasparc
+CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
+endif
+
#
# unixODBC stuff...
#
diff --git a/channels/Makefile b/channels/Makefile
index d9b670999..f73ce058c 100755
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -7,11 +7,15 @@
#
# Mark Spencer <markster@linux-support.net>
#
+# Edited By Belgarath <> Aug 28 2004
+# Added bare bones ultrasparc-linux support.
+#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
OSARCH=$(shell uname -s)
+PROC=$(shell uname -m)
USE_MYSQL_FRIENDS=0
USE_SIP_MYSQL_FRIENDS=0
@@ -45,6 +49,12 @@ MYSQLLIB=-L/usr/lib/mysql -lmysqlclient
PTLIB=-lpt_linux_x86_r
H323LIB=-lh323_linux_x86_r
CHANH323LIB=-ldl
+
+ifeq ($(PROC),sparc64)
+PROC=ultrasparc
+CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
+endif
+
endif
ifeq (${OSARCH},FreeBSD)
PTLIB=-lpt_FreeBSD_x86_r
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 86675b791..59dbf3280 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3685,21 +3685,19 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, char *cmd, c
} else {
snprintf(invite, sizeof(invite), "sip:%s", p->tohost);
}
+ if (!ast_strlen_zero(p->extraparams)) {
+ strncat(invite, ";", sizeof(invite) - strlen(invite));
+ strncat(invite, p->extraparams, sizeof(invite) - strlen(invite));
+ }
strncpy(p->uri, invite, sizeof(p->uri) - 1);
/* If there is a VXML URL append it to the SIP URL */
if (vxml_url)
{
- if (strlen(p->extraparams))
- snprintf(to, sizeof(to), "<%s;%s>;%s", invite, p->extraparams, vxml_url);
- else
- snprintf(to, sizeof(to), "<%s>;%s", invite, vxml_url);
+ snprintf(to, sizeof(to), "<%s>;%s", invite, vxml_url);
}
else
{
- if (strlen(p->extraparams))
- snprintf(to, sizeof(to), "<%s;%s>", invite, p->extraparams);
- else
- snprintf(to, sizeof(to), "<%s>", invite);
+ snprintf(to, sizeof(to), "<%s>", invite);
}
memset(req, 0, sizeof(struct sip_request));
init_req(req, cmd, invite);
diff --git a/codecs/gsm/Makefile b/codecs/gsm/Makefile
index 572f61e12..a21bd7e52 100755
--- a/codecs/gsm/Makefile
+++ b/codecs/gsm/Makefile
@@ -49,6 +49,15 @@ endif
endif
endif
+#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
+#This works for even old (2.96) versions of gcc and provides a small boost either way.
+#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
+#So we go lowest common available by gcc and go a step down, still a step up from
+#the default as we now have a better instruction set to work with. - Belgarath
+ifeq (${PROC},ultrasparc)
+OPTIMIZE+=-mcpu=v8 -mtune=$(PROC) -O3 -fomit-frame-pointer
+endif
+
PG =
#PG = -g -pg
######### Profiling flags. If you don't know what that means, leave it blank.
diff --git a/codecs/lpc10/Makefile b/codecs/lpc10/Makefile
index f747e64a5..23d6886e8 100755
--- a/codecs/lpc10/Makefile
+++ b/codecs/lpc10/Makefile
@@ -31,8 +31,13 @@ ifneq ($(findstring BSD,${OSARCH}),BSD)
ifneq ($(PROC),ppc)
ifneq ($(PROC),x86_64)
ifneq ($(PROC),alpha)
+#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
+#This works for even old (2.96) versions of gcc and provides a small boost either way.
+#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn.t support it.
+#So we go lowest common available by gcc and go a step down, still a step up from
+#the default as we now have a better instruction set to work with. - Belgarath
ifeq ($(PROC),ultrasparc)
- CFLAGS+= -mtune=$(PROC)
+ CFLAGS+= -mtune=$(PROC) -mcpu=v8 -O3 -fomit-frame-pointer
else
CFLAGS+= -march=$(PROC)
endif
diff --git a/db1-ast/Makefile b/db1-ast/Makefile
index 0bb8ea5c5..f8192f795 100755
--- a/db1-ast/Makefile
+++ b/db1-ast/Makefile
@@ -7,6 +7,12 @@ SOVER=2.1
else
SOVER=2
endif
+#Added support for UltraSparc - Belgarath
+ifeq ($(ARCH),sparc64)
+PROC=ultrasparc
+CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
+endif
+
LIBDBSO=libdb.so.$(SOVER)
PROG= db_dump185
OBJ1= hash.o hash_bigkey.o hash_buf.o hash_func.o hash_log2.o hash_page.o \