diff options
Diffstat (limited to 'net/asterisk10/files/patch-Makefile')
-rw-r--r-- | net/asterisk10/files/patch-Makefile | 525 |
1 files changed, 300 insertions, 225 deletions
diff --git a/net/asterisk10/files/patch-Makefile b/net/asterisk10/files/patch-Makefile index 49c66ed7e4e8..16f6b03edab1 100644 --- a/net/asterisk10/files/patch-Makefile +++ b/net/asterisk10/files/patch-Makefile @@ -3,128 +3,200 @@ $FreeBSD$ --- Makefile.orig +++ Makefile -@@ -45,6 +45,19 @@ - PROC=$(shell uname -m) - endif - -+ifeq (${OSARCH},FreeBSD) -+ifeq ($(PROC),sparc64) -+PROC=ultrasparc -+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi) -+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi) -+OPTIONS+=-fomit-frame-pointer -+endif -+ifeq ($(PROC),amd64) -+PROC=k8 -+OPTIONS+=-m64 -+endif -+endif -+ - # Pentium Pro Optimize - #PROC=i686 - -@@ -63,10 +76,10 @@ +@@ -19,8 +19,8 @@ + # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be- + # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/ + # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target +-CC=$(CROSS_COMPILE)gcc +-HOST_CC=gcc ++CC?=$(CROSS_COMPILE)gcc ++HOST_CC=${CC} + # CROSS_ARCH=Linux + # CROSS_PROC=arm + # SUB_PROC=xscale # or maverick +@@ -44,14 +44,14 @@ #K6OPT = -DK6OPT - #Tell gcc to optimize the asterisk's code + #Tell gcc to optimize the code -OPTIMIZE+=-O6 +#OPTIMIZE+=-O6 + endif - #Include debug symbols in the executables (-g) and profiling info (-pg) --DEBUG=-g #-pg -+#DEBUG=-g #-pg + #Overwite config files on "make samples" +-OVERWRITE=y ++OVERWRITE=n - # If you are running a radio application, define RADIO_RELAX so that the DTMF - # will be received more reliably -@@ -91,7 +104,7 @@ + #Include debug and macro symbols in the executables (-g) and profiling info (-pg) +-DEBUG=-g3 #-pg ++#DEBUG=-g3 #-pg + + #Set NOCRYPTO to yes if you do not want to have crypto support or + #dependencies +@@ -83,7 +83,7 @@ # Where to install asterisk after compiling # Default -> leave empty --INSTALL_PREFIX= +-INSTALL_PREFIX?= +INSTALL_PREFIX=$(PREFIX) # Staging directory # Files are copied here temporarily during the install process -@@ -111,23 +124,23 @@ - # Don't use together with -DBUSYDETECT_TONEONLY +@@ -106,17 +106,17 @@ BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE --ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk --ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk -+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk -+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk - ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk --ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk --ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk --ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk -+ASTSPOOLDIR=/var/spool/asterisk -+ASTLOGDIR=/var/log/asterisk -+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk - ASTCONFPATH=$(ASTETCDIR)/asterisk.conf --ASTBINDIR=$(INSTALL_PREFIX)/usr/bin --ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin --ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run --ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man -+ASTBINDIR=$(INSTALL_PREFIX)/bin -+ASTSBINDIR=$(INSTALL_PREFIX)/sbin -+ASTVARRUNDIR=/var/run -+ASTMANDIR=$(INSTALL_PREFIX)/man - - MODULES_DIR=$(ASTLIBDIR)/modules - AGI_DIR=$(ASTVARLIBDIR)/agi-bin - - INCLUDE=-Iinclude -I../include --CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY -+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY - CFLAGS+=$(OPTIMIZE) + ifneq ($(OSARCH),SunOS) +- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk +- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk ++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk ++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk + ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk +- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk +- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk +- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk ++ ASTSPOOLDIR=/var/spool/asterisk ++ ASTLOGDIR=/var/log/asterisk ++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk + ASTCONFPATH=$(ASTETCDIR)/asterisk.conf +- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin +- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin +- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run +- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man ++ ASTBINDIR=$(INSTALL_PREFIX)/bin ++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin ++ ASTVARRUNDIR=/var/run ++ ASTMANDIR=$(INSTALL_PREFIX)/man + MODULES_DIR=$(ASTLIBDIR)/modules + AGI_DIR=$(ASTVARLIBDIR)/agi-bin + else +@@ -218,13 +218,13 @@ + endif + + INCLUDE+=-Iinclude -I../include +-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY +-ASTCFLAGS+=$(OPTIMIZE) ++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY ++#ASTCFLAGS+=$(OPTIMIZE) + ASTOBJ=-o asterisk + + ifeq ($(findstring BSD,$(OSARCH)),BSD) + PROC=$(shell uname -m) +- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib ++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib + endif ifneq ($(PROC),ultrasparc) -@@ -138,12 +151,8 @@ - CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi) - - ifeq (${OSARCH},FreeBSD) --OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) --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 -+CFLAGS+=$(PTHREAD_CFLAGS) -+LIBS+=$(PTHREAD_LIBS) +@@ -235,8 +235,8 @@ + ASTCFLAGS+=-fsigned-char + endif + +-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),) +- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp ++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),) ++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp + else + ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),) + ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp +@@ -245,27 +245,24 @@ + + ifeq ($(OSARCH),FreeBSD) + BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk) +- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) +- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi) +- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),) +- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp ++ ASTCFLAGS+=$(PTHREAD_CFLAGS) ++ LIBS+=$(PTHREAD_LIBS) ++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),) ++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp + endif + MPG123TARG=freebsd + +- # XXX FreeBSD paths +- PREFIX?=/usr/local +- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk +- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk +- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk +- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk +- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk +- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk ++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk ++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk ++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk ++ ASTSPOOLDIR=/var/spool/asterisk ++ ASTLOGDIR=/var/log/asterisk ++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk + ASTCONFPATH=$(ASTETCDIR)/asterisk.conf +- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin +- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin +- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run +- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man +- # XXX end FreeBSD paths ++ ASTBINDIR=$(INSTALL_PREFIX)/bin ++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin ++ ASTVARRUNDIR=/var/run ++ ASTMANDIR=$(INSTALL_PREFIX)/man + endif # FreeBSD - ifeq (${OSARCH},NetBSD) -@@ -160,7 +169,10 @@ - #CFLAGS+=-DOLD_DSP_ROUTINES +@@ -281,7 +278,7 @@ - CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi) --CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi) -+CFLAGS+=-I$(LOCALBASE)/include -+ifdef WITH_ZAPTEL -+CFLAGS+=-DZAPTEL_OPTIMIZATIONS -+endif + ifeq ($(OSARCH),SunOS) + ASTCFLAGS+=-Wcast-align -DSOLARIS +- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include ++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include + endif - LIBEDIT=editline/libedit.a + ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN) +@@ -296,7 +293,7 @@ -@@ -222,7 +234,7 @@ - SOLINK=-shared -Xlinker -x + ifndef WITHOUT_ZAPTEL + +-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),) ++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),) + ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS + endif + +@@ -323,7 +320,7 @@ + ASTERISKVERSIONNUM=999999 + ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name) + else +- ASTERISKVERSIONNUM=000000 ++ ASTERISKVERSIONNUM?=000000 + endif + endif + +@@ -388,10 +385,10 @@ endif --CC=gcc -+CC?=gcc - INSTALL=install + ifeq ($(OSARCH),SunOS) +- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib ++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib + OBJS+=strcompat.o + ASTLINK= +- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib ++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib + endif + + ifeq ($(MAKETOPLEVEL),$(MAKELEVEL)) +@@ -399,7 +396,7 @@ + endif - _all: all -@@ -234,7 +246,7 @@ + # This is used when generating the doxygen documentation +-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),) ++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),) + HAVEDOT=yes + else + HAVEDOT=no +@@ -418,7 +415,7 @@ @echo " + $(MAKE) install +" @echo " +-------------------------------------------+" --all: depend asterisk subdirs -+all: depend asterisk subdirs manpage +-all: cleantest depend asterisk subdirs ++all: cleantest depend asterisk subdirs manpage - editline/config.h: - cd editline && unset CFLAGS LIBS && ./configure ; \ -@@ -243,13 +255,13 @@ + #ifneq ($(wildcard tags),) + ctags: tags +@@ -437,13 +434,13 @@ cd editline && unset CFLAGS LIBS && test -f config.h || ./configure $(MAKE) -C editline libedit.a @@ -144,55 +216,57 @@ $FreeBSD$ +# fi ifneq ($(wildcard .depend),) - include .depend -@@ -271,13 +283,10 @@ - - asterisk.o: asterisk.c build.h - --manpage: asterisk.8.gz -+manpage: asterisk.8 - --asterisk.8.gz: asterisk.sgml -- rm -f asterisk.8 -- docbook2man asterisk.sgml -- mv ./*.8 asterisk.8 -- gzip asterisk.8 -+asterisk.8: asterisk.8.gz -+ gzcat asterisk.8.gz > asterisk.8 - - ifneq ($(strip $(ASTERISKVERSION)),) - build.h: .version -@@ -295,8 +304,8 @@ - exit 1; \ + include .depend +@@ -510,14 +507,14 @@ + cygwin_a: + $(MAKE) -C cygwin all + +-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS) ++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS) + build_tools/make_build_h > include/asterisk/build.h.tmp + if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \ + mv include/asterisk/build.h.tmp include/asterisk/build.h ; \ fi - --asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS) -- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS) -+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS) -+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS) + rm -f include/asterisk/build.h.tmp + $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c +- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS) ++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS) muted: muted.o - $(CC) -o muted muted.o -@@ -315,28 +324,28 @@ - $(MAKE) -C stdtime clean + $(CC) $(AUDIO_LIBS) -o muted muted.o +@@ -539,38 +536,38 @@ datafiles: all + if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi - mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits +- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros for x in sounds/digits/*.gsm; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \ + if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \ else \ echo "No description for $$x"; \ exit 1; \ fi; \ done +- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate + for x in sounds/dictate/*.gsm; do \ + if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \ ++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \ + else \ + echo "No description for $$x"; \ + exit 1; \ + fi; \ + done - mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters for x in sounds/letters/*.gsm; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \ + if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \ else \ echo "No description for $$x"; \ @@ -202,17 +276,17 @@ $FreeBSD$ - mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic for x in sounds/phonetic/*.gsm; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \ + if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \ else \ echo "No description for $$x"; \ exit 1; \ -@@ -344,18 +353,18 @@ +@@ -578,18 +575,18 @@ done - for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ + for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \ + if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ else \ echo "No description for $$x"; \ @@ -224,70 +298,80 @@ $FreeBSD$ + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images for x in images/*.jpg; do \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \ done - mkdir -p $(DESTDIR)$(AGI_DIR) + $(MKDIR) $(DESTDIR)$(AGI_DIR) update: - @if [ -d CVS ]; then \ -@@ -367,127 +376,90 @@ - fi + @if [ -d .svn ]; then \ +@@ -618,75 +615,53 @@ + OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h))) bininstall: all - mkdir -p $(DESTDIR)$(MODULES_DIR) - mkdir -p $(DESTDIR)$(ASTSBINDIR) - mkdir -p $(DESTDIR)$(ASTETCDIR) - mkdir -p $(DESTDIR)$(ASTBINDIR) -- mkdir -p $(DESTDIR)$(ASTSBINDIR) - mkdir -p $(DESTDIR)$(ASTVARRUNDIR) - mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail +- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate +- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system - mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp -- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/ -- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ -- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ +- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme +- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor +- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi +- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi +- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi + $(MKDIR) $(DESTDIR)$(MODULES_DIR) + $(MKDIR) $(DESTDIR)$(ASTSBINDIR) + $(MKDIR) $(DESTDIR)$(ASTETCDIR) + $(MKDIR) $(DESTDIR)$(ASTBINDIR) -+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR) + $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR) + $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail ++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate ++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system + $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp -+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/ ++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme ++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor ++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi ++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi ++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi + ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk +- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ +- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ + $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ -+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ ++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \ -- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\ -+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\ + cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\ + chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\ fi for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done -- install -d $(DESTDIR)$(ASTHEADERDIR) -- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR) +- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR) +- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR) + $(MKDIR) $(DESTDIR)$(ASTHEADERDIR) + $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR) - rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm -- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail -- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \ -- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \ -- else \ -- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \ -- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \ -- fi -- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm + if [ -n "$(OLDHEADERS)" ]; then \ + rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\ + fi + rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail - mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds - mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv +- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom - mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys - mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware - mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax - mkdir -p $(DESTDIR)$(ASTMANDIR)/man8 -- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys -- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8 -+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm +- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys +- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys +- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 +- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8 +- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8 +- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds + $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv ++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware + $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax @@ -295,14 +379,16 @@ $FreeBSD$ + $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys + $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys + $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 ++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8 ++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8 ++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 if [ -d contrib/firmware/iax ]; then \ -- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \ +- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \ + $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \ else \ echo "You need to do cvs update -d not just cvs update" ; \ fi -- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . ) -- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . ) + ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . ) - if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi - @echo " +---- Asterisk Installation Complete -------+" - @echo " + +" @@ -325,85 +411,74 @@ $FreeBSD$ - @echo " + **Note** This requires that you have +" - @echo " + doxygen installed on your local system +" - @echo " +-------------------------------------------+" -- @echo " + +" -- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +" -- @echo " + +" -- @echo " + If you are downgrading from CVS HEAD to +" -- @echo " + a stable release, remember to delete +" -- @echo " + everything from your asterisk modules +" -- @echo " + directory (/usr/lib/asterisk/modules/) +" -- @echo " + and the asterisk header directory +" -- @echo " + (/usr/include/asterisk/) +" -- @echo " + before doing a '$(MAKE) install'. +" -- @echo " + +" -- @echo " +-------------------------------------------+" -+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . ) -+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . ) + @$(MAKE) -s oldmodcheck + NEWMODS=$(notdir $(wildcard */*.so)) +@@ -710,7 +685,7 @@ + echo " WARNING WARNING WARNING" ;\ + fi -install: all datafiles bininstall +install: all datafiles bininstall samples - + @if [ -x /usr/sbin/asterisk-post-install ]; then \ + /usr/sbin/asterisk-post-install $(DESTDIR) . ; \ + fi +@@ -718,16 +693,19 @@ upgrade: all bininstall - adsi: all + adsi: - mkdir -p $(DESTDIR)$(ASTETCDIR) + $(MKDIR) $(DESTDIR)$(ASTETCDIR) for x in configs/*.adsi; do \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \ - if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \ -- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \ + if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \ fi ; \ done - samples: all datafiles adsi + samples: adsi - mkdir -p $(DESTDIR)$(ASTETCDIR) -- for x in configs/*.sample; do \ -- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \ -- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \ ++ echo ADSI INSTALL $(BSD_INSTALL_DATA) + $(MKDIR) $(DESTDIR)$(ASTETCDIR) -+ for x in configs/*.sample channels/h323/*.sample; do \ + for x in configs/*.sample; do \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\ -+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \ -+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ + if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \ + if [ "$(OVERWRITE)" = "y" ]; then \ + if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \ +@@ -740,7 +718,7 @@ + continue; \ + fi ;\ fi ; \ -- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ ++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\ done -- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf -+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist -+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \ -+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \ -+ fi + if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \ + ( \ +@@ -759,25 +737,25 @@ + echo ";astctlowner = root" ; \ + echo ";astctlgroup = apache" ; \ + echo ";astctl = asterisk.ctl" ; \ +- ) > $(DESTDIR)$(ASTCONFPATH) ; \ ++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \ + else \ + echo "Skipping asterisk.conf creation"; \ + fi +- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ ++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ for x in sounds/demo-*; do \ - if grep -q "^%`basename $$x`%" sounds.txt; then \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ + if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \ else \ echo "No description for $$x"; \ exit 1; \ fi; \ done +- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ ++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ for x in sounds/*.mp3; do \ -- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ + $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \ done rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3 @@ -412,18 +487,18 @@ $FreeBSD$ :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \ cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \ -@@ -502,7 +474,7 @@ - @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 ) - @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 ) - install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi -- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk -+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk +@@ -791,7 +769,7 @@ + @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 ) + @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 ) + $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi +- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk ++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk for x in images/*.gif; do \ - install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \ + $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \ done -@@ -522,10 +494,10 @@ +@@ -820,10 +798,10 @@ - __rpm: _version + __rpm: include/asterisk/version.h spec rm -rf /tmp/asterisk ; \ - mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \ + $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \ @@ -431,6 +506,6 @@ $FreeBSD$ $(MAKE) DESTDIR=/tmp/asterisk samples ; \ - mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \ + $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \ - cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \ - sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \ + cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \ rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec + |