xref: /OK3568_Linux_fs/buildroot/package/libss7/libss7.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# libss7
4#
5################################################################################
6
7LIBSS7_VERSION = 2.0.0
8LIBSS7_SITE = http://downloads.asterisk.org/pub/telephony/libss7/releases
9
10LIBSS7_LICENSE = GPL-2.0
11LIBSS7_LICENSE_FILES = LICENSE
12
13LIBSS7_DEPENDENCIES = dahdi-linux dahdi-tools
14LIBSS7_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)
19LIBSS7_LIBS = libss7.a
20define LIBSS7_INSTALL_A
21	$(INSTALL) -D -m 0644 $(@D)/libss7.a $(1)/usr/lib/libss7.a
22endef
23endif
24
25ifneq ($(BR2_STATIC_LIBS),y)
26LIBSS7_LIBS += libss7.so.2.0
27define LIBSS7_INSTALL_SO
28	$(INSTALL) -D -m 0644 $(@D)/libss7.so.2.0 $(1)/usr/lib/libss7.so.2.0
29	ln -sf libss7.so.2.0 $(1)/usr/lib/libss7.so
30endef
31endif
32
33# The Makefile erroneously looks for host headers to decide what utilities
34# to build, and thus misses the test utilities. So we explicitly build them
35# as they can be useful to validate that the hardware does work.
36LIBSS7_UTILS = parser_debug ss7test ss7linktest
37
38define LIBSS7_BUILD_CMDS
39	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
40		CFLAGS="$(TARGET_CFLAGS) -fPIC" -C $(@D) \
41		$(LIBSS7_LIBS) $(LIBSS7_UTILS)
42endef
43
44define LIBSS7_INSTALL_STAGING_CMDS
45	$(call LIBSS7_INSTALL_A,$(STAGING_DIR))
46	$(call LIBSS7_INSTALL_SO,$(STAGING_DIR))
47	$(INSTALL) -D -m 0644 $(@D)/libss7.h $(STAGING_DIR)/usr/include/libss7.h
48endef
49
50define LIBSS7_INSTALL_TARGET_CMDS
51	$(foreach u,$(LIBSS7_UTILS),\
52		$(INSTALL) -D -m 0755 $(@D)/$(u) $(TARGET_DIR)/usr/sbin/$(u)$(sep))
53	$(call LIBSS7_INSTALL_SO,$(TARGET_DIR))
54endef
55
56$(eval $(generic-package))
57