aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-22 17:42:14 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-22 17:42:14 +0000
commitae5c80e1deeae11fa0f3478a6efa03e38971897f (patch)
treea3a0875ae4e73c9d9a1fc67f56ffa1ce73fe5457 /Makefile
parent8f813d432c685f0b0c25e98261379b083263cf32 (diff)
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
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile28
1 files changed, 11 insertions, 17 deletions
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