xref: /OK3568_Linux_fs/device/rockchip/common/scripts/check-header.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/bash -e
2
3SCRIPTS_DIR="${SCRIPTS_DIR:-$(dirname "$(realpath "$0")")}"
4RK_DATA_DIR="${RK_DATA_DIR:-$SCRIPTS_DIR/../data}"
5
6PACKAGE="$1"
7HEADER="$2"
8APT_PACKAGE="$3"
9
10if echo | gcc -E -include "$HEADER" - &>/dev/null; then
11	exit 0
12fi
13
14echo -e "\e[35m"
15echo "Your $PACKAGE headers are missing"
16echo "Please install it:"
17echo "sudo apt-get install $APT_PACKAGE"
18echo -e "\e[0m"
19exit 1
20