removed apr-1-config, you won't need it on a router, it's only for building other...
[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 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/apr
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+libpthread
29 TITLE:=Apache Portable Runtime Library
30 DESCRIPTION:=\
31 Apache Portable Runtime Library
32 URL:=http://apr.apache.org/
33 endef
34
35 define Build/Configure
36 $(call Build/Configure/Default, \
37 --with-devrandom=/dev/urandom \
38 --disable-dso \
39 --disable-ipv6 \
40 , \
41 ac_cv_file__dev_zero=yes \
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_sizeof_ssize_t=4 \
46 LDFLAGS="-lpthread -L$(STAGING_DIR)/lib" \
47 CFLAGS="-I$(STAGING_DIR)/include" \
48 )
49 endef
50
51 define Build/Compile
52 $(MAKE) -C $(PKG_BUILD_DIR) \
53 DESTDIR="$(PKG_INSTALL_DIR)" \
54 all install
55 endef
56
57 define Build/InstallDev
58 mkdir -p $(STAGING_DIR)/usr/bin
59 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
60 $(STAGING_DIR)/usr/bin
61 mkdir -p $(STAGING_DIR)/usr/include
62 $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/ \
63 $(STAGING_DIR)/usr/include/
64 mkdir -p $(STAGING_DIR)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*apr* \
66 $(STAGING_DIR)/usr/lib/
67 mkdir -p $(STAGING_DIR)/usr/share/
68 $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/ \
69 $(STAGING_DIR)/usr/share/
70 $(SED) "s,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1," $(STAGING_DIR)/usr/share/build-1/apr_rules.mk
71 $(SED) "s,\"/usr\",$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/bin/apr-1-config
72 $(SED) "s,"libdir\=\'/usr/lib\'",libdir='$(STAGING_DIR)/usr/lib\'," $(STAGING_DIR)/usr/lib/libapr-1.la
73 $(SED) "s,"bindir\=\"/usr/bin\"",bindir=\"$(STAGING_DIR)/usr/bin\"," $(STAGING_DIR)/usr/bin/apr-1-config
74 $(SED) "s,"datadir\=\"/usr/share\"",datadir=\"$(STAGING_DIR)/usr/share\"," $(STAGING_DIR)/usr/bin/apr-1-config
75 $(SED) "s,"installbuilddir\=\"/usr/share/build-1\"",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\"," $(STAGING_DIR)/usr/bin/apr-1-config
76 endef
77
78 define Build/UninstallDev
79 rm $(STAGING_DIR)/usr/bin/apr-1-config \
80 $(STAGING_DIR)/usr/lib/{libapr-1*,apr.exp} \
81 rm -rf $(STAGING_DIR)/usr/share/build-1/ \
82 $(STAGING_DIR)/usr/include/apr-1/
83 endef
84
85 define Package/apr/install
86 $(INSTALL_DIR) $(1)/usr/lib
87 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
88 endef
89
90 $(eval $(call BuildPackage,apr))