1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-16 03:24:07 +00:00
freebsd-ports/net/asterisk16/files/patch-Makefile
2004-02-05 19:38:40 +00:00

302 lines
12 KiB
Plaintext

$FreeBSD$
--- Makefile.orig Wed Jan 14 08:48:38 2004
+++ Makefile Fri Jan 30 02:25:09 2004
@@ -43,10 +43,10 @@
#K6OPT = -DK6OPT
#Tell gcc to optimize the asterisk's code
-OPTIMIZE=-O6
+#OPTIMIZE=-O6
#Include debug symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g #-pg
+#DEBUG=-g #-pg
# New hangup routines for chan_zap.c
# If this flag is uncommented then you need to have new libpri code in your system
@@ -68,7 +68,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
-INSTALL_PREFIX=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
@@ -88,28 +88,26 @@
# Don't use together with -DBUSYDETECT_TONEONLY
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
+ASTBINDIR=$(INSTALL_PREFIX)/bin
+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
+ASTVARRUNDIR=/var/run
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)
-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
-INCLUDE+=-I/usr/local/include
+CFLAGS+=$(PTHREAD_CFLAGS)
endif
ifeq (${OSARCH},OpenBSD)
CFLAGS+=-pthread
@@ -151,7 +149,7 @@
LIBS=-pthread
else
ifeq (${OSARCH},FreeBSD)
-LIBS=-pthread
+LIBS=$(PTHREAD_LIBS)
else
endif
endif
@@ -179,7 +177,7 @@
SOLINK=-shared -Xlinker -x
endif
-CC=gcc
+CC?=gcc
INSTALL=install
_all: all
@@ -200,13 +198,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
-db1-ast/libdb1.a: FORCE
- @if [ -d db1-ast ]; then \
- $(MAKE) -C db1-ast libdb1.a ; \
- else \
- echo "You need to do a cvs update -d not just cvs update"; \
- exit 1; \
- fi
+#db1-ast/libdb1.a: FORCE
+# @if [ -d db1-ast ]; then \
+# $(MAKE) -C db1-ast libdb1.a ; \
+# else \
+# echo "You need to do a cvs update -d not just cvs update"; \
+# exit 1; \
+# fi
ifneq ($(wildcard .depend),)
include .depend
@@ -244,8 +242,8 @@
exit 1; \
fi
-asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a
+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBS) $(LIBEDIT) stdtime/libtime.a
subdirs:
for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done
@@ -260,10 +258,10 @@
$(MAKE) -C stdtime clean
datafiles: all
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
for x in sounds/digits/*.gsm; do \
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; \
@@ -271,18 +269,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-*; 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"; \
exit 1; \
fi; \
done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
- 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 \
@@ -294,105 +292,74 @@
fi
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
- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(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)/ ;\
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)
+ $(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
- rm -f $(DESTDIR)$(MODULES_DIR)/chan_ixj.so
- rm -f $(DESTDIR)$(MODULES_DIR)/chan_tor.so
- rm -f $(DESTDIR)$(MODULES_DIR)/cdr_mysql.so
- rm -f $(DESTDIR)$(MODULES_DIR)/cdr_unixodbc.so
- rm -f $(DESTDIR)$(MODULES_DIR)/codec_mp3_d.so
- rm -f $(DESTDIR)$(MODULES_DIR)/format_mp3.so
- rm -f $(DESTDIR)$(MODULES_DIR)/app_voicemail2.so
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
- @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
- @echo " + +"
- @echo " + Asterisk has successfully been installed. +"
- @echo " + If you would like to install the sample +"
- @echo " + configuration files (overwriting any +"
- @echo " + existing config files), run: +"
- @echo " + +"
- @echo " + $(MAKE) samples +"
- @echo " + +"
- @echo " +----------------- or ---------------------+"
- @echo " + +"
- @echo " + You can go ahead and install the asterisk +"
- @echo " + program documentation now or later run: +"
- @echo " + +"
- @echo " + $(MAKE) progdocs +"
- @echo " + +"
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds; ln -sf $(ASTSPOOLDIR)/vm . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds; ln -sf $(ASTSPOOLDIR)/voicemail . )
-install: all datafiles bininstall
+install: all datafiles bininstall samples
upgrade: all bininstall
adsi: all
- 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` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
samples: all datafiles 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 ; \
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ for x in configs/*.sample channels/h323/*.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` ;\
fi ; \
- install -m 644 $$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 "[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
+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
+ fi
for x in sounds/demo-*; 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"; \
exit 1; \
fi; \
done
for x in sounds/*.mp3; do \
- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
:> $(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 ; \