Re: How to autotools figure what library need to be linked to?
On Tue, 30 Mar 2021, Peng Yu wrote: I am confused about what belongs to autoconf and what belongs to automake. For the usually configure -> make -> make install, what belongs to autoconf what belongs to automake? It is reasonable to be confused about this unless one reads the documentation. Most elements used to prepare the configure script are from Autoconf (https://www.gnu.org/software/autoconf/manual/) but some parts pertaining to production (and maintenance) of the Autoconf/Automake/Libtool parts are handled by Autoconf macros from Automake (https://www.gnu.org/software/automake/manual/). It is definitely worth reading some of the documentation. I see that section 2 of the Autoconf documentation specifically answers your question. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
Re: How to autotools figure what library need to be linked to?
I am confused about what belongs to autoconf and what belongs to automake. For the usually configure -> make -> make install, what belongs to autoconf what belongs to automake? Thanks. On 3/30/21, Bob Friesenhahn wrote: > On Mon, 29 Mar 2021, Peng Yu wrote: > >> 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. > > This is really an Autoconf (configure script) issue and not an > Automake issue. The common approach using Autoconf is to test various > known permutations (starting with nothing, and then adding crypt) > until linking succeeds. > > I expect that there is already a macro from the Autoconf macro archive > which handles this case. > > Bob > -- > Bob Friesenhahn > bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ > GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ > Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt > -- Regards, Peng
Re: How to autotools figure what library need to be linked to?
On Mon, 29 Mar 2021, Peng Yu wrote: 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. This is really an Autoconf (configure script) issue and not an Automake issue. The common approach using Autoconf is to test various known permutations (starting with nothing, and then adding crypt) until linking succeeds. I expect that there is already a macro from the Autoconf macro archive which handles this case. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
Re: ***UNCHECKED*** How to autotools figure what library need to be linked to?
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
How to autotools figure what library need to be linked to?
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