treewide: replace AUTORELEASE with real PKG_RELEASE
[feed/telephony.git] / libs / re / Makefile
1 #
2 # Copyright (C) 2010-2017 OpenWrt.org
3 # Copyright (C) 2010 Alfred E. Heggestad
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=re
12 PKG_VERSION:=2.0.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://codeload.github.com/baresip/re/tar.gz/v$(PKG_VERSION)?
17 PKG_HASH:=43aa439b96aff75fe5768b9f9d49dea97042e42e7647df47b345465763e2f7ed
18
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=docs/COPYING
21 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
22
23 PKG_BUILD_PARALLEL:=1
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libre
29 SUBMENU:=Telephony
30 SECTION:=libs
31 CATEGORY:=Libraries
32 DEPENDS:=+libopenssl +zlib
33 TITLE:=Generic library for real-time communications with async IO support
34 URL:=https://github.com/baresip/re
35 ABI_VERSION:=1
36 endef
37
38 # re.mk is used for this and all related packages (rem, restund and baresip).
39 # It relies on SYSROOT and SYSROOT_ALT being set. SYSROOT is used for finding
40 # toolchain headers (like pthread.h). SYSROOT_ALT is used for finding headers
41 # from other packages, like openssl etc.
42 #
43 # CFLAGS are picked up from the environment, as well as CPPFLAGS (and LD etc.).
44 # But LDFLAGS aren't picked up, so they need to be handed over via
45 # EXTRA_LFLAGS.
46 #
47 # LD is changed to TARGET_CC to fix build failures on x86 32bit. Without this
48 # there's no linking to ssp, which results in undefined references.
49
50 # used by 001-extend-ninit-nclose-check.patch
51 TARGET_CFLAGS+=-DOPENWRT
52
53 ifneq ($(CONFIG_USE_GLIBC)$(CONFIG_USE_MUSL),)
54 TARGET_CFLAGS+=-D_GNU_SOURCE
55 endif
56
57 MAKE_FLAGS+= \
58 CROSS_COMPILE="$(TARGET_CROSS)" \
59 EXTRA_LFLAGS="$(TARGET_LDFLAGS)" \
60 LD="$(TARGET_CC)" \
61 OS=linux \
62 RELEASE=1 \
63 SYSROOT="$(shell $(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s|/include/pthread.h||p')" \
64 SYSROOT_ALT="$(STAGING_DIR)/usr"
65
66 define Build/InstallDev
67 $(INSTALL_DIR) $(1)/usr/share/re
68 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/re/re.mk $(1)/usr/share/re
69 $(INSTALL_DIR) $(1)/usr/include
70 $(CP) $(PKG_INSTALL_DIR)/usr/include/re $(1)/usr/include
71 $(INSTALL_DIR) $(1)/usr/lib
72 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.{a,so*} $(1)/usr/lib
73 endef
74
75 define Package/libre/install
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.so.$(ABI_VERSION)* $(1)/usr/lib
78 endef
79
80 $(eval $(call BuildPackage,libre))