af173f9f168e7ed474d7027d4f5f2fa6602ff734
[feed/telephony.git] / libs / re / Makefile
1 #
2 # Copyright (C) 2010-2016 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:=0.4.17
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.creytiv.com/pub
17 PKG_MD5SUM:=5900337fd8c77515c87eae5bf0f8c091
18
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=docs/COPYING
21 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libre
26 SUBMENU:=Telephony
27 SECTION:=libs
28 CATEGORY:=Libraries
29 DEPENDS:=+libopenssl +libpthread +zlib
30 TITLE:=Generic library for real-time communications with async IO support
31 URL:=http://www.creytiv.com/
32 endef
33
34 TARGET_CFLAGS += $(FPIC)
35
36 ifneq ($(CONFIG_USE_GLIBC)$(CONFIG_USE_MUSL),)
37 TARGET_CFLAGS += -D_GNU_SOURCE
38 endif
39
40 define Build/Compile
41 $(MAKE) -C $(PKG_BUILD_DIR) \
42 HAVE_LIBRESOLV= \
43 CC="$(TARGET_CC)" \
44 EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \
45 EXTRA_LFLAGS="-lm" \
46 DESTDIR="$(PKG_INSTALL_DIR)" \
47 SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \
48 SYSROOT_ALT="$(STAGING_DIR)/usr" \
49 RELEASE=1 \
50 CROSS_COMPILE="$(TARGET_CROSS)" \
51 OS=linux \
52 all install
53 endef
54
55 define Build/InstallDev
56 $(INSTALL_DIR) $(1)/usr/share/re
57 $(CP) $(PKG_BUILD_DIR)/mk/re.mk $(1)/usr/share/re/
58 $(INSTALL_DIR) $(1)/usr/include
59 $(CP) $(PKG_INSTALL_DIR)/usr/include/re $(1)/usr/include/
60 $(INSTALL_DIR) $(1)/usr/lib
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.{a,so} $(1)/usr/lib/
62 endef
63
64 define Package/libre/install
65 $(INSTALL_DIR) $(1)/usr/lib
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.so $(1)/usr/lib/
67 endef
68
69 $(eval $(call BuildPackage,libre))