]> granicus.if.org Git - icinga2/commitdiff
Improved MingW compatibility.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 28 May 2012 08:41:21 +0000 (10:41 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 28 May 2012 08:41:21 +0000 (10:41 +0200)
base/application.cpp
base/win32.h
configure.ac
icinga-app/icinga.cpp

index 578501ef7802c5fd648048b631ff2e1b059d6242..d402dba3f97dbbf307129a9d819027e0f0a6bd59 100644 (file)
@@ -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 */
 
index 1e2fd4225baa0214f9b8c43834a0ac971d794b23..fea3d795db39381b21911a467105a86a9e296688 100644 (file)
 #define WIN32_H
 
 #define WIN32_LEAN_AND_MEAN
+#define _WIN32_WINNT 0x0502
 #include <windows.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <imagehlp.h>
 #include <shlwapi.h>
 
+#ifdef __MINGW32__
+#      ifndef IPV6_V6ONLY
+#              define IPV6_V6ONLY 27
+#      endif /* IPV6_V6ONLY */
+#endif /* __MINGW32__ */
+
 typedef int socklen_t;
 
 #define MAXPATHLEN MAX_PATH
index 4f97147c72350cbdf96bae033e11aac7abff07c8..48263587e64f80dfb257d573d65d98276a949063 100644 (file)
@@ -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 <openssl/ssl.h>]], [])],
index d15853cb09ca30d6ad948837282645edb1c2901f..095a0e41fd5e6d44463a77597e228727ac873c02 100644 (file)
 
 #include <i2-icinga.h>
 
+#ifndef _WIN32
+#      include <ltdl.h>
+#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<IcingaApplication>();
        return instance->Run(argc, argv);
 }