Added support for --disable-shared.

This commit is contained in:
Gunnar Beutner 2012-05-12 16:12:26 +02:00
parent 68039de848
commit 7b03f52e99
9 changed files with 25 additions and 10 deletions

View File

@ -7,8 +7,8 @@ SUBDIRS = ltdl \
base \ base \
jsonrpc \ jsonrpc \
icinga \ icinga \
icinga-app \ components \
components icinga-app
icinga2docdir = ${prefix}/share/doc/icinga2 icinga2docdir = ${prefix}/share/doc/icinga2
icinga2doc_DATA = \ icinga2doc_DATA = \

View File

@ -38,6 +38,8 @@ Application::Application(void)
WSADATA wsaData; WSADATA wsaData;
WSAStartup(MAKEWORD(1, 1), &wsaData); WSAStartup(MAKEWORD(1, 1), &wsaData);
#else /* _WIN32 */ #else /* _WIN32 */
LTDL_SET_PRELOADED_SYMBOLS();
lt_dlinit(); lt_dlinit();
#endif /* _WIN32 */ #endif /* _WIN32 */

View File

@ -46,8 +46,14 @@ public:
typedef Component *(*CreateComponentFunction)(void); typedef Component *(*CreateComponentFunction)(void);
#define EXPORT_COMPONENT(klass) \ #ifdef _WIN32
extern "C" I2_EXPORT icinga::Component *CreateComponent(void) \ # define SYM_CREATECOMPONENT(component) CreateComponent
#else /* _WIN32 */
# define SYM_CREATECOMPONENT(component) component ## _LTX_CreateComponent
#endif /* _WIN32 */
#define EXPORT_COMPONENT(component, klass) \
extern "C" I2_EXPORT icinga::Component *SYM_CREATECOMPONENT(component)(void) \
{ \ { \
return new klass(); \ return new klass(); \
} }

View File

@ -104,4 +104,4 @@ void ConfigFileComponent::Stop(void)
{ {
} }
EXPORT_COMPONENT(ConfigFileComponent); EXPORT_COMPONENT(configfile, ConfigFileComponent);

View File

@ -225,4 +225,4 @@ int ConfigRpcComponent::RemoteObjectRemovedHandler(const NewRequestEventArgs& ea
return 0; return 0;
} }
EXPORT_COMPONENT(ConfigRpcComponent); EXPORT_COMPONENT(configrpc, ConfigRpcComponent);

View File

@ -102,4 +102,4 @@ int DemoComponent::HelloWorldRequestHandler(const NewRequestEventArgs& nrea)
return 0; return 0;
} }
EXPORT_COMPONENT(DemoComponent); EXPORT_COMPONENT(demo, DemoComponent);

View File

@ -604,4 +604,4 @@ int DiscoveryComponent::DiscoveryTimerHandler(const TimerEventArgs& tea)
return 0; return 0;
} }
EXPORT_COMPONENT(DiscoveryComponent); EXPORT_COMPONENT(discovery, DiscoveryComponent);

View File

@ -36,7 +36,7 @@ fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], []), [], [AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application]) ]) AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], []), [], [AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application]) ])
LT_INIT([disable-static]) LT_INIT([dlopen, disable-static])
LT_CONFIG_LTDL_DIR([ltdl]) LT_CONFIG_LTDL_DIR([ltdl])
LTDL_INIT LTDL_INIT

View File

@ -17,4 +17,11 @@ icinga_CXXFLAGS = \
icinga_LDADD = \ icinga_LDADD = \
${top_builddir}/base/libbase.la \ ${top_builddir}/base/libbase.la \
${top_builddir}/icinga/libicinga.la ${top_builddir}/icinga/libicinga.la \
-dlopen ${top_builddir}/components/configfile/configfile.la \
-dlopen ${top_builddir}/components/configrpc/configrpc.la \
-dlopen ${top_builddir}/components/demo/demo.la \
-dlopen ${top_builddir}/components/discovery/discovery.la
icinga_DEPENDENCIES = \
${top_builddir}/components/configfile/configfile.la