fix curl compile (based on patch by Ambroz Bizjak)
[openwrt/svn-archive/archive.git] / libs / apr / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=apr
12 PKG_VERSION:=1.2.9
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://apache.d-s-s-p.de/apr/
17 PKG_MD5SUM:=6f4b063ac01a54ba0818c31280f06959
18
19 PKG_FIXUP = libtool
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libapr
24 SECTION:=libs
25 CATEGORY:=Libraries
26 DEPENDS:=+libpthread
27 TITLE:=Apache Portable Runtime Library
28 URL:=http://apr.apache.org/
29 endef
30
31 CONFIGURE_ARGS += \
32 --with-devrandom=/dev/urandom \
33 --disable-dso \
34 --enable-ipv6
35
36 CONFIGURE_VARS += \
37 ac_cv_file__dev_zero=yes \
38 apr_cv_process_shared_works=no \
39 apr_cv_mutex_robust_shared=no \
40 apr_cv_tcp_nodelay_with_cork=yes \
41 ac_cv_sizeof_ssize_t=4 \
42 LDFLAGS="$$$$LDFLAGS -lpthread" \
43
44 define Build/Compile
45 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
46 endef
47
48 define Build/InstallDev
49 $(INSTALL_DIR) $(2)/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 $(2)/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' $(2)/bin/apr-1-config
61 $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g' $(2)/bin/apr-1-config
62 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(2)/bin/apr-1-config
63 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(2)/bin/apr-1-config
64 $(SED) 's,-L$$$$libdir,,g' $(2)/bin/apr-1-config
65 $(SED) 's,-R$$$$libdir,,g' $(2)/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))