osip-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [osip-dev] Errors when cross compiling libeXosip2 with MinGW cross e


From: Aymeric Moizard
Subject: Re: [osip-dev] Errors when cross compiling libeXosip2 with MinGW cross environment
Date: Wed, 11 Jul 2012 22:08:01 +0200

Tk a lot, I will study the patch next week and will try to merge your patch in git branch multireg (future 4.0.0 version)

Regards
Aymeric

Le 11 juil. 2012 19:08, "will barbour" <address@hidden> a écrit :
I put the diffs backwards! Oops

--- ../../src/libeXosip2-3.6.0/src//eXosip2.h 2011-10-05 16:27:09 +0200
+++ .patches/libeXosip2-3.6.0/src//eXosip2.h 2012-07-11 17:15:46 +0200
@@ -42,7 +42,7 @@
#include <stdlib.h>
#include <winsock2.h>
#include <ws2tcpip.h>
-#define close(s) closesocket(s)
+#//define close(s) closesocket(s)
#else
#include <sys/types.h>
#include <sys/socket.h>
--- ../../src/libeXosip2-3.6.0/src//eXtl_tcp.c 2011-10-05 18:43:21 +0200
+++ .patches/libeXosip2-3.6.0/src//eXtl_tcp.c 2012-07-11 18:44:11 +0200
@@ -30,7 +30,19 @@
#endif
 
#ifdef WIN32
-#include <Mstcpip.h>
+
+/* Replacement for Mstcpip.h */
+
+struct tcp_keepalive {
+    ULONG onoff;
+    ULONG keepalivetime;
+    ULONG keepaliveinterval;
+};
+
+#define SIO_KEEPALIVE_VALS    _WSAIOW(IOC_VENDOR,4)
+
+
+
#endif
 
--- ../../src/libeXosip2-3.6.0/src//eXtl_tls.c 2011-10-05 16:36:48 +0200
+++ .patches/libeXosip2-3.6.0/src//eXtl_tls.c 2012-07-11 18:14:37 +0200
@@ -37,7 +37,6 @@
#endif
 
#ifdef WIN32
-#include <Mstcpip.h>
#include <wincrypt.h>
#endif
--- ../../src/libeXosip2-3.6.0/src//eXtl_udp.c 2011-10-04 09:56:59 +0200
+++ .patches/libeXosip2-3.6.0/src//eXtl_udp.c 2012-07-11 17:07:16 +0200
@@ -178,7 +178,7 @@
res = setsockopt(udp_socket, IPPROTO_IPV6, IPV6_TCLASS,
(SOCKET_OPTION_VALUE)&tos, sizeof(tos));
#else
- retval = setsockopt(udp_socket, IPPROTO_IPV6, IP_TOS,
+ res = setsockopt(udp_socket, IPPROTO_IPV6, IP_TOS,
(SOCKET_OPTION_VALUE)&tos, sizeof(tos));
#endif
}

Or prettier - http://www.utterspeech.com/article/random-fixes/1

cheers

will

On Wed, Jul 11, 2012 at 6:48 PM, will barbour <address@hidden> wrote:
Sorry I just clicked on the `reply by email button`. I have quoted the relevant conversation that I found via google:


Hi Simon,

2012/7/5 Simon Brenner <address@hidden>
Hey all,

I'm trying to cross compile libeXosip2 (3.6.0) from my Linux PC for
Windows with the help of MXE (M cross environment, MinGW cross
environment, http://mxe.cc).

Well, actually my goal is to compile Linphone for Windows (from Linux)
but therefore, I need libeXosip2 (as well as libosip2).


Have you tried a compilation from mingw on windows for windows? Is
this one broken too? 

I guess it used to compile correctly on windows for windows, but then I'm
not sure the best way to fix it

 About errors:

1/ retval is missing... This is fixed in new version (multireg branch -> 4.0.0 version),
    but may be not in "master" branch..

2/ I guess I should add some kind of #ifdeffor the closesocket issue. However,
   I have no idea which one would be needed for your use case.

3/ It's strange that "Mstcpip.h" is missing (is it also missing on mingw compilation
   on windows/for windows... I have no answer too, because I'm using visual studio...)

Sorry for not helping more. I'm also working with 4.0.0 (git branch multireg for exosip
and git branch osip4 for osip).. But I guess the issue should remain in those versions.

If you have any proper solution, let me know!

Regards,
Aymeric


I just want to confirm that the `mingw compilation
   on windows/for windows` is broken, due to the `retval` problem and the missing `Mstcpip`

We cannot assume that this header file is available as it is only available as part of the Windows SDK and therefore not in MinGW

I have enclosed my patches (though I have only tested that it compiles, not that it works as expected!)

Kind regards

will



--- .patches/libeXosip2-3.6.0/src//eXosip2.h 2012-07-11 17:15:46 +0200
+++ ../../src/libeXosip2-3.6.0/src//eXosip2.h 2011-10-05 16:27:09 +0200
@@ -42,7 +42,7 @@
 #include <stdlib.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#//define close(s) closesocket(s)
+#define close(s) closesocket(s)
 #else
 #include <sys/types.h>
 #include <sys/socket.h>

 
 
--- .patches/libeXosip2-3.6.0/src//eXtl_tcp.c 2012-07-11 18:44:11 +0200
+++ ../../src/libeXosip2-3.6.0/src//eXtl_tcp.c 2011-10-05 18:43:21 +0200
@@ -30,19 +30,7 @@
 #endif
 
 #ifdef WIN32
-
-/* Replacement for Mstcpip.h */
-
-struct tcp_keepalive {
-    ULONG onoff;
-    ULONG keepalivetime;
-    ULONG keepaliveinterval;
-};
-
-#define SIO_KEEPALIVE_VALS    _WSAIOW(IOC_VENDOR,4)
-
-
-
+#include <Mstcpip.h>
 #endif
 
--- .patches/libeXosip2-3.6.0/src//eXtl_tls.c 2012-07-11 18:14:37 +0200
+++ ../../src/libeXosip2-3.6.0/src//eXtl_tls.c 2011-10-05 16:36:48 +0200
@@ -37,6 +37,7 @@
 #endif
 
 #ifdef WIN32
+#include <Mstcpip.h>
 #include <wincrypt.h>
 #endif
 

--- .patches/libeXosip2-3.6.0/src//eXtl_udp.c 2012-07-11 17:07:16 +0200
+++ ../../src/libeXosip2-3.6.0/src//eXtl_udp.c 2011-10-04 09:56:59 +0200
@@ -178,7 +178,7 @@
  res = setsockopt(udp_socket, IPPROTO_IPV6, IPV6_TCLASS,
  (SOCKET_OPTION_VALUE)&tos, sizeof(tos));
 #else
- res = setsockopt(udp_socket, IPPROTO_IPV6, IP_TOS,
+ retval = setsockopt(udp_socket, IPPROTO_IPV6, IP_TOS,
  (SOCKET_OPTION_VALUE)&tos, sizeof(tos));
 #endif
  }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]