Skip to content

Improving library detection in has_lib.sh #288

Open
@pb82

Description

@pb82

Since there seem to be some issues with the current implementation of 'has_lib.sh' why not let the compiler take care of the library search path?

By executing

echo "int main(){return 0;}" | cc -xc -l$1 -o /dev/null -

and checking the return code one could determine the existence of a library. Works with gcc and clang.

Are there problems that i'm missing or could this be a viable solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions