diff options
author | Abdoulaye Walsimou Gaye <walsimou@walsimou.com> | 2010-01-07 22:44:31 +0100 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <walsimou@walsimou.com> | 2010-01-07 22:46:12 +0100 |
commit | 8911fd9b781b9d9eb5be8bd9513f6f37c9c3e430 (patch) | |
tree | bc5f54d3d1a830823345acf8b550489741865316 /packages/misc/libelf | |
parent | d477235f735b6773f4db1917d113d1c646700f5b (diff) | |
download | embtoolkit-8911fd9b781b9d9eb5be8bd9513f6f37c9c3e430.tar.gz embtoolkit-8911fd9b781b9d9eb5be8bd9513f6f37c9c3e430.tar.bz2 embtoolkit-8911fd9b781b9d9eb5be8bd9513f6f37c9c3e430.tar.xz |
Packages: New: add libelf as buildable package
Signed-off-by: Abdoulaye Walsimou Gaye <walsimou@walsimou.com>
Diffstat (limited to 'packages/misc/libelf')
-rw-r--r-- | packages/misc/libelf/libelf.kconfig | 46 | ||||
-rw-r--r-- | packages/misc/libelf/libelf.mk | 101 |
2 files changed, 147 insertions, 0 deletions
diff --git a/packages/misc/libelf/libelf.kconfig b/packages/misc/libelf/libelf.kconfig new file mode 100644 index 0000000..a2b2b91 --- /dev/null +++ b/packages/misc/libelf/libelf.kconfig @@ -0,0 +1,46 @@ +################################################################################ +# GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# Copyright(C) 2010 GAYE Abdoulaye Walsimou. All rights reserved. +# +# This program is free software; you can distribute it and/or modify it +# under the terms of the GNU General Public License +# (Version 2 or later) published by the Free Software Foundation. +# +# This program is distributed in the hope it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +################################################################################ +# +# \file libelf.kconfig +# \brief libelf.kconfig of Embtoolkit +# \author GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# \date January 2010 +################################################################################ + +config EMBTK_HAVE_LIBELF + bool "Have libelf" + select EMBTK_HAVE_GETTEXT + help + libelf lets you read, modify or create ELF files in an + architecture-independent way. The library takes care of size and + endian issues, e.g. you can process a file for SPARC processors + on an Intel-based system. +choice + prompt "libelf version you wish" + depends on EMBTK_HAVE_LIBELF + help + Here you can choose which version of libelf you want to use. + + config EMBTK_LIBELF_VERSION_0_8_13 + bool "libelf-0.8.13" +endchoice + +config EMBTK_LIBELF_VERSION_STRING + string + default "0.8.13" if EMBTK_LIBELF_VERSION_0_8_13 + diff --git a/packages/misc/libelf/libelf.mk b/packages/misc/libelf/libelf.mk new file mode 100644 index 0000000..9aef699 --- /dev/null +++ b/packages/misc/libelf/libelf.mk @@ -0,0 +1,101 @@ +################################################################################ +# GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# Copyright(C) 2009 GAYE Abdoulaye Walsimou. All rights reserved. +# +# This program is free software; you can distribute it and/or modify it +# under the terms of the GNU General Public License +# (Version 2 or later) published by the Free Software Foundation. +# +# This program is distributed in the hope it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +################################################################################ +# +# \file libelf.mk +# \brief libelf.mk of Embtoolkit +# \author GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# \date December 2009 +################################################################################ + +LIBELF_VERSION := $(subst ",,$(strip $(CONFIG_EMBTK_LIBELF_VERSION_STRING))) +LIBELF_SITE := http://www.mr511.de/software +LIBELF_PACKAGE := libelf-$(LIBELF_VERSION).tar.gz +LIBELF_BUILD_DIR := $(PACKAGES_BUILD)/libelf-$(LIBELF_VERSION) + +LIBELF_BINS = +LIBELF_SBINS = +LIBELF_INCLUDES = libelf gelf.h libelf.h nlist.h +LIBELF_LIBS = libelf.a +LIBELF_PKGCONFIGS = libelf.pc + +ifeq ($(CONFIG_EMBTK_64BITS_FS_COMPAT32),y) +PKG_CONFIG_PATH=$(SYSROOT)/usr/lib32/pkgconfig +else +PKG_CONFIG_PATH=$(SYSROOT)/usr/lib/pkgconfig +endif + +libelf_install: $(LIBELF_BUILD_DIR)/.installed + +$(LIBELF_BUILD_DIR)/.installed: gettext_install download_libelf \ + $(LIBELF_BUILD_DIR)/.decompressed $(LIBELF_BUILD_DIR)/.configured + $(call EMBTK_GENERIC_MESSAGE,"Compiling and installing \ + libelf-$(LIBELF_VERSION) in your root filesystem...") + $(Q)$(MAKE) -C $(LIBELF_BUILD_DIR) $(J) + $(Q)$(MAKE) -C $(LIBELF_BUILD_DIR) install + $(Q)$(MAKE) pkgconfig_files_adapt + @touch $@ + +download_libelf: + $(call EMBTK_GENERIC_MESSAGE,"Downloading $(LIBELF_PACKAGE) \ + if necessary...") + @test -e $(DOWNLOAD_DIR)/$(LIBELF_PACKAGE) || \ + wget -O $(DOWNLOAD_DIR)/$(LIBELF_PACKAGE) \ + $(LIBELF_SITE)/$(LIBELF_PACKAGE) + +$(LIBELF_BUILD_DIR)/.decompressed: + $(call EMBTK_GENERIC_MESSAGE,"Decompressing $(LIBELF_PACKAGE) ...") + @tar -C $(PACKAGES_BUILD) -xzf $(DOWNLOAD_DIR)/$(LIBELF_PACKAGE) + @touch $@ + +$(LIBELF_BUILD_DIR)/.configured: + $(Q)cd $(LIBELF_BUILD_DIR); \ + CC=$(TARGETCC_CACHED) \ + CXX=$(TARGETCXX_CACHED) \ + AR=$(TARGETAR) \ + RANLIB=$(TARGETRANLIB) \ + AS=$(CROSS_COMPILE)as \ + LD=$(TARGETLD) \ + NM=$(TARGETNM) \ + STRIP=$(TARGETSTRIP) \ + OBJDUMP=$(TARGETOBJDUMP) \ + OBJCOPY=$(TARGETOBJCOPY) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CXXFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="-L$(SYSROOT)/lib -L$(SYSROOT)/usr/lib \ + -L$(SYSROOT)/lib32 -L$(SYSROOT)/usr/lib32" \ + CPPFLGAS="-I$(SYSROOT)/usr/include" \ + PKG_CONFIG=$(PKGCONFIG_BIN) \ + PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \ + ./configure --build=$(HOST_BUILD) \ + --host=$(STRICT_GNU_TARGET) \ + --target=$(STRICT_GNU_TARGET) \ + --prefix=$(SYSROOT)/usr + @touch $@ + +libelf_clean: + $(call EMBTK_GENERIC_MESSAGE,"cleanup libelf-$(LIBELF_VERSION)...") + $(Q)-cd $(SYSROOT)/usr/bin; rm -rf $(LIBELF_BINS) + $(Q)-cd $(SYSROOT)/usr/sbin; rm -rf $(LIBELF_SBINS) + $(Q)-cd $(SYSROOT)/usr/include; rm -rf $(LIBELF_INCLUDES) + $(Q)-cd $(SYSROOT)/usr/lib; rm -rf $(LIBELF_LIBS) + $(Q)-cd $(SYSROOT)/usr/lib/pkgconfig; rm -rf $(LIBELF_PKGCONFIGS) +ifeq ($(CONFIG_EMBTK_64BITS_FS_COMPAT32),y) + $(Q)-cd $(SYSROOT)/usr/lib32; rm -rf $(LIBELF_LIBS) + $(Q)-cd $(SYSROOT)/usr/lib32/pkgconfig; rm -rf $(LIBELF_PKGCONFIGS) +endif + |