From 12155fa6c30257d36c786be73a9fa10f6c5ed973 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Tue, 31 Aug 2004 17:40:59 +0000 Subject: [PATCH] Minor Makefile fixes for libpri (bug #2330) git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@132 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a82d6ad..2647c58 100755 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ #LIBPRI_COUNTERS=-DLIBPRI_COUNTERS OSARCH=$(shell uname -s) +PROC=$(shell uname -m) TOBJS=testpri.o T2OBJS=testprilib.o @@ -46,6 +47,14 @@ CFLAGS += -I../zaptel -I../zapata 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 doesnt support it. +ifeq ($(PROC),sparc64) +PROC=ultrasparc +CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8 +endif + all: depend $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY) update: @@ -69,16 +78,16 @@ uninstall: rm -f $(INSTALL_PREFIX)/usr/include/libpri.h pritest: pritest.o - $(CC) -o pritest pritest.o -L. -lpri -lzap + $(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS) testprilib.o: testprilib.c $(CC) $(CFLAGS) -D_REENTRANT -D_GNU_SOURCE -o $@ -c $< testprilib: testprilib.o - $(CC) -o testprilib testprilib.o -L. -lpri -lpthread + $(CC) -o testprilib testprilib.o -L. -lpri -lpthread $(CFLAGS) pridump: pridump.o - $(CC) -o pridump pridump.o -L. -lpri -lzap + $(CC) -o pridump pridump.o -L. -lpri -lzap $(CFLAGS) include .depend