aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile28
1 files changed, 20 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 5a6a51c49..d6ff5fe99 100755
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,7 @@ OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1
OPTIONS+=-fomit-frame-pointer
endif
+MPG123TARG=linux
endif
ifeq ($(findstring BSD,${OSARCH}),BSD)
@@ -138,15 +139,17 @@ CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/us
ifeq (${OSARCH},FreeBSD)
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)
+CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
INCLUDE+=-I/usr/local/include
CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
+MPG123TARG=freebsd
endif # FreeBSD
ifeq (${OSARCH},NetBSD)
CFLAGS+=-pthread
-INCLUDE+=-I/usr/local/include
+INCLUDE+=-I/usr/local/include -I/usr/pkg/include
+MPG123TARG=netbsd
endif
ifeq (${OSARCH},OpenBSD)
@@ -197,7 +200,7 @@ ifeq (${OSARCH},FreeBSD)
LIBS+=-lcrypto
endif
ifeq (${OSARCH},NetBSD)
-LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -lncurses
+LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -L/usr/pkg/lib -lncurses
endif
ifeq (${OSARCH},OpenBSD)
LIBS=-lcrypto -lpthread -lm -lncurses
@@ -307,7 +310,7 @@ clean:
rm -f build.h
rm -f ast_expr.c
@if [ -e editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
- @if [ -d mpg123-0.59r ]; then make -C mpg123-0.59r clean; fi
+ @if [ -d mpg123-0.59r ]; then $(MAKE) -C mpg123-0.59r clean; fi
$(MAKE) -C db1-ast clean
$(MAKE) -C stdtime clean
@@ -405,7 +408,7 @@ bininstall: all
fi
( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then make -C mpg123-0.59r install; fi
+ if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
@echo " +---- Asterisk Installation Complete -------+"
@echo " + +"
@echo " + YOU MUST READ THE SECURITY DOCUMENT +"
@@ -518,7 +521,7 @@ mpg123:
@wget -V >/dev/null || (echo "You need wget" ; false )
[ -f mpg123-0.59r.tar.gz ] || wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz
[ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz
- make -C mpg123-0.59r linux
+ $(MAKE) -C mpg123-0.59r $(MPG123TARG)
config:
if [ -d /etc/rc.d/init.d ]; then \
@@ -537,12 +540,21 @@ depend: .depend
for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
.depend:
+ @if ! which mpg123 &>/dev/null ; then \
+ echo "*** You don't have mpg123 installed. You're going to need ***";\
+ echo "*** it if you want MusicOnHold ***";\
+ elif ! mpg123 --longhelp 2>&1 | grep .59r &>/dev/null ; then \
+ echo "*************************************************************";\
+ echo "*** You have the WRONG version of mpg123... you need .59r ***";\
+ echo "*** Use 'make mpg123' to get the right verison ***";\
+ echo "*************************************************************";\
+ fi
./mkdep ${CFLAGS} `ls *.c`
FORCE:
%_env:
- make -C $(shell echo $@ | sed "s/_env//g") env
+ $(MAKE) -C $(shell echo $@ | sed "s/_env//g") env
env:
env