fix apache compile
[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 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libapr
22 SECTION:=libs
23 CATEGORY:=Libraries
24 DEPENDS:=+libpthread
25 TITLE:=Apache Portable Runtime Library
26 URL:=http://apr.apache.org/
27 endef
28
29 CONFIGURE_ARGS += \
30 --with-devrandom=/dev/urandom \
31 --disable-dso \
32 --disable-ipv6
33
34 CONFIGURE_VARS += \
35 ac_cv_file__dev_zero=yes \
36 apr_cv_process_shared_works=no \
37 apr_cv_mutex_robust_shared=no \
38 apr_cv_tcp_nodelay_with_cork=yes \
39 ac_cv_sizeof_ssize_t=4 \
40 LDFLAGS="$$$$LDFLAGS -lpthread" \
41
42 define Build/Configure
43 $(call Build/Configure/Default)
44 $(call libtool_disable_rpath)
45 endef
46
47 define Build/Compile
48 $(MAKE) -C $(PKG_BUILD_DIR) all
49 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
50 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
51 endef
52
53 define Build/InstallDev
54 mkdir -p $(2)/bin
55 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
56 $(2)/bin
57 mkdir -p $(1)/usr/include/apr-1
58 $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
59 $(1)/usr/include/apr-1/
60 mkdir -p $(1)/usr/lib
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \
62 $(1)/usr/lib/
63 mkdir -p $(1)/usr/lib/pkgconfig
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
65 $(1)/usr/lib/pkgconfig/
66 mkdir -p $(1)/usr/share/build-1
67 $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* \
68 $(1)/usr/share/build-1/
69 $(SED) 's,^datadir=\"/usr/share\",datadir=\"$(1)/usr/share\",g' $(2)/bin/apr-1-config
70 $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(1)/usr/share/build-1\",g' $(2)/bin/apr-1-config
71 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(1)/usr/lib,g' $(2)/bin/apr-1-config
72 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(1)/usr/include/,g' $(2)/bin/apr-1-config
73 $(SED) 's,-L$$$$libdir,,g' $(2)/bin/apr-1-config
74 $(SED) 's,-R$$$$libdir,,g' $(2)/bin/apr-1-config
75 $(SED) 's,/usr/share/build-1,$(1)/usr/share/build-1,g' $(1)/usr/share/build-1/apr_rules.mk
76 endef
77
78 define Build/UninstallDev
79 rm -rf $(STAGING_DIR)/usr/bin/apr-1-config \
80 $(STAGING_DIR)/usr/include/apr-1 \
81 $(STAGING_DIR)/usr/lib/libapr-1.{a,so*} \
82 $(STAGING_DIR)/usr/lib/pkgconfig/apr-1.pc \
83 $(STAGING_DIR)/usr/share/build-1
84 endef
85
86 define Package/libapr/install
87 $(INSTALL_DIR) $(1)/usr/lib
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/
89 endef
90
91 $(eval $(call BuildPackage,libapr))