[packages] apr: add missing librt dependency
[openwrt/svn-archive/archive.git] / libs / apr / Makefile
1 #
2 # Copyright (C) 2007-2011 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:=apr
11 PKG_VERSION:=1.4.2
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.ibiblio.org/pub/mirrors/apache/apr
16 PKG_MD5SUM:=4b00e8f70c067893d075577962656b35
17
18 PKG_FIXUP:=libtool
19
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libapr
25 SECTION:=libs
26 CATEGORY:=Libraries
27 DEPENDS:=+libpthread +librt
28 TITLE:=Apache Portable Runtime Library
29 URL:=http://apr.apache.org/
30 endef
31
32 TARGET_CFLAGS += $(FPIC)
33 CONFIGURE_ARGS += \
34 --with-devrandom=/dev/urandom \
35 --disable-dso \
36 --enable-ipv6
37
38 # XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure
39 CONFIGURE_VARS += \
40 ac_cv_sizeof_struct_iovec=1 \
41 apr_cv_process_shared_works=no \
42 apr_cv_mutex_robust_shared=no \
43 apr_cv_tcp_nodelay_with_cork=yes \
44 LDFLAGS="$$$$LDFLAGS -lpthread" \
45
46 define Build/InstallDev
47 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 $(1)/usr/lib $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1
48 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
49 $(1)/usr/bin/
50 $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
51 $(1)/usr/include/apr-1/
52 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \
53 $(1)/usr/lib/
54 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
55 $(1)/usr/lib/pkgconfig/
56 $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* \
57 $(1)/usr/share/build-1/
58 $(SED) 's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' $(1)/usr/bin/apr-1-config
59 $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g' $(1)/usr/bin/apr-1-config
60 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apr-1-config
61 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apr-1-config
62 $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apr-1-config
63 $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apr-1-config
64 $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' $(1)/usr/share/build-1/apr_rules.mk
65 endef
66
67 define Package/libapr/install
68 $(INSTALL_DIR) $(1)/usr/lib
69 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/
70 endef
71
72 $(eval $(call BuildPackage,libapr))