From f5672d2dff8a84c4ef1c87a06d6ee99621db81c3 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 22 Oct 2009 18:20:38 +0200 Subject: [PATCH] yet and other step to wince compilation --- linphone/configure.in | 5 ++ linphone/mediastreamer2/configure.ac | 9 ++- .../include/mediastreamer2/mediastream.h | 1 + linphone/oRTP/configure.ac | 16 +++++- linphone/po/Makefile.in.in | 4 +- linphone/scripts/builder-arm-ming32ce.mk | 26 +++++++++ linphone/scripts/builder-generic.mk | 56 ++++++++++--------- linphone/scripts/cegcc-config.site | 7 ++- 8 files changed, 90 insertions(+), 34 deletions(-) diff --git a/linphone/configure.in b/linphone/configure.in index e996f9951..9730803bc 100644 --- a/linphone/configure.in +++ b/linphone/configure.in @@ -35,6 +35,11 @@ AC_HEADER_STDC AM_PROG_CC_C_O case $target_os in + *mingw32ce) + CFLAGS="$CFLAGS -D_WIN32_WCE" + LIBS="$LIBS -lws2 -liphlpapi" + mingw_found=yes + ;; *mingw*) CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501" CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501" diff --git a/linphone/mediastreamer2/configure.ac b/linphone/mediastreamer2/configure.ac index 6b288b76e..ea26ee637 100644 --- a/linphone/mediastreamer2/configure.ac +++ b/linphone/mediastreamer2/configure.ac @@ -134,7 +134,14 @@ case $target_os in macosx_found=yes LIBS="$LIBS -framework CoreFoundation -framework Cocoa" ;; - *mingw*) + *mingw32ce) + 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" + mingw_found=yes + ;; + *mingw*) CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC" CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC" dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux diff --git a/linphone/mediastreamer2/include/mediastreamer2/mediastream.h b/linphone/mediastreamer2/include/mediastreamer2/mediastream.h index 88544f655..eadff1495 100644 --- a/linphone/mediastreamer2/include/mediastreamer2/mediastream.h +++ b/linphone/mediastreamer2/include/mediastreamer2/mediastream.h @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mediastreamer2/msvideo.h" #include "ortp/ortp.h" #include "ortp/event.h" +#include typedef enum EchoLimiterType{ ELInactive, diff --git a/linphone/oRTP/configure.ac b/linphone/oRTP/configure.ac index 696a7973f..8e8a5a513 100644 --- a/linphone/oRTP/configure.ac +++ b/linphone/oRTP/configure.ac @@ -99,8 +99,11 @@ case "$target_os" in PTHREAD_LDFLAGS="-pthread" ;; *mingw32ce) - CFLAGS="$CFLAGS -D_WIN32_WCE" - LIBS="$LIBS -lws2 -liphlpapi";; + CFLAGS="$CFLAGS -D_WIN32_WCE -D_WIN32_WINNT=0x0501 -DORTP_STATIC" + LIBS="$LIBS -lws2 -liphlpapi" + build_tests=no + mingw_found=yes + ;; *mingw*) CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501 -DORTP_STATIC" LIBS="$LIBS -lws2_32 -liphlpapi -lwinmm" @@ -108,6 +111,15 @@ case "$target_os" in ;; esac +AC_CONFIG_COMMANDS([libtool-hacking],[ +if test "$mingw_found" = "yes" ; then + echo "Hacking libtool to work with mingw..." + sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp + cp -f ./libtool.tmp ./libtool + rm -f ./libtool.tmp +fi +],[mingw_found=$mingw_found]) + dnl Checks for programs. AC_PROG_CC AC_LIBTOOL_WIN32_DLL diff --git a/linphone/po/Makefile.in.in b/linphone/po/Makefile.in.in index 57ef267b3..402a25f7a 100644 --- a/linphone/po/Makefile.in.in +++ b/linphone/po/Makefile.in.in @@ -21,7 +21,7 @@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ -SHELL = /bin/sh +SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -56,7 +56,7 @@ ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) -USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi) +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) diff --git a/linphone/scripts/builder-arm-ming32ce.mk b/linphone/scripts/builder-arm-ming32ce.mk index 30d8c652a..495901f1b 100644 --- a/linphone/scripts/builder-arm-ming32ce.mk +++ b/linphone/scripts/builder-arm-ming32ce.mk @@ -2,5 +2,31 @@ host:=armv4-mingw32ce config_site:=cegcc-config.site library_mode:="" libosip2_version:=svn +libeXosip2_version:=svn +linphone_configure_controls?= --disable-video \ + --with-readline=none \ + --enable-gtk_ui=no \ + --enable-ssl-hmac=no \ + SPEEX_CFLAGS="-I$(prefix)/include" \ + SPEEX_LIBS="-L$(prefix)/lib -lspeex " include builder-generic.mk + + +build-linphone: build-osip2 build-eXosip2 build-speex $(LINPHONE_SRC_DIR)/Makefile + cd $(LINPHONE_SRC_DIR) && make newdate && make && make install + +clean-linphone: clean-osip2 clean-eXosip2 clean-speex + cd $(LINPHONE_SRC_DIR) && make clean + +veryclean-linphone: clean-linphone veryclean-osip2 veryclean-eXosip2 veryclean-speex + cd $(LINPHONE_SRC_DIR) && make distclean + cd $(LINPHONE_SRC_DIR) && rm configure + +clean-makefile-linphone: clean-makefile-osip2 clean-makefile-eXosip2 + cd $(LINPHONE_SRC_DIR) && rm Makefile && rm oRTP/Makefile && rm mediastreamer2/Makefile + + +get_dependencies: get_osip2_svn get_eXosip2_svn get_speex_src + + diff --git a/linphone/scripts/builder-generic.mk b/linphone/scripts/builder-generic.mk index 61a498185..59fc53e8e 100644 --- a/linphone/scripts/builder-generic.mk +++ b/linphone/scripts/builder-generic.mk @@ -2,11 +2,19 @@ host?=armv6-apple-darwin config_site?=iphone-config.site library_mode?= --disable-shared libosip2_version?=3.3.0 -libeXosip2_version=3.3.0 +libeXosip2_version?=3.3.0 libspeex_version=1.2rc1 libgsm_version=1.0.13 -ifeq ($(target_arch),armv6) - SPEEX_CONFIGURE_OPTION := --enable-fixed-point +linphone_configure_controls?= --disable-video \ + --with-readline=none \ + --enable-gtk_ui=no \ + --enable-ssl-hmac=no \ + --enable-nonstandard-gsm \ + --with-gsm=$(prefix) \ + SPEEX_CFLAGS="-I$(prefix)/include" \ + SPEEX_LIBS="-L$(prefix)/lib -lspeex " +ifneq (,$(findstring arm,$(host))) + SPEEX_CONFIGURE_OPTION := --enable-fixed-point --disable-float-api #SPEEX_CONFIGURE_OPTION := --enable-arm5e-asm --enable-fixed-point endif @@ -35,29 +43,18 @@ $(LINPHONE_SRC_DIR)/configure: $(LINPHONE_SRC_DIR)/Makefile: $(LINPHONE_SRC_DIR)/configure cd $(LINPHONE_SRC_DIR) && \ - PKG_CONFIG_PATH=$(prefix)/ CONFIG_SITE=$(LINPHONE_SRC_DIR)/scripts/$(config_site) \ + PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(LINPHONE_SRC_DIR)/scripts/$(config_site) \ ./configure -prefix=$(prefix) --host=$(host) ${library_mode} \ - --disable-video --with-readline=none --enable-gtk_ui=no --enable-ssl-hmac=no --with-osip=$(prefix) \ - --enable-nonstandard-gsm --with-gsm=$(prefix) \ - SPEEX_CFLAGS="-I$(prefix)/include" \ - SPEEX_LIBS="-L$(prefix)/lib -lspeex " - -build-linphone: build-osip2 build-eXosip2 build-speex build-libgsm $(LINPHONE_SRC_DIR)/Makefile - cd $(LINPHONE_SRC_DIR) && make newdate && make && make install - -clean-linphone: clean-osip2 clean-eXosip2 clean-speex clean-libgsm clean-libgsm - cd $(LINPHONE_SRC_DIR) && make clean - -veryclean-linphone: clean-linphone veryclean-osip2 veryclean-eXosip2 veryclean-speex veryclean-libgsm - cd $(LINPHONE_SRC_DIR) && make distclean - cd $(LINPHONE_SRC_DIR) && rm configure - -clean-makefile-linphone: clean-makefile-osip2 clean-makefile-eXosip2 clean-makefile-speex - cd $(LINPHONE_SRC_DIR) && rm Makefile && rm oRTP/Makefile && rm mediastreamer2/Makefile + ${linphone_configure_controls} -get_dependencies: get_osip2_src get_eXosip2_src get_speex_src get_libgsm_src +#libphone only (asume dependencies are met) +build-liblinphone: $(LINPHONE_SRC_DIR)/Makefile + cd $(LINPHONE_SRC_DIR) && make newdate && make && make install +clean-makefile-liblinphone: + cd $(LINPHONE_SRC_DIR) && rm Makefile && rm oRTP/Makefile && rm mediastreamer2/Makefile + #osip2 get_osip2_svn: @@ -93,7 +90,11 @@ veryclean-osip2: clean-makefile-osip2: cd $(LINPHONE_SRC_DIR)/libosip2-$(libosip2_version) && rm Makefile #eXosip - + +get_eXosip2_svn: + cd $(LINPHONE_SRC_DIR)/ \ + && svn co svn://svn.sv.gnu.org/exosip/trunk/exosip libeXosip2-$(libeXosip2_version) + get_eXosip2_src: cd $(LINPHONE_SRC_DIR)/ \ && rm -f libeXosip2-$(libeXosip2_version).tar.gz \ @@ -101,10 +102,13 @@ get_eXosip2_src: && tar xvzf libeXosip2-$(libeXosip2_version).tar.gz \ && rm -rf libeXosip2-$(libeXosip2_version).tar.gz -$(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version)/Makefile: +$(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version)/configure: + cd $(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version) && ./autogen.sh + +$(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version)/Makefile: $(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version)/configure cd $(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version)/\ - && CONFIG_SITE=$(LINPHONE_SRC_DIR)/scripts/$(config_site) \ - ./configure -prefix=$(prefix) --host=$(host) ${library_mode} --enable-pthread + && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(LINPHONE_SRC_DIR)/scripts/$(config_site) \ + ./configure -prefix=$(prefix) --host=$(host) ${library_mode} --disable-tools build-eXosip2: $(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version)/Makefile cd $(LINPHONE_SRC_DIR)/libeXosip2-$(libeXosip2_version) && make && make install diff --git a/linphone/scripts/cegcc-config.site b/linphone/scripts/cegcc-config.site index d0b728026..8ffc17354 100644 --- a/linphone/scripts/cegcc-config.site +++ b/linphone/scripts/cegcc-config.site @@ -5,12 +5,13 @@ ARCH=arm4l SDK_BIN_PATH=/opt/mingw32ce/bin SYSROOT_PATH=/opt/mingw32ce -CC="${SDK_BIN_PATH}/arm-mingw32ce-gcc -std=c99 -isysroot=${SYSROOT_PATH}" +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="-Dasm=__asm -D_WIN32_WCE" -CFLAGS="-D_WIN32_WCE" +CPPFLAGS="-D_WIN32_WCE -DUNICODE -Drewind=" +#CFLAGS="-D_WIN32_WCE" #LDFLAGS="-Wl,-syslibroot ${SYSROOT_PATH}" LDFLAGS="-Wl,-L${SYSROOT_PATH}/arm-mingw32ce/lib -lws2"