libevent2: do not add librt dependency when targetting eglibc
[openwrt/staging/chunkeey.git] / package / libs / libevent2 / Makefile
1 #
2 # Copyright (C) 2011-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libevent2
11 PKG_VERSION:=2.0.19
12 PKG_RELEASE:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable
15 PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz
16 PKG_SOURCE_URL:=http://www.monkey.org/~provos/ \
17 @SF/levent
18 PKG_MD5SUM:=91111579769f46055b0a438f5cc59572
19 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
20
21 PKG_FIXUP:=autoreconf
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/libevent2/Default
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=Event notification
31 URL:=http://www.monkey.org/~provos/libevent/
32 endef
33
34 define Package/libevent2/Default/description
35 The libevent API provides a mechanism to execute a callback function
36 when a specific event occurs on a file descriptor or after a timeout
37 has been reached. Furthermore, libevent also support callbacks due
38 to signals or regular timeouts.
39
40 libevent is meant to replace the event loop found in event driven
41 network servers. An application just needs to call event_dispatch()
42 and then add or remove events dynamically without having to change
43 the event loop.
44 endef
45
46 define Package/libevent2
47 $(call Package/libevent2/Default)
48 TITLE+= library (version 2.0)
49 endef
50
51 define Package/libevent2/description
52 $(call Package/libevent2/Default/description)
53
54 This package contains the libevent shared library historically
55 containing both the core & extra libraries.
56 endef
57
58 define Package/libevent2-core
59 $(call Package/libevent2/Default)
60 TITLE+= core library (version 2.0)
61 endef
62
63 define Package/libevent2-core/description
64 $(call Package/libevent2/Default/description)
65
66 This package contains the libevent core shared library for the event,
67 buffer & utility functions.
68 endef
69
70 define Package/libevent2-extra
71 $(call Package/libevent2/Default)
72 TITLE+= extra library (version 2.0)
73 endef
74
75 define Package/libevent2-extra/description
76 $(call Package/libevent2/Default/description)
77
78 This package contains the libevent extra shared library for specific
79 protocols including HTTP, DNS & RPC.
80 endef
81
82 define Package/libevent2-openssl
83 $(call Package/libevent2/Default)
84 TITLE+= OpenSSL library (version 2.0)
85 DEPENDS+=+libopenssl
86 endef
87
88 define Package/libevent2-openssl/description
89 $(call Package/libevent2/Default/description)
90
91 This package contains the libevent OpenSSL shared library for encrypted
92 bufferevents.
93 endef
94
95 define Package/libevent2-pthreads
96 $(call Package/libevent2/Default)
97 TITLE+= Pthreads library (version 2.0)
98 DEPENDS+=+libpthread
99 endef
100
101 define Package/libevent2-pthreads/description
102 $(call Package/libevent2/Default/description)
103
104 This package contains the libevent Pthreads shared library for
105 threading & locking.
106 endef
107
108 TARGET_CFLAGS += $(FPIC)
109
110 CONFIGURE_ARGS += \
111 --enable-shared \
112 --enable-static
113
114 MAKE_FLAGS += \
115 CFLAGS="$(TARGET_CFLAGS)"
116
117 define Build/InstallDev
118 $(INSTALL_DIR) $(1)/usr/include
119 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
120 $(INSTALL_DIR) $(1)/usr/lib
121 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*.{la,a,so} $(1)/usr/lib/
122 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*-2.0.so* $(1)/usr/lib/
123 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
124 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libevent*.pc $(1)/usr/lib/pkgconfig/
125 endef
126
127 define Package/libevent2/install
128 $(INSTALL_DIR) $(1)/usr/lib
129 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-2.0.so.* $(1)/usr/lib/
130 endef
131
132 define Package/libevent2-core/install
133 $(INSTALL_DIR) $(1)/usr/lib
134 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_core-2.0.so.* $(1)/usr/lib/
135 endef
136
137 define Package/libevent2-extra/install
138 $(INSTALL_DIR) $(1)/usr/lib
139 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_extra-2.0.so.* $(1)/usr/lib/
140 endef
141
142 define Package/libevent2-openssl/install
143 $(INSTALL_DIR) $(1)/usr/lib
144 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_openssl-2.0.so.* $(1)/usr/lib/
145 endef
146
147 define Package/libevent2-pthreads/install
148 $(INSTALL_DIR) $(1)/usr/lib
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_pthreads-2.0.so.* $(1)/usr/lib/
150 endef
151
152 $(eval $(call BuildPackage,libevent2))
153 $(eval $(call BuildPackage,libevent2-core))
154 $(eval $(call BuildPackage,libevent2-extra))
155 $(eval $(call BuildPackage,libevent2-openssl))
156 $(eval $(call BuildPackage,libevent2-pthreads))