>From [[EMAIL PROTECTED]]:
On Mon, May 08, 2000 at 10:07:12AM +0200, Daniel Stenberg wrote:
: Hi
: 
: It turns out that there are systems (NCR MP-RAS (svr4)) that require TWO libs
: for gethostbyname() and connect() should compile/build properly. The current
: configure rule only checks for one lib at a time and thus both checks fails
: on this system and it won't build properly.
: 
: Yes, you can enter the libs manually when running configure but I would of
: course prefer a solution that works automatically.
: 
: Today, the configure.in line looks like:
: 
: AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
: 
: ... and it seems as if the AC_CHECK_LIB() macro only can deal with a single
: lib at a time.
: 
: Does anyone have a good fix for this?
: 
: -- 
:    Daniel Stenberg - http://www.contactor.se/~dast - +46-705-44 31 77
:    ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol

I use AC_TRY_LINK directly for these kinds of things.  It would go something
like this:

my_ac_save_LIBS=$LIBS
LIBS="-llib1 -llib2"
AC_TRY_LINK( [#include <whatever>],
             [gethostbyname();],
             my_ac_link_result=success,
             my_ac_link_result=failure )
LIBS=$my_ac_save_LIBS

if test "$my_ac_link_result" = "failure"; then
  AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
else
  LIBS="-llib1 -llib2 $LIBS"
fi

This is of course the two-lib test, which should be used as a fallback when
the normal one-library test fail.

  Lars J

Reply via email to