make libmad depending on CONFIG_BUILD_PATENTED
[openwrt/svn-archive/archive.git] / libs / apr-util / Makefile
1 #
2 # Copyright (C) 2007-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=apr-util
11 PKG_VERSION:=1.3.9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://apache.autinity.de/apr/
16 PKG_MD5SUM:=29dd557f7bd891fc2bfdffcfa081db59
17
18 PKG_FIXUP = libtool
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/libaprutil
23 SECTION:=libs
24 CATEGORY:=Libraries
25 DEPENDS:=+libapr +libexpat +libiconv +libpthread +libsqlite3 +libuuid
26 TITLE:=Apache Portable Runtime Utility Library
27 URL:=http://apr.apache.org/
28 endef
29
30
31 TARGET_CFLAGS += $(FPIC)
32 CONFIGURE_ARGS += \
33 --with-pgsql=no \
34 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
35 --with-expat="$(STAGING_DIR)/usr" \
36 --without-sqlite2 \
37 --with-sqlite3="$(STAGING_DIR)/usr" \
38 --with-iconv="$(STAGING_DIR)/usr/lib/libiconv" \
39
40 CONFIGURE_VARS += \
41 ac_cv_file_dbd_apr_dbd_mysql_c=no \
42 APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1" \
43
44 define Build/Compile
45 $(MAKE) -C $(PKG_BUILD_DIR) APRUTIL_LIBS="-lsqlite3 $(TARGET_LDFLAGS) -lexpat -liconv -lapr-1 -luuid -lm -lcrypt" all
46 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
47 endef
48
49 define Build/InstallDev
50 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1/ $(1)/usr/lib $(1)/usr/lib/pkgconfig/
51 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apu-1-config \
52 $(1)/usr/bin/
53 $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
54 $(1)/usr/include/apr-1/
55 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{la,a,so*} \
56 $(1)/usr/lib/
57 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \
58 $(1)/usr/lib/pkgconfig/
59 $(SED) 's, -e \"s -I$$$$prefix/lib g\",,g' $(1)/usr/bin/apu-1-config
60 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apu-1-config
61 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apu-1-config
62 $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apu-1-config
63 $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apu-1-config
64 endef
65
66 define Package/libaprutil/install
67 $(INSTALL_DIR) $(1)/usr/lib
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.so.* $(1)/usr/lib/
69 endef
70
71 $(eval $(call BuildPackage,libaprutil))