replace lots of manual install commands with INSTALL_* variables
[openwrt/svn-archive/archive.git] / libs / libtool / Makefile
1 #
2 # Copyright (C) 2006 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:=libtool
12 PKG_VERSION:=1.5.22
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/libtool
17 PKG_MD5SUM:=8e0ac9797b62ba4dcc8a2fb7936412b0
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/libltdl
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=A generic dynamic object loading library
29 URL:=http://www.gnu.org/software/libtool/
30 endef
31
32 define Build/Configure
33 (cd $(PKG_BUILD_DIR); touch \
34 libltdl/configure.ac \
35 libltdl/acinclude.m4 \
36 libltdl/aclocal.m4 \
37 libltdl/Makefile.in \
38 libltdl/config-h.in \
39 libltdl/configure \
40 );
41 $(call Build/Configure/Default, \
42 --enable-shared \
43 --enable-static \
44 )
45 endef
46
47 define Build/Compile
48 $(MAKE) -C $(PKG_BUILD_DIR) \
49 DESTDIR="$(PKG_INSTALL_DIR)" \
50 all install
51 endef
52
53 define Build/InstallDev
54 mkdir -p $(STAGING_DIR)/usr/bin
55 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libtool $(STAGING_DIR)/usr/bin/
56 mkdir -p $(STAGING_DIR)/usr/include
57 $(CP) $(PKG_INSTALL_DIR)/usr/include/ltdl.h $(STAGING_DIR)/usr/include/
58 mkdir -p $(I_LIBLTDL_DEV)/usr/lib
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libltdl.{a,so*} $(STAGING_DIR)/usr/lib/
60 mkdir -p $(STAGING_DIR)/usr/share/libtool
61 $(CP) $(PKG_INSTALL_DIR)/usr/share/libtool/config.guess $(STAGING_DIR)/usr/share/libtool/
62 $(SED) 's|^sys_lib_dlsearch_path_spec=.*|sys_lib_dlsearch_path_spec="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib"|g' \
63 $(STAGING_DIR)/usr/bin/libtool
64 endef
65
66 define Build/UninstallDev
67 rm -rf \
68 $(STAGING_DIR)/usr/bin/libtool \
69 $(STAGING_DIR)/usr/include/ltdl.h \
70 $(STAGING_DIR)/usr/lib/libltdl.{a,so*} \
71 $(STAGING_DIR)/usr/share/libtool
72 endef
73
74 define Package/libltdl/install
75 $(INSTALL_DIR) $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libltdl.so.* $(1)/usr/lib/
77 endef
78
79 $(eval $(call BuildPackage,libltdl))