[Sofia-sip-devel] [PATCH] Fix configuration under MinGW

2010-07-06 Thread Stefano Sabatini
Hi all,

this patch fixes the configuration problem as reported here:
http://thread.gmane.org/gmane.comp.telephony.sofia-sip.devel/3853

$LIBS and $CFLAGS need to be expanded at the configuration level,
otherwise when using them during configuration they will be wrong,
resulting in many failing tests and in a fatal error which happens
in the code from configure.ac:

if test $ac_cv_c_ll_format = yes; then
  AC_DEFINE([LLU], ["%llu"], [Format (%llu) for unsigned long long])dnl
  AC_DEFINE([LLI], ["%lli"], [Format (%lli) for long long])dnl
  AC_DEFINE([LLX], ["%llx"], [Format (%llx) for long long hex])dnl
else
  AC_MSG_ERROR("printf cannot handle 64-bit integers")
fi

This is what you can find in config.log:

configure:24311: gcc -o conftest.exe -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-bas
e conftest.c -L$(top_srcdir)/win32/pthread -lpthreadVC2 -lws2_32-lwsock3
2 >&5
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot fin
d -lpthreadVC2
collect2: ld returned 1 exit status
configure:24311: $? = 1
configure: program exited with status 1
configure: failed program was:

Patch attached, regards.
>From 7d74c8b50b33469667006c50e902e690620ce5dd Mon Sep 17 00:00:00 2001
Message-Id: <7d74c8b50b33469667006c50e902e690620ce5dd.1278413394.git.stefano.sabatini-l...@poste.it>
From: Stefano Sabatini 
Date: Tue, 6 Jul 2010 12:28:11 +0200
Subject: [fix-mingw-compilation PATCH] Fix configuration in MinGW.

CFLAGS and LIBS need to be expanded at configuration time, otherwise
many configure test will fail and the configure will abort with the
message:
configure: error: "printf cannot handle 64-bit integers"
---
 m4/sac-general.m4 |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/sac-general.m4 b/m4/sac-general.m4
index b494de1..de0ba9a 100644
--- a/m4/sac-general.m4
+++ b/m4/sac-general.m4
@@ -359,12 +359,12 @@ fi
 ])
 
 if test "$ac_cc_environment" = mingw32 ; then
-CFLAGS="$CFLAGS -I\$(top_srcdir)/win32/pthread -DWINVER=0x0501 \
+CFLAGS="$CFLAGS -I${srcdir}/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"
 LDFLAGS="$LDFLAGS -Wl,--enable-auto-image-base"
-LIBS="-L\$(top_srcdir)/win32/pthread -lpthreadVC2 -lws2_32 \
+LIBS="-L${srcdir}/win32/pthread -lpthreadVC2 -lws2_32 \
 	-lwsock32"
 MINGW_ENVIRONMENT=1
 AC_SUBST(MINGW_ENVIRONMENT)
-- 
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


[Sofia-sip-devel] [PATCH] Fix gai_strerror re-declaration in MinGW

2010-07-06 Thread Stefano Sabatini
Hi, as in subject.

The patch requires to run autoheader to re-generate the config.h.in
file.

Regards.
>From c75913c29b31450936a366f4b918bb29cde461e7 Mon Sep 17 00:00:00 2001
Message-Id: 
In-Reply-To: 
References: 
From: Stefano Sabatini 
Date: Tue, 6 Jul 2010 15:43:13 +0200
Subject: [fix-mingw-compilation PATCH 2/2] Avoid gai_strerror redefinition if it has been already declared.

Fix compilation on MinGW (where it is declared but not defined).
---
 libsofia-sip-ua/su/su_addrinfo.c |4 
 m4/sac-general.m4|6 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libsofia-sip-ua/su/su_addrinfo.c b/libsofia-sip-ua/su/su_addrinfo.c
index c8005c0..4663fee 100644
--- a/libsofia-sip-ua/su/su_addrinfo.c
+++ b/libsofia-sip-ua/su/su_addrinfo.c
@@ -820,6 +820,10 @@ freeaddrinfo(ai)
 #endif
 
 #if !HAVE_GAI_STRERROR
