Commit 1b21c045 authored by Jehan Monnier's avatar Jehan Monnier

audio port to mingw32ce static libraries only

parent fa2477ed
install arm-mingw32ce from 0.55 from http://cegcc.sourceforge.net/
install arm-mingw32ce 0.55 from from http://cegcc.sourceforge.net/
Modify the file errno.h found in
"/mingw/opt/mingw32ce/arm-wince-mingw32ce/include/errno.h"
Remove lines 11-14:
#ifdef __COREDLL__
# include_next <errno.h>
#else /* __COREDLL__ */
and lines 106-107:
#endif /* Not __COREDLL__ */
get dependencies:
cd scripts
make -f builder-arm-ming32ce.mk get_dependencies
build:
from scripts:
make -f builder-arm-ming32ce.mk build-linphone
for ortp:
cd oRTP
./configure --host=arm-mingw32ce --enable-strict=no --enable-ipv6=no
......@@ -36,13 +36,14 @@ AM_PROG_CC_C_O
case $target_os in
*mingw32ce)
CFLAGS="$CFLAGS -D_WIN32_WCE"
LIBS="$LIBS -lws2 -liphlpapi"
CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501 -Dstrerror="
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -lws2 -liphlpapi"
mingw_found=yes
mingwce_found=yes
;;
*mingw*)
CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501 "
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -lws2_32"
GUI_FLAGS="-mwindows"
......@@ -326,6 +327,19 @@ dnl compilation of gtk-glade user interface
AM_CONDITIONAL(BUILD_GLADE_UI, [test x$gtk_ui = xtrue ] )
AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
dnl check getenv
AH_TEMPLATE([HAVE_GETENV])
AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.]))
dnl
AC_MSG_CHECKING([for sighandler_t])
AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
has_sighandler_t=yes,has_sighandler_t=no)
AC_MSG_RESULT($has_sighandler_t)
if test "$has_sighandler_t" = "yes" ; then
AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
fi
##################################################
# Stricter build options (after external packages)
##################################################
......
This diff is collapsed.
......@@ -22,18 +22,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/mediastream.h"
#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_SIGHANDLER_T
#include <signal.h>
#endif /*HAVE_SIGHANDLER_T*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <strings.h>
#include <errno.h>
#undef snprintf
#include <ortp/stun.h>
#ifndef WIN32
#if !defined(WIN32)
static char lock_name[80];
static char lock_set=0;
......@@ -41,7 +44,7 @@ static char lock_set=0;
int set_lock_file()
{
FILE *lockfile;
snprintf(lock_name,80,"/tmp/linphone.%i",getuid());
lockfile=fopen(lock_name,"w");
if (lockfile==NULL)
......@@ -60,7 +63,7 @@ int get_lock_file()
{
int pid;
FILE *lockfile;
snprintf(lock_name,80,"/tmp/linphone.%i",getuid());
lockfile=fopen(lock_name,"r");
if (lockfile==NULL)
......@@ -104,7 +107,7 @@ void check_sound_device(LinphoneCore *lc)
char *snd_pcm_oss=NULL;
char *snd_mixer_oss=NULL;
char *snd_pcm=NULL;
fd=open("/proc/modules",O_RDONLY);
if (fd>0){
/* read the entire /proc/modules file and check if sound conf seems correct */
......@@ -144,7 +147,7 @@ void check_sound_device(LinphoneCore *lc)
}
/* now check general volume. Some user forget to rise it and then complain that linphone is
not working */
/* but some other users complain that linphone should not change levels...
/* but some other users complain that linphone should not change levels...
if (lc->sound_conf.sndcard!=NULL){
a=snd_card_get_level(lc->sound_conf.sndcard,SND_CARD_LEVEL_GENERAL);
if (a<50){
......@@ -164,12 +167,12 @@ void check_sound_device(LinphoneCore *lc)
const char *payload_type_get_description(PayloadType *pt){
return _((const char *)pt->user_data);
}
}
void payload_type_set_enable(PayloadType *pt,int value)
void payload_type_set_enable(PayloadType *pt,int value)
{
if ((value)!=0) payload_type_set_flag(pt,PAYLOAD_TYPE_ENABLED); \
else payload_type_unset_flag(pt,PAYLOAD_TYPE_ENABLED);
else payload_type_unset_flag(pt,PAYLOAD_TYPE_ENABLED);
}
......@@ -266,7 +269,7 @@ bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType
/*let the video use all the bandwidth minus the maximum bandwidth used by audio */
if (min_video_bw>0)
pt->normal_bitrate=min_video_bw*1000;
else
else
pt->normal_bitrate=1500000; /*around 1.5 Mbit/s*/
ret=TRUE;
}
......@@ -274,7 +277,7 @@ bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType
break;
}
/*if (!ret) ms_warning("Payload %s is not usable with your internet connection.",pt->mime_type);*/
return ret;
}
......@@ -284,7 +287,7 @@ static PayloadType * find_payload(RtpProfile *prof, PayloadType *pt /*from confi
PayloadType *it;
for(i=0;i<127;++i){
it=rtp_profile_get_payload(prof,i);
if (it!=NULL && strcasecmp(pt->mime_type,it->mime_type)==0
if (it!=NULL && strcasecmp(pt->mime_type,it->mime_type)==0
&& (pt->clock_rate==it->clock_rate || pt->clock_rate<=0)
&& payload_type_get_user_data(it)==NULL ){
if ( (pt->recv_fmtp && it->recv_fmtp && strcasecmp(pt->recv_fmtp,it->recv_fmtp)==0) ||
......@@ -316,7 +319,7 @@ static MSList *fix_codec_list(RtpProfile *prof, MSList *conflist)
MSList *elem;
MSList *newlist=NULL;
PayloadType *payload,*confpayload;
for (elem=conflist;elem!=NULL;elem=ms_list_next(elem))
{
confpayload=(PayloadType*)elem->data;
......@@ -350,12 +353,12 @@ void linphone_core_setup_local_rtp_profile(LinphoneCore *lc)
PayloadType *payload;
bool_t prepend;
lc->local_profile=rtp_profile_clone_full(&av_profile);
/* first look at the list given by configuration file to see if
/* first look at the list given by configuration file to see if
it is correct */
audiopt=fix_codec_list(lc->local_profile,lc->codecs_conf.audio_codecs);
videopt=fix_codec_list(lc->local_profile,lc->codecs_conf.video_codecs);
/* now find and add payloads that are not listed in the configuration
codec list */
for (i=0;i<127;i++)
......@@ -384,7 +387,7 @@ void linphone_core_setup_local_rtp_profile(LinphoneCore *lc)
case PAYLOAD_AUDIO_CONTINUOUS:
case PAYLOAD_AUDIO_PACKETIZED:
if (prepend)
audiopt=ms_list_prepend(audiopt,(void *)payload);
audiopt=ms_list_prepend(audiopt,(void *)payload);
else
audiopt=ms_list_append(audiopt,(void *)payload);
break;
......@@ -427,6 +430,7 @@ int from_2char_without_params(osip_from_t *from,char **str)
}
bool_t lp_spawn_command_line_sync(const char *command, char **result,int *command_ret){
#if !defined(_WIN32_WCE)
FILE *f=popen(command,"r");
if (f!=NULL){
int err;
......@@ -442,6 +446,7 @@ bool_t lp_spawn_command_line_sync(const char *command, char **result,int *comman
if (command_ret!=NULL) *command_ret=err;
return TRUE;
}
#endif /*_WIN32_WCE*/
return FALSE;
}
......@@ -454,12 +459,12 @@ bool_t host_has_ipv6_network()
struct ifaddrs *ifp;
struct ifaddrs *ifpstart;
bool_t ipv6_present=FALSE;
if (getifaddrs (&ifpstart) < 0)
{
return FALSE;
}
for (ifp=ifpstart; ifp != NULL; ifp = ifp->ifa_next)
{
if (!ifp->ifa_addr)
......@@ -467,7 +472,7 @@ bool_t host_has_ipv6_network()
switch (ifp->ifa_addr->sa_family) {
case AF_INET:
break;
case AF_INET6:
ipv6_present=TRUE;
......@@ -608,7 +613,7 @@ void linphone_core_run_stun_tests(LinphoneCore *lc, LinphoneCall *call){
}
if (lc->vtable.display_status!=NULL)
lc->vtable.display_status(lc,_("Stun lookup in progress..."));
/*create the two audio and video RTP sockets, and send STUN message to our stun server */
sock1=create_socket(linphone_core_get_audio_port(lc));
if (sock1<0) return;
......
......@@ -138,9 +138,10 @@ case $target_os in
CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -D_WIN32_WCE -DORTP_STATIC"
CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC -D_WIN32_WCE"
dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
LIBS="$LIBS -lws2"
LIBS="$LIBS -lws2"
mingw_found=yes
;;
build_tests=no
;;
*mingw*)
CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
......@@ -158,6 +159,8 @@ esac
AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes)
AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
AC_CONFIG_COMMANDS([libtool-hacking],[
if test "$mingw_found" = "yes" ; then
echo "Hacking libtool to work with mingw..."
......
if BUILD_TESTS
noinst_PROGRAMS=echo ring mtudiscover bench
if BUILD_VIDEO
......@@ -31,3 +33,5 @@ INCLUDES=-I$(top_srcdir)/include/
AM_CFLAGS=-I$(top_srcdir) $(ORTP_CFLAGS) $(STRICT_OPTIONS) $(VIDEO_CFLAGS)
AM_LDFLAGS=-rdynamic
endif
Index: src/eXutils.c
===================================================================
--- src/eXutils.c (revision 1047)
+++ src/eXutils.c (working copy)
@@ -26,6 +26,7 @@
#include "eXosip2.h"
#if defined(_WIN32_WCE)
+#include <malloc.h>
#elif defined(WIN32)
#include <windns.h>
#include <malloc.h>
Index: include/osip2/internal.h
===================================================================
--- include/osip2/internal.h (revision 797)
+++ include/osip2/internal.h (working copy)
@@ -216,7 +216,7 @@
#include <windows.h>
#undef _WINSOCKAPI_
-#if (_WIN32_WINNT >= 0x0403)
+#if (_WIN32_WINNT >= 0x0403) && !defined(_WIN32_WCE)
#define OSIP_CRITICALSECTION_SPIN 4000
typedef struct
############################################################################
# builder-arm-mingw32ce.mk
# Copyright (C) 2009 Belledonne Communications,Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
host:=armv4-mingw32ce
config_site:=cegcc-config.site
library_mode:=""
libosip2_version:=svn
libeXosip2_version:=svn
config_site:=mingw32ce-config.site
library_mode:= --disable-shared --enable-static
libosip2_version:=797
libeXosip2_version:=1047
linphone_configure_controls?= --disable-video \
--with-readline=none \
--enable-gtk_ui=no \
--enable-console_ui=no \
--enable-ssl-hmac=no \
SPEEX_CFLAGS="-I$(prefix)/include" \
SPEEX_LIBS="-L$(prefix)/lib -lspeex "
......
############################################################################
# builder-generic.mk
# Copyright (C) 2009 Belledonne Communications,Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
host?=armv6-apple-darwin
config_site?=iphone-config.site
library_mode?= --disable-shared
......@@ -55,11 +77,15 @@ build-liblinphone: $(LINPHONE_SRC_DIR)/Makefile
clean-makefile-liblinphone:
cd $(LINPHONE_SRC_DIR) && rm Makefile && rm oRTP/Makefile && rm mediastreamer2/Makefile
clean-liblinphone:
cd $(LINPHONE_SRC_DIR) && make clean
#osip2
get_osip2_svn:
cd $(LINPHONE_SRC_DIR)/ \
&& svn co svn://svn.sv.gnu.org/osip/trunk/osip libosip2-$(libosip2_version)
&& svn co -r ${libosip2_version} svn://svn.sv.gnu.org/osip/trunk/osip libosip2-$(libosip2_version) \
&& cd libosip2-$(libosip2_version) \
&& patch -p0 < $(LINPHONE_SRC_DIR)/patches/libosip2-wince.patch
get_osip2_src:
cd $(LINPHONE_SRC_DIR)/ \
&& rm -f libosip2-$(libosip2_version).tar.gz \
......@@ -93,7 +119,9 @@ clean-makefile-osip2:
get_eXosip2_svn:
cd $(LINPHONE_SRC_DIR)/ \
&& svn co svn://svn.sv.gnu.org/exosip/trunk/exosip libeXosip2-$(libeXosip2_version)
&& svn co -r ${libeXosip2_version} svn://svn.sv.gnu.org/exosip/trunk/exosip libeXosip2-$(libeXosip2_version)\
&& cd libeXosip2-$(libeXosip2_version) \
&& patch -p0 < $(LINPHONE_SRC_DIR)/patches/libeXosip2-wince.patch
get_eXosip2_src:
cd $(LINPHONE_SRC_DIR)/ \
......
# -*- shell-script -*-
ARCH=arm4l
SDK_BIN_PATH=/opt/mingw32ce/bin
SYSROOT_PATH=/opt/mingw32ce
CC="${SDK_BIN_PATH}/arm-mingw32ce-gcc -isysroot=${SYSROOT_PATH}"
CXX="${SDK_BIN_PATH}/arm-mingw32ce-g++ -isysroot=${SYSROOT_PATH}"
LD="${SDK_BIN_PATH}/arm-mingw32ce-ld "
AR=${SDK_BIN_PATH}/arm-mingw32ce-ar
RANLIB=${SDK_BIN_PATH}/arm-mingw32ce-ranlib
CPPFLAGS="-D_WIN32_WCE -DUNICODE -Drewind="
#CFLAGS="-D_WIN32_WCE"
#LDFLAGS="-Wl,-syslibroot ${SYSROOT_PATH}"
LDFLAGS="-Wl,-L${SYSROOT_PATH}/arm-mingw32ce/lib -lws2"
############################################################################
# mingw32ce-config.site
# Copyright (C) 2009 Belledonne Communications,Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
SDK_BIN_PATH=/opt/mingw32ce/bin
SYSROOT_PATH=/opt/mingw32ce
CC="${SDK_BIN_PATH}/arm-mingw32ce-gcc -isysroot=${SYSROOT_PATH}"
CXX="${SDK_BIN_PATH}/arm-mingw32ce-g++ -isysroot=${SYSROOT_PATH}"
LD="${SDK_BIN_PATH}/arm-mingw32ce-ld "
AR=${SDK_BIN_PATH}/arm-mingw32ce-ar
RANLIB=${SDK_BIN_PATH}/arm-mingw32ce-ranlib
CPPFLAGS="-D_WIN32_WCE -DUNICODE -Drewind="
LDFLAGS="-L${SYSROOT_PATH}/arm-mingw32ce/lib -lws2"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment