autoconf
[Top][All Lists]
Advanced

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

what to do if a function is in a library?


From: Sam Steingold
Subject: what to do if a function is in a library?
Date: Mon, 02 May 2011 12:44:26 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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.




reply via email to

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