linux: install perf in development builds

perf will be built if CONFIG_PERF_EVENTS is enabled in the
kernel config.

elfutils, binutils and libunwind are needed to get symbols
of userspace programs in perf output.

zlib is an implicit dependency of elfutils and and optional
one for perf - but better add it here.

openssl/libcrypto is an optional dependency for perf, add it
so that the perf configuration on clean build is identical
to an unclean rebuild.

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2018-02-05 15:38:18 +01:00
parent 65490c26dd
commit a7bac9930e

View File

@ -50,6 +50,11 @@ else
PKG_KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_CFG_FILE PKG_KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_CFG_FILE
fi fi
if [ "$DEVTOOLS" = "yes" ] && grep -q ^CONFIG_PERF_EVENTS= $PKG_KERNEL_CFG_FILE ; then
PKG_BUILD_PERF="yes"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET binutils elfutils libunwind zlib openssl"
fi
case "$LINUX" in case "$LINUX" in
amlogic-3.10) amlogic-3.10)
PKG_VERSION="02fdb27" PKG_VERSION="02fdb27"
@ -175,6 +180,25 @@ make_target() {
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/source rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/source
if [ "$PKG_BUILD_PERF" = "yes" ] ; then
( cd tools/perf
WERROR=0 \
NO_LIBPERL=1 \
NO_LIBPYTHON=1 \
NO_SLANG=1 \
NO_GTK2=1 \
NO_LIBNUMA=1 \
NO_LIBAUDIT=1 \
NO_LZMA=1 \
NO_SDT=1 \
LDFLAGS="-ldw -ldwfl -lebl -lelf -ldl -lz" \
EXTRA_PERFLIBS="-lebl" \
make
mkdir -p $INSTALL/usr/bin
cp perf $INSTALL/usr/bin
)
fi
( cd $ROOT ( cd $ROOT
rm -rf $BUILD/initramfs rm -rf $BUILD/initramfs
$SCRIPTS/install initramfs $SCRIPTS/install initramfs