Add apr from #1712
[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:=0.9.13
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:=233894af598d8347fd68cf836e7dee91
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 ac_cv_sizeof_ssize_t=4 \
43 ac_cv_define_PTHREAD_PROCESS_SHARED=no \
44 apr_cv_mutex_robust_shared=no \
45 LDFLAGS="-lpthread -L$(STAGING_DIR)/lib" \
46 CFLAGS="-I$(STAGING_DIR)/include" \
47 )
48 endef
49
50 define Build/Compile
51 $(MAKE) -C $(PKG_BUILD_DIR) \
52 DESTDIR="$(PKG_INSTALL_DIR)" \
53 all install
54 endef
55
56 define Build/InstallDev
57 mkdir -p $(STAGING_DIR)/usr/bin
58 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-config \
59 $(STAGING_DIR)/usr/bin
60 mkdir -p $(STAGING_DIR)/usr/include
61 $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-0/ \
62 $(STAGING_DIR)/usr/include/
63 mkdir -p $(STAGING_DIR)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*apr* \
65 $(STAGING_DIR)/usr/lib/
66 mkdir -p $(STAGING_DIR)/usr/share/
67 $(CP) $(PKG_INSTALL_DIR)/usr/share/build/ \
68 $(STAGING_DIR)/usr/share/
69 $(SED) "s,/usr/share/build,$(STAGING_DIR)/usr/share/build," $(STAGING_DIR)/usr/share/build/apr_rules.mk
70 $(SED) "s,\"/usr\",$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/bin/apr-config
71 endef
72
73 define Build/UninstallDev
74 rm $(STAGING_DIR)/usr/bin/apr-config \
75 $(STAGING_DIR)/usr/include/apr-0/{apr_allocator.h,apr_atomic.h,apr_compat.h,apr_dso.h,apr_env.h,apr_errno.h,apr_file_info.h,apr_file_io.h,apr_fnmatch.h,apr_general.h,apr_getopt.h,apr_global_mutex.h,apr.h,apr_hash.h,apr_inherit.h,apr_lib.h,apr_mmap.h,apr_network_io.h,apr_poll.h,apr_pools.h,apr_portable.h,\apr_proc_mutex.h,\apr_ring.h,apr_shm.h,apr_signal.h,apr_strings.h,apr_support.h,apr_tables.h,apr_thread_cond.h,apr_thread_mutex.h,apr_thread_proc.h,apr_thread_rwlock.h,apr_time.h,apr_user.h,apr_version.h,apr_want.h} \
76 $(STAGING_DIR)/usr/lib/libapr-0* \
77 $(STAGING_DIR)/usr/share/build/{apr_rules.mk,libtool,make_exports.awk,make_var_export.awk,mkdir.sh}
78 endef
79
80 define Package/apr/install
81 $(INSTALL_DIR) $(1)/usr/bin
82 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-config $(1)/usr/bin/
83 $(INSTALL_DIR) $(1)/usr/lib
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
85 endef
86
87 $(eval $(call BuildPackage,apr))