re: update to 0.4.10
[feed/telephony.git] / libs / re / Makefile
1
2 # Copyright (C) 2010-2014 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.10
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:=2966ad3db2ca34ea865825533e7b7d55
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libre
22   SUBMENU:=Telephony
23   SECTION:=libs
24   CATEGORY:=Libraries
25   DEPENDS:=+libopenssl +libpthread
26   TITLE:=Generic library for real-time communications with async IO support
27   URL:=http://www.creytiv.com/
28 endef
29
30 TARGET_CFLAGS += $(FPIC)
31
32 ifneq ($(CONFIG_USE_EGLIBC),)
33 TARGET_CFLAGS += -D_GNU_SOURCE
34 endif
35
36 define Build/Compile
37         $(MAKE) -C $(PKG_BUILD_DIR) \
38                 HAVE_LIBRESOLV= \
39                 CC="$(TARGET_CC)" \
40                 EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \
41                 EXTRA_LFLAGS="-lm" \
42                 DESTDIR="$(PKG_INSTALL_DIR)" \
43                 SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \
44                 SYSROOT_ALT="$(STAGING_DIR)/usr" \
45                 RELEASE=1 \
46                 CROSS_COMPILE="$(TARGET_CROSS)" \
47                 OS=linux \
48                 all install
49 endef
50
51 define Build/InstallDev
52         $(INSTALL_DIR) $(1)/usr/share/re
53         $(CP) $(PKG_BUILD_DIR)/mk/re.mk $(1)/usr/share/re/
54         $(INSTALL_DIR) $(1)/usr/include
55         $(CP) $(PKG_INSTALL_DIR)/usr/include/re $(1)/usr/include/
56         $(INSTALL_DIR) $(1)/usr/lib
57         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.{a,so} $(1)/usr/lib/
58 endef
59
60 define Package/libre/install
61         $(INSTALL_DIR) $(1)/usr/lib
62         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.so $(1)/usr/lib/
63 endef
64
65 $(eval $(call BuildPackage,libre))