2 # Copyright (C) 2017 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
15 PKG_MAINTAINER
:=Jiri Slachta
<jiri@slachta.eu
>
17 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
21 # WARNING: Because this module is target specific ("nonshared") it cannot depend
22 # on the shared Asterisk package. Asterisk needs to be built _before_ this
23 # package, though, to generate the necessary headers.
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/version.mk
28 define Package
/$(PKG_NAME
)/Default
32 TITLE
:=Lantiq channel driver
33 URL
:=https
://github.com
/kochstefan
/asterisk_channel_lantiq
34 DEPENDS
:=@
(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200
) +kmod-ltq-vmmc
37 define Package
/$(PKG_NAME
)-asterisk13
38 $(call Package
/$(PKG_NAME
)/Default
)
42 define Package
/description
/Default
43 An implementation of a Lantiq TAPI channel driver for Asterisk.
46 Package
/$(PKG_NAME
)-asterisk13
/description
= $(Package
/description
/Default
)
48 define Package
/conffiles
/Default
49 /etc
/asterisk
/lantiq.conf
52 Package
/$(PKG_NAME
)-asterisk13
/conffiles
= $(Package
/conffiles
/Default
)
54 define Package
/Install
/Default
55 $(INSTALL_DIR
) $(1)/etc
/asterisk
56 $(INSTALL_CONF
) $(SOURCE
)/files
/lantiq-
$(BUILD_VARIANT
).conf.sample \
57 $(1)/etc
/asterisk
/lantiq.conf
58 $(INSTALL_DIR
) $(1)/usr
/lib
/asterisk
/modules
59 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/chan_lantiq.so \
60 $(1)/usr
/lib
/asterisk
/modules
63 Package
/$(PKG_NAME
)-asterisk13
/install = $(Package
/Install
/Default
)
66 $(CP
) $(SOURCE
)/files
/chan_lantiq-
$(BUILD_VARIANT
).c
$(PKG_BUILD_DIR
)/chan_lantiq.c
67 $(CP
) $(SOURCE
)/files
/default.exports
$(PKG_BUILD_DIR
)/chan_lantiq.exports
68 $(TAR
) --extract
--no-same-owner
--no-same-permissions
--xz \
69 --file
=$(DL_DIR
)/$(BUILD_VARIANT
)-$(call qstrip
,$(CONFIG_TARGET_ARCH_PACKAGES
))-headers-for-chan-lantiq-
$(VERSION_NUMBER
).
tar.xz \
70 --directory
=$(PKG_BUILD_DIR
)
73 define Build
/Configure
77 cd
$(PKG_BUILD_DIR
) && \
78 $(TARGET_CC
) -o chan_lantiq.o
-c chan_lantiq.c
-MD
-MT chan_lantiq.o \
79 -MF .chan_lantiq.o.d
-MP
-pthread \
81 -I
$(PKG_BUILD_DIR
)/include \
83 -Wall
-Wstrict-prototypes
-Wmissing-prototypes \
84 -Wmissing-declarations
$(FPIC
) -DAST_MODULE
=\"chan_lantiq
\" && \
85 $(TARGET_CC
) -o chan_lantiq.so
-pthread
$(TARGET_LDFLAGS
) -shared \
86 -Wl
,--version-script
,chan_lantiq.exports
,--warn-common \
90 $(eval
$(call BuildPackage
,$(PKG_NAME
)-asterisk13
))