blob: 12a6fb55776e3fa362cabca599680c48b43ee426 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001require binutils.inc
2require binutils-${PV}.inc
3
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05004DEPENDS += "zlib"
Andrew Geissler82c905d2020-04-13 13:39:40 -05005
6EXTRA_OECONF += "--with-sysroot=/ \
7 --enable-install-libbfd \
8 --enable-install-libiberty \
9 --enable-shared \
10 --with-system-zlib \
11 "
12
Patrick Williams213cb262021-08-07 19:21:33 -050013EXTRA_OEMAKE:append:libc-musl = "\
Andrew Geissler82c905d2020-04-13 13:39:40 -050014 gt_cv_func_gnugettext1_libc=yes \
15 gt_cv_func_gnugettext2_libc=yes \
16 "
Patrick Williams213cb262021-08-07 19:21:33 -050017EXTRA_OECONF:class-native = "--enable-targets=all \
Andrew Geissler82c905d2020-04-13 13:39:40 -050018 --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
Andrew Geisslerc926e172021-05-07 16:11:35 -050028PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
Andrew Geissler90fd73c2021-03-05 15:25:55 -060029PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils"
Andrew Geissler82c905d2020-04-13 13:39:40 -050030
Patrick Williams213cb262021-08-07 19:21:33 -050031do_install:class-native () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050032 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
Andrew Geisslerd1e89492021-02-12 15:35:20 -060053# libctf races with libbfd
Patrick Williams213cb262021-08-07 19:21:33 -050054PARALLEL_MAKEINST:class-target = ""
55PARALLEL_MAKEINST:class-nativesdk = ""
Andrew Geisslerd1e89492021-02-12 15:35:20 -060056
57# Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include
58# extra stuff
59PACKAGE_BEFORE_PN += "libbfd libopcodes"
Patrick Williams213cb262021-08-07 19:21:33 -050060FILES:libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so"
61FILES:libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so"
Andrew Geissler82c905d2020-04-13 13:39:40 -050062
Patrick Williams213cb262021-08-07 19:21:33 -050063SRC_URI:append:class-nativesdk = " file://0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch "
Andrew Geissler82c905d2020-04-13 13:39:40 -050064
Patrick Williams213cb262021-08-07 19:21:33 -050065USE_ALTERNATIVES_FOR:class-nativesdk = ""
66FILES:${PN}:append:class-nativesdk = " ${bindir}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050067
68BBCLASSEXTEND = "native nativesdk"
69