| 1 | # $FreeWRT$
|
|---|
| 2 | #-
|
|---|
| 3 | # This file is part of the FreeWRT project. FreeWRT is copyrighted
|
|---|
| 4 | # material, please see the LICENCE file in the top-level directory
|
|---|
| 5 | # or at http://www.freewrt.org/licence for details.
|
|---|
| 6 |
|
|---|
| 7 | include $(TOPDIR)/rules.mk
|
|---|
| 8 |
|
|---|
| 9 | PKG_NAME:= libelf
|
|---|
| 10 | PKG_VERSION:= 0.8.5
|
|---|
| 11 | PKG_RELEASE:= 1
|
|---|
| 12 | PKG_MD5SUM:= c1daf069367871350ece779b7de20047
|
|---|
| 13 |
|
|---|
| 14 | PKG_SOURCE_URL:=http://www.mr511.de/software/
|
|---|
| 15 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|---|
| 16 |
|
|---|
| 17 | include $(TOPDIR)/mk/package.mk
|
|---|
| 18 |
|
|---|
| 19 | $(eval $(call PKG_template,LIBELF,libelf,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 20 |
|
|---|
| 21 | $(WRKBUILD)/.configured:
|
|---|
| 22 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 23 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 24 | CFLAGS="$(TARGET_CFLAGS)" \
|
|---|
| 25 | CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
|
|---|
| 26 | LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
|
|---|
| 27 | mr_cv_target_elf=yes \
|
|---|
| 28 | libelf_64bit=yes \
|
|---|
| 29 | libelf_cv_struct_elf64_ehdr=yes \
|
|---|
| 30 | libelf_cv_type_elf64_addr=no \
|
|---|
| 31 | libelf_cv_struct_elf64_rel=yes \
|
|---|
| 32 | ac_cv_sizeof_long_long=8 \
|
|---|
| 33 | ./configure \
|
|---|
| 34 | --target=$(GNU_TARGET_NAME) \
|
|---|
| 35 | --host=$(GNU_TARGET_NAME) \
|
|---|
| 36 | --build=$(GNU_HOST_NAME) \
|
|---|
| 37 | --program-prefix="" \
|
|---|
| 38 | --program-suffix="" \
|
|---|
| 39 | --prefix=/usr \
|
|---|
| 40 | --exec-prefix=/usr \
|
|---|
| 41 | --bindir=/usr/bin \
|
|---|
| 42 | --datadir=/usr/share \
|
|---|
| 43 | --includedir=/usr/include \
|
|---|
| 44 | --infodir=/usr/share/info \
|
|---|
| 45 | --libdir=/usr/lib \
|
|---|
| 46 | --libexecdir=/usr/lib \
|
|---|
| 47 | --localstatedir=/var \
|
|---|
| 48 | --mandir=/usr/share/man \
|
|---|
| 49 | --sbindir=/usr/sbin \
|
|---|
| 50 | --sysconfdir=/etc \
|
|---|
| 51 | --enable-largefile \
|
|---|
| 52 | --disable-nls \
|
|---|
| 53 | --enable-shared \
|
|---|
| 54 | --enable-static \
|
|---|
| 55 | --enable-elf64=yes \
|
|---|
| 56 | );
|
|---|
| 57 | touch $@
|
|---|
| 58 |
|
|---|
| 59 | $(WRKBUILD)/.built:
|
|---|
| 60 | rm -rf $(WRKINST)
|
|---|
| 61 | mkdir -p $(WRKINST)
|
|---|
| 62 | $(MAKE) -C $(WRKBUILD) -j1 \
|
|---|
| 63 | CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld ARCH=$(ARCH) \
|
|---|
| 64 | instroot="$(WRKINST)" \
|
|---|
| 65 | all install
|
|---|
| 66 | touch $@
|
|---|
| 67 |
|
|---|
| 68 | $(IPKG_LIBELF):
|
|---|
| 69 | install -d -m0755 $(IDIR_LIBELF)/usr/lib
|
|---|
| 70 | $(CP) $(WRKINST)/usr/lib/libelf.so.* $(IDIR_LIBELF)/usr/lib/
|
|---|
| 71 | $(RSTRIP) $(IDIR_LIBELF)
|
|---|
| 72 | $(IPKG_BUILD) $(IDIR_LIBELF) $(PACKAGE_DIR)
|
|---|
| 73 |
|
|---|
| 74 | $(STAGING_DIR)/usr/lib/libelf.so: $(WRKBUILD)/.built
|
|---|
| 75 | mkdir -p $(STAGING_DIR)/usr/include
|
|---|
| 76 | $(CP) $(WRKINST)/usr/include/libelf* $(STAGING_DIR)/usr/include/
|
|---|
| 77 | mkdir -p $(STAGING_DIR)/usr/lib
|
|---|
| 78 | $(CP) $(WRKINST)/usr/lib/libelf.{a,so*} $(STAGING_DIR)/usr/lib/
|
|---|
| 79 |
|
|---|
| 80 | install-dev: $(STAGING_DIR)/usr/lib/libelf.so
|
|---|
| 81 |
|
|---|
| 82 | uninstall-dev:
|
|---|
| 83 | rm -rf $(STAGING_DIR)/usr/include/libelf*
|
|---|
| 84 | rm -rf $(STAGING_DIR)/usr/lib/libelf.{a,so*}
|
|---|
| 85 |
|
|---|
| 86 | compile-targets: install-dev
|
|---|
| 87 | clean-targets: uninstall-dev
|
|---|