+#if HAVE_DECL_GAI_STRERROR
+#undef gai_strerror
+#endif
+
 static
 char *
 gai_strerror(ecode)
diff --git a/m4/sac-general.m4 b/m4/sac-general.m4
index de0ba9a..ec42733 100644
--- a/m4/sac-general.m4
+++ b/m4/sac-general.m4
@@ -359,6 +359,9 @@ fi
 ])
 
 if test "$ac_cc_environment" = mingw32 ; then
+
+AC_CHECK_DECLS([gai_strerror], [], [], [[#include ]])
+
 CFLAGS="$CFLAGS -I${srcdir}/win32/pthread -DWINVER=0x0501 \
 	-D_WIN32_WINNT=0x0501 -DIN_LIBSOFIA_SIP_UA -DIN_LIBSOFIA_SRES \
 	-mms-bitfields \
@@ -370,7 +373,10 @@ MINGW_ENVIRONMENT=1
 AC_SUBST(MINGW_ENVIRONMENT)
 AC_DEFINE([HAVE_MINGW], [1], [Define to 1 if you are compiling in MinGW environment])
 AC_DEFINE([HAVE_WIN32], [1], [Define to 1 if you have WIN32])
+else
+AC_CHECK_DECLS([gai_strerror])
 fi
+
 AM_CONDITIONAL([HAVE_MINGW32], [test "x$ac_cc_environment" != x])
 ])dnl
 
-- 
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


[Sofia-sip-devel] MinGW and libtool problem

2010-07-06 Thread Stefano Sabatini
Hi all,

after my latest fixes/hacks I'm still having problems with
compilation. Now it fails when calling libtool:

make[4]: Entering directory `/c/x/y/sofia-sip_1_12_10/libsofia-sip-ua/su'
/bin/sh ../../libtool --tag=CC --mode=link gcc -Wall -g -O2 -I{srcdir}/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 addrinfo.exe  addrinfo.o libsu.la -lpthread
-L./win32/pthread -lpthreadVC2 -lws2_32 -lwsock32
../../libtool: line 1933: cd: ./win32/pthread: Not a directory
libtool: link: cannot determine absolute directory name of `./win32/pthread'
gcc -Wall -g -O2 "-I{srcdir}/win32/pthread" -DWINVER=0x0501 -D_WIN32_WINNT=0x050
1 -DIN_LIBSOFIA_SIP_UA -DIN_LIBSOFIA_SRES -mms-bitfields -pipe -mno-cygwin -mwin
dows -mconsole -Wall -g -O0 -Wl,--enable-auto-image-base -o addrinfo.exe addrinf
o.o  ./.libs/libsu.a -L./win32/pthread -lpthread -lpthreadVC2 -lws2_32 -lwsock32

c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot 
find -lpthreadVC2

It's precisely failing in this snippet of the libtool script:

  -L*)
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
  absdir=`cd "$dir" && pwd`
  if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of 
