dnl just assume that it's a working version as long as we have the
dnl library and the header files.
dnl
+dnl As an extra safety device, check for lt_dladvise_init() which is
+dnl only implemented in libtool 2.x, and refine as we go if we have
+dnl refined requirements.
+dnl
dnl Check the header files first since the system may have a
dnl libltdl.so for runtime, but no headers, and we want to bail out as
dnl soon as possible.
dnl variables like LDFLAGS and CPPFLAGS.
AC_CHECK_HEADER([ltdl.h],
- [AC_CHECK_LIB([ltdl], [lt_dlopen], [LIBLTDL=-lltdl], [LIBLTDL=])],
+ [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
[LIBLTDL=])
AS_IF([test "x$LIBLTDL" = "x"],