From 743f68ee078b227efa3970e1f4a9e22162a0ce08 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 9 Jan 2012 12:07:11 +0100 Subject: [PATCH] fix macos build and crash at exit from dock. --- README.macos | 24 +++++++++--------------- coreapi/sal_eXosip2.c | 15 +++++---------- gtk/main.c | 17 +++++++++++------ m4/exosip.m4 | 4 ++++ mediastreamer2 | 2 +- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/README.macos b/README.macos index 98b5b9fb..d8c07159 100644 --- a/README.macos +++ b/README.macos @@ -15,26 +15,18 @@ You need: $ port install libosip2 $ port install libeXosip2 $ port install ffmpeg-devel - -- Install SDL (for video display) -Unfortunately the current (august 2011) version of sdl in macports crashes all the time. Fortunately these bugs are fixed in the development branch of SDL. -So we recommend to download SDL 1.3 with mercurial (hg) and compile it by yourself, like this: -First, make sure you have mercurial: - $ sudo port install mercurial -Fetch SDL: - $ hg clone http://hg.libsdl.org/SDL -Compile: - $ cd SDL - $ ./autogen.sh - $ ./configure --prefix=/opt/local && make -j4 + +- Install srtp (optional) for call encryption + $ port install srtp + If that fails, get from source: + $ git clone git://git.linphone.org/srtp.git + $ cd srtp && autoconf && ./configure --prefix=/opt/local && make libsrtp.a $ sudo make install When this version will be integrated into macports, only this will be necessary: $ port install libsdl-devel - Install gtk. It is recommended to use the quartz backend for better integration. - $ port install cairo +quartz +no_x11 - $ port install pango +quartz +no_x11 $ port install gtk2 +quartz +no_x11 $ port install ige-mac-integration $ port install hicolor-icon-theme @@ -45,7 +37,7 @@ If you got the source code from git, run ./autogen.sh first. Then or otherwise, do: - $ ./configure --prefix=/opt/local --with-readline=/opt/local --disable-strict --disable-x11 && make + $ ./configure --prefix=/opt/local --with-readline=/opt/local --disable-strict --disable-x11 --with-srtp=/opt/local && make Install to /opt/local @@ -58,6 +50,8 @@ Use git: $ git clone https://github.com/jralls/gtk-mac-bundler.git $ cd gtk-mac-bundler && make install $ export PATH=$PATH:~/.local/bin + #make this dummy charset.alias file for the bundler to be happy: + $ sudo touch touch /opt/local/lib/charset.alias Then run, inside linphone source tree: 1. Run configure as told before but with "--enable-relativeprefix" appended. diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 533fa860..7a2f3e05 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -374,17 +374,14 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i memset(&tlsCtx, 0, sizeof(tlsCtx)); snprintf(tlsCtx.root_ca_cert, sizeof(tlsCtx.client.cert), "%s", ctx->rootCa); eXosip_set_tls_ctx(&tlsCtx); - } + } +#ifdef HAVE_EXOSIP_TLS_VERIFY_CERTIFICATE eXosip_tls_verify_certificate(ctx->verify_server_certs); +#endif break; default: ms_warning("unexpected proto, using datagram"); } -#if 0 - /* it does not work, exosip does not implement this option correctly*/ - err=0; - eXosip_set_option(EXOSIP_OPT_DNS_CAPABILITIES,&err); /*0=no NAPTR */ -#endif /*see if it looks like an IPv6 address*/ int use_rports = ctx->use_rports; // Copy char to int to avoid bad alignment eXosip_set_option(EXOSIP_OPT_USE_RPORT,&use_rports); @@ -399,10 +396,6 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i return -1; } err=eXosip_listen_addr(proto, addr, port, ipv6 ? PF_INET6 : PF_INET, is_secure); -#ifdef HAVE_EXOSIP_GET_SOCKET - ms_message("Exosip has socket number %i",eXosip_get_socket(proto)); -#endif - ctx->running=TRUE; return err; } @@ -451,7 +444,9 @@ void sal_set_root_ca(Sal* ctx, const char* rootCa) { void sal_verify_server_certificates(Sal *ctx, bool_t verify){ ctx->verify_server_certs=verify; +#ifdef HAVE_EXOSIP_TLS_VERIFY_CERTIFICATE eXosip_tls_verify_certificate(verify); +#endif } static int extract_received_rport(osip_message_t *msg, const char **received, int *rportval,SalTransport* transport){ diff --git a/gtk/main.c b/gtk/main.c index 73e99cc9..d577b331 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1583,14 +1583,19 @@ static void linphone_gtk_check_soundcards(){ } static void linphone_gtk_quit(void){ - linphone_gtk_uninit_instance(); - linphone_gtk_destroy_log_window(); - linphone_core_destroy(the_core); - linphone_gtk_log_uninit(); + static gboolean quit_done=FALSE; + if (!quit_done){ + quit_done=TRUE; + g_source_remove_by_user_data(linphone_gtk_get_core()); + linphone_gtk_uninit_instance(); + linphone_gtk_destroy_log_window(); + linphone_core_destroy(the_core); + linphone_gtk_log_uninit(); #ifdef HAVE_NOTIFY - notify_uninit(); + notify_uninit(); #endif - gdk_threads_leave(); + gdk_threads_leave(); + } } #ifdef HAVE_GTK_OSX diff --git a/m4/exosip.m4 b/m4/exosip.m4 index 921e3353..9be357f7 100644 --- a/m4/exosip.m4 +++ b/m4/exosip.m4 @@ -42,6 +42,10 @@ AC_CHECK_LIB([eXosip2],[eXosip_get_version], [AC_DEFINE([HAVE_EXOSIP_GET_VERSION],[1],[Defined when eXosip_get_version is available])], [], [-losipparser2 -losip2 ]) +AC_CHECK_LIB([eXosip2],[eXosip_tls_verify_certificate], + [AC_DEFINE([HAVE_EXOSIP_TLS_VERIFY_CERTIFICATE],[1],[Defined when eXosip_tls_verify_certificate is available])], + [AC_MSG_WARN([Could not find eXosip_tls_verify_certificate in eXosip2 !])], + [-losipparser2 -losip2 ]) AC_CHECK_LIB([eXosip2],[eXosip_get_socket], [AC_DEFINE([HAVE_EXOSIP_GET_SOCKET],[1],[Defined when eXosip_get_socket is available])], [AC_MSG_WARN([Could not find eXosip_get_socket in eXosip2 !])], diff --git a/mediastreamer2 b/mediastreamer2 index 0d7553a3..668bdcc2 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 0d7553a33aba3237f76b742a42af1802c3b74ec3 +Subproject commit 668bdcc2c04a487fb94f31b7790ef301908c47b5 -- 2.39.2