From d5945f817480809e5ad95b69237509951b9d8c20 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 1 Jan 2006 04:53:18 +0000 Subject: [PATCH] add libresample to core libs in msvc build, rework GetLibs.vbs to be more sensible in it's structure, change jrtp4c build in msvc to build as part of mod_exosip instead of as a separate lib for build simplicity, squash numerous warnings in libiax2 and jrtp4c, delete FreeswitchPlusLibs.sln because we were not using it and not maintaining it. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@250 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/iax/src/iax.c | 27 +- libs/iax/src/iax2-parser.c | 8 +- libs/jrtp4c/src/jrtp4c.cpp | 2 +- libs/jrtp4c/src/jrtp4c.h | 20 +- src/mod/mod_exosip/mod_exosip.vcproj | 12 +- w32/vsnet/FreeSwitchCore.vcproj | 12 +- w32/vsnet/FreeswitchPlusLibs.sln | 188 ------------ w32/vsnet/GetLibs.vbs | 432 +++++++++++++-------------- 8 files changed, 243 insertions(+), 458 deletions(-) delete mode 100644 w32/vsnet/FreeswitchPlusLibs.sln diff --git a/libs/iax/src/iax.c b/libs/iax/src/iax.c index cc2d91a378..ae101b824c 100644 --- a/libs/iax/src/iax.c +++ b/libs/iax/src/iax.c @@ -32,6 +32,7 @@ #if defined(_MSC_VER) #define close _close #define inline __inline +#define strdup _strdup #endif void gettimeofday(struct timeval *tv, void /*struct timezone*/ *tz); @@ -567,7 +568,7 @@ int iax_get_netstats(struct iax_session *session, int *rtt, struct iax_netstat * static int calc_timestamp(struct iax_session *session, unsigned int ts, struct ast_frame *f) { - int ms; + unsigned int ms; time_in_ms_t time_in_ms; int voice = 0; int genuine = 0; @@ -926,7 +927,7 @@ int iax_init(int preferredportno) DEBU(G "Already initialized."); return 0; } - netfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + netfd = (int)socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); if (netfd < 0) { DEBU(G "Unable to allocate UDP socket\n"); IAXERROR "Unable to allocate UDP socket\n"); @@ -976,7 +977,7 @@ int iax_init(int preferredportno) #endif portno = ntohs(sin.sin_port); } - srand(time(NULL)); + srand((unsigned int)time(NULL)); callnums = rand() % 32767 + 1; transfer_id = rand() % 32767 + 1; DEBU(G "Started on port %d\n", portno); @@ -1609,7 +1610,7 @@ int iax_hangup(struct iax_session *session, char *byemsg) int iax_sendurl(struct iax_session *session, char *url) { - return send_command(session, AST_FRAME_HTML, AST_HTML_URL, 0, (unsigned char *) url, strlen(url), -1); + return send_command(session, AST_FRAME_HTML, AST_HTML_URL, 0, (unsigned char *) url, (int)strlen(url), -1); } int iax_ring_announce(struct iax_session *session) @@ -1653,12 +1654,12 @@ int iax_load_complete(struct iax_session *session) int iax_send_url(struct iax_session *session, char *url, int link) { - return send_command(session, AST_FRAME_HTML, link ? AST_HTML_LINKURL : AST_HTML_URL, 0, (unsigned char *) url, strlen(url), -1); + return send_command(session, AST_FRAME_HTML, link ? AST_HTML_LINKURL : AST_HTML_URL, 0, (unsigned char *) url, (int)strlen(url), -1); } int iax_send_text(struct iax_session *session, char *text) { - return send_command(session, AST_FRAME_TEXT, 0, 0, (unsigned char *) text, strlen(text) + 1, -1); + return send_command(session, AST_FRAME_TEXT, 0, 0, (unsigned char *) text, (int)strlen(text) + 1, -1); } int iax_send_unlink(struct iax_session *session) @@ -1687,7 +1688,7 @@ static int iax_send_pong(struct iax_session *session, unsigned int ts) iax_ie_append_int(&ied,IAX_IE_RR_LOSS, ((0xff & (stats.losspct/1000)) << 24 | (stats.frames_lost & 0x00ffffff))); iax_ie_append_int(&ied,IAX_IE_RR_PKTS, stats.frames_in); - iax_ie_append_short(&ied,IAX_IE_RR_DELAY, stats.current - stats.min); + iax_ie_append_short(&ied,IAX_IE_RR_DELAY, (unsigned short)(stats.current - stats.min)); iax_ie_append_int(&ied,IAX_IE_RR_DROPPED, stats.frames_dropped); iax_ie_append_int(&ied,IAX_IE_RR_OOO, stats.frames_ooo); } @@ -1767,8 +1768,8 @@ int iax_auth_reply(struct iax_session *session, char *password, char *challenge, memset(&ied, 0, sizeof(ied)); if ((methods & IAX_AUTH_MD5) && challenge) { MD5Init(&md5); - MD5Update(&md5, (const unsigned char *) challenge, strlen(challenge)); - MD5Update(&md5, (const unsigned char *) password, strlen(password)); + MD5Update(&md5, (const unsigned char *) challenge, (unsigned int)strlen(challenge)); + MD5Update(&md5, (const unsigned char *) password, (unsigned int)strlen(password)); MD5Final((unsigned char *) reply, &md5); memset(realreply, 0, sizeof(realreply)); convert_reply(realreply, (unsigned char *) reply); @@ -1790,8 +1791,8 @@ static int iax_regauth_reply(struct iax_session *session, char *password, char * iax_ie_append_short(&ied, IAX_IE_REFRESH, session->refresh); if ((methods & IAX_AUTHMETHOD_MD5) && challenge) { MD5Init(&md5); - MD5Update(&md5, (const unsigned char *) challenge, strlen(challenge)); - MD5Update(&md5, (const unsigned char *) password, strlen(password)); + MD5Update(&md5, (const unsigned char *) challenge, (unsigned int)strlen(challenge)); + MD5Update(&md5, (const unsigned char *) password, (unsigned int)strlen(password)); MD5Final((unsigned char *) reply, &md5); memset(realreply, 0, sizeof(realreply)); convert_reply(realreply, (unsigned char *) reply); @@ -1852,7 +1853,7 @@ char iax_pref_codec_add(struct iax_session *session, unsigned int format) void iax_pref_codec_del(struct iax_session *session, unsigned int format) { int diff = (int) 'A'; - int x; + size_t x; char old[32]; char remove = which_bit(format) + diff; @@ -2539,7 +2540,7 @@ static struct iax_event *iax_header_to_event(struct iax_session *session, session->capability = e->ies.capability; if (e->ies.codec_prefs) { strncpy(session->codec_order, e->ies.codec_prefs, sizeof(session->codec_order)); - session->codec_order_len = strlen(session->codec_order); + session->codec_order_len = (int)strlen(session->codec_order); } e->etype = IAX_EVENT_CONNECT; e = schedule_delivery(e, ts, updatehistory); diff --git a/libs/iax/src/iax2-parser.c b/libs/iax/src/iax2-parser.c index 1c91be3d81..eaaad16eac 100644 --- a/libs/iax/src/iax2-parser.c +++ b/libs/iax/src/iax2-parser.c @@ -239,21 +239,21 @@ static void dump_prov_ies(char *output, int maxlen, unsigned char *iedata, int l if (len < 2) return; strcpy(output, "\n"); - maxlen -= strlen(output); output += strlen(output); + maxlen -= (int)strlen(output); output += strlen(output); while(len > 2) { ie = iedata[0]; ielen = iedata[1]; if (ielen + 2> len) { snprintf(tmp, (int)sizeof(tmp), "Total Prov IE length of %d bytes exceeds remaining prov frame length of %d bytes\n", ielen + 2, len); strncpy(output, tmp, maxlen - 1); - maxlen -= strlen(output); output += strlen(output); + maxlen -= (int)strlen(output); output += strlen(output); return; } found = 0; if (!found) { snprintf(tmp, (int)sizeof(tmp), " Unknown Prov IE %03d : Present\n", ie); strncpy(output, tmp, maxlen - 1); - maxlen -= strlen(output); output += strlen(output); + maxlen -= (int)strlen(output); output += strlen(output); } iedata += (2 + ielen); len -= (2 + ielen); @@ -467,7 +467,7 @@ int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned shor int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, unsigned char *str) { - return iax_ie_append_raw(ied, ie, str, strlen((char *) str)); + return iax_ie_append_raw(ied, ie, str, (int)strlen((char *) str)); } int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char dat) diff --git a/libs/jrtp4c/src/jrtp4c.cpp b/libs/jrtp4c/src/jrtp4c.cpp index 395ead0e63..ac35ead75d 100644 --- a/libs/jrtp4c/src/jrtp4c.cpp +++ b/libs/jrtp4c/src/jrtp4c.cpp @@ -130,7 +130,7 @@ extern "C" { if ((pack = jrtp4c->session->GetNextPacket())) { - slen = pack->GetPayloadLength(); + slen = (int)pack->GetPayloadLength(); if (slen > datalen) { slen = datalen; diff --git a/libs/jrtp4c/src/jrtp4c.h b/libs/jrtp4c/src/jrtp4c.h index 99f203e7de..e222d26007 100644 --- a/libs/jrtp4c/src/jrtp4c.h +++ b/libs/jrtp4c/src/jrtp4c.h @@ -6,6 +6,14 @@ #ifndef CCRTP4C_H #define CCRTP4C_H +#ifdef WIN32 +#include +#pragma warning(disable: 4267) +#else +#include +#include +#endif // WIN32 + #ifdef __cplusplus #include #include @@ -13,18 +21,6 @@ #include #include #include -#ifndef WIN32 -#include -#include -#else -#include -#endif // WIN32 -#if 0 -#include -#include -#include -#include -#endif extern "C" { #endif diff --git a/src/mod/mod_exosip/mod_exosip.vcproj b/src/mod/mod_exosip/mod_exosip.vcproj index b9ff74cf56..014a0e56fb 100644 --- a/src/mod/mod_exosip/mod_exosip.vcproj +++ b/src/mod/mod_exosip/mod_exosip.vcproj @@ -43,7 +43,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE" Optimization="0" - AdditionalIncludeDirectories="..\..\include;..\..\..\libs\include;..\..\..\libs\libeXosip2\include;..\..\..\libs\osip\include;..\..\..\libs\jrtp4c\src;..\..\..\libs\osip\src\osipparser2" + AdditionalIncludeDirectories="..\..\include;..\..\..\libs\include;..\..\..\libs\libeXosip2\include;..\..\..\libs\osip\include;..\..\..\libs\jrtp4c\src;..\..\..\libs\osip\src\osipparser2;..\..\..\libs\jrtplib\src;"..\..\..\libs\jthread-1.1.2\src"" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS" GeneratePreprocessedFile="0" MinimalRebuild="true" @@ -66,7 +66,7 @@ + + diff --git a/w32/vsnet/FreeSwitchCore.vcproj b/w32/vsnet/FreeSwitchCore.vcproj index 5cae566011..dddb82de50 100644 --- a/w32/vsnet/FreeSwitchCore.vcproj +++ b/w32/vsnet/FreeSwitchCore.vcproj @@ -42,7 +42,7 @@ =2 Then Select Case objArgs(1) Case "Release" @@ -86,45 +95,62 @@ Else BuildSpiderMonkey=True End If +' ****************** +' Process lib builds +' ****************** If BuildCore Then - BuildLibs_Core BuildDebug, BuildRelease + If Not FSO.FolderExists(LibDestDir & "include") Then + FSO.CreateFolder(LibDestDir & "include") + End If + BuildLibs_apr BuildDebug, BuildRelease + FSO.CopyFile LibDestDir & "apr\include\*.h", LibDestDir & "include" + BuildLibs_apriconv BuildDebug, BuildRelease + FSO.CopyFile LibDestDir & "apr-iconv\include\*.h", LibDestDir & "include" + BuildLibs_aprutil BuildDebug, BuildRelease + FSO.CopyFile LibDestDir & "apr-util\include\*.h", LibDestDir & "include" + BuildLibs_libresample BuildDebug, BuildRelease + FSO.CopyFile LibDestDir & "libresample\include\*.h", LibDestDir & "include" + BuildLibs_sqlite BuildDebug, BuildRelease + FSO.CopyFile LibDestDir & "sqlite\*.h", LibDestDir & "include" End If If BuildModExosip Then - BuildLibs_ModExosip BuildDebug, BuildRelease + BuildLibs_libosip2 BuildDebug, BuildRelease + BuildLibs_exosip BuildDebug, BuildRelease + BuildLibs_jrtplib BuildDebug, BuildRelease End If If BuildModIaxChan Then - BuildLibs_ModIaxChan BuildDebug, BuildRelease + BuildLibs_libiax2 BuildDebug, BuildRelease End If If BuildModPortAudio Then - BuildLibs_ModPortAudio BuildDebug, BuildRelease + BuildLibs_portaudio BuildDebug, BuildRelease End If If BuildModSpeexCodec Then - BuildLibs_ModSpeexCodec BuildDebug, BuildRelease + BuildLibs_SpeexCodec BuildDebug, BuildRelease End If If BuildModCodecG729 Then - BuildLibs_ModCodecG729 BuildDebug, BuildRelease + BuildLibs_libg729 BuildDebug, BuildRelease End If If BuildModCodecGSM Then - BuildLibs_ModCodecGSM BuildDebug, BuildRelease + BuildLibs_libgsm BuildDebug, BuildRelease End If If BuildModXMPPEvent Then - BuildLibs_ModXMPPEvent BuildDebug, BuildRelease + BuildLibs_iksemel BuildDebug, BuildRelease End If If BuildModsndfile Then - BuildLibs_Modsndfile BuildDebug, BuildRelease + BuildLibs_libsndfile BuildDebug, BuildRelease End If If BuildModrawaudio Then - BuildLibs_Modrawaudio BuildDebug, BuildRelease + BuildLibs_libresample BuildDebug, BuildRelease End If If BuildSpiderMonkey Then @@ -133,63 +159,10 @@ End If WScript.Echo "Complete" -Sub BuildLibs_Core(BuildDebug, BuildRelease) -If Not FSO.FolderExists(LibDestDir & "include") Then - FSO.CreateFolder(LibDestDir & "include") -End If - If Not FSO.FolderExists(LibDestDir & "apr") Then - WgetUnTarGz "ftp://ftp.wayne.edu/apache/apr/apr-1.2.2.tar.gz", LibDestDir - If Not FSO.FolderExists(LibDestDir & "apr-1.2.2") Then - Wscript.echo "Unable to get apr from default download location, Trying backup location:" - WgetUnTarGz "http://www.sofaswitch.org/mikej/apr-1.2.2.tar.gz", LibDestDir - End If - RenameFolder LibDestDir & "apr-1.2.2", "apr" - FSO.CopyFile Utilsdir & "apr\apr.vcproj", LibDestDir & "apr\", True - FindReplaceInFile LibDestDir & "apr\file_io\unix\fullrw.c", "int i;", "unsigned int i;" - End If - If FSO.FolderExists(LibDestDir & "apr") Then - If BuildDebug Then - If Not FSO.FileExists(LibDestDir & "apr\LibD\apr-1.lib") Then - BuildViaVCBuild LibDestDir & "apr\apr.vcproj", "Debug" - FSO.CopyFile LibDestDir & "apr\include\*.h", LibDestDir & "include" - End If - End If - If BuildRelease Then - If Not FSO.FileExists(LibDestDir & "apr\LibR\apr-1.lib") Then - BuildViaVCBuild LibDestDir & "apr\apr.vcproj", "Release" - FSO.CopyFile LibDestDir & "apr\include\*.h", LibDestDir & "include" - End If - End If - Else - Wscript.echo "Unable to download APR" - End If - - If Not FSO.FolderExists(LibDestDir & "apr-iconv") Then - WgetUnTarGz "ftp://ftp.wayne.edu/apache/apr/apr-iconv-1.1.1.tar.gz", LibDestDir - If Not FSO.FolderExists(LibDestDir & "apr-iconv-1.1.1") Then - Wscript.echo "Unable to get apr-iconv from default download location, Trying backup location:" - WgetUnTarGz "http://www.sofaswitch.org/mikej/apr-iconv-1.1.1.tar.gz", LibDestDir - End If - RenameFolder LibDestDir & "apr-iconv-1.1.1", "apr-iconv" - FSO.CopyFile Utilsdir & "apr\apriconv.vcproj", LibDestDir & "apr-iconv\", True - End If - If FSO.FolderExists(LibDestDir & "apr-iconv") Then - If BuildDebug Then - If Not FSO.FileExists(LibDestDir & "apr-iconv\LibD\apriconv-1.lib") Then - BuildViaVCBuild LibDestDir & "apr-iconv\apriconv.vcproj", "Debug" - FSO.CopyFile LibDestDir & "apr-iconv\include\*.h", LibDestDir & "include" - End If - End If - If BuildRelease Then - If Not FSO.FileExists(LibDestDir & "apr-iconv\LibR\apriconv-1.lib") Then - BuildViaVCBuild LibDestDir & "apr-iconv\apriconv.vcproj", "Release" - FSO.CopyFile LibDestDir & "apr-iconv\include\*.h", LibDestDir & "include" - End If - End If - Else - Wscript.echo "Unable to download apr-iconv" - End If - +' ****************** +' Lib Build Sectiton +' ****************** +Sub BuildLibs_aprutil(BuildDebug, BuildRelease) If Not FSO.FolderExists(LibDestDir & "apr-util") Then WgetUnTarGz "ftp://ftp.wayne.edu/apache/apr/apr-util-1.2.2.tar.gz", LibDestDir If Not FSO.FolderExists(LibDestDir & "apr-util-1.2.2") Then @@ -211,7 +184,6 @@ End If End If If Not FSO.FileExists(LibDestDir & "apr-util\LibD\aprutil-1.lib") Then BuildViaVCBuild LibDestDir & "apr-util\aprutil.vcproj", "Debug" - FSO.CopyFile LibDestDir & "apr-util\include\*.h", LibDestDir & "include" End If End If If BuildRelease Then @@ -223,13 +195,161 @@ End If End If If Not FSO.FileExists(LibDestDir & "apr-util\LibR\aprutil-1.lib") Then BuildViaVCBuild LibDestDir & "apr-util\aprutil.vcproj", "Release" - FSO.CopyFile LibDestDir & "apr-util\include\*.h", LibDestDir & "include" End If End If Else Wscript.echo "Unable to download apr-util" End If +End Sub +Sub BuildLibs_apriconv(BuildDebug, BuildRelease) + If Not FSO.FolderExists(LibDestDir & "apr-iconv") Then + WgetUnTarGz "ftp://ftp.wayne.edu/apache/apr/apr-iconv-1.1.1.tar.gz", LibDestDir + If Not FSO.FolderExists(LibDestDir & "apr-iconv-1.1.1") Then + Wscript.echo "Unable to get apr-iconv from default download location, Trying backup location:" + WgetUnTarGz "http://www.sofaswitch.org/mikej/apr-iconv-1.1.1.tar.gz", LibDestDir + End If + RenameFolder LibDestDir & "apr-iconv-1.1.1", "apr-iconv" + FSO.CopyFile Utilsdir & "apr\apriconv.vcproj", LibDestDir & "apr-iconv\", True + End If + If FSO.FolderExists(LibDestDir & "apr-iconv") Then + If BuildDebug Then + If Not FSO.FileExists(LibDestDir & "apr-iconv\LibD\apriconv-1.lib") Then + BuildViaVCBuild LibDestDir & "apr-iconv\apriconv.vcproj", "Debug" + End If + End If + If BuildRelease Then + If Not FSO.FileExists(LibDestDir & "apr-iconv\LibR\apriconv-1.lib") Then + BuildViaVCBuild LibDestDir & "apr-iconv\apriconv.vcproj", "Release" + End If + End If + Else + Wscript.echo "Unable to download apr-iconv" + End If +End Sub + +Sub BuildLibs_apr(BuildDebug, BuildRelease) + If Not FSO.FolderExists(LibDestDir & "apr") Then + WgetUnTarGz "ftp://ftp.wayne.edu/apache/apr/apr-1.2.2.tar.gz", LibDestDir + If Not FSO.FolderExists(LibDestDir & "apr-1.2.2") Then + Wscript.echo "Unable to get apr from default download location, Trying backup location:" + WgetUnTarGz "http://www.sofaswitch.org/mikej/apr-1.2.2.tar.gz", LibDestDir + End If + RenameFolder LibDestDir & "apr-1.2.2", "apr" + FSO.CopyFile Utilsdir & "apr\apr.vcproj", LibDestDir & "apr\", True + FindReplaceInFile LibDestDir & "apr\file_io\unix\fullrw.c", "int i;", "unsigned int i;" + End If + If FSO.FolderExists(LibDestDir & "apr") Then + If BuildDebug Then + If Not FSO.FileExists(LibDestDir & "apr\LibD\apr-1.lib") Then + BuildViaVCBuild LibDestDir & "apr\apr.vcproj", "Debug" + End If + End If + If BuildRelease Then + If Not FSO.FileExists(LibDestDir & "apr\LibR\apr-1.lib") Then + BuildViaVCBuild LibDestDir & "apr\apr.vcproj", "Release" + End If + End If + Else + Wscript.echo "Unable to download APR" + End If +End Sub + +Sub BuildLibs_exosip(BuildDebug, BuildRelease) + If Not FSO.FolderExists(LibDestDir & "libeXosip2") Then + WgetUnTarGz "http://www.antisip.com/download/libeXosip2-2.2.2.tar.gz", LibDestDir + If Not FSO.FolderExists(LibDestDir & "libeXosip2-2.2.2") Then + Wscript.echo "Unable to get eXosip from default download location, Trying backup location:" + WgetUnTarGz "http://www.sofaswitch.org/mikej/libeXosip2-2.2.2.tar.gz", LibDestDir + End If + RenameFolder LibDestDir & "libeXosip2-2.2.2", "libeXosip2" + FindReplaceInFile LibDestDir & "libeXosip2\platform\vsnet\eXosip.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" + End If + If FSO.FolderExists(LibDestDir & "libeXosip2") Then + If BuildDebug Then + If Not FSO.FileExists(LibDestDir & "libeXosip2\platform\vsnet\Debug\exosip.lib") Then + BuildViaVCBuild LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj", "Debug" + End If + End If + If BuildRelease Then + If Not FSO.FileExists(LibDestDir & "libeXosip2\platform\vsnet\Release\exosip.lib") Then + BuildViaVCBuild LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj", "Release" + End If + End If + Else + Wscript.echo "Unable to download exosip" + End If +End Sub + +Sub BuildLibs_libosip2(BuildDebug, BuildRelease) + If Not FSO.FolderExists(LibDestDir & "osip") Then + WgetUnTarGz "http://www.antisip.com/download/libosip2-2.2.2.tar.gz", LibDestDir + If Not FSO.FolderExists(LibDestDir & "libosip2-2.2.2") Then + Wscript.echo "Unable to get osip from default download location, Trying backup location:" + WgetUnTarGz "http://www.sofaswitch.org/mikej/libosip2-2.2.2.tar.gz", LibDestDir + End If + RenameFolder LibDestDir & "libosip2-2.2.2", "osip" + FindReplaceInFile LibDestDir & "osip\platform\vsnet\osipparser2.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" + FindReplaceInFile LibDestDir & "osip\platform\vsnet\osip2.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" + End If + If FSO.FolderExists(LibDestDir & "osip") Then + If BuildDebug Then + If Not FSO.FileExists(LibDestDir & "osip\platform\vsnet\Debug\osip2.lib") Then + BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osip2.vcproj", "Debug" + BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osipparser2.vcproj", "Debug" + End If + End If + If BuildRelease Then + If Not FSO.FileExists(LibDestDir & "osip\platform\vsnet\Release\osip2.lib") Then + BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osip2.vcproj", "Release" + BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osipparser2.vcproj", "Release" + End If + End If + Else + Wscript.echo "Unable to download Osip" + End If +End Sub + +Sub BuildLibs_jrtplib(BuildDebug, BuildRelease) + If Not FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then + WgetUnTarGz "http://research.edm.luc.ac.be/jori/jthread/jthread-1.1.2.tar.gz", LibDestDir + If Not FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then + Wscript.echo "Unable to get JThread from default download location, Trying backup location:" + WgetUnTarGz "http://www.sofaswitch.org/mikej/jthread-1.1.2.tar.gz", LibDestDir + End If + FindReplaceInFile LibDestDir & "jthread-1.1.2\jthread.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" + End If + + If Not FSO.FolderExists(LibDestDir & "jrtplib") Then + WgetUnTarGz "http://research.edm.luc.ac.be/jori/jrtplib/jrtplib-3.3.0.tar.gz", LibDestDir + If Not FSO.FolderExists(LibDestDir & "jrtplib-3.3.0") Then + Wscript.echo "Unable to get JRTPLib from default download location, Trying backup location:" + WgetUnTarGz "http://www.sofaswitch.org/mikej/jrtplib-3.3.0.tar.gz", LibDestDir + End If + RenameFolder LibDestDir & "jrtplib-3.3.0", "jrtplib" + FindReplaceInFile LibDestDir & "jrtplib\jrtplib.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" + FindReplaceInFile LibDestDir & "jrtplib\jrtplib.vcproj", "WarningLevel=" & quote & "3" & quote, "WarningLevel=" & quote & "0" & quote + End If + + If FSO.FolderExists(LibDestDir & "jrtplib") And FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then + If BuildDebug Then + If (Not FSO.FileExists(LibDestDir & "jrtplib\Debug\jrtplib.lib")) Or (Not FSO.FileExists(LibDestDir & "jthread-1.1.2\Debug\jthread.lib")) Then + BuildViaVCBuild LibDestDir & "jthread-1.1.2\jthread.vcproj", "Debug" + BuildViaVCBuild LibDestDir & "jrtplib\jrtplib.vcproj", "Debug" + End If + End If + If BuildRelease Then + If (Not FSO.FileExists(LibDestDir & "jrtplib\Release\jrtplib.lib")) Or (Not FSO.FileExists(LibDestDir & "jthread-1.1.2\Release\jthread.lib")) Then + BuildViaVCBuild LibDestDir & "jthread-1.1.2\jthread.vcproj", "Release" + BuildViaVCBuild LibDestDir & "jrtplib\jrtplib.vcproj", "Release" + End If + End If + Else + Wscript.echo "Unable to download JRtplib" + End If +End Sub + +Sub BuildLibs_sqlite(BuildDebug, BuildRelease) If Not FSO.FolderExists(LibDestDir & "sqlite") Then WgetUnZip "http://www.sqlite.org/sqlite-source-3_2_7.zip", LibDestDir If Not FSO.FolderExists(LibDestDir & "sqlite-source-3_2_7") Then @@ -239,30 +359,24 @@ End If RenameFolder LibDestDir & "sqlite-source-3_2_7", "sqlite" FSO.CopyFile Utilsdir & "sqlite.vcproj", LibDestDir & "sqlite\", True FindReplaceInFile LibDestDir & "sqlite\sqlite.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" - ' Upgrade Utilsdir & "sqlite.vcproj", LibDestDir & "sqlite\sqlite.vcproj" - FSO.CopyFile LibDestDir & "sqlite\*.h", LibDestDir & "include" End If If FSO.FolderExists(LibDestDir & "sqlite") Then If BuildDebug Then If Not FSO.FileExists(LibDestDir & "sqlite\Debug\sqlite.lib") Then -' UpgradeViaDevEnv LibDestDir & "sqlite\sqlite.vcproj" BuildViaVCBuild LibDestDir & "sqlite\sqlite.vcproj", "Debug" End If End If If BuildRelease Then If Not FSO.FileExists(LibDestDir & "sqlite\Release\sqlite.lib") Then -' UpgradeViaDevEnv LibDestDir & "sqlite\sqlite.vcproj" BuildViaVCBuild LibDestDir & "sqlite\sqlite.vcproj", "Release" End If End If Else Wscript.echo "Unable to download SQLite" End If - End Sub - -Sub BuildLibs_ModXMPPEvent(BuildDebug, BuildRelease) +Sub BuildLibs_iksemel(BuildDebug, BuildRelease) If Not FSO.FolderExists(LibDestDir & "iksemel") Then WgetUnTarGz "http://jabberstudio.2nw.net/iksemel/iksemel-1.2.tar.gz", LibDestDir If Not FSO.FolderExists(LibDestDir & "iksemel-1.2") Then @@ -289,111 +403,7 @@ Sub BuildLibs_ModXMPPEvent(BuildDebug, BuildRelease) End If End Sub - -Sub BuildLibs_ModExosip(BuildDebug, BuildRelease) - - If Not FSO.FolderExists(LibDestDir & "osip") Then - WgetUnTarGz "http://www.antisip.com/download/libosip2-2.2.2.tar.gz", LibDestDir - If Not FSO.FolderExists(LibDestDir & "libosip2-2.2.2") Then - Wscript.echo "Unable to get osip from default download location, Trying backup location:" - WgetUnTarGz "http://www.sofaswitch.org/mikej/libosip2-2.2.2.tar.gz", LibDestDir - End If - RenameFolder LibDestDir & "libosip2-2.2.2", "osip" -' FSO.CopyFile Utilsdir & "osipparser2.vcproj", LibDestDir & "osip\platform\vsnet\", True -' FSO.CopyFile Utilsdir & "osip2.vcproj", LibDestDir & "osip\platform\vsnet\", True - FindReplaceInFile LibDestDir & "osip\platform\vsnet\osipparser2.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" - FindReplaceInFile LibDestDir & "osip\platform\vsnet\osip2.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" - End If - If FSO.FolderExists(LibDestDir & "osip") Then - If BuildDebug Then - If Not FSO.FileExists(LibDestDir & "osip\platform\vsnet\Debug\osip2.lib") Then -' UpgradeViaDevEnv LibDestDir & "osip\platform\vsnet\osip.sln" - BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osip2.vcproj", "Debug" - BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osipparser2.vcproj", "Debug" - End If - End If - If BuildRelease Then - If Not FSO.FileExists(LibDestDir & "osip\platform\vsnet\Release\osip2.lib") Then -' UpgradeViaDevEnv LibDestDir & "osip\platform\vsnet\osip.sln" - BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osip2.vcproj", "Release" - BuildViaVCBuild LibDestDir & "osip\platform\vsnet\osipparser2.vcproj", "Release" - End If - End If - Else - Wscript.echo "Unable to download Osip" - End If - - If Not FSO.FolderExists(LibDestDir & "libeXosip2") Then - WgetUnTarGz "http://www.antisip.com/download/libeXosip2-2.2.2.tar.gz", LibDestDir - If Not FSO.FolderExists(LibDestDir & "libeXosip2-2.2.2") Then - Wscript.echo "Unable to get eXosip from default download location, Trying backup location:" - WgetUnTarGz "http://www.sofaswitch.org/mikej/libeXosip2-2.2.2.tar.gz", LibDestDir - End If - RenameFolder LibDestDir & "libeXosip2-2.2.2", "libeXosip2" - FindReplaceInFile LibDestDir & "libeXosip2\platform\vsnet\eXosip.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" -' FSO.CopyFile Utilsdir & "eXosip.vcproj", LibDestDir & "libeXosip2\platform\vsnet\", True - End If - If FSO.FolderExists(LibDestDir & "libeXosip2") Then - If BuildDebug Then - If Not FSO.FileExists(LibDestDir & "libeXosip2\platform\vsnet\Debug\exosip.lib") Then -' UpgradeViaDevEnv LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj" - BuildViaVCBuild LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj", "Debug" - End If - End If - If BuildRelease Then - If Not FSO.FileExists(LibDestDir & "libeXosip2\platform\vsnet\Release\exosip.lib") Then -' UpgradeViaDevEnv LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj" - BuildViaVCBuild LibDestDir & "libeXosip2\platform\vsnet\exosip.vcproj", "Release" - End If - End If - Else - Wscript.echo "Unable to download exosip" - End If - - If Not FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then - WgetUnTarGz "http://research.edm.luc.ac.be/jori/jthread/jthread-1.1.2.tar.gz", LibDestDir - If Not FSO.FolderExists(LibDestDir & "jthread-1.1.2") Then - Wscript.echo "Unable to get JThread from default download location, Trying backup location:" - WgetUnTarGz "http://www.sofaswitch.org/mikej/jthread-1.1.2.tar.gz", LibDestDir - End If - FindReplaceInFile LibDestDir & "jthread-1.1.2\jthread.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" - End If - - If Not FSO.FolderExists(LibDestDir & "jrtplib") Then - WgetUnTarGz "http://research.edm.luc.ac.be/jori/jrtplib/jrtplib-3.3.0.tar.gz", LibDestDir - If Not FSO.FolderExists(LibDestDir & "jrtplib-3.3.0") Then - Wscript.echo "Unable to get JRTPLib from default download location, Trying backup location:" - WgetUnTarGz "http://www.sofaswitch.org/mikej/jrtplib-3.3.0.tar.gz", LibDestDir - End If - RenameFolder LibDestDir & "jrtplib-3.3.0", "jrtplib" - FindReplaceInFile LibDestDir & "jrtplib\jrtplib.vcproj", "WIN32;", "_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;" - FindReplaceInFile LibDestDir & "jrtplib\jrtplib.vcproj", "WarningLevel=" & quote & "3" & quote, "WarningLevel=" & quote & "0" & quote - End If - If FSO.FolderExists(LibDestDir & "jrtplib") And FSO.FolderExists(LibDestDir & "jthread-1.1.2") And FSO.FolderExists(LibDestDir & "jrtp4c")Then - If BuildDebug Then - If (Not FSO.FileExists(LibDestDir & "jrtp4c\w32\Debug\jrtp4c.lib")) Or (Not FSO.FileExists(LibDestDir & "jrtplib\Debug\jrtplib.lib")) Or (Not FSO.FileExists(LibDestDir & "jthread-1.1.2\Debug\jthread.lib")) Then -' UpgradeViaDevEnv LibDestDir & "jrtp4c\w32\jrtp4c.sln" - BuildViaVCBuild LibDestDir & "jrtp4c\w32\jrtp4c.vcproj", "Debug" - BuildViaVCBuild LibDestDir & "jrtplib\jrtplib.vcproj", "Debug" - BuildViaVCBuild LibDestDir & "jthread-1.1.2\jthread.vcproj", "Debug" - End If - End If - If BuildRelease Then - If (Not FSO.FileExists(LibDestDir & "jrtp4c\w32\Release\jrtp4c.lib")) Or (Not FSO.FileExists(LibDestDir & "jrtplib\Release\jrtplib.lib")) Or (Not FSO.FileExists(LibDestDir & "jthread-1.1.2\Release\jthread.lib")) Then -' UpgradeViaDevEnv LibDestDir & "jrtp4c\w32\jrtp4c.sln" - BuildViaVCBuild LibDestDir & "jrtp4c\w32\jrtp4c.vcproj", "Release" - BuildViaVCBuild LibDestDir & "jrtplib\jrtplib.vcproj", "Release" - BuildViaVCBuild LibDestDir & "jthread-1.1.2\jthread.vcproj", "Release" - End If - End If - Else - Wscript.echo "Unable to download JRtplib" - End If - - -End Sub - -Sub BuildLibs_ModIaxChan(BuildDebug, BuildRelease) +Sub BuildLibs_libiax2(BuildDebug, BuildRelease) If FSO.FolderExists(LibDestDir & "iax") Then If BuildDebug Then If Not FSO.FileExists(LibDestDir & "iax\Debug\libiax2.lib") Then @@ -408,10 +418,9 @@ Sub BuildLibs_ModIaxChan(BuildDebug, BuildRelease) Else Wscript.echo "Unable to download libIAX2" End If - End Sub -Sub BuildLibs_ModPortAudio(BuildDebug, BuildRelease) +Sub BuildLibs_portaudio(BuildDebug, BuildRelease) If Not FSO.FolderExists(LibDestDir & "PortAudio") Then WgetUnZip "http://www.sofaswitch.org/mikej/portaudio_v18_1.zip", LibDestDir RenameFolder LibDestDir & "portaudio_v18_1", "PortAudio" @@ -429,38 +438,10 @@ Sub BuildLibs_ModPortAudio(BuildDebug, BuildRelease) End If Else Wscript.echo "Unable to download PortAudio" - End If - + End If End Sub -Sub BuildLibs_ModSpeexCodec(BuildDebug, BuildRelease) - If Not FSO.FolderExists(LibDestDir & "speex") Then - WgetUnTarGz "http://downloads.us.xiph.org/releases/speex/speex-1.1.11.1.tar.gz", LibDestDir - If Not FSO.FolderExists(LibDestDir & "speex-1.1.11.1") Then - Wscript.echo "Unable to get libspeex from default download location, Trying backup location:" - WgetUnTarGz "http://www.sofaswitch.org/mikej/speex-1.1.11.1.tar.gz", LibDestDir - End If - RenameFolder LibDestDir & "speex-1.1.11.1", "speex" - FSO.CopyFile Utilsdir & "libspeex.vcproj", LibDestDir & "speex\win32\libspeex\", True - End If - If FSO.FolderExists(LibDestDir & "speex") Then - If BuildDebug Then - If Not FSO.FileExists(LibDestDir & "speex\win32\libspeex\Debug\libspeex.lib") Then - BuildViaVCBuild LibDestDir & "speex\win32\libspeex\libspeex.vcproj", "Debug" - End If - End If - If BuildRelease Then - If Not FSO.FileExists(LibDestDir & "speex\win32\libspeex\Release\libspeex.lib") Then - BuildViaVCBuild LibDestDir & "speex\win32\libspeex\libspeex.vcproj", "Release" - End If - End If - Else - Wscript.echo "Unable to download libspeex" - End If - -End Sub - -Sub BuildLibs_ModCodecG729(BuildDebug, BuildRelease) +Sub BuildLibs_libg729(BuildDebug, BuildRelease) If FSO.FolderExists(LibDestDir & "codec\libg729") Then If BuildDebug Then If Not FSO.FileExists(LibDestDir & "codec\libg729\Debug\libg729.lib") Then @@ -477,7 +458,7 @@ Sub BuildLibs_ModCodecG729(BuildDebug, BuildRelease) End If End Sub -Sub BuildLibs_ModCodecGSM(BuildDebug, BuildRelease) +Sub BuildLibs_libgsm(BuildDebug, BuildRelease) If FSO.FolderExists(LibDestDir & "codec\gsm") Then If BuildDebug Then If Not FSO.FileExists(LibDestDir & "codec\gsm\Debug\libgsm.lib") Then @@ -494,7 +475,7 @@ Sub BuildLibs_ModCodecGSM(BuildDebug, BuildRelease) End If End Sub -Sub BuildLibs_ModSpeexCodec(BuildDebug, BuildRelease) +Sub BuildLibs_SpeexCodec(BuildDebug, BuildRelease) If Not FSO.FolderExists(LibDestDir & "speex") Then WgetUnTarGz "http://downloads.us.xiph.org/releases/speex/speex-1.1.11.1.tar.gz", LibDestDir If Not FSO.FolderExists(LibDestDir & "speex-1.1.11.1") Then @@ -518,10 +499,9 @@ Sub BuildLibs_ModSpeexCodec(BuildDebug, BuildRelease) Else Wscript.echo "Unable to download libspeex" End If - End Sub -Sub BuildLibs_Modsndfile(BuildDebug, BuildRelease) +Sub BuildLibs_libsndfile(BuildDebug, BuildRelease) If Not FSO.FolderExists(LibDestDir & "libsndfile") Then WgetUnTarGz "http://www.sofaswitch.com/mikej/libsndfile-1.0.12.tar.gz", LibDestDir RenameFolder LibDestDir & "libsndfile-1.0.12", "libsndfile" @@ -541,10 +521,9 @@ Sub BuildLibs_Modsndfile(BuildDebug, BuildRelease) Else Wscript.echo "Unable to download libsndfile" End If - End Sub -Sub BuildLibs_Modrawaudio(BuildDebug, BuildRelease) +Sub BuildLibs_libresample(BuildDebug, BuildRelease) If Not FSO.FolderExists(LibDestDir & "libresample") Then WgetUnZip "http://www.sofaswitch.com/mikej/libresample-0.1.3.zip", LibDestDir RenameFolder LibDestDir & "libresample-0.1.3", "libresample" @@ -563,7 +542,6 @@ Sub BuildLibs_Modrawaudio(BuildDebug, BuildRelease) Else Wscript.echo "Unable to download libresample" End If - End Sub Sub BuildLibs_SpiderMonkey(BuildDebug, BuildRelease) @@ -593,9 +571,11 @@ Sub BuildLibs_SpiderMonkey(BuildDebug, BuildRelease) Else Wscript.echo "Unable to download spidermonkey" End If - End Sub +' ******************* +' Utility Subroutines +' ******************* Sub UpgradeViaDevEnv(ProjectFile) Set oExec = WshShell.Exec(quote & DevEnv & quote & " " & quote & ProjectFile & quote & " /Upgrade ") @@ -662,14 +642,11 @@ End Sub Sub RenameFolder(FolderName, NewFolderName) -'On Error Resume Next Set Folder=FSO.GetFolder(FolderName) Folder.Name = NewFolderName -'On Error GoTo 0 End Sub Sub Upgrade(OldFileName, NewFileName) -'On Error Resume Next If WshSysEnv("VS80COMNTOOLS")<> "" Then Wscript.echo "8.0" Set vcProj = CreateObject("VisualStudio.VCProjectEngine.8.0") @@ -682,10 +659,7 @@ Sub Upgrade(OldFileName, NewFileName) WScript.Quit(1) End If End If - - -' WScript.Echo("Converting: "+ OldFileName) - + Set vcProject = vcProj.LoadProject(OldFileName) If Not FSO.FileExists(vcProject.ProjectFile) Then ' // specify name and location of new project file @@ -698,7 +672,6 @@ Sub Upgrade(OldFileName, NewFileName) 'On Error GoTo 0 End Sub - Sub Unix2dos(FileName) Const OpenAsASCII = 0 ' Opens the file as ASCII (TristateFalse) Const OpenAsUnicode = -1 ' Opens the file as Unicode (TristateTrue) @@ -832,7 +805,6 @@ Sub Wget(URL, DestFolder) End Sub - Function Showpath(folderspec) Set f = FSO.GetFolder(folderspec) showpath = f.path & "\"