fixup and simplify check for powerpc-*-*-uclibc*
[buildroot.git] / package / libelf / libelf.mk
blobb20c78aca5cf02c95718abfa9954dcb282a52ef0
1 #############################################################
3 # libelf
5 #############################################################
6 LIBELF_VERSION=0.8.10
7 LIBELF_SOURCE=libelf-$(LIBELF_VERSION).tar.gz
8 LIBELF_SITE=http://www.mr511.de/software/
9 LIBELF_DIR=$(BUILD_DIR)/libelf-$(LIBELF_VERSION)
11 ifeq ($(BR2_LARGEFILE),y)
12 LIBELF_CONFIG:=--enable-elf64
13 endif
15 $(DL_DIR)/$(LIBELF_SOURCE):
16 $(WGET) -P $(DL_DIR) $(LIBELF_SITE)/$(LIBELF_SOURCE)
18 $(LIBELF_DIR)/.unpacked: $(DL_DIR)/$(LIBELF_SOURCE)
19 $(ZCAT) $(DL_DIR)/$(LIBELF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
20 toolchain/patch-kernel.sh $(LIBELF_DIR) package/libelf libelf\*.patch
21 $(CONFIG_UPDATE) $(LIBELF_DIR)
22 touch $@
24 $(LIBELF_DIR)/.configured: $(LIBELF_DIR)/.unpacked
25 (cd $(LIBELF_DIR); rm -f config.cache; \
26 libelf_cv_working_memmove=yes \
27 mr_cv_target_elf=yes \
28 libelf_64bit=yes \
29 $(AUTO_CONFIGURE_TARGET) \
30 --prefix=/usr \
31 --sysconfdir=/etc \
32 --enable-shared \
33 --disable-debug \
34 --disable-sanity-checks \
35 $(LIBELF_CONFIG) \
36 $(DISABLE_NLS) \
38 touch $@
40 $(LIBELF_DIR)/lib/libelf.so.$(LIBELF_VERSION): $(LIBELF_DIR)/.configured
41 $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(LIBELF_DIR)
43 $(STAGING_DIR)/usr/lib/libelf.a $(STAGING_DIR)/usr/lib/libelf.so.$(LIBELF_VERSION): $(LIBELF_DIR)/lib/libelf.so.$(LIBELF_VERSION)
44 $(MAKE) $(TARGET_CONFIGURE_OPTS) \
45 instroot=$(STAGING_DIR) -C $(LIBELF_DIR) install
47 ifeq ($(BR2_PACKAGE_LIBELF_HEADERS),y)
48 libelf_headers: $(TARGET_DIR)/usr/lib/libelf.so.$(LIBELF_VERSION)
49 $(TARGET_DIR)/usr/lib/libelf.so.$(LIBELF_VERSION): $(STAGING_DIR)/usr/lib/libelf.a
50 $(INSTALL) -d $(@D)
51 $(INSTALL) -m 0755 $(STAGING_DIR)/usr/lib/libelf* $(@D)
52 $(INSTALL) -d $(TARGET_DIR)/usr/include
53 $(INSTALL) -m 0644 $(wildcard $(addprefix $(STAGING_DIR)/usr/include/,gelf.h libelf*)) \
54 $(TARGET_DIR)/usr/include/
55 $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
57 libelf: uclibc $(TARGET_DIR)/usr/lib/libelf.so.$(LIBELF_VERSION)
58 else
59 libelf: uclibc $(STAGING_DIR)/usr/lib/libelf.so.$(LIBELF_VERSION)
60 endif
61 libelf-source: $(DL_DIR)/$(LIBELF_SOURCE)
63 libelf-clean:
64 $(MAKE) prefix=$(TARGET_DIR)/usr -C $(LIBELF_DIR) uninstall
65 $(MAKE) instroot=$(STAGING_DIR) -C $(LIBELF_DIR) uninstall
66 -$(MAKE) -C $(LIBELF_DIR) clean
68 libelf-dirclean:
69 rm -rf $(LIBELF_DIR)
71 #############################################################
73 # Toplevel Makefile options
75 #############################################################
76 ifeq ($(BR2_PACKAGE_LIBELF),y)
77 TARGETS+=libelf
78 endif