autoconf
[Top][All Lists]
Advanced

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

AC_CHECK_LIB


From: Paul Martinolich
Subject: AC_CHECK_LIB
Date: Fri, 27 Oct 2000 12:24:35 -0500

I am searching for dlopen in both the c and dl libraries and want
to create the variable LIBDL as either blank or -ldir.  I do this
rather than add it to LIBS because my SGI linker gives me warnings
that the 'dir' library does not resolve any symbols for those
programs that do not use 'dlopen'.  I use automake to add LIBDL
on only those programs that need this function.

I am currently using:

AC_CHECK_LIB(c, dlopen, LIBDL="", AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl"))

and CVS autoconf from June 6, 2000.  I have just updated my CVS
and am getting this produced in the configure.in.

--------------------------------------------------------------
echo "configure:2974: checking for dlopen in -lc" >&5
echo $ECHO_N "checking for dlopen in -lc... $ECHO_C" >&6
if test "${ac_cv_lib_c_dlopen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lc  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line 2982 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dlopen ();
int
main ()
{
dlopen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo configure:3001: \"$ac_link\") >&5; (eval $ac_link) 2>&5; } && 
test -s conftest$ac_exeext; then
  ac_cv_lib_c_dlopen=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_lib_c_dlopen=no
fi
rm -f conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "configure:3011: result: $ac_cv_lib_c_dlopen" >&5
echo "${ECHO_T}$ac_cv_lib_c_dlopen" >&6
if test $ac_cv_lib_c_dlopen = yes; then
  LIBDL=""
else
    LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
-----------------------------------------------------------------------

This last line appears to be a config message but is not being properly
quoted.

How should I fix this?

Paul



reply via email to

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