elfutils: add 0.158 from newe OE
[openembedded.git] / recipes / elfutils / elfutils_0.158.bb
1 SUMMARY = "Utilities and libraries for handling compiled object files"
2 HOMEPAGE = "https://fedorahosted.org/elfutils"
3 SECTION = "base"
4 LICENSE = "GPLv3-Elfutils-Exception"
5 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
6 DEPENDS = "libtool bzip2 zlib virtual/libintl"
7
8 SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/elfutils-${PV}.tar.bz2"
9
10 SRC_URI[md5sum] = "050a4909e452d01ab4747fd69d4036e0"
11 SRC_URI[sha256sum] = "be27af5c21352f53e010342bf1c68e0b9e18232dbf3adec7e2f9b41f6bbe397d"
12
13 # Pick patches from debian
14 # http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.158-2.debian.tar.xz
15 SRC_URI += "\
16         file://redhat-portability.diff;patch=1 \
17         file://redhat-robustify.diff;patch=1 \
18         file://hppa_backend.diff;patch=1 \
19         file://arm_backend.diff;patch=1 \
20         file://mips_backend.diff;patch=1 \
21         file://m68k_backend.diff;patch=1 \
22         file://testsuite-ignore-elflint.diff;patch=1 \
23         file://scanf-format.patch;patch=1 \
24         file://mips_readelf_w.patch;patch=1 \
25         file://core_filename.patch;patch=1 \
26         file://CVE-2014-0172.patch;patch=1 \
27         file://unwind_non_linux.patch;patch=1 \
28         file://elf_additions.diff;patch=1 \
29         file://mempcpy.patch;patch=1 \
30         file://dso-link-change.patch;patch=1 \
31         file://m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch;patch=1 \
32         file://fixheadercheck.patch;patch=1 \
33 "
34
35 # Only apply when building uclibc based target recipe
36 SRC_URI_append_libc-uclibc = " file://uclibc-support.patch"
37
38 # The buildsystem wants to generate 2 .h files from source using a binary it just built,
39 # which can not pass the cross compiling, so let's work around it by adding 2 .h files
40 # along with the do_configure_prepend()
41
42 SRC_URI += "\
43         file://i386_dis.h \
44         file://x86_64_dis.h \
45 "
46 inherit autotools gettext
47
48 EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
49 EXTRA_OECONF_append_class-native = " --without-bzlib"
50 EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
51
52 do_configure_prepend() {
53         sed -i '/^i386_dis.h:/,+4 {/.*/d}' ${S}/libcpu/Makefile.am
54
55         cp ${WORKDIR}/*dis.h ${S}/libcpu
56 }
57
58 do_install_append() {
59         if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
60                 rm ${D}${bindir}/eu-objdump
61         fi
62 }
63
64 # we can not build complete elfutils when using uclibc
65 # but some recipes e.g. gcc 4.5 depends on libelf so we
66 # build only libelf for uclibc case
67
68 EXTRA_OEMAKE_libc-uclibc = "-C libelf"
69 EXTRA_OEMAKE_class-native = ""
70 EXTRA_OEMAKE_class-nativesdk = ""
71
72 BBCLASSEXTEND = "native"
73 # BBCLASSEXTEND = "native nativesdk"
74
75 # Package utilities separately
76 PACKAGES =+ "${PN}-binutils libelf libasm libdw libdw-dev libasm-dev libelf-dev"
77 FILES_${PN}-binutils = "\
78     ${bindir}/eu-addr2line \
79     ${bindir}/eu-ld \
80     ${bindir}/eu-nm \
81     ${bindir}/eu-readelf \
82     ${bindir}/eu-size \
83     ${bindir}/eu-strip"
84
85 FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
86 FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
87 FILES_libdw  = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
88 FILES_libelf-dev = "${libdir}/libelf.so ${includedir}"
89 FILES_libasm-dev = "${libdir}/libasm.so ${includedir}/elfutils/libasm.h"
90 FILES_libdw-dev  = "${libdir}/libdw.so  ${includedir}/dwarf.h ${includedir}/elfutils/libdw*.h"
91 # Some packages have the version preceeding the .so instead properly
92 # versioned .so.<version>, so we need to reorder and repackage.
93 #FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
94 #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
95
96 # The package contains symlinks that trip up insane
97 INSANE_SKIP_${MLPREFIX}libdw = "dev-so"