]> granicus.if.org Git - icinga2/commitdiff
Removed PCH support (as it's clearly not working properly).
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 22 Feb 2013 07:12:43 +0000 (08:12 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 22 Feb 2013 07:12:43 +0000 (08:12 +0100)
16 files changed:
autogen.sh
components/compat/compatcomponent.cpp
configure.ac
lib/base/Makefile.am
lib/base/dynamicobject.cpp
lib/base/process.cpp
lib/config/Makefile.am
lib/config/configitem.cpp
lib/config/configitem.h
lib/icinga/Makefile.am
lib/icinga/externalcommandprocessor.cpp
lib/icinga/host.cpp
lib/icinga/icingaapplication.cpp
lib/python/Makefile.am
lib/remoting/Makefile.am
libtool-pch.patch [deleted file]

index 09e9b9f6ef45f3880277e2d4f2d4c975834ba001..17b17bdc22d91732009ad1f2faa7dfc8fc885fde 100755 (executable)
@@ -186,12 +186,6 @@ do
       automake --add-missing --gnu $am_opt
       echo "Running 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
 done
index 0c62a69bcef3a67fcfb3d2dad51298e6468b2eac..5507b58018a78cb8e540ed2e120e7c98f4f8bbe9 100644 (file)
@@ -91,7 +91,7 @@ String CompatComponent::GetCommandPath(void) const
 void CompatComponent::Start(void)
 {
        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->Start();
        m_StatusTimer->Reschedule(0);
@@ -359,12 +359,12 @@ void CompatComponent::DumpServiceStatusAttrs(ofstream& fp, const Service::Ptr& s
                else
                        state = 1;
 
-               if (Host::IsReachable(host))
+               if (!Host::IsReachable(host))
                        state = 2;
        }
 
        {
-                       ObjectLock olock(service);
+               ObjectLock olock(service);
 
                fp << "\t" << "check_interval=" << service->GetCheckInterval() / 60.0 << "\n"
                   << "\t" << "retry_interval=" << service->GetRetryInterval() / 60.0 << "\n"
index 386568fd2594f50c11bee421fbff5651c1097dc6..d27eabee0b722bc654f56f7774030ca7806c6678 100644 (file)
@@ -92,15 +92,6 @@ if test "x$enable_debug" = "xyes"; then
 fi
 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)
 AC_DEFINE_UNQUOTED([ICINGA_PREFIX], "$ICINGA_PREFIX", [The installation prefix.])
 
index 721504a35e8b4681d11c80b1b0c8a47259a3f3ee..60ffcb8ccd7e6020f10c6c9402ef0c7e3f486f60 100644 (file)
@@ -106,16 +106,3 @@ libbase_la_LIBADD = \
        ${top_builddir}/third-party/mmatch/libmmatch.la \
        ${top_builddir}/third-party/cJSON/libcJSON.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
index 0a73afa9305067054d2cffa70ffca1c46f18c04b..bf4e714f757d563afbfaa070ed7e778cd39343d5 100644 (file)
@@ -24,7 +24,7 @@ using namespace icinga;
 double DynamicObject::m_CurrentTx = 0;
 set<DynamicObject::WeakPtr> DynamicObject::m_ModifiedObjects;
 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;
 
 signals2::signal<void (const DynamicObject::Ptr&)> DynamicObject::OnRegistered;
index 640d89d79c07069cdb4a00732f0f5aa68b20ba51..7e9a08a6fccba8c1ed392b4f2a3dc116e74c9fd9 100644 (file)
@@ -21,7 +21,7 @@
 
 using namespace icinga;
 
-boost::once_flag Process::m_ThreadOnce;
+boost::once_flag Process::m_ThreadOnce = BOOST_ONCE_INIT;
 boost::mutex Process::m_Mutex;
 deque<Process::Ptr> Process::m_Tasks;
 double Process::m_LastReport = 0;
index 796f0ba1cf4d8e2bbb5f736df6984b79503a297d..18ad41c77c0a66656aeb9df352110936747b0c10 100644 (file)
@@ -46,17 +46,3 @@ libconfig_la_LDFLAGS = \
 
 libconfig_la_LIBADD = \
        ${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
-
index 3b821301ac5c512b288407b9ebdcd1a89e324f3b..bccb661b1be8d83226c9f603c0c0d5d8c6405433 100644 (file)
@@ -21,7 +21,7 @@
 
 using namespace icinga;
 
-boost::mutex ConfigItem::m_Mutex;
+recursive_mutex ConfigItem::m_Mutex;
 ConfigItem::ItemMap ConfigItem::m_Items;
 signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnCommitted;
 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::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. */
                pair<String, String> ikey = make_pair(type, name);
@@ -368,16 +368,14 @@ DynamicObject::Ptr ConfigItem::GetDynamicObject(void) const
  */
 ConfigItem::Ptr ConfigItem::GetObject(const String& type, const String& name)
 {
-       {
-               boost::mutex::scoped_lock lock(m_Mutex);
+       recursive_mutex::scoped_lock lock(m_Mutex);
 
-               ConfigItem::ItemMap::iterator it;
+       ConfigItem::ItemMap::iterator it;
 
-               it = m_Items.find(make_pair(type, name));
+       it = m_Items.find(make_pair(type, name));
 
-               if (it != m_Items.end())
-                       return it->second;
-       }
+       if (it != m_Items.end())
+               return it->second;
 
        return ConfigItem::Ptr();
 }
@@ -416,7 +414,7 @@ void ConfigItem::Dump(ostream& fp) const
  */
 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 + "'");
 
index a20b361432935833a9dcb7349bfc28da25814fcd..56c1c470767f651ce7bca6fd1514317f9cc59d90 100644 (file)
@@ -90,10 +90,13 @@ private:
         set<ConfigItem::WeakPtr> m_ChildObjects; /**< Instantiated items
                                                      * that inherit from this item */
 
-       static boost::mutex m_Mutex;
+       static recursive_mutex m_Mutex;
 
        typedef map<pair<String, String>, ConfigItem::Ptr> ItemMap;
        static ItemMap m_Items; /**< All registered configuration items. */
+
+       static ConfigItem::Ptr GetObjectUnlocked(const String& type,
+           const String& name);
 };
 
 }
index 7dc43187451a562faca6652eb609598a8909f930..9e09a230c00ac27ed2fcc440f8deb00c6f3238f1 100644 (file)
@@ -61,17 +61,3 @@ libicinga_la_LIBADD = \
        ${top_builddir}/lib/base/libbase.la \
        ${top_builddir}/lib/config/libconfig.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
-
index fb42905390c7238bb183c341b24d2a29e1eb36ef..ed9621cb64dc39d07e54da1fb10966e1d5eaab7b 100644 (file)
@@ -21,7 +21,7 @@
 
 using namespace icinga;
 
-boost::once_flag ExternalCommandProcessor::m_InitializeOnce;
+boost::once_flag ExternalCommandProcessor::m_InitializeOnce = BOOST_ONCE_INIT;
 boost::mutex ExternalCommandProcessor::m_Mutex;
 map<String, ExternalCommandProcessor::Callback> ExternalCommandProcessor::m_Commands;
 
index 4bb21902f4e3e41160293798009933ac35e86fcc..581794b184bf2615a50b7d982b2a1cb75df339d5 100644 (file)
@@ -160,6 +160,8 @@ bool Host::IsReachable(const Host::Ptr& self)
                        hc = host->GetHostCheckService();
                }
 
