This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
spandsp.mk
90 lines (69 loc) · 2.69 KB
/
spandsp.mk
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
84
85
86
87
88
89
#########################################################
# spandsp for uClinux and Asterisk,
# Jeff Knighton Feb 2008
#
# usage: make -f spandsp.mk spandsp
#
# Run after building uClinux-dist, copies shared libs to
# uClinux-dist/staging, ready for use in Asterisk if
# required.
#########################################################
include rules.mk
SPANDSP_SITE=http://www.soft-switch.org/downloads/spandsp/old
SPANDSP_VERSION=0.0.4
SPANDSP_SOURCE=spandsp-0.0.4pre16.tgz
TIFF_VERSION=3.8.2
SPANDSP_DIR=$(BUILD_DIR)/spandsp-$(SPANDSP_VERSION)
SPANDSP_CONFIGURE_OPTS=--host=bfin-linux-uclibc --enable-fixed-point
TARGET_DIR=$(BUILD_DIR)/tmp/spandsp/ipkg/spandsp
PKG_NAME:=spandsp
PKG_VERSION:=$(SPANDSP_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/spandsp
TIFF_LDFLAGS=-L$(BUILD_DIR)/tiff-$(TIFF_VERSION)/libtiff/.libs
TIFF_CFLAGS=-I$(BUILD_DIR)/tiff-$(TIFF_VERSION)/libtiff
$(DL_DIR)/$(SPANDSP_SOURCE):
$(WGET) -P $(DL_DIR) $(SPANDSP_SITE)/$(SPANDSP_SOURCE)
spandsp-source: $(DL_DIR)/$(SPANDSP_SOURCE)
$(SPANDSP_DIR)/.unpacked: $(DL_DIR)/$(SPANDSP_SOURCE)
tar -xzvf $(DL_DIR)/$(SPANDSP_SOURCE)
touch $(SPANDSP_DIR)/.unpacked
$(SPANDSP_DIR)/.configured: $(SPANDSP_DIR)/.unpacked
cp -v -f $(BUILD_DIR)/patch/config.sub-spandsp-$(SPANDSP_VERSION) $(SPANDSP_DIR)/config/config.sub
cp -v -f $(BUILD_DIR)/patch/configure-spandsp-$(SPANDSP_VERSION) $(SPANDSP_DIR)/configure
chmod a+x $(SPANDSP_DIR)/configure
cd $(SPANDSP_DIR); LDFLAGS=$(TIFF_LDFLAGS) CFLAGS=$(TIFF_CFLAGS) ./configure $(SPANDSP_CONFIGURE_OPTS)
touch $(SPANDSP_DIR)/.configured
spandsp: $(SPANDSP_DIR)/.configured
make LDFLAGS=$(TIFF_LDFLAGS) CFLAGS=$(TIFF_CFLAGS) STAGEDIR=$(STAGING_DIR) -C $(SPANDSP_DIR)/
#copy header files to staging directory
mkdir -p $(STAGING_DIR)/usr/include/spandsp
cp -f $(SPANDSP_DIR)/src/spandsp/* $(STAGING_DIR)/usr/include/spandsp
cp -f $(SPANDSP_DIR)/src/.libs/libspandsp* $(STAGING_DIR)/usr/lib/
# setup directories for package
rm -Rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR)/lib
#copy to the package location
cp -f $(SPANDSP_DIR)/src/.libs/libspandsp.so.0 $(TARGET_DIR)/lib
cd $(TARGET_DIR)/lib; ln -sf libspandsp.so.0 libspandsp.so
$(TARGET_STRIP) $(TARGET_DIR)/lib/libspandsp.so.0
touch $(PKG_BUILD_DIR)/.built
all: spandsp
spandsp-dirclean:
rm -rf $(SPANDSP_DIR)
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Spandsp
DESCRIPTION:=\
Telephony Algorithms and Digital Signal Processing Routines.
URL:=http://soft-switch.org
endef
#post installation - do nothing
define Package/$(PKG_NAME)/postinst
endef
#pre-remove
define Package/$(PKG_NAME)/prerm
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
spandsp-package: spandsp $(PACKAGE_DIR)/$(PKG_NAME)_$(VERSION)_$(PKGARCH).ipk