\`$dir'" 1>&2
absdir="$dir"
notinst_path="$notinst_path $dir"
  fi
  dir="$absdir"
  ;;

Since $dir is: ./win32/pthread, and the current dir is
libsofia-sip-ua/su, it's trying to cd to
libsofia-sip-ua/su/win32/pthread which is unexisting. I hacked libtool
to do:
  absdir=`cd ../../"$dir" && pwd`

but this doesn't sound like the correct solution, as libtool is
auto-generated (and I'm rather clueless about it and all the libtool
thing) .

Can someone give some hint about a correct fix?

Regards.

--
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


Re: [Sofia-sip-devel] [PATCH] Fix configuration under MinGW

2010-07-06 Thread Michael Jerris
Do these CFLAGS get into the build as well?  a bit worried that we need to do 
both this for the tests, and using top_ for the build.

Mike

On Jul 6, 2010, at 6:53 AM, Stefano Sabatini wrote:

> Hi all,
> 
> this patch fixes the configuration problem as reported here:
> http://thread.gmane.org/gmane.comp.telephony.sofia-sip.devel/3853
> 
> $LIBS and $CFLAGS need to be expanded at the configuration level,
> otherwise when using them during configuration they will be wrong,
> resulting in many failing tests and in a fatal error which happens
> in the code from configure.ac:
> 
> if test $ac_cv_c_ll_format = yes; then
>  AC_DEFINE([LLU], ["%llu"], [Format (%llu) for unsigned long long])dnl
>  AC_DEFINE([LLI], ["%lli"], [Format (%lli) for long long])dnl
>  AC_DEFINE([LLX], ["%llx"], [Format (%llx) for long long hex])dnl
> else
>  AC_MSG_ERROR("printf cannot handle 64-bit integers")
> fi
> 
> This is what you can find in config.log:
> 
> configure:24311: gcc -o conftest.exe -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-bas
> e conftest.c -L$(top_srcdir)/win32/pthread -lpthreadVC2 -lws2_32
> -lwsock3
> 2 >&5
> c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot 
> fin
> d -lpthreadVC2
> collect2: ld returned 1 exit status
> configure:24311: $? = 1
> configure: program exited with status 1
> configure: failed program was:
> 
> Patch attached, regards.
> <0001-Fix-configuration-in-MinGW.patch>--
> 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


--
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


Re: [Sofia-sip-devel] [PATCH] Fix configuration under MinGW

2010-07-06 Thread Stefano Sabatini
On date Tuesday 2010-07-06 11:55:57 -0400, Michael Jerris phoned:
> Do these CFLAGS get into the build as well?  a bit worried that we
> need to do both this for the tests, and using top_ for the build.

Indeed I'm not sure this fix is right at all, at least it is working
for me but it may badly fails in other scenarios. I have no special
expertise with auto* tools, and I still can't grasp how it solves the
problem of defining the same flags for both the configure file and the
Makefile.

Hope someone with expertise in that area (Pekka?) can shed some light.

[...]

Regards.

--
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


Re: [Sofia-sip-devel] [PATCH] Fix configuration under MinGW

2010-07-06 Thread Michael Jerris
I'll take a look at this issue.

Mike

On Jul 6, 2010, at 12:20 PM, Stefano Sabatini wrote:

> On date Tuesday 2010-07-06 11:55:57 -0400, Michael Jerris phoned:
>> Do these CFLAGS get into the build as well?  a bit worried that we
>> need to do both this for the tests, and using top_ for the build.
> 
> Indeed I'm not sure this fix is right at all, at least it is working
> for me but it may badly fails in other scenarios. I have no special
> expertise with auto* tools, and I still can't grasp how it solves the
> problem of defining the same flags for both the configure file and the
> Makefile.
> 
> Hope someone with expertise in that area (Pekka?) can shed some light.
> 
> [...]
> 
> Regards.


--
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


Re: [Sofia-sip-devel] [PATCH] Fix configuration under MinGW

2010-07-06 Thread Pekka Pessi
2010/7/6 Stefano Sabatini :
> this patch fixes the configuration problem as reported here:
> http://thread.gmane.org/gmane.comp.telephony.sofia-sip.devel/3853

Thanks for the patch.

>-CFLAGS="$CFLAGS -I\$(top_srcdir)/win32/pthread -DWINVER=0x0501 \
>+CFLAGS="$CFLAGS -I${srcdir}/win32/pthread -DWINVER=0x0501 \

Can you actually compile sofia-sip with this? It seems to me that the
relative srcdir does dot work when make descends deeper into source
tree.

--Pekka

-- 
Pekka.Pessi mail at nokia.com

--
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


[Sofia-sip-devel] Basic intro to sofia-sip questions windows based.

2010-07-06 Thread David Clark
I have downloaded the library.  Compilation of the library using VS 
2008 was straight forward.
 From there I am looking to build test code that accepts an incoming 
call, hangs up, and also is
able to place an outbound call.

But the sample code I find is either incomplete or mismatched 
fragments like here:
http://sofia-sip.sourceforge.net/refdocs/nua/

Or like sofcli example seem to be compellable in linix only.  Anybody 
compile sofcli and the
media components under windows?   Any advice?

Thank you,
David Clark


--
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