# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.8)
set(BOOST_MIN_VERSION "1.48.0")
project(icinga2)
find_package(Termcap)
set(HAVE_TERMCAP "${TERMCAP_FOUND}")
+find_package(PostgreSQL)
+
+if(PostgreSQL_FOUND)
+ link_directories(${PostgreSQL_LIBRARY_DIRS})
+ include_directories(${PostgreSQL_INCLUDE_DIRS})
+endif()
+
include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/lib
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lpthread")
+ set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -lpthread")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread")
endif()
endif()
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ function(add_whole_static_library target library)
+ target_link_libraries(${target} -force_load ${library})
+ endfunction()
+elseif(MSVC)
+ function(add_whole_static_library target library)
+ target_link_libraries(${target} ${library})
+ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS "/wholearchive:${library} ")
+ endfunction()
+else()
+ function(add_whole_static_library target library)
+ target_link_libraries(${target} -Wl,--whole-archive ${library} -Wl,--no-whole-archive)
+ endfunction()
+endif()
+
include(CheckCXXCompilerFlag)
function(check_cxx_linker_flag flag var)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
endif()
endif()
-include(CheckCCompilerFlag)
-
-check_c_compiler_flag(-fvisibility-inlines-hidden HAVE_VISIBILITY_INLINES_HIDDEN)
-
-if(HAVE_VISIBILITY_INLINES_HIDDEN)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
-endif()
-
-check_c_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
-
-if(HAVE_VISIBILITY_HIDDEN)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-endif()
-
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
endif()
set(WindowsSources "")
endif()
-add_executable(icinga-app icinga.cpp ${WindowsSources})
+set(icingaloader_SOURCES
+ icinga.cpp
+ ${WindowsSources}
+)
+
+add_library(icingaloader OBJECT ${icingaloader_SOURCES})
+add_dependencies(icingaloader base config cli)
include_directories(${Boost_INCLUDE_DIRS})
-target_link_libraries(icinga-app ${Boost_LIBRARIES} base config cli)
+
+add_executable(icinga-app $<TARGET_OBJECTS:icingaloader>)
+
+add_whole_static_library(icinga-app base)
+add_whole_static_library(icinga-app config)
+add_whole_static_library(icinga-app remote)
+add_whole_static_library(icinga-app cli)
+
+if(ICINGA2_WITH_CHECKER)
+ add_whole_static_library(icinga-app checker)
+endif()
+
+if(ICINGA2_WITH_COMPAT)
+ add_whole_static_library(icinga-app compat)
+endif()
+
+if(ICINGA2_WITH_MYSQL)
+ add_whole_static_library(icinga-app db_ido_mysql)
+endif()
+
+if(ICINGA2_WITH_PGSQL)
+ add_whole_static_library(icinga-app db_ido_pgsql)
+endif()
+
+add_whole_static_library(icinga-app icinga)
+
+if(ICINGA2_WITH_LIVESTATUS)
+ add_whole_static_library(icinga-app livestatus)
+endif()
+
+add_whole_static_library(icinga-app methods)
+
+if(ICINGA2_WITH_NOTIFICATION)
+ add_whole_static_library(icinga-app notification)
+endif()
+
+if(ICINGA2_WITH_PERFDATA)
+ add_whole_static_library(icinga-app perfdata)
+endif()
set_target_properties (
icinga-app PROPERTIES
RUNTIME DESTINATION ${InstallPath}
)
+if(ICINGA2_WITH_HELLO)
+ add_executable(hello-app $<TARGET_OBJECTS:icingaloader>)
+ add_whole_static_library(hello-app base)
+ add_whole_static_library(hello-app config)
+ add_whole_static_library(hello-app remote)
+ add_whole_static_library(hello-app cli)
+ add_whole_static_library(hello-app hello)
+
+ set_target_properties (
+ hello-app PROPERTIES
+ INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+ FOLDER Bin
+ OUTPUT_NAME hello
+ )
+
+ install(
+ TARGETS hello-app
+ RUNTIME DESTINATION ${InstallPath}
+ )
+endif()
+
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/icinga2\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_RUNDIR}/icinga2\")")
LogSeverity logLevel = Logger::GetConsoleLogSeverity();
Logger::SetConsoleLogSeverity(LogWarning);
- Loader::LoadExtensionLibrary("cli");
-
po::options_description visibleDesc("Global options");
visibleDesc.add_options()
("color", "use VT100 color codes even when stdout is not a terminal")
#endif /* _WIN32 */
("define,D", po::value<std::vector<std::string> >(), "define a constant")
- ("app,a", po::value<std::string>(), "application library name (default: icinga)")
- ("library,l", po::value<std::vector<std::string> >(), "load a library")
("include,I", po::value<std::vector<std::string> >(), "add include search directory")
("log-level,x", po::value<std::string>(), "specify the log level for the console log.\n"
"The valid value is either debug, notice, information (default), warning, or critical")
Logger::SetConsoleLogSeverity(logLevel);
}
- if (vm.count("library")) {
- for (const String& libraryName : vm["library"].as<std::vector<std::string> >()) {
- try {
- (void) Loader::LoadExtensionLibrary(libraryName);
- } catch (const std::exception& ex) {
- Log(LogCritical, "icinga-app")
- << "Could not load library \"" << libraryName << "\": " << DiagnosticInformation(ex);
- return EXIT_FAILURE;
- }
- }
- }
-
if (!command || vm.count("help") || vm.count("version")) {
String appName;
return EXIT_FAILURE;
}
- LogSeverity logLevel = Logger::GetConsoleLogSeverity();
- Logger::SetConsoleLogSeverity(LogWarning);
-
- if (vm.count("app"))
- Loader::LoadExtensionLibrary(vm["app"].as<std::string>());
- else
- Loader::LoadExtensionLibrary("icinga");
-
- Logger::SetConsoleLogSeverity(logLevel);
-
rc = command->Run(vm, args);
}
icinga.icns ${WindowsSources})
include_directories(${Boost_INCLUDE_DIRS})
-target_link_libraries(icinga-studio ${Boost_LIBRARIES} ${wxWidgets_LIBRARIES} base remote)
+target_link_libraries(icinga-studio ${Boost_LIBRARIES} ${wxWidgets_LIBRARIES})
+add_whole_static_library(icinga-studio base)
+add_whole_static_library(icinga-studio remote)
if(APPLE)
set_source_files_properties(icinga.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
mkunity_target(base base base_SOURCES)
endif()
-add_library(base SHARED ${base_SOURCES})
+add_library(base STATIC ${base_SOURCES})
target_link_libraries(base ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${YAJL_LIBRARIES} mmatch socketpair)
set_target_properties (
base PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_BASE_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/icinga2\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2/crash\")")
-install(
- TARGETS base
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-if(APPLE)
- install(
- TARGETS base
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
- )
-endif()
-
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
*
* @ingroup base
*/
-class I2_BASE_API Application : public ObjectImpl<Application> {
+class Application : public ObjectImpl<Application> {
public:
DECLARE_OBJECT(Application);
*
* @ingroup base
*/
-class I2_BASE_API Array : public Object
+class Array : public Object
{
public:
DECLARE_OBJECT(Array);
*
* @ingroup remote
*/
-struct I2_BASE_API Base64
+struct Base64
{
static String Decode(const String& data);
static String Encode(const String& data);
/**
* Boolean class.
*/
-class I2_BASE_API Boolean
+class Boolean
{
public:
static Object::Ptr GetPrototype(void);
*
* @ingroup base
*/
-class I2_BASE_API ConfigObject : public ObjectImpl<ConfigObject>
+class ConfigObject : public ObjectImpl<ConfigObject>
{
public:
DECLARE_OBJECT(ConfigObject);
HARunEverywhere
};
-class I2_BASE_API NameComposer
+class NameComposer
{
public:
virtual ~NameComposer(void);
{ };
code {{{
-class I2_BASE_API ConfigObjectBase : public ObjectImpl<ConfigObjectBase>
+class ConfigObjectBase : public ObjectImpl<ConfigObjectBase>
{
public:
inline DebugInfo GetDebugInfo(void) const
class ConfigObject;
-class I2_BASE_API ConfigType
+class ConfigType
{
public:
virtual ~ConfigType(void);
*
* @ingroup base
*/
-class I2_BASE_API ConfigIdentifier : public Object
+class ConfigIdentifier : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ConfigIdentifier);
*
* @ingroup base
*/
-class I2_BASE_API ConfigWriter
+class ConfigWriter
{
public:
static void EmitBoolean(std::ostream& fp, bool val);
#endif /* _WIN32 */
};
-class I2_BASE_API ConsoleColorTag
+class ConsoleColorTag
{
public:
ConsoleColorTag(int color, ConsoleType consoleType = Console_Autodetect);
- friend I2_BASE_API std::ostream& operator<<(std::ostream& fp, const ConsoleColorTag& cct);
+ friend std::ostream& operator<<(std::ostream& fp, const ConsoleColorTag& cct);
private:
int m_Color;
int m_ConsoleType;
};
-I2_BASE_API std::ostream& operator<<(std::ostream& fp, const ConsoleColorTag& cct);
+std::ostream& operator<<(std::ostream& fp, const ConsoleColorTag& cct);
/**
* Console utilities.
*
* @ingroup base
*/
-class I2_BASE_API Console
+class Console
{
public:
static void DetectType(void);
namespace icinga
{
-class I2_BASE_API ContextTrace
+class ContextTrace
{
public:
ContextTrace(void);
std::list<String> m_Frames;
};
-I2_BASE_API std::ostream& operator<<(std::ostream& stream, const ContextTrace& trace);
+std::ostream& operator<<(std::ostream& stream, const ContextTrace& trace);
/**
* A context frame.
*
* @ingroup base
*/
-class I2_BASE_API ContextFrame
+class ContextFrame
{
public:
ContextFrame(const String& message);
*
* @ingroup base
*/
-class I2_BASE_API Convert
+class Convert
{
public:
template<typename T>
*
* @ingroup base
*/
-class I2_BASE_API DateTime : public ObjectImpl<DateTime>
+class DateTime : public ObjectImpl<DateTime>
{
public:
DECLARE_OBJECT(DateTime);
*
* @ingroup config
*/
-struct I2_BASE_API DebugInfo
+struct DebugInfo
{
String Path;
DebugInfo(void);
};
-I2_BASE_API std::ostream& operator<<(std::ostream& out, const DebugInfo& val);
+std::ostream& operator<<(std::ostream& out, const DebugInfo& val);
-I2_BASE_API DebugInfo DebugInfoRange(const DebugInfo& start, const DebugInfo& end);
+DebugInfo DebugInfoRange(const DebugInfo& start, const DebugInfo& end);
-I2_BASE_API void ShowCodeLocation(std::ostream& out, const DebugInfo& di, bool verbose = true);
+void ShowCodeLocation(std::ostream& out, const DebugInfo& di, bool verbose = true);
}
*
* @ingroup base
*/
-class I2_BASE_API DependencyGraph
+class DependencyGraph
{
public:
static void AddDependency(Object *parent, Object *child);
*
* @ingroup base
*/
-class I2_BASE_API Dictionary : public Object
+class Dictionary : public Object
{
public:
DECLARE_OBJECT(Dictionary);
static boost::thread_specific_ptr<DestCallback> l_LastExceptionDest;
# endif /* !__GLIBCXX__ && !_WIN32 */
-extern "C" I2_EXPORT void __cxa_throw(void *obj, TYPEINFO_TYPE *pvtinfo, void (*dest)(void *));
+extern "C" void __cxa_throw(void *obj, TYPEINFO_TYPE *pvtinfo, void (*dest)(void *));
#endif /* HAVE_CXXABI_H */
void icinga::RethrowUncaughtException(void)
namespace icinga
{
-class I2_BASE_API user_error : virtual public std::exception, virtual public boost::exception
+class user_error : virtual public std::exception, virtual public boost::exception
{ };
/*
* @ingroup base
*/
-class I2_BASE_API ScriptError : virtual public user_error
+class ScriptError : virtual public user_error
{
public:
ScriptError(const String& message);
/*
* @ingroup base
*/
-class I2_BASE_API ValidationError : virtual public user_error
+class ValidationError : virtual public user_error
{
public:
ValidationError(const ConfigObject::Ptr& object, const std::vector<String>& attributePath, const String& message);
Dictionary::Ptr m_DebugHint;
};
-I2_BASE_API StackTrace *GetLastExceptionStack(void);
-I2_BASE_API void SetLastExceptionStack(const StackTrace& trace);
+StackTrace *GetLastExceptionStack(void);
+void SetLastExceptionStack(const StackTrace& trace);
-I2_BASE_API ContextTrace *GetLastExceptionContext(void);
-I2_BASE_API void SetLastExceptionContext(const ContextTrace& context);
+ContextTrace *GetLastExceptionContext(void);
+void SetLastExceptionContext(const ContextTrace& context);
-I2_BASE_API void RethrowUncaughtException(void);
+void RethrowUncaughtException(void);
typedef boost::error_info<StackTrace, StackTrace> StackTraceErrorInfo;
return msgbuf.str();
}
-I2_BASE_API String DiagnosticInformation(const std::exception& ex, bool verbose = true, StackTrace *stack = nullptr, ContextTrace *context = nullptr);
-I2_BASE_API String DiagnosticInformation(boost::exception_ptr eptr, bool verbose = true);
+String DiagnosticInformation(const std::exception& ex, bool verbose = true, StackTrace *stack = nullptr, ContextTrace *context = nullptr);
+String DiagnosticInformation(boost::exception_ptr eptr, bool verbose = true);
-class I2_BASE_API posix_error : virtual public std::exception, virtual public boost::exception {
+class posix_error : virtual public std::exception, virtual public boost::exception {
public:
posix_error(void);
virtual ~posix_error(void) throw();
};
#ifdef _WIN32
-class I2_BASE_API win32_error : virtual public std::exception, virtual public boost::exception { };
+class win32_error : virtual public std::exception, virtual public boost::exception { };
struct errinfo_win32_error_;
typedef boost::error_info<struct errinfo_win32_error_, int> errinfo_win32_error;
*
* @ingroup base
*/
-class I2_BASE_API FIFO : public Stream
+class FIFO : public Stream
{
public:
DECLARE_PTR_TYPEDEFS(FIFO);
*
* @ingroup base
*/
-class I2_BASE_API FileLogger : public ObjectImpl<FileLogger>
+class FileLogger : public ObjectImpl<FileLogger>
{
public:
DECLARE_OBJECT(FileLogger);
*
* @ingroup base
*/
-class I2_BASE_API Function : public ObjectImpl<Function>
+class Function : public ObjectImpl<Function>
{
public:
DECLARE_OBJECT(Function);
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
-#include "base/visibility.hpp"
-
-#ifdef I2_BASE_BUILD
-# define I2_BASE_API I2_EXPORT
-#else /* I2_BASE_BUILD */
-# define I2_BASE_API I2_IMPORT
-#endif /* I2_BASE_BUILD */
-
#if defined(__GNUC__)
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#define I2_UNIQUE_NAME(prefix) I2_TOKENPASTE2(prefix, __COUNTER__)
-I2_BASE_API bool InitializeOnceHelper(void (*func)(void), int priority = 0);
+bool InitializeOnceHelper(void (*func)(void), int priority = 0);
#define INITIALIZE_ONCE(func) \
namespace { namespace I2_UNIQUE_NAME(io) { \
- I2_EXPORT bool l_InitializeOnce(icinga::InitializeOnceHelper(func)); \
+ bool l_InitializeOnce(icinga::InitializeOnceHelper(func)); \
} }
#define INITIALIZE_ONCE_WITH_PRIORITY(func, priority) \
namespace { namespace I2_UNIQUE_NAME(io) { \
- I2_EXPORT bool l_InitializeOnce(icinga::InitializeOnceHelper(func, priority)); \
+ bool l_InitializeOnce(icinga::InitializeOnceHelper(func, priority)); \
} }
}
class String;
class Value;
-I2_BASE_API String JsonEncode(const Value& value, bool pretty_print = false);
-I2_BASE_API Value JsonDecode(const String& data);
+String JsonEncode(const Value& value, bool pretty_print = false);
+Value JsonDecode(const String& data);
}
******************************************************************************/
#include "base/loader.hpp"
-#include "base/logger.hpp"
-#include "base/exception.hpp"
-#include "base/application.hpp"
using namespace icinga;
-/**
- * Loads the specified library.
- *
- * @param library The name of the library.
- */
-void Loader::LoadExtensionLibrary(const String& library)
-{
- String path;
-#if defined(_WIN32)
- path = library + ".dll";
-#elif defined(__APPLE__)
- path = "lib" + library + "." + Application::GetAppSpecVersion() + ".dylib";
-#else /* __APPLE__ */
- path = "lib" + library + ".so." + Application::GetAppSpecVersion();
-#endif /* _WIN32 */
-
- Log(LogNotice, "Loader")
- << "Loading library '" << path << "'";
-
-#ifdef _WIN32
- HMODULE hModule = LoadLibrary(path.CStr());
-
- if (!hModule) {
- BOOST_THROW_EXCEPTION(win32_error()
- << boost::errinfo_api_function("LoadLibrary")
- << errinfo_win32_error(GetLastError())
- << boost::errinfo_file_name(path));
- }
-#else /* _WIN32 */
- void *hModule = dlopen(path.CStr(), RTLD_NOW | RTLD_GLOBAL);
-
- if (!hModule) {
- BOOST_THROW_EXCEPTION(std::runtime_error("Could not load library '" + path + "': " + dlerror()));
- }
-#endif /* _WIN32 */
-
- ExecuteDeferredInitializers();
-}
-
boost::thread_specific_ptr<std::priority_queue<DeferredInitializer> >& Loader::GetDeferredInitializers(void)
{
static boost::thread_specific_ptr<std::priority_queue<DeferredInitializer> > initializers;
*
* @ingroup base
*/
-class I2_BASE_API Loader
+class Loader
{
public:
- static void LoadExtensionLibrary(const String& library);
-
static void AddDeferredInitializer(const std::function<void(void)>& callback, int priority = 0);
static void ExecuteDeferredInitializers(void);
*
* @ingroup base
*/
-class I2_BASE_API Logger : public ObjectImpl<Logger>
+class Logger : public ObjectImpl<Logger>
{
public:
DECLARE_OBJECT(Logger);
static LogSeverity m_ConsoleLogSeverity;
};
-I2_BASE_API void IcingaLog(LogSeverity severity, const String& facility, const String& message);
+void IcingaLog(LogSeverity severity, const String& facility, const String& message);
class Log
{
*
* @ingroup base
*/
-class I2_BASE_API NetString
+class NetString
{
public:
static StreamReadStatus ReadStringFromStream(const Stream::Ptr& stream, String *message, StreamReadContext& context, bool may_wait = false);
*
* @ingroup base
*/
-class I2_BASE_API NetworkStream : public Stream
+class NetworkStream : public Stream
{
public:
DECLARE_PTR_TYPEDEFS(NetworkStream);
/**
* Number class.
*/
-class I2_BASE_API Number
+class Number
{
public:
static Object::Ptr GetPrototype(void);
struct DebugInfo;
class ValidationUtils;
-extern I2_BASE_API Value Empty;
+extern Value Empty;
#define DECLARE_PTR_TYPEDEFS(klass) \
typedef intrusive_ptr<klass> Ptr
*
* @ingroup base
*/
-class I2_BASE_API Object
+class Object
{
public:
DECLARE_PTR_TYPEDEFS(Object);
friend void intrusive_ptr_release(Object *object);
};
-I2_BASE_API Value GetPrototypeField(const Value& context, const String& field, bool not_found_error, const DebugInfo& debugInfo);
+Value GetPrototypeField(const Value& context, const String& field, bool not_found_error, const DebugInfo& debugInfo);
-I2_BASE_API void TypeAddObject(Object *object);
-I2_BASE_API void TypeRemoveObject(Object *object);
+void TypeAddObject(Object *object);
+void TypeRemoveObject(Object *object);
inline void intrusive_ptr_add_ref(Object *object)
{
/**
* A scoped lock for Objects.
*/
-struct I2_BASE_API ObjectLock
+struct ObjectLock
{
public:
ObjectLock(void)
namespace icinga
{
-class I2_BASE_API ObjectType : public Type
+class ObjectType : public Type
{
public:
ObjectType(void);
*
* @ingroup base
*/
-class I2_BASE_API PerfdataValue : public ObjectImpl<PerfdataValue>
+class PerfdataValue : public ObjectImpl<PerfdataValue>
{
public:
DECLARE_OBJECT(PerfdataValue);
namespace icinga
{
-class I2_BASE_API PrimitiveType : public Type
+class PrimitiveType : public Type
{
public:
PrimitiveType(const String& name, const String& base, const ObjectFactory& factory = ObjectFactory());
*
* @ingroup base
*/
-class I2_BASE_API Process : public Object
+class Process : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Process);
*
* @ingroup base
*/
-class I2_BASE_API RingBuffer : public Object
+class RingBuffer : public Object
{
public:
DECLARE_PTR_TYPEDEFS(RingBuffer);
namespace icinga
{
-struct I2_BASE_API ScriptFrame
+struct ScriptFrame
{
Dictionary::Ptr Locals;
Value Self;
*
* @ingroup base
*/
-class I2_BASE_API ScriptGlobal
+class ScriptGlobal
{
public:
static Value Get(const String& name, const Value *defaultValue = nullptr);
/**
* @ingroup base
*/
-class I2_BASE_API ScriptUtils
+class ScriptUtils
{
public:
static void StaticInitialize(void);
namespace icinga
{
-I2_BASE_API Value Serialize(const Value& value, int attributeTypes = FAState);
-I2_BASE_API Value Deserialize(const Value& value, bool safe_mode = false, int attributeTypes = FAState);
-I2_BASE_API Value Deserialize(const Object::Ptr& object, const Value& value, bool safe_mode = false, int attributeTypes = FAState);
+Value Serialize(const Value& value, int attributeTypes = FAState);
+Value Deserialize(const Value& value, bool safe_mode = false, int attributeTypes = FAState);
+Value Deserialize(const Object::Ptr& object, const Value& value, bool safe_mode = false, int attributeTypes = FAState);
}
*
* @ingroup base
*/
-class I2_BASE_API Socket : public Object
+class Socket : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Socket);
*
* @ingroup base
*/
-class I2_BASE_API SocketEvents
+class SocketEvents
{
public:
~SocketEvents(void);
Object::Ptr LifesupportReference;
};
-class I2_BASE_API SocketEventEngine
+class SocketEventEngine
{
public:
void Start(void);
friend class SocketEvents;
};
-class I2_BASE_API SocketEventEnginePoll : public SocketEventEngine
+class SocketEventEnginePoll : public SocketEventEngine
{
public:
virtual void Register(SocketEvents *se, Object *lifesupportObject);
};
#ifdef __linux__
-class I2_BASE_API SocketEventEngineEpoll : public SocketEventEngine
+class SocketEventEngineEpoll : public SocketEventEngine
{
public:
virtual void Register(SocketEvents *se, Object *lifesupportObject);
*
* @ingroup base
*/
-class I2_BASE_API StackTrace
+class StackTrace
{
public:
StackTrace(void);
int m_Count;
};
-I2_BASE_API std::ostream& operator<<(std::ostream& stream, const StackTrace& trace);
+std::ostream& operator<<(std::ostream& stream, const StackTrace& trace);
}
namespace icinga {
-class I2_BASE_API StdioStream : public Stream
+class StdioStream : public Stream
{
public:
DECLARE_PTR_TYPEDEFS(StdioStream);
RoleServer
};
-struct I2_BASE_API StreamReadContext
+struct StreamReadContext
{
StreamReadContext(void)
: Buffer(nullptr), Size(0), MustRead(true), Eof(false)
*
* @ingroup base
*/
-class I2_BASE_API Stream : public Object
+class Stream : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Stream);
*
* @ingroup base
*/
-class I2_BASE_API StreamLogger : public ObjectImpl<StreamLogger>
+class StreamLogger : public ObjectImpl<StreamLogger>
{
public:
DECLARE_OBJECT(StreamLogger);
* Rationale for having this: The std::string class has an ambiguous assignment
* operator when used in conjunction with the Value class.
*/
-class I2_BASE_API String
+class String
{
public:
typedef std::string::iterator Iterator;
*
* @ingroup base
*/
-class I2_BASE_API SyslogLogger : public ObjectImpl<SyslogLogger>
+class SyslogLogger : public ObjectImpl<SyslogLogger>
{
public:
DECLARE_OBJECT(SyslogLogger);
*
* @ingroup base
*/
-class I2_BASE_API TcpSocket : public Socket
+class TcpSocket : public Socket
{
public:
DECLARE_PTR_TYPEDEFS(TcpSocket);
*
* @ingroup base
*/
-class I2_BASE_API ThreadPool
+class ThreadPool
{
public:
typedef std::function<void ()> WorkFunction;
*
* @ingroup base
*/
-class I2_BASE_API Timer : public Object
+class Timer : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Timer);
using namespace icinga;
-int I2_EXPORT TlsStream::m_SSLIndex;
-bool I2_EXPORT TlsStream::m_SSLIndexInitialized = false;
+int TlsStream::m_SSLIndex;
+bool TlsStream::m_SSLIndexInitialized = false;
/**
* Constructor for the TlsStream class.
*
* @ingroup base
*/
-class I2_BASE_API TlsStream : public Stream, private SocketEvents
+class TlsStream : public Stream, private SocketEvents
{
public:
DECLARE_PTR_TYPEDEFS(TlsStream);
namespace icinga
{
-void I2_BASE_API InitializeOpenSSL(void);
-std::shared_ptr<SSL_CTX> I2_BASE_API MakeSSLContext(const String& pubkey = String(), const String& privkey = String(), const String& cakey = String());
-void I2_BASE_API AddCRLToSSLContext(const std::shared_ptr<SSL_CTX>& context, const String& crlPath);
-void I2_BASE_API SetCipherListToSSLContext(const std::shared_ptr<SSL_CTX>& context, const String& cipherList);
-void I2_BASE_API SetTlsProtocolminToSSLContext(const std::shared_ptr<SSL_CTX>& context, const String& tlsProtocolmin);
-String I2_BASE_API GetCertificateCN(const std::shared_ptr<X509>& certificate);
-std::shared_ptr<X509> I2_BASE_API GetX509Certificate(const String& pemfile);
-int I2_BASE_API MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile = String(), const String& certfile = String(), bool ca = false);
-std::shared_ptr<X509> I2_BASE_API CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca);
-String I2_BASE_API GetIcingaCADir(void);
-String I2_BASE_API CertificateToString(const std::shared_ptr<X509>& cert);
-std::shared_ptr<X509> I2_BASE_API StringToCertificate(const String& cert);
-std::shared_ptr<X509> I2_BASE_API CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject);
-std::shared_ptr<X509> I2_BASE_API CreateCertIcingaCA(const std::shared_ptr<X509>& cert);
-String I2_BASE_API PBKDF2_SHA1(const String& password, const String& salt, int iterations);
-String I2_BASE_API SHA1(const String& s, bool binary = false);
-String I2_BASE_API SHA256(const String& s);
-String I2_BASE_API RandomString(int length);
-bool I2_BASE_API VerifyCertificate(const std::shared_ptr<X509>& caCertificate, const std::shared_ptr<X509>& certificate);
+void InitializeOpenSSL(void);
+std::shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey = String(), const String& privkey = String(), const String& cakey = String());
+void AddCRLToSSLContext(const std::shared_ptr<SSL_CTX>& context, const String& crlPath);
+void SetCipherListToSSLContext(const std::shared_ptr<SSL_CTX>& context, const String& cipherList);
+void SetTlsProtocolminToSSLContext(const std::shared_ptr<SSL_CTX>& context, const String& tlsProtocolmin);
+String GetCertificateCN(const std::shared_ptr<X509>& certificate);
+std::shared_ptr<X509> GetX509Certificate(const String& pemfile);
+int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile = String(), const String& certfile = String(), bool ca = false);
+std::shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca);
+String GetIcingaCADir(void);
+String CertificateToString(const std::shared_ptr<X509>& cert);
+std::shared_ptr<X509> StringToCertificate(const String& cert);
+std::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject);
+std::shared_ptr<X509> CreateCertIcingaCA(const std::shared_ptr<X509>& cert);
+String PBKDF2_SHA1(const String& password, const String& salt, int iterations);
+String SHA1(const String& s, bool binary = false);
+String SHA256(const String& s);
+String RandomString(int length);
+bool VerifyCertificate(const std::shared_ptr<X509>& caCertificate, const std::shared_ptr<X509>& certificate);
-class I2_BASE_API openssl_error : virtual public std::exception, virtual public boost::exception { };
+class openssl_error : virtual public std::exception, virtual public boost::exception { };
struct errinfo_openssl_error_;
typedef boost::error_info<struct errinfo_openssl_error_, unsigned long> errinfo_openssl_error;
virtual bool ValidateName(const String& type, const String& name) const = 0;
};
-class I2_BASE_API Type : public Object
+class Type : public Object
{
public:
DECLARE_OBJECT(Type);
Object::Ptr m_Prototype;
};
-class I2_BASE_API TypeType : public Type
+class TypeType : public Type
{
public:
DECLARE_PTR_TYPEDEFS(Type);
};
template<typename T>
-class I2_BASE_API TypeImpl
+class TypeImpl
{
};
namespace icinga
{
-class I2_BASE_API UnixSocket : public Socket
+class UnixSocket : public Socket
{
public:
DECLARE_PTR_TYPEDEFS(UnixSocket);
*
* @ingroup base
*/
-class I2_BASE_API Utility
+class Utility
{
public:
static String DemangleSymbolName(const String& sym);
*
* @ingroup base
*/
-class I2_BASE_API Value
+class Value
{
public:
Value(void)
boost::variant<boost::blank, double, bool, String, Object::Ptr> m_Value;
};
-extern I2_BASE_API Value Empty;
-
-I2_BASE_API Value operator+(const Value& lhs, const char *rhs);
-I2_BASE_API Value operator+(const char *lhs, const Value& rhs);
-
-I2_BASE_API Value operator+(const Value& lhs, const String& rhs);
-I2_BASE_API Value operator+(const String& lhs, const Value& rhs);
-
-I2_BASE_API Value operator+(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator+(const Value& lhs, double rhs);
-I2_BASE_API Value operator+(double lhs, const Value& rhs);
-I2_BASE_API Value operator+(const Value& lhs, int rhs);
-I2_BASE_API Value operator+(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator-(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator-(const Value& lhs, double rhs);
-I2_BASE_API Value operator-(double lhs, const Value& rhs);
-I2_BASE_API Value operator-(const Value& lhs, int rhs);
-I2_BASE_API Value operator-(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator*(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator*(const Value& lhs, double rhs);
-I2_BASE_API Value operator*(double lhs, const Value& rhs);
-I2_BASE_API Value operator*(const Value& lhs, int rhs);
-I2_BASE_API Value operator*(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator/(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator/(const Value& lhs, double rhs);
-I2_BASE_API Value operator/(double lhs, const Value& rhs);
-I2_BASE_API Value operator/(const Value& lhs, int rhs);
-I2_BASE_API Value operator/(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator%(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator%(const Value& lhs, double rhs);
-I2_BASE_API Value operator%(double lhs, const Value& rhs);
-I2_BASE_API Value operator%(const Value& lhs, int rhs);
-I2_BASE_API Value operator%(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator^(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator^(const Value& lhs, double rhs);
-I2_BASE_API Value operator^(double lhs, const Value& rhs);
-I2_BASE_API Value operator^(const Value& lhs, int rhs);
-I2_BASE_API Value operator^(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator&(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator&(const Value& lhs, double rhs);
-I2_BASE_API Value operator&(double lhs, const Value& rhs);
-I2_BASE_API Value operator&(const Value& lhs, int rhs);
-I2_BASE_API Value operator&(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator|(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator|(const Value& lhs, double rhs);
-I2_BASE_API Value operator|(double lhs, const Value& rhs);
-I2_BASE_API Value operator|(const Value& lhs, int rhs);
-I2_BASE_API Value operator|(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator<<(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator<<(const Value& lhs, double rhs);
-I2_BASE_API Value operator<<(double lhs, const Value& rhs);
-I2_BASE_API Value operator<<(const Value& lhs, int rhs);
-I2_BASE_API Value operator<<(int lhs, const Value& rhs);
-
-I2_BASE_API Value operator>>(const Value& lhs, const Value& rhs);
-I2_BASE_API Value operator>>(const Value& lhs, double rhs);
-I2_BASE_API Value operator>>(double lhs, const Value& rhs);
-I2_BASE_API Value operator>>(const Value& lhs, int rhs);
-I2_BASE_API Value operator>>(int lhs, const Value& rhs);
-
-I2_BASE_API bool operator<(const Value& lhs, const Value& rhs);
-I2_BASE_API bool operator<(const Value& lhs, double rhs);
-I2_BASE_API bool operator<(double lhs, const Value& rhs);
-I2_BASE_API bool operator<(const Value& lhs, int rhs);
-I2_BASE_API bool operator<(int lhs, const Value& rhs);
-
-I2_BASE_API bool operator>(const Value& lhs, const Value& rhs);
-I2_BASE_API bool operator>(const Value& lhs, double rhs);
-I2_BASE_API bool operator>(double lhs, const Value& rhs);
-I2_BASE_API bool operator>(const Value& lhs, int rhs);
-I2_BASE_API bool operator>(int lhs, const Value& rhs);
-
-I2_BASE_API bool operator<=(const Value& lhs, const Value& rhs);
-I2_BASE_API bool operator<=(const Value& lhs, double rhs);
-I2_BASE_API bool operator<=(double lhs, const Value& rhs);
-I2_BASE_API bool operator<=(const Value& lhs, int rhs);
-I2_BASE_API bool operator<=(int lhs, const Value& rhs);
-
-I2_BASE_API bool operator>=(const Value& lhs, const Value& rhs);
-I2_BASE_API bool operator>=(const Value& lhs, double rhs);
-I2_BASE_API bool operator>=(double lhs, const Value& rhs);
-I2_BASE_API bool operator>=(const Value& lhs, int rhs);
-I2_BASE_API bool operator>=(int lhs, const Value& rhs);
-
-I2_BASE_API std::ostream& operator<<(std::ostream& stream, const Value& value);
-I2_BASE_API std::istream& operator>>(std::istream& stream, Value& value);
+extern Value Empty;
+
+Value operator+(const Value& lhs, const char *rhs);
+Value operator+(const char *lhs, const Value& rhs);
+
+Value operator+(const Value& lhs, const String& rhs);
+Value operator+(const String& lhs, const Value& rhs);
+
+Value operator+(const Value& lhs, const Value& rhs);
+Value operator+(const Value& lhs, double rhs);
+Value operator+(double lhs, const Value& rhs);
+Value operator+(const Value& lhs, int rhs);
+Value operator+(int lhs, const Value& rhs);
+
+Value operator-(const Value& lhs, const Value& rhs);
+Value operator-(const Value& lhs, double rhs);
+Value operator-(double lhs, const Value& rhs);
+Value operator-(const Value& lhs, int rhs);
+Value operator-(int lhs, const Value& rhs);
+
+Value operator*(const Value& lhs, const Value& rhs);
+Value operator*(const Value& lhs, double rhs);
+Value operator*(double lhs, const Value& rhs);
+Value operator*(const Value& lhs, int rhs);
+Value operator*(int lhs, const Value& rhs);
+
+Value operator/(const Value& lhs, const Value& rhs);
+Value operator/(const Value& lhs, double rhs);
+Value operator/(double lhs, const Value& rhs);
+Value operator/(const Value& lhs, int rhs);
+Value operator/(int lhs, const Value& rhs);
+
+Value operator%(const Value& lhs, const Value& rhs);
+Value operator%(const Value& lhs, double rhs);
+Value operator%(double lhs, const Value& rhs);
+Value operator%(const Value& lhs, int rhs);
+Value operator%(int lhs, const Value& rhs);
+
+Value operator^(const Value& lhs, const Value& rhs);
+Value operator^(const Value& lhs, double rhs);
+Value operator^(double lhs, const Value& rhs);
+Value operator^(const Value& lhs, int rhs);
+Value operator^(int lhs, const Value& rhs);
+
+Value operator&(const Value& lhs, const Value& rhs);
+Value operator&(const Value& lhs, double rhs);
+Value operator&(double lhs, const Value& rhs);
+Value operator&(const Value& lhs, int rhs);
+Value operator&(int lhs, const Value& rhs);
+
+Value operator|(const Value& lhs, const Value& rhs);
+Value operator|(const Value& lhs, double rhs);
+Value operator|(double lhs, const Value& rhs);
+Value operator|(const Value& lhs, int rhs);
+Value operator|(int lhs, const Value& rhs);
+
+Value operator<<(const Value& lhs, const Value& rhs);
+Value operator<<(const Value& lhs, double rhs);
+Value operator<<(double lhs, const Value& rhs);
+Value operator<<(const Value& lhs, int rhs);
+Value operator<<(int lhs, const Value& rhs);
+
+Value operator>>(const Value& lhs, const Value& rhs);
+Value operator>>(const Value& lhs, double rhs);
+Value operator>>(double lhs, const Value& rhs);
+Value operator>>(const Value& lhs, int rhs);
+Value operator>>(int lhs, const Value& rhs);
+
+bool operator<(const Value& lhs, const Value& rhs);
+bool operator<(const Value& lhs, double rhs);
+bool operator<(double lhs, const Value& rhs);
+bool operator<(const Value& lhs, int rhs);
+bool operator<(int lhs, const Value& rhs);
+
+bool operator>(const Value& lhs, const Value& rhs);
+bool operator>(const Value& lhs, double rhs);
+bool operator>(double lhs, const Value& rhs);
+bool operator>(const Value& lhs, int rhs);
+bool operator>(int lhs, const Value& rhs);
+
+bool operator<=(const Value& lhs, const Value& rhs);
+bool operator<=(const Value& lhs, double rhs);
+bool operator<=(double lhs, const Value& rhs);
+bool operator<=(const Value& lhs, int rhs);
+bool operator<=(int lhs, const Value& rhs);
+
+bool operator>=(const Value& lhs, const Value& rhs);
+bool operator>=(const Value& lhs, double rhs);
+bool operator>=(double lhs, const Value& rhs);
+bool operator>=(const Value& lhs, int rhs);
+bool operator>=(int lhs, const Value& rhs);
+
+std::ostream& operator<<(std::ostream& stream, const Value& value);
+std::istream& operator>>(std::istream& stream, Value& value);
}
+++ /dev/null
-/******************************************************************************
- * Icinga 2 *
- * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License *
- * as published by the Free Software Foundation; either version 2 *
- * of the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software Foundation *
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
- ******************************************************************************/
-
-#ifndef VISIBILITY_H
-#define VISIBILITY_H
-
-#ifndef _WIN32
-# define I2_EXPORT __attribute__ ((visibility("default")))
-# define I2_IMPORT __attribute__ ((visibility("default")))
-#else /* _WIN32 */
-# define I2_EXPORT __declspec(dllexport)
-# define I2_IMPORT __declspec(dllimport)
-# define I2_HIDDEN
-#endif /* _WIN32 */
-
-#endif /* VISIBILITY_H */
*
* @ingroup base
*/
-class I2_BASE_API WorkQueue
+class WorkQueue
{
public:
typedef std::function<void (boost::exception_ptr)> ExceptionCallback;
mkunity_target(checker checker checker_SOURCES)
endif()
-add_library(checker SHARED ${checker_SOURCES})
+add_library(checker STATIC ${checker_SOURCES})
target_link_libraries(checker ${Boost_LIBRARIES} base config icinga remote)
set_target_properties (
checker PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_CHECKER_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
install_if_not_exists(
install_if_not_exists(${PROJECT_SOURCE_DIR}/etc/icinga2/features-enabled/checker.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-enabled)
endif()
-install(
- TARGETS checker
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
mkunity_target(cli cli cli_SOURCES)
endif()
-add_library(cli SHARED ${cli_SOURCES})
+add_library(cli STATIC ${cli_SOURCES})
target_link_libraries(cli ${Boost_LIBRARIES} base config remote)
set_target_properties (
cli PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_CLI_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
-)
-
-install(
- TARGETS cli
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
)
/**
* @ingroup cli
*/
-class I2_CLI_API ApiSetupUtility
+class ApiSetupUtility
{
public:
static bool SetupMaster(const String& cn, bool prompt_restart = false);
namespace icinga
{
-std::vector<String> I2_CLI_API GetBashCompletionSuggestions(const String& type, const String& word);
-std::vector<String> I2_CLI_API GetFieldCompletionSuggestions(const Type::Ptr& type, const String& word);
+std::vector<String> GetBashCompletionSuggestions(const String& type, const String& word);
+std::vector<String> GetFieldCompletionSuggestions(const Type::Ptr& type, const String& word);
enum ImpersonationLevel
{
*
* @ingroup base
*/
-class I2_CLI_API CLICommand : public Object
+class CLICommand : public Object
{
public:
DECLARE_PTR_TYPEDEFS(CLICommand);
/**
* @ingroup cli
*/
-class I2_CLI_API DaemonUtility
+class DaemonUtility
{
public:
static bool ValidateConfigFiles(const std::vector<std::string>& configs, const String& objectsFile = String());
/**
* @ingroup cli
*/
-class I2_CLI_API FeatureUtility
+class FeatureUtility
{
public:
static String GetFeaturesAvailablePath(void);
#include "base/i2-base.hpp"
-#ifdef I2_CLI_BUILD
-# define I2_CLI_API I2_EXPORT
-#else /* I2_REMOTE_BUILD */
-# define I2_CLI_API I2_IMPORT
-#endif /* I2_REMOTE_BUILD */
-
#endif /* I2CLI_H */
/**
* @ingroup cli
*/
-class I2_CLI_API NodeUtility
+class NodeUtility
{
public:
static String GetConstantsConfPath(void);
/**
* @ingroup cli
*/
-class I2_CLI_API ObjectListUtility
+class ObjectListUtility
{
public:
static bool PrintObject(std::ostream& fp, bool& first, const String& message, std::map<String, int>& type_count, const String& name_filter, const String& type_filter);
/**
* @ingroup cli
*/
-class I2_CLI_API VariableUtility
+class VariableUtility
{
public:
static Value GetVariable(const String& name);
mkunity_target(compat compat compat_SOURCES)
endif()
-add_library(compat SHARED ${compat_SOURCES})
+add_library(compat STATIC ${compat_SOURCES})
target_link_libraries(compat ${Boost_LIBRARIES} base config icinga)
set_target_properties (
compat PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_COMPAT_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
install_if_not_exists(
${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
)
-install(TARGETS compat RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2)
-
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2/compat/archives\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_RUNDIR}/icinga2/cmd\")")
mkunity_target(config config config_SOURCES)
endif()
-add_library(config SHARED ${config_SOURCES})
+add_library(config STATIC ${config_SOURCES})
-target_link_libraries(config ${Boost_LIBRARIES} base)
+target_link_libraries(config ${Boost_LIBRARIES} base)
set_target_properties (
config PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_CONFIG_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
-
-install(
- TARGETS config
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-if(APPLE)
- install(
- TARGETS config
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
- )
-endif()
namespace icinga
{
-class I2_CONFIG_API ActivationContext : public Object
+class ActivationContext : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ActivationContext);
friend class ActivationScope;
};
-class I2_CONFIG_API ActivationScope
+class ActivationScope
{
public:
ActivationScope(const ActivationContext::Ptr& context = nullptr);
/**
* @ingroup config
*/
-class I2_CONFIG_API ApplyRule
+class ApplyRule
{
public:
typedef std::map<String, std::vector<String> > TypeMap;
*
* @ingroup config
*/
-class I2_CONFIG_API ConfigCompiler
+class ConfigCompiler
{
public:
explicit ConfigCompiler(const String& path, std::istream *input,
/*
* @ingroup config
*/
-class I2_CONFIG_API ConfigCompilerContext
+class ConfigCompilerContext
{
public:
ConfigCompilerContext(void);
*
* @ingroup config
*/
-class I2_CONFIG_API ConfigItem : public Object {
+class ConfigItem : public Object {
public:
DECLARE_PTR_TYPEDEFS(ConfigItem);
*
* @ingroup config
*/
-class I2_CONFIG_API ConfigItemBuilder : public Object
+class ConfigItemBuilder : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ConfigItemBuilder);
ExpressionResult libres = m_Operand->Evaluate(frame, dhint);
CHECK_RESULT(libres);
- Loader::LoadExtensionLibrary(libres.GetValue());
+ Log(LogNotice, "config")
+ << "Ignoring explicit load request for library \"" << libres << "\".";
+ //Loader::LoadExtensionLibrary(libres.GetValue());
return Empty;
}
/**
* @ingroup config
*/
-class I2_CONFIG_API Expression
+class Expression
{
public:
Expression(void) = default;
static void ScriptBreakpoint(ScriptFrame& frame, ScriptError *ex, const DebugInfo& di);
};
-I2_CONFIG_API std::unique_ptr<Expression> MakeIndexer(ScopeSpecifier scopeSpec, const String& index);
+std::unique_ptr<Expression> MakeIndexer(ScopeSpecifier scopeSpec, const String& index);
-class I2_CONFIG_API OwnedExpression : public Expression
+class OwnedExpression : public Expression
{
public:
OwnedExpression(const std::shared_ptr<Expression>& expression)
std::shared_ptr<Expression> m_Expression;
};
-class I2_CONFIG_API LiteralExpression : public Expression
+class LiteralExpression : public Expression
{
public:
LiteralExpression(const Value& value = Value());
return std::unique_ptr<LiteralExpression>(MakeLiteralRaw(literal));
}
-class I2_CONFIG_API DebuggableExpression : public Expression
+class DebuggableExpression : public Expression
{
public:
DebuggableExpression(const DebugInfo& debugInfo = DebugInfo())
DebugInfo m_DebugInfo;
};
-class I2_CONFIG_API UnaryExpression : public DebuggableExpression
+class UnaryExpression : public DebuggableExpression
{
public:
UnaryExpression(std::unique_ptr<Expression> operand, const DebugInfo& debugInfo = DebugInfo())
std::unique_ptr<Expression> m_Operand;
};
-class I2_CONFIG_API BinaryExpression : public DebuggableExpression
+class BinaryExpression : public DebuggableExpression
{
public:
BinaryExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
std::unique_ptr<Expression> m_Operand2;
};
-class I2_CONFIG_API VariableExpression : public DebuggableExpression
+class VariableExpression : public DebuggableExpression
{
public:
VariableExpression(const String& variable, const DebugInfo& debugInfo = DebugInfo())
private:
String m_Variable;
- friend I2_CONFIG_API void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
+ friend void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
};
-class I2_CONFIG_API NegateExpression : public UnaryExpression
+class NegateExpression : public UnaryExpression
{
public:
NegateExpression(std::unique_ptr<Expression> operand, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API LogicalNegateExpression : public UnaryExpression
+class LogicalNegateExpression : public UnaryExpression
{
public:
LogicalNegateExpression(std::unique_ptr<Expression> operand, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API AddExpression : public BinaryExpression
+class AddExpression : public BinaryExpression
{
public:
AddExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API SubtractExpression : public BinaryExpression
+class SubtractExpression : public BinaryExpression
{
public:
SubtractExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API MultiplyExpression : public BinaryExpression
+class MultiplyExpression : public BinaryExpression
{
public:
MultiplyExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API DivideExpression : public BinaryExpression
+class DivideExpression : public BinaryExpression
{
public:
DivideExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API ModuloExpression : public BinaryExpression
+class ModuloExpression : public BinaryExpression
{
public:
ModuloExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API XorExpression : public BinaryExpression
+class XorExpression : public BinaryExpression
{
public:
XorExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API BinaryAndExpression : public BinaryExpression
+class BinaryAndExpression : public BinaryExpression
{
public:
BinaryAndExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API BinaryOrExpression : public BinaryExpression
+class BinaryOrExpression : public BinaryExpression
{
public:
BinaryOrExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API ShiftLeftExpression : public BinaryExpression
+class ShiftLeftExpression : public BinaryExpression
{
public:
ShiftLeftExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API ShiftRightExpression : public BinaryExpression
+class ShiftRightExpression : public BinaryExpression
{
public:
ShiftRightExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API EqualExpression : public BinaryExpression
+class EqualExpression : public BinaryExpression
{
public:
EqualExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API NotEqualExpression : public BinaryExpression
+class NotEqualExpression : public BinaryExpression
{
public:
NotEqualExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API LessThanExpression : public BinaryExpression
+class LessThanExpression : public BinaryExpression
{
public:
LessThanExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API GreaterThanExpression : public BinaryExpression
+class GreaterThanExpression : public BinaryExpression
{
public:
GreaterThanExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API LessThanOrEqualExpression : public BinaryExpression
+class LessThanOrEqualExpression : public BinaryExpression
{
public:
LessThanOrEqualExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API GreaterThanOrEqualExpression : public BinaryExpression
+class GreaterThanOrEqualExpression : public BinaryExpression
{
public:
GreaterThanOrEqualExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API InExpression : public BinaryExpression
+class InExpression : public BinaryExpression
{
public:
InExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API NotInExpression : public BinaryExpression
+class NotInExpression : public BinaryExpression
{
public:
NotInExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API LogicalAndExpression : public BinaryExpression
+class LogicalAndExpression : public BinaryExpression
{
public:
LogicalAndExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API LogicalOrExpression : public BinaryExpression
+class LogicalOrExpression : public BinaryExpression
{
public:
LogicalOrExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API FunctionCallExpression : public DebuggableExpression
+class FunctionCallExpression : public DebuggableExpression
{
public:
FunctionCallExpression(std::unique_ptr<Expression> fname, std::vector<std::unique_ptr<Expression> >&& args, const DebugInfo& debugInfo = DebugInfo())
std::vector<std::unique_ptr<Expression> > m_Args;
};
-class I2_CONFIG_API ArrayExpression : public DebuggableExpression
+class ArrayExpression : public DebuggableExpression
{
public:
ArrayExpression(std::vector<std::unique_ptr<Expression > >&& expressions, const DebugInfo& debugInfo = DebugInfo())
std::vector<std::unique_ptr<Expression> > m_Expressions;
};
-class I2_CONFIG_API DictExpression : public DebuggableExpression
+class DictExpression : public DebuggableExpression
{
public:
DictExpression(std::vector<std::unique_ptr<Expression> >&& expressions = {}, const DebugInfo& debugInfo = DebugInfo())
std::vector<std::unique_ptr<Expression> > m_Expressions;
bool m_Inline;
- friend I2_CONFIG_API void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
+ friend void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
};
-class I2_CONFIG_API SetExpression : public BinaryExpression
+class SetExpression : public BinaryExpression
{
public:
SetExpression(std::unique_ptr<Expression> operand1, CombinedSetOp op, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
private:
CombinedSetOp m_Op;
- friend I2_CONFIG_API void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
+ friend void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
};
-class I2_CONFIG_API ConditionalExpression : public DebuggableExpression
+class ConditionalExpression : public DebuggableExpression
{
public:
ConditionalExpression(std::unique_ptr<Expression> condition, std::unique_ptr<Expression> true_branch, std::unique_ptr<Expression> false_branch, const DebugInfo& debugInfo = DebugInfo())
std::unique_ptr<Expression> m_FalseBranch;
};
-class I2_CONFIG_API WhileExpression : public DebuggableExpression
+class WhileExpression : public DebuggableExpression
{
public:
WhileExpression(std::unique_ptr<Expression> condition, std::unique_ptr<Expression> loop_body, const DebugInfo& debugInfo = DebugInfo())
};
-class I2_CONFIG_API ReturnExpression : public UnaryExpression
+class ReturnExpression : public UnaryExpression
{
public:
ReturnExpression(std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API BreakExpression : public DebuggableExpression
+class BreakExpression : public DebuggableExpression
{
public:
BreakExpression(const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API ContinueExpression : public DebuggableExpression
+class ContinueExpression : public DebuggableExpression
{
public:
ContinueExpression(const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API GetScopeExpression : public Expression
+class GetScopeExpression : public Expression
{
public:
GetScopeExpression(ScopeSpecifier scopeSpec)
ScopeSpecifier m_ScopeSpec;
};
-class I2_CONFIG_API IndexerExpression : public BinaryExpression
+class IndexerExpression : public BinaryExpression
{
public:
IndexerExpression(std::unique_ptr<Expression> operand1, std::unique_ptr<Expression> operand2, const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
virtual bool GetReference(ScriptFrame& frame, bool init_dict, Value *parent, String *index, DebugHint **dhint) const override;
- friend I2_CONFIG_API void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
+ friend void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
};
-I2_CONFIG_API void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
+void BindToScope(std::unique_ptr<Expression>& expr, ScopeSpecifier scopeSpec);
-class I2_CONFIG_API ThrowExpression : public DebuggableExpression
+class ThrowExpression : public DebuggableExpression
{
public:
ThrowExpression(std::unique_ptr<Expression> message, bool incompleteExpr, const DebugInfo& debugInfo = DebugInfo())
bool m_IncompleteExpr;
};
-class I2_CONFIG_API ImportExpression : public DebuggableExpression
+class ImportExpression : public DebuggableExpression
{
public:
ImportExpression(std::unique_ptr<Expression> name, const DebugInfo& debugInfo = DebugInfo())
std::unique_ptr<Expression> m_Name;
};
-class I2_CONFIG_API ImportDefaultTemplatesExpression : public DebuggableExpression
+class ImportDefaultTemplatesExpression : public DebuggableExpression
{
public:
ImportDefaultTemplatesExpression(const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API FunctionExpression : public DebuggableExpression
+class FunctionExpression : public DebuggableExpression
{
public:
FunctionExpression(const String& name, const std::vector<String>& args,
std::shared_ptr<Expression> m_Expression;
};
-class I2_CONFIG_API ApplyExpression : public DebuggableExpression
+class ApplyExpression : public DebuggableExpression
{
public:
ApplyExpression(const String& type, const String& target, std::unique_ptr<Expression> name,
std::shared_ptr<Expression> m_Expression;
};
-class I2_CONFIG_API ObjectExpression : public DebuggableExpression
+class ObjectExpression : public DebuggableExpression
{
public:
ObjectExpression(bool abstract, std::unique_ptr<Expression> type, std::unique_ptr<Expression> name, std::unique_ptr<Expression> filter,
std::shared_ptr<Expression> m_Expression;
};
-class I2_CONFIG_API ForExpression : public DebuggableExpression
+class ForExpression : public DebuggableExpression
{
public:
ForExpression(const String& fkvar, const String& fvvar, std::unique_ptr<Expression> value, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
std::unique_ptr<Expression> m_Expression;
};
-class I2_CONFIG_API LibraryExpression : public UnaryExpression
+class LibraryExpression : public UnaryExpression
{
public:
LibraryExpression(std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
IncludeZones
};
-class I2_CONFIG_API IncludeExpression : public DebuggableExpression
+class IncludeExpression : public DebuggableExpression
{
public:
IncludeExpression(const String& relativeBase, std::unique_ptr<Expression> path, std::unique_ptr<Expression> pattern, std::unique_ptr<Expression> name,
String m_Package;
};
-class I2_CONFIG_API BreakpointExpression : public DebuggableExpression
+class BreakpointExpression : public DebuggableExpression
{
public:
BreakpointExpression(const DebugInfo& debugInfo = DebugInfo())
virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;
};
-class I2_CONFIG_API UsingExpression : public DebuggableExpression
+class UsingExpression : public DebuggableExpression
{
public:
UsingExpression(std::unique_ptr<Expression> name, const DebugInfo& debugInfo = DebugInfo())
std::unique_ptr<Expression> m_Name;
};
-class I2_CONFIG_API TryExceptExpression : public DebuggableExpression
+class TryExceptExpression : public DebuggableExpression
{
public:
TryExceptExpression(std::unique_ptr<Expression> tryBody, std::unique_ptr<Expression> exceptBody, const DebugInfo& debugInfo = DebugInfo())
#include "base/i2-base.hpp"
-#ifdef I2_CONFIG_BUILD
-# define I2_CONFIG_API I2_EXPORT
-#else /* I2_CONFIG_BUILD */
-# define I2_CONFIG_API I2_IMPORT
-#endif /* I2_CONFIG_BUILD */
-
#endif /* I2CONFIG_H */
/**
* @ingroup config
*/
-class I2_CONFIG_API ObjectRule
+class ObjectRule
{
public:
typedef std::set<String> TypeSet;
mkunity_target(db_ido db_ido db_ido_SOURCES)
endif()
-add_library(db_ido SHARED ${db_ido_SOURCES})
+add_library(db_ido STATIC ${db_ido_SOURCES})
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(db_ido ${Boost_LIBRARIES} base config icinga remote)
set_target_properties (
db_ido PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_DB_IDO_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
-)
-
-install(
- TARGETS db_ido
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
)
*
* @ingroup db_ido
*/
-class I2_DB_IDO_API DbConnection : public ObjectImpl<DbConnection>
+class DbConnection : public ObjectImpl<DbConnection>
{
public:
DECLARE_OBJECT(DbConnection);
*
* @ingroup ido
*/
-class I2_DB_IDO_API DbObject : public Object
+class DbObject : public Object
{
public:
DECLARE_PTR_TYPEDEFS(DbObject);
class DbObject;
-struct I2_DB_IDO_API DbQuery
+struct DbQuery
{
int Type;
DbQueryCategory Category;
*
* @ingroup ido
*/
-struct I2_DB_IDO_API DbReference
+struct DbReference
{
public:
DbReference(void);
*
* @ingroup ido
*/
-class I2_DB_IDO_API DbType : public Object
+class DbType : public Object
{
public:
DECLARE_PTR_TYPEDEFS(DbType);
*
* @ingroup ido
*/
-class I2_DB_IDO_API DbTypeRegistry : public Registry<DbTypeRegistry, DbType::Ptr>
+class DbTypeRegistry : public Registry<DbTypeRegistry, DbType::Ptr>
{
public:
static DbTypeRegistry *GetInstance(void);
*
* @ingroup ido
*/
-struct I2_DB_IDO_API DbValue : public Object
+struct DbValue : public Object
{
public:
DECLARE_PTR_TYPEDEFS(DbValue);
#include "base/i2-base.hpp"
-#ifdef I2_DB_IDO_BUILD
-# define I2_DB_IDO_API I2_EXPORT
-#else /* I2_DB_IDO_BUILD */
-# define I2_DB_IDO_API I2_IMPORT
-#endif /* I2_DB_IDO_BUILD */
-
#endif /* I2DB_IDO_H */
mkunity_target(db_ido_mysql db_ido_mysql db_ido_mysql_SOURCES)
endif()
- add_library(db_ido_mysql SHARED ${db_ido_mysql_SOURCES})
+ add_library(db_ido_mysql STATIC ${db_ido_mysql_SOURCES})
include_directories(${MYSQL_INCLUDE_DIR})
- target_link_libraries(db_ido_mysql ${Boost_LIBRARIES} ${MYSQL_CLIENT_LIBS} base config icinga db_ido)
+ target_link_libraries(db_ido_mysql ${Boost_LIBRARIES} ${MYSQL_LIB} base config icinga db_ido)
set_target_properties (
db_ido_mysql PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_DB_IDO_MYSQL_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
install_if_not_exists(
${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
)
- install(
- TARGETS db_ido_mysql
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- )
-
install(
DIRECTORY schema
DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql
# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-find_package(PostgreSQL)
-
if(PostgreSQL_FOUND)
mkclass_target(idopgsqlconnection.ti idopgsqlconnection.tcpp idopgsqlconnection.thpp)
- link_directories(${PostgreSQL_LIBRARY_DIRS})
- include_directories(${PostgreSQL_INCLUDE_DIRS})
-
set(db_ido_pgsql_SOURCES
idopgsqlconnection.cpp idopgsqlconnection.thpp
)
mkunity_target(db_ido_pgsql db_ido_pgsql db_ido_pgsql_SOURCES)
endif()
- add_library(db_ido_pgsql SHARED ${db_ido_pgsql_SOURCES})
+ add_library(db_ido_pgsql STATIC ${db_ido_pgsql_SOURCES})
target_link_libraries(db_ido_pgsql ${Boost_LIBRARIES} ${PostgreSQL_LIBRARIES} base config icinga db_ido)
set_target_properties (
db_ido_pgsql PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_DB_IDO_PGSQL_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
install_if_not_exists(
${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
)
- install(
- TARGETS db_ido_pgsql
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- )
-
install(
DIRECTORY schema
DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-pgsql
mkunity_target(demo demo demo_SOURCES)
endif()
-add_library(demo SHARED ${demo_SOURCES})
+add_library(demo STATIC ${demo_SOURCES})
target_link_libraries(demo ${Boost_LIBRARIES} base config icinga remote)
set_target_properties (
demo PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_DEMO_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
-
-install(
- TARGETS demo
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
mkunity_target(hello hello hello_SOURCES)
endif()
-add_library(hello SHARED ${hello_SOURCES})
+add_library(hello STATIC ${hello_SOURCES})
target_link_libraries(hello ${Boost_LIBRARIES} base config)
set_target_properties (
hello PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_HELLO_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
-
-install(
- TARGETS hello
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
mkunity_target(icinga icinga icinga_SOURCES)
endif()
-add_library(icinga SHARED ${icinga_SOURCES})
+add_library(icinga STATIC ${icinga_SOURCES})
target_link_libraries(icinga ${Boost_LIBRARIES} base config remote)
set_target_properties (
icinga PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_ICINGA_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
-
-install(
- TARGETS icinga
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-
/**
* @ingroup icinga
*/
-class I2_ICINGA_API ApiActions
+class ApiActions
{
public:
static Dictionary::Ptr ProcessCheckResult(const ConfigObject::Ptr& object, const Dictionary::Ptr& params);
/**
* @ingroup icinga
*/
-class I2_ICINGA_API ApiEvents
+class ApiEvents
{
public:
static void StaticInitialize(void);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Checkable : public ObjectImpl<Checkable>
+class Checkable : public ObjectImpl<Checkable>
{
public:
DECLARE_OBJECT(Checkable);
*
* @ingroup icinga
*/
-class I2_ICINGA_API CheckCommand : public ObjectImpl<CheckCommand>
+class CheckCommand : public ObjectImpl<CheckCommand>
{
public:
DECLARE_OBJECT(CheckCommand);
*
* @ingroup icinga
*/
-class I2_ICINGA_API CheckResult : public ObjectImpl<CheckResult>
+class CheckResult : public ObjectImpl<CheckResult>
{
public:
DECLARE_OBJECT(CheckResult);
*
* @ingroup icinga
*/
-class I2_ICINGA_API CIB
+class CIB
{
public:
static void UpdateActiveHostChecksStatistics(long tv, int num);
/**
* @ingroup icinga
*/
-class I2_ICINGA_API ClusterEvents
+class ClusterEvents
{
public:
static void StaticInitialize(void);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Command : public ObjectImpl<Command>
+class Command : public ObjectImpl<Command>
{
public:
DECLARE_OBJECT(Command);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Comment : public ObjectImpl<Comment>
+class Comment : public ObjectImpl<Comment>
{
public:
DECLARE_OBJECT(Comment);
CommentAcknowledgement = 4
};
-class I2_ICINGA_API CommentNameComposer : public NameComposer
+class CommentNameComposer : public NameComposer
{
public:
virtual String MakeName(const String& shortName, const Object::Ptr& context) const;
*
* @ingroup icinga
*/
-class I2_ICINGA_API CompatUtility
+class CompatUtility
{
public:
/* command */
*
* @ingroup icinga
*/
-class I2_ICINGA_API CustomVarObject : public ObjectImpl<CustomVarObject>
+class CustomVarObject : public ObjectImpl<CustomVarObject>
{
public:
DECLARE_OBJECT(CustomVarObject);
virtual void ValidateVars(const Dictionary::Ptr& value, const ValidationUtils& utils) override;
};
-I2_ICINGA_API int FilterArrayToInt(const Array::Ptr& typeFilters, const std::map<String, int>& filterMap, int defaultValue);
+int FilterArrayToInt(const Array::Ptr& typeFilters, const std::map<String, int>& filterMap, int defaultValue);
}
*
* @ingroup icinga
*/
-class I2_ICINGA_API Dependency : public ObjectImpl<Dependency>
+class Dependency : public ObjectImpl<Dependency>
{
public:
DECLARE_OBJECT(Dependency);
{
code {{{
-class I2_ICINGA_API DependencyNameComposer : public NameComposer
+class DependencyNameComposer : public NameComposer
{
public:
virtual String MakeName(const String& shortName, const Object::Ptr& context) const;
*
* @ingroup icinga
*/
-class I2_ICINGA_API Downtime : public ObjectImpl<Downtime>
+class Downtime : public ObjectImpl<Downtime>
{
public:
DECLARE_OBJECT(Downtime);
{
code {{{
-class I2_ICINGA_API DowntimeNameComposer : public NameComposer
+class DowntimeNameComposer : public NameComposer
{
public:
virtual String MakeName(const String& shortName, const Object::Ptr& context) const;
*
* @ingroup icinga
*/
-class I2_ICINGA_API EventCommand : public ObjectImpl<EventCommand>
+class EventCommand : public ObjectImpl<EventCommand>
{
public:
DECLARE_OBJECT(EventCommand);
size_t MaxArgs;
};
-class I2_ICINGA_API ExternalCommandProcessor {
+class ExternalCommandProcessor {
public:
static void Execute(const String& line);
static void Execute(double time, const String& command, const std::vector<String>& arguments);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Host : public ObjectImpl<Host>, public MacroResolver
+class Host : public ObjectImpl<Host>, public MacroResolver
{
public:
DECLARE_OBJECT(Host);
*
* @ingroup icinga
*/
-class I2_ICINGA_API HostGroup : public ObjectImpl<HostGroup>
+class HostGroup : public ObjectImpl<HostGroup>
{
public:
DECLARE_OBJECT(HostGroup);
#include "base/i2-base.hpp"
-#ifdef I2_ICINGA_BUILD
-# define I2_ICINGA_API I2_EXPORT
-#else /* I2_ICINGA_BUILD */
-# define I2_ICINGA_API I2_IMPORT
-#endif /* I2_ICINGA_BUILD */
-
#endif /* I2ICINGA_H */
void IcingaApplication::StaticInitialize(void)
{
- Loader::LoadExtensionLibrary("methods");
-
String node_name = Utility::GetFQDN();
if (node_name.IsEmpty()) {
*
* @ingroup icinga
*/
-class I2_ICINGA_API IcingaApplication : public ObjectImpl<IcingaApplication>, public MacroResolver
+class IcingaApplication : public ObjectImpl<IcingaApplication>, public MacroResolver
{
public:
DECLARE_OBJECT(IcingaApplication);
*
* @ingroup icinga
*/
-class I2_ICINGA_API LegacyTimePeriod
+class LegacyTimePeriod
{
public:
static Array::Ptr ScriptFunc(const TimePeriod::Ptr& tp, double start, double end);
*
* @ingroup icinga
*/
-class I2_ICINGA_API MacroProcessor
+class MacroProcessor
{
public:
typedef std::function<Value (const Value&)> EscapeCallback;
*
* @ingroup icinga
*/
-class I2_ICINGA_API MacroResolver
+class MacroResolver
{
public:
DECLARE_PTR_TYPEDEFS(MacroResolver);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Notification : public ObjectImpl<Notification>
+class Notification : public ObjectImpl<Notification>
{
public:
DECLARE_OBJECT(Notification);
static std::map<String, int> m_TypeFilterMap;
};
-I2_ICINGA_API int ServiceStateToFilter(ServiceState state);
-I2_ICINGA_API int HostStateToFilter(HostState state);
+int ServiceStateToFilter(ServiceState state);
+int HostStateToFilter(HostState state);
}
{
code {{{
-class I2_ICINGA_API NotificationNameComposer : public NameComposer
+class NotificationNameComposer : public NameComposer
{
public:
virtual String MakeName(const String& shortName, const Object::Ptr& context) const;
*
* @ingroup icinga
*/
-class I2_ICINGA_API NotificationCommand : public ObjectImpl<NotificationCommand>
+class NotificationCommand : public ObjectImpl<NotificationCommand>
{
public:
DECLARE_OBJECT(NotificationCommand);
/**
* @ingroup icinga
*/
-class I2_ICINGA_API ObjectUtils
+class ObjectUtils
{
public:
static Service::Ptr GetService(const Value& host, const String& name);
*
* @ingroup icinga
*/
-class I2_ICINGA_API PluginUtility
+class PluginUtility
{
public:
static void ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
*
* @ingroup icinga
*/
-class I2_ICINGA_API ScheduledDowntime : public ObjectImpl<ScheduledDowntime>
+class ScheduledDowntime : public ObjectImpl<ScheduledDowntime>
{
public:
DECLARE_OBJECT(ScheduledDowntime);
{
code {{{
-class I2_ICINGA_API ScheduledDowntimeNameComposer : public NameComposer
+class ScheduledDowntimeNameComposer : public NameComposer
{
public:
virtual String MakeName(const String& shortName, const Object::Ptr& context) const;
*
* @ingroup icinga
*/
-class I2_ICINGA_API Service : public ObjectImpl<Service>, public MacroResolver
+class Service : public ObjectImpl<Service>, public MacroResolver
{
public:
DECLARE_OBJECT(Service);
static bool EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule);
};
-I2_ICINGA_API std::pair<Host::Ptr, Service::Ptr> GetHostService(const Checkable::Ptr& checkable);
+std::pair<Host::Ptr, Service::Ptr> GetHostService(const Checkable::Ptr& checkable);
}
{
code {{{
-class I2_ICINGA_API ServiceNameComposer : public NameComposer
+class ServiceNameComposer : public NameComposer
{
public:
virtual String MakeName(const String& shortName, const Object::Ptr& context) const;
*
* @ingroup icinga
*/
-class I2_ICINGA_API ServiceGroup : public ObjectImpl<ServiceGroup>
+class ServiceGroup : public ObjectImpl<ServiceGroup>
{
public:
DECLARE_OBJECT(ServiceGroup);
*
* @ingroup icinga
*/
-class I2_ICINGA_API TimePeriod : public ObjectImpl<TimePeriod>
+class TimePeriod : public ObjectImpl<TimePeriod>
{
public:
DECLARE_OBJECT(TimePeriod);
*
* @ingroup icinga
*/
-class I2_ICINGA_API User : public ObjectImpl<User>
+class User : public ObjectImpl<User>
{
public:
DECLARE_OBJECT(User);
*
* @ingroup icinga
*/
-class I2_ICINGA_API UserGroup : public ObjectImpl<UserGroup>
+class UserGroup : public ObjectImpl<UserGroup>
{
public:
DECLARE_OBJECT(UserGroup);
mkunity_target(livestatus livestatus livestatus_SOURCES)
endif()
-add_library(livestatus SHARED ${livestatus_SOURCES})
+add_library(livestatus STATIC ${livestatus_SOURCES})
target_link_libraries(livestatus ${Boost_LIBRARIES} base config icinga remote)
set_target_properties (
livestatus PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_LIVESTATUS_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
install_if_not_exists(
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_RUNDIR}/icinga2/cmd\")")
-install(TARGETS livestatus RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2)
-
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
/**
* @ingroup livestatus
*/
-struct I2_LIVESTATUS_API AggregatorState
+struct AggregatorState
{
virtual ~AggregatorState(void);
};
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API Aggregator : public Object
+class Aggregator : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Aggregator);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API AndFilter : public CombinerFilter
+class AndFilter : public CombinerFilter
{
public:
DECLARE_PTR_TYPEDEFS(AndFilter);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API AttributeFilter : public Filter
+class AttributeFilter : public Filter
{
public:
DECLARE_PTR_TYPEDEFS(AttributeFilter);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API AvgAggregator : public Aggregator
+class AvgAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(AvgAggregator);
LivestatusGroupByServiceGroup
};
-class I2_LIVESTATUS_API Column
+class Column
{
public:
typedef std::function<Value (const Value&)> ValueAccessor;
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API CombinerFilter : public Filter
+class CombinerFilter : public Filter
{
public:
DECLARE_PTR_TYPEDEFS(CombinerFilter);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API CommandsTable : public Table
+class CommandsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(CommandsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API CommentsTable : public Table
+class CommentsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(CommentsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API ContactGroupsTable : public Table
+class ContactGroupsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(ContactGroupsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API ContactsTable : public Table
+class ContactsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(ContactsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API CountAggregator : public Aggregator
+class CountAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(CountAggregator);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API DowntimesTable : public Table
+class DowntimesTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(DowntimesTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API EndpointsTable : public Table
+class EndpointsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(EndpointsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API Filter : public Object
+class Filter : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Filter);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API HistoryTable : public Table
+class HistoryTable : public Table
{
public:
virtual void UpdateLogEntries(const Dictionary::Ptr& bag, int line_count, int lineno, const AddRowFunction& addRowFn);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API HostGroupsTable : public Table
+class HostGroupsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(HostGroupsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API HostsTable : public Table
+class HostsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(HostsTable);
#include "base/i2-base.hpp"
-#ifdef I2_LIVESTATUS_BUILD
-# define I2_LIVESTATUS_API I2_EXPORT
-#else /* I2_LIVESTATUS_BUILD */
-# define I2_LIVESTATUS_API I2_IMPORT
-#endif /* I2_LIVESTATUS_BUILD */
-
#endif /* I2LIVESTATUS_H */
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API InvAvgAggregator : public Aggregator
+class InvAvgAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(InvAvgAggregator);
/**
* @ingroup livestatus
*/
-struct I2_LIVESTATUS_API InvSumAggregatorState : public AggregatorState
+struct InvSumAggregatorState : public AggregatorState
{
InvSumAggregatorState(void)
: InvSum(0)
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API InvSumAggregator : public Aggregator
+class InvSumAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(InvSumAggregator);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API LivestatusListener : public ObjectImpl<LivestatusListener>
+class LivestatusListener : public ObjectImpl<LivestatusListener>
{
public:
DECLARE_OBJECT(LivestatusListener);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API LivestatusLogUtility
+class LivestatusLogUtility
{
public:
static void CreateLogIndex(const String& path, std::map<time_t, String>& index);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API LivestatusQuery : public Object
+class LivestatusQuery : public Object
{
public:
DECLARE_PTR_TYPEDEFS(LivestatusQuery);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API LogTable : public HistoryTable
+class LogTable : public HistoryTable
{
public:
DECLARE_PTR_TYPEDEFS(LogTable);
/**
* @ingroup livestatus
*/
-struct I2_LIVESTATUS_API MaxAggregatorState : public AggregatorState
+struct MaxAggregatorState : public AggregatorState
{
MaxAggregatorState(void)
: Max(0)
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API MaxAggregator : public Aggregator
+class MaxAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(MaxAggregator);
/**
* @ingroup livestatus
*/
-struct I2_LIVESTATUS_API MinAggregatorState : public AggregatorState
+struct MinAggregatorState : public AggregatorState
{
MinAggregatorState(void)
: Min(DBL_MAX)
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API MinAggregator : public Aggregator
+class MinAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(MinAggregator);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API NegateFilter : public Filter
+class NegateFilter : public Filter
{
public:
DECLARE_PTR_TYPEDEFS(NegateFilter);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API OrFilter : public CombinerFilter
+class OrFilter : public CombinerFilter
{
public:
DECLARE_PTR_TYPEDEFS(OrFilter);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API ServiceGroupsTable : public Table
+class ServiceGroupsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(ServiceGroupsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API ServicesTable : public Table
+class ServicesTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(ServicesTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API StateHistTable : public HistoryTable
+class StateHistTable : public HistoryTable
{
public:
DECLARE_PTR_TYPEDEFS(StateHistTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API StatusTable : public Table
+class StatusTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(StatusTable);
/**
* @ingroup livestatus
*/
-struct I2_LIVESTATUS_API StdAggregatorState : public AggregatorState
+struct StdAggregatorState : public AggregatorState
{
StdAggregatorState(void)
: StdSum(0), StdQSum(0), StdCount(0)
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API StdAggregator : public Aggregator
+class StdAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(StdAggregator);
/**
* @ingroup livestatus
*/
-struct I2_LIVESTATUS_API SumAggregatorState : public AggregatorState
+struct SumAggregatorState : public AggregatorState
{
SumAggregatorState(void)
: Sum(0)
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API SumAggregator : public Aggregator
+class SumAggregator : public Aggregator
{
public:
DECLARE_PTR_TYPEDEFS(SumAggregator);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API Table : public Object
+class Table : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Table);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API TimePeriodsTable : public Table
+class TimePeriodsTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(TimePeriodsTable);
/**
* @ingroup livestatus
*/
-class I2_LIVESTATUS_API ZonesTable : public Table
+class ZonesTable : public Table
{
public:
DECLARE_PTR_TYPEDEFS(ZonesTable);
mkunity_target(methods methods methods_SOURCES)
endif()
-add_library(methods SHARED ${methods_SOURCES})
+add_library(methods STATIC ${methods_SOURCES})
target_link_libraries(methods ${Boost_LIBRARIES} base config icinga)
set_target_properties (
methods PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_METHODS_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
-
-install(
- TARGETS methods
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-
*
* @ingroup methods
*/
-class I2_METHODS_API ClrCheckTask
+class ClrCheckTask
{
public:
static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
*
* @ingroup methods
*/
-class I2_METHODS_API DummyCheckTask
+class DummyCheckTask
{
public:
static void ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
#include "base/i2-base.hpp"
-#ifdef I2_METHODS_BUILD
-# define I2_METHODS_API I2_EXPORT
-#else /* I2_METHODS_BUILD */
-# define I2_METHODS_API I2_IMPORT
-#endif /* I2_METHODS_BUILD */
-
#endif /* I2METHODS_H */
*
* @ingroup methods
*/
-class I2_METHODS_API IcingaCheckTask
+class IcingaCheckTask
{
public:
static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
*
* @ingroup methods
*/
-class I2_METHODS_API NullCheckTask
+class NullCheckTask
{
public:
static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
*
* @ingroup methods
*/
-class I2_METHODS_API NullEventTask
+class NullEventTask
{
public:
static void ScriptFunc(const Checkable::Ptr& service,
*
* @ingroup methods
*/
-class I2_METHODS_API PluginCheckTask
+class PluginCheckTask
{
public:
static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
*
* @ingroup methods
*/
-class I2_METHODS_API PluginEventTask
+class PluginEventTask
{
public:
static void ScriptFunc(const Checkable::Ptr& service,
*
* @ingroup methods
*/
-class I2_METHODS_API PluginNotificationTask
+class PluginNotificationTask
{
public:
static void ScriptFunc(const Notification::Ptr& notification,
mkunity_target(notification notification notification_SOURCES)
endif()
-add_library(notification SHARED ${notification_SOURCES})
+add_library(notification STATIC ${notification_SOURCES})
target_link_libraries(notification ${Boost_LIBRARIES} base config icinga)
set_target_properties (
notification PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_NOTIFICATION_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
install_if_not_exists(
install_if_not_exists(${PROJECT_SOURCE_DIR}/etc/icinga2/features-enabled/notification.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-enabled)
endif()
-install(TARGETS notification RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2)
-
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)
mkunity_target(perfdata perfdata perfdata_SOURCES)
endif()
-add_library(perfdata SHARED ${perfdata_SOURCES})
+add_library(perfdata STATIC ${perfdata_SOURCES})
target_link_libraries(perfdata ${Boost_LIBRARIES} base config icinga)
set_target_properties (
perfdata PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_PERFDATA_BUILD
FOLDER Components
- VERSION ${SPEC_VERSION}
)
install_if_not_exists(
${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
)
-install(
- TARGETS perfdata
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2/perfdata\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2/tmp\")")
mkunity_target(remote remote remote_SOURCES)
endif()
-add_library(remote SHARED ${remote_SOURCES})
+add_library(remote STATIC ${remote_SOURCES})
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(remote ${Boost_LIBRARIES} base config)
set_target_properties (
remote PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL I2_REMOTE_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
-install(
- TARGETS remote
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-if(APPLE)
- install(
- TARGETS remote
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
- )
-endif()
-
#install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/icinga2/api\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/icinga2/api/log\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/icinga2/api/zones\")")
namespace icinga
{
-class I2_REMOTE_API ActionsHandler : public HttpHandler
+class ActionsHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(ActionsHandler);
*
* @ingroup remote
*/
-class I2_REMOTE_API ApiAction : public Object
+class ApiAction : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ApiAction);
*
* @ingroup remote
*/
-class I2_REMOTE_API ApiActionRegistry : public Registry<ApiActionRegistry, ApiAction::Ptr>
+class ApiActionRegistry : public Registry<ApiActionRegistry, ApiAction::Ptr>
{
public:
static ApiActionRegistry *GetInstance(void);
intrusive_ptr<ApiType> Type;
};
-class I2_REMOTE_API ApiType : public Object
+class ApiType : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ApiType);
String Type;
};
-struct I2_REMOTE_API ApiObject : public Object
+struct ApiObject : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ApiObject);
std::vector<ApiObjectReference> UsedBy;
};
-class I2_REMOTE_API ApiClient : public Object
+class ApiClient : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ApiClient);
*
* @ingroup base
*/
-class I2_REMOTE_API ApiFunction : public Object
+class ApiFunction : public Object
{
public:
DECLARE_PTR_TYPEDEFS(ApiFunction);
*
* @ingroup base
*/
-class I2_REMOTE_API ApiFunctionRegistry : public Registry<ApiFunctionRegistry, ApiFunction::Ptr>
+class ApiFunctionRegistry : public Registry<ApiFunctionRegistry, ApiFunction::Ptr>
{
public:
static ApiFunctionRegistry *GetInstance(void);
/**
* @ingroup remote
*/
-class I2_REMOTE_API ApiListener : public ObjectImpl<ApiListener>
+class ApiListener : public ObjectImpl<ApiListener>
{
public:
DECLARE_OBJECT(ApiListener);
/**
* @ingroup remote
*/
-class I2_REMOTE_API ApiUser : public ObjectImpl<ApiUser>
+class ApiUser : public ObjectImpl<ApiUser>
{
public:
DECLARE_OBJECT(ApiUser);
namespace icinga
{
-class I2_REMOTE_API ConfigFilesHandler : public HttpHandler
+class ConfigFilesHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(ConfigFilesHandler);
*
* @ingroup remote
*/
-class I2_REMOTE_API ConfigObjectUtility
+class ConfigObjectUtility
{
public:
namespace icinga
{
-class I2_REMOTE_API ConfigPackagesHandler : public HttpHandler
+class ConfigPackagesHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(ConfigPackagesHandler);
*
* @ingroup remote
*/
-class I2_REMOTE_API ConfigPackageUtility
+class ConfigPackageUtility
{
public:
namespace icinga
{
-class I2_REMOTE_API ConfigStagesHandler : public HttpHandler
+class ConfigStagesHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(ConfigStagesHandler);
namespace icinga
{
-struct I2_REMOTE_API ApiScriptFrame
+struct ApiScriptFrame
{
double Seen;
int NextLine;
{ }
};
-class I2_REMOTE_API ConsoleHandler : public HttpHandler
+class ConsoleHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(ConsoleHandler);
namespace icinga
{
-class I2_REMOTE_API CreateObjectHandler : public HttpHandler
+class CreateObjectHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(CreateObjectHandler);
namespace icinga
{
-class I2_REMOTE_API DeleteObjectHandler : public HttpHandler
+class DeleteObjectHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(DeleteObjectHandler);
*
* @ingroup remote
*/
-class I2_REMOTE_API Endpoint : public ObjectImpl<Endpoint>
+class Endpoint : public ObjectImpl<Endpoint>
{
public:
DECLARE_OBJECT(Endpoint);
namespace icinga
{
-class I2_REMOTE_API EventQueue : public Object
+class EventQueue : public Object
{
public:
DECLARE_PTR_TYPEDEFS(EventQueue);
*
* @ingroup base
*/
-class I2_REMOTE_API EventQueueRegistry : public Registry<EventQueueRegistry, EventQueue::Ptr>
+class EventQueueRegistry : public Registry<EventQueueRegistry, EventQueue::Ptr>
{
public:
static EventQueueRegistry *GetInstance(void);
namespace icinga
{
-class I2_REMOTE_API EventsHandler : public HttpHandler
+class EventsHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(EventsHandler);
*
* @ingroup remote
*/
-class I2_REMOTE_API FilterUtility
+class FilterUtility
{
public:
static Type::Ptr TypeFromPluralName(const String& pluralName);
*
* @ingroup remote
*/
-struct I2_REMOTE_API HttpChunkedEncoding
+struct HttpChunkedEncoding
{
static StreamReadStatus ReadChunkFromStream(const Stream::Ptr& stream,
char **data, size_t *size, ChunkReadContext& ccontext, bool may_wait = false);
*
* @ingroup remote
*/
-class I2_REMOTE_API HttpClientConnection : public Object
+class HttpClientConnection : public Object
{
public:
DECLARE_PTR_TYPEDEFS(HttpClientConnection);
*
* @ingroup remote
*/
-class I2_REMOTE_API HttpHandler : public Object
+class HttpHandler : public Object
{
public:
DECLARE_PTR_TYPEDEFS(HttpHandler);
*
* @ingroup remote
*/
-class I2_REMOTE_API RegisterHttpHandler
+class RegisterHttpHandler
{
public:
RegisterHttpHandler(const String& url, const HttpHandler& function);
*
* @ingroup remote
*/
-struct I2_REMOTE_API HttpRequest
+struct HttpRequest
{
public:
bool Complete;
*
* @ingroup remote
*/
-struct I2_REMOTE_API HttpResponse
+struct HttpResponse
{
public:
bool Complete;
*
* @ingroup remote
*/
-class I2_REMOTE_API HttpServerConnection : public Object
+class HttpServerConnection : public Object
{
public:
DECLARE_PTR_TYPEDEFS(HttpServerConnection);
*
* @ingroup remote
*/
-class I2_REMOTE_API HttpUtility
+class HttpUtility
{
public:
#include "base/i2-base.hpp"
-#ifdef I2_REMOTE_BUILD
-# define I2_REMOTE_API I2_EXPORT
-#else /* I2_REMOTE_BUILD */
-# define I2_REMOTE_API I2_IMPORT
-#endif /* I2_REMOTE_BUILD */
-
#endif /* I2REMOTE_H */
namespace icinga
{
-class I2_REMOTE_API InfoHandler : public HttpHandler
+class InfoHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(InfoHandler);
*
* @ingroup remote
*/
-class I2_REMOTE_API JsonRpc
+class JsonRpc
{
public:
static size_t SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message);
*
* @ingroup remote
*/
-class I2_REMOTE_API JsonRpcConnection : public Object
+class JsonRpcConnection : public Object
{
public:
DECLARE_PTR_TYPEDEFS(JsonRpcConnection);
/**
* @ingroup remote
*/
-class I2_REMOTE_API MessageOrigin : public Object
+class MessageOrigin : public Object
{
public:
DECLARE_PTR_TYPEDEFS(MessageOrigin);
namespace icinga
{
-class I2_REMOTE_API ModifyObjectHandler : public HttpHandler
+class ModifyObjectHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(ModifyObjectHandler);
namespace icinga
{
-class I2_REMOTE_API ObjectQueryHandler : public HttpHandler
+class ObjectQueryHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(ObjectQueryHandler);
/**
* @ingroup remote
*/
-class I2_REMOTE_API PkiUtility
+class PkiUtility
{
public:
static int NewCa(void);
namespace icinga
{
-class I2_REMOTE_API StatusHandler : public HttpHandler
+class StatusHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(StatusHandler);
namespace icinga
{
-class I2_REMOTE_API TemplateQueryHandler : public HttpHandler
+class TemplateQueryHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(TemplateQueryHandler);
namespace icinga
{
-class I2_REMOTE_API TypeQueryHandler : public HttpHandler
+class TypeQueryHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(TypeQueryHandler);
*
* @ingroup base
*/
-class I2_REMOTE_API Url : public Object
+class Url : public Object
{
public:
DECLARE_PTR_TYPEDEFS(Url);
namespace icinga
{
-class I2_REMOTE_API VariableQueryHandler : public HttpHandler
+class VariableQueryHandler : public HttpHandler
{
public:
DECLARE_PTR_TYPEDEFS(VariableQueryHandler);
/**
* @ingroup remote
*/
-class I2_REMOTE_API Zone : public ObjectImpl<Zone>
+class Zone : public ObjectImpl<Zone>
{
public:
DECLARE_OBJECT(Zone);
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
add_executable ( check_nscp_api check_nscp_api.cpp )
-target_link_libraries ( check_nscp_api ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY} base remote )
+target_link_libraries ( check_nscp_api ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY})
+add_whole_static_library(check_nscp_api base)
+add_whole_static_library(check_nscp_api config)
+add_whole_static_library(check_nscp_api remote)
set_target_properties (
check_nscp_api PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
add_boost_test(base
SOURCES test-runner.cpp ${base_test_SOURCES}
- LIBRARIES base config icinga
TESTS base_array/construct
base_array/getset
base_array/resize
remote_url/illegal_legal_strings
)
+add_whole_static_library(${base_TARGET_NAME} base)
+add_whole_static_library(${base_TARGET_NAME} config)
+add_whole_static_library(${base_TARGET_NAME} icinga)
+
if(ICINGA2_WITH_LIVESTATUS)
set(livestatus_test_SOURCES
livestatus.cpp
add_boost_test(livestatus
SOURCES test-runner.cpp livestatus-fixture.cpp ${livestatus_test_SOURCES}
- LIBRARIES base config icinga livestatus
- DEPENDENCIES methods
TESTS livestatus/hosts livestatus/services
)
+
+ add_whole_static_library(${livestatus_TARGET_NAME} base)
+ add_whole_static_library(${livestatus_TARGET_NAME} config)
+ add_whole_static_library(${livestatus_TARGET_NAME} icinga)
+ add_whole_static_library(${livestatus_TARGET_NAME} livestatus)
+ add_whole_static_library(${livestatus_TARGET_NAME} methods)
endif()
set(icinga_checkable_test_SOURCES
add_boost_test(icinga_checkable
SOURCES test-runner.cpp icinga-checkable-test.cpp ${icinga_checkable_test_SOURCES}
- LIBRARIES base config icinga cli
TESTS icinga_checkable_flapping/host_not_flapping
icinga_checkable_flapping/host_flapping
icinga_checkable_flapping/host_flapping_recover
icinga_checkable_flapping/host_flapping_docs_example
)
+add_whole_static_library(${icinga_checkable_TARGET_NAME} base)
+add_whole_static_library(${icinga_checkable_TARGET_NAME} config)
+add_whole_static_library(${icinga_checkable_TARGET_NAME} icinga)
+add_whole_static_library(${icinga_checkable_TARGET_NAME} cli)
# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-add_library(execvpe SHARED execvpe.c execvpe.h)
+add_library(execvpe STATIC execvpe.c execvpe.h)
set_target_properties (
execvpe PROPERTIES
- DEFINE_SYMBOL I2_EXECVPE_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
-
-install(
- TARGETS execvpe
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-if(APPLE)
- install(
- TARGETS execvpe
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
- )
-endif()
#ifndef EXECVPE_H
#define EXECVPE_H
-#include "base/visibility.hpp"
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#ifdef I2_EXECVPE_BUILD
-# define I2_EXECVPE_API I2_EXPORT
-#else
-# define I2_EXECVPE_API I2_IMPORT
-#endif /* I2_EXECVPE_BUILD */
-
#ifndef _MSC_VER
-I2_EXECVPE_API int icinga2_execvpe(const char *file, char *const argv[], char *const envp[]);
+int icinga2_execvpe(const char *file, char *const argv[], char *const envp[]);
#endif /* _MSC_VER */
#ifdef __cplusplus
# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-add_library(mmatch SHARED mmatch.c mmatch.h)
+add_library(mmatch STATIC mmatch.c mmatch.h)
set_target_properties(
mmatch PROPERTIES
- DEFINE_SYMBOL I2_MMATCH_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
-
-install(
- TARGETS mmatch
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-if(APPLE)
- install(
- TARGETS mmatch
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
- )
-endif()
#ifndef MMATCH_H
#define MMATCH_H
-#include "base/visibility.hpp"
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#ifdef I2_MMATCH_BUILD
-# define I2_MMATCH_API I2_EXPORT
-#else
-# define I2_MMATCH_API I2_IMPORT
-#endif /* I2_MMATCH_BUILD */
-
-I2_MMATCH_API int mmatch(const char *old_mask, const char *new_mask);
-I2_MMATCH_API int match(const char *mask, const char *str);
-I2_MMATCH_API char *collapse(char *pattern);
+int mmatch(const char *old_mask, const char *new_mask);
+int match(const char *mask, const char *str);
+char *collapse(char *pattern);
#ifdef __cplusplus
}
# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-add_library(socketpair SHARED socketpair.c socketpair.h)
+add_library(socketpair STATIC socketpair.c socketpair.h)
set_target_properties (
socketpair PROPERTIES
- DEFINE_SYMBOL I2_SOCKETPAIR_BUILD
FOLDER Lib
- VERSION ${SPEC_VERSION}
)
if(WIN32)
target_link_libraries(socketpair ws2_32)
endif()
-
-install(
- TARGETS socketpair
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
-)
-
-if(APPLE)
- install(
- TARGETS socketpair
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
- )
-endif()
#ifndef SOCKETPAIR_H
#define SOCKETPAIR_H
-#include "base/visibility.hpp"
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#ifdef I2_SOCKETPAIR_BUILD
-# define I2_SOCKETPAIR_API I2_EXPORT
-#else
-# define I2_SOCKETPAIR_API I2_IMPORT
-#endif /* I2_SOCKETPAIR_BUILD */
-
#ifdef _WIN32
-I2_SOCKETPAIR_API int dumb_socketpair(SOCKET socks[2], int make_overlapped);
+int dumb_socketpair(SOCKET socks[2], int make_overlapped);
#else /* _WIN32 */
-I2_SOCKETPAIR_API int dumb_socketpair(int socks[2], int dummy);
+int dumb_socketpair(int socks[2], int dummy);
#endif
#ifdef __cplusplus
# set up some paths
SET (incDir ${CMAKE_CURRENT_BINARY_DIR}/../include/yajl)
-ADD_LIBRARY(yajl SHARED ${SRCS} ${HDRS} ${PUB_HDRS})
+ADD_LIBRARY(yajl STATIC ${SRCS} ${HDRS} ${PUB_HDRS})
#### setup shared library version number
-SET_TARGET_PROPERTIES(yajl PROPERTIES
- INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
- DEFINE_SYMBOL YAJL_SHARED
- SOVERSION ${YAJL_MAJOR}
- VERSION ${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO}
- FOLDER Lib)
+SET_TARGET_PROPERTIES(yajl
+ PROPERTIES
+ FOLDER Lib
+)
#### build up an sdk as a post build step
ENDFOREACH (header ${PUB_HDRS})
INCLUDE_DIRECTORIES(${incDir}/..)
-
-INSTALL(TARGETS yajl
- RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2)
-
-if(APPLE)
- install(
- TARGETS yajl
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
- )
-endif()
void ClassCompiler::HandleLibrary(const std::string& library, const ClassDebugInfo&)
{
m_Library = library;
-
- std::string libName = m_Library;
- std::locale locale;
-
- for (auto& ch : libName)
- ch = std::toupper(ch, locale);
-
- m_Header << "#ifndef I2_" << libName << "_API" << std::endl
- << "# ifdef I2_" << libName << "_BUILD" << std::endl
- << "# define I2_" << libName << "_API I2_EXPORT" << std::endl
- << "# else /* I2_" << libName << "_BUILD */" << std::endl
- << "# define I2_" << libName << "_API I2_IMPORT" << std::endl
- << "# endif /* I2_" << libName << "_BUILD */" << std::endl
- << "#endif /* I2_" << libName << "_API */" << std::endl << std::endl;
}
unsigned long ClassCompiler::SDBM(const std::string& str, size_t len = std::string::npos)
void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
{
- std::string apiMacro;
-
- if (!m_Library.empty()) {
- std::string libName = m_Library;
- std::locale locale;
-
- for (auto& ch : libName)
- ch = std::toupper(ch, locale);
-
- apiMacro = "I2_" + libName + "_API ";
- }
-
/* forward declaration */
if (klass.Name.find_first_of(':') == std::string::npos)
m_Header << "class " << klass.Name << ";" << std::endl << std::endl;
/* TypeImpl */
m_Header << "template<>" << std::endl
- << "class " << apiMacro << "TypeImpl<" << klass.Name << ">"
+ << "class TypeImpl<" << klass.Name << ">"
<< " : public Type";
if (!klass.Parent.empty())
/* ObjectImpl */
m_Header << "template<>" << std::endl
- << "class " << apiMacro << "ObjectImpl<" << klass.Name << ">"
+ << "class ObjectImpl<" << klass.Name << ">"
<< " : public " << (klass.Parent.empty() ? "Object" : klass.Parent) << std::endl
<< "{" << std::endl
<< "public:" << std::endl