Removed PCH support (as it's clearly not working properly).

This commit is contained in:
Gunnar Beutner 2013-02-22 08:12:43 +01:00
parent 4306c6c07a
commit 404b1807e6
16 changed files with 20 additions and 129 deletions

View File

@ -186,12 +186,6 @@ do
automake --add-missing --gnu $am_opt automake --add-missing --gnu $am_opt
echo "Running autoconf ..." echo "Running autoconf ..."
autoconf autoconf
if ! patch --dry-run -p0 < libtool-pch.patch >/dev/null; then
echo "Warning: Libtool patch did not apply cleanly."
else
patch -p0 < libtool-pch.patch
fi
) )
fi fi
done done

View File

@ -91,7 +91,7 @@ String CompatComponent::GetCommandPath(void) const
void CompatComponent::Start(void) void CompatComponent::Start(void)
{ {
m_StatusTimer = boost::make_shared<Timer>(); m_StatusTimer = boost::make_shared<Timer>();
m_StatusTimer->SetInterval(30); m_StatusTimer->SetInterval(60);
m_StatusTimer->OnTimerExpired.connect(boost::bind(&CompatComponent::StatusTimerHandler, this)); m_StatusTimer->OnTimerExpired.connect(boost::bind(&CompatComponent::StatusTimerHandler, this));
m_StatusTimer->Start(); m_StatusTimer->Start();
m_StatusTimer->Reschedule(0); m_StatusTimer->Reschedule(0);
@ -359,7 +359,7 @@ void CompatComponent::DumpServiceStatusAttrs(ofstream& fp, const Service::Ptr& s
else else
state = 1; state = 1;
if (Host::IsReachable(host)) if (!Host::IsReachable(host))
state = 2; state = 2;
} }

View File

@ -92,15 +92,6 @@ if test "x$enable_debug" = "xyes"; then
fi fi
AC_MSG_RESULT($enable_debug) AC_MSG_RESULT($enable_debug)
AC_MSG_CHECKING(whether to enable GCC precompiled headers)
AC_ARG_ENABLE(pch, [ --enable-pch=[no/yes] enable GCC precompiled headers (default=no)],, enable_pch=no)
AM_CONDITIONAL([USE_PCH], [test "x$enable_pch" = "xyes"])
if test "x$enable_pch" = "xyes"; then
CFLAGS="$CFLAGS -fpch-deps -fpch-preprocess -Winvalid-pch"
CXXFLAGS="$CXXFLAGS -fpch-deps -fpch-preprocess -Winvalid-pch"
fi
AC_MSG_RESULT($enable_pch)
AS_AC_EXPAND([ICINGA_PREFIX], $prefix) AS_AC_EXPAND([ICINGA_PREFIX], $prefix)
AC_DEFINE_UNQUOTED([ICINGA_PREFIX], "$ICINGA_PREFIX", [The installation prefix.]) AC_DEFINE_UNQUOTED([ICINGA_PREFIX], "$ICINGA_PREFIX", [The installation prefix.])

View File

@ -106,16 +106,3 @@ libbase_la_LIBADD = \
${top_builddir}/third-party/mmatch/libmmatch.la \ ${top_builddir}/third-party/mmatch/libmmatch.la \
${top_builddir}/third-party/cJSON/libcJSON.la \ ${top_builddir}/third-party/cJSON/libcJSON.la \
${top_builddir}/third-party/popen-noshell/libpopen_noshell.la ${top_builddir}/third-party/popen-noshell/libpopen_noshell.la
if USE_PCH
BUILT_SOURCES = i2-base.h.gch
i2-base.h.gch: i2-base.h
$(AM_V_CXX)$(LTCXXCOMPILE) $(libbase_la_CPPFLAGS) -o $@ $^
libbase_la_DEPENDENCIES = \
i2-base.h.gch
clean-local:
rm -f i2-base.h.gch
endif

View File

@ -24,7 +24,7 @@ using namespace icinga;
double DynamicObject::m_CurrentTx = 0; double DynamicObject::m_CurrentTx = 0;
set<DynamicObject::WeakPtr> DynamicObject::m_ModifiedObjects; set<DynamicObject::WeakPtr> DynamicObject::m_ModifiedObjects;
boost::mutex DynamicObject::m_TransactionMutex; boost::mutex DynamicObject::m_TransactionMutex;
boost::once_flag DynamicObject::m_TransactionOnce; boost::once_flag DynamicObject::m_TransactionOnce = BOOST_ONCE_INIT;
Timer::Ptr DynamicObject::m_TransactionTimer; Timer::Ptr DynamicObject::m_TransactionTimer;
signals2::signal<void (const DynamicObject::Ptr&)> DynamicObject::OnRegistered; signals2::signal<void (const DynamicObject::Ptr&)> DynamicObject::OnRegistered;

View File

@ -21,7 +21,7 @@
using namespace icinga; using namespace icinga;
boost::once_flag Process::m_ThreadOnce; boost::once_flag Process::m_ThreadOnce = BOOST_ONCE_INIT;
boost::mutex Process::m_Mutex; boost::mutex Process::m_Mutex;
deque<Process::Ptr> Process::m_Tasks; deque<Process::Ptr> Process::m_Tasks;
double Process::m_LastReport = 0; double Process::m_LastReport = 0;

View File

@ -46,17 +46,3 @@ libconfig_la_LDFLAGS = \
libconfig_la_LIBADD = \ libconfig_la_LIBADD = \
${top_builddir}/lib/base/libbase.la ${top_builddir}/lib/base/libbase.la
if USE_PCH
BUILT_SOURCES += i2-config.h.gch
i2-config.h.gch: i2-config.h
$(AM_V_CXX)$(LTCXXCOMPILE) $(libconfig_la_CPPFLAGS) -o $@ $^
libconfig_la_DEPENDENCIES = \
i2-config.h.gch
clean-local:
rm -f i2-config.h.gch
endif

View File

@ -21,7 +21,7 @@
using namespace icinga; using namespace icinga;
boost::mutex ConfigItem::m_Mutex; recursive_mutex ConfigItem::m_Mutex;
ConfigItem::ItemMap ConfigItem::m_Items; ConfigItem::ItemMap ConfigItem::m_Items;
signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnCommitted; signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnCommitted;
signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnRemoved; signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnRemoved;
@ -181,7 +181,7 @@ DynamicObject::Ptr ConfigItem::Commit(const ConfigItem::Ptr& self)
BOOST_THROW_EXCEPTION(runtime_error("Type '" + type + "' does not exist.")); BOOST_THROW_EXCEPTION(runtime_error("Type '" + type + "' does not exist."));
{ {
boost::mutex::scoped_lock lock(m_Mutex); recursive_mutex::scoped_lock lock(m_Mutex);
/* Try to find an existing item with the same type and name. */ /* Try to find an existing item with the same type and name. */
pair<String, String> ikey = make_pair(type, name); pair<String, String> ikey = make_pair(type, name);
@ -368,8 +368,7 @@ DynamicObject::Ptr ConfigItem::GetDynamicObject(void) const
*/ */
ConfigItem::Ptr ConfigItem::GetObject(const String& type, const String& name) ConfigItem::Ptr ConfigItem::GetObject(const String& type, const String& name)
{ {
{ recursive_mutex::scoped_lock lock(m_Mutex);
boost::mutex::scoped_lock lock(m_Mutex);
ConfigItem::ItemMap::iterator it; ConfigItem::ItemMap::iterator it;
@ -377,7 +376,6 @@ ConfigItem::Ptr ConfigItem::GetObject(const String& type, const String& name)
if (it != m_Items.end()) if (it != m_Items.end())
return it->second; return it->second;
}
return ConfigItem::Ptr(); return ConfigItem::Ptr();
} }
@ -416,7 +414,7 @@ void ConfigItem::Dump(ostream& fp) const
*/ */
void ConfigItem::UnloadUnit(const String& unit) void ConfigItem::UnloadUnit(const String& unit)
{ {
boost::mutex::scoped_lock lock(m_Mutex); recursive_mutex::scoped_lock lock(m_Mutex);
Logger::Write(LogInformation, "config", "Unloading config items from compilation unit '" + unit + "'"); Logger::Write(LogInformation, "config", "Unloading config items from compilation unit '" + unit + "'");

View File

@ -90,10 +90,13 @@ private:
set<ConfigItem::WeakPtr> m_ChildObjects; /**< Instantiated items set<ConfigItem::WeakPtr> m_ChildObjects; /**< Instantiated items
* that inherit from this item */ * that inherit from this item */
static boost::mutex m_Mutex; static recursive_mutex m_Mutex;
typedef map<pair<String, String>, ConfigItem::Ptr> ItemMap; typedef map<pair<String, String>, ConfigItem::Ptr> ItemMap;
static ItemMap m_Items; /**< All registered configuration items. */ static ItemMap m_Items; /**< All registered configuration items. */
static ConfigItem::Ptr GetObjectUnlocked(const String& type,
const String& name);
}; };
} }

View File

@ -61,17 +61,3 @@ libicinga_la_LIBADD = \
${top_builddir}/lib/base/libbase.la \ ${top_builddir}/lib/base/libbase.la \
${top_builddir}/lib/config/libconfig.la \ ${top_builddir}/lib/config/libconfig.la \
${top_builddir}/lib/remoting/libremoting.la ${top_builddir}/lib/remoting/libremoting.la
if USE_PCH
BUILT_SOURCES = i2-icinga.h.gch
i2-icinga.h.gch: i2-icinga.h
$(AM_V_CXX)$(LTCXXCOMPILE) $(libicinga_la_CPPFLAGS) -o $@ $^
libicinga_la_DEPENDENCIES = \
i2-icinga.h.gch
clean-local:
rm -f i2-icinga.h.gch
endif

View File

@ -21,7 +21,7 @@
using namespace icinga; using namespace icinga;
boost::once_flag ExternalCommandProcessor::m_InitializeOnce; boost::once_flag ExternalCommandProcessor::m_InitializeOnce = BOOST_ONCE_INIT;
boost::mutex ExternalCommandProcessor::m_Mutex; boost::mutex ExternalCommandProcessor::m_Mutex;
map<String, ExternalCommandProcessor::Callback> ExternalCommandProcessor::m_Commands; map<String, ExternalCommandProcessor::Callback> ExternalCommandProcessor::m_Commands;

View File

@ -160,6 +160,8 @@ bool Host::IsReachable(const Host::Ptr& self)
hc = host->GetHostCheckService(); hc = host->GetHostCheckService();
} }
ObjectLock olock(hc);
/* ignore hosts that are up */ /* ignore hosts that are up */
if (hc && hc->GetState() == StateOK) if (hc && hc->GetState() == StateOK)
continue; continue;

