Merge pull request #417 from rafalste/configure_deps

Add libelf check to configure
This commit is contained in:
Robert Baldyga 2020-06-10 16:13:22 +02:00 committed by GitHub
commit 1704017839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

17
configure vendored
View File

@ -55,6 +55,23 @@ then
MISSING_TOOLS=1 MISSING_TOOLS=1
fi fi
if [ ! -f /usr/include/libelf.h ]; then
KERNEL_CONFIG=$(find /usr/src/ -type d -name "*$(uname -r)")/.config
if [ -f "$KERNEL_CONFIG" ]; then
if grep ^CONFIG_UNWINDER_ORC=[Yy] "$KERNEL_CONFIG" &>/dev/null; then
echo "Error: CONFIG_UNWINDER_ORC=y option is set in your kernel,"\
"please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
MISSING_TOOLS=1
fi
elif [ "$MISSING_TOOLS" -eq 0 ]; then
# Print this warning only if there is no missing tools, to not confuse the user
# that installing libelf-dev might help with the lack of needed utilities.
echo "Warning: unable to find kernel config" >&2
echo -e "If configure ends with an error, you may need to install"\
"libelf-dev, libelf-devel or elfutils-libelf-devel\n" >&2
fi
fi
if [ "$MISSING_TOOLS" -ne "0" ] if [ "$MISSING_TOOLS" -ne "0" ]
then then
exit 1 exit 1