summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rwxr-xr-xbootstrap.sh2
-rw-r--r--configure.ac28
-rw-r--r--src/Makefile.am2
4 files changed, 27 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 507a02f..802daf0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@
dist_doc_DATA = README
EXTRA_DIST = bootstrap.sh autogen.sh LGPL libcanberra.schemas
-SUBDIRS = libltdl src gtkdoc doc
+SUBDIRS = src gtkdoc doc
MAINTAINERCLEANFILES = README
noinst_DATA = README
diff --git a/bootstrap.sh b/bootstrap.sh
index ce5d7e4..29d356f 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -63,7 +63,7 @@ else
mkdir -p m4
gtkdocize --copy --flavour no-tmpl --docdir gtkdoc
- "$LIBTOOLIZE" -c --force --ltdl --recursive
+ "$LIBTOOLIZE" -c --force --recursive
run_versioned aclocal "$VERSION" -I m4
run_versioned autoconf 2.63 -Wall
run_versioned autoheader 2.63
diff --git a/configure.ac b/configure.ac
index 79c05b8..51dc305 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,9 +65,32 @@ done
#### libtool stuff ####
LT_PREREQ(2.2)
-LT_CONFIG_LTDL_DIR([libltdl])
LT_INIT([dlopen win32-dll disable-static])
-LTDL_INIT([convenience recursive])
+
+dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
+dnl exactly which version of libltdl is present in the system, so we
+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
+dnl We don't need any special variable for this though, since the user
+dnl can give the proper place to find libltdl through the standard
+dnl variables like LDFLAGS and CPPFLAGS.
+
+AC_CHECK_HEADER([ltdl.h],
+ [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
+ [LIBLTDL=])
+
+AS_IF([test "x$LIBLTDL" = "x"],
+ [AC_MSG_ERROR([Unable to find libltdl.])])
+AC_SUBST([LIBLTDL])
#### Determine build environment ####
@@ -552,7 +575,6 @@ GTK_DOC_CHECK(1.9)
AC_CONFIG_FILES([
Makefile
-libltdl/Makefile
src/Makefile
libcanberra.pc
libcanberra-gtk.pc
diff --git a/src/Makefile.am b/src/Makefile.am
index d1b4d89..1fb5168 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -85,8 +85,6 @@ if BUILTIN_DSO
libcanberra_la_SOURCES += \
dso.c \
driver-order.c driver-order.h
-libcanberra_la_CFLAGS += \
- $(LTDLINCL)
libcanberra_la_LIBADD += \
$(LIBLTDL)