Automattic / Automattic/node-canvas
Improving library detection in has_lib.sh
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
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?
Contributor guide
No contributing guide indexed for this repository
Research direction
Read has_lib.sh and compare its current library detection with the proposed compiler probe using cc, gcc, and clang. Check the script's callers and existing build checks, then verify that the selected libraries produce the expected compiler return codes without disrupting supported environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, shell
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100