View File

@ -17,8 +17,6 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/ ******************************************************************************/
#include <cstdio>
#include <iostream>
#include "i2-icinga.h" #include "i2-icinga.h"
using namespace icinga; using namespace icinga;

View File

@ -32,18 +32,4 @@ libpython_la_LIBADD = \
${top_builddir}/lib/base/libbase.la \ ${top_builddir}/lib/base/libbase.la \
${top_builddir}/lib/config/libconfig.la \ ${top_builddir}/lib/config/libconfig.la \
${top_builddir}/lib/remoting/libremoting.la ${top_builddir}/lib/remoting/libremoting.la
if USE_PCH
BUILT_SOURCES = i2-python.h.gch
i2-python.h.gch: i2-python.h
$(AM_V_CXX)$(LTCXXCOMPILE) $(libpython_la_CPPFLAGS) -o $@ $^
libpython_la_DEPENDENCIES = \
i2-python.h.gch
clean-local:
rm -f i2-python.h.gch
endif
endif endif

View File

@ -35,17 +35,3 @@ libremoting_la_LDFLAGS = \
libremoting_la_LIBADD = \ libremoting_la_LIBADD = \
${top_builddir}/lib/base/libbase.la \ ${top_builddir}/lib/base/libbase.la \
${top_builddir}/lib/config/libconfig.la ${top_builddir}/lib/config/libconfig.la
if USE_PCH
BUILT_SOURCES = i2-remoting.h.gch
i2-remoting.h.gch: i2-remoting.h
$(AM_V_CXX)$(LTCXXCOMPILE) $(libremoting_la_CPPFLAGS) -o $@ $^
libremoting_la_DEPENDENCIES = \
i2-remoting.h.gch
clean-local:
rm -f i2-remoting.h.gch
endif

View File

@ -1,26 +0,0 @@
--- m4/ltmain.sh 2013-02-21 11:23:30.000000000 +0100
+++ m4/ltmain.sh 2013-02-21 11:36:37.000000000 +0100
@@ -2507,6 +2507,7 @@
case $libobj in
*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *.gch) obj=$libobj ;;
*)
func_fatal_error "cannot determine name of library object from \`$libobj'"
;;
@@ -2717,7 +2718,14 @@
fi
$opt_dry_run || {
- func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+ case $libobj in
+ *.gch)
+ ln -sF "$objdir/$objname" "$libobj"
+ ;;
+ *)
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+ ;;
+ esac
# Unlock the critical section if it was locked
if test "$need_locks" != no; then