From 27d008f1cef1872bc91897a9c5a42cfdf6d275ff Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 13 Apr 2012 11:32:19 +0200 Subject: [PATCH] Build fix for *NIX. --- Makefile.am | 7 +++-- configfilecomponent/Makefile.am | 12 ++++---- configrpccomponent/Makefile.am | 14 ++++----- configure.ac | 1 + icinga/Makefile.am | 22 +++++--------- icinga/icinga.cpp | 3 ++ libicinga/Makefile.am | 29 +++++++++++++++++++ {icinga => libicinga}/endpoint.cpp | 0 {icinga => libicinga}/endpoint.h | 0 {icinga => libicinga}/endpointmanager.cpp | 0 {icinga => libicinga}/endpointmanager.h | 0 {icinga => libicinga}/i2-icinga.h | 0 {icinga => libicinga}/icingaapplication.cpp | 4 +-- {icinga => libicinga}/icingaapplication.h | 0 {icinga => libicinga}/jsonrpcendpoint.cpp | 0 {icinga => libicinga}/jsonrpcendpoint.h | 0 .../libicinga.vcxproj | 0 {icinga => libicinga}/virtualendpoint.cpp | 0 {icinga => libicinga}/virtualendpoint.h | 0 19 files changed, 58 insertions(+), 34 deletions(-) create mode 100644 icinga/icinga.cpp create mode 100644 libicinga/Makefile.am rename {icinga => libicinga}/endpoint.cpp (100%) rename {icinga => libicinga}/endpoint.h (100%) rename {icinga => libicinga}/endpointmanager.cpp (100%) rename {icinga => libicinga}/endpointmanager.h (100%) rename {icinga => libicinga}/i2-icinga.h (100%) rename {icinga => libicinga}/icingaapplication.cpp (98%) rename {icinga => libicinga}/icingaapplication.h (100%) rename {icinga => libicinga}/jsonrpcendpoint.cpp (100%) rename {icinga => libicinga}/jsonrpcendpoint.h (100%) rename icinga/icinga.vcxproj => libicinga/libicinga.vcxproj (100%) rename {icinga => libicinga}/virtualendpoint.cpp (100%) rename {icinga => libicinga}/virtualendpoint.h (100%) diff --git a/Makefile.am b/Makefile.am index ea056e09b..678cfc2f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,9 +5,10 @@ SUBDIRS = ltdl \ base \ cJSON \ jsonrpc \ + libicinga \ + icinga \ configfilecomponent \ - configrpccomponent \ - icinga + configrpccomponent icinga2docdir = ${prefix}/doc/icinga2 icinga2doc_DATA = \ @@ -50,4 +51,4 @@ dist-hook: icinga-version.stamp if test -f "icinga-version.h"; then \ $(SED) -e 's|^#undef GIT_IS_DIST.*|#define GIT_IS_DIST 1|' \ "icinga-version.h" > "$(distdir)/icinga-version.h"; \ - fi \ No newline at end of file + fi diff --git a/configfilecomponent/Makefile.am b/configfilecomponent/Makefile.am index 6f3ac1e8e..a61f35bf5 100644 --- a/configfilecomponent/Makefile.am +++ b/configfilecomponent/Makefile.am @@ -1,17 +1,17 @@ ## Process this file with automake to produce Makefile.in pkglib_LTLIBRARIES = \ - libconfigfilecomponent.la + configfilecomponent.la -libconfigfilecomponent_la_SOURCES = \ +configfilecomponent_la_SOURCES = \ configfilecomponent.cpp \ configfilecomponent.h \ i2-configfilecomponent.h -libconfigfilecomponent_la_CXXFLAGS = -I${top_srcdir}/base \ +configfilecomponent_la_CXXFLAGS = -I${top_srcdir}/base \ -I${top_srcdir}/jsonrpc \ -I${top_srcdir}/cJSON -libconfigfilecomponent_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined -libconfigfilecomponent_la_LIBADD = ${top_builddir}/base/libbase.la \ - ${top_builddir}/cJSON/libcJSON.la \ No newline at end of file +configfilecomponent_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined +configfilecomponent_la_LIBADD = ${top_builddir}/base/libbase.la \ + ${top_builddir}/cJSON/libcJSON.la diff --git a/configrpccomponent/Makefile.am b/configrpccomponent/Makefile.am index c8d85b412..ee488b9fb 100644 --- a/configrpccomponent/Makefile.am +++ b/configrpccomponent/Makefile.am @@ -1,20 +1,20 @@ ## Process this file with automake to produce Makefile.in pkglib_LTLIBRARIES = \ - libconfigrpccomponent.la + configrpccomponent.la -libconfigrpccomponent_la_SOURCES = \ +configrpccomponent_la_SOURCES = \ configrpccomponent.cpp \ configrpccomponent.h \ i2-configrpccomponent.h -libconfigrpccomponent_la_CXXFLAGS = -I${top_srcdir}/base \ +configrpccomponent_la_CXXFLAGS = -I${top_srcdir}/base \ -I${top_srcdir}/jsonrpc \ -I${top_srcdir}/cJSON \ - -I${top_srcdir}/icinga + -I${top_srcdir}/libicinga -libconfigrpccomponent_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined -pthread -libconfigrpccomponent_la_LIBADD = ${top_builddir}/base/libbase.la \ +configrpccomponent_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined -pthread +configrpccomponent_la_LIBADD = ${top_builddir}/base/libbase.la \ ${top_builddir}/jsonrpc/libjsonrpc.la \ ${top_builddir}/cJSON/libcJSON.la \ - ${top_builddir}/icinga/icinga + ${top_builddir}/libicinga/libicinga.la diff --git a/configure.ac b/configure.ac index 8a2b0a35a..b4532d723 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,7 @@ base/Makefile cJSON/Makefile configfilecomponent/Makefile configrpccomponent/Makefile +libicinga/Makefile icinga/Makefile jsonrpc/Makefile diff --git a/icinga/Makefile.am b/icinga/Makefile.am index 71ae3ffb1..3f5640cc7 100644 --- a/icinga/Makefile.am +++ b/icinga/Makefile.am @@ -5,25 +5,17 @@ bin_PROGRAMS = \ icinga icinga_SOURCES = \ - endpoint.cpp \ - endpoint.h \ - endpointmanager.cpp \ - endpointmanager.h \ - icingaapplication.cpp \ - icingaapplication.h \ - i2-icinga.h \ - jsonrpcendpoint.cpp \ - jsonrpcendpoint.h \ - virtualendpoint.cpp \ - virtualendpoint.h + icinga.cpp -icinga_CFLAGS = -DI2_ICINGA_BUILD +icinga_CFLAGS = -DI2_ICINGALAUNCHER_BUILD -icinga_CXXFLAGS = -DI2_ICINGA_BUILD -I${top_srcdir}/base \ +icinga_CXXFLAGS = -DI2_ICINGALAUNCHER_BUILD -I${top_srcdir}/base \ -I${top_srcdir}/jsonrpc \ -I${top_srcdir}/cJSON \ + -I${top_srcdir}/libicinga \ -I${top_srcdir} -icinga_LDFLAGS = $(top_builddir)/jsonrpc/libjsonrpc.la \ +icinga_LDFLAGS = $(top_builddir)/libicinga/libicinga.la \ + $(top_builddir)/jsonrpc/libjsonrpc.la \ $(top_builddir)/base/libbase.la \ - ${top_builddir}/cJSON/libcJSON.la \ No newline at end of file + ${top_builddir}/cJSON/libcJSON.la diff --git a/icinga/icinga.cpp b/icinga/icinga.cpp new file mode 100644 index 000000000..81c83740a --- /dev/null +++ b/icinga/icinga.cpp @@ -0,0 +1,3 @@ +#include + +SET_START_CLASS(icinga::IcingaApplication); diff --git a/libicinga/Makefile.am b/libicinga/Makefile.am new file mode 100644 index 000000000..f6dc16554 --- /dev/null +++ b/libicinga/Makefile.am @@ -0,0 +1,29 @@ +## Process this file with automake to produce Makefile.in + + +pkglib_LTLIBRARIES = \ + libicinga.la + +libicinga_la_SOURCES = \ + endpoint.cpp \ + endpoint.h \ + endpointmanager.cpp \ + endpointmanager.h \ + icingaapplication.cpp \ + icingaapplication.h \ + i2-icinga.h \ + jsonrpcendpoint.cpp \ + jsonrpcendpoint.h \ + virtualendpoint.cpp \ + virtualendpoint.h + +libicinga_la_CFLAGS = -DI2_ICINGA_BUILD + +libicinga_la_CXXFLAGS = -DI2_ICINGA_BUILD -I${top_srcdir}/base \ + -I${top_srcdir}/jsonrpc \ + -I${top_srcdir}/cJSON \ + -I${top_srcdir} + +libicinga_la_LDFLAGS = $(top_builddir)/jsonrpc/libjsonrpc.la \ + $(top_builddir)/base/libbase.la \ + ${top_builddir}/cJSON/libcJSON.la diff --git a/icinga/endpoint.cpp b/libicinga/endpoint.cpp similarity index 100% rename from icinga/endpoint.cpp rename to libicinga/endpoint.cpp diff --git a/icinga/endpoint.h b/libicinga/endpoint.h similarity index 100% rename from icinga/endpoint.h rename to libicinga/endpoint.h diff --git a/icinga/endpointmanager.cpp b/libicinga/endpointmanager.cpp similarity index 100% rename from icinga/endpointmanager.cpp rename to libicinga/endpointmanager.cpp diff --git a/icinga/endpointmanager.h b/libicinga/endpointmanager.h similarity index 100% rename from icinga/endpointmanager.h rename to libicinga/endpointmanager.h diff --git a/icinga/i2-icinga.h b/libicinga/i2-icinga.h similarity index 100% rename from icinga/i2-icinga.h rename to libicinga/i2-icinga.h diff --git a/icinga/icingaapplication.cpp b/libicinga/icingaapplication.cpp similarity index 98% rename from icinga/icingaapplication.cpp rename to libicinga/icingaapplication.cpp index 3ffdae972..6ea3fa75d 100644 --- a/icinga/icingaapplication.cpp +++ b/libicinga/icingaapplication.cpp @@ -85,7 +85,7 @@ int IcingaApplication::NewComponentHandler(ConfigObjectEventArgs::Ptr ea) #ifdef _WIN32 path = object->GetName() + ".dll"; #else /* _WIN32 */ - path = "lib" + object->GetName() + ".la"; + path = object->GetName() + ".la"; #endif /* _WIN32 */ // TODO: try to figure out where the component is located */ @@ -152,5 +152,3 @@ int IcingaApplication::DeletedRpcConnectionHandler(ConfigObjectEventArgs::Ptr ea return 0; } - -SET_START_CLASS(icinga::IcingaApplication); diff --git a/icinga/icingaapplication.h b/libicinga/icingaapplication.h similarity index 100% rename from icinga/icingaapplication.h rename to libicinga/icingaapplication.h diff --git a/icinga/jsonrpcendpoint.cpp b/libicinga/jsonrpcendpoint.cpp similarity index 100% rename from icinga/jsonrpcendpoint.cpp rename to libicinga/jsonrpcendpoint.cpp diff --git a/icinga/jsonrpcendpoint.h b/libicinga/jsonrpcendpoint.h similarity index 100% rename from icinga/jsonrpcendpoint.h rename to libicinga/jsonrpcendpoint.h diff --git a/icinga/icinga.vcxproj b/libicinga/libicinga.vcxproj similarity index 100% rename from icinga/icinga.vcxproj rename to libicinga/libicinga.vcxproj diff --git a/icinga/virtualendpoint.cpp b/libicinga/virtualendpoint.cpp similarity index 100% rename from icinga/virtualendpoint.cpp rename to libicinga/virtualendpoint.cpp diff --git a/icinga/virtualendpoint.h b/libicinga/virtualendpoint.h similarity index 100% rename from icinga/virtualendpoint.h rename to libicinga/virtualendpoint.h