+               ObjectLock olock(hc);
+
                /* ignore hosts that are up */
                if (hc && hc->GetState() == StateOK)
                        continue;
index a961d9be1f29a339aa2de85cecda0e0cfd07a2ea..96eda887dccb966c8ef0ab961e281f67589bbe45 100644 (file)
@@ -17,8 +17,6 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include <cstdio>
-#include <iostream>
 #include "i2-icinga.h"
 
 using namespace icinga;
index 36080d860ad49103caf4ff6ef6356bf5b6e0dd76..d314d69683ed340f3fe038ab4c5b6d16f0805778 100644 (file)
@@ -32,18 +32,4 @@ libpython_la_LIBADD = \
        ${top_builddir}/lib/base/libbase.la \
        ${top_builddir}/lib/config/libconfig.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
index 84e32b6fa012283e9923c05ad5608a3554425e21..372dcca81541fe0d079bf5b9e0aae3c103c3c146 100644 (file)
@@ -35,17 +35,3 @@ libremoting_la_LDFLAGS = \
 libremoting_la_LIBADD = \
        ${top_builddir}/lib/base/libbase.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
-
diff --git a/libtool-pch.patch b/libtool-pch.patch
deleted file mode 100644 (file)
index 2f1aac2..0000000
+++ /dev/null
@@ -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