From 9f1c4539dc27000f231fde4893ffaa5b4facd04f Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 30 Oct 2013 11:58:45 +0100 Subject: [PATCH] Remove libltdl dependency. Refs #4964 --- autogen.sh | 1 - components/checker/Makefile.am | 1 - components/cluster/Makefile.am | 1 - components/compat/Makefile.am | 1 - components/db_ido_mysql/Makefile.am | 1 - components/demo/Makefile.am | 1 - components/livestatus/Makefile.am | 1 - components/notification/Makefile.am | 1 - components/perfdata/Makefile.am | 1 - configure.ac | 12 +----------- icinga-app/Makefile.am | 22 +--------------------- icinga-app/icinga.cpp | 18 ------------------ icinga2.spec.in | 1 - lib/base/Makefile.am | 3 +-- lib/base/unix.h | 1 - lib/base/utility.cpp | 10 +++++----- lib/base/utility.h | 2 +- lib/config/Makefile.am | 1 - lib/db_ido/Makefile.am | 1 - lib/icinga/Makefile.am | 1 - lib/python/Makefile.am | 1 - third-party/Makefile.am | 1 - 22 files changed, 9 insertions(+), 74 deletions(-) diff --git a/autogen.sh b/autogen.sh index 62eab3a6c..00ce9e442 100755 --- a/autogen.sh +++ b/autogen.sh @@ -174,7 +174,6 @@ do if test -z "$NO_LIBTOOLIZE" ; then echo "Running $LIBTOOLIZE..." $LIBTOOLIZE --force --copy - find third-party/ltdl \! -perm u=w -exec chmod u+w '{}' ';' fi fi echo "Running aclocal $aclocalinclude ..." diff --git a/components/checker/Makefile.am b/components/checker/Makefile.am index 22945b025..202754518 100644 --- a/components/checker/Makefile.am +++ b/components/checker/Makefile.am @@ -22,7 +22,6 @@ libchecker_la_SOURCES = \ checker-type.conf libchecker_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components diff --git a/components/cluster/Makefile.am b/components/cluster/Makefile.am index 89eec5be8..08dbb881e 100644 --- a/components/cluster/Makefile.am +++ b/components/cluster/Makefile.am @@ -28,7 +28,6 @@ libcluster_la_SOURCES = \ jsonrpc.h libcluster_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components diff --git a/components/compat/Makefile.am b/components/compat/Makefile.am index 279689fe6..9a1f6dc13 100644 --- a/components/compat/Makefile.am +++ b/components/compat/Makefile.am @@ -34,7 +34,6 @@ libcompat_la_SOURCES = \ compat-type.conf libcompat_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components diff --git a/components/db_ido_mysql/Makefile.am b/components/db_ido_mysql/Makefile.am index 6e8b8137c..a43e3db88 100644 --- a/components/db_ido_mysql/Makefile.am +++ b/components/db_ido_mysql/Makefile.am @@ -27,7 +27,6 @@ libdb_ido_mysql_la_SOURCES = \ idomysqlconnection.ti libdb_ido_mysql_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ $(MYSQL_CFLAGS) \ -I${top_srcdir}/lib \ diff --git a/components/demo/Makefile.am b/components/demo/Makefile.am index 3151556ea..2d94d831f 100644 --- a/components/demo/Makefile.am +++ b/components/demo/Makefile.am @@ -22,7 +22,6 @@ libdemo_la_SOURCES = \ demo-type.conf libdemo_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components diff --git a/components/livestatus/Makefile.am b/components/livestatus/Makefile.am index 91775b984..e62482f7a 100644 --- a/components/livestatus/Makefile.am +++ b/components/livestatus/Makefile.am @@ -82,7 +82,6 @@ liblivestatus_la_SOURCES = \ table.h liblivestatus_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components diff --git a/components/notification/Makefile.am b/components/notification/Makefile.am index 69134f368..5132b6699 100644 --- a/components/notification/Makefile.am +++ b/components/notification/Makefile.am @@ -22,7 +22,6 @@ libnotification_la_SOURCES = \ notification-type.conf libnotification_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components diff --git a/components/perfdata/Makefile.am b/components/perfdata/Makefile.am index 67c5b8292..aeb073e99 100644 --- a/components/perfdata/Makefile.am +++ b/components/perfdata/Makefile.am @@ -27,7 +27,6 @@ libperfdata_la_SOURCES = \ perfdata-type.conf libperfdata_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components diff --git a/configure.ac b/configure.ac index 7957084b2..0d8c46669 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,7 @@ AC_INIT([icinga2], [0.0.3]) AC_CONFIG_AUX_DIR([m4]) +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([subdir-objects]) AX_SET_VERSION_INFO @@ -79,8 +80,6 @@ CXXFLAGS="$CXXFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" LT_INIT([dlopen disable-static win32-dll]) -LT_CONFIG_LTDL_DIR([third-party/ltdl]) -LTDL_INIT DX_HTML_FEATURE(ON) DX_CHM_FEATURE(OFF) @@ -226,19 +225,10 @@ case ${host} in ;; esac -if ! test -z "$LTDLDEPS"; then - ltdl_msg="bundled" -else - ltdl_msg="system-provided" -fi - AM_COND_IF([MYSQL_USE], [mysql_msg="enabled"], [mysql_msg="disabled"]) AM_COND_IF([PYTHON_USE], [python_msg="enabled"], [python_msg="disabled"]) echo " -Libraries: - ltdl: $ltdl_msg - Features: MySQL: $mysql_msg Python: $python_msg diff --git a/icinga-app/Makefile.am b/icinga-app/Makefile.am index 9a791c15b..a4dd42f63 100644 --- a/icinga-app/Makefile.am +++ b/icinga-app/Makefile.am @@ -7,8 +7,6 @@ icinga2_SOURCES = \ icinga.cpp icinga2_CPPFLAGS = \ - -DI2_ICINGALAUNCHER_BUILD \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib \ -I${top_srcdir}/components @@ -18,28 +16,10 @@ icinga2_LDFLAGS = \ -export-dynamic icinga2_LDADD = \ - $(LIBLTDL) \ $(BOOST_SIGNALS_LIB) \ $(BOOST_THREAD_LIB) \ $(BOOST_SYSTEM_LIB) \ $(BOOST_PROGRAM_OPTIONS_LIB) \ ${top_builddir}/lib/base/libbase.la \ - ${top_builddir}/lib/config/libconfig.la \ - -dlopen ${top_builddir}/lib/icinga/libicinga.la \ - -dlopen ${top_builddir}/components/checker/libchecker.la \ - -dlopen ${top_builddir}/components/cluster/libcluster.la \ - -dlopen ${top_builddir}/components/compat/libcompat.la \ - -dlopen ${top_builddir}/components/demo/libdemo.la \ - -dlopen ${top_builddir}/components/livestatus/liblivestatus.la \ - -dlopen ${top_builddir}/components/notification/libnotification.la \ - -dlopen ${top_builddir}/components/perfdata/libperfdata.la + ${top_builddir}/lib/config/libconfig.la -if PYTHON_USE -icinga2_LDADD += \ - -dlopen ${top_builddir}/lib/python/libpython.la -endif - -if MYSQL_USE -icinga2_LDADD += \ - -dlopen ${top_builddir}/components/db_ido_mysql/libdb_ido_mysql.la -endif diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index 958ce5122..0c3a6d6ef 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -32,7 +32,6 @@ #include #ifndef _WIN32 -# include # include # include # include @@ -162,14 +161,6 @@ int main(int argc, char **argv) { Application::SetStartTime(Utility::GetTime()); -#ifndef _WIN32 - LTDL_SET_PRELOADED_SYMBOLS(); -#endif /* _WIN32 */ - -#ifndef _WIN32 - lt_dlinit(); -#endif /* _WIN32 */ - /* Set thread title. */ Utility::SetThreadName("Main Thread", false); @@ -321,15 +312,6 @@ int main(int argc, char **argv) Log(LogInformation, "icinga-app", "Icinga application loader (version: " + Application::GetVersion() + ")"); - String searchDir = Application::GetPkgLibDir(); - Log(LogInformation, "base", "Adding library search dir: " + searchDir); - -#ifdef _WIN32 - SetDllDirectory(searchDir.CStr()); -#else /* _WIN32 */ - lt_dladdsearchdir(searchDir.CStr()); -#endif /* _WIN32 */ - (void) Utility::LoadExtensionLibrary("icinga"); if (g_AppParams.count("library")) { diff --git a/icinga2.spec.in b/icinga2.spec.in index 7f969dd04..865dd662f 100644 --- a/icinga2.spec.in +++ b/icinga2.spec.in @@ -67,7 +67,6 @@ BuildRequires: bison BuildRequires: %{apachename} %if "%{_vendor}" == "redhat" -BuildRequires: libtool-ltdl-devel %if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" # el5 requires EPEL BuildRequires: boost%{el5_boost_version}-devel diff --git a/lib/base/Makefile.am b/lib/base/Makefile.am index 0fea3da05..80d08278e 100644 --- a/lib/base/Makefile.am +++ b/lib/base/Makefile.am @@ -125,7 +125,6 @@ libbase_la_SOURCES = \ libbase_la_CPPFLAGS = \ -DI2_BASE_BUILD \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ $(OPENSSL_INCLUDES) \ -I${top_srcdir}/lib \ @@ -141,7 +140,7 @@ libbase_la_LDFLAGS = \ @VERSION_INFO@ libbase_la_LIBADD = \ - $(LIBLTDL) \ + -ldl \ $(OPENSSL_LIBS) \ $(BOOST_SIGNALS_LIB) \ $(BOOST_THREAD_LIB) \ diff --git a/lib/base/unix.h b/lib/base/unix.h index c81067604..38d0a8342 100644 --- a/lib/base/unix.h +++ b/lib/base/unix.h @@ -34,7 +34,6 @@ #include #include #include -#include #include typedef int SOCKET; diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index b5b8636a2..80a5b6ef4 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -246,15 +246,15 @@ void Utility::Sleep(double timeout) #ifdef _WIN32 HMODULE #else /* _WIN32 */ -lt_dlhandle +void * #endif /* _WIN32 */ Utility::LoadExtensionLibrary(const String& library) { String path; #ifdef _WIN32 - path = library + ".dll"; + path = Application::GetPkgLibDir() + "/" + library + ".dll"; #else /* _WIN32 */ - path = "lib" + library + ".la"; + path = Application::GetPkgLibDir() + "/lib" + library + ".so"; #endif /* _WIN32 */ Log(LogInformation, "base", "Loading library '" + path + "'"); @@ -269,10 +269,10 @@ Utility::LoadExtensionLibrary(const String& library) << boost::errinfo_file_name(path)); } #else /* _WIN32 */ - lt_dlhandle hModule = lt_dlopen(path.CStr()); + void *hModule = dlopen(path.CStr(), RTLD_NOW); if (hModule == NULL) { - BOOST_THROW_EXCEPTION(std::runtime_error("Could not load library '" + path + "': " + lt_dlerror())); + BOOST_THROW_EXCEPTION(std::runtime_error("Could not load library '" + path + "': " + dlerror())); } #endif /* _WIN32 */ diff --git a/lib/base/utility.h b/lib/base/utility.h index 8c9d587af..ddffa4b44 100644 --- a/lib/base/utility.h +++ b/lib/base/utility.h @@ -79,7 +79,7 @@ public: #ifdef _WIN32 HMODULE #else /* _WIN32 */ - lt_dlhandle + void * #endif /* _WIN32 */ LoadExtensionLibrary(const String& library); diff --git a/lib/config/Makefile.am b/lib/config/Makefile.am index b9f1669c3..7b8ed5532 100644 --- a/lib/config/Makefile.am +++ b/lib/config/Makefile.am @@ -53,7 +53,6 @@ libconfig_la_SOURCES = \ libconfig_la_CPPFLAGS = \ -DI2_CONFIG_BUILD \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib diff --git a/lib/db_ido/Makefile.am b/lib/db_ido/Makefile.am index a2b1e850a..f192a9d9d 100644 --- a/lib/db_ido/Makefile.am +++ b/lib/db_ido/Makefile.am @@ -48,7 +48,6 @@ libdb_ido_la_SOURCES = \ usergroupdbobject.h libdb_ido_la_CPPFLAGS = \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib diff --git a/lib/icinga/Makefile.am b/lib/icinga/Makefile.am index f644fedf6..63a072eeb 100644 --- a/lib/icinga/Makefile.am +++ b/lib/icinga/Makefile.am @@ -109,7 +109,6 @@ libicinga_la_SOURCES = \ libicinga_la_CPPFLAGS = \ -DI2_ICINGA_BUILD \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/lib diff --git a/lib/python/Makefile.am b/lib/python/Makefile.am index d306ff734..056a79a2e 100644 --- a/lib/python/Makefile.am +++ b/lib/python/Makefile.am @@ -12,7 +12,6 @@ libpython_la_SOURCES = \ libpython_la_CPPFLAGS = \ -DI2_PYTHON_BUILD \ - $(LTDLINCL) \ $(BOOST_CPPFLAGS) \ @PYTHON_CSPEC@ \ -I${top_srcdir}/lib diff --git a/third-party/Makefile.am b/third-party/Makefile.am index 3dfdcacd3..17b2736d4 100644 --- a/third-party/Makefile.am +++ b/third-party/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to produce Makefile.in SUBDIRS = \ - ltdl \ cJSON \ execvpe \ mmatch