include aminclude.am
-SUBDIRS = ltdl \
+SUBDIRS = \
+ compat \
+ ltdl \
mmatch \
cJSON \
base \
libbase_la_CXXFLAGS = \
-DI2_BASE_BUILD \
$(LTDLINCL) \
+ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/mmatch
libbase_la_LDFLAGS = \
libbase_la_LIBADD = \
$(LIBLTDL) \
+ $(BOOST_LDFLAGS) \
${top_builddir}/mmatch/libmmatch.la
using namespace icinga;
Application::Ptr I2_EXPORT Application::m_Instance;
+bool I2_EXPORT Application::m_ShuttingDown = false;
/**
* Constructor for the Application class.
m_Debugging = true;
#endif /* _WIN32 */
- m_ShuttingDown = false;
m_ConfigHive = make_shared<ConfigHive>();
}
*/
Application::~Application(void)
{
+ m_ShuttingDown = true;
+
/* stop all components */
for (map<string, Component::Ptr>::iterator i = m_Components.begin();
i != m_Components.end(); i++) {
*/
Application::Ptr Application::GetInstance(void)
{
- return m_Instance;
+ if (m_ShuttingDown)
+ return Application::Ptr();
+ else
+ return m_Instance;
}
/**
virtual int Main(const vector<string>& args) = 0;
- void Shutdown(void);
+ static void Shutdown(void);
static void Log(string message);
string GetExeDirectory(void) const;
private:
- static Application::Ptr m_Instance;
+ static Application::Ptr m_Instance; /**< The application instance. */
- bool m_ShuttingDown; /**< Whether the application is in the process of
+ static bool m_ShuttingDown; /**< Whether the application is in the process of
shutting down. */
ConfigHive::Ptr m_ConfigHive; /**< The application's configuration. */
map< string, shared_ptr<Component> > m_Components; /**< Components that
*/
Object::~Object(void)
{
-}
\ No newline at end of file
+}
+
--- /dev/null
+EXTRA_DIST=include
+
+dist-hook:
+ mkdir -p boost && \
+ bcp --boost=$(BOOST_PATH)/include tr1 smart_ptr bind function make_shared boost && \
+ rm -Rf include && \
+ mkdir include && \
+ mv boost/boost include/ && \
+ rm -Rf boost
i2-configfile.h
configfile_la_CXXFLAGS = \
+ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
-I${top_srcdir}/icinga \
-I${top_srcdir}/jsonrpc \
-version-info 0:0:0
configfile_la_LIBADD = \
+ $(BOOST_LDFLAGS) \
$(top_builddir)/base/libbase.la \
$(top_builddir)/icinga/libicinga.la \
$(top_builddir)/cJSON/libcJSON.la
i2-configrpc.h
configrpc_la_CXXFLAGS = \
+ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/icinga
-version-info 0:0:0
configrpc_la_LIBADD = \
+ $(BOOST_LDFLAGS) \
${top_builddir}/base/libbase.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la
i2-demo.h
demo_la_CXXFLAGS = \
+ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/cJSON \
-version-info 0:0:0
demo_la_LIBADD = \
+ $(BOOST_LDFLAGS) \
${top_builddir}/base/libbase.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/icinga/libicinga.la
discoverymessage.h \
i2-discovery.h
-discovery_la_CXXFLAGS = -I${top_srcdir}/base \
+discovery_la_CXXFLAGS = \
+ $(BOOST_CPPFLAGS) \
+ -I${top_srcdir}/base \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/cJSON \
-I${top_srcdir}/icinga
-discovery_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined -pthread
-discovery_la_LIBADD = ${top_builddir}/base/libbase.la \
+discovery_la_LDFLAGS = \
+ -module \
+ -version-info 0:0:0 \
+ -no-undefined
+
+discovery_la_LIBADD = \
+ $(BOOST_LDFLAGS) \
+ ${top_builddir}/base/libbase.la \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/cJSON/libcJSON.la \
${top_builddir}/icinga/libicinga.la
#
# This macro calls:
#
-# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
+# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) AC_SUBST(BOOST_PATH)
#
# And sets:
#
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
BOOST_CPPFLAGS="-I$ac_boost_path/include"
+ BOOST_PATH="$ac_boost_path"
for ac_boost_path_tmp in $libsubdirs; do
if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
fi
done
elif test "$cross_compiling" != yes; then
- for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
+ for ac_boost_path_tmp in /usr /usr/local /opt /opt/local "`pwd`/compat" ; do
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
for libsubdir in $libsubdirs ; do
if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
+ BOOST_PATH="$ac_boost_path_tmp"
break;
fi
done
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
+ AC_SUBST(BOOST_PATH)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
# execute ACTION-IF-FOUND (if present):
ifelse([$2], , :, [$2])
AC_OUTPUT([
Makefile
+compat/Makefile
base/Makefile
cJSON/Makefile
components/Makefile
icinga_CXXFLAGS = \
-DI2_ICINGALAUNCHER_BUILD \
+ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/cJSON \
-I${top_srcdir}
icinga_LDADD = \
+ $(BOOST_LDFLAGS) \
${top_builddir}/base/libbase.la \
${top_builddir}/icinga/libicinga.la \
-dlopen ${top_builddir}/components/configfile/configfile.la \
libicinga_la_CXXFLAGS = \
-DI2_ICINGA_BUILD \
+ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
-I${top_srcdir}/jsonrpc \
-I${top_srcdir}/cJSON \
-version-info 0:0:0
libicinga_la_LIBADD = \
+ $(BOOST_LDFLAGS) \
${top_builddir}/jsonrpc/libjsonrpc.la \
${top_builddir}/base/libbase.la
libjsonrpc_la_CXXFLAGS = \
-DI2_JSONRPC_BUILD \
+ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \
-I${top_srcdir}/cJSON
-version-info 0:0:0
libjsonrpc_la_LIBADD = \
+ $(BOOST_LDFLAGS) \
${top_builddir}/base/libbase.la \
${top_builddir}/cJSON/libcJSON.la