autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -lsocket -lsnl on solaris 9


From: Jeff Fulmer
Subject: Re: -lsocket -lsnl on solaris 9
Date: Mon, 26 Jan 2004 11:17:47 -0500

On Mon, Jan 26, 2004 at 03:43:44PM +0000, Lars Hecking wrote:
> Jeff Fulmer writes:
> > Hello,
> > 
> > I'm at wit's end here. I used to be able to link to the socket libs on
> > Solaris using the following directives in configure.in
> > 
> > AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket))
> > AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
> >  
> > AC_CHECK_LIB(socket, socket)  
> > 
> > At link time, it would add -lsocket and -lnsl
> > 
> > Since I've upgraded to solaris 9, this is no longer the the case.
> > configure correctly notes that I need -lsocket and -lnsl and adds those
> > flags to LIBS, however the only way I can get this to work is to add
> > LIBS to LDFLAGS as such:
> > 
> > LDFLAGS  =  $(SSL_LDFLAGS) @LIBS@  
> > 
> > Am I missing something? 
> 
>  Have you checked config.log? Maybe the order of the checks is important.
>  I've been using the following for ages, and it continues to work on
>  Solaris 9:
> 
> AC_CHECK_FUNCS(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname,,[AC_CHECK_LIB(socket,gethostbyname)])])
> AC_CHECK_FUNCS(setsockopt,,[AC_CHECK_LIB(socket,setsockopt)])

The checks appear to be working, I checked the logs. -lsocket and -lnsl
ARE in LIBS, but I need to add @LIBS@ to LDFLAGS in order to get this to
link. I've never had to do that before...

Jeff 
 
-- 
#include <stdio.h>
int main(){int a[]={74,117,115,116,32,97,110,111,116,104,101,114,32, \
67,32,104,97,99,107,101,114,10,0}; int *b=a;while(*b>0)putchar(*b++);}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]