what to do if a function is in a library?

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

 



This comes from AC_PATH_XTRA:

checking for gethostbyname... no
checking for gethostbyname in -lnsl... yes

the result of this is that ac_cv_func_connect=no and HAVE_GETHOSTBYNAME
is undefined.
However, since -lnsl is actually added to LIBS at some point,
gethostbyname() is present and available.
So, how do I make sure that autoconf knows that gethostbyname really is
there?

Alas, adding

test X$ac_cv_lib_socket_connect = Xyes && ac_cv_func_connect=yes
test X$ac_cv_lib_nsl_gethostbyname = Xyes && ac_cv_func_gethostbyname=yes
test X$ac_cv_lib_bsd_gethostbyname = Xyes && ac_cv_func_gethostbyname=yes

after AC_PATH_XTRA in configure.in is no good because HAVE_GETHOSTBYNAME
is not defined.

I guess I could do

undef ac_cv_func_connect
cl_save_LIBS=$LIBS
test x$LIBSOCKET = x || LIBS="$LIBS $LIBSOCKET"
AC_CHECK_FUNCS(connect)
LIBS=$cl_save_LIBS

(I have gl_SOCKETS in gl_INIT).
Is that TRT?

Thanks

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://www.memritv.org http://palestinefacts.org http://truepeace.org
http://www.PetitionOnline.com/tap12009/ http://dhimmi.com http://camera.org
If you think big enough, you'll never have to do it.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux