From 7b5bb11138061d60559b4511f0d080fb01c041f2 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 27 Dec 2005 22:48:58 +0000 Subject: [PATCH] msvc build for mod_sndfile git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@215 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/mod_sndfile/mod_sndfile.c | 2 +- src/mod/mod_sndfile/mod_sndfilel.vcproj | 212 ++++++++++++ w32/vsnet/FreeSwitchCore.vcproj | 4 +- w32/vsnet/Freeswitch.sln | 9 + w32/vsnet/GetLibs.vbs | 59 ++++ w32/vsnet/Tools/libsndfile.vcproj | 423 ++++++++++++++++++++++++ 6 files changed, 706 insertions(+), 3 deletions(-) create mode 100644 src/mod/mod_sndfile/mod_sndfilel.vcproj create mode 100644 w32/vsnet/Tools/libsndfile.vcproj diff --git a/src/mod/mod_sndfile/mod_sndfile.c b/src/mod/mod_sndfile/mod_sndfile.c index 021c62db3f..94d1d5e1c3 100644 --- a/src/mod/mod_sndfile/mod_sndfile.c +++ b/src/mod/mod_sndfile/mod_sndfile.c @@ -189,7 +189,7 @@ switch_status sndfile_file_write (switch_file_handle *handle, void *data, size_t /* Registration */ -static char *supported_formats[0]; +static char *supported_formats[1]; static const switch_file_interface sndfile_file_interface = { /*.interface_name*/ modname, diff --git a/src/mod/mod_sndfile/mod_sndfilel.vcproj b/src/mod/mod_sndfile/mod_sndfilel.vcproj new file mode 100644 index 0000000000..79db6aea16 --- /dev/null +++ b/src/mod/mod_sndfile/mod_sndfilel.vcproj @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/w32/vsnet/FreeSwitchCore.vcproj b/w32/vsnet/FreeSwitchCore.vcproj index 88e6b0a5d7..7019833dc5 100644 --- a/w32/vsnet/FreeSwitchCore.vcproj +++ b/w32/vsnet/FreeSwitchCore.vcproj @@ -99,7 +99,7 @@ /> diff --git a/w32/vsnet/Freeswitch.sln b/w32/vsnet/Freeswitch.sln index 9fde6c40e4..d3cc1908cc 100644 --- a/w32/vsnet/Freeswitch.sln +++ b/w32/vsnet/Freeswitch.sln @@ -83,6 +83,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xmpp_event", "..\..\src {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "..\..\src\mod\mod_sndfile\mod_sndfilel.vcproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -157,6 +162,10 @@ Global {F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Debug|Win32.Build.0 = Release|Win32 {F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|Win32.ActiveCfg = Release|Win32 {F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|Win32.Build.0 = Release|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/w32/vsnet/GetLibs.vbs b/w32/vsnet/GetLibs.vbs index 326d488cd7..6671f34f96 100644 --- a/w32/vsnet/GetLibs.vbs +++ b/w32/vsnet/GetLibs.vbs @@ -16,6 +16,7 @@ BuildModSpeexCodec=False BuildModCodecG729=False BuildModCodecGSM=False BuildModXMPPEvent=False +BuildModsndfile=False quote=Chr(34) ScriptDir=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName)) @@ -54,6 +55,8 @@ If objArgs.Count >=1 Then BuildModCodecGSM=True Case "Mod_XMPPEvent" BuildModXMPPEvent=True + Case "Mod_sndfile" + BuildModsndfile=True Case Else BuildCore=True BuildModExosip=True @@ -62,6 +65,7 @@ If objArgs.Count >=1 Then BuildModSpeexCodec=True BuildModCodecG729=True BuildModXMPPEvent=True + BuildModsndfile=True End Select Else BuildCore=True @@ -71,6 +75,7 @@ Else BuildModSpeexCodec=True BuildModCodecG729=True BuildModXMPPEvent=True + BuildModsndfile=True End If @@ -106,6 +111,10 @@ If BuildModXMPPEvent Then BuildLibs_ModXMPPEvent BuildDebug, BuildRelease End If +If BuildModsndfile Then + BuildLibs_Modsndfile BuildDebug, BuildRelease +End If + WScript.Echo "Complete" Sub BuildLibs_Core(BuildDebug, BuildRelease) @@ -469,6 +478,56 @@ Sub BuildLibs_ModCodecGSM(BuildDebug, BuildRelease) 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_Modsndfile(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" + FSO.CopyFile Utilsdir & "libsndfile.vcproj", LibDestDir & "libsndfile\Win32\", True + End If + If FSO.FolderExists(LibDestDir & "libsndfile") Then + If BuildDebug Then + If Not FSO.FileExists(LibDestDir & "libsndfile\Win32\Debug\libsndfile.lib") Then + BuildViaVCBuild LibDestDir & "libsndfile\Win32\libsndfile.vcproj", "Debug" + End If + End If + If BuildRelease Then + If Not FSO.FileExists(LibDestDir & "libsndfile\Win32\Release\libsndfile.lib") Then + BuildViaVCBuild LibDestDir & "libsndfile\Win32\libsndfile.vcproj", "Release" + End If + End If + Else + Wscript.echo "Unable to download libsndfile" + End If + +End Sub + Sub UpgradeViaDevEnv(ProjectFile) Set oExec = WshShell.Exec(quote & DevEnv & quote & " " & quote & ProjectFile & quote & " /Upgrade ") Do While oExec.Status <> 1 diff --git a/w32/vsnet/Tools/libsndfile.vcproj b/w32/vsnet/Tools/libsndfile.vcproj new file mode 100644 index 0000000000..20ab562cc7 --- /dev/null +++ b/w32/vsnet/Tools/libsndfile.vcproj @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +