Add new module to check if a library is installed.

This is very suboptimal compared to using pkg-config, but there are
still some libraries which don't install pkg-config files.
This commit is contained in:
Simon Howard 2019-01-20 16:04:32 -05:00
parent 0013d1623c
commit 1cca6143f5
2 changed files with 18 additions and 0 deletions

View file

@ -21,6 +21,10 @@ check_pkgconfig() {
install_module check_pkgconfig "$@" install_module check_pkgconfig "$@"
} }
check_library() {
install_module check_library "$@"
}
check_tool() { check_tool() {
install_module check_tool "$@" install_module check_tool "$@"
} }

View file

@ -0,0 +1,14 @@
check_library::init() {
PACKAGE_INSTALLED_LIB=$1
}
# Function that returns true if a specified C library is installed.
do_check() {
# TODO: A better way to choose compiler command?
${CC:-gcc} \
-l$PACKAGE_INSTALLED_LIB $LDFLAGS \
-o/dev/null \
-x c <( echo "int main() {}")
}