On date Thursday 2010-07-08 10:43:28 +0200, Stefano Sabatini phoned this:
> Hi all,
> 
> I cannot find a way of getting su_win32_port.c compiled and added to
> libsofia_sip in MinGW.
> 
> This is causing the following failure:
> 
> gcc -Wall -g -O2 "-I./win32/pthread" -DWINVER=0x0501
> -D_WIN32_WINNT=0x0501 -DIN_LIBSOFIA_SIP_UA -DIN_LIBSOFIA_SRES
> -mms-bitfields -pipe -mno-cygwin 
> -mwindows -mconsole -Wall -g -O0 -Wl,--enable-auto-image-base -o
> stunc.exe stunc.o  ./.libs/libstun.a -L/c/x/y/sofia-sip_1_12_10/win32/pthread
> ../sresolv/.libs/libsresolv.a ../su/.libs/libsu.a -L./win32/pthread -lpthread 
> -l
> pthreadVC2 -lws2_32 -lwsock32
> ../su/.libs/libsu.a(su_port.o): In function `su_default_port_create':
> c:\x\y\sofia-sip_1_12_10\libsofia-sip-ua\su/su_port.c:63:
> undefined reference to `su_wsaevent_port_create'
> ../su/.libs/libsu.a(su_port.o): In function `su_default_clone_start':
> c:\x\y\sofia-sip_1_12_10\libsofia-sip-ua\su/su_port.c:86:
> undefined reference to `su_wsaevent_clone_start'
> ../su/.libs/libsu.a(su_port.o): In function `su_port_set_system_preferences':
> c:\x\y\sofia-sip_1_12_10\libsofia-sip-ua\su/su_port.c:142:
>  undefined reference to `su_wsaevent_port_create'
> c:\x\y\sofia-sip_1_12_10\libsofia-sip-ua\su/su_port.c:143:
>  undefined reference to `su_wsaevent_clone_start'
> collect2: ld returned 1 exit status
> make[4]: *** [stunc.exe] Error 1
> make[4]: Leaving directory `/c/x/y/sofia-sip_1_12_10/libsofia-sip-ua/stun'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory `/c/x/y/sofia-sip_1_12_10/libso
> fia-sip-ua/stun'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/c/x/y/sofia-sip_1_12_10/libsofia-sip-ua'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/c/x/y/sofia-sip_1_12_10'
> make: *** [all] Error 2
> 
> Can you suggest how to fix this?

Found a way which works for me, it feels a bit unelegant and I'm not
sure this is the best solution (no auto* expertise). You need to run
autoreconf to update libsofia-sip-ua/su/Makefile.in.

Regards.
>From 1c7dfdb69706c224f7eea82fb06562d927b04550 Mon Sep 17 00:00:00 2001
From: Stefano Sabatini <ssabat...@reilabs.com>
Date: Thu, 8 Jul 2010 15:49:25 +0200
Subject: [PATCH 2/2] Compile and link su_win32_port.c when the target OS is MinGW.

Fix linking in MinGW.
---
 configure.ac                   |    2 ++
 libsofia-sip-ua/su/Makefile.am |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4f48650..f81fde4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,8 @@ AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_REV, [0])
 AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_AGE, [0])
 AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_SOVER, [3]) # CUR-AGE
 
+AM_CONDITIONAL(TARGET_OS_MINGW32, test x$target_os = xmingw32)
+
 ## calls AC_CANONICAL_ macros that are required by AM_INIT_AUTOMAKE
 SAC_CANONICAL_SYSTEM_CACHE_CHECK
 
diff --git a/libsofia-sip-ua/su/Makefile.am b/libsofia-sip-ua/su/Makefile.am
index db3a331..8775699 100644
--- a/libsofia-sip-ua/su/Makefile.am
+++ b/libsofia-sip-ua/su/Makefile.am
@@ -76,6 +76,9 @@ libsu_la_SOURCES = \
 	su_md5.c su_uniqueid.c su_bm.c smoothsort.c su_string.c string0.c \
 	$(OSXSOURCES)
 
+if TARGET_OS_MINGW32
+libsu_la_SOURCES += su_win32_port.c
+endif
 
 EXTRA_libsu_la_SOURCES = \
 			memmem.c strtoull.c \
-- 
1.7.1

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to