From 65e2acb62577121b0a35c2273f7a614346c97aa0 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 13 May 2009 09:43:36 +0000 Subject: [PATCH] build system: (Hopefully) added support for libtool 1.5 _and_ 2.2. The macro LT_PACKAGE_VERSION (which appeared in libtool 2.2) is used to check weather we're using libtool 2.2. --- Makefile.am | 2 ++ configure.in | 25 +++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index b52b0e93..9e3feac4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +ACLOCAL_AMFLAGS = -I libltdl/m4 + SUBDIRS = libltdl src bindings INCLUDES = $(LTDLINCL) diff --git a/configure.in b/configure.in index 2d3d8030..0fd6e78d 100644 --- a/configure.in +++ b/configure.in @@ -2,6 +2,25 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(collectd, m4_esyscmd(./version-gen.sh)) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) + +m4_ifdef([LT_PACKAGE_VERSION], + # libtool >= 2.2 + [ + LT_CONFIG_LTDL_DIR([libltdl]) + LT_INIT([dlopen]) + LTDL_INIT([convenience]) + ] +, + # libtool <= 1.5 + [ + AC_LIBLTDL_CONVENIENCE + AC_SUBST(LTDLINCL) + AC_SUBST(LIBLTDL) + AC_LIBTOOL_DLOPEN + AC_CONFIG_SUBDIRS(libltdl) + ] +) + AM_INIT_AUTOMAKE(dist-bzip2) AC_LANG(C) @@ -20,17 +39,11 @@ AC_PROG_MAKE_SET AM_PROG_CC_C_O AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes") -dnl configure libtool AC_DISABLE_STATIC -AC_LIBLTDL_CONVENIENCE -AC_SUBST(LTDLINCL) -AC_SUBST(LIBLTDL) -AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL AC_PROG_LEX AC_PROG_YACC PKG_PROG_PKG_CONFIG -AC_CONFIG_SUBDIRS(libltdl) AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in -- 2.30.2