fix apache compile
[openwrt/svn-archive/archive.git] / libs / apr-util / 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-util
12 PKG_VERSION:=1.2.8
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://apache.autinity.de/apr/
17 PKG_MD5SUM:=a2e2e54d65e9eae961f7171335cf2550
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libaprutil
22 SECTION:=libs
23 CATEGORY:=Libraries
24 DEPENDS:=+libapr +libexpat +libiconv +libpthread +libsqlite3 +libuuid
25 TITLE:=Apache Portable Runtime Utility Library
26 URL:=http://apr.apache.org/
27 endef
28
29
30 CONFIGURE_ARGS += \
31 --with-pgsql=no \
32 --with-apr="$(STAGING_DIR_HOST)/bin/apr-1-config" \
33 --with-expat="$(STAGING_DIR)/usr" \
34 --without-sqlite2 \
35 --with-sqlite3="$(STAGING_DIR)/usr" \
36 --with-iconv="$(STAGING_DIR)/usr/lib/libiconv" \
37
38 CONFIGURE_VARS += \
39 ac_cv_file_dbd_apr_dbd_mysql_c=no \
40 APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1" \
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) APRUTIL_LIBS="-lsqlite3 -L$(STAGING_DIR)/usr/lib -lexpat -liconv -lapr-1 -luuid -lm -lcrypt" 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/apu-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/libaprutil-1.{la,a,so*} \
62 $(1)/usr/lib/
63 mkdir -p $(1)/usr/lib/pkgconfig/
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \
65 $(1)/usr/lib/pkgconfig/
66 $(SED) 's, -e \"s -I$$$$prefix/lib g\",,g' $(2)/bin/apu-1-config
67 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(1)/usr/lib,g' $(2)/bin/apu-1-config
68 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(1)/usr/include/,g' $(2)/bin/apu-1-config
69 $(SED) 's,-L$$$$libdir,,g' $(2)/bin/apu-1-config
70 $(SED) 's,-R$$$$libdir,,g' $(2)/bin/apu-1-config
71 endef
72
73 define Build/UninstallDev
74 rm -rf $(2)/bin/apu-1-config \
75 $(1)/usr/include/apr-1 \
76 $(1)/usr/lib/libaprutil-1.{a,so*} \
77 $(1)/usr/lib/pkgconfig/apr-util-1.pc
78 endef
79
80 define Package/libaprutil/install
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.so.* $(1)/usr/lib/
83 endef
84
85 $(eval $(call BuildPackage,libaprutil))