2 # Copyright (C) 2007-2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://apache.d-s-s-p.de/apr/
16 PKG_MD5SUM:=6f4b063ac01a54ba0818c31280f06959
20 include $(INCLUDE_DIR)/package.mk
26 TITLE:=Apache Portable Runtime Library
27 URL:=http://apr.apache.org/
30 TARGET_CFLAGS += $(FPIC)
32 --with-devrandom=/dev/urandom \
37 apr_cv_process_shared_works=no \
38 apr_cv_mutex_robust_shared=no \
39 apr_cv_tcp_nodelay_with_cork=yes \
40 LDFLAGS="$$$$LDFLAGS -lpthread" \
43 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
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 \
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*} \
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
67 define Package/libapr/install
68 $(INSTALL_DIR) $(1)/usr/lib
69 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/
72 $(eval $(call BuildPackage,libapr))