From ae5c80e1deeae11fa0f3478a6efa03e38971897f Mon Sep 17 00:00:00 2001 From: markster Date: Tue, 22 Jun 2004 17:42:14 +0000 Subject: Merge major BSD mutex and symbol conflict patches (bug #1816) (link patch still pending) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3273 f38db490-d61c-443f-a65b-d21fe96a405b --- Makefile | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c5505ccf6..41c824325 100755 --- a/Makefile +++ b/Makefile @@ -26,15 +26,12 @@ PROC=k8 #PROC=athlon OPTIONS+=-m64 endif -else -ifeq (${OSARCH},FreeBSD) -PROC=$(shell uname -m) -else -ifeq (${OSARCH},OpenBSD) -PROC=$(shell uname -m) -endif endif + +ifeq ($(findstring BSD,${OSARCH}),BSD) +PROC=$(shell uname -m) endif + # Pentium Pro Optimize #PROC=i686 @@ -120,10 +117,15 @@ CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarati CFLAGS+=$(OPTIMIZE) 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) + ifeq (${OSARCH},FreeBSD) -CFLAGS+=-pthread +OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) +CFLAGS+=$(if ${OSVERSION}<500016,-D_THREAD_SAFE) +LIBS+=$(if ${OSVERSION}<502102,-lc_r,-pthread) INCLUDE+=-I/usr/local/include -endif +CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi) +endif # FreeBSD + ifeq (${OSARCH},OpenBSD) CFLAGS+=-pthread endif @@ -161,14 +163,6 @@ SUBDIRS=res channels pbx apps codecs formats agi cdr astman stdtime ifeq (${OSARCH},Linux) LIBS=-ldl -lpthread endif -ifeq (${OSARCH},OpenBSD) -LIBS=-pthread -else -ifeq (${OSARCH},FreeBSD) -LIBS=-pthread -else -endif -endif LIBS+=-lncurses -lm ifeq (${OSARCH},Linux) LIBS+=-lresolv #-lnjamd -- cgit v1.2.3