1AC_DEFUN([GP_DYNAMIC_LIBRARIES],[dnl
2dnl We require either of those
3dnl AC_REQUIRE([AC_LIBTTDL_INSTALLABLE])dnl
4dnl AC_REQUIRE([AC_LIBLTDL_CONVENIENCE])dnl
5AC_REQUIRE([AC_LIBTOOL_DLOPEN])dnl
6AC_REQUIRE([AC_PROG_LIBTOOL])dnl
7dnl ---------------------------------------------------------------------------
8dnl Check for libltdl:
9dnl  - lt_dlforeachfile has been introduced in libtool-1.4.
10dnl  - However, there are still systems out there running libtool-1.3.
11dnl    For those, we will use our shipped libltdl. This has the welcome
12dnl    side effect that we don't have to distinguish between libltdl 1.3 with
13dnl    and without the notorious segfault bug.
14dnl  - FIXME: In case we're using our own version, we have to check whether
15dnl           -ldl is required?
16dnl ---------------------------------------------------------------------------
17# $0
18ltdl_msg="no (not found or too old)"
19have_ltdl=false
20LIBS_save="$LIBS"
21LIBS="$LIBLTDL"
22AC_CHECK_LIB([ltdl], [lt_dlforeachfile],[
23	CPPFLAGS_save="$CPPFLAGS"
24	CPPFLAGS="$LTDLINCL"
25	AC_CHECK_HEADER([ltdl.h],[
26		AC_DEFINE([HAVE_LTDL],1,[whether we use libltdl])
27		ltdl_msg="yes (from system)"
28		have_ltdl=:
29	])
30	CPPFLAGS="$CPPFLAGS_save"
31])
32LIBS="$LIBS_save"
33if "$have_ltdl"; then :; else
34	AC_MSG_CHECKING([for included libltdl])
35	if test -d "$srcdir/libltdl"; then
36		LIBLTDL="\$(top_builddir)/libltdl/libltdlc.la"
37		LTDLINCL="-I\$(top_srcdir)/libltdl"
38		have_ltdl=:
39		ltdl_msg="yes (included)"
40		AC_MSG_RESULT([yes])
41	else
42		AC_MSG_RESULT([no])
43		AC_MSG_ERROR([
44*** Could not detect or configure libltdl.
45])
46	fi
47fi
48GP_CONFIG_MSG([libltdl],["${ltdl_msg}"])
49])dnl
50dnl
51dnl ####################################################################
52dnl
53dnl Please do not remove this:
54dnl filetype: 2b993145-3256-47b4-84fd-ec4dcdf4fdf9
55dnl I use this to find all the different instances of this file which
56dnl are supposed to be synchronized.
57dnl
58dnl Local Variables:
59dnl mode: autoconf
60dnl End:
61