Add support for libelf
authorEric Andersen <andersen@codepoet.org>
Fri, 25 Feb 2005 03:22:54 +0000 (03:22 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 25 Feb 2005 03:22:54 +0000 (03:22 -0000)
package/Config.in
package/libelf/Config.in [new file with mode: 0644]
package/libelf/libelf.mk [new file with mode: 0644]

index 98006453c048d51d25fc44a2032ced05f597c377..13a2288eee9e0be6731ed7e27f2b3fd86fdd9e25 100644 (file)
@@ -46,6 +46,7 @@ source "package/iproute2/Config.in"
 source "package/iptables/Config.in"
 source "package/jpeg/Config.in"
 source "package/less/Config.in"
+source "package/libelf/Config.in"
 source "package/libfloat/Config.in"
 source "package/libglib12/Config.in"
 source "package/libmad/Config.in"
diff --git a/package/libelf/Config.in b/package/libelf/Config.in
new file mode 100644 (file)
index 0000000..e0108f2
--- /dev/null
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_LIBELF
+       bool "libelf"
+       default n
+       help
+         This is the public release of libelf-0.8.5, a free ELF object
+         file access library.
+
+         http://www.stud.uni-hannover.de/~michael/software/
diff --git a/package/libelf/libelf.mk b/package/libelf/libelf.mk
new file mode 100644 (file)
index 0000000..0ee40f5
--- /dev/null
@@ -0,0 +1,61 @@
+#############################################################
+#
+# libelf
+#
+#############################################################
+LIBELF_VER=0.8.5
+LIBELF_SOURCE=libelf-$(LIBELF_VER).tar.gz
+LIBELF_SITE=http://www.stud.uni-hannover.de/~michael/software/
+LIBELF_DIR=$(BUILD_DIR)/libelf-$(LIBELF_VER)
+
+LIBELF_ARCH:=$(ARCH)
+ifeq ("$(strip $(ARCH))","armeb")
+LIBELF_ARCH:=arm
+endif
+
+$(DL_DIR)/$(LIBELF_SOURCE):
+       $(WGET) -P $(DL_DIR) $(LIBELF_SITE)/$(LIBELF_SOURCE)
+
+$(LIBELF_DIR)/.source: $(DL_DIR)/$(LIBELF_SOURCE)
+       zcat $(DL_DIR)/$(LIBELF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+       touch $(LIBELF_DIR)/.source
+
+$(LIBELF_DIR)/.configured: $(LIBELF_DIR)/.source
+       (cd $(LIBELF_DIR); \
+               $(TARGET_CONFIGURE_OPTS) \
+               ./configure \
+               --target=$(GNU_TARGET_NAME) \
+               --host=$(GNU_TARGET_NAME) \
+               --build=$(GNU_HOST_NAME) \
+               --prefix=/usr \
+               --sysconfdir=/etc \
+       );
+       touch $(LIBELF_DIR)/.configured;
+
+$(LIBELF_DIR)/libelf.so.$(LIBELF_VER): $(LIBELF_DIR)/.configured
+       $(MAKE) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld ARCH=$(LIBELF_ARCH) \
+               -C $(LIBELF_DIR)
+
+$(TARGET_DIR)/usr/lib/libelf.so.$(LIBELF_VER): $(LIBELF_DIR)/libelf.so.$(LIBELF_VER)
+       $(INSTALL) -d -m 0644 $(LIBELF_DIR)/libelf.so.$(LIBELF_VER) $(TARGET_DIR)/usr/lib/
+       $(INSTALL) -d -m 0644 $(LIBELF_DIR)/libelf.so $(TARGET_DIR)/usr/lib/
+
+libelf: uclibc $(TARGET_DIR)/usr/lib/libelf.so.$(LIBELF_VER)
+
+libelf-source: $(DL_DIR)/$(LIBELF_SOURCE)
+
+libelf-clean:
+       $(MAKE) prefix=$(TARGET_DIR)/usr -C $(LIBELF_DIR) uninstall
+       -$(MAKE) -C $(LIBELF_DIR) clean
+
+libelf-dirclean:
+       rm -rf $(LIBELF_DIR)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LIBELF)),y)
+TARGETS+=libelf
+endif