summaryrefslogtreecommitdiff
blob: 9b9b260267141fecd48be1eb126995dac58efafe (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
--- chan_sccp-20050902/Makefile.orig	2005-09-02 22:16:58.000000000 +0000
+++ chan_sccp-20050902/Makefile	2005-09-02 22:17:33.000000000 +0000
@@ -1,16 +1,14 @@
 INSTALL_PREFIX=
-ASTERISK_HEADER_DIR=$(INSTALL_PREFIX)/usr/include
+ASTERISK_HEADER_DIR=/usr/include
+AST_CFG=/usr/bin/asterisk-config
 
 # Location asterisk modules install to
 AST_MODULES_DIR=$(INSTALL_PREFIX)/usr/lib/asterisk/modules/
 
-PROC=$(shell uname -m)
-
 DEBUG=-ggdb
 
-DEFINE=-Iinclude -D_REENTRANT -D_GNU_SOURCE  -O  -DCRYPTO -fPIC
+DEFINE=-Iinclude -D_REENTRANT -D_GNU_SOURCE -O -DCRYPTO -fPIC
 CFLAG= -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-CFLAG+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo " -march=$(PROC)"; fi)
 CFLAG+=$(shell if uname -m | grep -q ppc; then echo " -fsigned-char"; fi)
 #CFLAG+= -pedantic
 #CFLAG+= -W
@@ -40,14 +38,14 @@
 FLS+=sccp_socket
 FLS+=sccp_indicate
 
-CFLAGS+=$(DEFINE) $(CFLAG) -I$(ASTERISK_HEADER_DIR)
+CFLAGS+=$(DEFINE) $(CFLAG)
 HEADERS=$(shell for i in $(FLS) ; do echo $$i.h ; done)
 OBJECTS=$(shell for i in $(FLS) ; do echo .tmp/$$i.o ; done)
 SOURCES=$(shell for i in $(FLS) ; do echo $$i.c ; done)
 
 chan_sccp.so: .config .tmp $(OBJECTS) $(HEADERS) $(SOURCES)
 	@echo "Linking chan_sccp.so"
-	@$(CC) -shared -Xlinker -x -o chan_sccp.so $(OBJECTS)
+	@$(CC) $(shell $(AST_CFG) --solink) -o chan_sccp.so $(OBJECTS)
 
 .tmp/%.o: $(HEADERS)
 	@printf "Now compiling .... %-15s\t%s lines \n" $*.c "`wc -l <$*.c`"
@@ -55,18 +53,14 @@
 
 all: chan_sccp.so
 
-install: chan_sccp.so
+install:
 	@echo "Now Installing chan_sccp.so"
-	@install -m 755 chan_sccp.so $(AST_MODULES_DIR);
+	@install -D -m 755 chan_sccp.so $(AST_MODULES_DIR)/chan_sccp.so;
 	@if ! [ -f $(INSTALL_PREFIX)/etc/asterisk/sccp.conf ]; then \
 		echo "Installing config file $(INSTALL_PREFIX)/etc/asterisk/sccp.conf"; \
 		mkdir -p $(INSTALL_PREFIX)/etc/asterisk; \
 		cp conf/sccp.conf $(INSTALL_PREFIX)/etc/asterisk/; \
 	fi
-	@echo "Chan_sccp is now installed"
-	@echo "Remember to disable chan_skinny by adding the following"
-	@echo "line to /etc/asterisk/modules.conf:"
-	@echo "noload => chan_skinny.so"
 
 clean:
 	rm -rf .config.h chan_sccp.so .tmp