How to autotools figure what library need to be linked to?

2021-03-29 Thread Peng Yu
Hi,

crypt(3) does not need -lcrypt on macOS, but need -lcrypt on Linux.
How does autotools determine what library is need to be linked based
on the source code? Thanks.

-- 
Regards,
Peng



Re: ***UNCHECKED*** How to autotools figure what library need to be linked to?

2021-03-29 Thread Simon Richter
Hi,

On 29.03.21 16:20, Peng Yu wrote:

> crypt(3) does not need -lcrypt on macOS, but need -lcrypt on Linux.
> How does autotools determine what library is need to be linked based
> on the source code? Thanks.

It compiles a short test program that calls crypt, then tries to link it
without any extra libraries, and if that fails, retries with -lcrypt.

It does not look at the source code of the project at all, the
configure.ac just includes a reference to the test to be run, and a copy
of the test is included in the configure script.

   Simon



OpenPGP_signature
Description: OpenPGP digital signature