xref: /OK3568_Linux_fs/buildroot/package/libpri/libpri.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# libpri
4#
5################################################################################
6
7LIBPRI_VERSION = 1.5.0
8LIBPRI_SITE = http://downloads.asterisk.org/pub/telephony/libpri/releases
9
10LIBPRI_LICENSE = GPL-2.0 with OpenH323 exception
11LIBPRI_LICENSE_FILES = LICENSE README
12
13LIBPRI_DEPENDENCIES = dahdi-linux dahdi-tools
14LIBPRI_INSTALL_STAGING = YES
15
16# The Makefile default rule will always try to generate both libraries.
17# So we need to explicitly build only what we can.
18ifneq ($(BR2_SHARED_LIBS),y)
19LIBPRI_LIBS = libpri.a
20define LIBPRI_INSTALL_A
21	$(INSTALL) -D -m 0644 $(@D)/libpri.a $(1)/usr/lib/libpri.a
22endef
23endif
24
25ifneq ($(BR2_STATIC_LIBS),y)
26LIBPRI_LIBS += libpri.so.1.4
27define LIBPRI_INSTALL_SO
28	$(INSTALL) -D -m 0644 $(@D)/libpri.so.1.4 $(1)/usr/lib/libpri.so.1.4
29	ln -sf libpri.so.1.4 $(1)/usr/lib/libpri.so
30endef
31endif
32
33LIBPRI_UTILS = pridump pritest rosetest testprilib
34
35define LIBPRI_BUILD_CMDS
36	$(TARGET_MAKE_ENV) $(MAKE1) $(TARGET_CONFIGURE_OPTS) \
37		CFLAGS="$(TARGET_CFLAGS) -fPIC" -C $(@D) \
38		$(LIBPRI_LIBS) $(LIBPRI_UTILS)
39endef
40
41define LIBPRI_INSTALL_STAGING_CMDS
42	$(call LIBPRI_INSTALL_A,$(STAGING_DIR))
43	$(call LIBPRI_INSTALL_SO,$(STAGING_DIR))
44	$(INSTALL) -D -m 0644 $(@D)/libpri.h $(STAGING_DIR)/usr/include/libpri.h
45endef
46
47define LIBPRI_INSTALL_TARGET_CMDS
48	$(foreach u,$(LIBPRI_UTILS),\
49		$(INSTALL) -D -m 0755 $(@D)/$(u) $(TARGET_DIR)/usr/sbin/$(u)$(sep))
50	$(call LIBPRI_INSTALL_SO,$(TARGET_DIR))
51endef
52
53$(eval $(generic-package))
54