[packages] apr: ensure rlimit support, fixes httpd mod_cgi link failures, upstream...
[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.5
12 PKG_RELEASE:=1
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:=8b53f5a5669d0597f2da889a2f576eb6
17
18 PKG_FIXUP:=autoreconf
19 PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh
20
21 PKG_INSTALL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libapr
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+libpthread +librt
29 TITLE:=Apache Portable Runtime Library
30 URL:=http://apr.apache.org/
31 endef
32
33 TARGET_CFLAGS += $(FPIC)
34 CONFIGURE_ARGS += \
35 --with-devrandom=/dev/urandom \
36 --disable-dso \
37 --enable-ipv6
38
39 # XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure
40 CONFIGURE_VARS += \
41 ac_cv_sizeof_struct_iovec=1 \
42 apr_cv_process_shared_works=no \
43 apr_cv_mutex_robust_shared=no \
44 apr_cv_tcp_nodelay_with_cork=yes \
45 ac_cv_struct_rlimit=yes \
46 LDFLAGS="$$$$LDFLAGS -lpthread" \
47
48 define Build/InstallDev
49 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 $(1)/usr/lib $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1
50 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
51 $(1)/usr/bin/
52 $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
53 $(1)/usr/include/apr-1/
54 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \
55 $(1)/usr/lib/
56 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
57 $(1)/usr/lib/pkgconfig/
58 $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* \
59 $(1)/usr/share/build-1/
60 $(SED) 's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' $(1)/usr/bin/apr-1-config
61 $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g' $(1)/usr/bin/apr-1-config
62 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apr-1-config
63 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apr-1-config
64 $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apr-1-config
65 $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apr-1-config
66 $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' $(1)/usr/share/build-1/apr_rules.mk
67 endef
68
69 define Package/libapr/install
70 $(INSTALL_DIR) $(1)/usr/lib
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/
72 endef
73
74 $(eval $(call BuildPackage,libapr))