mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2024-11-10 07:11:39 +00:00
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
2 changed files with 18 additions and 0 deletions
|
@ -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 "$@"
|
||||||
}
|
}
|
||||||
|
|
14
chocpkg/modules/check_library.sh
Normal file
14
chocpkg/modules/check_library.sh
Normal 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() {}")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue