Hi Mike,
On Sat, Mar 17, 2007 at 08:26:15PM +0100, Michal Trojnara wrote:
... Not exactly true. The relevant macro invocation is: AC_SEARCH_LIBS(gethostbyname, nsl)
I added the following line for debugging after
AC_SEARCH_LIBS(gethostbyname, nsl) AC_MSG_NOTICE([============>> LIBS=$LIBS])
Result: -lnsl was not added to $LIB. $LIB was empty here.
Maybe it's a problem with gethostbyname. Isn't gethostbyname a part of libc? What would happens if gethostbyname is resolved with libc?
In the manual (thanks for the link, I am a newbie to autoconf):
Search for a library defining function if it's not already available. .... first with no libraries, then for each library listed in search-libs.
"first with no libraries" ... so what happens if gethostbyname is resolved without libnsl? It won't be added :-(
I hope you understand that not every system uses nsl library like yours. 8-)
Yes, clear.
I use Linux with:
gcc (GCC) 3.4.6 glibc-2.3.6 autoconf-2.60
Kind regards Dieter