summaryrefslogtreecommitdiff
blob: f2f2af69ad136282d5b0ee6b3fa40bbc8e5c196a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
--- app_conference/Makefile.orig	2005-10-27 19:53:35.000000000 +0200
+++ app_conference/Makefile	2006-02-11 00:07:01.000000000 +0100
@@ -17,10 +17,11 @@
 # app_conference defines which can be passed on the command-line
 #
 
-INSTALL_PREFIX := /opt/horizon
-INSTALL_MODULES_DIR := $(INSTALL_PREFIX)/lib/asterisk/modules
+DESTDIR :=
+INSTALL_MODULES_DIR := $(shell /usr/bin/asterisk-config --modulesdir)
+INSTALL_CONFIG_DIR  := $(shell /usr/bin/asterisk-config --sysconfdir)
 
-ASTERISK_INCLUDE_DIR := $(HOME)/local/asterisk/asterisk/include
+ASTERISK_INCLUDE_DIR := $(shell /usr/bin/asterisk-config --includedir)
 
 # turn app_conference debugging on or off ( 0 == OFF, 1 == ON )
 APP_CONFERENCE_DEBUG := 1
@@ -43,28 +44,16 @@
 INSTALL = install
 CC = gcc
 
-INCLUDE = -I$(ASTERISK_INCLUDE_DIR) 
+# skip asterisk includes if they are in /usr/include/asterisk
+ifneq ($(shell dirname $(ASTERISK_INCLUDE_DIR)), /usr/include)
+INCLUDE = -I$(ASTERISK_INCLUDE_DIR)
+endif
+
 LIBS = -ldl -lpthread -lm
 DEBUG := -g 
 
-CFLAGS = -pipe -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
-#CFLAGS += -O2
-#CFLAGS += -O3 -march=pentium3 -msse -mfpmath=sse,387 -ffast-math 
-# PERF: below is 10% faster than -O2 or -O3 alone.
-#CFLAGS += -O3 -ffast-math -funroll-loops
-# below is another 5% faster or so.
-CFLAGS += -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant
-
-# this is fun for PPC
-#CFLAGS += -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic
-
-# this is fun for x86
-CFLAGS += -march=pentium3 -msse -mfpmath=sse,387
-
-
-# adding -msse -mfpmath=sse has little effect.
-#CFLAGS += -O3 -msse -mfpmath=sse
-#CFLAGS += $(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
+CFLAGS += -pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
+
 CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
 CFLAGS += -DCRYPTO
 
@@ -102,16 +91,22 @@
 	rm -f *.so *.o $(OBJS)
 
 app_conference.so : $(OBJS)
-	$(CC) -pg -shared -Xlinker -x -o $@ $(OBJS)
+	$(CC) -shared -Xlinker -x -o $@ $(OBJS)
 
 vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
 	$(CC) $(PROFILE) -o $@ $^ -lm
 
 install: all
-	for x in $(SHAREDOS); do $(INSTALL) -m 755 $$x $(INSTALL_MODULES_DIR) ; done
-	/var/horizon/mojo/lib/horizoncmd restart asterisk
-
-# config: all
-# 	cp conf.conf /etc/asterisk/
-	
+	if [ ! -d ${DESTDIR}${INSTALL_MODULES_DIR} ]; then \
+		$(INSTALL) -m 755 -d ${DESTDIR}${INSTALL_MODULES_DIR} ; \
+	fi
+	for x in $(SHAREDOS); do \
+		$(INSTALL) -m 755 $$x ${DESTDIR}$(INSTALL_MODULES_DIR) ; \
+	done
+
+#config: all
+#	if [ ! -d ${DESTDIR}${INSTALL_CONFIG_DIR} ]; then \
+#		$(INSTALL) -m 755 -d ${DESTDIR}${INSTALL_CONFIG_DIR} ; \
+#	fi
+#	$(INSTALL) -m 640 conf.conf ${DESTDIR}${INSTALL_CONFIG_DIR}