diff options
3 files changed, 101 insertions, 17 deletions
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch new file mode 100644 index 0000000000..7692709724 --- /dev/null +++ b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | make the tool to be cross compilable. | ||
| 2 | |||
| 3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | Index: mkelfImage/configure.ac | ||
| 7 | =================================================================== | ||
| 8 | --- mkelfImage.orig/configure.ac 2012-07-14 14:04:48.964898667 -0700 | ||
| 9 | +++ mkelfImage/configure.ac 2012-07-14 14:10:47.800916083 -0700 | ||
| 10 | @@ -70,6 +70,9 @@ | ||
| 11 | AC_MSG_ERROR([cc not found]) | ||
| 12 | fi | ||
| 13 | eval "${with_default}_CC='$CC'" | ||
| 14 | + if test "x$HOST_CC" = 'x'; then | ||
| 15 | + AC_CHECK_PROG([HOST_CC], [$CC], [$CC], [gcc], [$PATH]) | ||
| 16 | + fi | ||
| 17 | AC_PROG_CPP | ||
| 18 | if test "$CPP" = no; then | ||
| 19 | AC_MSG_ERROR([cpp not found]) | ||
| 20 | @@ -172,7 +175,6 @@ | ||
| 21 | |||
| 22 | dnl ---Output variables... | ||
| 23 | |||
| 24 | -HOST_CC=$CC | ||
| 25 | HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)" | ||
| 26 | |||
| 27 | dnl TODO: figure out how to set these appropriately for compilers other than gcc | ||
| 28 | Index: mkelfImage/linux-i386/Makefile | ||
| 29 | =================================================================== | ||
| 30 | --- mkelfImage.orig/linux-i386/Makefile 2012-07-14 14:04:48.964898667 -0700 | ||
| 31 | +++ mkelfImage/linux-i386/Makefile 2012-07-14 14:04:49.032898671 -0700 | ||
| 32 | @@ -4,7 +4,7 @@ | ||
| 33 | |||
| 34 | $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP) | ||
| 35 | $(MKDIR) -p $(@D) | ||
| 36 | - $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@ | ||
| 37 | + $(CC) $(HOST_CFLAGS) -c -g $< -o $@ | ||
| 38 | |||
| 39 | |||
| 40 | ifdef I386_CC | ||
| 41 | Index: mkelfImage/linux-ia64/Makefile | ||
| 42 | =================================================================== | ||
| 43 | --- mkelfImage.orig/linux-ia64/Makefile 2012-07-14 14:04:48.964898667 -0700 | ||
| 44 | +++ mkelfImage/linux-ia64/Makefile 2012-07-14 14:04:49.032898671 -0700 | ||
| 45 | @@ -4,7 +4,7 @@ | ||
| 46 | |||
| 47 | $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP) | ||
| 48 | $(MKDIR) -p $(@D) | ||
| 49 | - $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@ | ||
| 50 | + $(CC) $(HOST_CFLAGS) -c -g $< -o $@ | ||
| 51 | |||
| 52 | ifdef IA64_CC | ||
| 53 | |||
| 54 | Index: mkelfImage/main/Makefile | ||
| 55 | =================================================================== | ||
| 56 | --- mkelfImage.orig/main/Makefile 2012-07-14 14:04:48.964898667 -0700 | ||
| 57 | +++ mkelfImage/main/Makefile 2012-07-14 14:04:49.032898671 -0700 | ||
| 58 | @@ -4,11 +4,11 @@ | ||
| 59 | |||
| 60 | $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS) | ||
| 61 | $(MKDIR) -p $(@D) | ||
| 62 | - $(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS) | ||
| 63 | + $(CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS) | ||
| 64 | |||
| 65 | $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS) | ||
| 66 | $(MKDIR) -p $(@D) | ||
| 67 | - $(HOST_CC) $(HOST_CFLAGS) -c $< -o $@ | ||
| 68 | + $(CC) $(HOST_CFLAGS) -c $< -o $@ | ||
| 69 | |||
| 70 | $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man | ||
| 71 | $(MKDIR) -p $(@D) | ||
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb deleted file mode 100644 index 4b45c677f6..0000000000 --- a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | DESCRIPTION = "A utility to create ELF boot images from Linux kernel images" | ||
| 2 | HOMEPAGE = "http://www.coreboot.org/Mkelfimage" | ||
| 3 | SECTION = "devel" | ||
| 4 | LICENSE = "GPLv2" | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a" | ||
| 6 | |||
| 7 | SRCREV = "e1e6a91ce0738400fa1615179de88ebc0df29f66" | ||
| 8 | PV = "1.0.0+gitr${SRCPV}" | ||
| 9 | PR = "r1" | ||
| 10 | |||
| 11 | SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http;branch=master" | ||
| 12 | |||
| 13 | S = "${WORKDIR}/git/util/mkelfImage" | ||
| 14 | |||
| 15 | inherit autotools | ||
| 16 | |||
| 17 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_svn.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_svn.bb new file mode 100644 index 0000000000..c670f23e25 --- /dev/null +++ b/meta/recipes-devtools/mkelfimage/mkelfimage_svn.bb | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | DESCRIPTION = "A utility to create ELF boot images from Linux kernel images" | ||
| 2 | HOMEPAGE = "http://www.coreboot.org/Mkelfimage" | ||
| 3 | SECTION = "devel" | ||
| 4 | LICENSE = "GPLv2" | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a" | ||
| 6 | |||
| 7 | SRCREV = "6637" | ||
| 8 | PV = "1.0.0+svn${SRCPV}" | ||
| 9 | PR = "r1" | ||
| 10 | |||
| 11 | DEPENDS += "zlib" | ||
| 12 | |||
| 13 | SRC_URI = "svn://coreboot.org/coreboot/trunk/util;module=mkelfImage \ | ||
| 14 | file://cross-compile.patch \ | ||
| 15 | " | ||
| 16 | |||
| 17 | S = "${WORKDIR}/mkelfImage" | ||
| 18 | |||
| 19 | CFLAGS += "-fno-stack-protector" | ||
| 20 | CACHED_CONFIGUREVARS += "HOST_CC='${BUILD_CC}'" | ||
| 21 | EXTRA_OEMAKE += "HOST_CPPFLAGS='${BUILD_CPPFLAGS}'" | ||
| 22 | |||
| 23 | inherit autotools | ||
| 24 | |||
| 25 | do_install_append() { | ||
| 26 | rmdir ${D}${datadir}/mkelfImage/elf32-i386 | ||
| 27 | rmdir ${D}${datadir}/mkelfImage | ||
| 28 | } | ||
| 29 | |||
| 30 | BBCLASSEXTEND = "native" | ||
