From: Gunnar Beutner Date: Mon, 28 May 2012 08:41:21 +0000 (+0200) Subject: Improved MingW compatibility. X-Git-Tag: v0.0.1~471 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d130d6017f8186ef49131b7442236319d94bb6e1;p=icinga2 Improved MingW compatibility. --- diff --git a/base/application.cpp b/base/application.cpp index 578501ef7..d402dba3f 100644 --- a/base/application.cpp +++ b/base/application.cpp @@ -38,8 +38,6 @@ Application::Application(void) if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) throw Win32Exception("WSAStartup failed", WSAGetLastError()); #else /* _WIN32 */ - LTDL_SET_PRELOADED_SYMBOLS(); - lt_dlinit(); #endif /* _WIN32 */ diff --git a/base/win32.h b/base/win32.h index 1e2fd4225..fea3d795d 100644 --- a/base/win32.h +++ b/base/win32.h @@ -21,12 +21,19 @@ #define WIN32_H #define WIN32_LEAN_AND_MEAN +#define _WIN32_WINNT 0x0502 #include #include #include #include #include +#ifdef __MINGW32__ +# ifndef IPV6_V6ONLY +# define IPV6_V6ONLY 27 +# endif /* IPV6_V6ONLY */ +#endif /* __MINGW32__ */ + typedef int socklen_t; #define MAXPATHLEN MAX_PATH diff --git a/configure.ac b/configure.ac index 4f97147c7..48263587e 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,11 @@ AX_CXX_COMPILE_STDCXX_0X AX_CXX_GCC_ABI_DEMANGLE AX_PTHREAD +<<<<<<< Updated upstream LT_INIT([dlopen disable-static]) +======= +LT_INIT([dlopen shared disable-static win32-dll]) +>>>>>>> Stashed changes LT_CONFIG_LTDL_DIR([ltdl]) LTDL_INIT @@ -67,6 +71,8 @@ AC_CHECK_LIB(eay32, X509_NAME_oneline) AC_CHECK_LIB(m, floor) AC_CHECK_LIB(pthread, pthread_create) AC_CHECK_LIB(socket, getsockname) +AC_CHECK_LIB(ws2_32, getsockname) +AC_CHECK_LIB(shlwapi, PathRemoveFileSpecA) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [])], diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index d15853cb0..095a0e41f 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -19,6 +19,10 @@ #include +#ifndef _WIN32 +# include +#endif /* _WIN32 */ + using namespace icinga; /** @@ -30,6 +34,8 @@ using namespace icinga; */ int main(int argc, char **argv) { + LTDL_SET_PRELOADED_SYMBOLS(); + IcingaApplication::Ptr instance = make_shared(); return instance->Run(argc, argv); }