add quotes to TARGET_CC and TARGET_CROSS to help with distcc and ccache
[openwrt/svn-archive/archive.git] / libs / libelf / 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:=libelf
12 PKG_VERSION:=0.8.8
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://www.mr511.de/software/
18 PKG_MD5SUM:=be84e553686dd50c8b6d520f86f46521
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libelf
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=ELF object file access library
29 DESCRIPTION:=ELF object file access library
30 URL:=http://www.stud.uni-hannover.de/~michael/software/
31 endef
32
33 define Build/Configure
34 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
35 $(TARGET_CONFIGURE_OPTS) \
36 CFLAGS="$(TARGET_CFLAGS)" \
37 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
38 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
39 mr_cv_target_elf=yes \
40 libelf_64bit=yes \
41 libelf_cv_struct_elf64_ehdr=yes \
42 libelf_cv_type_elf64_addr=no \
43 libelf_cv_struct_elf64_rel=yes \
44 ac_cv_sizeof_long_long=8 \
45 ./configure \
46 --target=$(GNU_TARGET_NAME) \
47 --host=$(GNU_TARGET_NAME) \
48 --build=$(GNU_HOST_NAME) \
49 --program-prefix="" \
50 --program-suffix="" \
51 --prefix=/usr \
52 --exec-prefix=/usr \
53 --bindir=/usr/bin \
54 --datadir=/usr/share \
55 --includedir=/usr/include \
56 --infodir=/usr/share/info \
57 --libdir=/usr/lib \
58 --libexecdir=/usr/lib \
59 --localstatedir=/var \
60 --mandir=/usr/share/man \
61 --sbindir=/usr/sbin \
62 --sysconfdir=/etc \
63 $(DISABLE_LARGEFILE) \
64 $(DISABLE_NLS) \
65 --enable-shared \
66 --enable-static \
67 --enable-elf64=yes \
68 );
69 endef
70
71 define Build/Compile
72 rm -rf $(PKG_INSTALL_DIR)
73 mkdir -p $(PKG_INSTALL_DIR)
74 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
75 CC="$(TARGET_CC)" LD="$(TARGET_CROSS)ld" ARCH=$(ARCH) \
76 instroot="$(PKG_INSTALL_DIR)" \
77 all install
78 endef
79
80 define Package/libelf/install
81 install -d -m0755 $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.so.* $(1)/usr/lib/
83 endef
84
85 define Build/InstallDev
86 mkdir -p $(STAGING_DIR)/usr/include
87 $(CP) $(PKG_INSTALL_DIR)/usr/include/libelf* $(STAGING_DIR)/usr/include/
88 mkdir -p $(STAGING_DIR)/usr/lib
89 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.{a,so*} $(STAGING_DIR)/usr/lib/
90 endef
91
92 define Build/UninstallDev
93 rm -rf \
94 $(STAGING_DIR)/usr/include/libelf* \
95 $(STAGING_DIR)/usr/lib/libelf.{a,so*}
96 endef
97
98 $(eval $(call BuildPackage,libelf))