From 90496b5456b98ad4f9e0121272ccabfbbef11a91 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 31 Dec 2017 07:22:16 +0100 Subject: [PATCH] Build libraries as static libraries --- CMakeLists.txt | 43 +++--- icinga-app/CMakeLists.txt | 69 ++++++++- icinga-app/icinga.cpp | 26 ---- icinga-studio/CMakeLists.txt | 4 +- lib/base/CMakeLists.txt | 18 +-- lib/base/application.hpp | 2 +- lib/base/array.hpp | 2 +- lib/base/base64.hpp | 2 +- lib/base/boolean.hpp | 2 +- lib/base/configobject.hpp | 2 +- lib/base/configobject.ti | 4 +- lib/base/configtype.hpp | 2 +- lib/base/configwriter.hpp | 4 +- lib/base/console.hpp | 8 +- lib/base/context.hpp | 6 +- lib/base/convert.hpp | 2 +- lib/base/datetime.hpp | 2 +- lib/base/debuginfo.hpp | 8 +- lib/base/dependencygraph.hpp | 2 +- lib/base/dictionary.hpp | 2 +- lib/base/exception.cpp | 2 +- lib/base/exception.hpp | 24 +-- lib/base/fifo.hpp | 2 +- lib/base/filelogger.hpp | 2 +- lib/base/function.hpp | 2 +- lib/base/i2-base.hpp | 8 - lib/base/initialize.hpp | 6 +- lib/base/json.hpp | 4 +- lib/base/loader.cpp | 42 ------ lib/base/loader.hpp | 4 +- lib/base/logger.hpp | 4 +- lib/base/netstring.hpp | 2 +- lib/base/networkstream.hpp | 2 +- lib/base/number.hpp | 2 +- lib/base/object.hpp | 10 +- lib/base/objectlock.hpp | 2 +- lib/base/objecttype.hpp | 2 +- lib/base/perfdatavalue.hpp | 2 +- lib/base/primitivetype.hpp | 2 +- lib/base/process.hpp | 2 +- lib/base/ringbuffer.hpp | 2 +- lib/base/scriptframe.hpp | 2 +- lib/base/scriptglobal.hpp | 2 +- lib/base/scriptutils.hpp | 2 +- lib/base/serializer.hpp | 6 +- lib/base/socket.hpp | 2 +- lib/base/socketevents.hpp | 8 +- lib/base/stacktrace.hpp | 4 +- lib/base/stdiostream.hpp | 2 +- lib/base/stream.hpp | 4 +- lib/base/streamlogger.hpp | 2 +- lib/base/string.hpp | 2 +- lib/base/sysloglogger.hpp | 2 +- lib/base/tcpsocket.hpp | 2 +- lib/base/threadpool.hpp | 2 +- lib/base/timer.hpp | 2 +- lib/base/tlsstream.cpp | 4 +- lib/base/tlsstream.hpp | 2 +- lib/base/tlsutility.hpp | 40 ++--- lib/base/type.hpp | 6 +- lib/base/unixsocket.hpp | 2 +- lib/base/utility.hpp | 2 +- lib/base/value.hpp | 190 ++++++++++++------------ lib/base/visibility.hpp | 32 ---- lib/base/workqueue.hpp | 2 +- lib/checker/CMakeLists.txt | 11 +- lib/cli/CMakeLists.txt | 11 +- lib/cli/apisetuputility.hpp | 2 +- lib/cli/clicommand.hpp | 6 +- lib/cli/daemonutility.hpp | 2 +- lib/cli/featureutility.hpp | 2 +- lib/cli/i2-cli.hpp | 6 - lib/cli/nodeutility.hpp | 2 +- lib/cli/objectlistutility.hpp | 2 +- lib/cli/variableutility.hpp | 2 +- lib/compat/CMakeLists.txt | 7 +- lib/config/CMakeLists.txt | 20 +-- lib/config/activationcontext.hpp | 4 +- lib/config/applyrule.hpp | 2 +- lib/config/configcompiler.hpp | 2 +- lib/config/configcompilercontext.hpp | 2 +- lib/config/configitem.hpp | 2 +- lib/config/configitembuilder.hpp | 2 +- lib/config/expression.cpp | 4 +- lib/config/expression.hpp | 116 +++++++-------- lib/config/i2-config.hpp | 6 - lib/config/objectrule.hpp | 2 +- lib/db_ido/CMakeLists.txt | 11 +- lib/db_ido/dbconnection.hpp | 2 +- lib/db_ido/dbobject.hpp | 2 +- lib/db_ido/dbquery.hpp | 2 +- lib/db_ido/dbreference.hpp | 2 +- lib/db_ido/dbtype.hpp | 4 +- lib/db_ido/dbvalue.hpp | 2 +- lib/db_ido/i2-db_ido.hpp | 6 - lib/db_ido_mysql/CMakeLists.txt | 13 +- lib/db_ido_pgsql/CMakeLists.txt | 16 +- lib/demo/CMakeLists.txt | 12 +- lib/hello/CMakeLists.txt | 12 +- lib/icinga/CMakeLists.txt | 13 +- lib/icinga/apiactions.hpp | 2 +- lib/icinga/apievents.hpp | 2 +- lib/icinga/checkable.hpp | 2 +- lib/icinga/checkcommand.hpp | 2 +- lib/icinga/checkresult.hpp | 2 +- lib/icinga/cib.hpp | 2 +- lib/icinga/clusterevents.hpp | 2 +- lib/icinga/command.hpp | 2 +- lib/icinga/comment.hpp | 2 +- lib/icinga/comment.ti | 2 +- lib/icinga/compatutility.hpp | 2 +- lib/icinga/customvarobject.hpp | 4 +- lib/icinga/dependency.hpp | 2 +- lib/icinga/dependency.ti | 2 +- lib/icinga/downtime.hpp | 2 +- lib/icinga/downtime.ti | 2 +- lib/icinga/eventcommand.hpp | 2 +- lib/icinga/externalcommandprocessor.hpp | 2 +- lib/icinga/host.hpp | 2 +- lib/icinga/hostgroup.hpp | 2 +- lib/icinga/i2-icinga.hpp | 6 - lib/icinga/icingaapplication.cpp | 2 - lib/icinga/icingaapplication.hpp | 2 +- lib/icinga/legacytimeperiod.hpp | 2 +- lib/icinga/macroprocessor.hpp | 2 +- lib/icinga/macroresolver.hpp | 2 +- lib/icinga/notification.hpp | 6 +- lib/icinga/notification.ti | 2 +- lib/icinga/notificationcommand.hpp | 2 +- lib/icinga/objectutils.hpp | 2 +- lib/icinga/pluginutility.hpp | 2 +- lib/icinga/scheduleddowntime.hpp | 2 +- lib/icinga/scheduleddowntime.ti | 2 +- lib/icinga/service.hpp | 4 +- lib/icinga/service.ti | 2 +- lib/icinga/servicegroup.hpp | 2 +- lib/icinga/timeperiod.hpp | 2 +- lib/icinga/user.hpp | 2 +- lib/icinga/usergroup.hpp | 2 +- lib/livestatus/CMakeLists.txt | 7 +- lib/livestatus/aggregator.hpp | 4 +- lib/livestatus/andfilter.hpp | 2 +- lib/livestatus/attributefilter.hpp | 2 +- lib/livestatus/avgaggregator.hpp | 2 +- lib/livestatus/column.hpp | 2 +- lib/livestatus/combinerfilter.hpp | 2 +- lib/livestatus/commandstable.hpp | 2 +- lib/livestatus/commentstable.hpp | 2 +- lib/livestatus/contactgroupstable.hpp | 2 +- lib/livestatus/contactstable.hpp | 2 +- lib/livestatus/countaggregator.hpp | 2 +- lib/livestatus/downtimestable.hpp | 2 +- lib/livestatus/endpointstable.hpp | 2 +- lib/livestatus/filter.hpp | 2 +- lib/livestatus/historytable.hpp | 2 +- lib/livestatus/hostgroupstable.hpp | 2 +- lib/livestatus/hoststable.hpp | 2 +- lib/livestatus/i2-livestatus.hpp | 6 - lib/livestatus/invavgaggregator.hpp | 2 +- lib/livestatus/invsumaggregator.hpp | 4 +- lib/livestatus/livestatuslistener.hpp | 2 +- lib/livestatus/livestatuslogutility.hpp | 2 +- lib/livestatus/livestatusquery.hpp | 2 +- lib/livestatus/logtable.hpp | 2 +- lib/livestatus/maxaggregator.hpp | 4 +- lib/livestatus/minaggregator.hpp | 4 +- lib/livestatus/negatefilter.hpp | 2 +- lib/livestatus/orfilter.hpp | 2 +- lib/livestatus/servicegroupstable.hpp | 2 +- lib/livestatus/servicestable.hpp | 2 +- lib/livestatus/statehisttable.hpp | 2 +- lib/livestatus/statustable.hpp | 2 +- lib/livestatus/stdaggregator.hpp | 4 +- lib/livestatus/sumaggregator.hpp | 4 +- lib/livestatus/table.hpp | 2 +- lib/livestatus/timeperiodstable.hpp | 2 +- lib/livestatus/zonestable.hpp | 2 +- lib/methods/CMakeLists.txt | 13 +- lib/methods/clrchecktask.hpp | 2 +- lib/methods/dummychecktask.hpp | 2 +- lib/methods/i2-methods.hpp | 6 - lib/methods/icingachecktask.hpp | 2 +- lib/methods/nullchecktask.hpp | 2 +- lib/methods/nulleventtask.hpp | 2 +- lib/methods/pluginchecktask.hpp | 2 +- lib/methods/plugineventtask.hpp | 2 +- lib/methods/pluginnotificationtask.hpp | 2 +- lib/notification/CMakeLists.txt | 7 +- lib/perfdata/CMakeLists.txt | 11 +- lib/remote/CMakeLists.txt | 18 +-- lib/remote/actionshandler.hpp | 2 +- lib/remote/apiaction.hpp | 4 +- lib/remote/apiclient.hpp | 6 +- lib/remote/apifunction.hpp | 4 +- lib/remote/apilistener.hpp | 2 +- lib/remote/apiuser.hpp | 2 +- lib/remote/configfileshandler.hpp | 2 +- lib/remote/configobjectutility.hpp | 2 +- lib/remote/configpackageshandler.hpp | 2 +- lib/remote/configpackageutility.hpp | 2 +- lib/remote/configstageshandler.hpp | 2 +- lib/remote/consolehandler.hpp | 4 +- lib/remote/createobjecthandler.hpp | 2 +- lib/remote/deleteobjecthandler.hpp | 2 +- lib/remote/endpoint.hpp | 2 +- lib/remote/eventqueue.hpp | 4 +- lib/remote/eventshandler.hpp | 2 +- lib/remote/filterutility.hpp | 2 +- lib/remote/httpchunkedencoding.hpp | 2 +- lib/remote/httpclientconnection.hpp | 2 +- lib/remote/httphandler.hpp | 4 +- lib/remote/httprequest.hpp | 2 +- lib/remote/httpresponse.hpp | 2 +- lib/remote/httpserverconnection.hpp | 2 +- lib/remote/httputility.hpp | 2 +- lib/remote/i2-remote.hpp | 6 - lib/remote/infohandler.hpp | 2 +- lib/remote/jsonrpc.hpp | 2 +- lib/remote/jsonrpcconnection.hpp | 2 +- lib/remote/messageorigin.hpp | 2 +- lib/remote/modifyobjecthandler.hpp | 2 +- lib/remote/objectqueryhandler.hpp | 2 +- lib/remote/pkiutility.hpp | 2 +- lib/remote/statushandler.hpp | 2 +- lib/remote/templatequeryhandler.hpp | 2 +- lib/remote/typequeryhandler.hpp | 2 +- lib/remote/url.hpp | 2 +- lib/remote/variablequeryhandler.hpp | 2 +- lib/remote/zone.hpp | 2 +- plugins/CMakeLists.txt | 5 +- test/CMakeLists.txt | 18 ++- third-party/execvpe/CMakeLists.txt | 17 +-- third-party/execvpe/execvpe.h | 10 +- third-party/mmatch/CMakeLists.txt | 17 +-- third-party/mmatch/mmatch.h | 14 +- third-party/socketpair/CMakeLists.txt | 17 +-- third-party/socketpair/socketpair.h | 12 +- third-party/yajl/src/CMakeLists.txt | 23 +-- tools/mkclass/classcompiler.cpp | 30 +--- 239 files changed, 577 insertions(+), 914 deletions(-) delete mode 100644 lib/base/visibility.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fdf75d307..30116a6c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ # 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) @@ -139,6 +139,13 @@ set(HAVE_EDITLINE "${EDITLINE_FOUND}") 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 @@ -172,12 +179,28 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") 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) @@ -238,26 +261,10 @@ if(ICINGA2_LTO_BUILD) 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() diff --git a/icinga-app/CMakeLists.txt b/icinga-app/CMakeLists.txt index b2d7d6e4e..a6747fb4b 100644 --- a/icinga-app/CMakeLists.txt +++ b/icinga-app/CMakeLists.txt @@ -21,10 +21,54 @@ else() 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 $) + +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 @@ -52,6 +96,27 @@ install( RUNTIME DESTINATION ${InstallPath} ) +if(ICINGA2_WITH_HELLO) + add_executable(hello-app $) + 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\")") diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index 0a25e691e..0e8d93f35 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -194,8 +194,6 @@ static int Main(void) LogSeverity logLevel = Logger::GetConsoleLogSeverity(); Logger::SetConsoleLogSeverity(LogWarning); - Loader::LoadExtensionLibrary("cli"); - po::options_description visibleDesc("Global options"); visibleDesc.add_options() @@ -205,8 +203,6 @@ static int Main(void) ("color", "use VT100 color codes even when stdout is not a terminal") #endif /* _WIN32 */ ("define,D", po::value >(), "define a constant") - ("app,a", po::value(), "application library name (default: icinga)") - ("library,l", po::value >(), "load a library") ("include,I", po::value >(), "add include search directory") ("log-level,x", po::value(), "specify the log level for the console log.\n" "The valid value is either debug, notice, information (default), warning, or critical") @@ -359,18 +355,6 @@ static int Main(void) Logger::SetConsoleLogSeverity(logLevel); } - if (vm.count("library")) { - for (const String& libraryName : vm["library"].as >()) { - 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; @@ -544,16 +528,6 @@ static int Main(void) return EXIT_FAILURE; } - LogSeverity logLevel = Logger::GetConsoleLogSeverity(); - Logger::SetConsoleLogSeverity(LogWarning); - - if (vm.count("app")) - Loader::LoadExtensionLibrary(vm["app"].as()); - else - Loader::LoadExtensionLibrary("icinga"); - - Logger::SetConsoleLogSeverity(logLevel); - rc = command->Run(vm, args); } diff --git a/icinga-studio/CMakeLists.txt b/icinga-studio/CMakeLists.txt index 230e7375d..bf3aac869 100644 --- a/icinga-studio/CMakeLists.txt +++ b/icinga-studio/CMakeLists.txt @@ -30,7 +30,9 @@ add_executable(icinga-studio MACOSX_BUNDLE WIN32 icinga-studio.cpp 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) diff --git a/lib/base/CMakeLists.txt b/lib/base/CMakeLists.txt index 71479d79f..2b3d19e84 100644 --- a/lib/base/CMakeLists.txt +++ b/lib/base/CMakeLists.txt @@ -49,7 +49,7 @@ if(ICINGA2_UNITY_BUILD) 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) @@ -76,26 +76,10 @@ endif() 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) diff --git a/lib/base/application.hpp b/lib/base/application.hpp index 2ed324323..2ce037b23 100644 --- a/lib/base/application.hpp +++ b/lib/base/application.hpp @@ -35,7 +35,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Application : public ObjectImpl { +class Application : public ObjectImpl { public: DECLARE_OBJECT(Application); diff --git a/lib/base/array.hpp b/lib/base/array.hpp index d07146fde..1df29f506 100644 --- a/lib/base/array.hpp +++ b/lib/base/array.hpp @@ -35,7 +35,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Array : public Object +class Array : public Object { public: DECLARE_OBJECT(Array); diff --git a/lib/base/base64.hpp b/lib/base/base64.hpp index 0c689f081..1cea938ca 100644 --- a/lib/base/base64.hpp +++ b/lib/base/base64.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup remote */ -struct I2_BASE_API Base64 +struct Base64 { static String Decode(const String& data); static String Encode(const String& data); diff --git a/lib/base/boolean.hpp b/lib/base/boolean.hpp index d1b22f82d..d9612026a 100644 --- a/lib/base/boolean.hpp +++ b/lib/base/boolean.hpp @@ -30,7 +30,7 @@ class Value; /** * Boolean class. */ -class I2_BASE_API Boolean +class Boolean { public: static Object::Ptr GetPrototype(void); diff --git a/lib/base/configobject.hpp b/lib/base/configobject.hpp index ed2ea01de..f7a7a91a6 100644 --- a/lib/base/configobject.hpp +++ b/lib/base/configobject.hpp @@ -37,7 +37,7 @@ class ConfigType; * * @ingroup base */ -class I2_BASE_API ConfigObject : public ObjectImpl +class ConfigObject : public ObjectImpl { public: DECLARE_OBJECT(ConfigObject); diff --git a/lib/base/configobject.ti b/lib/base/configobject.ti index da5bb80e8..535a6589b 100644 --- a/lib/base/configobject.ti +++ b/lib/base/configobject.ti @@ -32,7 +32,7 @@ enum HAMode HARunEverywhere }; -class I2_BASE_API NameComposer +class NameComposer { public: virtual ~NameComposer(void); @@ -46,7 +46,7 @@ abstract class ConfigObjectBase { }; code {{{ -class I2_BASE_API ConfigObjectBase : public ObjectImpl +class ConfigObjectBase : public ObjectImpl { public: inline DebugInfo GetDebugInfo(void) const diff --git a/lib/base/configtype.hpp b/lib/base/configtype.hpp index 64999be1b..5258ebe29 100644 --- a/lib/base/configtype.hpp +++ b/lib/base/configtype.hpp @@ -30,7 +30,7 @@ namespace icinga class ConfigObject; -class I2_BASE_API ConfigType +class ConfigType { public: virtual ~ConfigType(void); diff --git a/lib/base/configwriter.hpp b/lib/base/configwriter.hpp index 0cb71ca61..3bb55249b 100644 --- a/lib/base/configwriter.hpp +++ b/lib/base/configwriter.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API ConfigIdentifier : public Object +class ConfigIdentifier : public Object { public: DECLARE_PTR_TYPEDEFS(ConfigIdentifier); @@ -51,7 +51,7 @@ private: * * @ingroup base */ -class I2_BASE_API ConfigWriter +class ConfigWriter { public: static void EmitBoolean(std::ostream& fp, bool val); diff --git a/lib/base/console.hpp b/lib/base/console.hpp index ad70ee57a..1b6456b5e 100644 --- a/lib/base/console.hpp +++ b/lib/base/console.hpp @@ -66,26 +66,26 @@ enum ConsoleType #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); diff --git a/lib/base/context.hpp b/lib/base/context.hpp index 7fd455a94..aa0b8c15c 100644 --- a/lib/base/context.hpp +++ b/lib/base/context.hpp @@ -27,7 +27,7 @@ namespace icinga { -class I2_BASE_API ContextTrace +class ContextTrace { public: ContextTrace(void); @@ -40,14 +40,14 @@ private: std::list 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); diff --git a/lib/base/convert.hpp b/lib/base/convert.hpp index 3043c5f2e..4e7b4c4d3 100644 --- a/lib/base/convert.hpp +++ b/lib/base/convert.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Convert +class Convert { public: template diff --git a/lib/base/datetime.hpp b/lib/base/datetime.hpp index fffb62cb1..3637738d4 100644 --- a/lib/base/datetime.hpp +++ b/lib/base/datetime.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API DateTime : public ObjectImpl +class DateTime : public ObjectImpl { public: DECLARE_OBJECT(DateTime); diff --git a/lib/base/debuginfo.hpp b/lib/base/debuginfo.hpp index ec7732f16..0d54d0a92 100644 --- a/lib/base/debuginfo.hpp +++ b/lib/base/debuginfo.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup config */ -struct I2_BASE_API DebugInfo +struct DebugInfo { String Path; @@ -44,11 +44,11 @@ struct I2_BASE_API DebugInfo 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); } diff --git a/lib/base/dependencygraph.hpp b/lib/base/dependencygraph.hpp index 89900acd1..f66a87cc5 100644 --- a/lib/base/dependencygraph.hpp +++ b/lib/base/dependencygraph.hpp @@ -31,7 +31,7 @@ namespace icinga { * * @ingroup base */ -class I2_BASE_API DependencyGraph +class DependencyGraph { public: static void AddDependency(Object *parent, Object *child); diff --git a/lib/base/dictionary.hpp b/lib/base/dictionary.hpp index 9244f18da..fadc1f41a 100644 --- a/lib/base/dictionary.hpp +++ b/lib/base/dictionary.hpp @@ -35,7 +35,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Dictionary : public Object +class Dictionary : public Object { public: DECLARE_OBJECT(Dictionary); diff --git a/lib/base/exception.cpp b/lib/base/exception.cpp index 14006ea8d..1a5b50fa6 100644 --- a/lib/base/exception.cpp +++ b/lib/base/exception.cpp @@ -88,7 +88,7 @@ typedef void (*DestCallback)(void *); static boost::thread_specific_ptr 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) diff --git a/lib/base/exception.hpp b/lib/base/exception.hpp index f0af63be2..08ec022ff 100644 --- a/lib/base/exception.hpp +++ b/lib/base/exception.hpp @@ -42,13 +42,13 @@ 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); @@ -73,7 +73,7 @@ private: /* * @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& attributePath, const String& message); @@ -96,13 +96,13 @@ private: 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 StackTraceErrorInfo; @@ -120,10 +120,10 @@ inline std::string to_string(const ContextTraceErrorInfo& e) 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(); @@ -135,7 +135,7 @@ private: }; #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 errinfo_win32_error; diff --git a/lib/base/fifo.hpp b/lib/base/fifo.hpp index 27fa56403..f596e9426 100644 --- a/lib/base/fifo.hpp +++ b/lib/base/fifo.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API FIFO : public Stream +class FIFO : public Stream { public: DECLARE_PTR_TYPEDEFS(FIFO); diff --git a/lib/base/filelogger.hpp b/lib/base/filelogger.hpp index 92add833d..1e82750ed 100644 --- a/lib/base/filelogger.hpp +++ b/lib/base/filelogger.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API FileLogger : public ObjectImpl +class FileLogger : public ObjectImpl { public: DECLARE_OBJECT(FileLogger); diff --git a/lib/base/function.hpp b/lib/base/function.hpp index 2e5ac95b8..531bd3288 100644 --- a/lib/base/function.hpp +++ b/lib/base/function.hpp @@ -35,7 +35,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Function : public ObjectImpl +class Function : public ObjectImpl { public: DECLARE_OBJECT(Function); diff --git a/lib/base/i2-base.hpp b/lib/base/i2-base.hpp index 104feeee4..95446b2cf 100644 --- a/lib/base/i2-base.hpp +++ b/lib/base/i2-base.hpp @@ -89,14 +89,6 @@ # 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) diff --git a/lib/base/initialize.hpp b/lib/base/initialize.hpp index a24e67dcc..dbc31149d 100644 --- a/lib/base/initialize.hpp +++ b/lib/base/initialize.hpp @@ -30,16 +30,16 @@ namespace icinga #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)); \ } } } diff --git a/lib/base/json.hpp b/lib/base/json.hpp index 18abf568e..368a25cbd 100644 --- a/lib/base/json.hpp +++ b/lib/base/json.hpp @@ -28,8 +28,8 @@ namespace icinga 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); } diff --git a/lib/base/loader.cpp b/lib/base/loader.cpp index 4bf7effb0..43709589e 100644 --- a/lib/base/loader.cpp +++ b/lib/base/loader.cpp @@ -18,51 +18,9 @@ ******************************************************************************/ #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 >& Loader::GetDeferredInitializers(void) { static boost::thread_specific_ptr > initializers; diff --git a/lib/base/loader.hpp b/lib/base/loader.hpp index 16e33ce98..2462fc027 100644 --- a/lib/base/loader.hpp +++ b/lib/base/loader.hpp @@ -55,11 +55,9 @@ private: * * @ingroup base */ -class I2_BASE_API Loader +class Loader { public: - static void LoadExtensionLibrary(const String& library); - static void AddDeferredInitializer(const std::function& callback, int priority = 0); static void ExecuteDeferredInitializers(void); diff --git a/lib/base/logger.hpp b/lib/base/logger.hpp index 928f135a0..406341d57 100644 --- a/lib/base/logger.hpp +++ b/lib/base/logger.hpp @@ -59,7 +59,7 @@ struct LogEntry { * * @ingroup base */ -class I2_BASE_API Logger : public ObjectImpl +class Logger : public ObjectImpl { public: DECLARE_OBJECT(Logger); @@ -104,7 +104,7 @@ private: 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 { diff --git a/lib/base/netstring.hpp b/lib/base/netstring.hpp index 0ab0575c4..a5f3ed039 100644 --- a/lib/base/netstring.hpp +++ b/lib/base/netstring.hpp @@ -35,7 +35,7 @@ class String; * * @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); diff --git a/lib/base/networkstream.hpp b/lib/base/networkstream.hpp index e121ed3fc..be1000796 100644 --- a/lib/base/networkstream.hpp +++ b/lib/base/networkstream.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API NetworkStream : public Stream +class NetworkStream : public Stream { public: DECLARE_PTR_TYPEDEFS(NetworkStream); diff --git a/lib/base/number.hpp b/lib/base/number.hpp index a43c63c80..3bff5ddbc 100644 --- a/lib/base/number.hpp +++ b/lib/base/number.hpp @@ -30,7 +30,7 @@ class Value; /** * Number class. */ -class I2_BASE_API Number +class Number { public: static Object::Ptr GetPrototype(void); diff --git a/lib/base/object.hpp b/lib/base/object.hpp index 3721f85ae..8740f337c 100644 --- a/lib/base/object.hpp +++ b/lib/base/object.hpp @@ -41,7 +41,7 @@ class String; struct DebugInfo; class ValidationUtils; -extern I2_BASE_API Value Empty; +extern Value Empty; #define DECLARE_PTR_TYPEDEFS(klass) \ typedef intrusive_ptr Ptr @@ -105,7 +105,7 @@ struct TypeHelper * * @ingroup base */ -class I2_BASE_API Object +class Object { public: DECLARE_PTR_TYPEDEFS(Object); @@ -160,10 +160,10 @@ private: 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) { diff --git a/lib/base/objectlock.hpp b/lib/base/objectlock.hpp index f7c8d9f17..427e90a26 100644 --- a/lib/base/objectlock.hpp +++ b/lib/base/objectlock.hpp @@ -31,7 +31,7 @@ namespace icinga /** * A scoped lock for Objects. */ -struct I2_BASE_API ObjectLock +struct ObjectLock { public: ObjectLock(void) diff --git a/lib/base/objecttype.hpp b/lib/base/objecttype.hpp index 2e65d7d27..9b3da8972 100644 --- a/lib/base/objecttype.hpp +++ b/lib/base/objecttype.hpp @@ -27,7 +27,7 @@ namespace icinga { -class I2_BASE_API ObjectType : public Type +class ObjectType : public Type { public: ObjectType(void); diff --git a/lib/base/perfdatavalue.hpp b/lib/base/perfdatavalue.hpp index 6d054f563..3da0bd724 100644 --- a/lib/base/perfdatavalue.hpp +++ b/lib/base/perfdatavalue.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API PerfdataValue : public ObjectImpl +class PerfdataValue : public ObjectImpl { public: DECLARE_OBJECT(PerfdataValue); diff --git a/lib/base/primitivetype.hpp b/lib/base/primitivetype.hpp index 1eb8ee55a..9c30ef5b8 100644 --- a/lib/base/primitivetype.hpp +++ b/lib/base/primitivetype.hpp @@ -27,7 +27,7 @@ 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()); diff --git a/lib/base/process.hpp b/lib/base/process.hpp index 38a560e9e..bfd28baa4 100644 --- a/lib/base/process.hpp +++ b/lib/base/process.hpp @@ -49,7 +49,7 @@ struct ProcessResult * * @ingroup base */ -class I2_BASE_API Process : public Object +class Process : public Object { public: DECLARE_PTR_TYPEDEFS(Process); diff --git a/lib/base/ringbuffer.hpp b/lib/base/ringbuffer.hpp index b6ff187a0..30b2f31bd 100644 --- a/lib/base/ringbuffer.hpp +++ b/lib/base/ringbuffer.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API RingBuffer : public Object +class RingBuffer : public Object { public: DECLARE_PTR_TYPEDEFS(RingBuffer); diff --git a/lib/base/scriptframe.hpp b/lib/base/scriptframe.hpp index 8de9360cf..4c80cad00 100644 --- a/lib/base/scriptframe.hpp +++ b/lib/base/scriptframe.hpp @@ -29,7 +29,7 @@ namespace icinga { -struct I2_BASE_API ScriptFrame +struct ScriptFrame { Dictionary::Ptr Locals; Value Self; diff --git a/lib/base/scriptglobal.hpp b/lib/base/scriptglobal.hpp index 0f75408c9..6705b762c 100644 --- a/lib/base/scriptglobal.hpp +++ b/lib/base/scriptglobal.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API ScriptGlobal +class ScriptGlobal { public: static Value Get(const String& name, const Value *defaultValue = nullptr); diff --git a/lib/base/scriptutils.hpp b/lib/base/scriptutils.hpp index dae878882..c9fa4a605 100644 --- a/lib/base/scriptutils.hpp +++ b/lib/base/scriptutils.hpp @@ -33,7 +33,7 @@ namespace icinga /** * @ingroup base */ -class I2_BASE_API ScriptUtils +class ScriptUtils { public: static void StaticInitialize(void); diff --git a/lib/base/serializer.hpp b/lib/base/serializer.hpp index 89089ddf8..b5e8cd31a 100644 --- a/lib/base/serializer.hpp +++ b/lib/base/serializer.hpp @@ -27,9 +27,9 @@ 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); } diff --git a/lib/base/socket.hpp b/lib/base/socket.hpp index d900c6250..066960f0f 100644 --- a/lib/base/socket.hpp +++ b/lib/base/socket.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Socket : public Object +class Socket : public Object { public: DECLARE_PTR_TYPEDEFS(Socket); diff --git a/lib/base/socketevents.hpp b/lib/base/socketevents.hpp index c7aba9a16..2acb13ab5 100644 --- a/lib/base/socketevents.hpp +++ b/lib/base/socketevents.hpp @@ -36,7 +36,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API SocketEvents +class SocketEvents { public: ~SocketEvents(void); @@ -93,7 +93,7 @@ struct EventDescription Object::Ptr LifesupportReference; }; -class I2_BASE_API SocketEventEngine +class SocketEventEngine { public: void Start(void); @@ -119,7 +119,7 @@ protected: friend class SocketEvents; }; -class I2_BASE_API SocketEventEnginePoll : public SocketEventEngine +class SocketEventEnginePoll : public SocketEventEngine { public: virtual void Register(SocketEvents *se, Object *lifesupportObject); @@ -132,7 +132,7 @@ protected: }; #ifdef __linux__ -class I2_BASE_API SocketEventEngineEpoll : public SocketEventEngine +class SocketEventEngineEpoll : public SocketEventEngine { public: virtual void Register(SocketEvents *se, Object *lifesupportObject); diff --git a/lib/base/stacktrace.hpp b/lib/base/stacktrace.hpp index 73696f23b..b6dbd2c2d 100644 --- a/lib/base/stacktrace.hpp +++ b/lib/base/stacktrace.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API StackTrace +class StackTrace { public: StackTrace(void); @@ -48,7 +48,7 @@ private: int m_Count; }; -I2_BASE_API std::ostream& operator<<(std::ostream& stream, const StackTrace& trace); +std::ostream& operator<<(std::ostream& stream, const StackTrace& trace); } diff --git a/lib/base/stdiostream.hpp b/lib/base/stdiostream.hpp index 277bea27b..238d37f87 100644 --- a/lib/base/stdiostream.hpp +++ b/lib/base/stdiostream.hpp @@ -26,7 +26,7 @@ namespace icinga { -class I2_BASE_API StdioStream : public Stream +class StdioStream : public Stream { public: DECLARE_PTR_TYPEDEFS(StdioStream); diff --git a/lib/base/stream.hpp b/lib/base/stream.hpp index 7f6dd9006..09a13b7dc 100644 --- a/lib/base/stream.hpp +++ b/lib/base/stream.hpp @@ -36,7 +36,7 @@ enum ConnectionRole RoleServer }; -struct I2_BASE_API StreamReadContext +struct StreamReadContext { StreamReadContext(void) : Buffer(nullptr), Size(0), MustRead(true), Eof(false) @@ -68,7 +68,7 @@ enum StreamReadStatus * * @ingroup base */ -class I2_BASE_API Stream : public Object +class Stream : public Object { public: DECLARE_PTR_TYPEDEFS(Stream); diff --git a/lib/base/streamlogger.hpp b/lib/base/streamlogger.hpp index f40415553..793c00ccb 100644 --- a/lib/base/streamlogger.hpp +++ b/lib/base/streamlogger.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API StreamLogger : public ObjectImpl +class StreamLogger : public ObjectImpl { public: DECLARE_OBJECT(StreamLogger); diff --git a/lib/base/string.hpp b/lib/base/string.hpp index e85814f2e..9a844d447 100644 --- a/lib/base/string.hpp +++ b/lib/base/string.hpp @@ -41,7 +41,7 @@ class Value; * 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; diff --git a/lib/base/sysloglogger.hpp b/lib/base/sysloglogger.hpp index 94edebca9..762f051e0 100644 --- a/lib/base/sysloglogger.hpp +++ b/lib/base/sysloglogger.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API SyslogLogger : public ObjectImpl +class SyslogLogger : public ObjectImpl { public: DECLARE_OBJECT(SyslogLogger); diff --git a/lib/base/tcpsocket.hpp b/lib/base/tcpsocket.hpp index af824a16b..e8ba26428 100644 --- a/lib/base/tcpsocket.hpp +++ b/lib/base/tcpsocket.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API TcpSocket : public Socket +class TcpSocket : public Socket { public: DECLARE_PTR_TYPEDEFS(TcpSocket); diff --git a/lib/base/threadpool.hpp b/lib/base/threadpool.hpp index 10a327f45..9e3f1dc5b 100644 --- a/lib/base/threadpool.hpp +++ b/lib/base/threadpool.hpp @@ -43,7 +43,7 @@ enum SchedulerPolicy * * @ingroup base */ -class I2_BASE_API ThreadPool +class ThreadPool { public: typedef std::function WorkFunction; diff --git a/lib/base/timer.hpp b/lib/base/timer.hpp index 919980a35..e28c404d4 100644 --- a/lib/base/timer.hpp +++ b/lib/base/timer.hpp @@ -33,7 +33,7 @@ class TimerHolder; * * @ingroup base */ -class I2_BASE_API Timer : public Object +class Timer : public Object { public: DECLARE_PTR_TYPEDEFS(Timer); diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp index ed687b97c..29daad4bf 100644 --- a/lib/base/tlsstream.cpp +++ b/lib/base/tlsstream.cpp @@ -29,8 +29,8 @@ 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. diff --git a/lib/base/tlsstream.hpp b/lib/base/tlsstream.hpp index 9dd2b1a88..d4dd5a17d 100644 --- a/lib/base/tlsstream.hpp +++ b/lib/base/tlsstream.hpp @@ -43,7 +43,7 @@ enum TlsAction * * @ingroup base */ -class I2_BASE_API TlsStream : public Stream, private SocketEvents +class TlsStream : public Stream, private SocketEvents { public: DECLARE_PTR_TYPEDEFS(TlsStream); diff --git a/lib/base/tlsutility.hpp b/lib/base/tlsutility.hpp index cce898852..23f7c93a6 100644 --- a/lib/base/tlsutility.hpp +++ b/lib/base/tlsutility.hpp @@ -36,27 +36,27 @@ namespace icinga { -void I2_BASE_API InitializeOpenSSL(void); -std::shared_ptr 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& context, const String& crlPath); -void I2_BASE_API SetCipherListToSSLContext(const std::shared_ptr& context, const String& cipherList); -void I2_BASE_API SetTlsProtocolminToSSLContext(const std::shared_ptr& context, const String& tlsProtocolmin); -String I2_BASE_API GetCertificateCN(const std::shared_ptr& certificate); -std::shared_ptr 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 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& cert); -std::shared_ptr I2_BASE_API StringToCertificate(const String& cert); -std::shared_ptr I2_BASE_API CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject); -std::shared_ptr I2_BASE_API CreateCertIcingaCA(const std::shared_ptr& 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& caCertificate, const std::shared_ptr& certificate); +void InitializeOpenSSL(void); +std::shared_ptr MakeSSLContext(const String& pubkey = String(), const String& privkey = String(), const String& cakey = String()); +void AddCRLToSSLContext(const std::shared_ptr& context, const String& crlPath); +void SetCipherListToSSLContext(const std::shared_ptr& context, const String& cipherList); +void SetTlsProtocolminToSSLContext(const std::shared_ptr& context, const String& tlsProtocolmin); +String GetCertificateCN(const std::shared_ptr& certificate); +std::shared_ptr 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 CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca); +String GetIcingaCADir(void); +String CertificateToString(const std::shared_ptr& cert); +std::shared_ptr StringToCertificate(const String& cert); +std::shared_ptr CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject); +std::shared_ptr CreateCertIcingaCA(const std::shared_ptr& 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& caCertificate, const std::shared_ptr& 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 errinfo_openssl_error; diff --git a/lib/base/type.hpp b/lib/base/type.hpp index 311a947e9..3b860bc79 100644 --- a/lib/base/type.hpp +++ b/lib/base/type.hpp @@ -70,7 +70,7 @@ public: 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); @@ -114,7 +114,7 @@ private: Object::Ptr m_Prototype; }; -class I2_BASE_API TypeType : public Type +class TypeType : public Type { public: DECLARE_PTR_TYPEDEFS(Type); @@ -133,7 +133,7 @@ protected: }; template -class I2_BASE_API TypeImpl +class TypeImpl { }; diff --git a/lib/base/unixsocket.hpp b/lib/base/unixsocket.hpp index 72e27bde0..a7e31f779 100644 --- a/lib/base/unixsocket.hpp +++ b/lib/base/unixsocket.hpp @@ -26,7 +26,7 @@ namespace icinga { -class I2_BASE_API UnixSocket : public Socket +class UnixSocket : public Socket { public: DECLARE_PTR_TYPEDEFS(UnixSocket); diff --git a/lib/base/utility.hpp b/lib/base/utility.hpp index ea7988f10..a52a8d52e 100644 --- a/lib/base/utility.hpp +++ b/lib/base/utility.hpp @@ -56,7 +56,7 @@ enum GlobType * * @ingroup base */ -class I2_BASE_API Utility +class Utility { public: static String DemangleSymbolName(const String& sym); diff --git a/lib/base/value.hpp b/lib/base/value.hpp index d764e9c9c..688f6cc10 100644 --- a/lib/base/value.hpp +++ b/lib/base/value.hpp @@ -49,7 +49,7 @@ enum ValueType * * @ingroup base */ -class I2_BASE_API Value +class Value { public: Value(void) @@ -293,100 +293,100 @@ private: boost::variant 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); } diff --git a/lib/base/visibility.hpp b/lib/base/visibility.hpp deleted file mode 100644 index 79081933b..000000000 --- a/lib/base/visibility.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/****************************************************************************** - * 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 */ diff --git a/lib/base/workqueue.hpp b/lib/base/workqueue.hpp index fea9415c8..781eaba5a 100644 --- a/lib/base/workqueue.hpp +++ b/lib/base/workqueue.hpp @@ -76,7 +76,7 @@ inline bool operator<(const Task& a, const Task& b) * * @ingroup base */ -class I2_BASE_API WorkQueue +class WorkQueue { public: typedef std::function ExceptionCallback; diff --git a/lib/checker/CMakeLists.txt b/lib/checker/CMakeLists.txt index c1ceb05c3..fe79d0e09 100644 --- a/lib/checker/CMakeLists.txt +++ b/lib/checker/CMakeLists.txt @@ -25,16 +25,13 @@ if(ICINGA2_UNITY_BUILD) 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( @@ -49,10 +46,4 @@ else() 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) diff --git a/lib/cli/CMakeLists.txt b/lib/cli/CMakeLists.txt index 690335888..dc1768f36 100644 --- a/lib/cli/CMakeLists.txt +++ b/lib/cli/CMakeLists.txt @@ -33,7 +33,7 @@ if(ICINGA2_UNITY_BUILD) 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) @@ -49,14 +49,5 @@ endif() 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 ) diff --git a/lib/cli/apisetuputility.hpp b/lib/cli/apisetuputility.hpp index 838418dd2..46bf453da 100644 --- a/lib/cli/apisetuputility.hpp +++ b/lib/cli/apisetuputility.hpp @@ -34,7 +34,7 @@ namespace icinga /** * @ingroup cli */ -class I2_CLI_API ApiSetupUtility +class ApiSetupUtility { public: static bool SetupMaster(const String& cn, bool prompt_restart = false); diff --git a/lib/cli/clicommand.hpp b/lib/cli/clicommand.hpp index 989db9642..e00baaf99 100644 --- a/lib/cli/clicommand.hpp +++ b/lib/cli/clicommand.hpp @@ -32,8 +32,8 @@ namespace icinga { -std::vector I2_CLI_API GetBashCompletionSuggestions(const String& type, const String& word); -std::vector I2_CLI_API GetFieldCompletionSuggestions(const Type::Ptr& type, const String& word); +std::vector GetBashCompletionSuggestions(const String& type, const String& word); +std::vector GetFieldCompletionSuggestions(const Type::Ptr& type, const String& word); enum ImpersonationLevel { @@ -47,7 +47,7 @@ enum ImpersonationLevel * * @ingroup base */ -class I2_CLI_API CLICommand : public Object +class CLICommand : public Object { public: DECLARE_PTR_TYPEDEFS(CLICommand); diff --git a/lib/cli/daemonutility.hpp b/lib/cli/daemonutility.hpp index 98de6ac18..ffd8f04b3 100644 --- a/lib/cli/daemonutility.hpp +++ b/lib/cli/daemonutility.hpp @@ -31,7 +31,7 @@ namespace icinga /** * @ingroup cli */ -class I2_CLI_API DaemonUtility +class DaemonUtility { public: static bool ValidateConfigFiles(const std::vector& configs, const String& objectsFile = String()); diff --git a/lib/cli/featureutility.hpp b/lib/cli/featureutility.hpp index 28df00e3d..281d62ca4 100644 --- a/lib/cli/featureutility.hpp +++ b/lib/cli/featureutility.hpp @@ -32,7 +32,7 @@ namespace icinga /** * @ingroup cli */ -class I2_CLI_API FeatureUtility +class FeatureUtility { public: static String GetFeaturesAvailablePath(void); diff --git a/lib/cli/i2-cli.hpp b/lib/cli/i2-cli.hpp index e7c6144cd..c23e2b875 100644 --- a/lib/cli/i2-cli.hpp +++ b/lib/cli/i2-cli.hpp @@ -28,10 +28,4 @@ #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 */ diff --git a/lib/cli/nodeutility.hpp b/lib/cli/nodeutility.hpp index 481a7bae7..403699d16 100644 --- a/lib/cli/nodeutility.hpp +++ b/lib/cli/nodeutility.hpp @@ -34,7 +34,7 @@ namespace icinga /** * @ingroup cli */ -class I2_CLI_API NodeUtility +class NodeUtility { public: static String GetConstantsConfPath(void); diff --git a/lib/cli/objectlistutility.hpp b/lib/cli/objectlistutility.hpp index b7a9da9e9..1b80f7dc2 100644 --- a/lib/cli/objectlistutility.hpp +++ b/lib/cli/objectlistutility.hpp @@ -33,7 +33,7 @@ namespace icinga /** * @ingroup cli */ -class I2_CLI_API ObjectListUtility +class ObjectListUtility { public: static bool PrintObject(std::ostream& fp, bool& first, const String& message, std::map& type_count, const String& name_filter, const String& type_filter); diff --git a/lib/cli/variableutility.hpp b/lib/cli/variableutility.hpp index 880bbe4da..4a3ce1545 100644 --- a/lib/cli/variableutility.hpp +++ b/lib/cli/variableutility.hpp @@ -32,7 +32,7 @@ namespace icinga /** * @ingroup cli */ -class I2_CLI_API VariableUtility +class VariableUtility { public: static Value GetVariable(const String& name); diff --git a/lib/compat/CMakeLists.txt b/lib/compat/CMakeLists.txt index 4bae49ae3..1e7b749b4 100644 --- a/lib/compat/CMakeLists.txt +++ b/lib/compat/CMakeLists.txt @@ -30,16 +30,13 @@ if(ICINGA2_UNITY_BUILD) 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( @@ -57,8 +54,6 @@ 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\")") diff --git a/lib/config/CMakeLists.txt b/lib/config/CMakeLists.txt index ec3dd8909..7fd35b558 100644 --- a/lib/config/CMakeLists.txt +++ b/lib/config/CMakeLists.txt @@ -44,27 +44,11 @@ if(ICINGA2_UNITY_BUILD) 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() diff --git a/lib/config/activationcontext.hpp b/lib/config/activationcontext.hpp index 55750fc3f..ff30b7d4b 100644 --- a/lib/config/activationcontext.hpp +++ b/lib/config/activationcontext.hpp @@ -28,7 +28,7 @@ namespace icinga { -class I2_CONFIG_API ActivationContext : public Object +class ActivationContext : public Object { public: DECLARE_PTR_TYPEDEFS(ActivationContext); @@ -46,7 +46,7 @@ private: friend class ActivationScope; }; -class I2_CONFIG_API ActivationScope +class ActivationScope { public: ActivationScope(const ActivationContext::Ptr& context = nullptr); diff --git a/lib/config/applyrule.hpp b/lib/config/applyrule.hpp index 4b8a776eb..8a13db392 100644 --- a/lib/config/applyrule.hpp +++ b/lib/config/applyrule.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup config */ -class I2_CONFIG_API ApplyRule +class ApplyRule { public: typedef std::map > TypeMap; diff --git a/lib/config/configcompiler.hpp b/lib/config/configcompiler.hpp index 92dd78c7c..53df8994a 100644 --- a/lib/config/configcompiler.hpp +++ b/lib/config/configcompiler.hpp @@ -83,7 +83,7 @@ struct ZoneFragment * * @ingroup config */ -class I2_CONFIG_API ConfigCompiler +class ConfigCompiler { public: explicit ConfigCompiler(const String& path, std::istream *input, diff --git a/lib/config/configcompilercontext.hpp b/lib/config/configcompilercontext.hpp index 9aad4916d..75fa887e7 100644 --- a/lib/config/configcompilercontext.hpp +++ b/lib/config/configcompilercontext.hpp @@ -31,7 +31,7 @@ namespace icinga /* * @ingroup config */ -class I2_CONFIG_API ConfigCompilerContext +class ConfigCompilerContext { public: ConfigCompilerContext(void); diff --git a/lib/config/configitem.hpp b/lib/config/configitem.hpp index 742c88fe9..f2fc84037 100644 --- a/lib/config/configitem.hpp +++ b/lib/config/configitem.hpp @@ -36,7 +36,7 @@ namespace icinga * * @ingroup config */ -class I2_CONFIG_API ConfigItem : public Object { +class ConfigItem : public Object { public: DECLARE_PTR_TYPEDEFS(ConfigItem); diff --git a/lib/config/configitembuilder.hpp b/lib/config/configitembuilder.hpp index c44553d72..d1a344a29 100644 --- a/lib/config/configitembuilder.hpp +++ b/lib/config/configitembuilder.hpp @@ -34,7 +34,7 @@ namespace icinga * * @ingroup config */ -class I2_CONFIG_API ConfigItemBuilder : public Object +class ConfigItemBuilder : public Object { public: DECLARE_PTR_TYPEDEFS(ConfigItemBuilder); diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 4d1534dca..cc29c1dcd 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -840,7 +840,9 @@ ExpressionResult LibraryExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dh 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; } diff --git a/lib/config/expression.hpp b/lib/config/expression.hpp index 6b7eb9f02..1bf55b0d4 100644 --- a/lib/config/expression.hpp +++ b/lib/config/expression.hpp @@ -195,7 +195,7 @@ private: /** * @ingroup config */ -class I2_CONFIG_API Expression +class Expression { public: Expression(void) = default; @@ -215,9 +215,9 @@ public: static void ScriptBreakpoint(ScriptFrame& frame, ScriptError *ex, const DebugInfo& di); }; -I2_CONFIG_API std::unique_ptr MakeIndexer(ScopeSpecifier scopeSpec, const String& index); +std::unique_ptr MakeIndexer(ScopeSpecifier scopeSpec, const String& index); -class I2_CONFIG_API OwnedExpression : public Expression +class OwnedExpression : public Expression { public: OwnedExpression(const std::shared_ptr& expression) @@ -239,7 +239,7 @@ private: std::shared_ptr m_Expression; }; -class I2_CONFIG_API LiteralExpression : public Expression +class LiteralExpression : public Expression { public: LiteralExpression(const Value& value = Value()); @@ -266,7 +266,7 @@ inline std::unique_ptr MakeLiteral(const Value& literal = Val return std::unique_ptr(MakeLiteralRaw(literal)); } -class I2_CONFIG_API DebuggableExpression : public Expression +class DebuggableExpression : public Expression { public: DebuggableExpression(const DebugInfo& debugInfo = DebugInfo()) @@ -279,7 +279,7 @@ protected: DebugInfo m_DebugInfo; }; -class I2_CONFIG_API UnaryExpression : public DebuggableExpression +class UnaryExpression : public DebuggableExpression { public: UnaryExpression(std::unique_ptr operand, const DebugInfo& debugInfo = DebugInfo()) @@ -290,7 +290,7 @@ protected: std::unique_ptr m_Operand; }; -class I2_CONFIG_API BinaryExpression : public DebuggableExpression +class BinaryExpression : public DebuggableExpression { public: BinaryExpression(std::unique_ptr operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -302,7 +302,7 @@ protected: std::unique_ptr m_Operand2; }; -class I2_CONFIG_API VariableExpression : public DebuggableExpression +class VariableExpression : public DebuggableExpression { public: VariableExpression(const String& variable, const DebugInfo& debugInfo = DebugInfo()) @@ -321,10 +321,10 @@ protected: private: String m_Variable; - friend I2_CONFIG_API void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); + friend void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); }; -class I2_CONFIG_API NegateExpression : public UnaryExpression +class NegateExpression : public UnaryExpression { public: NegateExpression(std::unique_ptr operand, const DebugInfo& debugInfo = DebugInfo()) @@ -335,7 +335,7 @@ protected: 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 operand, const DebugInfo& debugInfo = DebugInfo()) @@ -346,7 +346,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -357,7 +357,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -368,7 +368,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -379,7 +379,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -390,7 +390,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -401,7 +401,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -412,7 +412,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -423,7 +423,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -434,7 +434,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -445,7 +445,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -456,7 +456,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -467,7 +467,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -478,7 +478,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -489,7 +489,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -500,7 +500,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -511,7 +511,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -522,7 +522,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -533,7 +533,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -544,7 +544,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -555,7 +555,7 @@ protected: 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 operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -566,7 +566,7 @@ protected: 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 fname, std::vector >&& args, const DebugInfo& debugInfo = DebugInfo()) @@ -581,7 +581,7 @@ public: std::vector > m_Args; }; -class I2_CONFIG_API ArrayExpression : public DebuggableExpression +class ArrayExpression : public DebuggableExpression { public: ArrayExpression(std::vector >&& expressions, const DebugInfo& debugInfo = DebugInfo()) @@ -595,7 +595,7 @@ private: std::vector > m_Expressions; }; -class I2_CONFIG_API DictExpression : public DebuggableExpression +class DictExpression : public DebuggableExpression { public: DictExpression(std::vector >&& expressions = {}, const DebugInfo& debugInfo = DebugInfo()) @@ -611,10 +611,10 @@ private: std::vector > m_Expressions; bool m_Inline; - friend I2_CONFIG_API void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); + friend void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); }; -class I2_CONFIG_API SetExpression : public BinaryExpression +class SetExpression : public BinaryExpression { public: SetExpression(std::unique_ptr operand1, CombinedSetOp op, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -627,10 +627,10 @@ protected: private: CombinedSetOp m_Op; - friend I2_CONFIG_API void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); + friend void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); }; -class I2_CONFIG_API ConditionalExpression : public DebuggableExpression +class ConditionalExpression : public DebuggableExpression { public: ConditionalExpression(std::unique_ptr condition, std::unique_ptr true_branch, std::unique_ptr false_branch, const DebugInfo& debugInfo = DebugInfo()) @@ -646,7 +646,7 @@ private: std::unique_ptr m_FalseBranch; }; -class I2_CONFIG_API WhileExpression : public DebuggableExpression +class WhileExpression : public DebuggableExpression { public: WhileExpression(std::unique_ptr condition, std::unique_ptr loop_body, const DebugInfo& debugInfo = DebugInfo()) @@ -662,7 +662,7 @@ private: }; -class I2_CONFIG_API ReturnExpression : public UnaryExpression +class ReturnExpression : public UnaryExpression { public: ReturnExpression(std::unique_ptr expression, const DebugInfo& debugInfo = DebugInfo()) @@ -673,7 +673,7 @@ protected: 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()) @@ -684,7 +684,7 @@ protected: 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()) @@ -695,7 +695,7 @@ protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override; }; -class I2_CONFIG_API GetScopeExpression : public Expression +class GetScopeExpression : public Expression { public: GetScopeExpression(ScopeSpecifier scopeSpec) @@ -709,7 +709,7 @@ private: ScopeSpecifier m_ScopeSpec; }; -class I2_CONFIG_API IndexerExpression : public BinaryExpression +class IndexerExpression : public BinaryExpression { public: IndexerExpression(std::unique_ptr operand1, std::unique_ptr operand2, const DebugInfo& debugInfo = DebugInfo()) @@ -720,12 +720,12 @@ protected: 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& expr, ScopeSpecifier scopeSpec); + friend void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); }; -I2_CONFIG_API void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); +void BindToScope(std::unique_ptr& expr, ScopeSpecifier scopeSpec); -class I2_CONFIG_API ThrowExpression : public DebuggableExpression +class ThrowExpression : public DebuggableExpression { public: ThrowExpression(std::unique_ptr message, bool incompleteExpr, const DebugInfo& debugInfo = DebugInfo()) @@ -740,7 +740,7 @@ private: bool m_IncompleteExpr; }; -class I2_CONFIG_API ImportExpression : public DebuggableExpression +class ImportExpression : public DebuggableExpression { public: ImportExpression(std::unique_ptr name, const DebugInfo& debugInfo = DebugInfo()) @@ -754,7 +754,7 @@ private: std::unique_ptr m_Name; }; -class I2_CONFIG_API ImportDefaultTemplatesExpression : public DebuggableExpression +class ImportDefaultTemplatesExpression : public DebuggableExpression { public: ImportDefaultTemplatesExpression(const DebugInfo& debugInfo = DebugInfo()) @@ -765,7 +765,7 @@ protected: 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& args, @@ -783,7 +783,7 @@ private: std::shared_ptr m_Expression; }; -class I2_CONFIG_API ApplyExpression : public DebuggableExpression +class ApplyExpression : public DebuggableExpression { public: ApplyExpression(const String& type, const String& target, std::unique_ptr name, @@ -813,7 +813,7 @@ private: std::shared_ptr m_Expression; }; -class I2_CONFIG_API ObjectExpression : public DebuggableExpression +class ObjectExpression : public DebuggableExpression { public: ObjectExpression(bool abstract, std::unique_ptr type, std::unique_ptr name, std::unique_ptr filter, @@ -840,7 +840,7 @@ private: std::shared_ptr m_Expression; }; -class I2_CONFIG_API ForExpression : public DebuggableExpression +class ForExpression : public DebuggableExpression { public: ForExpression(const String& fkvar, const String& fvvar, std::unique_ptr value, std::unique_ptr expression, const DebugInfo& debugInfo = DebugInfo()) @@ -857,7 +857,7 @@ private: std::unique_ptr m_Expression; }; -class I2_CONFIG_API LibraryExpression : public UnaryExpression +class LibraryExpression : public UnaryExpression { public: LibraryExpression(std::unique_ptr expression, const DebugInfo& debugInfo = DebugInfo()) @@ -875,7 +875,7 @@ enum IncludeType IncludeZones }; -class I2_CONFIG_API IncludeExpression : public DebuggableExpression +class IncludeExpression : public DebuggableExpression { public: IncludeExpression(const String& relativeBase, std::unique_ptr path, std::unique_ptr pattern, std::unique_ptr name, @@ -898,7 +898,7 @@ private: String m_Package; }; -class I2_CONFIG_API BreakpointExpression : public DebuggableExpression +class BreakpointExpression : public DebuggableExpression { public: BreakpointExpression(const DebugInfo& debugInfo = DebugInfo()) @@ -909,7 +909,7 @@ protected: 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 name, const DebugInfo& debugInfo = DebugInfo()) @@ -923,7 +923,7 @@ private: std::unique_ptr m_Name; }; -class I2_CONFIG_API TryExceptExpression : public DebuggableExpression +class TryExceptExpression : public DebuggableExpression { public: TryExceptExpression(std::unique_ptr tryBody, std::unique_ptr exceptBody, const DebugInfo& debugInfo = DebugInfo()) diff --git a/lib/config/i2-config.hpp b/lib/config/i2-config.hpp index 7bf50eaf9..5ec9145c3 100644 --- a/lib/config/i2-config.hpp +++ b/lib/config/i2-config.hpp @@ -30,10 +30,4 @@ #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 */ diff --git a/lib/config/objectrule.hpp b/lib/config/objectrule.hpp index 42c7e2040..1d080cebe 100644 --- a/lib/config/objectrule.hpp +++ b/lib/config/objectrule.hpp @@ -31,7 +31,7 @@ namespace icinga /** * @ingroup config */ -class I2_CONFIG_API ObjectRule +class ObjectRule { public: typedef std::set TypeSet; diff --git a/lib/db_ido/CMakeLists.txt b/lib/db_ido/CMakeLists.txt index 769bcc898..2139c70aa 100644 --- a/lib/db_ido/CMakeLists.txt +++ b/lib/db_ido/CMakeLists.txt @@ -32,21 +32,12 @@ if(ICINGA2_UNITY_BUILD) 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 ) diff --git a/lib/db_ido/dbconnection.hpp b/lib/db_ido/dbconnection.hpp index 4d76802a2..afd8aedaf 100644 --- a/lib/db_ido/dbconnection.hpp +++ b/lib/db_ido/dbconnection.hpp @@ -40,7 +40,7 @@ namespace icinga * * @ingroup db_ido */ -class I2_DB_IDO_API DbConnection : public ObjectImpl +class DbConnection : public ObjectImpl { public: DECLARE_OBJECT(DbConnection); diff --git a/lib/db_ido/dbobject.hpp b/lib/db_ido/dbobject.hpp index d1689e2e3..592a2c24b 100644 --- a/lib/db_ido/dbobject.hpp +++ b/lib/db_ido/dbobject.hpp @@ -59,7 +59,7 @@ enum DbObjectType * * @ingroup ido */ -class I2_DB_IDO_API DbObject : public Object +class DbObject : public Object { public: DECLARE_PTR_TYPEDEFS(DbObject); diff --git a/lib/db_ido/dbquery.hpp b/lib/db_ido/dbquery.hpp index 872f56550..9947d6f74 100644 --- a/lib/db_ido/dbquery.hpp +++ b/lib/db_ido/dbquery.hpp @@ -60,7 +60,7 @@ enum DbQueryCategory class DbObject; -struct I2_DB_IDO_API DbQuery +struct DbQuery { int Type; DbQueryCategory Category; diff --git a/lib/db_ido/dbreference.hpp b/lib/db_ido/dbreference.hpp index 5484ac047..9dba6af5a 100644 --- a/lib/db_ido/dbreference.hpp +++ b/lib/db_ido/dbreference.hpp @@ -30,7 +30,7 @@ namespace icinga * * @ingroup ido */ -struct I2_DB_IDO_API DbReference +struct DbReference { public: DbReference(void); diff --git a/lib/db_ido/dbtype.hpp b/lib/db_ido/dbtype.hpp index 0d09428bf..e0c42ff69 100644 --- a/lib/db_ido/dbtype.hpp +++ b/lib/db_ido/dbtype.hpp @@ -36,7 +36,7 @@ class DbObject; * * @ingroup ido */ -class I2_DB_IDO_API DbType : public Object +class DbType : public Object { public: DECLARE_PTR_TYPEDEFS(DbType); @@ -79,7 +79,7 @@ private: * * @ingroup ido */ -class I2_DB_IDO_API DbTypeRegistry : public Registry +class DbTypeRegistry : public Registry { public: static DbTypeRegistry *GetInstance(void); diff --git a/lib/db_ido/dbvalue.hpp b/lib/db_ido/dbvalue.hpp index 57042a3b9..f52bfc2c2 100644 --- a/lib/db_ido/dbvalue.hpp +++ b/lib/db_ido/dbvalue.hpp @@ -39,7 +39,7 @@ enum DbValueType * * @ingroup ido */ -struct I2_DB_IDO_API DbValue : public Object +struct DbValue : public Object { public: DECLARE_PTR_TYPEDEFS(DbValue); diff --git a/lib/db_ido/i2-db_ido.hpp b/lib/db_ido/i2-db_ido.hpp index 72359f5dd..959fb9fbc 100644 --- a/lib/db_ido/i2-db_ido.hpp +++ b/lib/db_ido/i2-db_ido.hpp @@ -28,10 +28,4 @@ #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 */ diff --git a/lib/db_ido_mysql/CMakeLists.txt b/lib/db_ido_mysql/CMakeLists.txt index 9fe27de77..d8db6fe2c 100644 --- a/lib/db_ido_mysql/CMakeLists.txt +++ b/lib/db_ido_mysql/CMakeLists.txt @@ -28,17 +28,14 @@ if(MYSQL_FOUND) 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( @@ -46,12 +43,6 @@ if(MYSQL_FOUND) ${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 diff --git a/lib/db_ido_pgsql/CMakeLists.txt b/lib/db_ido_pgsql/CMakeLists.txt index d203b6190..d1eb092d6 100644 --- a/lib/db_ido_pgsql/CMakeLists.txt +++ b/lib/db_ido_pgsql/CMakeLists.txt @@ -15,14 +15,9 @@ # 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 ) @@ -31,16 +26,13 @@ if(PostgreSQL_FOUND) 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( @@ -48,12 +40,6 @@ if(PostgreSQL_FOUND) ${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 diff --git a/lib/demo/CMakeLists.txt b/lib/demo/CMakeLists.txt index 39e87d31d..07d8554b0 100644 --- a/lib/demo/CMakeLists.txt +++ b/lib/demo/CMakeLists.txt @@ -25,21 +25,11 @@ if(ICINGA2_UNITY_BUILD) 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 -) - diff --git a/lib/hello/CMakeLists.txt b/lib/hello/CMakeLists.txt index 0360f45f5..fa149d1f6 100644 --- a/lib/hello/CMakeLists.txt +++ b/lib/hello/CMakeLists.txt @@ -25,21 +25,11 @@ if(ICINGA2_UNITY_BUILD) 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 -) - diff --git a/lib/icinga/CMakeLists.txt b/lib/icinga/CMakeLists.txt index 466033ec6..acfb55f45 100644 --- a/lib/icinga/CMakeLists.txt +++ b/lib/icinga/CMakeLists.txt @@ -56,22 +56,11 @@ if(ICINGA2_UNITY_BUILD) 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 -) - - diff --git a/lib/icinga/apiactions.hpp b/lib/icinga/apiactions.hpp index 80efa2175..0b13bb546 100644 --- a/lib/icinga/apiactions.hpp +++ b/lib/icinga/apiactions.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup icinga */ -class I2_ICINGA_API ApiActions +class ApiActions { public: static Dictionary::Ptr ProcessCheckResult(const ConfigObject::Ptr& object, const Dictionary::Ptr& params); diff --git a/lib/icinga/apievents.hpp b/lib/icinga/apievents.hpp index 9bbc4b3ac..3937f77a6 100644 --- a/lib/icinga/apievents.hpp +++ b/lib/icinga/apievents.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup icinga */ -class I2_ICINGA_API ApiEvents +class ApiEvents { public: static void StaticInitialize(void); diff --git a/lib/icinga/checkable.hpp b/lib/icinga/checkable.hpp index a3a774d19..da15fb212 100644 --- a/lib/icinga/checkable.hpp +++ b/lib/icinga/checkable.hpp @@ -78,7 +78,7 @@ class Dependency; * * @ingroup icinga */ -class I2_ICINGA_API Checkable : public ObjectImpl +class Checkable : public ObjectImpl { public: DECLARE_OBJECT(Checkable); diff --git a/lib/icinga/checkcommand.hpp b/lib/icinga/checkcommand.hpp index e7b5697ff..2502bc1b4 100644 --- a/lib/icinga/checkcommand.hpp +++ b/lib/icinga/checkcommand.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API CheckCommand : public ObjectImpl +class CheckCommand : public ObjectImpl { public: DECLARE_OBJECT(CheckCommand); diff --git a/lib/icinga/checkresult.hpp b/lib/icinga/checkresult.hpp index 370f076af..08c635008 100644 --- a/lib/icinga/checkresult.hpp +++ b/lib/icinga/checkresult.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API CheckResult : public ObjectImpl +class CheckResult : public ObjectImpl { public: DECLARE_OBJECT(CheckResult); diff --git a/lib/icinga/cib.hpp b/lib/icinga/cib.hpp index cf202e743..ff2ad8770 100644 --- a/lib/icinga/cib.hpp +++ b/lib/icinga/cib.hpp @@ -65,7 +65,7 @@ struct HostStatistics { * * @ingroup icinga */ -class I2_ICINGA_API CIB +class CIB { public: static void UpdateActiveHostChecksStatistics(long tv, int num); diff --git a/lib/icinga/clusterevents.hpp b/lib/icinga/clusterevents.hpp index 511137caa..2faf2a4bd 100644 --- a/lib/icinga/clusterevents.hpp +++ b/lib/icinga/clusterevents.hpp @@ -32,7 +32,7 @@ namespace icinga /** * @ingroup icinga */ -class I2_ICINGA_API ClusterEvents +class ClusterEvents { public: static void StaticInitialize(void); diff --git a/lib/icinga/command.hpp b/lib/icinga/command.hpp index 3211a366d..a64606d26 100644 --- a/lib/icinga/command.hpp +++ b/lib/icinga/command.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API Command : public ObjectImpl +class Command : public ObjectImpl { public: DECLARE_OBJECT(Command); diff --git a/lib/icinga/comment.hpp b/lib/icinga/comment.hpp index 029caf2db..023726133 100644 --- a/lib/icinga/comment.hpp +++ b/lib/icinga/comment.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API Comment : public ObjectImpl +class Comment : public ObjectImpl { public: DECLARE_OBJECT(Comment); diff --git a/lib/icinga/comment.ti b/lib/icinga/comment.ti index b4857eaee..003fe0ff5 100644 --- a/lib/icinga/comment.ti +++ b/lib/icinga/comment.ti @@ -40,7 +40,7 @@ enum CommentType 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; diff --git a/lib/icinga/compatutility.hpp b/lib/icinga/compatutility.hpp index de3539b26..247226c01 100644 --- a/lib/icinga/compatutility.hpp +++ b/lib/icinga/compatutility.hpp @@ -36,7 +36,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API CompatUtility +class CompatUtility { public: /* command */ diff --git a/lib/icinga/customvarobject.hpp b/lib/icinga/customvarobject.hpp index 3ff9741bb..53bf323d8 100644 --- a/lib/icinga/customvarobject.hpp +++ b/lib/icinga/customvarobject.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API CustomVarObject : public ObjectImpl +class CustomVarObject : public ObjectImpl { public: DECLARE_OBJECT(CustomVarObject); @@ -41,7 +41,7 @@ public: virtual void ValidateVars(const Dictionary::Ptr& value, const ValidationUtils& utils) override; }; -I2_ICINGA_API int FilterArrayToInt(const Array::Ptr& typeFilters, const std::map& filterMap, int defaultValue); +int FilterArrayToInt(const Array::Ptr& typeFilters, const std::map& filterMap, int defaultValue); } diff --git a/lib/icinga/dependency.hpp b/lib/icinga/dependency.hpp index bcf62a2f9..be2152179 100644 --- a/lib/icinga/dependency.hpp +++ b/lib/icinga/dependency.hpp @@ -36,7 +36,7 @@ class Service; * * @ingroup icinga */ -class I2_ICINGA_API Dependency : public ObjectImpl +class Dependency : public ObjectImpl { public: DECLARE_OBJECT(Dependency); diff --git a/lib/icinga/dependency.ti b/lib/icinga/dependency.ti index 609bf9ac4..66c215bda 100644 --- a/lib/icinga/dependency.ti +++ b/lib/icinga/dependency.ti @@ -27,7 +27,7 @@ namespace icinga { code {{{ -class I2_ICINGA_API DependencyNameComposer : public NameComposer +class DependencyNameComposer : public NameComposer { public: virtual String MakeName(const String& shortName, const Object::Ptr& context) const; diff --git a/lib/icinga/downtime.hpp b/lib/icinga/downtime.hpp index 26436f746..c806ec22c 100644 --- a/lib/icinga/downtime.hpp +++ b/lib/icinga/downtime.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API Downtime : public ObjectImpl +class Downtime : public ObjectImpl { public: DECLARE_OBJECT(Downtime); diff --git a/lib/icinga/downtime.ti b/lib/icinga/downtime.ti index 2a60877fc..0cbc6738a 100644 --- a/lib/icinga/downtime.ti +++ b/lib/icinga/downtime.ti @@ -27,7 +27,7 @@ namespace icinga { code {{{ -class I2_ICINGA_API DowntimeNameComposer : public NameComposer +class DowntimeNameComposer : public NameComposer { public: virtual String MakeName(const String& shortName, const Object::Ptr& context) const; diff --git a/lib/icinga/eventcommand.hpp b/lib/icinga/eventcommand.hpp index 57ae947a1..e0a61671b 100644 --- a/lib/icinga/eventcommand.hpp +++ b/lib/icinga/eventcommand.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API EventCommand : public ObjectImpl +class EventCommand : public ObjectImpl { public: DECLARE_OBJECT(EventCommand); diff --git a/lib/icinga/externalcommandprocessor.hpp b/lib/icinga/externalcommandprocessor.hpp index 66d07dea7..aa76c6040 100644 --- a/lib/icinga/externalcommandprocessor.hpp +++ b/lib/icinga/externalcommandprocessor.hpp @@ -38,7 +38,7 @@ struct ExternalCommandInfo 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& arguments); diff --git a/lib/icinga/host.hpp b/lib/icinga/host.hpp index abce0ac77..7666f5561 100644 --- a/lib/icinga/host.hpp +++ b/lib/icinga/host.hpp @@ -35,7 +35,7 @@ class Service; * * @ingroup icinga */ -class I2_ICINGA_API Host : public ObjectImpl, public MacroResolver +class Host : public ObjectImpl, public MacroResolver { public: DECLARE_OBJECT(Host); diff --git a/lib/icinga/hostgroup.hpp b/lib/icinga/hostgroup.hpp index aad8e2265..1df85823e 100644 --- a/lib/icinga/hostgroup.hpp +++ b/lib/icinga/hostgroup.hpp @@ -34,7 +34,7 @@ class ConfigItem; * * @ingroup icinga */ -class I2_ICINGA_API HostGroup : public ObjectImpl +class HostGroup : public ObjectImpl { public: DECLARE_OBJECT(HostGroup); diff --git a/lib/icinga/i2-icinga.hpp b/lib/icinga/i2-icinga.hpp index 59e0a458b..80469b4bd 100644 --- a/lib/icinga/i2-icinga.hpp +++ b/lib/icinga/i2-icinga.hpp @@ -29,10 +29,4 @@ #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 */ diff --git a/lib/icinga/icingaapplication.cpp b/lib/icinga/icingaapplication.cpp index aaa187a4a..6e011175c 100644 --- a/lib/icinga/icingaapplication.cpp +++ b/lib/icinga/icingaapplication.cpp @@ -44,8 +44,6 @@ INITIALIZE_ONCE(&IcingaApplication::StaticInitialize); void IcingaApplication::StaticInitialize(void) { - Loader::LoadExtensionLibrary("methods"); - String node_name = Utility::GetFQDN(); if (node_name.IsEmpty()) { diff --git a/lib/icinga/icingaapplication.hpp b/lib/icinga/icingaapplication.hpp index 0e0a54f1a..3a9f6ea63 100644 --- a/lib/icinga/icingaapplication.hpp +++ b/lib/icinga/icingaapplication.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API IcingaApplication : public ObjectImpl, public MacroResolver +class IcingaApplication : public ObjectImpl, public MacroResolver { public: DECLARE_OBJECT(IcingaApplication); diff --git a/lib/icinga/legacytimeperiod.hpp b/lib/icinga/legacytimeperiod.hpp index a51e1f8e8..249106dbc 100644 --- a/lib/icinga/legacytimeperiod.hpp +++ b/lib/icinga/legacytimeperiod.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API LegacyTimePeriod +class LegacyTimePeriod { public: static Array::Ptr ScriptFunc(const TimePeriod::Ptr& tp, double start, double end); diff --git a/lib/icinga/macroprocessor.hpp b/lib/icinga/macroprocessor.hpp index c55032d0f..ed214a393 100644 --- a/lib/icinga/macroprocessor.hpp +++ b/lib/icinga/macroprocessor.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API MacroProcessor +class MacroProcessor { public: typedef std::function EscapeCallback; diff --git a/lib/icinga/macroresolver.hpp b/lib/icinga/macroresolver.hpp index aa47e0c74..33d3a97ae 100644 --- a/lib/icinga/macroresolver.hpp +++ b/lib/icinga/macroresolver.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API MacroResolver +class MacroResolver { public: DECLARE_PTR_TYPEDEFS(MacroResolver); diff --git a/lib/icinga/notification.hpp b/lib/icinga/notification.hpp index b02b3c8c4..5a2f04141 100644 --- a/lib/icinga/notification.hpp +++ b/lib/icinga/notification.hpp @@ -77,7 +77,7 @@ class Service; * * @ingroup icinga */ -class I2_ICINGA_API Notification : public ObjectImpl +class Notification : public ObjectImpl { public: DECLARE_OBJECT(Notification); @@ -139,8 +139,8 @@ private: static std::map m_TypeFilterMap; }; -I2_ICINGA_API int ServiceStateToFilter(ServiceState state); -I2_ICINGA_API int HostStateToFilter(HostState state); +int ServiceStateToFilter(ServiceState state); +int HostStateToFilter(HostState state); } diff --git a/lib/icinga/notification.ti b/lib/icinga/notification.ti index 631144166..d11f1b377 100644 --- a/lib/icinga/notification.ti +++ b/lib/icinga/notification.ti @@ -27,7 +27,7 @@ namespace icinga { code {{{ -class I2_ICINGA_API NotificationNameComposer : public NameComposer +class NotificationNameComposer : public NameComposer { public: virtual String MakeName(const String& shortName, const Object::Ptr& context) const; diff --git a/lib/icinga/notificationcommand.hpp b/lib/icinga/notificationcommand.hpp index a67562e71..3e6586b38 100644 --- a/lib/icinga/notificationcommand.hpp +++ b/lib/icinga/notificationcommand.hpp @@ -33,7 +33,7 @@ class Notification; * * @ingroup icinga */ -class I2_ICINGA_API NotificationCommand : public ObjectImpl +class NotificationCommand : public ObjectImpl { public: DECLARE_OBJECT(NotificationCommand); diff --git a/lib/icinga/objectutils.hpp b/lib/icinga/objectutils.hpp index a42cffb36..e31ae9f5e 100644 --- a/lib/icinga/objectutils.hpp +++ b/lib/icinga/objectutils.hpp @@ -31,7 +31,7 @@ namespace icinga /** * @ingroup icinga */ -class I2_ICINGA_API ObjectUtils +class ObjectUtils { public: static Service::Ptr GetService(const Value& host, const String& name); diff --git a/lib/icinga/pluginutility.hpp b/lib/icinga/pluginutility.hpp index 79621db5c..e3995f964 100644 --- a/lib/icinga/pluginutility.hpp +++ b/lib/icinga/pluginutility.hpp @@ -36,7 +36,7 @@ struct ProcessResult; * * @ingroup icinga */ -class I2_ICINGA_API PluginUtility +class PluginUtility { public: static void ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable, diff --git a/lib/icinga/scheduleddowntime.hpp b/lib/icinga/scheduleddowntime.hpp index 2dfedcbda..5054e365c 100644 --- a/lib/icinga/scheduleddowntime.hpp +++ b/lib/icinga/scheduleddowntime.hpp @@ -38,7 +38,7 @@ class Service; * * @ingroup icinga */ -class I2_ICINGA_API ScheduledDowntime : public ObjectImpl +class ScheduledDowntime : public ObjectImpl { public: DECLARE_OBJECT(ScheduledDowntime); diff --git a/lib/icinga/scheduleddowntime.ti b/lib/icinga/scheduleddowntime.ti index d836aef8b..10e88417b 100644 --- a/lib/icinga/scheduleddowntime.ti +++ b/lib/icinga/scheduleddowntime.ti @@ -26,7 +26,7 @@ namespace icinga { code {{{ -class I2_ICINGA_API ScheduledDowntimeNameComposer : public NameComposer +class ScheduledDowntimeNameComposer : public NameComposer { public: virtual String MakeName(const String& shortName, const Object::Ptr& context) const; diff --git a/lib/icinga/service.hpp b/lib/icinga/service.hpp index 2e2a1d50f..24b90036c 100644 --- a/lib/icinga/service.hpp +++ b/lib/icinga/service.hpp @@ -37,7 +37,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API Service : public ObjectImpl, public MacroResolver +class Service : public ObjectImpl, public MacroResolver { public: DECLARE_OBJECT(Service); @@ -72,7 +72,7 @@ private: static bool EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule); }; -I2_ICINGA_API std::pair GetHostService(const Checkable::Ptr& checkable); +std::pair GetHostService(const Checkable::Ptr& checkable); } diff --git a/lib/icinga/service.ti b/lib/icinga/service.ti index 8db011903..0d30978ca 100644 --- a/lib/icinga/service.ti +++ b/lib/icinga/service.ti @@ -29,7 +29,7 @@ namespace icinga { code {{{ -class I2_ICINGA_API ServiceNameComposer : public NameComposer +class ServiceNameComposer : public NameComposer { public: virtual String MakeName(const String& shortName, const Object::Ptr& context) const; diff --git a/lib/icinga/servicegroup.hpp b/lib/icinga/servicegroup.hpp index 8b26d57c4..cc05a9ecc 100644 --- a/lib/icinga/servicegroup.hpp +++ b/lib/icinga/servicegroup.hpp @@ -34,7 +34,7 @@ class ConfigItem; * * @ingroup icinga */ -class I2_ICINGA_API ServiceGroup : public ObjectImpl +class ServiceGroup : public ObjectImpl { public: DECLARE_OBJECT(ServiceGroup); diff --git a/lib/icinga/timeperiod.hpp b/lib/icinga/timeperiod.hpp index 9a8e73d01..b6a4b0873 100644 --- a/lib/icinga/timeperiod.hpp +++ b/lib/icinga/timeperiod.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API TimePeriod : public ObjectImpl +class TimePeriod : public ObjectImpl { public: DECLARE_OBJECT(TimePeriod); diff --git a/lib/icinga/user.hpp b/lib/icinga/user.hpp index bacbaa81a..b7984722d 100644 --- a/lib/icinga/user.hpp +++ b/lib/icinga/user.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API User : public ObjectImpl +class User : public ObjectImpl { public: DECLARE_OBJECT(User); diff --git a/lib/icinga/usergroup.hpp b/lib/icinga/usergroup.hpp index 5c90dd7da..eca1745a1 100644 --- a/lib/icinga/usergroup.hpp +++ b/lib/icinga/usergroup.hpp @@ -34,7 +34,7 @@ class ConfigItem; * * @ingroup icinga */ -class I2_ICINGA_API UserGroup : public ObjectImpl +class UserGroup : public ObjectImpl { public: DECLARE_OBJECT(UserGroup); diff --git a/lib/livestatus/CMakeLists.txt b/lib/livestatus/CMakeLists.txt index 6158031c3..0130724c9 100644 --- a/lib/livestatus/CMakeLists.txt +++ b/lib/livestatus/CMakeLists.txt @@ -35,16 +35,13 @@ if(ICINGA2_UNITY_BUILD) 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( @@ -54,6 +51,4 @@ 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) diff --git a/lib/livestatus/aggregator.hpp b/lib/livestatus/aggregator.hpp index 15bc6fc2e..242c795a6 100644 --- a/lib/livestatus/aggregator.hpp +++ b/lib/livestatus/aggregator.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -struct I2_LIVESTATUS_API AggregatorState +struct AggregatorState { virtual ~AggregatorState(void); }; @@ -38,7 +38,7 @@ struct I2_LIVESTATUS_API AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API Aggregator : public Object +class Aggregator : public Object { public: DECLARE_PTR_TYPEDEFS(Aggregator); diff --git a/lib/livestatus/andfilter.hpp b/lib/livestatus/andfilter.hpp index e8c0f72db..37feead8b 100644 --- a/lib/livestatus/andfilter.hpp +++ b/lib/livestatus/andfilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API AndFilter : public CombinerFilter +class AndFilter : public CombinerFilter { public: DECLARE_PTR_TYPEDEFS(AndFilter); diff --git a/lib/livestatus/attributefilter.hpp b/lib/livestatus/attributefilter.hpp index b9ce2701c..eaf555894 100644 --- a/lib/livestatus/attributefilter.hpp +++ b/lib/livestatus/attributefilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API AttributeFilter : public Filter +class AttributeFilter : public Filter { public: DECLARE_PTR_TYPEDEFS(AttributeFilter); diff --git a/lib/livestatus/avgaggregator.hpp b/lib/livestatus/avgaggregator.hpp index 54cfee73e..50ec98453 100644 --- a/lib/livestatus/avgaggregator.hpp +++ b/lib/livestatus/avgaggregator.hpp @@ -42,7 +42,7 @@ struct AvgAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API AvgAggregator : public Aggregator +class AvgAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(AvgAggregator); diff --git a/lib/livestatus/column.hpp b/lib/livestatus/column.hpp index 635d8a209..7a0ad1c69 100644 --- a/lib/livestatus/column.hpp +++ b/lib/livestatus/column.hpp @@ -34,7 +34,7 @@ enum LivestatusGroupByType { LivestatusGroupByServiceGroup }; -class I2_LIVESTATUS_API Column +class Column { public: typedef std::function ValueAccessor; diff --git a/lib/livestatus/combinerfilter.hpp b/lib/livestatus/combinerfilter.hpp index 375cd57a9..2a9075860 100644 --- a/lib/livestatus/combinerfilter.hpp +++ b/lib/livestatus/combinerfilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API CombinerFilter : public Filter +class CombinerFilter : public Filter { public: DECLARE_PTR_TYPEDEFS(CombinerFilter); diff --git a/lib/livestatus/commandstable.hpp b/lib/livestatus/commandstable.hpp index ef72f93f8..b54776c8f 100644 --- a/lib/livestatus/commandstable.hpp +++ b/lib/livestatus/commandstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API CommandsTable : public Table +class CommandsTable : public Table { public: DECLARE_PTR_TYPEDEFS(CommandsTable); diff --git a/lib/livestatus/commentstable.hpp b/lib/livestatus/commentstable.hpp index eb697a1c5..a0bc3ab30 100644 --- a/lib/livestatus/commentstable.hpp +++ b/lib/livestatus/commentstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API CommentsTable : public Table +class CommentsTable : public Table { public: DECLARE_PTR_TYPEDEFS(CommentsTable); diff --git a/lib/livestatus/contactgroupstable.hpp b/lib/livestatus/contactgroupstable.hpp index 196546c56..b1ee6c6ee 100644 --- a/lib/livestatus/contactgroupstable.hpp +++ b/lib/livestatus/contactgroupstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API ContactGroupsTable : public Table +class ContactGroupsTable : public Table { public: DECLARE_PTR_TYPEDEFS(ContactGroupsTable); diff --git a/lib/livestatus/contactstable.hpp b/lib/livestatus/contactstable.hpp index 43246855b..23a625ec3 100644 --- a/lib/livestatus/contactstable.hpp +++ b/lib/livestatus/contactstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API ContactsTable : public Table +class ContactsTable : public Table { public: DECLARE_PTR_TYPEDEFS(ContactsTable); diff --git a/lib/livestatus/countaggregator.hpp b/lib/livestatus/countaggregator.hpp index f0dc59b86..9d1cc6f40 100644 --- a/lib/livestatus/countaggregator.hpp +++ b/lib/livestatus/countaggregator.hpp @@ -41,7 +41,7 @@ struct CountAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API CountAggregator : public Aggregator +class CountAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(CountAggregator); diff --git a/lib/livestatus/downtimestable.hpp b/lib/livestatus/downtimestable.hpp index 89ecdc840..7df6078a4 100644 --- a/lib/livestatus/downtimestable.hpp +++ b/lib/livestatus/downtimestable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API DowntimesTable : public Table +class DowntimesTable : public Table { public: DECLARE_PTR_TYPEDEFS(DowntimesTable); diff --git a/lib/livestatus/endpointstable.hpp b/lib/livestatus/endpointstable.hpp index 62ce2912c..38cabfe28 100644 --- a/lib/livestatus/endpointstable.hpp +++ b/lib/livestatus/endpointstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API EndpointsTable : public Table +class EndpointsTable : public Table { public: DECLARE_PTR_TYPEDEFS(EndpointsTable); diff --git a/lib/livestatus/filter.hpp b/lib/livestatus/filter.hpp index 4bdd342e7..0942fccd4 100644 --- a/lib/livestatus/filter.hpp +++ b/lib/livestatus/filter.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API Filter : public Object +class Filter : public Object { public: DECLARE_PTR_TYPEDEFS(Filter); diff --git a/lib/livestatus/historytable.hpp b/lib/livestatus/historytable.hpp index e2e0c751c..7daaef617 100644 --- a/lib/livestatus/historytable.hpp +++ b/lib/livestatus/historytable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @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); diff --git a/lib/livestatus/hostgroupstable.hpp b/lib/livestatus/hostgroupstable.hpp index 32f3b36f4..df8dc5c30 100644 --- a/lib/livestatus/hostgroupstable.hpp +++ b/lib/livestatus/hostgroupstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API HostGroupsTable : public Table +class HostGroupsTable : public Table { public: DECLARE_PTR_TYPEDEFS(HostGroupsTable); diff --git a/lib/livestatus/hoststable.hpp b/lib/livestatus/hoststable.hpp index 1b4cab119..dbf0dfb5e 100644 --- a/lib/livestatus/hoststable.hpp +++ b/lib/livestatus/hoststable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API HostsTable : public Table +class HostsTable : public Table { public: DECLARE_PTR_TYPEDEFS(HostsTable); diff --git a/lib/livestatus/i2-livestatus.hpp b/lib/livestatus/i2-livestatus.hpp index 0516c89c7..7e7acf1fe 100644 --- a/lib/livestatus/i2-livestatus.hpp +++ b/lib/livestatus/i2-livestatus.hpp @@ -28,10 +28,4 @@ #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 */ diff --git a/lib/livestatus/invavgaggregator.hpp b/lib/livestatus/invavgaggregator.hpp index ef4090df5..3559cc2f7 100644 --- a/lib/livestatus/invavgaggregator.hpp +++ b/lib/livestatus/invavgaggregator.hpp @@ -42,7 +42,7 @@ struct InvAvgAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API InvAvgAggregator : public Aggregator +class InvAvgAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(InvAvgAggregator); diff --git a/lib/livestatus/invsumaggregator.hpp b/lib/livestatus/invsumaggregator.hpp index d32328f17..8541f406e 100644 --- a/lib/livestatus/invsumaggregator.hpp +++ b/lib/livestatus/invsumaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -struct I2_LIVESTATUS_API InvSumAggregatorState : public AggregatorState +struct InvSumAggregatorState : public AggregatorState { InvSumAggregatorState(void) : InvSum(0) @@ -41,7 +41,7 @@ struct I2_LIVESTATUS_API InvSumAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API InvSumAggregator : public Aggregator +class InvSumAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(InvSumAggregator); diff --git a/lib/livestatus/livestatuslistener.hpp b/lib/livestatus/livestatuslistener.hpp index 5e510c4c4..56c298a0a 100644 --- a/lib/livestatus/livestatuslistener.hpp +++ b/lib/livestatus/livestatuslistener.hpp @@ -34,7 +34,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API LivestatusListener : public ObjectImpl +class LivestatusListener : public ObjectImpl { public: DECLARE_OBJECT(LivestatusListener); diff --git a/lib/livestatus/livestatuslogutility.hpp b/lib/livestatus/livestatuslogutility.hpp index 669d6a491..2a548f754 100644 --- a/lib/livestatus/livestatuslogutility.hpp +++ b/lib/livestatus/livestatuslogutility.hpp @@ -60,7 +60,7 @@ enum LogEntryClass { /** * @ingroup livestatus */ -class I2_LIVESTATUS_API LivestatusLogUtility +class LivestatusLogUtility { public: static void CreateLogIndex(const String& path, std::map& index); diff --git a/lib/livestatus/livestatusquery.hpp b/lib/livestatus/livestatusquery.hpp index 91bc727e3..36a86b166 100644 --- a/lib/livestatus/livestatusquery.hpp +++ b/lib/livestatus/livestatusquery.hpp @@ -43,7 +43,7 @@ enum LivestatusError /** * @ingroup livestatus */ -class I2_LIVESTATUS_API LivestatusQuery : public Object +class LivestatusQuery : public Object { public: DECLARE_PTR_TYPEDEFS(LivestatusQuery); diff --git a/lib/livestatus/logtable.hpp b/lib/livestatus/logtable.hpp index 02ce78320..648334270 100644 --- a/lib/livestatus/logtable.hpp +++ b/lib/livestatus/logtable.hpp @@ -31,7 +31,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API LogTable : public HistoryTable +class LogTable : public HistoryTable { public: DECLARE_PTR_TYPEDEFS(LogTable); diff --git a/lib/livestatus/maxaggregator.hpp b/lib/livestatus/maxaggregator.hpp index 99ac9193a..7a3b1b544 100644 --- a/lib/livestatus/maxaggregator.hpp +++ b/lib/livestatus/maxaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -struct I2_LIVESTATUS_API MaxAggregatorState : public AggregatorState +struct MaxAggregatorState : public AggregatorState { MaxAggregatorState(void) : Max(0) @@ -41,7 +41,7 @@ struct I2_LIVESTATUS_API MaxAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API MaxAggregator : public Aggregator +class MaxAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(MaxAggregator); diff --git a/lib/livestatus/minaggregator.hpp b/lib/livestatus/minaggregator.hpp index ec8464eb3..82b40f1f6 100644 --- a/lib/livestatus/minaggregator.hpp +++ b/lib/livestatus/minaggregator.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -struct I2_LIVESTATUS_API MinAggregatorState : public AggregatorState +struct MinAggregatorState : public AggregatorState { MinAggregatorState(void) : Min(DBL_MAX) @@ -42,7 +42,7 @@ struct I2_LIVESTATUS_API MinAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API MinAggregator : public Aggregator +class MinAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(MinAggregator); diff --git a/lib/livestatus/negatefilter.hpp b/lib/livestatus/negatefilter.hpp index eb4a795c6..0ba575be8 100644 --- a/lib/livestatus/negatefilter.hpp +++ b/lib/livestatus/negatefilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API NegateFilter : public Filter +class NegateFilter : public Filter { public: DECLARE_PTR_TYPEDEFS(NegateFilter); diff --git a/lib/livestatus/orfilter.hpp b/lib/livestatus/orfilter.hpp index e4dc54bac..45389de38 100644 --- a/lib/livestatus/orfilter.hpp +++ b/lib/livestatus/orfilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API OrFilter : public CombinerFilter +class OrFilter : public CombinerFilter { public: DECLARE_PTR_TYPEDEFS(OrFilter); diff --git a/lib/livestatus/servicegroupstable.hpp b/lib/livestatus/servicegroupstable.hpp index 17cb33cc2..f42e979e1 100644 --- a/lib/livestatus/servicegroupstable.hpp +++ b/lib/livestatus/servicegroupstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API ServiceGroupsTable : public Table +class ServiceGroupsTable : public Table { public: DECLARE_PTR_TYPEDEFS(ServiceGroupsTable); diff --git a/lib/livestatus/servicestable.hpp b/lib/livestatus/servicestable.hpp index f75033027..2b43ed789 100644 --- a/lib/livestatus/servicestable.hpp +++ b/lib/livestatus/servicestable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API ServicesTable : public Table +class ServicesTable : public Table { public: DECLARE_PTR_TYPEDEFS(ServicesTable); diff --git a/lib/livestatus/statehisttable.hpp b/lib/livestatus/statehisttable.hpp index 3cfd22e3e..505e5bedb 100644 --- a/lib/livestatus/statehisttable.hpp +++ b/lib/livestatus/statehisttable.hpp @@ -32,7 +32,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API StateHistTable : public HistoryTable +class StateHistTable : public HistoryTable { public: DECLARE_PTR_TYPEDEFS(StateHistTable); diff --git a/lib/livestatus/statustable.hpp b/lib/livestatus/statustable.hpp index de67d7303..2c036937b 100644 --- a/lib/livestatus/statustable.hpp +++ b/lib/livestatus/statustable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API StatusTable : public Table +class StatusTable : public Table { public: DECLARE_PTR_TYPEDEFS(StatusTable); diff --git a/lib/livestatus/stdaggregator.hpp b/lib/livestatus/stdaggregator.hpp index 887085816..f105458a2 100644 --- a/lib/livestatus/stdaggregator.hpp +++ b/lib/livestatus/stdaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -struct I2_LIVESTATUS_API StdAggregatorState : public AggregatorState +struct StdAggregatorState : public AggregatorState { StdAggregatorState(void) : StdSum(0), StdQSum(0), StdCount(0) @@ -43,7 +43,7 @@ struct I2_LIVESTATUS_API StdAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API StdAggregator : public Aggregator +class StdAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(StdAggregator); diff --git a/lib/livestatus/sumaggregator.hpp b/lib/livestatus/sumaggregator.hpp index 54a87f010..43fa7bb61 100644 --- a/lib/livestatus/sumaggregator.hpp +++ b/lib/livestatus/sumaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -struct I2_LIVESTATUS_API SumAggregatorState : public AggregatorState +struct SumAggregatorState : public AggregatorState { SumAggregatorState(void) : Sum(0) @@ -41,7 +41,7 @@ struct I2_LIVESTATUS_API SumAggregatorState : public AggregatorState /** * @ingroup livestatus */ -class I2_LIVESTATUS_API SumAggregator : public Aggregator +class SumAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(SumAggregator); diff --git a/lib/livestatus/table.hpp b/lib/livestatus/table.hpp index bc1045a34..d39de04ad 100644 --- a/lib/livestatus/table.hpp +++ b/lib/livestatus/table.hpp @@ -42,7 +42,7 @@ class Filter; /** * @ingroup livestatus */ -class I2_LIVESTATUS_API Table : public Object +class Table : public Object { public: DECLARE_PTR_TYPEDEFS(Table); diff --git a/lib/livestatus/timeperiodstable.hpp b/lib/livestatus/timeperiodstable.hpp index 256f75d7c..e234cb7b0 100644 --- a/lib/livestatus/timeperiodstable.hpp +++ b/lib/livestatus/timeperiodstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API TimePeriodsTable : public Table +class TimePeriodsTable : public Table { public: DECLARE_PTR_TYPEDEFS(TimePeriodsTable); diff --git a/lib/livestatus/zonestable.hpp b/lib/livestatus/zonestable.hpp index 05dfa03dc..b1ccaf620 100644 --- a/lib/livestatus/zonestable.hpp +++ b/lib/livestatus/zonestable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class I2_LIVESTATUS_API ZonesTable : public Table +class ZonesTable : public Table { public: DECLARE_PTR_TYPEDEFS(ZonesTable); diff --git a/lib/methods/CMakeLists.txt b/lib/methods/CMakeLists.txt index 3debccfa4..2b5c3134c 100644 --- a/lib/methods/CMakeLists.txt +++ b/lib/methods/CMakeLists.txt @@ -35,22 +35,11 @@ if(ICINGA2_UNITY_BUILD) 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 -) - - diff --git a/lib/methods/clrchecktask.hpp b/lib/methods/clrchecktask.hpp index 0ae01a818..c44764f56 100644 --- a/lib/methods/clrchecktask.hpp +++ b/lib/methods/clrchecktask.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API ClrCheckTask +class ClrCheckTask { public: static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, diff --git a/lib/methods/dummychecktask.hpp b/lib/methods/dummychecktask.hpp index ae1428b4d..065f63c39 100644 --- a/lib/methods/dummychecktask.hpp +++ b/lib/methods/dummychecktask.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API DummyCheckTask +class DummyCheckTask { public: static void ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, diff --git a/lib/methods/i2-methods.hpp b/lib/methods/i2-methods.hpp index 17b6c0b3d..e3543bb04 100644 --- a/lib/methods/i2-methods.hpp +++ b/lib/methods/i2-methods.hpp @@ -29,10 +29,4 @@ #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 */ diff --git a/lib/methods/icingachecktask.hpp b/lib/methods/icingachecktask.hpp index 953cbb13c..fe74efc05 100644 --- a/lib/methods/icingachecktask.hpp +++ b/lib/methods/icingachecktask.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API IcingaCheckTask +class IcingaCheckTask { public: static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, diff --git a/lib/methods/nullchecktask.hpp b/lib/methods/nullchecktask.hpp index 7e74ca0b4..3afe491a9 100644 --- a/lib/methods/nullchecktask.hpp +++ b/lib/methods/nullchecktask.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API NullCheckTask +class NullCheckTask { public: static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, diff --git a/lib/methods/nulleventtask.hpp b/lib/methods/nulleventtask.hpp index c3d656399..1aee38fd8 100644 --- a/lib/methods/nulleventtask.hpp +++ b/lib/methods/nulleventtask.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API NullEventTask +class NullEventTask { public: static void ScriptFunc(const Checkable::Ptr& service, diff --git a/lib/methods/pluginchecktask.hpp b/lib/methods/pluginchecktask.hpp index 67afe4480..7095119b3 100644 --- a/lib/methods/pluginchecktask.hpp +++ b/lib/methods/pluginchecktask.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API PluginCheckTask +class PluginCheckTask { public: static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, diff --git a/lib/methods/plugineventtask.hpp b/lib/methods/plugineventtask.hpp index ac73a082a..8801a5142 100644 --- a/lib/methods/plugineventtask.hpp +++ b/lib/methods/plugineventtask.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API PluginEventTask +class PluginEventTask { public: static void ScriptFunc(const Checkable::Ptr& service, diff --git a/lib/methods/pluginnotificationtask.hpp b/lib/methods/pluginnotificationtask.hpp index 6a0ebe947..546d63384 100644 --- a/lib/methods/pluginnotificationtask.hpp +++ b/lib/methods/pluginnotificationtask.hpp @@ -33,7 +33,7 @@ namespace icinga * * @ingroup methods */ -class I2_METHODS_API PluginNotificationTask +class PluginNotificationTask { public: static void ScriptFunc(const Notification::Ptr& notification, diff --git a/lib/notification/CMakeLists.txt b/lib/notification/CMakeLists.txt index f1d491d87..d288b8ab5 100644 --- a/lib/notification/CMakeLists.txt +++ b/lib/notification/CMakeLists.txt @@ -25,16 +25,13 @@ if(ICINGA2_UNITY_BUILD) 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( @@ -49,6 +46,4 @@ else() 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) diff --git a/lib/perfdata/CMakeLists.txt b/lib/perfdata/CMakeLists.txt index cc3d6deb0..c670660a0 100644 --- a/lib/perfdata/CMakeLists.txt +++ b/lib/perfdata/CMakeLists.txt @@ -30,16 +30,13 @@ if(ICINGA2_UNITY_BUILD) 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( @@ -72,12 +69,6 @@ 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\")") diff --git a/lib/remote/CMakeLists.txt b/lib/remote/CMakeLists.txt index 7444b660e..522125694 100644 --- a/lib/remote/CMakeLists.txt +++ b/lib/remote/CMakeLists.txt @@ -38,32 +38,16 @@ if(ICINGA2_UNITY_BUILD) 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\")") diff --git a/lib/remote/actionshandler.hpp b/lib/remote/actionshandler.hpp index 23446fd6e..4fc54bfd9 100644 --- a/lib/remote/actionshandler.hpp +++ b/lib/remote/actionshandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API ActionsHandler : public HttpHandler +class ActionsHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(ActionsHandler); diff --git a/lib/remote/apiaction.hpp b/lib/remote/apiaction.hpp index 9bd511fd0..9921b734d 100644 --- a/lib/remote/apiaction.hpp +++ b/lib/remote/apiaction.hpp @@ -38,7 +38,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API ApiAction : public Object +class ApiAction : public Object { public: DECLARE_PTR_TYPEDEFS(ApiAction); @@ -65,7 +65,7 @@ private: * * @ingroup remote */ -class I2_REMOTE_API ApiActionRegistry : public Registry +class ApiActionRegistry : public Registry { public: static ApiActionRegistry *GetInstance(void); diff --git a/lib/remote/apiclient.hpp b/lib/remote/apiclient.hpp index f4152ad3b..a552a0d23 100644 --- a/lib/remote/apiclient.hpp +++ b/lib/remote/apiclient.hpp @@ -52,7 +52,7 @@ public: intrusive_ptr Type; }; -class I2_REMOTE_API ApiType : public Object +class ApiType : public Object { public: DECLARE_PTR_TYPEDEFS(ApiType); @@ -73,7 +73,7 @@ public: String Type; }; -struct I2_REMOTE_API ApiObject : public Object +struct ApiObject : public Object { public: DECLARE_PTR_TYPEDEFS(ApiObject); @@ -84,7 +84,7 @@ public: std::vector UsedBy; }; -class I2_REMOTE_API ApiClient : public Object +class ApiClient : public Object { public: DECLARE_PTR_TYPEDEFS(ApiClient); diff --git a/lib/remote/apifunction.hpp b/lib/remote/apifunction.hpp index 0d37d84ad..7a722e26b 100644 --- a/lib/remote/apifunction.hpp +++ b/lib/remote/apifunction.hpp @@ -35,7 +35,7 @@ namespace icinga * * @ingroup base */ -class I2_REMOTE_API ApiFunction : public Object +class ApiFunction : public Object { public: DECLARE_PTR_TYPEDEFS(ApiFunction); @@ -59,7 +59,7 @@ private: * * @ingroup base */ -class I2_REMOTE_API ApiFunctionRegistry : public Registry +class ApiFunctionRegistry : public Registry { public: static ApiFunctionRegistry *GetInstance(void); diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp index c3dbddbe5..71d7a7d46 100644 --- a/lib/remote/apilistener.hpp +++ b/lib/remote/apilistener.hpp @@ -49,7 +49,7 @@ struct ConfigDirInformation /** * @ingroup remote */ -class I2_REMOTE_API ApiListener : public ObjectImpl +class ApiListener : public ObjectImpl { public: DECLARE_OBJECT(ApiListener); diff --git a/lib/remote/apiuser.hpp b/lib/remote/apiuser.hpp index f2903058b..b64f48da6 100644 --- a/lib/remote/apiuser.hpp +++ b/lib/remote/apiuser.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup remote */ -class I2_REMOTE_API ApiUser : public ObjectImpl +class ApiUser : public ObjectImpl { public: DECLARE_OBJECT(ApiUser); diff --git a/lib/remote/configfileshandler.hpp b/lib/remote/configfileshandler.hpp index bb2a85c8e..8de6a2f6c 100644 --- a/lib/remote/configfileshandler.hpp +++ b/lib/remote/configfileshandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API ConfigFilesHandler : public HttpHandler +class ConfigFilesHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(ConfigFilesHandler); diff --git a/lib/remote/configobjectutility.hpp b/lib/remote/configobjectutility.hpp index d91549d57..fd27b530c 100644 --- a/lib/remote/configobjectutility.hpp +++ b/lib/remote/configobjectutility.hpp @@ -34,7 +34,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API ConfigObjectUtility +class ConfigObjectUtility { public: diff --git a/lib/remote/configpackageshandler.hpp b/lib/remote/configpackageshandler.hpp index 79589bbe3..a6eb782eb 100644 --- a/lib/remote/configpackageshandler.hpp +++ b/lib/remote/configpackageshandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API ConfigPackagesHandler : public HttpHandler +class ConfigPackagesHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(ConfigPackagesHandler); diff --git a/lib/remote/configpackageutility.hpp b/lib/remote/configpackageutility.hpp index 608ca6600..f877af5f0 100644 --- a/lib/remote/configpackageutility.hpp +++ b/lib/remote/configpackageutility.hpp @@ -35,7 +35,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API ConfigPackageUtility +class ConfigPackageUtility { public: diff --git a/lib/remote/configstageshandler.hpp b/lib/remote/configstageshandler.hpp index 832ee0413..cb215deaa 100644 --- a/lib/remote/configstageshandler.hpp +++ b/lib/remote/configstageshandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API ConfigStagesHandler : public HttpHandler +class ConfigStagesHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(ConfigStagesHandler); diff --git a/lib/remote/consolehandler.hpp b/lib/remote/consolehandler.hpp index 0a09049a6..605e3cb1d 100644 --- a/lib/remote/consolehandler.hpp +++ b/lib/remote/consolehandler.hpp @@ -26,7 +26,7 @@ namespace icinga { -struct I2_REMOTE_API ApiScriptFrame +struct ApiScriptFrame { double Seen; int NextLine; @@ -38,7 +38,7 @@ struct I2_REMOTE_API ApiScriptFrame { } }; -class I2_REMOTE_API ConsoleHandler : public HttpHandler +class ConsoleHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(ConsoleHandler); diff --git a/lib/remote/createobjecthandler.hpp b/lib/remote/createobjecthandler.hpp index d83ff4af8..85b407d76 100644 --- a/lib/remote/createobjecthandler.hpp +++ b/lib/remote/createobjecthandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API CreateObjectHandler : public HttpHandler +class CreateObjectHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(CreateObjectHandler); diff --git a/lib/remote/deleteobjecthandler.hpp b/lib/remote/deleteobjecthandler.hpp index 7ab02c590..951d957a2 100644 --- a/lib/remote/deleteobjecthandler.hpp +++ b/lib/remote/deleteobjecthandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API DeleteObjectHandler : public HttpHandler +class DeleteObjectHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(DeleteObjectHandler); diff --git a/lib/remote/endpoint.hpp b/lib/remote/endpoint.hpp index 5ca81b648..344d49bbc 100644 --- a/lib/remote/endpoint.hpp +++ b/lib/remote/endpoint.hpp @@ -36,7 +36,7 @@ class Zone; * * @ingroup remote */ -class I2_REMOTE_API Endpoint : public ObjectImpl +class Endpoint : public ObjectImpl { public: DECLARE_OBJECT(Endpoint); diff --git a/lib/remote/eventqueue.hpp b/lib/remote/eventqueue.hpp index 1f8404b80..eb5778b56 100644 --- a/lib/remote/eventqueue.hpp +++ b/lib/remote/eventqueue.hpp @@ -32,7 +32,7 @@ namespace icinga { -class I2_REMOTE_API EventQueue : public Object +class EventQueue : public Object { public: DECLARE_PTR_TYPEDEFS(EventQueue); @@ -73,7 +73,7 @@ private: * * @ingroup base */ -class I2_REMOTE_API EventQueueRegistry : public Registry +class EventQueueRegistry : public Registry { public: static EventQueueRegistry *GetInstance(void); diff --git a/lib/remote/eventshandler.hpp b/lib/remote/eventshandler.hpp index 5ab40ab7e..f58cefd5c 100644 --- a/lib/remote/eventshandler.hpp +++ b/lib/remote/eventshandler.hpp @@ -26,7 +26,7 @@ namespace icinga { -class I2_REMOTE_API EventsHandler : public HttpHandler +class EventsHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(EventsHandler); diff --git a/lib/remote/filterutility.hpp b/lib/remote/filterutility.hpp index c4edba9f6..a41567a27 100644 --- a/lib/remote/filterutility.hpp +++ b/lib/remote/filterutility.hpp @@ -64,7 +64,7 @@ struct QueryDescription * * @ingroup remote */ -class I2_REMOTE_API FilterUtility +class FilterUtility { public: static Type::Ptr TypeFromPluralName(const String& pluralName); diff --git a/lib/remote/httpchunkedencoding.hpp b/lib/remote/httpchunkedencoding.hpp index c09edf04c..c0a658c99 100644 --- a/lib/remote/httpchunkedencoding.hpp +++ b/lib/remote/httpchunkedencoding.hpp @@ -41,7 +41,7 @@ struct ChunkReadContext * * @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); diff --git a/lib/remote/httpclientconnection.hpp b/lib/remote/httpclientconnection.hpp index 73d8fea0e..9971cd41d 100644 --- a/lib/remote/httpclientconnection.hpp +++ b/lib/remote/httpclientconnection.hpp @@ -34,7 +34,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API HttpClientConnection : public Object +class HttpClientConnection : public Object { public: DECLARE_PTR_TYPEDEFS(HttpClientConnection); diff --git a/lib/remote/httphandler.hpp b/lib/remote/httphandler.hpp index d27ca2911..c06c4030b 100644 --- a/lib/remote/httphandler.hpp +++ b/lib/remote/httphandler.hpp @@ -34,7 +34,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API HttpHandler : public Object +class HttpHandler : public Object { public: DECLARE_PTR_TYPEDEFS(HttpHandler); @@ -53,7 +53,7 @@ private: * * @ingroup remote */ -class I2_REMOTE_API RegisterHttpHandler +class RegisterHttpHandler { public: RegisterHttpHandler(const String& url, const HttpHandler& function); diff --git a/lib/remote/httprequest.hpp b/lib/remote/httprequest.hpp index 6a125c571..18a11c602 100644 --- a/lib/remote/httprequest.hpp +++ b/lib/remote/httprequest.hpp @@ -49,7 +49,7 @@ enum HttpRequestState * * @ingroup remote */ -struct I2_REMOTE_API HttpRequest +struct HttpRequest { public: bool Complete; diff --git a/lib/remote/httpresponse.hpp b/lib/remote/httpresponse.hpp index 216a333e4..6a876d342 100644 --- a/lib/remote/httpresponse.hpp +++ b/lib/remote/httpresponse.hpp @@ -41,7 +41,7 @@ enum HttpResponseState * * @ingroup remote */ -struct I2_REMOTE_API HttpResponse +struct HttpResponse { public: bool Complete; diff --git a/lib/remote/httpserverconnection.hpp b/lib/remote/httpserverconnection.hpp index 347d33a48..1f4326531 100644 --- a/lib/remote/httpserverconnection.hpp +++ b/lib/remote/httpserverconnection.hpp @@ -34,7 +34,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API HttpServerConnection : public Object +class HttpServerConnection : public Object { public: DECLARE_PTR_TYPEDEFS(HttpServerConnection); diff --git a/lib/remote/httputility.hpp b/lib/remote/httputility.hpp index 5a74a8f42..bebc4f684 100644 --- a/lib/remote/httputility.hpp +++ b/lib/remote/httputility.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API HttpUtility +class HttpUtility { public: diff --git a/lib/remote/i2-remote.hpp b/lib/remote/i2-remote.hpp index f5bb0adc0..292e8f2e0 100644 --- a/lib/remote/i2-remote.hpp +++ b/lib/remote/i2-remote.hpp @@ -28,10 +28,4 @@ #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 */ diff --git a/lib/remote/infohandler.hpp b/lib/remote/infohandler.hpp index b50e0f430..1d318018c 100644 --- a/lib/remote/infohandler.hpp +++ b/lib/remote/infohandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API InfoHandler : public HttpHandler +class InfoHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(InfoHandler); diff --git a/lib/remote/jsonrpc.hpp b/lib/remote/jsonrpc.hpp index ef11edbee..1033086e4 100644 --- a/lib/remote/jsonrpc.hpp +++ b/lib/remote/jsonrpc.hpp @@ -32,7 +32,7 @@ namespace icinga * * @ingroup remote */ -class I2_REMOTE_API JsonRpc +class JsonRpc { public: static size_t SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message); diff --git a/lib/remote/jsonrpcconnection.hpp b/lib/remote/jsonrpcconnection.hpp index 9a65d1282..1d1cc4a7e 100644 --- a/lib/remote/jsonrpcconnection.hpp +++ b/lib/remote/jsonrpcconnection.hpp @@ -48,7 +48,7 @@ class MessageOrigin; * * @ingroup remote */ -class I2_REMOTE_API JsonRpcConnection : public Object +class JsonRpcConnection : public Object { public: DECLARE_PTR_TYPEDEFS(JsonRpcConnection); diff --git a/lib/remote/messageorigin.hpp b/lib/remote/messageorigin.hpp index 1be114aa7..f32b2b434 100644 --- a/lib/remote/messageorigin.hpp +++ b/lib/remote/messageorigin.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup remote */ -class I2_REMOTE_API MessageOrigin : public Object +class MessageOrigin : public Object { public: DECLARE_PTR_TYPEDEFS(MessageOrigin); diff --git a/lib/remote/modifyobjecthandler.hpp b/lib/remote/modifyobjecthandler.hpp index a8d6cd3b3..aa46e259c 100644 --- a/lib/remote/modifyobjecthandler.hpp +++ b/lib/remote/modifyobjecthandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API ModifyObjectHandler : public HttpHandler +class ModifyObjectHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(ModifyObjectHandler); diff --git a/lib/remote/objectqueryhandler.hpp b/lib/remote/objectqueryhandler.hpp index 5be7d7e8c..ebcd5e47f 100644 --- a/lib/remote/objectqueryhandler.hpp +++ b/lib/remote/objectqueryhandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API ObjectQueryHandler : public HttpHandler +class ObjectQueryHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(ObjectQueryHandler); diff --git a/lib/remote/pkiutility.hpp b/lib/remote/pkiutility.hpp index 2f872685e..5cd98eb5e 100644 --- a/lib/remote/pkiutility.hpp +++ b/lib/remote/pkiutility.hpp @@ -31,7 +31,7 @@ namespace icinga /** * @ingroup remote */ -class I2_REMOTE_API PkiUtility +class PkiUtility { public: static int NewCa(void); diff --git a/lib/remote/statushandler.hpp b/lib/remote/statushandler.hpp index 808561b26..0e2db4d4c 100644 --- a/lib/remote/statushandler.hpp +++ b/lib/remote/statushandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API StatusHandler : public HttpHandler +class StatusHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(StatusHandler); diff --git a/lib/remote/templatequeryhandler.hpp b/lib/remote/templatequeryhandler.hpp index 26d09ad25..55de097d1 100644 --- a/lib/remote/templatequeryhandler.hpp +++ b/lib/remote/templatequeryhandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API TemplateQueryHandler : public HttpHandler +class TemplateQueryHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(TemplateQueryHandler); diff --git a/lib/remote/typequeryhandler.hpp b/lib/remote/typequeryhandler.hpp index 26d56f5a1..12ff5c293 100644 --- a/lib/remote/typequeryhandler.hpp +++ b/lib/remote/typequeryhandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API TypeQueryHandler : public HttpHandler +class TypeQueryHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(TypeQueryHandler); diff --git a/lib/remote/url.hpp b/lib/remote/url.hpp index fa05f72cb..531c7c26a 100644 --- a/lib/remote/url.hpp +++ b/lib/remote/url.hpp @@ -36,7 +36,7 @@ namespace icinga * * @ingroup base */ -class I2_REMOTE_API Url : public Object +class Url : public Object { public: DECLARE_PTR_TYPEDEFS(Url); diff --git a/lib/remote/variablequeryhandler.hpp b/lib/remote/variablequeryhandler.hpp index 6a4954ecc..469a3442f 100644 --- a/lib/remote/variablequeryhandler.hpp +++ b/lib/remote/variablequeryhandler.hpp @@ -25,7 +25,7 @@ namespace icinga { -class I2_REMOTE_API VariableQueryHandler : public HttpHandler +class VariableQueryHandler : public HttpHandler { public: DECLARE_PTR_TYPEDEFS(VariableQueryHandler); diff --git a/lib/remote/zone.hpp b/lib/remote/zone.hpp index 07a44c035..218e148cd 100644 --- a/lib/remote/zone.hpp +++ b/lib/remote/zone.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup remote */ -class I2_REMOTE_API Zone : public ObjectImpl +class Zone : public ObjectImpl { public: DECLARE_OBJECT(Zone); diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 18c821e96..0182b6787 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -16,7 +16,10 @@ # 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 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 53e79aa2d..6f4328545 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -35,7 +35,6 @@ endif() 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 @@ -121,6 +120,10 @@ add_boost_test(base 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 @@ -132,10 +135,14 @@ if(ICINGA2_WITH_LIVESTATUS) 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 @@ -148,10 +155,13 @@ endif() 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) diff --git a/third-party/execvpe/CMakeLists.txt b/third-party/execvpe/CMakeLists.txt index 2d754196f..4aba91724 100644 --- a/third-party/execvpe/CMakeLists.txt +++ b/third-party/execvpe/CMakeLists.txt @@ -15,24 +15,9 @@ # 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() diff --git a/third-party/execvpe/execvpe.h b/third-party/execvpe/execvpe.h index a3e62c851..c2230cad7 100644 --- a/third-party/execvpe/execvpe.h +++ b/third-party/execvpe/execvpe.h @@ -20,20 +20,12 @@ #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 diff --git a/third-party/mmatch/CMakeLists.txt b/third-party/mmatch/CMakeLists.txt index ed96fc0e4..39060cb00 100644 --- a/third-party/mmatch/CMakeLists.txt +++ b/third-party/mmatch/CMakeLists.txt @@ -15,24 +15,9 @@ # 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() diff --git a/third-party/mmatch/mmatch.h b/third-party/mmatch/mmatch.h index 940220391..8a451b2ed 100644 --- a/third-party/mmatch/mmatch.h +++ b/third-party/mmatch/mmatch.h @@ -1,21 +1,13 @@ #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 } diff --git a/third-party/socketpair/CMakeLists.txt b/third-party/socketpair/CMakeLists.txt index 0e227aca1..f154ede8d 100644 --- a/third-party/socketpair/CMakeLists.txt +++ b/third-party/socketpair/CMakeLists.txt @@ -15,28 +15,13 @@ # 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() diff --git a/third-party/socketpair/socketpair.h b/third-party/socketpair/socketpair.h index eb091c7da..4b3783968 100644 --- a/third-party/socketpair/socketpair.h +++ b/third-party/socketpair/socketpair.h @@ -28,22 +28,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #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 diff --git a/third-party/yajl/src/CMakeLists.txt b/third-party/yajl/src/CMakeLists.txt index c5de3539d..1ebf36869 100644 --- a/third-party/yajl/src/CMakeLists.txt +++ b/third-party/yajl/src/CMakeLists.txt @@ -30,15 +30,13 @@ ADD_DEFINITIONS(-DYAJL_BUILD) # 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 @@ -56,14 +54,3 @@ FOREACH (header ${PUB_HDRS}) 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() diff --git a/tools/mkclass/classcompiler.cpp b/tools/mkclass/classcompiler.cpp index 79d9011b5..525358d75 100644 --- a/tools/mkclass/classcompiler.cpp +++ b/tools/mkclass/classcompiler.cpp @@ -109,20 +109,6 @@ void ClassCompiler::HandleCode(const std::string& code, const ClassDebugInfo&) 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) @@ -203,18 +189,6 @@ void ClassCompiler::OptimizeStructLayout(std::vector& fields) 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; @@ -233,7 +207,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&) /* TypeImpl */ m_Header << "template<>" << std::endl - << "class " << apiMacro << "TypeImpl<" << klass.Name << ">" + << "class TypeImpl<" << klass.Name << ">" << " : public Type"; if (!klass.Parent.empty()) @@ -471,7 +445,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&) /* 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 -- 2.40.0