xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/binutils/binutils_2.38.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1require binutils.inc
2require binutils-${PV}.inc
3
4DEPENDS += "zlib"
5
6EXTRA_OECONF += "--with-sysroot=/ \
7                --enable-install-libbfd \
8                --enable-install-libiberty \
9                --enable-shared \
10                --with-system-zlib \
11                "
12
13EXTRA_OEMAKE:append:libc-musl = "\
14                                 gt_cv_func_gnugettext1_libc=yes \
15                                 gt_cv_func_gnugettext2_libc=yes \
16                                "
17EXTRA_OECONF:class-native = "--enable-targets=all \
18                             --enable-64-bit-bfd \
19                             --enable-install-libiberty \
20                             --enable-install-libbfd \
21                             --disable-gdb \
22                             --disable-gdbserver \
23                             --disable-libdecnumber \
24                             --disable-readline \
25                             --disable-sim \
26                             --disable-werror"
27
28PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
29PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils"
30
31do_install:class-native () {
32	autotools_do_install
33
34	# Install the libiberty header
35	install -d ${D}${includedir}
36	install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
37	install -m 644 ${S}/include/libiberty.h ${D}${includedir}
38
39	# We only want libiberty, libbfd and libopcodes
40	rm -rf ${D}${bindir}
41	rm -rf ${D}${prefix}/${TARGET_SYS}
42	rm -rf ${D}${prefix}/lib/ldscripts
43	rm -rf ${D}${prefix}/share/info
44	rm -rf ${D}${prefix}/share/locale
45	rm -rf ${D}${prefix}/share/man
46	rmdir ${D}${prefix}/share || :
47	rmdir ${D}/${libdir}/gcc-lib || :
48	rmdir ${D}/${libdir}64/gcc-lib || :
49	rmdir ${D}/${libdir} || :
50	rmdir ${D}/${libdir}64 || :
51}
52
53# libctf races with libbfd
54PARALLEL_MAKEINST:class-target = ""
55PARALLEL_MAKEINST:class-nativesdk = ""
56
57# Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include
58# extra stuff
59PACKAGE_BEFORE_PN += "libbfd libopcodes"
60FILES:libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so"
61FILES:libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so"
62
63SRC_URI:append:class-nativesdk =  " file://0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch "
64
65USE_ALTERNATIVES_FOR:class-nativesdk = ""
66FILES:${PN}:append:class-nativesdk = " ${bindir}"
67
68BBCLASSEXTEND = "native nativesdk"
69
70