[Asterisk-Users] Best Linux for Asterisk

Ming-Wei Shih xming at spaceball.cjb.net
Sun Aug 1 09:22:54 MST 2004


Steve Totaro wrote:

>please post the makefile hackings.  i have a sparc64 gathering dust.
>
>
>---
>
this is against CVS-NHEAD-07/28/04-15:58:08
and includes my install path in /opt

Ming-Wei


diff --recursive -u asterisk/Makefile asterisk.orig/Makefile
--- asterisk/Makefile   2004-07-28 16:03:20.000000000 +0200
+++ asterisk.orig/Makefile      2004-07-18 19:58:05.000000000 +0200
@@ -16,8 +16,7 @@
 # Create OPTIONS variable
 OPTIONS=

-#OSARCH=$(shell uname -s)
-OSARCH=v9
+OSARCH=$(shell uname -s)

 ifeq (${OSARCH},Linux)
 PROC=$(shell uname -m)
@@ -51,10 +50,10 @@
 #K6OPT  = -DK6OPT

 #Tell gcc to optimize the asterisk's code
-OPTIMIZE=-mcpu=v9 -mtune=v9 -O2 -fomit-frame-pointer -pipe
+OPTIMIZE=-O6

 #Include debug symbols in the executables (-g) and profiling info (-pg)
-DEBUG= #-pg
+DEBUG=-g #-pg

 # If you are running a radio application, define RADIO_RELAX so that 
the DTMF
 # will be received more reliably
@@ -79,7 +78,7 @@

 # Where to install asterisk after compiling
 # Default -> leave empty
-INSTALL_PREFIX=/opt/asterisk
+INSTALL_PREFIX=

 # Staging directory
 # Files are copied here temporarily during the install process
@@ -99,17 +98,17 @@
 # Don't use together with -DBUSYDETECT_TONEONLY
 BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE

-ASTLIBDIR=$(INSTALL_PREFIX)/lib/
-ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/
-ASTETCDIR=$(INSTALL_PREFIX)/etc/
-ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/
-ASTLOGDIR=$(INSTALL_PREFIX)/var/log/
-ASTHEADERDIR=$(INSTALL_PREFIX)/include/
+ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
+ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
 ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
-ASTBINDIR=$(INSTALL_PREFIX)/bin
-ASTSBINDIR=$(INSTALL_PREFIX)/sbin
+ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
 ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
-ASTMANDIR=$(INSTALL_PREFIX)/share/man
+ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man

 MODULES_DIR=$(ASTLIBDIR)/modules
 AGI_DIR=$(ASTVARLIBDIR)/agi-bin
@@ -117,7 +116,7 @@
 INCLUDE=-Iinclude -I../include
 CFLAGS=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU
_SOURCE #-DMAKE_VALGRIND_HAPPY
 CFLAGS+=$(OPTIMIZE)
-CFLAGS+=$(shell if $(CC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; 
then echo ""; fi)
+CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null 
 >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
 CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
 CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo 
"-DOSP_SUPPORT -I/usr/include/osp" ; fi)

diff --recursive -u asterisk/codecs/gsm/Makefile 
asterisk.orig/codecs/gsm/Makefile
--- asterisk/codecs/gsm/Makefile        2004-07-28 16:04:54.000000000 +0200
+++ asterisk.orig/codecs/gsm/Makefile   2004-06-22 19:42:13.000000000 +0200
@@ -41,7 +41,7 @@
 ifneq (${PROC},x86_64)
 ifneq ($(shell uname -m),ppc)
 ifneq ($(shell uname -m),alpha)
-OPTIMIZE+=-mcpu=v9 -mtune=v9 -O2 -fomit-frame-pointer -pipe
+OPTIMIZE+=-march=$(PROC)
 endif
 endif
 endif
diff --recursive -u asterisk/codecs/ilbc/Makefile 
asterisk.orig/codecs/ilbc/Makefile
--- asterisk/codecs/ilbc/Makefile       2004-07-28 16:05:53.000000000 +0200
+++ asterisk.orig/codecs/ilbc/Makefile  2004-06-28 22:10:28.000000000 +0200
@@ -2,7 +2,7 @@
 ifeq (${OSARCH},Darwin)
 CFLAGS+=-Wall -Werror -fPIC -O3 -funroll-loops -fomit-frame-pointer
 else
-CFLAGS+=-Wall -Werror -fPIC -O3 -mcpu=v9 -mtune=v9 -O2 
-fomit-frame-pointer -pipe
+CFLAGS+=-Wall -Werror -fPIC -O3 -march=$(ARCH) -funroll-loops 
-fomit-frame-pointer
 endif
 LIB=libilbc.a

diff --recursive -u asterisk/codecs/lpc10/Makefile 
asterisk.orig/codecs/lpc10/Makefile
--- asterisk/codecs/lpc10/Makefile      2004-07-28 16:06:39.000000000 +0200
+++ asterisk.orig/codecs/lpc10/Makefile 2004-06-22 19:42:14.000000000 +0200
@@ -31,7 +31,7 @@
 ifneq ($(PROC),ppc)
 ifneq ($(PROC),x86_64)
 ifneq ($(PROC),alpha)
-       CFLAGS+= -mcpu=v9 -mtune=v9 -O2 -fomit-frame-pointer -pipe
+       CFLAGS+= -march=$(PROC)
 endif
 endif
 endif





More information about the asterisk-users mailing list