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:
parent
0013d1623c
commit
1cca6143f5
|
@ -21,6 +21,10 @@ check_pkgconfig() {
|
|||
install_module check_pkgconfig "$@"
|
||||
}
|
||||
|
||||
check_library() {
|
||||
install_module check_library "$@"
|
||||
}
|
||||
|
||||
check_tool() {
|
||||
install_module check_tool "$@"
|
||||
}
|
||||
|
|
|
@ -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() {}")
|
||||
}
|
||||
|
Loading…
Reference in New Issue