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