diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..06c92d07df --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +# gitattributes +*.exe -diff binary executable windows dfsg-nonfree debian-ignore +*.wav -diff binary sound +*.gif -diff binary image +*.jpg -diff binary image +*.jpeg -diff binary image +*.pbm -diff binary image +/clients/flex* dfsg-nonfree +/debian* debian-ignore +/freeswitch.xcodeproj debian-ignore +/libs/ilbc* dfsg-nonfree +/libs/libg722_1* dfsg-nonfree +/libs/win32* windows debian-ignore +/htdocs* dfsg-nonfree debian-ignore +/w32* windows debian-ignore diff --git a/.gitignore b/.gitignore index 55e1e9856b..f153ad6f7b 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ configure.lineno config.log config.status core.* +TAGS *.2010.log *.Build.CppClean.log *.tlog @@ -57,6 +58,7 @@ core.* !/w32/Setup/inno_setup/vcredist_x86.exe /.version +/.stamp-* /a.out.dSYM /AUTHORS /ChangeLog @@ -71,6 +73,7 @@ core.* /Makefile.in /modules.conf /NEWS +/noreg /Path /quiet_libtool /README @@ -199,3 +202,23 @@ src/mod/formats/mod_shout/*/*/mod_shout.log /src/mod/languages/mod_managed/x64/Release_CLR/FREESWITCH.MANAGED.DLL.metagen /src/mod/languages/mod_managed/x64/Release_CLR/RSAENH.DLL.bi /src/mod/languages/mod_managed/x64/Release_CLR/TZRES.DLL.bi +libs/apr-util/a.out.dSYM/Contents/Info.plist +libs/apr-util/a.out.dSYM/Contents/Resources/DWARF/a.out +libs/apr/a.out.dSYM/Contents/Info.plist +libs/apr/a.out.dSYM/Contents/Resources/DWARF/a.out +libs/iksemel/a.out.dSYM/Contents/Info.plist +libs/iksemel/a.out.dSYM/Contents/Resources/DWARF/a.out +libs/ilbc/a.out.dSYM/Contents/Info.plist +libs/ilbc/a.out.dSYM/Contents/Resources/DWARF/a.out +libs/libedit/a.out.dSYM/Contents/Info.plist +libs/libedit/a.out.dSYM/Contents/Resources/DWARF/a.out +libs/pcre/a.out.dSYM/Contents/Info.plist +libs/pcre/a.out.dSYM/Contents/Resources/DWARF/a.out +libs/sqlite/lemon.dSYM/Contents/Info.plist +libs/sqlite/lemon.dSYM/Contents/Resources/DWARF/lemon +libs/sqlite/mkkeywordhash.dSYM/Contents/Info.plist +libs/sqlite/mkkeywordhash.dSYM/Contents/Resources/DWARF/mkkeywordhash +libs/sqlite/sqlite3.dSYM/Contents/Info.plist +libs/sqlite/sqlite3.dSYM/Contents/Resources/DWARF/sqlite3 +libs/srtp/a.out.dSYM/Contents/Info.plist +libs/srtp/a.out.dSYM/Contents/Resources/DWARF/a.out diff --git a/Freeswitch.2008.sln b/Freeswitch.2008.sln index 30e947b575..781fdcb766 100644 --- a/Freeswitch.2008.sln +++ b/Freeswitch.2008.sln @@ -953,6 +953,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_abstraction", "src\mod\ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsmopen", "src\mod\endpoints\mod_gsmopen\mod_gsmopen.2008.vcproj", "{74B120FF-6935-4DFE-A142-CDB6BEA99C90}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "src\mod\endpoints\mod_gsmopen\gsmlib\gsmlib-1.10-patched-13ubuntu\win32\gsmlib.vcproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2698,6 +2705,20 @@ Global {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Release|Win32.Build.0 = Release|Win32 {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Release|x64.ActiveCfg = Release|x64 {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Release|x64.Build.0 = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|Win32.ActiveCfg = Release|Win32 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|Win32.Build.0 = Release|Win32 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.ActiveCfg = Release|Win32 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.ActiveCfg = Debug|Win32 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.ActiveCfg = Debug|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.ActiveCfg = Release|Win32 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|Win32.ActiveCfg = Debug|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|Win32.Build.0 = Debug|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.ActiveCfg = Debug|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.ActiveCfg = Debug|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2723,6 +2744,7 @@ Global {CC1DD008-9406-448D-A0AD-33C3186CFADB} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {48414740-C693-4968-9846-EE058020C64F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} + {74B120FF-6935-4DFE-A142-CDB6BEA99C90} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} @@ -2822,6 +2844,7 @@ Global {56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {B376D494-D7DD-4B2A-99E2-52916D5A8CD8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {23B4D303-79FC-49E0-89E2-2280E7E28940} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D} {4F92B672-DADB-4047-8D6A-4BB3796733FD} = {C120A020-773F-4EA3-923F-B67AF28B750D} {2DEE4895-1134-439C-B688-52203E57D878} = {C120A020-773F-4EA3-923F-B67AF28B750D} diff --git a/Freeswitch.2010.express.sln b/Freeswitch.2010.express.sln index b0df7d9c35..baea4a0c35 100644 --- a/Freeswitch.2010.express.sln +++ b/Freeswitch.2010.express.sln @@ -320,6 +320,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ldns", "libs\win32\ldns\ldn EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre Generate pcre_chartables.c", "libs\win32\pcre\pcre_chartables.c.2010.vcxproj", "{1CED5987-A529-46DC-B30F-870D85FF9C94}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzrtp", "libs\libzrtp\projects\win\libzrtp.2010.vcxproj", "{C13CC324-0032-4492-9A30-310A6BD64FF5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -1989,6 +1991,17 @@ Global {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.ActiveCfg = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.Build.0 = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|x64.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.ActiveCfg = Release|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x64.ActiveCfg = Release|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x64.Build.0 = Release|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.ActiveCfg = Debug|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.Build.0 = Debug|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.ActiveCfg = Debug|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.Build.0 = Debug|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.Build.0 = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.ActiveCfg = Release|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2089,6 +2102,7 @@ Global {ABB71A76-42B0-47A4-973A-42E3D920C6FD} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {9778F1C0-09BC-4698-8EBC-BD982247209A} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} + {C13CC324-0032-4492-9A30-310A6BD64FF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC} {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000} {ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000} diff --git a/Freeswitch.2010.sln b/Freeswitch.2010.sln index 5079f1f987..954ce1cc1b 100644 --- a/Freeswitch.2010.sln +++ b/Freeswitch.2010.sln @@ -521,6 +521,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_abstraction", "src\mod\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sms", "src\mod\applications\mod_sms\mod_sms.2010.vcxproj", "{2469B306-B027-4FF2-8815-C9C1EA2CAE79}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "src\mod\endpoints\mod_gsmopen\gsmlib\gsmlib-1.10-patched-13ubuntu\win32\gsmlib.2010.vcxproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsmopen", "src\mod\endpoints\mod_gsmopen\mod_gsmopen.2010.vcxproj", "{74B120FF-6935-4DFE-A142-CDB6BEA99C90}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzrtp", "libs\libzrtp\projects\win\libzrtp.2010.vcxproj", "{C13CC324-0032-4492-9A30-310A6BD64FF5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -3453,7 +3459,7 @@ Global {7C22BDFF-CC09-400C-8A09-660733980028}.Release|x64.ActiveCfg = Release|x64 {7C22BDFF-CC09-400C-8A09-660733980028}.Release|x64.Build.0 = Release|x64 {7C22BDFF-CC09-400C-8A09-660733980028}.Release|x64 Setup.ActiveCfg = Release|x64 - {7C22BDFF-CC09-400C-8A09-660733980028}.Release|x86 Setup.ActiveCfg = Release|x64 + {7C22BDFF-CC09-400C-8A09-660733980028}.Release|x86 Setup.ActiveCfg = Release|Win32 {23B4D303-79FC-49E0-89E2-2280E7E28940}.All|Win32.ActiveCfg = Release|x64 {23B4D303-79FC-49E0-89E2-2280E7E28940}.All|x64.ActiveCfg = Release|x64 {23B4D303-79FC-49E0-89E2-2280E7E28940}.All|x64.Build.0 = Release|x64 @@ -3470,7 +3476,7 @@ Global {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.ActiveCfg = Release|x64 {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.Build.0 = Release|x64 {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64 Setup.ActiveCfg = Release|x64 - {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x86 Setup.ActiveCfg = Release|x64 + {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x86 Setup.ActiveCfg = Release|Win32 {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|Win32.ActiveCfg = Release|x64 {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|x64.ActiveCfg = Release|x64 {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|x64.Build.0 = Release|x64 @@ -3483,7 +3489,7 @@ Global {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|Win32.ActiveCfg = Release|Win32 {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x64.ActiveCfg = Release|x64 {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x64 Setup.ActiveCfg = Release|x64 - {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x86 Setup.ActiveCfg = Release|x64 + {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x86 Setup.ActiveCfg = Release|Win32 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|Win32.ActiveCfg = Release|x64 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.ActiveCfg = Release|x64 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.Build.0 = Release|x64 @@ -3496,7 +3502,7 @@ Global {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|Win32.ActiveCfg = Release|Win32 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x64.ActiveCfg = Release|x64 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x64 Setup.ActiveCfg = Release|x64 - {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x86 Setup.ActiveCfg = Release|x64 + {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x86 Setup.ActiveCfg = Release|Win32 {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|Win32.ActiveCfg = Release|x64 {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x64.ActiveCfg = Release|x64 {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x64.Build.0 = Release|x64 @@ -3513,7 +3519,7 @@ Global {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x64.ActiveCfg = Release|x64 {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x64.Build.0 = Release|x64 {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x64 Setup.ActiveCfg = Release|x64 - {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x86 Setup.ActiveCfg = Release|x64 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x86 Setup.ActiveCfg = Release|Win32 {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|Win32.ActiveCfg = Release|x64 {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x64.ActiveCfg = Release|x64 {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x64.Build.0 = Release|x64 @@ -3530,7 +3536,7 @@ Global {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x64.ActiveCfg = Release|x64 {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x64.Build.0 = Release|x64 {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x64 Setup.ActiveCfg = Release|x64 - {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x86 Setup.ActiveCfg = Release|x64 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x86 Setup.ActiveCfg = Release|Win32 {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|Win32.ActiveCfg = Release|x64 {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x64.ActiveCfg = Release|x64 {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x64.Build.0 = Release|x64 @@ -3543,7 +3549,50 @@ Global {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|Win32.ActiveCfg = Release|Win32 {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64.ActiveCfg = Release|x64 {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64 Setup.ActiveCfg = Release|x64 - {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x86 Setup.ActiveCfg = Release|x64 + {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x86 Setup.ActiveCfg = Release|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|Win32.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.Build.0 = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64 Setup.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x86 Setup.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.ActiveCfg = Debug|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64 Setup.ActiveCfg = Debug|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x86 Setup.ActiveCfg = Debug|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64 Setup.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x86 Setup.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|Win32.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.Build.0 = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64 Setup.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x86 Setup.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.ActiveCfg = Debug|Win32 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.ActiveCfg = Debug|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64 Setup.ActiveCfg = Debug|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x86 Setup.ActiveCfg = Debug|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.ActiveCfg = Release|Win32 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64 Setup.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x86 Setup.ActiveCfg = Release|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.Build.0 = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x64.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x64 Setup.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x86 Setup.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.ActiveCfg = Debug|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.Build.0 = Debug|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.ActiveCfg = Debug|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.Build.0 = Debug|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64 Setup.ActiveCfg = Debug|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x86 Setup.ActiveCfg = Debug|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.Build.0 = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.ActiveCfg = Release|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.Build.0 = Release|x64 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64 Setup.ActiveCfg = Release|Win32 + {C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x86 Setup.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3569,6 +3618,7 @@ Global {48414740-C693-4968-9846-EE058020C64F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {05C9FB27-480E-4D53-B3B7-7338E2514666} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} + {74B120FF-6935-4DFE-A142-CDB6BEA99C90} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} @@ -3655,6 +3705,8 @@ Global {E4D29906-8B73-4F8A-B5F4-CA8BFA648F5A} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {23B4D303-79FC-49E0-89E2-2280E7E28940} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} + {C13CC324-0032-4492-9A30-310A6BD64FF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC} {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000} {ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000} diff --git a/Makefile.am b/Makefile.am index 9f6ab76916..12dc3fa05a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,11 +20,18 @@ DEFAULT_SOUNDS=en-us-callie-8000 sounds_version=`grep $$base_sound_dir $(switch_srcdir)/build/sounds_version.txt | cut -d ' ' -f2`;\ soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \ echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \ - if test "$$target" = "install"; then $(MAKE) $(AM_MAKEFLAGS) core_install; else $(MAKE) $(AM_MAKEFLAGS) core ; fi; \ if test "$$target_prefix" = "sounds"; then \ - if test "$$target" = "install"; then $(GETSOUNDS) $$soundfile $(DESTDIR)$(soundsdir)/; else $(GETSOUNDS) $$soundfile ; fi; \ + if test "$$target" = "install"; then \ + $(GETSOUNDS) $$soundfile $(DESTDIR)$(soundsdir)/;\ + else \ + $(GETSOUNDS) $$soundfile ; \ + fi; \ else \ - cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\ + if test "$$target" = "install"; then \ + $(MAKE) $(AM_MAKEFLAGS) core_install && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) core && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\ + fi; \ fi sounds: sounds-en-us-callie-8000 @@ -64,7 +71,7 @@ cd-moh-install: uhd-moh-install sounds-music-48000-install all-recursive: libfreeswitch.la clean-recusive: clean_core install-recursive: install-libLTLIBRARIES install-binPROGRAMS -$(RECURSIVE_TARGETS): +$(RECURSIVE_TARGETS): freeswitch @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -147,7 +154,16 @@ libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS) endif if ENABLE_ZRTP -libfreeswitch_la_LDFLAGS += -lzrtp -lbn +CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bgaes +CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bnlib +CORE_CFLAGS += -isystem $(switch_srcdir)/libs/libzrtp/include +ZRTP_LDFLAGS = -L$(switch_srcdir)/libs/libzrtp/third_party/bnlib +ZRTP_LDFLAGS += -L$(switch_srcdir)/libs/libzrtp/projects/gnu/build +ZRTP_LIBS = -lbn -lzrtp +libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS) +libfreeswitch_la_LIBADD += $(ZRTP_LIBS) +CORE_LIBS += libs/libzrtp/projects/gnu/build/libzrtp.a +LIBS += libs/libzrtp/third_party/bnlib/libbn.a endif library_includedir = $(includedir) @@ -402,8 +418,8 @@ $(switch_builddir)/quiet_libtool: $(switch_builddir)/libtool src/include/switch_version.h: src/include/switch_version.h.in .version $(libfreeswitch_la_SOURCES) $(library_include_HEADERS) @have_version=1 ; \ force=0 ; \ - grep "@SWITCH_VERSION_REVISION@" src/include/switch_version.h.in > /dev/null && have_version=0 ; \ - test ! -f src/include/switch_version.h || grep "@SWITCH_VERSION_REVISION@" src/include/switch_version.h > /dev/null && force=1 ; \ + grep -- "@SWITCH_VERSION_REVISION@" src/include/switch_version.h.in > /dev/null || have_version=0 ; \ + test ! -f src/include/switch_version.h || grep -- "@SWITCH_VERSION_REVISION@" src/include/switch_version.h > /dev/null && force=1 ; \ if test $$have_version = 1 ; then \ cat src/include/switch_version.h.in > src/include/switch_version.h ; \ touch .version ; \ @@ -429,6 +445,9 @@ src/include/switch_version.h: src/include/switch_version.h.in .version $(libfree libs/libedit/src/.libs/libedit.a: cd libs/libedit && $(MAKE) +libs/libzrtp/projects/gnu/build/libzrtp.a: + cd libs/libzrtp/projects/gnu && $(MAKE) + libs/curl/Makefile: cd libs/curl && sh ./configure.gnu --prefix=$(prefix) @@ -460,7 +479,6 @@ libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update @cd libs/srtp && $(MAKE) @$(TOUCH_TARGET) - ## ## helper targets ## diff --git a/bootstrap.sh b/bootstrap.sh index ff1f4550d0..5c9ab26f03 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,300 +1,372 @@ #!/bin/sh +##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- +##### bootstrap FreeSWITCH and FreeSWITCH libraries + echo "bootstrap: checking installation..." BGJOB=false -while getopts jh arg -do - case $arg in +VERBOSE=false +BASEDIR=`pwd`; +LIBDIR=${BASEDIR}/libs; +SUBDIRS="apr \ + libzrtp ilbc curl iksemel js js/nsprpub ldns libdingaling libedit libsndfile pcre sofia-sip \ + speex sqlite srtp openzap freetdm spandsp libg722_1 portaudio unimrcp tiff-3.8.2 broadvoice silk libcodec2 \ + fs"; + +while getopts 'jhd:v' o; do + case "$o" in j) BGJOB=true;; + d) SUBDIRS="$OPTARG";; + v) VERBOSE=true;; h) echo "Usage: $0 " - echo " Options:" - echo " -j => Run Jobs in Background" - exit;; + echo " Options:" + echo " -d 'library1 library2'" + echo " => Bootstrap only specified subdirectories" + echo " -j => Run Jobs in Background" + exit;; esac done -BASEDIR=`pwd`; -LIBDIR=${BASEDIR}/libs; -SUBDIRS="ilbc curl iksemel js js/nsprpub ldns libdingaling libedit libsndfile pcre sofia-sip \ - speex sqlite srtp openzap freetdm spandsp libg722_1 portaudio unimrcp tiff-3.8.2 broadvoice silk libcodec2"; +ex() { + test $VERBOSE && echo "bootstrap: $@" >&2 + $@ +} -if [ ! -f modules.conf ]; then +setup_modules() { + if [ ! -f modules.conf ]; then cp build/modules.conf.in modules.conf -fi + fi +} -# keep automake from making us magically GPL, and to stop complaining about missing files. -cp -f docs/COPYING . -cp -f docs/AUTHORS . -cp -f docs/ChangeLog . -touch NEWS -touch README +setup_gnu() { + # keep automake from making us magically GPL, and to stop + # complaining about missing files. + cp -f docs/COPYING . + cp -f docs/AUTHORS . + cp -f docs/ChangeLog . + touch NEWS + touch README +} -# autoconf 2.59 or newer -ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;s/[- ].*//g;q'` -if test -z "$ac_version"; then -echo "bootstrap: autoconf not found." -echo " You need autoconf version 2.59 or newer installed" -echo " to build FreeSWITCH from source." -exit 1 -fi +check_ac_ver() { + # autoconf 2.59 or newer + ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;s/[- ].*//g;q'` + if test -z "$ac_version"; then + echo "bootstrap: autoconf not found." + echo " You need autoconf version 2.59 or newer installed" + echo " to build FreeSWITCH from source." + exit 1 + fi + if test `uname -s` = "OpenBSD" && test "$ac_version" = "2.62"; then + echo "Autoconf 2.62 is broken on OpenBSD, please try another version" + exit 1 + fi + IFS=_; set $ac_version; IFS=' ' + ac_version=$1 + IFS=.; set $ac_version; IFS=' ' + if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then + echo "bootstrap: autoconf version $ac_version found." + echo " You need autoconf version 2.59 or newer installed" + echo " to build FreeSWITCH from source." + exit 1 + else + echo "bootstrap: autoconf version $ac_version (ok)" + fi +} -if test `uname -s` = "OpenBSD" && test "$ac_version" = "2.62"; then -echo "Autoconf 2.62 is broken on OpenBSD, please try another version" -exit 1 -fi +check_am_ver() { + # automake 1.7 or newer + am_version=`${AUTOMAKE:-automake} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;s/[- ].*//g;q'` + if test -z "$am_version"; then + echo "bootstrap: automake not found." + echo " You need automake version 1.7 or newer installed" + echo " to build FreeSWITCH from source." + exit 1 + fi + IFS=_; set $am_version; IFS=' ' + am_version=$1 + IFS=.; set $am_version; IFS=' ' + if test "$1" = "1" -a "$2" -lt "7"; then + echo "bootstrap: automake version $am_version found." + echo " You need automake version 1.7 or newer installed" + echo " to build FreeSWITCH from source." + exit 1 + else + echo "bootstrap: automake version $am_version (ok)" + fi +} -IFS=_; set $ac_version; IFS=' ' -ac_version=$1 -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then -echo "bootstrap: autoconf version $ac_version found." -echo " You need autoconf version 2.59 or newer installed" -echo " to build FreeSWITCH from source." -exit 1 -else -echo "bootstrap: autoconf version $ac_version (ok)" -fi +check_acl_ver() { + # aclocal 1.7 or newer + acl_version=`${ACLOCAL:-aclocal} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;s/[- ].*//g;q'` + if test -z "$acl_version"; then + echo "bootstrap: aclocal not found." + echo " You need aclocal version 1.7 or newer installed" + echo " to build FreeSWITCH from source." + exit 1 + fi + IFS=_; set $acl_version; IFS=' ' + acl_version=$1 + IFS=.; set $acl_version; IFS=' ' + if test "$1" = "1" -a "$2" -lt "7"; then + echo "bootstrap: aclocal version $acl_version found." + echo " You need aclocal version 1.7 or newer installed" + echo " to build FreeSWITCH from source." + exit 1 + else + echo "bootstrap: aclocal version $acl_version (ok)" + fi +} +check_lt_ver() { + # Sample libtool --version outputs: + # ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11) + # ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a + # output is multiline from 1.5 onwards -# automake 1.7 or newer + # Require libtool 1.4 or newer + libtool=${LIBTOOL:-`${LIBDIR}/apr/build/PrintPath glibtool libtool libtool22 libtool15 libtool14`} + lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` + if test -z "$lt_pversion"; then + echo "bootstrap: libtool not found." + echo " You need libtool version 1.5.14 or newer to build FreeSWITCH from source." + exit 1 + fi + lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` + IFS=.; set $lt_version; IFS=' ' + lt_status="good" -am_version=`${AUTOMAKE:-automake} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;s/[- ].*//g;q'` -if test -z "$am_version"; then -echo "bootstrap: automake not found." -echo " You need automake version 1.7 or newer installed" -echo " to build FreeSWITCH from source." -exit 1 -fi -IFS=_; set $am_version; IFS=' ' -am_version=$1 -IFS=.; set $am_version; IFS=' ' -if test "$1" = "1" -a "$2" -lt "7"; then -echo "bootstrap: automake version $am_version found." -echo " You need automake version 1.7 or newer installed" -echo " to build FreeSWITCH from source." -exit 1 -else -echo "bootstrap: automake version $am_version (ok)" -fi + if test -z "$1"; then a=0 ; else a=$1;fi + if test -z "$2"; then b=0 ; else b=$2;fi + if test -z "$3"; then c=0 ; else c=$3;fi + lt_major=$a -# aclocal 1.7 or newer - -acl_version=`${ACLOCAL:-aclocal} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;s/[- ].*//g;q'` -if test -z "$acl_version"; then -echo "bootstrap: aclocal not found." -echo " You need aclocal version 1.7 or newer installed" -echo " to build FreeSWITCH from source." -exit 1 -fi -IFS=_; set $acl_version; IFS=' ' -acl_version=$1 -IFS=.; set $acl_version; IFS=' ' -if test "$1" = "1" -a "$2" -lt "7"; then -echo "bootstrap: aclocal version $acl_version found." -echo " You need aclocal version 1.7 or newer installed" -echo " to build FreeSWITCH from source." -exit 1 -else -echo "bootstrap: aclocal version $acl_version (ok)" -fi - -# Sample libtool --version outputs: -# ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11) -# ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a -# output is multiline from 1.5 onwards - -# Require libtool 1.4 or newer -libtool=${LIBTOOL:-`${LIBDIR}/apr/build/PrintPath glibtool libtool libtool22 libtool15 libtool14`} -lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` -if test -z "$lt_pversion"; then - echo "bootstrap: libtool not found." - echo " You need libtool version 1.5.14 or newer to build FreeSWITCH from source." - exit 1 -fi -lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` -IFS=.; set $lt_version; IFS=' ' -lt_status="good" - -if test -z "$1"; then a=0 ; else a=$1;fi -if test -z "$2"; then b=0 ; else b=$2;fi -if test -z "$3"; then c=0 ; else c=$3;fi -lt_major=$a - -if test "$a" -eq "2"; then - lt_status="good" -elif test "$a" -lt "2"; then - if test "$b" -lt "5" -o "$b" = "5" -a "$c" -lt "14" ; then + if test "$a" -eq "2"; then + lt_status="good" + elif test "$a" -lt "2"; then + if test "$b" -lt "5" -o "$b" = "5" -a "$c" -lt "14" ; then lt_status="bad" - fi -else + fi + else lt_status="bad" -fi -if test $lt_status = "good"; then - echo "bootstrap: libtool version $lt_pversion (ok)" -else - echo "bootstrap: libtool version $lt_pversion found." - echo " You need libtool version 1.5.14 or newer to build FreeSWITCH from source." - exit 1 -fi + fi + if test $lt_status = "good"; then + echo "bootstrap: libtool version $lt_pversion (ok)" + else + echo "bootstrap: libtool version $lt_pversion found." + echo " You need libtool version 1.5.14 or newer to build FreeSWITCH from source." + exit 1 + fi +} -# check libtoolize availability -if [ -n "${LIBTOOL}" ]; then +check_libtoolize() { + # check libtoolize availability + if [ -n "${LIBTOOL}" ]; then libtoolize=${LIBTOOLIZE:-`dirname "${libtool}"`/libtoolize} -else + else libtoolize=${LIBTOOLIZE:-`${LIBDIR}/apr/build/PrintPath glibtoolize libtoolize libtoolize22 libtoolize15 libtoolize14`} -fi -if [ "x$libtoolize" = "x" ]; then + fi + if [ "x$libtoolize" = "x" ]; then echo "libtoolize not found in path" exit 1 -fi -if [ ! -x "$libtoolize" ]; then + fi + if [ ! -x "$libtoolize" ]; then echo "$libtoolize does not exist or is not executable" exit 1 -fi - -# compare libtool and libtoolize version -ltl_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` -ltl_version=`echo $ltl_pversion|sed -e 's/\([a-z]*\)$/.\1/'` -IFS=.; set $ltl_version; IFS=' ' - -if [ "x${lt_version}" != "x${ltl_version}" ]; then - echo "$libtool and $libtoolize have different versions" - exit 1 -fi - - -# -# Info output -# -echo "Bootstrapping using:" -echo " autoconf : ${AUTOCONF:-`which autoconf`}" -echo " automake : ${AUTOMAKE:-`which automake`}" -echo " aclocal : ${ACLOCAL:-`which aclocal`}" -echo " libtool : ${libtool} (${lt_version})" -echo " libtoolize: ${libtoolize}" -echo - -echo "Entering directory ${LIBDIR}/apr" -cd ${LIBDIR}/apr - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# - -# bootstrap: Build the support scripts needed to compile from a -# checked-out version of the source code. - -# Create the libtool helper files -# -# Note: we copy (rather than link) them to simplify distribution. -# Note: APR supplies its own config.guess and config.sub -- we do not -# rely on libtool's versions -# -echo "Copying libtool helper files ..." - -# Remove any libtool files so one can switch between libtool 1.3 -# and libtool 1.4 by simply rerunning the bootstrap script. -(cd build ; rm -f ltconfig ltmain.sh libtool.m4) - -if ${libtoolize} -n --install >/dev/null 2>&1 ; then - $libtoolize --force --copy --install -else - $libtoolize --force --copy -fi - -if [ -f libtool.m4 ]; then - ltfile=`pwd`/libtool.m4 -else - if [ $lt_major -eq 2 ]; then - ltfindcmd="`sed -n \"/aclocaldir=/{s/.*=/echo /p;q;}\" < $libtoolize`" - ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`/libtool.m4} - else - ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ - < $libtoolize`" - ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} - fi - # Expecting the code above to be very portable, but just in case... - if [ -z "$ltfile" -o ! -f "$ltfile" ]; then - ltpath=`dirname $libtoolize` - ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 - fi -fi - -if [ ! -f $ltfile ]; then - echo "$ltfile not found" - exit 1 -fi - -echo "bootstrap: Using libtool.m4 at ${ltfile}." - -cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 - -# libtool.m4 from 1.6 requires ltsugar.m4 -if [ -f ltsugar.m4 ]; then - rm -f build/ltsugar.m4 - mv ltsugar.m4 build/ltsugar.m4 -fi - -# Clean up any leftovers -rm -f aclocal.m4 libtool.m4 - -# fix for FreeBSD (at least): -# libtool.m4 is in share/aclocal, while e.g. aclocal19 only looks in share/aclocal19 -# get aclocal's default directory and include the libtool.m4 directory via -I if -# it's in a different location - -aclocal_dir="`${ACLOCAL:-aclocal} --print-ac-dir`" - -if [ -n "${aclocal_dir}" -a -n "${ltfile}" -a "`dirname ${ltfile}`" != "${aclocal_dir}" ] ; then - ACLOCAL_OPTS="-I `dirname ${ltfile}`" -fi - -### run aclocal -echo "Re-creating aclocal.m4 ..." -${ACLOCAL:-aclocal} ${ACLOCAL_OPTS} - -### do some work to toss config.cache? -echo "Creating configure ..." -${AUTOCONF:-autoconf} - -# -# Generate the autoconf header -# -echo "Creating include/arch/unix/apr_private.h.in ..." -${AUTOHEADER:-autoheader} - -# Libs automake automation function -libbootstrap() -{ - i=$1 - if [ -d ${LIBDIR}/${i} ] ; then - echo "Entering directory ${LIBDIR}/${i}" - cd ${LIBDIR}/${i} - rm -f aclocal.m4 - CFFILE= - if [ -f ${LIBDIR}/${i}/configure.in ] ; then - CFFILE="${LIBDIR}/${i}/configure.in" - else - if [ -f ${LIBDIR}/${i}/configure.ac ] ; then - CFFILE="${LIBDIR}/${i}/configure.ac" - fi fi - if [ ! -z ${CFFILE} ] ; then + # compare libtool and libtoolize version + ltl_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` + ltl_version=`echo $ltl_pversion|sed -e 's/\([a-z]*\)$/.\1/'` + IFS=.; set $ltl_version; IFS=' ' + if [ "x${lt_version}" != "x${ltl_version}" ]; then + echo "$libtool and $libtoolize have different versions" + exit 1 + fi +} + +check_make() { + # + # Check to make sure we have GNU Make installed + # + + make=`which make` + if [ -x "$make" ]; then + make_version=`$make --version | grep GNU` + if [ $? -ne 0 ]; then + make=`which gmake` + if [ -x "$make" ]; then + make_version=`$make --version | grep GNU` + if [ $? -ne 0 ]; then + echo "GNU Make does not exist or is not executable" + exit 1; + fi + fi + fi + fi +} + + +check_awk() { + # TODO: Building with mawk on at least Debian squeeze is know to + # work, but mawk is believed to fail on some systems. If we can + # replicate this, we need a particular behavior that we can test + # here to verify whether we have an acceptable awk. + : +} + + + +print_autotools_vers() { + # + # Info output + # + echo "Bootstrapping using:" + echo " autoconf : ${AUTOCONF:-`which autoconf`}" + echo " automake : ${AUTOMAKE:-`which automake`}" + echo " aclocal : ${ACLOCAL:-`which aclocal`}" + echo " libtool : ${libtool} (${lt_version})" + echo " libtoolize: ${libtoolize}" + echo " make : ${make} (${make_version})" + echo " awk : ${awk} (${awk_version})" + echo +} + +bootstrap_apr() { + echo "Entering directory ${LIBDIR}/apr" + cd ${LIBDIR}/apr + + # Licensed to the Apache Software Foundation (ASF) under one or more + # contributor license agreements. See the NOTICE file distributed with + # this work for additional information regarding copyright ownership. + # The ASF licenses this file to You under the Apache License, Version 2.0 + # (the "License"); you may not use this file except in compliance with + # the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # + # + + # bootstrap: Build the support scripts needed to compile from a + # checked-out version of the source code. + + # Create the libtool helper files + # + # Note: we copy (rather than link) them to simplify distribution. + # Note: APR supplies its own config.guess and config.sub -- we do not + # rely on libtool's versions + # + echo "Copying libtool helper files ..." + + # Remove any libtool files so one can switch between libtool 1.3 + # and libtool 1.4 by simply rerunning the bootstrap script. + (cd build ; rm -f ltconfig ltmain.sh libtool.m4) + + if ${libtoolize} -n --install >/dev/null 2>&1 ; then + $libtoolize --force --copy --install + else + $libtoolize --force --copy + fi + + if [ -f libtool.m4 ]; then + ltfile=`pwd`/libtool.m4 + else + if [ $lt_major -eq 2 ]; then + ltfindcmd="`sed -n \"/aclocaldir=/{s/.*=/echo /p;q;}\" < $libtoolize`" + ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`/libtool.m4} + else + ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ + < $libtoolize`" + ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} + fi + # Expecting the code above to be very portable, but just in case... + if [ -z "$ltfile" -o ! -f "$ltfile" ]; then + ltpath=`dirname $libtoolize` + ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 + fi + fi + + if [ ! -f $ltfile ]; then + echo "$ltfile not found" + exit 1 + fi + + echo "bootstrap: Using libtool.m4 at ${ltfile}." + + cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 + + # libtool.m4 from 1.6 requires ltsugar.m4 + if [ -f ltsugar.m4 ]; then + rm -f build/ltsugar.m4 + mv ltsugar.m4 build/ltsugar.m4 + fi + + # Clean up any leftovers + rm -f aclocal.m4 libtool.m4 + + # fix for FreeBSD (at least): + # libtool.m4 is in share/aclocal, while e.g. aclocal19 only looks in share/aclocal19 + # get aclocal's default directory and include the libtool.m4 directory via -I if + # it's in a different location + + aclocal_dir="`${ACLOCAL:-aclocal} --print-ac-dir`" + + if [ -n "${aclocal_dir}" -a -n "${ltfile}" -a "`dirname ${ltfile}`" != "${aclocal_dir}" ] ; then + ACLOCAL_OPTS="-I `dirname ${ltfile}`" + fi + + ### run aclocal + echo "Re-creating aclocal.m4 ..." + ${ACLOCAL:-aclocal} ${ACLOCAL_OPTS} + + ### do some work to toss config.cache? + rm -rf config.cache + + echo "Creating configure ..." + ${AUTOCONF:-autoconf} + + # + # Generate the autoconf header + # + echo "Creating include/arch/unix/apr_private.h.in ..." + ${AUTOHEADER:-autoheader} + + # Remove autoconf 2.5x's cache directory + rm -rf autom4te*.cache + + echo "Entering directory ${LIBDIR}/apr-util" + cd ${LIBDIR}/apr-util + ./buildconf +} + +bootstrap_libzrtp() { + (cd ${LIBDIR}/libzrtp/projects/gnu && ./bootstrap.sh) +} + +# Libs automake automation function +libbootstrap() { + i=$1 + if [ -d ${LIBDIR}/${i} ]; then + echo "Entering directory ${LIBDIR}/${i}" + ex cd ${LIBDIR}/${i} + ex rm -f aclocal.m4 + CFFILE= + if [ -f ${LIBDIR}/${i}/configure.in ]; then + CFFILE="${LIBDIR}/${i}/configure.in" + else + if [ -f ${LIBDIR}/${i}/configure.ac ]; then + CFFILE="${LIBDIR}/${i}/configure.ac" + fi + fi + + if [ ! -z ${CFFILE} ]; then LTTEST=`grep "AC_PROG_LIBTOOL" ${CFFILE}` LTTEST2=`grep "AM_PROG_LIBTOOL" ${CFFILE}` AMTEST=`grep "AM_INIT_AUTOMAKE" ${CFFILE}` @@ -303,71 +375,101 @@ libbootstrap() AXTEST=`grep "ACX_LIBTOOL_C_ONLY" ${CFFILE}` echo "Creating aclocal.m4" - ${ACLOCAL:-aclocal} ${ACLOCAL_OPTS} ${ACLOCAL_FLAGS} + ex ${ACLOCAL:-aclocal} ${ACLOCAL_OPTS} ${ACLOCAL_FLAGS} -#only run if AC_PROG_LIBTOOL is in configure.in/configure.ac - if [ ! -z "${LTTEST}" -o "${LTTEST2}" -o "${AXTEST}" ] ; then - echo "Running libtoolize..." - if ${libtoolize} -n --install >/dev/null 2>&1 ; then - $libtoolize --force --copy --install - else - $libtoolize --force --copy - fi + # only run if AC_PROG_LIBTOOL is in configure.in/configure.ac + if [ ! -z "${LTTEST}" -o "${LTTEST2}" -o "${AXTEST}" ]; then + echo "Running libtoolize..." + if ${libtoolize} -n --install >/dev/null 2>&1; then + ex $libtoolize --force --copy --install + else + ex $libtoolize --force --copy + fi fi echo "Creating configure" - ${AUTOCONF:-autoconf} + ex ${AUTOCONF:-autoconf} -#only run if AC_CONFIG_HEADERS is found in configure.in/configure.ac - if [ ! -z "${AHTEST}" ] ; then - echo "Running autoheader..." - ${AUTOHEADER:-autoheader} ; + # only run if AC_CONFIG_HEADERS is found in configure.in/configure.ac + if [ ! -z "${AHTEST}" ]; then + echo "Running autoheader..." + ex ${AUTOHEADER:-autoheader}; fi -#run if AM_INIT_AUTOMAKE / AC_PROG_INSTALL is in configure.in/configure.ac - if [ ! -z "${AMTEST}" -o "${AMTEST2}" ] ; then - echo "Creating Makefile.in" - ${AUTOMAKE:-automake} --no-force --add-missing --copy ; + # run if AM_INIT_AUTOMAKE / AC_PROG_INSTALL is in configure.in/configure.ac + if [ ! -z "${AMTEST}" -o "${AMTEST2}" ]; then + echo "Creating Makefile.in" + ex ${AUTOMAKE:-automake} --no-force --add-missing --copy; fi - rm -rf autom4te*.cache - fi + ex rm -rf autom4te*.cache + fi else - echo "Skipping directory ${LIBDIR}/${i}" + echo "Skipping directory ${LIBDIR}/${i}" fi } +bootstrap_fs() { + cd ${BASEDIR} + rm -f aclocal.m4 + ${ACLOCAL:-aclocal} ${ACLOCAL_OPTS} + $libtoolize --copy --automake + ${AUTOCONF:-autoconf} + ${AUTOHEADER:-autoheader} + ${AUTOMAKE:-automake} --no-force --add-missing --copy + rm -rf autom4te*.cache +} -# Remove autoconf 2.5x's cache directory -rm -rf autom4te*.cache +bootstrap_libs_pre() { + case "$1" in + *) return 0;; + esac +} -echo "Entering directory ${LIBDIR}/apr-util" -cd ${LIBDIR}/apr-util -if [ "${BGJOB}" = "false" ] ; then - ./buildconf -else - ./buildconf & -fi +bootstrap_libs_post() { + case "$1" in + ldns) + cd $BASEDIR/libs/ldns + if test ! -x install-sh; then + ex automake --add-missing --copy + ex rm -rf autom4te*.cache + fi + ;; + esac +} +bootstrap_libs() { + for i in ${SUBDIRS}; do + case "$i" in + apr|fs|libzrtp) + ${BGJOB} && wait + bootstrap_$i + continue + ;; + esac + bootstrap_libs_pre ${i} + if ! ${BGJOB}; then + libbootstrap ${i} ; bootstrap_libs_post ${i} + else + (libbootstrap ${i} ; bootstrap_libs_post ${i}) & + fi + done + ${BGJOB} && wait +} -for i in ${SUBDIRS} -do - if [ "${BGJOB}" = "false" ] ; then - libbootstrap ${i} - else - libbootstrap ${i} & - fi -done +run() { + setup_modules + setup_gnu + check_make + check_awk + check_ac_ver + check_am_ver + check_acl_ver + check_lt_ver + check_libtoolize + print_autotools_vers + bootstrap_libs + return 0 +} -if [ "${BGJOB}" = "true" ] ; then - wait -fi -cd ${BASEDIR} - -rm -f aclocal.m4 -${ACLOCAL:-aclocal} ${ACLOCAL_OPTS} -$libtoolize --copy --automake -${AUTOCONF:-autoconf} -${AUTOHEADER:-autoheader} -${AUTOMAKE:-automake} --no-force --add-missing --copy -rm -rf autom4te*.cache +run diff --git a/build/freeswitch.init.suse b/build/freeswitch.init.suse index 2859ddc501..29f832d86a 100644 --- a/build/freeswitch.init.suse +++ b/build/freeswitch.init.suse @@ -46,12 +46,7 @@ # Voice Platform ### END INIT INFO # -# Check for missing binaries (stale symlinks should not happen) -# Note: Special treatment of stop for LSB conformance FREESWITCH_BIN=/opt/freeswitch/bin/freeswitch -test -x $FREESWITCH_BIN || { echo "$FREESWITCH_BIN not installed"; - if [ "$1" = "stop" ]; then exit 0; - else exit 5; fi; } # Check for existence of needed config file and read it FREESWITCH_CONFIG=/etc/sysconfig/freeswitch @@ -62,6 +57,12 @@ test -r $FREESWITCH_CONFIG || { echo "$FREESWITCH_CONFIG not existing"; # Read config . $FREESWITCH_CONFIG +# Check for missing binaries (stale symlinks should not happen) +# Note: Special treatment of stop for LSB conformance +test -x $FREESWITCH_BIN || { echo "$FREESWITCH_BIN not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + # Source LSB init functions # providing start_daemon, killproc, pidofproc, # log_success_msg, log_failure_msg and log_warning_msg. @@ -202,7 +203,7 @@ case "$1" in ## argument to this init script which is required for a reload. ## Note: probe is not (yet) part of LSB (as of 1.9) - test /opt/freeswitch/conf/freeswitch.xml -nt /opt/freeswitch/run/freeswitch.pid && echo reload + test ${FREESWITCH_HOME}/conf/freeswitch.xml -nt ${FREESWITCH_HOME}/run/freeswitch.pid && echo reload ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" diff --git a/build/getlib.sh.in b/build/getlib.sh.in index bbfe696f79..f18ec1da2d 100755 --- a/build/getlib.sh.in +++ b/build/getlib.sh.in @@ -1,4 +1,5 @@ #!/bin/sh +##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- TAR=@TAR@ ZCAT=@ZCAT@ @@ -8,39 +9,39 @@ WGET=@WGET@ CURL=@CURL@ if [ -f "$WGET" ]; then - DOWNLOAD_CMD=$WGET + DOWNLOAD_CMD=$WGET elif [ -f "$CURL" ]; then - DOWNLOAD_CMD="$CURL -O" + DOWNLOAD_CMD="$CURL -O" fi if [ -n "`echo $1 | grep '://'`" ]; then - base=$1/ - tarfile=$2 + base=$1/ + tarfile=$2 else - base=http://files.freeswitch.org/downloads/libs/ - tarfile=$1 + base=http://files.freeswitch.org/downloads/libs/ + tarfile=$1 fi uncompressed=`echo $tarfile | sed 's/\(\(\.tar\.gz\|\.tar\.bz2\|\.tar\.xz\)\|\(\.tgz\|\.tbz2\)\)$//'` case `echo $tarfile | sed 's/^.*\.//'` in - bz2|tbz2) UNZIPPER=$BZIP ;; - xz) UNZIPPER=$XZ ;; - gz|tgz|*) UNZIPPER=$ZCAT ;; + bz2|tbz2) UNZIPPER=$BZIP ;; + xz) UNZIPPER=$XZ ;; + gz|tgz|*) UNZIPPER=$ZCAT ;; esac if [ ! -d $tarfile ]; then + if [ ! -f $tarfile ]; then + rm -fr $uncompressed + $DOWNLOAD_CMD $base$tarfile if [ ! -f $tarfile ]; then - rm -fr $uncompressed - $DOWNLOAD_CMD $base$tarfile - if [ ! -f $tarfile ]; then - echo cannot find $tarfile - exit 1 - fi - fi - if [ ! -d $uncompressed ]; then - $UNZIPPER -c -d $tarfile | $TAR -xf - + echo cannot find $tarfile + exit 1 fi + fi + if [ ! -d $uncompressed ]; then + $UNZIPPER -c -d $tarfile | $TAR -xf - + fi fi exit 0 diff --git a/build/getsounds.sh.in b/build/getsounds.sh.in index 09105fd280..3f14eab822 100755 --- a/build/getsounds.sh.in +++ b/build/getsounds.sh.in @@ -1,4 +1,5 @@ #!/bin/sh +##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- TAR=@TAR@ ZCAT=@ZCAT@ @@ -7,11 +8,11 @@ CURL=@CURL@ DIR=`pwd` -if [ -x "$WGET" ] ; then - DOWNLOAD_CMD=$WGET +if [ -x "$WGET" ]; then + DOWNLOAD_CMD=$WGET fi if [ "x${DOWNLOAD_CMD}" = "x" -a -x "$CURL" ] ; then - DOWNLOAD_CMD="$CURL -O" + DOWNLOAD_CMD="$CURL -O" fi base=http://files.freeswitch.org/ @@ -22,17 +23,22 @@ echo -n "#" pwd echo "# $0 $1 $2" -if [ ! -f $tarfile ] ; then - $DOWNLOAD_CMD $base$tarfile - if [ ! -f $tarfile ] ; then - echo cannot find $tarfile - exit 1 - fi +if [ -n "$FS_SOUNDS_DIR" ]; then + [ -d $FS_SOUNDS_DIR ] || mkdir -p $FS_SOUNDS_DIR + DIR=$FS_SOUNDS_DIR fi -if [ ! -z $install ] ; then - test -d $install || mkdir $install - cd $install && $ZCAT -c -d $DIR/$tarfile | $TAR xf - +if [ ! -f $DIR/$tarfile ]; then + (cd $DIR && $DOWNLOAD_CMD $base$tarfile) + if [ ! -f $DIR/$tarfile ]; then + echo "cannot find $tarfile" + exit 1 + fi +fi + +if [ ! -z "$install" ]; then + test -d $install || mkdir $install + (cd $install && $ZCAT -c -d $DIR/$tarfile | $TAR xf -) fi exit 0 diff --git a/build/ignore_helper.pl b/build/ignore_helper.pl index cc89c6814c..154afc7d4c 100644 --- a/build/ignore_helper.pl +++ b/build/ignore_helper.pl @@ -1,6 +1,6 @@ ################################################################################ # ignore_helper.pl -# Copyright (c) 2007-2009 Anthony Minessale II +# Copyright (c) 2007-2012 Anthony Minessale II # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation diff --git a/build/next-release.txt b/build/next-release.txt new file mode 100644 index 0000000000..996f71d3b9 --- /dev/null +++ b/build/next-release.txt @@ -0,0 +1 @@ +1.2-rc3 diff --git a/build/set-fs-version.sh b/build/set-fs-version.sh new file mode 100755 index 0000000000..6743b58b5f --- /dev/null +++ b/build/set-fs-version.sh @@ -0,0 +1,16 @@ +#!/bin/sh +##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- + +sdir="." +[ -n "${0%/*}" ] && sdir="${0%/*}" +. $sdir/../scripts/ci/common.sh + +check_pwd +check_input_ver_build $@ +in_ver="$1" +if [ "$in_ver" = "auto" ]; then + in_ver="$(cat build/next-release.txt)" +fi +eval $(parse_version "$in_ver") +set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" + diff --git a/conf/insideout/autoload_configs/modules.conf.xml b/conf/insideout/autoload_configs/modules.conf.xml index 8793a003ba..3c864aec1c 100644 --- a/conf/insideout/autoload_configs/modules.conf.xml +++ b/conf/insideout/autoload_configs/modules.conf.xml @@ -60,7 +60,7 @@ - + diff --git a/conf/insideout/sip_profiles/external.xml b/conf/insideout/sip_profiles/external.xml index 6f6045255d..f021a4c3c6 100644 --- a/conf/insideout/sip_profiles/external.xml +++ b/conf/insideout/sip_profiles/external.xml @@ -1,4 +1,4 @@ - + @@ -29,10 +29,10 @@ - @@ -47,8 +47,10 @@ + + diff --git a/conf/insideout/sip_profiles/external/example.xml b/conf/insideout/sip_profiles/external/example.xml index 7ac8db1186..c6b79e8fe3 100644 --- a/conf/insideout/sip_profiles/external/example.xml +++ b/conf/insideout/sip_profiles/external/example.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/insideout/sip_profiles/internal-ipv6.xml b/conf/insideout/sip_profiles/internal-ipv6.xml index 856ac4905d..b9907a78ad 100644 --- a/conf/insideout/sip_profiles/internal-ipv6.xml +++ b/conf/insideout/sip_profiles/internal-ipv6.xml @@ -53,36 +53,39 @@ - + - + - - - - + + + + + + + - + - + - + @@ -128,4 +131,3 @@ - diff --git a/conf/insideout/sip_profiles/internal.xml b/conf/insideout/sip_profiles/internal.xml index a6010b2945..e406cd5e72 100644 --- a/conf/insideout/sip_profiles/internal.xml +++ b/conf/insideout/sip_profiles/internal.xml @@ -1,7 +1,7 @@ @@ -16,24 +16,24 @@ - + - + - + @@ -63,7 +63,7 @@ - + @@ -88,36 +88,39 @@ - + - + - - - - + + + + + + + - + - + - + @@ -138,7 +141,7 @@ - + @@ -158,24 +161,24 @@ - + - + @@ -186,4 +189,3 @@ - diff --git a/conf/insideout/sip_profiles/internal/example.xml b/conf/insideout/sip_profiles/internal/example.xml index 7ac8db1186..c6b79e8fe3 100644 --- a/conf/insideout/sip_profiles/internal/example.xml +++ b/conf/insideout/sip_profiles/internal/example.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/sbc/autoload_configs/modules.conf.xml b/conf/sbc/autoload_configs/modules.conf.xml index 31b96dd27a..fb59b386be 100644 --- a/conf/sbc/autoload_configs/modules.conf.xml +++ b/conf/sbc/autoload_configs/modules.conf.xml @@ -39,7 +39,7 @@ - + diff --git a/conf/sbc/sbc_profiles/external.xml b/conf/sbc/sbc_profiles/external.xml index d16813960f..0f15159f58 100644 --- a/conf/sbc/sbc_profiles/external.xml +++ b/conf/sbc/sbc_profiles/external.xml @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ - + @@ -30,10 +30,10 @@ - @@ -48,8 +48,10 @@ + + diff --git a/conf/sbc/sbc_profiles/external/example.xml b/conf/sbc/sbc_profiles/external/example.xml index 7ac8db1186..c6b79e8fe3 100644 --- a/conf/sbc/sbc_profiles/external/example.xml +++ b/conf/sbc/sbc_profiles/external/example.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/sbc/sbc_profiles/internal-ipv6.xml b/conf/sbc/sbc_profiles/internal-ipv6.xml index 856ac4905d..b9907a78ad 100644 --- a/conf/sbc/sbc_profiles/internal-ipv6.xml +++ b/conf/sbc/sbc_profiles/internal-ipv6.xml @@ -53,36 +53,39 @@ - + - + - - - - + + + + + + + - + - + - + @@ -128,4 +131,3 @@ - diff --git a/conf/sbc/sbc_profiles/internal.xml b/conf/sbc/sbc_profiles/internal.xml index d06e3a76cd..3081052c88 100644 --- a/conf/sbc/sbc_profiles/internal.xml +++ b/conf/sbc/sbc_profiles/internal.xml @@ -1,7 +1,7 @@ @@ -15,24 +15,24 @@ - + - + - + @@ -69,7 +69,7 @@ - + @@ -94,36 +94,39 @@ - + - + - - - - + + + + + + + - + - + - + @@ -154,24 +157,24 @@ - + - + @@ -182,4 +185,3 @@ - diff --git a/conf/sbc/sbc_profiles/internal/example.xml b/conf/sbc/sbc_profiles/internal/example.xml index 7ac8db1186..c6b79e8fe3 100644 --- a/conf/sbc/sbc_profiles/internal/example.xml +++ b/conf/sbc/sbc_profiles/internal/example.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/softphone/freeswitch.xml b/conf/softphone/freeswitch.xml index 00a2bc31cb..66e7c2a923 100644 --- a/conf/softphone/freeswitch.xml +++ b/conf/softphone/freeswitch.xml @@ -3,7 +3,7 @@ - + @@ -86,10 +86,8 @@ - - diff --git a/conf/vanilla/autoload_configs/conference.conf.xml b/conf/vanilla/autoload_configs/conference.conf.xml index 5a906f91cd..826f6fb9be 100644 --- a/conf/vanilla/autoload_configs/conference.conf.xml +++ b/conf/vanilla/autoload_configs/conference.conf.xml @@ -120,6 +120,10 @@ + + diff --git a/conf/vanilla/autoload_configs/httapi.conf.xml b/conf/vanilla/autoload_configs/httapi.conf.xml index c2fe584a02..50bbe78f40 100644 --- a/conf/vanilla/autoload_configs/httapi.conf.xml +++ b/conf/vanilla/autoload_configs/httapi.conf.xml @@ -119,7 +119,7 @@ - + diff --git a/conf/vanilla/autoload_configs/modules.conf.xml b/conf/vanilla/autoload_configs/modules.conf.xml index 50353ac849..f88bb7b7c0 100644 --- a/conf/vanilla/autoload_configs/modules.conf.xml +++ b/conf/vanilla/autoload_configs/modules.conf.xml @@ -16,6 +16,7 @@ + @@ -62,6 +63,7 @@ + @@ -80,10 +82,10 @@ - + - + diff --git a/conf/vanilla/autoload_configs/xml_scgi.conf.xml b/conf/vanilla/autoload_configs/xml_scgi.conf.xml new file mode 100644 index 0000000000..b9662d1638 --- /dev/null +++ b/conf/vanilla/autoload_configs/xml_scgi.conf.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/conf/vanilla/lang/en/vm/sounds.xml b/conf/vanilla/lang/en/vm/sounds.xml index ff8844ae97..fdef472a5b 100644 --- a/conf/vanilla/lang/en/vm/sounds.xml +++ b/conf/vanilla/lang/en/vm/sounds.xml @@ -29,7 +29,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/conf/vanilla/sip_profiles/external.xml b/conf/vanilla/sip_profiles/external.xml index a709cbb94c..4f18e84be7 100644 --- a/conf/vanilla/sip_profiles/external.xml +++ b/conf/vanilla/sip_profiles/external.xml @@ -1,14 +1,14 @@ - + - @@ -18,10 +18,10 @@ - - + + - + @@ -34,15 +34,15 @@ - + - @@ -56,8 +56,10 @@ + + @@ -90,6 +92,5 @@ - diff --git a/conf/vanilla/sip_profiles/external/example.xml b/conf/vanilla/sip_profiles/external/example.xml index 70668a9ce5..2a4df31aaf 100644 --- a/conf/vanilla/sip_profiles/external/example.xml +++ b/conf/vanilla/sip_profiles/external/example.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/vanilla/sip_profiles/internal-ipv6.xml b/conf/vanilla/sip_profiles/internal-ipv6.xml index ee27a241a0..18274faa4f 100644 --- a/conf/vanilla/sip_profiles/internal-ipv6.xml +++ b/conf/vanilla/sip_profiles/internal-ipv6.xml @@ -54,36 +54,39 @@ - + - + - - - - + + + + + + + - + - + - + @@ -103,8 +106,8 @@ @@ -121,10 +124,9 @@ - - - + + + - diff --git a/conf/vanilla/sip_profiles/internal.xml b/conf/vanilla/sip_profiles/internal.xml index b8390c7934..0f4cabe32d 100644 --- a/conf/vanilla/sip_profiles/internal.xml +++ b/conf/vanilla/sip_profiles/internal.xml @@ -2,57 +2,62 @@ - + - + - + - + + + + + + - - + + - + - @@ -101,26 +106,26 @@ - - - + + + @@ -129,10 +134,10 @@ - + - + @@ -159,7 +164,7 @@ - + @@ -198,39 +203,42 @@ - + - + - + - - - - + + + + + + + - + - + - + @@ -247,16 +255,16 @@ - + + Used as the public IP address for SDP. + Can be an one of: + ip address - "12.34.56.78" + a stun server lookup - "stun:stun.server.com" + a DNS name - "host:host.server.com" + auto - Use guessed ip. + auto-nat - Use ip learned from NAT-PMP or UPNP + --> @@ -269,8 +277,8 @@ @@ -292,28 +300,27 @@ - - + @@ -327,59 +334,58 @@ - - - - + + + - - - - - - - - - - - - - - + - - + + + + + - - - + + + + + + + + + + + + + - diff --git a/conf/vanilla/sip_profiles/internal/example.xml b/conf/vanilla/sip_profiles/internal/example.xml index fc061f96d1..10263b05a5 100644 --- a/conf/vanilla/sip_profiles/internal/example.xml +++ b/conf/vanilla/sip_profiles/internal/example.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/vanilla/vars.xml b/conf/vanilla/vars.xml index 4f13a61fbb..907c6f1015 100644 --- a/conf/vanilla/vars.xml +++ b/conf/vanilla/vars.xml @@ -123,7 +123,7 @@ 127 - BV32 --> - + + + + + + diff --git a/freeswitch-sounds-en-us-callie.spec b/freeswitch-sounds-en-us-callie.spec index 468911c53d..68c79e42b6 100644 --- a/freeswitch-sounds-en-us-callie.spec +++ b/freeswitch-sounds-en-us-callie.spec @@ -77,6 +77,7 @@ BuildArch: noarch BuildRequires: sox Requires: freeswitch Requires: freeswitch-sounds-en-us-callie-48000 +Requires: sox BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description diff --git a/freeswitch-sounds-music.spec b/freeswitch-sounds-music.spec index e43ada5736..520a7dddfe 100644 --- a/freeswitch-sounds-music.spec +++ b/freeswitch-sounds-music.spec @@ -1,3 +1,4 @@ +%define fsname freeswitch %define PREFIX %{_prefix} %define EXECPREFIX %{_exec_prefix} %define BINDIR %{_bindir} diff --git a/freeswitch.spec b/freeswitch.spec index 6fd9ad706e..f4e3399715 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -1,5 +1,4 @@ ###################################################################################################################### -###################################################################################################################### # # spec file for package freeswitch # @@ -11,20 +10,20 @@ # # This file is part of: # FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -# Copyright (C) 2005-2010, Anthony Minessale II +# Copyright (C) 2005-2012, Anthony Minessale II # # This file and all modifications and additions to the pristine package are under the same license as the package itself. # # Contributor(s): Mike Jerris -# Brian West -# Raul Fragoso -# Rupa Shomaker -# Marc Olivier Chouinard -# Raymond Chandler -# Anthony Minessale II +# Brian West +# Anthony Minessale II +# Raul Fragoso +# Rupa Shomaker +# Marc Olivier Chouinard +# Raymond Chandler +# Ken Rice # -# -# Maintainer(s): Michal Bielicki # ###################################################################################################################### # Module build settings @@ -1434,7 +1433,7 @@ export ACLOCAL_FLAGS="-I /usr/share/aclocal" if test ! -f Makefile.in then - ./bootstrap.sh -j + ./bootstrap.sh fi %configure -C \ @@ -1594,6 +1593,7 @@ fi #################################### Basic Directory Structure ####################################################### # %dir %attr(0750, freeswitch, daemon) %{sysconfdir} +%dir %attr(0750, freeswitch, daemon) %{LOCALSTATEDIR} %dir %attr(0750, freeswitch, daemon) %{DBDIR} %dir %attr(0750, freeswitch, daemon) %{GRAMMARDIR} %dir %attr(0750, freeswitch, daemon) %{HTDOCSDIR} @@ -1757,6 +1757,7 @@ fi %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/xml_cdr.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/xml_curl.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/xml_rpc.conf.xml +%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/xml_scgi.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/zeroconf.conf.xml ###################################################################################################################### # Chatplans diff --git a/fscomm/call.cpp b/fscomm/call.cpp index 3b91d7ee90..d60084d483 100644 --- a/fscomm/call.cpp +++ b/fscomm/call.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/fscomm/call.h b/fscomm/call.h index d2626f35af..72ea93f6de 100644 --- a/fscomm/call.h +++ b/fscomm/call.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/fscomm/debugtools/sortfilterproxymodel.h b/fscomm/debugtools/sortfilterproxymodel.h index c0b1c53890..d157856bfc 100644 --- a/fscomm/debugtools/sortfilterproxymodel.h +++ b/fscomm/debugtools/sortfilterproxymodel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/fscomm/fshost.cpp b/fscomm/fshost.cpp index 2bb5b36cd6..a113b33958 100644 --- a/fscomm/fshost.cpp +++ b/fscomm/fshost.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/fscomm/fshost.h b/fscomm/fshost.h index ce4371191d..59cf2024e9 100644 --- a/fscomm/fshost.h +++ b/fscomm/fshost.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/fscomm/main.cpp b/fscomm/main.cpp index c1069eded1..18a97e2757 100644 --- a/fscomm/main.cpp +++ b/fscomm/main.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/fscomm/mainwindow.cpp b/fscomm/mainwindow.cpp index 30450e1215..8f1323b374 100644 --- a/fscomm/mainwindow.cpp +++ b/fscomm/mainwindow.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/fscomm/mainwindow.h b/fscomm/mainwindow.h index 84f4103b3e..33f36b87ba 100644 --- a/fscomm/mainwindow.h +++ b/fscomm/mainwindow.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/.gitignore b/libs/.gitignore index e0fed1112a..e39b1f4bf1 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -887,7 +887,6 @@ missing !/ldns/drill/install-sh !/ldns/examples/config.h.in !/ldns/examples/configure -!/ldns/install-sh !/ldns/ldns/config.h.in !/libdingaling/config.guess !/libdingaling/config.sub diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index 7dfaf2d5a6..febf6d85c5 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -58,6 +58,7 @@ typedef struct { const char *console_fnkeys[12]; char loglevel[128]; int quiet; + int batch_mode; char prompt_color[12]; char input_text_color[12]; char output_text_color[12]; @@ -109,6 +110,7 @@ static void sleep_s(int secs) { _sleep_ns(secs, 0); } static int process_command(esl_handle_t *handle, const char *cmd); static void clear_cli(void) { + if (global_profile->batch_mode) return; putchar('\r'); printf("\033[%dC", bare_prompt_str_len); printf("\033[K"); @@ -402,7 +404,9 @@ static BOOL console_readConsole(HANDLE conIn, char *buf, int len, int *pRed, int { DWORD recordIndex, bufferIndex, toRead, red; PINPUT_RECORD pInput; - GetNumberOfConsoleInputEvents(conIn, &toRead); + if (GetNumberOfConsoleInputEvents(conIn, &toRead) == 0) { + return(FALSE); + } if (len < (int)toRead) { toRead = len; } @@ -549,6 +553,7 @@ static const char *usage_str = " -r, --retry Retry connection on failure\n" " -R, --reconnect Reconnect if disconnected\n" " -d, --debug=level Debug Level (0 - 7)\n" + " -b, --batchmode Batch mode\n" " -t, --timeout Timeout for API commands (in miliseconds)\n\n"; static int usage(char *name){ @@ -598,6 +603,7 @@ static int write_char(int c) { #ifdef WIN32 static void clear_line(void) { + if (global_profile->batch_mode) return; putchar('\r'); printf("\033[K"); fflush(stdout); @@ -606,6 +612,7 @@ static void clear_line(void) #else static void clear_line(void) { + if (global_profile->batch_mode) return; if (!(write_char('\r'))) goto done; if (!(write_str("\033[K"))) goto done; done: @@ -618,6 +625,7 @@ static void redisplay(void) #ifndef WIN32 const LineInfo *lf = el_line(el); const char *c = lf->buffer; + if (global_profile->batch_mode) return; if (!(write_str(prompt_str))) goto done; while (c < lf->lastchar && *c) { if (!(write_char(*c))) goto done; @@ -643,7 +651,9 @@ static int output_printf(const char *fmt, ...) int r; va_start(ap, fmt); #ifndef WIN32 - printf("%s", output_text_color); + if (!(global_profile->batch_mode)) { + printf("%s", output_text_color); + } #endif r = vprintf(fmt, ap); va_end(ap); @@ -681,15 +691,23 @@ static void *msg_thread_run(esl_thread_t *me, void *obj) #ifndef WIN32 if (aok) { if (feature_level) clear_line(); - printf("%s%s", colors[level], handle->last_event->body); - if (!feature_level) printf("%s", ESL_SEQ_DEFAULT_COLOR); + if(!(global_profile->batch_mode)) { + printf("%s%s", colors[level], handle->last_event->body); + if (!feature_level) printf("%s", ESL_SEQ_DEFAULT_COLOR); + } else { + printf("%s", handle->last_event->body); + } if (feature_level) redisplay(); } #else if (aok) { - SetConsoleTextAttribute(hStdout, colors[level]); + if(!(global_profile->batch_mode)) { + SetConsoleTextAttribute(hStdout, colors[level]); + } WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL); - SetConsoleTextAttribute(hStdout, wOldColorAttrs); + if(!(global_profile->batch_mode)) { + SetConsoleTextAttribute(hStdout, wOldColorAttrs); + } } #endif } @@ -832,20 +850,27 @@ static int get_profile(const char *name, cli_profile_t **profile) return -1; } -#ifndef HAVE_EDITLINE static char command_buf[CMD_BUFLEN+1] = ""; static const char *basic_gets(int *cnt) { -#ifndef _MSC_VER int x = 0; +#ifdef _MSC_VER + int read, key; + char keys[CMD_BUFLEN]; + HANDLE stdinHandle; + if (global_profile->batch_mode) { +#endif printf("%s", prompt_str); + if (global_profile->batch_mode) fflush(stdout); memset(&command_buf, 0, sizeof(command_buf)); for (x = 0; x < (sizeof(command_buf) - 1); x++) { int c = getchar(); if (c < 0) { - int y = read(fileno(stdin), command_buf, sizeof(command_buf) - 1); - command_buf[y - 1] = '\0'; + if (fgets(command_buf, sizeof(command_buf) - 1, stdin) != command_buf) { + break; + } + command_buf[strlen(command_buf)-1] = '\0'; /* remove endline */ break; } command_buf[x] = (char) c; @@ -855,27 +880,28 @@ static const char *basic_gets(int *cnt) } } *cnt = x; -#else - int read, key; - char keys[CMD_BUFLEN]; - HANDLE stdinHandle = GetStdHandle(STD_INPUT_HANDLE); - console_bufferInput (0, 0, prompt_str, PROMPT_OP); - printf("%s", prompt_str); - *cnt = 0; - memset(&command_buf, 0, sizeof(command_buf)); - while (!*cnt) { - if (console_readConsole(stdinHandle, keys, (int)sizeof(keys), &read, &key)) { - *cnt = console_bufferInput(keys, read, command_buf, key); - if (!strcmp(command_buf, "Empty")) { - command_buf[0] = 0; +#ifdef _MSC_VER + } else { + stdinHandle = GetStdHandle(STD_INPUT_HANDLE); + console_bufferInput (0, 0, prompt_str, PROMPT_OP); + printf("%s", prompt_str); + if (global_profile->batch_mode) fflush(stdout); + *cnt = 0; + memset(&command_buf, 0, sizeof(command_buf)); + while (!*cnt) { + if (console_readConsole(stdinHandle, keys, (int)sizeof(keys), &read, &key)) { + *cnt = console_bufferInput(keys, read, command_buf, key); + if (global_profile->batch_mode) fflush(stdout); + if (!strcmp(command_buf, "Empty")) { + command_buf[0] = 0; + } } + sleep_ms(20); } - sleep_ms(20); } #endif return command_buf; } -#endif static void print_banner(FILE *stream) { @@ -1067,6 +1093,8 @@ static void read_config(const char *dft_cfile, const char *cfile) { if (pt > 0) { profiles[pcount-1].port = (esl_port_t)pt; } + } else if (!strcasecmp(var, "batchmode")) { + profiles[pcount-1].batch_mode = esl_true(val); } else if (!strcasecmp(var, "debug")) { int dt = atoi(val); if (dt > -1 && dt < 8){ @@ -1100,6 +1128,7 @@ static void clear_el_buffer(void) { #ifdef HAVE_EDITLINE const LineInfo *lf = el_line(el); int len = (int)(lf->lastchar - lf->buffer); + if (global_profile->batch_mode) return; el_deletestr(el, len); memset((char*)lf->buffer, 0, len); #endif @@ -1134,6 +1163,7 @@ int main(int argc, char *argv[]) {"execute", 1, 0, 'x'}, {"loglevel", 1, 0, 'l'}, {"quiet", 0, 0, 'q'}, + {"batchmode", 0, 0, 'b'}, {"retry", 0, 0, 'r'}, {"interrupt", 0, 0, 'i'}, {"reconnect", 0, 0, 'R'}, @@ -1154,6 +1184,7 @@ int main(int argc, char *argv[]) char argv_command[1024] = ""; char argv_loglevel[128] = ""; int argv_quiet = 0; + int argv_batch = 0; int loops = 2, reconnect = 0, timeout = 0; @@ -1186,7 +1217,7 @@ int main(int argc, char *argv[]) esl_global_set_default_logger(6); /* default debug level to 6 (info) */ for(;;) { int option_index = 0; - opt = getopt_long(argc, argv, "H:U:P:S:u:p:d:x:l:t:qrRhi?", options, &option_index); + opt = getopt_long(argc, argv, "H:U:P:S:u:p:d:x:l:t:qrRhib?", options, &option_index); if (opt == -1) break; switch (opt) { case 'H': @@ -1229,6 +1260,9 @@ int main(int argc, char *argv[]) case 'q': argv_quiet = 1; break; + case 'b': + argv_batch = 1; + break; case 'i': allow_ctl_c = 1; break; @@ -1279,6 +1313,10 @@ int main(int argc, char *argv[]) if (argv_pass) { esl_set_string(profile->pass, temp_pass); } + if (argv_batch || profile->batch_mode) { + profile->batch_mode = 1; + feature_level=0; + } if (*argv_loglevel) { esl_set_string(profile->loglevel, argv_loglevel); profile->quiet = 0; @@ -1423,6 +1461,9 @@ int main(int argc, char *argv[]) snprintf(cmd_str, sizeof(cmd_str), "log %s\n\n", profile->loglevel); esl_send_recv(&handle, cmd_str); } + if (global_profile->batch_mode) { + setvbuf(stdout, (char*)NULL, _IONBF, 0); + } print_banner(stdout); esl_log(ESL_LOG_INFO, "Netborder SS7 CLI Ready.\nenter /help for a list of commands.\n"); @@ -1431,9 +1472,13 @@ int main(int argc, char *argv[]) while (running > 0) { int r; #ifdef HAVE_EDITLINE - line = el_gets(el, &count); -#else + if (!(global_profile->batch_mode)) { + line = el_gets(el, &count); + } else { +#endif line = basic_gets(&count); +#ifdef HAVE_EDITLINE + } #endif if (count > 1 && !esl_strlen_zero(line)) { char *p, *cmd = strdup(line); diff --git a/libs/esl/ivrd.c b/libs/esl/ivrd.c index c71e392117..2e2e6b2fa4 100644 --- a/libs/esl/ivrd.c +++ b/libs/esl/ivrd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Anthony Minessale II + * Copyright (c) 2009-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,11 +36,56 @@ #include #include +static void my_forking_callback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr) +{ + esl_handle_t handle = {{0}}; + char path_buffer[1024] = { 0 }; + const char *path; + char arg[64] = { 0 }; + + if (fork()) { + close(client_sock); + return; + } + + if (esl_attach_handle(&handle, client_sock, addr) != ESL_SUCCESS || !handle.info_event) { + esl_log(ESL_LOG_ERROR, "Socket Error\n"); + exit(0); + } + + if (!(path = esl_event_get_header(handle.info_event, "variable_ivr_path"))) { + esl_disconnect(&handle); + esl_log(ESL_LOG_ERROR, "Missing ivr_path param!\n"); + exit(0); + } + + snprintf(arg, sizeof(arg), "%d", client_sock); + + strncpy(path_buffer, path, sizeof(path_buffer) - 1); + + /* hotwire the socket to STDIN/STDOUT */ + /* hotwire the socket to STDIN/STDOUT */ + if (!(dup2(client_sock, STDIN_FILENO)) && !(dup2(client_sock, STDOUT_FILENO))){ + esl_disconnect(&handle); + esl_log(ESL_LOG_ERROR, "Socket Error hotwiring socket to STDIN/STDOUT!\n"); + return; + } + + /* close the handle but leak the socket on purpose cos the child will need it open */ + handle.sock = -1; + esl_disconnect(&handle); + + execl(path_buffer, path_buffer, arg, (char *)NULL); + close(client_sock); + exit(0); +} + static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr) { esl_handle_t handle = {{0}}; const char *path; - + char path_buffer[1024] = { 0 }; + if (esl_attach_handle(&handle, client_sock, addr) != ESL_SUCCESS || !handle.info_event) { close(client_sock); esl_log(ESL_LOG_ERROR, "Socket Error\n"); @@ -53,16 +98,13 @@ static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struc return; } - /* hotwire the socket to STDIN/STDOUT */ - if (!(dup2(client_sock, STDIN_FILENO)) && !(dup2(client_sock, STDOUT_FILENO))){ - esl_disconnect(&handle); - esl_log(ESL_LOG_ERROR, "Socket Error hotwiring socket to STDIN/STDOUT!\n"); - return; - } + snprintf(path_buffer, sizeof(path_buffer), "%s %d", path, client_sock); - if(system(path)) { + + if (system(path_buffer)) { esl_log(ESL_LOG_ERROR, "System Call Failed! [%s]\n", strerror(errno)); } + esl_disconnect(&handle); } @@ -71,24 +113,43 @@ int main(int argc, char *argv[]) { int i; char *ip = NULL; - int port = 0; + int port = 0, thread = 0; - for (i = 1; i + 1 < argc; ) { - if (!strcasecmp(argv[i], "-h")) { - ip = argv[++i]; - } else if (!strcasecmp(argv[i], "-p")) { - port = atoi(argv[++i]); - } else { - i++; + for (i = 1; i < argc; ) { + int cont = 0; + + if (i + 1 < argc) { + if (!strcasecmp(argv[i], "-h")) { + ip = argv[++i]; cont++; + } else if (!strcasecmp(argv[i], "-p")) { + port = atoi(argv[++i]); cont++; + } } + + if (cont) { + i++; + continue; + } + + if (!strcasecmp(argv[i], "-t")) { + thread++; + } + + i++; } if (!(ip && port)) { - fprintf(stderr, "Usage %s -h -p \n", argv[0]); + fprintf(stderr, "Usage %s [-t] -h -p \n", argv[0]); return -1; } - esl_listen(ip, port, mycallback, 100000); + if (thread) { + printf("Starting threaded listener.\n"); + esl_listen_threaded(ip, port, mycallback, 100000); + } else { + printf("Starting forking listener.\n"); + esl_listen(ip, port, my_forking_callback); + } return 0; } diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 02ab7ef271..22b27836fd 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ #include #ifndef WIN32 -#define closesocket(x) close(x) +#define closesocket(x) shutdown(x, 2); close(x) #include #include #else @@ -491,7 +491,9 @@ ESL_DECLARE(esl_status_t) esl_attach_handle(esl_handle_t *handle, esl_socket_t s ESL_DECLARE(esl_status_t) esl_sendevent(esl_handle_t *handle, esl_event_t *event) { char *txt; - char event_buf[256] = ""; + char *event_buf = NULL; + esl_status_t status = ESL_FAIL; + size_t len = 0; if (!handle->connected || !event) { return ESL_FAIL; @@ -500,23 +502,20 @@ ESL_DECLARE(esl_status_t) esl_sendevent(esl_handle_t *handle, esl_event_t *event esl_event_serialize(event, &txt, ESL_FALSE); esl_log(ESL_LOG_DEBUG, "SEND EVENT\n%s\n", txt); - - snprintf(event_buf, sizeof(event_buf), "sendevent %s\n", esl_event_name(event->event_id)); - if (send(handle->sock, event_buf, strlen(event_buf), 0) <= 0) goto fail; - if (send(handle->sock, txt, strlen(txt), 0) <= 0) goto fail; + len = strlen(txt) + 100; + event_buf = malloc(len); + assert(event_buf); + memset(event_buf, 0, len); - free(txt); - - return esl_recv(handle); - - fail: - - handle->connected = 0; + snprintf(event_buf, len, "sendevent %s\n%s", esl_event_name(event->event_id), txt); + + status = esl_send_recv(handle, event_buf); free(txt); + free(event_buf); - return ESL_FAIL; + return status; } @@ -554,34 +553,36 @@ ESL_DECLARE(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, con ESL_DECLARE(esl_status_t) esl_sendmsg(esl_handle_t *handle, esl_event_t *event, const char *uuid) { - char cmd_buf[128] = "sendmsg\n"; + char *cmd_buf = NULL; char *txt; - + size_t len = 0; + esl_status_t status = ESL_FAIL; + if (!handle || !handle->connected || handle->sock == ESL_SOCK_INVALID) { return ESL_FAIL; } + esl_event_serialize(event, &txt, ESL_FALSE); + len = strlen(txt) + 100; + cmd_buf = malloc(len); + assert(cmd_buf); + memset(cmd_buf, 0, len); + + if (uuid) { - snprintf(cmd_buf, sizeof(cmd_buf), "sendmsg %s\n", uuid); + snprintf(cmd_buf, sizeof(cmd_buf), "sendmsg %s\n%s", uuid, txt); + } else { + snprintf(cmd_buf, sizeof(cmd_buf), "sendmsg\n%s", txt); } - esl_event_serialize(event, &txt, ESL_FALSE); esl_log(ESL_LOG_DEBUG, "%s%s\n", cmd_buf, txt); - if (send(handle->sock, cmd_buf, strlen(cmd_buf), 0) <= 0) goto fail; - if (send(handle->sock, txt, strlen(txt), 0) <= 0) goto fail; - - free(txt); - - return esl_recv(handle); - - fail: - - handle->connected = 0; + status = esl_send_recv(handle, cmd_buf); free(txt); + free(cmd_buf); - return ESL_FAIL; + return status; } @@ -648,7 +649,64 @@ static void *client_thread(esl_thread_t *me, void *obj) } -ESL_DECLARE(esl_status_t) esl_listen(const char *host, esl_port_t port, esl_listen_callback_t callback, int max) +ESL_DECLARE(esl_status_t) esl_listen(const char *host, esl_port_t port, esl_listen_callback_t callback) +{ + esl_socket_t server_sock = ESL_SOCK_INVALID; + struct sockaddr_in addr; + esl_status_t status = ESL_SUCCESS; + + if ((server_sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { + return ESL_FAIL; + } + + esl_socket_reuseaddr(server_sock); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_ANY); + addr.sin_port = htons(port); + + if (bind(server_sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + status = ESL_FAIL; + goto end; + } + + if (listen(server_sock, 10000) < 0) { + status = ESL_FAIL; + goto end; + } + + for (;;) { + int client_sock; + struct sockaddr_in echoClntAddr; +#ifdef WIN32 + int clntLen; +#else + unsigned int clntLen; +#endif + + clntLen = sizeof(echoClntAddr); + + if ((client_sock = accept(server_sock, (struct sockaddr *) &echoClntAddr, &clntLen)) == ESL_SOCK_INVALID) { + status = ESL_FAIL; + goto end; + } + + callback(server_sock, client_sock, &echoClntAddr); + } + + end: + + if (server_sock != ESL_SOCK_INVALID) { + closesocket(server_sock); + server_sock = ESL_SOCK_INVALID; + } + + return status; + +} + +ESL_DECLARE(esl_status_t) esl_listen_threaded(const char *host, esl_port_t port, esl_listen_callback_t callback, int max) { esl_socket_t server_sock = ESL_SOCK_INVALID; struct sockaddr_in addr; diff --git a/libs/esl/src/esl_buffer.c b/libs/esl/src/esl_buffer.c index 173c9cb76c..97f6b5813b 100644 --- a/libs/esl/src/esl_buffer.c +++ b/libs/esl/src/esl_buffer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Anthony Minessale II + * Copyright (c) 2010-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/esl/src/esl_config.c b/libs/esl/src/esl_config.c index 2e24007799..8954c874a1 100644 --- a/libs/esl/src/esl_config.c +++ b/libs/esl/src/esl_config.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index 1271e46e4f..6ebd6669b6 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/esl/src/include/esl.h b/libs/esl/src/include/esl.h index 2f1a50949a..4296175f3a 100644 --- a/libs/esl/src/include/esl.h +++ b/libs/esl/src/include/esl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -391,7 +391,9 @@ ESL_DECLARE(esl_status_t) esl_attach_handle(esl_handle_t *handle, esl_socket_t s \param port Port to bind to \param callback Callback that will be called upon data received */ -ESL_DECLARE(esl_status_t) esl_listen(const char *host, esl_port_t port, esl_listen_callback_t callback, int max); + +ESL_DECLARE(esl_status_t) esl_listen(const char *host, esl_port_t port, esl_listen_callback_t callback); +ESL_DECLARE(esl_status_t) esl_listen_threaded(const char *host, esl_port_t port, esl_listen_callback_t callback, int max); /*! \brief Executes application with sendmsg to a specific UUID. Used for outbound socket. \param handle Handle that the msg will be sent diff --git a/libs/esl/src/include/esl_buffer.h b/libs/esl/src/include/esl_buffer.h index c7901e4ede..9be62110d9 100644 --- a/libs/esl/src/include/esl_buffer.h +++ b/libs/esl/src/include/esl_buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Anthony Minessale II + * Copyright (c) 2010-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/esl/src/include/esl_config.h b/libs/esl/src/include/esl_config.h index 44fb23c911..515fd73cdb 100644 --- a/libs/esl/src/include/esl_config.h +++ b/libs/esl/src/include/esl_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/esl/src/include/esl_event.h b/libs/esl/src/include/esl_event.h index 1cc6134e42..b7dea736c9 100644 --- a/libs/esl/src/include/esl_event.h +++ b/libs/esl/src/include/esl_event.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/esl/src/include/esl_oop.h b/libs/esl/src/include/esl_oop.h index 0ea1e5da89..9ffdae73a7 100644 --- a/libs/esl/src/include/esl_oop.h +++ b/libs/esl/src/include/esl_oop.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/esl/testserver.c b/libs/esl/testserver.c index cf60313fe7..1477d8d71e 100644 --- a/libs/esl/testserver.c +++ b/libs/esl/testserver.c @@ -48,7 +48,7 @@ static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struc int main(void) { esl_global_set_default_logger(7); - esl_listen("localhost", 8084, mycallback, 100000); + esl_listen_threaded("localhost", 8084, mycallback, 100000); return 0; } diff --git a/libs/freetdm/Makefile.am b/libs/freetdm/Makefile.am index 35f1cecd1e..bfd68a17eb 100644 --- a/libs/freetdm/Makefile.am +++ b/libs/freetdm/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2007, Anthony Minessale II +# Copyright (c) 2007-2012, Anthony Minessale II # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -248,6 +248,14 @@ ftmod_r2_la_LDFLAGS = -shared -module -avoid-version -lopenr2 ftmod_r2_la_LIBADD = libfreetdm.la endif +if HAVE_WAT +mod_LTLIBRARIES += ftmod_gsm.la +ftmod_gsm_la_SOURCES = $(SRC)/ftmod/ftmod_gsm/ftmod_gsm.c +ftmod_gsm_la_CFLAGS = $(FTDM_CFLAGS) $(AM_CFLAGS) +ftmod_gsm_la_LDFLAGS = -shared -module -avoid-version -lwat +ftmod_gsm_la_LIBADD = libfreetdm.la +endif + if HAVE_MISDN mod_LTLIBRARIES += ftmod_misdn.la ftmod_misdn_la_SOURCES = $(SRC)/ftmod/ftmod_misdn/ftmod_misdn.c diff --git a/libs/freetdm/configure.ac b/libs/freetdm/configure.ac index 292c1e7cfa..cb7f9afd4d 100644 --- a/libs/freetdm/configure.ac +++ b/libs/freetdm/configure.ac @@ -189,6 +189,14 @@ AC_CHECK_LIB([openr2], [openr2_context_set_io_type], [HAVE_OPENR2="yes"]) AC_MSG_RESULT([checking whether to build ftmod_r2... ${HAVE_OPENR2}]) AM_CONDITIONAL([HAVE_OPENR2], [test "${HAVE_OPENR2}" = "yes"]) +## +# WAT GSM stack +# +HAVE_WAT="no" +AC_CHECK_LIB([wat], [wat_version], [HAVE_WAT="yes"]) +AC_MSG_RESULT([checking whether to build ftmod_wat... ${HAVE_WAT}]) +AM_CONDITIONAL([HAVE_WAT], [test "${HAVE_WAT}" = "yes"]) + ## # Digium libpri (TODO: add checks) # @@ -236,6 +244,21 @@ then AC_MSG_ERROR([libpri not found or unusable (see config.log for details)])] ) + AC_MSG_CHECKING([whether libpri is too old]) + AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM( + [#include ], + [#if !defined(PRI_IO_FUNCS) + #error "libpri is lacking PRI_IO_FUNCS" + #elif !defined(PRI_NEW_SET_API) + #error "libpri is lacking PRI_NEW_SET_API" + #endif] + )], + [AC_MSG_RESULT([no])], + [AC_MSG_RESULT([yes]) + AC_MSG_ERROR([Your version of libpri is too old (pre 1.2), please update!])] + ) + AC_MSG_CHECKING([whether libpri has BRI support]) AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -407,22 +430,13 @@ AC_ARG_WITH([misdn], ) AS_IF([test "${with_misdn}" != "no"], [AC_MSG_RESULT([${as_nl}<<>> ftmod_misdn (Linux mISDN I/O plugin)]) - AC_CHECK_FUNCS([timerfd_create],, - [AS_IF([test "${with_misdn}" = "yes"], - [AC_MSG_ERROR([no timerfd support in libc])], - [AC_MSG_NOTICE([no timerfd support in libc])] - )] - ) - AC_CHECK_HEADER([mISDN/mISDNif.h],, + AC_CHECK_HEADER([mISDN/mISDNif.h], + [HAVE_MISDN="yes"], [AS_IF([test "${with_misdn}" = "yes"], [AC_MSG_ERROR([mISDN/mISDNif.h not found])], [AC_MSG_NOTICE([mISDN/mISDNif.h not found])] )], [#include ] - ) - AS_IF([test "${ac_cv_func_timerfd_create}" = "yes" -a "${ac_cv_header_mISDN_mISDNif_h}" = "yes"], - [HAVE_MISDN="yes"], - [AC_MSG_NOTICE([Some required dependencies are missing, module disabled])] )] ) AM_CONDITIONAL([HAVE_MISDN], [test "${HAVE_MISDN}" = "yes"]) @@ -450,6 +464,7 @@ AC_MSG_RESULT([ ftmod_sangoma_isdn................. ${HAVE_SNG_ISDN} ftmod_sangoma_ss7.................. ${HAVE_SNG_SS7} ftmod_r2........................... ${HAVE_OPENR2} + ftmod_gsm.......................... ${HAVE_WAT} ftmod_pritap....................... ${HAVE_PRITAP} I/O: ftmod_wanpipe...................... ${HAVE_LIBSANGOMA} diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c index b6a6f49ca1..7482f73993 100755 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -27,7 +27,7 @@ * Moises Silva * David Yat Sin * James Zhang - * + * Gideon Sadan * * mod_freetdm.c -- FreeTDM Endpoint Module * @@ -291,7 +291,7 @@ static void cycle_foreground(ftdm_channel_t *ftdmchan, int flash, const char *bc const char *buuid; tech_pvt = switch_core_session_get_private(session); channel = switch_core_session_get_channel(session); - buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + buuid = switch_channel_get_partner_uuid(channel); if (tokencnt == 1 && flash) { @@ -2102,6 +2102,24 @@ static FIO_SIGNAL_CB_FUNCTION(on_common_signal) switch (sigmsg->event_id) { + case FTDM_SIGEVENT_SMS: + { + ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(sigmsg->channel); + ftdm_sms_data_t *sms = (ftdm_sms_data_t*) caller_data->priv; + + + ftdm_log(FTDM_LOG_INFO,"FTDM_SIGEVENT_SMS from %s: %s", sms->from, sms->body); + if (switch_event_create(&event, SWITCH_EVENT_TRAP) != SWITCH_STATUS_SUCCESS) { + ftdm_log(FTDM_LOG_ERROR, "failed to create SMS event\n"); + return FTDM_FAIL; + } + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", sms->from); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "body", sms->body); + alarmbits = 0; + } + //return FTDM_BREAK; + break; + case FTDM_SIGEVENT_ALARM_CLEAR: case FTDM_SIGEVENT_ALARM_TRAP: { @@ -2151,6 +2169,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_common_signal) return FTDM_SUCCESS; } break; + case FTDM_SIGEVENT_RELEASED: case FTDM_SIGEVENT_INDICATION_COMPLETED: case FTDM_SIGEVENT_DIALING: @@ -2179,6 +2198,8 @@ static FIO_SIGNAL_CB_FUNCTION(on_common_signal) } if (event) { + + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "span-name", "%s", ftdm_channel_get_span_name(sigmsg->channel)); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "span-number", "%d", ftdm_channel_get_span_id(sigmsg->channel)); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "chan-number", "%d", ftdm_channel_get_id(sigmsg->channel)); @@ -2336,19 +2357,19 @@ static FIO_SIGNAL_CB_FUNCTION(on_fxs_signal) if ((session_a = switch_core_session_locate(ftdm_channel_get_token(sigmsg->channel, 0)))) { channel_a = switch_core_session_get_channel(session_a); - br_a_uuid = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE); + br_a_uuid = switch_channel_get_partner_uuid(channel_a); tech_pvt = switch_core_session_get_private(session_a); - stop_hold(session_a, switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE)); + stop_hold(session_a, switch_channel_get_partner_uuid(channel_a)); switch_clear_flag_locked(tech_pvt, TFLAG_HOLD); } if ((session_b = switch_core_session_locate(ftdm_channel_get_token(sigmsg->channel, 1)))) { channel_b = switch_core_session_get_channel(session_b); - br_b_uuid = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE); + br_b_uuid = switch_channel_get_partner_uuid(channel_b); tech_pvt = switch_core_session_get_private(session_b); - stop_hold(session_a, switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE)); + stop_hold(session_a, switch_channel_get_partner_uuid(channel_b)); switch_clear_flag_locked(tech_pvt, TFLAG_HOLD); } @@ -2416,7 +2437,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_fxs_signal) tech_pvt = switch_core_session_get_private(session); channel = switch_core_session_get_channel(session); - buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + buuid = switch_channel_get_partner_uuid(channel); ftdm_channel_call_unhold(sigmsg->channel); stop_hold(session, buuid); switch_clear_flag_locked(tech_pvt, TFLAG_HOLD); @@ -3036,6 +3057,95 @@ static int add_profile_parameters(switch_xml_t cfg, const char *profname, ftdm_c return paramindex; } +static void parse_gsm_spans(switch_xml_t cfg, switch_xml_t spans) +{ + switch_xml_t myspan, param; + + for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) { + ftdm_status_t zstatus = FTDM_FAIL; + const char *context = "default"; + const char *dialplan = "XML"; + ftdm_conf_parameter_t spanparameters[FTDM_MAX_SIG_PARAMETERS]; + char *id = (char *) switch_xml_attr(myspan, "id"); + char *name = (char *) switch_xml_attr(myspan, "name"); + char *configname = (char *) switch_xml_attr(myspan, "cfgprofile"); + ftdm_span_t *span = NULL; + uint32_t span_id = 0; + unsigned paramindex = 0; + + if (!name && !id) { + CONFIG_ERROR("GSM span missing required attribute 'id' or 'name', skipping ...\n"); + continue; + } + + if (name) { + zstatus = ftdm_span_find_by_name(name, &span); + } else { + if (switch_is_number(id)) { + span_id = atoi(id); + zstatus = ftdm_span_find(span_id, &span); + } + + if (zstatus != FTDM_SUCCESS) { + zstatus = ftdm_span_find_by_name(id, &span); + } + } + + if (zstatus != FTDM_SUCCESS) { + CONFIG_ERROR("Error finding FreeTDM span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name)); + continue; + } + + if (!span_id) { + span_id = ftdm_span_get_id(span); + } + + memset(spanparameters, 0, sizeof(spanparameters)); + paramindex = 0; + + if (configname) { + paramindex = add_profile_parameters(cfg, configname, spanparameters, ftdm_array_len(spanparameters)); + if (paramindex) { + ftdm_log(FTDM_LOG_DEBUG, "Added %d parameters from profile %s for span %d\n", paramindex, configname, span_id); + } + } + + for (param = switch_xml_child(myspan, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (ftdm_array_len(spanparameters) - 1 == paramindex) { + CONFIG_ERROR("Too many parameters for GSM span, ignoring any parameter after %s\n", var); + break; + } + + if (!strcasecmp(var, "context")) { + context = val; + } else if (!strcasecmp(var, "dialplan")) { + dialplan = val; + } else { + spanparameters[paramindex].var = var; + spanparameters[paramindex].val = val; + paramindex++; + } + } + + if (ftdm_configure_span_signaling(span, + "gsm", + on_clear_channel_signal, + spanparameters) != FTDM_SUCCESS) { + CONFIG_ERROR("Error configuring Sangoma GSM FreeTDM span %d\n", span_id); + continue; + } + SPAN_CONFIG[span_id].span = span; + switch_copy_string(SPAN_CONFIG[span_id].context, context, sizeof(SPAN_CONFIG[span_id].context)); + switch_copy_string(SPAN_CONFIG[span_id].dialplan, dialplan, sizeof(SPAN_CONFIG[span_id].dialplan)); + switch_copy_string(SPAN_CONFIG[span_id].type, "GSM", sizeof(SPAN_CONFIG[span_id].type)); + ftdm_log(FTDM_LOG_DEBUG, "Configured GSM FreeTDM span %d\n", span_id); + ftdm_span_start(span); + } +} + static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans) { switch_xml_t myspan, param; @@ -3044,7 +3154,7 @@ static void parse_bri_pri_spans(switch_xml_t cfg, switch_xml_t spans) ftdm_status_t zstatus = FTDM_FAIL; const char *context = "default"; const char *dialplan = "XML"; - ftdm_conf_parameter_t spanparameters[30]; + ftdm_conf_parameter_t spanparameters[FTDM_MAX_SIG_PARAMETERS]; char *id = (char *) switch_xml_attr(myspan, "id"); char *name = (char *) switch_xml_attr(myspan, "name"); char *configname = (char *) switch_xml_attr(myspan, "cfgprofile"); @@ -3213,13 +3323,17 @@ static switch_status_t load_config(void) parse_bri_pri_spans(cfg, spans); } + if ((spans = switch_xml_child(cfg, "gsm_spans"))) { + parse_gsm_spans(cfg, spans); + } + switch_core_hash_init(&globals.ss7_configs, module_pool); if ((spans = switch_xml_child(cfg, "sangoma_ss7_spans"))) { for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) { ftdm_status_t zstatus = FTDM_FAIL; const char *context = "default"; const char *dialplan = "XML"; - ftdm_conf_parameter_t spanparameters[30]; + ftdm_conf_parameter_t spanparameters[FTDM_MAX_SIG_PARAMETERS]; char *id = (char *) switch_xml_attr(myspan, "id"); char *name = (char *) switch_xml_attr(myspan, "name"); char *configname = (char *) switch_xml_attr(myspan, "cfgprofile"); @@ -3621,7 +3735,7 @@ static switch_status_t load_config(void) if ((spans = switch_xml_child(cfg, "pri_spans"))) { for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) { char *name = (char *) switch_xml_attr(myspan, "name"); - ftdm_conf_parameter_t spanparameters[10]; + ftdm_conf_parameter_t spanparameters[FTDM_MAX_SIG_PARAMETERS]; ftdm_status_t zstatus = FTDM_FAIL; const char *context = "default"; const char *dialplan = "XML"; @@ -3689,7 +3803,7 @@ static switch_status_t load_config(void) ftdm_status_t zstatus = FTDM_FAIL; unsigned paramindex = 0; - ftdm_conf_parameter_t spanparameters[10]; + ftdm_conf_parameter_t spanparameters[FTDM_MAX_SIG_PARAMETERS]; const char *context = "default"; const char *dialplan = "XML"; ftdm_span_t *span = NULL; @@ -3747,7 +3861,7 @@ static switch_status_t load_config(void) if ((spans = switch_xml_child(cfg, "libpri_spans"))) { for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) { char *name = (char *) switch_xml_attr(myspan, "name"); - ftdm_conf_parameter_t spanparameters[10]; + ftdm_conf_parameter_t spanparameters[FTDM_MAX_SIG_PARAMETERS]; ftdm_status_t zstatus = FTDM_FAIL; const char *context = "default"; const char *dialplan = "XML"; @@ -3822,7 +3936,7 @@ static switch_status_t load_config(void) uint32_t span_id = 0; ftdm_span_t *span = NULL; - ftdm_conf_parameter_t spanparameters[30]; + ftdm_conf_parameter_t spanparameters[FTDM_MAX_SIG_PARAMETERS]; unsigned paramindex = 0; if (!name) { diff --git a/libs/freetdm/src/ftdm_buffer.c b/libs/freetdm/src/ftdm_buffer.c index 000cddd3f9..015402556f 100644 --- a/libs/freetdm/src/ftdm_buffer.c +++ b/libs/freetdm/src/ftdm_buffer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftdm_config.c b/libs/freetdm/src/ftdm_config.c index 4dfc395e06..42b93cd78e 100644 --- a/libs/freetdm/src/ftdm_config.c +++ b/libs/freetdm/src/ftdm_config.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 78e65dfe88..a8f1da4943 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -5745,7 +5745,7 @@ done: static ftdm_status_t ftdm_cpu_monitor_start(void) { - if (ftdm_interrupt_create(&globals.cpu_monitor.interrupt, FTDM_INVALID_SOCKET) != FTDM_SUCCESS) { + if (ftdm_interrupt_create(&globals.cpu_monitor.interrupt, FTDM_INVALID_SOCKET, FTDM_NO_FLAGS) != FTDM_SUCCESS) { ftdm_log(FTDM_LOG_CRIT, "Failed to create CPU monitor interrupt\n"); return FTDM_FAIL; } diff --git a/libs/freetdm/src/ftdm_queue.c b/libs/freetdm/src/ftdm_queue.c index 75d18033da..625f22ec36 100644 --- a/libs/freetdm/src/ftdm_queue.c +++ b/libs/freetdm/src/ftdm_queue.c @@ -98,7 +98,7 @@ static ftdm_status_t ftdm_std_queue_create(ftdm_queue_t **outqueue, ftdm_size_t goto failed; } - if (ftdm_interrupt_create(&queue->interrupt, FTDM_INVALID_SOCKET) != FTDM_SUCCESS) { + if (ftdm_interrupt_create(&queue->interrupt, FTDM_INVALID_SOCKET, FTDM_NO_FLAGS) != FTDM_SUCCESS) { goto failed; } diff --git a/libs/freetdm/src/ftdm_state.c b/libs/freetdm/src/ftdm_state.c index e5aba9d408..026fd0e2c2 100644 --- a/libs/freetdm/src/ftdm_state.c +++ b/libs/freetdm/src/ftdm_state.c @@ -272,7 +272,7 @@ static ftdm_status_t ftdm_core_set_state(const char *file, const char *func, int } if (!ftdmchan->state_completed_interrupt) { - status = ftdm_interrupt_create(&ftdmchan->state_completed_interrupt, FTDM_INVALID_SOCKET); + status = ftdm_interrupt_create(&ftdmchan->state_completed_interrupt, FTDM_INVALID_SOCKET, FTDM_NO_FLAGS); if (status != FTDM_SUCCESS) { ftdm_log_chan_ex(ftdmchan, file, func, line, FTDM_LOG_LEVEL_CRIT, "Failed to create state change interrupt when moving from %s to %s\n", ftdm_channel_state2str(ftdmchan->state), ftdm_channel_state2str(state)); diff --git a/libs/freetdm/src/ftdm_threadmutex.c b/libs/freetdm/src/ftdm_threadmutex.c index 20b85ae91e..302cd32e64 100644 --- a/libs/freetdm/src/ftdm_threadmutex.c +++ b/libs/freetdm/src/ftdm_threadmutex.c @@ -73,6 +73,8 @@ struct ftdm_mutex { struct ftdm_interrupt { ftdm_socket_t device; + ftdm_wait_flag_t device_input_flags; + ftdm_wait_flag_t device_output_flags; #ifdef WIN32 /* for generic interruption */ HANDLE event; @@ -323,7 +325,7 @@ FT_DECLARE(ftdm_status_t) _ftdm_mutex_unlock(const char *file, int line, const c } -FT_DECLARE(ftdm_status_t) ftdm_interrupt_create(ftdm_interrupt_t **ininterrupt, ftdm_socket_t device) +FT_DECLARE(ftdm_status_t) ftdm_interrupt_create(ftdm_interrupt_t **ininterrupt, ftdm_socket_t device, ftdm_wait_flag_t device_flags) { ftdm_status_t status = FTDM_SUCCESS; ftdm_interrupt_t *interrupt = NULL; @@ -340,6 +342,7 @@ FT_DECLARE(ftdm_status_t) ftdm_interrupt_create(ftdm_interrupt_t **ininterrupt, } interrupt->device = device; + interrupt->device_input_flags = device_flags; #ifdef WIN32 interrupt->event = CreateEvent(NULL, FALSE, FALSE, NULL); if (!interrupt->event) { @@ -389,15 +392,16 @@ FT_DECLARE(ftdm_status_t) ftdm_interrupt_wait(ftdm_interrupt_t *interrupt, int m char pipebuf[255]; #endif - ftdm_assert_return(interrupt != NULL, FTDM_FAIL, "Condition is null!\n"); - + ftdm_assert_return(interrupt != NULL, FTDM_FAIL, "Interrupt is null!\n"); + interrupt->device_output_flags = FTDM_NO_FLAGS; /* start implementation */ #ifdef WIN32 ints[0] = interrupt->event; if (interrupt->device != FTDM_INVALID_SOCKET) { num++; ints[1] = interrupt->device; + ftdm_log(FTDM_LOG_CRIT, "implement me! (Windows support for device_output_flags member!)\n"); } res = WaitForMultipleObjects(num, ints, FALSE, ms >= 0 ? ms : INFINITE); switch (res) { @@ -422,7 +426,7 @@ pollagain: if (interrupt->device != FTDM_INVALID_SOCKET) { num++; ints[1].fd = interrupt->device; - ints[1].events = POLLIN; + ints[1].events = interrupt->device_input_flags; ints[1].revents = 0; } @@ -446,7 +450,17 @@ pollagain: ftdm_log(FTDM_LOG_CRIT, "reading interrupt descriptor failed (%s)\n", strerror(errno)); } } - + if (interrupt->device != FTDM_INVALID_SOCKET) { + if (ints[1].revents & POLLIN) { + interrupt->device_output_flags |= FTDM_READ; + } + if (ints[1].revents & POLLOUT) { + interrupt->device_output_flags |= FTDM_WRITE; + } + if (ints[1].revents & POLLPRI) { + interrupt->device_output_flags |= FTDM_EVENTS; + } + } return FTDM_SUCCESS; #endif } @@ -515,10 +529,12 @@ FT_DECLARE(ftdm_status_t) ftdm_interrupt_multiple_wait(ftdm_interrupt_t *interru for (i = 0; i < size; i++) { ints[i] = interrupts[i]->event; + interrupts[i]->device_output_flags = FTDM_NO_FLAGS; if (interrupts[i]->device != FTDM_INVALID_SOCKET) { - + /* WARNING: if the device is ready for data we must implement for Windows the device_output_flags member */ ints[size+numdevices] = interrupts[i]->device; numdevices++; + ftdm_log(FTDM_LOG_CRIT, "implement me! (Windows support for device_data_ready member!)\n", size); } } @@ -548,17 +564,16 @@ pollagain: ints[i].events = POLLIN; ints[i].revents = 0; ints[i].fd = interrupts[i]->readfd; + interrupts[i]->device_output_flags = FTDM_NO_FLAGS; if (interrupts[i]->device != FTDM_INVALID_SOCKET) { - ints[size+numdevices].events = POLLIN; + ints[size+numdevices].events = interrupts[i]->device_input_flags; ints[size+numdevices].revents = 0; ints[size+numdevices].fd = interrupts[i]->device; - numdevices++; } } res = poll(ints, size + numdevices, ms); - if (res == -1) { if (errno == EINTR) { goto pollagain; @@ -571,7 +586,8 @@ pollagain: return FTDM_TIMEOUT; } - /* check for events in the pipes, NOT in the devices */ + /* check for events in the pipes and in the devices, but service only the pipes */ + numdevices = 0; for (i = 0; i < size; i++) { if (ints[i].revents & POLLIN) { res = read(ints[i].fd, pipebuf, sizeof(pipebuf)); @@ -579,6 +595,18 @@ pollagain: ftdm_log(FTDM_LOG_CRIT, "reading interrupt descriptor failed (%s)\n", strerror(errno)); } } + if (interrupts[i]->device != FTDM_INVALID_SOCKET) { + if (ints[size+numdevices].revents & POLLIN) { + interrupts[i]->device_output_flags |= FTDM_READ; + } + if (ints[size+numdevices].revents & POLLOUT) { + interrupts[i]->device_output_flags |= FTDM_WRITE; + } + if (ints[size+numdevices].revents & POLLPRI) { + interrupts[i]->device_output_flags |= FTDM_EVENTS; + } + numdevices++; + } } #else /* for MacOS compilation, unused vars */ @@ -587,6 +615,15 @@ pollagain: return FTDM_SUCCESS; } +FT_DECLARE(ftdm_wait_flag_t) ftdm_interrupt_device_ready(ftdm_interrupt_t *interrupt) +{ +#if defined(__WINDOWS__) + /* device output flags are not currently filled for Windows upon returning from a wait function */ + ftdm_log(FTDM_LOG_CRIT, "IMPLEMENT ME!\n"); +#endif + return interrupt->device_output_flags; +} + /* For Emacs: * Local Variables: * mode:c diff --git a/libs/freetdm/src/ftmod/ftmod_analog/ftdm_analog.h b/libs/freetdm/src/ftmod/ftmod_analog/ftdm_analog.h index a2339120c5..47a7a43491 100644 --- a/libs/freetdm/src/ftmod/ftmod_analog/ftdm_analog.h +++ b/libs/freetdm/src/ftmod/ftmod_analog/ftdm_analog.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c b/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c index 85da471739..25e2a5ac77 100644 --- a/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c +++ b/libs/freetdm/src/ftmod/ftmod_analog/ftmod_analog.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_analog_em/ftdm_analog_em.h b/libs/freetdm/src/ftmod/ftmod_analog_em/ftdm_analog_em.h index 83d5bb31d9..22a1c25132 100644 --- a/libs/freetdm/src/ftmod/ftmod_analog_em/ftdm_analog_em.h +++ b/libs/freetdm/src/ftmod/ftmod_analog_em/ftdm_analog_em.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Anthony Minessale II + * Copyright (c) 2008-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c b/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c index 907a8cb034..f7f0683673 100644 --- a/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c +++ b/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Anthony Minessale II + * Copyright (c) 2008-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_gsm/ftmod_gsm.c b/libs/freetdm/src/ftmod/ftmod_gsm/ftmod_gsm.c new file mode 100755 index 0000000000..35a7be22bb --- /dev/null +++ b/libs/freetdm/src/ftmod/ftmod_gsm/ftmod_gsm.c @@ -0,0 +1,1329 @@ +/* + * Copyright (c) 2011, Sangoma Technologies + * All rights reserved. + * + Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the original author; nor the names of any contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Contributors: + * + * Gideon Sadan + * Moises Silva + * + */ + + +#define _GNU_SOURCE + +#include +#include +#include + +#include +#include +#include +#include +#include +/*========================*/ + +#include +#include +#include + +#include + +// Debug +#define LOG_SIG_DATA 0 +#define DEBUG_STATES 0 + + +#if DEBUG_STATES // state debugging +#define STATE_ADVANCE_LOG_LEVEL FTDM_LOG_CRIT +#else +#define STATE_ADVANCE_LOG_LEVEL FTDM_LOG_DEBUG +#endif + + +/********************************************************************************/ +/* */ +/* MACROS */ +/* */ +/********************************************************************************/ +// Macro to send signals +#define SEND_STATE_SIGNAL(sig) \ + { \ + ftdm_sigmsg_t sigev; \ + memset(&sigev, 0, sizeof(sigev)); \ + sigev.event_id = sig; \ + sigev.channel = ftdmchan; \ + ftdm_span_send_signal(ftdmchan->span, &sigev); \ + } + +// Syntax message +#define FT_SYNTAX "USAGE:\n" \ +"--------------------------------------------------------------------------------\n" \ +"ftdm gsm version \n" \ +"ftdm gsm status \n" \ +"ftdm gsm sms \n" \ +"--------------------------------------------------------------------------------\n" + +// Used to declare command handler +#define COMMAND_HANDLER(name) \ + ftdm_status_t fCMD_##name(ftdm_stream_handle_t *stream, char *argv[], int argc); \ + ftdm_status_t fCMD_##name(ftdm_stream_handle_t *stream, char *argv[], int argc) + +// Used to define command entry in the command map. +#define COMMAND(name, argc) {#name, argc, fCMD_##name} + +/********************************************************************************/ +/* */ +/* types */ +/* */ +/********************************************************************************/ + +// private data +typedef struct ftdm_gsm_span_data_s { + ftdm_span_t *span; + ftdm_channel_t *dchan; + ftdm_channel_t *bchan; + int32_t call_id; +} ftdm_gsm_span_data_t; + +// command handler function type. +typedef ftdm_status_t (*fCMD)(ftdm_stream_handle_t *stream, char *argv[], int argc); + + + +/********************************************************************************/ +/* */ +/* function declaration */ +/* */ +/********************************************************************************/ +static ftdm_status_t init_wat_lib(void); +static int wat_lib_initialized = 0; +static FIO_API_FUNCTION(ftdm_gsm_api); + + + +/* wat callbacks */ +int on_wat_span_write(unsigned char span_id, void *buffer, unsigned len); + +void on_wat_con_ind(unsigned char span_id, uint8_t call_id, wat_con_event_t *con_event); +void on_wat_con_sts(unsigned char span_id, uint8_t call_id, wat_con_status_t *status); +void on_wat_rel_ind(unsigned char span_id, uint8_t call_id, wat_rel_event_t *rel_event); +void on_wat_rel_cfm(unsigned char span_id, uint8_t call_id); +void on_wat_sms_ind(unsigned char span_id, wat_sms_event_t *sms_event); +void on_wat_sms_sts(unsigned char span_id, uint8_t sms_id, wat_sms_status_t *status); + + +void on_wat_log(uint8_t level, char *fmt, ...); +void *on_wat_malloc(size_t size); +void *on_wat_calloc(size_t nmemb, size_t size); +void on_wat_free(void *ptr); +void on_wat_log_span(uint8_t span_id, uint8_t level, char *fmt, ...); + + +ftdm_span_t *GetSpanByID(unsigned char span_id, ftdm_gsm_span_data_t **gsm_data); + +static void *ftdm_gsm_run(ftdm_thread_t *me, void *obj); + +/********************************************************************************/ +/* */ +/* static & global data */ +/* */ +/********************************************************************************/ +int g_outbound_call_id = 8; + +/* IO interface for the command API */ +static ftdm_io_interface_t g_ftdm_gsm_interface; + +/********************************************************************************/ +/* */ +/* implementation */ +/* */ +/********************************************************************************/ +static int read_channel(ftdm_channel_t *ftdm_chan , const void *buf, int size) +{ + + ftdm_size_t outsize = size; + ftdm_status_t status = ftdm_channel_read(ftdm_chan, (void *)buf, &outsize); + if (FTDM_FAIL == status) { + return -1; + } + return (int)outsize; +} + + +int on_wat_span_write(unsigned char span_id, void *buffer, unsigned len) +{ + +#if LOG_SIG_DATA + fprintf(stdout, " Out Data ====================>>> %s \r\n (%d) - %d\n", (char *)buffer, len, (int) span_id); +#endif + + ftdm_span_t *span = NULL; + ftdm_status_t status = FTDM_FAIL; + ftdm_gsm_span_data_t *gsm_data = NULL; + ftdm_size_t outsize = len; + + status = ftdm_span_find(span_id, &span); + if (status != FTDM_SUCCESS) { + ftdm_log(FTDM_LOG_ERROR, "Failed to find span %d to write %d bytes\n", span_id, len); + return -1; + } + + gsm_data = span->signal_data; + status = ftdm_channel_write(gsm_data->dchan, (void *)buffer, len, &outsize); + if (status != FTDM_SUCCESS) { + ftdm_log(FTDM_LOG_ERROR, "Failed to write %d bytes to d-channel in span %s\n", len, span->name); + return -1; + } + +//#if LOG_SIG_DATA +// fprintf(stdout, "\r\n==================== len=%d outsize=%d \r\n", len, (int)outsize); +//#endif + + fflush(stdout); + return len; + + +} + +static void on_wat_span_status(unsigned char span_id, wat_span_status_t *status) +{ + switch (status->type) { + case WAT_SPAN_STS_READY: + { + ftdm_log(FTDM_LOG_INFO, "span %d: Ready\n", span_id); + } + break; + case WAT_SPAN_STS_SIGSTATUS: + { + if (status->sts.sigstatus == WAT_SIGSTATUS_UP) { + ftdm_log(FTDM_LOG_INFO, "span %d: Signaling is now up\n", span_id); + } else { + ftdm_log(FTDM_LOG_INFO, "span %d: Signaling is now down\n", span_id); + } + } + break; + case WAT_SPAN_STS_SIM_INFO_READY: + { + ftdm_log(FTDM_LOG_INFO, "span %d: SIM information ready\n", span_id); + } + break; + case WAT_SPAN_STS_ALARM: + { + ftdm_log(FTDM_LOG_INFO, "span %d: Alarm received\n", span_id); + } + break; + default: + { + ftdm_log(FTDM_LOG_INFO, "span %d: Unhandled span status notification %d\n", span_id, status->type); + } + break; + } +} + +void on_wat_con_ind(unsigned char span_id, uint8_t call_id, wat_con_event_t *con_event) +{ + //fprintf(stdout, "s%d: Incoming call (id:%d) Calling Number:%s Calling Name:\"%s\" type:%d plan:%d\n", span_id, call_id, con_event->calling_num.digits, con_event->calling_name, con_event->calling_num.type, con_event->calling_num.plan); + + ftdm_log(FTDM_LOG_INFO, "s%d: Incoming call (id:%d) Calling Number:%s Calling Name:\"%s\" type:%d plan:%d\n", span_id, call_id, con_event->calling_num.digits, con_event->calling_name, con_event->calling_num.type, con_event->calling_num.plan); + + ftdm_span_t *span = NULL; + //ftdm_status_t ftdm_status = FTDM_FAIL; + ftdm_gsm_span_data_t *gsm_data = NULL; + + if(!(span = GetSpanByID(span_id, &gsm_data))) { + return; + } + + gsm_data->call_id = call_id; + + #define ZERO_ARRAY(arr) memset(arr, 0, sizeof(arr)) + // cid date + { + time_t t; + struct tm *tmp; + t = time(NULL); + tmp = localtime(&t); + if (tmp == NULL) { + ZERO_ARRAY(gsm_data->bchan->caller_data.cid_date); + strftime(gsm_data->bchan->caller_data.cid_date, sizeof(gsm_data->bchan->caller_data.cid_date), "%y/%m/%d", tmp); + } + + } + + // cid name + ZERO_ARRAY(gsm_data->bchan->caller_data.cid_name); + strncpy(gsm_data->bchan->caller_data.cid_name, con_event->calling_name,sizeof(gsm_data->bchan->caller_data.cid_name)); + + // dnis + ZERO_ARRAY(gsm_data->bchan->caller_data.dnis.digits); + strncpy(gsm_data->bchan->caller_data.dnis.digits, con_event->calling_num.digits, FTDM_DIGITS_LIMIT); + + //collected + ZERO_ARRAY(gsm_data->bchan->caller_data.collected); + strncpy(gsm_data->bchan->caller_data.collected, con_event->calling_num.digits, FTDM_DIGITS_LIMIT); + + ftdm_set_state(gsm_data->bchan, FTDM_CHANNEL_STATE_RING); + + if (ftdm_channel_open_chan(gsm_data->bchan) != FTDM_SUCCESS) { + ftdm_log_chan(gsm_data->bchan, FTDM_LOG_ERROR, "Failed to open GSM b-channel of span %s!\n", span->name); + } + +} + + +ftdm_span_t *GetSpanByID(unsigned char span_id, ftdm_gsm_span_data_t **gsm_data) +{ + ftdm_status_t ftdm_status = FTDM_FAIL; + ftdm_span_t *span = NULL; + if(gsm_data) { + (*gsm_data) = NULL; + } + + ftdm_status = ftdm_span_find(span_id, &span); + if (ftdm_status != FTDM_SUCCESS) { + ftdm_log(FTDM_LOG_ERROR, "GetSpanByID - Failed to find span %d\n", span_id); + return NULL; + } + + if(gsm_data) { + (*gsm_data) = span->signal_data; + } + + return span; + +} + +void on_wat_con_sts(unsigned char span_id, uint8_t call_id, wat_con_status_t *status) +{ + + ftdm_span_t *span = NULL; + //ftdm_status_t ftdm_status = FTDM_FAIL; + ftdm_gsm_span_data_t *gsm_data = NULL; + + if(!(span = GetSpanByID(span_id, &gsm_data))) { + return; + } + + + + switch(status->type) { + + case WAT_CON_STATUS_TYPE_RINGING: + ftdm_log(FTDM_LOG_INFO, "on_wat_con_sts - WAT_CON_STATUS_TYPE_RINGING\r\n"); + ftdm_set_state(gsm_data->bchan, FTDM_CHANNEL_STATE_RINGING); + break; + + case WAT_CON_STATUS_TYPE_ANSWER: + ftdm_log(FTDM_LOG_INFO, "on_wat_con_sts - WAT_CON_STATUS_TYPE_ANSWER\r\n"); + ftdm_set_state(gsm_data->bchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA); + break; + default: + ftdm_log(FTDM_LOG_INFO, "on_wat_con_sts - Unhandled state %d\n", span_id); + + }; + + + return; +} + +void on_wat_rel_ind(unsigned char span_id, uint8_t call_id, wat_rel_event_t *rel_event) +{ + ftdm_log(FTDM_LOG_INFO, "s%d: Call hangup (id:%d) cause:%d\n", span_id, call_id, rel_event->cause); + + ftdm_span_t *span = NULL; + //ftdm_status_t ftdm_status = FTDM_FAIL; + ftdm_gsm_span_data_t *gsm_data = NULL; + + if(!(span = GetSpanByID(span_id, &gsm_data))) { + return; + } + + ftdm_set_state(gsm_data->bchan, FTDM_CHANNEL_STATE_HANGUP); + + +} + +void on_wat_rel_cfm(unsigned char span_id, uint8_t call_id) +{ + ftdm_log(FTDM_LOG_INFO, "s%d: Call hangup complete (id:%d)\n", span_id, call_id); + ftdm_span_t *span = NULL; + //ftdm_status_t ftdm_status = FTDM_FAIL; + ftdm_gsm_span_data_t *gsm_data = NULL; + + if(!(span = GetSpanByID(span_id, &gsm_data))) { + return; + } + + switch(gsm_data->dchan->state) { + case FTDM_CHANNEL_STATE_UP: + ftdm_set_state(gsm_data->bchan, FTDM_CHANNEL_STATE_HANGUP); + break; + default: + ftdm_set_state(gsm_data->bchan, FTDM_CHANNEL_STATE_DOWN); + break; + } + +} + +void on_wat_sms_ind(unsigned char span_id, wat_sms_event_t *sms_event) +{ + //printf("on_wat_sms_ind\r\n"); + + ftdm_span_t *span = NULL; + ftdm_channel_t *ftdmchan; + + ftdm_gsm_span_data_t *gsm_data = NULL; + + if(!(span = GetSpanByID(span_id, &gsm_data))) { + return; + } + + ftdmchan = gsm_data->dchan; + + { + ftdm_sms_data_t sms_data; + memset(&sms_data, 0, sizeof(sms_data)); + + strncpy(sms_data.from, sms_event->from.digits, sizeof(sms_data.from)); + strncpy(sms_data.body, sms_event->content.data, sizeof(sms_data.body)); + + ftdm_sigmsg_t sigev; + memset(&sigev, 0, sizeof(sigev)); + sigev.event_id = FTDM_SIGEVENT_SMS; + sigev.channel = ftdmchan ; + gsm_data->dchan->caller_data.priv = (void *)&sms_data; + ftdm_span_send_signal(span, &sigev); + } +// SEND_STATE_SIGNAL(FTDM_SIGEVENT_SMS); + return; +} + +void on_wat_sms_sts(unsigned char span_id, uint8_t sms_id, wat_sms_status_t *status) +{ + + if(status->success) { + ftdm_log(FTDM_LOG_INFO, "Span %d SMS Send - OK\n", span_id ); + } + else { + ftdm_log(FTDM_LOG_CRIT, "Span %d SMS Send - FAIL (%s)\n", span_id, status->error); + + } + + + return; +} + + + +void on_wat_log(uint8_t level, char *fmt, ...) +{ + + int ftdm_level; + + va_list argptr; + va_start(argptr, fmt); + + char buff[10001]; + switch(level) { + case WAT_LOG_CRIT: ftdm_level = FTDM_LOG_LEVEL_CRIT; break; + case WAT_LOG_ERROR: ftdm_level = FTDM_LOG_LEVEL_ERROR; break; + default: + case WAT_LOG_WARNING: ftdm_level = FTDM_LOG_LEVEL_WARNING; break; + case WAT_LOG_INFO: ftdm_level = FTDM_LOG_LEVEL_INFO; break; + case WAT_LOG_NOTICE: ftdm_level = FTDM_LOG_LEVEL_NOTICE; break; + case WAT_LOG_DEBUG: ftdm_level = FTDM_LOG_LEVEL_DEBUG; break; + + }; + + + vsprintf(buff, fmt, argptr); + + ftdm_log(FTDM_PRE, ftdm_level, "WAT :%s", buff); + + va_end(argptr); +} + + +void *on_wat_malloc(size_t size) +{ + return ftdm_malloc(size); +} + +void *on_wat_calloc(size_t nmemb, size_t size) +{ + return ftdm_calloc(nmemb, size); +} + +void on_wat_free(void *ptr) +{ + ftdm_free(ptr); +} + +void on_wat_log_span(uint8_t span_id, uint8_t level, char *fmt, ...) +{ + int ftdm_level; +return; + va_list argptr; + va_start(argptr, fmt); + + char buff[10001]; + switch(level) { + case WAT_LOG_CRIT: ftdm_level = FTDM_LOG_LEVEL_CRIT; break; + case WAT_LOG_ERROR: ftdm_level = FTDM_LOG_LEVEL_ERROR; break; + default: + + case WAT_LOG_WARNING: ftdm_level = FTDM_LOG_LEVEL_WARNING; break; + case WAT_LOG_INFO: ftdm_level = FTDM_LOG_LEVEL_INFO; break; + case WAT_LOG_NOTICE: ftdm_level = FTDM_LOG_LEVEL_NOTICE; break; + case WAT_LOG_DEBUG: ftdm_level = FTDM_LOG_LEVEL_DEBUG; break; + + }; + + + vsprintf(buff, fmt, argptr); + + ftdm_log(FTDM_PRE, ftdm_level, "WAT span %d:%s", span_id, buff); + + va_end(argptr); + + +} + + +/* END wat callbacks */ + +/* span monitor thread */ +static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(gsm_outgoing_call) +{ + + return FTDM_SUCCESS; +} + +static ftdm_status_t ftdm_gsm_start(ftdm_span_t *span) +{ + if (wat_span_start(span->span_id)) { + ftdm_log(FTDM_LOG_ERROR, "Failed to start span %s!\n", span->name); + return FTDM_SUCCESS; + } + + return ftdm_thread_create_detached(ftdm_gsm_run, span); +} + +static ftdm_status_t ftdm_gsm_stop(ftdm_span_t *span) +{ + return FTDM_SUCCESS; +} + +static FIO_CHANNEL_GET_SIG_STATUS_FUNCTION(ftdm_gsm_get_channel_sig_status) +{ + ftdm_log(FTDM_LOG_INFO, "\r\nftdm_gsm_get_channel_sig_status\r\n"); + + if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_SIG_UP)) { + *status = FTDM_SIG_STATE_UP; + } + else { + *status = FTDM_SIG_STATE_DOWN; + } + *status = FTDM_SIG_STATE_UP; + return FTDM_SUCCESS; + +} + +static FIO_CHANNEL_SET_SIG_STATUS_FUNCTION(ftdm_gsm_set_channel_sig_status) +{ + return FTDM_SUCCESS; +} + +static FIO_SPAN_GET_SIG_STATUS_FUNCTION(ftdm_gsm_get_span_sig_status) +{ + *status = FTDM_SIG_STATE_UP; + return FTDM_SUCCESS; +} + +static FIO_SPAN_SET_SIG_STATUS_FUNCTION(ftdm_gsm_set_span_sig_status) +{ + return FTDM_SUCCESS; +} + +static ftdm_state_map_t gsm_state_map = { + { + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_ANY_STATE, FTDM_END}, + {FTDM_CHANNEL_STATE_RESET, FTDM_END} + }, + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_RESET, FTDM_END}, + {FTDM_CHANNEL_STATE_DOWN, FTDM_END} + }, + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_DOWN, FTDM_END}, + {FTDM_CHANNEL_STATE_RING, FTDM_END} + }, + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_RING, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_UP, FTDM_END} + }, + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_END}, + {FTDM_CHANNEL_STATE_DOWN, FTDM_END}, + }, + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_TERMINATING, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_END}, + }, + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_UP, FTDM_END}, + }, + { + ZSD_INBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_UP, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_END}, + }, + + /* Outbound states */ + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_ANY_STATE, FTDM_END}, + {FTDM_CHANNEL_STATE_RESET, FTDM_END} + }, + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_RESET, FTDM_END}, + {FTDM_CHANNEL_STATE_DOWN, FTDM_END} + }, + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_DOWN, FTDM_END}, + {FTDM_CHANNEL_STATE_DIALING, FTDM_END} + }, + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_DIALING, FTDM_CHANNEL_STATE_RINGING, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_RINGING, FTDM_END} + }, + + + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_END}, + {FTDM_CHANNEL_STATE_DOWN, FTDM_END} + }, + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_TERMINATING, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_END} + }, + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_UP, FTDM_END} + }, + + { + ZSD_OUTBOUND, + ZSM_UNACCEPTABLE, + {FTDM_CHANNEL_STATE_UP, FTDM_END}, + {FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_END} + }, + } +}; + +static ftdm_status_t ftdm_gsm_state_advance(ftdm_channel_t *ftdmchan) +{ + + ftdm_log_chan(ftdmchan, STATE_ADVANCE_LOG_LEVEL , "Executing state handler for %s\n", ftdm_channel_state2str(ftdmchan->state)); + + ftdm_channel_complete_state(ftdmchan); + + switch (ftdmchan->state) { + + /* starting an incoming call */ + case FTDM_CHANNEL_STATE_COLLECT: + { + + + } + break; + + /* starting an outgoing call */ + case FTDM_CHANNEL_STATE_DIALING: + { + uint32_t interval = 0; + + ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Starting outgoing call with interval %d\n", interval); + + { + + ftdm_gsm_span_data_t *gsm_data; + gsm_data = ftdmchan->span->signal_data; + gsm_data->call_id = g_outbound_call_id++; + wat_con_event_t con_event; + memset(&con_event, 0, sizeof(con_event)); + sprintf(con_event.called_num.digits, ftdmchan->caller_data.dnis.digits); + ftdm_log(FTDM_LOG_DEBUG, "Dialing number %s\n", con_event.called_num.digits); + wat_con_req(ftdmchan->span->span_id, gsm_data->call_id , &con_event); + + SEND_STATE_SIGNAL(FTDM_SIGEVENT_DIALING); + + + } + + + } + break; + + /* incoming call was offered */ + case FTDM_CHANNEL_STATE_RING: + + /* notify the user about the new call */ + + ftdm_log(FTDM_LOG_INFO, "Answering Incomming Call\r\n"); + SEND_STATE_SIGNAL(FTDM_SIGEVENT_START); + + break; + + /* the call is making progress */ + case FTDM_CHANNEL_STATE_PROGRESS: + case FTDM_CHANNEL_STATE_PROGRESS_MEDIA: + { + SEND_STATE_SIGNAL(FTDM_SIGEVENT_PROGRESS_MEDIA); + ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_UP); + } + break; + + /* the call was answered */ + case FTDM_CHANNEL_STATE_UP: + { + if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) { + + SEND_STATE_SIGNAL(FTDM_SIGEVENT_UP); + } + else { + ftdm_gsm_span_data_t *gsm_data; + gsm_data = ftdmchan->span->signal_data; + wat_con_cfm(ftdmchan->span->span_id, gsm_data->call_id); + } + + + } + break; + + /* just got hangup */ + case FTDM_CHANNEL_STATE_HANGUP: + { + ftdm_gsm_span_data_t *gsm_data; + gsm_data = ftdmchan->span->signal_data; + wat_rel_req(ftdmchan->span->span_id, gsm_data->call_id); + gsm_data->call_id = 0; + SEND_STATE_SIGNAL(FTDM_SIGEVENT_STOP); + } + break; + + case FTDM_CHANNEL_STATE_TERMINATING: + { + SEND_STATE_SIGNAL(FTDM_SIGEVENT_STOP); + } + break; + + /* finished call for good */ + case FTDM_CHANNEL_STATE_DOWN: + { + ftdm_channel_t *closed_chan; + closed_chan = ftdmchan; + ftdm_channel_close(&closed_chan); + ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "State processing ended.\n"); + SEND_STATE_SIGNAL(FTDM_SIGEVENT_STOP); + } + break; + + /* INDICATE_RINGING doesn't apply to MFC/R2. maybe we could generate a tone */ + case FTDM_CHANNEL_STATE_RINGING: + ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "RINGING indicated, ignoring it as it doesn't apply to MFC/R2\n"); + SEND_STATE_SIGNAL(FTDM_SIGEVENT_RINGING); + + break; + + /* put the r2 channel back to IDLE, close ftdmchan and set it's state as DOWN */ + case FTDM_CHANNEL_STATE_RESET: + { + ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "RESET indicated, putting the R2 channel back to IDLE\n"); + ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_DOWN); + } + break; + + default: + { + ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Unhandled channel state change: %s\n", ftdm_channel_state2str(ftdmchan->state)); + } + break; + } + + + return FTDM_SUCCESS; +} + + + +static ftdm_status_t init_wat_lib(void) +{ + if (wat_lib_initialized) { + return FTDM_SUCCESS; + } + + wat_interface_t wat_interface; + + ftdm_log(FTDM_LOG_DEBUG, "Registering interface to WAT Library...\n"); + + memset(&wat_interface, 0, sizeof(wat_interface)); + wat_interface.wat_span_write = on_wat_span_write; + + wat_interface.wat_log = on_wat_log; + wat_interface.wat_log_span = on_wat_log_span; + wat_interface.wat_malloc = on_wat_malloc; + wat_interface.wat_calloc = on_wat_calloc; + wat_interface.wat_free = on_wat_free; + + wat_interface.wat_con_ind = on_wat_con_ind; + wat_interface.wat_con_sts = on_wat_con_sts; + wat_interface.wat_rel_ind = on_wat_rel_ind; + wat_interface.wat_rel_cfm = on_wat_rel_cfm; + wat_interface.wat_sms_ind = on_wat_sms_ind; + wat_interface.wat_sms_sts = on_wat_sms_sts; + wat_interface.wat_span_sts = on_wat_span_status; + + if (wat_register(&wat_interface)) { + ftdm_log(FTDM_LOG_DEBUG, "Failed registering interface to WAT library ...\n"); + return FTDM_FAIL; + } + + ftdm_log(FTDM_LOG_DEBUG, "Registered interface to WAT library\n"); + + wat_lib_initialized = 1; + return FTDM_SUCCESS; +} + + +static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_gsm_configure_span_signaling) +{ + wat_span_config_t span_config; + ftdm_gsm_span_data_t *gsm_data = NULL; + ftdm_iterator_t *chaniter = NULL; + ftdm_iterator_t *citer = NULL; + ftdm_channel_t *ftdmchan = NULL; + ftdm_channel_t *dchan = NULL; + ftdm_channel_t *bchan = NULL; + + unsigned paramindex = 0; + const char *var = NULL; + const char *val = NULL; + + /* libwat is smart enough to set good default values for the timers if they are set to 0 */ + memset(&span_config, 0, sizeof(span_config)); + + /* set some span defaults */ + span_config.moduletype = WAT_MODULE_TELIT; + + if (FTDM_SUCCESS != init_wat_lib()) { + return FTDM_FAIL; + } + + if (!sig_cb) { + ftdm_log(FTDM_LOG_ERROR, "No signaling callback provided\n"); + return FTDM_FAIL; + } + + if (span->signal_type) { + ftdm_log(FTDM_LOG_ERROR, "Span %s is already configured for another signaling\n", span->name); + return FTDM_FAIL; + } + + /* verify the span has one d-channel */ + chaniter = ftdm_span_get_chan_iterator(span, NULL); + + if (!chaniter) { + ftdm_log(FTDM_LOG_CRIT, "Failed to allocate channel iterator for span %s!\n", span->name); + return FTDM_FAIL; + } + + citer = ftdm_span_get_chan_iterator(span, chaniter); + for ( ; citer; citer = ftdm_iterator_next(citer)) { + ftdmchan = ftdm_iterator_current(citer); + + if ((NULL == dchan) && FTDM_IS_DCHAN(ftdmchan)) { + dchan = ftdmchan; + } + if ((NULL == bchan) && FTDM_IS_VOICE_CHANNEL(ftdmchan)) { + bchan = ftdmchan; + } + + } + ftdm_iterator_free(chaniter); + + if (!dchan) { + ftdm_log(FTDM_LOG_CRIT, "Could not find a d-channel for GSM span %s!\n", span->name); + return FTDM_FAIL; + } + if (!bchan) { + ftdm_log(FTDM_LOG_CRIT, "Could not find a b-channel for GSM span %s!\n", span->name); + return FTDM_FAIL; + } + + + + + + gsm_data = ftdm_calloc(1, sizeof(*gsm_data)); + if (!gsm_data) { + return FTDM_FAIL; + } + gsm_data->dchan = dchan; + gsm_data->bchan = bchan; + + //sprintf(gsm_data->dchan->chan_name, "%s\t\n", "GSM dchan"); + //sprintf(gsm_data->bchan->chan_name, "%s\r\n", "GSM bchan"); + + for (paramindex = 0; ftdm_parameters[paramindex].var; paramindex++) { + var = ftdm_parameters[paramindex].var; + val = ftdm_parameters[paramindex].val; + if (!ftdm_strlen_zero_buf(val)) { + ftdm_log(FTDM_LOG_WARNING, "Ignoring empty GSM parameter %s for span %s\n", var, val, span->name); + continue; + } + ftdm_log(FTDM_LOG_DEBUG, "Reading GSM parameter %s=%s for span %s\n", var, val, span->name); + if (!strcasecmp(var, "moduletype")) { + span_config.moduletype = wat_str2wat_moduletype(val); + if (span_config.moduletype == WAT_MODULE_INVALID) { + ftdm_log(FTDM_LOG_DEBUG, "Unknown GSM module type %s for span %s\n", val, span->name); + continue; + } + ftdm_log(FTDM_LOG_DEBUG, "Configuring GSM span %s with moduletype %s\n", span->name, val); + } else { + ftdm_log(FTDM_LOG_ERROR, "Ignoring unknown GSM parameter '%s'", var); + } + } + + /* Bind function pointers for control operations */ + span->start = ftdm_gsm_start; + span->stop = ftdm_gsm_stop; + span->sig_read = NULL; + span->sig_write = NULL; + + span->signal_cb = sig_cb; + span->signal_type = FTDM_SIGTYPE_GSM; + span->signal_data = gsm_data; /* Gideon, plz fill me with gsm span specific data (you allocate and free) */ + span->outgoing_call = gsm_outgoing_call; + span->get_span_sig_status = ftdm_gsm_get_span_sig_status; + span->set_span_sig_status = ftdm_gsm_set_span_sig_status; + span->get_channel_sig_status = ftdm_gsm_get_channel_sig_status; + span->set_channel_sig_status = ftdm_gsm_set_channel_sig_status; + + //printf("\r\nspan->state_map = &gsm_state_map;\r\n"); + span->state_map = &gsm_state_map; + span->state_processor = ftdm_gsm_state_advance; + + /* use signals queue */ + ftdm_set_flag(span, FTDM_SPAN_USE_SIGNALS_QUEUE); + ftdm_set_flag(span, FTDM_SPAN_USE_CHAN_QUEUE); + + /* we can skip states (going straight from RING to UP) */ + ftdm_set_flag(span, FTDM_SPAN_USE_SKIP_STATES); + + gsm_data->span = span; + +#if 0 + /* setup the scheduler (create if needed) */ + snprintf(schedname, sizeof(schedname), "ftmod_r2_%s", span->name); + ftdm_assert(ftdm_sched_create(&r2data->sched, schedname) == FTDM_SUCCESS, "Failed to create schedule!\n"); + spanpvt->sched = r2data->sched; +#endif + + +fprintf(stdout, "Configuring wat span %d %s \r\n", span->span_id, span->name); + if (wat_span_config(span->span_id, &span_config)) { + ftdm_log(FTDM_LOG_ERROR, "Failed to configure span %s for GSM signaling!!\n", span->name); + return FTDM_FAIL; + } + + { + int codec = FTDM_CODEC_SLIN; + int interval = 20; + + ftdm_channel_command(gsm_data->bchan, FTDM_COMMAND_SET_NATIVE_CODEC, &codec); + ftdm_channel_command(gsm_data->bchan, FTDM_COMMAND_SET_CODEC, &codec); + ftdm_channel_command(gsm_data->bchan, FTDM_COMMAND_SET_INTERVAL, &interval); + } + + return FTDM_SUCCESS; + +} + +#define GSM_POLL_INTERVAL_MS 20 +static void *ftdm_gsm_run(ftdm_thread_t *me, void *obj) +{ + + ftdm_log(FTDM_LOG_INFO,"ftdm_gsm_run\r\n"); + + ftdm_channel_t *ftdmchan = NULL; + ftdm_span_t *span = (ftdm_span_t *) obj; + ftdm_gsm_span_data_t *gsm_data = NULL; + ftdm_interrupt_t *data_sources[2] = {NULL, NULL}; + int waitms = 0; + + gsm_data = span->signal_data; + + ftdm_assert_return(gsm_data != NULL, NULL, "No gsm data attached to span\n"); + + ftdm_log(FTDM_LOG_DEBUG, "GSM monitor thread for span %s started\n", span->name); + if (!gsm_data->dchan || ftdm_channel_open_chan(gsm_data->dchan) != FTDM_SUCCESS) { + ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Failed to open GSM d-channel of span %s!\n", span->name); + gsm_data->dchan = NULL; + goto done; + } + + + + + while (ftdm_running()) { + + wat_span_run(span->span_id); + + waitms = wat_span_schedule_next(span->span_id); + if (waitms > GSM_POLL_INTERVAL_MS) { + waitms = GSM_POLL_INTERVAL_MS; + } + +///////////////////// + + + { + ftdm_wait_flag_t flags = FTDM_READ | FTDM_EVENTS; + ftdm_status_t status = ftdm_channel_wait(gsm_data->dchan, &flags, waitms); + + + /* double check that this channel has a state change pending */ + ftdm_channel_lock(gsm_data->bchan); + ftdm_channel_advance_states(gsm_data->bchan); + + if(FTDM_SUCCESS == status ) { + + if(flags &FTDM_READ ) { + char buffer[1025]; + int n = 0, m = 0; + memset(buffer, 0, sizeof(buffer)); + + n = read_channel(gsm_data->dchan, buffer, sizeof(buffer)-1); + m = strlen(buffer); + wat_span_process_read(span->span_id, buffer, m); +#if LOG_SIG_DATA + printf("<<======================= incomming data len = %d, %s\r\n", n, buffer); +#endif + + } + } + + ftdm_channel_advance_states(gsm_data->bchan); + + ftdm_channel_unlock(gsm_data->bchan); + + + } + + + + + ftdm_span_trigger_signals(span); + + + } + +done: + if (data_sources[0]) { + ftdm_interrupt_destroy(&data_sources[0]); + } + + ftdm_log(FTDM_LOG_DEBUG, "GSM thread ending.\n"); + + return NULL; +} + + + +static FIO_IO_LOAD_FUNCTION(ftdm_gsm_io_init) +{ + assert(fio != NULL); + memset(&g_ftdm_gsm_interface, 0, sizeof(g_ftdm_gsm_interface)); + + g_ftdm_gsm_interface.name = "gsm"; + g_ftdm_gsm_interface.api = ftdm_gsm_api; + + *fio = &g_ftdm_gsm_interface; + + return (FTDM_SUCCESS); +} +static FIO_SIG_LOAD_FUNCTION(ftdm_gsm_init) +{ + /* this is called on module load */ + return FTDM_SUCCESS; +} + +static FIO_SIG_UNLOAD_FUNCTION(ftdm_gsm_destroy) +{ + /* this is called on module unload */ + return FTDM_SUCCESS; +} + +EX_DECLARE_DATA ftdm_module_t ftdm_module = { + /* .name */ "gsm", + /* .io_load */ ftdm_gsm_io_init, + /* .io_unload */ NULL, + /* .sig_load */ ftdm_gsm_init, + /* .sig_configure */ NULL, + /* .sig_unload */ ftdm_gsm_destroy, + /* .configure_span_signaling */ ftdm_gsm_configure_span_signaling +}; + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ + + +/********************************************************************************/ +/* */ +/* COMMAND HANDLERS */ +/* */ +/********************************************************************************/ + + +// Version Command Handler +COMMAND_HANDLER(version) +{ + uint8_t current = 0, revision = 0, age = 0; + wat_version(¤t, &revision, &age); + stream->write_function(stream, "libwat version: %d.%d.%d\n", current, revision, age); + stream->write_function(stream, "+OK.\n"); + return FTDM_SUCCESS; +} + + +// Status Command Handler +COMMAND_HANDLER(status) +{ + int span_id = 0; + ftdm_span_t *span = NULL; + const wat_chip_info_t *chip_info = NULL; + const wat_sim_info_t *sim_info = NULL; + const wat_net_info_t *net_info = NULL; + const wat_sig_info_t *sig_info = NULL; + const wat_pin_stat_t *pin_stat = NULL; + + + span_id = atoi(argv[0]); + if (ftdm_span_find_by_name(argv[0], &span) != FTDM_SUCCESS && ftdm_span_find(span_id, &span) != FTDM_SUCCESS) { + stream->write_function(stream, "-ERR Failed to find GSM span '%s'\n", argv[1]); + return FTDM_FAIL; + } + + if (!span || !span->signal_data || (span->start != ftdm_gsm_start)) { + stream->write_function(stream, "-ERR '%s' is not a valid GSM span\n", argv[1]); + return FTDM_FAIL; + } + + chip_info = wat_span_get_chip_info(span->span_id); + sim_info = wat_span_get_sim_info(span->span_id); + net_info = wat_span_get_net_info(span->span_id); + sig_info = wat_span_get_sig_info(span->span_id); + pin_stat = wat_span_get_pin_info(span->span_id); + + stream->write_function(stream, "Span %d (%s):\n", span->span_id, span->name); + + stream->write_function(stream, "CHIP type - %s (%s), revision %s, serial %s \n", + chip_info->manufacturer, + chip_info->model, + chip_info->revision, + chip_info->serial); + + stream->write_function(stream, "SIM - Subscriber type %s, imsi %s\n", sim_info->subscriber_type, sim_info->imsi); + + stream->write_function(stream, "Subscriber - Number %s, Plan %s, validity %s\n", + sim_info->subscriber.digits, + wat_number_type2str(sim_info->subscriber.type), + wat_number_plan2str(sim_info->subscriber.plan), + wat_number_validity2str(sim_info->subscriber.validity)); + + stream->write_function(stream, "Network - status %s, Area Code %d, Cell ID %d, Operator %s\n", + wat_net_stat2str(net_info->stat), net_info->lac, net_info->ci, net_info->operator_name); + + + stream->write_function(stream, "\n"); + + stream->write_function(stream, "+OK.\n"); + + return FTDM_SUCCESS; +} + +// SMS Command Handler +COMMAND_HANDLER(sms) +{ + int span_id = 0,i; + ftdm_span_t *span = NULL; + wat_sms_event_t sms; + + + span_id = atoi(argv[0]); + if (ftdm_span_find_by_name(argv[0], &span) != FTDM_SUCCESS && ftdm_span_find(span_id, &span) != FTDM_SUCCESS) { + stream->write_function(stream, "-ERR Failed to find GSM span '%s'\n", argv[1]); + return FTDM_FAIL; + } + + if (!span || !span->signal_data || (span->start != ftdm_gsm_start)) { + stream->write_function(stream, "-ERR '%s' is not a valid GSM span\n", argv[1]); + return FTDM_FAIL; + } + + memset(&sms, 0, sizeof(sms)); + + strcpy(sms.to.digits, argv[1]); + sms.type = WAT_SMS_TXT; + sms.content.data[0] = '\0'; + for(i=2;ispan_id, g_outbound_call_id++ , &sms)) { + stream->write_function(stream, "Failed to Send SMS \n"); + } + else { + stream->write_function(stream, "SMS Sent.\n"); + } + return FTDM_SUCCESS; +} + + + +// command map +struct { + const char*CMD; // command + int Argc; // minimum args + fCMD Handler; // handling function +} + GSM_COMMANDS[] = { + COMMAND(version, 0), + COMMAND(status, 1), + COMMAND(sms, 3) + }; + +// Commnand API entry point +static FIO_API_FUNCTION(ftdm_gsm_api) +{ + + char *mycmd = NULL, *argv[10] = { 0 }; + int argc = 0; + int i; + ftdm_status_t status = FTDM_FAIL; + ftdm_status_t syntax = FTDM_FAIL; + + + if (data) { + mycmd = ftdm_strdup(data); + argc = ftdm_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if(argc > 0) { + for(i=0;i= GSM_COMMANDS[i].Argc) { + syntax = FTDM_SUCCESS; + status = GSM_COMMANDS[i].Handler(stream, &argv[1], argc-1); + + } + + break; + } + + } + } + + if(FTDM_SUCCESS != syntax) { + stream->write_function(stream, "%s", FT_SYNTAX); + } + else + if(FTDM_SUCCESS != status) { + stream->write_function(stream, "%s Command Failed\r\n", GSM_COMMANDS[i].CMD); + } + ftdm_safe_free(mycmd); + + return FTDM_SUCCESS; +} + + diff --git a/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c b/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c index 4abddf16e1..be5ab50965 100644 --- a/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c +++ b/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.h b/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.h index 6b17f2cbef..dff3d21276 100644 --- a/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.h +++ b/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c index 8ddc42c963..aef0d0ddff 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * Copyright (c) 2010, Stefan Knoblich * All rights reserved. * @@ -114,42 +114,40 @@ static FIO_CHANNEL_REQUEST_FUNCTION(isdn_channel_request) return FTDM_FAIL; } -#ifdef WIN32 -/** - * \brief Logs a libpri error - * \param s Error string - */ -static void s_pri_error(char *s) -#else -/** - * \brief Logs a libpri error - * \param pri libpri structure (unused) - * \param s Error string - */ -static void s_pri_error(struct pri *pri, char *s) -#endif -{ - ftdm_log(FTDM_LOG_ERROR, "%s", s); -} -#ifdef WIN32 /** * \brief Logs a libpri message - * \param s Message string - */ -static void s_pri_message(char *s) -#else -/** - * \brief Logs a libpri message - * \param pri libpri structure (unused) - * \param s Message string + * \param pri libpri structure + * \param s Message string */ static void s_pri_message(struct pri *pri, char *s) -#endif { - ftdm_log(FTDM_LOG_DEBUG, "%s", s); + struct lpwrap_pri *spri = pri_get_userdata(pri); + + if (spri && spri->dchan) { + ftdm_log_chan(spri->dchan, FTDM_LOG_DEBUG, "%s", s); + } else { + ftdm_log(FTDM_LOG_DEBUG, "%s", s); + } } +/** + * \brief Logs a libpri error + * \param pri libpri structure + * \param s Error string + */ +static void s_pri_error(struct pri *pri, char *s) +{ + struct lpwrap_pri *spri = pri_get_userdata(pri); + + if (spri && spri->dchan) { + ftdm_log_chan(spri->dchan, FTDM_LOG_ERROR, "%s", s); + } else { + ftdm_log(FTDM_LOG_ERROR, "%s", s); + } +} + + #define PRI_DEBUG_Q921_ALL (PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_STATE) #define PRI_DEBUG_Q931_ALL (PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q931_ANOMALY) diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.h b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.h index 27b1763fec..b54d0b1dcf 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.h +++ b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Anthony Minessale II + * Copyright (c) 2009-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c index bfb67e4c78..facbc27033 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Anthony Minessale II + * Copyright (c) 2009-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h index b62e5fb176..052f3b080d 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h +++ b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Anthony Minessale II + * Copyright (c) 2009-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 38480950e7..60e3c1425d 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -45,8 +45,6 @@ #include #include -#include - /* this is how it should have been... #ifdef HAVE_FREETDM_FREETDM_H #include @@ -256,7 +254,6 @@ struct misdn_chan_private { /* */ int state; int debugfd; - int timerfd; int active; /* hw addr of channel */ @@ -941,36 +938,7 @@ static FIO_OPEN_FUNCTION(misdn_open) ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "mISDN channel activation request sent\n"); switch (ftdmchan->type) { - case FTDM_CHAN_TYPE_B: { -#if 0 - struct itimerspec its = { - .it_interval = { 0, 0 }, - .it_value = { 0, 0 }, - }; - - its.it_interval.tv_nsec = (ftdmchan->effective_interval * 1000000); - its.it_value.tv_nsec = (ftdmchan->effective_interval * 1000000); - - /* create tx timerfd */ - chan_priv->timerfd = timerfd_create(CLOCK_MONOTONIC, O_NONBLOCK); - if (chan_priv->timerfd < 0) { - ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "mISDN failed to create b-channel tx interval timer: %s\n", - strerror(errno)); - return FTDM_FAIL; - } - - /* start tx timerfd */ - ret = timerfd_settime(chan_priv->timerfd, 0, &its, NULL); - if (ret < 0) { - ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "mISDN failed to start b-channel tx interval timer: %s\n", - strerror(errno)); - return FTDM_FAIL; - } - - ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "mISDN created tx interval (%d ms) timer\n", - ftdmchan->effective_interval); -#endif - } + case FTDM_CHAN_TYPE_B: case FTDM_CHAN_TYPE_DQ921: chan_priv->state = MISDN_CHAN_STATE_OPEN; break; @@ -998,15 +966,6 @@ static FIO_CLOSE_FUNCTION(misdn_close) /* deactivate b-channels on close */ if (ftdm_channel_get_type(ftdmchan) == FTDM_CHAN_TYPE_B) { -#if 0 - /* - * Stop tx timerfd - */ - if (chan_priv->timerfd >= 0) { - close(chan_priv->timerfd); - chan_priv->timerfd = -1; - } -#endif /* * Send deactivation request (don't wait for answer) */ @@ -1570,7 +1529,6 @@ static ftdm_status_t misdn_open_range(ftdm_span_t *span, ftdm_chan_type_t type, priv->addr = addr; priv->debugfd = -1; - priv->timerfd = -1; /* * Create event queue diff --git a/libs/freetdm/src/ftmod/ftmod_pika/ftdm_pika.h b/libs/freetdm/src/ftmod/ftmod_pika/ftdm_pika.h index 882eaba411..1bcf82e285 100644 --- a/libs/freetdm/src/ftmod/ftmod_pika/ftdm_pika.h +++ b/libs/freetdm/src/ftmod/ftmod_pika/ftdm_pika.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_pika/ftmod_pika.c b/libs/freetdm/src/ftmod/ftmod_pika/ftmod_pika.c index aaafdb33cc..0e1ed24afe 100644 --- a/libs/freetdm/src/ftmod/ftmod_pika/ftmod_pika.c +++ b/libs/freetdm/src/ftmod/ftmod_pika/ftmod_pika.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c index d963acc60d..11df566362 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c @@ -953,6 +953,12 @@ void sngisdn_process_sta_cfm (sngisdn_event_data_t *sngisdn_event) break; case 2: /* overlap sending */ switch (ftdmchan->state) { + case FTDM_CHANNEL_STATE_COLLECT: + /* T302 Timeout reached */ + /* Send the call to user, and see if they accept it */ + ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "T302 Timer expired, proceeding with call\n"); + ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RING); + break; case FTDM_CHANNEL_STATE_PROCEED: case FTDM_CHANNEL_STATE_PROGRESS: case FTDM_CHANNEL_STATE_RINGING: diff --git a/libs/freetdm/src/ftmod/ftmod_skel/ftmod_skel.c b/libs/freetdm/src/ftmod/ftmod_skel/ftmod_skel.c index ee06a0716d..96475f58d9 100644 --- a/libs/freetdm/src/ftmod/ftmod_skel/ftmod_skel.c +++ b/libs/freetdm/src/ftmod/ftmod_skel/ftmod_skel.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c old mode 100644 new mode 100755 index 1e9f3b059f..87ba7ed728 --- a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c +++ b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,9 +36,9 @@ * David Yat Sin * Nenad Corbic * Arnaldo Pereira + * Gideon Sadan * - */ - + */ #ifdef WP_DEBUG_IO #define _BSD_SOURCE #include @@ -121,6 +121,16 @@ FIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event); FIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_span_next_event); FIO_CHANNEL_NEXT_EVENT_FUNCTION(wanpipe_channel_next_event); +static void wp_swap16(char *data, int datalen) +{ + int i = 0; + uint16_t *samples = data; + for (i = 0; i < datalen/2; i++) { + uint16_t sample = ((samples[i] & 0x00FF) << 8) | ((samples[i] & 0xFF00) >> 8); + samples[i] = sample; + } +} + /** * \brief Poll for event on a wanpipe socket * \param fd Wanpipe socket descriptor @@ -305,11 +315,20 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start err = sangoma_tdm_get_hw_coding(chan->sockfd, &tdm_api); + + if (tdm_api.wp_tdm_cmd.hw_tdm_coding) { chan->native_codec = chan->effective_codec = FTDM_CODEC_ALAW; } else { chan->native_codec = chan->effective_codec = FTDM_CODEC_ULAW; } + + + if ((span->trunk_type == FTDM_TRUNK_GSM) && (chan->type == FTDM_CHAN_TYPE_B)) { + chan->native_codec = FTDM_CODEC_SLIN; + chan->native_interval = 20; + chan->packet_len = 320; + } err = sangoma_tdm_get_hw_dtmf(chan->sockfd, &tdm_api); if (err > 0) { @@ -580,8 +599,9 @@ static FIO_OPEN_FUNCTION(wanpipe_open) ftdm_channel_set_feature(ftdmchan, FTDM_CHANNEL_FEATURE_INTERVAL); ftdmchan->effective_interval = ftdmchan->native_interval = wp_globals.codec_ms; - ftdmchan->packet_len = ftdmchan->native_interval * 8; - + + /* The packet len will depend on the codec and interval */ + ftdmchan->packet_len = ftdmchan->native_interval * ((ftdmchan->native_codec==FTDM_CODEC_SLIN) ? 16 : 8); if (wp_globals.txqueue_size > 0) { ftdm_channel_command(ftdmchan, FTDM_COMMAND_SET_TX_QUEUE_SIZE, &wp_globals.txqueue_size); } @@ -772,6 +792,7 @@ static FIO_COMMAND_FUNCTION(wanpipe_command) case FTDM_COMMAND_SET_INTERVAL: { err=sangoma_tdm_set_usr_period(ftdmchan->sockfd, &tdm_api, FTDM_COMMAND_OBJ_INT); + ftdmchan->packet_len = ftdmchan->native_interval * (ftdmchan->effective_codec == FTDM_CODEC_SLIN ? 16 : 8); } break; @@ -793,7 +814,7 @@ static FIO_COMMAND_FUNCTION(wanpipe_command) FTDM_COMMAND_OBJ_INT = wanpipe_swap_bits(rbsbits); } #else - // does sangoma_tdm_read_rbs is available here? + /* is sangoma_tdm_read_rbs available here? */ FTDM_COMMAND_OBJ_INT = ftdmchan->rx_cas_bits; #endif } @@ -969,12 +990,15 @@ static void wanpipe_read_stats(ftdm_channel_t *ftdmchan, wp_tdm_api_rx_hdr_t *rx * \param datalen Size of data buffer * \return Success, failure or timeout */ + + static FIO_READ_FUNCTION(wanpipe_read) { int rx_len = 0; int rq_len = (int)*datalen; wp_tdm_api_rx_hdr_t hdrframe; + #ifdef WP_DEBUG_IO wp_channel_t *wchan = ftdmchan->io_data; ftdm_time_t time_diff = 0; @@ -1034,6 +1058,10 @@ static FIO_READ_FUNCTION(wanpipe_read) wanpipe_read_stats(ftdmchan, &hdrframe); } + if ((ftdmchan->type == FTDM_CHAN_TYPE_B) && (ftdmchan->span->trunk_type == FTDM_TRUNK_GSM)) { + wp_swap16(data, *datalen); + } + return FTDM_SUCCESS; } @@ -1050,6 +1078,10 @@ static FIO_WRITE_FUNCTION(wanpipe_write) int err = 0; wp_tdm_api_tx_hdr_t hdrframe; + if ((ftdmchan->type == FTDM_CHAN_TYPE_B) && (ftdmchan->span->trunk_type == FTDM_TRUNK_GSM)) { + wp_swap16(data, *datalen); + } + /* Do we even need the headerframe here? on windows, we don't even pass it to the driver */ memset(&hdrframe, 0, sizeof(hdrframe)); if (*datalen == 0) { diff --git a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c index f531d2b375..2569ea49fd 100644 --- a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c +++ b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -561,7 +561,7 @@ static FIO_CONFIGURE_FUNCTION(zt_configure) } } else if (!strcasecmp(var, "echo_cancel_level")) { num = atoi(val); - if (num < 0 || num > 256) { + if (num < 0 || num > 1024) { ftdm_log(FTDM_LOG_WARNING, "invalid echo can val at line %d\n", lineno); } else { zt_globals.eclevel = num; diff --git a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.h b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.h index 40b5a4e71d..c9bb171b55 100644 --- a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.h +++ b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/freetdm/src/include/freetdm.h b/libs/freetdm/src/include/freetdm.h index 48758f406f..19cf03619c 100755 --- a/libs/freetdm/src/include/freetdm.h +++ b/libs/freetdm/src/include/freetdm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,6 +62,9 @@ /*! \brief Max number of groups */ #define FTDM_MAX_GROUPS_INTERFACE FTDM_MAX_SPANS_INTERFACE +/*! \brief Max number of key=value pairs to be sent as signaling stack parameters */ +#define FTDM_MAX_SIG_PARAMETERS 30 + #define FTDM_INVALID_INT_PARM 0xFF /*! \brief Thread/Mutex OS abstraction API. */ @@ -343,6 +346,11 @@ typedef struct { uint8_t plan; } ftdm_number_t; +typedef struct { + char from[FTDM_MAX_NUMBER_STR_SZ]; + char body[FTDM_MAX_NAME_STR_SZ]; +} ftdm_sms_data_t; + /*! \brief Caller information */ typedef struct ftdm_caller_data { char cid_date[8]; /*!< Caller ID date */ @@ -454,12 +462,13 @@ typedef enum { FTDM_SIGEVENT_INDICATION_COMPLETED, /*!< Last requested indication was completed */ FTDM_SIGEVENT_DIALING, /*!< Outgoing call just started */ FTDM_SIGEVENT_TRANSFER_COMPLETED, /*!< Transfer request is completed */ + FTDM_SIGEVENT_SMS, FTDM_SIGEVENT_INVALID, /*! + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/freetdm/src/include/private/libteletone_detect.h b/libs/freetdm/src/include/private/libteletone_detect.h index 28ae2f5492..3ecac062bd 100644 --- a/libs/freetdm/src/include/private/libteletone_detect.h +++ b/libs/freetdm/src/include/private/libteletone_detect.h @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/freetdm/src/include/private/libteletone_generate.h b/libs/freetdm/src/include/private/libteletone_generate.h index 8e49afaabe..853f9da81b 100644 --- a/libs/freetdm/src/include/private/libteletone_generate.h +++ b/libs/freetdm/src/include/private/libteletone_generate.h @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/freetdm/src/libteletone_detect.c b/libs/freetdm/src/libteletone_detect.c index 0d0fd27eec..2006fcaa27 100644 --- a/libs/freetdm/src/libteletone_detect.c +++ b/libs/freetdm/src/libteletone_detect.c @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/freetdm/src/libteletone_generate.c b/libs/freetdm/src/libteletone_generate.c index 7448508944..3e263af7ee 100644 --- a/libs/freetdm/src/libteletone_generate.c +++ b/libs/freetdm/src/libteletone_generate.c @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/freetdm/src/priserver.c b/libs/freetdm/src/priserver.c index 4e5ec8706d..033934c32e 100644 --- a/libs/freetdm/src/priserver.c +++ b/libs/freetdm/src/priserver.c @@ -4,7 +4,7 @@ * Author(s): Anthony Minessale II * Nenad Corbic * - * Copyright: (c) 2005 Anthony Minessale II + * Copyright: (c) 2005-2012 Anthony Minessale II * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/libs/freetdm/src/sangoma_pri.c b/libs/freetdm/src/sangoma_pri.c index 4adcf017cf..60d0154a39 100644 --- a/libs/freetdm/src/sangoma_pri.c +++ b/libs/freetdm/src/sangoma_pri.c @@ -4,7 +4,7 @@ * Author(s): Anthony Minessale II * Nenad Corbic * - * Copyright: (c) 2005 Anthony Minessale II + * Copyright: (c) 2005-2012 Anthony Minessale II * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/libs/freetdm/src/sangoma_pri.h b/libs/freetdm/src/sangoma_pri.h index d37622a6da..2072c8b08a 100644 --- a/libs/freetdm/src/sangoma_pri.h +++ b/libs/freetdm/src/sangoma_pri.h @@ -4,7 +4,7 @@ * Author(s): Anthony Minessale II * Nenad Corbic * - * Copyright: (c) 2005 Anthony Minessale II + * Copyright: (c) 2005-2012 Anthony Minessale II * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/libs/ldns/configure.ac b/libs/ldns/configure.ac index d4aa2b030e..9d759ddea5 100644 --- a/libs/ldns/configure.ac +++ b/libs/ldns/configure.ac @@ -486,3 +486,4 @@ AC_OUTPUT COPY_HEADER_FILES(ldns/, ldns/) AC_CONFIG_SUBDIRS([drill]) +m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([install-sh])]) diff --git a/libs/ldns/install-sh b/libs/ldns/install-sh deleted file mode 100755 index 6781b987bd..0000000000 --- a/libs/ldns/install-sh +++ /dev/null @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/libs/libdingaling/src/ldl_compat.h b/libs/libdingaling/src/ldl_compat.h index 26ae586632..2507cd5957 100644 --- a/libs/libdingaling/src/ldl_compat.h +++ b/libs/libdingaling/src/ldl_compat.h @@ -1,6 +1,6 @@ /* * libDingaLing XMPP Jingle Library - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libdingaling/src/libdingaling.c b/libs/libdingaling/src/libdingaling.c index 9d0355191f..0b11411ffd 100644 --- a/libs/libdingaling/src/libdingaling.c +++ b/libs/libdingaling/src/libdingaling.c @@ -1,6 +1,6 @@ /* * libDingaLing XMPP Jingle Library - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libdingaling/src/libdingaling.h b/libs/libdingaling/src/libdingaling.h index 1f43167dab..6cf8bd846b 100644 --- a/libs/libdingaling/src/libdingaling.h +++ b/libs/libdingaling/src/libdingaling.h @@ -1,6 +1,6 @@ /* * libDingaLing XMPP Jingle Library - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libg722_1/README b/libs/libg722_1/README index 424c281581..865accacde 100644 --- a/libs/libg722_1/README +++ b/libs/libg722_1/README @@ -18,7 +18,7 @@ a separate process, and your application communicates with it through pipes or sockets. This implementation of G.722.1 is adapted from the reference source code -provided by Polycom. Polycom has given its concent for this library to be +provided by Polycom. Polycom has given its consent for this library to be distributed as source code, either on its own or as part of a larger package which they have licenced under their royalty free licencing scheme. diff --git a/libs/libnatpmp/natpmp.c b/libs/libnatpmp/natpmp.c index d4b9dcbe31..c79e92bdfd 100644 --- a/libs/libnatpmp/natpmp.c +++ b/libs/libnatpmp/natpmp.c @@ -165,15 +165,22 @@ int sendnewportmappingrequest(natpmp_t * p, int protocol, uint16_t privateport, uint16_t publicport, uint32_t lifetime) { + uint16_t *n; + uint32_t *m; + if(!p || (protocol!=NATPMP_PROTOCOL_TCP && protocol!=NATPMP_PROTOCOL_UDP)) return NATPMP_ERR_INVALIDARGS; p->pending_request[0] = 0; p->pending_request[1] = (char)protocol; p->pending_request[2] = 0; p->pending_request[3] = 0; - *((uint16_t *)(intptr_t)(p->pending_request + 4)) = htons(privateport); - *((uint16_t *)(intptr_t)(p->pending_request + 6)) = htons(publicport); - *((uint32_t *)(intptr_t)(p->pending_request + 8)) = htonl(lifetime); + n = (uint16_t *)(p->pending_request + 4); *n = htons(privateport); + n = (uint16_t *)(p->pending_request + 6); *n = htons(publicport); + m = (uint32_t *)(p->pending_request + 8); *m = htonl(lifetime); + + //*((uint16_t *)(p->pending_request + 4)) = htons(privateport); + //*((uint16_t *)(p->pending_request + 6)) = htons(publicport); + //*((uint32_t *)(p->pending_request + 8)) = htonl(lifetime); p->pending_request_len = 12; return sendnatpmprequest(p); } diff --git a/libs/libscgi/FSSCGI.i b/libs/libscgi/FSSCGI.i new file mode 100644 index 0000000000..186cef6244 --- /dev/null +++ b/libs/libscgi/FSSCGI.i @@ -0,0 +1,6 @@ +%{ +#include "scgi.h" +#include "scgi_oop.h" +%} + +%include "scgi_oop.h" diff --git a/libs/libscgi/Makefile b/libs/libscgi/Makefile new file mode 100644 index 0000000000..265834ae69 --- /dev/null +++ b/libs/libscgi/Makefile @@ -0,0 +1,51 @@ +PWD=$(shell pwd) +INCS=-I$(PWD)/src/include +DEBUG=-g -ggdb +BASE_FLAGS=$(INCS) $(DEBUG) -fPIC +PICKY=-O2 +CFLAGS=$(BASE_FLAGS) $(PICKY) +CXXFLAGS=$(BASE_FLAGS) +MYLIB=libscgi.a +LIBS= +LDFLAGS=-L. +OBJS=src/scgi.o +SRC=src/scgi.c src/scgi_oop.cpp +HEADERS=src/include/scgi.h src/include/scgi_oop.h +SOLINK=-shared -Xlinker -x + +# comment the next line to disable c++ (no swig mods for you then) +OBJS += src/scgi_oop.o + +all: $(MYLIB) testclient testserver + +$(MYLIB): $(OBJS) $(HEADERS) $(SRC) + ar rcs $(MYLIB) $(OBJS) + ranlib $(MYLIB) + +%.o: %.c $(HEADERS) + $(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@ + +%.o: %.cpp $(HEADERS) + $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) -c $< -o $@ + +testclient: $(MYLIB) testclient.c + $(CC) $(CC_CFLAGS) $(CFLAGS) testclient.c -o testclient -lscgi $(LDFLAGS) $(LIBS) + +testserver: $(MYLIB) testserver.c + $(CC) $(CC_CFLAGS) $(CFLAGS) testserver.c -o testserver -lscgi $(LDFLAGS) $(LIBS) + +clean: + rm -f *.o src/*.o libscgi.a *~ src/*~ src/include/*~ testclient testserver + $(MAKE) -C perl clean + +reswig: swigclean + $(MAKE) -C perl reswig + +swigclean: clean + $(MAKE) -C perl swigclean + +perlmod: $(MYLIB) + $(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl + +perlmod-install: perlmod + $(MAKE) -C perl install diff --git a/libs/libscgi/perl/FSSCGI.pm b/libs/libscgi/perl/FSSCGI.pm new file mode 100644 index 0000000000..05370a12a7 --- /dev/null +++ b/libs/libscgi/perl/FSSCGI.pm @@ -0,0 +1,105 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.35 +# +# Don't modify this file, modify the SWIG interface instead. + +package FSSCGI; +require Exporter; +require DynaLoader; +@ISA = qw(Exporter DynaLoader); +package FSSCGIc; +bootstrap FSSCGI; +package FSSCGI; +@EXPORT = qw( ); + +# ---------- BASE METHODS ------------- + +package FSSCGI; + +sub TIEHASH { + my ($classname,$obj) = @_; + return bless $obj, $classname; +} + +sub CLEAR { } + +sub FIRSTKEY { } + +sub NEXTKEY { } + +sub FETCH { + my ($self,$field) = @_; + my $member_func = "swig_${field}_get"; + $self->$member_func(); +} + +sub STORE { + my ($self,$field,$newval) = @_; + my $member_func = "swig_${field}_set"; + $self->$member_func($newval); +} + +sub this { + my $ptr = shift; + return tied(%$ptr); +} + + +# ------- FUNCTION WRAPPERS -------- + +package FSSCGI; + + +############# Class : FSSCGI::SCGIhandle ############## + +package FSSCGI::SCGIhandle; +use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); +@ISA = qw( FSSCGI ); +%OWNER = (); +%ITERATORS = (); +sub new { + my $pkg = shift; + my $self = FSSCGIc::new_SCGIhandle(@_); + bless $self, $pkg if defined($self); +} + +sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + FSSCGIc::delete_SCGIhandle($self); + delete $OWNER{$self}; + } +} + +*connected = *FSSCGIc::SCGIhandle_connected; +*socketDescriptor = *FSSCGIc::SCGIhandle_socketDescriptor; +*disconnect = *FSSCGIc::SCGIhandle_disconnect; +*addParam = *FSSCGIc::SCGIhandle_addParam; +*addBody = *FSSCGIc::SCGIhandle_addBody; +*getBody = *FSSCGIc::SCGIhandle_getBody; +*getParam = *FSSCGIc::SCGIhandle_getParam; +*sendRequest = *FSSCGIc::SCGIhandle_sendRequest; +*respond = *FSSCGIc::SCGIhandle_respond; +*bind = *FSSCGIc::SCGIhandle_bind; +*accept = *FSSCGIc::SCGIhandle_accept; +sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; +} + +sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; +} + + +# ------- VARIABLE STUBS -------- + +package FSSCGI; + +1; diff --git a/libs/libscgi/perl/Makefile b/libs/libscgi/perl/Makefile new file mode 100644 index 0000000000..3bce02368d --- /dev/null +++ b/libs/libscgi/perl/Makefile @@ -0,0 +1,38 @@ +PERL=$(shell which perl) +PERL_SITEDIR=$(shell perl -MConfig -e 'print $$Config{sitelibexp}') +PERL_LIBDIR=-L$(shell perl -MConfig -e 'print $$Config{archlib}')/CORE +PERL_LIBS=$(shell perl -MConfig -e 'print $$Config{libs}') +LOCAL_CFLAGS=-w -DMULTIPLICITY $(shell $(PERL) -MExtUtils::Embed -e ccopts) -DEMBED_PERL +LOCAL_LDFLAGS=$(shell $(PERL) -MExtUtils::Embed -e ldopts) $(shell $(PERL) -MConfig -e 'print $$Config{libs}') +GCC_WARNING_JUNK=-w +PERL_INC=$(shell $(PERL) -MExtUtils::Embed -e perl_inc) +all: FSSCGI.so + +scgi_wrap.cpp: + swig -module FSSCGI -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o scgi_wrap.cpp ../FSSCGI.i + +perlxsi.c: + $(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c + +perlxsi.o: perlxsi.c + $(CC) $(CC_CFLAGS) $(CFLAGS) $(LOCAL_CFLAGS) -c perlxsi.c -o perlxsi.o + +scgi_wrap.o: scgi_wrap.cpp + $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(GCC_WARNING_JUNK) $(PERL_INC) -c scgi_wrap.cpp -o scgi_wrap.o + +FSSCGI.so: scgi_wrap.o perlxsi.o + $(CXX) $(SOLINK) scgi_wrap.o perlxsi.o $(MYLIB) $(LOCAL_LDFLAGS) -o FSSCGI.so -L. $(LIBS) + +clean: + rm -f *.o *.so *~ + +swigclean: + rm -f scgi_wrap.* FSSCGI.so FSSCGI.pm perlxsi.* + +reswig: swigclean scgi_wrap.cpp perlxsi.c + +install: FSSCGI.so + install -m 755 FSSCGI.so $(PERL_SITEDIR) + install -m 755 FSSCGI.pm $(PERL_SITEDIR) + install -d -m 755 FSSCGI $(PERL_SITEDIR)/FSSCGI + install -m 755 FSSCGI/* $(PERL_SITEDIR)/FSSCGI diff --git a/libs/libscgi/perl/esl_wrap.cpp b/libs/libscgi/perl/esl_wrap.cpp new file mode 100644 index 0000000000..832289f156 --- /dev/null +++ b/libs/libscgi/perl/esl_wrap.cpp @@ -0,0 +1,4149 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPERL +#define SWIG_CASTRANK_MODE + +#ifdef __cplusplus +template class SwigValueWrapper { + T *tt; +public: + SwigValueWrapper() : tt(0) { } + SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } + SwigValueWrapper(const T& t) : tt(new T(t)) { } + ~SwigValueWrapper() { delete tt; } + SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } + operator T&() const { return *tt; } + T *operator&() { return tt; } +private: + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); +}; + +template T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic CAPI SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the swig runtime code. + In 99.9% of the cases, swig just needs to declare them as 'static'. + + But only do this if is strictly necessary, ie, if you have problems + with your compiler or so. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The swig conversion methods, as ConvertPtr, return and integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old swig versions, you usually write code as: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit as: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + that seems to be the same, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + requires also to SWIG_ConvertPtr to return new result values, as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + swig errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() + + + */ +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCompare(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + + +/* think of this as a c++ template<> or a scheme macro */ +#define SWIG_TypeCheck_Template(comparison, ty) \ + if (ty) { \ + swig_cast_info *iter = ty->cast; \ + while (iter) { \ + if (comparison) { \ + if (iter == ty->cast) return iter; \ + /* Move iter to the top of the linked list */ \ + iter->prev->next = iter->next; \ + if (iter->next) \ + iter->next->prev = iter->prev; \ + iter->next = ty->cast; \ + iter->prev = 0; \ + if (ty->cast) ty->cast->prev = iter; \ + ty->cast = iter; \ + return iter; \ + } \ + iter = iter->next; \ + } \ + } \ + return 0 + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); +} + +/* Same as previous function, except strcmp is replaced with a pointer comparison */ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { + SWIG_TypeCheck_Template(iter->type == from, into); +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +#ifdef __cplusplus +/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ +#include +#include +extern "C" { +#endif +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */ + +/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */ +#ifndef PERL_REVISION +# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) +# define PERL_PATCHLEVEL_H_IMPLICIT +# include +# endif +# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) +# include +# endif +# ifndef PERL_REVISION +# define PERL_REVISION (5) +# define PERL_VERSION PATCHLEVEL +# define PERL_SUBVERSION SUBVERSION +# endif +#endif + +#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) +#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) +#endif + +#ifndef SvIOK_UV +# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) +#endif + +#ifndef SvUOK +# define SvUOK(sv) SvIOK_UV(sv) +#endif + +#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))) +# define PL_sv_undef sv_undef +# define PL_na na +# define PL_errgv errgv +# define PL_sv_no sv_no +# define PL_sv_yes sv_yes +# define PL_markstack_ptr markstack_ptr +#endif + +#ifndef IVSIZE +# ifdef LONGSIZE +# define IVSIZE LONGSIZE +# else +# define IVSIZE 4 /* A bold guess, but the best we can make. */ +# endif +#endif + +#ifndef INT2PTR +# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) +# define PTRV UV +# define INT2PTR(any,d) (any)(d) +# else +# if PTRSIZE == LONGSIZE +# define PTRV unsigned long +# else +# define PTRV unsigned +# endif +# define INT2PTR(any,d) (any)(PTRV)(d) +# endif + +# define NUM2PTR(any,d) (any)(PTRV)(d) +# define PTR2IV(p) INT2PTR(IV,p) +# define PTR2UV(p) INT2PTR(UV,p) +# define PTR2NV(p) NUM2PTR(NV,p) + +# if PTRSIZE == LONGSIZE +# define PTR2ul(p) (unsigned long)(p) +# else +# define PTR2ul(p) INT2PTR(unsigned long,p) +# endif +#endif /* !INT2PTR */ + +#ifndef SvPV_nolen +# define SvPV_nolen(x) SvPV(x,PL_na) +#endif + +#ifndef get_sv +# define get_sv perl_get_sv +#endif + +#ifndef ERRSV +# define ERRSV get_sv("@",FALSE) +#endif + +#ifndef pTHX_ +#define pTHX_ +#endif + +#include +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGINTERN const char* +SWIG_Perl_ErrorType(int code) { + const char* type = 0; + switch(code) { + case SWIG_MemoryError: + type = "MemoryError"; + break; + case SWIG_IOError: + type = "IOError"; + break; + case SWIG_RuntimeError: + type = "RuntimeError"; + break; + case SWIG_IndexError: + type = "IndexError"; + break; + case SWIG_TypeError: + type = "TypeError"; + break; + case SWIG_DivisionByZero: + type = "ZeroDivisionError"; + break; + case SWIG_OverflowError: + type = "OverflowError"; + break; + case SWIG_SyntaxError: + type = "SyntaxError"; + break; + case SWIG_ValueError: + type = "ValueError"; + break; + case SWIG_SystemError: + type = "SystemError"; + break; + case SWIG_AttributeError: + type = "AttributeError"; + break; + default: + type = "RuntimeError"; + } + return type; +} + + + + +/* ----------------------------------------------------------------------------- + * perlrun.swg + * + * This file contains the runtime support for Perl modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef PERL_OBJECT +#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl), +#define SWIG_PERL_OBJECT_CALL pPerl, +#else +#define SWIG_PERL_OBJECT_DECL +#define SWIG_PERL_OBJECT_CALL +#endif + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) +#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) +#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) + + +/* Error manipulation */ + +#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) +#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + +/* Perl-specific SWIG API */ + +#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) +#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) +#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) + + +#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) +#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) +#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) +#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +/* For backward compatibility only */ +#define SWIG_POINTER_EXCEPTION 0 + +#ifdef __cplusplus +extern "C" { +#endif + +#define SWIG_OWNER SWIG_POINTER_OWN +#define SWIG_SHADOW SWIG_OWNER << 1 + +#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL + +/* SWIG Perl macros */ + +/* Macro to declare an XS function */ +#ifndef XSPROTO +# define XSPROTO(name) void name(pTHX_ CV* cv) +#endif + +/* Macro to call an XS function */ +#ifdef PERL_OBJECT +# define SWIG_CALLXS(_name) _name(cv,pPerl) +#else +# ifndef MULTIPLICITY +# define SWIG_CALLXS(_name) _name(cv) +# else +# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) +# endif +#endif + +#ifdef PERL_OBJECT +#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +#define SWIGCLASS_STATIC + +#else /* PERL_OBJECT */ + +#define MAGIC_PPERL +#define SWIGCLASS_STATIC static SWIGUNUSED + +#ifndef MULTIPLICITY +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#else /* MULTIPLICITY */ + +#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#endif /* MULTIPLICITY */ +#endif /* PERL_OBJECT */ + +/* Workaround for bug in perl 5.6.x croak and earlier */ +#if (PERL_VERSION < 8) +# ifdef PERL_OBJECT +# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) +static void SWIG_Perl_croak_null(CPerlObj *pPerl) +# else +static void SWIG_croak_null() +# endif +{ + SV *err=ERRSV; +# if (PERL_VERSION < 6) + croak("%_", err); +# else + if (SvOK(err) && !SvROK(err)) croak("%_", err); + croak(Nullch); +# endif +} +#else +# define SWIG_croak_null() croak(Nullch) +#endif + + +/* + Define how strict is the cast between strings and integers/doubles + when overloading between these types occurs. + + The default is making it as strict as possible by using SWIG_AddCast + when needed. + + You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to + disable the SWIG_AddCast, making the casting between string and + numbers less strict. + + In the end, we try to solve the overloading between strings and + numerical types in the more natural way, but if you can avoid it, + well, avoid it using %rename, for example. +*/ +#ifndef SWIG_PERL_NO_STRICT_STR2NUM +# ifndef SWIG_PERL_STRICT_STR2NUM +# define SWIG_PERL_STRICT_STR2NUM +# endif +#endif +#ifdef SWIG_PERL_STRICT_STR2NUM +/* string takes precedence */ +#define SWIG_Str2NumCast(x) SWIG_AddCast(x) +#else +/* number takes precedence */ +#define SWIG_Str2NumCast(x) x +#endif + + + +#include + +SWIGRUNTIME const char * +SWIG_Perl_TypeProxyName(const swig_type_info *type) { + if (!type) return NULL; + if (type->clientdata != NULL) { + return (const char*) type->clientdata; + } + else { + return type->name; + } +} + +SWIGRUNTIME swig_cast_info * +SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) + || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); +} + + +/* Function for getting a pointer value */ + +SWIGRUNTIME int +SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { + swig_cast_info *tc; + void *voidptr = (void *)0; + SV *tsv = 0; + /* If magical, apply more magic */ + if (SvGMAGICAL(sv)) + mg_get(sv); + + /* Check to see if this is an object */ + if (sv_isobject(sv)) { + IV tmp = 0; + tsv = (SV*) SvRV(sv); + if ((SvTYPE(tsv) == SVt_PVHV)) { + MAGIC *mg; + if (SvMAGICAL(tsv)) { + mg = mg_find(tsv,'P'); + if (mg) { + sv = mg->mg_obj; + if (sv_isobject(sv)) { + tsv = (SV*)SvRV(sv); + tmp = SvIV(tsv); + } + } + } else { + return SWIG_ERROR; + } + } else { + tmp = SvIV(tsv); + } + voidptr = INT2PTR(void *,tmp); + } else if (! SvOK(sv)) { /* Check for undef */ + *(ptr) = (void *) 0; + return SWIG_OK; + } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ + if (!SvROK(sv)) { + *(ptr) = (void *) 0; + return SWIG_OK; + } else { + return SWIG_ERROR; + } + } else { /* Don't know what it is */ + return SWIG_ERROR; + } + if (_t) { + /* Now see if the types match */ + char *_c = HvNAME(SvSTASH(SvRV(sv))); + tc = SWIG_TypeProxyCheck(_c,_t); + if (!tc) { + return SWIG_ERROR; + } + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } + } else { + *ptr = voidptr; + } + + /* + * DISOWN implementation: we need a perl guru to check this one. + */ + if (tsv && (flags & SWIG_POINTER_DISOWN)) { + /* + * almost copy paste code from below SWIG_POINTER_OWN setting + */ + SV *obj = sv; + HV *stash = SvSTASH(SvRV(obj)); + GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE); + if (isGV(gv)) { + HV *hv = GvHVn(gv); + /* + * To set ownership (see below), a newSViv(1) entry is added. + * Hence, to remove ownership, we delete the entry. + */ + if (hv_exists_ent(hv, obj, 0)) { + hv_delete_ent(hv, obj, 0, 0); + } + } + } + return SWIG_OK; +} + +SWIGRUNTIME void +SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { + if (ptr && (flags & SWIG_SHADOW)) { + SV *self; + SV *obj=newSV(0); + HV *hash=newHV(); + HV *stash; + sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr); + stash=SvSTASH(SvRV(obj)); + if (flags & SWIG_POINTER_OWN) { + HV *hv; + GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE); + if (!isGV(gv)) + gv_init(gv, stash, "OWNER", 5, FALSE); + hv=GvHVn(gv); + hv_store_ent(hv, obj, newSViv(1), 0); + } + sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); + SvREFCNT_dec(obj); + self=newRV_noinc((SV *)hash); + sv_setsv(sv, self); + SvREFCNT_dec((SV *)self); + sv_bless(sv, stash); + } + else { + sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr); + } +} + +SWIGRUNTIMEINLINE SV * +SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { + SV *result = sv_newmortal(); + SWIG_MakePtr(result, ptr, t, flags); + return result; +} + +SWIGRUNTIME void +SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { + char result[1024]; + char *r = result; + if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + strcpy(r,SWIG_Perl_TypeProxyName(type)); + sv_setpv(sv, result); +} + +SWIGRUNTIME SV * +SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { + SV *result = sv_newmortal(); + SWIG_Perl_MakePackedObj(result, ptr, sz, type); + return result; +} + +/* Convert a packed value value */ +SWIGRUNTIME int +SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { + swig_cast_info *tc; + const char *c = 0; + + if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; + c = SvPV_nolen(obj); + /* Pointer values must start with leading underscore */ + if (*c != '_') return SWIG_ERROR; + c++; + c = SWIG_UnpackData(c,ptr,sz); + if (ty) { + tc = SWIG_TypeCheck(c,ty); + if (!tc) return SWIG_ERROR; + } + return SWIG_OK; +} + + +/* Macros for low-level exception handling */ +#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } + + +typedef XSPROTO(SwigPerlWrapper); +typedef SwigPerlWrapper *SwigPerlWrapperPtr; + +/* Structure for command table */ +typedef struct { + const char *name; + SwigPerlWrapperPtr wrapper; +} swig_command_info; + +/* Information for constant table */ + +#define SWIG_INT 1 +#define SWIG_FLOAT 2 +#define SWIG_STRING 3 +#define SWIG_POINTER 4 +#define SWIG_BINARY 5 + +/* Constant information structure */ +typedef struct swig_constant_info { + int type; + const char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_constant_info; + + +/* Structure for variable table */ +typedef struct { + const char *name; + SwigMagicFunc set; + SwigMagicFunc get; + swig_type_info **type; +} swig_variable_info; + +/* Magic variable code */ +#ifndef PERL_OBJECT +#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) + #ifndef MULTIPLICITY + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) + #else + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) + #endif +#else +# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) +SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) +#endif +{ + MAGIC *mg; + sv_magic(sv,sv,'U',(char *) name,strlen(name)); + mg = mg_find(sv,'U'); + mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); + mg->mg_virtual->svt_get = (SwigMagicFunc) get; + mg->mg_virtual->svt_set = (SwigMagicFunc) set; + mg->mg_virtual->svt_len = 0; + mg->mg_virtual->svt_clear = 0; + mg->mg_virtual->svt_free = 0; +} + + +SWIGRUNTIME swig_module_info * +SWIG_Perl_GetModule(void) { + static void *type_pointer = (void *)0; + SV *pointer; + + /* first check if pointer already created */ + if (!type_pointer) { + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); + if (pointer && SvOK(pointer)) { + type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); + } + } + + return (swig_module_info *) type_pointer; +} + +SWIGRUNTIME void +SWIG_Perl_SetModule(swig_module_info *module) { + SV *pointer; + + /* create a new pointer */ + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); + sv_setiv(pointer, PTR2IV(module)); +} + +#ifdef __cplusplus +} +#endif + +/* Workaround perl5 global namespace pollution. Note that undefining library + * functions like fopen will not solve the problem on all platforms as fopen + * might be a macro on Windows but not necessarily on other operating systems. */ +#ifdef do_open + #undef do_open +#endif +#ifdef do_close + #undef do_close +#endif +#ifdef scalar + #undef scalar +#endif +#ifdef list + #undef list +#endif +#ifdef apply + #undef apply +#endif +#ifdef convert + #undef convert +#endif +#ifdef Error + #undef Error +#endif +#ifdef form + #undef form +#endif +#ifdef vform + #undef vform +#endif +#ifdef LABEL + #undef LABEL +#endif +#ifdef METHOD + #undef METHOD +#endif +#ifdef Move + #undef Move +#endif +#ifdef yylex + #undef yylex +#endif +#ifdef yyparse + #undef yyparse +#endif +#ifdef yyerror + #undef yyerror +#endif +#ifdef invert + #undef invert +#endif +#ifdef ref + #undef ref +#endif +#ifdef read + #undef read +#endif +#ifdef write + #undef write +#endif +#ifdef eof + #undef eof +#endif +#ifdef bool + #undef bool +#endif +#ifdef close + #undef close +#endif +#ifdef rewind + #undef rewind +#endif +#ifdef free + #undef free +#endif +#ifdef malloc + #undef malloc +#endif +#ifdef calloc + #undef calloc +#endif +#ifdef Stat + #undef Stat +#endif +#ifdef check + #undef check +#endif +#ifdef seekdir + #undef seekdir +#endif +#ifdef open + #undef open +#endif + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_ESLconnection swig_types[0] +#define SWIGTYPE_p_ESLevent swig_types[1] +#define SWIGTYPE_p_char swig_types[2] +#define SWIGTYPE_p_esl_event_t swig_types[3] +#define SWIGTYPE_p_esl_priority_t swig_types[4] +static swig_type_info *swig_types[6]; +static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_init boot_ESL + +#define SWIG_name "ESLc::boot_ESL" +#define SWIG_prefix "ESLc::" + +#define SWIGVERSION 0x010335 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) + + +#include + + +#ifdef __cplusplus +extern "C" +#endif +#ifndef PERL_OBJECT +#ifndef MULTIPLICITY +SWIGEXPORT void SWIG_init (CV* cv); +#else +SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); +#endif +#else +SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); +#endif + + +#include "esl.h" +#include "esl_oop.h" + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) +{ + if (SvPOK(obj)) { + STRLEN len = 0; + char *cstr = SvPV(obj, len); + size_t size = len + 1; + if (cptr) { + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); + } else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } + } + if (psize) *psize = size; + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + char* vptr = 0; + if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = vptr; + if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + + +SWIGINTERNINLINE SV * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + SV *obj = sv_newmortal(); + if (carray) { + sv_setpvn(obj, carray, size); + } else { + sv_setsv(obj, &PL_sv_undef); + } + return obj; +} + + +SWIGINTERNINLINE SV * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + +#include +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +SWIGINTERN int +SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) +{ + if (SvNIOK(obj)) { + if (val) *val = SvNV(obj); + return SWIG_OK; + } else if (SvIOK(obj)) { + if (val) *val = (double) SvIV(obj); + return SWIG_AddCast(SWIG_OK); + } else { + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + double v = strtod(nptr, &endptr); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + } + return SWIG_TypeError; +} + + +#include + + +#include + + +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN int +SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) +{ + if (SvIOK(obj)) { + if (val) *val = SvIV(obj); + return SWIG_OK; + } else { + int dispatch = 0; + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + long v; + errno = 0; + v = strtol(nptr, &endptr,0); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + if (val) *val = (long)(d); + return res; + } + } + } + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) +{ + long v; + int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = static_cast< int >(v); + } + } + return res; +} + + +SWIGINTERNINLINE SV * +SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) +{ + SV *obj = sv_newmortal(); + sv_setiv(obj, (IV) value); + return obj; +} + + +SWIGINTERNINLINE SV * +SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value) +{ + return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value); +} + + +SWIGINTERNINLINE SV * +SWIG_From_bool SWIG_PERL_DECL_ARGS_1(bool value) +{ + SV *obj = sv_newmortal(); + if (value) { + sv_setsv(obj, &PL_sv_yes); + } else { + sv_setsv(obj, &PL_sv_no); + } + return obj; +} + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef PERL_OBJECT +#define MAGIC_CLASS _wrap_ESL_var:: +class _wrap_ESL_var : public CPerlObj { +public: +#else +#define MAGIC_CLASS +#endif +SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + croak("Value is read-only."); + return 0; +} + + +#ifdef PERL_OBJECT +}; +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +XS(_wrap_ESLevent_event_set) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + esl_event_t *arg2 = (esl_event_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLevent_event_set(self,event);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_event_set" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_esl_event_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_event_set" "', argument " "2"" of type '" "esl_event_t *""'"); + } + arg2 = reinterpret_cast< esl_event_t * >(argp2); + if (arg1) (arg1)->event = arg2; + + + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_event_get) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + esl_event_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLevent_event_get(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_event_get" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (esl_event_t *) ((arg1)->event); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_esl_event_t, 0 | 0); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_serialized_string_set) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLevent_serialized_string_set(self,serialized_string);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_serialized_string_set" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialized_string_set" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + if (arg1->serialized_string) delete[] arg1->serialized_string; + if (arg2) { + size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1; + arg1->serialized_string = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size))); + } else { + arg1->serialized_string = 0; + } + + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_serialized_string_get) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLevent_serialized_string_get(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_serialized_string_get" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (char *) ((arg1)->serialized_string); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_mine_set) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLevent_mine_set(self,mine);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_mine_set" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ESLevent_mine_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + if (arg1) (arg1)->mine = arg2; + + + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_mine_get) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLevent_mine_get(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_mine_get" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (int) ((arg1)->mine); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLevent__SWIG_0) { + { + char *arg1 = (char *) 0 ; + char *arg2 = (char *) NULL ; + ESLevent *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 2)) { + SWIG_croak("Usage: new_ESLevent(type,subclass_name);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = reinterpret_cast< char * >(buf1); + if (items > 1) { + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + } + result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLevent__SWIG_1) { + { + esl_event_t *arg1 = (esl_event_t *) 0 ; + int arg2 = (int) 0 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 2)) { + SWIG_croak("Usage: new_ESLevent(wrap_me,free_me);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_esl_event_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "esl_event_t *""'"); + } + arg1 = reinterpret_cast< esl_event_t * >(argp1); + if (items > 1) { + ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + } + result = (ESLevent *)new ESLevent(arg1,arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLevent__SWIG_2) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: new_ESLevent(me);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (ESLevent *)new ESLevent(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLevent) { + dXSARGS; + + { + unsigned long _index = 0; + SWIG_TypeRank _rank = 0; + if ((items >= 1) && (items <= 2)) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_esl_event_t, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_1; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (items > 1) { + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_1; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + } + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 1; + if (_rank == _rankm) goto dispatch; + } + } + check_1: + + if (items == 1) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_ESLevent, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 2; + if (_rank == _rankm) goto dispatch; + } + } + check_2: + + if ((items >= 1) && (items <= 2)) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_3; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (items > 1) { + { + int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_3; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + } + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 3; + if (_rank == _rankm) goto dispatch; + } + } + check_3: + + dispatch: + switch(_index) { + case 1: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLevent__SWIG_1); return; + case 2: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLevent__SWIG_2); return; + case 3: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLevent__SWIG_0); return; + } + } + + croak("No matching function for overloaded 'new_ESLevent'"); + XSRETURN(0); +} + + +XS(_wrap_delete_ESLevent) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: delete_ESLevent(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ESLevent" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + delete arg1; + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_serialize) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) NULL ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 2)) { + SWIG_croak("Usage: ESLevent_serialize(self,format);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_serialize" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + if (items > 1) { + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialize" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + } + result = (char *)(arg1)->serialize((char const *)arg2); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_setPriority) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 2)) { + SWIG_croak("Usage: ESLevent_setPriority(self,priority);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_setPriority" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + if (items > 1) { + { + res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_esl_priority_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ESLevent_setPriority" "', argument " "2"" of type '" "esl_priority_t""'"); + } else { + arg2 = *(reinterpret_cast< esl_priority_t * >(argp2)); + } + } + } + result = (bool)(arg1)->setPriority(arg2); + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_getHeader) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 = (int) -1 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 3)) { + SWIG_croak("Usage: ESLevent_getHeader(self,header_name,idx);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_getHeader" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_getHeader" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + if (items > 2) { + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ESLevent_getHeader" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + } + result = (char *)(arg1)->getHeader((char const *)arg2,arg3); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_getBody) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLevent_getBody(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_getBody" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (char *)(arg1)->getBody(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_getType) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLevent_getType(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_getType" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (char *)(arg1)->getType(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_addBody) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLevent_addBody(self,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_addBody" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_addBody" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (bool)(arg1)->addBody((char const *)arg2); + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_addHeader) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: ESLevent_addHeader(self,header_name,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_addHeader" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_addHeader" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLevent_addHeader" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_pushHeader) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: ESLevent_pushHeader(self,header_name,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_pushHeader" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_pushHeader" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLevent_pushHeader" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (bool)(arg1)->pushHeader((char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_unshiftHeader) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: ESLevent_unshiftHeader(self,header_name,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_unshiftHeader" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_unshiftHeader" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLevent_unshiftHeader" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (bool)(arg1)->unshiftHeader((char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_delHeader) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *arg2 = (char *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLevent_delHeader(self,header_name);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_delHeader" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_delHeader" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (bool)(arg1)->delHeader((char const *)arg2); + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_firstHeader) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLevent_firstHeader(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_firstHeader" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (char *)(arg1)->firstHeader(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLevent_nextHeader) { + { + ESLevent *arg1 = (ESLevent *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLevent_nextHeader(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_nextHeader" "', argument " "1"" of type '" "ESLevent *""'"); + } + arg1 = reinterpret_cast< ESLevent * >(argp1); + result = (char *)(arg1)->nextHeader(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLconnection__SWIG_0) { + { + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + ESLconnection *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: new_ESLconnection(host,port,user,password);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = reinterpret_cast< char * >(buf1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLconnection" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ESLconnection" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_ESLconnection" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLconnection__SWIG_1) { + { + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + ESLconnection *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: new_ESLconnection(host,port,password);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = reinterpret_cast< char * >(buf1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLconnection" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ESLconnection" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLconnection__SWIG_2) { + { + int arg1 ; + ESLconnection *result = 0 ; + int val1 ; + int ecode1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: new_ESLconnection(socket);"); + } + ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + result = (ESLconnection *)new ESLconnection(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_new_ESLconnection) { + dXSARGS; + + { + unsigned long _index = 0; + SWIG_TypeRank _rank = 0; + if (items == 1) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_1; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 1; + if (_rank == _rankm) goto dispatch; + } + } + check_1: + + if (items == 3) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 2; + if (_rank == _rankm) goto dispatch; + } + } + check_2: + + if (items == 4) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_3; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_3; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_3; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + int res = SWIG_AsCharPtrAndSize(ST(3), 0, NULL, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_3; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 3; + if (_rank == _rankm) goto dispatch; + } + } + check_3: + + dispatch: + switch(_index) { + case 1: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_2); return; + case 2: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_1); return; + case 3: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_ESLconnection__SWIG_0); return; + } + } + + croak("No matching function for overloaded 'new_ESLconnection'"); + XSRETURN(0); +} + + +XS(_wrap_delete_ESLconnection) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: delete_ESLconnection(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ESLconnection" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + delete arg1; + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_socketDescriptor) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLconnection_socketDescriptor(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_socketDescriptor" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + result = (int)(arg1)->socketDescriptor(); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_connected) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLconnection_connected(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_connected" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + result = (int)(arg1)->connected(); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_getInfo) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLconnection_getInfo(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_getInfo" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + result = (ESLevent *)(arg1)->getInfo(); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_send) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLconnection_send(self,cmd);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_send" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_send" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (int)(arg1)->send((char const *)arg2); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_sendRecv) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLconnection_sendRecv(self,cmd);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_sendRecv" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_sendRecv" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (ESLevent *)(arg1)->sendRecv((char const *)arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_api) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) NULL ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 3)) { + SWIG_croak("Usage: ESLconnection_api(self,cmd,arg);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_api" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_api" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + if (items > 2) { + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_api" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + } + result = (ESLevent *)(arg1)->api((char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_bgapi) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) NULL ; + char *arg4 = (char *) NULL ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 4)) { + SWIG_croak("Usage: ESLconnection_bgapi(self,cmd,arg,job_uuid);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_bgapi" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_bgapi" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + if (items > 2) { + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_bgapi" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + } + if (items > 3) { + res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ESLconnection_bgapi" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + } + result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_sendEvent) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + ESLevent *arg2 = (ESLevent *) 0 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLconnection_sendEvent(self,send_me);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_sendEvent" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_sendEvent" "', argument " "2"" of type '" "ESLevent *""'"); + } + arg2 = reinterpret_cast< ESLevent * >(argp2); + result = (ESLevent *)(arg1)->sendEvent(arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_sendMSG) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + ESLevent *arg2 = (ESLevent *) 0 ; + char *arg3 = (char *) NULL ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 3)) { + SWIG_croak("Usage: ESLconnection_sendMSG(self,send_me,uuid);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_sendMSG" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_ESLevent, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_sendMSG" "', argument " "2"" of type '" "ESLevent *""'"); + } + arg2 = reinterpret_cast< ESLevent * >(argp2); + if (items > 2) { + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_sendMSG" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + } + result = (int)(arg1)->sendMSG(arg2,(char const *)arg3); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_recvEvent) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLconnection_recvEvent(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_recvEvent" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + result = (ESLevent *)(arg1)->recvEvent(); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_recvEventTimed) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + int arg2 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLconnection_recvEventTimed(self,ms);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_recvEventTimed" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ESLconnection_recvEventTimed" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (ESLevent *)(arg1)->recvEventTimed(arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_filter) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: ESLconnection_filter(self,header,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_filter" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_filter" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_filter" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (ESLevent *)(arg1)->filter((char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_events) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: ESLconnection_events(self,etype,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_events" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_events" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_events" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (int)(arg1)->events((char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_execute) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) NULL ; + char *arg4 = (char *) NULL ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 4)) { + SWIG_croak("Usage: ESLconnection_execute(self,app,arg,uuid);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_execute" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_execute" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + if (items > 2) { + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_execute" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + } + if (items > 3) { + res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ESLconnection_execute" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + } + result = (ESLevent *)(arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_executeAsync) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) NULL ; + char *arg4 = (char *) NULL ; + ESLevent *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 4)) { + SWIG_croak("Usage: ESLconnection_executeAsync(self,app,arg,uuid);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_executeAsync" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_executeAsync" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + if (items > 2) { + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_executeAsync" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + } + if (items > 3) { + res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ESLconnection_executeAsync" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + } + result = (ESLevent *)(arg1)->executeAsync((char const *)arg2,(char const *)arg3,(char const *)arg4); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_setAsyncExecute) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLconnection_setAsyncExecute(self,val);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_setAsyncExecute" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_setAsyncExecute" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (int)(arg1)->setAsyncExecute((char const *)arg2); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_setEventLock) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + char *arg2 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: ESLconnection_setEventLock(self,val);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_setEventLock" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_setEventLock" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (int)(arg1)->setEventLock((char const *)arg2); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_ESLconnection_disconnect) { + { + ESLconnection *arg1 = (ESLconnection *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: ESLconnection_disconnect(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_disconnect" "', argument " "1"" of type '" "ESLconnection *""'"); + } + arg1 = reinterpret_cast< ESLconnection * >(argp1); + result = (int)(arg1)->disconnect(); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_eslSetLogLevel) { + { + int arg1 ; + int val1 ; + int ecode1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: eslSetLogLevel(level);"); + } + ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "eslSetLogLevel" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + eslSetLogLevel(arg1); + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_ESLconnection = {"_p_ESLconnection", "ESLconnection *", 0, 0, (void*)"ESL::ESLconnection", 0}; +static swig_type_info _swigt__p_ESLevent = {"_p_ESLevent", "ESLevent *", 0, 0, (void*)"ESL::ESLevent", 0}; +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_esl_event_t = {"_p_esl_event_t", "esl_event_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_esl_priority_t = {"_p_esl_priority_t", "esl_priority_t *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_ESLconnection, + &_swigt__p_ESLevent, + &_swigt__p_char, + &_swigt__p_esl_event_t, + &_swigt__p_esl_priority_t, +}; + +static swig_cast_info _swigc__p_ESLconnection[] = { {&_swigt__p_ESLconnection, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ESLevent[] = { {&_swigt__p_ESLevent, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_esl_event_t[] = { {&_swigt__p_esl_event_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_esl_priority_t[] = { {&_swigt__p_esl_priority_t, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_ESLconnection, + _swigc__p_ESLevent, + _swigc__p_char, + _swigc__p_esl_event_t, + _swigc__p_esl_priority_t, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_constant_info swig_constants[] = { +{0,0,0,0,0,0} +}; +#ifdef __cplusplus +} +#endif +static swig_variable_info swig_variables[] = { +{0,0,0,0} +}; +static swig_command_info swig_commands[] = { +{"ESLc::ESLevent_event_set", _wrap_ESLevent_event_set}, +{"ESLc::ESLevent_event_get", _wrap_ESLevent_event_get}, +{"ESLc::ESLevent_serialized_string_set", _wrap_ESLevent_serialized_string_set}, +{"ESLc::ESLevent_serialized_string_get", _wrap_ESLevent_serialized_string_get}, +{"ESLc::ESLevent_mine_set", _wrap_ESLevent_mine_set}, +{"ESLc::ESLevent_mine_get", _wrap_ESLevent_mine_get}, +{"ESLc::new_ESLevent", _wrap_new_ESLevent}, +{"ESLc::delete_ESLevent", _wrap_delete_ESLevent}, +{"ESLc::ESLevent_serialize", _wrap_ESLevent_serialize}, +{"ESLc::ESLevent_setPriority", _wrap_ESLevent_setPriority}, +{"ESLc::ESLevent_getHeader", _wrap_ESLevent_getHeader}, +{"ESLc::ESLevent_getBody", _wrap_ESLevent_getBody}, +{"ESLc::ESLevent_getType", _wrap_ESLevent_getType}, +{"ESLc::ESLevent_addBody", _wrap_ESLevent_addBody}, +{"ESLc::ESLevent_addHeader", _wrap_ESLevent_addHeader}, +{"ESLc::ESLevent_pushHeader", _wrap_ESLevent_pushHeader}, +{"ESLc::ESLevent_unshiftHeader", _wrap_ESLevent_unshiftHeader}, +{"ESLc::ESLevent_delHeader", _wrap_ESLevent_delHeader}, +{"ESLc::ESLevent_firstHeader", _wrap_ESLevent_firstHeader}, +{"ESLc::ESLevent_nextHeader", _wrap_ESLevent_nextHeader}, +{"ESLc::new_ESLconnection", _wrap_new_ESLconnection}, +{"ESLc::delete_ESLconnection", _wrap_delete_ESLconnection}, +{"ESLc::ESLconnection_socketDescriptor", _wrap_ESLconnection_socketDescriptor}, +{"ESLc::ESLconnection_connected", _wrap_ESLconnection_connected}, +{"ESLc::ESLconnection_getInfo", _wrap_ESLconnection_getInfo}, +{"ESLc::ESLconnection_send", _wrap_ESLconnection_send}, +{"ESLc::ESLconnection_sendRecv", _wrap_ESLconnection_sendRecv}, +{"ESLc::ESLconnection_api", _wrap_ESLconnection_api}, +{"ESLc::ESLconnection_bgapi", _wrap_ESLconnection_bgapi}, +{"ESLc::ESLconnection_sendEvent", _wrap_ESLconnection_sendEvent}, +{"ESLc::ESLconnection_sendMSG", _wrap_ESLconnection_sendMSG}, +{"ESLc::ESLconnection_recvEvent", _wrap_ESLconnection_recvEvent}, +{"ESLc::ESLconnection_recvEventTimed", _wrap_ESLconnection_recvEventTimed}, +{"ESLc::ESLconnection_filter", _wrap_ESLconnection_filter}, +{"ESLc::ESLconnection_events", _wrap_ESLconnection_events}, +{"ESLc::ESLconnection_execute", _wrap_ESLconnection_execute}, +{"ESLc::ESLconnection_executeAsync", _wrap_ESLconnection_executeAsync}, +{"ESLc::ESLconnection_setAsyncExecute", _wrap_ESLconnection_setAsyncExecute}, +{"ESLc::ESLconnection_setEventLock", _wrap_ESLconnection_setEventLock}, +{"ESLc::ESLconnection_disconnect", _wrap_ESLconnection_disconnect}, +{"ESLc::eslSetLogLevel", _wrap_eslSetLogLevel}, +{0,0} +}; +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found, init; + + clientdata = clientdata; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#endif + + + +#ifdef __cplusplus +extern "C" +#endif + +XS(SWIG_init) { + dXSARGS; + int i; + + SWIG_InitializeModule(0); + + /* Install commands */ + for (i = 0; swig_commands[i].name; i++) { + newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); + } + + /* Install variables */ + for (i = 0; swig_variables[i].name; i++) { + SV *sv; + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); + if (swig_variables[i].type) { + SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); + } else { + sv_setiv(sv,(IV) 0); + } + swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); + } + + /* Install constant */ + for (i = 0; swig_constants[i].type; i++) { + SV *sv; + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); + switch(swig_constants[i].type) { + case SWIG_INT: + sv_setiv(sv, (IV) swig_constants[i].lvalue); + break; + case SWIG_FLOAT: + sv_setnv(sv, (double) swig_constants[i].dvalue); + break; + case SWIG_STRING: + sv_setpv(sv, (char *) swig_constants[i].pvalue); + break; + case SWIG_POINTER: + SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); + break; + case SWIG_BINARY: + SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); + break; + default: + break; + } + SvREADONLY_on(sv); + } + + SWIG_TypeClientData(SWIGTYPE_p_ESLevent, (void*) "ESL::ESLevent"); + SWIG_TypeClientData(SWIGTYPE_p_ESLconnection, (void*) "ESL::ESLconnection"); + ST(0) = &PL_sv_yes; + XSRETURN(1); +} + diff --git a/libs/libscgi/perl/perlxsi.c b/libs/libscgi/perl/perlxsi.c new file mode 100644 index 0000000000..9ca8fc1fb1 --- /dev/null +++ b/libs/libscgi/perl/perlxsi.c @@ -0,0 +1,16 @@ +#include +#include + +EXTERN_C void xs_init (pTHX); + +EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); + +EXTERN_C void +xs_init(pTHX) +{ + char *file = __FILE__; + dXSUB_SYS; + + /* DynaLoader is a special case */ + newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); +} diff --git a/libs/libscgi/perl/scgi_wrap.cpp b/libs/libscgi/perl/scgi_wrap.cpp new file mode 100644 index 0000000000..cc96e9494c --- /dev/null +++ b/libs/libscgi/perl/scgi_wrap.cpp @@ -0,0 +1,2539 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPERL +#define SWIG_CASTRANK_MODE + +#ifdef __cplusplus +template class SwigValueWrapper { + T *tt; +public: + SwigValueWrapper() : tt(0) { } + SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } + SwigValueWrapper(const T& t) : tt(new T(t)) { } + ~SwigValueWrapper() { delete tt; } + SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } + operator T&() const { return *tt; } + T *operator&() { return tt; } +private: + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); +}; + +template T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic CAPI SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the swig runtime code. + In 99.9% of the cases, swig just needs to declare them as 'static'. + + But only do this if is strictly necessary, ie, if you have problems + with your compiler or so. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The swig conversion methods, as ConvertPtr, return and integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old swig versions, you usually write code as: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit as: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + that seems to be the same, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + requires also to SWIG_ConvertPtr to return new result values, as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + swig errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() + + + */ +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCompare(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + + +/* think of this as a c++ template<> or a scheme macro */ +#define SWIG_TypeCheck_Template(comparison, ty) \ + if (ty) { \ + swig_cast_info *iter = ty->cast; \ + while (iter) { \ + if (comparison) { \ + if (iter == ty->cast) return iter; \ + /* Move iter to the top of the linked list */ \ + iter->prev->next = iter->next; \ + if (iter->next) \ + iter->next->prev = iter->prev; \ + iter->next = ty->cast; \ + iter->prev = 0; \ + if (ty->cast) ty->cast->prev = iter; \ + ty->cast = iter; \ + return iter; \ + } \ + iter = iter->next; \ + } \ + } \ + return 0 + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); +} + +/* Same as previous function, except strcmp is replaced with a pointer comparison */ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { + SWIG_TypeCheck_Template(iter->type == from, into); +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +#ifdef __cplusplus +/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ +#include +#include +extern "C" { +#endif +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */ + +/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */ +#ifndef PERL_REVISION +# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) +# define PERL_PATCHLEVEL_H_IMPLICIT +# include +# endif +# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) +# include +# endif +# ifndef PERL_REVISION +# define PERL_REVISION (5) +# define PERL_VERSION PATCHLEVEL +# define PERL_SUBVERSION SUBVERSION +# endif +#endif + +#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) +#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) +#endif + +#ifndef SvIOK_UV +# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) +#endif + +#ifndef SvUOK +# define SvUOK(sv) SvIOK_UV(sv) +#endif + +#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))) +# define PL_sv_undef sv_undef +# define PL_na na +# define PL_errgv errgv +# define PL_sv_no sv_no +# define PL_sv_yes sv_yes +# define PL_markstack_ptr markstack_ptr +#endif + +#ifndef IVSIZE +# ifdef LONGSIZE +# define IVSIZE LONGSIZE +# else +# define IVSIZE 4 /* A bold guess, but the best we can make. */ +# endif +#endif + +#ifndef INT2PTR +# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) +# define PTRV UV +# define INT2PTR(any,d) (any)(d) +# else +# if PTRSIZE == LONGSIZE +# define PTRV unsigned long +# else +# define PTRV unsigned +# endif +# define INT2PTR(any,d) (any)(PTRV)(d) +# endif + +# define NUM2PTR(any,d) (any)(PTRV)(d) +# define PTR2IV(p) INT2PTR(IV,p) +# define PTR2UV(p) INT2PTR(UV,p) +# define PTR2NV(p) NUM2PTR(NV,p) + +# if PTRSIZE == LONGSIZE +# define PTR2ul(p) (unsigned long)(p) +# else +# define PTR2ul(p) INT2PTR(unsigned long,p) +# endif +#endif /* !INT2PTR */ + +#ifndef SvPV_nolen +# define SvPV_nolen(x) SvPV(x,PL_na) +#endif + +#ifndef get_sv +# define get_sv perl_get_sv +#endif + +#ifndef ERRSV +# define ERRSV get_sv("@",FALSE) +#endif + +#ifndef pTHX_ +#define pTHX_ +#endif + +#include +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGINTERN const char* +SWIG_Perl_ErrorType(int code) { + const char* type = 0; + switch(code) { + case SWIG_MemoryError: + type = "MemoryError"; + break; + case SWIG_IOError: + type = "IOError"; + break; + case SWIG_RuntimeError: + type = "RuntimeError"; + break; + case SWIG_IndexError: + type = "IndexError"; + break; + case SWIG_TypeError: + type = "TypeError"; + break; + case SWIG_DivisionByZero: + type = "ZeroDivisionError"; + break; + case SWIG_OverflowError: + type = "OverflowError"; + break; + case SWIG_SyntaxError: + type = "SyntaxError"; + break; + case SWIG_ValueError: + type = "ValueError"; + break; + case SWIG_SystemError: + type = "SystemError"; + break; + case SWIG_AttributeError: + type = "AttributeError"; + break; + default: + type = "RuntimeError"; + } + return type; +} + + + + +/* ----------------------------------------------------------------------------- + * perlrun.swg + * + * This file contains the runtime support for Perl modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef PERL_OBJECT +#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl), +#define SWIG_PERL_OBJECT_CALL pPerl, +#else +#define SWIG_PERL_OBJECT_DECL +#define SWIG_PERL_OBJECT_CALL +#endif + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) +#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) +#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) + + +/* Error manipulation */ + +#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) +#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + +/* Perl-specific SWIG API */ + +#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) +#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) +#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) + + +#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) +#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) +#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) +#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +/* For backward compatibility only */ +#define SWIG_POINTER_EXCEPTION 0 + +#ifdef __cplusplus +extern "C" { +#endif + +#define SWIG_OWNER SWIG_POINTER_OWN +#define SWIG_SHADOW SWIG_OWNER << 1 + +#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL + +/* SWIG Perl macros */ + +/* Macro to declare an XS function */ +#ifndef XSPROTO +# define XSPROTO(name) void name(pTHX_ CV* cv) +#endif + +/* Macro to call an XS function */ +#ifdef PERL_OBJECT +# define SWIG_CALLXS(_name) _name(cv,pPerl) +#else +# ifndef MULTIPLICITY +# define SWIG_CALLXS(_name) _name(cv) +# else +# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) +# endif +#endif + +#ifdef PERL_OBJECT +#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +#define SWIGCLASS_STATIC + +#else /* PERL_OBJECT */ + +#define MAGIC_PPERL +#define SWIGCLASS_STATIC static SWIGUNUSED + +#ifndef MULTIPLICITY +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#else /* MULTIPLICITY */ + +#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#endif /* MULTIPLICITY */ +#endif /* PERL_OBJECT */ + +/* Workaround for bug in perl 5.6.x croak and earlier */ +#if (PERL_VERSION < 8) +# ifdef PERL_OBJECT +# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) +static void SWIG_Perl_croak_null(CPerlObj *pPerl) +# else +static void SWIG_croak_null() +# endif +{ + SV *err=ERRSV; +# if (PERL_VERSION < 6) + croak("%_", err); +# else + if (SvOK(err) && !SvROK(err)) croak("%_", err); + croak(Nullch); +# endif +} +#else +# define SWIG_croak_null() croak(Nullch) +#endif + + +/* + Define how strict is the cast between strings and integers/doubles + when overloading between these types occurs. + + The default is making it as strict as possible by using SWIG_AddCast + when needed. + + You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to + disable the SWIG_AddCast, making the casting between string and + numbers less strict. + + In the end, we try to solve the overloading between strings and + numerical types in the more natural way, but if you can avoid it, + well, avoid it using %rename, for example. +*/ +#ifndef SWIG_PERL_NO_STRICT_STR2NUM +# ifndef SWIG_PERL_STRICT_STR2NUM +# define SWIG_PERL_STRICT_STR2NUM +# endif +#endif +#ifdef SWIG_PERL_STRICT_STR2NUM +/* string takes precedence */ +#define SWIG_Str2NumCast(x) SWIG_AddCast(x) +#else +/* number takes precedence */ +#define SWIG_Str2NumCast(x) x +#endif + + + +#include + +SWIGRUNTIME const char * +SWIG_Perl_TypeProxyName(const swig_type_info *type) { + if (!type) return NULL; + if (type->clientdata != NULL) { + return (const char*) type->clientdata; + } + else { + return type->name; + } +} + +SWIGRUNTIME swig_cast_info * +SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) + || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); +} + + +/* Function for getting a pointer value */ + +SWIGRUNTIME int +SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { + swig_cast_info *tc; + void *voidptr = (void *)0; + SV *tsv = 0; + /* If magical, apply more magic */ + if (SvGMAGICAL(sv)) + mg_get(sv); + + /* Check to see if this is an object */ + if (sv_isobject(sv)) { + IV tmp = 0; + tsv = (SV*) SvRV(sv); + if ((SvTYPE(tsv) == SVt_PVHV)) { + MAGIC *mg; + if (SvMAGICAL(tsv)) { + mg = mg_find(tsv,'P'); + if (mg) { + sv = mg->mg_obj; + if (sv_isobject(sv)) { + tsv = (SV*)SvRV(sv); + tmp = SvIV(tsv); + } + } + } else { + return SWIG_ERROR; + } + } else { + tmp = SvIV(tsv); + } + voidptr = INT2PTR(void *,tmp); + } else if (! SvOK(sv)) { /* Check for undef */ + *(ptr) = (void *) 0; + return SWIG_OK; + } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ + if (!SvROK(sv)) { + *(ptr) = (void *) 0; + return SWIG_OK; + } else { + return SWIG_ERROR; + } + } else { /* Don't know what it is */ + return SWIG_ERROR; + } + if (_t) { + /* Now see if the types match */ + char *_c = HvNAME(SvSTASH(SvRV(sv))); + tc = SWIG_TypeProxyCheck(_c,_t); + if (!tc) { + return SWIG_ERROR; + } + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } + } else { + *ptr = voidptr; + } + + /* + * DISOWN implementation: we need a perl guru to check this one. + */ + if (tsv && (flags & SWIG_POINTER_DISOWN)) { + /* + * almost copy paste code from below SWIG_POINTER_OWN setting + */ + SV *obj = sv; + HV *stash = SvSTASH(SvRV(obj)); + GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE); + if (isGV(gv)) { + HV *hv = GvHVn(gv); + /* + * To set ownership (see below), a newSViv(1) entry is added. + * Hence, to remove ownership, we delete the entry. + */ + if (hv_exists_ent(hv, obj, 0)) { + hv_delete_ent(hv, obj, 0, 0); + } + } + } + return SWIG_OK; +} + +SWIGRUNTIME void +SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { + if (ptr && (flags & SWIG_SHADOW)) { + SV *self; + SV *obj=newSV(0); + HV *hash=newHV(); + HV *stash; + sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr); + stash=SvSTASH(SvRV(obj)); + if (flags & SWIG_POINTER_OWN) { + HV *hv; + GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE); + if (!isGV(gv)) + gv_init(gv, stash, "OWNER", 5, FALSE); + hv=GvHVn(gv); + hv_store_ent(hv, obj, newSViv(1), 0); + } + sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); + SvREFCNT_dec(obj); + self=newRV_noinc((SV *)hash); + sv_setsv(sv, self); + SvREFCNT_dec((SV *)self); + sv_bless(sv, stash); + } + else { + sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr); + } +} + +SWIGRUNTIMEINLINE SV * +SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { + SV *result = sv_newmortal(); + SWIG_MakePtr(result, ptr, t, flags); + return result; +} + +SWIGRUNTIME void +SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { + char result[1024]; + char *r = result; + if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + strcpy(r,SWIG_Perl_TypeProxyName(type)); + sv_setpv(sv, result); +} + +SWIGRUNTIME SV * +SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { + SV *result = sv_newmortal(); + SWIG_Perl_MakePackedObj(result, ptr, sz, type); + return result; +} + +/* Convert a packed value value */ +SWIGRUNTIME int +SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { + swig_cast_info *tc; + const char *c = 0; + + if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; + c = SvPV_nolen(obj); + /* Pointer values must start with leading underscore */ + if (*c != '_') return SWIG_ERROR; + c++; + c = SWIG_UnpackData(c,ptr,sz); + if (ty) { + tc = SWIG_TypeCheck(c,ty); + if (!tc) return SWIG_ERROR; + } + return SWIG_OK; +} + + +/* Macros for low-level exception handling */ +#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } + + +typedef XSPROTO(SwigPerlWrapper); +typedef SwigPerlWrapper *SwigPerlWrapperPtr; + +/* Structure for command table */ +typedef struct { + const char *name; + SwigPerlWrapperPtr wrapper; +} swig_command_info; + +/* Information for constant table */ + +#define SWIG_INT 1 +#define SWIG_FLOAT 2 +#define SWIG_STRING 3 +#define SWIG_POINTER 4 +#define SWIG_BINARY 5 + +/* Constant information structure */ +typedef struct swig_constant_info { + int type; + const char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_constant_info; + + +/* Structure for variable table */ +typedef struct { + const char *name; + SwigMagicFunc set; + SwigMagicFunc get; + swig_type_info **type; +} swig_variable_info; + +/* Magic variable code */ +#ifndef PERL_OBJECT +#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) + #ifndef MULTIPLICITY + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) + #else + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) + #endif +#else +# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) +SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) +#endif +{ + MAGIC *mg; + sv_magic(sv,sv,'U',(char *) name,strlen(name)); + mg = mg_find(sv,'U'); + mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); + mg->mg_virtual->svt_get = (SwigMagicFunc) get; + mg->mg_virtual->svt_set = (SwigMagicFunc) set; + mg->mg_virtual->svt_len = 0; + mg->mg_virtual->svt_clear = 0; + mg->mg_virtual->svt_free = 0; +} + + +SWIGRUNTIME swig_module_info * +SWIG_Perl_GetModule(void) { + static void *type_pointer = (void *)0; + SV *pointer; + + /* first check if pointer already created */ + if (!type_pointer) { + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); + if (pointer && SvOK(pointer)) { + type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); + } + } + + return (swig_module_info *) type_pointer; +} + +SWIGRUNTIME void +SWIG_Perl_SetModule(swig_module_info *module) { + SV *pointer; + + /* create a new pointer */ + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); + sv_setiv(pointer, PTR2IV(module)); +} + +#ifdef __cplusplus +} +#endif + +/* Workaround perl5 global namespace pollution. Note that undefining library + * functions like fopen will not solve the problem on all platforms as fopen + * might be a macro on Windows but not necessarily on other operating systems. */ +#ifdef do_open + #undef do_open +#endif +#ifdef do_close + #undef do_close +#endif +#ifdef scalar + #undef scalar +#endif +#ifdef list + #undef list +#endif +#ifdef apply + #undef apply +#endif +#ifdef convert + #undef convert +#endif +#ifdef Error + #undef Error +#endif +#ifdef form + #undef form +#endif +#ifdef vform + #undef vform +#endif +#ifdef LABEL + #undef LABEL +#endif +#ifdef METHOD + #undef METHOD +#endif +#ifdef Move + #undef Move +#endif +#ifdef yylex + #undef yylex +#endif +#ifdef yyparse + #undef yyparse +#endif +#ifdef yyerror + #undef yyerror +#endif +#ifdef invert + #undef invert +#endif +#ifdef ref + #undef ref +#endif +#ifdef read + #undef read +#endif +#ifdef write + #undef write +#endif +#ifdef eof + #undef eof +#endif +#ifdef bool + #undef bool +#endif +#ifdef close + #undef close +#endif +#ifdef rewind + #undef rewind +#endif +#ifdef free + #undef free +#endif +#ifdef malloc + #undef malloc +#endif +#ifdef calloc + #undef calloc +#endif +#ifdef Stat + #undef Stat +#endif +#ifdef check + #undef check +#endif +#ifdef seekdir + #undef seekdir +#endif +#ifdef open + #undef open +#endif + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_SCGIhandle swig_types[0] +#define SWIGTYPE_p_char swig_types[1] +static swig_type_info *swig_types[3]; +static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_init boot_FSSCGI + +#define SWIG_name "FSSCGIc::boot_FSSCGI" +#define SWIG_prefix "FSSCGIc::" + +#define SWIGVERSION 0x010335 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) + + +#include + + +#ifdef __cplusplus +extern "C" +#endif +#ifndef PERL_OBJECT +#ifndef MULTIPLICITY +SWIGEXPORT void SWIG_init (CV* cv); +#else +SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); +#endif +#else +SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); +#endif + + +#include "scgi.h" +#include "scgi_oop.h" + + +SWIGINTERNINLINE SV * +SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) +{ + SV *obj = sv_newmortal(); + sv_setiv(obj, (IV) value); + return obj; +} + + +SWIGINTERNINLINE SV * +SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value) +{ + return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value); +} + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) +{ + if (SvPOK(obj)) { + STRLEN len = 0; + char *cstr = SvPV(obj, len); + size_t size = len + 1; + if (cptr) { + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); + } else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } + } + if (psize) *psize = size; + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + char* vptr = 0; + if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = vptr; + if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + + +SWIGINTERNINLINE SV * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + SV *obj = sv_newmortal(); + if (carray) { + sv_setpvn(obj, carray, size); + } else { + sv_setsv(obj, &PL_sv_undef); + } + return obj; +} + + +SWIGINTERNINLINE SV * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + +#include +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +SWIGINTERN int +SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) +{ + if (SvNIOK(obj)) { + if (val) *val = SvNV(obj); + return SWIG_OK; + } else if (SvIOK(obj)) { + if (val) *val = (double) SvIV(obj); + return SWIG_AddCast(SWIG_OK); + } else { + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + double v = strtod(nptr, &endptr); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + } + return SWIG_TypeError; +} + + +#include + + +#include + + +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN int +SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) +{ + if (SvIOK(obj)) { + if (val) *val = SvIV(obj); + return SWIG_OK; + } else { + int dispatch = 0; + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + long v; + errno = 0; + v = strtol(nptr, &endptr,0); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + if (val) *val = (long)(d); + return res; + } + } + } + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) +{ + long v; + int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = static_cast< int >(v); + } + } + return res; +} + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef PERL_OBJECT +#define MAGIC_CLASS _wrap_FSSCGI_var:: +class _wrap_FSSCGI_var : public CPerlObj { +public: +#else +#define MAGIC_CLASS +#endif +SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + croak("Value is read-only."); + return 0; +} + + +#ifdef PERL_OBJECT +}; +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +XS(_wrap_new_SCGIhandle) { + { + SCGIhandle *result = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: new_SCGIhandle();"); + } + result = (SCGIhandle *)new SCGIhandle(); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SCGIhandle, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_delete_SCGIhandle) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: delete_SCGIhandle(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SCGIhandle" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + delete arg1; + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_connected) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: SCGIhandle_connected(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_connected" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + result = (int)(arg1)->connected(); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_socketDescriptor) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: SCGIhandle_socketDescriptor(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_socketDescriptor" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + result = (int)(arg1)->socketDescriptor(); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_disconnect) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: SCGIhandle_disconnect(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_disconnect" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + result = (int)(arg1)->disconnect(); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_addParam) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: SCGIhandle_addParam(self,name,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_addParam" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_addParam" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SCGIhandle_addParam" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (int)(arg1)->addParam((char const *)arg2,(char const *)arg3); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_addBody) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + char *arg2 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: SCGIhandle_addBody(self,value);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_addBody" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_addBody" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (int)(arg1)->addBody((char const *)arg2); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_getBody) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: SCGIhandle_getBody(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_getBody" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + result = (char *)(arg1)->getBody(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_getParam) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + char *arg2 = (char *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: SCGIhandle_getParam(self,name);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_getParam" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_getParam" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (char *)(arg1)->getParam((char const *)arg2); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_sendRequest) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + int arg4 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: SCGIhandle_sendRequest(self,host,port,timeout);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_sendRequest" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_sendRequest" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SCGIhandle_sendRequest" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "SCGIhandle_sendRequest" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (char *)(arg1)->sendRequest((char const *)arg2,arg3,arg4); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + + + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + + + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_respond) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + char *arg2 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: SCGIhandle_respond(self,msg);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_respond" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_respond" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (int)(arg1)->respond(arg2); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_bind) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: SCGIhandle_bind(self,host,port);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_bind" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_bind" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SCGIhandle_bind" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (int)(arg1)->bind((char const *)arg2,arg3); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + + SWIG_croak_null(); + } +} + + +XS(_wrap_SCGIhandle_accept) { + { + SCGIhandle *arg1 = (SCGIhandle *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: SCGIhandle_accept(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_accept" "', argument " "1"" of type '" "SCGIhandle *""'"); + } + arg1 = reinterpret_cast< SCGIhandle * >(argp1); + result = (int)(arg1)->accept(); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_SCGIhandle = {"_p_SCGIhandle", "SCGIhandle *", 0, 0, (void*)"FSSCGI::SCGIhandle", 0}; +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_SCGIhandle, + &_swigt__p_char, +}; + +static swig_cast_info _swigc__p_SCGIhandle[] = { {&_swigt__p_SCGIhandle, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_SCGIhandle, + _swigc__p_char, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_constant_info swig_constants[] = { +{0,0,0,0,0,0} +}; +#ifdef __cplusplus +} +#endif +static swig_variable_info swig_variables[] = { +{0,0,0,0} +}; +static swig_command_info swig_commands[] = { +{"FSSCGIc::new_SCGIhandle", _wrap_new_SCGIhandle}, +{"FSSCGIc::delete_SCGIhandle", _wrap_delete_SCGIhandle}, +{"FSSCGIc::SCGIhandle_connected", _wrap_SCGIhandle_connected}, +{"FSSCGIc::SCGIhandle_socketDescriptor", _wrap_SCGIhandle_socketDescriptor}, +{"FSSCGIc::SCGIhandle_disconnect", _wrap_SCGIhandle_disconnect}, +{"FSSCGIc::SCGIhandle_addParam", _wrap_SCGIhandle_addParam}, +{"FSSCGIc::SCGIhandle_addBody", _wrap_SCGIhandle_addBody}, +{"FSSCGIc::SCGIhandle_getBody", _wrap_SCGIhandle_getBody}, +{"FSSCGIc::SCGIhandle_getParam", _wrap_SCGIhandle_getParam}, +{"FSSCGIc::SCGIhandle_sendRequest", _wrap_SCGIhandle_sendRequest}, +{"FSSCGIc::SCGIhandle_respond", _wrap_SCGIhandle_respond}, +{"FSSCGIc::SCGIhandle_bind", _wrap_SCGIhandle_bind}, +{"FSSCGIc::SCGIhandle_accept", _wrap_SCGIhandle_accept}, +{0,0} +}; +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found, init; + + clientdata = clientdata; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#endif + + + +#ifdef __cplusplus +extern "C" +#endif + +XS(SWIG_init) { + dXSARGS; + int i; + + SWIG_InitializeModule(0); + + /* Install commands */ + for (i = 0; swig_commands[i].name; i++) { + newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); + } + + /* Install variables */ + for (i = 0; swig_variables[i].name; i++) { + SV *sv; + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); + if (swig_variables[i].type) { + SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); + } else { + sv_setiv(sv,(IV) 0); + } + swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); + } + + /* Install constant */ + for (i = 0; swig_constants[i].type; i++) { + SV *sv; + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); + switch(swig_constants[i].type) { + case SWIG_INT: + sv_setiv(sv, (IV) swig_constants[i].lvalue); + break; + case SWIG_FLOAT: + sv_setnv(sv, (double) swig_constants[i].dvalue); + break; + case SWIG_STRING: + sv_setpv(sv, (char *) swig_constants[i].pvalue); + break; + case SWIG_POINTER: + SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); + break; + case SWIG_BINARY: + SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); + break; + default: + break; + } + SvREADONLY_on(sv); + } + + SWIG_TypeClientData(SWIGTYPE_p_SCGIhandle, (void*) "FSSCGI::SCGIhandle"); + ST(0) = &PL_sv_yes; + XSRETURN(1); +} + diff --git a/libs/libscgi/perl/testclient.pl b/libs/libscgi/perl/testclient.pl new file mode 100644 index 0000000000..59415baf72 --- /dev/null +++ b/libs/libscgi/perl/testclient.pl @@ -0,0 +1,19 @@ +use FSSCGI; + + +my $handle = new FSSCGI::SCGIhandle(); + + $handle->addParam( "REQUEST_METHOD", "POST"); + $handle->addParam( "REQUEST_URI", "/deepthought"); + $handle->addParam( "TESTING", "TRUE"); + $handle->addParam( "TESTING", "TRUE"); + $handle->addBody("What is the answer to life?"); + + + +if ((my $response = $handle->sendRequest("127.0.0.1", 7777, 10000))) { + print "RESP[$response]\n"; +} else { + print "ERROR!\n"; +} + diff --git a/libs/libscgi/perl/testserver.pl b/libs/libscgi/perl/testserver.pl new file mode 100644 index 0000000000..6e03d5c5e4 --- /dev/null +++ b/libs/libscgi/perl/testserver.pl @@ -0,0 +1,17 @@ +use FSSCGI; + + +my $handle = new FSSCGI::SCGIhandle(); + +if ($handle->bind("127.0.0.1", 7777)) { + + while($handle->accept()) { + print "REQ: " . $handle->getBody(). "\n\n"; + $handle->respond("W00t!!!!!!\n"); + } + + print "DONE\n"; + +} else { + print "FAIL\n"; +} diff --git a/libs/libscgi/protocol.txt b/libs/libscgi/protocol.txt new file mode 100644 index 0000000000..34c128005f --- /dev/null +++ b/libs/libscgi/protocol.txt @@ -0,0 +1,101 @@ +SCGI: A Simple Common Gateway Interface alternative +Neil Schemenauer +2008-06-23 + +1. Introduction + + The SCGI protocol is a replacement for the Common Gateway Interface + (CGI) protocol. It is a standard for applications to interface with + HTTP servers. It is similar to FastCGI but is designed to be easier + to implement. + + In this document, a string of 8-bit bytes may be written in two + different forms: as a series of hexadecimal numbers between angle + brackets, or as a sequence of ASCII characters between double quotes. + For example, <68 65 6c 6c 6f 20 77 6f 72 6c 64 21> is a string of + length 12; it is the same as the string "hello world!". Note that + these notations are part of this document, not part of the protocol. + + +2. Protocol + + The client connects to a SCGI server over a reliable stream protocol + allowing transmission of 8-bit bytes. The client begins by sending a + request. See section 3 for the format of the request. When the SCGI + server sees the end of the request it sends back a response and closes + the connection. The format of the response is not specified by this + protocol. + + +3. Request Format + + A request consists of a number of headers and a body. The format of + the headers is: + + headers ::= header* + header ::= name NUL value NUL + name ::= notnull+ + value ::= notnull* + notnull ::= <01> | <02> | <03> | ... | + NUL = <00> + + Duplicate names are not allowed in the headers. The first header + must have the name "CONTENT_LENGTH" and a value that is a nonempty + sequence of ASCII digits giving the of the body length in decimal. + The "CONTENT_LENGTH" header must always be present, even if its + value is "0". There must also always be a header with the name + "SCGI" and a value of "1". In order to facilitate the transition + from CGI, standard CGI environment variables should be provided as + SCGI headers. + + The headers are sent encoded as a netstring. Netstring encoding is + explained in section 4. The body is sent following the headers and + its length is specified by the "CONTENT_LENGTH" header. + + +4. Netstrings + + Any string of 8-bit bytes may be encoded as [len]":"[string]",". Here + [string] is the string and [len] is a nonempty sequence of ASCII + digits giving the length of [string] in decimal. The ASCII digits are + <30> for 0, <31> for 1, and so on up through <39> for 9. Extra zeros + at the front of [len] are prohibited: [len] begins with <30> exactly + when [string] is empty. + + For example, the string "hello world!" is encoded as <31 32 3a 68 65 + 6c 6c 6f 20 77 6f 72 6c 64 21 2c>, i.e., "12:hello world!,". The empty + string is encoded as "0:,". + + [len]":"[string]"," is called a netstring. [string] is called the + interpretation of the netstring. + + +5. Example + + The web server (a SCGI client) opens a connection and sends the + concatenation of the following strings: + + "70:" + "CONTENT_LENGTH" <00> "27" <00> + "SCGI" <00> "1" <00> + "REQUEST_METHOD" <00> "POST" <00> + "REQUEST_URI" <00> "/deepthought" <00> + "," + "What is the answer to life?" + + The SCGI server sends the following response: + + "Status: 200 OK" <0d 0a> + "Content-Type: text/plain" <0d 0a> + "" <0d 0a> + "42" + + The SCGI server closes the connection. + + +6. Copyright + + This document has been placed in the public domain. + + +/* vim: set ai tw=74 et sw=4 sts=4: */ diff --git a/libs/libscgi/src/include/scgi.h b/libs/libscgi/src/include/scgi.h new file mode 100644 index 0000000000..575a45f7f9 --- /dev/null +++ b/libs/libscgi/src/include/scgi.h @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2012-2013, Anthony Minessale II + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the original author; nor the names of any contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SCGI_H_ +#define _SCGI_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* defined(__cplusplus) */ +#if EMACS_BUG +} +#endif + +#ifdef _MSC_VER +#define FD_SETSIZE 8192 +#define SCGI_USE_SELECT +#else +#define SCGI_USE_POLL +#endif + + + +#ifdef SCGI_USE_POLL +#include +#endif + +#ifdef WIN32 +#include +#include +typedef SOCKET scgi_socket_t; +typedef unsigned __int64 uint64_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int8 uint8_t; +typedef __int64 int64_t; +typedef __int32 int32_t; +typedef __int16 int16_t; +typedef __int8 int8_t; +typedef intptr_t scgi_ssize_t; +typedef int scgi_filehandle_t; +#define SCGI_SOCK_INVALID INVALID_SOCKET +#define strerror_r(num, buf, size) strerror_s(buf, size, num) +#if defined(SCGI_DECLARE_STATIC) +#define SCGI_DECLARE(type) type __stdcall +#define SCGI_DECLARE_NONSTD(type) type __cdecl +#define SCGI_DECLARE_DATA +#elif defined(SCGI_EXPORTS) +#define SCGI_DECLARE(type) __declspec(dllexport) type __stdcall +#define SCGI_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define SCGI_DECLARE_DATA __declspec(dllexport) +#else +#define SCGI_DECLARE(type) __declspec(dllimport) type __stdcall +#define SCGI_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define SCGI_DECLARE_DATA __declspec(dllimport) +#endif +#else +#define SCGI_DECLARE(type) type +#define SCGI_DECLARE_NONSTD(type) type +#define SCGI_DECLARE_DATA +#include +#include +#include +#include +#include +#include +#include +#define SCGI_SOCK_INVALID -1 +typedef int scgi_socket_t; +typedef ssize_t scgi_ssize_t; +typedef int scgi_filehandle_t; +#endif + + +#include +#ifndef WIN32 +#include +#endif + +#include +#include +#include +#include +#ifndef WIN32 +#include +#include +#include +#include +#include +#include +#endif + +#ifdef HAVE_STRINGS_H +#include +#endif +#include + +#if (_MSC_VER >= 1400) // VC8+ +#define scgi_assert(expr) assert(expr);__analysis_assume( expr ) +#endif + +#ifndef scgi_assert +#define scgi_assert(_x) assert(_x) +#endif + +#define scgi_safe_free(_x) if (_x) free(_x); _x = NULL +#define scgi_strlen_zero(s) (!s || *(s) == '\0') +#define scgi_strlen_zero_buf(s) (*(s) == '\0') +#define end_of(_s) *(*_s == '\0' ? _s : _s + strlen(_s) - 1) +#define end_of_p(_s) (*_s == '\0' ? _s : _s + strlen(_s) - 1) + +typedef enum { + SCGI_POLL_READ = (1 << 0), + SCGI_POLL_WRITE = (1 << 1), + SCGI_POLL_ERROR = (1 << 2) +} scgi_poll_t; + + +typedef struct scgi_param_s { + char *name; + char *value; + struct scgi_param_s *next; +} scgi_param_t; + +typedef struct scgi_handle_s { + scgi_param_t *params; + char *body; + struct sockaddr_in sockaddr; + struct hostent hostent; + char hostbuf[256]; + scgi_socket_t sock; + char err[256]; + int errnum; + int connected; + struct sockaddr_in addr; + int destroyed; +} scgi_handle_t; + + +typedef int16_t scgi_port_t; +typedef size_t scgi_size_t; + +typedef enum { + SCGI_SUCCESS, + SCGI_FAIL, + SCGI_BREAK, + SCGI_DISCONNECTED, + SCGI_GENERR +} scgi_status_t; + +typedef void (*scgi_listen_callback_t)(scgi_socket_t server_sock, scgi_socket_t *client_sock, struct sockaddr_in *addr); + +SCGI_DECLARE(scgi_status_t) scgi_connect(scgi_handle_t *handle, const char *host, scgi_port_t port, uint32_t timeout); +SCGI_DECLARE(scgi_status_t) scgi_disconnect(scgi_handle_t *handle); +SCGI_DECLARE(scgi_status_t) scgi_parse(scgi_socket_t sock, scgi_handle_t *handle); +SCGI_DECLARE(int) scgi_wait_sock(scgi_socket_t sock, uint32_t ms, scgi_poll_t flags); +SCGI_DECLARE(ssize_t) scgi_recv(scgi_handle_t *handle, unsigned char *buf, size_t buflen); +SCGI_DECLARE(scgi_status_t) scgi_send_request(scgi_handle_t *handle); +SCGI_DECLARE(scgi_status_t) scgi_add_param(scgi_handle_t *handle, const char *name, const char *value); +SCGI_DECLARE(scgi_status_t) scgi_add_body(scgi_handle_t *handle, const char *value); +SCGI_DECLARE(size_t) scgi_build_message(scgi_handle_t *handle, char **buffer); +SCGI_DECLARE(scgi_status_t) scgi_destroy_params(scgi_handle_t *handle); +SCGI_DECLARE(scgi_status_t) scgi_listen(const char *host, scgi_port_t port, scgi_listen_callback_t callback); +SCGI_DECLARE(const char *) scgi_get_body(scgi_handle_t *handle); +SCGI_DECLARE(const char *) scgi_get_param(scgi_handle_t *handle, const char *name); +SCGI_DECLARE(scgi_status_t) scgi_bind(const char *host, scgi_port_t port, scgi_socket_t *socketp); +SCGI_DECLARE(scgi_status_t) scgi_accept(scgi_socket_t server_sock, scgi_socket_t *client_sock_p, struct sockaddr_in *echoClntAddr); + +#ifndef WIN32 +#define closesocket(x) close(x) +#endif + +#ifdef __cplusplus +} +#endif /* defined(__cplusplus) */ + + +#endif /* defined(_SCGI_H_) */ + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/libs/libscgi/src/include/scgi_oop.h b/libs/libscgi/src/include/scgi_oop.h new file mode 100644 index 0000000000..64f3267779 --- /dev/null +++ b/libs/libscgi/src/include/scgi_oop.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2007-2012, Anthony Minessale II + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the original author; nor the names of any contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SCGI_OOP_H_ +#define _SCGI_OOP_H_ +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define this_check(x) do { if (!this) { scgi_log(SCGI_LOG_ERROR, "object is not initalized\n"); return x;}} while(0) +#define this_check_void() do { if (!this) { scgi_log(SCGI_LOG_ERROR, "object is not initalized\n"); return;}} while(0) + + + +class SCGIhandle { + private: + scgi_socket_t server_sock; + scgi_handle_t handle; + unsigned char buf[65536]; + char *data_buf; + int buflen; + int bufsize; + public: + SCGIhandle(); + virtual ~SCGIhandle(); + int connected(); + int socketDescriptor(); + int disconnect(void); + int addParam(const char *name, const char *value); + int addBody(const char *value); + char *getBody(); + char *getParam(const char *name); + char *sendRequest(const char *host, int port, int timeout); + int respond(char *msg); + int bind(const char *host, int port); + int accept(void); +}; + + + + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/libscgi/src/scgi.c b/libs/libscgi/src/scgi.c new file mode 100644 index 0000000000..df05b5980b --- /dev/null +++ b/libs/libscgi/src/scgi.c @@ -0,0 +1,739 @@ +/* + * Copyright (c) 2012-2013, Anthony Minessale II + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the original author; nor the names of any contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#ifndef WIN32 +#include +#include +#else +#pragma warning (disable:6386) +/* These warnings need to be ignored warning in sdk header */ +#include +#include +#ifndef errno +#define errno WSAGetLastError() +#endif +#ifndef EINTR +#define EINTR WSAEINTR +#endif +#pragma warning (default:6386) +#endif + +static scgi_status_t scgi_push_param(scgi_handle_t *handle, const char *name, const char *value); + +static int sock_setup(scgi_handle_t *handle) +{ + + if (handle->sock == SCGI_SOCK_INVALID) { + return SCGI_FAIL; + } + +#ifdef WIN32 + { + BOOL bOptVal = TRUE; + int bOptLen = sizeof(BOOL); + setsockopt(handle->sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&bOptVal, bOptLen); + } +#else + { + int x = 1; + setsockopt(handle->sock, IPPROTO_TCP, TCP_NODELAY, &x, sizeof(x)); + } +#endif + + return SCGI_SUCCESS; +} + + +SCGI_DECLARE(size_t) scgi_build_message(scgi_handle_t *handle, char **bufferp) +{ + scgi_param_t *pp; + size_t len = 0, plen = 0, ctlen = 0; + char *s, *bp; + char *buffer = NULL; + char tmp[128] = ""; + + scgi_push_param(handle, "SCGI", "1"); + + if (handle->body) { + ctlen = strlen(handle->body); + } + + snprintf(tmp, sizeof(tmp), "%d", (int)ctlen); + + scgi_push_param(handle, "CONTENT_LENGTH", tmp); + + + for(pp = handle->params; pp; pp = pp->next) { + plen += (strlen(pp->name) + strlen(pp->value) + 2); + } + + snprintf(tmp, sizeof(tmp), "%d", (int) (plen + ctlen)); + + len = plen + ctlen + strlen(tmp) + 2; + + buffer = malloc(len); + memset(buffer, 0, len); + + snprintf(buffer, len, "%d:", (int)plen); + bp = buffer + strlen(buffer); + + for(pp = handle->params; pp; pp = pp->next) { + + for (s = pp->name; s && *s; s++) { + *bp++ = *s; + } + + *bp++ = '\0'; + + for (s = pp->value; s && *s; s++) { + *bp++ = *s; + } + + *bp++ = '\0'; + } + + *bp++ = ','; + + if (handle->body) { + for (s = handle->body; s && *s; s++) { + *bp++ = *s; + } + } + + *bufferp = buffer; + + return len; +} + +SCGI_DECLARE(scgi_status_t) scgi_destroy_params(scgi_handle_t *handle) +{ + scgi_param_t *param, *pp; + + pp = handle->params; + + while(pp) { + param = pp; + pp = pp->next; + + free(param->name); + free(param->value); + free(param); + } + + handle->params = NULL; + + return SCGI_SUCCESS; +} + +SCGI_DECLARE(scgi_status_t) scgi_add_body(scgi_handle_t *handle, const char *value) +{ + handle->body = strdup(value); + + return SCGI_SUCCESS; +} + +SCGI_DECLARE(const char *) scgi_get_body(scgi_handle_t *handle) +{ + return handle->body; +} + +SCGI_DECLARE(scgi_status_t) scgi_add_param(scgi_handle_t *handle, const char *name, const char *value) +{ + scgi_param_t *param, *pp; + + for(pp = handle->params; pp && pp->next; pp = pp->next) { + if (!strcasecmp(pp->name, name)) { + return SCGI_FAIL; + } + } + + param = malloc(sizeof(*param)); + memset(param, 0, sizeof(*param)); + + param->name = strdup(name); + param->value = strdup(value); + + if (!pp) { + handle->params = param; + } else { + pp->next = param; + } + + return SCGI_SUCCESS; +} + +SCGI_DECLARE(const char *) scgi_get_param(scgi_handle_t *handle, const char *name) +{ + scgi_param_t *pp; + + for(pp = handle->params; pp; pp = pp->next) { + if (!strcasecmp(pp->name, name)) { + return pp->value; + } + } + + return NULL; +} + +static scgi_status_t scgi_push_param(scgi_handle_t *handle, const char *name, const char *value) +{ + scgi_param_t *param; + + param = malloc(sizeof(*param)); + memset(param, 0, sizeof(*param)); + + param->name = strdup(name); + param->value = strdup(value); + + param->next = handle->params; + handle->params = param; + + return SCGI_SUCCESS; +} + +SCGI_DECLARE(scgi_status_t) scgi_send_request(scgi_handle_t *handle) +{ + scgi_status_t status = SCGI_SUCCESS; + char *buffer = NULL; + size_t bytes = 0; + ssize_t sent = 0; + + if (handle->connected != 1) { + return SCGI_FAIL; + } + + bytes = scgi_build_message(handle, &buffer); + sent = send(handle->sock, buffer, bytes, 0); + + if (sent <= 0) { + handle->connected = -1; + } + + scgi_safe_free(buffer); + + return status; +} + + +SCGI_DECLARE(ssize_t) scgi_recv(scgi_handle_t *handle, unsigned char *buf, size_t buflen) +{ + ssize_t recvd; + + if (handle->connected != 1) { + return -1; + } + + recvd = recv(handle->sock, buf, buflen, 0); + + if (recvd == 0) { + handle->connected = -1; + } + + + return recvd; +} + +SCGI_DECLARE(scgi_status_t) scgi_connect(scgi_handle_t *handle, const char *host, scgi_port_t port, uint32_t timeout) +{ + int rval = 0; + + struct addrinfo hints = { 0 }, *result; +#ifndef WIN32 + int fd_flags = 0; +#else + WORD wVersionRequested = MAKEWORD(2, 0); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + if (err != 0) { + snprintf(handle->err, sizeof(handle->err), "WSAStartup Error"); + return SCGI_FAIL; + } + +#endif + + handle->sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + + if (handle->sock == SCGI_SOCK_INVALID) { + snprintf(handle->err, sizeof(handle->err), "Socket Error"); + return SCGI_FAIL; + } + + + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + + if (getaddrinfo(host, NULL, &hints, &result)) { + strncpy(handle->err, "Cannot resolve host", sizeof(handle->err)); + goto fail; + } + + memcpy(&handle->sockaddr, result->ai_addr, sizeof(handle->sockaddr)); + handle->sockaddr.sin_family = AF_INET; + handle->sockaddr.sin_port = htons(port); + freeaddrinfo(result); + + if (timeout) { +#ifdef WIN32 + u_long arg = 1; + if (ioctlsocket(handle->sock, FIONBIO, &arg) == SOCKET_ERROR) { + snprintf(handle->err, sizeof(handle->err), "Socket Connection Error"); + goto fail; + } +#else + fd_flags = fcntl(handle->sock, F_GETFL, 0); + if (fcntl(handle->sock, F_SETFL, fd_flags | O_NONBLOCK)) { + snprintf(handle->err, sizeof(handle->err), "Socket Connection Error"); + goto fail; + } +#endif + } + + rval = connect(handle->sock, (struct sockaddr*)&handle->sockaddr, sizeof(handle->sockaddr)); + + if (timeout) { + int r; + + + r = scgi_wait_sock(handle->sock, timeout, SCGI_POLL_WRITE); + + if (r <= 0) { + snprintf(handle->err, sizeof(handle->err), "Connection timed out"); + goto fail; + } + + if (!(r & SCGI_POLL_WRITE)) { + snprintf(handle->err, sizeof(handle->err), "Connection timed out"); + goto fail; + } + +#ifdef WIN32 + { + u_long arg = 0; + if (ioctlsocket(handle->sock, FIONBIO, &arg) == SOCKET_ERROR) { + snprintf(handle->err, sizeof(handle->err), "Socket Connection Error"); + goto fail; + } + } +#else + fcntl(handle->sock, F_SETFL, fd_flags); +#endif + rval = 0; + } + + result = NULL; + + if (rval) { + snprintf(handle->err, sizeof(handle->err), "Socket Connection Error"); + goto fail; + } + + sock_setup(handle); + + handle->connected = 1; + + + return SCGI_SUCCESS; + + fail: + + handle->connected = 0; + scgi_disconnect(handle); + + return SCGI_FAIL; +} + + + +SCGI_DECLARE(scgi_status_t) scgi_disconnect(scgi_handle_t *handle) +{ + scgi_status_t status = SCGI_FAIL; + + if (handle->destroyed) { + return SCGI_FAIL; + } + + if (handle->sock != SCGI_SOCK_INVALID) { + closesocket(handle->sock); + handle->sock = SCGI_SOCK_INVALID; + status = SCGI_SUCCESS; + } + + handle->destroyed = 1; + handle->connected = 0; + + scgi_destroy_params(handle); + scgi_safe_free(handle->body); + + return status; +} + + +/* USE WSAPoll on vista or higher */ +#ifdef SCGI_USE_WSAPOLL +SCGI_DECLARE(int) scgi_wait_sock(scgi_socket_t sock, uint32_t ms, scgi_poll_t flags) +{ +} +#endif + + +#ifdef SCGI_USE_SELECT +#ifdef WIN32 +#pragma warning( push ) +#pragma warning( disable : 6262 ) /* warning C6262: Function uses '98348' bytes of stack: exceeds /analyze:stacksize'16384'. Consider moving some data to heap */ +#endif +SCGI_DECLARE(int) scgi_wait_sock(scgi_socket_t sock, uint32_t ms, scgi_poll_t flags) +{ + int s = 0, r = 0; + fd_set rfds; + fd_set wfds; + fd_set efds; + struct timeval tv; + + FD_ZERO(&rfds); + FD_ZERO(&wfds); + FD_ZERO(&efds); + +#ifndef WIN32 + /* Wouldn't you rather know?? */ + assert(sock <= FD_SETSIZE); +#endif + + if ((flags & SCGI_POLL_READ)) { + +#ifdef WIN32 +#pragma warning( push ) +#pragma warning( disable : 4127 ) + FD_SET(sock, &rfds); +#pragma warning( pop ) +#else + FD_SET(sock, &rfds); +#endif + } + + if ((flags & SCGI_POLL_WRITE)) { + +#ifdef WIN32 +#pragma warning( push ) +#pragma warning( disable : 4127 ) + FD_SET(sock, &wfds); +#pragma warning( pop ) +#else + FD_SET(sock, &wfds); +#endif + } + + if ((flags & SCGI_POLL_ERROR)) { + +#ifdef WIN32 +#pragma warning( push ) +#pragma warning( disable : 4127 ) + FD_SET(sock, &efds); +#pragma warning( pop ) +#else + FD_SET(sock, &efds); +#endif + } + + tv.tv_sec = ms / 1000; + tv.tv_usec = (ms % 1000) * ms; + + s = select(sock + 1, (flags & SCGI_POLL_READ) ? &rfds : NULL, (flags & SCGI_POLL_WRITE) ? &wfds : NULL, (flags & SCGI_POLL_ERROR) ? &efds : NULL, &tv); + + if (s < 0) { + r = s; + } else if (s > 0) { + if ((flags & SCGI_POLL_READ) && FD_ISSET(sock, &rfds)) { + r |= SCGI_POLL_READ; + } + + if ((flags & SCGI_POLL_WRITE) && FD_ISSET(sock, &wfds)) { + r |= SCGI_POLL_WRITE; + } + + if ((flags & SCGI_POLL_ERROR) && FD_ISSET(sock, &efds)) { + r |= SCGI_POLL_ERROR; + } + } + + return r; + +} +#ifdef WIN32 +#pragma warning( pop ) +#endif +#endif + +#ifdef SCGI_USE_POLL +SCGI_DECLARE(int) scgi_wait_sock(scgi_socket_t sock, uint32_t ms, scgi_poll_t flags) +{ + struct pollfd pfds[2] = { { 0 } }; + int s = 0, r = 0; + + pfds[0].fd = sock; + + if ((flags & SCGI_POLL_READ)) { + pfds[0].events |= POLLIN; + } + + if ((flags & SCGI_POLL_WRITE)) { + pfds[0].events |= POLLOUT; + } + + if ((flags & SCGI_POLL_ERROR)) { + pfds[0].events |= POLLERR; + } + + s = poll(pfds, 1, ms); + + if (s < 0) { + r = s; + } else if (s > 0) { + if ((pfds[0].revents & POLLIN)) { + r |= SCGI_POLL_READ; + } + if ((pfds[0].revents & POLLOUT)) { + r |= SCGI_POLL_WRITE; + } + if ((pfds[0].revents & POLLERR)) { + r |= SCGI_POLL_ERROR; + } + } + + return r; + +} +#endif + +static int scgi_socket_reuseaddr(scgi_socket_t socket) +{ +#ifdef WIN32 + BOOL reuse_addr = TRUE; + return setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse_addr, sizeof(reuse_addr)); +#else + int reuse_addr = 1; + return setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, &reuse_addr, sizeof(reuse_addr)); +#endif +} + +SCGI_DECLARE(scgi_status_t) scgi_bind(const char *host, scgi_port_t port, scgi_socket_t *socketp) +{ + scgi_socket_t server_sock = SCGI_SOCK_INVALID; + struct sockaddr_in addr; + scgi_status_t status = SCGI_SUCCESS; + + if ((server_sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { + return SCGI_FAIL; + } + + scgi_socket_reuseaddr(server_sock); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_ANY); + addr.sin_port = htons(port); + + if (bind(server_sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + status = SCGI_FAIL; + goto end; + } + + if (listen(server_sock, 10000) < 0) { + status = SCGI_FAIL; + goto end; + } + + end: + + if (status == SCGI_FAIL) { + if (server_sock != SCGI_SOCK_INVALID) { + closesocket(server_sock); + server_sock = SCGI_SOCK_INVALID; + } + } else { + *socketp = server_sock; + } + + return status; +} + +SCGI_DECLARE(scgi_status_t) scgi_accept(scgi_socket_t server_sock, scgi_socket_t *client_sock_p, struct sockaddr_in *echoClntAddr) +{ + scgi_status_t status = SCGI_SUCCESS; + int client_sock; + struct sockaddr_in local_echoClntAddr; +#ifdef WIN32 + int clntLen; +#else + unsigned int clntLen; +#endif + + if (!echoClntAddr) { + echoClntAddr = &local_echoClntAddr; + } + + clntLen = sizeof(*echoClntAddr); + + if ((client_sock = accept(server_sock, (struct sockaddr *) echoClntAddr, &clntLen)) == SCGI_SOCK_INVALID) { + printf("FRICK %s\n", strerror(errno)); + status = SCGI_FAIL; + } else { + *client_sock_p = client_sock; + } + + return status; +} + +SCGI_DECLARE(scgi_status_t) scgi_listen(const char *host, scgi_port_t port, scgi_listen_callback_t callback) +{ + + scgi_socket_t server_sock = SCGI_SOCK_INVALID, client_sock = SCGI_SOCK_INVALID; + scgi_status_t status = SCGI_FAIL; + struct sockaddr_in echoClntAddr; + + if ((status = scgi_bind(host, port, &server_sock)) == SCGI_SUCCESS) { + + while(scgi_accept(server_sock, &client_sock, &echoClntAddr) == SCGI_SUCCESS) { + callback(server_sock, &client_sock, &echoClntAddr); + + if (client_sock != SCGI_SOCK_INVALID) { + closesocket(client_sock); + client_sock = SCGI_SOCK_INVALID; + } + } + } + + return status; + +} + +#define next_str(_e, _s) _s = _e; while(*_s) _s++; _s++ + +SCGI_DECLARE(scgi_status_t) scgi_parse(scgi_socket_t sock, scgi_handle_t *handle) +{ + char sbuf[128] = ""; + char *p = sbuf, *e, *end; + ssize_t r = 0; + scgi_status_t status = SCGI_FAIL; + ssize_t bytes = 0; + char *headers = NULL; + int loops = 0; + ssize_t clen = 0; + char *body = NULL; + char comma = 0; + + memset(handle, 0, sizeof(*handle)); + + handle->sock = sock; + + handle->connected = 1; + sock_setup(handle); + + for(;;) { + + if ((r = recv(sock, p, 1, 0)) < 1) { + break; + } + + if (*p == ':') { + *p = '\0'; + break; + } + p++; + } + + if (r <= 0) goto end; + + bytes = atoi(sbuf); + + if (bytes <= 0) goto end; + + headers = malloc(bytes); + r = recv(sock, headers, bytes, 0); + if (r <= 0) goto end; + + r = recv(sock, &comma, 1, 0); + if (r <= 0 || comma != ',') goto end; + + + p = headers; + end = p + bytes; + e = NULL; + + while(p < end) { + next_str(p, e); + + if (!e) break; + + if (!loops++) { + if (!strcasecmp(p, "CONTENT_LENGTH") && e) { + clen = atoi(e); + if (clen) { + body = malloc(clen+1); + r = recv(sock, body, clen, 0); + *(body + clen) = '\0'; + if (r <= 0) goto end; + scgi_add_body(handle, body); + scgi_safe_free(body); + } + + status = SCGI_SUCCESS; + + } else { + goto end; + } + } + + scgi_add_param(handle, p, e); + next_str(e, p); + } + + end: + + scgi_safe_free(headers); + + return status; +} + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/libs/libscgi/src/scgi_oop.cpp b/libs/libscgi/src/scgi_oop.cpp new file mode 100644 index 0000000000..4001b748a3 --- /dev/null +++ b/libs/libscgi/src/scgi_oop.cpp @@ -0,0 +1,127 @@ +#include +#include + +#define connection_construct_common() memset(&handle, 0, sizeof(handle)) + + + +SCGIhandle::SCGIhandle(void) +{ + connection_construct_common(); +} + +SCGIhandle::~SCGIhandle() +{ + + scgi_disconnect(&handle); + scgi_safe_free(data_buf); + buflen = 0; + bufsize = 0; + +} + +int SCGIhandle::socketDescriptor() +{ + if (handle.connected) { + return (int) handle.sock; + } + + return -1; +} + + +int SCGIhandle::disconnect() +{ + return scgi_disconnect(&handle); +} + +int SCGIhandle::connected() +{ + return handle.connected; +} + +int SCGIhandle::addParam(const char *name, const char *value) +{ + return (int) scgi_add_param(&handle, name, value); +} + +int SCGIhandle::addBody(const char *value) +{ + return (int) scgi_add_body(&handle, value); +} + +char *SCGIhandle::getBody() +{ + return handle.body; +} + +char *SCGIhandle::getParam(const char *name) +{ + return (char *) scgi_get_param(&handle, name); +} + +char *SCGIhandle::sendRequest(const char *host, int port, int timeout) +{ + ssize_t len; + + if (!host) { + return 0; + } + + if (timeout < 1000) { + timeout = 1000; + } + + if (scgi_connect(&handle, host, port, timeout) == SCGI_SUCCESS) { + if (scgi_send_request(&handle) == SCGI_SUCCESS) { + while((len = scgi_recv(&handle, buf, sizeof(buf))) > 0) { + if (buflen + len > bufsize) { + bufsize = buflen + len + 1024; + void *tmp = realloc(data_buf, bufsize); + assert(tmp); + data_buf = (char *)tmp; + + *(data_buf+buflen) = '\0'; + } + snprintf(data_buf+buflen, bufsize-buflen, "%s", buf); + buflen += len; + } + + return data_buf; + } + } + + return (char *) ""; +} + +int SCGIhandle::bind(const char *host, int port) +{ + return (scgi_bind(host, port, &server_sock) == SCGI_SUCCESS) ? 1 : 0; +} + + +int SCGIhandle::accept(void) +{ + scgi_socket_t client_sock; + + if (scgi_accept(server_sock, &client_sock, NULL) == SCGI_SUCCESS) { + if (scgi_parse(client_sock, &handle) == SCGI_SUCCESS) { + return 1; + } + + closesocket(client_sock); + } + + return 0; +} + + +int SCGIhandle::respond(char *msg) +{ + int b = write(handle.sock, msg, strlen(msg)); + scgi_disconnect(&handle); + scgi_safe_free(data_buf); + buflen = 0; + bufsize = 0; + return b; +} diff --git a/libs/libscgi/testclient.c b/libs/libscgi/testclient.c new file mode 100644 index 0000000000..9b9078691c --- /dev/null +++ b/libs/libscgi/testclient.c @@ -0,0 +1,40 @@ +#include + + +int main(int argc, char *argv[]) +{ + char buf[16336] = ""; + ssize_t len; + scgi_handle_t handle = { 0 }; + char *ip; + int port = 0; + + if (argc < 2) { + fprintf(stderr, "usage: testclient \n"); + exit(-1); + } + + ip = argv[1]; + port = atoi(argv[2]); + + + + scgi_add_param(&handle, "REQUEST_METHOD", "POST"); + scgi_add_param(&handle, "REQUEST_URI", "/deepthought"); + scgi_add_param(&handle, "TESTING", "TRUE"); + scgi_add_param(&handle, "TESTING", "TRUE"); + scgi_add_body(&handle, "What is the answer to life?"); + + + scgi_connect(&handle, ip, port, 10000); + + scgi_send_request(&handle); + + + while((len = scgi_recv(&handle, buf, sizeof(buf))) > 0) { + printf("READ [%s]\n", buf); + } + + scgi_disconnect(&handle); + +} diff --git a/libs/libscgi/testserver.c b/libs/libscgi/testserver.c new file mode 100644 index 0000000000..153a215c0e --- /dev/null +++ b/libs/libscgi/testserver.c @@ -0,0 +1,43 @@ +#include + +static void callback(scgi_socket_t server_sock, scgi_socket_t *client_sock, struct sockaddr_in *addr) +{ + scgi_handle_t handle = { 0 }; + + if (scgi_parse(*client_sock, &handle) == SCGI_SUCCESS) { + scgi_param_t *pp; + + *client_sock = SCGI_SOCK_INVALID; + + for(pp = handle.params; pp; pp = pp->next) { + printf("HEADER: [%s] VALUE: [%s]\n", pp->name, pp->value); + } + + if (handle.body) { + printf("\n\nBODY:\n%s\n\n", handle.body); + } + + scgi_disconnect(&handle); + } + +} + +int main(int argc, char *argv[]) +{ + char *ip; + int port = 0; + + if (argc < 2) { + fprintf(stderr, "usage: testserver \n"); + exit(-1); + } + + ip = argv[1]; + port = atoi(argv[2]); + + + scgi_listen(ip, port, callback); + + + +} diff --git a/libs/libsndfile/.update b/libs/libsndfile/.update index f195187f18..31cb06ca73 100644 --- a/libs/libsndfile/.update +++ b/libs/libsndfile/.update @@ -1 +1 @@ -Thu May 21 16:11:03 CDT 2009 +Mon Apr 16 11:52:47 CDT 2012 diff --git a/libs/libsndfile/src/ima_adpcm.c b/libs/libsndfile/src/ima_adpcm.c index a9bd6ef521..e3ab38d752 100644 --- a/libs/libsndfile/src/ima_adpcm.c +++ b/libs/libsndfile/src/ima_adpcm.c @@ -724,7 +724,9 @@ ima_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) if (offset == 0) { psf_fseek (psf, psf->dataoffset, SEEK_SET) ; pima->blockcount = 0 ; - pima->decode_block (psf, pima) ; + if (pima->decode_block) { + pima->decode_block (psf, pima) ; + } pima->samplecount = 0 ; return 0 ; } ; diff --git a/libs/libteletone/src/libteletone.h b/libs/libteletone/src/libteletone.h index 61078b4984..026f10141b 100644 --- a/libs/libteletone/src/libteletone.h +++ b/libs/libteletone/src/libteletone.h @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libteletone/src/libteletone_detect.c b/libs/libteletone/src/libteletone_detect.c index 0d0fd27eec..2006fcaa27 100644 --- a/libs/libteletone/src/libteletone_detect.c +++ b/libs/libteletone/src/libteletone_detect.c @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libteletone/src/libteletone_detect.h b/libs/libteletone/src/libteletone_detect.h index 4da368969c..b4b70fcd92 100644 --- a/libs/libteletone/src/libteletone_detect.h +++ b/libs/libteletone/src/libteletone_detect.h @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libteletone/src/libteletone_generate.c b/libs/libteletone/src/libteletone_generate.c index 7448508944..3e263af7ee 100644 --- a/libs/libteletone/src/libteletone_generate.c +++ b/libs/libteletone/src/libteletone_generate.c @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libteletone/src/libteletone_generate.h b/libs/libteletone/src/libteletone_generate.h index 0ff39e0dfa..a49e45a658 100644 --- a/libs/libteletone/src/libteletone_generate.h +++ b/libs/libteletone/src/libteletone_generate.h @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/libs/libzrtp/.gitignore b/libs/libzrtp/.gitignore new file mode 100644 index 0000000000..4bb1123214 --- /dev/null +++ b/libs/libzrtp/.gitignore @@ -0,0 +1,2 @@ +# -*- mode:conf -*- +/include/zrtp_config_unix.h diff --git a/libs/libzrtp/projects/gnu/.gitignore b/libs/libzrtp/projects/gnu/.gitignore new file mode 100644 index 0000000000..0920c730f6 --- /dev/null +++ b/libs/libzrtp/projects/gnu/.gitignore @@ -0,0 +1,10 @@ +# -*- mode:conf -*- +/Makefile +/Makefile.in +/_configs.sed +/build/Makefile +/build/Makefile.in +/build/test/Makefile +/build/test/Makefile.in +/config/config.h +/config/stamp-h1 diff --git a/libs/libzrtp/projects/gnu/acinclude.m4 b/libs/libzrtp/projects/gnu/acinclude.m4 new file mode 100644 index 0000000000..f5879955c2 --- /dev/null +++ b/libs/libzrtp/projects/gnu/acinclude.m4 @@ -0,0 +1,94 @@ +AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl +AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl +AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl +AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl +AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl +AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl +AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl +AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl +AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl +m4_pushdef([_script],[conftest.prefix])dnl +m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl +_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)` +_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"` +_PKG=`echo ifelse($2, , $PACKAGE, $2)` +_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"` +_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"` +_INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'` +if test ".$_INP" = "."; then + for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue + case "$ac_file" in + *.h) _INP=$ac_file ;; + *) + esac + test ".$_INP" != "." && break + done +fi +if test ".$_INP" = "."; then + case "$_OUT" in + */*) _INP=`basename "$_OUT"` + ;; + *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"` + ;; + *) _INP=config.h + ;; + esac +fi +if test -z "$_PKG" ; then + AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) +else + if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then + _INP="$srcdir/$_INP" + fi fi + AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines) + if test -f $_INP ; then + echo "s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script + echo "s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script + echo "s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script + echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script + echo "@%:@endif/" >>_script + echo "s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script + echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script + echo "@%:@endif/" >> _script + # now executing _script on _DEF input to create _OUT output file + echo "@%:@ifndef $_DEF" >$tmp/pconfig.h + echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h + echo ' ' >>$tmp/pconfig.h + echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h + + sed -f _script $_INP >>$tmp/pconfig.h + echo ' ' >>$tmp/pconfig.h + echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h + echo "@%:@endif" >>$tmp/pconfig.h + if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then + AC_MSG_NOTICE([$_OUT is unchanged]) + else + ac_dir=`AS_DIRNAME(["$_OUT"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f "$_OUT" + mv $tmp/pconfig.h "$_OUT" + fi + cp _script _configs.sed + else + AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT]) + fi + rm -f conftest.* +fi +m4_popdef([_symbol])dnl +m4_popdef([_script])dnl +AS_VAR_POPDEF([_INP])dnl +AS_VAR_POPDEF([_UPP])dnl +AS_VAR_POPDEF([_LOW])dnl +AS_VAR_POPDEF([_PKG])dnl +AS_VAR_POPDEF([_DEF])dnl +AS_VAR_POPDEF([_OUT])dnl +],[PACKAGE="$PACKAGE"])]) + +dnl implementation note: a bug report (31.5.2005) from Marten Svantesson points +dnl out a problem where `echo "\1"` results in a Control-A. The unix standard +dnl http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html +dnl defines all backslash-sequences to be inherently non-portable asking +dnl for replacement mit printf. Some old systems had problems with that +dnl one either. However, the latest libtool (!) release does export an $ECHO +dnl (and $echo) that does the right thing - just one question is left: what +dnl was the first version to have it? Is it greater 2.58 ? diff --git a/libs/libzrtp/projects/gnu/autoreconf.sh b/libs/libzrtp/projects/gnu/autoreconf.sh deleted file mode 100755 index fb8e583f63..0000000000 --- a/libs/libzrtp/projects/gnu/autoreconf.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -aclocal -I ./config/ -autoheader -autoconf -automake diff --git a/libs/libzrtp/projects/gnu/bootstrap.sh b/libs/libzrtp/projects/gnu/bootstrap.sh new file mode 100755 index 0000000000..df9bb21e30 --- /dev/null +++ b/libs/libzrtp/projects/gnu/bootstrap.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +reconf () { + aclocal + mkdir -p config + libtoolize --copy --automake + autoconf + autoheader + automake --no-force --add-missing --copy +} + +(cd ../../third_party/bnlib && reconf) +reconf + diff --git a/libs/libzrtp/projects/gnu/cfg b/libs/libzrtp/projects/gnu/cfg deleted file mode 100755 index 8f19122fb7..0000000000 --- a/libs/libzrtp/projects/gnu/cfg +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -./configure --enable-enterprise \ No newline at end of file diff --git a/libs/libzrtp/projects/win/libzrtp.2010.vcxproj b/libs/libzrtp/projects/win/libzrtp.2010.vcxproj new file mode 100644 index 0000000000..3306611920 --- /dev/null +++ b/libs/libzrtp/projects/win/libzrtp.2010.vcxproj @@ -0,0 +1,250 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {C13CC324-0032-4492-9A30-310A6BD64FF5} + libzrtp.x32 + Win32Proj + libzrtp + + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ../../include;../../third_party/bnlib;../../third_party/bgaes;../../test/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Default + + + Level3 + ProgramDatabase + CompileAsC + + + + if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" + + + + + Disabled + ../../include;../../third_party/bnlib;../../third_party/bgaes;../../test/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Default + + + Level3 + ProgramDatabase + CompileAsC + + + + if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" + + + + + ../../include;../../third_party/bnlib;../../third_party/bgaes;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions) + + + MultiThreadedDLL + Default + false + + + Level3 + ProgramDatabase + CompileAsC + + + + if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" + + + + + ../../include;../../third_party/bnlib;../../third_party/bgaes;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions) + + + MultiThreadedDLL + Default + false + + + Level3 + ProgramDatabase + CompileAsC + + + + if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/libzrtp/projects/win/libzrtp.2010.vcxproj.filters b/libs/libzrtp/projects/win/libzrtp.2010.vcxproj.filters new file mode 100644 index 0000000000..4bae11a1dd --- /dev/null +++ b/libs/libzrtp/projects/win/libzrtp.2010.vcxproj.filters @@ -0,0 +1,256 @@ + + + + + {c0e76076-0032-445d-8c07-32b6c762622b} + + + {a03c0d83-0032-4848-9704-22cdce5ab144} + + + {dbe8a34e-0032-495e-8df7-e82218921e60} + + + {96d1a5c9-0032-4230-a764-a0ed11f434a7} + + + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bgaes + + + bgaes + + + bgaes + + + bgaes + + + bgaes + + + bgaes + + + bgaes + + + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bnlib + + + bgaes + + + bgaes + + + bgaes + + + bgaes + + + bgaes + + + bgaes + + + + + + + \ No newline at end of file diff --git a/libs/libzrtp/src/zrtp_iface_cache.c b/libs/libzrtp/src/zrtp_iface_cache.c index ae1b454666..970d97e869 100644 --- a/libs/libzrtp/src/zrtp_iface_cache.c +++ b/libs/libzrtp/src/zrtp_iface_cache.c @@ -1,6 +1,6 @@ /* * libZRTP SDK library, implements the ZRTP secure VoIP protocol. - * Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved. + * Copyright (c) 2006-2012 Philip R. Zimmermann. All rights reserved. * Contact: http://philzimmermann.com * For licensing and other legal details, see the file zrtp_legal.c. * diff --git a/libs/libzrtp/src/zrtp_pbx.c b/libs/libzrtp/src/zrtp_pbx.c index f4f5a906c4..3567d4a47b 100644 --- a/libs/libzrtp/src/zrtp_pbx.c +++ b/libs/libzrtp/src/zrtp_pbx.c @@ -356,8 +356,8 @@ zrtp_status_t zrtp_register_with_trusted_mitm(zrtp_stream_t* stream) /* Passive Client endpoint should NOT generate PBX Secret. */ if ((stream->mitm_mode == ZRTP_MITM_MODE_REG_CLIENT) && - (ZRTP_LICENSE_MODE_PASSIVE != stream->zrtp->lic_mode)) { - ZRTP_LOG(2,(_ZTU_,"WARNING: Passive Client endpoint should NOT generate PBX Secert.\n")); + (ZRTP_LICENSE_MODE_PASSIVE == stream->zrtp->lic_mode)) { + ZRTP_LOG(2,(_ZTU_,"WARNING: Passive Client endpoint should NOT generate PBX Secret.\n")); return zrtp_status_bad_param; } diff --git a/libs/libzrtp/third_party/bnlib/.gitignore b/libs/libzrtp/third_party/bnlib/.gitignore new file mode 100644 index 0000000000..93a51e214c --- /dev/null +++ b/libs/libzrtp/third_party/bnlib/.gitignore @@ -0,0 +1,3 @@ +# -*- mode:conf -*- +/Makefile +/bnconfig.h diff --git a/libs/libzrtp/third_party/bnlib/Makefile b/libs/libzrtp/third_party/bnlib/Makefile deleted file mode 100644 index 9d0890ce82..0000000000 --- a/libs/libzrtp/third_party/bnlib/Makefile +++ /dev/null @@ -1,182 +0,0 @@ -# -# This code is pretty well tested, but not optimizing it will have -# a *major* effect on speed, so its optimzation flags are separate -# from the rest of the release. -# -# For the SPARC v8, at least, gcc produces a *much* faster library than -# the SunPro C compiler. On a 50 MHz TI TMS390Z50 SuperSPARC: -# 14.5 vs. 47.2 ms per 256-bit modular exponentiation. -# 77.4 vs. 317.8 ms per 512-bit modular exponentiation. -# 249.0 vs. 1031.5 ms per 1024-bit modular exponentiation -# -CC=gcc -# for libzrtp support -CFLAGS= -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1 -DHAVE_CONFIG_H $(DEFINE) -I../../include -I../../include/enterprise -I../../projects/gnu/config -I../../third_party/bgaes -srcdir=. - - -# Extra object files (e.g. lbnalpha.o for Alpha assembly routines) -AUXOBJS= -# Extra definitions (e.g. -DBNINCLUDE=lbnalpha.h) -DEFINE= - -SHELL = /bin/sh -.SUFFIXES: -.SUFFIXES: .c .h .o .s - -LD =$(CC) -LDFLAGS = -LIBS= -RANLIB=ranlib - -# If you have a machine-specific assembly file, add it to AUXOBJS. -OBJS = bn00.o lbn00.o bn.o lbnmem.o sieve.o prime.o \ - bnprint.o jacobi.o germain.o $(AUXOBJS) - -BNLIB = libbn.a - -# for libzrtp support -all: $(BNLIB) bntest32.c bntest64.c -# bntest germtest - -# for libzrtp support -install: all - test -d /usr/local/include/libzrtp || mkdir /usr/local/include/libzrtp - cp *.h /usr/local/include/libzrtp - cp 'libbn.a' '/usr/local/lib/libbn.a' - chmod 644 /usr/local/lib/libbn.a - chown 0:0 /usr/local/lib/libbn.a - $(RANLIB) '/usr/local/lib/libbn.a' - -# for libzrtp support -#check: bntest -# ./bntest -check: - -bntest: bntest00.o $(BNLIB) - $(LD) $(LDFLAGS) -o $@ bntest00.o $(BNLIB) $(LIBS) - -germtest: germtest.o $(BNLIB) - $(LD) $(LDFLAGS) -o $@ germtest.o $(BNLIB) $(LIBS) - -$(BNLIB): $(OBJS) - $(AR) r $@ $? - $(RANLIB) $@ - -# Here we get tricky... if we're compiling with GCC, then GCCMAGIC1 and -# GCCMAGIC2 are set so that we actually do a link, but with the -r flag -# (produce relocatable output) and with -lgcc *only*. This is so that -# the result can be linked cleanly with code compiled with another cc, -# which doesn't know about -lgcc. Presumably the lbnXX.o file, which -# has by far the most math in it, will have a call to every interesting -# support-library function. - -lbn00.o: $(srcdir)/lbn00.c $(HDRS) bnconfig.h - $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -Wl,-r -nostdlib lbn00.c -lgcc - -lbn16.o: $(srcdir)/lbn16.c $(HDRS) bnconfig.h - $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -Wl,-r -nostdlib lbn16.c -lgcc - -lbn32.o: $(srcdir)/lbn32.c $(HDRS) bnconfig.h - $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -Wl,-r -nostdlib lbn32.c -lgcc - -lbn64.o: $(srcdir)/lbn64.c $(HDRS) bnconfig.h - $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -Wl,-r -nostdlib lbn64.c -lgcc - -# The default .o rule. -.c.o: bnconfig.h - $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -c $< - -# Extra, non-obvious dependencies. Bnlib can be compiled in three -# word sizes, and the *00.c files #include the right .c files based -# on , which means that a single compilation will only use a -# subset of these files. Duplicated here in case someone regenerates -# dependencies with cc -M and they get lost. - -lbn00.o: lbn16.c lbn32.c lbn64.c lbn16.h lbn32.h lbn64.h -bn00.o: bn16.c bn32.c bn64.c bn16.h bn32.h bn64.h \ - bninit16.c bninit32.c bninit64.c -bntest00.o: bntest16.c bntest32.c bntest64.c lbn16.h lbn32.h lbn64.h - -# Actual build commented out to prevent confusion by people without autoconf. -# Do it manually for now. -configure: configure.in - @echo "configure script is out of date; run autoconf" -# autoconf - -clean: - $(RM) -f *.o *32.[ch] *64.[ch] - -distclean: clean - -rm -f Makefile - -BNSOURCES = lbn32.c lbn32.h bn32.c bn32.h bninit32.c bntest32.c \ - lbn64.c lbn64.h bn64.c bn64.h bninit64.c bntest64.c - -# An explicit target that can be made before distribution for -# machines that don't have sed. -bnsources: $(BNSOURCES) - -# The 16-bit versions of the code are the master versions; all else is -# generated from them. This fiddling about makes them unwriteable -# to discourage improper edits. - -# (You didn't know that suffixes for suffix rules didn't have to begin -# with a period, did you?) -.SUFFIXES: 16.c 16.h 32.c 32.h 64.c 64.h -16.c32.c: - @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@ - sed -e s/32/64/g -e s/16/32/g $< > $@ - @chmod a-w $@ - -16.h32.h: - @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@ - sed -e s/32/64/g -e s/16/32/g $< > $@ - @chmod a-w $@ - -16.c64.c: - @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@ - sed -e s/32/128/g -e s/16/64/g $< > $@ - @chmod a-w $@ - -16.h64.h: - @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@ - sed -e s/32/128/g -e s/16/64/g $< > $@ - @chmod a-w $@ - -### Dependencies -bn.o: bn.c bn.h -bn00.o: bn00.c bnsize00.h lbn.h bn16.c bn32.c bn64.c lbn16.c lbn32.h \ - lbn64.h lbnmem.h bn16.h bn32.h bn64.h bn.h kludge.h bninit16.c \ - bninit32.c bninit64.c -bn16.o: bn16.c lbn.h lbn16.h lbnmem.h bn16.h bn.h kludge.h -bn32.o: bn32.c lbn.h lbn32.h lbnmem.h bn32.h bn.h kludge.h -bn64.o: bn64.c lbn.h lbn64.h lbnmem.h bn64.h bn.h kludge.h -bn68000.o: bn68000.c lbn.h lbn68000.h bn16.h bn32.h -bn8086.o: bn8086.c lbn.h bn64.h lbn8086.h bn32.h -bninit16.o: bninit16.c bn.h bn16.h -bninit32.o: bninit32.c bn.h bn32.h -bninit64.o: bninit64.c bn.h bn64.h -bnprint.o: bnprint.c bn.h bnprint.h kludge.h -bntest00.o: bntest00.c bnsize00.h lbn.h bntest16.c bntest32.c \ - bntest64.c cputime.h lbn16.h lbn32.h lbn64.h kludge.h -bntest16.o: bntest16.c cputime.h lbn16.h lbn.h kludge.h -bntest32.o: bntest32.c cputime.h lbn32.h lbn.h kludge.h -bntest64.o: bntest64.c cputime.h lbn64.h lbn.h kludge.h -germain.o: germain.c bn.h germain.h jacobi.h lbnmem.h sieve.h kludge.h -germtest.o: germtest.c bn.h germain.h sieve.h cputime.h bnprint.h -jacobi.o: jacobi.c bn.h jacobi.h -lbn00.o: lbn00.c bnsize00.h lbn.h lbn16.c lbn16.h lbn32.c lbn32.h \ - lbn64.c lbn64.h lbnmem.h kludge.h -lbn16.o: lbn16.c lbn.h lbn16.h lbnmem.h kludge.h -lbn32.o: lbn32.c lbn.h lbn32.h lbnmem.h kludge.h -lbn64.o: lbn64.c lbn.h lbn64.h lbnmem.h kludge.h -lbn68000.o: lbn68000.c lbn.h lbn68000.h -lbn68020.o: lbn68020.c lbn.h lbn68020.h -lbnmem.o: lbnmem.c lbn.h lbnmem.h kludge.h -lbnppc.o: lbnppc.c lbnppc.h ppcasm.h -prime.o: prime.c bn.h lbnmem.h prime.h sieve.h kludge.h -sieve.o: sieve.c bn.h sieve.h kludge.h -sizetest.c: bnsize00.h - -distdir: diff --git a/libs/libzrtp/third_party/bnlib/bnconfig.win b/libs/libzrtp/third_party/bnlib/bnconfig.win new file mode 100644 index 0000000000..303a25b689 --- /dev/null +++ b/libs/libzrtp/third_party/bnlib/bnconfig.win @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1995 Colin Plumb. All rights reserved. + * For licensing and other legal details, see the file legal.c. + * + * bnconfig.h -- Configuration file for BigNum library. + * + * This file is automatically filled in by configure. + * Everything must start out turned *off*, because configure + * (or, more properly, config.status) only knows how to turn them + * *on*. + */ +#ifndef CONFIG_H +#define CONFIG_H + +/* Define to empty if the compiler does not support 'const' variables. */ +#undef const + +/* Define to `unsigned' if doesn't define it. */ +#undef size_t + +/* Checks for the presence and absence of various header files */ +#define HAVE_ASSERT_H 1 +#define NO_ASSERT_H !HAVE_ASSERT_H +#define HAVE_LIMITS_H 1 +#define NO_LIMITS_H !HAVE_LIMITS_H +#define HAVE_STDLIB_H 1 +#define NO_STDLIB_H !HAVE_STDLIB_H +#define HAVE_STRING_H 1 +#define NO_STRING_H !HAVE_STRING_H + +#define HAVE_STRINGS_H 0 +#define NEED_MEMORY_H 0 + +/* We go to some trouble to find accurate times... */ + +/* Define if you have Posix.4 glock_gettime() */ +#define HAVE_CLOCK_GETTIME 0 +/* Define if you have Solaris-style gethrvtime() */ +#define HAVE_GETHRVTIME 0 +/* Define if you have getrusage() */ +#define HAVE_GETRUSAGE 0 +/* Define if you have clock() */ +#define HAVE_CLOCK 0 +/* Define if you have time() */ +#define HAVE_TIME 0 + +/* + * Define as 0 if #including automatically + * #includes , and doing so explicitly causes an + * error. + */ +#define TIME_WITH_SYS_TIME 0 + +/* Defines for various kinds of library brokenness */ + +/* Define if is missing prototypes (= lots of warnings!) */ +#define NO_STDIO_PROTOS 0 + +/* Define if depends on and breaks without it */ +#define ASSERT_NEEDS_STDIO 0 +/* Define if depends on and complains without it */ +#define ASSERT_NEEDS_STDLIB 0 + +/* + * Define if delcares the mem* functions to take char * + * instead of void * parameters (= lots of warnings) + */ +#define MEM_PROTOS_BROKEN 0 + +/* If not available, bcopy() is substituted */ +#define HAVE_MEMMOVE 1 +#define NO_MEMMOVE !HAVE_MEMMOVE +#define HAVE_MEMCPY 1 +#define NO_MEMCPY !HAVE_MEMCPY + +#endif /* CONFIG_H */ diff --git a/libs/libzrtp/third_party/bnlib/lbn.h b/libs/libzrtp/third_party/bnlib/lbn.h index b0fd21cfb5..43fc7c91dc 100644 --- a/libs/libzrtp/third_party/bnlib/lbn.h +++ b/libs/libzrtp/third_party/bnlib/lbn.h @@ -145,6 +145,12 @@ typedef unsigned long long bnword64; #define BNWORD64 bnword64 #endif +/*Workaround for windows for now. */ +#ifdef WIN32 +typedef unsigned long long bnword64; +#define BNWORD64 bnword64 +#endif + /* We don't even try to find a 128-bit type at the moment */ #endif /* !LBN_H */ diff --git a/libs/openzap/Makefile.am b/libs/openzap/Makefile.am index e8c9fbf3db..52af5e3082 100644 --- a/libs/openzap/Makefile.am +++ b/libs/openzap/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2007, Anthony Minessale II +# Copyright (c) 2007-2012, Anthony Minessale II # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/mod_openzap/mod_openzap.c b/libs/openzap/mod_openzap/mod_openzap.c index ef346b8eea..e67d71e15e 100644 --- a/libs/openzap/mod_openzap/mod_openzap.c +++ b/libs/openzap/mod_openzap/mod_openzap.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -297,7 +297,7 @@ static void cycle_foreground(zap_channel_t *zchan, int flash, const char *bcast) const char *buuid; tech_pvt = switch_core_session_get_private(session); channel = switch_core_session_get_channel(session); - buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + buuid = switch_channel_get_partner_uuid(channel); if (zchan->token_count == 1 && flash) { @@ -1663,19 +1663,19 @@ static ZIO_SIGNAL_CB_FUNCTION(on_fxs_signal) if ((session_a = switch_core_session_locate(sigmsg->channel->tokens[0]))) { channel_a = switch_core_session_get_channel(session_a); - br_a_uuid = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE); + br_a_uuid = switch_channel_get_partner_uuid(channel_a); tech_pvt = switch_core_session_get_private(session_a); - stop_hold(session_a, switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE)); + stop_hold(session_a, switch_channel_get_partner_uuid(channel_a)); switch_clear_flag_locked(tech_pvt, TFLAG_HOLD); } if ((session_b = switch_core_session_locate(sigmsg->channel->tokens[1]))) { channel_b = switch_core_session_get_channel(session_b); - br_b_uuid = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE); + br_b_uuid = switch_channel_get_partner_uuid(channel_b); tech_pvt = switch_core_session_get_private(session_b); - stop_hold(session_a, switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE)); + stop_hold(session_a, switch_channel_get_partner_uuid(channel_b)); switch_clear_flag_locked(tech_pvt, TFLAG_HOLD); } @@ -1738,7 +1738,7 @@ static ZIO_SIGNAL_CB_FUNCTION(on_fxs_signal) tech_pvt = switch_core_session_get_private(session); channel = switch_core_session_get_channel(session); - buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + buuid = switch_channel_get_partner_uuid(channel); zap_set_state_locked(sigmsg->channel, ZAP_CHANNEL_STATE_UP); stop_hold(session, buuid); switch_clear_flag_locked(tech_pvt, TFLAG_HOLD); diff --git a/libs/openzap/src/include/libteletone.h b/libs/openzap/src/include/libteletone.h index b54098c8ee..4fb3d9975d 100644 --- a/libs/openzap/src/include/libteletone.h +++ b/libs/openzap/src/include/libteletone.h @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -37,7 +37,7 @@ * source code outside the scope of the openzap library will nullify the * following license and reinact the MPL 1.1 as stated above. * - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2005-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/include/libteletone_detect.h b/libs/openzap/src/include/libteletone_detect.h index c8c667d282..173f2b563b 100644 --- a/libs/openzap/src/include/libteletone_detect.h +++ b/libs/openzap/src/include/libteletone_detect.h @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * libteletone_detect.c Tone Detection Code * diff --git a/libs/openzap/src/include/libteletone_generate.h b/libs/openzap/src/include/libteletone_generate.h index 1b774206ff..212dbbb19b 100644 --- a/libs/openzap/src/include/libteletone_generate.h +++ b/libs/openzap/src/include/libteletone_generate.h @@ -1,8 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II - * - * Copyright (c) 2007, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/include/openzap.h b/libs/openzap/src/include/openzap.h index 32cce92c69..ab33b00bf4 100644 --- a/libs/openzap/src/include/openzap.h +++ b/libs/openzap/src/include/openzap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/include/zap_buffer.h b/libs/openzap/src/include/zap_buffer.h index 9a05420979..ed23ce4dd7 100644 --- a/libs/openzap/src/include/zap_buffer.h +++ b/libs/openzap/src/include/zap_buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/include/zap_config.h b/libs/openzap/src/include/zap_config.h index f2f2e374bf..6345750821 100644 --- a/libs/openzap/src/include/zap_config.h +++ b/libs/openzap/src/include/zap_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/include/zap_types.h b/libs/openzap/src/include/zap_types.h index 165533ff22..0b65ea865a 100644 --- a/libs/openzap/src/include/zap_types.h +++ b/libs/openzap/src/include/zap_types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/libteletone_detect.c b/libs/openzap/src/libteletone_detect.c index 0436c25953..758142f53e 100644 --- a/libs/openzap/src/libteletone_detect.c +++ b/libs/openzap/src/libteletone_detect.c @@ -1,6 +1,6 @@ /* * libteletone - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Much less efficient expansion interface was added to allow for the detection of * a single arbitrary tone combination which may also exceed 2 simultaneous tones. @@ -10,7 +10,7 @@ * * libteletone_detect.c Tone Detection Code * - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/libteletone_generate.c b/libs/openzap/src/libteletone_generate.c index 1d5d696af2..e40c8f5729 100644 --- a/libs/openzap/src/libteletone_generate.c +++ b/libs/openzap/src/libteletone_generate.c @@ -1,7 +1,7 @@ /* * libteletone_generate.c -- Tone Generator * - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/m3ua_client.h b/libs/openzap/src/m3ua_client.h index b80309017c..7d9834f1b4 100644 --- a/libs/openzap/src/m3ua_client.h +++ b/libs/openzap/src/m3ua_client.h @@ -5,7 +5,7 @@ * Created by Shane Burrell on 4/3/08. * Copyright 2008 Shane Burrell. All rights reserved. * - * Copyright (c) 2007, Anthony Minessale II, Nenad Corbic + * Copyright (c) 2007-2012, Anthony Minessale II, Nenad Corbic * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c index d878b9195e..5a36a23359 100644 --- a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c +++ b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h b/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h index 3ffa422ead..f1ae31cc14 100644 --- a/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h +++ b/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c b/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c index 581c6dd45a..9d4573f3a6 100644 --- a/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c +++ b/libs/openzap/src/ozmod/ozmod_analog_em/ozmod_analog_em.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Anthony Minessale II + * Copyright (c) 2008-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_analog_em/zap_analog_em.h b/libs/openzap/src/ozmod/ozmod_analog_em/zap_analog_em.h index eb9f9f3d20..1a0e355106 100644 --- a/libs/openzap/src/ozmod/ozmod_analog_em/zap_analog_em.h +++ b/libs/openzap/src/ozmod/ozmod_analog_em/zap_analog_em.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Anthony Minessale II + * Copyright (c) 2008-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c b/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c index fc998b126f..529e87d10d 100644 --- a/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c +++ b/libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_isdn/zap_isdn.h b/libs/openzap/src/ozmod/ozmod_isdn/zap_isdn.h index c5e0e5a711..3542a550ab 100644 --- a/libs/openzap/src/ozmod/ozmod_isdn/zap_isdn.h +++ b/libs/openzap/src/ozmod/ozmod_isdn/zap_isdn.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.c b/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.c index 3df1d54d89..bd8f72202d 100644 --- a/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.c +++ b/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Anthony Minessale II + * Copyright (c) 2009-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.h b/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.h index 4c79526b9e..bd63db15c2 100644 --- a/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.h +++ b/libs/openzap/src/ozmod/ozmod_libpri/lpwrap_pri.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Anthony Minessale II + * Copyright (c) 2009-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c index f18aa1fc54..511746afa8 100644 --- a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c +++ b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h index 8c929516ba..f31671735c 100644 --- a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h +++ b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Anthony Minessale II + * Copyright (c) 2009-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_pika/ozmod_pika.c b/libs/openzap/src/ozmod/ozmod_pika/ozmod_pika.c index 154c1618ff..2084848235 100644 --- a/libs/openzap/src/ozmod/ozmod_pika/ozmod_pika.c +++ b/libs/openzap/src/ozmod/ozmod_pika/ozmod_pika.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_pika/zap_pika.h b/libs/openzap/src/ozmod/ozmod_pika/zap_pika.h index 27c455a429..758ea32763 100644 --- a/libs/openzap/src/ozmod/ozmod_pika/zap_pika.h +++ b/libs/openzap/src/ozmod/ozmod_pika/zap_pika.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c index dc2218012e..a1bdaa77b1 100644 --- a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c +++ b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c b/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c index 5b3e5b87ad..96e2ae72ec 100644 --- a/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c +++ b/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II, Nenad Corbic + * Copyright (c) 2007-2012, Anthony Minessale II, Nenad Corbic * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.h b/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.h index 861f941ceb..8ae6e74101 100644 --- a/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.h +++ b/libs/openzap/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II, Nenad Corbic + * Copyright (c) 2007-2012, Anthony Minessale II, Nenad Corbic * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_sangoma_boost/zap_sangoma_boost.h b/libs/openzap/src/ozmod/ozmod_sangoma_boost/zap_sangoma_boost.h index a48060812b..10ac69d63d 100644 --- a/libs/openzap/src/ozmod/ozmod_sangoma_boost/zap_sangoma_boost.h +++ b/libs/openzap/src/ozmod/ozmod_sangoma_boost/zap_sangoma_boost.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_skel/ozmod_skel.c b/libs/openzap/src/ozmod/ozmod_skel/ozmod_skel.c index 949e0fbf31..b4bc8676ee 100644 --- a/libs/openzap/src/ozmod/ozmod_skel/ozmod_skel.c +++ b/libs/openzap/src/ozmod/ozmod_skel/ozmod_skel.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c b/libs/openzap/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c index 8423aac34b..109e34cd9c 100644 --- a/libs/openzap/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c +++ b/libs/openzap/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.c b/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.c index ca42c2c578..4b2836d5b2 100644 --- a/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.c +++ b/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.h b/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.h index 687269a983..c496df9bae 100644 --- a/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.h +++ b/libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/priserver.c b/libs/openzap/src/priserver.c index 080e5d4cef..fddec03e5b 100644 --- a/libs/openzap/src/priserver.c +++ b/libs/openzap/src/priserver.c @@ -4,7 +4,7 @@ * Author(s): Anthony Minessale II * Nenad Corbic * - * Copyright: (c) 2005 Anthony Minessale II + * Copyright: (c) 2005-2012 Anthony Minessale II * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/libs/openzap/src/sangoma_pri.c b/libs/openzap/src/sangoma_pri.c index c160eedd28..9da5c951af 100644 --- a/libs/openzap/src/sangoma_pri.c +++ b/libs/openzap/src/sangoma_pri.c @@ -4,7 +4,7 @@ * Author(s): Anthony Minessale II * Nenad Corbic * - * Copyright: (c) 2005 Anthony Minessale II + * Copyright: (c) 2005-2012 Anthony Minessale II * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/libs/openzap/src/sangoma_pri.h b/libs/openzap/src/sangoma_pri.h index 880fc85cea..5829a699ea 100644 --- a/libs/openzap/src/sangoma_pri.h +++ b/libs/openzap/src/sangoma_pri.h @@ -4,7 +4,7 @@ * Author(s): Anthony Minessale II * Nenad Corbic * - * Copyright: (c) 2005 Anthony Minessale II + * Copyright: (c) 2005-2012 Anthony Minessale II * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/libs/openzap/src/zap_buffer.c b/libs/openzap/src/zap_buffer.c index 0e2279d7e3..1a3b6a8311 100644 --- a/libs/openzap/src/zap_buffer.c +++ b/libs/openzap/src/zap_buffer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/zap_config.c b/libs/openzap/src/zap_config.c index ca0315594b..54119e1e8c 100644 --- a/libs/openzap/src/zap_config.c +++ b/libs/openzap/src/zap_config.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/zap_io.c b/libs/openzap/src/zap_io.c index 283a9fe332..6235f92392 100644 --- a/libs/openzap/src/zap_io.c +++ b/libs/openzap/src/zap_io.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libs/openzap/src/zap_m3ua.c b/libs/openzap/src/zap_m3ua.c index 50736b75e4..e5bc4cdd38 100644 --- a/libs/openzap/src/zap_m3ua.c +++ b/libs/openzap/src/zap_m3ua.c @@ -6,7 +6,7 @@ * Copyright 2008 Shane Burrell. All rights reserved. * * - * Copyright (c) 2007, Anthony Minessale II, Nenad Corbic * + * Copyright (c) 2007-2012, Anthony Minessale II, Nenad Corbic * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index c35540c4f5..ade22984f2 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Thu Mar 1 10:03:45 CST 2012 +Thu May 3 16:30:20 CDT 2012 diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c index 5dd574b88f..e690b424e7 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c +++ b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c @@ -4165,7 +4165,7 @@ nta_leg_t *nta_leg_tcreate(nta_agent_t *agent, if (i == NONE) /* Magic value, used for compatibility */ no_dialog = 1; - if (!(leg = su_home_clone(agent->sa_home, sizeof(*leg)))) + if (!(leg = su_home_clone(NULL, sizeof(*leg)))) return NULL; home = leg->leg_home; @@ -4394,7 +4394,8 @@ void nta_leg_destroy(nta_leg_t *leg) static void leg_free(nta_agent_t *sa, nta_leg_t *leg) { - su_free(sa->sa_home, leg); + //su_free(sa->sa_home, leg); + su_home_unref((su_home_t *)leg); } /** Return application context for the leg */ @@ -5327,7 +5328,7 @@ nta_incoming_t *incoming_create(nta_agent_t *agent, } irq->irq_branch = sip->sip_via->v_branch; irq->irq_reliable_tp = tport_is_reliable(tport); - irq->irq_extra_100 = 1; /* Sending extra 100 trying true by default */ + irq->irq_extra_100 = 0; /* Sending extra 100 trying false by default */ if (sip->sip_timestamp) irq->irq_timestamp = sip_timestamp_copy(home, sip->sip_timestamp); @@ -6068,7 +6069,7 @@ incoming_recv(nta_incoming_t *irq, msg_t *msg, sip_t *sip, tport_t *tport) if (irq->irq_status >= 100) { SU_DEBUG_5(("nta: re-received %s request, retransmitting %u reply\n", sip->sip_request->rq_method_name, irq->irq_status)); - incoming_retransmit_reply(irq, tport); + incoming_retransmit_reply(irq, tport); } else if (irq->irq_agent->sa_extra_100 && irq->irq_extra_100) { diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c index 1a3614c6a1..e7ec9fb890 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c @@ -1212,10 +1212,12 @@ int nua_base_client_check_restart(nua_client_request_t *cr, return 1; } } - - if (0 && 500 <= status && status < 600 && + /* GriGiu : RFC-3261 status supported Retry-After */ + if ( (status == 404 || status == 413 || status == 480 || status == 486 || + status == 500 || status == 503 || + status == 600 || status == 603) && sip->sip_retry_after && - sip->sip_retry_after->af_delta < 32) { + sip->sip_retry_after->af_delta < 3200) { su_timer_t *timer; char phrase[18]; /* Retry After XXXX\0 */ diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c index bc842c242d..661a18b1d2 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c @@ -109,8 +109,8 @@ nua_handle_t *nh_create_handle(nua_t *nua, assert(nua->nua_home); - if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) { - //if ((nh = su_home_new(sizeof(*nh)))) { + //if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) { + if ((nh = su_home_new(sizeof(*nh)))) { nh->nh_valid = nua_valid_handle_cookie; nh->nh_nua = nua; nh->nh_magic = hmagic; diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c index 58b480440a..0f6a491dff 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c @@ -139,6 +139,7 @@ int nua_stack_set_defaults(nua_handle_t *nh, NHP_SET(nhp, only183_100rel, 0); NHP_SET(nhp, auto_answer, 0); NHP_SET(nhp, auto_ack, 1); + NHP_SET(nhp, timer_autorequire, 1); NHP_SET(nhp, invite_timeout, 120); nhp->nhp_session_timer = 1800; @@ -741,6 +742,10 @@ static int nhp_set_tags(su_home_t *home, else if (tag == nutag_autoack) { NHP_SET(nhp, auto_ack, value != 0); } + /* NUTAG_TIMER_AUTOREQUIRE(timer_autorequire) */ + else if (tag == nutag_timer_autorequire) { + NHP_SET(nhp, timer_autorequire, value != 0); + } /* NUTAG_INVITE_TIMER(invite_timeout) */ else if (tag == nutag_invite_timer) { NHP_SET(nhp, invite_timeout, (unsigned)value); @@ -1647,6 +1652,7 @@ int nua_stack_get_params(nua_t *nua, nua_handle_t *nh, nua_event_t e, TIF(NUTAG_ONLY183_100REL, only183_100rel), TIF(NUTAG_AUTOANSWER, auto_answer), TIF(NUTAG_AUTOACK, auto_ack), + TIF(NUTAG_TIMER_AUTOREQUIRE, timer_autorequire), TIF(NUTAG_INVITE_TIMER, invite_timeout), TIFD(NUTAG_SESSION_TIMER, session_timer), diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h b/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h index 1904a080c5..9fe4a98652 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h @@ -109,6 +109,8 @@ struct nua_handle_preferences /** Always include id with Event: refer */ unsigned nhp_refer_with_id:1; + + unsigned nhp_timer_autorequire:1; unsigned:0; /* Default lifetime for implicit subscriptions created by REFER */ @@ -207,6 +209,7 @@ struct nua_handle_preferences unsigned nhb_appl_method:1; unsigned nhb_initial_route:1; unsigned nhb_proxy:1; + unsigned nhb_timer_autorequire:1; unsigned :0; } set_bits; unsigned set_unsigned[2]; diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c index 50150a3a42..f27c83fb92 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c @@ -261,11 +261,12 @@ int nua_stack_process_request(nua_handle_t *nh, } if (sr->sr_status <= 100) { - SR_STATUS1(sr, SIP_100_TRYING); + SR_STATUS1(sr, SIP_100_TRYING); if (method == sip_method_invite || sip->sip_timestamp) { - nta_incoming_treply(irq, SIP_100_TRYING, - SIPTAG_USER_AGENT_STR(user_agent), - TAG_END()); + nta_incoming_treply(irq, SIP_100_TRYING, + SIPTAG_USER_AGENT_STR(user_agent), + TAG_END()); + } } else { diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c index 1958b5645a..751b1cfff8 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c @@ -370,7 +370,8 @@ static int session_timer_check_min_se(msg_t *msg, sip_t *sip, static int session_timer_add_headers(struct session_timer *t, int initial, - msg_t *msg, sip_t *sip); + msg_t *msg, sip_t *sip, + nua_handle_t *nh); static void session_timer_negotiate(struct session_timer *t, int uas); @@ -791,7 +792,7 @@ static int nua_invite_client_request(nua_client_request_t *cr, /* Add session timer headers */ if (session_timer_is_supported(ss->ss_timer)) session_timer_add_headers(ss->ss_timer, ss->ss_state == nua_callstate_init, - msg, sip); + msg, sip, nh); ss->ss_100rel = NH_PGET(nh, early_media); ss->ss_precondition = sip_has_feature(sip->sip_require, "precondition"); @@ -2436,7 +2437,7 @@ int nua_invite_server_respond(nua_server_request_t *sr, tagi_t const *tags) NH_PGET(nh, min_se)); if (session_timer_is_supported(ss->ss_timer)) - session_timer_add_headers(ss->ss_timer, 0, msg, sip); + session_timer_add_headers(ss->ss_timer, 0, msg, sip, nh); } return nua_base_server_respond(sr, tags); @@ -3354,7 +3355,7 @@ static int nua_update_client_request(nua_client_request_t *cr, if (session_timer_is_supported(ss->ss_timer)) session_timer_add_headers(ss->ss_timer, ss->ss_state < nua_callstate_ready, - msg, sip); + msg, sip, nh); retval = nua_base_client_request(cr, msg, sip, NULL); @@ -3610,7 +3611,7 @@ int nua_update_server_respond(nua_server_request_t *sr, tagi_t const *tags) nua_server_request_t *sr0; int uas; - session_timer_add_headers(ss->ss_timer, 0, msg, sip); + session_timer_add_headers(ss->ss_timer, 0, msg, sip, nh); for (sr0 = nh->nh_ds->ds_sr; sr0; sr0 = sr0->sr_next) if (sr0->sr_method == sip_method_invite) @@ -4426,18 +4427,24 @@ static int session_timer_add_headers(struct session_timer *t, int initial, msg_t *msg, - sip_t *sip) + sip_t *sip, + nua_handle_t *nh) { unsigned long expires, min; sip_min_se_t min_se[1]; sip_session_expires_t x[1]; int uas; + int autorequire = 1; enum nua_session_refresher refresher = nua_any_refresher; static sip_param_t const x_params_uac[] = {"refresher=uac", NULL}; static sip_param_t const x_params_uas[] = {"refresher=uas", NULL}; + if ( !NH_PGET(nh, timer_autorequire) && NH_PISSET(nh, timer_autorequire)) { + autorequire = 0; + } + if (!t->local.supported) return 0; @@ -4491,7 +4498,7 @@ session_timer_add_headers(struct session_timer *t, /* Min-SE: 0 is optional with initial INVITE */ || !initial, SIPTAG_MIN_SE(min_se)), - //TAG_IF(refresher == nua_remote_refresher && expires != 0, SIPTAG_REQUIRE_STR("timer")), + TAG_IF(autorequire && refresher == nua_remote_refresher && expires != 0, SIPTAG_REQUIRE_STR("timer")), TAG_END()); return 1; diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c index 96ca20baee..491d485731 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c @@ -1329,6 +1329,8 @@ tag_typedef_t nutag_autoanswer = BOOLTAG_TYPEDEF(autoAnswer); */ tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK); +tag_typedef_t nutag_timer_autorequire = BOOLTAG_TYPEDEF(timerAutorequire); + /**@def NUTAG_AUTOACK_REF(x) * Reference tag for NUTAG_AUTOACK(). */ diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h b/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h index 9e710d052d..813e0d757a 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h +++ b/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h @@ -199,6 +199,11 @@ SOFIAPUBVAR tag_typedef_t nutag_autoack; #define NUTAG_AUTOACK_REF(x) nutag_autoack_ref, tag_bool_vr(&(x)) SOFIAPUBVAR tag_typedef_t nutag_autoack_ref; +#define NUTAG_TIMER_AUTOREQUIRE(x) nutag_timer_autorequire, tag_bool_v(x) +SOFIAPUBVAR tag_typedef_t nutag_timer_autorequire; +#define NUTAG_TIMER_AUTOREQUIRE_REF(x) nutag_timer_autorequire_ref, tag_bool_vr(&(x)) +SOFIAPUBVAR tag_typedef_t nutag_timer_autorequire_ref; + #define NUTAG_AUTOANSWER(x) nutag_autoanswer, tag_bool_v(x) SOFIAPUBVAR tag_typedef_t nutag_autoanswer; #define NUTAG_AUTOANSWER_REF(x) nutag_autoanswer_ref, tag_bool_vr(&(x)) diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c b/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c index 523599c7a7..c1c4fd23df 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c @@ -409,8 +409,10 @@ static int li_scope6(struct in6_addr const *ip6) { if (IN6_IS_ADDR_V4MAPPED(ip6) || IN6_IS_ADDR_V4COMPAT(ip6)) { - uint32_t ip4 = *(uint32_t *)(ip6->s6_addr + 12); - return li_scope4(ip4); + uint32_t *u = (uint32_t *)(ip6->s6_addr + 12); + + uint32_t ip4 = *u; + return li_scope4(ip4); } else if (IN6_IS_ADDR_LOOPBACK(ip6)) return LI_SCOPE_HOST; diff --git a/libs/stfu/stfu.c b/libs/stfu/stfu.c index 0bd42a7d4a..787fd9c3d9 100644 --- a/libs/stfu/stfu.c +++ b/libs/stfu/stfu.c @@ -1,6 +1,6 @@ /* * STFU (S)ort (T)ransportable (F)ramed (U)tterances - * Copyright (c) 2007 Anthony Minessale II + * Copyright (c) 2007-2012 Anthony Minessale II * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -461,7 +461,7 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint32_t pt, void i->sync_in = 0; } else { - if ((ts && ts == i->last_rd_ts + i->samples_per_packet) || (i->last_rd_ts > 4294900000 && ts < 5000)) { + if ((ts && ts == i->last_rd_ts + i->samples_per_packet) || (i->last_rd_ts > 4294900000u && ts < 5000)) { good_ts = 1; } diff --git a/libs/stfu/stfu.h b/libs/stfu/stfu.h index 3e989b0a97..2b21419118 100644 --- a/libs/stfu/stfu.h +++ b/libs/stfu/stfu.h @@ -1,6 +1,6 @@ /* * STFU (S)ort (T)ransportable (F)ramed (U)tterances - * Copyright (c) 2007 Anthony Minessale II + * Copyright (c) 2007-2012 Anthony Minessale II * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/libs/win32/util.vbs b/libs/win32/util.vbs index ace3fd6998..29a7be5715 100644 --- a/libs/win32/util.vbs +++ b/libs/win32/util.vbs @@ -270,88 +270,35 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest) strVerMicro = FindVersionStringInConfigure(VersionDir & "configure.in", "SWITCH_VERSION_MICRO") strVerRev = FindVersionStringInConfigure(VersionDir & "configure.in", "SWITCH_VERSION_REVISION") - If Right(tmpFolder, 1) <> "\" Then tmpFolder = tmpFolder & "\" End If - If Not FSO.FileExists(tmpFolder & "fs_svnversion.exe") Then - Wget ToolsBase & "fs_svnversion.exe", tmpFolder - End If - - If Not FSO.FileExists(tmpFolder & "libdb44.dll") Then - Wget ToolsBase & "libdb44.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "libsvn_diff-1.dll") Then - Wget ToolsBase & "libsvn_diff-1.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "libsvn_subr-1.dll") Then - Wget ToolsBase & "libsvn_subr-1.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "libsvn_wc-1.dll") Then - Wget ToolsBase & "libsvn_wc-1.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "intl3_svn.dll") Then - Wget ToolsBase & "intl3_svn.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "libapr-1.dll") Then - Wget ToolsBase & "libapr-1.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "libaprutil-1.dll") Then - Wget ToolsBase & "libaprutil-1.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "libapriconv-1.dll") Then - Wget ToolsBase & "libapriconv-1.dll", tmpFolder - End If - If Not FSO.FileExists(tmpFolder & "libsvn_delta-1.dll") Then - Wget ToolsBase & "libsvn_delta-1.dll", tmpFolder - End If - - Dim sLastFile - Const OverwriteIfExist = -1 - Const ForReading = 1 - - if strVerRev = "" Then - if FSO.FolderExists(VersionDir & ".svn") Then - VersionCmd="fs_svnversion " & quote & VersionDir & "." & quote & " -n" - Set MyFile = fso.CreateTextFile(tmpFolder & "tmpVersion.Bat", True) - MyFile.WriteLine("@" & "cd " & quote & tmpFolder & quote ) - MyFile.WriteLine("@" & VersionCmd) - MyFile.Close - Set oExec = WshShell.Exec("cmd /C " & quote & tmpFolder & "tmpVersion.Bat" & quote) - Do - strFromProc = OExec.StdOut.ReadLine() - VERSION="svn-" & strFromProc - Loop While Not OExec.StdOut.atEndOfStream - sLastVersion = "" - Set sLastFile = FSO.OpenTextFile(tmpFolder & "lastversion", ForReading, true, OpenAsASCII) - If Not sLastFile.atEndOfStream Then - sLastVersion = sLastFile.ReadLine() - End If - sLastFile.Close - End If - - if FSO.FolderExists(VersionDir & ".git") Then - VersionCmd="git log --format=" & quote & "%%h %%ci" & quote & " -1 HEAD" - Set MyFile = FSO.CreateTextFile(tmpFolder & "tmpVersion.Bat", True) - MyFile.WriteLine("@" & "cd " & quote & VersionDir & quote) - MyFile.WriteLine("@" & VersionCmd) - MyFile.Close - Set oExec = WshShell.Exec("cmd /C " & quote & tmpFolder & "tmpVersion.Bat" & quote) - Do - strFromProc = Trim(OExec.StdOut.ReadLine()) - VERSION="git-" & strFromProc - Loop While Not OExec.StdOut.atEndOfStream - sLastVersion = "" - Set sLastFile = FSO.OpenTextFile(tmpFolder & "lastversion", ForReading, true, OpenAsASCII) - If Not sLastFile.atEndOfStream Then - sLastVersion = sLastFile.ReadLine() - End If - sLastFile.Close - VERSION = Replace(VERSION, ":", "-") - End If - End If - + 'Set version to the one reported by configure.in if strVerRev <> "" Then VERSION = strVerRev End If + Dim sLastFile + Const ForReading = 1 + + 'Try To read revision from git, if it's found, use this instead of strVerRev found above + If FSO.FolderExists(VersionDir & ".git") Then + VersionCmd="git log --format=" & quote & "%%h %%ci" & quote & " -1 HEAD" + Set MyFile = FSO.CreateTextFile(tmpFolder & "tmpVersion.Bat", True) + MyFile.WriteLine("@" & "cd " & quote & VersionDir & quote) + MyFile.WriteLine("@" & VersionCmd) + MyFile.Close + Set oExec = WshShell.Exec("cmd /C " & quote & tmpFolder & "tmpVersion.Bat" & quote) + Do + strFromProc = Trim(OExec.StdOut.ReadLine()) + VERSION="git-" & strFromProc + Loop While Not OExec.StdOut.atEndOfStream + sLastVersion = "" + Set sLastFile = FSO.OpenTextFile(tmpFolder & "lastversion", ForReading, true, OpenAsASCII) + If Not sLastFile.atEndOfStream Then + sLastVersion = sLastFile.ReadLine() + End If + sLastFile.Close + VERSION = Replace(VERSION, ":", "-") + End If + If VERSION = "" Then VERSION = "UNKNOWN" End If diff --git a/scripts/c/socket2me/socket2me.c b/scripts/c/socket2me/socket2me.c index 1b3aa0c6f2..9bb9551742 100644 --- a/scripts/c/socket2me/socket2me.c +++ b/scripts/c/socket2me/socket2me.c @@ -29,7 +29,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * - * Copyright (C) 2007, Anthony Minessale II + * Copyright (C) 2007-2012, Anthony Minessale II */ #include diff --git a/scripts/ci/common.sh b/scripts/ci/common.sh new file mode 100755 index 0000000000..3aa6bb3441 --- /dev/null +++ b/scripts/ci/common.sh @@ -0,0 +1,136 @@ +#!/bin/sh +##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- + +src_repo="$(pwd)" +tmp_dir=${TMP_DIR:="/tmp"} + +zgrep () { (echo "$2" | grep -e "$1" >/dev/null); } + +parse_version () { + local ver="$1" major="" minor="" micro="" rev="" + local next=major + for x in $(echo "$1" | sed -e 's/\([._~-]\)/ \1 /g'); do + if [ $next = rev ]; then + rev="${rev}${x}" + elif [ "$x" = "." ] || [ "$x" = "_" ] || [ "$x" = "~" ] || [ "$x" = "-" ]; then + if [ "$x" = "_" ] || [ "$x" = "~" ] || [ "$x" = "-" ]; then + next=rev + eval $next='$x' + else + case $next in + major) next=minor;; + minor) next=micro;; + micro) next=rev;; + esac + fi + else + local tmp="$(eval echo \$$next)" + eval $next='${tmp}${x}' + fi + done + # The major version should never be null + if [ -z "$major" ]; then + echo "WARNING: parse_version was called with '$1' which is missing a major version number" >&2 + fi + # If someone asks for the minor or micro specificially, they + # probably expect that it won't be null. Also, vX.Y should never be + # different from vX.Y.0 (that would be crazy), so we don't lose + # meaningful generality by setting minor or micro to zero on vX or + # vX.Y style versions. + minor="${minor:-0}" + micro="${micro:-0}" + # centos-style versions (don't mess with the argument given for now) + # TODO: what is the CentOS version number policy? + local cmajor cminor cmicro crev cver + cmajor="${major:-0}" + cminor="${minor:-0}" + cmicro="${micro:-0}" + crev="$(echo "$rev" | sed -e 's/[._~-]//')" + cver="${cmajor}.${cminor}.${cmicro}" + [ -n "$crev" ] && cver="${cver}.${crev}" + # fix up if the revision was passed in the minor or micro number + if zgrep '^\(alpha\|beta\|rc\)' "$minor"; then + rev="-${minor}" + minor="0" + micro="0" + ver="${major}${rev}" + fi + if zgrep '^\(alpha\|beta\|rc\)' "$micro"; then + rev="-${micro}" + micro="0" + ver="${major}.${minor}${rev}" + fi + # git-style versions + local gmajor gminor gmicro grev gver + gver="$(echo "$ver" | sed -e 's/[~_]/-/')" + grev="$(echo "$rev" | sed -e 's/[~_]/-/')" + gmajor="$major" + gminor="$minor" + gmicro="$micro" + # debian-style versions + local dmajor dminor dmicro drev dver + dver="$(echo "$ver" | sed -e 's/[-_]/~/')" + drev="$(echo "$rev" | sed -e 's/[-_]/~/')" + dmajor="$major" + dminor="$minor" + dmicro="$micro" + # return variables + echo "ver='$ver'" + echo "major='$major'" + echo "minor='$minor'" + echo "micro='$micro'" + echo "rev='$rev'" + echo "gver='$gver'" + echo "gmajor='$gmajor'" + echo "gminor='$gminor'" + echo "gmicro='$gmicro'" + echo "grev='$grev'" + echo "dver='$dver'" + echo "dmajor='$dmajor'" + echo "dminor='$dminor'" + echo "dmicro='$dmicro'" + echo "drev='$drev'" + echo "cver='$cver'" + echo "cmajor='$cmajor'" + echo "cminor='$cminor'" + echo "cmicro='$cmicro'" + echo "crev='$crev'" +} + +set_fs_ver () { + local ver="$1" major="$2" minor="$3" micro="$4" rev="$5" + sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \ + -e "s|\(AC_SUBST(SWITCH_VERSION_MINOR, \[\).*\(\])\)|\1$minor\2|" \ + -e "s|\(AC_SUBST(SWITCH_VERSION_MICRO, \[\).*\(\])\)|\1$micro\2|" \ + -e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], BUG-REPORT-ADDRESS)\)|\1$ver\2|" \ + -i configure.in + if [ -n "$rev" ]; then + sed -e "s|\(AC_SUBST(SWITCH_VERSION_REVISION, \[\).*\(\])\)|\1$rev\2|" \ + -e "s|#\(AC_SUBST(SWITCH_VERSION_REVISION\)|\1|" \ + -i configure.in + fi +} + +gnuize () { + ./bootstrap.sh + mv bootstrap.sh rebootstrap.sh + rm -f docs/AUTHORS + rm -f docs/COPYING + rm -f docs/ChangeLog + rm -rf .git +} + +check_pwd () { + if [ ! -d .git ]; then + echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2 + exit 1; + fi +} + +check_input_ver_build () { + if [ -z "$1" ]; then + echo "usage: $0 " 1>&2 + exit 1; + fi +} + diff --git a/scripts/ci/debsrcbuilder.sh b/scripts/ci/debsrcbuilder.sh index d58f61075a..e64093d120 100755 --- a/scripts/ci/debsrcbuilder.sh +++ b/scripts/ci/debsrcbuilder.sh @@ -1,54 +1,84 @@ -#!/bin/bash +#!/bin/sh ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- -src_repo="$(pwd)" +sdir="." +[ -n "${0%/*}" ] && sdir="${0%/*}" +. $sdir/common.sh -if [ ! -d .git ]; then - echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2 - exit 1; +check_pwd +check_input_ver_build $@ +in_ver="$1" +if [ "$in_ver" = "auto" ]; then + in_ver="$(cat build/next-release.txt)" fi +eval $(parse_version "$in_ver") +datestamp="$(date +%Y%m%dT%H%M%SZ)" +nightly="n${datestamp}" +build="b${2-0}" +distro="${3-unstable}" +codename="${4-sid}" -if [ -z "$1" ]; then - echo "usage: ./scripts/ci/debbuilder.sh MAJOR.MINOR.MICRO[.REVISION] BUILD_NUMBER" 1>&2 - exit 1; -fi +fver="${dver}~${nightly}~${build}" +fname="freeswitch-$fver" +orig="freeswitch_$fver.orig" +ddir=$src_repo/debbuild +bdir=$src_repo/debbuild/$fname -ver="$1" -major=$(echo "$ver" | cut -d. -f1) -minor=$(echo "$ver" | cut -d. -f2) -micro=$(echo "$ver" | cut -d. -f3) -rev=$(echo "$ver" | cut -d. -f4) +mkdir -p $ddir +git clone . $bdir +cd $bdir +set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" +cd libs +getlib () { + f="${1##*/}" + echo "fetching: $1 to $f" >&2 + wget -N "$1" \ + && tar -xv --no-same-owner --no-same-permissions -f "$f" \ + && rm -f "$f" \ + && mkdir -p $f +} +getlib http://downloads.mongodb.org/cxx-driver/mongodb-linux-x86_64-v1.8-latest.tgz +getlib http://files.freeswitch.org/downloads/libs/json-c-0.9.tar.gz +getlib http://files.freeswitch.org/downloads/libs/libmemcached-0.32.tar.gz +getlib http://files.freeswitch.org/downloads/libs/soundtouch-1.6.0.tar.gz +getlib http://files.freeswitch.org/downloads/libs/flite-1.5.4-current.tar.bz2 +getlib http://files.freeswitch.org/downloads/libs/sphinxbase-0.7.tar.gz +getlib http://files.freeswitch.org/downloads/libs/pocketsphinx-0.7.tar.gz +getlib http://files.freeswitch.org/downloads/libs/communicator_semi_6000_20080321.tar.gz +getlib http://files.freeswitch.org/downloads/libs/celt-0.10.0.tar.gz +getlib http://files.freeswitch.org/downloads/libs/opus-0.9.0.tar.gz +getlib http://files.freeswitch.org/downloads/libs/openldap-2.4.19.tar.gz +getlib http://download.zeromq.org/zeromq-2.1.9.tar.gz \ + || getlib http://download.zeromq.org/historic/zeromq-2.1.9.tar.gz +getlib http://files.freeswitch.org/downloads/libs/freeradius-client-1.1.6.tar.gz +getlib http://files.freeswitch.org/downloads/libs/lame-3.98.4.tar.gz +getlib http://files.freeswitch.org/downloads/libs/libshout-2.2.2.tar.gz +getlib http://files.freeswitch.org/downloads/libs/mpg123-1.13.2.tar.gz +cd mongo-cxx-driver-v1.8 +rm -rf config.log .sconf_temp *Test *Example +find . -name "*.o" -exec rm -f {} \; +cd $ddir +tar -c --exclude=.git -vf $orig.tar $fname +echo "Compressing $orig.tar with xz -6..." >&2 +xz -6 $orig.tar -build="$2" +cd $bdir +(cd debian && ./bootstrap.sh -c "$codename") +# dch can't handle comments in control file +(cd debian; \ + mv control control.orig; \ + grep -e '^#' -v control.orig > control) +# dependency: libparse-debcontrol-perl +dch -b -v "${fver}-1~${codename}+1" \ + -M --force-distribution -D "$distro" \ + "Nightly build at ${datestamp}." +# dependency: fakeroot +dpkg-buildpackage -S -rfakeroot -uc -us -i\.git -I.git -Zxz -z9 || exit ? -dst_version="$major.$minor.$micro" -dst_name="freeswitch-$dst_version" -dst_parent="/tmp/" -dst_dir="/tmp/$dst_name" - - -mkdir -p $src_repo/debbuild/ - -tar xvjf src_dist/$dst_name.tar.bz2 -C $src_repo/debbuild/ -cp src_dist/$dst_name.tar.bz2 $src_repo/debbuild/freeswitch_${dst_version}.orig.tar.bz2 - -# Build the debian source package first, from the source tar file. -cd $src_repo/debbuild/$dst_name - -dch -v $dst_version-$build "Nightly Build" - -dpkg-buildpackage -rfakeroot -S -us -uc - -status=$? - -if [ $status -gt 0 ]; then - exit $status -else - cat 1>&2 <&2 <&2 - exit 1; -fi - -if [ -z "$1" ]; then - echo "usage: ./scripts/ci/rpmbuilder.sh MAJOR.MINOR.MICRO[.REVISION] BUILD_NUMBER" 1>&2 - exit 1; -fi - -ver="$1" -major=$(echo "$ver" | cut -d. -f1) -minor=$(echo "$ver" | cut -d. -f2) -micro=$(echo "$ver" | cut -d. -f3) -rev=$(echo "$ver" | cut -d. -f4) +sdir="." +[ -n "${0%/*}" ] && sdir="${0%/*}" +. $sdir/common.sh +check_pwd +check_input_ver_build $@ +eval $(parse_version "$1") build="$2" -dst_name="freeswitch-$major.$minor.$micro" +dst_name="freeswitch-$cmajor.$cminor.$cmicro" dst_parent="/tmp/" dst_dir="/tmp/$dst_name" -mkdir -p $src_repo/rpmbuild/{SOURCES,BUILD,BUILDROOT,i386,x86_64,SPECS} +(mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS) cd $src_repo +cp -a src_dist/* rpmbuild/SOURCES/ || true -rpmbuild --define "VERSION_NUMBER $ver" \ +rpmbuild --define "VERSION_NUMBER $cver" \ --define "BUILD_NUMBER $build" \ --define "_topdir %(pwd)/rpmbuild" \ --define "_rpmdir %{_topdir}" \ @@ -46,7 +36,7 @@ mv $src_repo/rpmbuild/*/*.rpm $src_repo/RPMS/. cat 1>&2 <&2 - exit 1; -fi - -if [ -z "$1" ]; then - echo "usage: ./scripts/ci/rpmbuilder.sh MAJOR.MINOR.MICRO[.REVISION] BUILD_NUMBER" 1>&2 - exit 1; -fi - -ver="$1" -major=$(echo "$ver" | cut -d. -f1) -minor=$(echo "$ver" | cut -d. -f2) -micro=$(echo "$ver" | cut -d. -f3) +sdir="." +[ -n "${0%/*}" ] && sdir="${0%/*}" +. $sdir/common.sh +check_pwd +check_input_ver_build $@ +eval $(parse_version "$1") build="$2" cd rpmbuild/SOURCES diff --git a/scripts/ci/sounds-music.sh b/scripts/ci/sounds-music.sh index 118d6b717f..70e61eabec 100755 --- a/scripts/ci/sounds-music.sh +++ b/scripts/ci/sounds-music.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- src_repo="$(pwd)" diff --git a/scripts/ci/sounds-ru-ru-elena.sh b/scripts/ci/sounds-ru-ru-elena.sh index 93da3228f7..33a4f9d004 100755 --- a/scripts/ci/sounds-ru-ru-elena.sh +++ b/scripts/ci/sounds-ru-ru-elena.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- src_repo="$(pwd)" diff --git a/scripts/ci/src_tarball.sh b/scripts/ci/src_tarball.sh index c4d95ce5be..0cab5f5d58 100755 --- a/scripts/ci/src_tarball.sh +++ b/scripts/ci/src_tarball.sh @@ -1,93 +1,44 @@ -#!/bin/bash +#!/bin/sh ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- -src_repo="$(pwd)" +sdir="." +[ -n "${0%/*}" ] && sdir="${0%/*}" +. $sdir/common.sh -if [ ! -d .git ]; then - echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2 - exit 1; -fi +check_pwd +check_input_ver_build $@ +eval $(parse_version "$1") -if [ -z "$1" ]; then - echo "usage: ./scripts/dailys.sh MAJOR.MINOR.MICRO[.REVISION] BUILD_NUMBER" 1>&2 - exit 1; -fi - -ver="$1" -major=$(echo "$ver" | cut -d. -f1) -minor=$(echo "$ver" | cut -d. -f2) -micro=$(echo "$ver" | cut -d. -f3) -rev=$(echo "$ver" | cut -d. -f4) - -build="$2" - -dst_name="freeswitch-$major.$minor.$micro" -dst_parent="/tmp/jenkis.$$/" -dst_dir="/tmp/jenkins.$$/$dst_name" +dst_name="freeswitch-$cmajor.$cminor.$cmicro" +dst_dir="${tmp_dir}/jenkins.$$/$dst_name" if [ -d "$dst_dir" ]; then echo "error: destination directory $dst_dir already exists." 1>&2 exit 1; fi -# save local changes -#ret=$(git stash save "Save uncommitted changes before tagging.") -#if echo $ret | grep "^Saved"; then - #stash_saved=1 -#fi - -sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \ - -e "s|\(AC_SUBST(SWITCH_VERSION_MINOR, \[\).*\(\])\)|\1$minor\2|" \ - -e "s|\(AC_SUBST(SWITCH_VERSION_MICRO, \[\).*\(\])\)|\1$micro\2|" \ - -e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], BUG-REPORT-ADDRESS)\)|\1$major.$minor.$micro\2|" \ - -i configure.in - -if [ -n "$rev" ]; then - sed -e "s|\(AC_SUBST(SWITCH_VERSION_REVISION, \[\).*\(\])\)|\1$rev\2|" \ - -e "s|#\(AC_SUBST(SWITCH_VERSION_REVISION\)|\1|" \ - -i configure.in -fi - -#git add configure.in -#git commit -m "Release freeswitch-$ver" -#git tag -a -m "freeswitch-$ver release" v$ver - -#git clone $src_repo $dst_dir -#if [ -n "$stash_saved" ]; then -# git stash pop -#fi - mkdir -p $dst_dir cp -r . $dst_dir cd $dst_dir - -./bootstrap.sh -mv bootstrap.sh rebootstrap.sh -rm -f docs/AUTHORS -rm -f docs/COPYING -rm -f docs/ChangeLog -rm -rf .git +set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" +gnuize cd .. - -cd $dst_parent - ls +tar -cvf ${dst_name}.tar $dst_name -tar -cvf $dst_name.tar $dst_name +# gzip -9 -c ${dst_name}.tar > $dst_name.tar.gz || echo "gzip not available" +bzip2 -z -k ${dst_name}.tar || echo "bzip2 not available" +# xz -z -9 -k ${dst_name}.tar || echo "xz / xz-utils not available" -# gzip -9 -c $dst_name.tar > $dst_name.tar.gz || echo "gzip not available" -bzip2 -z -k $dst_name.tar || echo "bzip2 not available" -# xz -z -9 -k $dst_name.tar || echo "xz / xz-utils not available" +rm -rf ${dst_name}.tar $dst_dir -rm -rf $dst_name.tar $dst_dir - -mkdir -p $src_repo/src_dist -mv -f $dst_name.tar.* $src_repo/src_dist +mkdir -p ${src_repo}/src_dist +mv -f ${dst_name}.tar.* ${src_repo}/src_dist cat 1>&2 < + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/scripts/javascript/js_modules/SpeechTools.jm b/scripts/javascript/js_modules/SpeechTools.jm index 4e9628b2f5..84e6363743 100644 --- a/scripts/javascript/js_modules/SpeechTools.jm +++ b/scripts/javascript/js_modules/SpeechTools.jm @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2006, Anthony Minessale II + * Copyright (C) 2005/2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/scripts/javascript/pizza.js b/scripts/javascript/pizza.js index 9807f5bc8d..57c8f2b116 100644 --- a/scripts/javascript/pizza.js +++ b/scripts/javascript/pizza.js @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/scripts/javascript/ps_pizza.js b/scripts/javascript/ps_pizza.js index 7fd405e009..646128e308 100644 --- a/scripts/javascript/ps_pizza.js +++ b/scripts/javascript/ps_pizza.js @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/scripts/python/freepy/__init__.py b/scripts/python/freepy/__init__.py index cebe48a0ab..2274cdc474 100644 --- a/scripts/python/freepy/__init__.py +++ b/scripts/python/freepy/__init__.py @@ -1,6 +1,6 @@ """ FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -Copyright (C) 2005-2011, Anthony Minessale II +Copyright (C) 2005-2012, Anthony Minessale II Version: MPL 1.1 diff --git a/scripts/python/freepy/fseventlistener.py b/scripts/python/freepy/fseventlistener.py index 6e3455f62f..fb1b430f5d 100644 --- a/scripts/python/freepy/fseventlistener.py +++ b/scripts/python/freepy/fseventlistener.py @@ -1,6 +1,6 @@ """ FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -Copyright (C) 2005-2011, Anthony Minessale II +Copyright (C) 2005-2012, Anthony Minessale II Version: MPL 1.1 diff --git a/scripts/python/freepy/fshelper.py b/scripts/python/freepy/fshelper.py index 090abce9d6..d258461629 100644 --- a/scripts/python/freepy/fshelper.py +++ b/scripts/python/freepy/fshelper.py @@ -2,7 +2,7 @@ """ FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -Copyright (C) 2005-2011, Anthony Minessale II +Copyright (C) 2005-2012, Anthony Minessale II Version: MPL 1.1 diff --git a/scripts/python/freepy/models.py b/scripts/python/freepy/models.py index 3dfb105424..37e595946f 100644 --- a/scripts/python/freepy/models.py +++ b/scripts/python/freepy/models.py @@ -1,6 +1,6 @@ """ FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -Copyright (C) 2005-2011, Anthony Minessale II +Copyright (C) 2005-2012, Anthony Minessale II Version: MPL 1.1 diff --git a/scripts/python/freepy/request.py b/scripts/python/freepy/request.py index d76fe2942c..787482be3a 100644 --- a/scripts/python/freepy/request.py +++ b/scripts/python/freepy/request.py @@ -1,6 +1,6 @@ """ FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -Copyright (C) 2005-2011, Anthony Minessale II +Copyright (C) 2005-2012, Anthony Minessale II Version: MPL 1.1 diff --git a/scripts/rss/rss2ivr.pl b/scripts/rss/rss2ivr.pl index ed5aabd3a3..489fc1609f 100755 --- a/scripts/rss/rss2ivr.pl +++ b/scripts/rss/rss2ivr.pl @@ -2,7 +2,7 @@ ########################################################################## # rss2ivr.pl -- A Script to turn an RSS feed into audio files. # -# Copyright (C) 2006, Anthony Minessale +# Copyright (C) 2006-2012, Anthony Minessale # # Anthony Minessale # diff --git a/scripts/setup-git.sh b/scripts/setup-git.sh index f9f709ff7f..df3cd73b6c 100755 --- a/scripts/setup-git.sh +++ b/scripts/setup-git.sh @@ -34,13 +34,14 @@ if ! git config user.email >/dev/null 2>&1; then git config --global user.email "$email" fi +git config pull.rebase true git config branch.master.rebase true cat 1>&2 <&2 - exit 1; -fi +check_pwd showusage() { - echo "usage: ./scripts/tagscript.sh [-s] MAJOR.MINOR.MICRO[.REVISION]" 1>&2 - exit 1; + cat >&2 < + +DESCRIPTION + Creates a new FreeSWITCH tag after performing some sanity checks. + The tag is optionally signed if '-s' is provided, but you should + really sign any public release tags, so pass '-s'. + + follows the format: + + 1.2-alpha3 + 1.2-beta3 + 1.2-rc3 + 1.2 + 1.2.13-rc4 + 1.2.13 + etc. + + This tool will take care of correctly naming the tag to be + consistent with FreeSWITCH git policy from there. + +OPTIONS + -s + Signs the resulting tag. + + -d + Debug mode. Remove the tag after creating it and don't warn about + the lack of a signature. + +EOF + exit 1; } -while getopts "s" o; do - case "$o" in - s) opts="-s" ;; - esac +opts="" +debug=false +while getopts "ds" o; do + case "$o" in + d) debug=true ;; + s) opts="-s" ;; + esac done shift $(($OPTIND-1)) if [ -z "$1" ]; then - showusage + showusage fi -ver="$1" -major=$(echo "$ver" | cut -d. -f1) -minor=$(echo "$ver" | cut -d. -f2) -micro=$(echo "$ver" | cut -d. -f3) -rev=$(echo "$ver" | cut -d. -f4) +eval $(parse_version "$1") +ngrep () { (echo "$2" | grep -e "$1" >/dev/null); } +err () { echo "$1" >&2; exit 1; } -dst_name="freeswitch-$major.$minor.$micro" -dst_dir="$src_repo/../$dst_name" +ngrep '^[1-9]*$' "$gmajor" || \ + err "The major version '$gmajor' appears invalid." +ngrep '^[0-9]*$' "$gminor" || \ + err "The minor version '$gminor' appears invalid." +[ -z "$gmicro" ] || ngrep '^[0-9]*$' "$gmicro" || \ + err "The micro version '$gmicro' appears invalid." +[ -z "$grev" ] || ngrep '^[.-]' "$grev" || \ + err "The revision '$grev' appears invalid." -if [ -d "$dst_dir" ]; then - echo "error: destination directory $dst_dir already exists." 1>&2 - exit 1; +echo "We're going to release freeswitch v$gver" >&2 +echo >&2 + +if ! ($debug || ngrep '-s' "$opts"); then + cat >&2 <&2 + read r + [ -z "$r" ] && continue + if [ "$r" = yes ] || [ "$r" = y ]; then + (echo; echo "OK, I believe you."; echo) >&2 + break + else + (echo; echo "This is a bad idea then."; echo) >&2 + fi + while true; do + echo -n "Are you really really sure? (yes/no): " >&2 + read r + [ -z "$r" ] && continue + if [ "$r" = yes ] || [ "$r" = y ]; then + (echo; echo "As you wish, you've been warned."; echo) >&2 + break + else + (echo; echo "Great; go setup a GPG key and try again with -s"; echo) >&2 + exit 1 + fi + break + done + break + done fi -# save local changes +echo "Saving uncommitted changes before tagging..." >&2 ret=$(git stash save "Save uncommitted changes before tagging.") -if echo $ret | grep "^Saved"; then - stash_saved=1 +if (ngrep '^Saved' "$ret"); then + stash_saved=1 fi -sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \ - -e "s|\(AC_SUBST(SWITCH_VERSION_MINOR, \[\).*\(\])\)|\1$minor\2|" \ - -e "s|\(AC_SUBST(SWITCH_VERSION_MICRO, \[\).*\(\])\)|\1$micro\2|" \ - -e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], BUG-REPORT-ADDRESS)\)|\1$major.$minor.$micro\2|" \ - -i configure.in - -if [ -n "$rev" ]; then - sed -e "s|\(AC_SUBST(SWITCH_VERSION_REVISION, \[\).*\(\])\)|\1$rev\2|" \ - -e "s|#\(AC_SUBST(SWITCH_VERSION_REVISION\)|\1|" \ - -i configure.in +echo "Determining next-release (release+1) version..." >&2 +if [ -n "$grev" ] && ngrep '[0-9]*$' "$grev"; then + rev_ver="$(echo "$grev" | sed -e 's/^[^0-9]*\([0-9]*\)$/\1/')" + next_rev="$((rev_ver+1))" + next_ver="${gver%%$rev_ver}${next_rev}" +elif [ -n "$grev" ]; then + next_ver="${gver}1" +elif ! [ "$gmicro" = "0" ]; then + next_ver="${gver%%$micro}$((micro+1))" +else + next_ver="${gmajor}.$((gminor+1))-rc1" fi +echo "Setting next-release version ($next_ver)..." >&2 +echo "${next_ver}" > build/next-release.txt +git add build/next-release.txt +echo "Changing the version of configure.in..." >&2 +set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" + +echo "Committing the new version..." >&2 git add configure.in -git commit -m "Release freeswitch-$ver" -git tag -a ${opts} -m "freeswitch-$ver release" v$ver +if ! (git commit --allow-empty -m "release FreeSWITCH $gver"); then + cat >&2 <&2 +if ! (git tag -a ${opts} -m "FreeSWITCH $gver" "v$gver"); then + cat >&2 < $dst_name.tar.gz || echo "gzip not available" -bzip2 -z -k $dst_name.tar || echo "bzip2 not available" -xz -z -9 -k $dst_name.tar || echo "xz / xz-utils not available" -rm -rf $dst_name.tar $dst_dir +EOF + err "Stopping here." +fi + +if $debug; then + (echo; echo "We're in debug mode, so we're cleaning up...") >&2 + git tag -d "v$gver" || true + git reset --hard HEAD^ || true +fi + +if [ -n "$stash_saved" ]; then + echo "Restoring your uncommitted changes to your working directory..." >&2 + git stash pop >/dev/null +fi cat 1>&2 < + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h index 68376c273c..0005008252 100644 --- a/src/include/private/switch_core_pvt.h +++ b/src/include/private/switch_core_pvt.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -120,6 +120,7 @@ struct switch_core_session { switch_codec_t *video_write_codec; switch_codec_implementation_t read_impl; + switch_codec_implementation_t real_read_impl; switch_codec_implementation_t write_impl; switch_codec_implementation_t video_read_impl; switch_codec_implementation_t video_write_impl; @@ -171,6 +172,8 @@ struct switch_core_session { uint32_t soft_lock; switch_ivr_dmachine_t *dmachine[2]; plc_state_t *plc; + uint8_t recur_buffer[SWITCH_RECOMMENDED_BUFFER_SIZE]; + switch_size_t recur_buffer_len; }; struct switch_media_bug { @@ -199,6 +202,7 @@ struct switch_media_bug { uint32_t record_pre_buffer_count; uint32_t record_pre_buffer_max; switch_frame_t *ping_frame; + switch_frame_t *read_demux_frame; struct switch_media_bug *next; }; @@ -261,6 +265,10 @@ struct switch_runtime { uint32_t db_handle_timeout; int cpu_count; uint32_t time_sync; + char *core_db_pre_trans_execute; + char *core_db_post_trans_execute; + char *core_db_inner_pre_trans_execute; + char *core_db_inner_post_trans_execute; }; extern struct switch_runtime runtime; diff --git a/src/include/switch.h b/src/include/switch.h index de099f1b94..3e1bfbb77f 100644 --- a/src/include/switch.h +++ b/src/include/switch.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_apr.h b/src/include/switch_apr.h index 0c8673570f..91faf06e16 100644 --- a/src/include/switch_apr.h +++ b/src/include/switch_apr.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1604,8 +1604,14 @@ SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_ */ SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, switch_thread_t *thd); - /** @} */ +/** + * Return a human readable string describing the specified error. + * @param statcode The error code the get a string for. + * @param buf A buffer to hold the error string. + * @bufsize Size of the buffer to hold the string. + */ +SWITCH_DECLARE(char *) switch_strerror(switch_status_t statcode, char *buf, switch_size_t bufsize); diff --git a/src/include/switch_bitpack.h b/src/include/switch_bitpack.h index 3209cbc282..af32b9025d 100644 --- a/src/include/switch_bitpack.h +++ b/src/include/switch_bitpack.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_buffer.h b/src/include/switch_buffer.h index 751439d1ad..920d3965fe 100644 --- a/src/include/switch_buffer.h +++ b/src/include/switch_buffer.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_caller.h b/src/include/switch_caller.h index 09ff57beb6..3618858819 100644 --- a/src/include/switch_caller.h +++ b/src/include/switch_caller.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_channel.h b/src/include/switch_channel.h index d566434457..2348a4cc54 100644 --- a/src/include/switch_channel.h +++ b/src/include/switch_channel.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -273,6 +273,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_hold_music_partner(switch_channe SWITCH_DECLARE(uint32_t) switch_channel_del_variable_prefix(switch_channel_t *channel, const char *prefix); +#define switch_channel_set_variable_safe(_channel, _var, _val) switch_channel_set_variable_var_check(_channel, _var, _val, SWITCH_FALSE) #define switch_channel_set_variable(_channel, _var, _val) switch_channel_set_variable_var_check(_channel, _var, _val, SWITCH_TRUE) #define switch_channel_set_variable_partner(_channel, _var, _val) switch_channel_set_variable_partner_var_check(_channel, _var, _val, SWITCH_TRUE) @@ -592,8 +593,8 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(_In_ switch_channel_ \return the original string if no expansion takes place otherwise a new string that must be freed \note it's necessary to test if the return val is the same as the input and free the string if it is not. */ -SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *channel, const char *in, switch_event_t *var_list, switch_event_t *api_list); -#define switch_channel_expand_variables(_channel, _in) switch_channel_expand_variables_check(_channel, _in, NULL, NULL) +SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *channel, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur); +#define switch_channel_expand_variables(_channel, _in) switch_channel_expand_variables_check(_channel, _in, NULL, NULL, 0) SWITCH_DECLARE(char *) switch_channel_build_param_string(_In_ switch_channel_t *channel, _In_opt_ switch_caller_profile_t *caller_profile, @@ -640,6 +641,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_api_on(switch_channel_t *channel, SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_queued_extension(switch_channel_t *channel); SWITCH_DECLARE(void) switch_channel_transfer_to_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension); +SWITCH_DECLARE(const char *) switch_channel_get_partner_uuid(switch_channel_t *channel); SWITCH_END_EXTERN_C #endif diff --git a/src/include/switch_config.h b/src/include/switch_config.h index b0ef805b52..fab6832e20 100644 --- a/src/include/switch_config.h +++ b/src/include/switch_config.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_console.h b/src/include/switch_console.h index 5585a041c1..9a88f3c229 100644 --- a/src/include/switch_console.h +++ b/src/include/switch_console.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_core.h b/src/include/switch_core.h index 1e3bfcba76..05d6e0aa48 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -137,6 +137,11 @@ SWITCH_DECLARE(void) switch_core_session_disable_heartbeat(switch_core_session_t #define switch_core_session_get_name(_s) switch_channel_get_name(switch_core_session_get_channel(_s)) +SWITCH_DECLARE(switch_status_t) switch_core_media_bug_pop(switch_core_session_t *orig_session, const char *function, switch_media_bug_t **pop); + +SWITCH_DECLARE(switch_status_t) switch_core_media_bug_exec_all(switch_core_session_t *orig_session, + const char *function, switch_media_bug_exec_cb_t cb, void *user_data); +SWITCH_DECLARE(uint32_t) switch_core_media_bug_count(switch_core_session_t *orig_session, const char *function); /*! \brief Add a media bug to the session \param session the session to add the bug to @@ -193,7 +198,7 @@ SWITCH_DECLARE(void) switch_core_media_bug_set_write_replace_frame(_In_ switch_m \param bug the bug to get the data from */ SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_read_replace_frame(_In_ switch_media_bug_t *bug); - +SWITCH_DECLARE(void) switch_core_media_bug_set_read_demux_frame(_In_ switch_media_bug_t *bug, _In_ switch_frame_t *frame); /*! \brief Obtain the session from a media bug \param bug the bug to get the data from @@ -225,6 +230,7 @@ SWITCH_DECLARE(uint32_t) switch_core_cpu_count(void); \param bug bug to remove \return SWITCH_STATUS_SUCCESS if the operation was a success */ + SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(_In_ switch_core_session_t *session, _Inout_ switch_media_bug_t **bug); SWITCH_DECLARE(uint32_t) switch_core_media_bug_prune(switch_core_session_t *session); @@ -247,7 +253,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_close(_Inout_ switch_media \param session the session to remove the bugs from \return SWITCH_STATUS_SUCCESS if the operation was a success */ -SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(_In_ switch_core_session_t *session); +SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all_function(_In_ switch_core_session_t *session, const char *function); + +#define switch_core_media_bug_remove_all(_s) switch_core_media_bug_remove_all_function(_s, NULL) SWITCH_DECLARE(switch_status_t) switch_core_media_bug_enumerate(switch_core_session_t *session, switch_stream_handle_t *stream); SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session); @@ -1492,6 +1500,7 @@ SWITCH_DECLARE(void) switch_core_session_unlock_codec_read(_In_ switch_core_sess SWITCH_DECLARE(switch_status_t) switch_core_session_get_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp); +SWITCH_DECLARE(switch_status_t) switch_core_session_get_real_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp); SWITCH_DECLARE(switch_status_t) switch_core_session_get_write_impl(switch_core_session_t *session, switch_codec_implementation_t *impp); SWITCH_DECLARE(switch_status_t) switch_core_session_get_video_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp); SWITCH_DECLARE(switch_status_t) switch_core_session_get_video_write_impl(switch_core_session_t *session, switch_codec_implementation_t *impp); @@ -2291,10 +2300,12 @@ SWITCH_DECLARE(uint32_t) switch_default_ptime(const char *name, uint32_t number) \param [in] network_ip \param [in] network_port \param [in] network_proto - one of tls, tcp, udp + \param [in] metadata - generic metadata supplied by module \param [out] err - Error if it exists */ SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, const char *realm, const char *token, const char *url, uint32_t expires, - const char *network_ip, const char *network_port, const char *network_proto); + const char *network_ip, const char *network_port, const char *network_proto, + const char *metadata); /*! \brief Delete user registration \param [in] user @@ -2319,6 +2330,8 @@ SWITCH_DECLARE(switch_status_t) switch_say_file_handle_create(switch_say_file_ha SWITCH_DECLARE(void) switch_say_file(switch_say_file_handle_t *sh, const char *fmt, ...); SWITCH_DECLARE(int) switch_max_file_desc(void); SWITCH_DECLARE(void) switch_close_extra_files(int *keep, int keep_ttl); +SWITCH_DECLARE(switch_status_t) switch_core_thread_set_cpu_affinity(int cpu); +SWITCH_DECLARE(void) switch_os_yield(void); SWITCH_END_EXTERN_C #endif diff --git a/src/include/switch_core_db.h b/src/include/switch_core_db.h index f72c3c5f45..e5fbf76a95 100644 --- a/src/include/switch_core_db.h +++ b/src/include/switch_core_db.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_core_event_hook.h b/src/include/switch_core_event_hook.h index ff836b3978..8f16706dd6 100644 --- a/src/include/switch_core_event_hook.h +++ b/src/include/switch_core_event_hook.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_curl.h b/src/include/switch_curl.h index a404bffb34..73cfef7474 100644 --- a/src/include/switch_curl.h +++ b/src/include/switch_curl.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2010, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_event.h b/src/include/switch_event.h index c77e4aebb4..5909c0e0c0 100644 --- a/src/include/switch_event.h +++ b/src/include/switch_event.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -330,8 +330,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, con SWITCH_DECLARE(switch_status_t) switch_event_set_body(switch_event_t *event, const char *body); -SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, const char *in, switch_event_t *var_list, switch_event_t *api_list); -#define switch_event_expand_headers(_event, _in) switch_event_expand_headers_check(_event, _in, NULL, NULL) +SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur); +#define switch_event_expand_headers(_event, _in) switch_event_expand_headers_check(_event, _in, NULL, NULL, 0) SWITCH_DECLARE(switch_status_t) switch_event_create_pres_in_detailed(_In_z_ char *file, _In_z_ char *func, _In_ int line, _In_z_ const char *proto, _In_z_ const char *login, @@ -402,6 +402,8 @@ SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event); SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, const char *prefix, switch_hash_t *vars_map); SWITCH_DECLARE(int) switch_event_check_permission_list(switch_event_t *list, const char *name); +SWITCH_DECLARE(void) switch_event_add_presence_data_cols(switch_channel_t *channel, switch_event_t *event, const char *prefix); + ///\} SWITCH_END_EXTERN_C diff --git a/src/include/switch_frame.h b/src/include/switch_frame.h index edc4f8be6c..91910f85dd 100644 --- a/src/include/switch_frame.h +++ b/src/include/switch_frame.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h index 0fb3c83e7f..9299c584d9 100644 --- a/src/include/switch_ivr.h +++ b/src/include/switch_ivr.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -41,6 +41,7 @@ #define SWITCH_IVR_H #include +#include "switch_json.h" SWITCH_BEGIN_EXTERN_C struct switch_unicast_conninfo { switch_core_session_t *session; @@ -82,6 +83,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_activate_unicast(switch_core_session_ char *local_ip, switch_port_t local_port, char *remote_ip, switch_port_t remote_port, char *transport, char *flags); +/*! + \brief Generate an JSON CDR report. + \param session the session to get the data from. + \param json_cdr pointer to the json object + \return SWITCH_STATUS_SUCCESS if successful + \note on success the json object must be freed +*/ +SWITCH_DECLARE(switch_status_t) switch_ivr_generate_json_cdr(switch_core_session_t *session, cJSON **json_cdr, switch_bool_t urlencode); /*! \brief Generate an XML CDR report. @@ -269,6 +278,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(swit */ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, uint32_t limit, switch_file_handle_t *fh); + +SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_pop_eavesdropper(switch_core_session_t *session, switch_core_session_t **sessionp); +SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_exec_all(switch_core_session_t *session, const char *app, const char *arg); +SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_update_display(switch_core_session_t *session, const char *name, const char *number); + /*! \brief Eavesdrop on a another session \param session our session @@ -956,6 +970,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_insert_file(switch_core_session_t *se SWITCH_DECLARE(switch_status_t) switch_ivr_create_message_reply(switch_event_t **reply, switch_event_t *message, const char *new_proto); SWITCH_DECLARE(char *) switch_ivr_check_presence_mapping(const char *exten_name, const char *domain_name); SWITCH_DECLARE(switch_status_t) switch_ivr_kill_uuid(const char *uuid, switch_call_cause_t cause); +SWITCH_DECLARE(switch_status_t) switch_ivr_blind_transfer_ack(switch_core_session_t *session, switch_bool_t success); /** @} */ diff --git a/src/include/switch_limit.h b/src/include/switch_limit.h index 4488b8caf0..fa9d1181fc 100644 --- a/src/include/switch_limit.h +++ b/src/include/switch_limit.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_loadable_module.h b/src/include/switch_loadable_module.h index 62fcac2343..3edc4dc8a7 100644 --- a/src/include/switch_loadable_module.h +++ b/src/include/switch_loadable_module.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -115,6 +115,8 @@ SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoin */ SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(const char *name); +SWITCH_DECLARE(char *) switch_parse_codec_buf(char *buf, uint32_t *interval, uint32_t *rate, uint32_t *bit); + /*! \brief Retrieve the dialplan interface by it's registered name \param name the name of the dialplan diff --git a/src/include/switch_log.h b/src/include/switch_log.h index 170425a2a4..a44aa29a01 100644 --- a/src/include/switch_log.h +++ b/src/include/switch_log.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h index acb85407c7..af85e3ed7c 100644 --- a/src/include/switch_module_interfaces.h +++ b/src/include/switch_module_interfaces.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_nat.h b/src/include/switch_nat.h index 492dbfb29d..dae74073ff 100644 --- a/src/include/switch_nat.h +++ b/src/include/switch_nat.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_odbc.h b/src/include/switch_odbc.h index 103fe0f0d7..fd3ff888ef 100644 --- a/src/include/switch_odbc.h +++ b/src/include/switch_odbc.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_platform.h b/src/include/switch_platform.h index 17c972c989..a011850748 100644 --- a/src/include/switch_platform.h +++ b/src/include/switch_platform.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -258,8 +258,12 @@ typedef intptr_t switch_ssize_t; #endif #ifndef TIME_T_FMT +#if defined(__FreeBSD__) && SIZEOF_VOIDP == 4 +#define TIME_T_FMT "d" +#else #define TIME_T_FMT "ld" #endif +#endif #endif diff --git a/src/include/switch_regex.h b/src/include/switch_regex.h index 6558299b53..393341fd43 100644 --- a/src/include/switch_regex.h +++ b/src/include/switch_regex.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_resample.h b/src/include/switch_resample.h index 3dff620c4b..f85a61f065 100644 --- a/src/include/switch_resample.h +++ b/src/include/switch_resample.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -170,7 +170,7 @@ SWITCH_DECLARE(void) switch_change_sln_volume_granular(int16_t *data, uint32_t s ///\} SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples); - +SWITCH_DECLARE(uint32_t) switch_unmerge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples); SWITCH_DECLARE(void) switch_mux_channels(int16_t *data, switch_size_t samples, uint32_t channels); SWITCH_END_EXTERN_C diff --git a/src/include/switch_rtcp_frame.h b/src/include/switch_rtcp_frame.h index 5d06294304..7e034169e1 100644 --- a/src/include/switch_rtcp_frame.h +++ b/src/include/switch_rtcp_frame.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index a61326a6b8..9d1de7a193 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -461,6 +461,7 @@ SWITCH_DECLARE(void) switch_rtp_intentional_bugs(switch_rtp_t *rtp_session, swit SWITCH_DECLARE(switch_rtp_stats_t *) switch_rtp_get_stats(switch_rtp_t *rtp_session, switch_memory_pool_t *pool); SWITCH_DECLARE(switch_byte_t) switch_rtp_check_auto_adj(switch_rtp_t *rtp_session); +SWITCH_DECLARE(void) switch_rtp_set_interdigit_delay(switch_rtp_t *rtp_session, uint32_t delay); /*! \} diff --git a/src/include/switch_scheduler.h b/src/include/switch_scheduler.h index 8db9696f4a..6a69371d59 100644 --- a/src/include/switch_scheduler.h +++ b/src/include/switch_scheduler.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_ssl.h b/src/include/switch_ssl.h index 46cdd5cbbe..70d675e16b 100644 --- a/src/include/switch_ssl.h +++ b/src/include/switch_ssl.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2010, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_stun.h b/src/include/switch_stun.h index 426eb49628..7159cf1f3b 100644 --- a/src/include/switch_stun.h +++ b/src/include/switch_stun.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 185fdb64af..5d62b597ee 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -129,7 +129,9 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE "enable_heartbeat_events" #define SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE "bypass_media_after_bridge" #define SWITCH_READ_RESULT_VARIABLE "read_result" +#define SWITCH_ATT_XFER_RESULT_VARIABLE "att_xfer_result" #define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr" +#define SWITCH_COPY_JSON_CDR_VARIABLE "copy_json_cdr" #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application" #define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause" #define SWITCH_TRANSFER_HISTORY_VARIABLE "transfer_history" @@ -168,6 +170,7 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME "__cache_speech_handles_obj__" #define SWITCH_BYPASS_MEDIA_VARIABLE "bypass_media" #define SWITCH_PROXY_MEDIA_VARIABLE "proxy_media" +#define SWITCH_ZRTP_PASSTHRU_VARIABLE "zrtp_passthru" #define SWITCH_ENDPOINT_DISPOSITION_VARIABLE "endpoint_disposition" #define SWITCH_HOLD_MUSIC_VARIABLE "hold_music" #define SWITCH_TEMP_HOLD_MUSIC_VARIABLE "temp_hold_music" @@ -180,6 +183,7 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_LAST_BRIDGE_VARIABLE "last_bridge_to" #define SWITCH_SIGNAL_BRIDGE_VARIABLE "signal_bridge_to" #define SWITCH_SIGNAL_BOND_VARIABLE "signal_bond" +#define SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE "originate_signal_bond" #define SWITCH_ORIGINATOR_VARIABLE "originator" #define SWITCH_ORIGINATOR_CODEC_VARIABLE "originator_codec" #define SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE "originator_video_codec" @@ -287,7 +291,8 @@ typedef enum { ED_NONE = 0, ED_MUX_READ = (1 << 0), ED_MUX_WRITE = (1 << 1), - ED_DTMF = (1 << 2) + ED_DTMF = (1 << 2), + ED_COPY_DISPLAY = (1 << 3) } switch_eavesdrop_flag_enum_t; typedef uint32_t switch_eavesdrop_flag_t; @@ -884,6 +889,7 @@ typedef enum { SWITCH_MESSAGE_INDICATE_SIGNAL_DATA, SWITCH_MESSAGE_INDICATE_INFO, SWITCH_MESSAGE_INDICATE_AUDIO_DATA, + SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE, SWITCH_MESSAGE_INVALID } switch_core_session_message_types_t; @@ -1209,8 +1215,12 @@ typedef enum { CF_VIDEO_REFRESH_REQ, CF_SERVICE_AUDIO, CF_SERVICE_VIDEO, + CF_ZRTP_PASSTHRU_REQ, + CF_ZRTP_PASSTHRU, CF_ZRTP_HASH, - CF_ZRTP_PASS, + CF_CHANNEL_SWAP, + CF_PICKUP, + CF_CONFIRM_BLIND_TRANSFER, /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */ /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */ CF_FLAG_MAX @@ -1431,7 +1441,8 @@ typedef enum { SMBF_THREAD_LOCK = (1 << 7), SMBF_PRUNE = (1 << 8), SMBF_NO_PAUSE = (1 << 9), - SMBF_STEREO_SWAP = (1 << 10) + SMBF_STEREO_SWAP = (1 << 10), + SMBF_LOCK = (1 << 11) } switch_media_bug_flag_enum_t; typedef uint32_t switch_media_bug_flag_t; @@ -1818,6 +1829,8 @@ struct switch_console_callback_match { }; typedef struct switch_console_callback_match switch_console_callback_match_t; +typedef void (*switch_media_bug_exec_cb_t)(switch_media_bug_t *bug, void *user_data); + typedef void (*switch_cap_callback_t) (const char *var, const char *val, void *user_data); typedef switch_status_t (*switch_console_complete_callback_t) (const char *, const char *, switch_console_callback_match_t **matches); typedef switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void *, switch_abc_type_t); diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index cce5abfa2d..40560a0434 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_version.h.cmake b/src/include/switch_version.h.cmake index 6510dba154..6e36b0b1da 100644 --- a/src/include/switch_version.h.cmake +++ b/src/include/switch_version.h.cmake @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2006, Anthony Minessale II + * Copyright (C) 2005/2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_version.h.template b/src/include/switch_version.h.template index c0e75b526e..2f75d75266 100644 --- a/src/include/switch_version.h.template +++ b/src/include/switch_version.h.template @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2006, Anthony Minessale II + * Copyright (C) 2005/2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/switch_xml.h b/src/include/switch_xml.h index 0d436fac2f..f2a6eb3220 100644 --- a/src/include/switch_xml.h +++ b/src/include/switch_xml.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -214,7 +214,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_get(_In_ switch_xml_t xml,...); ///\param prn_header add header too ///\return the xml text string SWITCH_DECLARE(char *) switch_xml_toxml(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header); - +SWITCH_DECLARE(char *) switch_xml_toxml_nolock(switch_xml_t xml, _In_ switch_bool_t prn_header); ///\brief Converts an switch_xml structure back to xml using the buffer passed in the parameters. ///\param xml the xml node ///\param buf buffer to use diff --git a/src/include/switch_xml_config.h b/src/include/switch_xml_config.h index 49986c9211..fc669e4fc1 100644 --- a/src/include/switch_xml_config.h +++ b/src/include/switch_xml_config.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/include/timerfd_wrap.h b/src/include/timerfd_wrap.h index bb751c93a2..7196a6c1e0 100644 --- a/src/include/timerfd_wrap.h +++ b/src/include/timerfd_wrap.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/.gitignore b/src/mod/.gitignore index f7a1c41eea..c4ba547b10 100644 --- a/src/mod/.gitignore +++ b/src/mod/.gitignore @@ -14,6 +14,7 @@ /applications/mod_fax/mod_fax.log /applications/mod_fifo/Makefile /applications/mod_fsv/Makefile +/applications/mod_httapi/Makefile /applications/mod_limit/Makefile /applications/mod_sms/Makefile /applications/mod_spandsp/Makefile @@ -62,5 +63,7 @@ /loggers/mod_logfile/Makefile /loggers/mod_syslog/Makefile /say/mod_say_en/Makefile +/say/mod_say_ja/Makefile /say/mod_say_ru/Makefile +/timers/mod_posix_timer/Makefile /timers/mod_timerfd/Makefile diff --git a/src/mod/applications/mod_abstraction/mod_abstraction.c b/src/mod/applications/mod_abstraction/mod_abstraction.c index b1af6a6271..7f7e5cb01c 100644 --- a/src/mod/applications/mod_abstraction/mod_abstraction.c +++ b/src/mod/applications/mod_abstraction/mod_abstraction.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_avmd/mod_avmd.c b/src/mod/applications/mod_avmd/mod_avmd.c index d0c9f6e419..ce3aed0916 100644 --- a/src/mod/applications/mod_avmd/mod_avmd.c +++ b/src/mod/applications/mod_avmd/mod_avmd.c @@ -59,13 +59,17 @@ #define TO_HZ(r, f) (((r) * (f)) / (2.0 * M_PI)) /*! Minimum beep frequency in Hertz */ #define MIN_FREQUENCY (300.0) +#define MIN_FREQUENCY_R(r) ((2.0 * M_PI * MIN_FREQUENCY) / (r)) /*! Maximum beep frequency in Hertz */ -#define MAX_FREQUENCY (1500.0) +#define MAX_FREQUENCY (2500.0) +#define MAX_FREQUENCY_R(r) ((2.0 * M_PI * MAX_FREQUENCY) / (r)) +/* decrease this value to eliminate false positives */ +#define VARIANCE_THRESHOLD (0.001) #include "amplitude.h" #include "buffer.h" #include "desa2.h" -#include "goertzel.h" +//#include "goertzel.h" #include "psi.h" #include "sma_buf.h" #include "options.h" @@ -111,7 +115,9 @@ typedef struct { uint32_t rate; circ_buffer_t b; sma_buffer_t sma_b; + sma_buffer_t sqa_b; size_t pos; + double f; /* freq_table_t ft; */ avmd_state_t state; } avmd_session_t; @@ -134,6 +140,7 @@ static void init_avmd_session_data(avmd_session_t *avmd_session, switch_core_se avmd_session->session = fs_session; avmd_session->pos = 0; + avmd_session->f = 0.0; avmd_session->state.last_beep = 0; avmd_session->state.beep_state = BEEP_NOTDETECTED; @@ -142,6 +149,12 @@ static void init_avmd_session_data(avmd_session_t *avmd_session, switch_core_se BEEP_LEN(avmd_session->rate) / SINE_LEN(avmd_session->rate), fs_session ); + + INIT_SMA_BUFFER( + &avmd_session->sqa_b, + BEEP_LEN(avmd_session->rate) / SINE_LEN(avmd_session->rate), + fs_session + ); } @@ -474,17 +487,18 @@ static void avmd_process(avmd_session_t *session, switch_frame_t *frame) circ_buffer_t *b; size_t pos; double f; - double a; - double error = 0.0; - double success = 0.0; - double amp = 0.0; - double s_rate; + double v; +// double error = 0.0; +// double success = 0.0; +// double amp = 0.0; +// double s_rate; // double e_rate; - double avg_a; - double sine_len; +// double avg_a; + //double sine_len; uint32_t sine_len_i; - int valid; - + //uint32_t beep_len_i; +// int valid; + b = &session->b; /*! If beep has already been detected skip the CPU heavy stuff */ @@ -494,57 +508,39 @@ static void avmd_process(avmd_session_t *session, switch_frame_t *frame) /*! Precompute values used heavily in the inner loop */ sine_len_i = SINE_LEN(session->rate); - sine_len = (double)sine_len_i; - - + //sine_len = (double)sine_len_i; + //beep_len_i = BEEP_LEN(session->rate); + channel = switch_core_session_get_channel(session->session); /*! Insert frame of 16 bit samples into buffer */ INSERT_INT16_FRAME(b, (int16_t *)(frame->data), frame->samples); + //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session->session), SWITCH_LOG_INFO, "<<< AVMD sine_len_i=%d >>>\n", sine_len_i); + /*! INNER LOOP -- OPTIMIZATION TARGET */ - for(pos = GET_BACKLOG_POS(b); pos != (GET_CURRENT_POS(b) - P); pos++){ + for(pos = session->pos; pos < (GET_CURRENT_POS(b) - P); pos++){ + if ((pos % sine_len_i) == 0) { + /*! Get a desa2 frequency estimate every sine len */ + f = desa2(b, pos); - /*! Get a desa2 frequency estimate in Hertz */ - f = TO_HZ(session->rate, desa2(b, pos)); + if(f < MIN_FREQUENCY_R(session->rate) || f > MAX_FREQUENCY_R(session->rate)) { + v = 99999.0; + RESET_SMA_BUFFER(&session->sma_b); + RESET_SMA_BUFFER(&session->sqa_b); + } else { + APPEND_SMA_VAL(&session->sma_b, f); + APPEND_SMA_VAL(&session->sqa_b, f * f); + + /* calculate variance */ + v = session->sqa_b.sma - (session->sma_b.sma * session->sma_b.sma); - /*! Don't caculate amplitude if frequency is not within range */ - if(f < MIN_FREQUENCY || f > MAX_FREQUENCY) { - a = 0.0; - error += 1.0; - } else { - a = amplitude(b, pos, f); - success += 1.0; - if(!ISNAN(a)){ - amp += a; - } - } - - /*! Every once in a while we evaluate the desa2 and amplitude results */ - if(((pos + 1) % sine_len_i) == 0){ - s_rate = success / (error + success); -// e_rate = error / (error + success); - avg_a = amp / sine_len; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session->session), SWITCH_LOG_INFO, "<<< AVMD v=%f f=%f %fHz sma=%f sqa=%f >>>\n", v, f, TO_HZ(session->rate, f), session->sma_b.sma, session->sqa_b.sma); + } - /*! Results out of these ranges are considered invalid */ - valid = 0; - if( s_rate > 0.60 && avg_a > 0.50) valid = 1; - else if(s_rate > 0.65 && avg_a > 0.45) valid = 1; - else if(s_rate > 0.70 && avg_a > 0.40) valid = 1; - else if(s_rate > 0.80 && avg_a > 0.30) valid = 1; - else if(s_rate > 0.95 && avg_a > 0.05) valid = 1; - else if(s_rate >= 0.99 && avg_a > 0.04) valid = 1; - else if(s_rate == 1.00 && avg_a > 0.02) valid = 1; + /*! If variance is less than threshold then we have detection */ + if(v < VARIANCE_THRESHOLD){ - if(valid) { - APPEND_SMA_VAL(&session->sma_b, s_rate * avg_a); - } - else { - APPEND_SMA_VAL(&session->sma_b, 0.0 ); - } - - /*! If sma is higher then 0 we have some kind of detection (increase this value to eliminate false positives ex: 0.01) */ - if(session->sma_b.sma > 0.00){ /*! Throw an event to FreeSWITCH */ status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, AVMD_EVENT_BEEP); if(status != SWITCH_STATUS_SUCCESS) { @@ -565,16 +561,18 @@ static void avmd_process(avmd_session_t *session, switch_frame_t *frame) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session->session), SWITCH_LOG_INFO, "<<< AVMD - Beep Detected >>>\n"); switch_channel_set_variable(channel, "avmd_detect", "TRUE"); RESET_SMA_BUFFER(&session->sma_b); + RESET_SMA_BUFFER(&session->sqa_b); session->state.beep_state = BEEP_DETECTED; return; } - amp = 0.0; - success = 0.0; - error = 0.0; + //amp = 0.0; + //success = 0.0; + //error = 0.0; } } + session->pos = pos; } /* For Emacs: diff --git a/src/mod/applications/mod_blacklist/mod_blacklist.c b/src/mod/applications/mod_blacklist/mod_blacklist.c index 39db253396..c05a533e6b 100644 --- a/src/mod/applications/mod_blacklist/mod_blacklist.c +++ b/src/mod/applications/mod_blacklist/mod_blacklist.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 277026a3c6..df8670f2ee 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1466,6 +1466,8 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa switch_event_add_header(ovars, SWITCH_STACK_BOTTOM, "ignore_early_media", "true"); switch_event_add_header(ovars, SWITCH_STACK_BOTTOM, "origination_uuid", "%s", agent_uuid_str); + switch_channel_process_export(member_channel, NULL, ovars, "cc_export_vars"); + t_agent_called = local_epoch_time_now(NULL); dialstr = switch_mprintf("%s", h->originate_string); status = switch_ivr_originate(NULL, &agent_session, &cause, dialstr, 60, NULL, cid_name ? cid_name : h->member_cid_name, h->member_cid_number, NULL, ovars, SOF_NONE, NULL); @@ -1534,7 +1536,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa /* Wait for the real channel to be fully bridged */ switch_channel_wait_for_flag(other_loopback_channel, CF_BRIDGED, SWITCH_TRUE, 5000, member_channel); - real_uuid = switch_channel_get_variable(other_loopback_channel, SWITCH_SIGNAL_BOND_VARIABLE); + real_uuid = switch_channel_get_partner_uuid(other_loopback_channel); switch_channel_set_variable(other_loopback_channel, "cc_member_pre_answer_uuid", NULL); /* Switch the agent session */ diff --git a/src/mod/applications/mod_cidlookup/mod_cidlookup.c b/src/mod/applications/mod_cidlookup/mod_cidlookup.c index fc32e6fe21..562cea7f5f 100755 --- a/src/mod/applications/mod_cidlookup/mod_cidlookup.c +++ b/src/mod/applications/mod_cidlookup/mod_cidlookup.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -188,7 +188,7 @@ static switch_bool_t cidlookup_execute_sql_callback(char *sql, switch_core_db_ca switch_bool_t retval = SWITCH_FALSE; switch_cache_db_handle_t *dbh = NULL; - if (globals.odbc_dsn && (dbh = cidlookup_get_db_handle())) { + if (!zstr(globals.odbc_dsn) && (dbh = cidlookup_get_db_handle())) { if (switch_cache_db_execute_sql_callback(dbh, sql, callback, (void *) cbt, err) != SWITCH_STATUS_SUCCESS) { retval = SWITCH_FALSE; } else { @@ -533,7 +533,7 @@ static char *do_db_lookup(switch_memory_pool_t *pool, switch_event_t *event, con callback_t cbt = { 0 }; cbt.pool = pool; - if (globals.odbc_dsn) { + if (!zstr(globals.odbc_dsn)) { newsql = switch_event_expand_headers(event, sql); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "SQL: %s\n", newsql); if (cidlookup_execute_sql_callback(newsql, cidlookup_callback, &cbt, &err)) { @@ -655,8 +655,6 @@ static cid_data_t *do_lookup(switch_memory_pool_t *pool, switch_event_t *event, SWITCH_STANDARD_APP(cidlookup_app_function) { - switch_status_t status = SWITCH_STATUS_SUCCESS; - char *argv[4] = { 0 }; int argc; char *mydata = NULL; @@ -705,7 +703,7 @@ SWITCH_STANDARD_APP(cidlookup_app_function) if (switch_string_var_check_const(cid->name)) { switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_CRIT, "Invalid CID data {%s} contains a variable\n", cid->name); - switch_goto_status(SWITCH_STATUS_GENERR, done); + goto done; } if (cid && channel) { @@ -719,7 +717,6 @@ SWITCH_STANDARD_APP(cidlookup_app_function) profile->caller_id_name = switch_core_strdup(profile->pool, cid->name);; } - switch_goto_status(SWITCH_STATUS_SUCCESS, done); done: if (event) { @@ -728,9 +725,6 @@ SWITCH_STANDARD_APP(cidlookup_app_function) if (!session && pool) { switch_core_destroy_memory_pool(&pool); } - /* This is so compile doesn't failed because status is never used */ - if (status) { - } } SWITCH_STANDARD_API(cidlookup_function) diff --git a/src/mod/applications/mod_cluechoo/mod_cluechoo.c b/src/mod/applications/mod_cluechoo/mod_cluechoo.c index b4eaee0acb..a87aa09433 100644 --- a/src/mod/applications/mod_cluechoo/mod_cluechoo.c +++ b/src/mod/applications/mod_cluechoo/mod_cluechoo.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 08b7512306..fd80992531 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1559,27 +1559,22 @@ SWITCH_STANDARD_API(regex_function) goto error; } - if ((proceed = switch_regex_perform(argv[0], argv[1], &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) { - if (argc > 2) { - len = (strlen(argv[0]) + strlen(argv[2]) + 10) * proceed; - substituted = malloc(len); - switch_assert(substituted); - memset(substituted, 0, len); - switch_replace_char(argv[2], '%', '$', SWITCH_FALSE); - switch_perform_substitution(re, proceed, argv[2], argv[0], substituted, len, ovector); + proceed = switch_regex_perform(argv[0], argv[1], &re, ovector, sizeof(ovector) / sizeof(ovector[0])); - stream->write_function(stream, "%s", substituted); - free(substituted); - } else { - stream->write_function(stream, "true"); - } + if (argc > 2) { + len = (strlen(argv[0]) + strlen(argv[2]) + 10) * proceed; + substituted = malloc(len); + switch_assert(substituted); + memset(substituted, 0, len); + switch_replace_char(argv[2], '%', '$', SWITCH_FALSE); + switch_perform_substitution(re, proceed, argv[2], argv[0], substituted, len, ovector); + + stream->write_function(stream, "%s", substituted); + free(substituted); } else { - if (argc > 2) { - stream->write_function(stream, "%s", argv[0]); - } else { - stream->write_function(stream, "false"); - } + stream->write_function(stream, proceed ? "true" : "false"); } + goto ok; error: @@ -2649,9 +2644,10 @@ SWITCH_STANDARD_API(sched_hangup_function) char *cause_str = argv[2]; time_t when; switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT; + int sec = atol(argv[0] + 1); if (*argv[0] == '+') { - when = switch_epoch_time_now(NULL) + atol(argv[0] + 1); + when = switch_epoch_time_now(NULL) + sec; } else { when = atol(argv[0]); } @@ -2661,7 +2657,13 @@ SWITCH_STANDARD_API(sched_hangup_function) } if ((hsession = switch_core_session_locate(uuid))) { - switch_ivr_schedule_hangup(when, uuid, cause, SWITCH_FALSE); + if (sec == 0) { + switch_channel_t *hchannel = switch_core_session_get_channel(hsession); + switch_channel_hangup(hchannel, cause); + } else { + switch_ivr_schedule_hangup(when, uuid, cause, SWITCH_FALSE); + } + stream->write_function(stream, "+OK\n"); switch_core_session_rwunlock(hsession); } else { @@ -3087,6 +3089,45 @@ SWITCH_STANDARD_API(uuid_send_info_function) } +#define VIDEO_REFRESH_SYNTAX "" +SWITCH_STANDARD_API(uuid_video_refresh_function) +{ + switch_status_t status = SWITCH_STATUS_FALSE; + char *mycmd = NULL, *argv[2] = { 0 }; + int argc = 0; + + if (!zstr(cmd) && (mycmd = strdup(cmd))) { + argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argc < 1) { + stream->write_function(stream, "-USAGE: %s\n", VIDEO_REFRESH_SYNTAX); + } else { + switch_core_session_message_t msg = { 0 }; + switch_core_session_t *lsession = NULL; + + msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ; + msg.string_array_arg[2] = argv[1]; + msg.from = __FILE__; + + if ((lsession = switch_core_session_locate(argv[0]))) { + status = switch_core_session_receive_message(lsession, &msg); + switch_core_session_rwunlock(lsession); + } + } + + if (status == SWITCH_STATUS_SUCCESS) { + stream->write_function(stream, "+OK Success\n"); + } else { + stream->write_function(stream, "-ERR Operation Failed\n"); + } + + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; +} + + #define DEBUG_AUDIO_SYNTAX " " SWITCH_STANDARD_API(uuid_debug_audio_function) { @@ -3398,7 +3439,7 @@ SWITCH_STANDARD_API(break_function) channel = switch_core_session_get_channel(psession); if (both) { - const char *quuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *quuid = switch_channel_get_partner_uuid(channel); if (quuid && (qsession = switch_core_session_locate(quuid))) { qchannel = switch_core_session_get_channel(qsession); } @@ -5434,6 +5475,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) SWITCH_ADD_API(commands_api_interface, "uuid_hold", "hold", uuid_hold_function, HOLD_SYNTAX); SWITCH_ADD_API(commands_api_interface, "uuid_kill", "Kill Channel", kill_function, KILL_SYNTAX); SWITCH_ADD_API(commands_api_interface, "uuid_send_info", "Send info to the endpoint", uuid_send_info_function, INFO_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "uuid_video_refresh", "Send video refresh.", uuid_video_refresh_function, VIDEO_REFRESH_SYNTAX); SWITCH_ADD_API(commands_api_interface, "uuid_outgoing_answer", "Answer Outgoing Channel", outgoing_answer_function, OUTGOING_ANSWER_SYNTAX); SWITCH_ADD_API(commands_api_interface, "uuid_limit", "Increase limit resource", uuid_limit_function, LIMIT_SYNTAX); SWITCH_ADD_API(commands_api_interface, "uuid_limit_release", "Release limit resource", uuid_limit_release_function, LIMIT_RELEASE_SYNTAX); @@ -5598,6 +5640,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) switch_console_set_complete("add uuid_simplify ::console::list_uuid"); switch_console_set_complete("add uuid_transfer ::console::list_uuid"); switch_console_set_complete("add uuid_dual_transfer ::console::list_uuid"); + switch_console_set_complete("add uuid_video_refresh ::console::list_uuid"); switch_console_set_complete("add version"); switch_console_set_complete("add uuid_warning ::console::list_uuid"); switch_console_set_complete("add ..."); diff --git a/src/mod/applications/mod_conference/conf/autoload_configs/conference.conf.xml b/src/mod/applications/mod_conference/conf/autoload_configs/conference.conf.xml index 5a906f91cd..826f6fb9be 100644 --- a/src/mod/applications/mod_conference/conf/autoload_configs/conference.conf.xml +++ b/src/mod/applications/mod_conference/conf/autoload_configs/conference.conf.xml @@ -120,6 +120,10 @@ + + diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index e92971ab80..8b4be69b2c 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -83,7 +83,7 @@ static int EC = 0; /* the maximum value for the IIR score [keeps loud & longwinded people from getting overweighted] */ #define SCORE_MAX_IIR 25000 /* the minimum score for which you can be considered to be loud enough to now have the floor */ -#define SCORE_IIR_SPEAKING_MAX 3000 +#define SCORE_IIR_SPEAKING_MAX 300 /* the threshold below which you cede the floor to someone loud (see above value). */ #define SCORE_IIR_SPEAKING_MIN 100 @@ -174,7 +174,8 @@ typedef enum { CFLAG_INHASH = (1 << 11), CFLAG_EXIT_SOUND = (1 << 12), CFLAG_ENTER_SOUND = (1 << 13), - CFLAG_VIDEO_BRIDGE = (1 << 14) + CFLAG_VIDEO_BRIDGE = (1 << 14), + CFLAG_AUDIO_ALWAYS = (1 << 15) } conf_flag_t; typedef enum { @@ -216,7 +217,8 @@ typedef enum { EFLAG_FLOOR_CHANGE = (1 << 25), EFLAG_MUTE_DETECT = (1 << 26), EFLAG_RECORD = (1 << 27), - EFLAG_HUP_MEMBER = (1 << 28) + EFLAG_HUP_MEMBER = (1 << 28), + EFLAG_PLAY_FILE_DONE = (1 << 29), } event_type_t; typedef struct conference_file_node { @@ -334,6 +336,7 @@ typedef struct conference_obj { switch_time_t end_time; char *log_dir; struct vid_helper vh[2]; + struct vid_helper mh; } conference_obj_t; /* Relationship with another member */ @@ -476,7 +479,8 @@ static switch_status_t chat_send(switch_event_t *message_event); static void launch_conference_record_thread(conference_obj_t *conference, char *path); -static void launch_conference_video_bridge_thread(conference_member_t *member_a, conference_member_t *member_b); +static int launch_conference_video_bridge_thread(conference_member_t *member_a, conference_member_t *member_b); +static void launch_conference_video_mirror_thread(conference_member_t *member_a); typedef switch_status_t (*conf_api_args_cmd_t) (conference_obj_t *, switch_stream_handle_t *, int, char **); typedef switch_status_t (*conf_api_member_cmd_t) (conference_member_t *, switch_stream_handle_t *, void *); @@ -657,9 +661,10 @@ static void conference_cdr_render(conference_obj_t *conference) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n", path, ebuf); } - + switch_safe_free(path); switch_safe_free(xml_text); + switch_xml_free(cdr); } @@ -1220,6 +1225,62 @@ static void *SWITCH_THREAD_FUNC conference_video_bridge_thread_run(switch_thread } + +static void *SWITCH_THREAD_FUNC conference_video_mirror_thread_run(switch_thread_t *thread, void *obj) +{ + struct vid_helper *vh = obj; + switch_core_session_t *session_a = vh->member_a->session; + switch_channel_t *channel_a = switch_core_session_get_channel(session_a); + switch_status_t status; + switch_frame_t *read_frame; + conference_obj_t *conference = vh->member_a->conference; + switch_core_session_message_t msg = { 0 }; + + switch_thread_rwlock_rdlock(conference->rwlock); + switch_thread_rwlock_rdlock(vh->member_a->rwlock); + + /* Acquire locks for both sessions so the helper object and member structures don't get destroyed before we exit */ + switch_core_session_read_lock(session_a); + + /* Tell the channel to request a fresh vid frame */ + msg.from = __FILE__; + msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ; + switch_core_session_receive_message(session_a, &msg); + + vh->up = 1; + while (vh->up > 0 && switch_test_flag(vh->member_a, MFLAG_RUNNING) && + switch_channel_ready(channel_a)) { + + if (vh->up == 1) { + status = switch_core_session_read_video_frame(session_a, &read_frame, SWITCH_IO_FLAG_NONE, 0); + if (!SWITCH_READ_ACCEPTABLE(status)) { + break; + } + + if (!switch_test_flag(read_frame, SFF_CNG)) { + if (switch_core_session_write_video_frame(session_a, read_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { + break; + } + } + } else { + switch_yield(100000); + } + } + + + switch_thread_rwlock_unlock(vh->member_a->rwlock); + + switch_core_session_rwunlock(session_a); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s video mirror thread ended.\n", switch_channel_get_name(channel_a)); + + switch_thread_rwlock_unlock(conference->rwlock); + + vh->up = 0; + return NULL; +} + + /* Main video monitor thread (1 per distinct conference room) */ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thread, void *obj) { @@ -1522,8 +1583,22 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v switch_channel_ready(switch_core_session_get_channel(video_bridge_members[0]->session)) && switch_channel_ready(switch_core_session_get_channel(video_bridge_members[1]->session)) ) { + conference->mh.up = 2; + if (launch_conference_video_bridge_thread(video_bridge_members[0], video_bridge_members[1])) { + conference->mh.up = 1; + } else { + conference->mh.up = -1; + } + } else if (conference->vh[0].up == 0 && + conference->vh[1].up == 0 && + conference->mh.up == 0 && + video_bridge_members[0] && + !video_bridge_members[1] && + switch_test_flag(video_bridge_members[0], MFLAG_RUNNING) && + switch_channel_ready(switch_core_session_get_channel(video_bridge_members[0]->session)) + ) { - launch_conference_video_bridge_thread(video_bridge_members[0], video_bridge_members[1]); + launch_conference_video_mirror_thread(video_bridge_members[0]); } } @@ -1547,7 +1622,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v } if (file_sample_len <= 0) { - if (test_eflag(conference, EFLAG_PLAY_FILE) && + if (test_eflag(conference, EFLAG_PLAY_FILE_DONE) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { conference_add_event_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file-done"); @@ -2500,6 +2575,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v switch_clear_flag_locked(member, MFLAG_TALKING); check_agc_levels(member); clear_avg(member); + member->score_iir = 0; if (test_eflag(member->conference, EFLAG_STOP_TALKING) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { @@ -2670,8 +2746,8 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v } /* skip frames that are not actual media or when we are muted or silent */ - if ((switch_test_flag(member, MFLAG_TALKING) || member->energy_level == 0) && switch_test_flag(member, MFLAG_CAN_SPEAK) && - !switch_test_flag(member->conference, CFLAG_WAIT_MOD)) { + if ((switch_test_flag(member, MFLAG_TALKING) || member->energy_level == 0 || switch_test_flag(member->conference, CFLAG_AUDIO_ALWAYS)) + && switch_test_flag(member, MFLAG_CAN_SPEAK) && !switch_test_flag(member->conference, CFLAG_WAIT_MOD)) { switch_audio_resampler_t *read_resampler = member->read_resampler; void *data; uint32_t datalen; @@ -4426,6 +4502,10 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer switch_xml_set_attr_d(x_conference, "wait_mod", "true"); } + if (switch_test_flag(conference, CFLAG_AUDIO_ALWAYS)) { + switch_xml_set_attr_d(x_conference, "audio_always", "true"); + } + if (switch_test_flag(conference, CFLAG_RUNNING)) { switch_xml_set_attr_d(x_conference, "running", "true"); } @@ -5605,6 +5685,7 @@ static switch_status_t conference_outcall(conference_obj_t *conference, char appdata[512]; int rdlock = 0; switch_bool_t have_flags = SWITCH_FALSE; + const char *outcall_flags; *cause = SWITCH_CAUSE_NORMAL_CLEARING; @@ -5690,6 +5771,12 @@ static switch_status_t conference_outcall(conference_obj_t *conference, goto done; } + if ((outcall_flags = switch_channel_get_variable(peer_channel, "outcall_flags"))) { + if (!zstr(outcall_flags)) { + flags = (char *)outcall_flags; + } + } + if (flags && strcasecmp(flags, "none")) { have_flags = SWITCH_TRUE; } @@ -5962,6 +6049,8 @@ static void set_cflags(const char *flags, uint32_t *f) *f |= CFLAG_VID_FLOOR; } else if (!strcasecmp(argv[i], "video-bridge")) { *f |= CFLAG_VIDEO_BRIDGE; + } else if (!strcasecmp(argv[i], "audio-always")) { + *f |= CFLAG_AUDIO_ALWAYS; } } @@ -6019,6 +6108,8 @@ static void clear_eflags(char *events, uint32_t *f) *f &= ~EFLAG_VOLUME_OUT_MEMBER; } else if (!strcmp(event, "play-file")) { *f &= ~EFLAG_PLAY_FILE; + } else if (!strcmp(event, "play-file-done")) { + *f &= ~EFLAG_PLAY_FILE; } else if (!strcmp(event, "play-file-member")) { *f &= ~EFLAG_PLAY_FILE_MEMBER; } else if (!strcmp(event, "speak-text")) { @@ -6756,11 +6847,11 @@ static void launch_conference_video_thread(conference_obj_t *conference) } /* Create a video thread for the conference and launch it */ -static void launch_conference_video_bridge_thread(conference_member_t *member_a, conference_member_t *member_b) +static int launch_conference_video_bridge_thread(conference_member_t *member_a, conference_member_t *member_b) { conference_obj_t *conference = member_a->conference; switch_memory_pool_t *pool = conference->pool; - int sanity = 10000; + int sanity = 10000, r = 0; memset(conference->vh, 0, sizeof(conference->vh)); @@ -6779,14 +6870,33 @@ static void launch_conference_video_bridge_thread(conference_member_t *member_a, if (conference->vh[0].up == 1 && conference->vh[1].up != 1) { conference->vh[0].up = -1; + r = -1; } if (conference->vh[1].up == 1 && conference->vh[0].up != 1) { conference->vh[1].up = -1; + r = -1; } + + return r; } + + +/* Create a video thread for the conference and launch it */ +static void launch_conference_video_mirror_thread(conference_member_t *member_a) +{ + conference_obj_t *conference = member_a->conference; + switch_memory_pool_t *pool = conference->pool; + + memset(&conference->mh, 0, sizeof(conference->mh)); + + conference->mh.member_a = member_a; + + launch_thread_detached(conference_video_mirror_thread_run, pool, &conference->mh); +} + static void launch_conference_record_thread(conference_obj_t *conference, char *path) { switch_thread_t *thread; diff --git a/src/mod/applications/mod_curl/mod_curl.c b/src/mod/applications/mod_curl/mod_curl.c index 513e40fcd6..688b78ae73 100644 --- a/src/mod/applications/mod_curl/mod_curl.c +++ b/src/mod/applications/mod_curl/mod_curl.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_db/mod_db.c b/src/mod/applications/mod_db/mod_db.c index d94de1b900..5c64b20c95 100644 --- a/src/mod/applications/mod_db/mod_db.c +++ b/src/mod/applications/mod_db/mod_db.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_directory/mod_directory.c b/src/mod/applications/mod_directory/mod_directory.c index edc8f89b4c..90f55e64e3 100644 --- a/src/mod/applications/mod_directory/mod_directory.c +++ b/src/mod/applications/mod_directory/mod_directory.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_distributor/mod_distributor.c b/src/mod/applications/mod_distributor/mod_distributor.c index b87b3edb75..1a3714c7a2 100644 --- a/src/mod/applications/mod_distributor/mod_distributor.c +++ b/src/mod/applications/mod_distributor/mod_distributor.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 7d48784486..009088e9f9 100755 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -24,7 +24,7 @@ * Contributor(s): * * Anthony Minessale II - * Ken Rice, Asteria Solutions Group, Inc + * Ken Rice * Michael Murdock * Neal Horman * Bret McDanel @@ -38,7 +38,8 @@ #include SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load); -SWITCH_MODULE_DEFINITION(mod_dptools, mod_dptools_load, NULL, NULL); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dptools_shutdown); +SWITCH_MODULE_DEFINITION(mod_dptools, mod_dptools_load, mod_dptools_shutdown, NULL); SWITCH_STANDARD_DIALPLAN(inline_dialplan_hunt) { @@ -464,6 +465,7 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function) char *lbuf = NULL; const char *response = "DONE"; char *detect = NULL; + char *s; switch_channel_set_variable(channel, "detect_speech_result", ""); @@ -474,6 +476,12 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function) goto done; } + /* trim any trailing space */ + s = detect; + while (--s >= lbuf && switch_isspace(*s)) { + *s = '\0'; + } + /* split input at "detect:" */ detect[0] = '\0'; detect += 7; @@ -966,7 +974,7 @@ SWITCH_STANDARD_APP(transfer_function) if (bleg || both) { const char *uuid; switch_channel_t *channel = switch_core_session_get_channel(session); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *b_session; if ((b_session = switch_core_session_locate(uuid))) { switch_ivr_session_transfer(b_session, argv[1], argv[2], argv[3]); @@ -1021,9 +1029,10 @@ SWITCH_STANDARD_APP(sched_hangup_function) time_t when; switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT; switch_bool_t bleg = SWITCH_FALSE; + int sec = atol(argv[0] + 1); if (*argv[0] == '+') { - when = switch_epoch_time_now(NULL) + atol(argv[0] + 1); + when = switch_epoch_time_now(NULL) + sec; } else { when = atol(argv[0]); } @@ -1036,7 +1045,11 @@ SWITCH_STANDARD_APP(sched_hangup_function) bleg = SWITCH_TRUE; } - switch_ivr_schedule_hangup(when, switch_core_session_get_uuid(session), cause, bleg); + if (sec == 0) { + switch_channel_hangup(switch_core_session_get_channel(session), cause); + } else { + switch_ivr_schedule_hangup(when, switch_core_session_get_uuid(session), cause, bleg); + } } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No time specified.\n"); } @@ -1172,6 +1185,17 @@ SWITCH_STANDARD_APP(redirect_function) switch_core_session_receive_message(session, &msg); } +SWITCH_STANDARD_APP(video_refresh_function) +{ + switch_core_session_message_t msg = { 0 }; + + /* Tell the channel to refresh video */ + msg.from = __FILE__; + msg.string_arg = data; + msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ; + switch_core_session_receive_message(session, &msg); +} + SWITCH_STANDARD_APP(send_info_function) { switch_core_session_message_t msg = { 0 }; @@ -1965,7 +1989,7 @@ SWITCH_STANDARD_APP(speak_function) { switch_channel_t *channel = switch_core_session_get_channel(session); char buf[10]; - char *argv[4] = { 0 }; + char *argv[3] = { 0 }; int argc; const char *engine = NULL; const char *voice = NULL; @@ -1984,14 +2008,14 @@ SWITCH_STANDARD_APP(speak_function) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Params!\n"); return; } else if (argc == 1) { - text = argv[0]; + text = switch_core_session_strdup(session, data); /* unstripped text */ } else if (argc == 2) { voice = argv[0]; - text = argv[1]; + text = switch_core_session_strdup(session, data + (argv[1] - argv[0])); /* unstripped text */ } else { engine = argv[0]; voice = argv[1]; - text = argv[2]; + text = switch_core_session_strdup(session, data + (argv[2] - argv[0])); /* unstripped text */ } if (!engine) { @@ -2109,6 +2133,12 @@ static switch_status_t hanguphook(switch_core_session_t *session) return SWITCH_STATUS_SUCCESS; } + +static void att_xfer_set_result(switch_channel_t *channel, switch_status_t status) +{ + switch_channel_set_variable(channel, SWITCH_ATT_XFER_RESULT_VARIABLE, status == SWITCH_STATUS_SUCCESS ? "success" : "failure"); +} + SWITCH_STANDARD_APP(att_xfer_function) { switch_core_session_t *peer_session = NULL; @@ -2119,7 +2149,7 @@ SWITCH_STANDARD_APP(att_xfer_function) channel = switch_core_session_get_channel(session); - if ((bond = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((bond = switch_channel_get_partner_uuid(channel))) { bond = switch_core_session_strdup(session, bond); } @@ -2154,7 +2184,8 @@ SWITCH_STANDARD_APP(att_xfer_function) if (!switch_channel_down(peer_channel)) { if (!switch_channel_ready(channel)) { - switch_ivr_uuid_bridge(switch_core_session_get_uuid(peer_session), bond); + switch_status_t status = switch_ivr_uuid_bridge(switch_core_session_get_uuid(peer_session), bond); + att_xfer_set_result(peer_channel, status); br++; } else if ((b_session = switch_core_session_locate(bond))) { switch_channel_t *b_channel = switch_core_session_get_channel(b_session); @@ -2172,7 +2203,8 @@ SWITCH_STANDARD_APP(att_xfer_function) } if (!br) { - switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), bond); + switch_status_t status = switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), bond); + att_xfer_set_result(channel, status); } } @@ -2766,7 +2798,7 @@ SWITCH_STANDARD_APP(audio_bridge_function) switch_thread_t *thread = NULL; switch_threadattr_t *thd_attr = NULL; char *camp_data = NULL; - switch_status_t status; + switch_status_t status = SWITCH_STATUS_FALSE; int camp_loops = 0; if (zstr(data)) { @@ -3037,7 +3069,8 @@ SWITCH_STANDARD_APP(audio_bridge_function) } } } - if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && switch_channel_get_state(caller_channel) != CS_ROUTING) { + if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && !switch_channel_test_flag(caller_channel, CF_CONFIRM_BLIND_TRANSFER) && + switch_channel_get_state(caller_channel) != CS_ROUTING) { switch_channel_hangup(caller_channel, cause); } return; @@ -3087,6 +3120,480 @@ SWITCH_STANDARD_APP(audio_bridge_function) } } +static struct { + switch_memory_pool_t *pool; + switch_hash_t *pickup_hash; + switch_mutex_t *pickup_mutex; +} globals; + +/* pickup channel */ + + + +typedef struct pickup_node_s { + char *key; + char *uuid; + struct pickup_node_s *next; +} pickup_node_t; + + +#define PICKUP_PROTO "pickup" +static int EC = 0; + +static int pickup_count(const char *key_name) +{ + int count = 0; + pickup_node_t *head, *np; + + switch_mutex_lock(globals.pickup_mutex); + if ((head = switch_core_hash_find(globals.pickup_hash, key_name))) { + for (np = head; np; np = np->next) count++; + } + switch_mutex_unlock(globals.pickup_mutex); + + return count; + +} + +static void pickup_send_presence(const char *key_name) +{ + + char *domain_name, *dup_key_name = NULL, *dup_domain_name = NULL, *dup_id = NULL; + switch_event_t *event; + int count; + + + dup_key_name = strdup(key_name); + key_name = dup_key_name; + + if ((domain_name = strchr(dup_key_name, '@'))) { + *domain_name++ = '\0'; + } + + if (zstr(domain_name)) { + dup_domain_name = switch_core_get_variable_dup("domain"); + domain_name = dup_domain_name; + } + + if (zstr(domain_name)) { + domain_name = "cluecon.com"; + } + + dup_id = switch_mprintf("%s@%s", key_name, domain_name); + + count = pickup_count(dup_id); + + if (count > 0) { + if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", PICKUP_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", dup_id); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", dup_id); + + + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "force-status", "Active (%d call%s)", count, count == 1 ? "" : "s"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "active"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", key_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "confirmed"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound"); + switch_event_fire(&event); + } + } else { + if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", PICKUP_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", dup_id); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", dup_id); + + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "force-status", "Idle"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "unknown"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", dup_id); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound"); + switch_event_fire(&event); + } + } + + switch_safe_free(dup_domain_name); + switch_safe_free(dup_key_name); + switch_safe_free(dup_id); + +} + +static void pickup_pres_event_handler(switch_event_t *event) +{ + char *to = switch_event_get_header(event, "to"); + char *dup_to = NULL, *key_name, *dup_key_name = NULL, *domain_name, *dup_domain_name = NULL; + int count = 0; + + if (!to || strncasecmp(to, "pickup+", 7) || !strchr(to, '@')) { + return; + } + + if (!(dup_to = strdup(to))) { + return; + } + + key_name = dup_to + 7; + + if ((domain_name = strchr(key_name, '@'))) { + *domain_name++ = '\0'; + } else { + dup_domain_name = switch_core_get_variable_dup("domain"); + domain_name = dup_domain_name; + } + + if (zstr(domain_name)) { + switch_safe_free(dup_to); + return; + } + + dup_key_name = switch_mprintf("%q@%q", key_name, domain_name); + count = pickup_count(dup_key_name); + + switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN); + + if (count) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", PICKUP_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", key_name); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", key_name, domain_name); + + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "force-status", "Active (%d call%s)", count, count == 1 ? "" : "s"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "active"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", key_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "confirmed"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound"); + } else { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", PICKUP_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", key_name); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", key_name, domain_name); + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "force-status", "Idle"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "unknown"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", key_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound"); + + } + + switch_event_fire(&event); + switch_safe_free(dup_to); + switch_safe_free(dup_key_name); + switch_safe_free(dup_domain_name); +} + + + +static void pickup_add_session(switch_core_session_t *session, const char *key) +{ + pickup_node_t *head, *node, *np; + char *dup_key = NULL; + + if (!strchr(key, '@')) { + dup_key = switch_mprintf("%s@%s", key, switch_core_get_variable("domain")); + key = dup_key; + } + + node = malloc(sizeof(*node)); + node->key = strdup(key); + node->uuid = strdup(switch_core_session_get_uuid(session)); + node->next = NULL; + + switch_mutex_lock(globals.pickup_mutex); + head = switch_core_hash_find(globals.pickup_hash, key); + + if (head) { + for (np = head; np && np->next; np = np->next); + np->next = node; + } else { + head = node; + switch_core_hash_insert(globals.pickup_hash, key, head); + } + + switch_mutex_unlock(globals.pickup_mutex); + + pickup_send_presence(key); + + switch_safe_free(dup_key); +} + +static char *pickup_pop_uuid(const char *key, const char *uuid) +{ + pickup_node_t *node = NULL, *head; + char *r = NULL; + char *dup_key = NULL; + + if (!strchr(key, '@')) { + dup_key = switch_mprintf("%s@%s", key, switch_core_get_variable("domain")); + key = dup_key; + } + + switch_mutex_lock(globals.pickup_mutex); + + if ((head = switch_core_hash_find(globals.pickup_hash, key))) { + + switch_core_hash_delete(globals.pickup_hash, key); + + if (uuid) { + pickup_node_t *np, *lp = NULL; + + for(np = head; np; np = np->next) { + if (!strcmp(np->uuid, uuid)) { + if (lp) { + lp->next = np->next; + } else { + head = np->next; + } + + node = np; + break; + } + + lp = np; + } + + } else { + node = head; + head = head->next; + } + + + if (head) { + switch_core_hash_insert(globals.pickup_hash, key, head); + } + } + + if (node) { + r = node->uuid; + free(node->key); + free(node); + } + + switch_mutex_unlock(globals.pickup_mutex); + + if (r) pickup_send_presence(key); + + switch_safe_free(dup_key); + + return r; +} + + +typedef struct pickup_pvt_s { + char *key; + switch_event_t *vars; +} pickup_pvt_t; + +switch_endpoint_interface_t *pickup_endpoint_interface; +static switch_call_cause_t pickup_outgoing_channel(switch_core_session_t *session, + switch_event_t *var_event, + switch_caller_profile_t *outbound_profile, + switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, + switch_call_cause_t *cancel_cause); +switch_io_routines_t pickup_io_routines = { + /*.outgoing_channel */ pickup_outgoing_channel +}; + +static switch_status_t pickup_event_handler(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_channel_state_t state = switch_channel_get_running_state(channel); + pickup_pvt_t *tech_pvt = switch_core_session_get_private(session); + + switch(state) { + case CS_DESTROY: + if (tech_pvt->vars) { + switch_event_destroy(&tech_pvt->vars); + } + break; + case CS_REPORTING: + return SWITCH_STATUS_FALSE; + case CS_HANGUP: + { + + if (switch_channel_test_flag(channel, CF_CHANNEL_SWAP)) { + const char *key = switch_channel_get_variable(channel, "channel_swap_uuid"); + switch_core_session_t *swap_session; + + if ((swap_session = switch_core_session_locate(key))) { + switch_channel_t *swap_channel = switch_core_session_get_channel(swap_session); + switch_channel_hangup(swap_channel, SWITCH_CAUSE_PICKED_OFF); + switch_core_session_rwunlock(swap_session); + } + switch_channel_clear_flag(channel, CF_CHANNEL_SWAP); + } + + pickup_pop_uuid(tech_pvt->key, switch_core_session_get_uuid(session)); + } + break; + default: + break; + } + + + return SWITCH_STATUS_SUCCESS; +} + +switch_state_handler_table_t pickup_event_handlers = { + /*.on_init */ pickup_event_handler, + /*.on_routing */ pickup_event_handler, + /*.on_execute */ pickup_event_handler, + /*.on_hangup */ pickup_event_handler, + /*.on_exchange_media */ pickup_event_handler, + /*.on_soft_execute */ pickup_event_handler, + /*.on_consume_media */ pickup_event_handler, + /*.on_hibernate */ pickup_event_handler, + /*.on_reset */ pickup_event_handler, + /*.on_park */ pickup_event_handler, + /*.on_reporting */ pickup_event_handler, + /*.on_destroy */ pickup_event_handler +}; + +static switch_call_cause_t pickup_outgoing_channel(switch_core_session_t *session, + switch_event_t *var_event, + switch_caller_profile_t *outbound_profile, + switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, + switch_call_cause_t *cancel_cause) +{ + char *pickup; + switch_call_cause_t cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + switch_core_session_t *nsession; + switch_channel_t *nchannel; + char *name; + pickup_pvt_t *tech_pvt; + switch_caller_profile_t *caller_profile; + + if (zstr(outbound_profile->destination_number)) { + goto done; + } + + pickup = outbound_profile->destination_number; + + + if (!(nsession = switch_core_session_request(pickup_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Creating Session\n"); + goto error; + } + + tech_pvt = switch_core_session_alloc(nsession, sizeof(*tech_pvt)); + tech_pvt->key = switch_core_session_strdup(nsession, pickup); + switch_event_dup(&tech_pvt->vars, var_event); + + switch_core_session_set_private(nsession, tech_pvt); + + nchannel = switch_core_session_get_channel(nsession); + caller_profile = switch_caller_profile_clone(nsession, outbound_profile); + switch_channel_set_caller_profile(nchannel, caller_profile); + + switch_channel_set_state(nchannel, CS_ROUTING); + + + + *new_session = nsession; + cause = SWITCH_CAUSE_SUCCESS; + name = switch_core_session_sprintf(nsession, "pickup/%s", pickup); + switch_channel_set_name(nchannel, name); + switch_channel_set_variable(nchannel, "process_cdr", "false"); + pickup_add_session(nsession, pickup); + switch_channel_set_flag(nchannel, CF_PICKUP); + + goto done; + + error: + + if (nsession) { + switch_core_session_destroy(&nsession); + } + + if (pool) { + *pool = NULL; + } + + done: + + + return cause; +} + +#define PICKUP_SYNTAX "[]" +SWITCH_STANDARD_APP(pickup_function) +{ + char *uuid = NULL; + switch_core_session_t *pickup_session; + switch_channel_t *channel = switch_core_session_get_channel(session); + + if (zstr(data)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Missing data. Usage: pickup %s\n", PICKUP_SYNTAX); + return; + } + + if ((uuid = pickup_pop_uuid((char *)data, NULL))) { + if ((pickup_session = switch_core_session_locate(uuid))) { + switch_channel_t *pickup_channel = switch_core_session_get_channel(pickup_session); + switch_caller_profile_t *pickup_caller_profile = switch_channel_get_caller_profile(pickup_channel), + *caller_profile = switch_channel_get_caller_profile(channel); + const char *name, *num; + switch_event_t *event; + switch_event_header_t *hp; + pickup_pvt_t *tech_pvt = switch_core_session_get_private(pickup_session); + + for(hp = tech_pvt->vars->headers; hp; hp = hp->next) { + switch_channel_set_variable(channel, hp->name, hp->value); + } + + + switch_channel_set_flag(pickup_channel, CF_CHANNEL_SWAP); + switch_channel_set_variable(pickup_channel, "channel_swap_uuid", switch_core_session_get_uuid(session)); + + name = caller_profile->caller_id_name; + num = caller_profile->caller_id_number; + + caller_profile->caller_id_name = switch_core_strdup(caller_profile->pool, pickup_caller_profile->caller_id_name); + caller_profile->caller_id_number = switch_core_strdup(caller_profile->pool, pickup_caller_profile->caller_id_number); + + caller_profile->callee_id_name = name; + caller_profile->callee_id_number = num; + + if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) { + const char *uuid = switch_channel_get_partner_uuid(channel); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV"); + + if (uuid) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid); + } + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + + + switch_channel_set_state(channel, CS_HIBERNATE); + + switch_channel_mark_answered(pickup_channel); + switch_core_session_rwunlock(pickup_session); + } + free(uuid); + } +} + + + + + /* fake chan_error */ switch_endpoint_interface_t *error_endpoint_interface; static switch_call_cause_t error_outgoing_channel(switch_core_session_t *session, @@ -3936,7 +4443,7 @@ static switch_status_t file_string_file_read(switch_file_handle_t *handle, void *len = context->samples; } - context->samples -= *len; + context->samples -= (int) *len; memset(data, 255, *len *2); status = SWITCH_STATUS_SUCCESS; } else { @@ -3962,6 +4469,19 @@ static char *file_string_supported_formats[SWITCH_MAX_CODECS] = { 0 }; /* /FILE STRING INTERFACE */ +SWITCH_STANDARD_APP(blind_transfer_ack_function) +{ + switch_bool_t val = 0; + + if (data) { + val = switch_true((char *) val); + } + + switch_ivr_blind_transfer_ack(session, val); +} + + + #define SPEAK_DESC "Speak text to a channel via the tts interface" #define DISPLACE_DESC "Displace audio from a file to the channels input" @@ -3978,6 +4498,14 @@ static char *file_string_supported_formats[SWITCH_MAX_CODECS] = { 0 }; #define LOG_LONG_DESC "Logs a channel variable for the channel calling the application." #define TRANSFER_LONG_DESC "Immediately transfer the calling channel to a new extension" #define SLEEP_LONG_DESC "Pause the channel for a given number of milliseconds, consuming the audio for that period of time." + +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dptools_shutdown) +{ + switch_event_unbind_callback(pickup_pres_event_handler); + + return SWITCH_STATUS_SUCCESS; +} + SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) { switch_api_interface_t *api_interface; @@ -3986,12 +4514,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) switch_chat_interface_t *chat_interface; switch_file_interface_t *file_interface; + globals.pool = pool; + switch_core_hash_init(&globals.pickup_hash, NULL); + switch_mutex_init(&globals.pickup_mutex, SWITCH_MUTEX_NESTED, globals.pool); + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); + switch_event_bind(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, pickup_pres_event_handler, NULL); + + file_string_supported_formats[0] = "file_string"; - file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE); + file_interface = (switch_file_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE); file_interface->interface_name = modname; file_interface->extens = file_string_supported_formats; file_interface->file_open = file_string_file_open; @@ -4000,18 +4535,23 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) file_interface->file_seek = file_string_file_seek; - error_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); + error_endpoint_interface = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); error_endpoint_interface->interface_name = "error"; error_endpoint_interface->io_routines = &error_io_routines; - group_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); + group_endpoint_interface = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); group_endpoint_interface->interface_name = "group"; group_endpoint_interface->io_routines = &group_io_routines; - user_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); + user_endpoint_interface = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); user_endpoint_interface->interface_name = "user"; user_endpoint_interface->io_routines = &user_io_routines; + pickup_endpoint_interface = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); + pickup_endpoint_interface->interface_name = "pickup"; + pickup_endpoint_interface->io_routines = &pickup_io_routines; + pickup_endpoint_interface->state_handler = &pickup_event_handlers; + SWITCH_ADD_CHAT(chat_interface, "event", event_chat_send); SWITCH_ADD_CHAT(chat_interface, "api", api_chat_send); @@ -4021,6 +4561,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) SWITCH_ADD_API(api_interface, "strftime", "strftime", strftime_api_function, ""); SWITCH_ADD_API(api_interface, "presence", "presence", presence_api_function, PRESENCE_USAGE); + SWITCH_ADD_APP(app_interface, "blind_transfer_ack", "", "", blind_transfer_ack_function, "[true|false]", SAF_NONE); + SWITCH_ADD_APP(app_interface, "bind_digit_action", "bind a key sequence or regex to an action", "bind a key sequence or regex to an action", bind_digit_action_function, BIND_DIGIT_ACTION_USAGE, SAF_SUPPORT_NOMEDIA); @@ -4097,6 +4639,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) SWITCH_ADD_APP(app_interface, "ivr", "Run an ivr menu", "Run an ivr menu.", ivr_application_function, "", SAF_NONE); SWITCH_ADD_APP(app_interface, "redirect", "Send session redirect", "Send a redirect message to a session.", redirect_function, "", SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_APP(app_interface, "video_refresh", "Send video refresh.", "Send video refresh.", video_refresh_function, "", + SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "send_info", "Send info", "Send info", send_info_function, "", SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "jitterbuffer", "Send session jitterbuffer", "Send a jitterbuffer message to a session.", jitterbuffer_function, "", SAF_SUPPORT_NOMEDIA); @@ -4186,6 +4730,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) SWITCH_ADD_APP(app_interface, "limit_execute", "Limit", LIMITEXECUTE_DESC, limit_execute_function, LIMITEXECUTE_USAGE, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "limit_hash_execute", "Limit", LIMITHASHEXECUTE_DESC, limit_hash_execute_function, LIMITHASHEXECUTE_USAGE, SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_APP(app_interface, "pickup", "Pickup", "Pickup a call", pickup_function, PICKUP_SYNTAX, SAF_SUPPORT_NOMEDIA); + + SWITCH_ADD_DIALPLAN(dp_interface, "inline", inline_dialplan_hunt); /* indicate that the module should continue to be loaded */ diff --git a/src/mod/applications/mod_easyroute/mod_easyroute.c b/src/mod/applications/mod_easyroute/mod_easyroute.c index c4a017d3db..4431aac2ee 100644 --- a/src/mod/applications/mod_easyroute/mod_easyroute.c +++ b/src/mod/applications/mod_easyroute/mod_easyroute.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_enum/mod_enum.c b/src/mod/applications/mod_enum/mod_enum.c index 80b4d899f4..c0cf904da2 100644 --- a/src/mod/applications/mod_enum/mod_enum.c +++ b/src/mod/applications/mod_enum/mod_enum.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_esf/mod_esf.c b/src/mod/applications/mod_esf/mod_esf.c index 39952f2a8c..5414b9d8df 100644 --- a/src/mod/applications/mod_esf/mod_esf.c +++ b/src/mod/applications/mod_esf/mod_esf.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -226,7 +226,7 @@ SWITCH_STANDARD_APP(bcast_function) bytes = 16; switch_socket_sendto(socket, control_packet_addr, 0, (void *) &control_packet, &bytes); - for (;;) { + while (switch_channel_ready(channel)) { status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); diff --git a/src/mod/applications/mod_esl/mod_esl.c b/src/mod/applications/mod_esl/mod_esl.c index 5ebda251f2..9af05b236e 100644 --- a/src/mod/applications/mod_esl/mod_esl.c +++ b/src/mod/applications/mod_esl/mod_esl.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_expr/mod_expr.c b/src/mod/applications/mod_expr/mod_expr.c index d562d8cd9c..8933f872d5 100644 --- a/src/mod/applications/mod_expr/mod_expr.c +++ b/src/mod/applications/mod_expr/mod_expr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_fax/Makefile.am b/src/mod/applications/mod_fax/Makefile.am deleted file mode 100644 index c71c5b9da5..0000000000 --- a/src/mod/applications/mod_fax/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -include $(top_srcdir)/build/modmake.rulesam -MODNAME=mod_fax - -TIFF_DIR=$(switch_srcdir)/libs/tiff-3.8.2 -TIFF_BUILDDIR=$(switch_builddir)/libs/tiff-3.8.2 -TIFF_LA=$(TIFF_BUILDDIR)/libtiff/libtiff.la - -SPANDSP_DIR=$(switch_srcdir)/libs/spandsp -SPANDSP_BUILDDIR=$(switch_builddir)/libs/spandsp -SPANDSP_LA=$(SPANDSP_BUILDDIR)/src/libspandsp.la - -mod_LTLIBRARIES = mod_fax.la -mod_fax_la_SOURCES = mod_fax.c udptl.c -mod_fax_la_CFLAGS = $(AM_CFLAGS) -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. -mod_fax_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SPANDSP_LA) $(TIFF_LA) -mod_fax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -ljpeg - -$(SPANDSP_LA): $(TIFF_LA) $(SPANDSP_DIR) $(SPANDSP_DIR)/.update - cd $(SPANDSP_BUILDDIR) && $(MAKE) -j1 - $(TOUCH_TARGET) - -$(TIFF_LA): $(TIFF_DIR) $(TIFF_DIR)/.update - cd $(TIFF_BUILDDIR) && $(MAKE) -j1 - $(TOUCH_TARGET) diff --git a/src/mod/applications/mod_fax/mod_fax.c b/src/mod/applications/mod_fax/mod_fax.c deleted file mode 100644 index 340a497a23..0000000000 --- a/src/mod/applications/mod_fax/mod_fax.c +++ /dev/null @@ -1,1945 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH mod_fax. - * - * The Initial Developer of the Original Code is - * Massimo Cetra - * - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Brian West - * Anthony Minessale II - * Steve Underwood - * Antonio Gallo - * mod_fax.c -- Fax applications provided by SpanDSP - * - */ - -#include -#ifdef WIN32 -#define FAX_INVALID_SOCKET INVALID_HANDLE_VALUE -typedef HANDLE zap_socket_t; -#else -#define FAX_INVALID_SOCKET -1 -typedef int zap_socket_t; -#endif - -#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES -#include -#include - -#include "udptl.h" - -#define LOCAL_FAX_MAX_DATAGRAM 400 -#define MAX_FEC_ENTRIES 4 -#define MAX_FEC_SPAN 4 - -/***************************************************************************** - OUR DEFINES AND STRUCTS -*****************************************************************************/ - -typedef enum { - FUNCTION_TX, - FUNCTION_RX, - FUNCTION_GW -} application_mode_t; - -typedef enum { - T38_MODE, - AUDIO_MODE, - T38_GATEWAY_MODE -} transport_mode_t; - -typedef enum { - T38_MODE_UNKNOWN = 0, - T38_MODE_NEGOTIATED = 1, - T38_MODE_REQUESTED = 2, - T38_MODE_REFUSED = -1, -} t38_mode_t; - -/* The global stuff */ -static struct { - switch_memory_pool_t *pool; - switch_mutex_t *mutex; - - uint32_t total_sessions; - - short int use_ecm; - short int verbose; - short int disable_v17; - short int enable_t38; - short int enable_t38_request; - short int enable_t38_insist; - char ident[20]; - char header[50]; - char *prepend_string; - char *spool; -} globals; - -struct pvt_s { - switch_core_session_t *session; - - application_mode_t app_mode; - - fax_state_t *fax_state; - t38_terminal_state_t *t38_state; - t38_gateway_state_t *t38_gateway_state; - t38_core_state_t *t38_core; - - udptl_state_t *udptl_state; - - char *filename; - char *ident; - char *header; - - int use_ecm; - int disable_v17; - int verbose; - int caller; - - int tx_page_start; - int tx_page_end; - - int done; - - t38_mode_t t38_mode; - - struct pvt_s *next; -}; - -typedef struct pvt_s pvt_t; - -static void launch_timer_thread(void); - -static struct { - pvt_t *head; - switch_mutex_t *mutex; - switch_thread_t *thread; - int thread_running; -} t38_state_list; - -static int add_pvt(pvt_t *pvt) -{ - int r = 0; - uint32_t sanity = 50; - - switch_mutex_lock(t38_state_list.mutex); - if (!t38_state_list.thread_running) { - - launch_timer_thread(); - - while(--sanity && !t38_state_list.thread_running) { - switch_yield(10000); - } - } - switch_mutex_unlock(t38_state_list.mutex); - - if (t38_state_list.thread_running) { - switch_mutex_lock(t38_state_list.mutex); - pvt->next = t38_state_list.head; - t38_state_list.head = pvt; - switch_mutex_unlock(t38_state_list.mutex); - } - - return r; - -} - - -static int del_pvt(pvt_t *del_pvt) -{ - pvt_t *p, *l = NULL; - int r = 0; - - if (!t38_state_list.thread_running) goto end; - - switch_mutex_lock(t38_state_list.mutex); - for (p = t38_state_list.head; p; p = p->next) { - if (p == del_pvt) { - if (l) { - l->next = p->next; - } else { - t38_state_list.head = p->next; - } - p->next = NULL; - r = 1; - goto end; - } - - l = p; - } - - end: - - switch_mutex_unlock(t38_state_list.mutex); - - return r; - -} - -static void *SWITCH_THREAD_FUNC timer_thread_run(switch_thread_t *thread, void *obj) -{ - switch_timer_t timer = { 0 }; - pvt_t *pvt; - int samples = 240; - int ms = 30; - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "timer thread started.\n"); - - if (switch_core_timer_init(&timer, "soft", ms, samples, NULL) != SWITCH_STATUS_SUCCESS) { - return NULL; - } - - t38_state_list.thread_running = 1; - - while(t38_state_list.thread_running) { - - switch_mutex_lock(t38_state_list.mutex); - - if (!t38_state_list.head) { - switch_mutex_unlock(t38_state_list.mutex); - goto end; - } - - for (pvt = t38_state_list.head; pvt; pvt = pvt->next) { - if (pvt->udptl_state) { - t38_terminal_send_timeout(pvt->t38_state, samples); - } - } - - switch_mutex_unlock(t38_state_list.mutex); - - switch_core_timer_next(&timer); - } - - end: - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "timer thread ended.\n"); - - t38_state_list.thread_running = 0; - switch_core_timer_destroy(&timer); - - return NULL; -} - -static void launch_timer_thread(void) -{ - - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, globals.pool); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&t38_state_list.thread, thd_attr, timer_thread_run, NULL, globals.pool); -} - - -/***************************************************************************** - LOGGING AND HELPER FUNCTIONS -*****************************************************************************/ - -static void counter_increment(void) -{ - switch_mutex_lock(globals.mutex); - globals.total_sessions++; - switch_mutex_unlock(globals.mutex); -} - -static void spanfax_log_message(int level, const char *msg) -{ - int fs_log_level; - - switch (level) { - case SPAN_LOG_NONE: - return; - case SPAN_LOG_ERROR: - case SPAN_LOG_PROTOCOL_ERROR: - fs_log_level = SWITCH_LOG_ERROR; - break; - case SPAN_LOG_WARNING: - case SPAN_LOG_PROTOCOL_WARNING: - fs_log_level = SWITCH_LOG_WARNING; - break; - case SPAN_LOG_FLOW: - case SPAN_LOG_FLOW_2: - case SPAN_LOG_FLOW_3: - default: /* SPAN_LOG_DEBUG, SPAN_LOG_DEBUG_2, SPAN_LOG_DEBUG_3 */ - fs_log_level = SWITCH_LOG_DEBUG; - break; - } - - if (!zstr(msg)) { - switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg); - } -} - -/* - * Called at the end of the document - */ -static void phase_e_handler(t30_state_t *s, void *user_data, int result) -{ - t30_stats_t t; - const char *local_ident; - const char *far_ident; - switch_core_session_t *session; - switch_channel_t *channel; - pvt_t *pvt; - char *tmp; - - pvt = (pvt_t *) user_data; - switch_assert(pvt); - - session = pvt->session; - switch_assert(session); - - channel = switch_core_session_get_channel(session); - switch_assert(channel); - - t30_get_transfer_statistics(s, &t); - local_ident = switch_str_nil(t30_get_tx_ident(s)); - far_ident = switch_str_nil(t30_get_rx_ident(s)); - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n"); - - if (result == T30_ERR_OK) { - if (pvt->app_mode == FUNCTION_TX) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Fax successfully sent.\n"); - } else if (pvt->app_mode == FUNCTION_RX) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Fax successfully received.\n"); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Fax successfully managed. How ?\n"); - } - switch_channel_set_variable(channel, "fax_success", "1"); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Fax processing not successful - result (%d) %s.\n", result, - t30_completion_code_to_str(result)); - switch_channel_set_variable(channel, "fax_success", "0"); - } - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote station id: %s\n", far_ident); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Local station id: %s\n", local_ident); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Pages transferred: %i\n", - pvt->app_mode == FUNCTION_TX ? t.pages_tx : t.pages_rx); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Total fax pages: %i\n", t.pages_in_file); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image resolution: %ix%i\n", t.x_resolution, t.y_resolution); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate); - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "ECM status %s\n", (t.error_correcting_mode) ? "on" : "off"); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote country: %s\n", switch_str_nil(t30_get_rx_country(s))); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote vendor: %s\n", switch_str_nil(t30_get_rx_vendor(s))); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "remote model: %s\n", switch_str_nil(t30_get_rx_model(s))); - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "==============================================================================\n"); - - /* - Set our channel variables - */ - - tmp = switch_mprintf("%i", result); - if (tmp) { - switch_channel_set_variable(channel, "fax_result_code", tmp); - switch_safe_free(tmp); - } - - switch_channel_set_variable(channel, "fax_result_text", t30_completion_code_to_str(result)); - - switch_channel_set_variable(channel, "fax_ecm_used", (t.error_correcting_mode) ? "on" : "off"); - switch_channel_set_variable(channel, "fax_local_station_id", local_ident); - switch_channel_set_variable(channel, "fax_remote_station_id", far_ident); - - tmp = switch_mprintf("%i", pvt->app_mode == FUNCTION_TX ? t.pages_tx : t.pages_rx); - if (tmp) { - switch_channel_set_variable(channel, "fax_document_transferred_pages", tmp); - switch_safe_free(tmp); - } - - tmp = switch_mprintf("%i", t.pages_in_file); - if (tmp) { - switch_channel_set_variable(channel, "fax_document_total_pages", tmp); - switch_safe_free(tmp); - } - - tmp = switch_mprintf("%ix%i", t.x_resolution, t.y_resolution); - if (tmp) { - switch_channel_set_variable(channel, "fax_image_resolution", tmp); - switch_safe_free(tmp); - } - - tmp = switch_mprintf("%d", t.image_size); - if (tmp) { - switch_channel_set_variable(channel, "fax_image_size", tmp); - switch_safe_free(tmp); - } - - tmp = switch_mprintf("%d", t.bad_rows); - if (tmp) { - switch_channel_set_variable(channel, "fax_bad_rows", tmp); - switch_safe_free(tmp); - } - - tmp = switch_mprintf("%i", t.bit_rate); - if (tmp) { - switch_channel_set_variable(channel, "fax_transfer_rate", tmp); - switch_safe_free(tmp); - } - - /* switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); */ - - pvt->done = 1; - - /* - TODO Fire events - */ -} - -static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) -{ - switch_frame_t out_frame = { 0 }; - switch_core_session_t *session; - switch_channel_t *channel; - pvt_t *pvt; - uint8_t pkt[LOCAL_FAX_MAX_DATAGRAM]; - int x; - int r = 0; - - pvt = (pvt_t *) user_data; - session = pvt->session; - channel = switch_core_session_get_channel(session); - - /* we need to build a real packet here and make write_frame.packet and write_frame.packetlen point to it */ - out_frame.flags = SFF_UDPTL_PACKET | SFF_PROXY_PACKET; - out_frame.packet = pkt; - out_frame.packetlen = udptl_build_packet(pvt->udptl_state, pkt, buf, len); - - //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "WRITE %d udptl bytes\n", out_frame.packetlen); - - for (x = 0; x < count; x++) { - if (switch_core_session_write_frame(session, &out_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { - r = -1; - break; - } - } - - return r; -} - -static switch_status_t spanfax_init(pvt_t *pvt, transport_mode_t trans_mode) -{ - - switch_core_session_t *session; - switch_channel_t *channel; - fax_state_t *fax; - t38_terminal_state_t *t38; - t30_state_t *t30; - - - session = (switch_core_session_t *) pvt->session; - switch_assert(session); - - channel = switch_core_session_get_channel(session); - switch_assert(channel); - - - switch (trans_mode) { - case AUDIO_MODE: - if (pvt->fax_state == NULL) { - pvt->fax_state = (fax_state_t *) switch_core_session_alloc(pvt->session, sizeof(fax_state_t)); - } - if (pvt->fax_state == NULL) { - return SWITCH_STATUS_FALSE; - } - - fax = pvt->fax_state; - t30 = fax_get_t30_state(fax); - - memset(fax, 0, sizeof(fax_state_t)); - if (fax_init(fax, pvt->caller) == NULL) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot initialize my fax structs\n"); - return SWITCH_STATUS_FALSE; - } - - fax_set_transmit_on_idle(fax, TRUE); - - span_log_set_message_handler(&fax->logging, spanfax_log_message); - span_log_set_message_handler(&t30->logging, spanfax_log_message); - - if (pvt->verbose) { - span_log_set_level(&fax->logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); - span_log_set_level(&t30->logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); - } - break; - case T38_MODE: - if (pvt->t38_state == NULL) { - pvt->t38_state = (t38_terminal_state_t *) switch_core_session_alloc(pvt->session, sizeof(t38_terminal_state_t)); - } - if (pvt->t38_state == NULL) { - return SWITCH_STATUS_FALSE; - } - if (pvt->udptl_state == NULL) { - pvt->udptl_state = (udptl_state_t *) switch_core_session_alloc(pvt->session, sizeof(udptl_state_t)); - } - if (pvt->udptl_state == NULL) { - t38_terminal_free(pvt->t38_state); - pvt->t38_state = NULL; - return SWITCH_STATUS_FALSE; - } - - /* add to timer thread processing */ - add_pvt(pvt); - - t38 = pvt->t38_state; - t30 = t38_terminal_get_t30_state(t38); - - memset(t38, 0, sizeof(t38_terminal_state_t)); - - if (t38_terminal_init(t38, pvt->caller, t38_tx_packet_handler, pvt) == NULL) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot initialize my T.38 structs\n"); - return SWITCH_STATUS_FALSE; - } - - pvt->t38_core = t38_terminal_get_t38_core_state(pvt->t38_state); - - if (udptl_init(pvt->udptl_state, UDPTL_ERROR_CORRECTION_REDUNDANCY, 3, 3, - (udptl_rx_packet_handler_t *) t38_core_rx_ifp_packet, (void *) pvt->t38_core) == NULL) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot initialize my UDPTL structs\n"); - return SWITCH_STATUS_FALSE; - } - - span_log_set_message_handler(&t38->logging, spanfax_log_message); - span_log_set_message_handler(&t30->logging, spanfax_log_message); - - if (pvt->verbose) { - span_log_set_level(&t38->logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); - span_log_set_level(&t30->logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); - } - break; - case T38_GATEWAY_MODE: - if (pvt->t38_gateway_state == NULL) { - pvt->t38_gateway_state = (t38_gateway_state_t *) switch_core_session_alloc(pvt->session, sizeof(t38_gateway_state_t)); - } - - if (pvt->udptl_state == NULL) { - pvt->udptl_state = (udptl_state_t *) switch_core_session_alloc(pvt->session, sizeof(udptl_state_t)); - } - - if (t38_gateway_init(pvt->t38_gateway_state, t38_tx_packet_handler, pvt) == NULL) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot initialize my T.38 structs\n"); - t38_gateway_free(pvt->t38_gateway_state); - pvt->t38_gateway_state = NULL; - - return SWITCH_STATUS_FALSE; - } - - pvt->t38_core = t38_gateway_get_t38_core_state(pvt->t38_gateway_state); - - if (udptl_init(pvt->udptl_state, UDPTL_ERROR_CORRECTION_REDUNDANCY, 3, 3, - (udptl_rx_packet_handler_t *) t38_core_rx_ifp_packet, (void *) pvt->t38_core) == NULL) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot initialize my UDPTL structs\n"); - t38_gateway_free(pvt->t38_gateway_state); - udptl_release(pvt->udptl_state); - pvt->udptl_state = NULL; - return SWITCH_STATUS_FALSE; - } - - t38_gateway_set_transmit_on_idle(pvt->t38_gateway_state, TRUE); - - if (switch_true(switch_channel_get_variable(channel, "fax_v17_disabled"))) { - t38_gateway_set_supported_modems(pvt->t38_gateway_state, T30_SUPPORT_V29 | T30_SUPPORT_V27TER); - } else { - t38_gateway_set_supported_modems(pvt->t38_gateway_state, T30_SUPPORT_V17 | T30_SUPPORT_V29 | T30_SUPPORT_V27TER); - } - - t38_gateway_set_ecm_capability(pvt->t38_gateway_state, pvt->use_ecm); - switch_channel_set_variable(channel, "fax_ecm_requested", pvt->use_ecm ? "true" : "false"); - - if (switch_true(switch_channel_get_variable(channel, "FAX_DISABLE_ECM"))) { - t38_gateway_set_ecm_capability(pvt->t38_gateway_state, FALSE); - } else { - t38_gateway_set_ecm_capability(pvt->t38_gateway_state, TRUE); - } - - - span_log_set_message_handler(&pvt->t38_gateway_state->logging, spanfax_log_message); - span_log_set_message_handler(&pvt->t38_core->logging, spanfax_log_message); - - if (pvt->verbose) { - span_log_set_level(&pvt->t38_gateway_state->logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); - span_log_set_level(&pvt->t38_core->logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); - } - - t38_set_t38_version(pvt->t38_core, 0); - t38_gateway_set_ecm_capability(pvt->t38_gateway_state, 1); - - return SWITCH_STATUS_SUCCESS; - - default: - assert(0); /* What? */ - return SWITCH_STATUS_SUCCESS; - } /* Switch trans mode */ - - /* All the things which are common to audio and T.38 FAX setup */ - t30_set_tx_ident(t30, pvt->ident); - t30_set_tx_page_header_info(t30, pvt->header); - - t30_set_phase_e_handler(t30, phase_e_handler, pvt); - - t30_set_supported_image_sizes(t30, - T30_SUPPORT_US_LETTER_LENGTH | T30_SUPPORT_US_LEGAL_LENGTH | T30_SUPPORT_UNLIMITED_LENGTH - | T30_SUPPORT_215MM_WIDTH | T30_SUPPORT_255MM_WIDTH | T30_SUPPORT_303MM_WIDTH); - t30_set_supported_resolutions(t30, - T30_SUPPORT_STANDARD_RESOLUTION | T30_SUPPORT_FINE_RESOLUTION | T30_SUPPORT_SUPERFINE_RESOLUTION - | T30_SUPPORT_R8_RESOLUTION | T30_SUPPORT_R16_RESOLUTION); - - if (pvt->disable_v17) { - t30_set_supported_modems(t30, T30_SUPPORT_V29 | T30_SUPPORT_V27TER); - switch_channel_set_variable(channel, "fax_v17_disabled", "1"); - } else { - t30_set_supported_modems(t30, T30_SUPPORT_V29 | T30_SUPPORT_V27TER | T30_SUPPORT_V17); - switch_channel_set_variable(channel, "fax_v17_disabled", "0"); - } - - if (pvt->use_ecm) { - t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); - t30_set_ecm_capability(t30, TRUE); - switch_channel_set_variable(channel, "fax_ecm_requested", "1"); - } else { - t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION); - switch_channel_set_variable(channel, "fax_ecm_requested", "0"); - } - - if (pvt->app_mode == FUNCTION_TX) { - t30_set_tx_file(t30, pvt->filename, pvt->tx_page_start, pvt->tx_page_end); - } else { - t30_set_rx_file(t30, pvt->filename, -1); - } - switch_channel_set_variable(channel, "fax_filename", pvt->filename); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t spanfax_destroy(pvt_t *pvt) -{ - int terminate; - t30_state_t *t30; - - if (!pvt) return SWITCH_STATUS_FALSE; - - if (pvt->fax_state) { - if (pvt->t38_state) { - terminate = 0; - } else { - terminate = 1; - } - - t30 = fax_get_t30_state(pvt->fax_state); - if (terminate && t30) { - t30_terminate(t30); - } - - fax_release(pvt->fax_state); - } - - if (pvt->t38_state) { - - /* remove from timer thread processing */ - del_pvt(pvt); - - if (pvt->t38_state) { - terminate = 1; - } else { - terminate = 0; - } - - t30 = t38_terminal_get_t30_state(pvt->t38_state); - - if (terminate && t30) { - t30_terminate(t30); - } - - t38_terminal_release(pvt->t38_state); - } - - if (pvt->t38_gateway_state) { - t38_gateway_release(pvt->t38_gateway_state); - } - - if (pvt->udptl_state) { - udptl_release(pvt->udptl_state); - } - return SWITCH_STATUS_SUCCESS; -} - -static t38_mode_t configure_t38(pvt_t *pvt) -{ - switch_core_session_t *session = pvt->session; - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_t38_options_t *t38_options = switch_channel_get_private(channel, "t38_options"); - int method = 2; - - if (!t38_options || !pvt || !pvt->t38_core) { - pvt->t38_mode = T38_MODE_REFUSED; - return pvt->t38_mode; - } - - t38_set_t38_version(pvt->t38_core, t38_options->T38FaxVersion); - t38_set_max_buffer_size(pvt->t38_core, t38_options->T38FaxMaxBuffer); - t38_set_fastest_image_data_rate(pvt->t38_core, t38_options->T38MaxBitRate); - t38_set_fill_bit_removal(pvt->t38_core, t38_options->T38FaxFillBitRemoval); - t38_set_mmr_transcoding(pvt->t38_core, t38_options->T38FaxTranscodingMMR); - t38_set_jbig_transcoding(pvt->t38_core, t38_options->T38FaxTranscodingJBIG); - t38_set_max_datagram_size(pvt->t38_core, t38_options->T38FaxMaxDatagram); - - if (t38_options->T38FaxRateManagement) { - if (!strcasecmp(t38_options->T38FaxRateManagement, "transferredTCF")) { - method = 2; - } else { - method = 1; - } - } - - t38_set_data_rate_management_method(pvt->t38_core, method); - - - //t38_set_data_transport_protocol(pvt->t38_core, int data_transport_protocol); - //t38_set_redundancy_control(pvt->t38_core, int category, int setting); - - return pvt->t38_mode; -} - -static t38_mode_t negotiate_t38(pvt_t *pvt) -{ - switch_core_session_t *session = pvt->session; - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_core_session_message_t msg = { 0 }; - switch_t38_options_t *t38_options = switch_channel_get_private(channel, "t38_options"); - int enabled = 0, insist = 0; - const char *v; - - pvt->t38_mode = T38_MODE_REFUSED; - - if (pvt->app_mode == FUNCTION_GW) { - enabled = 1; - } else if ((v = switch_channel_get_variable(channel, "fax_enable_t38"))) { - enabled = switch_true(v); - } else { - enabled = globals.enable_t38; - } - - if (!(enabled && t38_options)) { - /* if there is no t38_options the endpoint will refuse the transition */ - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s NO T38 options detected.\n", switch_channel_get_name(channel)); - switch_channel_set_private(channel, "t38_options", NULL); - } else { - pvt->t38_mode = T38_MODE_NEGOTIATED; - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxVersion = %d\n", t38_options->T38FaxVersion); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38MaxBitRate = %d\n", t38_options->T38MaxBitRate); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxFillBitRemoval = %d\n", t38_options->T38FaxFillBitRemoval); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxTranscodingMMR = %d\n", t38_options->T38FaxTranscodingMMR); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxTranscodingJBIG = %d\n", t38_options->T38FaxTranscodingJBIG); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxRateManagement = '%s'\n", t38_options->T38FaxRateManagement); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxMaxBuffer = %d\n", t38_options->T38FaxMaxBuffer); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxMaxDatagram = %d\n", t38_options->T38FaxMaxDatagram); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxUdpEC = '%s'\n", t38_options->T38FaxUdpEC); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38VendorInfo = '%s'\n", switch_str_nil(t38_options->T38VendorInfo)); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "ip = '%s'\n", t38_options->remote_ip ? t38_options->remote_ip : "Not specified"); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "port = %d\n", t38_options->remote_port); - - /* Time to practice our negotiating skills, by editing the t38_options */ - - if (t38_options->T38FaxVersion > 3) { - t38_options->T38FaxVersion = 3; - } - t38_options->T38MaxBitRate = (pvt->disable_v17) ? 9600 : 14400; - t38_options->T38FaxFillBitRemoval = 1; - t38_options->T38FaxTranscodingMMR = 0; - t38_options->T38FaxTranscodingJBIG = 0; - t38_options->T38FaxRateManagement = "transferredTCF"; - t38_options->T38FaxMaxBuffer = 2000; - t38_options->T38FaxMaxDatagram = LOCAL_FAX_MAX_DATAGRAM; - if (strcasecmp(t38_options->T38FaxUdpEC, "t38UDPRedundancy") == 0 - || - strcasecmp(t38_options->T38FaxUdpEC, "t38UDPFEC") == 0) { - t38_options->T38FaxUdpEC = "t38UDPRedundancy"; - } else { - t38_options->T38FaxUdpEC = NULL; - } - t38_options->T38VendorInfo = "0 0 0"; - } - - if ((v = switch_channel_get_variable(channel, "fax_enable_t38_insist"))) { - insist = switch_true(v); - } else { - insist = globals.enable_t38_insist; - } - - /* This will send the options back in a response */ - msg.from = __FILE__; - msg.message_id = SWITCH_MESSAGE_INDICATE_T38_DESCRIPTION; - msg.numeric_arg = insist; - switch_core_session_receive_message(session, &msg); - - return pvt->t38_mode; -} - - - -static t38_mode_t request_t38(pvt_t *pvt) -{ - switch_core_session_t *session = pvt->session; - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_core_session_message_t msg = { 0 }; - switch_t38_options_t *t38_options = NULL; - int enabled = 0, insist = 0; - const char *v; - - pvt->t38_mode = T38_MODE_UNKNOWN; - - if (pvt->app_mode == FUNCTION_GW) { - enabled = 1; - } else if ((v = switch_channel_get_variable(channel, "fax_enable_t38"))) { - enabled = switch_true(v); - } else { - enabled = globals.enable_t38; - } - - if (enabled) { - if ((v = switch_channel_get_variable(channel, "fax_enable_t38_request"))) { - enabled = switch_true(v); - } else { - enabled = globals.enable_t38_request; - } - } - - - if ((v = switch_channel_get_variable(channel, "fax_enable_t38_insist"))) { - insist = switch_true(v); - } else { - insist = globals.enable_t38_insist; - } - - if (enabled) { - t38_options = switch_core_session_alloc(session, sizeof(*t38_options)); - - t38_options->T38MaxBitRate = (pvt->disable_v17) ? 9600 : 14400; - t38_options->T38FaxVersion = 0; - t38_options->T38FaxFillBitRemoval = 1; - t38_options->T38FaxTranscodingMMR = 0; - t38_options->T38FaxTranscodingJBIG = 0; - t38_options->T38FaxRateManagement = "transferredTCF"; - t38_options->T38FaxMaxBuffer = 2000; - t38_options->T38FaxMaxDatagram = LOCAL_FAX_MAX_DATAGRAM; - t38_options->T38FaxUdpEC = "t38UDPRedundancy"; - t38_options->T38VendorInfo = "0 0 0"; - - switch_channel_set_private(channel, "t38_options", t38_options); - pvt->t38_mode = T38_MODE_REQUESTED; - - /* This will send a request for t.38 mode */ - msg.from = __FILE__; - msg.message_id = SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA; - msg.numeric_arg = insist; - switch_core_session_receive_message(session, &msg); - } - - return pvt->t38_mode; -} - -/***************************************************************************** - MAIN FAX PROCESSING -*****************************************************************************/ - -static pvt_t *pvt_init(switch_core_session_t *session, application_mode_t app_mode) -{ - switch_channel_t *channel; - pvt_t *pvt = NULL; - const char *tmp; - - /* Make sure we have a valid channel when starting the FAX application */ - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - if (!switch_channel_media_ready(channel)) { - switch_channel_answer(channel); - } - - /* Allocate our structs */ - pvt = switch_core_session_alloc(session, sizeof(pvt_t)); - pvt->session = session; - - pvt->app_mode = app_mode; - - pvt->tx_page_start = -1; - pvt->tx_page_end = -1; - - - switch(pvt->app_mode) { - - case FUNCTION_TX: - pvt->caller = 1; - break; - case FUNCTION_RX: - pvt->caller = 0; - break; - case FUNCTION_GW: - break; - } - - /* Retrieving our settings from the channel variables */ - - if ((tmp = switch_channel_get_variable(channel, "fax_use_ecm"))) { - pvt->use_ecm = switch_true(tmp); - } else { - pvt->use_ecm = globals.use_ecm; - } - - if ((tmp = switch_channel_get_variable(channel, "fax_disable_v17"))) { - pvt->disable_v17 = switch_true(tmp); - } else { - pvt->disable_v17 = globals.disable_v17; - } - - if ((tmp = switch_channel_get_variable(channel, "fax_verbose"))) { - pvt->verbose = switch_true(tmp); - } else { - pvt->verbose = globals.verbose; - } - - if ((tmp = switch_channel_get_variable(channel, "fax_force_caller"))) { - if (switch_true(tmp)) { - pvt->caller = 1; - } else { - pvt->caller = 0; - } - } - - if ((tmp = switch_channel_get_variable(channel, "fax_ident"))) { - pvt->ident = switch_core_session_strdup(session, tmp); - } else { - pvt->ident = switch_core_session_strdup(session, globals.ident); - } - - if ((tmp = switch_channel_get_variable(channel, "fax_header"))) { - pvt->header = switch_core_session_strdup(session, tmp); - } else { - pvt->header = switch_core_session_strdup(session, globals.header); - } - - if (pvt->app_mode == FUNCTION_TX) { - if ((tmp = switch_channel_get_variable(channel, "fax_start_page"))) { - pvt->tx_page_start = atoi(tmp); - } - - if ((tmp = switch_channel_get_variable(channel, "fax_end_page"))) { - pvt->tx_page_end = atoi(tmp); - } - - if (pvt->tx_page_end < -1) { - pvt->tx_page_end = -1; - } - - if (pvt->tx_page_start < -1) { - pvt->tx_page_start = -1; - } - - if ((pvt->tx_page_end < pvt->tx_page_start) && (pvt->tx_page_end != -1)) { - pvt->tx_page_end = pvt->tx_page_start; - } - } - - return pvt; -} - -void process_fax(switch_core_session_t *session, const char *data, application_mode_t app_mode) -{ - pvt_t *pvt; - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_codec_t read_codec = { 0 }; - switch_codec_t write_codec = { 0 }; - switch_frame_t *read_frame = { 0 }; - switch_frame_t write_frame = { 0 }; - switch_codec_implementation_t read_impl = { 0 }; - int16_t *buf = NULL; - - switch_core_session_get_read_impl(session, &read_impl); - - counter_increment(); - - - pvt = pvt_init(session, app_mode); - - - buf = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE); - - if (!zstr(data)) { - pvt->filename = switch_core_session_strdup(session, data); - if (pvt->app_mode == FUNCTION_TX) { - if ((switch_file_exists(pvt->filename, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot send inexistant fax file [%s]\n", - switch_str_nil(pvt->filename)); - goto done; - } - } - } else { - if (pvt->app_mode == FUNCTION_TX) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Fax TX filename not set.\n"); - goto done; - } else if (pvt->app_mode == FUNCTION_RX) { - char *fname; - const char *prefix; - switch_time_t time; - - time = switch_time_now(); - - if (!(prefix = switch_channel_get_variable(channel, "fax_prefix"))) { - prefix = globals.prepend_string; - } - - fname = switch_mprintf("%s/%s-%ld-%ld.tif", globals.spool, prefix, globals.total_sessions, time); - if (fname) { - pvt->filename = switch_core_session_strdup(session, fname); - switch_safe_free(fname); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot automatically set fax RX destination file\n"); - goto done; - } - } else { - assert(0); /* UH ?? */ - } - } - - /* - *** Initialize the SpanDSP elements *** - - Note: we could analyze if a fax was already detected in previous stages - and if so, when T.38 will be supported, send a reinvite in T38_MODE, - bypassing AUDIO_MODE. - */ - - if ((spanfax_init(pvt, AUDIO_MODE) != SWITCH_STATUS_SUCCESS)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot initialize Fax engine\n"); - return; - } - - /* - Note: Disable echocan on the channel, remember to call app "disable_ec" in the dialplan - before invoking fax applications - */ - - /* - Note: we are disabling the Jitterbuffer, here, before we answer. - If you have set it to something else and the channel is pre-answered, - it will have no effect. Make sure that if you want more reliable - faxes, it is disabled. - */ - switch_channel_set_variable(channel, "jitterbuffer_msec", "0"); - - - /* We store the original channel codec before switching both - * legs of the calls to a linear 16 bit codec that is the one - * used internally by spandsp and FS will do the transcoding - * from G.711 or any other original codec - */ - if (switch_core_codec_init(&read_codec, - "L16", - NULL, - read_impl.samples_per_second, - read_impl.microseconds_per_packet / 1000, - 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, - NULL, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Raw read codec activation Success L16 %u\n", - read_codec.implementation->microseconds_per_packet); - switch_core_session_set_read_codec(session, &read_codec); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Raw read codec activation Failed L16\n"); - goto done; - } - - if (switch_core_codec_init(&write_codec, - "L16", - NULL, - read_impl.samples_per_second, - read_impl.microseconds_per_packet / 1000, - 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, - NULL, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Raw write codec activation Success L16\n"); - write_frame.codec = &write_codec; - write_frame.data = buf; - write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Raw write codec activation Failed L16\n"); - goto done; - } - - switch_ivr_sleep(session, 250, SWITCH_TRUE, NULL); - - - /* If you have the means, I highly recommend picking one up. ...*/ - request_t38(pvt); - - - while (switch_channel_ready(channel)) { - int tx = 0; - switch_status_t status; - - /* - if we are in T.38 mode, we should: 1- initialize the ptv->t38_state stuff, if not done - and then set some callbacks when reading frames. - The only thing we need, then, in this loop, is: - - read a frame without blocking - - eventually feed that frame in spandsp, - - call t38_terminal_send_timeout(), sleep for a while - - The T.38 stuff can be placed here (and the audio stuff can be skipped) - */ - - /* read new audio frame from the channel */ - status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); - - if (!SWITCH_READ_ACCEPTABLE(status) || pvt->done) { - /* Our duty is over */ - goto done; - } - - switch (pvt->t38_mode) { - case T38_MODE_REQUESTED: - { - if (switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) { - switch_core_session_message_t msg = { 0 }; - pvt->t38_mode = T38_MODE_NEGOTIATED; - spanfax_init(pvt, T38_MODE); - configure_t38(pvt); - - /* This will change the rtp stack to udptl mode */ - msg.from = __FILE__; - msg.message_id = SWITCH_MESSAGE_INDICATE_UDPTL_MODE; - switch_core_session_receive_message(session, &msg); - } - continue; - } - break; - case T38_MODE_UNKNOWN: - { - if (switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) { - if (negotiate_t38(pvt) == T38_MODE_NEGOTIATED) { - /* is is safe to call this again, it was already called above in AUDIO_MODE */ - /* but this is the only way to set up the t38 stuff */ - spanfax_init(pvt, T38_MODE); - continue; - } - } - } - break; - case T38_MODE_NEGOTIATED: - { - /* do what we need to do when we are in t38 mode */ - if (switch_test_flag(read_frame, SFF_CNG)) { - /* dunno what to do, most likely you will not get too many of these since we turn off the timer in udptl mode */ - continue; - } - - if (switch_test_flag(read_frame, SFF_UDPTL_PACKET)) { - /* now we know we can cast frame->packet to a udptl structure */ - //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "READ %d udptl bytes\n", read_frame->packetlen); - - udptl_rx_packet(pvt->udptl_state, read_frame->packet, read_frame->packetlen); - - - } - } - continue; - default: - break; - } - - /* Skip CNG frames (auto-generated by FreeSWITCH, usually) */ - if (switch_test_flag(read_frame, SFF_CNG)) { - /* We have no real signal data for the FAX software, but we have a space in time if we have a CNG indication. - Do a fill-in operation in the FAX machine, to keep things rolling along. */ - if (fax_rx_fillin(pvt->fax_state, read_frame->samples)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "fax_rx_fillin reported an error\n"); - goto done; - } - } else { - /* Pass the new incoming audio frame to the fax_rx function */ - if (fax_rx(pvt->fax_state, (int16_t *) read_frame->data, read_frame->samples)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "fax_rx reported an error\n"); - goto done; - } - } - - if ((tx = fax_tx(pvt->fax_state, buf, write_codec.implementation->samples_per_packet)) < 0) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "fax_tx reported an error\n"); - goto done; - } - - if (!tx) { - /* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No audio samples to send\n"); */ - continue; - } else { - /* Set our write_frame data */ - write_frame.datalen = tx * sizeof(int16_t); - write_frame.samples = tx; - } - - if (switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { - goto done; - } - - } - - done: - /* Destroy the SpanDSP structures */ - spanfax_destroy(pvt); - - /* restore the original codecs over the channel */ - - switch_core_session_set_read_codec(session, NULL); - - if (switch_core_codec_ready(&read_codec)) { - switch_core_codec_destroy(&read_codec); - } - - if (switch_core_codec_ready(&write_codec)) { - switch_core_codec_destroy(&write_codec); - } -} - -/* ************************************************************************** - CONFIGURATION - ************************************************************************* */ - -void load_configuration(switch_bool_t reload) -{ - switch_xml_t xml = NULL, x_lists = NULL, x_list = NULL, cfg = NULL; - - if ((xml = switch_xml_open_cfg("fax.conf", &cfg, NULL))) { - if ((x_lists = switch_xml_child(cfg, "settings"))) { - for (x_list = switch_xml_child(x_lists, "param"); x_list; x_list = x_list->next) { - const char *name = switch_xml_attr(x_list, "name"); - const char *value = switch_xml_attr(x_list, "value"); - - if (zstr(name)) { - continue; - } - - if (zstr(value)) { - continue; - } - - if (!strcmp(name, "use-ecm")) { - if (switch_true(value)) - globals.use_ecm = 1; - else - globals.use_ecm = 0; - } else if (!strcmp(name, "verbose")) { - if (switch_true(value)) - globals.verbose = 1; - else - globals.verbose = 0; - } else if (!strcmp(name, "disable-v17")) { - if (switch_true(value)) - globals.disable_v17 = 1; - else - globals.disable_v17 = 0; - } else if (!strcmp(name, "enable-t38")) { - if (switch_true(value)) { - globals.enable_t38= 1; - } else { - globals.enable_t38 = 0; - } - } else if (!strcmp(name, "enable-t38-request")) { - if (switch_true(value)) { - globals.enable_t38_request = 1; - } else { - globals.enable_t38_request = 0; - } - } else if (!strcmp(name, "ident")) { - strncpy(globals.ident, value, sizeof(globals.ident) - 1); - } else if (!strcmp(name, "header")) { - strncpy(globals.header, value, sizeof(globals.header) - 1); - } else if (!strcmp(name, "spool-dir")) { - globals.spool = switch_core_strdup(globals.pool, value); - } else if (!strcmp(name, "file-prefix")) { - globals.prepend_string = switch_core_strdup(globals.pool, value); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unknown parameter %s\n", name); - } - - } - } - - switch_xml_free(xml); - } -} - -static void event_handler(switch_event_t *event) -{ - load_configuration(1); -} - - - - - - -typedef struct { - switch_core_session_t *session; - dtmf_rx_state_t *dtmf_detect; -} switch_inband_dtmf_t; - -static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type) -{ - switch_inband_dtmf_t *pvt = (switch_inband_dtmf_t *) user_data; - switch_frame_t *frame = NULL; - char digit_str[80]; - switch_channel_t *channel = switch_core_session_get_channel(pvt->session); - - switch (type) { - case SWITCH_ABC_TYPE_INIT: - pvt->dtmf_detect = dtmf_rx_init(NULL, NULL, NULL); - break; - case SWITCH_ABC_TYPE_CLOSE: - if (pvt->dtmf_detect) { - dtmf_rx_free(pvt->dtmf_detect); - } - break; - case SWITCH_ABC_TYPE_READ_REPLACE: - if ((frame = switch_core_media_bug_get_read_replace_frame(bug))) { - dtmf_rx(pvt->dtmf_detect, frame->data, frame->samples); - dtmf_rx_get(pvt->dtmf_detect, digit_str, sizeof(digit_str)); - if (digit_str[0]) { - char *p = digit_str; - while (p && *p) { - switch_dtmf_t dtmf = {0}; - dtmf.digit = *p; - dtmf.duration = switch_core_default_dtmf_duration(0); - switch_channel_queue_dtmf(channel, &dtmf); - p++; - } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(bug)), SWITCH_LOG_DEBUG, "DTMF DETECTED: [%s]\n", - digit_str); - } - switch_core_media_bug_set_read_replace_frame(bug, frame); - } - break; - case SWITCH_ABC_TYPE_WRITE: - default: - break; - } - - return SWITCH_TRUE; -} - -switch_status_t spandsp_stop_inband_dtmf_session(switch_core_session_t *session) -{ - switch_media_bug_t *bug; - switch_channel_t *channel = switch_core_session_get_channel(session); - - if ((bug = switch_channel_get_private(channel, "dtmf"))) { - switch_channel_set_private(channel, "dtmf", NULL); - switch_core_media_bug_remove(session, &bug); - return SWITCH_STATUS_SUCCESS; - } - return SWITCH_STATUS_FALSE; -} - -switch_status_t spandsp_inband_dtmf_session(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_media_bug_t *bug; - switch_status_t status; - switch_inband_dtmf_t *pvt; - switch_codec_implementation_t read_impl = { 0 }; - - switch_core_session_get_read_impl(session, &read_impl); - - if (!(pvt = switch_core_session_alloc(session, sizeof(*pvt)))) { - return SWITCH_STATUS_MEMERR; - } - - - pvt->session = session; - - - if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) { - return SWITCH_STATUS_FALSE; - } - - if ((status = switch_core_media_bug_add(session, "spandsp_dtmf_detect", NULL, - inband_dtmf_callback, pvt, 0, SMBF_READ_REPLACE, &bug)) != SWITCH_STATUS_SUCCESS) { - return status; - } - - switch_channel_set_private(channel, "dtmf", bug); - - return SWITCH_STATUS_SUCCESS; -} - -/* ************************************************************************** - FREESWITCH MODULE DEFINITIONS - ************************************************************************* */ - -#define SPANFAX_RX_USAGE "" -#define SPANFAX_TX_USAGE "" - -SWITCH_MODULE_LOAD_FUNCTION(mod_fax_init); -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fax_shutdown); -SWITCH_MODULE_DEFINITION(mod_fax, mod_fax_init, mod_fax_shutdown, NULL); - -static switch_event_node_t *NODE = NULL; - -SWITCH_STANDARD_APP(spanfax_tx_function) -{ - process_fax(session, data, FUNCTION_TX); -} - -SWITCH_STANDARD_APP(spanfax_rx_function) -{ - process_fax(session, data, FUNCTION_RX); -} - - -SWITCH_STANDARD_APP(dtmf_session_function) -{ - spandsp_inband_dtmf_session(session); -} - -SWITCH_STANDARD_APP(stop_dtmf_session_function) -{ - spandsp_stop_inband_dtmf_session(session); -} - -static const switch_state_handler_table_t t38_gateway_state_handlers; - -static switch_status_t t38_gateway_on_soft_execute(switch_core_session_t *session) -{ - switch_core_session_t *other_session; - - switch_channel_t *other_channel, *channel = switch_core_session_get_channel(session); - pvt_t *pvt; - const char *peer_uuid = switch_channel_get_variable(channel, "t38_peer"); - switch_core_session_message_t msg = { 0 }; - switch_status_t status; - switch_frame_t *read_frame = { 0 }; - - if (!(other_session = switch_core_session_locate(peer_uuid))) { - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Cannot locate channel with uuid %s", - switch_channel_get_name(channel), peer_uuid); - goto end; - } - - other_channel = switch_core_session_get_channel(other_session); - - pvt = pvt_init(session, FUNCTION_GW); - request_t38(pvt); - - msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE; - msg.from = __FILE__; - msg.string_arg = peer_uuid; - switch_core_session_receive_message(session, &msg); - - while (switch_channel_ready(channel) && switch_channel_up(other_channel) && !switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) { - status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); - - if (!SWITCH_READ_ACCEPTABLE(status) || pvt->done) { - /* Our duty is over */ - goto end_unlock; - } - - if (switch_test_flag(read_frame, SFF_CNG)) { - continue; - } - - if (switch_core_session_write_frame(other_session, read_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { - goto end_unlock; - } - } - - if (!(switch_channel_ready(channel) && switch_channel_up(other_channel))) { - goto end_unlock; - } - - if (!switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) { - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Could not negotiate T38\n", switch_channel_get_name(channel)); - goto end_unlock; - } - - if (pvt->t38_mode == T38_MODE_REQUESTED) { - spanfax_init(pvt, T38_GATEWAY_MODE); - configure_t38(pvt); - pvt->t38_mode = T38_MODE_NEGOTIATED; - } else { - if (negotiate_t38(pvt) != T38_MODE_NEGOTIATED) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Could not negotiate T38\n", switch_channel_get_name(channel)); - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - goto end_unlock; - } - - spanfax_init(pvt, T38_GATEWAY_MODE); - } - - /* This will change the rtp stack to udptl mode */ - msg.from = __FILE__; - msg.message_id = SWITCH_MESSAGE_INDICATE_UDPTL_MODE; - switch_core_session_receive_message(session, &msg); - - - /* wake up the audio side */ - switch_channel_set_private(channel, "_t38_pvt", pvt); - switch_channel_set_app_flag_key("T38", other_channel, CF_APP_T38); - - - while (switch_channel_ready(channel) && switch_channel_up(other_channel)) { - - status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); - - if (!SWITCH_READ_ACCEPTABLE(status) || pvt->done) { - /* Our duty is over */ - goto end_unlock; - } - - if (switch_test_flag(read_frame, SFF_CNG)) { - continue; - } - - if (switch_test_flag(read_frame, SFF_UDPTL_PACKET)) { - udptl_rx_packet(pvt->udptl_state, read_frame->packet, read_frame->packetlen); - } - } - - end_unlock: - - - msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; - msg.from = __FILE__; - msg.string_arg = peer_uuid; - switch_core_session_receive_message(session, &msg); - - switch_channel_hangup(other_channel, SWITCH_CAUSE_NORMAL_CLEARING); - switch_core_session_rwunlock(other_session); - - end: - - switch_channel_clear_state_handler(channel, &t38_gateway_state_handlers); - switch_channel_set_variable(channel, "t38_peer", NULL); - - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t t38_gateway_on_consume_media(switch_core_session_t *session) -{ - switch_core_session_t *other_session; - switch_channel_t *other_channel, *channel = switch_core_session_get_channel(session); - const char *peer_uuid = switch_channel_get_variable(channel, "t38_peer"); - pvt_t *pvt = NULL; - switch_codec_t read_codec = { 0 }; - switch_codec_t write_codec = { 0 }; - switch_frame_t *read_frame = { 0 }; - switch_frame_t write_frame = { 0 }; - switch_codec_implementation_t read_impl = { 0 }; - int16_t *buf = NULL; - switch_status_t status; - switch_size_t tx; - const char *t38_trace = switch_channel_get_variable(channel, "t38_trace"); - char *trace_read, *trace_write; - zap_socket_t read_fd = FAX_INVALID_SOCKET, write_fd = FAX_INVALID_SOCKET; - switch_core_session_message_t msg = { 0 }; - switch_event_t *event; - - switch_core_session_get_read_impl(session, &read_impl); - - buf = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE); - - if (!(other_session = switch_core_session_locate(peer_uuid))) { - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - goto end; - } - - other_channel = switch_core_session_get_channel(other_session); - - msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE; - msg.from = __FILE__; - msg.string_arg = peer_uuid; - switch_core_session_receive_message(session, &msg); - - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(channel, event); - switch_event_fire(&event); - } - - while (switch_channel_ready(channel) && switch_channel_up(other_channel) && !switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) { - status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); - - if (!SWITCH_READ_ACCEPTABLE(status)) { - /* Our duty is over */ - goto end_unlock; - } - - if (switch_test_flag(read_frame, SFF_CNG)) { - continue; - } - - if (switch_core_session_write_frame(other_session, read_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { - goto end_unlock; - } - } - - if (!(switch_channel_ready(channel) && switch_channel_up(other_channel))) { - goto end_unlock; - } - - if (!switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) { - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - goto end_unlock; - } - - if (!(pvt = switch_channel_get_private(other_channel, "_t38_pvt"))) { - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - goto end_unlock; - } - - if (switch_core_codec_init(&read_codec, - "L16", - NULL, - read_impl.samples_per_second, - read_impl.microseconds_per_packet / 1000, - 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, - NULL, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Raw read codec activation Success L16 %u\n", - read_codec.implementation->microseconds_per_packet); - switch_core_session_set_read_codec(session, &read_codec); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Raw read codec activation Failed L16\n"); - goto end_unlock; - } - - if (switch_core_codec_init(&write_codec, - "L16", - NULL, - read_impl.samples_per_second, - read_impl.microseconds_per_packet / 1000, - 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, - NULL, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Raw write codec activation Success L16\n"); - write_frame.codec = &write_codec; - write_frame.data = buf; - write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Raw write codec activation Failed L16\n"); - goto end_unlock; - } - - switch_ivr_sleep(session, 0, SWITCH_TRUE, NULL); - - if (switch_true(t38_trace)) { - trace_read = switch_core_session_sprintf(session, "%s%s%s_read.raw", SWITCH_GLOBAL_dirs.temp_dir, - SWITCH_PATH_SEPARATOR, switch_core_session_get_uuid(session)); - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Tracing inbound audio to %s\n", trace_read); - switch_channel_set_variable(channel, "t38_trace_read", trace_read); - - trace_write = switch_core_session_sprintf(session, "%s%s%s_write.raw", SWITCH_GLOBAL_dirs.temp_dir, - SWITCH_PATH_SEPARATOR, switch_core_session_get_uuid(session)); - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Tracing outbound audio to %s\n", trace_write); - switch_channel_set_variable(channel, "t38_trace_read", trace_write); - - - if ((write_fd = open(trace_read, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) != FAX_INVALID_SOCKET) { - if ((read_fd = open(trace_write, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) == FAX_INVALID_SOCKET) { - close(write_fd); - write_fd = FAX_INVALID_SOCKET; - } - } - } - - while (switch_channel_ready(channel) && switch_channel_up(other_channel)) { - status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); - - if (!SWITCH_READ_ACCEPTABLE(status) || pvt->done) { - /* Our duty is over */ - goto end_unlock; - } - - - /* Skip CNG frames (auto-generated by FreeSWITCH, usually) */ - if (!switch_test_flag(read_frame, SFF_CNG)) { - - if (read_fd != FAX_INVALID_SOCKET) { - int w = write(read_fd, read_frame->data, read_frame->datalen); - if (w <= 0) { - close(read_fd); - read_fd = FAX_INVALID_SOCKET; - } - } - if (t38_gateway_rx(pvt->t38_gateway_state, (int16_t *) read_frame->data, read_frame->samples)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "fax_rx reported an error\n"); - goto end_unlock; - } - } - - if ((tx = t38_gateway_tx(pvt->t38_gateway_state, buf, write_codec.implementation->samples_per_packet)) < 0) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "fax_tx reported an error\n"); - goto end_unlock; - } - - if (!tx) { - /* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No audio samples to send\n"); */ - continue; - } else { - /* Set our write_frame data */ - write_frame.datalen = tx * sizeof(int16_t); - write_frame.samples = tx; - } - - if (write_fd != FAX_INVALID_SOCKET) { - int w = write(write_fd, write_frame.data, write_frame.datalen); - if (w <= 0) { - close(write_fd); - write_fd = FAX_INVALID_SOCKET; - } - } - - if (switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { - goto end_unlock; - } - } - - end_unlock: - - msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; - msg.from = __FILE__; - msg.string_arg = peer_uuid; - switch_core_session_receive_message(session, &msg); - - - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(channel, event); - switch_event_fire(&event); - } - - if (read_fd != FAX_INVALID_SOCKET) { - close(read_fd); - read_fd = FAX_INVALID_SOCKET; - } - - if (write_fd != FAX_INVALID_SOCKET) { - close(write_fd); - write_fd = FAX_INVALID_SOCKET; - } - - - switch_channel_hangup(other_channel, SWITCH_CAUSE_NORMAL_CLEARING); - switch_core_session_rwunlock(other_session); - - switch_core_session_set_read_codec(session, NULL); - - if (switch_core_codec_ready(&read_codec)) { - switch_core_codec_destroy(&read_codec); - } - - if (switch_core_codec_ready(&write_codec)) { - switch_core_codec_destroy(&write_codec); - } - - - end: - - switch_channel_clear_state_handler(channel, &t38_gateway_state_handlers); - switch_channel_set_variable(channel, "t38_peer", NULL); - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t t38_gateway_on_reset(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - - switch_channel_set_variable(channel, "rtp_autoflush_during_bridge", "false"); - - switch_channel_clear_flag(channel, CF_REDIRECT); - - if (switch_channel_test_app_flag(channel, CF_APP_TAGGED)) { - switch_channel_clear_app_flag(channel, CF_APP_TAGGED); - switch_channel_set_state(channel, CS_CONSUME_MEDIA); - } else { - switch_channel_set_state(channel, CS_SOFT_EXECUTE); - } - - return SWITCH_STATUS_SUCCESS; -} - -static const switch_state_handler_table_t t38_gateway_state_handlers = { - /*.on_init */ NULL, - /*.on_routing */ NULL, - /*.on_execute */ NULL, - /*.on_hangup */ NULL, - /*.on_exchange_media */ NULL, - /*.on_soft_execute */ t38_gateway_on_soft_execute, - /*.on_consume_media */ t38_gateway_on_consume_media, - /*.on_hibernate */ NULL, - /*.on_reset */ t38_gateway_on_reset, - /*.on_park */ NULL, - /*.on_reporting */ NULL, - /*.on_destroy */ NULL, - SSH_FLAG_STICKY -}; - -static switch_bool_t t38_gateway_start(switch_core_session_t *session, const char *app, const char *data) -{ - switch_channel_t *other_channel = NULL, *channel = switch_core_session_get_channel(session); - switch_core_session_t *other_session = NULL; - int peer = app && !strcasecmp(app, "peer"); - - if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { - other_channel = switch_core_session_get_channel(other_session); - - switch_channel_set_variable(channel, "t38_peer", switch_core_session_get_uuid(other_session)); - switch_channel_set_variable(other_channel, "t38_peer", switch_core_session_get_uuid(session)); - - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s starting gateway mode to %s\n", - switch_channel_get_name(peer ? channel : other_channel), - switch_channel_get_name(peer ? other_channel : channel)); - - - switch_channel_clear_state_handler(channel, NULL); - switch_channel_clear_state_handler(other_channel, NULL); - - switch_channel_add_state_handler(channel, &t38_gateway_state_handlers); - switch_channel_add_state_handler(other_channel, &t38_gateway_state_handlers); - - switch_channel_set_app_flag(peer ? channel : other_channel, CF_APP_TAGGED); - switch_channel_clear_app_flag(peer ? other_channel : channel, CF_APP_TAGGED); - - switch_channel_set_flag(channel, CF_REDIRECT); - switch_channel_set_state(channel, CS_RESET); - - switch_channel_set_flag(other_channel, CF_REDIRECT); - switch_channel_set_state(other_channel, CS_RESET); - - switch_core_session_rwunlock(other_session); - - } - - return SWITCH_FALSE; -} - - -SWITCH_STANDARD_APP(t38_gateway_function) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - time_t timeout = switch_epoch_time_now(NULL) + 20; - const char *var; - - if (zstr(data) || strcasecmp(data, "self")) { - data = "peer"; - } - - switch_channel_set_variable(channel, "t38_leg", data); - - if ((var = switch_channel_get_variable(channel, "t38_gateway_detect_timeout"))) { - long to = atol(var); - if (to > -1) { - timeout = (time_t) (switch_epoch_time_now(NULL) + to); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s invalid timeout value.\n", switch_channel_get_name(channel)); - } - } - - switch_ivr_tone_detect_session(session, "t38", "1100.0", "rw", timeout, 1, data, NULL, t38_gateway_start); -} - - -SWITCH_MODULE_LOAD_FUNCTION(mod_fax_init) -{ - switch_application_interface_t *app_interface; - - *module_interface = switch_loadable_module_create_module_interface(pool, modname); - - SWITCH_ADD_APP(app_interface, "t38_gateway", "Convert to T38 Gateway if tones are heard", "Convert to T38 Gateway if tones are heard", - t38_gateway_function, "", SAF_MEDIA_TAP); - - SWITCH_ADD_APP(app_interface, "rxfax", "FAX Receive Application", "FAX Receive Application", spanfax_rx_function, SPANFAX_RX_USAGE, - SAF_SUPPORT_NOMEDIA); - SWITCH_ADD_APP(app_interface, "txfax", "FAX Transmit Application", "FAX Transmit Application", spanfax_tx_function, SPANFAX_TX_USAGE, - SAF_SUPPORT_NOMEDIA); - - SWITCH_ADD_APP(app_interface, "spandsp_stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE); - SWITCH_ADD_APP(app_interface, "spandsp_start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_MEDIA_TAP); - - memset(&globals, 0, sizeof(globals)); - memset(&t38_state_list, 0, sizeof(t38_state_list)); - switch_core_new_memory_pool(&globals.pool); - switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool); - switch_mutex_init(&t38_state_list.mutex, SWITCH_MUTEX_NESTED, globals.pool); - - globals.enable_t38 = 1; - globals.total_sessions = 0; - globals.verbose = 1; - globals.use_ecm = 1; - globals.disable_v17 = 0; - globals.prepend_string = switch_core_strdup(globals.pool, "fax"); - globals.spool = switch_core_strdup(globals.pool, "/tmp"); - strncpy(globals.ident, "SpanDSP Fax Ident", sizeof(globals.ident) - 1); - strncpy(globals.header, "SpanDSP Fax Header", sizeof(globals.header) - 1); - - load_configuration(0); - - if ((switch_event_bind_removable(modname, SWITCH_EVENT_RELOADXML, NULL, event_handler, NULL, &NODE) != SWITCH_STATUS_SUCCESS)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind our reloadxml handler!\n"); - /* Not such severe to prevent loading */ - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_fax loaded, using spandsp library version [%s]\n", SPANDSP_RELEASE_DATETIME_STRING); - - return SWITCH_STATUS_SUCCESS; -} - -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fax_shutdown) -{ - switch_memory_pool_t *pool = globals.pool; - - switch_event_unbind(&NODE); - - switch_core_destroy_memory_pool(&pool); - memset(&globals, 0, sizeof(globals)); - - return SWITCH_STATUS_UNLOAD; -} - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:nil - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4: - */ diff --git a/src/mod/applications/mod_fax/udptl.c b/src/mod/applications/mod_fax/udptl.c deleted file mode 100644 index a2651513f0..0000000000 --- a/src/mod/applications/mod_fax/udptl.c +++ /dev/null @@ -1,563 +0,0 @@ -//#define UDPTL_DEBUG -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2009, Steve Underwood - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Contributor(s): - * - * Steve Underwood - * - * udptl.c -- UDPTL handling for T.38 - * - */ - -#include -#include -#include -#include -#include - -#include "udptl.h" - -#define FALSE 0 -#define TRUE (!FALSE) - -static int decode_length(const uint8_t *buf, int limit, int *len, int *pvalue) -{ - if (*len >= limit) - return -1; - if ((buf[*len] & 0x80) == 0) { - *pvalue = buf[(*len)++]; - return 0; - } - if ((buf[*len] & 0x40) == 0) { - if (*len >= limit - 1) - return -1; - *pvalue = (buf[(*len)++] & 0x3F) << 8; - *pvalue |= buf[(*len)++]; - return 0; - } - *pvalue = (buf[(*len)++] & 0x3F) << 14; - /* Indicate we have a fragment */ - return 1; -} - -/*- End of function --------------------------------------------------------*/ - -static int decode_open_type(const uint8_t *buf, int limit, int *len, const uint8_t ** p_object, int *p_num_octets) -{ - int octet_cnt; - int octet_idx; - int stat; - int i; - const uint8_t **pbuf; - - for (octet_idx = 0, *p_num_octets = 0;; octet_idx += octet_cnt) { - if ((stat = decode_length(buf, limit, len, &octet_cnt)) < 0) - return -1; - if (octet_cnt > 0) { - *p_num_octets += octet_cnt; - - pbuf = &p_object[octet_idx]; - i = 0; - /* Make sure the buffer contains at least the number of bits requested */ - if ((*len + octet_cnt) > limit) - return -1; - - *pbuf = &buf[*len]; - *len += octet_cnt; - } - if (stat == 0) - break; - } - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -static int encode_length(uint8_t *buf, int *len, int value) -{ - int multiplier; - - if (value < 0x80) { - /* 1 octet */ - buf[(*len)++] = value; - return value; - } - if (value < 0x4000) { - /* 2 octets */ - /* Set the first bit of the first octet */ - buf[(*len)++] = ((0x8000 | value) >> 8) & 0xFF; - buf[(*len)++] = value & 0xFF; - return value; - } - /* Fragmentation */ - multiplier = (value < 0x10000) ? (value >> 14) : 4; - /* Set the first 2 bits of the octet */ - buf[(*len)++] = 0xC0 | multiplier; - return multiplier << 14; -} - -/*- End of function --------------------------------------------------------*/ - -static int encode_open_type(uint8_t *buf, int *len, const uint8_t *data, int num_octets) -{ - int enclen; - int octet_idx; - uint8_t zero_byte; - - /* If open type is of zero length, add a single zero byte (10.1) */ - if (num_octets == 0) { - zero_byte = 0; - data = &zero_byte; - num_octets = 1; - } - /* Encode the open type */ - for (octet_idx = 0;; num_octets -= enclen, octet_idx += enclen) { - if ((enclen = encode_length(buf, len, num_octets)) < 0) - return -1; - if (enclen > 0) { - memcpy(&buf[*len], &data[octet_idx], enclen); - *len += enclen; - } - if (enclen >= num_octets) - break; - } - - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len) -{ - int stat; - int stat2; - int i; - int j; - int k; - int l; - int m; - int x; - int limit; - int which; - int ptr; - int count; - int total_count; - int seq_no; - const uint8_t *msg; - const uint8_t *data; - int msg_len; - int repaired[16]; - const uint8_t *bufs[16]; - int lengths[16]; - int span; - int entries; - - ptr = 0; - /* Decode seq_number */ - if (ptr + 2 > len) - return -1; - seq_no = (buf[0] << 8) | buf[1]; - ptr += 2; - /* Break out the primary packet */ - if ((stat = decode_open_type(buf, len, &ptr, &msg, &msg_len)) != 0) - return -1; - /* Decode error_recovery */ - if (ptr + 1 > len) - return -1; - /* Our buffers cannot tolerate overlength packets */ - if (msg_len > LOCAL_FAX_MAX_DATAGRAM) - return -1; - /* Update any missed slots in the buffer */ - for (i = s->rx_seq_no; seq_no > i; i++) { - x = i & UDPTL_BUF_MASK; - s->rx[x].buf_len = -1; - s->rx[x].fec_len[0] = 0; - s->rx[x].fec_span = 0; - s->rx[x].fec_entries = 0; - } - /* Save the new packet. Pure redundancy mode won't use this, but some systems will switch - into FEC mode after sending some redundant packets. */ - x = seq_no & UDPTL_BUF_MASK; - memcpy(s->rx[x].buf, msg, msg_len); - s->rx[x].buf_len = msg_len; - s->rx[x].fec_len[0] = 0; - s->rx[x].fec_span = 0; - s->rx[x].fec_entries = 0; - if ((buf[ptr++] & 0x80) == 0) { - /* Secondary packet mode for error recovery */ - /* We might have the packet we want, but we need to check through - the redundant stuff, and verify the integrity of the UDPTL. - This greatly reduces our chances of accepting garbage. */ - total_count = 0; - do { - if ((stat2 = decode_length(buf, len, &ptr, &count)) < 0) - return -1; - for (i = 0; i < count; i++) { - if ((stat = decode_open_type(buf, len, &ptr, &bufs[total_count + i], &lengths[total_count + i])) != 0) - return -1; - } - total_count += count; - } - while (stat2 > 0); - /* We should now be exactly at the end of the packet. If not, this is a fault. */ - if (ptr != len) - return -1; - if (seq_no > s->rx_seq_no) { - /* We received a later packet than we expected, so we need to check if we can fill in the gap from the - secondary packets. */ - /* Step through in reverse order, so we go oldest to newest */ - for (i = total_count; i > 0; i--) { - if (seq_no - i >= s->rx_seq_no) { - /* This one wasn't seen before */ - /* Decode the secondary packet */ -#if defined(UDPTL_DEBUG) - fprintf(stderr, "Secondary %d, len %d\n", seq_no - i, lengths[i - 1]); -#endif - /* Save the new packet. Redundancy mode won't use this, but some systems will switch into - FEC mode after sending some redundant packets, and this may then be important. */ - x = (seq_no - i) & UDPTL_BUF_MASK; - memcpy(s->rx[x].buf, bufs[i - 1], lengths[i - 1]); - s->rx[x].buf_len = lengths[i - 1]; - s->rx[x].fec_len[0] = 0; - s->rx[x].fec_span = 0; - s->rx[x].fec_entries = 0; - if (s->rx_packet_handler(s->user_data, bufs[i - 1], lengths[i - 1], seq_no - i) < 0) - fprintf(stderr, "Bad IFP\n"); - } - } - } - } else { - /* FEC mode for error recovery */ - - /* Decode the FEC packets */ - /* The span is defined as an unconstrained integer, but will never be more - than a small value. */ - if (ptr + 2 > len) - return -1; - if (buf[ptr++] != 1) - return -1; - span = buf[ptr++]; - - x = seq_no & UDPTL_BUF_MASK; - - s->rx[x].fec_span = span; - - memset(repaired, 0, sizeof(repaired)); - repaired[x] = TRUE; - - /* The number of entries is defined as a length, but will only ever be a small - value. Treat it as such. */ - if (ptr + 1 > len) - return -1; - entries = buf[ptr++]; - s->rx[x].fec_entries = entries; - - /* Decode the elements */ - for (i = 0; i < entries; i++) { - if ((stat = decode_open_type(buf, len, &ptr, &data, &s->rx[x].fec_len[i])) != 0) - return -1; - if (s->rx[x].fec_len[i] > LOCAL_FAX_MAX_DATAGRAM) - return -1; - - /* Save the new FEC data */ - memcpy(s->rx[x].fec[i], data, s->rx[x].fec_len[i]); -#if 0 - fprintf(stderr, "FEC: "); - for (j = 0; j < s->rx[x].fec_len[i]; j++) - fprintf(stderr, "%02X ", data[j]); - fprintf(stderr, "\n"); -#endif - } - /* We should now be exactly at the end of the packet. If not, this is a fault. */ - if (ptr != len) - return -1; - /* See if we can reconstruct anything which is missing */ - /* TODO: this does not comprehensively hunt back and repair everything that is possible */ - for (l = x; l != ((x - (16 - span * entries)) & UDPTL_BUF_MASK); l = (l - 1) & UDPTL_BUF_MASK) { - if (s->rx[l].fec_len[0] <= 0) - continue; - for (m = 0; m < s->rx[l].fec_entries; m++) { - limit = (l + m) & UDPTL_BUF_MASK; - for (which = -1, k = (limit - s->rx[l].fec_span * s->rx[l].fec_entries) & UDPTL_BUF_MASK; k != limit; - k = (k + s->rx[l].fec_entries) & UDPTL_BUF_MASK) { - if (s->rx[k].buf_len <= 0) - which = (which == -1) ? k : -2; - } - if (which >= 0) { - /* Repairable */ - for (j = 0; j < s->rx[l].fec_len[m]; j++) { - s->rx[which].buf[j] = s->rx[l].fec[m][j]; - for (k = (limit - s->rx[l].fec_span * s->rx[l].fec_entries) & UDPTL_BUF_MASK; k != limit; - k = (k + s->rx[l].fec_entries) & UDPTL_BUF_MASK) - s->rx[which].buf[j] ^= (s->rx[k].buf_len > j) ? s->rx[k].buf[j] : 0; - } - s->rx[which].buf_len = s->rx[l].fec_len[m]; - repaired[which] = TRUE; - } - } - } - /* Now play any new packets forwards in time */ - for (l = (x + 1) & UDPTL_BUF_MASK, j = seq_no - UDPTL_BUF_MASK; l != x; l = (l + 1) & UDPTL_BUF_MASK, j++) { - if (repaired[l]) { -#if defined(UDPTL_DEBUG) - fprintf(stderr, "Fixed packet %d, len %d\n", j, l); -#endif - if (s->rx_packet_handler(s->user_data, s->rx[l].buf, s->rx[l].buf_len, j) < 0) - fprintf(stderr, "Bad IFP\n"); - } - } - } - /* If packets are received out of sequence, we may have already processed this packet from the error - recovery information in a packet already received. */ - if (seq_no >= s->rx_seq_no) { - /* Decode the primary packet */ -#if defined(UDPTL_DEBUG) - fprintf(stderr, "Primary packet %d, len %d\n", seq_no, msg_len); -#endif - if (s->rx_packet_handler(s->user_data, msg, msg_len, seq_no) < 0) - fprintf(stderr, "Bad IFP\n"); - } - - s->rx_seq_no = (seq_no + 1) & 0xFFFF; - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int msg_len) -{ - uint8_t fec[LOCAL_FAX_MAX_DATAGRAM]; - int i; - int j; - int seq; - int entry; - int entries; - int span; - int m; - int len; - int limit; - int high_tide; - - /* UDPTL cannot cope with zero length messages, and our buffering for redundancy limits their - maximum length. */ - if (msg_len < 1 || msg_len > LOCAL_FAX_MAX_DATAGRAM) - return -1; - seq = s->tx_seq_no & 0xFFFF; - - /* Map the sequence number to an entry in the circular buffer */ - entry = seq & UDPTL_BUF_MASK; - - /* We save the message in a circular buffer, for generating FEC or - redundancy sets later on. */ - s->tx[entry].buf_len = msg_len; - memcpy(s->tx[entry].buf, msg, msg_len); - - /* Build the UDPTL packet */ - - len = 0; - /* Encode the sequence number */ - buf[len++] = (seq >> 8) & 0xFF; - buf[len++] = seq & 0xFF; - - /* Encode the primary packet */ - if (encode_open_type(buf, &len, msg, msg_len) < 0) - return -1; - - /* Encode the appropriate type of error recovery information */ - switch (s->error_correction_scheme) { - case UDPTL_ERROR_CORRECTION_NONE: - /* Encode the error recovery type */ - buf[len++] = 0x00; - /* The number of entries will always be zero, so it is pointless allowing - for the fragmented case here. */ - if (encode_length(buf, &len, 0) < 0) - return -1; - break; - case UDPTL_ERROR_CORRECTION_REDUNDANCY: - /* Encode the error recovery type */ - buf[len++] = 0x00; - if (s->tx_seq_no > s->error_correction_entries) - entries = s->error_correction_entries; - else - entries = s->tx_seq_no; - /* The number of entries will always be small, so it is pointless allowing - for the fragmented case here. */ - if (encode_length(buf, &len, entries) < 0) - return -1; - /* Encode the elements */ - for (i = 0; i < entries; i++) { - j = (entry - i - 1) & UDPTL_BUF_MASK; - if (encode_open_type(buf, &len, s->tx[j].buf, s->tx[j].buf_len) < 0) - return -1; - } - break; - case UDPTL_ERROR_CORRECTION_FEC: - span = s->error_correction_span; - entries = s->error_correction_entries; - if (seq < s->error_correction_span * s->error_correction_entries) { - /* In the initial stages, wind up the FEC smoothly */ - entries = seq / s->error_correction_span; - if (seq < s->error_correction_span) - span = 0; - } - /* Encode the error recovery type */ - buf[len++] = 0x80; - /* Span is defined as an inconstrained integer, which it dumb. It will only - ever be a small value. Treat it as such. */ - buf[len++] = 1; - buf[len++] = span; - /* The number of entries is defined as a length, but will only ever be a small - value. Treat it as such. */ - buf[len++] = entries; - for (m = 0; m < entries; m++) { - /* Make an XOR'ed entry the maximum length */ - limit = (entry + m) & UDPTL_BUF_MASK; - high_tide = 0; - for (i = (limit - span * entries) & UDPTL_BUF_MASK; i != limit; i = (i + entries) & UDPTL_BUF_MASK) { - if (high_tide < s->tx[i].buf_len) { - for (j = 0; j < high_tide; j++) - fec[j] ^= s->tx[i].buf[j]; - for (; j < s->tx[i].buf_len; j++) - fec[j] = s->tx[i].buf[j]; - high_tide = s->tx[i].buf_len; - } else { - for (j = 0; j < s->tx[i].buf_len; j++) - fec[j] ^= s->tx[i].buf[j]; - } - } - if (encode_open_type(buf, &len, fec, high_tide) < 0) - return -1; - } - break; - } - - if (s->verbose) - fprintf(stderr, "\n"); - s->tx_seq_no++; - return len; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_set_error_correction(udptl_state_t *s, int ec_scheme, int span, int entries) -{ - switch (ec_scheme) { - case UDPTL_ERROR_CORRECTION_FEC: - case UDPTL_ERROR_CORRECTION_REDUNDANCY: - case UDPTL_ERROR_CORRECTION_NONE: - s->error_correction_scheme = ec_scheme; - break; - case -1: - /* Just don't change the scheme */ - break; - default: - return -1; - } - if (span >= 0) - s->error_correction_span = span; - if (entries >= 0) - s->error_correction_entries = entries; - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_get_error_correction(udptl_state_t *s, int *ec_scheme, int *span, int *entries) -{ - if (ec_scheme) - *ec_scheme = s->error_correction_scheme; - if (span) - *span = s->error_correction_span; - if (entries) - *entries = s->error_correction_entries; - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_set_local_max_datagram(udptl_state_t *s, int max_datagram) -{ - s->local_max_datagram_size = max_datagram; - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_get_local_max_datagram(udptl_state_t *s) -{ - return s->local_max_datagram_size; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_set_far_max_datagram(udptl_state_t *s, int max_datagram) -{ - s->far_max_datagram_size = max_datagram; - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_get_far_max_datagram(udptl_state_t *s) -{ - return s->far_max_datagram_size; -} - -/*- End of function --------------------------------------------------------*/ - -udptl_state_t *udptl_init(udptl_state_t *s, int ec_scheme, int span, int entries, udptl_rx_packet_handler_t rx_packet_handler, void *user_data) -{ - int i; - - if (rx_packet_handler == NULL) - return NULL; - - if (s == NULL) { - if ((s = (udptl_state_t *) malloc(sizeof(*s))) == NULL) - return NULL; - } - memset(s, 0, sizeof(*s)); - - s->error_correction_scheme = ec_scheme; - s->error_correction_span = span; - s->error_correction_entries = entries; - - s->far_max_datagram_size = LOCAL_FAX_MAX_DATAGRAM; - s->local_max_datagram_size = LOCAL_FAX_MAX_DATAGRAM; - - memset(&s->rx, 0, sizeof(s->rx)); - memset(&s->tx, 0, sizeof(s->tx)); - for (i = 0; i <= UDPTL_BUF_MASK; i++) { - s->rx[i].buf_len = -1; - s->tx[i].buf_len = -1; - } - - s->rx_packet_handler = rx_packet_handler; - s->user_data = user_data; - - return s; -} - -/*- End of function --------------------------------------------------------*/ - -int udptl_release(udptl_state_t *s) -{ - return 0; -} - -/*- End of function --------------------------------------------------------*/ -/*- End of file ------------------------------------------------------------*/ diff --git a/src/mod/applications/mod_fax/udptl.h b/src/mod/applications/mod_fax/udptl.h deleted file mode 100644 index 39740353d1..0000000000 --- a/src/mod/applications/mod_fax/udptl.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2009, Steve Underwood - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Contributor(s): - * - * Steve Underwood - * - * udptl.h -- UDPTL handling for T.38 - * - */ - -#if !defined(FREESWITCH_UDPTL_H) -#define FREESWITCH_UDPTL_H - -#define LOCAL_FAX_MAX_DATAGRAM 400 -#define LOCAL_FAX_MAX_FEC_PACKETS 5 - -#define UDPTL_BUF_MASK 15 - -typedef int (udptl_rx_packet_handler_t) (void *user_data, const uint8_t msg[], int len, int seq_no); - -typedef struct { - int buf_len; - uint8_t buf[LOCAL_FAX_MAX_DATAGRAM]; -} udptl_fec_tx_buffer_t; - -typedef struct { - int buf_len; - uint8_t buf[LOCAL_FAX_MAX_DATAGRAM]; - int fec_len[LOCAL_FAX_MAX_FEC_PACKETS]; - uint8_t fec[LOCAL_FAX_MAX_FEC_PACKETS][LOCAL_FAX_MAX_DATAGRAM]; - int fec_span; - int fec_entries; -} udptl_fec_rx_buffer_t; - -struct udptl_state_s { - udptl_rx_packet_handler_t *rx_packet_handler; - void *user_data; - - /*! This option indicates the error correction scheme used in transmitted UDPTL - packets. */ - int error_correction_scheme; - - /*! This option indicates the number of error correction entries transmitted in - UDPTL packets. */ - int error_correction_entries; - - /*! This option indicates the span of the error correction entries in transmitted - UDPTL packets (FEC only). */ - int error_correction_span; - - /*! This option indicates the maximum size of a datagram that can be accepted by - the remote device. */ - int far_max_datagram_size; - - /*! This option indicates the maximum size of a datagram that we are prepared to - accept. */ - int local_max_datagram_size; - - int verbose; - - int tx_seq_no; - int rx_seq_no; - int rx_expected_seq_no; - - udptl_fec_tx_buffer_t tx[UDPTL_BUF_MASK + 1]; - udptl_fec_rx_buffer_t rx[UDPTL_BUF_MASK + 1]; -}; - -enum { - UDPTL_ERROR_CORRECTION_NONE, - UDPTL_ERROR_CORRECTION_FEC, - UDPTL_ERROR_CORRECTION_REDUNDANCY -}; - -typedef struct udptl_state_s udptl_state_t; - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! \brief Process an arriving UDPTL packet. - \param s The UDPTL context. - \param buf The UDPTL packet buffer. - \param len The length of the packet. - \return 0 for OK. */ - int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len); - -/*! \brief Construct a UDPTL packet, ready for transmission. - \param s The UDPTL context. - \param buf The UDPTL packet buffer. - \param msg The primary packet. - \param len The length of the primary packet. - \return The length of the constructed UDPTL packet. */ - int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int msg_len); - -/*! \brief Change the error correction settings of a UDPTL context. - \param s The UDPTL context. - \param ec_scheme One of the optional error correction schemes. - \param span The packet span over which error correction should be applied. - \param entries The number of error correction entries to include in packets. - \return 0 for OK. */ - int udptl_set_error_correction(udptl_state_t *s, int ec_scheme, int span, int entries); - -/*! \brief Check the error correction settings of a UDPTL context. - \param s The UDPTL context. - \param ec_scheme One of the optional error correction schemes. - \param span The packet span over which error correction is being applied. - \param entries The number of error correction being included in packets. - \return 0 for OK. */ - int udptl_get_error_correction(udptl_state_t *s, int *ec_scheme, int *span, int *entries); - - int udptl_set_local_max_datagram(udptl_state_t *s, int max_datagram); - - int udptl_get_local_max_datagram(udptl_state_t *s); - - int udptl_set_far_max_datagram(udptl_state_t *s, int max_datagram); - - int udptl_get_far_max_datagram(udptl_state_t *s); - -/*! \brief Initialise a UDPTL context. - \param s The UDPTL context. - \param ec_scheme One of the optional error correction schemes. - \param span The packet span over which error correction should be applied. - \param entries The number of error correction entries to include in packets. - \param rx_packet_handler The callback function, used to report arriving IFP packets. - \param user_data An opaque pointer supplied to rx_packet_handler. - \return A pointer to the UDPTL context, or NULL if there was a problem. */ - udptl_state_t *udptl_init(udptl_state_t *s, int ec_scheme, int span, int entries, udptl_rx_packet_handler_t rx_packet_handler, void *user_data); - -/*! \brief Release a UDPTL context. - \param s The UDPTL context. - \return 0 for OK. */ - int udptl_release(udptl_state_t *s); - -#if defined(__cplusplus) -} -#endif -#endif -/*- End of file ------------------------------------------------------------*/ diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index d126f86d32..15c6d124f9 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1121,7 +1121,7 @@ static switch_status_t messagehook (switch_core_session_t *session, switch_core_ "(fifo_name,caller_uuid,caller_caller_id_name,caller_caller_id_number,consumer_uuid,consumer_outgoing_uuid,bridge_start) " "values ('%q','%q','%q','%q','%q','%q',%ld)", MANUAL_QUEUE_NAME, - "N/A", + (msg->string_arg && strchr(msg->string_arg, '-')) ? msg->string_arg : "00000000-0000-0000-0000-000000000000", ced_name, ced_number, switch_core_session_get_uuid(session), @@ -2926,12 +2926,27 @@ SWITCH_STANDARD_APP(fifo_function) if (!(switch_channel_ready(channel))) { const char *app = switch_channel_get_variable(other_channel, "current_application"); const char *arg = switch_channel_get_variable(other_channel, "current_application_data"); - switch_caller_extension_t *extension = NULL; + switch_caller_extension_t *extension = NULL; + + + switch_channel_set_variable_printf(channel, "last_sent_callee_id_name", "%s (AGENT FAIL)", + switch_channel_get_variable(other_channel, "caller_id_name")); + switch_channel_set_variable(channel, "last_sent_callee_id_number", switch_channel_get_variable(other_channel, "caller_id_number")); + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, + "Customer %s %s [%s] appears to be abandoned by agent %s [%s] " + "but is still on the line, redirecting them back to the queue with VIP status.\n", + switch_channel_get_name(other_channel), + switch_channel_get_variable(other_channel, "caller_id_name"), + switch_channel_get_variable(other_channel, "caller_id_number"), + switch_channel_get_variable(channel, "caller_id_name"), + switch_channel_get_variable(channel, "caller_id_number")); + + switch_channel_wait_for_state_timeout(other_channel, CS_HIBERNATE, 5000); send_presence(node); check_cancel(node); - - + if (app) { extension = switch_caller_extension_new(other_session, app, arg); switch_caller_extension_add_application(other_session, extension, app, arg); @@ -2940,6 +2955,7 @@ SWITCH_STANDARD_APP(fifo_function) } else { switch_channel_hangup(other_channel, SWITCH_CAUSE_NORMAL_CLEARING); } + switch_channel_set_variable(other_channel, "fifo_vip", "true"); switch_core_session_rwunlock(other_session); break; @@ -3098,6 +3114,7 @@ SWITCH_STANDARD_APP(fifo_function) send_presence(node); check_cancel(node); + switch_core_session_rwunlock(other_session); @@ -3230,7 +3247,6 @@ SWITCH_STANDARD_APP(fifo_function) switch_channel_clear_app_flag_key(FIFO_APP_KEY, channel, FIFO_APP_BRIDGE_TAG); switch_core_media_bug_resume(session); - } struct xml_helper { diff --git a/src/mod/applications/mod_fsk/fsk_callerid.c b/src/mod/applications/mod_fsk/fsk_callerid.c index 2146f663c5..9c99650f3d 100644 --- a/src/mod/applications/mod_fsk/fsk_callerid.c +++ b/src/mod/applications/mod_fsk/fsk_callerid.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_fsk/fsk_callerid.h b/src/mod/applications/mod_fsk/fsk_callerid.h index 9018201ce5..59f6cc5e52 100644 --- a/src/mod/applications/mod_fsk/fsk_callerid.h +++ b/src/mod/applications/mod_fsk/fsk_callerid.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_fsk/mod_fsk.c b/src/mod/applications/mod_fsk/mod_fsk.c index 0291707c62..da996fdba4 100644 --- a/src/mod/applications/mod_fsk/mod_fsk.c +++ b/src/mod/applications/mod_fsk/mod_fsk.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_fsv/mod_fsv.c b/src/mod/applications/mod_fsv/mod_fsv.c index 6f37776f92..1c09365175 100644 --- a/src/mod/applications/mod_fsv/mod_fsv.c +++ b/src/mod/applications/mod_fsv/mod_fsv.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index c4a899a74b..5905116883 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -451,8 +451,6 @@ SWITCH_STANDARD_APP(hash_function) value = strdup(argv[3]); switch_assert(value); switch_core_hash_insert(globals.db_hash, hash_key, value); - } else { - switch_safe_free(value); } } else if (!strcasecmp(argv[0], "delete")) { @@ -466,9 +464,9 @@ SWITCH_STANDARD_APP(hash_function) } if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { if(!strcmp(argv[3], value)) { + switch_safe_free(value); switch_core_hash_delete(globals.db_hash, hash_key); } - switch_safe_free(value); } } else { goto usage; @@ -527,7 +525,6 @@ SWITCH_STANDARD_API(hash_api_function) switch_thread_rwlock_wrlock(globals.db_hash_rwlock); if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { stream->write_function(stream, "-ERR key already exists\n"); - switch_safe_free(value); } else { value = strdup(argv[3]); switch_assert(value); @@ -552,12 +549,12 @@ SWITCH_STANDARD_API(hash_api_function) switch_thread_rwlock_wrlock(globals.db_hash_rwlock); if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { if(!strcmp(argv[3],value)) { + switch_safe_free(value); switch_core_hash_delete(globals.db_hash, hash_key); stream->write_function(stream, "+OK\n"); } else { stream->write_function(stream, "-ERR Doesn't match\n"); } - switch_safe_free(value); } else { stream->write_function(stream, "-ERR Not found\n"); } diff --git a/src/mod/applications/mod_httapi/docs/mod_httapi_doc.txt b/src/mod/applications/mod_httapi/docs/mod_httapi_doc.txt index 8690a62fc8..99970d88c9 100644 --- a/src/mod/applications/mod_httapi/docs/mod_httapi_doc.txt +++ b/src/mod/applications/mod_httapi/docs/mod_httapi_doc.txt @@ -319,7 +319,7 @@ user-agent : mod_httapi/1.0 User Agent header value. : * = default - + *set-params : tag can be parsed for session params. set-vars : tag can be parsed to set channel vars. diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index fba7736363..9d5b8003a5 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1142,7 +1142,8 @@ static switch_status_t parse_xml(client_t *client) switch_channel_get_variables(client->channel, &templ_data); switch_event_merge(templ_data, client->params); expanded = switch_event_expand_headers_check(templ_data, tag->txt, - client->profile->var_params.expand_var_list, client->profile->var_params.api_list); + client->profile->var_params.expand_var_list, + client->profile->var_params.api_list, 0); switch_event_destroy(&templ_data); } @@ -1324,7 +1325,7 @@ static void cleanup_attachments(client_t *client) for (hp = client->params->headers; hp; hp = hp->next) { if (!strncasecmp(hp->name, "attach_file:", 12)) { - if (switch_file_exists(hp->value, client->pool)) { + if (switch_file_exists(hp->value, client->pool) == SWITCH_STATUS_SUCCESS) { printf("DELETE %s\n", hp->value); unlink(hp->value); } @@ -1498,7 +1499,7 @@ static switch_status_t httapi_sync(client_t *client) switch_curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers); - if (method != NULL && strcasecmp(method, "get") && strcasecmp(method, "post")) { + if (!zstr(method)) { switch_curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, method); } @@ -2160,6 +2161,7 @@ SWITCH_STANDARD_APP(httapi_function) if (!zstr(url) && switch_stristr("://", url)) { if (!params) { switch_event_create(¶ms, SWITCH_EVENT_CLONE); + params->flags |= EF_UNIQ_HEADERS; } switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "url", url); } diff --git a/src/mod/applications/mod_http_cache/conf/autoload_configs/http_cache.conf.xml b/src/mod/applications/mod_http_cache/conf/autoload_configs/http_cache.conf.xml index 4150d6472e..d4b5475ec9 100644 --- a/src/mod/applications/mod_http_cache/conf/autoload_configs/http_cache.conf.xml +++ b/src/mod/applications/mod_http_cache/conf/autoload_configs/http_cache.conf.xml @@ -3,6 +3,9 @@ + + + diff --git a/src/mod/applications/mod_http_cache/conf/cacert.pem b/src/mod/applications/mod_http_cache/conf/cacert.pem new file mode 100644 index 0000000000..72e14177c9 --- /dev/null +++ b/src/mod/applications/mod_http_cache/conf/cacert.pem @@ -0,0 +1,3366 @@ +## +## ca-bundle.crt -- Bundle of CA Root Certificates +## +## Certificate data from Mozilla as of: Sun Feb 19 04:03:37 2012 +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## + +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Netscape security libraries. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +# @(#) $RCSfile: certdata.txt,v $ $Revision: 1.82 $ $Date: 2012/02/18 21:41:46 $ + +GTE CyberTrust Global Root +========================== +-----BEGIN CERTIFICATE----- +MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg +Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG +A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz +MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL +Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 +IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u +sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql +HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID +AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW +M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF +NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ +-----END CERTIFICATE----- + +Thawte Server CA +================ +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE +AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j +b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV +BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u +c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG +A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 +ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl +/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 +1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J +GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ +GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- + +Thawte Premium Server CA +======================== +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE +AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl +ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT +AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU +VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 +aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ +cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 +aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh +Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ +qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm +SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf +8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t +UCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- + +Equifax Secure CA +================= +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE +ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT +B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR +fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW +8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG +A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE +CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG +A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS +spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB +Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 +zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB +BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 +70+sB3c4 +-----END CERTIFICATE----- + +Digital Signature Trust Co. Global CA 1 +======================================= +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE +ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy +MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs +IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE +NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i +o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo +BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 +dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw +IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY +MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM +BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB +ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq +kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4 +RbyhkwS7hp86W0N6w4pl +-----END CERTIFICATE----- + +Digital Signature Trust Co. Global CA 3 +======================================= +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE +ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy +MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs +IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD +VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS +xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo +BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 +dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw +IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY +MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM +BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB +AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi +up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1 +mPnHfxsb1gYgAlihw6ID +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA +TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah +WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf +Tqj/ZA1k +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G2 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO +FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 +lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB +MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT +1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD +Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 +-----END CERTIFICATE----- + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +GlobalSign Root CA - R2 +======================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 +ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp +s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN +S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL +TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C +ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E +FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i +YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN +BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp +9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu +01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 +9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +ValiCert Class 1 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy +MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi +GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm +DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG +lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX +icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP +Orf1LXLI +-----END CERTIFICATE----- + +ValiCert Class 2 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC +CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf +ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ +SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV +UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8 +W9ViH0Pd +-----END CERTIFICATE----- + +RSA Root Certificate 1 +====================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td +3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H +BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs +3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF +V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r +on+jjBXu +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 +EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc +cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw +EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj +055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f +j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 +xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa +t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +Verisign Class 4 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS +tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM +8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW +Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX +Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt +mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm +fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd +RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG +UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== +-----END CERTIFICATE----- + +Entrust.net Secure Server CA +============================ +-----BEGIN CERTIFICATE----- +MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV +BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg +cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl +ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG +A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi +eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p +dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ +aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5 +gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw +ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw +CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l +dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF +bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu +dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw +NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow +HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA +BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN +Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 +n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo3QwcjARBglghkgBhvhC +AQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGAvtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdER +gL7YibkIozH5oSQJFrlwMB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B +AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo +oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS +o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z +2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX +OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ== +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li +ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC +SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs +dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME +uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB +UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C +G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 +XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr +l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI +VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB +BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh +cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 +hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa +Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H +RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +Equifax Secure Global eBusiness CA +================================== +-----BEGIN CERTIFICATE----- +MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp +bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx +HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds +b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV +PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN +qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn +hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j +BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs +MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN +I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY +NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV +-----END CERTIFICATE----- + +Equifax Secure eBusiness CA 1 +============================= +-----BEGIN CERTIFICATE----- +MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB +LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE +ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz +IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ +1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a +IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk +MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW +Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF +AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5 +lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+ +KpYrtWKmpj29f5JZzVoqgrI3eQ== +-----END CERTIFICATE----- + +Equifax Secure eBusiness CA 2 +============================= +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEXMBUGA1UE +ChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0y +MB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT +DkVxdWlmYXggU2VjdXJlMSYwJAYDVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn +2Z0GvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/BPO3QSQ5 +BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0CAwEAAaOCAQkwggEFMHAG +A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUx +JjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoG +A1UdEAQTMBGBDzIwMTkwNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9e +uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB +Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1 +jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia +78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm +V+GRMOrN +-----END CERTIFICATE----- + +AddTrust Low-Value Services Root +================================ +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU +cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw +CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO +ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 +54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr +oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 +Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui +GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w +HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD +AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT +RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw +HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt +ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph +iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr +mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj +ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- + +AddTrust External Root +====================== +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD +VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw +NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU +cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg +Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 ++iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw +Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo +aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy +2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 +7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL +VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk +VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl +j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 +e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u +G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +AddTrust Public Services Root +============================= +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU +cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ +BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l +dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu +nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i +d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG +Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw +HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G +A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G +A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 +JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL ++YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao +GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 +Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H +EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= +-----END CERTIFICATE----- + +AddTrust Qualified Certificates Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU +cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx +CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ +IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx +64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 +KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o +L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR +wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU +MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE +BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y +azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG +GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X +dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze +RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB +iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw +b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG +A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 +MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu +MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu +Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v +dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz +A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww +Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 +j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN +rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 +MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH +hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM +Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa +v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS +W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 +tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +RSA Security 2048 v3 +==================== +-----BEGIN CERTIFICATE----- +MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK +ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy +MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb +BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 +Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb +WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH +KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP ++Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ +MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E +FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY +v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj +0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj +VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 +nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA +pKnXwiJPZ9d37CAFYd4= +-----END CERTIFICATE----- + +GeoTrust Global CA +================== +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw +MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo +BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet +8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc +T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU +vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk +DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q +zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 +d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 +mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p +XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm +Mw== +-----END CERTIFICATE----- + +GeoTrust Global CA 2 +==================== +-----BEGIN CERTIFICATE----- +MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw +MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ +NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k +LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA +Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b +HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH +K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 +srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh +ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL +OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC +x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF +H4z1Ir+rzoPz4iIprn2DQKi6bA== +-----END CERTIFICATE----- + +GeoTrust Universal CA +===================== +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 +MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu +Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t +JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e +RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs +7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d +8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V +qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga +Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB +Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu +KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 +ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 +XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB +hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 +qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL +oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK +xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF +KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 +DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK +xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU +p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI +P/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +GeoTrust Universal CA 2 +======================= +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 +MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg +SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 +DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 +j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q +JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a +QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 +WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP +20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn +ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC +SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG +8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 ++/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E +BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ +4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ +mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq +A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg +Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP +pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d +FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp +gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm +X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +America Online Root Certification Authority 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG +v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z +DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh +sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP +8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T +AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z +o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf +GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF +VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft +3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g +Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds +sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 +-----END CERTIFICATE----- + +America Online Root Certification Authority 2 +============================================= +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en +fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 +f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO +qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN +RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 +gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn +6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid +FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6 +Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj +B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op +aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY +T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p ++DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg +JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy +zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO +ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh +1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf +GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff +Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP +cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk= +-----END CERTIFICATE----- + +Visa eCommerce Root +=================== +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG +EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug +QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 +WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm +VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL +F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b +RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 +TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI +/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs +GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG +MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc +CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW +YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz +zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu +YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- + +Certum Root CA +============== +-----BEGIN CERTIFICATE----- +MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK +ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla +Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u +by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x +wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL +kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ +89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K +Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P +NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ +GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg +GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ +0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS +qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl +c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV +BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG +C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs +i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW +Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH +Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK +Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f +BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl +cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz +LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm +7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z +8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C +12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +Comodo Secure Services root +=========================== +-----BEGIN CERTIFICATE----- +MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw +MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu +Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi +BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP +9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc +rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC +oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V +p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E +FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w +gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj +YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm +aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm +4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj +Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL +DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw +pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H +RR3B7Hzs/Sk= +-----END CERTIFICATE----- + +Comodo Trusted Services root +============================ +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw +MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h +bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw +IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 +3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y +/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 +juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS +ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud +DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp +ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl +cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw +uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 +pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA +BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l +R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O +9y5Xt5hwXsjEeLBi +-----END CERTIFICATE----- + +QuoVadis Root CA +================ +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE +ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz +MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp +cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD +EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk +J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL +F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL +YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen +AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w +PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y +ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 +MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj +YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs +ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW +Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu +BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw +FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 +tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo +fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul +LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x +gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi +5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi +5nrQNiOKSnQ2+Q== +-----END CERTIFICATE----- + +QuoVadis Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx +ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 +XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk +lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB +lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy +lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt +66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn +wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh +D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy +BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie +J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud +DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU +a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv +Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 +UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm +VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK ++JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW +IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 +WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X +f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II +4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 +VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +QuoVadis Root CA 3 +================== +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx +OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg +DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij +KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K +DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv +BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp +p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 +nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX +MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM +Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz +uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT +BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj +YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB +BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD +VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 +ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE +AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV +qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s +hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z +POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 +Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp +8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC +bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu +g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw +8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM +DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX +5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd +DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 +JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g +0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a +mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ +s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ +6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi +FL39vmwLAw== +-----END CERTIFICATE----- + +Sonera Class 2 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw +NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 +/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT +dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG +f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P +tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH +nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT +XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt +0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI +cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph +Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx +EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH +llpwrN9M +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA +============================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE +ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w +HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh +bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt +vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P +jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca +C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth +vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 +22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV +HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v +dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN +BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR +EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw +MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y +nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR +iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== +-----END CERTIFICATE----- + +TDC Internet Root CA +==================== +-----BEGIN CERTIFICATE----- +MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE +ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx +NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu +ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j +xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL +znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc +5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6 +otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI +AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM +VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM +MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC +AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe +UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G +CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m +gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ +2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb +O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU +Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l +-----END CERTIFICATE----- + +TDC OCES Root CA +================ +-----BEGIN CERTIFICATE----- +MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJESzEMMAoGA1UE +ChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEwODM5MzBaFw0zNzAyMTEwOTA5 +MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNUREMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuH +nEz9pPPEXyG9VhDr2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0 +zY0s2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItUGBxIYXvV +iGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKjdGqPqcNiKXEx5TukYBde +dObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+rTpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO +3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB +5DCB4TCB3gYIKoFQgSkBAQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5k +ay9yZXBvc2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRlciBm +cmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4xLiBDZXJ0aWZp +Y2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4x +LjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1UdHwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEM +MAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYm +aHR0cDovL2NybC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy +MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZJ2cdUBVLc647 ++RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6 +NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACromJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4 +A9G28kNBKWKnctj7fAXmMXAnVBhOinxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYsc +A+UYyAFMP8uXBV2YcaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9 +AOoBmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQYqbsFbS1 +AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9BKNDLdr8C2LqL19iUw== +-----END CERTIFICATE----- + +UTN DATACorp SGC Root CA +======================== +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ +BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa +MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w +HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy +dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys +raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo +wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA +9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv +33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud +DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 +BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD +LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 +DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft +Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 +I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx +EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP +DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI +-----END CERTIFICATE----- + +UTN USERFirst Hardware Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd +BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx +OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 +eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz +ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI +wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd +tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 +i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf +Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw +gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF +lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF +UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF +BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM +//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW +XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 +lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn +iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 +nfhmqA== +-----END CERTIFICATE----- + +Camerfirma Chambers of Commerce Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx +NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp +cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn +MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC +AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU +xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH +NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW +DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV +d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud +EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v +cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P +AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh +bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD +VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz +aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi +fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD +L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN +UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n +ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 +erfutGWaIZDgqtCYvDi1czyL+Nw= +-----END CERTIFICATE----- + +Camerfirma Global Chambersign Root +================================== +-----BEGIN CERTIFICATE----- +MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx +NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt +YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg +MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw +ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J +1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O +by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl +6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c +8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ +BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j +aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B +Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj +aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y +ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh +bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA +PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y +gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ +PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 +IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes +t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== +-----END CERTIFICATE----- + +NetLock Notary (Class A) Root +============================= +-----BEGIN CERTIFICATE----- +MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI +EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j +ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX +DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH +EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD +VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz +cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM +D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ +z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC +/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 +tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 +4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG +A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC +Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv +bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu +IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn +LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 +ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz +IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh +IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu +b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh +bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg +Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp +bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 +ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP +ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB +CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr +KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM +8CgHrTwXZoi1/baI +-----END CERTIFICATE----- + +NetLock Business (Class B) Root +=============================== +-----BEGIN CERTIFICATE----- +MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg +VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD +VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv +bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg +VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB +iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S +o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr +1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV +HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ +RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh +dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0 +ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv +c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg +YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh +c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz +Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA +bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl +IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2 +YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj +cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM +43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR +stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI +-----END CERTIFICATE----- + +NetLock Express (Class C) Root +============================== +-----BEGIN CERTIFICATE----- +MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD +KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ +BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j +ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z +W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63 +euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw +DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN +RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn +YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB +IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i +aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0 +ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs +ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo +dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y +emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k +IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ +UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg +YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2 +xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW +gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A== +-----END CERTIFICATE----- + +XRamp Global CA Root +==================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE +BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj +dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx +HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg +U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu +IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx +foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE +zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs +AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry +xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap +oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC +AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc +/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n +nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz +8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +Go Daddy Class 2 CA +=================== +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY +VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG +A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g +RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD +ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv +2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 +qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j +YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY +vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O +BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o +atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu +MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim +PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt +I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo +MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG +A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG +SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY +bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ +JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm +epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN +F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF +MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f +hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo +bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs +afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM +PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD +KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj +YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH +AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw +Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg +U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 +LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh +cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT +dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC +AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh +3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm +vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk +fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 +fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ +EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl +1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ +lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro +g14= +-----END CERTIFICATE----- + +Taiwan GRCA +=========== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG +EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X +DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv +dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN +w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 +BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O +1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO +htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov +J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 +Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t +B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB +O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 +lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV +HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 +09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj +Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 +Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU +D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz +DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk +Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk +7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ +CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy ++fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS +-----END CERTIFICATE----- + +Firmaprofesional Root CA +======================== +-----BEGIN CERTIFICATE----- +MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT +GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp +Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA +ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL +MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT +OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2 +ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V +j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH +lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf +3H5idPayBQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcLiam8 +NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcbAgMBAAGjgZ8wgZww +KgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lvbmFsLmNvbTASBgNVHRMBAf8ECDAG +AQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQAD +ggEBAEdz/o0nVPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq +u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36mhoEyIwOdyPdf +wUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzflZKG+TQyTmAyX9odtsz/ny4Cm +7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBpQWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YG +VM+h4k0460tQtcsm9MracEpqoeJ5quGnM/b9Sh/22WA= +-----END CERTIFICATE----- + +Wells Fargo Root CA +=================== +-----BEGIN CERTIFICATE----- +MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCVVMxFDASBgNV +BAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MDAxMDExMTY0MTI4WhcNMjEwMTE0MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dl +bGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEv +MC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n135zHCLielTWi5MbqNQ1mX +x3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHESxP9cMIlrCL1dQu3U+SlK93OvRw6esP3 +E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4OJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5 +OEL8pahbSCOz6+MlsoCultQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4j +sNtlAHCEAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMBAAGj +YTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcBCzAyMDAGCCsGAQUF +BwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRwb2xpY3kwDQYJKoZIhvcNAQEFBQAD +ggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv +m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R +OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx +x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023 +tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s= +-----END CERTIFICATE----- + +Swisscom Root CA 1 +================== +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG +EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy +dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 +MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln +aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC +IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM +MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF +NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe +AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC +b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn +7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN +cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp +WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 +haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY +MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw +HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j +BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 +MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn +jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ +MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H +VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl +vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl +OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 +1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq +nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy +x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW +NY6E0F/6MBr1mmz0DlP5OlvRHA== +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw +MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ +MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu +Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t +Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS +OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 +MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ +NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe +h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY +JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ +V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp +myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK +mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K +-----END CERTIFICATE----- + +Certplus Class 2 Primary CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE +BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN +OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy +dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR +5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ +Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO +YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e +e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME +CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ +YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t +L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD +P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R +TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ +7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW +//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- + +DST Root CA X3 +============== +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK +ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X +DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 +cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT +rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 +UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy +xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d +utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ +MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug +dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE +GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw +RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS +fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +DST ACES CA X6 +============== +-----BEGIN CERTIFICATE----- +MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT +MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha +MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE +CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI +DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa +pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow +GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy +MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu +Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy +dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU +CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 +5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t +Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq +nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs +vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 +oKfN5XozNmr6mis= +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 1 +============================================== +-----BEGIN CERTIFICATE----- +MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP +MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 +acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx +MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg +U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB +TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC +aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX +yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i +Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ +8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 +W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME +BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 +sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE +q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy +B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY +nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 2 +============================================== +-----BEGIN CERTIFICATE----- +MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP +MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg +QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN +MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr +dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G +A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls +acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe +LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI +x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g +QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr +5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB +AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt +Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 +Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ +hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P +9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 +UrbnBEI= +-----END CERTIFICATE----- + +SwissSign Gold CA - G2 +====================== +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw +EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN +MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp +c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq +t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C +jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg +vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF +ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR +AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend +jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO +peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR +7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi +GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 +OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm +5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr +44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf +Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m +Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp +mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X +DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 +aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 +N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm ++/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH +6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu +MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h +qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 +FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs +ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc +celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X +CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB +tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P +4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F +kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L +3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx +/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa +DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP +e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu +WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ +DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub +DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx +CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ +cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN +b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 +nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge +RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt +tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI +hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K +Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN +NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa +Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG +1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +thawte Primary Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 +MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg +SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv +KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT +FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs +oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ +1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc +q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K +aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p +afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF +AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE +uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 +jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH +z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G5 +============================================================ +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln +biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh +dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz +j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD +Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ +Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r +fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv +Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG +SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ +X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE +KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC +Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE +ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +SecureTrust CA +============== +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy +dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe +BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX +OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t +DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH +GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b +01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH +ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj +aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu +SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf +mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ +nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +Secure Global CA +================ +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH +bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg +MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg +Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx +YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ +bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g +8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV +HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi +0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn +oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA +MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ +OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================== +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb +MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD +T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH ++7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww +xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV +4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA +1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI +rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx +jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT +aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT +crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc +/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB +AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv +bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA +A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q +4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ +GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD +ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +WellsSecure Public Root Certificate Authority +============================================= +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM +F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw +NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl +bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD +VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 +iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 +i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 +bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB +K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB +AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu +cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm +lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB +i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww +GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI +K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 +bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj +qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es +E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ +tylv2G0xffX8oRAHh84vWdw+WNs= +-----END CERTIFICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +IGC/A +===== +-----BEGIN CERTIFICATE----- +MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD +VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE +Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy +MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI +EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT +STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 +TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW +So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy +HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd +frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ +tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB +egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC +iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK +q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q +MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg +Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI +lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF +0mBWWg== +-----END CERTIFICATE----- + +Security Communication EV RootCA1 +================================= +-----BEGIN CERTIFICATE----- +MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE +BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl +Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO +/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX +WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z +ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 +bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK +9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG +SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm +iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG +Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW +mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW +T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GA CA +=============================== +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE +BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG +A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH +bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD +VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw +IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 +IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 +Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg +Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD +d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ +/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R +LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm +MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 ++vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY +okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA +========================= +-----BEGIN CERTIFICATE----- +MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE +BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL +EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 +MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz +dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT +GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG +d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N +oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc +QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ +PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb +MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG +IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD +VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 +LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A +dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn +AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA +4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg +AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA +egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 +Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO +PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv +c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h +cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw +IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT +WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV +MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER +MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp +Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal +HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT +nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE +aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a +86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK +yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB +S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= +-----END CERTIFICATE----- + +Certigna +======== +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw +EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 +MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI +Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q +XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH +GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p +ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg +DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf +Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ +tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ +BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J +SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA +hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ +ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu +PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +AC Ra\xC3\xADz Certic\xC3\xA1mara S.A. +====================================== +-----BEGIN CERTIFICATE----- +MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT +AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg +LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w +HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+ +U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh +IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN +yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU +2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3 +4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP +2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm +8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf +HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa +Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK +5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b +czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g +ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF +BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug +cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf +AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX +EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v +/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3 +MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4 +3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk +eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f +/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h +RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU +Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 2 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw +MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw +IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 +xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ +Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u +SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G +dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ +KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj +TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP +JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk +vQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 3 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw +MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W +yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo +6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ +uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk +2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE +O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 +yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 +IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal +092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc +5A== +-----END CERTIFICATE----- + +TC TrustCenter Universal CA I +============================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy +IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN +MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg +VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw +JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC +qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv +xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw +ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O +gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j +BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG +1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy +vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 +ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT +ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a +7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY +-----END CERTIFICATE----- + +Deutsche Telekom Root CA 2 +========================== +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT +RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG +A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 +MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G +A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS +b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 +bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI +KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY +AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK +Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV +jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV +HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr +E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy +zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 +rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G +dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +ComSign Secured CA +================== +-----BEGIN CERTIFICATE----- +MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE +AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w +NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD +QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs +49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH +7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB +kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 +9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw +AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t +U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA +j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC +AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a +BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp +FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP +51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz +OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv +qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX +12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O +WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ +ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao +lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ +vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi +Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi +MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 +1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq +KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV +xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP +NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r +GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE +xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx +gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy +sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD +BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 +============================================================================================================================= +-----BEGIN CERTIFICATE----- +MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH +DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q +aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry +b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV +BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg +S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 +MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl +IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF +n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl +IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft +dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl +cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO +Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 +xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR +6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL +hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd +BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 +N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT +y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh +LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M +dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= +-----END CERTIFICATE----- + +Buypass Class 2 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 +MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M +cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 +0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 +0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R +uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV +1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt +7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 +fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w +wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho +-----END CERTIFICATE----- + +Buypass Class 3 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 +MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx +ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 +n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia +AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c +1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 +pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA +EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 +htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj +el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 +-----END CERTIFICATE----- + +EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 +========================================================================== +-----BEGIN CERTIFICATE----- +MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg +QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe +Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p +ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt +IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by +X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b +gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr +eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ +TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy +Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn +uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI +qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm +ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 +Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW +Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t +FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm +zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k +XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT +bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU +RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK +1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt +2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ +Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 +AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT +-----END CERTIFICATE----- + +certSIGN ROOT CA +================ +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD +VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa +Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE +CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I +JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH +rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 +ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD +0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 +AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B +Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +CNNIC ROOT +========== +-----BEGIN CERTIFICATE----- +MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE +ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw +OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD +o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz +VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT +VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or +czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK +y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC +wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S +lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 +Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM +O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 +BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 +G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m +mxE= +-----END CERTIFICATE----- + +ApplicationCA - Japanese Government +=================================== +-----BEGIN CERTIFICATE----- +MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT +SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw +MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl +cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 +fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN +wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE +jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu +nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU +WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV +BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD +vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs +o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g +/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD +io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW +dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL +rosot4LKGAfmt1t06SAZf7IbiVQ= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G3 +============================================= +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 +IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz +NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo +YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT +LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j +K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE +c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C +IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu +dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr +2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 +cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE +Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s +t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +thawte Primary Root CA - G2 +=========================== +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC +VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu +IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg +Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV +MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG +b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt +IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS +LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 +8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU +mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN +G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K +rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +thawte Primary Root CA - G3 +=========================== +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w +ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD +VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG +A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At +P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC ++BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY +7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW +vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ +KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK +A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC +8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm +er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G2 +============================================= +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu +Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 +OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl +b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG +BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc +KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ +EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m +ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 +npaqBA+K +-----END CERTIFICATE----- + +VeriSign Universal Root Certification Authority +=============================================== +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj +1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP +MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 +9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I +AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR +tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G +CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O +a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 +Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx +Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx +P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P +wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 +mJO37M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G4 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC +VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 +b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz +ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU +cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo +b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 +Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz +rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw +HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u +Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD +A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx +AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) FÅ‘tanúsítvány +============================================ +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 +c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu +0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw +/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk +H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw +fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 +neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW +qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta +YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna +NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu +dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G2 +================================== +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ +5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn +vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj +CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil +e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR +OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI +CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 +48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi +trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 +qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB +AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC +ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA +A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz ++51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj +f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN +kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk +CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF +URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb +CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h +oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV +IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm +66+KAQ== +-----END CERTIFICATE----- + +CA Disig +======== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK +QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw +MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz +bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm +GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD +Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo +hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt +ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w +gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P +AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz +aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff +ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa +BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t +WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 +mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ +CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K +ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA +4Z7CRneC9VkGjCFMhwnN5ag= +-----END CERTIFICATE----- + +Juur-SK +======= +-----BEGIN CERTIFICATE----- +MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA +c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw +DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG +SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy +aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf +TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC ++Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw +UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa +Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF +MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD +HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh +AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA +cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr +AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw +cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE +FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G +A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo +ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL +abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 +IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh +Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 +yyqcjg== +-----END CERTIFICATE----- + +Hongkong Post Root CA 1 +======================= +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT +DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx +NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi +SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS +b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw +KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 +cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL +TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO +wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq +g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP +O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA +bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX +t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh +OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r +bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ +Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 +y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 +lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +ACEDICOM Root +============= +-----BEGIN CERTIFICATE----- +MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD +T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 +MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG +A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk +WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD +YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew +MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb +m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk +HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT +xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 +3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 +2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq +TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz +4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU +9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv +bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg +aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP +eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk +zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 +ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI +KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq +nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE +I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp +MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o +tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky +CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX +bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ +D/xwzoiQ +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER +MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv +c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE +BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt +U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA +fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG +0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA +pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm +1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC +AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf +QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE +FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o +lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX +I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 +yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi +=================================================== +-----BEGIN CERTIFICATE----- +MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG +EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz +ZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3 +MDEwNDExMzI0OFoXDTE3MDEwNDExMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0 +cm9uaWsgQmlsZ2kgR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9u +aWsgU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdUMZTe1RK6UxYC6lhj71vY +8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlTL/jDj/6z/P2douNffb7tC+Bg62nsM+3Y +jfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAI +JjjcJRFHLfO6IxClv7wC90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk +9Ok0oSy1c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoEVtstxNulMA0GCSqG +SIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLPqk/CaOv/gKlR6D1id4k9CnU58W5d +F4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwq +D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4 +Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq +fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +TC TrustCenter Universal CA III +=============================== +-----BEGIN CERTIFICATE----- +MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy +IFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAe +Fw0wOTA5MDkwODE1MjdaFw0yOTEyMzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNU +QyBUcnVzdENlbnRlciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0Ex +KDAmBgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF5+cvAqBNLaT6hdqbJYUt +QCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYvDIRlzg9uwliT6CwLOunBjvvya8o84pxO +juT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8vzArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+Eut +CHnNaYlAJ/Uqwa1D7KRTyGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1 +M4BDj5yjdipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBhMB8G +A1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI4jANBgkqhkiG9w0BAQUFAAOCAQEA +g8ev6n9NCjw5sWi+e22JLumzCecYV42FmhfzdkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+ +KGwWaODIl0YgoGhnYIg5IFHYaAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhK +BgePxLcHsU0GDeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV +CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPHLQNjO9Po5KIq +woIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD +Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P +B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY +7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH +ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI +plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX +MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX +LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK +bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU +vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud +EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH +DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA +bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx +ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx +51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk +R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP +T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f +Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl +osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR +crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK +ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU ++zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC +PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT +OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK +F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK +0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ +0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB +leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID +AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ +SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG +NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O +BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l +Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga +kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q +hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs +g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 +aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 +nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC +ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Chambers of Commerce Root - 2008 +================================ +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy +Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl +ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF +EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl +cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA +XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj +h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ +ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk +NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g +D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 +lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ +0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 +EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI +G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ +BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh +bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh +bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC +CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH +AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 +wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH +3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU +RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 +M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 +YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF +9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK +zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG +nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ +-----END CERTIFICATE----- + +Global Chambersign Root - 2008 +============================== +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx +NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg +Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ +QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf +VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf +XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 +ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB +/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA +TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M +H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe +Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF +HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB +AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT +BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE +BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm +aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm +aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp +1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 +dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG +/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 +ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s +dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg +9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH +foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du +qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr +P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq +c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 +eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw +DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg +VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB +dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv +W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs +bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk +N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf +ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU +JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol +TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx +4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw +F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw +MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb +DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV +C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 +BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww +MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV +HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG +hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi +qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv +0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh +sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI +dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 +/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb +h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV +HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu +UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 +12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 +WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 +/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +AffirmTrust Premium +=================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy +OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy +dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn +BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV +5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs ++7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd +GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R +p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI +S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 +6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 +/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo ++Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv +MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC +6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +Certinomis - Autorité Racine +============================= +-----BEGIN CERTIFICATE----- +MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK +Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg +LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG +A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw +JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa +wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly +Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw +2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N +jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q +c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC +lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb +xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g +530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna +4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ +KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x +WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva +R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 +nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B +CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv +JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE +qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b +WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE +wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ +vgt2Fl43N+bYdJeimUV5 +-----END CERTIFICATE----- + +Root CA Generalitat Valenciana +============================== +-----BEGIN CERTIFICATE----- +MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE +ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 +IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 +WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE +CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 +F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B +ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ +D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte +JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB +AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n +dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB +ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl +AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA +YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy +AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA +aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt +AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA +YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu +AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA +OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 +dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV +BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G +A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S +b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh +TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz +Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 +NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH +iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt ++GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= +-----END CERTIFICATE----- + +A-Trust-nQual-03 +================ +-----BEGIN CERTIFICATE----- +MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE +Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy +a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R +dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw +RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 +ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 +c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA +zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n +yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE +SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 +iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V +cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV +eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 +ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr +sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd +JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS +mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 +ahq97BvIxYSazQ== +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ +VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG +EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB +IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx +QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC +oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP +4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r +y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG +9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC +mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW +QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY +T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy +aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ ++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R +3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV +spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K +EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 +QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB +CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj +u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk +3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q +tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 +mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +EC-ACC +====== +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE +BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w +ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD +VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE +CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT +BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 +MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt +SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl +Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh +cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK +w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT +ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 +HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a +E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw +0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD +VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 +Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l +dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ +lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa +Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe +l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 +E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.c b/src/mod/applications/mod_http_cache/mod_http_cache.c index b93016a5e6..fb2b4e09a2 100644 --- a/src/mod/applications/mod_http_cache/mod_http_cache.c +++ b/src/mod/applications/mod_http_cache/mod_http_cache.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -23,7 +23,9 @@ * * Contributor(s): * - * Chris Rienzo + * Christopher M. Rienzo + * + * Maintainer: Christopher M. Rienzo * * mod_http_cache.c -- HTTP GET with caching * -- designed for downloading audio files from a webserver for playback @@ -96,12 +98,12 @@ struct http_get_data { }; typedef struct http_get_data http_get_data_t; -static switch_status_t http_get(cached_url_t *url, switch_core_session_t *session); +static switch_status_t http_get(url_cache_t *cache, cached_url_t *url, switch_core_session_t *session); static size_t get_file_callback(void *ptr, size_t size, size_t nmemb, void *get); static size_t get_header_callback(void *ptr, size_t size, size_t nmemb, void *url); static void process_cache_control_header(cached_url_t *url, char *data); -static switch_status_t http_put(switch_core_session_t *session, const char *url, const char *filename); +static switch_status_t http_put(url_cache_t *cache, switch_core_session_t *session, const char *url, const char *filename); /** * Queue used for clock cache replacement algorithm. This @@ -159,6 +161,12 @@ struct url_cache { int shutdown; /** Synchronizes shutdown of cache */ switch_thread_rwlock_t *shutdown_lock; + /** SSL cert filename */ + char *ssl_cacert; + /** Verify certificate */ + int ssl_verifypeer; + /** Verify that hostname matches certificate */ + int ssl_verifyhost; }; static url_cache_t gcache; @@ -173,12 +181,13 @@ static void url_cache_clear(url_cache_t *cache, switch_core_session_t *session); /** * Put a file to the URL + * @param cache the cache * @param session the (optional) session uploading the file * @param url The URL * @param filename The file to upload * @return SWITCH_STATUS_SUCCESS if successful */ -static switch_status_t http_put(switch_core_session_t *session, const char *url, const char *filename) +static switch_status_t http_put(url_cache_t *cache, switch_core_session_t *session, const char *url, const char *filename) { switch_status_t status = SWITCH_STATUS_SUCCESS; CURL *curl_handle = NULL; @@ -223,6 +232,18 @@ static switch_status_t http_put(switch_core_session_t *session, const char *url, switch_curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); switch_curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10); switch_curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-http-cache/1.0"); + if (!cache->ssl_verifypeer) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0L); + } else { + /* this is the file with all the trusted certificate authorities */ + if (!zstr(cache->ssl_cacert)) { + switch_curl_easy_setopt(curl_handle, CURLOPT_CAINFO, cache->ssl_cacert); + } + /* verify that the host name matches the cert */ + if (!cache->ssl_verifyhost) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L); + } + } switch_curl_easy_perform(curl_handle); switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &httpRes); switch_curl_easy_cleanup(curl_handle); @@ -346,7 +367,7 @@ static void process_cache_control_header(cached_url_t *url, char *data) return; } - url->max_age = switch_time_now() + (max_age * 1000 * 1000); + url->max_age = max_age * 1000 * 1000; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "setting max age to %u seconds from now\n", (int)max_age); } @@ -485,7 +506,7 @@ static char *url_cache_get(url_cache_t *cache, switch_core_session_t *session, c /* download the file */ url_cache_unlock(cache, session); - if (http_get(u, session) == SWITCH_STATUS_SUCCESS) { + if (http_get(cache, u, session) == SWITCH_STATUS_SUCCESS) { /* Got the file, let the waiters know it is available */ url_cache_lock(cache, session); u->status = CACHED_URL_AVAILABLE; @@ -708,11 +729,12 @@ static void cached_url_destroy(cached_url_t *url, switch_memory_pool_t *pool) /** * Fetch a file via HTTP + * @param cache the cache * @param url The cached URL entry * @param session the (optional) session * @return SWITCH_STATUS_SUCCESS if successful */ -static switch_status_t http_get(cached_url_t *url, switch_core_session_t *session) +static switch_status_t http_get(url_cache_t *cache, cached_url_t *url, switch_core_session_t *session) { switch_status_t status = SWITCH_STATUS_SUCCESS; switch_CURL *curl_handle = NULL; @@ -734,7 +756,19 @@ static switch_status_t http_get(cached_url_t *url, switch_core_session_t *sessio switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &get_data); switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, get_header_callback); switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, (void *) url); - switch_curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-http-cache/1.0"); + switch_curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-http-cache/1.0"); + if (!cache->ssl_verifypeer) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0L); + } else { + /* this is the file with all the trusted certificate authorities */ + if (!zstr(cache->ssl_cacert)) { + switch_curl_easy_setopt(curl_handle, CURLOPT_CAINFO, cache->ssl_cacert); + } + /* verify that the host name matches the cert */ + if (!cache->ssl_verifyhost) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L); + } + } switch_curl_easy_perform(curl_handle); switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &httpRes); switch_curl_easy_cleanup(curl_handle); @@ -791,7 +825,7 @@ static void setup_dir(url_cache_t *cache) static int isUrl(const char *filename) { - return !zstr(filename) && !strncmp("http://", filename, strlen("http://")); + return !zstr(filename) && (!strncmp("http://", filename, strlen("http://")) || !strncmp("https://", filename, strlen("https://"))); } #define HTTP_PREFETCH_SYNTAX "" @@ -910,7 +944,7 @@ SWITCH_STANDARD_API(http_cache_put) char *argv[10] = { 0 }; int argc = 0; - if (zstr(cmd) || strncmp("http://", cmd, strlen("http://"))) { + if (zstr(cmd) || (strncmp("http://", cmd, strlen("http://")) && strncmp("https://", cmd, strlen("https://")))) { stream->write_function(stream, "USAGE: %s\n", HTTP_PUT_SYNTAX); status = SWITCH_STATUS_SUCCESS; goto done; @@ -924,7 +958,7 @@ SWITCH_STANDARD_API(http_cache_put) goto done; } - status = http_put(session, argv[0], argv[1]); + status = http_put(&gcache, session, argv[0], argv[1]); if (status == SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "+OK\n"); } else { @@ -1013,6 +1047,9 @@ static switch_status_t do_config(url_cache_t *cache) cache->location = SWITCH_PREFIX_DIR "/http_cache"; cache->prefetch_queue_size = 100; cache->prefetch_thread_count = 8; + cache->ssl_cacert = SWITCH_PREFIX_DIR "/conf/cacert.pem"; + cache->ssl_verifyhost = 1; + cache->ssl_verifypeer = 1; /* get params */ settings = switch_xml_child(cfg, "settings"); @@ -1035,6 +1072,15 @@ static switch_status_t do_config(url_cache_t *cache) } else if (!strcasecmp(var, "prefetch-thread-count")) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting prefetch-thread-count to %s\n", val); cache->prefetch_thread_count = atoi(val); + } else if (!strcasecmp(var, "ssl-cacert")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting ssl-cacert to %s\n", val); + cache->ssl_cacert = switch_core_strdup(cache->pool, val); + } else if (!strcasecmp(var, "ssl-verifyhost")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting ssl-verifyhost to %s\n", val); + cache->ssl_verifyhost = !switch_false(val); /* only disable if explicitly set to false */ + } else if (!strcasecmp(var, "ssl-verifypeer")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting ssl-verifypeer to %s\n", val); + cache->ssl_verifypeer = !switch_false(val); /* only disable if explicitly set to false */ } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unsupported param: %s\n", var); } diff --git a/src/mod/applications/mod_ladspa/mod_ladspa.c b/src/mod/applications/mod_ladspa/mod_ladspa.c index efc75e03ee..e7362108a4 100644 --- a/src/mod/applications/mod_ladspa/mod_ladspa.c +++ b/src/mod/applications/mod_ladspa/mod_ladspa.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index d24aa2df1a..f3d3c0fe41 100644 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_limit/mod_limit.c b/src/mod/applications/mod_limit/mod_limit.c index 56da299941..8ffe00ab57 100644 --- a/src/mod/applications/mod_limit/mod_limit.c +++ b/src/mod/applications/mod_limit/mod_limit.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_memcache/mod_memcache.c b/src/mod/applications/mod_memcache/mod_memcache.c index 6016639d4f..ea4ed38a25 100755 --- a/src/mod/applications/mod_memcache/mod_memcache.c +++ b/src/mod/applications/mod_memcache/mod_memcache.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_mongo/Makefile b/src/mod/applications/mod_mongo/Makefile index 26687b5ac6..cdab0466be 100644 --- a/src/mod/applications/mod_mongo/Makefile +++ b/src/mod/applications/mod_mongo/Makefile @@ -24,6 +24,9 @@ $(MONGO_CXX_DRIVER_SRC): $(LIBMONGOCLIENT_A): $(MONGO_CXX_DRIVER_SRC) - cd $(MONGO_CXX_DRIVER_SRC) && scons + (cd $(MONGO_CXX_DRIVER_SRC) && \ + sed -i SConstruct -e "s/Environment()/Environment(ENV = {'PATH' : os.environ['PATH'],'CFLAGS' : os.environ['CFLAGS'],'CXXFLAGS' : os.environ['CXXFLAGS']})/" && \ + echo "env.Append(PATH=os.environ['PATH'])" >> SConstruct && \ + scons) $(TOUCH_TARGET) diff --git a/src/mod/applications/mod_mongo/mod_mongo.cpp b/src/mod/applications/mod_mongo/mod_mongo.cpp index 85bbd0ee4a..27723af13d 100644 --- a/src/mod/applications/mod_mongo/mod_mongo.cpp +++ b/src/mod/applications/mod_mongo/mod_mongo.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_mongo/mod_mongo.h b/src/mod/applications/mod_mongo/mod_mongo.h index a1c8322bd7..b336443225 100644 --- a/src/mod/applications/mod_mongo/mod_mongo.h +++ b/src/mod/applications/mod_mongo/mod_mongo.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_mongo/mongo_conn.cpp b/src/mod/applications/mod_mongo/mongo_conn.cpp index 075b8f85d6..673e1be768 100644 --- a/src/mod/applications/mod_mongo/mongo_conn.cpp +++ b/src/mod/applications/mod_mongo/mongo_conn.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_mp4/mod_mp4.cpp b/src/mod/applications/mod_mp4/mod_mp4.cpp index 0d9eac113f..56cbf53877 100644 --- a/src/mod/applications/mod_mp4/mod_mp4.cpp +++ b/src/mod/applications/mod_mp4/mod_mp4.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_nibblebill/mod_nibblebill.c b/src/mod/applications/mod_nibblebill/mod_nibblebill.c index eca9f621c9..c1a788454a 100755 --- a/src/mod/applications/mod_nibblebill/mod_nibblebill.c +++ b/src/mod/applications/mod_nibblebill/mod_nibblebill.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -287,7 +287,7 @@ static void transfer_call(switch_core_session_t *session, char *destination) switch_separate_string(mydup, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); /* Find the uuid of our B leg. If it exists, transfer it first */ - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *b_session; /* Get info on the B leg */ diff --git a/src/mod/applications/mod_osp/docs/mod_osp.txt b/src/mod/applications/mod_osp/docs/mod_osp.txt new file mode 100644 index 0000000000..a5686a4a03 --- /dev/null +++ b/src/mod/applications/mod_osp/docs/mod_osp.txt @@ -0,0 +1,84 @@ +FreeSWITCH Open Settlement Protocol (OSP) module + +This module provides OSP based call authentication, authorization, routing lookup and call detail record (CDR) collection services using standard FreeSWITCH application and dailplan interfaces. + +The OSP module can be configured by the following parameters in osp.conf.xml: + +Global parameters: + + + + + +Global parameter names and values can be: + +debug-info: Flag to show OSP module debug information. The default is "disabled". +log-level: At which log level to show OSP module debug information. The default is "info". +crypto-hardware: If to use hardware for OpenSSL. The default is "disabled". +sip: Used SIP module and profile. The default is "sofia" and "external". +h323: Used H.323 module and profile. The default is "h323" and "external". This option has not been implemented. +iax: Used IAX2 module and profile. The default is "iax" and "external". This option has not been implemented. +skype: Used Skype module and profile. The default is "skypopen" and "external". This option has not been implemented. +default-protocol: The VoIP protocol for destinations with unknown/undefined protocol. The default is "sip". + +OSP provider parameters: + + + + + + + +OSP provider parameter names ane values cab be: + +profile: OSP provider profile name. +service-point-url: OSP service point URL. This parameter must be defined. Up to 8 URLs are allowed. +device-ip: FreeSWITCH IP for OSP module. This parameter must be defined. +ssl-lifetime: SSL lifetime. The default is 300 in seconds. +http-max-connections: HTTP max connections. The default is 20. +http-persistence: HTTP persistence. The default is 60 in seconds. +http-retry-delay: HTTP retry delay. The default is 0 in seconds. +http-retry-limit: HTTP retry times. The default is 2. +http-timeout: HTTP timeout. The default is 10000 in ms. +work-mode: OSP module work mode (direct and indirect). The default is "direct". +service-type: OSP service type (voice and npquery). The default is "voice". +max-destinations: Max destinations OSP server will return. It is up to 12. The default is 12. + +The OSP application is called in dial plan like this: + + + +The OSP dialplan is called in dial plan like this: + + + +For both OSP application and dialplan, the is an OSP service provider name configured in osp.conf.xml. If it is empty, profile "default" is used. + +Both OSP application and dialplan accept a set of inbound channel variables that are used to pass additional call information to OSP module. These channel variables include: + +osp_source_device: Actual source device IP address channel variable. It is only for FreeSWITH OSP module running in indirect mode. +osp_source_nid: Source device network ID channel variable. +osp_custom_info_N: Up to 8 custom info channel variables. N is the index starting from 1. +osp_networkid_userparam: The URI user parameter name that is used to present destination network ID. +osp_networkid_uriparam: The URI parameter name that is used to present destination network ID. +osp_user_phone: Flag to add "user=phone" URI parameter. The default is "disabled". +osp_outbound_proxy: Outbound proxy IP address channel variable. + +Both OSP application and dialplan also export a set of channel variables for outbound channels and FreeSWITCH dial plan logic (for OSP dialplan, some exported channel variables are not visible for dial plan). These channel variables include: + +osp_profile: Used OSP profile name. Used by outbound channels. +osp_transaction_id: OSP transaction ID. Used by outbound channels. +osp_calling: Original inbound calling number. Used by outbound channels. +osp_called: Original inbound called number. Used by outbound channels. +osp_start_time: Inbound call start time. Used by outbound channels. +osp_source_device: Actual source device. Used by outbound channels. It is only for FreeSWITH OSP module running in indirect mode. +osp_source_nid: Source network ID. Used by outbound channels. +osp_destination_total: Total number of destinations from OSP servers. Used by outbound channels. +osp_destination_count: Destination index. Used by outbound channels. +osp_destination_ip: Destination IP. Used by outbound channels. +osp_destination_nid: Destination network ID. Used by outbound channels. +osp_authreq_status: Authorization request result status. +osp_route_count: Number of supported destinations. +osp_route_N: Destination route string. N is the index starting from 1. +osp_auto_route: Bridge route string. + diff --git a/src/mod/applications/mod_osp/mod_osp.c b/src/mod/applications/mod_osp/mod_osp.c index 1775421560..6f312386f4 100644 --- a/src/mod/applications/mod_osp/mod_osp.c +++ b/src/mod/applications/mod_osp/mod_osp.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_rad_auth/mod_rad_auth.c b/src/mod/applications/mod_rad_auth/mod_rad_auth.c index 1dc6d6bbdc..4f66608814 100644 --- a/src/mod/applications/mod_rad_auth/mod_rad_auth.c +++ b/src/mod/applications/mod_rad_auth/mod_rad_auth.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* Copyright (C) 2005-2011, Anthony Minessale II +* Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_random/mod_random.c b/src/mod/applications/mod_random/mod_random.c new file mode 100644 index 0000000000..08f1a8723e --- /dev/null +++ b/src/mod/applications/mod_random/mod_random.c @@ -0,0 +1,234 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2012, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Anthony Minessale II + * Neal Horman + * + * + * mod_random.c -- entropy source module + * + */ +#include + +/* Prototypes */ +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_random_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_random_runtime); +SWITCH_MODULE_LOAD_FUNCTION(mod_random_load); + +SWITCH_MODULE_DEFINITION(mod_random, mod_random_load, mod_random_shutdown, mod_random_runtime); + +static int RUNNING = 0; +static const char *random_device_files[] = { "/dev/hwrandom", "/dev/random", NULL }; +const char *random_device_file = NULL; + +static void event_handler(switch_event_t *event); + + +SWITCH_MODULE_LOAD_FUNCTION(mod_random_load) +{ + +#ifdef WIN32 + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s missing window support\n", modname); + return SWITCH_STATUS_NOTIMPL; +#endif + + int i = 0; + + + for(i = 0 ;random_device_files[i]; i++) { + if (switch_file_exists(random_device_files[i], pool) == SWITCH_STATUS_SUCCESS) { + random_device_file = random_device_files[i]; + break; + } + } + + + if (!random_device_file) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s can't locate a random device file\n", modname); + return SWITCH_STATUS_FALSE; + } + + + if ((switch_event_bind(modname, SWITCH_EVENT_ALL, NULL, event_handler, NULL) != SWITCH_STATUS_SUCCESS)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n"); + return SWITCH_STATUS_TERM; + } + + /* connect my internal structure to the blank pointer passed to me */ + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + RUNNING = 1; + + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_random_shutdown) +{ + + switch_event_unbind_callback(event_handler); + + RUNNING = 0; + + return SWITCH_STATUS_SUCCESS; +} + +#if WIN32 +SWITCH_MODULE_RUNTIME_FUNCTION(mod_random_runtime) +{ + RUNNING = 0; + return SWITCH_STATUS_TERM; +} +#else + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +typedef struct { + int count; + int size; + unsigned char *data; +} entropy_t; + + +static int random_add_entropy(int fd, void *buf, size_t size) +{ + entropy_t e = { 0 }; + int r = 0; + + e.count = size * 8; + e.size = size; + e.data = (unsigned char *) buf; + + if (ioctl(fd, RNDADDENTROPY, &e) != 0) { + r = 1; + } + + return r; +} + +static int rng_read(int fd, void *buf, size_t size) +{ + size_t off = 0; + ssize_t r; + unsigned char *bp = (unsigned char *) buf; + + while (size > 0) { + do { + r = read(fd, bp + off, size); + } while ((r == -1) && (errno == EINTR)); + + if (r <= 0) { + break; + } + + off += r; + size -= r; + } + + return size; +} + +static int rfd = 0; + +static void event_handler(switch_event_t *event) +{ + char *buf; + + if (switch_event_serialize(event, &buf, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) { + random_add_entropy(rfd, buf, strlen(buf)); + free(buf); + } + +} + +SWITCH_MODULE_RUNTIME_FUNCTION(mod_random_runtime) +{ + + unsigned char data[1024] = {0}; + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s Thread starting using random_device_file %s\n", modname, random_device_file); + + if ((rfd = open(random_device_file, O_RDWR)) < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Error opening random_device_file %s\n", modname, random_device_file); + RUNNING = 0; + } + + rng_read(rfd, data, 4); + + while(RUNNING) { + int16_t data[64]; + int i = 0; + int len = sizeof(data) / 2; + + switch_generate_sln_silence(data, len, 1); + random_add_entropy(rfd, data, len); + + while(i < len && !data[i]) i++; + + if (i < len) { + switch_yield(abs(data[i]) * 1000); + } + + } + + if (rfd > -1) { + close(rfd); + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s Thread ending\n", modname); + + return SWITCH_STATUS_TERM; +} + +#endif + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 + */ diff --git a/src/mod/applications/mod_redis/mod_redis.c b/src/mod/applications/mod_redis/mod_redis.c index 36376dd069..979977baa8 100755 --- a/src/mod/applications/mod_redis/mod_redis.c +++ b/src/mod/applications/mod_redis/mod_redis.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_rss/mod_rss.c b/src/mod/applications/mod_rss/mod_rss.c index 073b471bb4..8f45e0bd1c 100644 --- a/src/mod/applications/mod_rss/mod_rss.c +++ b/src/mod/applications/mod_rss/mod_rss.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_skel/mod_skel.c b/src/mod/applications/mod_skel/mod_skel.c index c5445f3166..f412cd6e7c 100644 --- a/src/mod/applications/mod_skel/mod_skel.c +++ b/src/mod/applications/mod_skel/mod_skel.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_sms/mod_sms.c b/src/mod/applications/mod_sms/mod_sms.c index e3e3f49578..f70282f8c6 100644 --- a/src/mod/applications/mod_sms/mod_sms.c +++ b/src/mod/applications/mod_sms/mod_sms.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_snapshot/mod_snapshot.c b/src/mod/applications/mod_snapshot/mod_snapshot.c index 854292c777..08c83dea00 100644 --- a/src/mod/applications/mod_snapshot/mod_snapshot.c +++ b/src/mod/applications/mod_snapshot/mod_snapshot.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_snipe_hunt/mod_snipe_hunt.c b/src/mod/applications/mod_snipe_hunt/mod_snipe_hunt.c index 334a0c5e20..6f899b9fab 100644 --- a/src/mod/applications/mod_snipe_hunt/mod_snipe_hunt.c +++ b/src/mod/applications/mod_snipe_hunt/mod_snipe_hunt.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_snom/mod_snom.c b/src/mod/applications/mod_snom/mod_snom.c index 3c50ea1699..1ec423df05 100644 --- a/src/mod/applications/mod_snom/mod_snom.c +++ b/src/mod/applications/mod_snom/mod_snom.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp b/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp index 37f88baf99..e991728d1a 100644 --- a/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp +++ b/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index 65324ff449..70d0754393 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.h b/src/mod/applications/mod_spandsp/mod_spandsp.h index 3ba14bcd14..d4f388dd36 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.h +++ b/src/mod/applications/mod_spandsp/mod_spandsp.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_codecs.c b/src/mod/applications/mod_spandsp/mod_spandsp_codecs.c index c75db05449..e9ce7665df 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_codecs.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_codecs.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c index 0b4ac48f29..144d02ef8d 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -43,12 +43,17 @@ typedef struct { uint32_t last_digit_end; uint32_t digit_begin; uint32_t min_dup_digit_spacing; + int twist; + int reverse_twist; + int filter_dialtone; + int threshold; } switch_inband_dtmf_t; -static void spandsp_dtmf_rx_realtime_callback(void *user_data, int code, int level, int delay) +static void spandsp_dtmf_rx_realtime_callback(void *user_data, int code, int level, int duration) { switch_inband_dtmf_t *pvt = (switch_inband_dtmf_t *)user_data; char digit = (char)code; + pvt->samples += duration; if (digit) { /* prevent duplicate DTMF */ if (digit != pvt->last_digit || (pvt->samples - pvt->last_digit_end) > pvt->min_dup_digit_spacing) { @@ -74,16 +79,12 @@ static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_da { switch_inband_dtmf_t *pvt = (switch_inband_dtmf_t *) user_data; switch_frame_t *frame = NULL; - switch_channel_t *channel = switch_core_session_get_channel(pvt->session); switch (type) { case SWITCH_ABC_TYPE_INIT: { - const char *min_dup_digit_spacing_str = switch_channel_get_variable(channel, "min_dup_digit_spacing_ms"); pvt->dtmf_detect = dtmf_rx_init(NULL, NULL, NULL); + dtmf_rx_parms(pvt->dtmf_detect, pvt->filter_dialtone, pvt->twist, pvt->reverse_twist, pvt->threshold); dtmf_rx_set_realtime_callback(pvt->dtmf_detect, spandsp_dtmf_rx_realtime_callback, pvt); - if (!zstr(min_dup_digit_spacing_str)) { - pvt->min_dup_digit_spacing = atoi(min_dup_digit_spacing_str) * 8; - } break; } case SWITCH_ABC_TYPE_CLOSE: @@ -93,7 +94,6 @@ static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_da break; case SWITCH_ABC_TYPE_READ_REPLACE: if ((frame = switch_core_media_bug_get_read_replace_frame(bug))) { - pvt->samples += frame->samples; dtmf_rx(pvt->dtmf_detect, frame->data, frame->samples); switch_core_media_bug_set_read_replace_frame(bug, frame); } @@ -126,6 +126,7 @@ switch_status_t spandsp_inband_dtmf_session(switch_core_session_t *session) switch_status_t status; switch_inband_dtmf_t *pvt; switch_codec_implementation_t read_impl = { 0 }; + const char *value; switch_core_session_get_read_impl(session, &read_impl); @@ -133,8 +134,60 @@ switch_status_t spandsp_inband_dtmf_session(switch_core_session_t *session) return SWITCH_STATUS_MEMERR; } - pvt->session = session; + pvt->session = session; + /* get detector params */ + pvt->min_dup_digit_spacing = 0; + value = switch_channel_get_variable(channel, "min_dup_digit_spacing_ms"); + if (!zstr(value) && switch_is_number(value)) { + int val = atoi(value) * 8; /* convert from ms to samples */ + if (val < 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "min_dup_digit_spacing_ms must be >= 0\n"); + } else { + pvt->min_dup_digit_spacing = val; + } + } + + pvt->threshold = -100; + value = switch_channel_get_variable(channel, "spandsp_dtmf_rx_threshold"); + if (!zstr(value) && switch_is_number(value)) { + int val = atoi(value); + if (val < -99) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "spandsp_dtmf_rx_threshold must be >= -99 dBm0\n"); + } else { + pvt->threshold = val; + } + } + + pvt->twist = -1; + value = switch_channel_get_variable(channel, "spandsp_dtmf_rx_twist"); + if (!zstr(value) && switch_is_number(value)) { + int val = atoi(value); + if (val < 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "spandsp_dtmf_rx_twist must be >= 0 dB\n"); + } else { + pvt->twist = val; + } + } + + pvt->reverse_twist = -1; + value = switch_channel_get_variable(channel, "spandsp_dtmf_rx_reverse_twist"); + if (!zstr(value) && switch_is_number(value)) { + int val = atoi(value); + if (val < 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "spandsp_dtmf_rx_reverse_twist must be >= 0 dB\n"); + } else { + pvt->reverse_twist = val; + } + } + + pvt->filter_dialtone = -1; + value = switch_channel_get_variable(channel, "spandsp_dtmf_rx_filter_dialtone"); + if (switch_true(value)) { + pvt->filter_dialtone = 1; + } else if (switch_false(value)) { + pvt->filter_dialtone = 0; + } if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_FALSE; diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index fab30f2bb8..975aca1fc8 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c index 9b8fa1e090..f1a1fdb7b0 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -230,13 +230,14 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl #if USE_OPENPTY if (openpty(&modem->master, &modem->slave, NULL, NULL, NULL)) { - if (modem->master < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fatal error: failed to initialize pty\n"); - status = SWITCH_STATUS_FALSE; - goto end; - } + if (modem->master < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fatal error: failed to initialize pty\n"); + status = SWITCH_STATUS_FALSE; + goto end; + } - modem->stty = ttyname(modem->slave); + modem->stty = ttyname(modem->slave); + } #else #if WIN32 modem->slot = 4+globals.NEXT_ID++; /* need work here we start at COM4 for now*/ diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_modem.h b/src/mod/applications/mod_spandsp/mod_spandsp_modem.h index ae9d64e71b..f04797e017 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_modem.h +++ b/src/mod/applications/mod_spandsp/mod_spandsp_modem.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_spy/mod_spy.c b/src/mod/applications/mod_spy/mod_spy.c index 1797539cf0..12c42ba15c 100644 --- a/src/mod/applications/mod_spy/mod_spy.c +++ b/src/mod/applications/mod_spy/mod_spy.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_stress/mod_stress.cpp b/src/mod/applications/mod_stress/mod_stress.cpp index d96739da0a..4fae808c40 100644 --- a/src/mod/applications/mod_stress/mod_stress.cpp +++ b/src/mod/applications/mod_stress/mod_stress.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index 9a237ac44a..773fdbabeb 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -618,7 +618,7 @@ SWITCH_STANDARD_APP(valet_parking_function) char tmp[512] = ""; switch_snprintf(tmp, sizeof(tmp), "%s:%s", lot_name, ext); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *b_session; if ((b_session = switch_core_session_locate(uuid))) { diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 55a25c1f2d..0bbea275d5 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -629,6 +629,7 @@ vm_profile_t *profile_set_config(vm_profile_t *profile) SWITCH_CONFIG_SET_ITEM(profile->config[i++], "email_date-fmt", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &profile->date_fmt, "%A, %B %d %Y, %I:%M %p", &profile->config_str_pool, NULL, NULL); SWITCH_CONFIG_SET_ITEM(profile->config[i++], "odbc-dsn", SWITCH_CONFIG_STRING, 0, &profile->odbc_dsn, NULL, &profile->config_str_pool, NULL, NULL); + SWITCH_CONFIG_SET_ITEM(profile->config[i++], "dbname", SWITCH_CONFIG_STRING, 0, &profile->dbname, NULL, &profile->config_str_pool, NULL, NULL); SWITCH_CONFIG_SET_ITEM_CALLBACK(profile->config[i++], "email_template-file", SWITCH_CONFIG_CUSTOM, CONFIG_RELOADABLE, NULL, NULL, profile, vm_config_email_callback, NULL, NULL); SWITCH_CONFIG_SET_ITEM_CALLBACK(profile->config[i++], "email_notify-template-file", SWITCH_CONFIG_CUSTOM, CONFIG_RELOADABLE, @@ -722,7 +723,9 @@ static vm_profile_t *load_profile(const char *profile_name) } } - profile->dbname = switch_core_sprintf(profile->pool, "voicemail_%s", profile_name); + if (zstr(profile->dbname)) { + profile->dbname = switch_core_sprintf(profile->pool, "voicemail_%s", profile_name); + } if (!(dbh = vm_get_db_handle(profile))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot open DB!\n"); @@ -1544,7 +1547,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t char cid_buf[1024] = ""; if (switch_channel_ready(channel)) { - switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cbt->cid_number, cbt->cid_name); + switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cbt->cid_name, cbt->cid_number); msg.from = __FILE__; msg.string_arg = cid_buf; @@ -2194,8 +2197,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p if (fail) { /* add feedback for user - let him/her know that the password they tried to change to is not allowed */ - /* change the following macro to VM_CHANGE_PASS_FAIL_MACRO when new prompts have been recorded */ - switch_ivr_phrase_macro(session, VM_FAIL_AUTH_MACRO, NULL, NULL, NULL); + switch_ivr_phrase_macro(session, VM_CHANGE_PASS_FAIL_MACRO, NULL, NULL, NULL); } else { sql = switch_mprintf("update voicemail_prefs set password='%s' where username='%s' and domain='%s'", buf, myid, domain_name); vm_execute_sql(profile, sql, profile->mutex); @@ -2583,8 +2585,6 @@ static switch_status_t deliver_vm(vm_profile_t *profile, switch_status_t ret = SWITCH_STATUS_SUCCESS; char *convert_cmd = profile->convert_cmd; char *convert_ext = profile->convert_ext; - int del_file = 0; - if (!params) { switch_event_create(&local_event, SWITCH_EVENT_REQUEST_PARAMS); @@ -2901,10 +2901,6 @@ static switch_status_t deliver_vm(vm_profile_t *profile, switch_safe_free(headers); } } - - if (!insert_db) { - del_file = 1; - } } if (session) { @@ -2926,7 +2922,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile, failed: - if (del_file && file_path && switch_file_exists(file_path, pool)) { + if (!insert_db && file_path && switch_file_exists(file_path, pool) == SWITCH_STATUS_SUCCESS) { if (unlink(file_path) != 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", file_path); } @@ -4899,6 +4895,8 @@ SWITCH_STANDARD_API(vm_fsdb_pref_greeting_set_function) profile->name, SWITCH_PATH_SEPARATOR, domain, SWITCH_PATH_SEPARATOR, id); char *final_file_path = switch_core_sprintf(pool, "%s%sgreeting_%d.%s", dir_path, SWITCH_PATH_SEPARATOR, slot, profile->file_ext); + switch_dir_make_recursive(dir_path, SWITCH_DEFAULT_DIR_PERMS, pool); + if (file_path) { if (switch_file_exists(file_path, pool) != SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "-ERR Filename doesn't exist\n"); @@ -4993,6 +4991,8 @@ SWITCH_STANDARD_API(vm_fsdb_pref_recname_set_function) profile->name, SWITCH_PATH_SEPARATOR, domain, SWITCH_PATH_SEPARATOR, id); char *final_file_path = switch_core_sprintf(pool, "%s%srecorded_name.%s", dir_path, SWITCH_PATH_SEPARATOR, profile->file_ext); + switch_dir_make_recursive(dir_path, SWITCH_DEFAULT_DIR_PERMS, pool); + if (switch_file_exists(file_path, pool) != SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "-ERR Filename doesn't exist\n"); profile_rwunlock(profile); @@ -5000,6 +5000,7 @@ SWITCH_STANDARD_API(vm_fsdb_pref_recname_set_function) } switch_file_rename(file_path, final_file_path, pool); + if (atoi(res) == 0) { sql = switch_mprintf("INSERT INTO voicemail_prefs (username, domain, name_path) VALUES('%q', '%q', '%q')", id, domain, final_file_path); } else { diff --git a/src/mod/applications/mod_voicemail_ivr/config.c b/src/mod/applications/mod_voicemail_ivr/config.c index a664d85462..1066a5c6ce 100644 --- a/src/mod/applications/mod_voicemail_ivr/config.c +++ b/src/mod/applications/mod_voicemail_ivr/config.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/config.h b/src/mod/applications/mod_voicemail_ivr/config.h index f94fdb6f54..9d3b63d584 100644 --- a/src/mod/applications/mod_voicemail_ivr/config.h +++ b/src/mod/applications/mod_voicemail_ivr/config.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/ivr.c b/src/mod/applications/mod_voicemail_ivr/ivr.c index 4c2b2c8010..81e4cc542f 100644 --- a/src/mod/applications/mod_voicemail_ivr/ivr.c +++ b/src/mod/applications/mod_voicemail_ivr/ivr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/ivr.h b/src/mod/applications/mod_voicemail_ivr/ivr.h index a277140985..31f95732b5 100644 --- a/src/mod/applications/mod_voicemail_ivr/ivr.h +++ b/src/mod/applications/mod_voicemail_ivr/ivr.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/menu.c b/src/mod/applications/mod_voicemail_ivr/menu.c index 73fa7f4859..4442b23e53 100644 --- a/src/mod/applications/mod_voicemail_ivr/menu.c +++ b/src/mod/applications/mod_voicemail_ivr/menu.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/menu.h b/src/mod/applications/mod_voicemail_ivr/menu.h index 6a49dedcba..1f91b658f6 100644 --- a/src/mod/applications/mod_voicemail_ivr/menu.h +++ b/src/mod/applications/mod_voicemail_ivr/menu.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/mod_voicemail_ivr.c b/src/mod/applications/mod_voicemail_ivr/mod_voicemail_ivr.c index bede1d0e04..bfc2a62c6c 100644 --- a/src/mod/applications/mod_voicemail_ivr/mod_voicemail_ivr.c +++ b/src/mod/applications/mod_voicemail_ivr/mod_voicemail_ivr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/utils.c b/src/mod/applications/mod_voicemail_ivr/utils.c index e7b374a325..1f065a55f0 100644 --- a/src/mod/applications/mod_voicemail_ivr/utils.c +++ b/src/mod/applications/mod_voicemail_ivr/utils.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/applications/mod_voicemail_ivr/utils.h b/src/mod/applications/mod_voicemail_ivr/utils.h index a20dfe806d..c8e9ca0868 100644 --- a/src/mod/applications/mod_voicemail_ivr/utils.h +++ b/src/mod/applications/mod_voicemail_ivr/utils.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c index 63ed2a23d9..1889ad269a 100644 --- a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c +++ b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/asr_tts/mod_flite/mod_flite.c b/src/mod/asr_tts/mod_flite/mod_flite.c index 079818af07..be7abd1915 100644 --- a/src/mod/asr_tts/mod_flite/mod_flite.c +++ b/src/mod/asr_tts/mod_flite/mod_flite.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/asr_tts/mod_pocketsphinx/Makefile b/src/mod/asr_tts/mod_pocketsphinx/Makefile index ca72c6b0a4..e3d795fb60 100644 --- a/src/mod/asr_tts/mod_pocketsphinx/Makefile +++ b/src/mod/asr_tts/mod_pocketsphinx/Makefile @@ -12,35 +12,43 @@ POCKETSPHINX_LA=$(POCKETSPHINX_BUILDDIR)/src/libpocketsphinx/libpocketsphinx.la SPHINXMODEL=communicator_semi_6000_20080321 LOCAL_CFLAGS=-I$(SPHINXBASE_DIR)/include -I$(POCKETSPHINX_DIR)/include -LOCAL_LIBADD=$(POCKETSPHINX_LA) $(SPHINXBASE_LA) $(SPHINXBASE_LA2) +LOCAL_LIBADD=$(POCKETSPHINX_LA) $(SPHINXBASE_LA) $(SPHINXBASE_LA2) BASE=../../../.. include $(BASE)/build/modmake.rules +mod_pocketsphinx.lo: $(POCKETSPHINX_LA) $(SPHINXBASE_LA) $(SPHINXBASE_LA2) + $(SPHINXBASE_DIR): $(GETLIB) $(SPHINXBASE).tar.gz -$(SPHINXBASE_BUILDDIR)/buildstamp: $(SPHINXBASE_DIR) +$(SPHINXBASE_BUILDDIR)/Makefile: $(SPHINXBASE_DIR) mkdir -p $(SPHINXBASE_BUILDDIR) - test -f $(SPHINXBASE_BUILDDIR)/Makefile || (cd $(SPHINXBASE_BUILDDIR) && $(DEFAULT_VARS) $(SPHINXBASE_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(SPHINXBASE_DIR) --without-python CFLAGS=) - test -f $(SPHINXBASE_BUILDDIR)/buildstamp || (touch $(SPHINXBASE_BUILDDIR)/buildstamp) + (cd $(SPHINXBASE_BUILDDIR) && $(DEFAULT_VARS) $(SPHINXBASE_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(SPHINXBASE_DIR) --without-python CFLAGS=) + $(TOUCH_TARGET) + +$(SPHINXBASE_BUILDDIR)/buildstamp: $(SPHINXBASE_BUILDDIR)/Makefile + (cd $(SPHINXBASE_BUILDDIR) && $(MAKE)) + touch $@ $(SPHINXBASE_LA): $(SPHINXBASE_BUILDDIR)/buildstamp - cd $(SPHINXBASE_BUILDDIR) && $(MAKE) + $(TOUCH_TARGET) + +$(SPHINXBASE_LA2): $(SPHINXBASE_BUILDDIR)/buildstamp $(TOUCH_TARGET) $(POCKETSPHINX_DIR): $(GETLIB) $(POCKETSPHINX).tar.gz -$(POCKETSPHINX_BUILDDIR)/Makefile: $(POCKETSPHINX_DIR) $(SPHINXBASE_LA) +$(POCKETSPHINX_BUILDDIR)/Makefile: $(POCKETSPHINX_DIR) $(SPHINXBASE_LA) $(SPHINXBASE_LA2) mkdir -p $(POCKETSPHINX_BUILDDIR) - cd $(POCKETSPHINX_BUILDDIR) && $(DEFAULT_VARS) $(POCKETSPHINX_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(POCKETSPHINX_DIR) --without-python --with-sphinxbase=$(SPHINXBASE_DIR) --with-sphinxbase-build=$(SPHINXBASE_BUILDDIR) CFLAGS= + (cd $(POCKETSPHINX_BUILDDIR) && $(DEFAULT_VARS) $(POCKETSPHINX_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(POCKETSPHINX_DIR) --without-python --with-sphinxbase=$(SPHINXBASE_DIR) --with-sphinxbase-build=$(SPHINXBASE_BUILDDIR) CFLAGS=) $(TOUCH_TARGET) $(POCKETSPHINX_BUILDDIR)/buildstamp: $(POCKETSPHINX_BUILDDIR)/Makefile - test -f $(POCKETSPHINX_BUILDDIR)/buildstamp || touch $(POCKETSPHINX_BUILDDIR)/buildstamp + (cd $(POCKETSPHINX_BUILDDIR) && $(MAKE)) + touch $@ -$(POCKETSPHINX_LA): $(POCKETSPHINX_BUILDDIR)/Makefile - cd $(POCKETSPHINX_BUILDDIR) && $(MAKE) +$(POCKETSPHINX_LA): $(POCKETSPHINX_BUILDDIR)/buildstamp $(TOUCH_TARGET) $(DESTDIR)$(grammardir)/model: @@ -52,6 +60,7 @@ $(DESTDIR)$(grammardir)/model/communicator: cp -rp $(switch_srcdir)/libs/Communicator_semi_40.cd_semi_6000/* $(DESTDIR)$(grammardir)/model/communicator dictionary: - @cp -f $(POCKETSPHINX_DIR)/model/lm/en_US/cmu07a.dic $(DESTDIR)$(grammardir)/default.dic + @install -m0644 $(POCKETSPHINX_DIR)/model/lm/en_US/cmu07a.dic $(DESTDIR)$(grammardir)/default.dic local_install: $(DESTDIR)$(grammardir)/model $(DESTDIR)$(grammardir)/model/communicator dictionary + diff --git a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c index c9a59038fd..995fe737d2 100644 --- a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c +++ b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c index a4dde5189d..e53964277c 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2009-2010, Anthony Minessale II + * Copyright (C) 2009-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -28,6 +28,8 @@ * Christopher M. Rienzo * Luke Dashjr (OpenMethods, LLC) * + * Maintainer: Christopher M. Rienzo + * * mod_unimrcp.c -- UniMRCP module (MRCP client) * */ diff --git a/src/mod/codecs/mod_amr/mod_amr.c b/src/mod/codecs/mod_amr/mod_amr.c index 0523e64fdd..394535cf4c 100644 --- a/src/mod/codecs/mod_amr/mod_amr.c +++ b/src/mod/codecs/mod_amr/mod_amr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_amrwb/mod_amrwb.c b/src/mod/codecs/mod_amrwb/mod_amrwb.c index d71953b224..f11486ca34 100644 --- a/src/mod/codecs/mod_amrwb/mod_amrwb.c +++ b/src/mod/codecs/mod_amrwb/mod_amrwb.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_bv/mod_bv.c b/src/mod/codecs/mod_bv/mod_bv.c index d8560094b4..d41e014bc5 100644 --- a/src/mod/codecs/mod_bv/mod_bv.c +++ b/src/mod/codecs/mod_bv/mod_bv.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_celt/mod_celt.c b/src/mod/codecs/mod_celt/mod_celt.c index 8d36b6af12..d03f45ed82 100644 --- a/src/mod/codecs/mod_celt/mod_celt.c +++ b/src/mod/codecs/mod_celt/mod_celt.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_codec2/mod_codec2.c b/src/mod/codecs/mod_codec2/mod_codec2.c index 866a39c9df..fefe80463f 100644 --- a/src/mod/codecs/mod_codec2/mod_codec2.c +++ b/src/mod/codecs/mod_codec2/mod_codec2.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c b/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c index a5bf1ecad7..b9d150dc4f 100644 --- a/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c +++ b/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_g723_1/mod_g723_1.c b/src/mod/codecs/mod_g723_1/mod_g723_1.c index cd5defb8e9..f4d835cedd 100644 --- a/src/mod/codecs/mod_g723_1/mod_g723_1.c +++ b/src/mod/codecs/mod_g723_1/mod_g723_1.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_g729/mod_g729.c b/src/mod/codecs/mod_g729/mod_g729.c index 0b1d2ada0e..4de9604935 100644 --- a/src/mod/codecs/mod_g729/mod_g729.c +++ b/src/mod/codecs/mod_g729/mod_g729.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_h26x/mod_h26x.c b/src/mod/codecs/mod_h26x/mod_h26x.c index 7f9ec543f6..368edb98f2 100644 --- a/src/mod/codecs/mod_h26x/mod_h26x.c +++ b/src/mod/codecs/mod_h26x/mod_h26x.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_ilbc/mod_ilbc.c b/src/mod/codecs/mod_ilbc/mod_ilbc.c index 23ca642c22..50ecdce368 100644 --- a/src/mod/codecs/mod_ilbc/mod_ilbc.c +++ b/src/mod/codecs/mod_ilbc/mod_ilbc.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_isac/auto_corr_to_refl_coef.c b/src/mod/codecs/mod_isac/auto_corr_to_refl_coef.c index b7e885898a..b0ed4605f4 100644 --- a/src/mod/codecs/mod_isac/auto_corr_to_refl_coef.c +++ b/src/mod/codecs/mod_isac/auto_corr_to_refl_coef.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source diff --git a/src/mod/codecs/mod_isac/mod_isac.c b/src/mod/codecs/mod_isac/mod_isac.c index 3f5f40aadb..e182999368 100644 --- a/src/mod/codecs/mod_isac/mod_isac.c +++ b/src/mod/codecs/mod_isac/mod_isac.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_mp4v/mod_mp4v.c b/src/mod/codecs/mod_mp4v/mod_mp4v.c index d4e0a1ea23..48c7242482 100644 --- a/src/mod/codecs/mod_mp4v/mod_mp4v.c +++ b/src/mod/codecs/mod_mp4v/mod_mp4v.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_opus/mod_opus.c b/src/mod/codecs/mod_opus/mod_opus.c index b9a31208a4..285557fd96 100644 --- a/src/mod/codecs/mod_opus/mod_opus.c +++ b/src/mod/codecs/mod_opus/mod_opus.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_silk/mod_silk.c b/src/mod/codecs/mod_silk/mod_silk.c index 6a090bef0d..5c32b72969 100644 --- a/src/mod/codecs/mod_silk/mod_silk.c +++ b/src/mod/codecs/mod_silk/mod_silk.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_siren/mod_siren.c b/src/mod/codecs/mod_siren/mod_siren.c index 224a8258a6..1a3bc54cad 100644 --- a/src/mod/codecs/mod_siren/mod_siren.c +++ b/src/mod/codecs/mod_siren/mod_siren.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_skel_codec/mod_skel_codec.c b/src/mod/codecs/mod_skel_codec/mod_skel_codec.c index cab5c7e8df..7be74aa6a6 100644 --- a/src/mod/codecs/mod_skel_codec/mod_skel_codec.c +++ b/src/mod/codecs/mod_skel_codec/mod_skel_codec.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_speex/mod_speex.c b/src/mod/codecs/mod_speex/mod_speex.c index aaec0a6602..ab9a044b53 100644 --- a/src/mod/codecs/mod_speex/mod_speex.c +++ b/src/mod/codecs/mod_speex/mod_speex.c @@ -117,51 +117,143 @@ struct speex_context { static switch_status_t switch_speex_fmtp_parse(const char *fmtp, switch_codec_fmtp_t *codec_fmtp) { - if (codec_fmtp) { - speex_codec_settings_t *codec_settings = NULL; - if (codec_fmtp->private_info) { - codec_settings = codec_fmtp->private_info; - memcpy(codec_settings, &default_codec_settings, sizeof(*codec_settings)); - } + speex_codec_settings_t *codec_settings = NULL; + int x, argc; + char *argv[10]; + char *fmtp_dup = NULL; - if (fmtp) { - int x, argc; - char *argv[10]; - char *fmtp_dup = strdup(fmtp); + if (!codec_fmtp) { + return SWITCH_STATUS_FALSE; + } - switch_assert(fmtp_dup); - - argc = switch_separate_string(fmtp_dup, ';', argv, (sizeof(argv) / sizeof(argv[0]))); - - for (x = 0; x < argc; x++) { - char *data = argv[x]; - char *arg; - switch_assert(data); - while (*data == ' ') { - data++; - } - if ((arg = strchr(data, '='))) { - *arg++ = '\0'; - /* - if (!strcasecmp(data, "bitrate")) { - bit_rate = atoi(arg); - } - */ - /* - if (codec_settings) { - if (!strcasecmp(data, "vad")) { - bit_rate = atoi(arg); - } - } - */ - } - } - free(fmtp_dup); - } - /*codec_fmtp->bits_per_second = bit_rate;*/ + /* load default settings */ + if (codec_fmtp->private_info) { + codec_settings = codec_fmtp->private_info; + memcpy(codec_settings, &default_codec_settings, sizeof(*codec_settings)); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "codec_fmtp->private_info is NULL\n"); return SWITCH_STATUS_SUCCESS; } - return SWITCH_STATUS_FALSE; + + if (!fmtp) { + return SWITCH_STATUS_SUCCESS; + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "got fmtp: %s\n", fmtp); + + fmtp_dup = strdup(fmtp); + switch_assert(fmtp_dup); + + /* parse ; separated fmtp args */ + argc = switch_separate_string(fmtp_dup, ';', argv, (sizeof(argv) / sizeof(argv[0]))); + for (x = 0; x < argc; x++) { + char *data = argv[x]; + char *arg; + switch_assert(data); + while (*data == ' ') { + data++; + } + if (!(arg = strchr(data, '='))) { + continue; + } + *arg++ = '\0'; + if (zstr(arg)) { + continue; + } + + if (!strcasecmp("vbr", data)) { + /* vbr can be on/off/vad */ + if (!strcasecmp("vad", arg)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "enabling speex vbr=vad\n"); + codec_settings->vbr = 0; + codec_settings->vad = 1; + codec_settings->pp_vad = 1; + } else { + if (switch_true(arg)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "enabling speex vbr\n"); + codec_settings->vbr = 1; + codec_settings->vad = 0; + codec_settings->pp_vad = 1; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "disabling speex vbr\n"); + codec_settings->vbr = 0; + codec_settings->vad = 0; + codec_settings->pp_vad = 0; + } + } + } else if (!strcasecmp("cng", data)) { + /* TODO don't know how to turn on CNG */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "speex cng is unsupported\n"); + } else if (!strcasecmp("mode", data)) { + /* mode is a comma-separate list of preferred modes. Use the first mode in the list */ + char *arg_dup; + char *mode[2]; + if (!strncasecmp("any", arg, 3)) { + /* "any", keep the default setting */ + continue; + } + arg_dup = strdup(arg); + if (switch_separate_string(arg_dup, ',', mode, (sizeof(mode) / sizeof(mode[0])))) { + int mode_num = -1; + char *mode_str = mode[0]; + if (mode_str[0] == '"') { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "mode starts with \"\n"); + mode_str++; + } + if (switch_is_number(mode_str)) { + mode_num = atoi(mode_str); + } + /* TODO there might be a way to set the mode directly instead of changing the quality */ + if (codec_fmtp->actual_samples_per_second == 8000) { + switch (mode_num) { + case 1: + codec_settings->quality = 0; + break; + case 2: + codec_settings->quality = 2; + break; + case 3: + codec_settings->quality = 4; + break; + case 4: + codec_settings->quality = 6; + break; + case 5: + codec_settings->quality = 8; + break; + case 6: + codec_settings->quality = 9; + break; + case 7: + codec_settings->quality = 10; + break; + case 8: + codec_settings->quality = 1; + break; + default: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "ignoring invalid speex/8000 mode %s\n", mode_str); + continue; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "choosing speex/8000 mode %s\n", mode_str); + codec_settings->quality = codec_settings->quality; + codec_settings->vbr_quality = codec_settings->quality; + } else { + if (mode_num >= 0 && mode_num <= 10) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "choosing speex/%d mode %s\n", codec_fmtp->actual_samples_per_second, mode_str); + codec_settings->quality = mode_num; + codec_settings->vbr_quality = mode_num; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "ignoring invalid speex/%d mode %s\n", codec_fmtp->actual_samples_per_second, mode_str); + continue; + } + } + } + free(arg_dup); + } + } + free(fmtp_dup); + /*codec_fmtp->bits_per_second = bit_rate;*/ + return SWITCH_STATUS_SUCCESS; } @@ -182,6 +274,7 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla memset(&codec_fmtp, '\0', sizeof(struct switch_codec_fmtp)); codec_fmtp.private_info = &codec_settings; + codec_fmtp.actual_samples_per_second = codec->implementation->actual_samples_per_second; switch_speex_fmtp_parse(codec->fmtp_in, &codec_fmtp); memcpy(&context->codec_settings, &codec_settings, sizeof(context->codec_settings)); @@ -205,11 +298,24 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla speex_encoder_ctl(context->encoder_state, SPEEX_GET_FRAME_SIZE, &context->encoder_frame_size); speex_encoder_ctl(context->encoder_state, SPEEX_SET_COMPLEXITY, &context->codec_settings.complexity); if (context->codec_settings.preproc) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "preprocessor on\n"); context->pp = speex_preprocess_state_init(context->encoder_frame_size, codec->implementation->actual_samples_per_second); + if (context->codec_settings.pp_vad) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "preprocessor vad on\n"); + } speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_VAD, &context->codec_settings.pp_vad); + if (context->codec_settings.pp_agc) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "preprocessor agc on\n"); + } speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC, &context->codec_settings.pp_agc); speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC_LEVEL, &context->codec_settings.pp_agc_level); + if (context->codec_settings.pp_denoise) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "preprocessor denoise on\n"); + } speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DENOISE, &context->codec_settings.pp_denoise); + if (context->codec_settings.pp_dereverb) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "preprocessor dereverb on\n"); + } speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB, &context->codec_settings.pp_dereverb); speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &context->codec_settings.pp_dereverb_decay); speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &context->codec_settings.pp_dereverb_level); @@ -218,17 +324,21 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla if (!context->codec_settings.abr && !context->codec_settings.vbr) { speex_encoder_ctl(context->encoder_state, SPEEX_SET_QUALITY, &context->codec_settings.quality); if (context->codec_settings.vad) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "vad on\n"); speex_encoder_ctl(context->encoder_state, SPEEX_SET_VAD, &context->codec_settings.vad); } } if (context->codec_settings.vbr) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "vbr on\n"); speex_encoder_ctl(context->encoder_state, SPEEX_SET_VBR, &context->codec_settings.vbr); speex_encoder_ctl(context->encoder_state, SPEEX_SET_VBR_QUALITY, &context->codec_settings.vbr_quality); } if (context->codec_settings.abr) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "abr on\n"); speex_encoder_ctl(context->encoder_state, SPEEX_SET_ABR, &context->codec_settings.abr); } if (context->codec_settings.dtx) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "dtx on\n"); speex_encoder_ctl(context->encoder_state, SPEEX_SET_DTX, &context->codec_settings.dtx); } } @@ -243,6 +353,7 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "initialized Speex codec \n"); codec->private_info = context; return SWITCH_STATUS_SUCCESS; } @@ -279,17 +390,15 @@ static switch_status_t switch_speex_encode(switch_codec_t *codec, if (is_speech) { switch_clear_flag(context, SWITCH_CODEC_FLAG_SILENCE); - *flag |= SWITCH_CODEC_FLAG_SILENCE_STOP; *flag &= ~SFF_CNG; } else { if (switch_test_flag(context, SWITCH_CODEC_FLAG_SILENCE)) { *encoded_data_len = 0; - *flag |= SWITCH_CODEC_FLAG_SILENCE | SFF_CNG; + *flag |= SFF_CNG; return SWITCH_STATUS_SUCCESS; } switch_set_flag(context, SWITCH_CODEC_FLAG_SILENCE); - *flag |= SWITCH_CODEC_FLAG_SILENCE_START; } diff --git a/src/mod/codecs/mod_theora/mod_theora.c b/src/mod/codecs/mod_theora/mod_theora.c index f1601436ca..fb97fd850d 100644 --- a/src/mod/codecs/mod_theora/mod_theora.c +++ b/src/mod/codecs/mod_theora/mod_theora.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c b/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c index 68bec657e6..5bbbc29d97 100644 --- a/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c +++ b/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c index 4e62a00da8..2da9a6caa7 100644 --- a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c +++ b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c b/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c index d28804e3b8..d316299c8b 100644 --- a/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c +++ b/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c index 9faaa1852b..2ff472afea 100644 --- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c +++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/directories/mod_ldap/mod_ldap.c b/src/mod/directories/mod_ldap/mod_ldap.c index 1bc9b9d61b..32b0c5a886 100644 --- a/src/mod/directories/mod_ldap/mod_ldap.c +++ b/src/mod/directories/mod_ldap/mod_ldap.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/endpoints/mod_alsa/mod_alsa.c b/src/mod/endpoints/mod_alsa/mod_alsa.c index 40c1362f3d..bafe8bdcc1 100644 --- a/src/mod/endpoints/mod_alsa/mod_alsa.c +++ b/src/mod/endpoints/mod_alsa/mod_alsa.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -748,14 +748,6 @@ static switch_io_routines_t channel_io_routines = { /*.receive_message */ channel_receive_message }; -static switch_endpoint_interface_t channel_endpoint_interface = { - /*.interface_name */ "alsa", - /*.io_routines */ &channel_io_routines, - /*.event_handlers */ &channel_event_handlers, - /*.private */ NULL, - /*.next */ NULL -}; - /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines that allocate memory or you will have 1 channel with memory allocated from another channel's pool! @@ -766,7 +758,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi switch_call_cause_t *cancel_cause) { - if ((*new_session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) { + if ((*new_session = switch_core_session_request(alsa_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) { private_t *tech_pvt; switch_channel_t *channel; switch_caller_profile_t *caller_profile; @@ -956,6 +948,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_alsa_shutdown) } switch_core_hash_destroy(&globals.call_hash); + switch_event_free_subclass(MY_EVENT_RINGING); switch_safe_free(globals.dialplan); switch_safe_free(globals.cid_name); switch_safe_free(globals.cid_num); @@ -1437,7 +1430,7 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t } dest = argv[0]; - if ((session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) { + if ((session = switch_core_session_request(alsa_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) { private_t *tech_pvt; switch_channel_t *channel; char *dialplan = globals.dialplan; diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 7de70de36e..735a68efc7 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/endpoints/mod_gsmopen/.gitignore b/src/mod/endpoints/mod_gsmopen/.gitignore index e2769c8969..9fdeeb1412 100644 --- a/src/mod/endpoints/mod_gsmopen/.gitignore +++ b/src/mod/endpoints/mod_gsmopen/.gitignore @@ -1,3 +1,2 @@ !/gsmlib/gsmlib-*/aclocal.m4 !/gsmlib/gsmlib-*/configure -!/gsmlib/gsmlib_1.10.orig.tar.gz diff --git a/src/mod/endpoints/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/Makefile index 9aff13615a..18823eb4ca 100644 --- a/src/mod/endpoints/mod_gsmopen/Makefile +++ b/src/mod/endpoints/mod_gsmopen/Makefile @@ -1,9 +1,5 @@ MODNAME=mod_gsmopen -SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' -#LOCAL_CFLAGS += $(SVNDEF) -I/usr/src/gsmlib-1.10 -LOCAL_CFLAGS += $(SVNDEF) -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff -#LOCAL_LDFLAGS=-lasound -L/usr/src/gsmlib-1.10/gsmlib/.libs -lgsmme -LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lasound -lgsmme -lspandsp -LOCAL_OBJS=gsmopen_protocol.o -#OUR_OBJS += /usr/src/gsmlib-1.10/gsmlib/libgsmme.la +LOCAL_CFLAGS += -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff -DGSMOPEN_C_VER=\"`git log -1 --format="%h" gsmopen_protocol.cpp`\" -DMODGSMOPEN_C_VER=\"`git log -1 --format="%h" mod_gsmopen.cpp`\" +LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp -lctb-0.16 -lgsmme +LOCAL_OBJS=gsmopen_protocol.o include ../../../../build/modmake.rules diff --git a/src/mod/endpoints/mod_gsmopen/Makefile.am b/src/mod/endpoints/mod_gsmopen/Makefile.am index 8879a4616d..749d04896c 100644 --- a/src/mod/endpoints/mod_gsmopen/Makefile.am +++ b/src/mod/endpoints/mod_gsmopen/Makefile.am @@ -11,9 +11,9 @@ SPANDSP_LA=$(SPANDSP_BUILDDIR)/src/libspandsp.la mod_LTLIBRARIES = mod_gsmopen.la mod_gsmopen_la_SOURCES = mod_gsmopen.cpp gsmopen_protocol.cpp -mod_gsmopen_la_CFLAGS = $(AM_CFLAGS) -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. -DGSMOPEN_SVN_VERSION=\"`cat $(switch_builddir)/.version`\" +mod_gsmopen_la_CFLAGS = $(AM_CFLAGS) -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. -DGSMOPEN_C_VER=\"`git log -1 --format="%h" gsmopen_protocol.cpp`\" -DMODGSMOPEN_C_VER=\"`git log -1 --format="%h" mod_gsmopen.cpp`\" mod_gsmopen_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SPANDSP_LA) $(TIFF_LA) -mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lasound -lgsmme +mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lctb-0.16 -lgsmme $(SPANDSP_LA): $(TIFF_LA) $(SPANDSP_DIR) $(SPANDSP_DIR)/.update cd $(SPANDSP_BUILDDIR) && $(MAKE) -j1 diff --git a/src/mod/endpoints/mod_gsmopen/README b/src/mod/endpoints/mod_gsmopen/README index 0335ad1deb..30955a2157 100644 --- a/src/mod/endpoints/mod_gsmopen/README +++ b/src/mod/endpoints/mod_gsmopen/README @@ -1,31 +1,9 @@ GSMopen, GSM Endpoint and Trunk -This is just a prototype. - -put this directory in freeswitch.trunk/src/mod/endpoints/ - -make clean; make; make install - -Is not getting its configuration from the configuration file, it's all hardcoded but it needs the configuration file. - -Copy gsmopen.conf.xml in /usr/local/freeswitch/conf/autoload_configs/ - -You must have the device on serial port /dev/ttyACM0 and the audio as second soundcard plughw:1 (if you do not have a first soundcard, just modprobe snd-dummy before to connect the usb thingy). - -Put the volumes (with alsamixer -c1 -Vall) as: speaker 80, autogain on, mic off, mic capt 0. - -Then, with alsamixer -c1 -Vcapture, be sure capture is active (eg, press the spacebar until the red CAPTURE appear). When it all working, adjust to your taste. - -It answer calls, make calls, receive sms, and send sms (with the CLI command "sendsms"). - -Copy ciapalo in /usr/local/bin/ (is the program automatically spawned when an SMS is received). - -Copy asound.conf in /etc/asound.conf, it will spare you cpu cycles when rate conversion is required (always). - All documentation on compiling, using, configuring, tricks and tweaks, possible problems at: -http://wiki.freeswitch.org/wiki/GSMopen_GSM_Endpoint_and_Trunk +http://wiki.freeswitch.org/wiki/Gsmopen Enjoy diff --git a/src/mod/endpoints/mod_gsmopen/configs/asound.conf b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/asound.conf similarity index 100% rename from src/mod/endpoints/mod_gsmopen/configs/asound.conf rename to src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/asound.conf diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml new file mode 100644 index 0000000000..d21a4c1969 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml.motorola b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml.motorola similarity index 100% rename from src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml.motorola rename to src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml.motorola diff --git a/src/mod/endpoints/mod_gsmopen/setmixers b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/setmixers similarity index 100% rename from src/mod/endpoints/mod_gsmopen/setmixers rename to src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/setmixers diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h deleted file mode 120000 index 663f1cbc4d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h new file mode 100644 index 0000000000..03c14283b4 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h @@ -0,0 +1,665 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005/2012, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * This module (mod_gsmopen) has been contributed by: + * + * Giovanni Maruzzelli (gmaruzz@gmail.com) + * + * + * Further Contributors: + * + * + * + * mod_gsmopen.c -- GSM compatible Endpoint Module + * + */ + +#define __STDC_LIMIT_MACROS + +#ifdef WIN32 +#define HAVE_VSNPRINTF +#pragma warning(disable: 4290) +#endif //WIN32 + +#define MY_EVENT_INCOMING_SMS "gsmopen::incoming_sms" +#define MY_EVENT_DUMP "gsmopen::dump_event" +#define MY_EVENT_ALARM "gsmopen::alarm" + +#define ALARM_FAILED_INTERFACE 0 +#define ALARM_NO_NETWORK_REGISTRATION 1 +#define ALARM_ROAMING_NETWORK_REGISTRATION 2 +#define ALARM_NETWORK_NO_SERVICE 3 +#define ALARM_NETWORK_NO_SIGNAL 4 +#define ALARM_NETWORK_LOW_SIGNAL 5 + + + + + +#undef GIOVA48 + +#ifndef GIOVA48 +#define SAMPLES_PER_FRAME 160 +#else // GIOVA48 +#define SAMPLES_PER_FRAME 960 +#endif // GIOVA48 + + +#ifndef GIOVA48 +#define GSMOPEN_FRAME_SIZE 160 +#else //GIOVA48 +#define GSMOPEN_FRAME_SIZE 960 +#endif //GIOVA48 +#define SAMPLERATE_GSMOPEN 8000 + +#ifndef NO_ALSA +#define GSMOPEN_ALSA +#endif // NO_ALSA +#include +#include +#ifndef WIN32 +#include +#include +#include +#endif //WIN32 +//#include + +#ifdef GSMOPEN_ALSA +#define ALSA_PCM_NEW_HW_PARAMS_API +#define ALSA_PCM_NEW_SW_PARAMS_API +#include +#endif /* GSMOPEN_ALSA */ + +#ifdef GSMOPEN_PORTAUDIO +#include "pablio.h" +#undef WANT_SPEEX +#ifdef WANT_SPEEX +#include "speex/speex_preprocess.h" +#include "speex/speex_echo.h" +#endif /* WANT_SPEEX */ +#endif// GSMOPEN_PORTAUDIO + +//#include "celliax_spandsp.h" +#ifndef WIN32 +#include +//#include +//#include +//#include +#endif //WIN32 + +#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES +#include +#include + +#ifdef _MSC_VER +//Windows macro for FD_SET includes a warning C4127: conditional expression is constant +#pragma warning(push) +#pragma warning(disable:4127) +#endif + +#define PROTOCOL_ALSA_VOICEMODEM 4 +#define PROTOCOL_AT 2 +#define PROTOCOL_FBUS2 1 +#define PROTOCOL_NO_SERIAL 3 + +#define AT_BUFSIZ 8192 +//FIXME FIXME FIXME #define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ +#define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ +//FIXME FIXME FIXME #define AT_MESG_MAX_LINES 256 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ +#define AT_MESG_MAX_LINES 20 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ + +//#define SAMPLERATE_GSMOPEN 16000 +//#define SAMPLES_PER_FRAME SAMPLERATE_GSMOPEN/50 + +#ifndef GSMOPEN_SVN_VERSION +#define GSMOPEN_SVN_VERSION SWITCH_VERSION_REVISION +#endif /* GSMOPEN_SVN_VERSION */ + +typedef enum { + TFLAG_IO = (1 << 0), + TFLAG_INBOUND = (1 << 1), + TFLAG_OUTBOUND = (1 << 2), + TFLAG_DTMF = (1 << 3), + TFLAG_VOICE = (1 << 4), + TFLAG_HANGUP = (1 << 5), + TFLAG_LINEAR = (1 << 6), + TFLAG_CODEC = (1 << 7), + TFLAG_BREAK = (1 << 8) +} TFLAGS; + +typedef enum { + GFLAG_MY_CODEC_PREFS = (1 << 0) +} GFLAGS; + +#define DEBUGA_GSMOPEN(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_GSMOPEN %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); + +#define GSMOPEN_P_LOG (void *)NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->phone_callflow : -1 + +/*********************************/ +#define GSMOPEN_CAUSE_NORMAL 1 +#define GSMOPEN_CAUSE_FAILURE 2 +#define GSMOPEN_CAUSE_NO_ANSWER 3 +/*********************************/ +#define GSMOPEN_FRAME_DTMF 1 +/*********************************/ +#define GSMOPEN_CONTROL_RINGING 1 +#define GSMOPEN_CONTROL_ANSWER 2 +#define GSMOPEN_CONTROL_HANGUP 3 +#define GSMOPEN_CONTROL_BUSY 4 + +/*********************************/ +#define GSMOPEN_STATE_IDLE 0 +#define GSMOPEN_STATE_DOWN 1 +#define GSMOPEN_STATE_RING 2 +#define GSMOPEN_STATE_DIALING 3 +#define GSMOPEN_STATE_BUSY 4 +#define GSMOPEN_STATE_UP 5 +#define GSMOPEN_STATE_RINGING 6 +#define GSMOPEN_STATE_PRERING 7 +#define GSMOPEN_STATE_ERROR_DOUBLE_CALL 8 +#define GSMOPEN_STATE_SELECTED 9 +#define GSMOPEN_STATE_HANGUP_REQUESTED 10 +#define GSMOPEN_STATE_PREANSWER 11 +/*********************************/ +/* call flow from the device */ +#define CALLFLOW_CALL_IDLE 0 +#define CALLFLOW_CALL_DOWN 1 +#define CALLFLOW_INCOMING_RING 2 +#define CALLFLOW_CALL_DIALING 3 +#define CALLFLOW_CALL_LINEBUSY 4 +#define CALLFLOW_CALL_ACTIVE 5 +#define CALLFLOW_INCOMING_HANGUP 6 +#define CALLFLOW_CALL_RELEASED 7 +#define CALLFLOW_CALL_NOCARRIER 8 +#define CALLFLOW_CALL_INFLUX 9 +#define CALLFLOW_CALL_INCOMING 10 +#define CALLFLOW_CALL_FAILED 11 +#define CALLFLOW_CALL_NOSERVICE 12 +#define CALLFLOW_CALL_OUTGOINGRESTRICTED 13 +#define CALLFLOW_CALL_SECURITYFAIL 14 +#define CALLFLOW_CALL_NOANSWER 15 +#define CALLFLOW_STATUS_FINISHED 16 +#define CALLFLOW_STATUS_CANCELLED 17 +#define CALLFLOW_STATUS_FAILED 18 +#define CALLFLOW_STATUS_REFUSED 19 +#define CALLFLOW_STATUS_RINGING 20 +#define CALLFLOW_STATUS_INPROGRESS 21 +#define CALLFLOW_STATUS_UNPLACED 22 +#define CALLFLOW_STATUS_ROUTING 23 +#define CALLFLOW_STATUS_EARLYMEDIA 24 +#define CALLFLOW_INCOMING_CALLID 25 +#define CALLFLOW_STATUS_REMOTEHOLD 26 +#define CALLFLOW_CALL_REMOTEANSWER 27 +#define CALLFLOW_CALL_HANGUP_REQUESTED 28 + +/*********************************/ + +#define AT_OK 0 +#define AT_ERROR 1 + +#define GSMOPEN_MAX_INTERFACES 64 + +#ifndef WIN32 +struct GSMopenHandles { + //Window gsmopen_win; + //Display *disp; + //Window win; + int currentuserhandle; + int api_connected; + int fdesc[2]; +}; +#else //WIN32 + +struct GSMopenHandles { + HWND win32_hInit_MainWindowHandle; + HWND win32_hGlobal_GSMAPIWindowHandle; + HINSTANCE win32_hInit_ProcessHandle; + char win32_acInit_WindowClassName[128]; + UINT win32_uiGlobal_MsgID_GSMControlAPIAttach; + UINT win32_uiGlobal_MsgID_GSMControlAPIDiscover; + int currentuserhandle; + int api_connected; + switch_file_t *fdesc[2]; +}; + +#endif //WIN32 + +/*! + * \brief structure for storing the results of AT commands, in an array of AT_MESG_MAX_LINES * AT_MESG_MAX_LENGTH chars + */ +struct s_result { + int elemcount; + char result[AT_MESG_MAX_LINES][AT_MESG_MAX_LENGTH]; +}; + +struct ciapa_struct { + int state; + int hangupcause; +}; +typedef struct ciapa_struct ciapa_t; + +struct private_object { + unsigned int flags; + switch_codec_t read_codec; + switch_codec_t write_codec; + switch_frame_t read_frame; + unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; + char session_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + switch_caller_profile_t *caller_profile; + switch_mutex_t *mutex; + switch_mutex_t *flag_mutex; + + char id[80]; + char name[80]; + char dialplan[80]; + char context[80]; + char dial_regex[256]; + char fail_dial_regex[256]; + char hold_music[256]; + char type[256]; + char X11_display[256]; +#ifdef WIN32 + unsigned short tcp_cli_port; + unsigned short tcp_srv_port; +#else + int tcp_cli_port; + int tcp_srv_port; +#endif + struct GSMopenHandles GSMopenHandles; + + int interface_state; /*!< \brief 'state' of the interface (channel) */ + char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ + char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ + int gsmopen_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ + char callid_name[50]; + char callid_number[50]; + double playback_boost; + double capture_boost; + int stripmsd; + char gsmopen_call_id[512]; + int gsmopen_call_ongoing; + char gsmopen_friends[4096]; + char gsmopen_fullname[512]; + char gsmopen_displayname[512]; + int phone_callflow; /*!< \brief 'callflow' of the gsmopen interface (as opposed to phone interface) */ + int gsmopen; /*!< \brief config flag, bool, GSM support on this interface (0 if false, -1 if true) */ + int control_to_send; +#ifdef WIN32 + switch_file_t *audiopipe[2]; + switch_file_t *audiogsmopenpipe[2]; + switch_file_t *gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ +#else /* WIN32 */ + int audiopipe[2]; + int audiogsmopenpipe[2]; + int gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ +#endif /* WIN32 */ + switch_thread_t *tcp_srv_thread; + switch_thread_t *tcp_cli_thread; + switch_thread_t *gsmopen_signaling_thread; + switch_thread_t *gsmopen_api_thread; + //short audiobuf[SAMPLES_PER_FRAME]; + //int audiobuf_is_loaded; + + //int phonebook_listing; + //int phonebook_querying; + //int phonebook_listing_received_calls; + + //int phonebook_first_entry; + //int phonebook_last_entry; + //int phonebook_number_lenght; + //int phonebook_text_lenght; + int gsmopen_dir_entry_extension_prefix; + char gsmopen_user[256]; + char gsmopen_password[256]; + char destination[256]; + struct timeval answer_time; + + struct timeval transfer_time; + char transfer_callid_number[50]; + char gsmopen_transfer_call_id[512]; + int running; + unsigned long ib_calls; + unsigned long ob_calls; + unsigned long ib_failed_calls; + unsigned long ob_failed_calls; + + + char controldevice_name[50]; /*!< \brief name of the serial device controlling the interface, possibly none */ + int controldevprotocol; /*!< \brief which protocol is used for serial control of this interface */ + char controldevprotocolname[50]; /*!< \brief name of the serial device controlling protocol, one of "at" "fbus2" "no_serial" "alsa_voicemodem" */ + int controldevfd; /*!< \brief serial controlling file descriptor for this interface */ + //pthread_t controldev_thread; /*!< \brief serial control thread for this interface, running during the call */ +#ifdef WIN32 + int controldevice_speed; +#else + speed_t controldevice_speed; +#endif// WIN32 + int controldev_dead; + + char at_dial_pre_number[64]; + char at_dial_post_number[64]; + char at_dial_expect[64]; + unsigned int at_early_audio; + char at_hangup[64]; + char at_hangup_expect[64]; + char at_answer[64]; + char at_answer_expect[64]; + unsigned int at_initial_pause; + char at_preinit_1[64]; + char at_preinit_1_expect[64]; + char at_preinit_2[64]; + char at_preinit_2_expect[64]; + char at_preinit_3[64]; + char at_preinit_3_expect[64]; + char at_preinit_4[64]; + char at_preinit_4_expect[64]; + char at_preinit_5[64]; + char at_preinit_5_expect[64]; + unsigned int at_after_preinit_pause; + + char at_postinit_1[64]; + char at_postinit_1_expect[64]; + char at_postinit_2[64]; + char at_postinit_2_expect[64]; + char at_postinit_3[64]; + char at_postinit_3_expect[64]; + char at_postinit_4[64]; + char at_postinit_4_expect[64]; + char at_postinit_5[64]; + char at_postinit_5_expect[64]; + + char at_send_dtmf[64]; + + char at_query_battchg[64]; + char at_query_battchg_expect[64]; + char at_query_signal[64]; + char at_query_signal_expect[64]; + char at_call_idle[64]; + char at_call_incoming[64]; + char at_call_active[64]; + char at_call_failed[64]; + char at_call_calling[64]; + +#define CIEV_STRING_SIZE 64 + char at_indicator_noservice_string[64]; + char at_indicator_nosignal_string[64]; + char at_indicator_lowsignal_string[64]; + char at_indicator_lowbattchg_string[64]; + char at_indicator_nobattchg_string[64]; + char at_indicator_callactive_string[64]; + char at_indicator_nocallactive_string[64]; + char at_indicator_nocallsetup_string[64]; + char at_indicator_callsetupincoming_string[64]; + char at_indicator_callsetupoutgoing_string[64]; + char at_indicator_callsetupremoteringing_string[64]; + + int at_indicator_callp; + int at_indicator_callsetupp; + int at_indicator_roamp; + int at_indicator_battchgp; + int at_indicator_servicep; + int at_indicator_signalp; + + int at_has_clcc; + int at_has_ecam; + + char at_cmgw[16]; + int no_ucs2; + time_t gsmopen_serial_sync_period; + + time_t gsmopen_serial_synced_timestamp; + struct s_result line_array; + + + int unread_sms_msg_id; + int reading_sms_msg; + char sms_message[4800]; + char sms_sender[256]; + char sms_date[256]; + char sms_body[4800]; + char sms_datacodingscheme[256]; + char sms_servicecentreaddress[256]; + int sms_messagetype; + int sms_cnmi_not_supported; + int sms_pdu_not_supported; + //char sms_receiving_program[256]; + + + struct timeval call_incoming_time; + switch_mutex_t *controldev_lock; + + int phonebook_listing; + int phonebook_querying; + int phonebook_listing_received_calls; + + int phonebook_first_entry; + int phonebook_last_entry; + int phonebook_number_lenght; + int phonebook_text_lenght; + FILE *phonebook_writing_fp; + + struct timeval ringtime; + ciapa_t *owner; +#ifdef GSMOPEN_ALSA + snd_pcm_t *alsac; /*!< \brief handle of the ALSA capture audio device */ + snd_pcm_t *alsap; /*!< \brief handle of the ALSA playback audio device */ + char alsacname[50]; /*!< \brief name of the ALSA capture audio device */ + char alsapname[50]; /*!< \brief name of the ALSA playback audio device */ + int alsa_period_size; /*!< \brief ALSA period_size, in byte */ + int alsa_periods_in_buffer; /*!< \brief how many periods in ALSA buffer, to calculate buffer_size */ + unsigned long int alsa_buffer_size; /*!< \brief ALSA buffer_size, in byte */ + int alsawrite_filled; + int alsa_capture_is_mono; + int alsa_play_is_mono; + struct pollfd pfd; +#endif // GSMOPEN_ALSA + + time_t audio_play_reset_timestamp; + int audio_play_reset_period; + + switch_timer_t timer_read; + switch_timer_t timer_write; + teletone_dtmf_detect_state_t dtmf_detect; + switch_time_t old_dtmf_timestamp; + + int no_sound; + +#ifdef GSMOPEN_PORTAUDIO + int speexecho; + int speexpreprocess; + int portaudiocindex; /*!< \brief Index of the Portaudio capture audio device */ + int portaudiopindex; /*!< \brief Index of the Portaudio playback audio device */ + PABLIO_Stream *stream; + +#ifdef WANT_SPEEX + SpeexPreprocessState *preprocess; + SpeexEchoState *echo_state; +#endif// WANT_SPEEX +#endif// GSMOPEN_PORTAUDIO + dtmf_rx_state_t dtmf_state; + int active; + int home_network_registered; + int roaming_registered; + int not_registered; + int got_signal; + char imei[128]; + int requesting_imei; + char imsi[128]; + int requesting_imsi; + int network_creg_not_supported; + char creg[128]; + +}; + +typedef struct private_object private_t; + +void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t * thread, void *obj); +int gsmopen_audio_read(private_t * tech_pvt); +int gsmopen_audio_init(private_t * tech_pvt); +int gsmopen_signaling_read(private_t * tech_pvt); + +int gsmopen_call(private_t * tech_pvt, char *idest, int timeout); +int gsmopen_senddigit(private_t * tech_pvt, char digit); + +void *gsmopen_do_tcp_srv_thread_func(void *obj); +void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t * thread, void *obj); + +void *gsmopen_do_tcp_cli_thread_func(void *obj); +void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t * thread, void *obj); + +void *gsmopen_do_gsmopenapi_thread_func(void *obj); +void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj); +int dtmf_received(private_t * tech_pvt, char *value); +int start_audio_threads(private_t * tech_pvt); +int new_inbound_channel(private_t * tech_pvt); +int outbound_channel_answered(private_t * tech_pvt); +//int gsmopen_signaling_write(private_t * tech_pvt, char *msg_to_gsmopen); +#if defined(WIN32) && !defined(__CYGWIN__) +int gsmopen_pipe_read(switch_file_t * pipe, short *buf, int howmany); +int gsmopen_pipe_write(switch_file_t * pipe, short *buf, int howmany); +/* Visual C do not have strsep ? */ +char *strsep(char **stringp, const char *delim); +#else +int gsmopen_pipe_read(int pipe, short *buf, int howmany); +int gsmopen_pipe_write(int pipe, short *buf, int howmany); +#endif /* WIN32 */ +int gsmopen_close_socket(unsigned int fd); +private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling); +int remote_party_is_ringing(private_t * tech_pvt); +int remote_party_is_early_media(private_t * tech_pvt); +//int gsmopen_answer(private_t * tech_pvt, char *id, char *value); +#if 0 +int gsmopen_transfer(private_t * tech_pvt, char *id, char *value); +#endif //0 +int gsmopen_socket_create_and_bind(private_t * tech_pvt, int *which_port); + + + + + +void *gsmopen_do_controldev_thread(void *data); +#ifdef WIN32 +int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed); +#else +int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed); +#endif //WIN32 +int gsmopen_serial_monitor(private_t * tech_pvt); +int gsmopen_serial_sync(private_t * tech_pvt); +int gsmopen_serial_sync_AT(private_t * tech_pvt); +int gsmopen_serial_config(private_t * tech_pvt); +int gsmopen_serial_config_AT(private_t * tech_pvt); + +#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 2) +#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 2) +#define gsmopen_serial_write_AT_expect_noexpcr_tout(P, D, S, T) gsmopen_serial_write_AT_expect1(P, D, S, 0, T) +// 20.5 sec timeout, used for querying the SIM and sending SMSs +#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20) +#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20) +int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data); +int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data); +int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data); +int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data); +int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data); +int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds); +int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds); +int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf); +int gsmopen_serial_read(private_t * tech_pvt); +#ifdef NOTDEF +int gsmopen_serial_getstatus(private_t * tech_pvt); +int gsmopen_serial_hangup(private_t * tech_pvt); +int gsmopen_serial_answer(private_t * tech_pvt); +int gsmopen_serial_answer_AT(private_t * tech_pvt); +int gsmopen_serial_hangup_AT(private_t * tech_pvt); +int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr); +int gsmopen_serial_getstatus_AT(private_t * tech_pvt); +#endif // NOTDEF +#define RESULT_FAILURE 0 +#define RESULT_SUCCESS 1 +int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft); +int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft); +//#define PUSHA_UNLOCKA(x) pthread_cleanup_push(gsmopen_unlocka_log, (void *) x); +//#define POPPA_UNLOCKA(x) pthread_cleanup_pop(0); + +#define PUSHA_UNLOCKA(x) if(option_debug > 100) ERRORA("PUSHA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); +#define POPPA_UNLOCKA(x) if(option_debug > 100) ERRORA("POPPA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); +//#define LOKKA(x) if(option_debug > 100) ERRORA("LOKKA: %p\n", GSMOPEN_P_LOG, (void *)x); +#define LOKKA(x) switch_mutex_lock(x); +#define UNLOCKA(x) switch_mutex_unlock(x); +//#define UNLOCKA(x) if(option_debug > 100) ERRORA("UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); + +#define gsmopen_queue_control(x, y) ERRORA("gsmopen_queue_control: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y); + +#define ast_setstate(x, y) ERRORA("ast_setstate: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y); + +int gsmopen_serial_read(private_t * tech_pvt); +int gsmopen_answer(private_t * tech_pvt); +int gsmopen_serial_answer(private_t * tech_pvt); +int gsmopen_serial_answer_AT(private_t * tech_pvt); +int gsmopen_serial_hangup(private_t * tech_pvt); +int gsmopen_serial_hangup_AT(private_t * tech_pvt); +int gsmopen_hangup(private_t * tech_pvt); +int gsmopen_serial_call(private_t * tech_pvt, char *dstr); +int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr); +int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text); + +#ifdef GSMOPEN_ALSA +int alsa_init(private_t * tech_pvt); +int alsa_shutdown(private_t * tech_pvt); +snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream); +int alsa_write(private_t * tech_pvt, short *data, int datalen); +int alsa_read(private_t * tech_pvt, short *data, int datalen); + +#endif /* GSMOPEN_ALSA */ + + +void gsmopen_store_boost(char *s, double *boost); +int gsmopen_sound_boost(void *data, int samples_num, double boost); +int sms_incoming(private_t * tech_pvt); +int gsmopen_ring(private_t * tech_pvt); + +int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft); +int gsmopen_serial_getstatus_AT(private_t * tech_pvt); + + +#ifdef GSMOPEN_PORTAUDIO + +int gsmopen_portaudio_devlist(private_t *tech_pvt); + +int gsmopen_portaudio_init(private_t *tech_pvt); + +int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen); + +int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen); + + +int gsmopen_portaudio_shutdown(private_t *tech_pvt); + +#endif // GSMOPEN_PORTAUDIO +int dump_event(private_t *tech_pvt); +int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message); +int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message); diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c deleted file mode 120000 index b03564bdd9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen_protocol.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c new file mode 100644 index 0000000000..6834a1d880 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c @@ -0,0 +1,4004 @@ +#include "gsmopen.h" +//#include + +#ifndef NO_GSMLIB +#include +#ifdef WIN32 +#include +#else +#include +#endif +#include +#include + + +using namespace std; +using namespace gsmlib; +#endif// NO_GSMLIB + +#ifdef ASTERISK +#define gsmopen_sleep usleep +#define gsmopen_strncpy strncpy +#define tech_pvt p +extern int gsmopen_debug; +extern char *gsmopen_console_active; +#else /* FREESWITCH */ +#define gsmopen_sleep switch_sleep +#define gsmopen_strncpy switch_copy_string +extern switch_memory_pool_t *gsmopen_module_pool; +extern switch_endpoint_interface_t *gsmopen_endpoint_interface; +#endif /* ASTERISK */ +//int samplerate_gsmopen = SAMPLERATE_GSMOPEN; + +extern int running; +int gsmopen_dir_entry_extension = 1; + +int option_debug = 100; + + +#ifdef WIN32 +#define GSMLIBGIO +#else //WIN32 +#undef GSMLIBGIO +#endif //WIN32 + +#ifdef WIN32 +/***************/ +// from http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ + +#include + +#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 +#else /* */ +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL +#endif /* */ +struct sk_timezone { + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; +int gettimeofday(struct timeval *tv, struct sk_timezone *tz) +{ + FILETIME ft; + unsigned __int64 tmpres = 0; + static int tzflag; + if (NULL != tv) { + GetSystemTimeAsFileTime(&ft); + tmpres |= ft.dwHighDateTime; + tmpres <<= 32; + tmpres |= ft.dwLowDateTime; + + /*converting file time to unix epoch */ + tmpres /= 10; /*convert into microseconds */ + tmpres -= DELTA_EPOCH_IN_MICROSECS; + tv->tv_sec = (long) (tmpres / 1000000UL); + tv->tv_usec = (long) (tmpres % 1000000UL); + } + if (NULL != tz) { + if (!tzflag) { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + return 0; +} + +/***************/ +#endif /* WIN32 */ + +#ifdef GSMOPEN_PORTAUDIO +#include "pablio.h" + +#ifndef GIOVA48 +#define SAMPLES_PER_FRAME 160 +#else // GIOVA48 +#define SAMPLES_PER_FRAME 960 +#endif // GIOVA48 + +int gsmopen_portaudio_devlist(private_t *tech_pvt) +{ + int i, numDevices; + const PaDeviceInfo *deviceInfo; + + numDevices = Pa_GetDeviceCount(); + if (numDevices < 0) { + return 0; + } + for (i = 0; i < numDevices; i++) { + deviceInfo = Pa_GetDeviceInfo(i); + NOTICA + ("Found PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", + GSMOPEN_P_LOG, i, deviceInfo->name, deviceInfo->maxInputChannels, + deviceInfo->maxOutputChannels); + } + + return numDevices; +} + +int gsmopen_portaudio_init(private_t *tech_pvt) +{ + PaError err; + int c; + PaStreamParameters inputParameters, outputParameters; + int numdevices; + const PaDeviceInfo *deviceInfo; + +#ifndef GIOVA48 + setenv("PA_ALSA_PLUGHW", "1", 1); +#endif // GIOVA48 + + err = Pa_Initialize(); + if (err != paNoError) + return err; + + numdevices = gsmopen_portaudio_devlist(tech_pvt); + + if (tech_pvt->portaudiocindex > (numdevices - 1)) { + ERRORA("Portaudio Capture id=%d is out of range: valid id are from 0 to %d\n", + GSMOPEN_P_LOG, tech_pvt->portaudiocindex, (numdevices - 1)); + return -1; + } + + if (tech_pvt->portaudiopindex > (numdevices - 1)) { + ERRORA("Portaudio Playback id=%d is out of range: valid id are from 0 to %d\n", + GSMOPEN_P_LOG, tech_pvt->portaudiopindex, (numdevices - 1)); + return -1; + } + //inputParameters.device = 0; + if (tech_pvt->portaudiocindex != -1) { + inputParameters.device = tech_pvt->portaudiocindex; + } else { + inputParameters.device = Pa_GetDefaultInputDevice(); + } + deviceInfo = Pa_GetDeviceInfo(inputParameters.device); + NOTICA + ("Using INPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", + GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, + deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); + if (deviceInfo->maxInputChannels == 0) { + ERRORA + ("No INPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", + GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, + deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); + return -1; + } + inputParameters.channelCount = 1; + inputParameters.sampleFormat = paInt16; + //inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultHighInputLatency; + inputParameters.suggestedLatency = 0.1; + inputParameters.hostApiSpecificStreamInfo = NULL; + + //outputParameters.device = 3; + if (tech_pvt->portaudiopindex != -1) { + outputParameters.device = tech_pvt->portaudiopindex; + } else { + outputParameters.device = Pa_GetDefaultOutputDevice(); + } + deviceInfo = Pa_GetDeviceInfo(outputParameters.device); + NOTICA + ("Using OUTPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", + GSMOPEN_P_LOG, outputParameters.device, deviceInfo->name, + deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); + if (deviceInfo->maxOutputChannels == 0) { + ERRORA + ("No OUTPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", + GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, + deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); + return -1; + } +#ifndef GIOVA48 + outputParameters.channelCount = 1; +#else // GIOVA48 + outputParameters.channelCount = 2; +#endif // GIOVA48 + outputParameters.sampleFormat = paInt16; + //outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultHighOutputLatency; + outputParameters.suggestedLatency = 0.1; + outputParameters.hostApiSpecificStreamInfo = NULL; + +/* build the pipe that will be polled on by pbx */ + c = pipe(tech_pvt->audiopipe); + if (c) { + ERRORA("Unable to create audio pipe\n", GSMOPEN_P_LOG); + return -1; + } + fcntl(tech_pvt->audiopipe[0], F_SETFL, O_NONBLOCK); + fcntl(tech_pvt->audiopipe[1], F_SETFL, O_NONBLOCK); + + err = +#ifndef GIOVA48 + OpenAudioStream(&tech_pvt->stream, &inputParameters, &outputParameters, 8000, + paClipOff|paDitherOff, SAMPLES_PER_FRAME, 0); + //&tech_pvt->speexecho, &tech_pvt->speexpreprocess, &tech_pvt->owner); + +#else // GIOVA48 + OpenAudioStream(&tech_pvt->stream, &inputParameters, &outputParameters, 48000, + paDitherOff | paClipOff, SAMPLES_PER_FRAME, tech_pvt->audiopipe[1], + &tech_pvt->speexecho, &tech_pvt->speexpreprocess, &tech_pvt->owner); + + +#endif// GIOVA48 + if (err != paNoError) { + ERRORA("Unable to open audio stream: %s\n", GSMOPEN_P_LOG, Pa_GetErrorText(err)); + return -1; + } + +/* the pipe is our audio fd for pbx to poll on */ + tech_pvt->gsmopen_sound_capt_fd = tech_pvt->audiopipe[0]; + + return 0; +} +//int gsmopen_portaudio_write(private_t *tech_pvt, struct ast_frame *f) +int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen) +{ + int samples; +#ifdef GIOVA48 + //short buf[GSMOPEN_FRAME_SIZE * 2]; + short buf[3840]; + short *buf2; + + //ERRORA("1 f->datalen=: %d\n", GSMOPEN_P_LOG, f->datalen); + + + + + memset(buf, '\0', GSMOPEN_FRAME_SIZE *2); + + buf2 = f->data; + + int i=0, a=0; + + for(i=0; i< f->datalen / sizeof(short); i++){ +//stereo, 2 chan 48 -> mono 8 + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + buf[a] = buf2[i]; + a++; + /* + */ + } + f->data = &buf; + f->datalen = f->datalen * 6; + //ERRORA("2 f->datalen=: %d\n", GSMOPEN_P_LOG, f->datalen); + //f->datalen = f->datalen; +#endif // GIOVA48 + + + samples = + WriteAudioStream(tech_pvt->stream, (short *) data, (int) (datalen / sizeof(short)), &tech_pvt->timer_write); + + if (samples != (int) (datalen / sizeof(short))) + ERRORA("WriteAudioStream wrote: %d of %d\n", GSMOPEN_P_LOG, samples, + (int) (datalen / sizeof(short))); + + return samples; +} +//struct ast_frame *gsmopen_portaudio_read(private_t *tech_pvt) +#define AST_FRIENDLY_OFFSET 0 +int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen) +{ +#if 0 + //static struct ast_frame f; + static short __buf[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; + short *buf; + static short __buf2[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; + short *buf2; + int samples; + //char c; + + memset(__buf, '\0', (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); + + buf = __buf + AST_FRIENDLY_OFFSET / 2; + + memset(__buf2, '\0', (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); + + buf2 = __buf2 + AST_FRIENDLY_OFFSET / 2; + +#if 0 + f.frametype = AST_FRAME_NULL; + f.subclass = 0; + f.samples = 0; + f.datalen = 0; + +#ifdef ASTERISK_VERSION_1_6_1 + f.data.ptr = NULL; +#else + f.data = NULL; +#endif /* ASTERISK_VERSION_1_6_1 */ + f.offset = 0; + f.src = gsmopen_type; + f.mallocd = 0; + f.delivery.tv_sec = 0; + f.delivery.tv_usec = 0; +#endif //0 + + //if ((samples = ReadAudioStream(tech_pvt->stream, buf, SAMPLES_PER_FRAME)) == 0) + //if ((samples = ReadAudioStream(tech_pvt->stream, data, datalen/sizeof(short))) == 0) + if (samples = ReadAudioStream(tech_pvt->stream, (short *)data, datalen, &tech_pvt->timer_read) == 0) { + //do nothing + } else { +#ifdef GIOVA48 + int i=0, a=0; + + samples = samples / 6; + for(i=0; i< samples; i++){ + buf2[i] = buf[a]; + a = a + 6; //mono, 1 chan 48 -> 8 + } + buf = buf2; + +#if 0 + /* A real frame */ + f.frametype = AST_FRAME_VOICE; + f.subclass = AST_FORMAT_SLINEAR; + f.samples = GSMOPEN_FRAME_SIZE/6; + f.datalen = GSMOPEN_FRAME_SIZE * 2/6; +#endif //0 +#else// GIOVA48 +#if 0 + /* A real frame */ + f.frametype = AST_FRAME_VOICE; + f.subclass = AST_FORMAT_SLINEAR; + f.samples = GSMOPEN_FRAME_SIZE; + f.datalen = GSMOPEN_FRAME_SIZE * 2; +#endif //0 +#endif// GIOVA48 + +#if 0 +#ifdef ASTERISK_VERSION_1_6_1 + f.data.ptr = buf; +#else + f.data = buf; +#endif /* ASTERISK_VERSION_1_6_1 */ + f.offset = AST_FRIENDLY_OFFSET; + f.src = gsmopen_type; + f.mallocd = 0; +#endif //0 + } + +#if 0 + read(tech_pvt->audiopipe[0], &c, 1); + + return &f; +#endif //0 +#endif //0 + + int samples; + samples = ReadAudioStream(tech_pvt->stream, (short *)data, datalen, &tech_pvt->timer_read); + //WARNINGA("samples=%d\n", GSMOPEN_P_LOG, samples); + + return samples; +} +int gsmopen_portaudio_shutdown(private_t *tech_pvt) +{ + PaError err; + + err = CloseAudioStream(tech_pvt->stream); + + if (err != paNoError) + ERRORA("not able to CloseAudioStream\n", GSMOPEN_P_LOG); + + Pa_Terminate(); + return 0; +} + + + + +#endif // GSMOPEN_PORTAUDIO +#ifndef GSMLIBGIO +int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed) +{ + int fd; + int rt; + struct termios tp; + unsigned int status = 0; + unsigned int flags = TIOCM_DTR; + +/* if there is a file descriptor, close it. But it is probably just an old value, so don't check for close success*/ + fd = tech_pvt->controldevfd; + if (fd) { + close(fd); + } +/* open the serial port */ +//#ifdef __CYGWIN__ + fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); + sleep(1); + close(fd); +//#endif /* __CYGWIN__ */ + fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); + if (fd == -1) { + perror("open error "); + DEBUGA_GSMOPEN("serial error: %s\n", GSMOPEN_P_LOG, strerror(errno)); + tech_pvt->controldevfd = fd; + return -1; + } +/* flush it */ + rt = tcflush(fd, TCIFLUSH); + if (rt == -1) { + ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); + } +/* attributes */ + tp.c_cflag = B0 | CS8 | CLOCAL | CREAD | HUPCL; + tp.c_iflag = IGNPAR; + tp.c_cflag &= ~CRTSCTS; + tp.c_oflag = 0; + tp.c_lflag = 0; + tp.c_cc[VMIN] = 1; + tp.c_cc[VTIME] = 0; +/* set controldevice_speed */ + rt = cfsetispeed(&tp, tech_pvt->controldevice_speed); + if (rt == -1) { + ERRORA("serial error: %s, speed was: %d", GSMOPEN_P_LOG, strerror(errno), tech_pvt->controldevice_speed); + } + rt = cfsetospeed(&tp, tech_pvt->controldevice_speed); + if (rt == -1) { + ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); + } +/* set port attributes */ + if (tcsetattr(fd, TCSADRAIN, &tp) == -1) { + ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); + } + rt = tcsetattr(fd, TCSANOW, &tp); + if (rt == -1) { + ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); + } +#ifndef __CYGWIN__ + ioctl(fd, TIOCMGET, &status); + status |= TIOCM_DTR; /* Set DTR high */ + status &= ~TIOCM_RTS; /* Set RTS low */ + ioctl(fd, TIOCMSET, &status); + ioctl(fd, TIOCMGET, &status); + ioctl(fd, TIOCMBIS, &flags); + flags = TIOCM_RTS; + ioctl(fd, TIOCMBIC, &flags); + ioctl(fd, TIOCMGET, &status); +#else /* __CYGWIN__ */ + ioctl(fd, TIOCMGET, &status); + status |= TIOCM_DTR; /* Set DTR high */ + status &= ~TIOCM_RTS; /* Set RTS low */ + ioctl(fd, TIOCMSET, &status); +#endif /* __CYGWIN__ */ + tech_pvt->controldevfd = fd; + DEBUGA_GSMOPEN("Syncing Serial, fd=%d, protocol=%d\n", GSMOPEN_P_LOG, fd, tech_pvt->controldevprotocol); + rt = gsmopen_serial_sync(tech_pvt); + if (rt == -1) { + ERRORA("Serial init error\n", GSMOPEN_P_LOG); + return -1; + } + return (fd); +} +#else //GSMLIBGIO +#ifdef WIN32 +int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed) +#else +int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed) +#endif //WIN32 +{ + int i; + string ciapa; + SMSMessageRef sms; + char content2[1000]; + int size; + +#ifdef WIN32 + Ref port = new Win32SerialPort((string) tech_pvt->controldevice_name, 38400); +#else + //Ref port = new UnixSerialPort((string)argv[1], B38400); + Ref < Port > port = new UnixSerialPort((string) tech_pvt->controldevice_name, B115200); +#endif + MeTa m(port); + + //cout << "Creating GsmAt object" << endl; + Ref gsmat = new GsmAt(m); + + //cout << "Using GsmAt object" << endl; + //cout << gsmat->chat("AT", "OK", false, false) << endl; + //cout << gsmat->chat("D3472665618;") << endl; + gsmat->putLine("AT+cgmm", true); + for (i = 0; i < 4; i++) { + ciapa = gsmat->getLine(); + //cout << "PRESO: |||" << ciapa << "|||" << endl; + NOTICA("PRESO %d |||%s|||\n", GSMOPEN_P_LOG, i, ciapa.c_str()); + //gsmopen_sleep(5000); + } + + sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 + NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 + NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 + NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 + NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 + NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + +#if 0 + size = MultiByteToWideChar(CP_OEMCP, 0, username, strlen(username)+1, UserName, 0); + UserName=(wchar_t*)GlobalAlloc(GME­ M_ZEROINIT, size); + ret = MultiByteToWideChar(CP_OEMCP, 0, username, strlen(username)+1, UserName, size); + if(ret == 0) + getError(GetLastError()); +#endif //0 + return (-1); +} + +#endif //GSMLIBGIO + + +int gsmopen_serial_read(private_t * tech_pvt) +{ + if (tech_pvt->controldevprotocol == PROTOCOL_AT) + return gsmopen_serial_read_AT(tech_pvt, 0, 100000, 0, NULL, 1); // a 10th of a second timeout +#ifdef GSMOPEN_FBUS2 + if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) + return gsmopen_serial_read_FBUS2(tech_pvt); +#endif /* GSMOPEN_FBUS2 */ +#ifdef GSMOPEN_CVM + if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) + return gsmopen_serial_read_CVM_BUSMAIL(tech_pvt); +#endif /* GSMOPEN_CVM */ + return -1; +} + + +int gsmopen_serial_sync(private_t * tech_pvt) +{ + if (tech_pvt->controldevprotocol == PROTOCOL_AT) + return gsmopen_serial_sync_AT(tech_pvt); +#ifdef GSMOPEN_FBUS2 + if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) + return gsmopen_serial_sync_FBUS2(tech_pvt); +#endif /* GSMOPEN_FBUS2 */ +#ifdef GSMOPEN_CVM + if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) + return gsmopen_serial_sync_CVM_BUSMAIL(tech_pvt); +#endif /* GSMOPEN_CVM */ + + return -1; +} + +int gsmopen_serial_config(private_t * tech_pvt) +{ +#ifndef NO_GSMLIB + SMSMessageRef sms; + char content2[1000]; + //sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 + //sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 + //sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 + sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 + //sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 + //NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + + memset(content2, '\0', sizeof(content2)); + if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { + iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); + } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { + ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, + sizeof(content2)); + } else { + ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + + } + //NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + //NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); +#endif// NO_GSMLIB + + if (tech_pvt->controldevprotocol == PROTOCOL_AT) + return gsmopen_serial_config_AT(tech_pvt); +#ifdef GSMOPEN_FBUS2 + if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) + return gsmopen_serial_config_FBUS2(tech_pvt); +#endif /* GSMOPEN_FBUS2 */ +#ifdef GSMOPEN_CVM + if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) + return gsmopen_serial_config_CVM_BUSMAIL(tech_pvt); +#endif /* GSMOPEN_CVM */ + + return -1; +} + +int gsmopen_serial_config_AT(private_t * tech_pvt) +{ + int res; + char at_command[5]; + int i; + +/* initial_pause? */ + if (tech_pvt->at_initial_pause) { + DEBUGA_GSMOPEN("sleeping for %d usec\n", GSMOPEN_P_LOG, tech_pvt->at_initial_pause); + gsmopen_sleep(tech_pvt->at_initial_pause); + } + +/* go until first empty preinit string, or last preinit string */ + while (1) { + + if (strlen(tech_pvt->at_preinit_1)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_preinit_2)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_preinit_3)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_preinit_4)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_preinit_5)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect); + } + } else { + break; + } + + break; + } + +/* after_preinit_pause? */ + if (tech_pvt->at_after_preinit_pause) { + DEBUGA_GSMOPEN("sleeping for %d usec\n", GSMOPEN_P_LOG, tech_pvt->at_after_preinit_pause); + gsmopen_sleep(tech_pvt->at_after_preinit_pause); + } + + /* phone, brother, art you alive? */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT"); + if (res) { + ERRORA("no response to AT\n", GSMOPEN_P_LOG); + return -1; + } + /* for motorola, bring it back to "normal" mode if it happens to be in another mode */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+mode=0"); + if (res) { + DEBUGA_GSMOPEN("AT+mode=0 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", GSMOPEN_P_LOG); + } + gsmopen_sleep(50000); + /* for motorola end */ + + /* reset AT configuration to phone default */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "ATZ"); + if (res) { + DEBUGA_GSMOPEN("ATZ failed\n", GSMOPEN_P_LOG); + } + + /* disable AT command echo */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "ATE0"); + if (res) { + DEBUGA_GSMOPEN("ATE0 failed\n", GSMOPEN_P_LOG); + } + + /* disable extended error reporting */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMEE=0"); + if (res) { + DEBUGA_GSMOPEN("AT+CMEE failed\n", GSMOPEN_P_LOG); + } + + /* various phone manufacturer identifier */ + for (i = 0; i < 10; i++) { + memset(at_command, 0, sizeof(at_command)); + sprintf(at_command, "ATI%d", i); + res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); + if (res) { + DEBUGA_GSMOPEN("ATI%d command failed, continue\n", GSMOPEN_P_LOG, i); + } + } + + /* phone manufacturer */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMI"); + if (res) { + DEBUGA_GSMOPEN("AT+CGMI failed\n", GSMOPEN_P_LOG); + } + + /* phone model */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMM"); + if (res) { + DEBUGA_GSMOPEN("AT+CGMM failed\n", GSMOPEN_P_LOG); + } + + /* signal network registration with a +CREG unsolicited msg */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG=1"); + if (res) { + DEBUGA_GSMOPEN("AT+CREG=1 failed\n", GSMOPEN_P_LOG); + tech_pvt->network_creg_not_supported = 1; + } + if(!tech_pvt->network_creg_not_supported){ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG?"); + if (res) { + DEBUGA_GSMOPEN("AT+CREG? failed\n", GSMOPEN_P_LOG); + } + } + /* query signal strength */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSQ"); + if (res) { + DEBUGA_GSMOPEN("AT+CSQ failed\n", GSMOPEN_P_LOG); + } + /* IMEI */ + tech_pvt->requesting_imei = 1; + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+GSN"); + tech_pvt->requesting_imei = 0; + if (res) { + DEBUGA_GSMOPEN("AT+GSN failed\n", GSMOPEN_P_LOG); + tech_pvt->requesting_imei = 1; + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGSN"); + tech_pvt->requesting_imei = 0; + if (res) { + DEBUGA_GSMOPEN("AT+CGSN failed\n", GSMOPEN_P_LOG); + } + } + /* IMSI */ + tech_pvt->requesting_imsi = 1; + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CIMI"); + tech_pvt->requesting_imsi = 0; + if (res) { + DEBUGA_GSMOPEN("AT+CIMI failed\n", GSMOPEN_P_LOG); + } + + /* signal incoming SMS with a +CMTI unsolicited msg */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=3,1,0,0,0"); + if (res) { + DEBUGA_GSMOPEN("AT+CNMI=3,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); + tech_pvt->sms_cnmi_not_supported = 1; + tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config + } + /* what is the Message Center address (number) to which the SMS has to be sent? */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCA?"); + if (res) { + DEBUGA_GSMOPEN("AT+CSCA? failed, continue\n", GSMOPEN_P_LOG); + } + /* what is the Message Format of SMSs? */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF?"); + if (res) { + DEBUGA_GSMOPEN("AT+CMGF? failed, continue\n", GSMOPEN_P_LOG); + } +#ifdef NO_GSMLIB + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); + if (res) { + ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); + } + tech_pvt->sms_pdu_not_supported = 1; +#else // NO_GSMLIB + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); + if (res) { + WARNINGA("Error setting SMS sending mode to PDU on the cellphone, falling back to TEXT mode. Continuing\n", GSMOPEN_P_LOG); + tech_pvt->sms_pdu_not_supported = 1; + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); + if (res) { + ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); + } + } +#endif // NO_GSMLIB + /* what is the Charset of SMSs? */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS?"); + if (res) { + DEBUGA_GSMOPEN("AT+CSCS? failed, continue\n", GSMOPEN_P_LOG); + } + + tech_pvt->no_ucs2 = 0; + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); + if (res) { + WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", GSMOPEN_P_LOG); + tech_pvt->no_ucs2 = 1; + } + + if (tech_pvt->no_ucs2) { + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); + if (res) { + WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,16"); //"flash", class 0 sms 7 bit + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,0"); //normal, 7 bit message + if (res) { + WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); + } + } else { + //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,20"); //"flash", class 0 sms 16 bit unicode + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message + if (res) { + WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); + } + } + + /* is the unsolicited reporting of mobile equipment event supported? */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMER=?"); + if (res) { + DEBUGA_GSMOPEN("AT+CMER=? failed, continue\n", GSMOPEN_P_LOG); + } + /* request unsolicited reporting of mobile equipment indicators' events, to be screened by categories reported by +CIND=? */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMER=3,0,0,1"); + if (res) { + DEBUGA_GSMOPEN("AT+CMER=? failed, continue\n", GSMOPEN_P_LOG); + } + + /* is the solicited reporting of mobile equipment indications supported? */ + + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CIND=?"); + if (res) { + DEBUGA_GSMOPEN("AT+CIND=? failed, continue\n", GSMOPEN_P_LOG); + } + + /* is the unsolicited reporting of call monitoring supported? sony-ericsson specific */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT*ECAM=?"); + if (res) { + DEBUGA_GSMOPEN("AT*ECAM=? failed, continue\n", GSMOPEN_P_LOG); + } + /* enable the unsolicited reporting of call monitoring. sony-ericsson specific */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT*ECAM=1"); + if (res) { + DEBUGA_GSMOPEN("AT*ECAM=1 failed, continue\n", GSMOPEN_P_LOG); + tech_pvt->at_has_ecam = 0; + } else { + tech_pvt->at_has_ecam = 1; + } + + /* disable unsolicited signaling of call list */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CLCC=0"); + if (res) { + DEBUGA_GSMOPEN("AT+CLCC=0 failed, continue\n", GSMOPEN_P_LOG); + tech_pvt->at_has_clcc = 0; + } else { + tech_pvt->at_has_clcc = 1; + } + + /* give unsolicited caller id when incoming call */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CLIP=1"); + if (res) { + DEBUGA_GSMOPEN("AT+CLIP failed, continue\n", GSMOPEN_P_LOG); + } + /* for motorola */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+MCST=1"); /* motorola call control codes + (to know when call is disconnected (they + don't give you "no carrier") */ + if (res) { + DEBUGA_GSMOPEN("AT+MCST=1 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", GSMOPEN_P_LOG); + } + /* for motorola end */ + +/* go until first empty postinit string, or last postinit string */ + while (1) { + + if (strlen(tech_pvt->at_postinit_1)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_postinit_2)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_postinit_3)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_postinit_4)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect); + } + } else { + break; + } + + if (strlen(tech_pvt->at_postinit_5)) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect); + if (res) { + DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect); + } + } else { + break; + } + + break; + } + + return 0; +} + + +int gsmopen_serial_sync_AT(private_t * tech_pvt) +{ + gsmopen_sleep(10000); /* 10msec */ + time(&tech_pvt->gsmopen_serial_synced_timestamp); + return 0; +} +int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf) +{ + int select_err = 1; + int res; + fd_set read_fds; + struct timeval timeout; + char tmp_answer[AT_BUFSIZ]; + char tmp_answer2[AT_BUFSIZ]; + char *tmp_answer_ptr; + char *last_line_ptr; + int i = 0; + int read_count = 0; + int la_counter = 0; + int at_ack = -1; + int la_read = 0; + + if(!running || !tech_pvt->running){ + return -1; + } + + FD_ZERO(&read_fds); + FD_SET(tech_pvt->controldevfd, &read_fds); + + //NOTICA (" INSIDE this gsmopen_serial_device %s \n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tmp_answer_ptr = tmp_answer; + memset(tmp_answer, 0, sizeof(char) * AT_BUFSIZ); + + timeout.tv_sec = timeout_sec; + timeout.tv_usec = timeout_usec; + PUSHA_UNLOCKA(tech_pvt->controldev_lock); + LOKKA(tech_pvt->controldev_lock); + + while ((!tech_pvt->controldev_dead) && ((select_err = select(tech_pvt->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0)) { + char *token_ptr; + timeout.tv_sec = timeout_sec; //reset the timeout, linux modify it + timeout.tv_usec = timeout_usec; //reset the timeout, linux modify it + read_count = read(tech_pvt->controldevfd, tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer)); + + if (read_count == 0) { + ERRORA + ("read 0 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running=0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active=0; + tech_pvt->name[0]='\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + return -1; + } + + if (option_debug > 90) { + //DEBUGA_GSMOPEN("1 read %d bytes, --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer_ptr); + //DEBUGA_GSMOPEN("2 read %d bytes, --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer); + } + tmp_answer_ptr = tmp_answer_ptr + read_count; + + + la_counter = 0; + memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ); + strcpy(tmp_answer2, tmp_answer); + if ((token_ptr = strtok(tmp_answer2, "\n\r"))) { + last_line_ptr = token_ptr; + strncpy(tech_pvt->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); + if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { + WARNINGA + ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", + GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); + } + la_counter++; + while ((token_ptr = strtok(NULL, "\n\r"))) { + last_line_ptr = token_ptr; + strncpy(tech_pvt->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); + if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { + WARNINGA + ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", + GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); + } + la_counter++; + } + } else { + last_line_ptr = tmp_answer; + } + + if (expected_string && !expect_crlf) { + DEBUGA_GSMOPEN + ("last_line_ptr=|%s|, expected_string=|%s|, expect_crlf=%d, memcmp(last_line_ptr, expected_string, strlen(expected_string)) = %d\n", + GSMOPEN_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr, expected_string, strlen(expected_string))); + } + + if (expected_string && !expect_crlf && !memcmp(last_line_ptr, expected_string, strlen(expected_string)) + ) { + strncpy(tech_pvt->line_array.result[la_counter], last_line_ptr, AT_MESG_MAX_LENGTH); + // match expected string -> accept it withtout CRLF + la_counter++; + + } + /* if the last line read was not a complete line, we'll read the rest in the future */ + else if (tmp_answer[strlen(tmp_answer) - 1] != '\r' && tmp_answer[strlen(tmp_answer) - 1] != '\n') + la_counter--; + + /* let's list the complete lines read so far, without re-listing the lines that has yet been listed */ + if (option_debug > 1) { + for (i = la_read; i < la_counter; i++) + DEBUGA_GSMOPEN("Read line %d: |%s|\n", GSMOPEN_P_LOG, i, tech_pvt->line_array.result[i]); + } + + /* let's interpret the complete lines read so far (WITHOUT looking for OK, ERROR, and EXPECTED_STRING), without re-interpreting the lines that has been yet interpreted, so we're sure we don't miss anything */ + for (i = la_read; i < la_counter; i++) { + + if ((strcmp(tech_pvt->line_array.result[i], "RING") == 0)) { + /* with first RING we wait for callid */ + gettimeofday(&(tech_pvt->ringtime), NULL); + /* give CALLID (+CLIP) a chance, wait for the next RING before answering */ + if (tech_pvt->phone_callflow == CALLFLOW_INCOMING_RING) { + /* we're at the second ring, set the interface state, will be answered by gsmopen_do_monitor */ + DEBUGA_GSMOPEN("|%s| got second RING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->interface_state = GSMOPEN_STATE_RING; + } else { + /* we're at the first ring, so there is no CALLID yet thus clean the previous one + just in case we don't receive the caller identification in this new call */ + memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); + memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); + /* only send AT+CLCC? if the device previously reported its support */ + if (tech_pvt->at_has_clcc != 0) { + /* we're at the first ring, try to get CALLID (with +CLCC) */ + DEBUGA_GSMOPEN("|%s| got first RING, sending AT+CLCC?\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + res = gsmopen_serial_write_AT_noack(tech_pvt, "AT+CLCC?"); + if (res) { + ERRORA("AT+CLCC? (call list) was not correctly sent to the phone\n", GSMOPEN_P_LOG); + } + } else { + DEBUGA_GSMOPEN("|%s| got first RING, but not sending AT+CLCC? as this device " + "seems not to support\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + } + tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CLCC", 5) == 0)) { + int commacount = 0; + int a = 0; + int b = 0; + int c = 0; + /* with clcc we wait for clip */ + memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); + memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); + + for (a = 0; a < strlen(tech_pvt->line_array.result[i]); a++) { + + if (tech_pvt->line_array.result[i][a] == ',') { + commacount++; + } + if (commacount == 5) { + if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { + tech_pvt->callid_number[b] = tech_pvt->line_array.result[i][a]; + b++; + } + } + if (commacount == 7) { + if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { + tech_pvt->callid_name[c] = tech_pvt->line_array.result[i][a]; + c++; + } + } + } + + tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; + DEBUGA_GSMOPEN("|%s| CLCC CALLID: name is %s, number is %s\n", GSMOPEN_P_LOG, + tech_pvt->line_array.result[i], + tech_pvt->callid_name[0] ? tech_pvt->callid_name : "not available", + tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available"); + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CLIP", 5) == 0)) { + int commacount = 0; + int a = 0; + int b = 0; + int c = 0; + /* with CLIP, we want to answer right away */ + memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); + memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); + + + for (a = 7; a < strlen(tech_pvt->line_array.result[i]); a++) { + if (tech_pvt->line_array.result[i][a] == ',') { + commacount++; + } + if (commacount == 0) { + if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { + tech_pvt->callid_number[b] = tech_pvt->line_array.result[i][a]; + b++; + } + } + if (commacount == 4) { + if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { + tech_pvt->callid_name[c] = tech_pvt->line_array.result[i][a]; + c++; + } + } + } + + if (tech_pvt->interface_state != GSMOPEN_STATE_RING) { + gettimeofday(&(tech_pvt->call_incoming_time), NULL); + DEBUGA_GSMOPEN("GSMOPEN_STATE_RING call_incoming_time.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec); + + } + + tech_pvt->interface_state = GSMOPEN_STATE_RING; + tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; + DEBUGA_GSMOPEN("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", GSMOPEN_P_LOG, + tech_pvt->line_array.result[i], + (strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) ? tech_pvt->callid_name : "not available", + strlen(tech_pvt->callid_number) ? tech_pvt->callid_number : "not available"); + + if (!strlen(tech_pvt->callid_number)) { + strcpy(tech_pvt->callid_number, "not available"); + } + + if (!strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) { + strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)); + //strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)) ; + snprintf(tech_pvt->callid_name, sizeof(tech_pvt->callid_name), "GSMopen: %s", tech_pvt->callid_number); + } + + DEBUGA_GSMOPEN("|%s| CLIP INCOMING CALLID: NOW name is %s, number is %s\n", GSMOPEN_P_LOG, + tech_pvt->line_array.result[i], tech_pvt->callid_name, tech_pvt->callid_number); + } + + if ((strcmp(tech_pvt->line_array.result[i], "BUSY") == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_LINEBUSY\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + //if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) { + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) { + //ast_setstate(tech_pvt->owner, GSMOPEN_STATE_BUSY); + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_BUSY); + //cicopet + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + tech_pvt->interface_state = GSMOPEN_STATE_DOWN; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if (session) { + channel = switch_core_session_get_channel(session); + //gsmopen_hangup(tech_pvt); + switch_core_session_rwunlock(session); + switch_channel_hangup(channel, SWITCH_CAUSE_NONE); + } + // + //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + + } else { + ERRORA("Why BUSY now?\n", GSMOPEN_P_LOG); + } + } + if ((strcmp(tech_pvt->line_array.result[i], "NO ANSWER") == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_NOANSWER; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOANSWER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NO_ANSWER; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } else { + ERRORA("Why NO ANSWER now?\n", GSMOPEN_P_LOG); + } + } + if ((strcmp(tech_pvt->line_array.result[i], "NO CARRIER") == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { + //cicopet + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + tech_pvt->interface_state = GSMOPEN_STATE_DOWN; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if (session) { + channel = switch_core_session_get_channel(session); + //gsmopen_hangup(tech_pvt); + switch_core_session_rwunlock(session); + switch_channel_hangup(channel, SWITCH_CAUSE_NONE); + } + // + //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } else { + ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); + } + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CBC:", 5) == 0)) { + int power_supply, battery_strenght, err; + + power_supply = battery_strenght = 0; + + err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &power_supply, &battery_strenght); + if (err < 2) { + DEBUGA_GSMOPEN("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + err = sscanf(&tech_pvt->line_array.result[i][5], "%d,%d", &power_supply, &battery_strenght); + DEBUGA_GSMOPEN("|%s| +CBC: Powered by %s, battery strenght=%d\n", GSMOPEN_P_LOG, + tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght); + + } + + if (err < 2) { + DEBUGA_GSMOPEN("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + else { + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| +CBC: Powered by %s, battery strenght=%d\n", GSMOPEN_P_LOG, + tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght); + if (!power_supply) { + if (battery_strenght < 10) { + ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else if (battery_strenght < 20) { + WARNINGA("|%s| BATTERY LOW\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + } + + } + } + + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CSQ:", 5) == 0)) { + int signal_quality, ber, err; + + signal_quality = ber = 0; + + err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &signal_quality, &ber); + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], signal_quality, ber); + if (err < 2) { + ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else { + if (signal_quality < 11 || signal_quality == 99) { + ERRORA + ("|%s| CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna\n", + GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->got_signal=0; + alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna"); + } else if (signal_quality < 15) { + WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->got_signal=1; + alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "CELLPHONE GETS SIGNAL LOW"); + } else { + tech_pvt->got_signal=2; + } + + } + + } + if ((strncmp(tech_pvt->line_array.result[i], "+CREG:", 6) == 0)) { + int n, stat, err; + + n = stat = 0; + + err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &n, &stat); + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| +CREG: Display: %d, Registration=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], n, stat); + if (err < 2) { + WARNINGA("|%s| is not formatted as: |+CREG: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + if (stat==0) { + ERRORA + ("|%s| CELLPHONE is not registered to network, consider to move it or additional antenna\n", + GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->not_registered=1; + tech_pvt->home_network_registered=0; + tech_pvt->roaming_registered=0; + alarm_event(tech_pvt, ALARM_NO_NETWORK_REGISTRATION, "CELLPHONE is not registered to network, consider to move it or additional antenna"); + } else if (stat==1) { + DEBUGA_GSMOPEN("|%s| CELLPHONE is registered to the HOME network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->not_registered=0; + tech_pvt->home_network_registered=1; + tech_pvt->roaming_registered=0; + }else { + ERRORA("|%s| CELLPHONE is registered to a ROAMING network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->not_registered=0; + tech_pvt->home_network_registered=0; + tech_pvt->roaming_registered=1; + alarm_event(tech_pvt, ALARM_ROAMING_NETWORK_REGISTRATION, "CELLPHONE is registered to a ROAMING network"); + } + + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CMGW:", 6) == 0)) { + int err; + + err = sscanf(&tech_pvt->line_array.result[i][7], "%s", tech_pvt->at_cmgw); + DEBUGA_GSMOPEN("|%s| +CMGW: %s\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], tech_pvt->at_cmgw); + if (err < 1) { + ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + } + + /* at_call_* are unsolicited messages sent by the modem to signal us about call processing activity and events */ + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_idle) == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + DEBUGA_GSMOPEN("just received a remote HANGUP\n", GSMOPEN_P_LOG); + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + DEBUGA_GSMOPEN("just sent GSMOPEN_CONTROL_HANGUP\n", GSMOPEN_P_LOG); + } + + tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { + //cicopet + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + tech_pvt->interface_state = GSMOPEN_STATE_DOWN; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if (session) { + channel = switch_core_session_get_channel(session); + //gsmopen_hangup(tech_pvt); + switch_core_session_rwunlock(session); + switch_channel_hangup(channel, SWITCH_CAUSE_NONE); + } + // + //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } else { + ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); + } + + + + + + + + + + + + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_incoming) == 0)) { + + //char list_command[64]; + + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_INCOMING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + if (tech_pvt->phone_callflow != CALLFLOW_CALL_INCOMING && tech_pvt->phone_callflow != CALLFLOW_INCOMING_RING) { + //mark the time of CALLFLOW_CALL_INCOMING + gettimeofday(&(tech_pvt->call_incoming_time), NULL); + tech_pvt->phone_callflow = CALLFLOW_CALL_INCOMING; + DEBUGA_GSMOPEN("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec); + + } + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_active) == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_ACTIVE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + if (tech_pvt->interface_state == CALLFLOW_CALL_DIALING || tech_pvt->interface_state == CALLFLOW_STATUS_EARLYMEDIA) { + DEBUGA_PBX("just received a remote ANSWER\n", GSMOPEN_P_LOG); + if (tech_pvt->phone_callflow == GSMOPEN_STATE_UP) { + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_RINGING); + DEBUGA_PBX("just sent GSMOPEN_CONTROL_RINGING\n", GSMOPEN_P_LOG); + DEBUGA_PBX("going to send GSMOPEN_CONTROL_ANSWER\n", GSMOPEN_P_LOG); + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); + tech_pvt->interface_state = CALLFLOW_CALL_REMOTEANSWER; + DEBUGA_PBX("just sent GSMOPEN_CONTROL_ANSWER\n", GSMOPEN_P_LOG); + } + } else { + } + //tech_pvt->interface_state = GSMOPEN_STATE_UP; + //DEBUGA_PBX("just interface_state UP\n", GSMOPEN_P_LOG); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_calling) == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_DIALING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_failed) == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_FAILED; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_FAILED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CSCA:", 6) == 0)) { //TODO SMS FIXME in config! + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| +CSCA: Message Center Address!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CMGF:", 6) == 0)) { //TODO SMS FIXME in config! + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| +CMGF: Message Format!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CMTI:", 6) == 0)) { //TODO SMS FIXME in config! + int err; + int pos; + + //FIXME all the following commands in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +CMTI: Incoming SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + err = sscanf(&tech_pvt->line_array.result[i][12], "%d", &pos); + if (err < 1) { + ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else { + DEBUGA_GSMOPEN("|%s| +CMTI: Incoming SMS in position: %d!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], pos); + tech_pvt->unread_sms_msg_id = pos; + gsmopen_sleep(1000); + + if (tech_pvt->unread_sms_msg_id) { + char at_command[256]; + + if (tech_pvt->no_ucs2 == 0) { + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); + if (res) { + ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); + //memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); + } + } + + memset(at_command, 0, sizeof(at_command)); + sprintf(at_command, "AT+CMGR=%d", tech_pvt->unread_sms_msg_id); + //memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); + + tech_pvt->reading_sms_msg = 1; + res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); + tech_pvt->reading_sms_msg = 0; + if (res) { + ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); + } + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); + if (res) { + ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + memset(at_command, 0, sizeof(at_command)); + sprintf(at_command, "AT+CMGD=%d", tech_pvt->unread_sms_msg_id); /* delete the message */ + tech_pvt->unread_sms_msg_id = 0; + res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); + if (res) { + ERRORA("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); + } + + res = sms_incoming(tech_pvt); + +#if 0 + if (strlen(tech_pvt->sms_message)) { + //FIXME manager_event(EVENT_FLAG_SYSTEM, "GSMOPENincomingsms", + //FIXME "Interface: %s\r\nSMS_Message: %s\r\n", tech_pvt->name, + //FIXME tech_pvt->sms_message); + + res = sms_incoming(tech_pvt, tech_pvt->sms_message); + + if (strlen(tech_pvt->sms_receiving_program)) { + int fd1[2]; + pid_t pid1; + char *arg1[] = { tech_pvt->sms_receiving_program, (char *) NULL }; + int i; + + DEBUGA_GSMOPEN("incoming SMS message:>>>%s<<<\n", GSMOPEN_P_LOG, tech_pvt->sms_message); + res = pipe(fd1); + pid1 = fork(); + + if (pid1 == 0) { //child + int err; + + dup2(fd1[0], 0); // Connect stdin to pipe output + close(fd1[1]); // close input pipe side + close(tech_pvt->controldevfd); + setsid(); //session id + err = execvp(arg1[0], arg1); //exec our program, with stdin connected to pipe output + if (err) { + ERRORA + ("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n", + GSMOPEN_P_LOG, tech_pvt->sms_receiving_program, err, strerror(errno), tech_pvt->sms_message); + } + close(fd1[0]); // close output pipe side + } +//starting here continue the parent + close(fd1[0]); // close output pipe side + // write the msg on the pipe input + for (i = 0; i < strlen(tech_pvt->sms_message); i++) { + res = write(fd1[1], &tech_pvt->sms_message[i], 1); + } + close(fd1[1]); // close pipe input, let our program know we've finished + } else { + ERRORA + ("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n", + GSMOPEN_P_LOG, tech_pvt->sms_message); + } + } +#endif //0 +#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself + if (tech_pvt->phone_callflow == CALLFLOW_CALL_IDLE && tech_pvt->interface_state == GSMOPEN_STATE_DOWN && tech_pvt->owner == NULL) { + /* we're not in a call, neither calling */ + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\""); + if (res) { + ERRORA("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + } +#endif + } //unread_msg_id + + } //CMTI well formatted + + } //CMTI + + if ((strncmp(tech_pvt->line_array.result[i], "+MMGL:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! + int err = 0; + //int unread_msg_id=0; + + if (option_debug) + DEBUGA_GSMOPEN("|%s| +MMGL: Listing Motorola SMSs!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + err = sscanf(&tech_pvt->line_array.result[i][7], "%d", &tech_pvt->unread_sms_msg_id); + if (err < 1) { + ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + } + if ((strncmp(tech_pvt->line_array.result[i], "+CMGL:", 6) == 0)) { //TODO SMS FIXME in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +CMGL: Listing SMSs!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + if ((strncmp(tech_pvt->line_array.result[i], "+MMGR:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +MMGR: Reading Motorola SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->reading_sms_msg) + tech_pvt->reading_sms_msg++; + } + if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO U", 13) == 0)) { //TODO SMS FIXME in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +CMGR: Reading stored UNSENT SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO S", 13) == 0)) { //TODO SMS FIXME in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +CMGR: Reading stored SENT SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC R", 13) == 0)) { //TODO SMS FIXME in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +CMGR: Reading received READ SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC U", 13) == 0)) { //TODO SMS FIXME in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +CMGR: Reading received UNREAD SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->reading_sms_msg) + tech_pvt->reading_sms_msg++; + } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: ", 6) == 0)) { //TODO SMS FIXME in config! + if (option_debug) + DEBUGA_GSMOPEN("|%s| +CMGR: Reading SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->reading_sms_msg) + tech_pvt->reading_sms_msg++; + } + + + if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 17") == 0)) { /* motorola call processing unsolicited messages */ + tech_pvt->phone_callflow = CALLFLOW_CALL_INFLUX; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_INFLUX\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 68") == 0)) { /* motorola call processing unsolicited messages */ + tech_pvt->phone_callflow = CALLFLOW_CALL_NOSERVICE; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOSERVICE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + } + if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 70") == 0)) { /* motorola call processing unsolicited messages */ + tech_pvt->phone_callflow = CALLFLOW_CALL_OUTGOINGRESTRICTED; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + } + if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 72") == 0)) { /* motorola call processing unsolicited messages */ + tech_pvt->phone_callflow = CALLFLOW_CALL_SECURITYFAIL; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_SECURITYFAIL\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + } + + if ((strncmp(tech_pvt->line_array.result[i], "+CPBR", 5) == 0)) { /* phonebook stuff begins */ + + if (tech_pvt->phonebook_querying) { /* probably phonebook struct begins */ + int err, first_entry, last_entry, number_lenght, text_lenght; + + if (option_debug) + DEBUGA_GSMOPEN("phonebook struct: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + err = sscanf(&tech_pvt->line_array.result[i][8], "%d-%d),%d,%d", &first_entry, &last_entry, &number_lenght, &text_lenght); + if (err < 4) { + + err = sscanf(&tech_pvt->line_array.result[i][7], "%d-%d,%d,%d", &first_entry, &last_entry, &number_lenght, &text_lenght); + } + + if (err < 4) { + ERRORA + ("phonebook struct: |%s| is nor formatted as: |+CPBR: (1-750),40,14| neither as: |+CPBR: 1-750,40,14|\n", + GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else { + + if (option_debug) + DEBUGA_GSMOPEN + ("First entry: %d, last entry: %d, phone number max lenght: %d, text max lenght: %d\n", + GSMOPEN_P_LOG, first_entry, last_entry, number_lenght, text_lenght); + tech_pvt->phonebook_first_entry = first_entry; + tech_pvt->phonebook_last_entry = last_entry; + tech_pvt->phonebook_number_lenght = number_lenght; + tech_pvt->phonebook_text_lenght = text_lenght; + } + + } else { /* probably phonebook entry begins */ + + if (tech_pvt->phonebook_listing) { + int err, entry_id, entry_type; + + char entry_number[256]; + char entry_text[256]; + + if (option_debug) + DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + err = + sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, + entry_text); + if (err < 4) { + ERRORA + ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", + GSMOPEN_P_LOG, err, tech_pvt->line_array.result[i]); + } else { + //TODO: sanitize entry_text + if (option_debug) + DEBUGA_GSMOPEN("Number: %s, Text: %s, Type: %d\n", GSMOPEN_P_LOG, entry_number, entry_text, entry_type); + /* write entry in phonebook file */ + if (tech_pvt->phonebook_writing_fp) { + gsmopen_dir_entry_extension++; + + fprintf(tech_pvt->phonebook_writing_fp, + "%s => ,%sSKO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", + entry_number, entry_text, "no", + tech_pvt->gsmopen_dir_entry_extension_prefix, "2", gsmopen_dir_entry_extension, "yes", "not_specified"); + fprintf(tech_pvt->phonebook_writing_fp, + "%s => ,%sDO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", + entry_number, entry_text, "no", + tech_pvt->gsmopen_dir_entry_extension_prefix, "3", gsmopen_dir_entry_extension, "yes", "not_specified"); + } + } + + } + + if (tech_pvt->phonebook_listing_received_calls) { + int err, entry_id, entry_type; + + char entry_number[256] = ""; + char entry_text[256] = ""; + + if (option_debug) + DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + err = + sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, + entry_text); + if (err < 1) { //we match only on the progressive id, maybe the remote party has not sent its number, and/or there is no corresponding text entry in the phone directory + ERRORA + ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", + GSMOPEN_P_LOG, err, tech_pvt->line_array.result[i]); + } else { + //TODO: sanitize entry_text + + if (option_debug) + DEBUGA_GSMOPEN("Number: %s, Text: %s, Type: %d\n", GSMOPEN_P_LOG, entry_number, entry_text, entry_type); + memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); + memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); + strncpy(tech_pvt->callid_name, entry_text, sizeof(tech_pvt->callid_name)); + strncpy(tech_pvt->callid_number, entry_number, sizeof(tech_pvt->callid_number)); + if (option_debug) + DEBUGA_GSMOPEN("incoming callid: Text: %s, Number: %s\n", GSMOPEN_P_LOG, tech_pvt->callid_name, tech_pvt->callid_number); + + DEBUGA_GSMOPEN("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n", + GSMOPEN_P_LOG, tech_pvt->line_array.result[i], + tech_pvt->callid_name[0] != 1 ? tech_pvt->callid_name : "not available", + tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available"); + + /* mark the time of RING */ + gettimeofday(&(tech_pvt->ringtime), NULL); + tech_pvt->interface_state = GSMOPEN_STATE_RING; + tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; + + } + + } + + else { + DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + + } + } + + } + + if ((strncmp(tech_pvt->line_array.result[i], "*ECAV", 5) == 0) || (strncmp(tech_pvt->line_array.result[i], "*ECAM", 5) == 0)) { /* sony-ericsson call processing unsolicited messages */ + int res, ccid, ccstatus, calltype, processid, exitcause, number, type; + res = ccid = ccstatus = calltype = processid = exitcause = number = type = 0; + res = + sscanf(&tech_pvt->line_array.result[i][6], "%d,%d,%d,%d,%d,%d,%d", &ccid, &ccstatus, &calltype, &processid, &exitcause, &number, + &type); + /* only changes the phone_callflow if enought parameters were parsed */ + if (res >= 3) { + switch (ccstatus) { + case 0: + if (tech_pvt->owner) { + ast_setstate(tech_pvt->owner, GSMOPEN_STATE_DOWN); + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + tech_pvt->interface_state = GSMOPEN_STATE_DOWN; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + break; + case 1: + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + break; + case 2: + if (tech_pvt->owner) { + ast_setstate(tech_pvt->owner, GSMOPEN_STATE_DIALING); + } + tech_pvt->interface_state = CALLFLOW_CALL_DIALING; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + break; + case 3: + if (tech_pvt->owner) { + ast_setstate(tech_pvt->owner, GSMOPEN_STATE_UP); + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); + } + tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; + tech_pvt->interface_state = GSMOPEN_STATE_UP; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + break; + case 4: + if (option_debug > 1) + DEBUGA_GSMOPEN + ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle HOLD event\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + break; + case 5: + if (option_debug > 1) + DEBUGA_GSMOPEN + ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle WAITING event\n", GSMOPEN_P_LOG, + tech_pvt->line_array.result[i]); + break; + case 6: + if (option_debug > 1) + DEBUGA_GSMOPEN + ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle ALERTING event\n", GSMOPEN_P_LOG, + tech_pvt->line_array.result[i]); + break; + case 7: + if (tech_pvt->owner) { + ast_setstate(tech_pvt->owner, GSMOPEN_STATE_BUSY); + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_BUSY); + } + tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY; + tech_pvt->interface_state = GSMOPEN_STATE_BUSY; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + break; + } + } else { + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + } + + /* at_indicator_* are unsolicited messages sent by the phone to signal us that some of its visual indicators on its screen has changed, based on CIND CMER ETSI docs */ + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_noservice_string) == 0)) { + ERRORA("|%s| at_indicator_noservice_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + alarm_event(tech_pvt, ALARM_NETWORK_NO_SERVICE, "at_indicator_noservice_string"); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nosignal_string) == 0)) { + ERRORA("|%s| at_indicator_nosignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "at_indicator_nosignal_string"); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowsignal_string) == 0)) { + WARNINGA("|%s| at_indicator_lowsignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "at_indicator_lowsignal_string"); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowbattchg_string) == 0)) { + WARNINGA("|%s| at_indicator_lowbattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nobattchg_string) == 0)) { + ERRORA("|%s| at_indicator_nobattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callactive_string) == 0)) { + DEBUGA_GSMOPEN("|%s| at_indicator_callactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallactive_string) == 0)) { + DEBUGA_GSMOPEN("|%s| at_indicator_nocallactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallsetup_string) == 0)) { + DEBUGA_GSMOPEN("|%s| at_indicator_nocallsetup_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupincoming_string) == 0)) { + DEBUGA_GSMOPEN("|%s| at_indicator_callsetupincoming_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupoutgoing_string) == 0)) { + DEBUGA_GSMOPEN("|%s| at_indicator_callsetupoutgoing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupremoteringing_string) + == 0)) { + DEBUGA_GSMOPEN("|%s| at_indicator_callsetupremoteringing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } + + } + + /* let's look for OK, ERROR and EXPECTED_STRING in the complete lines read so far, without re-looking at the lines that has been yet looked at */ + for (i = la_read; i < la_counter; i++) { + if (expected_string) { + if ((strncmp(tech_pvt->line_array.result[i], expected_string, strlen(expected_string)) + == 0)) { + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| got what EXPECTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + at_ack = AT_OK; + } + } else { + if ((strcmp(tech_pvt->line_array.result[i], "OK") == 0)) { + if (option_debug > 1) + DEBUGA_GSMOPEN("got OK\n", GSMOPEN_P_LOG); + at_ack = AT_OK; + } + } + if ((strcmp(tech_pvt->line_array.result[i], "ERROR") == 0)) { + if (option_debug > 1) + DEBUGA_GSMOPEN("got ERROR\n", GSMOPEN_P_LOG); + at_ack = AT_ERROR; + } + + /* if we are requesting IMEI, put the line into the imei buffer if the line is not "OK" or "ERROR" */ + if (tech_pvt->requesting_imei && at_ack == -1) { + if (strlen(tech_pvt->line_array.result[i])) { /* we are reading the IMEI */ + strncpy(tech_pvt->imei, tech_pvt->line_array.result[i], sizeof(tech_pvt->imei)); + } + } + + /* if we are requesting IMSI, put the line into the imei buffer if the line is not "OK" or "ERROR" */ + if (tech_pvt->requesting_imsi && at_ack == -1) { + if (strlen(tech_pvt->line_array.result[i])) { /* we are reading the IMSI */ + strncpy(tech_pvt->imsi, tech_pvt->line_array.result[i], sizeof(tech_pvt->imsi)); + } + } + /* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */ + if (tech_pvt->reading_sms_msg > 1 && at_ack == -1) { + int c; + char sms_body[16000]; + int err = 0; + memset(sms_body, '\0', sizeof(sms_body)); + + if (strncmp(tech_pvt->line_array.result[i], "+CMGR", 5) == 0) { /* we are reading the "header" of an SMS */ +#if 1 + char content[512]; + char content2[512]; + int inside_comma = 0; + int inside_quote = 0; + int which_field = 0; + int d = 0; + + DEBUGA_GSMOPEN("HERE\n", GSMOPEN_P_LOG); + + memset(content, '\0', sizeof(content)); + + + for (c = 0; c < strlen(tech_pvt->line_array.result[i]); c++) { + if (tech_pvt->line_array.result[i][c] == ',' && tech_pvt->line_array.result[i][c - 1] != '\\' && inside_quote == 0) { + if (inside_comma) { + inside_comma = 0; + DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, + &tech_pvt->line_array.result[i][c]); + } else { + inside_comma = 1; + DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, + &tech_pvt->line_array.result[i][c]); + } + } + if (tech_pvt->line_array.result[i][c] == '"' && tech_pvt->line_array.result[i][c - 1] != '\\') { + if (inside_quote) { + inside_quote = 0; + DEBUGA_GSMOPEN("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, + &tech_pvt->line_array.result[i][c]); + DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content); + + //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //strncat(tech_pvt->sms_message, content, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + + memset(content2, '\0', sizeof(content2)); + if (which_field == 1) { + //FIXME why this? err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); + //err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); + err = 0; + strncpy(content2, content, sizeof(content2)); + } else { + err = 0; + strncpy(content2, content, sizeof(content2)); + } + DEBUGA_GSMOPEN("%d content2=%s\n", GSMOPEN_P_LOG, which_field, content2); + DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); + + //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //if (!err) + //strncat(tech_pvt->sms_message, content2, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + memset(content, '\0', sizeof(content)); + d = 0; + if (which_field == 1) { + strncpy(tech_pvt->sms_sender, content2, sizeof(tech_pvt->sms_sender)); + DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); + + } else if (which_field == 2) { + strncpy(tech_pvt->sms_date, content2, sizeof(tech_pvt->sms_date)); + DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); + } else if (which_field > 2) { + WARNINGA("WHY which_field is > 2 ? (which_field is %d)\n", GSMOPEN_P_LOG, which_field); + } + which_field++; + } else { + inside_quote = 1; + DEBUGA_GSMOPEN("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, + &tech_pvt->line_array.result[i][c]); + } + } + if (inside_quote && tech_pvt->line_array.result[i][c] != '"') { + + content[d] = tech_pvt->line_array.result[i][c]; + d++; + + } + + } +#endif //0 + } //it was the +CMGR answer from the cellphone + else { + DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); + DEBUGA_GSMOPEN("tech_pvt->line_array.result[i]=%s\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->sms_pdu_not_supported) { + char content3[1000]; + strncpy(tech_pvt->sms_message, tech_pvt->line_array.result[i], sizeof(tech_pvt->sms_message)); + + //int howmanyleft; + + + DEBUGA_GSMOPEN("sms_message=%s\n", GSMOPEN_P_LOG, tech_pvt->sms_message); + ucs2_to_utf8(tech_pvt, tech_pvt->sms_message, content3, sizeof(content3)); + DEBUGA_GSMOPEN("content3=%s\n", GSMOPEN_P_LOG, content3); + strncpy(tech_pvt->sms_body, content3, sizeof(tech_pvt->sms_body)); + //sleep(10); + //cicopet + if (tech_pvt->sms_cnmi_not_supported) { + sms_incoming(tech_pvt); + DEBUGA_GSMOPEN("2 content3=%s\n", GSMOPEN_P_LOG, content3); + } + } else { +#ifndef NO_GSMLIB + char content2[1000]; + SMSMessageRef sms; +//MessageType messagetype; +//Address servicecentreaddress; +//Timestamp servicecentretimestamp; +//Address sender_recipient_address; + + sms = SMSMessage::decode(tech_pvt->line_array.result[i]); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 + + DEBUGA_GSMOPEN("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + + memset(content2, '\0', sizeof(content2)); + if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { + iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); + } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { + ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, + sizeof(content2)); + } else { + ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + + } + DEBUGA_GSMOPEN("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + DEBUGA_GSMOPEN("dataCodingScheme=%s\n", GSMOPEN_P_LOG, sms->dataCodingScheme().toString().c_str()); + DEBUGA_GSMOPEN("address=%s\n", GSMOPEN_P_LOG, sms->address().toString().c_str()); + DEBUGA_GSMOPEN("serviceCentreAddress=%s\n", GSMOPEN_P_LOG, sms->serviceCentreAddress().toString().c_str()); + DEBUGA_GSMOPEN("serviceCentreTimestamp=%s\n", GSMOPEN_P_LOG, sms->serviceCentreTimestamp().toString().c_str()); + DEBUGA_GSMOPEN("messageType=%d\n", GSMOPEN_P_LOG, sms->messageType()); + DEBUGA_GSMOPEN("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); + + + memset(sms_body, '\0', sizeof(sms_body)); + strncpy(sms_body, content2, sizeof(sms_body)); + DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); + strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); + strncpy(tech_pvt->sms_sender, sms->address().toString().c_str(), sizeof(tech_pvt->sms_sender)); + strncpy(tech_pvt->sms_date, sms->serviceCentreTimestamp().toString().c_str(), sizeof(tech_pvt->sms_date)); + strncpy(tech_pvt->sms_datacodingscheme, sms->dataCodingScheme().toString().c_str(), sizeof(tech_pvt->sms_datacodingscheme)); + strncpy(tech_pvt->sms_servicecentreaddress, sms->serviceCentreAddress().toString().c_str(), + sizeof(tech_pvt->sms_servicecentreaddress)); + tech_pvt->sms_messagetype = sms->messageType(); +//messagetype = sms->messageType(); +//servicecentreaddress = sms->serviceCentreAddress(); +//servicecentretimestamp = sms->serviceCentreTimestamp(); +//sender_recipient_address = sms->address(); + +#endif// NO_GSMLIB + } + +#if 0 + //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //strncat(tech_pvt->sms_message, tech_pvt->line_array.result[i], ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + + memset(sms_body, '\0', sizeof(sms_body)); + err = ucs2_to_utf8(tech_pvt, tech_pvt->line_array.result[i], sms_body, sizeof(sms_body)); + DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); + strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); + + //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //if (!err) + //strncat(tech_pvt->sms_message, sms_body, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); + + //DEBUGA_GSMOPEN("sms_message=%s\n", GSMOPEN_P_LOG, tech_pvt->sms_message); +#endif //0 + } //it was the UCS2 from cellphone + + } //we were reading the SMS + + } + + la_read = la_counter; + + if (look_for_ack && at_ack > -1) + break; + + if (la_counter > AT_MESG_MAX_LINES) { + ERRORA("Too many lines in result (>%d). Stopping reader.\n", GSMOPEN_P_LOG, AT_MESG_MAX_LINES); + at_ack = AT_ERROR; + break; + } + } + + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(tech_pvt->controldev_lock); + if (select_err == -1) { + ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name, strerror(errno)); + tech_pvt->controldev_dead = 1; + close(tech_pvt->controldevfd); + + tech_pvt->running=0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "select returned -1 on interface, setting controldev_dead"); + tech_pvt->active=0; + tech_pvt->name[0]='\0'; + if (tech_pvt->owner) + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + switch_sleep(1000000); + return -1; + } + + if (tech_pvt->phone_callflow == CALLFLOW_CALL_INCOMING && tech_pvt->call_incoming_time.tv_sec) { //after three sec of CALLFLOW_CALL_INCOMING, we assume the phone is incapable of notifying RING (eg: motorola c350), so we try to answer + char list_command[64]; + struct timeval call_incoming_timeout; + gettimeofday(&call_incoming_timeout, NULL); + call_incoming_timeout.tv_sec -= 3; + DEBUGA_GSMOPEN + ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", + GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); + if (call_incoming_timeout.tv_sec > tech_pvt->call_incoming_time.tv_sec) { + + tech_pvt->call_incoming_time.tv_sec = 0; + tech_pvt->call_incoming_time.tv_usec = 0; + DEBUGA_GSMOPEN + ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", + GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPBS=RC"); + if (res) { + ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", GSMOPEN_P_LOG); + } + tech_pvt->phonebook_querying = 1; + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPBR=?"); + if (res) { + ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", GSMOPEN_P_LOG); + } + tech_pvt->phonebook_querying = 0; + sprintf(list_command, "AT+CPBR=%d,%d", tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry); + tech_pvt->phonebook_listing_received_calls = 1; + res = gsmopen_serial_write_AT_expect_longtime(tech_pvt, list_command, "OK"); + if (res) { + WARNINGA("AT+CPBR=%d,%d failed, continue\n", GSMOPEN_P_LOG, tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry); + } + tech_pvt->phonebook_listing_received_calls = 0; + } + } + + if (tech_pvt->phone_callflow == CALLFLOW_INCOMING_RING) { + struct timeval call_incoming_timeout; + gettimeofday(&call_incoming_timeout, NULL); + call_incoming_timeout.tv_sec -= 10; + // DEBUGA_GSMOPEN ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); + if (call_incoming_timeout.tv_sec > tech_pvt->ringtime.tv_sec) { + ERRORA("Ringing stopped and I have not answered. Why?\n", GSMOPEN_P_LOG); + DEBUGA_GSMOPEN + ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", + GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); + if (tech_pvt->owner) { + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + } + } + } + tech_pvt->line_array.elemcount = la_counter; + //NOTICA (" OUTSIDE this gsmopen_serial_device %s \n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + if (look_for_ack) + return at_ack; + else + return 0; +} + +int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data) +{ + int howmany; + int i; + int res; + int count; + + howmany = strlen(data); + + for (i = 0; i < howmany; i++) { + res = write(tech_pvt->controldevfd, &data[i], 1); + + if (res != 1) { + DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &data[i], res, strerror(errno)); + gsmopen_sleep(100000); + for (count = 0; count < 10; count++) { + res = write(tech_pvt->controldevfd, &data[i], 1); + if (res == 1) { + DEBUGA_GSMOPEN("Successfully RE-sent (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + break; + } else + DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + gsmopen_sleep(100000); + + } + if (res != 1) { + ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + return -1; + } + } + if (option_debug > 1) + DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &data[i]); + gsmopen_sleep(1000); /* release the cpu */ + } + + res = write(tech_pvt->controldevfd, "\r", 1); + + if (res != 1) { + DEBUGA_GSMOPEN("Error sending (carriage return): %d (%s)\n", GSMOPEN_P_LOG, res, strerror(errno)); + gsmopen_sleep(100000); + for (count = 0; count < 10; count++) { + res = write(tech_pvt->controldevfd, "\r", 1); + + if (res == 1) { + DEBUGA_GSMOPEN("Successfully RE-sent carriage return: %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); + break; + } else + DEBUGA_GSMOPEN("Error RE-sending (carriage return): %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); + gsmopen_sleep(100000); + + } + if (res != 1) { + ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); + return -1; + } + } + if (option_debug > 1) + DEBUGA_GSMOPEN("sent (carriage return)\n", GSMOPEN_P_LOG); + gsmopen_sleep(1000); /* release the cpu */ + + return howmany; +} + +int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data) +{ + int howmany; + int i; + int res; + int count; + + howmany = strlen(data); + + for (i = 0; i < howmany; i++) { + res = write(tech_pvt->controldevfd, &data[i], 1); + + if (res != 1) { + DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &data[i], res, strerror(errno)); + gsmopen_sleep(100000); + for (count = 0; count < 10; count++) { + res = write(tech_pvt->controldevfd, &data[i], 1); + if (res == 1) + break; + else + DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + gsmopen_sleep(100000); + + } + if (res != 1) { + ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + return -1; + } + } + if (option_debug > 1) + DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &data[i]); + gsmopen_sleep(1000); /* release the cpu */ + } + + gsmopen_sleep(1000); /* release the cpu */ + + return howmany; +} + +int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data) +{ + + if (option_debug > 1) + DEBUGA_GSMOPEN("gsmopen_serial_write_AT_noack: %s\n", GSMOPEN_P_LOG, data); + + PUSHA_UNLOCKA(tech_pvt->controldev_lock); + LOKKA(tech_pvt->controldev_lock); + if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { + + ERRORA("Error sending data... (%s)\n", GSMOPEN_P_LOG, strerror(errno)); + UNLOCKA(tech_pvt->controldev_lock); + return -1; + } + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(tech_pvt->controldev_lock); + + return 0; +} + +int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data) +{ + int at_result = AT_ERROR; + + PUSHA_UNLOCKA(tech_pvt->controldev_lock); + LOKKA(tech_pvt->controldev_lock); + if (option_debug > 1) + DEBUGA_GSMOPEN("sending: %s\n", GSMOPEN_P_LOG, data); + if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { + ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); + UNLOCKA(tech_pvt->controldev_lock); + return -1; + } + + at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 2, NULL, 1); // 2.5 sec timeout + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(tech_pvt->controldev_lock); + + return at_result; + +} + +int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data) +{ + int at_result = AT_ERROR; + + PUSHA_UNLOCKA(tech_pvt->controldev_lock); + LOKKA(tech_pvt->controldev_lock); + if (option_debug > 1) + DEBUGA_GSMOPEN("sending: %s\n", GSMOPEN_P_LOG, data); + if (gsmopen_serial_write_AT_nocr(tech_pvt, data) != strlen(data)) { + ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); + UNLOCKA(tech_pvt->controldev_lock); + return -1; + } + + at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 20, NULL, 1); // 20.5 sec timeout + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(tech_pvt->controldev_lock); + + return at_result; + +} + +int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds) +{ + int at_result = AT_ERROR; + + PUSHA_UNLOCKA(tech_pvt->controldev_lock); + LOKKA(tech_pvt->controldev_lock); + if (option_debug > 1) + DEBUGA_GSMOPEN("sending: %s, expecting: %s\n", GSMOPEN_P_LOG, data, expected_string); + if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { + ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); + UNLOCKA(tech_pvt->controldev_lock); + return -1; + } + + at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(tech_pvt->controldev_lock); + + return at_result; + +} + +int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds) +{ + int at_result = AT_ERROR; + + PUSHA_UNLOCKA(tech_pvt->controldev_lock); + LOKKA(tech_pvt->controldev_lock); + if (option_debug > 1) + DEBUGA_GSMOPEN("expecting: %s\n", GSMOPEN_P_LOG, expected_string); + + at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(tech_pvt->controldev_lock); + + return at_result; + +} + +int gsmopen_serial_answer(private_t * tech_pvt) +{ + if (tech_pvt->controldevprotocol == PROTOCOL_AT) + return gsmopen_serial_answer_AT(tech_pvt); +#ifdef GSMOPEN_FBUS2 + if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) + return gsmopen_serial_answer_FBUS2(tech_pvt); +#endif /* GSMOPEN_FBUS2 */ +#ifdef GSMOPEN_CVM + if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) + return gsmopen_serial_answer_CVM_BUSMAIL(tech_pvt); +#endif /* GSMOPEN_CVM */ + return -1; +} + + +int gsmopen_serial_answer_AT(private_t * tech_pvt) +{ + int res; + + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_answer, tech_pvt->at_answer_expect); + if (res) { + DEBUGA_GSMOPEN + ("at_answer command failed, command used: %s, expecting: %s, trying with AT+CKPD=\"S\"\n", + GSMOPEN_P_LOG, tech_pvt->at_answer, tech_pvt->at_answer_expect); + + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"S\""); + if (res) { + ERRORA("at_answer command failed, command used: 'AT+CKPD=\"S\"', giving up\n", GSMOPEN_P_LOG); + return -1; + } + } + //tech_pvt->interface_state = GSMOPEN_STATE_UP; + //tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; + DEBUGA_GSMOPEN("AT: call answered\n", GSMOPEN_P_LOG); + return 0; +} + +int gsmopen_serial_hangup(private_t * tech_pvt) +{ + if (tech_pvt->controldevprotocol == PROTOCOL_AT) + return gsmopen_serial_hangup_AT(tech_pvt); +#ifdef GSMOPEN_FBUS2 + if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) + return gsmopen_serial_hangup_FBUS2(tech_pvt); +#endif /* GSMOPEN_FBUS2 */ +#ifdef GSMOPEN_CVM + if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) + return gsmopen_serial_hangup_CVM_BUSMAIL(tech_pvt); +#endif /* GSMOPEN_CVM */ + return -1; +} + + +int gsmopen_serial_hangup_AT(private_t * tech_pvt) +{ + int res; + + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { + res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_hangup, tech_pvt->at_hangup_expect); + if (res) { + DEBUGA_GSMOPEN("at_hangup command failed, command used: %s, trying to use AT+CKPD=\"EEE\"\n", GSMOPEN_P_LOG, tech_pvt->at_hangup); + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\""); + if (res) { + ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n", GSMOPEN_P_LOG); + return -1; + } + } + } + tech_pvt->interface_state = GSMOPEN_STATE_DOWN; + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + return 0; +} + + +int gsmopen_serial_call(private_t * tech_pvt, char *dstr) +{ + if (tech_pvt->controldevprotocol == PROTOCOL_AT) + return gsmopen_serial_call_AT(tech_pvt, dstr); +#ifdef GSMOPEN_FBUS2 + if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) + return gsmopen_serial_call_FBUS2(tech_pvt, dstr); +#endif /* GSMOPEN_FBUS2 */ + if (tech_pvt->controldevprotocol == PROTOCOL_NO_SERIAL) + return 0; +#ifdef GSMOPEN_CVM + if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) + return gsmopen_serial_call_CVM_BUSMAIL(tech_pvt, dstr); +#endif /* GSMOPEN_CVM */ + return -1; +} + +int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr) +{ + int res; + char at_command[256]; + + if (option_debug) + DEBUGA_PBX("Dialing %s\n", GSMOPEN_P_LOG, dstr); + memset(at_command, 0, sizeof(at_command)); + tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING; + tech_pvt->interface_state = GSMOPEN_STATE_DIALING; + //ast_uri_decode(dstr); +/* + size_t fixdstr = strspn(dstr, AST_DIGIT_ANYDIG); + if (fixdstr == 0) { + ERRORA("dial command failed because of invalid dial number. dial string was: %s\n", + GSMOPEN_P_LOG, dstr); + return -1; + } +*/ + //dstr[fixdstr] = '\0'; + sprintf(at_command, "%s%s%s", tech_pvt->at_dial_pre_number, dstr, tech_pvt->at_dial_post_number); + DEBUGA_PBX("Dialstring %s\n", GSMOPEN_P_LOG, at_command); + res = gsmopen_serial_write_AT_expect(tech_pvt, at_command, tech_pvt->at_dial_expect); + if (res) { + ERRORA("dial command failed, dial string was: %s\n", GSMOPEN_P_LOG, at_command); + return -1; + } + // jet - early audio + //if (tech_pvt->at_early_audio) { + //ast_queue_control(tech_pvt->owner, AST_CONTROL_ANSWER); + //} + + return 0; +} + +int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft) +{ + char converted[16000]; +#ifndef WIN32 + iconv_t iconv_format; + int iconv_res; + char *outbuf; + char *inbuf; + size_t inbytesleft; + int c; + char stringa[5]; + double hexnum; + int i = 0; + + memset(converted, '\0', sizeof(converted)); + + DEBUGA_GSMOPEN("ucs2_in=%s\n", GSMOPEN_P_LOG, ucs2_in); + /* cicopet */ + for (c = 0; c < strlen(ucs2_in); c++) { + sprintf(stringa, "0x%c%c", ucs2_in[c], ucs2_in[c + 1]); + c++; + hexnum = strtod(stringa, NULL); + converted[i] = (char) hexnum; + i++; + } + + outbuf = utf8_out; + inbuf = converted; + + iconv_format = iconv_open("UTF8", "UCS-2BE"); + if (iconv_format == (iconv_t) - 1) { + ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); + return -1; + } + + inbytesleft = i; + DEBUGA_GSMOPEN("1 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", + GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); + + iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (iconv_res == (size_t) -1) { + DEBUGA_GSMOPEN("2 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", + GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); + DEBUGA_GSMOPEN("3 error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); + iconv_close(iconv_format); + return -1; + } + DEBUGA_GSMOPEN + ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", + GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); + iconv_close(iconv_format); + +#endif //WIN32 + return 0; +} + +int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft) +{ + char converted[16000]; +#ifndef WIN32 + iconv_t iconv_format; + int iconv_res; + char *outbuf; + char *inbuf; + size_t inbytesleft; + //int c; + //char stringa[5]; + //double hexnum; + //int i = 0; + + memset(converted, '\0', sizeof(converted)); + + DEBUGA_GSMOPEN("iso_8859_1_in=%s\n", GSMOPEN_P_LOG, iso_8859_1_in); + + outbuf = utf8_out; + inbuf = iso_8859_1_in; + + iconv_format = iconv_open("UTF8", "ISO_8859-1"); + if (iconv_format == (iconv_t) - 1) { + ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); + return -1; + } + + + inbytesleft = strlen(iso_8859_1_in) * 2; + iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (iconv_res == (size_t) -1) { + DEBUGA_GSMOPEN("ciao in=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", + GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); + DEBUGA_GSMOPEN("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); + return -1; + } + DEBUGA_GSMOPEN + (" strlen(iso_8859_1_in)=%d, iconv_res=%d, inbuf=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", + GSMOPEN_P_LOG, (int) strlen(iso_8859_1_in), iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); + + + + iconv_close(iconv_format); + +#endif //WIN32 + return 0; +} + + +int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft) +{ + /* cicopet */ +#ifndef WIN32 + iconv_t iconv_format; + int iconv_res; + char *outbuf; + char *inbuf; + char converted[16000]; + int i; + char stringa[16]; + char stringa2[16]; + + memset(converted, '\0', sizeof(converted)); + + outbuf = converted; + inbuf = utf_in; + + iconv_format = iconv_open("UCS-2BE", "UTF8"); + if (iconv_format == (iconv_t) - 1) { + ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); + return -1; + } + outbytesleft = 16000; + + DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", + GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted); + iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (iconv_res == (size_t) -1) { + ERRORA("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); + return -1; + } + DEBUGA_GSMOPEN + ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", + GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted); + iconv_close(iconv_format); + + for (i = 0; i < 16000 - outbytesleft; i++) { + memset(stringa, '\0', sizeof(stringa)); + memset(stringa2, '\0', sizeof(stringa2)); + sprintf(stringa, "%02X", converted[i]); + DEBUGA_GSMOPEN("character is |%02X|\n", GSMOPEN_P_LOG, converted[i]); + stringa2[0] = stringa[strlen(stringa) - 2]; + stringa2[1] = stringa[strlen(stringa) - 1]; + strncat(ucs2_out, stringa2, ((outbytesleft - strlen(ucs2_out)) - 1)); //add the received line to the buffer + DEBUGA_GSMOPEN("stringa=%s, stringa2=%s, ucs2_out=%s\n", GSMOPEN_P_LOG, stringa, stringa2, ucs2_out); + } +#endif //WIN32 + return 0; +} + + +/*! \brief Answer incoming call, + * Part of PBX interface */ +int gsmopen_answer(private_t * tech_pvt) +{ + int res; + + if (option_debug) { + DEBUGA_PBX("ENTERING FUNC\n", GSMOPEN_P_LOG); + } + /* do something to actually answer the call, if needed (eg. pick up the phone) */ + if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { + if (gsmopen_serial_answer(tech_pvt)) { + ERRORA("gsmopen_answer FAILED\n", GSMOPEN_P_LOG); + if (option_debug) { + DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); + } + return -1; + } + } + tech_pvt->interface_state = GSMOPEN_STATE_UP; + tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; + + while (tech_pvt->interface_state == GSMOPEN_STATE_RING) { + gsmopen_sleep(10000); //10msec + } + if (tech_pvt->interface_state != GSMOPEN_STATE_UP) { + ERRORA("call answering failed\n", GSMOPEN_P_LOG); + res = -1; + } else { + if (option_debug) + DEBUGA_PBX("call answered\n", GSMOPEN_P_LOG); + res = 0; +#ifdef GSMOPEN_PORTAUDIO + //speex_echo_state_reset(tech_pvt->stream->echo_state); +#endif // GSMOPEN_PORTAUDIO + + new_inbound_channel(tech_pvt); + if (tech_pvt->owner) { + DEBUGA_PBX("going to send GSMOPEN_STATE_UP\n", GSMOPEN_P_LOG); + ast_setstate(tech_pvt->owner, GSMOPEN_STATE_UP); + //ast_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); + DEBUGA_PBX("just sent GSMOPEN_STATE_UP\n", GSMOPEN_P_LOG); + } + } + if (option_debug) { + DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); + } + return res; +} + +int gsmopen_ring(private_t * tech_pvt) +{ + int res = 0; + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + if (option_debug) { + //DEBUGA_PBX("ENTERING FUNC\n", GSMOPEN_P_LOG); + } + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if (session) { + switch_core_session_rwunlock(session); + return 0; + } + + new_inbound_channel(tech_pvt); + + gsmopen_sleep(10000); + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if (session) { + channel = switch_core_session_get_channel(session); + + switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING); + if (channel) { + switch_channel_mark_ring_ready(channel); + } else { + ERRORA("no session\n", GSMOPEN_P_LOG); + } + switch_core_session_rwunlock(session); + } else { + ERRORA("no session\n", GSMOPEN_P_LOG); + + } + + + if (option_debug) { + DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); + } + return res; +} + + +/*! \brief Hangup gsmopen call + * Part of PBX interface, called from ast_hangup */ + +int gsmopen_hangup(private_t * tech_pvt) +{ + + /* if there is not gsmopen pvt why we are here ? */ + if (!tech_pvt) { + ERRORA("Asked to hangup channel not connected\n", GSMOPEN_P_LOG); + return 0; + } + + DEBUGA_GSMOPEN("ENTERING FUNC\n", GSMOPEN_P_LOG); + + + if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { + /* actually hangup through the serial port */ + if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { + int res; + res = gsmopen_serial_hangup(tech_pvt); + if (res) { + ERRORA("gsmopen_serial_hangup error: %d\n", GSMOPEN_P_LOG, res); + if (option_debug) { + DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); + } + return -1; + } + } + + while (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { + gsmopen_sleep(10000); //10msec + } + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { + ERRORA("call hangup failed\n", GSMOPEN_P_LOG); + return -1; + } else { + DEBUGA_GSMOPEN("call hungup\n", GSMOPEN_P_LOG); + } + } + } else { + tech_pvt->interface_state = GSMOPEN_STATE_DOWN; + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + } + + switch_set_flag(tech_pvt, TFLAG_HANGUP); + if (option_debug) { + DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); + } + return 0; +} + + + +#ifdef GSMOPEN_ALSA +/*! \brief ALSA pcm format, according to endianess */ +#if __BYTE_ORDER == __LITTLE_ENDIAN +snd_pcm_format_t gsmopen_format = SND_PCM_FORMAT_S16_LE; +#else +snd_pcm_format_t gsmopen_format = SND_PCM_FORMAT_S16_BE; +#endif + +/*! + * \brief Initialize the ALSA soundcard channels (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces) + * \param p the gsmopen_pvt of the interface + * + * This function call alsa_open_dev to initialize the ALSA soundcard for each channel (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init + * + * \return zero on success, -1 on error. + */ +int alsa_init(private_t * tech_pvt) +{ + tech_pvt->alsac = alsa_open_dev(tech_pvt, SND_PCM_STREAM_CAPTURE); + if (!tech_pvt->alsac) { + ERRORA("Failed opening ALSA capture device: %s\n", GSMOPEN_P_LOG, tech_pvt->alsacname); + if (alsa_shutdown(tech_pvt)) { + ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); + return -1; + } + return -1; + } + tech_pvt->alsap = alsa_open_dev(tech_pvt, SND_PCM_STREAM_PLAYBACK); + if (!tech_pvt->alsap) { + ERRORA("Failed opening ALSA playback device: %s\n", GSMOPEN_P_LOG, tech_pvt->alsapname); + if (alsa_shutdown(tech_pvt)) { + ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); + return -1; + } + return -1; + } + + /* make valgrind very happy */ + snd_config_update_free_global(); + return 0; +} + +/*! + * \brief Shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces) + * \param p the gsmopen_pvt of the interface + * + * This function shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init + * + * \return zero on success, -1 on error. + */ + +int alsa_shutdown(private_t * tech_pvt) +{ + + int err; + + if (tech_pvt->alsap) { + err = snd_pcm_drop(tech_pvt->alsap); + if (err < 0) { + ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsapname, snd_strerror(err)); + return -1; + } + err = snd_pcm_close(tech_pvt->alsap); + if (err < 0) { + ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsapname, snd_strerror(err)); + return -1; + } + tech_pvt->alsap = NULL; + } + if (tech_pvt->alsac) { + err = snd_pcm_drop(tech_pvt->alsac); + if (err < 0) { + ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsacname, snd_strerror(err)); + return -1; + } + err = snd_pcm_close(tech_pvt->alsac); + if (err < 0) { + ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsacname, snd_strerror(err)); + return -1; + } + tech_pvt->alsac = NULL; + } + + return 0; +} + +/*! + * \brief Setup and open the ALSA device (capture OR playback) + * \param p the gsmopen_pvt of the interface + * \param stream the ALSA capture/playback definition + * + * This function setup and open the ALSA device (capture OR playback). Called by alsa_init + * + * \return zero on success, -1 on error. + */ +snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream) +{ + + snd_pcm_t *handle = NULL; + snd_pcm_hw_params_t *params; + snd_pcm_sw_params_t *swparams; + snd_pcm_uframes_t buffer_size; + int err; + size_t n; + //snd_pcm_uframes_t xfer_align; + unsigned int rate; + snd_pcm_uframes_t start_threshold, stop_threshold; + snd_pcm_uframes_t period_size = 0; + snd_pcm_uframes_t chunk_size = 0; + int start_delay = 0; + int stop_delay = 0; + snd_pcm_state_t state; + snd_pcm_info_t *info; + unsigned int chan_num; + + period_size = tech_pvt->alsa_period_size; + + snd_pcm_hw_params_alloca(¶ms); + snd_pcm_sw_params_alloca(&swparams); + + if (stream == SND_PCM_STREAM_CAPTURE) { + err = snd_pcm_open(&handle, tech_pvt->alsacname, stream, 0 | SND_PCM_NONBLOCK); + } else { + err = snd_pcm_open(&handle, tech_pvt->alsapname, stream, 0 | SND_PCM_NONBLOCK); + } + if (err < 0) { + ERRORA + ("snd_pcm_open failed with error '%s' on device '%s', if you are using a plughw:n device please change it to be a default:n device (so to allow it to be shared with other concurrent programs), or maybe you are using an ALSA voicemodem and slmodemd" + " is running?\n", GSMOPEN_P_LOG, snd_strerror(err), stream == SND_PCM_STREAM_CAPTURE ? tech_pvt->alsacname : tech_pvt->alsapname); + return NULL; + } + + snd_pcm_info_alloca(&info); + + if ((err = snd_pcm_info(handle, info)) < 0) { + ERRORA("info error: %s", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + + err = snd_pcm_nonblock(handle, 1); + if (err < 0) { + ERRORA("nonblock setting error: %s", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + + err = snd_pcm_hw_params_any(handle, params); + if (err < 0) { + ERRORA("Broken configuration for this PCM, no configurations available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + + err = snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED); + if (err < 0) { + ERRORA("Access type not available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + err = snd_pcm_hw_params_set_format(handle, params, gsmopen_format); + if (err < 0) { + ERRORA("Sample format non available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + err = snd_pcm_hw_params_set_channels(handle, params, 1); + if (err < 0) { + DEBUGA_GSMOPEN("Channels count set failed: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + } +#if 1 + err = snd_pcm_hw_params_get_channels(params, &chan_num); + if (err < 0) { + ERRORA("Channels count non available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + if (chan_num < 1 || chan_num > 2) { + ERRORA("Channels count MUST BE 1 or 2, it is: %d\n", GSMOPEN_P_LOG, chan_num); + ERRORA("Channels count MUST BE 1 or 2, it is: %d on %s %s\n", GSMOPEN_P_LOG, chan_num, tech_pvt->alsapname, tech_pvt->alsacname); + return NULL; + } else { + if (chan_num == 1) { + if (stream == SND_PCM_STREAM_CAPTURE) + tech_pvt->alsa_capture_is_mono = 1; + else + tech_pvt->alsa_play_is_mono = 1; + } else { + if (stream == SND_PCM_STREAM_CAPTURE) + tech_pvt->alsa_capture_is_mono = 0; + else + tech_pvt->alsa_play_is_mono = 0; + } + } +#else + tech_pvt->alsa_capture_is_mono = 1; + tech_pvt->alsa_play_is_mono = 1; +#endif + +#if 1 + rate = tech_pvt->gsmopen_sound_rate; + err = snd_pcm_hw_params_set_rate_near(handle, params, &rate, 0); + if ((float) tech_pvt->gsmopen_sound_rate * 1.05 < rate || (float) tech_pvt->gsmopen_sound_rate * 0.95 > rate) { + WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", GSMOPEN_P_LOG, tech_pvt->gsmopen_sound_rate, rate); + } + + if (err < 0) { + ERRORA("Error setting rate: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + tech_pvt->gsmopen_sound_rate = rate; + + err = snd_pcm_hw_params_set_period_size_near(handle, params, &period_size, 0); + + if (err < 0) { + ERRORA("Error setting period_size: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + + tech_pvt->alsa_period_size = period_size; + + tech_pvt->alsa_buffer_size = tech_pvt->alsa_period_size * tech_pvt->alsa_periods_in_buffer; + + err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &tech_pvt->alsa_buffer_size); + + if (err < 0) { + ERRORA("Error setting buffer_size: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } +#endif + + err = snd_pcm_hw_params(handle, params); + if (err < 0) { + ERRORA("Unable to install hw params: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + + snd_pcm_hw_params_get_period_size(params, &chunk_size, 0); + snd_pcm_hw_params_get_buffer_size(params, &buffer_size); + if (chunk_size == buffer_size) { + ERRORA("Can't use period equal to buffer size (%lu == %lu)\n", GSMOPEN_P_LOG, chunk_size, buffer_size); + return NULL; + } + + snd_pcm_sw_params_current(handle, swparams); + + /* + if (sleep_min) + xfer_align = 1; + err = snd_pcm_sw_params_set_sleep_min(handle, swparams, + 0); + + if (err < 0) { + ERRORA("Error setting slep_min: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + } + */ + n = chunk_size; + err = snd_pcm_sw_params_set_avail_min(handle, swparams, n); + if (err < 0) { + ERRORA("Error setting avail_min: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + } + if (stream == SND_PCM_STREAM_CAPTURE) { + start_delay = 1; + } + if (start_delay <= 0) { + start_threshold = n + (snd_pcm_uframes_t) rate *start_delay / 1000000; + } else { + start_threshold = (snd_pcm_uframes_t) rate *start_delay / 1000000; + } + if (start_threshold < 1) + start_threshold = 1; + if (start_threshold > n) + start_threshold = n; + err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold); + if (err < 0) { + ERRORA("Error setting start_threshold: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + } + + if (stop_delay <= 0) + stop_threshold = buffer_size + (snd_pcm_uframes_t) rate *stop_delay / 1000000; + else + stop_threshold = (snd_pcm_uframes_t) rate *stop_delay / 1000000; + + if (stream == SND_PCM_STREAM_CAPTURE) { + stop_threshold = -1; + } + + err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold); + + if (err < 0) { + ERRORA("Error setting stop_threshold: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + } + + if (snd_pcm_sw_params(handle, swparams) < 0) { + ERRORA("Error installing software parameters: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + } + + err = snd_pcm_poll_descriptors_count(handle); + if (err <= 0) { + ERRORA("Unable to get a poll descriptors count, error is %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + + if (err != 1) { //number of poll descriptors + DEBUGA_GSMOPEN("Can't handle more than one device\n", GSMOPEN_P_LOG); + return NULL; + } + + err = snd_pcm_poll_descriptors(handle, &tech_pvt->pfd, err); + if (err != 1) { + ERRORA("snd_pcm_poll_descriptors failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + DEBUGA_GSMOPEN("Acquired fd %d from the poll descriptor\n", GSMOPEN_P_LOG, tech_pvt->pfd.fd); + + if (stream == SND_PCM_STREAM_CAPTURE) { + tech_pvt->gsmopen_sound_capt_fd = tech_pvt->pfd.fd; + } + + state = snd_pcm_state(handle); + + if (state != SND_PCM_STATE_RUNNING) { + if (state != SND_PCM_STATE_PREPARED) { + err = snd_pcm_prepare(handle); + if (err) { + ERRORA("snd_pcm_prepare failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + DEBUGA_GSMOPEN("prepared!\n", GSMOPEN_P_LOG); + } + if (stream == SND_PCM_STREAM_CAPTURE) { + err = snd_pcm_start(handle); + if (err) { + ERRORA("snd_pcm_start failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + return NULL; + } + DEBUGA_GSMOPEN("started!\n", GSMOPEN_P_LOG); + } + } + if (option_debug > 1) { + snd_output_t *output = NULL; + err = snd_output_stdio_attach(&output, stdout, 0); + if (err < 0) { + ERRORA("snd_output_stdio_attach failed: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); + } + snd_pcm_dump(handle, output); + +#ifndef NO_GSMLIB + SMSMessageRef sms; + char content2[1000]; + //sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 + //sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 + //sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 + sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 + //sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 + //NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + + memset(content2, '\0', sizeof(content2)); + if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { + iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); + } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { + ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, + sizeof(content2)); + } else { + ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + + } + //NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + //NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); +#endif// NO_GSMLIB + + } + if (option_debug > 1) + DEBUGA_GSMOPEN("ALSA handle = %ld\n", GSMOPEN_P_LOG, (long int) handle); + return handle; + +} + +/*! \brief Write audio frames to interface */ +#endif /* GSMOPEN_ALSA */ + +int gsmopen_call(private_t * tech_pvt, char *rdest, int timeout) +{ + + //gsmopen_sleep(5000); + DEBUGA_GSMOPEN("Calling GSM, rdest is: %s\n", GSMOPEN_P_LOG, rdest); + //gsmopen_signaling_write(tech_pvt, "SET AGC OFF"); + //gsmopen_sleep(10000); + //gsmopen_signaling_write(tech_pvt, "SET AEC OFF"); + //gsmopen_sleep(10000); + + gsmopen_serial_call(tech_pvt, rdest); + //ERRORA("failed to communicate with GSM client, now exit\n", GSMOPEN_P_LOG); + //return -1; + //} + return 0; +} + + +int gsmopen_senddigit(private_t * tech_pvt, char digit) +{ + + DEBUGA_GSMOPEN("DIGIT received: %c\n", GSMOPEN_P_LOG, digit); + if (tech_pvt->controldevprotocol == PROTOCOL_AT && tech_pvt->at_send_dtmf[0]) { + int res = 0; + char at_command[256]; + + memset(at_command, '\0', 256); + sprintf(at_command, "%s=\"%c\"", tech_pvt->at_send_dtmf, digit); + res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); + if (res) { + ERRORA("senddigit command failed, command used: '%s=\"%c\"', giving up\n", GSMOPEN_P_LOG, tech_pvt->at_send_dtmf, digit); + } + } + + return 0; +} + +#ifdef GSMOPEN_ALSA +/*! \brief Write audio frames to interface */ +int alsa_write(private_t * tech_pvt, short *data, int datalen) +{ + static char sizbuf[8000]; + static char sizbuf2[16000]; + static char silencebuf[8000]; + static int sizpos = 0; + int len = sizpos; + int pos; + int res = 0; + time_t now_timestamp; + /* size_t frames = 0; */ + snd_pcm_state_t state; + snd_pcm_sframes_t delayp1=0; + snd_pcm_sframes_t delayp2=0; + + if(tech_pvt->no_sound==1){ + return res; + } + + + memset(sizbuf, 255, sizeof(sizbuf)); + memset(sizbuf2, 255, sizeof(sizbuf)); + memset(silencebuf, 255, sizeof(sizbuf)); + + //ERRORA("data=%p, datalen=%d\n", GSMOPEN_P_LOG, (void *)data, datalen); + /* We have to digest the frame in 160-byte portions */ + if (datalen > sizeof(sizbuf) - sizpos) { + ERRORA("Frame too large\n", GSMOPEN_P_LOG); + res = -1; + } else { + memcpy(sizbuf + sizpos, data, datalen); + memset(data, 255, datalen); + len += datalen; + pos = 0; + + +#ifdef ALSA_MONITOR + alsa_monitor_write(sizbuf, len); +#endif + state = snd_pcm_state(tech_pvt->alsap); + if (state == SND_PCM_STATE_XRUN) { + int i; + + DEBUGA_GSMOPEN + ("You've got an ALSA write XRUN in the past (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file\n", + GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer); + res = snd_pcm_prepare(tech_pvt->alsap); + if (res) { + ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + } else { + res = snd_pcm_format_set_silence(gsmopen_format, silencebuf, len / 2); + if (res < 0) { + DEBUGA_GSMOPEN("Silence error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + res = -1; + } + for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) { + res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2); + if (res != len / 2) { + DEBUGA_GSMOPEN("Write returned a different quantity: %d\n", GSMOPEN_P_LOG, res); + res = -1; + } else if (res < 0) { + DEBUGA_GSMOPEN("Write error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + res = -1; + } + } + } + + } + + res = snd_pcm_delay(tech_pvt->alsap, &delayp1); + if (res < 0) { + DEBUGA_GSMOPEN("Error %d on snd_pcm_delay: \"%s\"\n", GSMOPEN_P_LOG, res, snd_strerror(res)); + res = snd_pcm_prepare(tech_pvt->alsap); + if (res) { + DEBUGA_GSMOPEN("snd_pcm_prepare failed: '%s'\n", GSMOPEN_P_LOG, snd_strerror(res)); + } + res = snd_pcm_delay(tech_pvt->alsap, &delayp1); + } + + delayp2 = snd_pcm_avail_update(tech_pvt->alsap); + if (delayp2 < 0) { + DEBUGA_GSMOPEN("Error %d on snd_pcm_avail_update: \"%s\"\n", GSMOPEN_P_LOG, (int) delayp2, snd_strerror(delayp2)); + + res = snd_pcm_prepare(tech_pvt->alsap); + if (res) { + DEBUGA_GSMOPEN("snd_pcm_prepare failed: '%s'\n", GSMOPEN_P_LOG, snd_strerror(res)); + } + delayp2 = snd_pcm_avail_update(tech_pvt->alsap); + } + + if ( /* delayp1 != 0 && delayp1 != 160 */ + delayp1 < 160 || delayp2 > tech_pvt->alsa_buffer_size) { + + res = snd_pcm_prepare(tech_pvt->alsap); + if (res) { + DEBUGA_GSMOPEN + ("snd_pcm_prepare failed while trying to prevent an ALSA write XRUN: %s, delayp1=%d, delayp2=%d\n", + GSMOPEN_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2); + } else { + + int i; + for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) { + res = snd_pcm_format_set_silence(gsmopen_format, silencebuf, len / 2); + if (res < 0) { + DEBUGA_GSMOPEN("Silence error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + res = -1; + } + res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2); + if (res < 0) { + DEBUGA_GSMOPEN("Write error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + res = -1; + } else if (res != len / 2) { + DEBUGA_GSMOPEN("Write returned a different quantity: %d\n", GSMOPEN_P_LOG, res); + res = -1; + } + } + + DEBUGA_GSMOPEN + ("PREVENTING an ALSA write XRUN (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", + GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); + } + + } + + memset(sizbuf2, 0, sizeof(sizbuf2)); + if (tech_pvt->alsa_play_is_mono) { + res = snd_pcm_writei(tech_pvt->alsap, sizbuf, len / 2); + } else { + int a = 0; + int i = 0; + for (i = 0; i < 8000;) { + sizbuf2[a] = sizbuf[i]; + a++; + i++; + sizbuf2[a] = sizbuf[i]; + a++; + i--; + sizbuf2[a] = sizbuf[i]; // comment out this line to use only left + a++; + i++; + sizbuf2[a] = sizbuf[i]; // comment out this line to use only left + a++; + i++; + } + res = snd_pcm_writei(tech_pvt->alsap, sizbuf2, len); + } + if (res == -EPIPE) { + DEBUGA_GSMOPEN + ("ALSA write EPIPE (XRUN) (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", + GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); + res = snd_pcm_prepare(tech_pvt->alsap); + if (res) { + ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + } else { + + if (tech_pvt->alsa_play_is_mono) { + res = snd_pcm_writei(tech_pvt->alsap, sizbuf, len / 2); + } else { + int a = 0; + int i = 0; + for (i = 0; i < 8000;) { + sizbuf2[a] = sizbuf[i]; + a++; + i++; + sizbuf2[a] = sizbuf[i]; + a++; + i--; + sizbuf2[a] = sizbuf[i]; + a++; + i++; + sizbuf2[a] = sizbuf[i]; + a++; + i++; + } + res = snd_pcm_writei(tech_pvt->alsap, sizbuf2, len); + } + + } + + } else { + if (res == -ESTRPIPE) { + ERRORA("You've got some big problems\n", GSMOPEN_P_LOG); + } else if (res == -EAGAIN) { + DEBUGA_GSMOPEN("Momentarily busy\n", GSMOPEN_P_LOG); + res = 0; + } else if (res < 0) { + ERRORA("Error %d on audio write: \"%s\"\n", GSMOPEN_P_LOG, res, snd_strerror(res)); + } + } + } + + if (tech_pvt->audio_play_reset_period) { + time(&now_timestamp); + if ((now_timestamp - tech_pvt->audio_play_reset_timestamp) > tech_pvt->audio_play_reset_period) { + if (option_debug) + DEBUGA_GSMOPEN("reset audio play\n", GSMOPEN_P_LOG); + res = snd_pcm_wait(tech_pvt->alsap, 1000); + if (res < 0) { + ERRORA("audio play wait failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + } + res = snd_pcm_drop(tech_pvt->alsap); + if (res) { + ERRORA("audio play drop failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + } + res = snd_pcm_prepare(tech_pvt->alsap); + if (res) { + ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + } + res = snd_pcm_wait(tech_pvt->alsap, 1000); + if (res < 0) { + ERRORA("audio play wait failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); + } + time(&tech_pvt->audio_play_reset_timestamp); + } + } + //res = 0; + //if (res > 0) + //res = 0; + return res; +} + +#define AST_FRIENDLY_OFFSET 0 +int alsa_read(private_t * tech_pvt, short *data, int datalen) +{ + //static struct ast_frame f; + static short __buf[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; + static short __buf2[(GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2]; + short *buf; + short *buf2; + static int readpos = 0; + //static int left = GSMOPEN_FRAME_SIZE; + static int left; + snd_pcm_state_t state; + int r = 0; + int off = 0; + int error = 0; + //time_t now_timestamp; + + //DEBUGA_GSMOPEN("buf=%p, datalen=%d, left=%d\n", GSMOPEN_P_LOG, (void *)buf, datalen, left); + //memset(&f, 0, sizeof(struct ast_frame)); //giova + + + + if(tech_pvt->no_sound==1){ + return r; + } + + left = datalen; + + + state = snd_pcm_state(tech_pvt->alsac); + if (state != SND_PCM_STATE_RUNNING) { + DEBUGA_GSMOPEN("ALSA read state is not SND_PCM_STATE_RUNNING\n", GSMOPEN_P_LOG); + + if (state != SND_PCM_STATE_PREPARED) { + error = snd_pcm_prepare(tech_pvt->alsac); + if (error) { + ERRORA("snd_pcm_prepare failed, %s\n", GSMOPEN_P_LOG, snd_strerror(error)); + return r; + } + DEBUGA_GSMOPEN("prepared!\n", GSMOPEN_P_LOG); + } + gsmopen_sleep(1000); + error = snd_pcm_start(tech_pvt->alsac); + if (error) { + ERRORA("snd_pcm_start failed, %s\n", GSMOPEN_P_LOG, snd_strerror(error)); + return r; + } + DEBUGA_GSMOPEN("started!\n", GSMOPEN_P_LOG); + gsmopen_sleep(1000); + } + + buf = __buf + AST_FRIENDLY_OFFSET / 2; + buf2 = __buf2 + ((AST_FRIENDLY_OFFSET / 2) * 2); + + if (tech_pvt->alsa_capture_is_mono) { + r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left); + //DEBUGA_GSMOPEN("r=%d, buf=%p, buf+readpos=%p, datalen=%d, left=%d\n", GSMOPEN_P_LOG, r, (void *)buf, (void *)(buf + readpos), datalen, left); + } else { + int a = 0; + int i = 0; + r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left); + + for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { + __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; //comment out this line to use only left + //__buf[a] = __buf2[i]; // enable this line to use only left + a++; + i++; + i++; + } + } + + if (r == -EPIPE) { + DEBUGA_GSMOPEN("ALSA XRUN on read\n", GSMOPEN_P_LOG); + return r; + } else if (r == -ESTRPIPE) { + ERRORA("-ESTRPIPE\n", GSMOPEN_P_LOG); + return r; + + } else if (r == -EAGAIN) { + int count=0; + while (r == -EAGAIN) { + gsmopen_sleep(10000); + DEBUGA_GSMOPEN("%d ALSA read -EAGAIN, the soundcard is not ready to be read by gsmopen\n", GSMOPEN_P_LOG, count); + count++; + + if (tech_pvt->alsa_capture_is_mono) { + r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left); + } else { + int a = 0; + int i = 0; + r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left); + + for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { + __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; + a++; + i++; + i++; + } + } + + } + } else if (r < 0) { + WARNINGA("ALSA Read error: %s\n", GSMOPEN_P_LOG, snd_strerror(r)); + } else if (r >= 0) { + //DEBUGA_GSMOPEN("read: r=%d, readpos=%d, left=%d, off=%d\n", GSMOPEN_P_LOG, r, readpos, left, off); + off -= r; //what is the meaning of this? a leftover, probably + } + /* Update positions */ + readpos += r; + left -= r; + + if (readpos >= GSMOPEN_FRAME_SIZE) { + int i; + /* A real frame */ + readpos = 0; + left = GSMOPEN_FRAME_SIZE; + for (i = 0; i < r; i++) + data[i] = buf[i]; + + } + return r; +} + +#endif // GSMOPEN_ALSA + + + + + +int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text) +{ + //char *idest = data; + //char rdest[256]; + //private_t *p = NULL; + //char *device; + //char *dest; + //char *text; + //char *stringp = NULL; + //int found = 0; + int failed = 0; + int err = 0; + + //strncpy(rdest, idest, sizeof(rdest) - 1); + DEBUGA_GSMOPEN("GSMopenSendsms: dest=%s text=%s\n", GSMOPEN_P_LOG, dest, text); + DEBUGA_GSMOPEN("START\n", GSMOPEN_P_LOG); + /* we can use gsmopen_request to get the channel, but gsmopen_request would look for onowned channels, and probably we can send SMSs while a call is ongoing + * + */ + + if (tech_pvt->controldevprotocol != PROTOCOL_AT) { + ERRORA(", GSMOPEN_P_LOGGSMopenSendsms supports only AT command cellphones at the moment :-( !\n", GSMOPEN_P_LOG); + return RESULT_FAILURE; + } + + if (tech_pvt->controldevprotocol == PROTOCOL_AT) { + char smscommand[16000]; + memset(smscommand, '\0', sizeof(smscommand)); + + PUSHA_UNLOCKA(&tech_pvt->controldev_lock); + LOKKA(tech_pvt->controldev_lock); + + err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); + if (err) { + ERRORA("AT+CMGF=1 (set message sending to TEXT (as opposed to PDU) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + + + if (tech_pvt->no_ucs2) { + sprintf(smscommand, "AT+CMGS=\"%s\"", dest); //TODO: support phones that only accept pdu mode + } else { + char dest2[1048]; + + err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); + if (err) { + ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + + memset(dest2, '\0', sizeof(dest2)); + utf_to_ucs2(tech_pvt, dest, strlen(dest), dest2, sizeof(dest2)); + sprintf(smscommand, "AT+CMGS=\"%s\"", dest2); //TODO: support phones that only accept pdu mode + } + //TODO: support phones that only accept pdu mode + //TODO would be better to lock controldev here + //sprintf(smscommand, "AT+CMGS=\"%s\"", dest); //FIXME: nokia e63 want this + err = gsmopen_serial_write_AT_noack(tech_pvt, smscommand); + if (err) { + ERRORA("Error sending SMS\n", GSMOPEN_P_LOG); + failed = 1; + goto uscita; + } + err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf +#if 1 + if (err) { + DEBUGA_GSMOPEN + ("Error or timeout getting prompt '> ' for sending sms directly to the remote party. BTW, seems that we cannot do that with Motorola c350, so we'll write to cellphone memory, then send from memory\n", + GSMOPEN_P_LOG); + + err = gsmopen_serial_write_AT_ack(tech_pvt, "ATE1"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! + if (err) { + ERRORA("Error activating echo from modem\n", GSMOPEN_P_LOG); + } + tech_pvt->at_cmgw[0] = '\0'; + sprintf(smscommand, "AT+CMGW=\"%s\"", dest); //TODO: support phones that only accept pdu mode + err = gsmopen_serial_write_AT_noack(tech_pvt, smscommand); + if (err) { + ERRORA("Error writing SMS destination to the cellphone memory\n", GSMOPEN_P_LOG); + failed = 1; + goto uscita; + } + err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf + if (err) { + ERRORA("Error or timeout getting prompt '> ' for writing sms text in cellphone memory\n", GSMOPEN_P_LOG); + failed = 1; + goto uscita; + } + } +#endif + + //sprintf(text,"ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大"); //let's test the beauty of utf + memset(smscommand, '\0', sizeof(smscommand)); + if (tech_pvt->no_ucs2) { + sprintf(smscommand, "%s", text); + } else { + utf_to_ucs2(tech_pvt, text, strlen(text), smscommand, sizeof(smscommand)); + } + + smscommand[strlen(smscommand)] = 0x1A; + DEBUGA_GSMOPEN("smscommand len is: %d, text is:|||%s|||\n", GSMOPEN_P_LOG, (int) strlen(smscommand), smscommand); + + err = gsmopen_serial_write_AT_ack_nocr_longtime(tech_pvt, smscommand); + //TODO would be better to unlock controldev here + if (err) { + ERRORA("Error writing SMS text to the cellphone memory\n", GSMOPEN_P_LOG); + //return RESULT_FAILURE; + failed = 1; + goto uscita; + } + if (tech_pvt->at_cmgw[0]) { + sprintf(smscommand, "AT+CMSS=%s", tech_pvt->at_cmgw); + err = gsmopen_serial_write_AT_expect_longtime(tech_pvt, smscommand, "OK"); + if (err) { + ERRORA("Error sending SMS from the cellphone memory\n", GSMOPEN_P_LOG); + //return RESULT_FAILURE; + failed = 1; + goto uscita; + } + + err = gsmopen_serial_write_AT_ack(tech_pvt, "ATE0"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! + if (err) { + ERRORA("Error de-activating echo from modem\n", GSMOPEN_P_LOG); + } + } + uscita: + gsmopen_sleep(1000); + + if (tech_pvt->at_cmgw[0]) { + + /* let's see what we've sent, just for check TODO: Motorola it's not reliable! Motorola c350 tells that all was sent, but is not true! It just sends how much it fits into one SMS FIXME: need an algorithm to calculate how many ucs2 chars fits into an SMS. It make difference based, probably, on the GSM alphabet translation, or so */ + sprintf(smscommand, "AT+CMGR=%s", tech_pvt->at_cmgw); + err = gsmopen_serial_write_AT_ack(tech_pvt, smscommand); + if (err) { + ERRORA("Error reading SMS back from the cellphone memory\n", GSMOPEN_P_LOG); + } + + /* let's delete from cellphone memory what we've sent */ + sprintf(smscommand, "AT+CMGD=%s", tech_pvt->at_cmgw); + err = gsmopen_serial_write_AT_ack(tech_pvt, smscommand); + if (err) { + ERRORA("Error deleting SMS from the cellphone memory\n", GSMOPEN_P_LOG); + } + + tech_pvt->at_cmgw[0] = '\0'; + } + //gsmopen_sleep(500000); //.5 secs + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(&tech_pvt->controldev_lock); + } + + err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); + if (err) { + DEBUGA_GSMOPEN("AT+CMGF=0 (set message sending to PDU (as opposed to TEXT) do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); + } + + + DEBUGA_GSMOPEN("FINISH\n", GSMOPEN_P_LOG); + if (failed) + return -1; + else + return RESULT_SUCCESS; +} + +/************************************************/ + +/* LUIGI RIZZO's magic */ +/* boost support. BOOST_SCALE * 10 ^(BOOST_MAX/20) must + * be representable in 16 bits to avoid overflows. + */ +#define BOOST_SCALE (1<<9) +#define BOOST_MAX 40 /* slightly less than 7 bits */ + +/* + * store the boost factor + */ +void gsmopen_store_boost(char *s, double *boost) +{ + private_t *tech_pvt = NULL; + + if (sscanf(s, "%lf", boost) != 1) { + ERRORA("invalid boost <%s>\n", GSMOPEN_P_LOG, s); + return; + } + if (*boost < -BOOST_MAX) { + WARNINGA("boost %s too small, using %d\n", GSMOPEN_P_LOG, s, -BOOST_MAX); + *boost = -BOOST_MAX; + } else if (*boost > BOOST_MAX) { + WARNINGA("boost %s too large, using %d\n", GSMOPEN_P_LOG, s, BOOST_MAX); + *boost = BOOST_MAX; + } +#ifdef WIN32 + *boost = exp(log ((double)10) * *boost / 20) * BOOST_SCALE; +#else + *boost = exp(log(10) * *boost / 20) * BOOST_SCALE; +#endif //WIN32 + if (option_debug > 1) + DEBUGA_GSMOPEN("setting boost %s to %f\n", GSMOPEN_P_LOG, s, *boost); +} + + +int gsmopen_sound_boost(void *data, int samples_num, double boost) +{ +/* LUIGI RIZZO's magic */ + if (boost != 0 && (boost < 511 || boost > 513)) { /* scale and clip values */ + int i, x; + + int16_t *ptr = (int16_t *) data; + + for (i = 0; i < samples_num; i++) { + x = (int) (ptr[i] * boost) / BOOST_SCALE; + if (x > 32767) { + x = 32767; + } else if (x < -32768) { + x = -32768; + } + ptr[i] = x; + } + } else { + //printf("BOOST=%f\n", boost); + } + + return 0; +} + + +int gsmopen_serial_getstatus_AT(private_t * tech_pvt) +{ + int res; + private_t *p = tech_pvt; + +#if 0 + if (p->owner) { + if (p->owner->_state != AST_STATE_UP && p->owner->_state != AST_STATE_DOWN) { + DEBUGA_AT("No getstatus, we're neither UP nor DOWN\n", GSMOPEN_P_LOG); + return 0; + } + } +#endif + + + PUSHA_UNLOCKA(p->controldev_lock); + LOKKA(p->controldev_lock); + res = gsmopen_serial_write_AT_ack(p, "AT"); + if (res) { + ERRORA("AT was not acknowledged, continuing but maybe there is a problem\n", GSMOPEN_P_LOG); + } + gsmopen_sleep(1000); + + if (strlen(p->at_query_battchg)) { + res = gsmopen_serial_write_AT_expect(p, p->at_query_battchg, p->at_query_battchg_expect); + if (res) { + WARNINGA("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, p->at_query_battchg, p->at_query_battchg_expect); + } + gsmopen_sleep(1000); + } + + if (strlen(p->at_query_signal)) { + res = gsmopen_serial_write_AT_expect(p, p->at_query_signal, p->at_query_signal_expect); + if (res) { + WARNINGA("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, p->at_query_signal, p->at_query_signal_expect); + } + gsmopen_sleep(1000); + } + + if (!p->network_creg_not_supported) { + res = gsmopen_serial_write_AT_ack(p, "AT+CREG?"); + if (res) { + WARNINGA("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, "AT+CREG?", "OK"); + } + gsmopen_sleep(1000); + } + + //FIXME all the following commands in config! + + if (p->sms_cnmi_not_supported) { + res = gsmopen_serial_write_AT_ack(p, "AT+MMGL=\"HEADER ONLY\""); + if (res) { + WARNINGA + ("%s does not get %s from the phone. If your phone is not Motorola, please contact the gsmopen developers. Else, if your phone IS a Motorola, probably a long msg was incoming and ther first part was read and then deleted. The second part is now orphan. If you got this warning repeatedly, and you cannot correctly receive SMSs from this interface, please manually clean all messages (and the residual parts of them) from the cellphone/SIM. Continuing.\n", + GSMOPEN_P_LOG, "AT+MMGL=\"HEADER ONLY\"", "OK"); + } else { + gsmopen_sleep(1000); + if (p->unread_sms_msg_id) { + char at_command[256]; + + res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"UCS2\""); + if (res) { + ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", GSMOPEN_P_LOG); + memset(p->sms_message, 0, sizeof(p->sms_message)); + } + + memset(at_command, 0, sizeof(at_command)); + sprintf(at_command, "AT+CMGR=%d", p->unread_sms_msg_id); + memset(p->sms_message, 0, sizeof(p->sms_message)); + + p->reading_sms_msg = 1; + res = gsmopen_serial_write_AT_ack(p, at_command); + p->reading_sms_msg = 0; + if (res) { + ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); + } + res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"GSM\""); + if (res) { + ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + memset(at_command, 0, sizeof(at_command)); + sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id); /* delete the message */ + p->unread_sms_msg_id = 0; + res = gsmopen_serial_write_AT_ack(p, at_command); + if (res) { + ERRORA("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); + } + + if (strlen(p->sms_message)) { +#if 0 + + manager_event(EVENT_FLAG_SYSTEM, "GSMOPENincomingsms", "Interface: %s\r\nSMS_Message: %s\r\n", p->name, p->sms_message); + + if (strlen(p->sms_receiving_program)) { + int fd1[2]; + pid_t pid1; + char *arg1[] = { p->sms_receiving_program, (char *) NULL }; + int i; + + DEBUGA_AT("incoming SMS message:---%s---\n", GSMOPEN_P_LOG, p->sms_message); + pipe(fd1); + pid1 = fork(); + + if (pid1 == 0) { //child + int err; + + dup2(fd1[0], 0); // Connect stdin to pipe output + close(fd1[1]); // close input pipe side + setsid(); //session id + err = execvp(arg1[0], arg1); //exec our program, with stdin connected to pipe output + if (err) { + ERRORA + ("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n", + GSMOPEN_P_LOG, p->sms_receiving_program, err, strerror(errno), p->sms_message); + } + close(fd1[0]); // close output pipe side + } //starting here continue the parent + close(fd1[0]); // close output pipe side + // write the msg on the pipe input + for (i = 0; i < strlen(p->sms_message); i++) { + write(fd1[1], &p->sms_message[i], 1); + } + close(fd1[1]); // close pipe input, let our program know we've finished + } else { + ERRORA + ("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n", + GSMOPEN_P_LOG, p->sms_message); + } +#endif //0 + DEBUGA_GSMOPEN("got SMS incoming message. SMS received was:---%s---\n", GSMOPEN_P_LOG, p->sms_message); + } +#if 0 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself + if (p->phone_callflow == CALLFLOW_CALL_IDLE && p->interface_state == AST_STATE_DOWN && p->owner == NULL) { + /* we're not in a call, neither calling */ + res = gsmopen_serial_write_AT_ack(p, "AT+CKPD=\"EEE\""); + if (res) { + ERRORA("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + } +#endif + } + } + } + + UNLOCKA(p->controldev_lock); + POPPA_UNLOCKA(p->controldev_lock); + return 0; +} diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c deleted file mode 120000 index a0686ea786..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c +++ /dev/null @@ -1 +0,0 @@ -../../mod_gsmopen.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c new file mode 100644 index 0000000000..fdfbca74b8 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c @@ -0,0 +1,3474 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005/2012, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * This module (mod_gsmopen) has been contributed by: + * + * Giovanni Maruzzelli (gmaruzz@gmail.com) + * + * + * Further Contributors: + * + * + * + * mod_gsmopen.c -- GSM compatible Endpoint Module + * + */ + +#include "gsmopen.h" + +#if 0 +#ifdef WIN32 +/***************/ +// from http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ + +#include + +#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 +#else /* */ +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL +#endif /* */ +struct sk_timezone { + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; +int gettimeofday(struct timeval *tv, struct sk_timezone *tz) +{ + FILETIME ft; + unsigned __int64 tmpres = 0; + static int tzflag; + if (NULL != tv) { + GetSystemTimeAsFileTime(&ft); + tmpres |= ft.dwHighDateTime; + tmpres <<= 32; + tmpres |= ft.dwLowDateTime; + + /*converting file time to unix epoch */ + tmpres /= 10; /*convert into microseconds */ + tmpres -= DELTA_EPOCH_IN_MICROSECS; + tv->tv_sec = (long) (tmpres / 1000000UL); + tv->tv_usec = (long) (tmpres % 1000000UL); + } + if (NULL != tz) { + if (!tzflag) { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + return 0; +} + +/***************/ +#endif /* WIN32 */ +#endif //0 +SWITCH_BEGIN_EXTERN_C +SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown); +SWITCH_MODULE_DEFINITION(mod_gsmopen, mod_gsmopen_load, mod_gsmopen_shutdown, NULL); +SWITCH_END_EXTERN_C +#define GSMOPEN_CHAT_PROTO "sms" +#if 1 +SWITCH_STANDARD_API(gsm_function); +/* BEGIN: Changes here */ +#define GSM_SYNTAX "list [full] || console || AT_command || remove < interface_name | interface_id > || reload" +/* END: Changes heres */ +SWITCH_STANDARD_API(gsmopen_function); +#define GSMOPEN_SYNTAX "interface_name AT_command" +#endif //0 + +SWITCH_STANDARD_API(gsmopen_boost_audio_function); +#define GSMOPEN_BOOST_AUDIO_SYNTAX "interface_name [ ]" +SWITCH_STANDARD_API(sendsms_function); +#define SENDSMS_SYNTAX "gsmopen_sendsms interface_name destination_number SMS_text" +SWITCH_STANDARD_API(gsmopen_dump_function); +#define GSMOPEN_DUMP_SYNTAX "gsmopen_dump " +/* BEGIN: Changes here */ +#define FULL_RELOAD 0 +#define SOFT_RELOAD 1 +/* END: Changes heres */ + +const char *interface_status[] = { /* should match GSMOPEN_STATE_xxx in gsmopen.h */ + "IDLE", + "DOWN", + "RING", + "DIALING", + "BUSY", + "UP", + "RINGING", + "PRERING", + "DOUBLE", + "SELECTD", + "HANG_RQ", + "PREANSW" +}; +const char *phone_callflow[] = { /* should match CALLFLOW_XXX in gsmopen.h */ + "CALL_IDLE", + "CALL_DOWN", + "INCOMING_RNG", + "CALL_DIALING", + "CALL_LINEBUSY", + "CALL_ACTIVE", + "INCOMING_HNG", + "CALL_RLEASD", + "CALL_NOCARR", + "CALL_INFLUX", + "CALL_INCOMING", + "CALL_FAILED", + "CALL_NOSRVC", + "CALL_OUTRESTR", + "CALL_SECFAIL", + "CALL_NOANSWER", + "STATUS_FNSHED", + "STATUS_CANCLED", + "STATUS_FAILED", + "STATUS_REFUSED", + "STATUS_RINGING", + "STATUS_INPROGRS", + "STATUS_UNPLACD", + "STATUS_ROUTING", + "STATUS_EARLYMD", + "INCOMING_CLID", + "STATUS_RMTEHOLD" +}; + + +static struct { + int debug; + char *ip; + int port; + char *dialplan; + char *destination; + char *context; + char *codec_string; + char *codec_order[SWITCH_MAX_CODECS]; + int codec_order_last; + char *codec_rates_string; + char *codec_rates[SWITCH_MAX_CODECS]; + int codec_rates_last; + unsigned int flags; + int fd; + int calls; + int real_interfaces; + int next_interface; + char hold_music[256]; + private_t GSMOPEN_INTERFACES[GSMOPEN_MAX_INTERFACES]; + switch_mutex_t *mutex; + private_t *gsm_console; +} globals; + +switch_endpoint_interface_t *gsmopen_endpoint_interface; +switch_memory_pool_t *gsmopen_module_pool = NULL; +int running = 0; + +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_context, globals.context); +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_destination, globals.destination); +//SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string); +//SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string); + +/* BEGIN: Changes here */ +static switch_status_t interface_exists(char *the_interface); +#if 1 +static switch_status_t remove_interface(char *the_interface); +#endif //0 +/* END: Changes here */ + +static switch_status_t channel_on_init(switch_core_session_t *session); +static switch_status_t channel_on_hangup(switch_core_session_t *session); +static switch_status_t channel_on_destroy(switch_core_session_t *session); +static switch_status_t channel_on_routing(switch_core_session_t *session); +static switch_status_t channel_on_exchange_media(switch_core_session_t *session); +static switch_status_t channel_on_consume_media(switch_core_session_t *session); +static switch_status_t channel_on_soft_execute(switch_core_session_t *session); +static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, + switch_event_t *var_event, + switch_caller_profile_t *outbound_profile, + switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, + switch_call_cause_t *cancel_cause); +static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id); +static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id); +static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig); +static switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *session); + +static switch_status_t gsmopen_codec(private_t * tech_pvt, int sample_rate, int codec_ms) +{ + switch_core_session_t *session = NULL; + + if (switch_core_codec_init + (&tech_pvt->read_codec, "L16", NULL, sample_rate, codec_ms, 1, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { + ERRORA("Can't load codec?\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + } + + if (switch_core_codec_init + (&tech_pvt->write_codec, "L16", NULL, sample_rate, codec_ms, 1, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { + ERRORA("Can't load codec?\n", GSMOPEN_P_LOG); + switch_core_codec_destroy(&tech_pvt->read_codec); + return SWITCH_STATUS_FALSE; + } + + tech_pvt->read_frame.rate = sample_rate; + tech_pvt->read_frame.codec = &tech_pvt->read_codec; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + + if (session) { + switch_core_session_set_read_codec(session, &tech_pvt->read_codec); + switch_core_session_set_write_codec(session, &tech_pvt->write_codec); + switch_core_session_rwunlock(session); + } else { + ERRORA("no session\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + } + + return SWITCH_STATUS_SUCCESS; + +} + +switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *session) +{ + +#ifdef WANT_SPEEX + int ciapa; + long level; + int tmp; +#endif// WANT_SPEEX + switch_assert(tech_pvt != NULL); + switch_assert(session != NULL); + tech_pvt->read_frame.data = tech_pvt->databuf; + tech_pvt->read_frame.buflen = sizeof(tech_pvt->databuf); + switch_mutex_init(&tech_pvt->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); + switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); + switch_core_session_set_private(session, tech_pvt); + switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(session), sizeof(tech_pvt->session_uuid_str)); + if (!strlen(tech_pvt->session_uuid_str)) { + ERRORA("no tech_pvt->session_uuid_str\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + } + if (gsmopen_codec(tech_pvt, SAMPLERATE_GSMOPEN, 20) != SWITCH_STATUS_SUCCESS) { + ERRORA("gsmopen_codec FAILED\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + } + //teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, tech_pvt->read_codec.implementation->actual_samples_per_second); + //teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, 8000); + dtmf_rx_init(&tech_pvt->dtmf_state, NULL, NULL); + dtmf_rx_parms(&tech_pvt->dtmf_state, 0, 10, 10, -99); + +#ifdef GSMOPEN_ALSA + if(tech_pvt->no_sound==0){ + if (alsa_init(tech_pvt)) { + ERRORA("alsa_init failed\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + + } + } +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + if(tech_pvt->no_sound==0){ + if (gsmopen_portaudio_init(tech_pvt)) { + ERRORA("gsmopen_portaudio_init failed\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + + } + } +#endif// GSMOPEN_PORTAUDIO + + if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, gsmopen_module_pool) != + SWITCH_STATUS_SUCCESS) { + ERRORA("setup timer failed\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + } + + switch_core_timer_sync(&tech_pvt->timer_read); + + if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, tech_pvt->write_codec.implementation->samples_per_packet, gsmopen_module_pool) != + SWITCH_STATUS_SUCCESS) { + ERRORA("setup timer failed\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + } + + switch_core_timer_sync(&tech_pvt->timer_write); + +#ifdef WANT_SPEEX + /* Echo canceller with 100 ms tail length */ +#ifndef GIOVA48 + tech_pvt->echo_state = speex_echo_state_init(160, 1024); + ciapa = 8000; +#else// GIOVA48 + tech_pvt->echo_state = speex_echo_state_init(960, 4800); + ciapa = 48000; +#endif // GIOVA48 + speex_echo_ctl(tech_pvt->echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &ciapa); + +#if 1 //NO MORE + /* Setup preprocessor and associate with echo canceller for residual echo suppression */ +#ifndef GIOVA48 + tech_pvt->preprocess = speex_preprocess_state_init(160, 8000); +#else// GIOVA48 + tech_pvt->preprocess = speex_preprocess_state_init(960, 48000); +#endif // GIOVA48 + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_ECHO_STATE, + tech_pvt->echo_state); + +#if 0 + /* Setup preprocessor various other goodies */ + tmp = 0; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_AGC, &tmp); + //level=8000.1; + //speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_AGC_LEVEL, &level); + + // Let's turn off all of the 'denoisers' (eg denoise and dereverb, and vad too) because they start automatic gain on mic input on cm108 usb, also if it (the agc on usb) disbled through mixer + tmp = 0; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); + tmp = 0; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DEREVERB, &tmp); + tmp = 0; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_VAD, &tmp); +#endif + + tmp = 0; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC, &tmp); + fprintf(stderr, "AGC is: %d\n", tmp); + level = 1.0; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_LEVEL, &level); + fprintf(stderr, "AGC_LEVEL is: %f\n", level); + //tmp=1; + //speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_TARGET, &tmp); + //fprintf( stderr, "AGC_TARGET is: %d\n", tmp ); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_DENOISE, &tmp); + fprintf(stderr, "DENOISE is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_DEREVERB, &tmp); + fprintf(stderr, "DEREVERB is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_VAD, &tmp); + fprintf(stderr, "VAD is: %d\n", tmp); + +#if 0 + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_NOISE_SUPPRESS, &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_NOISE_SUPPRESS is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS, &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE, + &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_MAX_GAIN, &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_INCREMENT, &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_DECREMENT, &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_PROB_START, &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_START is: %d\n", tmp); + tmp = 1; + speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_PROB_CONTINUE, &tmp); + fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_CONTINUE is: %d\n", tmp); +#endif //0 +#endif// 0 //NO MORE + +#endif // WANT_SPEEX + + + + switch_clear_flag(tech_pvt, TFLAG_HANGUP); + DEBUGA_GSMOPEN("gsmopen_codec SUCCESS\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_SUCCESS; +} + +/* BEGIN: Changes here */ +static switch_status_t interface_exists(char *the_interface) +{ + int i; + int interface_id; + + if (*the_interface == '#') { /* look by interface id or interface name */ + the_interface++; + switch_assert(the_interface); + interface_id = atoi(the_interface); + + /* take a number as interface id */ + if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { + if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { + return SWITCH_STATUS_SUCCESS; + } + } else { + /* interface name */ + for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { + if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { + return SWITCH_STATUS_SUCCESS; + break; + } + } + } + } else { /* look by gsmopen_user */ + + + for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.GSMOPEN_INTERFACES[i].gsmopen_user)) { + if (strcmp(globals.GSMOPEN_INTERFACES[i].gsmopen_user, the_interface) == 0) { + return SWITCH_STATUS_SUCCESS; + } + } + } + } + return SWITCH_STATUS_FALSE; +} + +#if 1 +static switch_status_t remove_interface(char *the_interface) +{ + int x = 10; + unsigned int howmany = 8; + int interface_id = -1; + private_t *tech_pvt = NULL; + switch_status_t status; + + //running = 0; + + + //XXX if (*the_interface == '#') { /* remove by interface id or interface name */ + //XXX the_interface++; + switch_assert(the_interface); + interface_id = atoi(the_interface); + + if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { + /* take a number as interface id */ + tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + } else { + + for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { + if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { + tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + break; + } + } + } + //XXX } //else { /* remove by gsmopen_user */ + //for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { + //if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].gsmopen_user, the_interface) == 0) { + //tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + //break; + //} + //} + //} + + if (!tech_pvt) { + DEBUGA_GSMOPEN("interface '%s' does not exist\n", GSMOPEN_P_LOG, the_interface); + goto end; + } + + if (strlen(globals.GSMOPEN_INTERFACES[interface_id].session_uuid_str)) { + DEBUGA_GSMOPEN("interface '%s' is busy\n", GSMOPEN_P_LOG, the_interface); + goto end; + } + + globals.GSMOPEN_INTERFACES[interface_id].running = 0; + + if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { +#if 1 +#ifdef WIN32 + switch_file_write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die +#else /* WIN32 */ + howmany = write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", howmany); +#endif /* WIN32 */ +#endif //0 + DEBUGA_GSMOPEN("HERE will shutdown gsmopen_signaling_thread of '%s'\n", GSMOPEN_P_LOG, the_interface); + } + + if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { +#if 0 +#ifdef WIN32 + if (SendMessage(tech_pvt->GSMopenHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the gsmopen_api_thread_func die + DEBUGA_GSMOPEN("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", GSMOPEN_P_LOG, GetLastError()); + globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread = NULL; + } +#else + XEvent e; + Atom atom1 = XInternAtom(tech_pvt->GSMopenHandles.disp, "GSMOPENCONTROLAPI_MESSAGE_BEGIN", False); + memset(&e, 0, sizeof(e)); + e.xclient.type = ClientMessage; + e.xclient.message_type = atom1; /* leading message */ + e.xclient.display = tech_pvt->GSMopenHandles.disp; + e.xclient.window = tech_pvt->GSMopenHandles.gsmopen_win; + e.xclient.format = 8; + + XSendEvent(tech_pvt->GSMopenHandles.disp, tech_pvt->GSMopenHandles.win, False, 0, &e); + XSync(tech_pvt->GSMopenHandles.disp, False); +#endif //WIN32 +#endif //0 + + DEBUGA_GSMOPEN("HERE will shutdown gsmopen_api_thread of '%s'\n", GSMOPEN_P_LOG, the_interface); + } + + while (x) { + x--; + switch_yield(50000); + } + + if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { + switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread); + } + + if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { + switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread); + } + + switch_mutex_lock(globals.mutex); + if (globals.gsm_console == &globals.GSMOPEN_INTERFACES[interface_id]) { + DEBUGA_GSMOPEN("interface '%s' no more console\n", GSMOPEN_P_LOG, the_interface); + globals.gsm_console = NULL; + } else { + DEBUGA_GSMOPEN("interface '%s' STILL console\n", GSMOPEN_P_LOG, the_interface); + } + memset(&globals.GSMOPEN_INTERFACES[interface_id], '\0', sizeof(private_t)); + globals.real_interfaces--; + switch_mutex_unlock(globals.mutex); + + DEBUGA_GSMOPEN("interface '%s' deleted successfully\n", GSMOPEN_P_LOG, the_interface); + globals.GSMOPEN_INTERFACES[interface_id].running = 1; + end: + //running = 1; + return SWITCH_STATUS_SUCCESS; +} +#endif //0 + +/* END: Changes here */ + +/* + State methods they get called when the state changes to the specific state + returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next + so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it. +*/ +static switch_status_t channel_on_init(switch_core_session_t *session) +{ + switch_channel_t *channel; + private_t *tech_pvt = NULL; + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + //ERRORA("%s CHANNEL INIT\n", GSMOPEN_P_LOG, tech_pvt->name); + switch_set_flag(tech_pvt, TFLAG_IO); + + /* Move channel's state machine to ROUTING. This means the call is trying + to get from the initial start where the call because, to the point + where a destination has been identified. If the channel is simply + left in the initial state, nothing will happen. */ + switch_channel_set_state(channel, CS_ROUTING); + switch_mutex_lock(globals.mutex); + globals.calls++; + + switch_mutex_unlock(globals.mutex); + DEBUGA_GSMOPEN("%s CHANNEL INIT %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_on_destroy(switch_core_session_t *session) +{ + private_t *tech_pvt = NULL; + + tech_pvt = (private_t *) switch_core_session_get_private(session); + + + if (tech_pvt) { + DEBUGA_GSMOPEN("%s CHANNEL DESTROY %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); + + if (switch_core_codec_ready(&tech_pvt->read_codec)) { + switch_core_codec_destroy(&tech_pvt->read_codec); + } + + if (switch_core_codec_ready(&tech_pvt->write_codec)) { + switch_core_codec_destroy(&tech_pvt->write_codec); + } + + switch_core_timer_destroy(&tech_pvt->timer_read); + switch_core_timer_destroy(&tech_pvt->timer_write); + +#ifdef GSMOPEN_ALSA + if(tech_pvt->no_sound==0){ + alsa_shutdown(tech_pvt); + } +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + if(tech_pvt->no_sound==0){ + if (gsmopen_portaudio_shutdown(tech_pvt)) { + ERRORA("gsmopen_portaudio_shutdown failed\n", GSMOPEN_P_LOG); + + } + } +#endif// GSMOPEN_PORTAUDIO + + + *tech_pvt->session_uuid_str = '\0'; + tech_pvt->interface_state = GSMOPEN_STATE_IDLE; + if (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED) { + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + } + switch_core_session_set_private(session, NULL); + } else { + DEBUGA_GSMOPEN("!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(session)); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_on_hangup(switch_core_session_t *session) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + tech_pvt->phone_callflow = CALLFLOW_CALL_HANGUP_REQUESTED; + + if (!switch_channel_test_flag(channel, CF_ANSWERED)) { + if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { + tech_pvt->ob_failed_calls++; + } else { + tech_pvt->ib_failed_calls++; + } + } + + + DEBUGA_GSMOPEN("%s CHANNEL HANGUP\n", GSMOPEN_P_LOG, tech_pvt->name); + switch_clear_flag(tech_pvt, TFLAG_IO); + switch_clear_flag(tech_pvt, TFLAG_VOICE); + switch_set_flag(tech_pvt, TFLAG_HANGUP); + + gsmopen_hangup(tech_pvt); + + //memset(tech_pvt->session_uuid_str, '\0', sizeof(tech_pvt->session_uuid_str)); + //*tech_pvt->session_uuid_str = '\0'; + DEBUGA_GSMOPEN("%s CHANNEL HANGUP\n", GSMOPEN_P_LOG, tech_pvt->name); + switch_mutex_lock(globals.mutex); + globals.calls--; + if (globals.calls < 0) { + globals.calls = 0; + } + + tech_pvt->interface_state = GSMOPEN_STATE_IDLE; + //FIXME if (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED) { + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + //FIXME } + switch_mutex_unlock(globals.mutex); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_on_routing(switch_core_session_t *session) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + DEBUGA_GSMOPEN("%s CHANNEL ROUTING\n", GSMOPEN_P_LOG, tech_pvt->name); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_on_execute(switch_core_session_t *session) +{ + + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + DEBUGA_GSMOPEN("%s CHANNEL EXECUTE\n", GSMOPEN_P_LOG, tech_pvt->name); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + DEBUGA_GSMOPEN("%s CHANNEL KILL_CHANNEL\n", GSMOPEN_P_LOG, tech_pvt->name); + switch (sig) { + case SWITCH_SIG_KILL: + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_KILL\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + //switch_mutex_lock(tech_pvt->flag_mutex); + switch_clear_flag(tech_pvt, TFLAG_IO); + switch_clear_flag(tech_pvt, TFLAG_VOICE); + switch_set_flag(tech_pvt, TFLAG_HANGUP); + //switch_mutex_unlock(tech_pvt->flag_mutex); + break; + case SWITCH_SIG_BREAK: + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_BREAK\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + //switch_set_flag(tech_pvt, TFLAG_BREAK); + //switch_mutex_lock(tech_pvt->flag_mutex); + switch_set_flag(tech_pvt, TFLAG_BREAK); + //switch_mutex_unlock(tech_pvt->flag_mutex); + break; + default: + break; + } + + return SWITCH_STATUS_SUCCESS; +} +static switch_status_t channel_on_consume_media(switch_core_session_t *session) +{ + private_t *tech_pvt = NULL; + + tech_pvt = (private_t *) switch_core_session_get_private(session); + + DEBUGA_GSMOPEN("%s CHANNEL CONSUME_MEDIA\n", GSMOPEN_P_LOG, tech_pvt->name); + return SWITCH_STATUS_SUCCESS; +} + + +static switch_status_t channel_on_exchange_media(switch_core_session_t *session) +{ + private_t *tech_pvt = NULL; + tech_pvt = (private_t *) switch_core_session_get_private(session); + DEBUGA_GSMOPEN("%s CHANNEL EXCHANGE_MEDIA\n", GSMOPEN_P_LOG, tech_pvt->name); + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_on_soft_execute(switch_core_session_t *session) +{ + private_t *tech_pvt = NULL; + tech_pvt = (private_t *) switch_core_session_get_private(session); + DEBUGA_GSMOPEN("%s CHANNEL SOFT_EXECUTE\n", GSMOPEN_P_LOG, tech_pvt->name); + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf) +{ + private_t *tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + DEBUGA_GSMOPEN("%s CHANNEL SEND_DTMF\n", GSMOPEN_P_LOG, tech_pvt->name); + DEBUGA_GSMOPEN("DTMF: %c\n", GSMOPEN_P_LOG, dtmf->digit); + + gsmopen_senddigit(tech_pvt, dtmf->digit); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + switch_byte_t *data; +#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + int samples; + char digit_str[256]; +#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) +#ifdef GSMOPEN_PORTAUDIO +#ifdef WANT_SPEEX + spx_int16_t *speexptr; + spx_int16_t pcm2[160]; + int i; +#endif// GSMOPEN_ALSA +#endif// WANT_SPEEX + + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { + ERRORA("channel not ready \n", GSMOPEN_P_LOG); + //TODO: kill the bastard + return SWITCH_STATUS_FALSE; + } + + + tech_pvt->read_frame.flags = SFF_NONE; + *frame = NULL; + + if (switch_test_flag(tech_pvt, TFLAG_HANGUP)) { + return SWITCH_STATUS_FALSE; + } + +#ifndef GSMOPEN_PORTAUDIO + switch_core_timer_next(&tech_pvt->timer_read); +#endif// GSMOPEN_PORTAUDIO + + if(tech_pvt->no_sound==1){ + goto cng; + } +#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) +#ifdef GSMOPEN_ALSA + //if ((samples = snd_pcm_readi(tech_pvt->alsac, tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) + if ((samples = alsa_read(tech_pvt, (short *) tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + if ((samples = gsmopen_portaudio_read(tech_pvt, (short *) tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) +#endif// GSMOPEN_PORTAUDIO + { + +#ifdef GSMOPEN_PORTAUDIO +#ifdef WANT_SPEEX + + if (tech_pvt->speexecho) { + speexptr = ((spx_int16_t *) tech_pvt->read_frame.data); + /* Perform echo cancellation */ + speex_echo_capture(tech_pvt->echo_state, speexptr, pcm2); +#ifndef GIOVA48 + for (i = 0; i < 160; i++) +#else //GIOVA48 + for (i = 0; i < 960; i++) +#endif //GIOVA48 + speexptr[i] = pcm2[i]; + } + /* Apply noise/echo residual suppression */ + if (tech_pvt->speexpreprocess) { + speex_preprocess_run(tech_pvt->preprocess, speexptr); + } + + DEBUGA_GSMOPEN("read\n", GSMOPEN_P_LOG); +#endif //WANT_SPEEX +#endif // GSMOPEN_PORTAUDIO + + + + + + tech_pvt->read_frame.datalen = samples * 2; + tech_pvt->read_frame.samples = samples; + +#ifndef GSMOPEN_PORTAUDIO + tech_pvt->read_frame.timestamp = tech_pvt->timer_read.samplecount; +#endif// GSMOPEN_PORTAUDIO + + *frame = &tech_pvt->read_frame; + + //status = SWITCH_STATUS_SUCCESS; + switch_set_flag(tech_pvt, TFLAG_VOICE); + } + + //WARNINGA("samples=%d\n", GSMOPEN_P_LOG, samples); + if (samples != 160) { + ERRORA("samples=%d\n", GSMOPEN_P_LOG, samples); + goto cng; + } +//DEBUGA_GSMOPEN("samples=%d tech_pvt->read_frame.timestamp=%d\n", GSMOPEN_P_LOG, samples, tech_pvt->read_frame.timestamp); + +//usleep(17000); +//usleep(17000); + + + + + + memset(digit_str, 0, sizeof(digit_str)); + //teletone_dtmf_detect(&tech_pvt->dtmf_detect, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); + //teletone_dtmf_get(&tech_pvt->dtmf_detect, digit_str, sizeof(digit_str)); + dtmf_rx(&tech_pvt->dtmf_state, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); + dtmf_rx_get(&tech_pvt->dtmf_state, digit_str, sizeof(digit_str)); + + gsmopen_sound_boost(tech_pvt->read_frame.data, tech_pvt->read_frame.samples, tech_pvt->capture_boost); + + if (digit_str[0]) { + switch_time_t new_dtmf_timestamp = switch_time_now(); + if ((new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp) > 350000) { //FIXME: make it configurable + char *p = digit_str; + switch_channel_t *channel = switch_core_session_get_channel(session); + + while (p && *p) { + switch_dtmf_t dtmf = {0}; + dtmf.digit = *p; + dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; + switch_channel_queue_dtmf(channel, &dtmf); + p++; + } + NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", GSMOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, + (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); + tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp; + } + } + while (switch_test_flag(tech_pvt, TFLAG_IO)) { + if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { + switch_clear_flag(tech_pvt, TFLAG_BREAK); + DEBUGA_GSMOPEN("CHANNEL READ FRAME goto CNG\n", GSMOPEN_P_LOG); + goto cng; + } + + if (!switch_test_flag(tech_pvt, TFLAG_IO)) { + DEBUGA_GSMOPEN("CHANNEL READ FRAME not IO\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + } + + if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { + switch_clear_flag(tech_pvt, TFLAG_VOICE); + if (!tech_pvt->read_frame.datalen) { + DEBUGA_GSMOPEN("CHANNEL READ CONTINUE\n", GSMOPEN_P_LOG); + continue; + } + *frame = &tech_pvt->read_frame; +#ifdef BIGENDIAN + if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { + switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2); + } +#endif + //WARNINGA("HERE\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_SUCCESS; + } + + WARNINGA("HERE\n", GSMOPEN_P_LOG); + DEBUGA_GSMOPEN("CHANNEL READ no TFLAG_VOICE\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; + + } + + DEBUGA_GSMOPEN("CHANNEL READ FALSE\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_FALSE; +#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + cng: + data = (switch_byte_t *) tech_pvt->read_frame.data; + data[0] = 65; + data[1] = 0; + tech_pvt->read_frame.datalen = 2; + tech_pvt->read_frame.flags = SFF_CNG; + *frame = &tech_pvt->read_frame; +#ifdef GSMOPEN_PORTAUDIO + //speex_echo_state_reset(tech_pvt->stream->echo_state); +#endif // GSMOPEN_PORTAUDIO + return SWITCH_STATUS_SUCCESS; + +} + +static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; +#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + unsigned int sent; +#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) +#ifdef GSMOPEN_PORTAUDIO +#ifdef WANT_SPEEX + spx_int16_t *speexptr; +#endif// GSMOPEN_ALSA +#endif// WANT_SPEEX + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { + ERRORA("channel not ready \n", GSMOPEN_P_LOG); + //TODO: kill the bastard + return SWITCH_STATUS_FALSE; + } +#ifdef BIGENDIAN + if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { +#ifdef WIN32 + switch_swap_linear((int16_t *)frame->data, (int) frame->datalen / 2); +#else + switch_swap_linear(frame->data, (int) frame->datalen / 2); +#endif //WIN32 + } +#endif + + //switch_core_timer_next(&tech_pvt->timer_write); + //sent = frame->datalen; + + //ERRORA("PLAY \n", GSMOPEN_P_LOG); + //snd_pcm_writei(tech_pvt->alsap, (short *) frame->data, (int) (frame->datalen / 2)); + + gsmopen_sound_boost(frame->data, frame->samples, tech_pvt->playback_boost); +#ifdef GSMOPEN_ALSA + + switch_core_timer_next(&tech_pvt->timer_write); + sent = alsa_write(tech_pvt, (short *) frame->data, (int) (frame->datalen)); +//DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent); + + if (sent && sent != frame->datalen / 2 && sent != -1) { + DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent); + } +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + sent = gsmopen_portaudio_write(tech_pvt, (short *) frame->data, (int) (frame->datalen)); +//DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent); + + if (sent && sent != frame->datalen / 2 && sent != -1) { + DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent); + } + +#ifdef WANT_SPEEX + if (tech_pvt->speexecho) { + speexptr = (spx_int16_t *) frame->data; + /* Put frame into playback buffer */ + speex_echo_playback(tech_pvt->echo_state, speexptr); + DEBUGA_GSMOPEN("write\n", GSMOPEN_P_LOG); + } +#endif //WANT_SPEEX +#endif // GSMOPEN_PORTAUDIO + //NOTICA("sent=%d\n", GSMOPEN_P_LOG, sent); + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_answer_channel(switch_core_session_t *session) +{ + private_t *tech_pvt; + switch_channel_t *channel = NULL; + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + //ERRORA("%s CHANNEL INIT\n", GSMOPEN_P_LOG, tech_pvt->name); + switch_set_flag(tech_pvt, TFLAG_IO); + gsmopen_serial_answer(tech_pvt); + + /* Move channel's state machine to ROUTING. This means the call is trying + to get from the initial start where the call because, to the point + where a destination has been identified. If the channel is simply + left in the initial state, nothing will happen. */ + switch_channel_set_state(channel, CS_ROUTING); + switch_mutex_lock(globals.mutex); + globals.calls++; + + switch_mutex_unlock(globals.mutex); + DEBUGA_GSMOPEN("%s CHANNEL ANSWER %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); + + + + + + + + + + + + + + + + + DEBUGA_GSMOPEN("ANSWERED! \n", GSMOPEN_P_LOG); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg) +{ + switch_channel_t *channel; + private_t *tech_pvt; +#if defined(GSMOPEN_ALSA) + int samples; + short tmp_buffer[1280]; +#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + + channel = switch_core_session_get_channel(session); + switch_assert(channel != NULL); + + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + + switch (msg->message_id) { + case SWITCH_MESSAGE_INDICATE_ANSWER: + { + DEBUGA_GSMOPEN("MSG_ID=%d, TO BE ANSWERED!\n", GSMOPEN_P_LOG, msg->message_id); + channel_answer_channel(session); + } + break; + case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC: + + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + switch_core_timer_sync(&tech_pvt->timer_read); + switch_core_timer_sync(&tech_pvt->timer_write); + +#ifdef GSMOPEN_ALSA + while ((samples = alsa_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 4)) > 160) { + //WARNINGA("read %d samples\n", GSMOPEN_P_LOG, samples); + } +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + //while ((samples = gsmopen_portaudio_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 2)) > 160) { + //WARNINGA("read %d samples\n", GSMOPEN_P_LOG, samples); + //} +#ifdef WANT_SPEEX + speex_echo_state_reset(tech_pvt->echo_state); +#endif// WANT_SPEEX +#endif// GSMOPEN_PORTAUDIO + break; + + + default: + { + DEBUGA_GSMOPEN("MSG_ID=%d\n", GSMOPEN_P_LOG, msg->message_id); + } + break; + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_receive_event(switch_core_session_t *session, switch_event_t *event) +{ + struct private_object *tech_pvt = (struct private_object *) switch_core_session_get_private(session); + char *body = switch_event_get_body(event); + switch_assert(tech_pvt != NULL); + + if (!body) { + body = (char *) ""; + } + + WARNINGA("event: |||%s|||\n", GSMOPEN_P_LOG, body); + + return SWITCH_STATUS_SUCCESS; +} + +switch_state_handler_table_t gsmopen_state_handlers = { + /*.on_init */ channel_on_init, + /*.on_routing */ channel_on_routing, + /*.on_execute */ channel_on_execute, + /*.on_hangup */ channel_on_hangup, + /*.on_exchange_media */ channel_on_exchange_media, + /*.on_soft_execute */ channel_on_soft_execute, + /*.on_consume_media */ channel_on_consume_media, + /*.on_hibernate */ NULL, + /*.on_reset */ NULL, + /*.on_park */ NULL, + /*.on_reporting */ NULL, + /*.on_destroy */ channel_on_destroy +}; + +switch_io_routines_t gsmopen_io_routines = { + /*.outgoing_channel */ channel_outgoing_channel, + /*.read_frame */ channel_read_frame, + /*.write_frame */ channel_write_frame, + /*.kill_channel */ channel_kill_channel, + /*.send_dtmf */ channel_send_dtmf, + /*.receive_message */ channel_receive_message, + /*.receive_event */ channel_receive_event +}; + +static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, + switch_event_t *var_event, + switch_caller_profile_t *outbound_profile, + switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, + switch_call_cause_t *cancel_cause) +{ + private_t *tech_pvt = NULL; + if ((*new_session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) { + switch_channel_t *channel = NULL; + switch_caller_profile_t *caller_profile; + char *rdest; + int found = 0; + char interface_name[256]; + + DEBUGA_GSMOPEN("1 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); + switch_core_session_add_stream(*new_session, NULL); + + + if (!zstr(outbound_profile->destination_number)) { + int i; + char *slash; + + switch_copy_string(interface_name, outbound_profile->destination_number, 255); + slash = strrchr(interface_name, '/'); + *slash = '\0'; + + switch_mutex_lock(globals.mutex); + if (strncmp("ANY", interface_name, strlen(interface_name)) == 0 || strncmp("RR", interface_name, strlen(interface_name)) == 0) { + /* we've been asked for the "ANY" interface, let's find the first idle interface */ + //DEBUGA_GSMOPEN("Finding one available gsmopen interface\n", GSMOPEN_P_LOG); + //tech_pvt = find_available_gsmopen_interface(NULL); + //if (tech_pvt) + //found = 1; + //} else if (strncmp("RR", interface_name, strlen(interface_name)) == 0) { + /* Find the first idle interface using Round Robin */ + DEBUGA_GSMOPEN("Finding one available gsmopen interface RR\n", GSMOPEN_P_LOG); + tech_pvt = find_available_gsmopen_interface_rr(NULL); + if (tech_pvt) { + found = 1; + DEBUGA_GSMOPEN("FOUND one available gsmopen interface RR\n", GSMOPEN_P_LOG); + } + } + + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, interface_name, strlen(interface_name)) == 0)) { + if (strlen(globals.GSMOPEN_INTERFACES[i].session_uuid_str)) { + DEBUGA_GSMOPEN + ("globals.GSMOPEN_INTERFACES[%d].name=|||%s||| session_uuid_str=|||%s||| is BUSY\n", + GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].session_uuid_str); + DEBUGA_GSMOPEN("1 SESSION_DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); + switch_core_session_destroy(new_session); + switch_mutex_unlock(globals.mutex); + return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; + } + + DEBUGA_GSMOPEN("globals.GSMOPEN_INTERFACES[%d].name=|||%s|||?\n", GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name); + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + found = 1; + break; + } + + } + + } else { + ERRORA("Doh! no destination number?\n", GSMOPEN_P_LOG); + switch_core_session_destroy(new_session); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + + if (!found) { + DEBUGA_GSMOPEN("Doh! no available interface for |||%s|||?\n", GSMOPEN_P_LOG, interface_name); + DEBUGA_GSMOPEN("2 SESSION_DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); + switch_core_session_destroy(new_session); + switch_mutex_unlock(globals.mutex); + //return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; + } + + channel = switch_core_session_get_channel(*new_session); + if (!channel) { + ERRORA("Doh! no channel?\n", GSMOPEN_P_LOG); + switch_core_session_destroy(new_session); + switch_mutex_unlock(globals.mutex); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + if (gsmopen_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) { + ERRORA("Doh! no tech_init?\n", GSMOPEN_P_LOG); + switch_core_session_destroy(new_session); + switch_mutex_unlock(globals.mutex); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + + + if (outbound_profile) { + char name[128]; + + snprintf(name, sizeof(name), "gsmopen/%s", outbound_profile->destination_number); + //snprintf(name, sizeof(name), "gsmopen/%s", tech_pvt->name); + switch_channel_set_name(channel, name); + caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); + switch_channel_set_caller_profile(channel, caller_profile); + tech_pvt->caller_profile = caller_profile; + } else { + ERRORA("Doh! no caller profile\n", GSMOPEN_P_LOG); + switch_core_session_destroy(new_session); + switch_mutex_unlock(globals.mutex); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + + tech_pvt->ob_calls++; + + rdest = strchr(caller_profile->destination_number, '/'); + *rdest++ = '\0'; + + //gsmopen_call(tech_pvt, rdest, 30); + + switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(*new_session), sizeof(tech_pvt->session_uuid_str)); + caller_profile = tech_pvt->caller_profile; + caller_profile->destination_number = rdest; + + switch_set_flag(tech_pvt, TFLAG_OUTBOUND); + switch_channel_set_state(channel, CS_INIT); + gsmopen_call(tech_pvt, rdest, 30); + switch_mutex_unlock(globals.mutex); + return SWITCH_CAUSE_SUCCESS; + } + + ERRORA("Doh! no new_session\n", GSMOPEN_P_LOG); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; +} + +/*! + * \brief This thread runs during a call, and monitor the interface for signaling, like hangup, caller id, etc most of signaling is handled inside the gsmopen_signaling_read function + * + */ + +static switch_status_t load_config(int reload_type) +{ + const char *cf = "gsmopen.conf"; + switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; + private_t *tech_pvt = NULL; + + switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, gsmopen_module_pool); + if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { + ERRORA("open of %s failed\n", GSMOPEN_P_LOG, cf); + running = 0; + switch_xml_free(xml); + return SWITCH_STATUS_TERM; + } + + switch_mutex_lock(globals.mutex); + if ((global_settings = switch_xml_child(cfg, "global_settings"))) { + for (param = switch_xml_child(global_settings, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "debug")) { + DEBUGA_GSMOPEN("globals.debug=%d\n", GSMOPEN_P_LOG, globals.debug); + globals.debug = atoi(val); + DEBUGA_GSMOPEN("globals.debug=%d\n", GSMOPEN_P_LOG, globals.debug); + } else if (!strcasecmp(var, "hold-music")) { + switch_set_string(globals.hold_music, val); + DEBUGA_GSMOPEN("globals.hold_music=%s\n", GSMOPEN_P_LOG, globals.hold_music); + } else if (!strcmp(var, "dialplan")) { + set_global_dialplan(val); + DEBUGA_GSMOPEN("globals.dialplan=%s\n", GSMOPEN_P_LOG, globals.dialplan); + } else if (!strcmp(var, "destination")) { + set_global_destination(val); + DEBUGA_GSMOPEN("globals.destination=%s\n", GSMOPEN_P_LOG, globals.destination); + } else if (!strcmp(var, "context")) { + set_global_context(val); + DEBUGA_GSMOPEN("globals.context=%s\n", GSMOPEN_P_LOG, globals.context); + + } + + } + } + + if ((interfaces = switch_xml_child(cfg, "per_interface_settings"))) { + int i = 0; + + for (myinterface = switch_xml_child(interfaces, "interface"); myinterface; myinterface = myinterface->next) { + char *id = (char *) switch_xml_attr(myinterface, "id"); + char *name = (char *) switch_xml_attr(myinterface, "name"); + const char *context = "default"; + const char *dialplan = "XML"; + const char *destination = "5000"; + const char *controldevice_name = "/dev/ttyACM0"; + char *digit_timeout = NULL; + char *max_digits = NULL; + char *hotline = NULL; + char *dial_regex = NULL; + char *hold_music = NULL; + char *fail_dial_regex = NULL; + const char *enable_callerid = "true"; + + + const char *at_dial_pre_number = "ATD"; + const char *at_dial_post_number = ";"; + const char *at_dial_expect = "OK"; + const char *at_hangup = "ATH"; + const char *at_hangup_expect = "OK"; + const char *at_answer = "ATA"; + const char *at_answer_expect = "OK"; + const char *at_send_dtmf = "AT+VTS"; + const char *at_preinit_1 = ""; + const char *at_preinit_1_expect = ""; + const char *at_preinit_2 = ""; + const char *at_preinit_2_expect = ""; + const char *at_preinit_3 = ""; + const char *at_preinit_3_expect = ""; + const char *at_preinit_4 = ""; + const char *at_preinit_4_expect = ""; + const char *at_preinit_5 = ""; + const char *at_preinit_5_expect = ""; + const char *at_postinit_1 = "at+cmic=0,9"; + const char *at_postinit_1_expect = "OK"; + const char *at_postinit_2 = "AT+CKPD=\"EEE\""; + const char *at_postinit_2_expect = "OK"; + const char *at_postinit_3 = "AT+CSSN=1,0"; + const char *at_postinit_3_expect = "OK"; + const char *at_postinit_4 = "at+sidet=0"; + const char *at_postinit_4_expect = "OK"; + const char *at_postinit_5 = "at+clvl=99"; + const char *at_postinit_5_expect = "OK"; + const char *at_query_battchg = "AT+CBC"; + const char *at_query_battchg_expect = "OK"; + const char *at_query_signal = "AT+CSQ"; + const char *at_query_signal_expect = "OK"; + const char *at_call_idle = "+MCST: 1"; + const char *at_call_incoming = "+MCST: 2"; + const char *at_call_active = "+CSSI: 7"; + const char *at_call_failed = "+MCST: 65"; + const char *at_call_calling = "+CSSI: 1"; + const char *at_indicator_noservice_string = "CIEV: 2;0"; + const char *at_indicator_nosignal_string = "CIEV: 5;0"; + const char *at_indicator_lowsignal_string = "CIEV: 5;1"; + const char *at_indicator_lowbattchg_string = "CIEV: 0;1"; + const char *at_indicator_nobattchg_string = "CIEV: 0;0"; + const char *at_indicator_callactive_string = "CIEV: 3;1"; + const char *at_indicator_nocallactive_string = "CIEV: 3;0"; + const char *at_indicator_nocallsetup_string = "CIEV: 6;0"; + const char *at_indicator_callsetupincoming_string = "CIEV: 6;1"; + const char *at_indicator_callsetupoutgoing_string = "CIEV: 6;2"; + const char *at_indicator_callsetupremoteringing_string = "CIEV: 6;3"; + //const char *sms_receiving_program = "/usr/local/bin/ciapalo"; + const char *alsacname = "plughw:1"; + const char *alsapname = "plughw:1"; + const char *at_early_audio = "0"; + const char *at_after_preinit_pause = "500000"; + const char *at_initial_pause = "500000"; + const char *at_has_clcc = "0"; + const char *at_has_ecam = "0"; + const char *alsa_period_size = "160"; + const char *alsa_periods_in_buffer = "4"; + const char *gsmopen_sound_rate = "8000"; + const char *alsa_play_is_mono = "1"; + const char *alsa_capture_is_mono = "1"; + const char *capture_boost = "5"; + const char *playback_boost = "10"; +#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + const char *no_sound = "0"; +#else + const char *no_sound = "1"; +#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + const char *portaudiocindex = "1"; + const char *portaudiopindex = "1"; + const char *speexecho = "1"; + const char *speexpreprocess = "1"; + + uint32_t interface_id = 0; +#ifdef WIN32 + int controldevice_speed = 115200; //FIXME TODO +#else + uint32_t controldevice_speed = B115200; //FIXME TODO +#endif //WIN32 + uint32_t controldevprotocol = PROTOCOL_AT; //FIXME TODO + uint32_t running = 1; //FIXME TODO + const char *gsmopen_serial_sync_period = "300"; //FIXME TODO + + + + tech_pvt = NULL; + + for (param = switch_xml_child(myinterface, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "id")) { + id = val; + } else if (!strcasecmp(var, "name")) { + name = val; + } else if (!strcasecmp(var, "context")) { + context = val; + } else if (!strcasecmp(var, "dialplan")) { + dialplan = val; + } else if (!strcasecmp(var, "destination")) { + destination = val; + } else if (!strcasecmp(var, "controldevice_name")) { + controldevice_name = val; + } else if (!strcasecmp(var, "digit_timeout")) { + digit_timeout = val; + } else if (!strcasecmp(var, "max_digits")) { + max_digits = val; + } else if (!strcasecmp(var, "hotline")) { + hotline = val; + } else if (!strcasecmp(var, "dial_regex")) { + dial_regex = val; + } else if (!strcasecmp(var, SWITCH_HOLD_MUSIC_VARIABLE)) { + hold_music = val; + } else if (!strcasecmp(var, "fail_dial_regex")) { + fail_dial_regex = val; + } else if (!strcasecmp(var, "enable_callerid")) { + enable_callerid = val; + } else if (!strcasecmp(var, "at_dial_pre_number")) { + at_dial_pre_number = val; + } else if (!strcasecmp(var, "at_dial_post_number")) { + at_dial_post_number = val; + } else if (!strcasecmp(var, "at_dial_expect")) { + at_dial_expect = val; + } else if (!strcasecmp(var, "at_hangup")) { + at_hangup = val; + } else if (!strcasecmp(var, "at_hangup_expect")) { + at_hangup_expect = val; + } else if (!strcasecmp(var, "at_answer")) { + at_answer = val; + } else if (!strcasecmp(var, "at_answer_expect")) { + at_answer_expect = val; + } else if (!strcasecmp(var, "at_send_dtmf")) { + at_send_dtmf = val; + } else if (!strcasecmp(var, "at_preinit_1")) { + at_preinit_1 = val; + } else if (!strcasecmp(var, "at_preinit_1_expect")) { + at_preinit_1_expect = val; + } else if (!strcasecmp(var, "at_preinit_2")) { + at_preinit_2 = val; + } else if (!strcasecmp(var, "at_preinit_2_expect")) { + at_preinit_2_expect = val; + } else if (!strcasecmp(var, "at_preinit_3")) { + at_preinit_3 = val; + } else if (!strcasecmp(var, "at_preinit_3_expect")) { + at_preinit_3_expect = val; + } else if (!strcasecmp(var, "at_preinit_4")) { + at_preinit_4 = val; + } else if (!strcasecmp(var, "at_preinit_4_expect")) { + at_preinit_4_expect = val; + } else if (!strcasecmp(var, "at_preinit_5")) { + at_preinit_5 = val; + } else if (!strcasecmp(var, "at_preinit_5_expect")) { + at_preinit_5_expect = val; + } else if (!strcasecmp(var, "at_postinit_1")) { + at_postinit_1 = val; + } else if (!strcasecmp(var, "at_postinit_1_expect")) { + at_postinit_1_expect = val; + } else if (!strcasecmp(var, "at_postinit_2")) { + at_postinit_2 = val; + } else if (!strcasecmp(var, "at_postinit_2_expect")) { + at_postinit_2_expect = val; + } else if (!strcasecmp(var, "at_postinit_3")) { + at_postinit_3 = val; + } else if (!strcasecmp(var, "at_postinit_3_expect")) { + at_postinit_3_expect = val; + } else if (!strcasecmp(var, "at_postinit_4")) { + at_postinit_4 = val; + } else if (!strcasecmp(var, "at_postinit_4_expect")) { + at_postinit_4_expect = val; + } else if (!strcasecmp(var, "at_postinit_5")) { + at_postinit_5 = val; + } else if (!strcasecmp(var, "at_postinit_5_expect")) { + at_postinit_5_expect = val; + } else if (!strcasecmp(var, "at_query_battchg")) { + at_query_battchg = val; + } else if (!strcasecmp(var, "at_query_battchg_expect")) { + at_query_battchg_expect = val; + } else if (!strcasecmp(var, "at_query_signal")) { + at_query_signal = val; + } else if (!strcasecmp(var, "at_query_signal_expect")) { + at_query_signal_expect = val; + } else if (!strcasecmp(var, "at_call_idle")) { + at_call_idle = val; + } else if (!strcasecmp(var, "at_call_incoming")) { + at_call_incoming = val; + } else if (!strcasecmp(var, "at_call_active")) { + at_call_active = val; + } else if (!strcasecmp(var, "at_call_failed")) { + at_call_failed = val; + } else if (!strcasecmp(var, "at_call_calling")) { + at_call_calling = val; + } else if (!strcasecmp(var, "at_indicator_noservice_string")) { + at_indicator_noservice_string = val; + } else if (!strcasecmp(var, "at_indicator_nosignal_string")) { + at_indicator_nosignal_string = val; + } else if (!strcasecmp(var, "at_indicator_lowsignal_string")) { + at_indicator_lowsignal_string = val; + } else if (!strcasecmp(var, "at_indicator_lowbattchg_string")) { + at_indicator_lowbattchg_string = val; + } else if (!strcasecmp(var, "at_indicator_nobattchg_string")) { + at_indicator_nobattchg_string = val; + } else if (!strcasecmp(var, "at_indicator_callactive_string")) { + at_indicator_callactive_string = val; + } else if (!strcasecmp(var, "at_indicator_nocallactive_string")) { + at_indicator_nocallactive_string = val; + } else if (!strcasecmp(var, "at_indicator_nocallsetup_string")) { + at_indicator_nocallsetup_string = val; + } else if (!strcasecmp(var, "at_indicator_callsetupincoming_string")) { + at_indicator_callsetupincoming_string = val; + } else if (!strcasecmp(var, "at_indicator_callsetupoutgoing_string")) { + at_indicator_callsetupoutgoing_string = val; + } else if (!strcasecmp(var, "at_indicator_callsetupremoteringing_string")) { + at_indicator_callsetupremoteringing_string = val; + //} else if (!strcasecmp(var, "sms_receiving_program")) { + //sms_receiving_program = val; + } else if (!strcasecmp(var, "alsacname")) { + alsacname = val; + } else if (!strcasecmp(var, "alsapname")) { + alsapname = val; + } else if (!strcasecmp(var, "portaudiocindex")) { + portaudiocindex = val; + } else if (!strcasecmp(var, "portaudiopindex")) { + portaudiopindex = val; + } else if (!strcasecmp(var, "speexecho")) { + speexecho = val; + } else if (!strcasecmp(var, "speexpreprocess")) { + speexpreprocess = val; + } else if (!strcasecmp(var, "at_early_audio")) { + at_early_audio = val; + } else if (!strcasecmp(var, "at_after_preinit_pause")) { + at_after_preinit_pause = val; + } else if (!strcasecmp(var, "at_initial_pause")) { + at_initial_pause = val; + } else if (!strcasecmp(var, "at_has_clcc")) { + at_has_clcc = val; + } else if (!strcasecmp(var, "at_has_ecam")) { + at_has_ecam = val; + } else if (!strcasecmp(var, "alsa_period_size")) { + alsa_period_size = val; + } else if (!strcasecmp(var, "alsa_periods_in_buffer")) { + alsa_periods_in_buffer = val; + } else if (!strcasecmp(var, "gsmopen_sound_rate")) { + gsmopen_sound_rate = val; + } else if (!strcasecmp(var, "alsa_play_is_mono")) { + alsa_play_is_mono = val; + } else if (!strcasecmp(var, "alsa_capture_is_mono")) { + alsa_capture_is_mono = val; + } else if (!strcasecmp(var, "capture_boost")) { + capture_boost = val; + } else if (!strcasecmp(var, "playback_boost")) { + playback_boost = val; + } else if (!strcasecmp(var, "no_sound")) { + no_sound = val; + } else if (!strcasecmp(var, "gsmopen_serial_sync_period")) { + gsmopen_serial_sync_period = val; + } + + + } + + /* BEGIN: Changes here */ + if (reload_type == SOFT_RELOAD) { + char the_interface[256]; + sprintf(the_interface, "#%s", name); + + if (interface_exists(the_interface) == SWITCH_STATUS_SUCCESS) { + continue; + } + } + /* END: Changes here */ + + if (!id) { + ERRORA("interface missing REQUIRED param 'id'\n", GSMOPEN_P_LOG); + continue; + } + + if (switch_is_number(id)) { + interface_id = atoi(id); + } else { + ERRORA("interface param 'id' MUST be a number, now id='%s'\n", GSMOPEN_P_LOG, id); + continue; + } + + if (!switch_is_number(at_early_audio)) { + ERRORA("interface param 'at_early_audio' MUST be a number, now at_early_audio='%s'\n", GSMOPEN_P_LOG, at_early_audio); + continue; + } + if (!switch_is_number(at_after_preinit_pause)) { + ERRORA("interface param 'at_after_preinit_pause' MUST be a number, now at_after_preinit_pause='%s'\n", GSMOPEN_P_LOG, + at_after_preinit_pause); + continue; + } + if (!switch_is_number(at_initial_pause)) { + ERRORA("interface param 'at_initial_pause' MUST be a number, now at_initial_pause='%s'\n", GSMOPEN_P_LOG, at_initial_pause); + continue; + } + if (!switch_is_number(at_has_clcc)) { + ERRORA("interface param 'at_has_clcc' MUST be a number, now at_has_clcc='%s'\n", GSMOPEN_P_LOG, at_has_clcc); + continue; + } + if (!switch_is_number(at_has_ecam)) { + ERRORA("interface param 'at_has_ecam' MUST be a number, now at_has_ecam='%s'\n", GSMOPEN_P_LOG, at_has_ecam); + continue; + } + if (!switch_is_number(alsa_period_size)) { + ERRORA("interface param 'alsa_period_size' MUST be a number, now alsa_period_size='%s'\n", GSMOPEN_P_LOG, alsa_period_size); + continue; + } + if (!switch_is_number(alsa_periods_in_buffer)) { + ERRORA("interface param 'alsa_periods_in_buffer' MUST be a number, now alsa_periods_in_buffer='%s'\n", GSMOPEN_P_LOG, + alsa_periods_in_buffer); + continue; + } + if (!switch_is_number(gsmopen_sound_rate)) { + ERRORA("interface param 'gsmopen_sound_rate' MUST be a number, now gsmopen_sound_rate='%s'\n", GSMOPEN_P_LOG, gsmopen_sound_rate); + continue; + } + if (!switch_is_number(alsa_play_is_mono)) { + ERRORA("interface param 'alsa_play_is_mono' MUST be a number, now alsa_play_is_mono='%s'\n", GSMOPEN_P_LOG, alsa_play_is_mono); + continue; + } + if (!switch_is_number(alsa_capture_is_mono)) { + ERRORA("interface param 'alsa_capture_is_mono' MUST be a number, now alsa_capture_is_mono='%s'\n", GSMOPEN_P_LOG, alsa_capture_is_mono); + continue; + } + if (!switch_is_number(capture_boost)) { + ERRORA("interface param 'capture_boost' MUST be a number, now capture_boost='%s'\n", GSMOPEN_P_LOG, capture_boost); + continue; + } + if (!switch_is_number(playback_boost)) { + ERRORA("interface param 'playback_boost' MUST be a number, now playback_boost='%s'\n", GSMOPEN_P_LOG, playback_boost); + continue; + } + if (!switch_is_number(no_sound)) { + ERRORA("interface param 'no_sound' MUST be a number, now no_sound='%s'\n", GSMOPEN_P_LOG, no_sound); + continue; + } + if (!switch_is_number(gsmopen_serial_sync_period)) { + ERRORA("interface param 'gsmopen_serial_sync_period' MUST be a number, now gsmopen_serial_sync_period='%s'\n", GSMOPEN_P_LOG, gsmopen_serial_sync_period); + continue; + } + + + if (interface_id && interface_id < GSMOPEN_MAX_INTERFACES) { + private_t newconf; + switch_threadattr_t *gsmopen_api_thread_attr = NULL; + int res = 0; + + memset(&newconf, '\0', sizeof(newconf)); + globals.GSMOPEN_INTERFACES[interface_id] = newconf; + + + tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + + switch_mutex_init(&globals.GSMOPEN_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, gsmopen_module_pool); + + + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].id, id); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].name, name); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].context, context); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dialplan, dialplan); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].destination, destination); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].controldevice_name, controldevice_name); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dial_regex, dial_regex); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].hold_music, hold_music); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].fail_dial_regex, fail_dial_regex); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_pre_number, at_dial_pre_number); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_post_number, at_dial_post_number); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_expect, at_dial_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_hangup, at_hangup); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_hangup_expect, at_hangup_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_answer, at_answer); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_answer_expect, at_answer_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_send_dtmf, at_send_dtmf); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_1, at_preinit_1); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_1_expect, at_preinit_1_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_2, at_preinit_2); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_2_expect, at_preinit_2_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_3, at_preinit_3); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_3_expect, at_preinit_3_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_4, at_preinit_4); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_4_expect, at_preinit_4_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_5, at_preinit_5); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_5_expect, at_preinit_5_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_1, at_postinit_1); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_1_expect, at_postinit_1_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_2, at_postinit_2); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_2_expect, at_postinit_2_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_3, at_postinit_3); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_3_expect, at_postinit_3_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_4, at_postinit_4); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_4_expect, at_postinit_4_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_5, at_postinit_5); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_5_expect, at_postinit_5_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_battchg, at_query_battchg); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_battchg_expect, at_query_battchg_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_signal, at_query_signal); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_signal_expect, at_query_signal_expect); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_idle, at_call_idle); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_incoming, at_call_incoming); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_active, at_call_active); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_failed, at_call_failed); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_calling, at_call_calling); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_noservice_string, at_indicator_noservice_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nosignal_string, at_indicator_nosignal_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_lowsignal_string, at_indicator_lowsignal_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_lowbattchg_string, at_indicator_lowbattchg_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nobattchg_string, at_indicator_nobattchg_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callactive_string, at_indicator_callactive_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nocallactive_string, at_indicator_nocallactive_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nocallsetup_string, at_indicator_nocallsetup_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupincoming_string, at_indicator_callsetupincoming_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, at_indicator_callsetupoutgoing_string); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, + at_indicator_callsetupremoteringing_string); + //switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].sms_receiving_program, sms_receiving_program); +#ifdef GSMOPEN_ALSA + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsacname, alsacname); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsapname, alsapname); +#endif// GSMOPEN_ALSA + +#ifdef GSMOPEN_PORTAUDIO + globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex = atoi(portaudiocindex); + globals.GSMOPEN_INTERFACES[interface_id].portaudiopindex = atoi(portaudiopindex); + globals.GSMOPEN_INTERFACES[interface_id].speexecho = atoi(speexecho); + globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess = atoi(speexpreprocess); +#endif// GSMOPEN_PORTAUDIO + globals.GSMOPEN_INTERFACES[interface_id].at_early_audio = atoi(at_early_audio); + globals.GSMOPEN_INTERFACES[interface_id].at_after_preinit_pause = atoi(at_after_preinit_pause); + globals.GSMOPEN_INTERFACES[interface_id].at_initial_pause = atoi(at_initial_pause); + globals.GSMOPEN_INTERFACES[interface_id].at_has_clcc = atoi(at_has_clcc); + globals.GSMOPEN_INTERFACES[interface_id].at_has_ecam = atoi(at_has_ecam); +#ifdef GSMOPEN_ALSA + globals.GSMOPEN_INTERFACES[interface_id].alsa_period_size = atoi(alsa_period_size); + globals.GSMOPEN_INTERFACES[interface_id].alsa_periods_in_buffer = atoi(alsa_periods_in_buffer); + globals.GSMOPEN_INTERFACES[interface_id].gsmopen_sound_rate = atoi(gsmopen_sound_rate); + globals.GSMOPEN_INTERFACES[interface_id].alsa_play_is_mono = atoi(alsa_play_is_mono); + globals.GSMOPEN_INTERFACES[interface_id].alsa_capture_is_mono = atoi(alsa_capture_is_mono); +#endif// GSMOPEN_ALSA + globals.GSMOPEN_INTERFACES[interface_id].capture_boost = atoi(capture_boost); + globals.GSMOPEN_INTERFACES[interface_id].playback_boost = atoi(playback_boost); +#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + globals.GSMOPEN_INTERFACES[interface_id].no_sound = atoi(no_sound); +#else + globals.GSMOPEN_INTERFACES[interface_id].no_sound = 1; +#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period = atoi(gsmopen_serial_sync_period); + + + + globals.GSMOPEN_INTERFACES[interface_id].controldevice_speed = controldevice_speed; //FIXME + globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol = controldevprotocol; //FIXME + globals.GSMOPEN_INTERFACES[interface_id].running = running; //FIXME + + + + WARNINGA("STARTING interface_id=%d\n", GSMOPEN_P_LOG, interface_id); + DEBUGA_GSMOPEN("id=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].id); + DEBUGA_GSMOPEN("name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].name); + DEBUGA_GSMOPEN("hold-music=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].hold_music); + DEBUGA_GSMOPEN("context=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].context); + DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].dialplan); + DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].destination); + DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].controldevice_name); +#ifdef GSMOPEN_ALSA + DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsacname); + DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsapname); +#endif// GSMOPEN_ALSA + + +#ifdef GSMOPEN_PORTAUDIO + //FIXME + //globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex = 1; + //globals.GSMOPEN_INTERFACES[interface_id].portaudiopindex = 1; + //globals.GSMOPEN_INTERFACES[interface_id].speexecho = 1; + //globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess = 1; + DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex); + DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex); + DEBUGA_GSMOPEN("speexecho=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].speexecho); + DEBUGA_GSMOPEN("speexpreprocess=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess); +#endif// GSMOPEN_PORTAUDIO + DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int)globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period); + /* init the serial port */ + if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) { + globals.GSMOPEN_INTERFACES[interface_id].controldevfd = + gsmopen_serial_init(&globals.GSMOPEN_INTERFACES[interface_id], globals.GSMOPEN_INTERFACES[interface_id].controldevice_speed); + if (globals.GSMOPEN_INTERFACES[interface_id].controldevfd == -1) { + ERRORA("gsmopen_serial_init failed\n", GSMOPEN_P_LOG); + ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); + //return SWITCH_STATUS_FALSE; + globals.GSMOPEN_INTERFACES[interface_id].running=0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_init failed"); + globals.GSMOPEN_INTERFACES[interface_id].active=0; + globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + continue; + } + } + + /* config the phone/modem on the serial port */ + if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) { + res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]); + if (res) { + int count = 0; + ERRORA("gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG); + while(res && count < 5){ + switch_sleep(100000); //0.1 seconds + res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]); + count++; + if (res) { + ERRORA("%d: gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG, count); + } + } + if (res) { + ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); + //return SWITCH_STATUS_FALSE; + globals.GSMOPEN_INTERFACES[interface_id].running=0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_config failed"); + globals.GSMOPEN_INTERFACES[interface_id].active=0; + globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + continue; + } + } + } + + if(globals.GSMOPEN_INTERFACES[interface_id].no_sound==0){ +#ifdef GSMOPEN_ALSA + if (alsa_init(&globals.GSMOPEN_INTERFACES[interface_id])) { + ERRORA("alsa_init failed\n", GSMOPEN_P_LOG); + ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); + //return SWITCH_STATUS_FALSE; + globals.GSMOPEN_INTERFACES[interface_id].running=0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "alsa_init failed"); + globals.GSMOPEN_INTERFACES[interface_id].active=0; + globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + continue; + + } + + if (alsa_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { + ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); + ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); + //return SWITCH_STATUS_FALSE; + globals.GSMOPEN_INTERFACES[interface_id].running=0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "alsa_shutdown failed"); + globals.GSMOPEN_INTERFACES[interface_id].active=0; + globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + continue; + + } +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + if (gsmopen_portaudio_init(&globals.GSMOPEN_INTERFACES[interface_id])) { + ERRORA("gsmopen_portaudio_init failed\n", GSMOPEN_P_LOG); + ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); + //return SWITCH_STATUS_FALSE; + globals.GSMOPEN_INTERFACES[interface_id].running=0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_portaudio_init failed"); + globals.GSMOPEN_INTERFACES[interface_id].active=0; + globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + continue; + + } + + if (gsmopen_portaudio_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { + ERRORA("gsmopen_portaudio_shutdown failed\n", GSMOPEN_P_LOG); + ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); + //return SWITCH_STATUS_FALSE; + globals.GSMOPEN_INTERFACES[interface_id].running=0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_portaudio_shutdown failed"); + globals.GSMOPEN_INTERFACES[interface_id].active=0; + globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + continue; + + } +#endif// GSMOPEN_PORTAUDIO + } + + globals.GSMOPEN_INTERFACES[interface_id].active=1; + + //gsmopen_store_boost((char *)"5", &globals.GSMOPEN_INTERFACES[interface_id].capture_boost); //FIXME + //gsmopen_store_boost((char *)"10", &globals.GSMOPEN_INTERFACES[interface_id].playback_boost); //FIXME + gsmopen_store_boost((char *) capture_boost, &globals.GSMOPEN_INTERFACES[interface_id].capture_boost); //FIXME + gsmopen_store_boost((char *) playback_boost, &globals.GSMOPEN_INTERFACES[interface_id].playback_boost); //FIXME + + switch_sleep(100000); + switch_threadattr_create(&gsmopen_api_thread_attr, gsmopen_module_pool); + switch_threadattr_stacksize_set(gsmopen_api_thread_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread, gsmopen_api_thread_attr, gsmopen_do_gsmopenapi_thread, + &globals.GSMOPEN_INTERFACES[interface_id], gsmopen_module_pool); + + switch_sleep(100000); + WARNINGA("STARTED interface_id=%d\n", GSMOPEN_P_LOG, interface_id); + + } else { + ERRORA("interface id %d is higher than GSMOPEN_MAX_INTERFACES (%d)\n", GSMOPEN_P_LOG, interface_id, GSMOPEN_MAX_INTERFACES); + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "interface id is higher than GSMOPEN_MAX_INTERFACES"); + continue; + } + + } + + for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { + /* How many real intterfaces */ + globals.real_interfaces = i + 1; + + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + + DEBUGA_GSMOPEN("id=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].id); + DEBUGA_GSMOPEN("name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].name); + DEBUGA_GSMOPEN("context=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].context); + DEBUGA_GSMOPEN("hold-music=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].hold_music); + DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].dialplan); + DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].destination); + DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_name); +#ifdef GSMOPEN_ALSA + DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsacname); + DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsapname); +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].portaudiocindex); + DEBUGA_GSMOPEN("portaudiopindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].portaudiopindex); + DEBUGA_GSMOPEN("speexecho=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].speexecho); + DEBUGA_GSMOPEN("speexpreprocess=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].speexpreprocess); +#endif// GSMOPEN_PORTAUDIO + DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int)globals.GSMOPEN_INTERFACES[i].gsmopen_serial_sync_period); + + } + } + } + + switch_mutex_unlock(globals.mutex); + switch_xml_free(xml); + + return SWITCH_STATUS_SUCCESS; +} + +//static switch_status_t chat_send(const char *proto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint) +static switch_status_t chat_send(switch_event_t *message_event) +{ + char *user, *host, *f_user = NULL, *f_host = NULL, *f_resource = NULL; + private_t *tech_pvt = NULL; + int i = 0, found = 0; + + const char *proto; + const char *from; + const char *to; + const char *subject; + const char *body; + //const char *type; + const char *hint; + + proto = switch_event_get_header(message_event, "proto"); + from = switch_event_get_header(message_event, "from"); + to = switch_event_get_header(message_event, "to"); + subject = switch_event_get_header(message_event, "subject"); + body = switch_event_get_body(message_event); + //type = switch_event_get_header(message_event, "type"); + hint = switch_event_get_header(message_event, "hint"); + + switch_assert(proto != NULL); + + DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, + hint ? hint : "NULL"); + + if (!to || !strlen(to)) { + ERRORA("Missing To: header.\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_SUCCESS; + } + + if ((!from && !hint) || (!strlen(from) && !strlen(hint))) { + ERRORA("Missing From: AND Hint: headers.\n", GSMOPEN_P_LOG); + return SWITCH_STATUS_SUCCESS; + } + + if (from && (f_user = strdup(from))) { + if ((f_host = strchr(f_user, '@'))) { + *f_host++ = '\0'; + if ((f_resource = strchr(f_host, '/'))) { + *f_resource++ = '\0'; + } + } + } + + if (!strlen(hint)) { //FIXME FIXME FIXME + hint = from; + } + if (to && (user = strdup(to))) { + if ((host = strchr(user, '@'))) { + *host++ = '\0'; + } + + DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, + hint ? hint : "NULL"); + if (hint && strlen(hint)) { + //in hint we receive the interface name to use + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, hint, strlen(hint)) == 0)) { + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + DEBUGA_GSMOPEN("Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", GSMOPEN_P_LOG, i, + globals.GSMOPEN_INTERFACES[i].name); + found = 1; + break; + } + } + } /* FIXME add a tech_pvt member for the SIM telephone number //else { + //we have no a predefined interface name to use (hint is NULL), so let's choose an interface from the username (from) + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].skype_user, from, strlen(from)) == 0)) { + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + DEBUGA_GSMOPEN("Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name); + found = 1; + break; + } + } + } + */ + if (!found) { + ERRORA("ERROR: A GSMopen interface with name='%s' or one with SIM_number='%s' was not found\n", GSMOPEN_P_LOG, hint ? hint : "NULL", + from ? from : "NULL"); + goto end; + } else { + gsmopen_sendsms(tech_pvt, (char *) to, (char *) body); + } + } + end: + switch_safe_free(user); + switch_safe_free(f_user); + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t compat_chat_send(const char *proto, const char *from, const char *to, + const char *subject, const char *body, const char *type, const char *hint) +{ + switch_event_t *message_event; + switch_status_t status; + + if (switch_event_create(&message_event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "proto", proto); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "from", from); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "to", to); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint); + + if (body) { + switch_event_add_body(message_event, "%s", body); + } + } else { + abort(); + } + + status = chat_send(message_event); + switch_event_destroy(&message_event); + + return status; + +} + +SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load) +{ + switch_api_interface_t *commands_api_interface; + switch_chat_interface_t *chat_interface; + + gsmopen_module_pool = pool; + memset(&globals, '\0', sizeof(globals)); + + running = 1; + + if (load_config(FULL_RELOAD) != SWITCH_STATUS_SUCCESS) { + running = 0; + return SWITCH_STATUS_FALSE; + } + + if (switch_event_reserve_subclass(MY_EVENT_INCOMING_SMS) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass!\n"); + return SWITCH_STATUS_GENERR; + } + + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + gsmopen_endpoint_interface = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); + gsmopen_endpoint_interface->interface_name = "gsmopen"; + gsmopen_endpoint_interface->io_routines = &gsmopen_io_routines; + gsmopen_endpoint_interface->state_handler = &gsmopen_state_handlers; + + if (running) { + +#if 1 + SWITCH_ADD_API(commands_api_interface, "gsm", "gsm console AT_command", gsm_function, GSM_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "gsmopen", "gsmopen interface AT_command", gsmopen_function, GSMOPEN_SYNTAX); +#endif //0 + SWITCH_ADD_API(commands_api_interface, "gsmopen_boost_audio", "gsmopen_boost_audio interface AT_command", gsmopen_boost_audio_function, GSMOPEN_BOOST_AUDIO_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "gsmopen_dump", "gsmopen_dump interface", gsmopen_dump_function, GSMOPEN_DUMP_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "gsmopen_sendsms", "gsmopen_sendsms interface destination_number SMS_text", sendsms_function, + SENDSMS_SYNTAX); + SWITCH_ADD_CHAT(chat_interface, GSMOPEN_CHAT_PROTO, chat_send); + + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; + } else + return SWITCH_STATUS_FALSE; +} + +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown) +{ + int x; + private_t *tech_pvt = NULL; + switch_status_t status; + unsigned int howmany = 8; + int interface_id; + int fd; + + running = 0; + + for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { + tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + + if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { + WARNINGA("SHUTDOWN interface_id=%d\n", GSMOPEN_P_LOG, interface_id); + globals.GSMOPEN_INTERFACES[interface_id].running = 0; + if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { +#ifdef WIN32 + switch_file_write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die +#else /* WIN32 */ + howmany = write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", howmany); +#endif /* WIN32 */ + } + x = 10; + while (x) { //FIXME 0.5 seconds? + x--; + switch_yield(50000); + } + if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { + switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread); + } + if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { + switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread); + } + + x = 10; + while (x) { //FIXME 0.5 seconds? + x--; + switch_yield(50000); + } + fd = tech_pvt->controldevfd; + //DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); + if (fd) { + //close(fd); + //tech_pvt->controldevfd = -1; + DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); + } +#ifndef WIN32 + shutdown(tech_pvt->audiogsmopenpipe[0], 2); + close(tech_pvt->audiogsmopenpipe[0]); + shutdown(tech_pvt->audiogsmopenpipe[1], 2); + close(tech_pvt->audiogsmopenpipe[1]); + shutdown(tech_pvt->audiopipe[0], 2); + close(tech_pvt->audiopipe[0]); + shutdown(tech_pvt->audiopipe[1], 2); + close(tech_pvt->audiopipe[1]); + shutdown(tech_pvt->GSMopenHandles.fdesc[0], 2); + close(tech_pvt->GSMopenHandles.fdesc[0]); + shutdown(tech_pvt->GSMopenHandles.fdesc[1], 2); + close(tech_pvt->GSMopenHandles.fdesc[1]); +#endif /* WIN32 */ + } + + } + + switch_event_free_subclass(MY_EVENT_INCOMING_SMS); + + switch_safe_free(globals.dialplan); + switch_safe_free(globals.context); + switch_safe_free(globals.destination); + switch_safe_free(globals.codec_string); + switch_safe_free(globals.codec_rates_string); + + return SWITCH_STATUS_SUCCESS; +} + + +void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj) +{ + return gsmopen_do_gsmopenapi_thread_func(obj); +} + +int dtmf_received(private_t * tech_pvt, char *value) +{ + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + channel = switch_core_session_get_channel(session); + + if (channel) { + + if (!switch_channel_test_flag(channel, CF_BRIDGED)) { + + switch_dtmf_t dtmf = { (char) value[0], switch_core_default_dtmf_duration(0) }; + DEBUGA_GSMOPEN("received DTMF %c on channel %s\n", GSMOPEN_P_LOG, dtmf.digit, switch_channel_get_name(channel)); + switch_mutex_lock(tech_pvt->flag_mutex); + //FIXME: why sometimes DTMFs from here do not seems to be get by FS? + switch_channel_queue_dtmf(channel, &dtmf); + switch_set_flag(tech_pvt, TFLAG_DTMF); + switch_mutex_unlock(tech_pvt->flag_mutex); + } else { + DEBUGA_GSMOPEN + ("received a DTMF on channel %s, but we're BRIDGED, so let's NOT relay it out of band\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + } + } else { + WARNINGA("received %c DTMF, but no channel?\n", GSMOPEN_P_LOG, value[0]); + } + switch_core_session_rwunlock(session); + + return 0; +} + +int new_inbound_channel(private_t * tech_pvt) +{ + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + switch_assert(tech_pvt != NULL); + tech_pvt->ib_calls++; + if ((session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) { + DEBUGA_GSMOPEN("2 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(session)); + switch_core_session_add_stream(session, NULL); + channel = switch_core_session_get_channel(session); + if (!channel) { + ERRORA("Doh! no channel?\n", GSMOPEN_P_LOG); + switch_core_session_destroy(&session); + return 0; + } + if (gsmopen_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) { + ERRORA("Doh! no tech_init?\n", GSMOPEN_P_LOG); + switch_core_session_destroy(&session); + return 0; + } + + if ((tech_pvt->caller_profile = + switch_caller_profile_new(switch_core_session_get_pool(session), "gsmopen", + tech_pvt->dialplan, tech_pvt->callid_name, + tech_pvt->callid_number, NULL, NULL, NULL, NULL, "mod_gsmopen", tech_pvt->context, tech_pvt->destination)) != 0) { + char name[128]; + //switch_snprintf(name, sizeof(name), "gsmopen/%s/%s", tech_pvt->name, tech_pvt->caller_profile->destination_number); + switch_snprintf(name, sizeof(name), "gsmopen/%s", tech_pvt->name); + switch_channel_set_name(channel, name); + switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); + } + switch_channel_set_state(channel, CS_INIT); + if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { + ERRORA("Error spawning thread\n", GSMOPEN_P_LOG); + switch_core_session_destroy(&session); + return 0; + } + } + if (channel) { + //switch_channel_mark_answered(channel); + } + + DEBUGA_GSMOPEN("new_inbound_channel\n", GSMOPEN_P_LOG); + + return 0; +} + +int remote_party_is_ringing(private_t * tech_pvt) +{ + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + if (!zstr(tech_pvt->session_uuid_str)) { + session = switch_core_session_locate(tech_pvt->session_uuid_str); + } else { + ERRORA("No session???\n", GSMOPEN_P_LOG); + goto done; + } + if (session) { + channel = switch_core_session_get_channel(session); + } else { + ERRORA("No session???\n", GSMOPEN_P_LOG); + goto done; + } + if (channel) { + switch_channel_mark_ring_ready(channel); + DEBUGA_GSMOPEN("gsmopen_call: REMOTE PARTY RINGING\n", GSMOPEN_P_LOG); + } else { + ERRORA("No channel???\n", GSMOPEN_P_LOG); + } + + switch_core_session_rwunlock(session); + + done: + return 0; +} + +int remote_party_is_early_media(private_t * tech_pvt) +{ + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + if (!zstr(tech_pvt->session_uuid_str)) { + session = switch_core_session_locate(tech_pvt->session_uuid_str); + } else { + ERRORA("No session???\n\n\n", GSMOPEN_P_LOG); + //TODO: kill the bastard + goto done; + } + if (session) { + channel = switch_core_session_get_channel(session); + switch_core_session_add_stream(session, NULL); + } else { + ERRORA("No session???\n", GSMOPEN_P_LOG); + //TODO: kill the bastard + goto done; + } + if (channel) { + switch_channel_mark_pre_answered(channel); + DEBUGA_GSMOPEN("gsmopen_call: REMOTE PARTY EARLY MEDIA\n", GSMOPEN_P_LOG); + } else { + ERRORA("No channel???\n", GSMOPEN_P_LOG); + //TODO: kill the bastard + } + + switch_core_session_rwunlock(session); + + done: + return 0; +} + +int outbound_channel_answered(private_t * tech_pvt) +{ + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + if (!zstr(tech_pvt->session_uuid_str)) { + session = switch_core_session_locate(tech_pvt->session_uuid_str); + } else { + ERRORA("No session???\n", GSMOPEN_P_LOG); + goto done; + } + if (session) { + channel = switch_core_session_get_channel(session); + } else { + ERRORA("No channel???\n", GSMOPEN_P_LOG); + goto done; + } + if (channel) { + switch_channel_mark_answered(channel); + tech_pvt->phone_callflow = GSMOPEN_STATE_UP; + tech_pvt->interface_state = GSMOPEN_STATE_UP; + //DEBUGA_GSMOPEN("gsmopen_call: %s, answered\n", GSMOPEN_P_LOG, id); + } else { + ERRORA("No channel???\n", GSMOPEN_P_LOG); + } + + switch_core_session_rwunlock(session); + + done: + DEBUGA_GSMOPEN("outbound_channel_answered!\n", GSMOPEN_P_LOG); + + return 0; +} + +private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling) +{ + private_t *tech_pvt = NULL; + int i; + //int num_interfaces = GSMOPEN_MAX_INTERFACES; + //int num_interfaces = globals.real_interfaces; + + switch_mutex_lock(globals.mutex); + + /* Fact is the real interface start from 1 */ + //XXX no, is just a convention, but you can have it start from 0. I do not, for aestetic reasons :-) + //if (globals.next_interface == 0) globals.next_interface = 1; + + for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { + int interface_id; + + interface_id = globals.next_interface; + //interface_id = interface_id < GSMOPEN_MAX_INTERFACES ? interface_id : interface_id - GSMOPEN_MAX_INTERFACES + 1; + globals.next_interface = interface_id + 1 < GSMOPEN_MAX_INTERFACES ? interface_id + 1 : 0; + + if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { + int gsmopen_state = 0; + + tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + gsmopen_state = tech_pvt->interface_state; + DEBUGA_GSMOPEN("gsmopen interface: %d, name: %s, state: %d\n", GSMOPEN_P_LOG, interface_id, globals.GSMOPEN_INTERFACES[interface_id].name, + gsmopen_state); + if ((tech_pvt_calling ? strcmp(tech_pvt->gsmopen_user, tech_pvt_calling->gsmopen_user) : 1) + && (GSMOPEN_STATE_DOWN == gsmopen_state || 0 == gsmopen_state) && (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED + || 0 == tech_pvt->phone_callflow)) { + DEBUGA_GSMOPEN("returning as available gsmopen interface name: %s, state: %d callflow: %d\n", GSMOPEN_P_LOG, tech_pvt->name, gsmopen_state, + tech_pvt->phone_callflow); + /*set to Dialing state to avoid other thread fint it, don't know if it is safe */ + //XXX no, it's not safe + if (tech_pvt_calling == NULL) { + tech_pvt->interface_state = GSMOPEN_STATE_SELECTED; + } + + switch_mutex_unlock(globals.mutex); + return tech_pvt; + } + } // else { + //DEBUGA_GSMOPEN("GSM interface: %d blank!! A hole here means we cannot hunt the last interface.\n", GSMOPEN_P_LOG, interface_id); + //} + } + + switch_mutex_unlock(globals.mutex); + return NULL; +} + +#if 1 +SWITCH_STANDARD_API(gsm_function) +{ + char *mycmd = NULL, *argv[10] = { 0 }; + int argc = 0; + + if (globals.gsm_console) + stream->write_function(stream, "gsm console is: |||%s|||\n", globals.gsm_console->name); + else + stream->write_function(stream, "gsm console is NOT yet assigned\n"); + + if (!zstr(cmd) && (mycmd = strdup(cmd))) { + argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (!argc || !argv[0]) { + stream->write_function(stream, "%s", GSM_SYNTAX); + goto end; + } + + if (!strcasecmp(argv[0], "list")) { + int i; + char next_flag_char = ' '; + + stream->write_function(stream, "F ID\t Name \tIB (F/T) OB (F/T)\tState\tCallFlw\t\tUUID\n"); + stream->write_function(stream, "= ====\t ======== \t======= =======\t======\t============\t======\n"); + + for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { + next_flag_char = i == globals.next_interface ? '*' : ' '; + + if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { + stream->write_function(stream, + "%c %d\t[%s]\t%3ld/%ld\t%6ld/%ld\t%s\t%s\t%s\n", + next_flag_char, + i, globals.GSMOPEN_INTERFACES[i].name, + globals.GSMOPEN_INTERFACES[i].ib_failed_calls, + globals.GSMOPEN_INTERFACES[i].ib_calls, + globals.GSMOPEN_INTERFACES[i].ob_failed_calls, + globals.GSMOPEN_INTERFACES[i].ob_calls, + interface_status[globals.GSMOPEN_INTERFACES[i].interface_state], + phone_callflow[globals.GSMOPEN_INTERFACES[i].phone_callflow], globals.GSMOPEN_INTERFACES[i].session_uuid_str); + } else if (argc > 1 && !strcasecmp(argv[1], "full")) { + stream->write_function(stream, "%c\t%d\n", next_flag_char, i); + } + + } + stream->write_function(stream, "\nTotal: %d\n", globals.real_interfaces - 1); + + } else if (!strcasecmp(argv[0], "console")) { + int i; + int found = 0; + + if (argc == 2) { + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[1], strlen(argv[1])) == 0)) { + globals.gsm_console = &globals.GSMOPEN_INTERFACES[i]; + stream->write_function(stream, "gsm console is now: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, + globals.GSMOPEN_INTERFACES[i].name); + stream->write_function(stream, "gsm console is: |||%s|||\n", globals.gsm_console->name); + found = 1; + break; + } + + } + if (!found) + stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[1]); + } else { + + stream->write_function(stream, "-ERR Usage: gsm console interface_name\n"); + goto end; + } + + } else if (!strcasecmp(argv[0], "ciapalino")) { + +/* BEGIN: Changes heres */ + } else if (!strcasecmp(argv[0], "reload")) { + if (load_config(SOFT_RELOAD) != SWITCH_STATUS_SUCCESS) { + stream->write_function(stream, "gsm reload failed\n"); + } else { + stream->write_function(stream, "gsm reload success\n"); + } + } else if (!strcasecmp(argv[0], "remove")) { + if (argc == 2) { + if (remove_interface(argv[1]) == SWITCH_STATUS_SUCCESS) { + if (interface_exists(argv[1]) == SWITCH_STATUS_SUCCESS) { + stream->write_function(stream, "gsm remove '%s' failed\n", argv[1]); + } else { + stream->write_function(stream, "gsm remove '%s' success\n", argv[1]); + } + } + } else { + stream->write_function(stream, "-ERR Usage: gsm remove interface_name\n"); + goto end; + } +/* END: Changes heres */ + + } else { + if (globals.gsm_console) + gsmopen_serial_write_AT_noack(globals.gsm_console, (char *) cmd); + else + stream->write_function(stream, "gsm console is NOT yet assigned\n"); + } + end: + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_STANDARD_API(gsmopen_function) +{ + char *mycmd = NULL, *argv[10] = { 0 }; + int argc = 0; + private_t *tech_pvt = NULL; + + if (!zstr(cmd) && (mycmd = strdup(cmd))) { + argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (!argc) { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); + goto end; + } + + if (argc < 2) { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); + goto end; + } + + if (argv[0]) { + int i; + int found = 0; + + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); + found = 1; + break; + } + + } + if (!found) { + stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; + } else { + gsmopen_serial_write_AT_noack(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]); + } + } else { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); + } + end: + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; +} +#endif //0 +SWITCH_STANDARD_API(gsmopen_dump_function) +{ + char *mycmd = NULL, *argv[10] = { 0 }; + int argc = 0; + private_t *tech_pvt = NULL; + char value[512]; + + if (!zstr(cmd) && (mycmd = strdup(cmd))) { + argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (!argc) { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_DUMP_SYNTAX); + goto end; + } + if (argc == 1) { + int i; + int found = 0; + + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + //stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); + found = 1; + break; + } + + } + if (!found && (strcmp("list", argv[0]) == 0)) { + int i; + stream->write_function(stream, "gsmopen_dump LIST\n\n"); + for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { + stream->write_function(stream, "dumping interface '%s'\n\n", globals.GSMOPEN_INTERFACES[i].name); + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + + + stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); + stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); + stream->write_function(stream, "active = %s\n", value); + if(!tech_pvt->network_creg_not_supported){ + snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); + stream->write_function(stream, "not_registered = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); + stream->write_function(stream, "home_network_registered = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); + stream->write_function(stream, "roaming_registered = %s\n", value); + }else{ + stream->write_function(stream, "not_registered = %s\n", "N/A"); + stream->write_function(stream, "home_network_registered = %s\n", "N/A"); + stream->write_function(stream, "roaming_registered = %s\n", "N/A"); + } + snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); + stream->write_function(stream, "got_signal = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); + stream->write_function(stream, "running = %s\n", value); + stream->write_function(stream, "imei = %s\n", tech_pvt->imei); + stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); + stream->write_function(stream, "controldev_dead = %s\n", value); + stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); + stream->write_function(stream, "no_sound = %s\n", value); +#ifdef GSMOPEN_ALSA + stream->write_function(stream, "alsacname = %s\n", tech_pvt->alsacname); + stream->write_function(stream, "alsapname = %s\n", tech_pvt->alsapname); +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); + stream->write_function(stream, "portaudiocindex = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); + stream->write_function(stream, "portaudiopindex = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); + stream->write_function(stream, "speexecho = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); + stream->write_function(stream, "speexpreprocess = %s\n", value); +#endif// GSMOPEN_PORTAUDIO + snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); + stream->write_function(stream, "playback_boost = %s\n", value); + snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); + stream->write_function(stream, "capture_boost = %s\n", value); + stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); + stream->write_function(stream, "context = %s\n", tech_pvt->context); + stream->write_function(stream, "destination = %s\n", tech_pvt->destination); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); + stream->write_function(stream, "ib_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); + stream->write_function(stream, "ob_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); + stream->write_function(stream, "ib_failed_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); + stream->write_function(stream, "ob_failed_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); + stream->write_function(stream, "interface_state = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); + stream->write_function(stream, "phone_callflow = %s\n", value); + stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); + stream->write_function(stream, "\n"); + + dump_event(tech_pvt); + } + + } + + } else if(found){ + stream->write_function(stream, "dumping interface '%s'\n\n", argv[0]); + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + + + stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); + stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); + stream->write_function(stream, "active = %s\n", value); + if(!tech_pvt->network_creg_not_supported){ + snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); + stream->write_function(stream, "not_registered = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); + stream->write_function(stream, "home_network_registered = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); + stream->write_function(stream, "roaming_registered = %s\n", value); + }else{ + stream->write_function(stream, "not_registered = %s\n", "N/A"); + stream->write_function(stream, "home_network_registered = %s\n", "N/A"); + stream->write_function(stream, "roaming_registered = %s\n", "N/A"); + } + snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); + stream->write_function(stream, "got_signal = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); + stream->write_function(stream, "running = %s\n", value); + stream->write_function(stream, "imei = %s\n", tech_pvt->imei); + stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); + stream->write_function(stream, "controldev_dead = %s\n", value); + stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); + stream->write_function(stream, "no_sound = %s\n", value); +#ifdef GSMOPEN_ALSA + stream->write_function(stream, "alsacname = %s\n", tech_pvt->alsacname); + stream->write_function(stream, "alsapname = %s\n", tech_pvt->alsapname); +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); + stream->write_function(stream, "portaudiocindex = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); + stream->write_function(stream, "portaudiopindex = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); + stream->write_function(stream, "speexecho = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); + stream->write_function(stream, "speexpreprocess = %s\n", value); +#endif// GSMOPEN_PORTAUDIO + snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); + stream->write_function(stream, "playback_boost = %s\n", value); + snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); + stream->write_function(stream, "capture_boost = %s\n", value); + stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); + stream->write_function(stream, "context = %s\n", tech_pvt->context); + stream->write_function(stream, "destination = %s\n", tech_pvt->destination); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); + stream->write_function(stream, "ib_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); + stream->write_function(stream, "ob_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); + stream->write_function(stream, "ib_failed_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); + stream->write_function(stream, "ob_failed_calls = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); + stream->write_function(stream, "interface_state = %s\n", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); + stream->write_function(stream, "phone_callflow = %s\n", value); + stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); + stream->write_function(stream, "\n"); + + dump_event(tech_pvt); + } else{ + stream->write_function(stream, "interface '%s' was not found\n", argv[0]); + } + } else { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_DUMP_SYNTAX); + } +end: + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; +} +SWITCH_STANDARD_API(gsmopen_boost_audio_function) +{ + char *mycmd = NULL, *argv[10] = { 0 }; + int argc = 0; + private_t *tech_pvt = NULL; + + if (!zstr(cmd) && (mycmd = strdup(cmd))) { + argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argc == 1 || argc==3) { + int i; + int found = 0; + + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); + found = 1; + break; + } + + } + if (!found) { + stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); + + } else { + if (argc == 1) { + stream->write_function(stream,"[%s] capture boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); + stream->write_function(stream,"[%s] playback boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); + stream->write_function(stream, "%s usage: %s", argv[0], GSMOPEN_BOOST_AUDIO_SYNTAX); + goto end; + } else if ((strncmp("play", argv[1], strlen(argv[1])) == 0)) { + if (switch_is_number(argv[2])) { + stream->write_function(stream,"[%s] playback boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); + gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].playback_boost); //FIXME + stream->write_function(stream,"[%s] playback boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); + } + }else if ((strncmp("capt", argv[1], strlen(argv[1])) == 0)) { + if (switch_is_number(argv[2])) { + stream->write_function(stream,"[%s] capture boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); + gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].capture_boost); //FIXME + stream->write_function(stream,"[%s] capture boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); + } + } else { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX); + } + } + } else { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX); + } + end: + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; +} + + +#if 0 +int gsmopen_transfer(private_t * tech_pvt, char *id, char *value) +{ + char msg_to_gsmopen[1024]; + int i; + int found = 0; + private_t *giovatech; + struct timeval timenow; + + switch_mutex_lock(globals.mutex); + + gettimeofday(&timenow, NULL); + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { + + giovatech = &globals.GSMOPEN_INTERFACES[i]; + //NOTICA("gsmopen interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->gsmopen_user=%s\n", GSMOPEN_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->gsmopen_user); + //FIXME check a timestamp here + if (strlen(giovatech->gsmopen_call_id) && (giovatech->interface_state != GSMOPEN_STATE_DOWN) && (!strcmp(giovatech->gsmopen_user, tech_pvt->gsmopen_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 500000)) { //0.5sec + found = 1; + DEBUGA_GSMOPEN + ("FOUND (name=%s, giovatech->interface_state=%d != GSMOPEN_STATE_DOWN) && (giovatech->gsmopen_user=%s == tech_pvt->gsmopen_user=%s) && (giovatech->callid_number=%s == value=%s)\n", + GSMOPEN_P_LOG, giovatech->name, giovatech->interface_state, giovatech->gsmopen_user, tech_pvt->gsmopen_user, giovatech->callid_number, + value) + break; + } + } + } + + if (found) { + //tech_pvt->callid_number[0]='\0'; + //sprintf(msg_to_gsmopen, "ALTER CALL %s END HANGUP", id); + //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); + switch_mutex_unlock(globals.mutex); + return 0; + } + DEBUGA_GSMOPEN("NOT FOUND\n", GSMOPEN_P_LOG); + + if (!tech_pvt || !tech_pvt->gsmopen_call_id || !strlen(tech_pvt->gsmopen_call_id)) { + /* we are not inside an active call */ + DEBUGA_GSMOPEN("We're NO MORE in a call now %s\n", GSMOPEN_P_LOG, (tech_pvt && tech_pvt->gsmopen_call_id) ? tech_pvt->gsmopen_call_id : ""); + switch_mutex_unlock(globals.mutex); + + } else { + + /* we're owned, we're in a call, let's try to transfer */ + /************************** TODO + Checking here if it is possible to transfer this call to Test2 + -> GET CALL 288 CAN_TRANSFER Test2 + <- CALL 288 CAN_TRANSFER test2 TRUE + **********************************/ + + private_t *available_gsmopen_interface = NULL; + + gettimeofday(&timenow, NULL); + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { + + giovatech = &globals.GSMOPEN_INTERFACES[i]; + //NOTICA("gsmopen interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->gsmopen_user=%s\n", GSMOPEN_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->gsmopen_user); + //FIXME check a timestamp here + if (strlen(giovatech->gsmopen_transfer_call_id) && (giovatech->interface_state != GSMOPEN_STATE_DOWN) && (!strcmp(giovatech->gsmopen_user, tech_pvt->gsmopen_user)) && (!strcmp(giovatech->transfer_callid_number, value)) && ((((timenow.tv_sec - giovatech->transfer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->transfer_time.tv_usec)) < 1000000)) { //1.0 sec + found = 1; + DEBUGA_GSMOPEN + ("FOUND (name=%s, giovatech->interface_state=%d != GSMOPEN_STATE_DOWN) && (giovatech->gsmopen_user=%s == tech_pvt->gsmopen_user=%s) && (giovatech->transfer_callid_number=%s == value=%s)\n", + GSMOPEN_P_LOG, giovatech->name, giovatech->interface_state, + giovatech->gsmopen_user, tech_pvt->gsmopen_user, giovatech->transfer_callid_number, value) + break; + } + } + } + + if (found) { + //tech_pvt->callid_number[0]='\0'; + //sprintf(msg_to_gsmopen, "ALTER CALL %s END HANGUP", id); + //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); + switch_mutex_unlock(globals.mutex); + return 0; + } + DEBUGA_GSMOPEN("NOT FOUND\n", GSMOPEN_P_LOG); + + available_gsmopen_interface = find_available_gsmopen_interface_rr(tech_pvt); + if (available_gsmopen_interface) { + /* there is a gsmopen interface idle, let's transfer the call to it */ + + //FIXME write a timestamp here + gettimeofday(&tech_pvt->transfer_time, NULL); + switch_copy_string(tech_pvt->gsmopen_transfer_call_id, id, sizeof(tech_pvt->gsmopen_transfer_call_id) - 1); + + switch_copy_string(tech_pvt->transfer_callid_number, value, sizeof(tech_pvt->transfer_callid_number) - 1); + + DEBUGA_GSMOPEN + ("Let's transfer the gsmopen_call %s to %s interface (with gsmopen_user: %s), because we are already in a gsmopen call(%s)\n", + GSMOPEN_P_LOG, tech_pvt->gsmopen_call_id, available_gsmopen_interface->name, available_gsmopen_interface->gsmopen_user, id); + + //FIXME why this? the inbound call will come, eventually, on that other interface + //available_gsmopen_interface->ib_calls++; + + sprintf(msg_to_gsmopen, "ALTER CALL %s TRANSFER %s", id, available_gsmopen_interface->gsmopen_user); + //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); + if (tech_pvt->interface_state == GSMOPEN_STATE_SELECTED) { + tech_pvt->interface_state = GSMOPEN_STATE_IDLE; //we marked it GSMOPEN_STATE_SELECTED just in case it has to make an outbound call + } + } else { + /* no gsmopen interfaces idle, do nothing */ + DEBUGA_GSMOPEN + ("Not answering the gsmopen_call %s, because we are already in a gsmopen call(%s) and not transferring, because no other gsmopen interfaces are available\n", + GSMOPEN_P_LOG, id, tech_pvt->gsmopen_call_id); + sprintf(msg_to_gsmopen, "ALTER CALL %s END HANGUP", id); + //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); + } + switch_sleep(10000); + DEBUGA_GSMOPEN + ("We have NOT answered a GSM RING from gsmopen_call %s, because we are already in a gsmopen call (%s)\n", + GSMOPEN_P_LOG, id, tech_pvt->gsmopen_call_id); + + switch_mutex_unlock(globals.mutex); + } + return 0; +} +#endif //0 + +void *gsmopen_do_gsmopenapi_thread_func(void *obj) +{ + + private_t *tech_pvt = (private_t *) obj; + time_t now_timestamp; + + //if (gsmopen_present(GSMopenHandles)) + while (running && tech_pvt->running) { + int res; + //gsmopen_sleep(1000000); //1 sec + //DEBUGA_GSMOPEN("ciao!\n", GSMOPEN_P_LOG); + res = gsmopen_serial_read(tech_pvt); + if (res == -1) { //manage the graceful interface shutdown + tech_pvt->controldev_dead = 1; + close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running=0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active=0; + tech_pvt->name[0]='\0'; + switch_sleep(1000000); + } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_RING + && tech_pvt->phone_callflow != CALLFLOW_CALL_HANGUP_REQUESTED) { + //WARNINGA("INCOMING RING\n", GSMOPEN_P_LOG); + + gsmopen_ring(tech_pvt); + + //FIXME gsmopen_answer(tech_pvt); + //new_inbound_channel(tech_pvt); + //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { + //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); + //FIXME } + + + } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_DIALING) { + WARNINGA("WE'RE DIALING, let's take the earlymedia\n", GSMOPEN_P_LOG); + tech_pvt->interface_state = CALLFLOW_STATUS_EARLYMEDIA; + remote_party_is_early_media(tech_pvt); + //new_inbound_channel(tech_pvt); + //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { + //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); + //FIXME } + + + + + } else if (tech_pvt->interface_state == CALLFLOW_CALL_REMOTEANSWER) { + WARNINGA("REMOTE PARTY ANSWERED\n", GSMOPEN_P_LOG); + outbound_channel_answered(tech_pvt); + //new_inbound_channel(tech_pvt); + //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { + //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); + //FIXME } + } + switch_sleep(100); //give other threads a chance + time(&now_timestamp); + + if ((now_timestamp - tech_pvt->gsmopen_serial_synced_timestamp) > tech_pvt->gsmopen_serial_sync_period) { //TODO find a sensible period. 5min? in config? + gsmopen_serial_sync(tech_pvt); + gsmopen_serial_getstatus_AT(tech_pvt); + } + } + DEBUGA_GSMOPEN("EXIT\n", GSMOPEN_P_LOG); + //running = 0; + return NULL; + +} + + +SWITCH_STANDARD_API(sendsms_function) +{ + char *mycmd = NULL, *argv[3] = { 0 }; + int argc = 0; + private_t *tech_pvt = NULL; + + if (!zstr(cmd) && (mycmd = strdup(cmd))) { + argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (!argc) { + stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); + goto end; + } + + if (argc < 3) { + stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); + goto end; + } + + if (argv[0]) { + int i; + int found = 0; + + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + stream->write_function(stream, "Trying to send your SMS: interface=%s, dest=%s, text=%s\n", argv[0], argv[1], argv[2]); + found = 1; + break; + } + + } + if (!found) { + stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; + } else { + //gsmopen_sendsms(tech_pvt, (char *) argv[1], (char *) argv[2]); + NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", GSMOPEN_P_LOG, GSMOPEN_CHAT_PROTO, tech_pvt->name, + argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), tech_pvt->name); + + compat_chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->name, argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), NULL, tech_pvt->name); + } + } else { + stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); + } + end: + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; +} + +int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message) +{ + switch_event_t *event; + char value[512]; + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + switch_status_t status; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if(session){ + channel = switch_core_session_get_channel(session); + } + + if (is_alarm){ + ERRORA("ALARM on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name ); + status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_ALARM); + }else{ + DEBUGA_GSMOPEN("DUMP on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name ); + status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_DUMP); + } + if (status == SWITCH_STATUS_SUCCESS) { + if (is_alarm){ + snprintf(value, sizeof(value)-1, "%d", alarm_code); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_code", value); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_message", alarm_message); + } + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_name", tech_pvt->name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_id", tech_pvt->id); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "active", value); + if(!tech_pvt->network_creg_not_supported){ + snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", value); + }else{ + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", "N/A"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", "N/A"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", "N/A"); + } + snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "got_signal", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "running", value); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imei", tech_pvt->imei); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imsi", tech_pvt->imsi); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldev_dead", value); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "no_sound", value); +#ifdef GSMOPEN_ALSA + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsacname", tech_pvt->alsacname); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsapname", tech_pvt->alsapname); +#endif// GSMOPEN_ALSA +#ifdef GSMOPEN_PORTAUDIO + snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiocindex", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiopindex", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexecho", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexpreprocess", value); +#endif// GSMOPEN_PORTAUDIO + snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "playback_boost", value); + snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "capture_boost", value); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialplan", tech_pvt->dialplan); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", tech_pvt->context); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "destination", tech_pvt->destination); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_calls", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_calls", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_failed_calls", value); + snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_failed_calls", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_state", value); + snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "phone_callflow", value); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "session_uuid_str", tech_pvt->session_uuid_str); + if (strlen(tech_pvt->session_uuid_str)) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); + } else { //no session + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "false"); + } + if (channel) { + switch_channel_event_set_data(channel, event); + } + switch_event_fire(&event); + } else { + ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); + } + + if (session) { + switch_core_session_rwunlock(session); + } + return 0; +} + +int dump_event(private_t * tech_pvt) +{ + return dump_event_full(tech_pvt, 0, 0, NULL); +} + + +int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message) +{ + return dump_event_full(tech_pvt, 1, alarm_code, alarm_message); +} + +int sms_incoming(private_t * tech_pvt) +{ + switch_event_t *event; + switch_core_session_t *session = NULL; + int event_sent_to_esl = 0; + + //DEBUGA_GSMOPEN("received SMS on interface %s: %s\n", GSMOPEN_P_LOG, tech_pvt->name, tech_pvt->sms_message); + DEBUGA_GSMOPEN("received SMS on interface %s: DATE=%s, SENDER=%s, BODY=%s|\n", GSMOPEN_P_LOG, tech_pvt->name, tech_pvt->sms_date, tech_pvt->sms_sender, + tech_pvt->sms_body); + + if (!zstr(tech_pvt->session_uuid_str)) { + session = switch_core_session_locate(tech_pvt->session_uuid_str); + } + if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", GSMOPEN_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->sms_sender); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "date", tech_pvt->sms_date); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "datacodingscheme", tech_pvt->sms_datacodingscheme); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "servicecentreaddress", tech_pvt->sms_servicecentreaddress); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "messagetype", "%d", tech_pvt->sms_messagetype); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); + switch_event_add_body(event, "%s\n", tech_pvt->sms_body); + if (session) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); + if (switch_core_session_queue_event(session, &event) != SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true"); + switch_event_fire(&event); + } + } else { //no session + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "false"); + switch_event_fire(&event); + event_sent_to_esl = 1; + } + + } else { + ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); + } + + if (!event_sent_to_esl) { + + if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", GSMOPEN_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->chatmessages[which].from_handle); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->sms_sender); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "date", tech_pvt->sms_date); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "datacodingscheme", tech_pvt->sms_datacodingscheme); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "servicecentreaddress", tech_pvt->sms_servicecentreaddress); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "messagetype", "%d", tech_pvt->sms_messagetype); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); + switch_event_add_body(event, "%s\n", tech_pvt->sms_body); + if (session) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); + } else { //no session + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "false"); + } + switch_event_fire(&event); + } else { + ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); + } + } + + if (session) { + switch_core_session_rwunlock(session); + } + //memset(&tech_pvt->chatmessages[which], '\0', sizeof(&tech_pvt->chatmessages[which]) ); + //memset(tech_pvt->sms_message, '\0', sizeof(tech_pvt->sms_message)); + return 0; +} + + +#ifdef NOTDEF +SWITCH_STANDARD_API(gsmopen_chat_function) +{ + char *mycmd = NULL, *argv[10] = { 0 }; + int argc = 0; + private_t *tech_pvt = NULL; + //int tried =0; + int i; + int found = 0; + //char skype_msg[1024]; + + if (!zstr(cmd) && (mycmd = strdup(cmd))) { + argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (!argc) { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_CHAT_SYNTAX); + goto end; + } + + if (argc < 3) { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_CHAT_SYNTAX); + goto end; + } + + if (argv[0]) { + for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { + /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ + if (strlen(globals.GSMOPEN_INTERFACES[i].name) + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + tech_pvt = &globals.GSMOPEN_INTERFACES[i]; + stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); + found = 1; + break; + } + + } + if (!found) { + stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); + goto end; + } else { + + //chat_send(const char *proto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint); + //chat_send(p*roto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint); + //chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, hint); + + NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", GSMOPEN_P_LOG, GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, + argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), tech_pvt->name); + + chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", + switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, tech_pvt->name); + + //NOTICA("TEXT is: %s\n", GSMOPEN_P_LOG, (char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1] ); + //snprintf(skype_msg, sizeof(skype_msg), "CHAT CREATE %s", argv[1]); + //gsmopen_signaling_write(tech_pvt, skype_msg); + //switch_sleep(100); + } + } else { + stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_CHAT_SYNTAX); + goto end; + } + +#ifdef NOTDEF + + found = 0; + + while (!found) { + for (i = 0; i < MAX_CHATS; i++) { + if (!strcmp(tech_pvt->chats[i].dialog_partner, argv[1])) { + snprintf(skype_msg, sizeof(skype_msg), "CHATMESSAGE %s %s", tech_pvt->chats[i].chatname, + (char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]); + gsmopen_signaling_write(tech_pvt, skype_msg); + found = 1; + break; + } + } + if (found) { + break; + } + if (tried > 1000) { + stream->write_function(stream, "ERROR: no chat with dialog_partner='%s' was found\n", argv[1]); + break; + } + switch_sleep(1000); + } +#endif //NOTDEF + + end: + switch_safe_free(mycmd); + + return SWITCH_STATUS_SUCCESS; +} +#endif // NOTDEF + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: + */ diff --git a/src/mod/endpoints/mod_gsmopen/usb-cm-108-2.txt b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/usb-cm-108-2.txt similarity index 100% rename from src/mod/endpoints/mod_gsmopen/usb-cm-108-2.txt rename to src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/usb-cm-108-2.txt diff --git a/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml b/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml index d21a4c1969..0647f53168 100644 --- a/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml +++ b/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml @@ -4,18 +4,22 @@ - + - - - - - - - - + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/filtra48down8.c b/src/mod/endpoints/mod_gsmopen/filtra48down8.c deleted file mode 100644 index 615f80295b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/filtra48down8.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 2007 Jean-Marc Valin - - File: testresample.c - Testing the resampling code - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include - -#define NN 256 - -int main() -{ - short *in; - short *out; - int i; - int a; - - in = malloc(NN*sizeof(short)); - out = malloc(NN*sizeof(short)/6); - while (1) - { - fread(in, sizeof(short), NN, stdin); - if (feof(stdin)) - break; - - a=0; - for (i=0;i -//#include "speex/speex_resampler.h" -#include -#include - -#define NN 256 - -int main() -{ - short *in; - short *out; - int i; - int a; - - in = malloc(NN*sizeof(short)); - out = malloc(NN*sizeof(short)*6); - while (1) - { - fread(in, sizeof(short), NN, stdin); - if (feof(stdin)) - break; - - a=0; - for (i=0;i #endif #ifdef WIN32 +#include #include #else #include diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h old mode 100644 new mode 100755 index 176ccc58d2..258d4fed52 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h @@ -68,7 +68,9 @@ /* Define if vsnprintf() function available */ #define HAVE_VSNPRINTF 1 +#ifndef WIN32 #define vsnprintf _vsnprintf +#endif// WIN32 /* The number of bytes in a unsigned int. */ #define SIZEOF_UNSIGNED_INT 4 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmctl.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmctl.vcproj new file mode 100755 index 0000000000..b41426144d --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmctl.vcproj @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2010.vcxproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2010.vcxproj new file mode 100644 index 0000000000..78bc811ea1 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2010.vcxproj @@ -0,0 +1,263 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + gsmlib + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + .\Release\ + .\Release\ + .\Debug\ + .\Debug\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + MaxSpeed + OnlyExplicitInline + ../vcproject;..;.;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + true + .\Release/gsmlib.pch + .\Release/ + .\Release/ + .\Release/ + true + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + .\Release\gsmlib.lib + true + + + true + .\Release/gsmlib.bsc + + + + + Disabled + ..;.;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + .\Debug/gsmlib.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + .\Debug\gsmlib.lib + true + false + %(IgnoreSpecificDefaultLibraries) + + + true + .\Debug/gsmlib.bsc + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + ../vcproject;..;.;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + true + .\Release/gsmlib.pch + .\Release/ + .\Release/ + .\Release/ + true + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + .\Release\gsmlib.lib + true + + + true + .\Release/gsmlib.bsc + + + + + X64 + + + Disabled + ..;.;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + .\Debug/gsmlib.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + .\Debug\gsmlib.lib + true + false + %(IgnoreSpecificDefaultLibraries) + + + true + .\Debug/gsmlib.bsc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.sln b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.sln new file mode 100755 index 0000000000..928215c23d --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.sln @@ -0,0 +1,92 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmctl", "gsmctl.vcproj", "{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "gsmlib.vcproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmpb", "gsmpb.vcproj", "{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsendsms", "gsmsendsms.vcproj", "{CF99664C-05D1-41A3-9B12-B79D55718377}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsd", "gsmsmsd.vcproj", "{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsstore", "gsmsmsstore.vcproj", "{5A834BCC-8B96-4D1C-9811-ADC816797E3A}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgsmlib", "testgsmlib.vcproj", "{248E3E22-2203-4352-964E-32946A1A0AEC}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms", "testsms.vcproj", "{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms2", "testsms2.vcproj", "{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}" + ProjectSection(ProjectDependencies) = postProject + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Debug|Win32.ActiveCfg = Debug|Win32 + {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Debug|Win32.Build.0 = Debug|Win32 + {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Release|Win32.ActiveCfg = Release|Win32 + {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Release|Win32.Build.0 = Release|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.Build.0 = Debug|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.Build.0 = Release|Win32 + {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Debug|Win32.ActiveCfg = Debug|Win32 + {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Debug|Win32.Build.0 = Debug|Win32 + {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Release|Win32.ActiveCfg = Release|Win32 + {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Release|Win32.Build.0 = Release|Win32 + {CF99664C-05D1-41A3-9B12-B79D55718377}.Debug|Win32.ActiveCfg = Debug|Win32 + {CF99664C-05D1-41A3-9B12-B79D55718377}.Debug|Win32.Build.0 = Debug|Win32 + {CF99664C-05D1-41A3-9B12-B79D55718377}.Release|Win32.ActiveCfg = Release|Win32 + {CF99664C-05D1-41A3-9B12-B79D55718377}.Release|Win32.Build.0 = Release|Win32 + {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Debug|Win32.Build.0 = Debug|Win32 + {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Release|Win32.ActiveCfg = Release|Win32 + {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Release|Win32.Build.0 = Release|Win32 + {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Debug|Win32.ActiveCfg = Debug|Win32 + {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Debug|Win32.Build.0 = Debug|Win32 + {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Release|Win32.ActiveCfg = Release|Win32 + {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Release|Win32.Build.0 = Release|Win32 + {248E3E22-2203-4352-964E-32946A1A0AEC}.Debug|Win32.ActiveCfg = Debug|Win32 + {248E3E22-2203-4352-964E-32946A1A0AEC}.Debug|Win32.Build.0 = Debug|Win32 + {248E3E22-2203-4352-964E-32946A1A0AEC}.Release|Win32.ActiveCfg = Release|Win32 + {248E3E22-2203-4352-964E-32946A1A0AEC}.Release|Win32.Build.0 = Release|Win32 + {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Debug|Win32.ActiveCfg = Debug|Win32 + {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Debug|Win32.Build.0 = Debug|Win32 + {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Release|Win32.ActiveCfg = Release|Win32 + {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Release|Win32.Build.0 = Release|Win32 + {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Debug|Win32.ActiveCfg = Debug|Win32 + {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Debug|Win32.Build.0 = Debug|Win32 + {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Release|Win32.ActiveCfg = Release|Win32 + {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.vcproj new file mode 100755 index 0000000000..16d4ae1bc0 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.vcproj @@ -0,0 +1,489 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.vcproj new file mode 100755 index 0000000000..5390644dd6 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.vcproj @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsendsms.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsendsms.vcproj new file mode 100755 index 0000000000..391d71bef6 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsendsms.vcproj @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsd.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsd.vcproj new file mode 100755 index 0000000000..46d6ed3d72 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsd.vcproj @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsstore.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsstore.vcproj new file mode 100755 index 0000000000..b8e7bc14f2 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsstore.vcproj @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testgsmlib.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testgsmlib.vcproj new file mode 100755 index 0000000000..f75fb35a4d --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testgsmlib.vcproj @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms.vcproj new file mode 100755 index 0000000000..5988cf44fe --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms.vcproj @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms2.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms2.vcproj new file mode 100755 index 0000000000..f1318baccd --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms2.vcproj @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10-13.diff b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10-13.diff deleted file mode 100644 index ddea9c6d8f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10-13.diff +++ /dev/null @@ -1,64915 +0,0 @@ ---- gsmlib-1.10.orig/g41.patch -+++ gsmlib-1.10/g41.patch -@@ -0,0 +1,29 @@ -+--- ./gsmlib/gsm_me_ta.h~ 2006-03-09 19:15:59.000000000 +0000 -++++ ./gsmlib/gsm_me_ta.h 2006-03-09 19:16:31.000000000 +0000 -+@@ -291,8 +291,8 @@ -+ // 3 disable phone receive RF circuits only -+ // 4 disable phone both transmit and receive RF circuits -+ // 5...127 implementation-defined -+- int MeTa::getFunctionalityLevel() throw(GsmException); -+- void MeTa::setFunctionalityLevel(int level) throw(GsmException); -++ int getFunctionalityLevel() throw(GsmException); -++ void setFunctionalityLevel(int level) throw(GsmException); -+ -+ // return battery charge status (+CBC): -+ // 0 ME is powered by the battery -+@@ -386,13 +386,13 @@ -+ void setCallWaitingLockStatus(FacilityClass cl, -+ bool lock)throw(GsmException); -+ -+- void MeTa::setCLIRPresentation(bool enable) throw(GsmException); -++ void setCLIRPresentation(bool enable) throw(GsmException); -+ //(+CLIR) -+ -+ // 0:according to the subscription of the CLIR service -+ // 1:CLIR invocation -+ // 2:CLIR suppression -+- int MeTa::getCLIRPresentation() throw(GsmException); -++ int getCLIRPresentation() throw(GsmException); -+ -+ friend class Phonebook; -+ friend class SMSStore; ---- gsmlib-1.10.orig/Makefile.in -+++ gsmlib-1.10/Makefile.in -@@ -1,8 +1,6 @@ --# Makefile.in generated by automake 1.6.3 from Makefile.am. --# @configure_input@ -+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am - --# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 --# Free Software Foundation, Inc. -+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. - # This Makefile.in is free software; the Free Software Foundation - # gives unlimited permission to copy and/or distribute it, - # with or without modifications, as long as this notice is preserved. -@@ -12,8 +10,6 @@ - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. - --@SET_MAKE@ -- - # ************************************************************************* - # * GSM TA/ME library - # * -@@ -25,6 +21,8 @@ - # * - # * Created: 21.5.1999 - # ************************************************************************* -+ -+ - SHELL = @SHELL@ - - srcdir = @srcdir@ -@@ -45,9 +43,13 @@ - mandir = @mandir@ - includedir = @includedir@ - oldincludedir = /usr/include -+ -+DESTDIR = -+ - pkgdatadir = $(datadir)/@PACKAGE@ - pkglibdir = $(libdir)/@PACKAGE@ - pkgincludedir = $(includedir)/@PACKAGE@ -+ - top_builddir = . - - ACLOCAL = @ACLOCAL@ -@@ -55,16 +57,12 @@ - AUTOMAKE = @AUTOMAKE@ - AUTOHEADER = @AUTOHEADER@ - --am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd - INSTALL = @INSTALL@ --INSTALL_PROGRAM = @INSTALL_PROGRAM@ -+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) - INSTALL_DATA = @INSTALL_DATA@ --install_sh_DATA = $(install_sh) -c -m 644 --install_sh_PROGRAM = $(install_sh) -c --install_sh_SCRIPT = $(install_sh) -c - INSTALL_SCRIPT = @INSTALL_SCRIPT@ --INSTALL_HEADER = $(INSTALL_DATA) - transform = @program_transform_name@ -+ - NORMAL_INSTALL = : - PRE_INSTALL = : - POST_INSTALL = : -@@ -73,33 +71,38 @@ - POST_UNINSTALL = : - host_alias = @host_alias@ - host_triplet = @host@ -- --EXEEXT = @EXEEXT@ --OBJEXT = @OBJEXT@ --PATH_SEPARATOR = @PATH_SEPARATOR@ --AMTAR = @AMTAR@ -+AR = @AR@ - AS = @AS@ --AWK = @AWK@ - BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ - CATOBJEXT = @CATOBJEXT@ - CC = @CC@ - CPP = @CPP@ - CXX = @CXX@ -+CXXCPP = @CXXCPP@ - DATADIRNAME = @DATADIRNAME@ --DEPDIR = @DEPDIR@ - DLLTOOL = @DLLTOOL@ - ECHO = @ECHO@ -+EGREP = @EGREP@ -+EXEEXT = @EXEEXT@ -+F77 = @F77@ -+GCJ = @GCJ@ -+GCJFLAGS = @GCJFLAGS@ - GENCAT = @GENCAT@ -+GLIBC2 = @GLIBC2@ - GLIBC21 = @GLIBC21@ - GMSGFMT = @GMSGFMT@ - GSM_VERSION = @GSM_VERSION@ -+HAVE_ASPRINTF = @HAVE_ASPRINTF@ - HAVE_LIB = @HAVE_LIB@ --INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -+HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ -+HAVE_SNPRINTF = @HAVE_SNPRINTF@ -+HAVE_WPRINTF = @HAVE_WPRINTF@ - INSTOBJEXT = @INSTOBJEXT@ - INTLBISON = @INTLBISON@ - INTLLIBS = @INTLLIBS@ - INTLOBJS = @INTLOBJS@ - INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ - LIB = @LIB@ - LIBICONV = @LIBICONV@ - LIBINTL = @LIBINTL@ -@@ -108,89 +111,83 @@ - LTLIB = @LTLIB@ - LTLIBICONV = @LTLIBICONV@ - LTLIBINTL = @LTLIBINTL@ -+MAKEINFO = @MAKEINFO@ - MKINSTALLDIRS = @MKINSTALLDIRS@ - OBJDUMP = @OBJDUMP@ -+OBJEXT = @OBJEXT@ - PACKAGE = @PACKAGE@ - POSUB = @POSUB@ - RANLIB = @RANLIB@ -+RC = @RC@ - STRIP = @STRIP@ - USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ --am__include = @am__include@ --am__quote = @am__quote@ --install_sh = @install_sh@ - - SUBDIRS_ = po gsmlib apps tests doc scripts win32 ext - - EXTRA_DIST = gsmlib.spec -- - @COMPILE_INTL_TRUE@SUBDIRS = intl $(SUBDIRS_) # po - make automake happy - @COMPILE_INTL_FALSE@SUBDIRS = $(SUBDIRS_) # po intl - make automake happy --subdir = . - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs - CONFIG_HEADER = gsm_config.h --CONFIG_CLEAN_FILES = intl/Makefile --DIST_SOURCES = -+CONFIG_CLEAN_FILES = -+DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ -+INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h acinclude.m4 \ -+aclocal.m4 configure configure.in gsm_config.h.in - --RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ -- uninstall-info-recursive all-recursive install-data-recursive \ -- install-exec-recursive installdirs-recursive install-recursive \ -- uninstall-recursive check-recursive installcheck-recursive --DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \ -- Makefile.am Makefile.in NEWS TODO acconfig.h acinclude.m4 \ -- aclocal.m4 configure configure.in gsm_config.h.in --DIST_SUBDIRS = po gsmlib apps tests doc scripts win32 ext intl --all: gsm_config.h -- $(MAKE) $(AM_MAKEFLAGS) all-recursive - -+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -+ -+TAR = tar -+GZIP_ENV = --best -+DIST_SUBDIRS = intl po gsmlib apps tests doc scripts win32 ext po \ -+gsmlib apps tests doc scripts win32 ext -+all: all-redirect - .SUFFIXES: -+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) -+ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile - --am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ -- configure.lineno --$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) -- cd $(top_srcdir) && \ -- $(AUTOMAKE) --gnu Makefile --Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) -+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) -+ cd $(top_builddir) \ -+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - --$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) -+$(ACLOCAL_M4): configure.in acinclude.m4 -+ cd $(srcdir) && $(ACLOCAL) -+ -+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck --$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) -+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - --$(ACLOCAL_M4): configure.in acinclude.m4 -- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -- --gsm_config.h: stamp-h1 -+gsm_config.h: stamp-h - @if test ! -f $@; then \ -- rm -f stamp-h1; \ -- $(MAKE) stamp-h1; \ -+ rm -f stamp-h; \ -+ $(MAKE) stamp-h; \ - else :; fi -- --stamp-h1: $(srcdir)/gsm_config.h.in $(top_builddir)/config.status -- @rm -f stamp-h1 -- cd $(top_builddir) && $(SHELL) ./config.status gsm_config.h -- --$(srcdir)/gsm_config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h -+stamp-h: $(srcdir)/gsm_config.h.in $(top_builddir)/config.status -+ cd $(top_builddir) \ -+ && CONFIG_FILES= CONFIG_HEADERS=gsm_config.h \ -+ $(SHELL) ./config.status -+ @echo timestamp > stamp-h 2> /dev/null -+$(srcdir)/gsm_config.h.in: $(srcdir)/stamp-h.in -+ @if test ! -f $@; then \ -+ rm -f $(srcdir)/stamp-h.in; \ -+ $(MAKE) $(srcdir)/stamp-h.in; \ -+ else :; fi -+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - cd $(top_srcdir) && $(AUTOHEADER) -- touch $(srcdir)/gsm_config.h.in -+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - --distclean-hdr: -- -rm -f gsm_config.h stamp-h1 --intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in -- cd $(top_builddir) && $(SHELL) ./config.status $@ -+mostlyclean-hdr: - --mostlyclean-libtool: -- -rm -f *.lo -+clean-hdr: - --clean-libtool: -- -rm -rf .libs _libs -+distclean-hdr: -+ -rm -f gsm_config.h - --distclean-libtool: -- -rm -f libtool --uninstall-info-am: -+maintainer-clean-hdr: - - # This directory's subdirectories are mostly independent; you can cd - # into them and run `make' without going through this Makefile. -@@ -198,8 +195,13 @@ - # (1) if the variable is set in `config.status', edit `config.status' - # (which will cause the Makefiles to be regenerated when you run `make'); - # (2) otherwise, pass the desired values on the `make' command line. --$(RECURSIVE_TARGETS): -- @set fnord $$MAKEFLAGS; amf=$$2; \ -+ -+@SET_MAKE@ -+ -+all-recursive install-data-recursive install-exec-recursive \ -+installdirs-recursive install-recursive uninstall-recursive \ -+check-recursive installcheck-recursive info-recursive dvi-recursive: -+ @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ -@@ -219,18 +221,13 @@ - - mostlyclean-recursive clean-recursive distclean-recursive \ - maintainer-clean-recursive: -- @set fnord $$MAKEFLAGS; amf=$$2; \ -+ @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ -- case "$@" in \ -- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ -- *) list='$(SUBDIRS)' ;; \ -- esac; \ -- rev=''; for subdir in $$list; do \ -- if test "$$subdir" = "."; then :; else \ -- rev="$$subdir $$rev"; \ -- fi; \ -+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ -+ rev="$$subdir $$rev"; \ -+ test "$$subdir" != "." || dot_seen=yes; \ - done; \ -- rev="$$rev ."; \ -+ test "$$dot_seen" = "no" && rev=". $$rev"; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ -@@ -247,237 +244,180 @@ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done - --ETAGS = etags --ETAGSFLAGS = -- - tags: TAGS - --ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) -- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ -- unique=`for i in $$list; do \ -- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ -- done | \ -- $(AWK) ' { files[$$0] = 1; } \ -+ID: $(HEADERS) $(SOURCES) $(LISP) -+ list='$(SOURCES) $(HEADERS)'; \ -+ unique=`for i in $$list; do echo $$i; done | \ -+ awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ -- mkid -fID $$unique -+ here=`pwd` && cd $(srcdir) \ -+ && mkid -f$$here/ID $$unique $(LISP) - --TAGS: tags-recursive $(HEADERS) $(SOURCES) gsm_config.h.in $(TAGS_DEPENDENCIES) \ -- $(TAGS_FILES) $(LISP) -+TAGS: tags-recursive $(HEADERS) $(SOURCES) gsm_config.h.in $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ -- if test "$$subdir" = .; then :; else \ -+ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ -- fi; \ -+ fi; \ - done; \ -- list='$(SOURCES) $(HEADERS) gsm_config.h.in $(LISP) $(TAGS_FILES)'; \ -- unique=`for i in $$list; do \ -- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ -- done | \ -- $(AWK) ' { files[$$0] = 1; } \ -+ list='$(SOURCES) $(HEADERS)'; \ -+ unique=`for i in $$list; do echo $$i; done | \ -+ awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ -- test -z "$(ETAGS_ARGS)$$tags$$unique" \ -- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ -- $$tags $$unique -- --GTAGS: -- here=`$(am__cd) $(top_builddir) && pwd` \ -- && cd $(top_srcdir) \ -- && gtags -i $(GTAGS_ARGS) $$here -+ test -z "$(ETAGS_ARGS)gsm_config.h.in$$unique$(LISP)$$tags" \ -+ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags gsm_config.h.in $$unique $(LISP)) - --distclean-tags: -- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH --DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -+mostlyclean-tags: - --top_distdir = . --distdir = $(PACKAGE)-$(VERSION) -+clean-tags: - --am__remove_distdir = \ -- { test ! -d $(distdir) \ -- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ -- && rm -fr $(distdir); }; } -+distclean-tags: -+ -rm -f TAGS ID - --GZIP_ENV = --best --distcleancheck_listfiles = find . -type f -print -+maintainer-clean-tags: - -+distdir = $(PACKAGE)-$(VERSION) -+top_distdir = $(distdir) -+ -+# This target untars the dist file and tries a VPATH configuration. Then -+# it guarantees that the distribution is self-contained by making another -+# tarfile. -+distcheck: dist -+ -rm -rf $(distdir) -+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz -+ mkdir $(distdir)/=build -+ mkdir $(distdir)/=inst -+ dc_install_base=`cd $(distdir)/=inst && pwd`; \ -+ cd $(distdir)/=build \ -+ && ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \ -+ && $(MAKE) $(AM_MAKEFLAGS) \ -+ && $(MAKE) $(AM_MAKEFLAGS) dvi \ -+ && $(MAKE) $(AM_MAKEFLAGS) check \ -+ && $(MAKE) $(AM_MAKEFLAGS) install \ -+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ -+ && $(MAKE) $(AM_MAKEFLAGS) dist -+ -rm -rf $(distdir) -+ @banner="$(distdir).tar.gz is ready for distribution"; \ -+ dashes=`echo "$$banner" | sed s/./=/g`; \ -+ echo "$$dashes"; \ -+ echo "$$banner"; \ -+ echo "$$dashes" -+dist: distdir -+ -chmod -R a+r $(distdir) -+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -+ -rm -rf $(distdir) -+dist-all: distdir -+ -chmod -R a+r $(distdir) -+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -+ -rm -rf $(distdir) - distdir: $(DISTFILES) -- $(am__remove_distdir) -+ -rm -rf $(distdir) - mkdir $(distdir) -- $(mkinstalldirs) $(distdir)/intl $(distdir)/po -- @list='$(DISTFILES)'; for file in $$list; do \ -- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ -- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ -- if test "$$dir" != "$$file" && test "$$dir" != "."; then \ -- dir="/$$dir"; \ -- $(mkinstalldirs) "$(distdir)$$dir"; \ -- else \ -- dir=''; \ -- fi; \ -+ -chmod 777 $(distdir) -+ here=`cd $(top_builddir) && pwd`; \ -+ top_distdir=`cd $(distdir) && pwd`; \ -+ distdir=`cd $(distdir) && pwd`; \ -+ cd $(top_srcdir) \ -+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile -+ @for file in $(DISTFILES); do \ -+ d=$(srcdir); \ - if test -d $$d/$$file; then \ -- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ -- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ -- fi; \ -- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ -+ cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ -- || cp -p $$d/$$file $(distdir)/$$file \ -- || exit 1; \ -+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ -+ || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ -+ for subdir in $(DIST_SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ -- (cd $$subdir && \ -- $(MAKE) $(AM_MAKEFLAGS) \ -- top_distdir="$(top_distdir)" \ -- distdir=../$(distdir)/$$subdir \ -- distdir) \ -+ chmod 777 $(distdir)/$$subdir; \ -+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done -- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ -- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ -- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ -- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ -- || chmod -R a+r $(distdir) --dist-gzip: distdir -- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -- $(am__remove_distdir) -- --dist dist-all: distdir -- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -- $(am__remove_distdir) -- --# This target untars the dist file and tries a VPATH configuration. Then --# it guarantees that the distribution is self-contained by making another --# tarfile. --distcheck: dist -- $(am__remove_distdir) -- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - -- chmod -R a-w $(distdir); chmod a+w $(distdir) -- mkdir $(distdir)/=build -- mkdir $(distdir)/=inst -- chmod a-w $(distdir) -- dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ -- && cd $(distdir)/=build \ -- && ../configure --srcdir=.. --prefix=$$dc_install_base \ -- --with-included-gettext \ -- $(DISTCHECK_CONFIGURE_FLAGS) \ -- && $(MAKE) $(AM_MAKEFLAGS) \ -- && $(MAKE) $(AM_MAKEFLAGS) dvi \ -- && $(MAKE) $(AM_MAKEFLAGS) check \ -- && $(MAKE) $(AM_MAKEFLAGS) install \ -- && $(MAKE) $(AM_MAKEFLAGS) installcheck \ -- && $(MAKE) $(AM_MAKEFLAGS) uninstall \ -- && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ -- || { echo "ERROR: files left after uninstall:" ; \ -- find $$dc_install_base -type f -print ; \ -- exit 1; } >&2 ) \ -- && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ -- && rm -f $(distdir).tar.gz \ -- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck -- $(am__remove_distdir) -- @echo "$(distdir).tar.gz is ready for distribution" | \ -- sed 'h;s/./=/g;p;x;p;x' --distcleancheck: distclean -- if test '$(srcdir)' = . ; then \ -- echo "ERROR: distcleancheck can only run from a VPATH build" ; \ -- exit 1 ; \ -- fi -- test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ -- || { echo "ERROR: files left after distclean:" ; \ -- $(distcleancheck_listfiles) ; \ -- exit 1; } >&2 -+info-am: -+info: info-recursive -+dvi-am: -+dvi: dvi-recursive - check-am: all-am - check: check-recursive --all-am: Makefile gsm_config.h --installdirs: installdirs-recursive --installdirs-am: -+installcheck-am: -+installcheck: installcheck-recursive -+all-recursive-am: gsm_config.h -+ $(MAKE) $(AM_MAKEFLAGS) all-recursive - --install: install-recursive -+install-exec-am: - install-exec: install-exec-recursive -+ -+install-data-am: - install-data: install-data-recursive --uninstall: uninstall-recursive - - install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -- --installcheck: installcheck-recursive -+install: install-recursive -+uninstall-am: -+uninstall: uninstall-recursive -+all-am: Makefile gsm_config.h -+all-redirect: all-recursive-am - install-strip: -- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ -- INSTALL_STRIP_FLAG=-s \ -- `test -z '$(STRIP)' || \ -- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -+installdirs: installdirs-recursive -+installdirs-am: -+ -+ - mostlyclean-generic: - - clean-generic: - - distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) -+ -rm -f config.cache config.log stamp-h stamp-h[0-9]* - - maintainer-clean-generic: -- @echo "This command is intended for maintainers to use" -- @echo "it deletes files that may require special tools to rebuild." --clean: clean-recursive -- --clean-am: clean-generic clean-libtool mostlyclean-am -- --distclean: distclean-recursive -- -rm -f $(am__CONFIG_DISTCLEAN_FILES) --distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ -- distclean-tags -+mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic - --dvi: dvi-recursive -- --dvi-am: -- --info: info-recursive -- --info-am: -+mostlyclean: mostlyclean-recursive - --install-data-am: -+clean-am: clean-hdr clean-tags clean-generic mostlyclean-am - --install-exec-am: -+clean: clean-recursive - --install-info: install-info-recursive -+distclean-am: distclean-hdr distclean-tags distclean-generic clean-am -+ -rm -f libtool - --install-man: -+distclean: distclean-recursive -+ -rm -f config.status - --installcheck-am: -+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ -+ maintainer-clean-generic distclean-am -+ @echo "This command is intended for maintainers to use;" -+ @echo "it deletes files that may require special tools to rebuild." - - maintainer-clean: maintainer-clean-recursive -- -rm -f $(am__CONFIG_DISTCLEAN_FILES) -- -rm -rf autom4te.cache --maintainer-clean-am: distclean-am maintainer-clean-generic -- --mostlyclean: mostlyclean-recursive -- --mostlyclean-am: mostlyclean-generic mostlyclean-libtool -+ -rm -f config.status - --uninstall-am: uninstall-info-am -- --uninstall-info: uninstall-info-recursive -- --.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ -- clean-generic clean-libtool clean-recursive dist dist-all \ -- dist-gzip distcheck distclean distclean-generic distclean-hdr \ -- distclean-libtool distclean-recursive distclean-tags \ -- distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ -- info-recursive install install-am install-data install-data-am \ -- install-data-recursive install-exec install-exec-am \ -- install-exec-recursive install-info install-info-am \ -- install-info-recursive install-man install-recursive \ -- install-strip installcheck installcheck-am installdirs \ -- installdirs-am installdirs-recursive maintainer-clean \ -- maintainer-clean-generic maintainer-clean-recursive mostlyclean \ -- mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ -- tags tags-recursive uninstall uninstall-am uninstall-info-am \ -- uninstall-info-recursive uninstall-recursive -+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -+install-data-recursive uninstall-data-recursive install-exec-recursive \ -+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ -+all-recursive check-recursive installcheck-recursive info-recursive \ -+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ -+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ -+install-exec-am install-exec install-data-am install-data install-am \ -+install uninstall-am uninstall all-redirect all-am all installdirs-am \ -+installdirs mostlyclean-generic distclean-generic clean-generic \ -+maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - - all: -+ - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: ---- gsmlib-1.10.orig/gsm_config.h.in -+++ gsmlib-1.10/gsm_config.h.in -@@ -55,25 +55,50 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_ARGZ_H - -+/* Define to 1 if you have the `asprintf' function. */ -+#undef HAVE_ASPRINTF -+ -+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the -+ CoreFoundation framework. */ -+#undef HAVE_CFLOCALECOPYCURRENT -+ -+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in -+ the CoreFoundation framework. */ -+#undef HAVE_CFPREFERENCESCOPYAPPVALUE -+ - /* Define if the GNU dcgettext() function is already present or preinstalled. - */ - #undef HAVE_DCGETTEXT - -+/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you -+ don't. */ -+#undef HAVE_DECL_FEOF_UNLOCKED -+ -+/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if -+ you don't. */ -+#undef HAVE_DECL_FGETS_UNLOCKED -+ -+/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you -+ don't. */ -+#undef HAVE_DECL_GETC_UNLOCKED -+ -+/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you -+ don't. */ -+#undef HAVE_DECL__SNPRINTF -+ -+/* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you -+ don't. */ -+#undef HAVE_DECL__SNWPRINTF -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_DLFCN_H - --/* Define to 1 if you have the `feof_unlocked' function. */ --#undef HAVE_FEOF_UNLOCKED -- --/* Define to 1 if you have the `fgets_unlocked' function. */ --#undef HAVE_FGETS_UNLOCKED -+/* Define to 1 if you have the `fwprintf' function. */ -+#undef HAVE_FWPRINTF - - /* Define to 1 if you have the `getcwd' function. */ - #undef HAVE_GETCWD - --/* Define to 1 if you have the `getc_unlocked' function. */ --#undef HAVE_GETC_UNLOCKED -- - /* Define to 1 if you have the `getegid' function. */ - #undef HAVE_GETEGID - -@@ -95,6 +120,9 @@ - /* Define if you have the iconv() function. */ - #undef HAVE_ICONV - -+/* Define if you have the 'intmax_t' type in or . */ -+#undef HAVE_INTMAX_T -+ - /* Define if exists and doesn't clash with . */ - #undef HAVE_INTTYPES_H - -@@ -120,6 +148,12 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_LOCALE_H - -+/* Define if you have the 'long double' type. */ -+#undef HAVE_LONG_DOUBLE -+ -+/* Define if you have the 'long long' type. */ -+#undef HAVE_LONG_LONG -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_MALLOC_H - -@@ -141,6 +175,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_NL_TYPES_H - -+/* Define if your printf() function supports format strings with positions. */ -+#undef HAVE_POSIX_PRINTF -+ - /* Define to 1 if you have the `putenv' function. */ - #undef HAVE_PUTENV - -@@ -150,6 +187,9 @@ - /* Define to 1 if you have the `setlocale' function. */ - #undef HAVE_SETLOCALE - -+/* Define to 1 if you have the `snprintf' function. */ -+#undef HAVE_SNPRINTF -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_STDDEF_H - -@@ -193,12 +233,24 @@ - /* Define to 1 if you have the `tsearch' function. */ - #undef HAVE_TSEARCH - -+/* Define if you have the 'uintmax_t' type in or . */ -+#undef HAVE_UINTMAX_T -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_UNISTD_H - --/* Define if you have the unsigned long long type. */ -+/* Define if you have the 'unsigned long long' type. */ - #undef HAVE_UNSIGNED_LONG_LONG - -+/* Define if you have the 'wchar_t' type. */ -+#undef HAVE_WCHAR_T -+ -+/* Define to 1 if you have the `wcslen' function. */ -+#undef HAVE_WCSLEN -+ -+/* Define if you have the 'wint_t' type. */ -+#undef HAVE_WINT_T -+ - /* Define to 1 if you have the `__argz_count' function. */ - #undef HAVE___ARGZ_COUNT - -@@ -208,6 +260,9 @@ - /* Define to 1 if you have the `__argz_stringify' function. */ - #undef HAVE___ARGZ_STRINGIFY - -+/* Define to 1 if you have the `__fsetlocking' function. */ -+#undef HAVE___FSETLOCKING -+ - /* Define as const if the declaration of iconv() needs const. */ - #undef ICONV_CONST - -@@ -244,12 +299,16 @@ - /* The size of a `unsigned short int', as computed by sizeof. */ - #undef SIZEOF_UNSIGNED_SHORT_INT - -+/* Define as the maximum value of type 'size_t', if the system doesn't define -+ it. */ -+#undef SIZE_MAX -+ - /* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. -- STACK_DIRECTION > 0 => grows toward higher addresses -- STACK_DIRECTION < 0 => grows toward lower addresses -- STACK_DIRECTION = 0 => direction of growth unknown */ -+ STACK_DIRECTION > 0 => grows toward higher addresses -+ STACK_DIRECTION < 0 => grows toward lower addresses -+ STACK_DIRECTION = 0 => direction of growth unknown */ - #undef STACK_DIRECTION - - /* Define to 1 if you have the ANSI C header files. */ -@@ -261,16 +320,25 @@ - /* Define to empty if `const' does not conform to ANSI C. */ - #undef const - --/* Define as `__inline' if that's what the C compiler calls it, or to nothing -- if it is not supported. */ -+/* Define to `__inline__' or `__inline' if that's what the C compiler -+ calls it, or to nothing if 'inline' is not supported under any name. */ -+#ifndef __cplusplus - #undef inline -+#endif - - /* Define to `long' if does not define. */ - #undef off_t - -+/* Define as the type of the result of subtracting two pointers, if the system -+ doesn't define it. */ -+#undef ptrdiff_t -+ -+/* Define to empty if the C compiler doesn't support this keyword. */ -+#undef signed -+ - /* Define to `unsigned' if does not define. */ - #undef size_t - --/* Define to unsigned long or unsigned long long if and -- don't define. */ -+/* Define to unsigned long or unsigned long long if and -+ don't define. */ - #undef uintmax_t ---- gsmlib-1.10.orig/aclocal.m4 -+++ gsmlib-1.10/aclocal.m4 -@@ -1,7 +1,7 @@ --# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- -+# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - --# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 --# Free Software Foundation, Inc. -+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+# 2005 Free Software Foundation, Inc. - # This file is free software; the Free Software Foundation - # gives unlimited permission to copy and/or distribute it, - # with or without modifications, as long as this notice is preserved. -@@ -11,5211 +11,1221 @@ - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. - -+# codeset.m4 serial AM1 (gettext-0.10.40) -+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- -- --# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. -+dnl From Bruno Haible. - --# 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, or (at your option) --# any later version. -+AC_DEFUN([AM_LANGINFO_CODESET], -+[ -+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, -+ [AC_TRY_LINK([#include ], -+ [char* cs = nl_langinfo(CODESET);], -+ am_cv_langinfo_codeset=yes, -+ am_cv_langinfo_codeset=no) -+ ]) -+ if test $am_cv_langinfo_codeset = yes; then -+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1, -+ [Define if you have and nl_langinfo(CODESET).]) -+ fi -+]) - --# 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. -+# gettext.m4 serial 37 (gettext-0.14.4) -+dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+dnl -+dnl This file can can be used in projects which are not available under -+dnl the GNU General Public License or the GNU Library General Public -+dnl License but which still want to provide support for the GNU gettext -+dnl functionality. -+dnl Please note that the actual code of the GNU gettext library is covered -+dnl by the GNU Library General Public License, and the rest of the GNU -+dnl gettext package package is covered by the GNU General Public License. -+dnl They are *not* in the public domain. - --# 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. -+dnl Authors: -+dnl Ulrich Drepper , 1995-2000. -+dnl Bruno Haible , 2000-2003. - --AC_PREREQ([2.52]) -+dnl Macro to add for using GNU gettext. - --# serial 6 -+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). -+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The -+dnl default (if it is not specified or empty) is 'no-libtool'. -+dnl INTLSYMBOL should be 'external' for packages with no intl directory, -+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. -+dnl If INTLSYMBOL is 'use-libtool', then a libtool library -+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, -+dnl depending on --{enable,disable}-{shared,static} and on the presence of -+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library -+dnl $(top_builddir)/intl/libintl.a will be created. -+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext -+dnl implementations (in libc or libintl) without the ngettext() function -+dnl will be ignored. If NEEDSYMBOL is specified and is -+dnl 'need-formatstring-macros', then GNU gettext implementations that don't -+dnl support the ISO C 99 formatstring macros will be ignored. -+dnl INTLDIR is used to find the intl libraries. If empty, -+dnl the value `$(top_builddir)/intl/' is used. -+dnl -+dnl The result of the configuration is one of three cases: -+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled -+dnl and used. -+dnl Catalog format: GNU --> install in $(datadir) -+dnl Catalog extension: .mo after installation, .gmo in source tree -+dnl 2) GNU gettext has been found in the system's C library. -+dnl Catalog format: GNU --> install in $(datadir) -+dnl Catalog extension: .mo after installation, .gmo in source tree -+dnl 3) No internationalization, always use English msgid. -+dnl Catalog format: none -+dnl Catalog extension: none -+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. -+dnl The use of .gmo is historical (it was needed to avoid overwriting the -+dnl GNU format catalogs when building on a platform with an X/Open gettext), -+dnl but we keep it in order not to force irrelevant filename changes on the -+dnl maintainers. -+dnl -+AC_DEFUN([AM_GNU_GETTEXT], -+[ -+ dnl Argument checking. -+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , -+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT -+])])])])]) -+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , -+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT -+])])])]) -+ define([gt_included_intl], ifelse([$1], [external], [no], [yes])) -+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) - --# When config.status generates a header, we must update the stamp-h file. --# This file resides in the same directory as the config header --# that is generated. We must strip everything past the first ":", --# and everything past the last "/". -+ AC_REQUIRE([AM_PO_SUBDIRS])dnl -+ ifelse(gt_included_intl, yes, [ -+ AC_REQUIRE([AM_INTL_SUBDIR])dnl -+ ]) - --# _AM_DIRNAME(PATH) --# ----------------- --# Like AS_DIRNAME, only do it during macro expansion --AC_DEFUN([_AM_DIRNAME], -- [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, -- m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, -- m4_if(regexp([$1], [^/.*]), -1, -- [.], -- patsubst([$1], [^\(/\).*], [\1])), -- patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), -- patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl --])# _AM_DIRNAME -- -- --# The stamp files are numbered to have different names. --# We could number them on a directory basis, but that's additional --# complications, let's have a unique counter. --m4_define([_AM_STAMP_Count], [0]) -+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ AC_REQUIRE([AC_LIB_RPATH]) - -+ dnl Sometimes libintl requires libiconv, so first search for libiconv. -+ dnl Ideally we would do this search only after the -+ dnl if test "$USE_NLS" = "yes"; then -+ dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then -+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT -+ dnl the configure script would need to contain the same shell code -+ dnl again, outside any 'if'. There are two solutions: -+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. -+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. -+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not -+ dnl documented, we avoid it. -+ ifelse(gt_included_intl, yes, , [ -+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) -+ ]) - --# _AM_STAMP(HEADER) --# ----------------- --# The name of the stamp file for HEADER. --AC_DEFUN([_AM_STAMP], --[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl --AS_ESCAPE(_AM_DIRNAME(patsubst([$1], -- [:.*])))/stamp-h[]_AM_STAMP_Count]) -+ dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. -+ gt_INTL_MACOSX - -+ dnl Set USE_NLS. -+ AM_NLS - --# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) --# ------------------------------------------------------------ --# We used to try to get a real timestamp in stamp-h. But the fear is that --# that will cause unnecessary cvs conflicts. --AC_DEFUN([_AM_CONFIG_HEADER], --[# Add the stamp file to the list of files AC keeps track of, --# along with our hook. --AC_CONFIG_HEADERS([$1], -- [# update the timestamp --echo 'timestamp for $1' >"_AM_STAMP([$1])" --$2], -- [$3]) --])# _AM_CONFIG_HEADER -- -- --# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) --# -------------------------------------------------------------- --AC_DEFUN([AM_CONFIG_HEADER], --[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) --])# AM_CONFIG_HEADER -+ ifelse(gt_included_intl, yes, [ -+ BUILD_INCLUDED_LIBINTL=no -+ USE_INCLUDED_LIBINTL=no -+ ]) -+ LIBINTL= -+ LTLIBINTL= -+ POSUB= - --# Do all the work for Automake. -*- Autoconf -*- -+ dnl If we use NLS figure out what method -+ if test "$USE_NLS" = "yes"; then -+ gt_use_preinstalled_gnugettext=no -+ ifelse(gt_included_intl, yes, [ -+ AC_MSG_CHECKING([whether included gettext is requested]) -+ AC_ARG_WITH(included-gettext, -+ [ --with-included-gettext use the GNU gettext library included here], -+ nls_cv_force_use_gnu_gettext=$withval, -+ nls_cv_force_use_gnu_gettext=no) -+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) - --# This macro actually does too much some checks are only needed if --# your package does certain things. But this isn't really a big deal. -+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" -+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then -+ ]) -+ dnl User does not insist on using GNU NLS library. Figure out what -+ dnl to use. If GNU gettext is available we use this. Else we have -+ dnl to fall back to GNU NLS library. - --# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 --# Free Software Foundation, Inc. -+ dnl Add a version number to the cache macros. -+ define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) -+ define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) -+ define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) - --# 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, or (at your option) --# any later version. -+ AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, -+ [AC_TRY_LINK([#include -+]ifelse([$2], [need-formatstring-macros], -+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -+#endif -+changequote(,)dnl -+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -+changequote([,])dnl -+], [])[extern int _nl_msg_cat_cntr; -+extern int *_nl_domain_bindings;], -+ [bindtextdomain ("", ""); -+return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], -+ gt_cv_func_gnugettext_libc=yes, -+ gt_cv_func_gnugettext_libc=no)]) - --# 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. -+ if test "$gt_cv_func_gnugettext_libc" != "yes"; then -+ dnl Sometimes libintl requires libiconv, so first search for libiconv. -+ ifelse(gt_included_intl, yes, , [ -+ AM_ICONV_LINK -+ ]) -+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL -+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) -+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL -+ dnl even if libiconv doesn't exist. -+ AC_LIB_LINKFLAGS_BODY([intl]) -+ AC_CACHE_CHECK([for GNU gettext in libintl], -+ gt_cv_func_gnugettext_libintl, -+ [gt_save_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS $INCINTL" -+ gt_save_LIBS="$LIBS" -+ LIBS="$LIBS $LIBINTL" -+ dnl Now see whether libintl exists and does not depend on libiconv. -+ AC_TRY_LINK([#include -+]ifelse([$2], [need-formatstring-macros], -+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -+#endif -+changequote(,)dnl -+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -+changequote([,])dnl -+], [])[extern int _nl_msg_cat_cntr; -+extern -+#ifdef __cplusplus -+"C" -+#endif -+const char *_nl_expand_alias (const char *);], -+ [bindtextdomain ("", ""); -+return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], -+ gt_cv_func_gnugettext_libintl=yes, -+ gt_cv_func_gnugettext_libintl=no) -+ dnl Now see whether libintl exists and depends on libiconv. -+ if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then -+ LIBS="$LIBS $LIBICONV" -+ AC_TRY_LINK([#include -+]ifelse([$2], [need-formatstring-macros], -+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -+#endif -+changequote(,)dnl -+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -+changequote([,])dnl -+], [])[extern int _nl_msg_cat_cntr; -+extern -+#ifdef __cplusplus -+"C" -+#endif -+const char *_nl_expand_alias (const char *);], -+ [bindtextdomain ("", ""); -+return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], -+ [LIBINTL="$LIBINTL $LIBICONV" -+ LTLIBINTL="$LTLIBINTL $LTLIBICONV" -+ gt_cv_func_gnugettext_libintl=yes -+ ]) -+ fi -+ CPPFLAGS="$gt_save_CPPFLAGS" -+ LIBS="$gt_save_LIBS"]) -+ fi - --# 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. -+ dnl If an already present or preinstalled GNU gettext() is found, -+ dnl use it. But if this macro is used in GNU gettext, and GNU -+ dnl gettext is already preinstalled in libintl, we update this -+ dnl libintl. (Cf. the install rule in intl/Makefile.in.) -+ if test "$gt_cv_func_gnugettext_libc" = "yes" \ -+ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ -+ && test "$PACKAGE" != gettext-runtime \ -+ && test "$PACKAGE" != gettext-tools; }; then -+ gt_use_preinstalled_gnugettext=yes -+ else -+ dnl Reset the values set by searching for libintl. -+ LIBINTL= -+ LTLIBINTL= -+ INCINTL= -+ fi - --# serial 8 -+ ifelse(gt_included_intl, yes, [ -+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then -+ dnl GNU gettext is not found in the C library. -+ dnl Fall back on included GNU gettext library. -+ nls_cv_use_gnu_gettext=yes -+ fi -+ fi - --# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be --# written in clear, in which case automake, when reading aclocal.m4, --# will think it sees a *use*, and therefore will trigger all it's --# C support machinery. Also note that it means that autoscan, seeing --# CC etc. in the Makefile, will ask for an AC_PROG_CC use... -+ if test "$nls_cv_use_gnu_gettext" = "yes"; then -+ dnl Mark actions used to generate GNU NLS library. -+ BUILD_INCLUDED_LIBINTL=yes -+ USE_INCLUDED_LIBINTL=yes -+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" -+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" -+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` -+ fi - -+ CATOBJEXT= -+ if test "$gt_use_preinstalled_gnugettext" = "yes" \ -+ || test "$nls_cv_use_gnu_gettext" = "yes"; then -+ dnl Mark actions to use GNU gettext tools. -+ CATOBJEXT=.gmo -+ fi -+ ]) - --AC_PREREQ([2.52]) -+ if test -n "$INTL_MACOSX_LIBS"; then -+ if test "$gt_use_preinstalled_gnugettext" = "yes" \ -+ || test "$nls_cv_use_gnu_gettext" = "yes"; then -+ dnl Some extra flags are needed during linking. -+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" -+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" -+ fi -+ fi - --# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow --# the ones we care about. --m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -+ if test "$gt_use_preinstalled_gnugettext" = "yes" \ -+ || test "$nls_cv_use_gnu_gettext" = "yes"; then -+ AC_DEFINE(ENABLE_NLS, 1, -+ [Define to 1 if translation of program messages to the user's native language -+ is requested.]) -+ else -+ USE_NLS=no -+ fi -+ fi - --# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) --# AM_INIT_AUTOMAKE([OPTIONS]) --# ----------------------------------------------- --# The call with PACKAGE and VERSION arguments is the old style --# call (pre autoconf-2.50), which is being phased out. PACKAGE --# and VERSION should now be passed to AC_INIT and removed from --# the call to AM_INIT_AUTOMAKE. --# We support both call styles for the transition. After --# the next Automake release, Autoconf can make the AC_INIT --# arguments mandatory, and then we can depend on a new Autoconf --# release and drop the old call support. --AC_DEFUN([AM_INIT_AUTOMAKE], --[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -- AC_REQUIRE([AC_PROG_INSTALL])dnl --# test to see if srcdir already configured --if test "`cd $srcdir && pwd`" != "`pwd`" && -- test -f $srcdir/config.status; then -- AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) --fi -+ AC_MSG_CHECKING([whether to use NLS]) -+ AC_MSG_RESULT([$USE_NLS]) -+ if test "$USE_NLS" = "yes"; then -+ AC_MSG_CHECKING([where the gettext function comes from]) -+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then -+ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then -+ gt_source="external libintl" -+ else -+ gt_source="libc" -+ fi -+ else -+ gt_source="included intl directory" -+ fi -+ AC_MSG_RESULT([$gt_source]) -+ fi - --# Define the identity of the package. --dnl Distinguish between old-style and new-style calls. --m4_ifval([$2], --[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl -- AC_SUBST([PACKAGE], [$1])dnl -- AC_SUBST([VERSION], [$2])], --[_AM_SET_OPTIONS([$1])dnl -- AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl -- AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl -+ if test "$USE_NLS" = "yes"; then - --_AM_IF_OPTION([no-define],, --[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl -+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then -+ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then -+ AC_MSG_CHECKING([how to link with libintl]) -+ AC_MSG_RESULT([$LIBINTL]) -+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) -+ fi - --# Some tools Automake needs. --AC_REQUIRE([AM_SANITY_CHECK])dnl --AC_REQUIRE([AC_ARG_PROGRAM])dnl --AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) --AM_MISSING_PROG(AUTOCONF, autoconf) --AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) --AM_MISSING_PROG(AUTOHEADER, autoheader) --AM_MISSING_PROG(MAKEINFO, makeinfo) --AM_MISSING_PROG(AMTAR, tar) --AM_PROG_INSTALL_SH --AM_PROG_INSTALL_STRIP --# We need awk for the "check" target. The system "awk" is bad on --# some platforms. --AC_REQUIRE([AC_PROG_AWK])dnl --AC_REQUIRE([AC_PROG_MAKE_SET])dnl -+ dnl For backward compatibility. Some packages may be using this. -+ AC_DEFINE(HAVE_GETTEXT, 1, -+ [Define if the GNU gettext() function is already present or preinstalled.]) -+ AC_DEFINE(HAVE_DCGETTEXT, 1, -+ [Define if the GNU dcgettext() function is already present or preinstalled.]) -+ fi - --_AM_IF_OPTION([no-dependencies],, --[AC_PROVIDE_IFELSE([AC_PROG_][CC], -- [_AM_DEPENDENCIES(CC)], -- [define([AC_PROG_][CC], -- defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl --AC_PROVIDE_IFELSE([AC_PROG_][CXX], -- [_AM_DEPENDENCIES(CXX)], -- [define([AC_PROG_][CXX], -- defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl --]) --]) -+ dnl We need to process the po/ directory. -+ POSUB=po -+ fi - --# Copyright 2002 Free Software Foundation, Inc. -+ ifelse(gt_included_intl, yes, [ -+ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL -+ dnl to 'yes' because some of the testsuite requires it. -+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then -+ BUILD_INCLUDED_LIBINTL=yes -+ fi - --# 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, or (at your option) --# any later version. -+ dnl Make all variables we use known to autoconf. -+ AC_SUBST(BUILD_INCLUDED_LIBINTL) -+ AC_SUBST(USE_INCLUDED_LIBINTL) -+ AC_SUBST(CATOBJEXT) - --# 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. -+ dnl For backward compatibility. Some configure.ins may be using this. -+ nls_cv_header_intl= -+ nls_cv_header_libgt= - --# 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 -+ dnl For backward compatibility. Some Makefiles may be using this. -+ DATADIRNAME=share -+ AC_SUBST(DATADIRNAME) - --# AM_AUTOMAKE_VERSION(VERSION) --# ---------------------------- --# Automake X.Y traces this macro to ensure aclocal.m4 has been --# generated from the m4 files accompanying Automake X.Y. --AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) -+ dnl For backward compatibility. Some Makefiles may be using this. -+ INSTOBJEXT=.mo -+ AC_SUBST(INSTOBJEXT) - --# AM_SET_CURRENT_AUTOMAKE_VERSION --# ------------------------------- --# Call AM_AUTOMAKE_VERSION so it can be traced. --# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. --AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -- [AM_AUTOMAKE_VERSION([1.6.3])]) -+ dnl For backward compatibility. Some Makefiles may be using this. -+ GENCAT=gencat -+ AC_SUBST(GENCAT) - --# Helper functions for option handling. -*- Autoconf -*- -+ dnl For backward compatibility. Some Makefiles may be using this. -+ INTLOBJS= -+ if test "$USE_INCLUDED_LIBINTL" = yes; then -+ INTLOBJS="\$(GETTOBJS)" -+ fi -+ AC_SUBST(INTLOBJS) - --# Copyright 2001, 2002 Free Software Foundation, Inc. -+ dnl Enable libtool support if the surrounding package wishes it. -+ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix -+ AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) -+ ]) - --# 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, or (at your option) --# any later version. -+ dnl For backward compatibility. Some Makefiles may be using this. -+ INTLLIBS="$LIBINTL" -+ AC_SUBST(INTLLIBS) - --# 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. -+ dnl Make all documented variables known to autoconf. -+ AC_SUBST(LIBINTL) -+ AC_SUBST(LTLIBINTL) -+ AC_SUBST(POSUB) -+]) - --# 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. - --# serial 2 -+dnl Checks for all prerequisites of the intl subdirectory, -+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, -+dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. -+AC_DEFUN([AM_INTL_SUBDIR], -+[ -+ AC_REQUIRE([AC_PROG_INSTALL])dnl -+ AC_REQUIRE([AM_MKINSTALLDIRS])dnl -+ AC_REQUIRE([AC_PROG_CC])dnl -+ AC_REQUIRE([AC_CANONICAL_HOST])dnl -+ AC_REQUIRE([gt_GLIBC2])dnl -+ AC_REQUIRE([AC_PROG_RANLIB])dnl -+ AC_REQUIRE([AC_ISC_POSIX])dnl -+ AC_REQUIRE([AC_HEADER_STDC])dnl -+ AC_REQUIRE([AC_C_CONST])dnl -+ AC_REQUIRE([bh_C_SIGNED])dnl -+ AC_REQUIRE([AC_C_INLINE])dnl -+ AC_REQUIRE([AC_TYPE_OFF_T])dnl -+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl -+ AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl -+ AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl -+ AC_REQUIRE([gt_TYPE_WCHAR_T])dnl -+ AC_REQUIRE([gt_TYPE_WINT_T])dnl -+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) -+ AC_REQUIRE([gl_AC_HEADER_STDINT_H]) -+ AC_REQUIRE([gt_TYPE_INTMAX_T]) -+ AC_REQUIRE([gt_PRINTF_POSIX]) -+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl -+ AC_REQUIRE([AC_FUNC_MMAP])dnl -+ AC_REQUIRE([gl_GLIBC21])dnl -+ AC_REQUIRE([gt_INTDIV0])dnl -+ AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl -+ AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl -+ AC_REQUIRE([gt_INTTYPES_PRI])dnl -+ AC_REQUIRE([gl_XSIZE])dnl -+ AC_REQUIRE([gt_INTL_MACOSX])dnl - --# _AM_MANGLE_OPTION(NAME) --# ----------------------- --AC_DEFUN([_AM_MANGLE_OPTION], --[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) -+ AC_CHECK_TYPE([ptrdiff_t], , -+ [AC_DEFINE([ptrdiff_t], [long], -+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) -+ ]) -+ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ -+stdlib.h string.h unistd.h sys/param.h]) -+ AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ -+mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ -+strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ -+__fsetlocking]) -+ -+ dnl Use the _snprintf function only if it is declared (because on NetBSD it -+ dnl is defined as a weak alias of snprintf; we prefer to use the latter). -+ gt_CHECK_DECL(_snprintf, [#include ]) -+ gt_CHECK_DECL(_snwprintf, [#include ]) -+ -+ dnl Use the *_unlocked functions only if they are declared. -+ dnl (because some of them were defined without being declared in Solaris -+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built -+ dnl on Solaris 2.5.1 to run on Solaris 2.6). -+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. -+ gt_CHECK_DECL(feof_unlocked, [#include ]) -+ gt_CHECK_DECL(fgets_unlocked, [#include ]) -+ gt_CHECK_DECL(getc_unlocked, [#include ]) -+ -+ case $gt_cv_func_printf_posix in -+ *yes) HAVE_POSIX_PRINTF=1 ;; -+ *) HAVE_POSIX_PRINTF=0 ;; -+ esac -+ AC_SUBST([HAVE_POSIX_PRINTF]) -+ if test "$ac_cv_func_asprintf" = yes; then -+ HAVE_ASPRINTF=1 -+ else -+ HAVE_ASPRINTF=0 -+ fi -+ AC_SUBST([HAVE_ASPRINTF]) -+ if test "$ac_cv_func_snprintf" = yes; then -+ HAVE_SNPRINTF=1 -+ else -+ HAVE_SNPRINTF=0 -+ fi -+ AC_SUBST([HAVE_SNPRINTF]) -+ if test "$ac_cv_func_wprintf" = yes; then -+ HAVE_WPRINTF=1 -+ else -+ HAVE_WPRINTF=0 -+ fi -+ AC_SUBST([HAVE_WPRINTF]) - --# _AM_SET_OPTION(NAME) --# ------------------------------ --# Set option NAME. Presently that only means defining a flag for this option. --AC_DEFUN([_AM_SET_OPTION], --[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) -+ AM_ICONV -+ AM_LANGINFO_CODESET -+ if test $ac_cv_header_locale_h = yes; then -+ gt_LC_MESSAGES -+ fi - --# _AM_SET_OPTIONS(OPTIONS) --# ---------------------------------- --# OPTIONS is a space-separated list of Automake options. --AC_DEFUN([_AM_SET_OPTIONS], --[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) -+ if test -n "$INTL_MACOSX_LIBS"; then -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ fi - --# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) --# ------------------------------------------- --# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. --AC_DEFUN([_AM_IF_OPTION], --[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -+ dnl intl/plural.c is generated from intl/plural.y. It requires bison, -+ dnl because plural.y uses bison specific features. It requires at least -+ dnl bison-1.26 because earlier versions generate a plural.c that doesn't -+ dnl compile. -+ dnl bison is only needed for the maintainer (who touches plural.y). But in -+ dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put -+ dnl the rule in general Makefile. Now, some people carelessly touch the -+ dnl files or have a broken "make" program, hence the plural.c rule will -+ dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not -+ dnl present or too old. -+ AC_CHECK_PROGS([INTLBISON], [bison]) -+ if test -z "$INTLBISON"; then -+ ac_verc_fail=yes -+ else -+ dnl Found it, now check the version. -+ AC_MSG_CHECKING([version of bison]) -+changequote(<<,>>)dnl -+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ case $ac_prog_version in -+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; -+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) -+changequote([,])dnl -+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; -+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; -+ esac -+ AC_MSG_RESULT([$ac_prog_version]) -+ fi -+ if test $ac_verc_fail = yes; then -+ INTLBISON=: -+ fi -+]) - --# --# Check to make sure that the build environment is sane. --# - --# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. -+dnl Checks for special options needed on MacOS X. -+dnl Defines INTL_MACOSX_LIBS. -+AC_DEFUN([gt_INTL_MACOSX], -+[ -+ dnl Check for API introduced in MacOS X 10.2. -+ AC_CACHE_CHECK([for CFPreferencesCopyAppValue], -+ gt_cv_func_CFPreferencesCopyAppValue, -+ [gt_save_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ gt_save_LIBS="$LIBS" -+ LIBS="$LIBS -framework CoreFoundation" -+ AC_TRY_LINK([#include ], -+ [CFPreferencesCopyAppValue(NULL, NULL)], -+ [gt_cv_func_CFPreferencesCopyAppValue=yes], -+ [gt_cv_func_CFPreferencesCopyAppValue=no]) -+ CPPFLAGS="$gt_save_CPPFLAGS" -+ LIBS="$gt_save_LIBS"]) -+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then -+ AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, -+ [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) -+ fi -+ dnl Check for API introduced in MacOS X 10.3. -+ AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, -+ [gt_save_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ gt_save_LIBS="$LIBS" -+ LIBS="$LIBS -framework CoreFoundation" -+ AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], -+ [gt_cv_func_CFLocaleCopyCurrent=yes], -+ [gt_cv_func_CFLocaleCopyCurrent=no]) -+ CPPFLAGS="$gt_save_CPPFLAGS" -+ LIBS="$gt_save_LIBS"]) -+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then -+ AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, -+ [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) -+ fi -+ INTL_MACOSX_LIBS= -+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then -+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" -+ fi -+ AC_SUBST([INTL_MACOSX_LIBS]) -+]) - --# 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, 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. -+dnl gt_CHECK_DECL(FUNC, INCLUDES) -+dnl Check whether a function is declared. -+AC_DEFUN([gt_CHECK_DECL], -+[ -+ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, -+ [AC_TRY_COMPILE([$2], [ -+#ifndef $1 -+ char *p = (char *) $1; -+#endif -+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) -+ if test $ac_cv_have_decl_$1 = yes; then -+ gt_value=1 -+ else -+ gt_value=0 -+ fi -+ AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], -+ [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) -+]) - --# 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. - --# serial 3 -+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) -+AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) - --# AM_SANITY_CHECK --# --------------- --AC_DEFUN([AM_SANITY_CHECK], --[AC_MSG_CHECKING([whether build environment is sane]) --# Just in case --sleep 1 --echo timestamp > conftest.file --# Do `set' in a subshell so we don't clobber the current shell's --# arguments. Must try -L first in case configure is actually a --# symlink; some systems play weird games with the mod time of symlinks --# (eg FreeBSD returns the mod time of the symlink's containing --# directory). --if ( -- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` -- if test "$[*]" = "X"; then -- # -L didn't work. -- set X `ls -t $srcdir/configure conftest.file` -- fi -- rm -f conftest.file -- if test "$[*]" != "X $srcdir/configure conftest.file" \ -- && test "$[*]" != "X conftest.file $srcdir/configure"; then -- -- # If neither matched, then we have a broken ls. This can happen -- # if, for instance, CONFIG_SHELL is bash and it inherits a -- # broken ls alias from the environment. This has actually -- # happened. Such a system could not be considered "sane". -- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken --alias in your environment]) -- fi -- -- test "$[2]" = conftest.file -- ) --then -- # Ok. -- : --else -- AC_MSG_ERROR([newly created file is older than distributed files! --Check your system clock]) --fi --AC_MSG_RESULT(yes)]) -- --# -*- Autoconf -*- -+# glibc2.m4 serial 1 -+dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - -+# Test for the GNU C Library, version 2.0 or newer. -+# From Bruno Haible. - --# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. -+AC_DEFUN([gt_GLIBC2], -+ [ -+ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, -+ ac_cv_gnu_library_2, -+ [AC_EGREP_CPP([Lucky GNU user], -+ [ -+#include -+#ifdef __GNU_LIBRARY__ -+ #if (__GLIBC__ >= 2) -+ Lucky GNU user -+ #endif -+#endif -+ ], -+ ac_cv_gnu_library_2=yes, -+ ac_cv_gnu_library_2=no) -+ ] -+ ) -+ AC_SUBST(GLIBC2) -+ GLIBC2="$ac_cv_gnu_library_2" -+ ] -+) - --# 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, or (at your option) --# any later version. -+# glibc21.m4 serial 3 -+dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# 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. -+# Test for the GNU C Library, version 2.1 or newer. -+# From Bruno Haible. - --# 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. -+AC_DEFUN([gl_GLIBC21], -+ [ -+ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, -+ ac_cv_gnu_library_2_1, -+ [AC_EGREP_CPP([Lucky GNU user], -+ [ -+#include -+#ifdef __GNU_LIBRARY__ -+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) -+ Lucky GNU user -+ #endif -+#endif -+ ], -+ ac_cv_gnu_library_2_1=yes, -+ ac_cv_gnu_library_2_1=no) -+ ] -+ ) -+ AC_SUBST(GLIBC21) -+ GLIBC21="$ac_cv_gnu_library_2_1" -+ ] -+) - --# serial 3 -+# iconv.m4 serial AM4 (gettext-0.11.3) -+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# AM_MISSING_PROG(NAME, PROGRAM) --# ------------------------------ --AC_DEFUN([AM_MISSING_PROG], --[AC_REQUIRE([AM_MISSING_HAS_RUN]) --$1=${$1-"${am_missing_run}$2"} --AC_SUBST($1)]) -+dnl From Bruno Haible. - -+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], -+[ -+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ AC_REQUIRE([AC_LIB_RPATH]) - --# AM_MISSING_HAS_RUN --# ------------------ --# Define MISSING if not defined so far and test if it supports --run. --# If it does, set am_missing_run to use it, otherwise, to nothing. --AC_DEFUN([AM_MISSING_HAS_RUN], --[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl --test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" --# Use eval to expand $SHELL --if eval "$MISSING --run true"; then -- am_missing_run="$MISSING --run " --else -- am_missing_run= -- AC_MSG_WARN([`missing' script is too old or missing]) --fi -+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV -+ dnl accordingly. -+ AC_LIB_LINKFLAGS_BODY([iconv]) - ]) - --# AM_AUX_DIR_EXPAND -- --# Copyright 2001 Free Software Foundation, Inc. -- --# 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, 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. -+AC_DEFUN([AM_ICONV_LINK], -+[ -+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and -+ dnl those with the standalone portable GNU libiconv installed). - --# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets --# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to --# `$srcdir', `$srcdir/..', or `$srcdir/../..'. --# --# Of course, Automake must honor this variable whenever it calls a --# tool from the auxiliary directory. The problem is that $srcdir (and --# therefore $ac_aux_dir as well) can be either absolute or relative, --# depending on how configure is run. This is pretty annoying, since --# it makes $ac_aux_dir quite unusable in subdirectories: in the top --# source directory, any form will work fine, but in subdirectories a --# relative path needs to be adjusted first. --# --# $ac_aux_dir/missing --# fails when called from a subdirectory if $ac_aux_dir is relative --# $top_srcdir/$ac_aux_dir/missing --# fails if $ac_aux_dir is absolute, --# fails when called from a subdirectory in a VPATH build with --# a relative $ac_aux_dir --# --# The reason of the latter failure is that $top_srcdir and $ac_aux_dir --# are both prefixed by $srcdir. In an in-source build this is usually --# harmless because $srcdir is `.', but things will broke when you --# start a VPATH build or use an absolute $srcdir. --# --# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, --# iff we strip the leading $srcdir from $ac_aux_dir. That would be: --# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` --# and then we would define $MISSING as --# MISSING="\${SHELL} $am_aux_dir/missing" --# This will work as long as MISSING is not called from configure, because --# unfortunately $(top_srcdir) has no meaning in configure. --# However there are other variables, like CC, which are often used in --# configure, and could therefore not use this "fixed" $ac_aux_dir. --# --# Another solution, used here, is to always expand $ac_aux_dir to an --# absolute PATH. The drawback is that using absolute paths prevent a --# configured tree to be moved without reconfiguration. -+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV -+ dnl accordingly. -+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) - --# Rely on autoconf to set up CDPATH properly. --AC_PREREQ([2.50]) -+ dnl Add $INCICONV to CPPFLAGS before performing the following checks, -+ dnl because if the user has installed libiconv and not disabled its use -+ dnl via --without-libiconv-prefix, he wants to use it. The first -+ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. -+ am_save_CPPFLAGS="$CPPFLAGS" -+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - --AC_DEFUN([AM_AUX_DIR_EXPAND], [ --# expand $ac_aux_dir to an absolute path --am_aux_dir=`cd $ac_aux_dir && pwd` -+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ -+ am_cv_func_iconv="no, consider installing GNU libiconv" -+ am_cv_lib_iconv=no -+ AC_TRY_LINK([#include -+#include ], -+ [iconv_t cd = iconv_open("",""); -+ iconv(cd,NULL,NULL,NULL,NULL); -+ iconv_close(cd);], -+ am_cv_func_iconv=yes) -+ if test "$am_cv_func_iconv" != yes; then -+ am_save_LIBS="$LIBS" -+ LIBS="$LIBS $LIBICONV" -+ AC_TRY_LINK([#include -+#include ], -+ [iconv_t cd = iconv_open("",""); -+ iconv(cd,NULL,NULL,NULL,NULL); -+ iconv_close(cd);], -+ am_cv_lib_iconv=yes -+ am_cv_func_iconv=yes) -+ LIBS="$am_save_LIBS" -+ fi -+ ]) -+ if test "$am_cv_func_iconv" = yes; then -+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) -+ fi -+ if test "$am_cv_lib_iconv" = yes; then -+ AC_MSG_CHECKING([how to link with libiconv]) -+ AC_MSG_RESULT([$LIBICONV]) -+ else -+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV -+ dnl either. -+ CPPFLAGS="$am_save_CPPFLAGS" -+ LIBICONV= -+ LTLIBICONV= -+ fi -+ AC_SUBST(LIBICONV) -+ AC_SUBST(LTLIBICONV) - ]) - --# AM_PROG_INSTALL_SH --# ------------------ --# Define $install_sh. -+AC_DEFUN([AM_ICONV], -+[ -+ AM_ICONV_LINK -+ if test "$am_cv_func_iconv" = yes; then -+ AC_MSG_CHECKING([for iconv declaration]) -+ AC_CACHE_VAL(am_cv_proto_iconv, [ -+ AC_TRY_COMPILE([ -+#include -+#include -+extern -+#ifdef __cplusplus -+"C" -+#endif -+#if defined(__STDC__) || defined(__cplusplus) -+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -+#else -+size_t iconv(); -+#endif -+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") -+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) -+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` -+ AC_MSG_RESULT([$]{ac_t:- -+ }[$]am_cv_proto_iconv) -+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, -+ [Define as const if the declaration of iconv() needs const.]) -+ fi -+]) - --# Copyright 2001 Free Software Foundation, Inc. -+# intdiv0.m4 serial 1 (gettext-0.11.3) -+dnl Copyright (C) 2002 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# 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, or (at your option) --# any later version. -+dnl From Bruno Haible. - --# 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. -+AC_DEFUN([gt_INTDIV0], -+[ -+ AC_REQUIRE([AC_PROG_CC])dnl -+ AC_REQUIRE([AC_CANONICAL_HOST])dnl - --# 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. -+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], -+ gt_cv_int_divbyzero_sigfpe, -+ [ -+ AC_TRY_RUN([ -+#include -+#include - --AC_DEFUN([AM_PROG_INSTALL_SH], --[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl --install_sh=${install_sh-"$am_aux_dir/install-sh"} --AC_SUBST(install_sh)]) -+static void -+#ifdef __cplusplus -+sigfpe_handler (int sig) -+#else -+sigfpe_handler (sig) int sig; -+#endif -+{ -+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ -+ exit (sig != SIGFPE); -+} - --# AM_PROG_INSTALL_STRIP -- --# Copyright 2001 Free Software Foundation, Inc. -+int x = 1; -+int y = 0; -+int z; -+int nan; - --# 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, or (at your option) --# any later version. -+int main () -+{ -+ signal (SIGFPE, sigfpe_handler); -+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ -+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) -+ signal (SIGTRAP, sigfpe_handler); -+#endif -+/* Linux/SPARC yields signal SIGILL. */ -+#if defined (__sparc__) && defined (__linux__) -+ signal (SIGILL, sigfpe_handler); -+#endif - --# 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. -+ z = x / y; -+ nan = y / y; -+ exit (1); -+} -+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, -+ [ -+ # Guess based on the CPU. -+ case "$host_cpu" in -+ alpha* | i[34567]86 | m68k | s390*) -+ gt_cv_int_divbyzero_sigfpe="guessing yes";; -+ *) -+ gt_cv_int_divbyzero_sigfpe="guessing no";; -+ esac -+ ]) -+ ]) -+ case "$gt_cv_int_divbyzero_sigfpe" in -+ *yes) value=1;; -+ *) value=0;; -+ esac -+ AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, -+ [Define if integer division by zero raises signal SIGFPE.]) -+]) - --# 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. -+# intmax.m4 serial 2 (gettext-0.14.2) -+dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# One issue with vendor `install' (even GNU) is that you can't --# specify the program used to strip binaries. This is especially --# annoying in cross-compiling environments, where the build's strip --# is unlikely to handle the host's binaries. --# Fortunately install-sh will honor a STRIPPROG variable, so we --# always use install-sh in `make install-strip', and initialize --# STRIPPROG with the value of the STRIP variable (set by the user). --AC_DEFUN([AM_PROG_INSTALL_STRIP], --[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl --# Installed binaries are usually stripped using `strip' when the user --# run `make install-strip'. However `strip' might not be the right --# tool to use in cross-compilation environments, therefore Automake --# will honor the `STRIP' environment variable to overrule this program. --dnl Don't test for $cross_compiling = yes, because it might be `maybe'. --if test "$cross_compiling" != no; then -- AC_CHECK_TOOL([STRIP], [strip], :) --fi --INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" --AC_SUBST([INSTALL_STRIP_PROGRAM])]) -+dnl From Bruno Haible. -+dnl Test whether the system has the 'intmax_t' type, but don't attempt to -+dnl find a replacement if it is lacking. - --# serial 4 -*- Autoconf -*- -+AC_DEFUN([gt_TYPE_INTMAX_T], -+[ -+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) -+ AC_REQUIRE([gl_AC_HEADER_STDINT_H]) -+ AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, -+ [AC_TRY_COMPILE([ -+#include -+#include -+#if HAVE_STDINT_H_WITH_UINTMAX -+#include -+#endif -+#if HAVE_INTTYPES_H_WITH_UINTMAX -+#include -+#endif -+], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) -+ if test $gt_cv_c_intmax_t = yes; then -+ AC_DEFINE(HAVE_INTMAX_T, 1, -+ [Define if you have the 'intmax_t' type in or .]) -+ fi -+]) - --# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. -+# inttypes-pri.m4 serial 1 (gettext-0.11.4) -+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# 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, or (at your option) --# any later version. -+dnl From Bruno Haible. - --# 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. -+# Define PRI_MACROS_BROKEN if exists and defines the PRI* -+# macros to non-string values. This is the case on AIX 4.3.3. - --# 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. -+AC_DEFUN([gt_INTTYPES_PRI], -+[ -+ AC_REQUIRE([gt_HEADER_INTTYPES_H]) -+ if test $gt_cv_header_inttypes_h = yes; then -+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], -+ gt_cv_inttypes_pri_broken, -+ [ -+ AC_TRY_COMPILE([#include -+#ifdef PRId32 -+char *p = PRId32; -+#endif -+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) -+ ]) -+ fi -+ if test "$gt_cv_inttypes_pri_broken" = yes; then -+ AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, -+ [Define if exists and defines unusable PRI* macros.]) -+ fi -+]) - -+# inttypes.m4 serial 1 (gettext-0.11.4) -+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be --# written in clear, in which case automake, when reading aclocal.m4, --# will think it sees a *use*, and therefore will trigger all it's --# C support machinery. Also note that it means that autoscan, seeing --# CC etc. in the Makefile, will ask for an AC_PROG_CC use... -+dnl From Paul Eggert. - -+# Define HAVE_INTTYPES_H if exists and doesn't clash with -+# . - -+AC_DEFUN([gt_HEADER_INTTYPES_H], -+[ -+ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, -+ [ -+ AC_TRY_COMPILE( -+ [#include -+#include ], -+ [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) -+ ]) -+ if test $gt_cv_header_inttypes_h = yes; then -+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, -+ [Define if exists and doesn't clash with .]) -+ fi -+]) - --# _AM_DEPENDENCIES(NAME) --# ---------------------- --# See how the compiler implements dependency checking. --# NAME is "CC", "CXX", "GCJ", or "OBJC". --# We try a few techniques and use that to set a single cache variable. --# --# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was --# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular --# dependency, and given that the user is not expected to run this macro, --# just rely on AC_PROG_CC. --AC_DEFUN([_AM_DEPENDENCIES], --[AC_REQUIRE([AM_SET_DEPDIR])dnl --AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl --AC_REQUIRE([AM_MAKE_INCLUDE])dnl --AC_REQUIRE([AM_DEP_TRACK])dnl -+# inttypes_h.m4 serial 6 -+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --ifelse([$1], CC, [depcc="$CC" am_compiler_list=], -- [$1], CXX, [depcc="$CXX" am_compiler_list=], -- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], -- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], -- [depcc="$$1" am_compiler_list=]) -+dnl From Paul Eggert. - --AC_CACHE_CHECK([dependency style of $depcc], -- [am_cv_$1_dependencies_compiler_type], --[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then -- # We make a subdir and do the tests there. Otherwise we can end up -- # making bogus files that we don't know about and never remove. For -- # instance it was reported that on HP-UX the gcc test will end up -- # making a dummy file named `D' -- because `-MD' means `put the output -- # in D'. -- mkdir conftest.dir -- # Copy depcomp to subdir because otherwise we won't find it if we're -- # using a relative directory. -- cp "$am_depcomp" conftest.dir -- cd conftest.dir -+# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, -+# doesn't clash with , and declares uintmax_t. - -- am_cv_$1_dependencies_compiler_type=none -- if test "$am_compiler_list" = ""; then -- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` -+AC_DEFUN([gl_AC_HEADER_INTTYPES_H], -+[ -+ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, -+ [AC_TRY_COMPILE( -+ [#include -+#include ], -+ [uintmax_t i = (uintmax_t) -1;], -+ gl_cv_header_inttypes_h=yes, -+ gl_cv_header_inttypes_h=no)]) -+ if test $gl_cv_header_inttypes_h = yes; then -+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, -+ [Define if exists, doesn't clash with , -+ and declares uintmax_t. ]) - fi -- for depmode in $am_compiler_list; do -- # We need to recreate these files for each test, as the compiler may -- # overwrite some of them when testing with obscure command lines. -- # This happens at least with the AIX C compiler. -- echo '#include "conftest.h"' > conftest.c -- echo 'int i;' > conftest.h -- echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf -- -- case $depmode in -- nosideeffect) -- # after this tag, mechanisms are not by side-effect, so they'll -- # only be used when explicitly requested -- if test "x$enable_dependency_tracking" = xyes; then -- continue -- else -- break -- fi -- ;; -- none) break ;; -- esac -- # We check with `-c' and `-o' for the sake of the "dashmstdout" -- # mode. It turns out that the SunPro C++ compiler does not properly -- # handle `-M -o', and we need to detect this. -- if depmode=$depmode \ -- source=conftest.c object=conftest.o \ -- depfile=conftest.Po tmpdepfile=conftest.TPo \ -- $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && -- grep conftest.h conftest.Po > /dev/null 2>&1 && -- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -- am_cv_$1_dependencies_compiler_type=$depmode -- break -- fi -- done -- -- cd .. -- rm -rf conftest.dir --else -- am_cv_$1_dependencies_compiler_type=none --fi --]) --AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) - ]) - -+# lcmessage.m4 serial 4 (gettext-0.14.2) -+dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+dnl -+dnl This file can can be used in projects which are not available under -+dnl the GNU General Public License or the GNU Library General Public -+dnl License but which still want to provide support for the GNU gettext -+dnl functionality. -+dnl Please note that the actual code of the GNU gettext library is covered -+dnl by the GNU Library General Public License, and the rest of the GNU -+dnl gettext package package is covered by the GNU General Public License. -+dnl They are *not* in the public domain. - --# AM_SET_DEPDIR --# ------------- --# Choose a directory name for dependency files. --# This macro is AC_REQUIREd in _AM_DEPENDENCIES --AC_DEFUN([AM_SET_DEPDIR], --[rm -f .deps 2>/dev/null --mkdir .deps 2>/dev/null --if test -d .deps; then -- DEPDIR=.deps --else -- # MS-DOS does not allow filenames that begin with a dot. -- DEPDIR=_deps --fi --rmdir .deps 2>/dev/null --AC_SUBST([DEPDIR]) --]) -+dnl Authors: -+dnl Ulrich Drepper , 1995. - -+# Check whether LC_MESSAGES is available in . - --# AM_DEP_TRACK --# ------------ --AC_DEFUN([AM_DEP_TRACK], --[AC_ARG_ENABLE(dependency-tracking, --[ --disable-dependency-tracking Speeds up one-time builds -- --enable-dependency-tracking Do not reject slow dependency extractors]) --if test "x$enable_dependency_tracking" != xno; then -- am_depcomp="$ac_aux_dir/depcomp" -- AMDEPBACKSLASH='\' --fi --AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) --AC_SUBST([AMDEPBACKSLASH]) -+AC_DEFUN([gt_LC_MESSAGES], -+[ -+ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, -+ [AC_TRY_LINK([#include ], [return LC_MESSAGES], -+ gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) -+ if test $gt_cv_val_LC_MESSAGES = yes; then -+ AC_DEFINE(HAVE_LC_MESSAGES, 1, -+ [Define if your file defines LC_MESSAGES.]) -+ fi - ]) - --# Generate code to set up dependency tracking. -*- Autoconf -*- -- --# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -- --# 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, 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. -+# lib-ld.m4 serial 3 (gettext-0.13) -+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# 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. -+dnl Subroutines of libtool.m4, -+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -+dnl with libtool.m4. - --#serial 2 -+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -+AC_DEFUN([AC_LIB_PROG_LD_GNU], -+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -+[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -+case `$LD -v 2>&1 /dev/null 2>&1; then -- dirpart=`AS_DIRNAME("$mf")` -+dnl From libtool-1.4. Sets the variable LD. -+AC_DEFUN([AC_LIB_PROG_LD], -+[AC_ARG_WITH(gnu-ld, -+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -+AC_REQUIRE([AC_PROG_CC])dnl -+AC_REQUIRE([AC_CANONICAL_HOST])dnl -+# Prepare PATH_SEPARATOR. -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' - else -- continue -+ PATH_SEPARATOR=: - fi -- grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue -- # Extract the definition of DEP_FILES from the Makefile without -- # running `make'. -- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` -- test -z "$DEPDIR" && continue -- # When using ansi2knr, U may be empty or an underscore; expand it -- U=`sed -n -e '/^U = / s///p' < "$mf"` -- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" -- # We invoke sed twice because it is the simplest approach to -- # changing $(DEPDIR) to its actual value in the expansion. -- for file in `sed -n -e ' -- /^DEP_FILES = .*\\\\$/ { -- s/^DEP_FILES = // -- :loop -- s/\\\\$// -- p -- n -- /\\\\$/ b loop -- p -- } -- /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ -- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do -- # Make sure the directory exists. -- test -f "$dirpart/$file" && continue -- fdir=`AS_DIRNAME(["$file"])` -- AS_MKDIR_P([$dirpart/$fdir]) -- # echo "creating $dirpart/$file" -- echo '# dummy' > "$dirpart/$file" -- done --done --])# _AM_OUTPUT_DEPENDENCY_COMMANDS -- -- --# AM_OUTPUT_DEPENDENCY_COMMANDS --# ----------------------------- --# This macro should only be invoked once -- use via AC_REQUIRE. --# --# This code is only required when automatic dependency tracking --# is enabled. FIXME. This creates each `.P' file that we will --# need in order to bootstrap the dependency handling code. --AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], --[AC_CONFIG_COMMANDS([depfiles], -- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], -- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) --]) -- --# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- -- --# 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, 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. -- --# serial 2 -- --# AM_MAKE_INCLUDE() --# ----------------- --# Check to see how make treats includes. --AC_DEFUN([AM_MAKE_INCLUDE], --[am_make=${MAKE-make} --cat > confinc << 'END' --doit: -- @echo done --END --# If we don't find an include directive, just comment out the code. --AC_MSG_CHECKING([for style of include used by $am_make]) --am__include="#" --am__quote= --_am_result=none --# First try GNU make style include. --echo "include confinc" > confmf --# We grep out `Entering directory' and `Leaving directory' --# messages which can occur if `w' ends up in MAKEFLAGS. --# In particular we don't look at `^make:' because GNU make might --# be invoked under some other name (usually "gmake"), in which --# case it prints its new name instead of `make'. --if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then -- am__include=include -- am__quote= -- _am_result=GNU -+ rm -f conf$$.sh - fi --# Now try BSD make style include. --if test "$am__include" = "#"; then -- echo '.include "confinc"' > confmf -- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then -- am__include=.include -- am__quote="\"" -- _am_result=BSD -- fi -+ac_prog=ld -+if test "$GCC" = yes; then -+ # Check if gcc -print-prog-name=ld gives a path. -+ AC_MSG_CHECKING([for ld used by GCC]) -+ case $host in -+ *-*-mingw*) -+ # gcc leaves a trailing carriage return which upsets mingw -+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; -+ *) -+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; -+ esac -+ case $ac_prog in -+ # Accept absolute paths. -+ [[\\/]* | [A-Za-z]:[\\/]*)] -+ [re_direlt='/[^/][^/]*/\.\./'] -+ # Canonicalize the path of ld -+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` -+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` -+ done -+ test -z "$LD" && LD="$ac_prog" -+ ;; -+ "") -+ # If it fails, then pretend we aren't using GCC. -+ ac_prog=ld -+ ;; -+ *) -+ # If it is relative, then search for the first ld in PATH. -+ with_gnu_ld=unknown -+ ;; -+ esac -+elif test "$with_gnu_ld" = yes; then -+ AC_MSG_CHECKING([for GNU ld]) -+else -+ AC_MSG_CHECKING([for non-GNU ld]) - fi --AC_SUBST(am__include) --AC_SUBST(am__quote) --AC_MSG_RESULT($_am_result) --rm -f confinc confmf -+AC_CACHE_VAL(acl_cv_path_LD, -+[if test -z "$LD"; then -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" -+ for ac_dir in $PATH; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then -+ acl_cv_path_LD="$ac_dir/$ac_prog" -+ # Check to see if the program is GNU ld. I'd rather use --version, -+ # but apparently some GNU ld's only accept -v. -+ # Break only if it was the GNU/non-GNU ld that we prefer. -+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in -+ *GNU* | *'with BFD'*) -+ test "$with_gnu_ld" != no && break ;; -+ *) -+ test "$with_gnu_ld" != yes && break ;; -+ esac -+ fi -+ done -+ IFS="$ac_save_ifs" -+else -+ acl_cv_path_LD="$LD" # Let the user override the test with a path. -+fi]) -+LD="$acl_cv_path_LD" -+if test -n "$LD"; then -+ AC_MSG_RESULT($LD) -+else -+ AC_MSG_RESULT(no) -+fi -+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -+AC_LIB_PROG_LD_GNU - ]) - --# AM_CONDITIONAL -*- Autoconf -*- -- --# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. -- --# 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, or (at your option) --# any later version. -+# lib-link.m4 serial 6 (gettext-0.14.3) -+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --# 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. -+dnl From Bruno Haible. - --# 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. -+AC_PREREQ(2.50) - --# serial 5 -+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -+dnl the libraries corresponding to explicit and implicit dependencies. -+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -+dnl augments the CPPFLAGS variable. -+AC_DEFUN([AC_LIB_LINKFLAGS], -+[ -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ AC_REQUIRE([AC_LIB_RPATH]) -+ define([Name],[translit([$1],[./-], [___])]) -+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ -+ AC_LIB_LINKFLAGS_BODY([$1], [$2]) -+ ac_cv_lib[]Name[]_libs="$LIB[]NAME" -+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" -+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME" -+ ]) -+ LIB[]NAME="$ac_cv_lib[]Name[]_libs" -+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" -+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags" -+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) -+ AC_SUBST([LIB]NAME) -+ AC_SUBST([LTLIB]NAME) -+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the -+ dnl results of this search when this library appears as a dependency. -+ HAVE_LIB[]NAME=yes -+ undefine([Name]) -+ undefine([NAME]) -+]) - --AC_PREREQ(2.52) -+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -+dnl searches for libname and the libraries corresponding to explicit and -+dnl implicit dependencies, together with the specified include files and -+dnl the ability to compile and link the specified testcode. If found, it -+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -+[ -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ AC_REQUIRE([AC_LIB_RPATH]) -+ define([Name],[translit([$1],[./-], [___])]) -+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - --# AM_CONDITIONAL(NAME, SHELL-CONDITION) --# ------------------------------------- --# Define a conditional. --AC_DEFUN([AM_CONDITIONAL], --[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], -- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl --AC_SUBST([$1_TRUE]) --AC_SUBST([$1_FALSE]) --if $2; then -- $1_TRUE= -- $1_FALSE='#' --else -- $1_TRUE='#' -- $1_FALSE= --fi --AC_CONFIG_COMMANDS_PRE( --[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then -- AC_MSG_ERROR([conditional \"$1\" was never defined. --Usually this means the macro was only invoked conditionally.]) --fi])]) -+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME -+ dnl accordingly. -+ AC_LIB_LINKFLAGS_BODY([$1], [$2]) - --# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, -+ dnl because if the user has installed lib[]Name and not disabled its use -+ dnl via --without-lib[]Name-prefix, he wants to use it. -+ ac_save_CPPFLAGS="$CPPFLAGS" -+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - --# serial 46 AC_PROG_LIBTOOL -+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ -+ ac_save_LIBS="$LIBS" -+ LIBS="$LIBS $LIB[]NAME" -+ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) -+ LIBS="$ac_save_LIBS" -+ ]) -+ if test "$ac_cv_lib[]Name" = yes; then -+ HAVE_LIB[]NAME=yes -+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) -+ AC_MSG_CHECKING([how to link with lib[]$1]) -+ AC_MSG_RESULT([$LIB[]NAME]) -+ else -+ HAVE_LIB[]NAME=no -+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need -+ dnl $INC[]NAME either. -+ CPPFLAGS="$ac_save_CPPFLAGS" -+ LIB[]NAME= -+ LTLIB[]NAME= -+ fi -+ AC_SUBST([HAVE_LIB]NAME) -+ AC_SUBST([LIB]NAME) -+ AC_SUBST([LTLIB]NAME) -+ undefine([Name]) -+ undefine([NAME]) -+]) - --AC_DEFUN([AC_PROG_LIBTOOL], --[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -- --# This can be used to rebuild libtool when needed --LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" -- --# Always use our own libtool. --LIBTOOL='$(SHELL) $(top_builddir)/libtool' --AC_SUBST(LIBTOOL)dnl -- --# Prevent multiple expansion --define([AC_PROG_LIBTOOL], []) --]) -- --AC_DEFUN([AC_LIBTOOL_SETUP], --[AC_PREREQ(2.13)dnl --AC_REQUIRE([AC_ENABLE_SHARED])dnl --AC_REQUIRE([AC_ENABLE_STATIC])dnl --AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl --AC_REQUIRE([AC_CANONICAL_HOST])dnl --AC_REQUIRE([AC_CANONICAL_BUILD])dnl --AC_REQUIRE([AC_PROG_CC])dnl --AC_REQUIRE([AC_PROG_LD])dnl --AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl --AC_REQUIRE([AC_PROG_NM])dnl --AC_REQUIRE([AC_PROG_LN_S])dnl --AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl --AC_REQUIRE([AC_OBJEXT])dnl --AC_REQUIRE([AC_EXEEXT])dnl --dnl -- --_LT_AC_PROG_ECHO_BACKSLASH --# Only perform the check for file, if the check method requires it --case $deplibs_check_method in --file_magic*) -- if test "$file_magic_cmd" = '$MAGIC_CMD'; then -- AC_PATH_MAGIC -- fi -- ;; --esac -- --AC_CHECK_TOOL(RANLIB, ranlib, :) --AC_CHECK_TOOL(STRIP, strip, :) -- --ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) --ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], --enable_win32_dll=yes, enable_win32_dll=no) -- --AC_ARG_ENABLE(libtool-lock, -- [ --disable-libtool-lock avoid locking (might break parallel builds)]) --test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -- --# Some flags need to be propagated to the compiler or linker for good --# libtool support. --case $host in --*-*-irix6*) -- # Find out which ABI we are using. -- echo '[#]line __oline__ "configure"' > conftest.$ac_ext -- if AC_TRY_EVAL(ac_compile); then -- case `/usr/bin/file conftest.$ac_objext` in -- *32-bit*) -- LD="${LD-ld} -32" -- ;; -- *N32*) -- LD="${LD-ld} -n32" -- ;; -- *64-bit*) -- LD="${LD-ld} -64" -- ;; -- esac -- fi -- rm -rf conftest* -- ;; -- --*-*-sco3.2v5*) -- # On SCO OpenServer 5, we need -belf to get full-featured binaries. -- SAVE_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS -belf" -- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, -- [AC_LANG_SAVE -- AC_LANG_C -- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) -- AC_LANG_RESTORE]) -- if test x"$lt_cv_cc_needs_belf" != x"yes"; then -- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf -- CFLAGS="$SAVE_CFLAGS" -- fi -- ;; -- --ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], --[*-*-cygwin* | *-*-mingw* | *-*-pw32*) -- AC_CHECK_TOOL(DLLTOOL, dlltool, false) -- AC_CHECK_TOOL(AS, as, false) -- AC_CHECK_TOOL(OBJDUMP, objdump, false) -- -- # recent cygwin and mingw systems supply a stub DllMain which the user -- # can override, but on older systems we have to supply one -- AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, -- [AC_TRY_LINK([], -- [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); -- DllMain (0, 0, 0);], -- [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) -- -- case $host/$CC in -- *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) -- # old mingw systems require "-dll" to link a DLL, while more recent ones -- # require "-mdll" -- SAVE_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS -mdll" -- AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, -- [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) -- CFLAGS="$SAVE_CFLAGS" ;; -- *-*-cygwin* | *-*-pw32*) -- # cygwin systems need to pass --dll to the linker, and not link -- # crt.o which will require a WinMain@16 definition. -- lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; -- esac -- ;; -+dnl Determine the platform dependent parameters needed to use rpath: -+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -+dnl hardcode_direct, hardcode_minus_L. -+AC_DEFUN([AC_LIB_RPATH], -+[ -+ dnl Tell automake >= 1.10 to complain if config.rpath is missing. -+ m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) -+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS -+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld -+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host -+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir -+ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ -+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ -+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh -+ . ./conftest.sh -+ rm -f ./conftest.sh -+ acl_cv_rpath=done - ]) --esac -- --_LT_AC_LTCONFIG_HACK -- -+ wl="$acl_cv_wl" -+ libext="$acl_cv_libext" -+ shlibext="$acl_cv_shlibext" -+ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" -+ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" -+ hardcode_direct="$acl_cv_hardcode_direct" -+ hardcode_minus_L="$acl_cv_hardcode_minus_L" -+ dnl Determine whether the user wants rpath handling at all. -+ AC_ARG_ENABLE(rpath, -+ [ --disable-rpath do not hardcode runtime library paths], -+ :, enable_rpath=yes) - ]) - --# AC_LIBTOOL_HEADER_ASSERT --# ------------------------ --AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], --[AC_CACHE_CHECK([whether $CC supports assert without backlinking], -- [lt_cv_func_assert_works], -- [case $host in -- *-*-solaris*) -- if test "$GCC" = yes && test "$with_gnu_ld" != yes; then -- case `$CC --version 2>/dev/null` in -- [[12]].*) lt_cv_func_assert_works=no ;; -- *) lt_cv_func_assert_works=yes ;; -- esac -- fi -- ;; -- esac]) -- --if test "x$lt_cv_func_assert_works" = xyes; then -- AC_CHECK_HEADERS(assert.h) --fi --])# AC_LIBTOOL_HEADER_ASSERT -- --# _LT_AC_CHECK_DLFCN --# -------------------- --AC_DEFUN([_LT_AC_CHECK_DLFCN], --[AC_CHECK_HEADERS(dlfcn.h) --])# _LT_AC_CHECK_DLFCN -- --# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE --# --------------------------------- --AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], --[AC_REQUIRE([AC_CANONICAL_HOST]) --AC_REQUIRE([AC_PROG_NM]) --AC_REQUIRE([AC_OBJEXT]) --# Check for command to grab the raw symbol name followed by C symbol from nm. --AC_MSG_CHECKING([command to parse $NM output]) --AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl -- --# These are sane defaults that work on at least a few old systems. --# [They come from Ultrix. What could be older than Ultrix?!! ;)] -- --# Character class describing NM global symbol codes. --symcode='[[BCDEGRST]]' -- --# Regexp to match symbols that can be accessed directly from C. --sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' -- --# Transform the above into a raw symbol and a C symbol. --symxfrm='\1 \2\3 \3' -- --# Transform an extracted symbol line into a proper C declaration --lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" -- --# Transform an extracted symbol line into symbol name and symbol address --lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -- --# Define system-specific variables. --case $host_os in --aix*) -- symcode='[[BCDT]]' -- ;; --cygwin* | mingw* | pw32*) -- symcode='[[ABCDGISTW]]' -- ;; --hpux*) # Its linker distinguishes data from code symbols -- lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -- lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -- ;; --irix*) -- symcode='[[BCDEGRST]]' -- ;; --solaris* | sysv5*) -- symcode='[[BDT]]' -- ;; --sysv4) -- symcode='[[DFNSTU]]' -- ;; --esac -- --# Handle CRLF in mingw tool chain --opt_cr= --case $host_os in --mingw*) -- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp -- ;; --esac -- --# If we're using GNU nm, then use its standard symbol codes. --if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then -- symcode='[[ABCDGISTW]]' --fi -- --# Try without a prefix undercore, then with it. --for ac_symprfx in "" "_"; do -- -- # Write the raw and C identifiers. --lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" -- -- # Check to see that the pipe works correctly. -- pipe_works=no -- rm -f conftest* -- cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then -- # Try sorting and uniquifying the output. -- if sort "$nlist" | uniq > "$nlist"T; then -- mv -f "$nlist"T "$nlist" -+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -+dnl the libraries corresponding to explicit and implicit dependencies. -+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -+AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -+[ -+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -+ dnl By default, look in $includedir and $libdir. -+ use_additional=yes -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) -+ AC_LIB_ARG_WITH([lib$1-prefix], -+[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib -+ --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -+[ -+ if test "X$withval" = "Xno"; then -+ use_additional=no -+ else -+ if test "X$withval" = "X"; then -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) - else -- rm -f "$nlist"T -- fi -- -- # Make sure that we snagged all the symbols we need. -- if egrep ' nm_test_var$' "$nlist" >/dev/null; then -- if egrep ' nm_test_func$' "$nlist" >/dev/null; then -- cat < conftest.$ac_ext --#ifdef __cplusplus --extern "C" { --#endif -- --EOF -- # Now generate the symbol file. -- eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' -- -- cat <> conftest.$ac_ext --#if defined (__STDC__) && __STDC__ --# define lt_ptr void * --#else --# define lt_ptr char * --# define const --#endif -- --/* The mapping between symbol names and symbols. */ --const struct { -- const char *name; -- lt_ptr address; --} --lt_preloaded_symbols[[]] = --{ --EOF -- sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext -- cat <<\EOF >> conftest.$ac_ext -- {0, (lt_ptr) 0} --}; -- --#ifdef __cplusplus --} --#endif --EOF -- # Now try linking the two files. -- mv conftest.$ac_objext conftstm.$ac_objext -- save_LIBS="$LIBS" -- save_CFLAGS="$CFLAGS" -- LIBS="conftstm.$ac_objext" -- CFLAGS="$CFLAGS$no_builtin_flag" -- if AC_TRY_EVAL(ac_link) && test -s conftest; then -- pipe_works=yes -- fi -- LIBS="$save_LIBS" -- CFLAGS="$save_CFLAGS" -- else -- echo "cannot find nm_test_func in $nlist" >&AC_FD_CC -- fi -- else -- echo "cannot find nm_test_var in $nlist" >&AC_FD_CC -- fi -- else -- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC -- fi -- else -- echo "$progname: failed program was:" >&AC_FD_CC -- cat conftest.$ac_ext >&5 -- fi -- rm -f conftest* conftst* -- -- # Do not use the global_symbol_pipe unless it works. -- if test "$pipe_works" = yes; then -- break -- else -- lt_cv_sys_global_symbol_pipe= -- fi --done --]) --global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" --if test -z "$lt_cv_sys_global_symbol_pipe"; then -- global_symbol_to_cdecl= -- global_symbol_to_c_name_address= --else -- global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" -- global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" --fi --if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; --then -- AC_MSG_RESULT(failed) --else -- AC_MSG_RESULT(ok) --fi --]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -- --# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR --# --------------------------------- --AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], --[# Find the correct PATH separator. Usually this is `:', but --# DJGPP uses `;' like DOS. --if test "X${PATH_SEPARATOR+set}" != Xset; then -- UNAME=${UNAME-`uname 2>/dev/null`} -- case X$UNAME in -- *-DOS) lt_cv_sys_path_separator=';' ;; -- *) lt_cv_sys_path_separator=':' ;; -- esac -- PATH_SEPARATOR=$lt_cv_sys_path_separator --fi --])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -- --# _LT_AC_PROG_ECHO_BACKSLASH --# -------------------------- --# Add some code to the start of the generated configure script which --# will find an echo command which doesn't interpret backslashes. --AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], --[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], -- [AC_DIVERT_PUSH(NOTICE)]) --_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -- --# Check that we are running under the correct shell. --SHELL=${CONFIG_SHELL-/bin/sh} -- --case X$ECHO in --X*--fallback-echo) -- # Remove one level of quotation (which was required for Make). -- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` -- ;; --esac -- --echo=${ECHO-echo} --if test "X[$]1" = X--no-reexec; then -- # Discard the --no-reexec flag, and continue. -- shift --elif test "X[$]1" = X--fallback-echo; then -- # Avoid inline document here, it may be left over -- : --elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then -- # Yippee, $echo works! -- : --else -- # Restart under the correct shell. -- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} --fi -- --if test "X[$]1" = X--fallback-echo; then -- # used as fallback echo -- shift -- cat </dev/null && -- echo_test_string="`eval $cmd`" && -- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null -- then -- break -- fi -- done --fi -- --if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- : --else -- # The Solaris, AIX, and Digital Unix default echo programs unquote -- # backslashes. This makes it impossible to quote backslashes using -- # echo "$something" | sed 's/\\/\\\\/g' -- # -- # So, first we look for a working echo in the user's PATH. -- -- IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR -- for dir in $PATH /usr/ucb; do -- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && -- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- echo="$dir/echo" -- break -- fi -- done -- IFS="$save_ifs" -- -- if test "X$echo" = Xecho; then -- # We didn't find a better echo, so look for alternatives. -- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- # This shell has a builtin print -r that does the trick. -- echo='print -r' -- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && -- test "X$CONFIG_SHELL" != X/bin/ksh; then -- # If we have ksh, try running configure again with it. -- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -- export ORIGINAL_CONFIG_SHELL -- CONFIG_SHELL=/bin/ksh -- export CONFIG_SHELL -- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} -- else -- # Try using printf. -- echo='printf %s\n' -- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- # Cool, printf works -- : -- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && -- test "X$echo_testing_string" = 'X\t' && -- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL -- export CONFIG_SHELL -- SHELL="$CONFIG_SHELL" -- export SHELL -- echo="$CONFIG_SHELL [$]0 --fallback-echo" -- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && -- test "X$echo_testing_string" = 'X\t' && -- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- echo="$CONFIG_SHELL [$]0 --fallback-echo" -- else -- # maybe with a smaller string... -- prev=: -- -- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do -- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null -- then -- break -- fi -- prev="$cmd" -- done -- -- if test "$prev" != 'sed 50q "[$]0"'; then -- echo_test_string=`eval $prev` -- export echo_test_string -- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} -- else -- # Oops. We lost completely, so just stick with echo. -- echo=echo -- fi -- fi -- fi -- fi --fi --fi -- --# Copy echo and quote the copy suitably for passing to libtool from --# the Makefile, instead of quoting the original, which is used later. --ECHO=$echo --if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then -- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" --fi -- --AC_SUBST(ECHO) --AC_DIVERT_POP --])# _LT_AC_PROG_ECHO_BACKSLASH -- --# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, --# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) --# ------------------------------------------------------------------ --AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], --[if test "$cross_compiling" = yes; then : -- [$4] --else -- AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -- lt_status=$lt_dlunknown -- cat > conftest.$ac_ext < --#endif -- --#include -- --#ifdef RTLD_GLOBAL --# define LT_DLGLOBAL RTLD_GLOBAL --#else --# ifdef DL_GLOBAL --# define LT_DLGLOBAL DL_GLOBAL --# else --# define LT_DLGLOBAL 0 --# endif --#endif -- --/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -- find out it does not work in some platform. */ --#ifndef LT_DLLAZY_OR_NOW --# ifdef RTLD_LAZY --# define LT_DLLAZY_OR_NOW RTLD_LAZY --# else --# ifdef DL_LAZY --# define LT_DLLAZY_OR_NOW DL_LAZY --# else --# ifdef RTLD_NOW --# define LT_DLLAZY_OR_NOW RTLD_NOW --# else --# ifdef DL_NOW --# define LT_DLLAZY_OR_NOW DL_NOW --# else --# define LT_DLLAZY_OR_NOW 0 --# endif --# endif --# endif --# endif --#endif -- --#ifdef __cplusplus --extern "C" void exit (int); --#endif -- --void fnord() { int i=42;} --int main () --{ -- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -- int status = $lt_dlunknown; -- -- if (self) -- { -- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -- /* dlclose (self); */ -- } -- -- exit (status); --}] --EOF -- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then -- (./conftest; exit; ) 2>/dev/null -- lt_status=$? -- case x$lt_status in -- x$lt_dlno_uscore) $1 ;; -- x$lt_dlneed_uscore) $2 ;; -- x$lt_unknown|x*) $3 ;; -- esac -- else : -- # compilation failed -- $3 -- fi --fi --rm -fr conftest* --])# _LT_AC_TRY_DLOPEN_SELF -- --# AC_LIBTOOL_DLOPEN_SELF --# ------------------- --AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], --[if test "x$enable_dlopen" != xyes; then -- enable_dlopen=unknown -- enable_dlopen_self=unknown -- enable_dlopen_self_static=unknown --else -- lt_cv_dlopen=no -- lt_cv_dlopen_libs= -- -- case $host_os in -- beos*) -- lt_cv_dlopen="load_add_on" -- lt_cv_dlopen_libs= -- lt_cv_dlopen_self=yes -- ;; -- -- cygwin* | mingw* | pw32*) -- lt_cv_dlopen="LoadLibrary" -- lt_cv_dlopen_libs= -- ;; -- -- *) -- AC_CHECK_FUNC([shl_load], -- [lt_cv_dlopen="shl_load"], -- [AC_CHECK_LIB([dld], [shl_load], -- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], -- [AC_CHECK_FUNC([dlopen], -- [lt_cv_dlopen="dlopen"], -- [AC_CHECK_LIB([dl], [dlopen], -- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], -- [AC_CHECK_LIB([svld], [dlopen], -- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], -- [AC_CHECK_LIB([dld], [dld_link], -- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) -- ]) -- ]) -- ]) -- ]) -- ]) -- ;; -- esac -- -- if test "x$lt_cv_dlopen" != xno; then -- enable_dlopen=yes -- else -- enable_dlopen=no -- fi -- -- case $lt_cv_dlopen in -- dlopen) -- save_CPPFLAGS="$CPPFLAGS" -- AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -- -- save_LDFLAGS="$LDFLAGS" -- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -- -- save_LIBS="$LIBS" -- LIBS="$lt_cv_dlopen_libs $LIBS" -- -- AC_CACHE_CHECK([whether a program can dlopen itself], -- lt_cv_dlopen_self, [dnl -- _LT_AC_TRY_DLOPEN_SELF( -- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, -- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) -- ]) -- -- if test "x$lt_cv_dlopen_self" = xyes; then -- LDFLAGS="$LDFLAGS $link_static_flag" -- AC_CACHE_CHECK([whether a statically linked program can dlopen itself], -- lt_cv_dlopen_self_static, [dnl -- _LT_AC_TRY_DLOPEN_SELF( -- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, -- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) -- ]) -- fi -- -- CPPFLAGS="$save_CPPFLAGS" -- LDFLAGS="$save_LDFLAGS" -- LIBS="$save_LIBS" -- ;; -- esac -- -- case $lt_cv_dlopen_self in -- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; -- *) enable_dlopen_self=unknown ;; -- esac -- -- case $lt_cv_dlopen_self_static in -- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; -- *) enable_dlopen_self_static=unknown ;; -- esac --fi --])# AC_LIBTOOL_DLOPEN_SELF -- --AC_DEFUN([_LT_AC_LTCONFIG_HACK], --[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl --# Sed substitution that helps us do robust quoting. It backslashifies --# metacharacters that are still active within double-quoted strings. --Xsed='sed -e s/^X//' --sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' -- --# Same as above, but do not quote variable references. --double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' -- --# Sed substitution to delay expansion of an escaped shell variable in a --# double_quote_subst'ed string. --delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -- --# Constants: --rm="rm -f" -- --# Global variables: --default_ofile=libtool --can_build_shared=yes -- --# All known linkers require a `.a' archive for static linking (except M$VC, --# which needs '.lib'). --libext=a --ltmain="$ac_aux_dir/ltmain.sh" --ofile="$default_ofile" --with_gnu_ld="$lt_cv_prog_gnu_ld" --need_locks="$enable_libtool_lock" -- --old_CC="$CC" --old_CFLAGS="$CFLAGS" -- --# Set sane defaults for various variables --test -z "$AR" && AR=ar --test -z "$AR_FLAGS" && AR_FLAGS=cru --test -z "$AS" && AS=as --test -z "$CC" && CC=cc --test -z "$DLLTOOL" && DLLTOOL=dlltool --test -z "$LD" && LD=ld --test -z "$LN_S" && LN_S="ln -s" --test -z "$MAGIC_CMD" && MAGIC_CMD=file --test -z "$NM" && NM=nm --test -z "$OBJDUMP" && OBJDUMP=objdump --test -z "$RANLIB" && RANLIB=: --test -z "$STRIP" && STRIP=: --test -z "$ac_objext" && ac_objext=o -- --if test x"$host" != x"$build"; then -- ac_tool_prefix=${host_alias}- --else -- ac_tool_prefix= --fi -- --# Transform linux* to *-*-linux-gnu*, to support old configure scripts. --case $host_os in --linux-gnu*) ;; --linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` --esac -- --case $host_os in --aix3*) -- # AIX sometimes has problems with the GCC collect2 program. For some -- # reason, if we set the COLLECT_NAMES environment variable, the problems -- # vanish in a puff of smoke. -- if test "X${COLLECT_NAMES+set}" != Xset; then -- COLLECT_NAMES= -- export COLLECT_NAMES -- fi -- ;; --esac -- --# Determine commands to create old-style static archives. --old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' --old_postinstall_cmds='chmod 644 $oldlib' --old_postuninstall_cmds= -- --if test -n "$RANLIB"; then -- case $host_os in -- openbsd*) -- old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" -- ;; -- *) -- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -- ;; -- esac -- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" --fi -- --# Allow CC to be a program name with arguments. --set dummy $CC --compiler="[$]2" -- --AC_MSG_CHECKING([for objdir]) --rm -f .libs 2>/dev/null --mkdir .libs 2>/dev/null --if test -d .libs; then -- objdir=.libs --else -- # MS-DOS does not allow filenames that begin with a dot. -- objdir=_libs --fi --rmdir .libs 2>/dev/null --AC_MSG_RESULT($objdir) -- -- --AC_ARG_WITH(pic, --[ --with-pic try to use only PIC/non-PIC objects [default=use both]], --pic_mode="$withval", pic_mode=default) --test -z "$pic_mode" && pic_mode=default -- --# We assume here that the value for lt_cv_prog_cc_pic will not be cached --# in isolation, and that seeing it set (from the cache) indicates that --# the associated values are set (in the cache) correctly too. --AC_MSG_CHECKING([for $compiler option to produce PIC]) --AC_CACHE_VAL(lt_cv_prog_cc_pic, --[ lt_cv_prog_cc_pic= -- lt_cv_prog_cc_shlib= -- lt_cv_prog_cc_wl= -- lt_cv_prog_cc_static= -- lt_cv_prog_cc_no_builtin= -- lt_cv_prog_cc_can_build_shared=$can_build_shared -- -- if test "$GCC" = yes; then -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static='-static' -- -- case $host_os in -- aix*) -- # Below there is a dirty hack to force normal static linking with -ldl -- # The problem is because libdl dynamically linked with both libc and -- # libC (AIX C++ library), which obviously doesn't included in libraries -- # list by gcc. This cause undefined symbols with -static flags. -- # This hack allows C programs to be linked with "-static -ldl", but -- # not sure about C++ programs. -- lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" -- ;; -- amigaos*) -- # FIXME: we need at least 68020 code to build shared libraries, but -- # adding the `-m68020' flag to GCC prevents building anything better, -- # like `-m68040'. -- lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' -- ;; -- beos* | irix5* | irix6* | osf3* | osf4* | osf5*) -- # PIC is the default for these OSes. -- ;; -- darwin* | rhapsody*) -- # PIC is the default on this platform -- # Common symbols not allowed in MH_DYLIB files -- lt_cv_prog_cc_pic='-fno-common' -- ;; -- cygwin* | mingw* | pw32* | os2*) -- # This hack is so that the source file can tell whether it is being -- # built for inclusion in a dll (and should export symbols for example). -- lt_cv_prog_cc_pic='-DDLL_EXPORT' -- ;; -- sysv4*MP*) -- if test -d /usr/nec; then -- lt_cv_prog_cc_pic=-Kconform_pic -- fi -- ;; -- *) -- lt_cv_prog_cc_pic='-fPIC' -- ;; -- esac -- else -- # PORTME Check for PIC flags for the system compiler. -- case $host_os in -- aix3* | aix4* | aix5*) -- lt_cv_prog_cc_wl='-Wl,' -- # All AIX code is PIC. -- if test "$host_cpu" = ia64; then -- # AIX 5 now supports IA64 processor -- lt_cv_prog_cc_static='-Bstatic' -- else -- lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' -- fi -- ;; -- -- hpux9* | hpux10* | hpux11*) -- # Is there a better lt_cv_prog_cc_static that works with the bundled CC? -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" -- lt_cv_prog_cc_pic='+Z' -- ;; -- -- irix5* | irix6*) -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static='-non_shared' -- # PIC (with -KPIC) is the default. -- ;; -- -- cygwin* | mingw* | pw32* | os2*) -- # This hack is so that the source file can tell whether it is being -- # built for inclusion in a dll (and should export symbols for example). -- lt_cv_prog_cc_pic='-DDLL_EXPORT' -- ;; -- -- newsos6) -- lt_cv_prog_cc_pic='-KPIC' -- lt_cv_prog_cc_static='-Bstatic' -- ;; -- -- osf3* | osf4* | osf5*) -- # All OSF/1 code is PIC. -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static='-non_shared' -- ;; -- -- sco3.2v5*) -- lt_cv_prog_cc_pic='-Kpic' -- lt_cv_prog_cc_static='-dn' -- lt_cv_prog_cc_shlib='-belf' -- ;; -- -- solaris*) -- lt_cv_prog_cc_pic='-KPIC' -- lt_cv_prog_cc_static='-Bstatic' -- lt_cv_prog_cc_wl='-Wl,' -- ;; -- -- sunos4*) -- lt_cv_prog_cc_pic='-PIC' -- lt_cv_prog_cc_static='-Bstatic' -- lt_cv_prog_cc_wl='-Qoption ld ' -- ;; -- -- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -- lt_cv_prog_cc_pic='-KPIC' -- lt_cv_prog_cc_static='-Bstatic' -- if test "x$host_vendor" = xsni; then -- lt_cv_prog_cc_wl='-LD' -- else -- lt_cv_prog_cc_wl='-Wl,' -- fi -- ;; -- -- uts4*) -- lt_cv_prog_cc_pic='-pic' -- lt_cv_prog_cc_static='-Bstatic' -- ;; -- -- sysv4*MP*) -- if test -d /usr/nec ;then -- lt_cv_prog_cc_pic='-Kconform_pic' -- lt_cv_prog_cc_static='-Bstatic' -- fi -- ;; -- -- *) -- lt_cv_prog_cc_can_build_shared=no -- ;; -- esac -- fi --]) --if test -z "$lt_cv_prog_cc_pic"; then -- AC_MSG_RESULT([none]) --else -- AC_MSG_RESULT([$lt_cv_prog_cc_pic]) -- -- # Check to make sure the pic_flag actually works. -- AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) -- AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl -- save_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" -- AC_TRY_COMPILE([], [], [dnl -- case $host_os in -- hpux9* | hpux10* | hpux11*) -- # On HP-UX, both CC and GCC only warn that PIC is supported... then -- # they create non-PIC objects. So, if there were any warnings, we -- # assume that PIC is not supported. -- if test -s conftest.err; then -- lt_cv_prog_cc_pic_works=no -- else -- lt_cv_prog_cc_pic_works=yes -- fi -- ;; -- *) -- lt_cv_prog_cc_pic_works=yes -- ;; -- esac -- ], [dnl -- lt_cv_prog_cc_pic_works=no -- ]) -- CFLAGS="$save_CFLAGS" -- ]) -- -- if test "X$lt_cv_prog_cc_pic_works" = Xno; then -- lt_cv_prog_cc_pic= -- lt_cv_prog_cc_can_build_shared=no -- else -- lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" -- fi -- -- AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) --fi -- --# Check for any special shared library compilation flags. --if test -n "$lt_cv_prog_cc_shlib"; then -- AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) -- if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : -- else -- AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) -- lt_cv_prog_cc_can_build_shared=no -- fi --fi -- --AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) --AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl -- lt_cv_prog_cc_static_works=no -- save_LDFLAGS="$LDFLAGS" -- LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" -- AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) -- LDFLAGS="$save_LDFLAGS" --]) -- --# Belt *and* braces to stop my trousers falling down: --test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= --AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) -- --pic_flag="$lt_cv_prog_cc_pic" --special_shlib_compile_flags="$lt_cv_prog_cc_shlib" --wl="$lt_cv_prog_cc_wl" --link_static_flag="$lt_cv_prog_cc_static" --no_builtin_flag="$lt_cv_prog_cc_no_builtin" --can_build_shared="$lt_cv_prog_cc_can_build_shared" -- -- --# Check to see if options -o and -c are simultaneously supported by compiler --AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) --AC_CACHE_VAL([lt_cv_compiler_c_o], [ --$rm -r conftest 2>/dev/null --mkdir conftest --cd conftest --echo "int some_variable = 0;" > conftest.$ac_ext --mkdir out --# According to Tom Tromey, Ian Lance Taylor reported there are C compilers --# that will create temporary files in the current directory regardless of --# the output directory. Thus, making CWD read-only will cause this test --# to fail, enabling locking or at least warning the user not to do parallel --# builds. --chmod -w . --save_CFLAGS="$CFLAGS" --CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" --compiler_c_o=no --if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then -- # The compiler can only warn and ignore the option if not recognized -- # So say no if there are warnings -- if test -s out/conftest.err; then -- lt_cv_compiler_c_o=no -- else -- lt_cv_compiler_c_o=yes -- fi --else -- # Append any errors to the config.log. -- cat out/conftest.err 1>&AC_FD_CC -- lt_cv_compiler_c_o=no --fi --CFLAGS="$save_CFLAGS" --chmod u+w . --$rm conftest* out/* --rmdir out --cd .. --rmdir conftest --$rm -r conftest 2>/dev/null --]) --compiler_c_o=$lt_cv_compiler_c_o --AC_MSG_RESULT([$compiler_c_o]) -- --if test x"$compiler_c_o" = x"yes"; then -- # Check to see if we can write to a .lo -- AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) -- AC_CACHE_VAL([lt_cv_compiler_o_lo], [ -- lt_cv_compiler_o_lo=no -- save_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS -c -o conftest.lo" -- save_objext="$ac_objext" -- ac_objext=lo -- AC_TRY_COMPILE([], [int some_variable = 0;], [dnl -- # The compiler can only warn and ignore the option if not recognized -- # So say no if there are warnings -- if test -s conftest.err; then -- lt_cv_compiler_o_lo=no -- else -- lt_cv_compiler_o_lo=yes -- fi -- ]) -- ac_objext="$save_objext" -- CFLAGS="$save_CFLAGS" -- ]) -- compiler_o_lo=$lt_cv_compiler_o_lo -- AC_MSG_RESULT([$compiler_o_lo]) --else -- compiler_o_lo=no --fi -- --# Check to see if we can do hard links to lock some files if needed --hard_links="nottested" --if test "$compiler_c_o" = no && test "$need_locks" != no; then -- # do not overwrite the value of need_locks provided by the user -- AC_MSG_CHECKING([if we can lock with hard links]) -- hard_links=yes -- $rm conftest* -- ln conftest.a conftest.b 2>/dev/null && hard_links=no -- touch conftest.a -- ln conftest.a conftest.b 2>&5 || hard_links=no -- ln conftest.a conftest.b 2>/dev/null && hard_links=no -- AC_MSG_RESULT([$hard_links]) -- if test "$hard_links" = no; then -- AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) -- need_locks=warn -- fi --else -- need_locks=no --fi -- --if test "$GCC" = yes; then -- # Check to see if options -fno-rtti -fno-exceptions are supported by compiler -- AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) -- echo "int some_variable = 0;" > conftest.$ac_ext -- save_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" -- compiler_rtti_exceptions=no -- AC_TRY_COMPILE([], [int some_variable = 0;], [dnl -- # The compiler can only warn and ignore the option if not recognized -- # So say no if there are warnings -- if test -s conftest.err; then -- compiler_rtti_exceptions=no -- else -- compiler_rtti_exceptions=yes -- fi -- ]) -- CFLAGS="$save_CFLAGS" -- AC_MSG_RESULT([$compiler_rtti_exceptions]) -- -- if test "$compiler_rtti_exceptions" = "yes"; then -- no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' -- else -- no_builtin_flag=' -fno-builtin' -- fi --fi -- --# See if the linker supports building shared libraries. --AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) -- --allow_undefined_flag= --no_undefined_flag= --need_lib_prefix=unknown --need_version=unknown --# when you set need_version to no, make sure it does not cause -set_version --# flags to be left without arguments --archive_cmds= --archive_expsym_cmds= --old_archive_from_new_cmds= --old_archive_from_expsyms_cmds= --export_dynamic_flag_spec= --whole_archive_flag_spec= --thread_safe_flag_spec= --hardcode_into_libs=no --hardcode_libdir_flag_spec= --hardcode_libdir_separator= --hardcode_direct=no --hardcode_minus_L=no --hardcode_shlibpath_var=unsupported --runpath_var= --link_all_deplibs=unknown --always_export_symbols=no --export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' --# include_expsyms should be a list of space-separated symbols to be *always* --# included in the symbol list --include_expsyms= --# exclude_expsyms can be an egrep regular expression of symbols to exclude --# it will be wrapped by ` (' and `)$', so one must not match beginning or --# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', --# as well as any symbol that contains `d'. --exclude_expsyms="_GLOBAL_OFFSET_TABLE_" --# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out --# platforms (ab)use it in PIC code, but their linkers get confused if --# the symbol is explicitly referenced. Since portable code cannot --# rely on this symbol name, it's probably fine to never include it in --# preloaded symbol tables. --extract_expsyms_cmds= -- --case $host_os in --cygwin* | mingw* | pw32*) -- # FIXME: the MSVC++ port hasn't been tested in a loooong time -- # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++. -- if test "$GCC" != yes; then -- with_gnu_ld=no -- fi -- ;; --openbsd*) -- with_gnu_ld=no -- ;; --esac -- --ld_shlibs=yes --if test "$with_gnu_ld" = yes; then -- # If archive_cmds runs LD, not CC, wlarc should be empty -- wlarc='${wl}' -- -- # See if GNU ld supports shared libraries. -- case $host_os in -- aix3* | aix4* | aix5*) -- # On AIX, the GNU linker is very broken -- # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. -- ld_shlibs=no -- cat <&2 -- --*** Warning: the GNU linker, at least up to release 2.9.1, is reported --*** to be unable to reliably create shared libraries on AIX. --*** Therefore, libtool is disabling shared libraries support. If you --*** really care for shared libraries, you may want to modify your PATH --*** so that a non-GNU linker is found, and then restart. -- --EOF -- ;; -- -- amigaos*) -- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_minus_L=yes -- -- # Samuel A. Falvo II reports -- # that the semantics of dynamic libraries on AmigaOS, at least up -- # to version 4, is to share data among multiple programs linked -- # with the same dynamic library. Since this doesn't match the -- # behavior of shared libraries on other platforms, we can use -- # them. -- ld_shlibs=no -- ;; -- -- beos*) -- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -- allow_undefined_flag=unsupported -- # Joseph Beckenbach says some releases of gcc -- # support --undefined. This deserves some investigation. FIXME -- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- else -- ld_shlibs=no -- fi -- ;; -- -- cygwin* | mingw* | pw32*) -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec='-L$libdir' -- allow_undefined_flag=unsupported -- always_export_symbols=yes -- -- extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ -- sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ -- test -f $output_objdir/impgen.exe || (cd $output_objdir && \ -- if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ -- else $CC -o impgen impgen.c ; fi)~ -- $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' -- -- old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' -- -- # cygwin and mingw dlls have different entry points and sets of symbols -- # to exclude. -- # FIXME: what about values for MSVC? -- dll_entry=__cygwin_dll_entry@12 -- dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ -- case $host_os in -- mingw*) -- # mingw values -- dll_entry=_DllMainCRTStartup@12 -- dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ -- ;; -- esac -- -- # mingw and cygwin differ, and it's simplest to just exclude the union -- # of the two symbol sets. -- dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 -- -- # recent cygwin and mingw systems supply a stub DllMain which the user -- # can override, but on older systems we have to supply one (in ltdll.c) -- if test "x$lt_cv_need_dllmain" = "xyes"; then -- ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " -- ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ -- test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' -- else -- ltdll_obj= -- ltdll_cmds= -- fi -- -- # Extract the symbol export list from an `--export-all' def file, -- # then regenerate the def file from the symbol export list, so that -- # the compiled dll only exports the symbol export list. -- # Be careful not to strip the DATA tag left be newer dlltools. -- export_symbols_cmds="$ltdll_cmds"' -- $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ -- sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' -- -- # If the export-symbols file already is a .def file (1st line -- # is EXPORTS), use it as is. -- # If DATA tags from a recent dlltool are present, honour them! -- archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then -- cp $export_symbols $output_objdir/$soname-def; -- else -- echo EXPORTS > $output_objdir/$soname-def; -- _lt_hint=1; -- cat $export_symbols | while read symbol; do -- set dummy \$symbol; -- case \[$]# in -- 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; -- *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; -- esac; -- _lt_hint=`expr 1 + \$_lt_hint`; -- done; -- fi~ -- '"$ltdll_cmds"' -- $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ -- $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ -- $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' -- ;; -- -- netbsd*) -- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' -- wlarc= -- else -- archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -- fi -- ;; -- -- solaris* | sysv5*) -- if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then -- ld_shlibs=no -- cat <&2 -- --*** Warning: The releases 2.8.* of the GNU linker cannot reliably --*** create shared libraries on Solaris systems. Therefore, libtool --*** is disabling shared libraries support. We urge you to upgrade GNU --*** binutils to release 2.9.1 or newer. Another option is to modify --*** your PATH or compiler configuration so that the native linker is --*** used, and then restart. -- --EOF -- elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -- else -- ld_shlibs=no -- fi -- ;; -- -- sunos4*) -- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' -- wlarc= -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -- -- *) -- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -- else -- ld_shlibs=no -- fi -- ;; -- esac -- -- if test "$ld_shlibs" = yes; then -- runpath_var=LD_RUN_PATH -- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' -- export_dynamic_flag_spec='${wl}--export-dynamic' -- case $host_os in -- cygwin* | mingw* | pw32*) -- # dlltool doesn't understand --whole-archive et. al. -- whole_archive_flag_spec= -- ;; -- *) -- # ancient GNU ld didn't support --whole-archive et. al. -- if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then -- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -- else -- whole_archive_flag_spec= -- fi -- ;; -- esac -- fi --else -- # PORTME fill in a description of your system's linker (not GNU ld) -- case $host_os in -- aix3*) -- allow_undefined_flag=unsupported -- always_export_symbols=yes -- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' -- # Note: this linker hardcodes the directories in LIBPATH if there -- # are no directories specified by -L. -- hardcode_minus_L=yes -- if test "$GCC" = yes && test -z "$link_static_flag"; then -- # Neither direct hardcoding nor static linking is supported with a -- # broken collect2. -- hardcode_direct=unsupported -- fi -- ;; -- -- aix4* | aix5*) -- if test "$host_cpu" = ia64; then -- # On IA64, the linker does run time linking by default, so we don't -- # have to do anything special. -- aix_use_runtimelinking=no -- exp_sym_flag='-Bexport' -- no_entry_flag="" -- else -- aix_use_runtimelinking=no -- -- # Test if we are trying to use run time linking or normal -- # AIX style linking. If -brtl is somewhere in LDFLAGS, we -- # need to do runtime linking. -- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) -- for ld_flag in $LDFLAGS; do -- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then -- aix_use_runtimelinking=yes -- break -- fi -- done -- esac -- -- exp_sym_flag='-bexport' -- no_entry_flag='-bnoentry' -- fi -- -- # When large executables or shared objects are built, AIX ld can -- # have problems creating the table of contents. If linking a library -- # or program results in "error TOC overflow" add -mminimal-toc to -- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -- -- hardcode_direct=yes -- archive_cmds='' -- hardcode_libdir_separator=':' -- if test "$GCC" = yes; then -- case $host_os in aix4.[[012]]|aix4.[[012]].*) -- collect2name=`${CC} -print-prog-name=collect2` -- if test -f "$collect2name" && \ -- strings "$collect2name" | grep resolve_lib_name >/dev/null -- then -- # We have reworked collect2 -- hardcode_direct=yes -- else -- # We have old collect2 -- hardcode_direct=unsupported -- # It fails to find uninstalled libraries when the uninstalled -- # path is not listed in the libpath. Setting hardcode_minus_L -- # to unsupported forces relinking -- hardcode_minus_L=yes -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_libdir_separator= -- fi -- esac -- -- shared_flag='-shared' -- else -- # not using gcc -- if test "$host_cpu" = ia64; then -- shared_flag='${wl}-G' -- else -- if test "$aix_use_runtimelinking" = yes; then -- shared_flag='${wl}-G' -- else -- shared_flag='${wl}-bM:SRE' -- fi -- fi -- fi -- -- # It seems that -bexpall can do strange things, so it is better to -- # generate a list of symbols to export. -- always_export_symbols=yes -- if test "$aix_use_runtimelinking" = yes; then -- # Warning - without using the other runtime loading flags (-brtl), -- # -berok will link without error, but may produce a broken library. -- allow_undefined_flag='-berok' -- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' -- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -- else -- if test "$host_cpu" = ia64; then -- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' -- allow_undefined_flag="-z nodefs" -- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -- else -- hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' -- # Warning - without using the other run time loading flags, -- # -berok will link without error, but may produce a broken library. -- allow_undefined_flag='${wl}-berok' -- # This is a bit strange, but is similar to how AIX traditionally builds -- # it's shared libraries. -- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' -- fi -- fi -- ;; -- -- amigaos*) -- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_minus_L=yes -- # see comment about different semantics on the GNU ld section -- ld_shlibs=no -- ;; -- -- cygwin* | mingw* | pw32*) -- # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++. -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec=' ' -- allow_undefined_flag=unsupported -- # Tell ltmain to make .lib files, not .a files. -- libext=lib -- # FIXME: Setting linknames here is a bad hack. -- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' -- # The linker will automatically build a .lib file if we build a DLL. -- old_archive_from_new_cmds='true' -- # FIXME: Should let the user specify the lib program. -- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' -- fix_srcfile_path='`cygpath -w "$srcfile"`' -- ;; -- -- darwin* | rhapsody*) -- case "$host_os" in -- rhapsody* | darwin1.[[012]]) -- allow_undefined_flag='-undefined suppress' -- ;; -- *) # Darwin 1.3 on -- allow_undefined_flag='-flat_namespace -undefined suppress' -- ;; -- esac -- # FIXME: Relying on posixy $() will cause problems for -- # cross-compilation, but unfortunately the echo tests do not -- # yet detect zsh echo's removal of \ escapes. -- archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' -- # We need to add '_' to the symbols in $export_symbols first -- #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- whole_archive_flag_spec='-all_load $convenience' -- ;; -- -- freebsd1*) -- ld_shlibs=no -- ;; -- -- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor -- # support. Future versions do this automatically, but an explicit c++rt0.o -- # does not break anything, and helps significantly (at the cost of a little -- # extra space). -- freebsd2.2*) -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -- -- # Unfortunately, older versions of FreeBSD 2 do not have this feature. -- freebsd2*) -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes -- hardcode_minus_L=yes -- hardcode_shlibpath_var=no -- ;; -- -- # FreeBSD 3 and greater uses gcc -shared to do shared libraries. -- freebsd*) -- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -- -- hpux9* | hpux10* | hpux11*) -- case $host_os in -- hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; -- *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; -- esac -- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' -- hardcode_libdir_separator=: -- hardcode_direct=yes -- hardcode_minus_L=yes # Not in the search PATH, but as the default -- # location of the library. -- export_dynamic_flag_spec='${wl}-E' -- ;; -- -- irix5* | irix6*) -- if test "$GCC" = yes; then -- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -- else -- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -- fi -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- hardcode_libdir_separator=: -- link_all_deplibs=yes -- ;; -- -- netbsd*) -- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out -- else -- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF -- fi -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -- -- newsos6) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- hardcode_libdir_separator=: -- hardcode_shlibpath_var=no -- ;; -- -- openbsd*) -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' -- export_dynamic_flag_spec='${wl}-E' -- else -- case "$host_os" in -- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-R$libdir' -- ;; -- *) -- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' -- ;; -- esac -- fi -- ;; -- -- os2*) -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_minus_L=yes -- allow_undefined_flag=unsupported -- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' -- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' -- ;; -- -- osf3*) -- if test "$GCC" = yes; then -- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -- else -- allow_undefined_flag=' -expect_unresolved \*' -- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -- fi -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- hardcode_libdir_separator=: -- ;; -- -- osf4* | osf5*) # as osf3* with the addition of -msym flag -- if test "$GCC" = yes; then -- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- else -- allow_undefined_flag=' -expect_unresolved \*' -- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ -- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' -- -- #Both c and cxx compiler support -rpath directly -- hardcode_libdir_flag_spec='-rpath $libdir' -- fi -- hardcode_libdir_separator=: -- ;; -- -- sco3.2v5*) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_shlibpath_var=no -- runpath_var=LD_RUN_PATH -- hardcode_runpath_var=yes -- export_dynamic_flag_spec='${wl}-Bexport' -- ;; -- -- solaris*) -- # gcc --version < 3.0 without binutils cannot create self contained -- # shared libraries reliably, requiring libgcc.a to resolve some of -- # the object symbols generated in some cases. Libraries that use -- # assert need libgcc.a to resolve __eprintf, for example. Linking -- # a copy of libgcc.a into every shared library to guarantee resolving -- # such symbols causes other problems: According to Tim Van Holder -- # , C++ libraries end up with a separate -- # (to the application) exception stack for one thing. -- no_undefined_flag=' -z defs' -- if test "$GCC" = yes; then -- case `$CC --version 2>/dev/null` in -- [[12]].*) -- cat <&2 -- --*** Warning: Releases of GCC earlier than version 3.0 cannot reliably --*** create self contained shared libraries on Solaris systems, without --*** introducing a dependency on libgcc.a. Therefore, libtool is disabling --*** -no-undefined support, which will at least allow you to build shared --*** libraries. However, you may find that when you link such libraries --*** into an application without using GCC, you have to manually add --*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to --*** upgrade to a newer version of GCC. Another option is to rebuild your --*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. -- --EOF -- no_undefined_flag= -- ;; -- esac -- fi -- # $CC -shared without GNU ld will not create a library from C++ -- # object files and a static libstdc++, better avoid it by now -- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_shlibpath_var=no -- case $host_os in -- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; -- *) # Supported since Solaris 2.6 (maybe 2.5.1?) -- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; -- esac -- link_all_deplibs=yes -- ;; -- -- sunos4*) -- if test "x$host_vendor" = xsequent; then -- # Use $CC to link under sequent, because it throws in some extra .o -- # files that make .init and .fini sections work. -- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' -- else -- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' -- fi -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_direct=yes -- hardcode_minus_L=yes -- hardcode_shlibpath_var=no -- ;; -- -- sysv4) -- if test "x$host_vendor" = xsno; then -- archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes # is this really true??? -- else -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=no #Motorola manual says yes, but my tests say they lie -- fi -- runpath_var='LD_RUN_PATH' -- hardcode_shlibpath_var=no -- ;; -- -- sysv4.3*) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_shlibpath_var=no -- export_dynamic_flag_spec='-Bexport' -- ;; -- -- sysv5*) -- no_undefined_flag=' -z text' -- # $CC -shared without GNU ld will not create a library from C++ -- # object files and a static libstdc++, better avoid it by now -- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -- hardcode_libdir_flag_spec= -- hardcode_shlibpath_var=no -- runpath_var='LD_RUN_PATH' -- ;; -- -- uts4*) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_shlibpath_var=no -- ;; -- -- dgux*) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_shlibpath_var=no -- ;; -- -- sysv4*MP*) -- if test -d /usr/nec; then -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_shlibpath_var=no -- runpath_var=LD_RUN_PATH -- hardcode_runpath_var=yes -- ld_shlibs=yes -- fi -- ;; -- -- sysv4.2uw2*) -- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes -- hardcode_minus_L=no -- hardcode_shlibpath_var=no -- hardcode_runpath_var=yes -- runpath_var=LD_RUN_PATH -- ;; -- -- sysv5uw7* | unixware7*) -- no_undefined_flag='${wl}-z ${wl}text' -- if test "$GCC" = yes; then -- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -- else -- archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -- fi -- runpath_var='LD_RUN_PATH' -- hardcode_shlibpath_var=no -- ;; -- -- *) -- ld_shlibs=no -- ;; -- esac --fi --AC_MSG_RESULT([$ld_shlibs]) --test "$ld_shlibs" = no && can_build_shared=no -- --# Check hardcoding attributes. --AC_MSG_CHECKING([how to hardcode library paths into programs]) --hardcode_action= --if test -n "$hardcode_libdir_flag_spec" || \ -- test -n "$runpath_var"; then -- -- # We can hardcode non-existant directories. -- if test "$hardcode_direct" != no && -- # If the only mechanism to avoid hardcoding is shlibpath_var, we -- # have to relink, otherwise we might link with an installed library -- # when we should be linking with a yet-to-be-installed one -- ## test "$hardcode_shlibpath_var" != no && -- test "$hardcode_minus_L" != no; then -- # Linking always hardcodes the temporary library directory. -- hardcode_action=relink -- else -- # We can link without hardcoding, and we can hardcode nonexisting dirs. -- hardcode_action=immediate -- fi --else -- # We cannot hardcode anything, or else we can only hardcode existing -- # directories. -- hardcode_action=unsupported --fi --AC_MSG_RESULT([$hardcode_action]) -- --striplib= --old_striplib= --AC_MSG_CHECKING([whether stripping libraries is possible]) --if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then -- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -- test -z "$striplib" && striplib="$STRIP --strip-unneeded" -- AC_MSG_RESULT([yes]) --else -- AC_MSG_RESULT([no]) --fi -- --reload_cmds='$LD$reload_flag -o $output$reload_objs' --test -z "$deplibs_check_method" && deplibs_check_method=unknown -- --# PORTME Fill in your ld.so characteristics --AC_MSG_CHECKING([dynamic linker characteristics]) --library_names_spec= --libname_spec='lib$name' --soname_spec= --postinstall_cmds= --postuninstall_cmds= --finish_cmds= --finish_eval= --shlibpath_var= --shlibpath_overrides_runpath=unknown --version_type=none --dynamic_linker="$host_os ld.so" --sys_lib_dlsearch_path_spec="/lib /usr/lib" --sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -- --case $host_os in --aix3*) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix $libname.a' -- shlibpath_var=LIBPATH -- -- # AIX has no versioning support, so we append a major version to the name. -- soname_spec='${libname}${release}.so$major' -- ;; -- --aix4* | aix5*) -- version_type=linux -- if test "$host_cpu" = ia64; then -- # AIX 5 supports IA64 -- library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- else -- # With GCC up to 2.95.x, collect2 would create an import file -- # for dependence libraries. The import file would start with -- # the line `#! .'. This would cause the generated library to -- # depend on `.', always an invalid library. This was fixed in -- # development snapshots of GCC prior to 3.0. -- case $host_os in -- aix4 | aix4.[[01]] | aix4.[[01]].*) -- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' -- echo ' yes ' -- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then -- : -- else -- can_build_shared=no -- fi -- ;; -- esac -- # AIX (on Power*) has no versioning support, so currently we can -- # not hardcode correct soname into executable. Probably we can -- # add versioning support to collect2, so additional links can -- # be useful in future. -- if test "$aix_use_runtimelinking" = yes; then -- # If using run time linking (on AIX 4.2 or later) use lib.so -- # instead of lib.a to let people know that these are not -- # typical AIX shared libraries. -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- else -- # We preserve .a as extension for shared libraries through AIX4.2 -- # and later when we are not doing run time linking. -- library_names_spec='${libname}${release}.a $libname.a' -- soname_spec='${libname}${release}.so$major' -- fi -- shlibpath_var=LIBPATH -- fi -- ;; -- --amigaos*) -- library_names_spec='$libname.ixlibrary $libname.a' -- # Create ${libname}_ixlibrary.a entries in /sys/libs. -- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' -- ;; -- --beos*) -- library_names_spec='${libname}.so' -- dynamic_linker="$host_os ld.so" -- shlibpath_var=LIBRARY_PATH -- ;; -- --bsdi4*) -- version_type=linux -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -- export_dynamic_flag_spec=-rdynamic -- # the default ld.so.conf also contains /usr/contrib/lib and -- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -- # libtool to hard-code these into programs -- ;; -- --cygwin* | mingw* | pw32*) -- version_type=windows -- need_version=no -- need_lib_prefix=no -- case $GCC,$host_os in -- yes,cygwin*) -- library_names_spec='$libname.dll.a' -- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' -- postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ -- dldir=$destdir/`dirname \$dlpath`~ -- test -d \$dldir || mkdir -p \$dldir~ -- $install_prog .libs/$dlname \$dldir/$dlname' -- postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ -- dlpath=$dir/\$dldll~ -- $rm \$dlpath' -- ;; -- yes,mingw*) -- library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' -- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` -- ;; -- yes,pw32*) -- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' -- ;; -- *) -- library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' -- ;; -- esac -- dynamic_linker='Win32 ld.exe' -- # FIXME: first we should search . and the directory the executable is in -- shlibpath_var=PATH -- ;; -- --darwin* | rhapsody*) -- dynamic_linker="$host_os dyld" -- version_type=darwin -- need_lib_prefix=no -- need_version=no -- # FIXME: Relying on posixy $() will cause problems for -- # cross-compilation, but unfortunately the echo tests do not -- # yet detect zsh echo's removal of \ escapes. -- library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' -- soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' -- shlibpath_overrides_runpath=yes -- shlibpath_var=DYLD_LIBRARY_PATH -- ;; -- --freebsd1*) -- dynamic_linker=no -- ;; -- --freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -- version_type=freebsd-$objformat -- case $version_type in -- freebsd-elf*) -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' -- need_version=no -- need_lib_prefix=no -- ;; -- freebsd-*) -- library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' -- need_version=yes -- ;; -- esac -- shlibpath_var=LD_LIBRARY_PATH -- case $host_os in -- freebsd2*) -- shlibpath_overrides_runpath=yes -- ;; -- *) -- shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -- ;; -- esac -- ;; -- --gnu*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- hardcode_into_libs=yes -- ;; -- --hpux9* | hpux10* | hpux11*) -- # Give a soname corresponding to the major version so that dld.sl refuses to -- # link against other versions. -- dynamic_linker="$host_os dld.sl" -- version_type=sunos -- need_lib_prefix=no -- need_version=no -- shlibpath_var=SHLIB_PATH -- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH -- library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' -- soname_spec='${libname}${release}.sl$major' -- # HP-UX runs *really* slowly unless shared libraries are mode 555. -- postinstall_cmds='chmod 555 $lib' -- ;; -- --irix5* | irix6*) -- version_type=irix -- need_lib_prefix=no -- need_version=no -- soname_spec='${libname}${release}.so$major' -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' -- case $host_os in -- irix5*) -- libsuff= shlibsuff= -- ;; -- *) -- case $LD in # libtool.m4 will add one of these switches to LD -- *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; -- *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; -- *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; -- *) libsuff= shlibsuff= libmagic=never-match;; -- esac -- ;; -- esac -- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -- shlibpath_overrides_runpath=no -- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -- ;; -- --# No shared lib support for Linux oldld, aout, or coff. --linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) -- dynamic_linker=no -- ;; -- --# This must be Linux ELF. --linux-gnu*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=no -- # This implies no fast_install, which is unacceptable. -- # Some rework will be needed to allow for fast_install -- # before this can be enabled. -- hardcode_into_libs=yes -- -- # We used to test for /lib/ld.so.1 and disable shared libraries on -- # powerpc, because MkLinux only supported shared libraries with the -- # GNU dynamic linker. Since this was broken with cross compilers, -- # most powerpc-linux boxes support dynamic linking these days and -- # people can always --disable-shared, the test was removed, and we -- # assume the GNU/Linux dynamic linker is in use. -- dynamic_linker='GNU/Linux ld.so' -- ;; -- --netbsd*) -- version_type=sunos -- need_lib_prefix=no -- need_version=no -- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -- dynamic_linker='NetBSD (a.out) ld.so' -- else -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' -- soname_spec='${libname}${release}.so$major' -- dynamic_linker='NetBSD ld.elf_so' -- fi -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -- ;; -- --newsos6) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- ;; -- --openbsd*) -- version_type=sunos -- need_lib_prefix=no -- need_version=no -- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -- case "$host_os" in -- openbsd2.[[89]] | openbsd2.[[89]].*) -- shlibpath_overrides_runpath=no -- ;; -- *) -- shlibpath_overrides_runpath=yes -- ;; -- esac -- else -- shlibpath_overrides_runpath=yes -- fi -- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- ;; -- --os2*) -- libname_spec='$name' -- need_lib_prefix=no -- library_names_spec='$libname.dll $libname.a' -- dynamic_linker='OS/2 ld.exe' -- shlibpath_var=LIBPATH -- ;; -- --osf3* | osf4* | osf5*) -- version_type=osf -- need_version=no -- soname_spec='${libname}${release}.so' -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -- ;; -- --sco3.2v5*) -- version_type=osf -- soname_spec='${libname}${release}.so$major' -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- ;; -- --solaris*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -- # ldd complains unless libraries are executable -- postinstall_cmds='chmod +x $lib' -- ;; -- --sunos4*) -- version_type=sunos -- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' -- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- if test "$with_gnu_ld" = yes; then -- need_lib_prefix=no -- fi -- need_version=yes -- ;; -- --sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- case $host_vendor in -- sni) -- shlibpath_overrides_runpath=no -- ;; -- motorola) -- need_lib_prefix=no -- need_version=no -- shlibpath_overrides_runpath=no -- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -- ;; -- esac -- ;; -- --uts4*) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- ;; -- --dgux*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- ;; -- --sysv4*MP*) -- if test -d /usr/nec ;then -- version_type=linux -- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' -- soname_spec='$libname.so.$major' -- shlibpath_var=LD_LIBRARY_PATH -- fi -- ;; -- --*) -- dynamic_linker=no -- ;; --esac --AC_MSG_RESULT([$dynamic_linker]) --test "$dynamic_linker" = no && can_build_shared=no -- --# Report the final consequences. --AC_MSG_CHECKING([if libtool supports shared libraries]) --AC_MSG_RESULT([$can_build_shared]) -- --AC_MSG_CHECKING([whether to build shared libraries]) --test "$can_build_shared" = "no" && enable_shared=no -- --# On AIX, shared libraries and static libraries use the same namespace, and --# are all built from PIC. --case "$host_os" in --aix3*) -- test "$enable_shared" = yes && enable_static=no -- if test -n "$RANLIB"; then -- archive_cmds="$archive_cmds~\$RANLIB \$lib" -- postinstall_cmds='$RANLIB $lib' -- fi -- ;; -- --aix4*) -- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then -- test "$enable_shared" = yes && enable_static=no -- fi -- ;; --esac --AC_MSG_RESULT([$enable_shared]) -- --AC_MSG_CHECKING([whether to build static libraries]) --# Make sure either enable_shared or enable_static is yes. --test "$enable_shared" = yes || enable_static=yes --AC_MSG_RESULT([$enable_static]) -- --if test "$hardcode_action" = relink; then -- # Fast installation is not supported -- enable_fast_install=no --elif test "$shlibpath_overrides_runpath" = yes || -- test "$enable_shared" = no; then -- # Fast installation is not necessary -- enable_fast_install=needless --fi -- --variables_saved_for_relink="PATH $shlibpath_var $runpath_var" --if test "$GCC" = yes; then -- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" --fi -- --AC_LIBTOOL_DLOPEN_SELF -- --if test "$enable_shared" = yes && test "$GCC" = yes; then -- case $archive_cmds in -- *'~'*) -- # FIXME: we may have to deal with multi-command sequences. -- ;; -- '$CC '*) -- # Test whether the compiler implicitly links with -lc since on some -- # systems, -lgcc has to come before -lc. If gcc already passes -lc -- # to ld, don't add -lc before -lgcc. -- AC_MSG_CHECKING([whether -lc should be explicitly linked in]) -- AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], -- [$rm conftest* -- echo 'static int dummy;' > conftest.$ac_ext -- -- if AC_TRY_EVAL(ac_compile); then -- soname=conftest -- lib=conftest -- libobjs=conftest.$ac_objext -- deplibs= -- wl=$lt_cv_prog_cc_wl -- compiler_flags=-v -- linker_flags=-v -- verstring= -- output_objdir=. -- libname=conftest -- save_allow_undefined_flag=$allow_undefined_flag -- allow_undefined_flag= -- if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) -- then -- lt_cv_archive_cmds_need_lc=no -- else -- lt_cv_archive_cmds_need_lc=yes -- fi -- allow_undefined_flag=$save_allow_undefined_flag -- else -- cat conftest.err 1>&5 -- fi]) -- AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) -- ;; -- esac --fi --need_lc=${lt_cv_archive_cmds_need_lc-yes} -- --# The second clause should only fire when bootstrapping the --# libtool distribution, otherwise you forgot to ship ltmain.sh --# with your package, and you will get complaints that there are --# no rules to generate ltmain.sh. --if test -f "$ltmain"; then -- : --else -- # If there is no Makefile yet, we rely on a make rule to execute -- # `config.status --recheck' to rerun these tests and create the -- # libtool script then. -- test -f Makefile && make "$ltmain" --fi -- --if test -f "$ltmain"; then -- trap "$rm \"${ofile}T\"; exit 1" 1 2 15 -- $rm -f "${ofile}T" -- -- echo creating $ofile -- -- # Now quote all the things that may contain metacharacters while being -- # careful not to overquote the AC_SUBSTed values. We take copies of the -- # variables and quote the copies for generation of the libtool script. -- for var in echo old_CC old_CFLAGS \ -- AR AR_FLAGS CC LD LN_S NM SHELL \ -- reload_flag reload_cmds wl \ -- pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ -- thread_safe_flag_spec whole_archive_flag_spec libname_spec \ -- library_names_spec soname_spec \ -- RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ -- old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ -- postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ -- old_striplib striplib file_magic_cmd export_symbols_cmds \ -- deplibs_check_method allow_undefined_flag no_undefined_flag \ -- finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ -- global_symbol_to_c_name_address \ -- hardcode_libdir_flag_spec hardcode_libdir_separator \ -- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -- compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do -- -- case $var in -- reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ -- old_postinstall_cmds | old_postuninstall_cmds | \ -- export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ -- extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ -- postinstall_cmds | postuninstall_cmds | \ -- finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) -- # Double-quote double-evaled strings. -- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" -- ;; -- *) -- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -- ;; -- esac -- done -- -- cat <<__EOF__ > "${ofile}T" --#! $SHELL -- --# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. --# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) --# NOTE: Changes made to this file will be lost: look at ltmain.sh. --# --# Copyright (C) 1996-2000 Free Software Foundation, Inc. --# Originally by Gordon Matzigkeit , 1996 --# --# 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. --# --# As a special exception to the GNU General Public License, if you --# distribute this file as part of a program that contains a --# configuration script generated by Autoconf, you may include it under --# the same distribution terms that you use for the rest of that program. -- --# Sed that helps us avoid accidentally triggering echo(1) options like -n. --Xsed="sed -e s/^X//" -- --# The HP-UX ksh and POSIX shell print the target directory to stdout --# if CDPATH is set. --if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi -- --# ### BEGIN LIBTOOL CONFIG -- --# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -- --# Shell to use when invoking shell scripts. --SHELL=$lt_SHELL -- --# Whether or not to build shared libraries. --build_libtool_libs=$enable_shared -- --# Whether or not to build static libraries. --build_old_libs=$enable_static -- --# Whether or not to add -lc for building shared libraries. --build_libtool_need_lc=$need_lc -- --# Whether or not to optimize for fast installation. --fast_install=$enable_fast_install -- --# The host system. --host_alias=$host_alias --host=$host -- --# An echo program that does not interpret backslashes. --echo=$lt_echo -- --# The archiver. --AR=$lt_AR --AR_FLAGS=$lt_AR_FLAGS -- --# The default C compiler. --CC=$lt_CC -- --# Is the compiler the GNU C compiler? --with_gcc=$GCC -- --# The linker used to build libraries. --LD=$lt_LD -- --# Whether we need hard or soft links. --LN_S=$lt_LN_S -- --# A BSD-compatible nm program. --NM=$lt_NM -- --# A symbol stripping program --STRIP=$STRIP -- --# Used to examine libraries when file_magic_cmd begins "file" --MAGIC_CMD=$MAGIC_CMD -- --# Used on cygwin: DLL creation program. --DLLTOOL="$DLLTOOL" -- --# Used on cygwin: object dumper. --OBJDUMP="$OBJDUMP" -- --# Used on cygwin: assembler. --AS="$AS" -- --# The name of the directory that contains temporary libtool files. --objdir=$objdir -- --# How to create reloadable object files. --reload_flag=$lt_reload_flag --reload_cmds=$lt_reload_cmds -- --# How to pass a linker flag through the compiler. --wl=$lt_wl -- --# Object file suffix (normally "o"). --objext="$ac_objext" -- --# Old archive suffix (normally "a"). --libext="$libext" -- --# Executable file suffix (normally ""). --exeext="$exeext" -- --# Additional compiler flags for building library objects. --pic_flag=$lt_pic_flag --pic_mode=$pic_mode -- --# Does compiler simultaneously support -c and -o options? --compiler_c_o=$lt_compiler_c_o -- --# Can we write directly to a .lo ? --compiler_o_lo=$lt_compiler_o_lo -- --# Must we lock files when doing compilation ? --need_locks=$lt_need_locks -- --# Do we need the lib prefix for modules? --need_lib_prefix=$need_lib_prefix -- --# Do we need a version for libraries? --need_version=$need_version -- --# Whether dlopen is supported. --dlopen_support=$enable_dlopen -- --# Whether dlopen of programs is supported. --dlopen_self=$enable_dlopen_self -- --# Whether dlopen of statically linked programs is supported. --dlopen_self_static=$enable_dlopen_self_static -- --# Compiler flag to prevent dynamic linking. --link_static_flag=$lt_link_static_flag -- --# Compiler flag to turn off builtin functions. --no_builtin_flag=$lt_no_builtin_flag -- --# Compiler flag to allow reflexive dlopens. --export_dynamic_flag_spec=$lt_export_dynamic_flag_spec -- --# Compiler flag to generate shared objects directly from archives. --whole_archive_flag_spec=$lt_whole_archive_flag_spec -- --# Compiler flag to generate thread-safe objects. --thread_safe_flag_spec=$lt_thread_safe_flag_spec -- --# Library versioning type. --version_type=$version_type -- --# Format of library name prefix. --libname_spec=$lt_libname_spec -- --# List of archive names. First name is the real one, the rest are links. --# The last name is the one that the linker finds with -lNAME. --library_names_spec=$lt_library_names_spec -- --# The coded name of the library, if different from the real name. --soname_spec=$lt_soname_spec -- --# Commands used to build and install an old-style archive. --RANLIB=$lt_RANLIB --old_archive_cmds=$lt_old_archive_cmds --old_postinstall_cmds=$lt_old_postinstall_cmds --old_postuninstall_cmds=$lt_old_postuninstall_cmds -- --# Create an old-style archive from a shared archive. --old_archive_from_new_cmds=$lt_old_archive_from_new_cmds -- --# Create a temporary old-style archive to link instead of a shared archive. --old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds -- --# Commands used to build and install a shared archive. --archive_cmds=$lt_archive_cmds --archive_expsym_cmds=$lt_archive_expsym_cmds --postinstall_cmds=$lt_postinstall_cmds --postuninstall_cmds=$lt_postuninstall_cmds -- --# Commands to strip libraries. --old_striplib=$lt_old_striplib --striplib=$lt_striplib -- --# Method to check whether dependent libraries are shared objects. --deplibs_check_method=$lt_deplibs_check_method -- --# Command to use when deplibs_check_method == file_magic. --file_magic_cmd=$lt_file_magic_cmd -- --# Flag that allows shared libraries with undefined symbols to be built. --allow_undefined_flag=$lt_allow_undefined_flag -- --# Flag that forces no undefined symbols. --no_undefined_flag=$lt_no_undefined_flag -- --# Commands used to finish a libtool library installation in a directory. --finish_cmds=$lt_finish_cmds -- --# Same as above, but a single script fragment to be evaled but not shown. --finish_eval=$lt_finish_eval -- --# Take the output of nm and produce a listing of raw symbols and C names. --global_symbol_pipe=$lt_global_symbol_pipe -- --# Transform the output of nm in a proper C declaration --global_symbol_to_cdecl=$lt_global_symbol_to_cdecl -- --# Transform the output of nm in a C name address pair --global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address -- --# This is the shared library runtime path variable. --runpath_var=$runpath_var -- --# This is the shared library path variable. --shlibpath_var=$shlibpath_var -- --# Is shlibpath searched before the hard-coded library search path? --shlibpath_overrides_runpath=$shlibpath_overrides_runpath -- --# How to hardcode a shared library path into an executable. --hardcode_action=$hardcode_action -- --# Whether we should hardcode library paths into libraries. --hardcode_into_libs=$hardcode_into_libs -- --# Flag to hardcode \$libdir into a binary during linking. --# This must work even if \$libdir does not exist. --hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -- --# Whether we need a single -rpath flag with a separated argument. --hardcode_libdir_separator=$lt_hardcode_libdir_separator -- --# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the --# resulting binary. --hardcode_direct=$hardcode_direct -- --# Set to yes if using the -LDIR flag during linking hardcodes DIR into the --# resulting binary. --hardcode_minus_L=$hardcode_minus_L -- --# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into --# the resulting binary. --hardcode_shlibpath_var=$hardcode_shlibpath_var -- --# Variables whose values should be saved in libtool wrapper scripts and --# restored at relink time. --variables_saved_for_relink="$variables_saved_for_relink" -- --# Whether libtool must link a program against all its dependency libraries. --link_all_deplibs=$link_all_deplibs -- --# Compile-time system search path for libraries --sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -- --# Run-time system search path for libraries --sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -- --# Fix the shell variable \$srcfile for the compiler. --fix_srcfile_path="$fix_srcfile_path" -- --# Set to yes if exported symbols are required. --always_export_symbols=$always_export_symbols -- --# The commands to list exported symbols. --export_symbols_cmds=$lt_export_symbols_cmds -- --# The commands to extract the exported symbol list from a shared archive. --extract_expsyms_cmds=$lt_extract_expsyms_cmds -- --# Symbols that should not be listed in the preloaded symbols. --exclude_expsyms=$lt_exclude_expsyms -- --# Symbols that must always be exported. --include_expsyms=$lt_include_expsyms -- --# ### END LIBTOOL CONFIG -- --__EOF__ -- -- case $host_os in -- aix3*) -- cat <<\EOF >> "${ofile}T" -- --# AIX sometimes has problems with the GCC collect2 program. For some --# reason, if we set the COLLECT_NAMES environment variable, the problems --# vanish in a puff of smoke. --if test "X${COLLECT_NAMES+set}" != Xset; then -- COLLECT_NAMES= -- export COLLECT_NAMES --fi --EOF -- ;; -- esac -- -- case $host_os in -- cygwin* | mingw* | pw32* | os2*) -- cat <<'EOF' >> "${ofile}T" -- # This is a source program that is used to create dlls on Windows -- # Don't remove nor modify the starting and closing comments --# /* ltdll.c starts here */ --# #define WIN32_LEAN_AND_MEAN --# #include --# #undef WIN32_LEAN_AND_MEAN --# #include --# --# #ifndef __CYGWIN__ --# # ifdef __CYGWIN32__ --# # define __CYGWIN__ __CYGWIN32__ --# # endif --# #endif --# --# #ifdef __cplusplus --# extern "C" { --# #endif --# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); --# #ifdef __cplusplus --# } --# #endif --# --# #ifdef __CYGWIN__ --# #include --# DECLARE_CYGWIN_DLL( DllMain ); --# #endif --# HINSTANCE __hDllInstance_base; --# --# BOOL APIENTRY --# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) --# { --# __hDllInstance_base = hInst; --# return TRUE; --# } --# /* ltdll.c ends here */ -- # This is a source program that is used to create import libraries -- # on Windows for dlls which lack them. Don't remove nor modify the -- # starting and closing comments --# /* impgen.c starts here */ --# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. --# --# This file is part of GNU libtool. --# --# 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. --# */ --# --# #include /* for printf() */ --# #include /* for open(), lseek(), read() */ --# #include /* for O_RDONLY, O_BINARY */ --# #include /* for strdup() */ --# --# /* O_BINARY isn't required (or even defined sometimes) under Unix */ --# #ifndef O_BINARY --# #define O_BINARY 0 --# #endif --# --# static unsigned int --# pe_get16 (fd, offset) --# int fd; --# int offset; --# { --# unsigned char b[2]; --# lseek (fd, offset, SEEK_SET); --# read (fd, b, 2); --# return b[0] + (b[1]<<8); --# } --# --# static unsigned int --# pe_get32 (fd, offset) --# int fd; --# int offset; --# { --# unsigned char b[4]; --# lseek (fd, offset, SEEK_SET); --# read (fd, b, 4); --# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); --# } --# --# static unsigned int --# pe_as32 (ptr) --# void *ptr; --# { --# unsigned char *b = ptr; --# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); --# } --# --# int --# main (argc, argv) --# int argc; --# char *argv[]; --# { --# int dll; --# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; --# unsigned long export_rva, export_size, nsections, secptr, expptr; --# unsigned long name_rvas, nexp; --# unsigned char *expdata, *erva; --# char *filename, *dll_name; --# --# filename = argv[1]; --# --# dll = open(filename, O_RDONLY|O_BINARY); --# if (dll < 1) --# return 1; --# --# dll_name = filename; --# --# for (i=0; filename[i]; i++) --# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') --# dll_name = filename + i +1; --# --# pe_header_offset = pe_get32 (dll, 0x3c); --# opthdr_ofs = pe_header_offset + 4 + 20; --# num_entries = pe_get32 (dll, opthdr_ofs + 92); --# --# if (num_entries < 1) /* no exports */ --# return 1; --# --# export_rva = pe_get32 (dll, opthdr_ofs + 96); --# export_size = pe_get32 (dll, opthdr_ofs + 100); --# nsections = pe_get16 (dll, pe_header_offset + 4 +2); --# secptr = (pe_header_offset + 4 + 20 + --# pe_get16 (dll, pe_header_offset + 4 + 16)); --# --# expptr = 0; --# for (i = 0; i < nsections; i++) --# { --# char sname[8]; --# unsigned long secptr1 = secptr + 40 * i; --# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); --# unsigned long vsize = pe_get32 (dll, secptr1 + 16); --# unsigned long fptr = pe_get32 (dll, secptr1 + 20); --# lseek(dll, secptr1, SEEK_SET); --# read(dll, sname, 8); --# if (vaddr <= export_rva && vaddr+vsize > export_rva) --# { --# expptr = fptr + (export_rva - vaddr); --# if (export_rva + export_size > vaddr + vsize) --# export_size = vsize - (export_rva - vaddr); --# break; --# } --# } --# --# expdata = (unsigned char*)malloc(export_size); --# lseek (dll, expptr, SEEK_SET); --# read (dll, expdata, export_size); --# erva = expdata - export_rva; --# --# nexp = pe_as32 (expdata+24); --# name_rvas = pe_as32 (expdata+32); --# --# printf ("EXPORTS\n"); --# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) -- -- mv -f "${ofile}T" "$ofile" || \ -- (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") -- chmod +x "$ofile" --fi -- --])# _LT_AC_LTCONFIG_HACK -- --# AC_LIBTOOL_DLOPEN - enable checks for dlopen support --AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) -- --# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's --AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) -- --# AC_ENABLE_SHARED - implement the --enable-shared flag --# Usage: AC_ENABLE_SHARED[(DEFAULT)] --# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to --# `yes'. --AC_DEFUN([AC_ENABLE_SHARED], --[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl --AC_ARG_ENABLE(shared, --changequote(<<, >>)dnl --<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], --changequote([, ])dnl --[p=${PACKAGE-default} --case $enableval in --yes) enable_shared=yes ;; --no) enable_shared=no ;; --*) -- enable_shared=no -- # Look at the argument we got. We use all the common list separators. -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," -- for pkg in $enableval; do -- if test "X$pkg" = "X$p"; then -- enable_shared=yes -- fi -- done -- IFS="$ac_save_ifs" -- ;; --esac], --enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl --]) -- --# AC_DISABLE_SHARED - set the default shared flag to --disable-shared --AC_DEFUN([AC_DISABLE_SHARED], --[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl --AC_ENABLE_SHARED(no)]) -- --# AC_ENABLE_STATIC - implement the --enable-static flag --# Usage: AC_ENABLE_STATIC[(DEFAULT)] --# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to --# `yes'. --AC_DEFUN([AC_ENABLE_STATIC], --[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl --AC_ARG_ENABLE(static, --changequote(<<, >>)dnl --<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], --changequote([, ])dnl --[p=${PACKAGE-default} --case $enableval in --yes) enable_static=yes ;; --no) enable_static=no ;; --*) -- enable_static=no -- # Look at the argument we got. We use all the common list separators. -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," -- for pkg in $enableval; do -- if test "X$pkg" = "X$p"; then -- enable_static=yes -- fi -- done -- IFS="$ac_save_ifs" -- ;; --esac], --enable_static=AC_ENABLE_STATIC_DEFAULT)dnl --]) -- --# AC_DISABLE_STATIC - set the default static flag to --disable-static --AC_DEFUN([AC_DISABLE_STATIC], --[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl --AC_ENABLE_STATIC(no)]) -- -- --# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag --# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] --# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to --# `yes'. --AC_DEFUN([AC_ENABLE_FAST_INSTALL], --[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl --AC_ARG_ENABLE(fast-install, --changequote(<<, >>)dnl --<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], --changequote([, ])dnl --[p=${PACKAGE-default} --case $enableval in --yes) enable_fast_install=yes ;; --no) enable_fast_install=no ;; --*) -- enable_fast_install=no -- # Look at the argument we got. We use all the common list separators. -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," -- for pkg in $enableval; do -- if test "X$pkg" = "X$p"; then -- enable_fast_install=yes -- fi -- done -- IFS="$ac_save_ifs" -- ;; --esac], --enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl --]) -- --# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install --AC_DEFUN([AC_DISABLE_FAST_INSTALL], --[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl --AC_ENABLE_FAST_INSTALL(no)]) -- --# AC_LIBTOOL_PICMODE - implement the --with-pic flag --# Usage: AC_LIBTOOL_PICMODE[(MODE)] --# Where MODE is either `yes' or `no'. If omitted, it defaults to --# `both'. --AC_DEFUN([AC_LIBTOOL_PICMODE], --[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl --pic_mode=ifelse($#,1,$1,default)]) -- -- --# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library --AC_DEFUN([AC_PATH_TOOL_PREFIX], --[AC_MSG_CHECKING([for $1]) --AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, --[case $MAGIC_CMD in -- /*) -- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. -- ;; -- ?:/*) -- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. -- ;; -- *) -- ac_save_MAGIC_CMD="$MAGIC_CMD" -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" --dnl $ac_dummy forces splitting on constant user-supplied paths. --dnl POSIX.2 word splitting is done only on the output of word expansions, --dnl not every word. This closes a longstanding sh security hole. -- ac_dummy="ifelse([$2], , $PATH, [$2])" -- for ac_dir in $ac_dummy; do -- test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/$1; then -- lt_cv_path_MAGIC_CMD="$ac_dir/$1" -- if test -n "$file_magic_test_file"; then -- case $deplibs_check_method in -- "file_magic "*) -- file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" -- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | -- egrep "$file_magic_regex" > /dev/null; then -- : -- else -- cat <&2 -- --*** Warning: the command libtool uses to detect shared libraries, --*** $file_magic_cmd, produces output that libtool cannot recognize. --*** The result is that libtool may fail to recognize shared libraries --*** as such. This will affect the creation of libtool libraries that --*** depend on shared libraries, but programs linked with such libtool --*** libraries will work regardless of this problem. Nevertheless, you --*** may want to report the problem to your system manager and/or to --*** bug-libtool@gnu.org -- --EOF -- fi ;; -- esac -- fi -- break -- fi -- done -- IFS="$ac_save_ifs" -- MAGIC_CMD="$ac_save_MAGIC_CMD" -- ;; --esac]) --MAGIC_CMD="$lt_cv_path_MAGIC_CMD" --if test -n "$MAGIC_CMD"; then -- AC_MSG_RESULT($MAGIC_CMD) --else -- AC_MSG_RESULT(no) --fi --]) -- -- --# AC_PATH_MAGIC - find a file program which can recognise a shared library --AC_DEFUN([AC_PATH_MAGIC], --[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl --AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) --if test -z "$lt_cv_path_MAGIC_CMD"; then -- if test -n "$ac_tool_prefix"; then -- AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) -- else -- MAGIC_CMD=: -- fi --fi --]) -- -- --# AC_PROG_LD - find the path to the GNU or non-GNU linker --AC_DEFUN([AC_PROG_LD], --[AC_ARG_WITH(gnu-ld, --[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], --test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) --AC_REQUIRE([AC_PROG_CC])dnl --AC_REQUIRE([AC_CANONICAL_HOST])dnl --AC_REQUIRE([AC_CANONICAL_BUILD])dnl --AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl --ac_prog=ld --if test "$GCC" = yes; then -- # Check if gcc -print-prog-name=ld gives a path. -- AC_MSG_CHECKING([for ld used by GCC]) -- case $host in -- *-*-mingw*) -- # gcc leaves a trailing carriage return which upsets mingw -- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; -- *) -- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; -- esac -- case $ac_prog in -- # Accept absolute paths. -- [[\\/]]* | [[A-Za-z]]:[[\\/]]*) -- re_direlt='/[[^/]][[^/]]*/\.\./' -- # Canonicalize the path of ld -- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` -- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` -- done -- test -z "$LD" && LD="$ac_prog" -- ;; -- "") -- # If it fails, then pretend we aren't using GCC. -- ac_prog=ld -- ;; -- *) -- # If it is relative, then search for the first ld in PATH. -- with_gnu_ld=unknown -- ;; -- esac --elif test "$with_gnu_ld" = yes; then -- AC_MSG_CHECKING([for GNU ld]) --else -- AC_MSG_CHECKING([for non-GNU ld]) --fi --AC_CACHE_VAL(lt_cv_path_LD, --[if test -z "$LD"; then -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -- for ac_dir in $PATH; do -- test -z "$ac_dir" && ac_dir=. -- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then -- lt_cv_path_LD="$ac_dir/$ac_prog" -- # Check to see if the program is GNU ld. I'd rather use --version, -- # but apparently some GNU ld's only accept -v. -- # Break only if it was the GNU/non-GNU ld that we prefer. -- if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then -- test "$with_gnu_ld" != no && break -- else -- test "$with_gnu_ld" != yes && break -- fi -- fi -- done -- IFS="$ac_save_ifs" --else -- lt_cv_path_LD="$LD" # Let the user override the test with a path. --fi]) --LD="$lt_cv_path_LD" --if test -n "$LD"; then -- AC_MSG_RESULT($LD) --else -- AC_MSG_RESULT(no) --fi --test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) --AC_PROG_LD_GNU --]) -- --# AC_PROG_LD_GNU - --AC_DEFUN([AC_PROG_LD_GNU], --[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, --[# I'd rather use --version here, but apparently some GNU ld's only accept -v. --if $LD -v 2>&1 &5; then -- lt_cv_prog_gnu_ld=yes --else -- lt_cv_prog_gnu_ld=no --fi]) --with_gnu_ld=$lt_cv_prog_gnu_ld --]) -- --# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker --# -- PORTME Some linkers may need a different reload flag. --AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], --[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, --[lt_cv_ld_reload_flag='-r']) --reload_flag=$lt_cv_ld_reload_flag --test -n "$reload_flag" && reload_flag=" $reload_flag" --]) -- --# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies --# -- PORTME fill in with the dynamic library characteristics --AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], --[AC_CACHE_CHECK([how to recognise dependant libraries], --lt_cv_deplibs_check_method, --[lt_cv_file_magic_cmd='$MAGIC_CMD' --lt_cv_file_magic_test_file= --lt_cv_deplibs_check_method='unknown' --# Need to set the preceding variable on all platforms that support --# interlibrary dependencies. --# 'none' -- dependencies not supported. --# `unknown' -- same as none, but documents that we really don't know. --# 'pass_all' -- all dependencies passed with no checks. --# 'test_compile' -- check by making test program. --# 'file_magic [[regex]]' -- check by looking for files in library path --# which responds to the $file_magic_cmd with a given egrep regex. --# If you have `file' or equivalent on your system and you're not sure --# whether `pass_all' will *always* work, you probably want this one. -- --case $host_os in --aix4* | aix5*) -- lt_cv_deplibs_check_method=pass_all -- ;; -- --beos*) -- lt_cv_deplibs_check_method=pass_all -- ;; -- --bsdi4*) -- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' -- lt_cv_file_magic_cmd='/usr/bin/file -L' -- lt_cv_file_magic_test_file=/shlib/libc.so -- ;; -- --cygwin* | mingw* | pw32*) -- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' -- lt_cv_file_magic_cmd='$OBJDUMP -f' -- ;; -- --darwin* | rhapsody*) -- lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' -- lt_cv_file_magic_cmd='/usr/bin/file -L' -- case "$host_os" in -- rhapsody* | darwin1.[[012]]) -- lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` -- ;; -- *) # Darwin 1.3 on -- lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' -- ;; -- esac -- ;; -- --freebsd*) -- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then -- case $host_cpu in -- i*86 ) -- # Not sure whether the presence of OpenBSD here was a mistake. -- # Let's accept both of them until this is cleared up. -- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' -- lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` -- ;; -- esac -- else -- lt_cv_deplibs_check_method=pass_all -- fi -- ;; -- --gnu*) -- lt_cv_deplibs_check_method=pass_all -- ;; -- --hpux10.20*|hpux11*) -- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' -- lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=/usr/lib/libc.sl -- ;; -- --irix5* | irix6*) -- case $host_os in -- irix5*) -- # this will be overridden with pass_all, but let us keep it just in case -- lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" -- ;; -- *) -- case $LD in -- *-32|*"-32 ") libmagic=32-bit;; -- *-n32|*"-n32 ") libmagic=N32;; -- *-64|*"-64 ") libmagic=64-bit;; -- *) libmagic=never-match;; -- esac -- # this will be overridden with pass_all, but let us keep it just in case -- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" -- ;; -- esac -- lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` -- lt_cv_deplibs_check_method=pass_all -- ;; -- --# This must be Linux ELF. --linux-gnu*) -- case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) -- lt_cv_deplibs_check_method=pass_all ;; -- *) -- # glibc up to 2.1.1 does not perform some relocations on ARM -- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; -- esac -- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` -- ;; -- --netbsd*) -- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then -- lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' -- else -- lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' -- fi -- ;; -- --newos6*) -- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' -- lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=/usr/lib/libnls.so -- ;; -- --openbsd*) -- lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` -- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' -- else -- lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' -- fi -- ;; -- --osf3* | osf4* | osf5*) -- # this will be overridden with pass_all, but let us keep it just in case -- lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' -- lt_cv_file_magic_test_file=/shlib/libc.so -- lt_cv_deplibs_check_method=pass_all -- ;; -- --sco3.2v5*) -- lt_cv_deplibs_check_method=pass_all -- ;; -- --solaris*) -- lt_cv_deplibs_check_method=pass_all -- lt_cv_file_magic_test_file=/lib/libc.so -- ;; -- --sysv5uw[[78]]* | sysv4*uw2*) -- lt_cv_deplibs_check_method=pass_all -- ;; -- --sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -- case $host_vendor in -- motorola) -- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' -- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` -- ;; -- ncr) -- lt_cv_deplibs_check_method=pass_all -- ;; -- sequent) -- lt_cv_file_magic_cmd='/bin/file' -- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' -- ;; -- sni) -- lt_cv_file_magic_cmd='/bin/file' -- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" -- lt_cv_file_magic_test_file=/lib/libc.so -- ;; -- esac -- ;; --esac --]) --file_magic_cmd=$lt_cv_file_magic_cmd --deplibs_check_method=$lt_cv_deplibs_check_method --]) -- -- --# AC_PROG_NM - find the path to a BSD-compatible name lister --AC_DEFUN([AC_PROG_NM], --[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl --AC_MSG_CHECKING([for BSD-compatible nm]) --AC_CACHE_VAL(lt_cv_path_NM, --[if test -n "$NM"; then -- # Let the user override the test. -- lt_cv_path_NM="$NM" --else -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do -- test -z "$ac_dir" && ac_dir=. -- tmp_nm=$ac_dir/${ac_tool_prefix}nm -- if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then -- # Check to see if the nm accepts a BSD-compat flag. -- # Adding the `sed 1q' prevents false positives on HP-UX, which says: -- # nm: unknown option "B" ignored -- # Tru64's nm complains that /dev/null is an invalid object file -- if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then -- lt_cv_path_NM="$tmp_nm -B" -- break -- elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then -- lt_cv_path_NM="$tmp_nm -p" -- break -- else -- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but -- continue # so that we can try to find one that supports BSD flags -- fi -- fi -- done -- IFS="$ac_save_ifs" -- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm --fi]) --NM="$lt_cv_path_NM" --AC_MSG_RESULT([$NM]) --]) -- --# AC_CHECK_LIBM - check for math library --AC_DEFUN([AC_CHECK_LIBM], --[AC_REQUIRE([AC_CANONICAL_HOST])dnl --LIBM= --case $host in --*-*-beos* | *-*-cygwin* | *-*-pw32*) -- # These system don't have libm -- ;; --*-ncr-sysv4.3*) -- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") -- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") -- ;; --*) -- AC_CHECK_LIB(m, main, LIBM="-lm") -- ;; --esac --]) -- --# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for --# the libltdl convenience library and INCLTDL to the include flags for --# the libltdl header and adds --enable-ltdl-convenience to the --# configure arguments. Note that LIBLTDL and INCLTDL are not --# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not --# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed --# with '${top_builddir}/' and INCLTDL will be prefixed with --# '${top_srcdir}/' (note the single quotes!). If your package is not --# flat and you're not using automake, define top_builddir and --# top_srcdir appropriately in the Makefiles. --AC_DEFUN([AC_LIBLTDL_CONVENIENCE], --[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -- case $enable_ltdl_convenience in -- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; -- "") enable_ltdl_convenience=yes -- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; -- esac -- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la -- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) --]) -- --# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for --# the libltdl installable library and INCLTDL to the include flags for --# the libltdl header and adds --enable-ltdl-install to the configure --# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is --# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed --# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will --# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed --# with '${top_srcdir}/' (note the single quotes!). If your package is --# not flat and you're not using automake, define top_builddir and --# top_srcdir appropriately in the Makefiles. --# In the future, this macro may have to be called after AC_PROG_LIBTOOL. --AC_DEFUN([AC_LIBLTDL_INSTALLABLE], --[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -- AC_CHECK_LIB(ltdl, main, -- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], -- [if test x"$enable_ltdl_install" = xno; then -- AC_MSG_WARN([libltdl not installed, but installation disabled]) -- else -- enable_ltdl_install=yes -- fi -- ]) -- if test x"$enable_ltdl_install" = x"yes"; then -- ac_configure_args="$ac_configure_args --enable-ltdl-install" -- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la -- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) -- else -- ac_configure_args="$ac_configure_args --enable-ltdl-install=no" -- LIBLTDL="-lltdl" -- INCLTDL= -- fi --]) -- --# old names --AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) --AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) --AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) --AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) --AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) --AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) --AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) -- --# This is just to silence aclocal about the macro not being used --ifelse([AC_DISABLE_FAST_INSTALL]) -- --# gettext.m4 serial 16 (gettext-0.11.4) --dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. --dnl --dnl This file can can be used in projects which are not available under --dnl the GNU General Public License or the GNU Library General Public --dnl License but which still want to provide support for the GNU gettext --dnl functionality. --dnl Please note that the actual code of the GNU gettext library is covered --dnl by the GNU Library General Public License, and the rest of the GNU --dnl gettext package package is covered by the GNU General Public License. --dnl They are *not* in the public domain. -- --dnl Authors: --dnl Ulrich Drepper , 1995-2000. --dnl Bruno Haible , 2000-2002. -- --dnl Macro to add for using GNU gettext. -- --dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). --dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The --dnl default (if it is not specified or empty) is 'no-libtool'. --dnl INTLSYMBOL should be 'external' for packages with no intl directory, --dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. --dnl If INTLSYMBOL is 'use-libtool', then a libtool library --dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, --dnl depending on --{enable,disable}-{shared,static} and on the presence of --dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library --dnl $(top_builddir)/intl/libintl.a will be created. --dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext --dnl implementations (in libc or libintl) without the ngettext() function --dnl will be ignored. If NEEDSYMBOL is specified and is --dnl 'need-formatstring-macros', then GNU gettext implementations that don't --dnl support the ISO C 99 formatstring macros will be ignored. --dnl INTLDIR is used to find the intl libraries. If empty, --dnl the value `$(top_builddir)/intl/' is used. --dnl --dnl The result of the configuration is one of three cases: --dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled --dnl and used. --dnl Catalog format: GNU --> install in $(datadir) --dnl Catalog extension: .mo after installation, .gmo in source tree --dnl 2) GNU gettext has been found in the system's C library. --dnl Catalog format: GNU --> install in $(datadir) --dnl Catalog extension: .mo after installation, .gmo in source tree --dnl 3) No internationalization, always use English msgid. --dnl Catalog format: none --dnl Catalog extension: none --dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. --dnl The use of .gmo is historical (it was needed to avoid overwriting the --dnl GNU format catalogs when building on a platform with an X/Open gettext), --dnl but we keep it in order not to force irrelevant filename changes on the --dnl maintainers. --dnl --AC_DEFUN([AM_GNU_GETTEXT], --[ -- dnl Argument checking. -- ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , -- [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT --])])])])]) -- ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , -- [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT --])])])]) -- define(gt_included_intl, ifelse([$1], [external], [no], [yes])) -- define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) -- -- AC_REQUIRE([AM_PO_SUBDIRS])dnl -- ifelse(gt_included_intl, yes, [ -- AC_REQUIRE([AM_INTL_SUBDIR])dnl -- ]) -- -- dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. -- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -- AC_REQUIRE([AC_LIB_RPATH]) -- -- dnl Sometimes libintl requires libiconv, so first search for libiconv. -- dnl Ideally we would do this search only after the -- dnl if test "$USE_NLS" = "yes"; then -- dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then -- dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT -- dnl the configure script would need to contain the same shell code -- dnl again, outside any 'if'. There are two solutions: -- dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. -- dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. -- dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not -- dnl documented, we avoid it. -- ifelse(gt_included_intl, yes, , [ -- AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) -- ]) -- -- AC_MSG_CHECKING([whether NLS is requested]) -- dnl Default is enabled NLS -- AC_ARG_ENABLE(nls, -- [ --disable-nls do not use Native Language Support], -- USE_NLS=$enableval, USE_NLS=yes) -- AC_MSG_RESULT($USE_NLS) -- AC_SUBST(USE_NLS) -- -- ifelse(gt_included_intl, yes, [ -- BUILD_INCLUDED_LIBINTL=no -- USE_INCLUDED_LIBINTL=no -- ]) -- LIBINTL= -- LTLIBINTL= -- POSUB= -- -- dnl If we use NLS figure out what method -- if test "$USE_NLS" = "yes"; then -- gt_use_preinstalled_gnugettext=no -- ifelse(gt_included_intl, yes, [ -- AC_MSG_CHECKING([whether included gettext is requested]) -- AC_ARG_WITH(included-gettext, -- [ --with-included-gettext use the GNU gettext library included here], -- nls_cv_force_use_gnu_gettext=$withval, -- nls_cv_force_use_gnu_gettext=no) -- AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) -- -- nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" -- if test "$nls_cv_force_use_gnu_gettext" != "yes"; then -- ]) -- dnl User does not insist on using GNU NLS library. Figure out what -- dnl to use. If GNU gettext is available we use this. Else we have -- dnl to fall back to GNU NLS library. -- -- dnl Add a version number to the cache macros. -- define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) -- define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) -- define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) -- -- AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, -- [AC_TRY_LINK([#include --]ifelse([$2], [need-formatstring-macros], --[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION --#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) --#endif --changequote(,)dnl --typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; --changequote([,])dnl --], [])[extern int _nl_msg_cat_cntr; --extern int *_nl_domain_bindings;], -- [bindtextdomain ("", ""); --return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], -- gt_cv_func_gnugettext_libc=yes, -- gt_cv_func_gnugettext_libc=no)]) -- -- if test "$gt_cv_func_gnugettext_libc" != "yes"; then -- dnl Sometimes libintl requires libiconv, so first search for libiconv. -- ifelse(gt_included_intl, yes, , [ -- AM_ICONV_LINK -- ]) -- dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL -- dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) -- dnl because that would add "-liconv" to LIBINTL and LTLIBINTL -- dnl even if libiconv doesn't exist. -- AC_LIB_LINKFLAGS_BODY([intl]) -- AC_CACHE_CHECK([for GNU gettext in libintl], -- gt_cv_func_gnugettext_libintl, -- [gt_save_CPPFLAGS="$CPPFLAGS" -- CPPFLAGS="$CPPFLAGS $INCINTL" -- gt_save_LIBS="$LIBS" -- LIBS="$LIBS $LIBINTL" -- dnl Now see whether libintl exists and does not depend on libiconv. -- AC_TRY_LINK([#include --]ifelse([$2], [need-formatstring-macros], --[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION --#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) --#endif --changequote(,)dnl --typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; --changequote([,])dnl --], [])[extern int _nl_msg_cat_cntr; --extern --#ifdef __cplusplus --"C" --#endif --const char *_nl_expand_alias ();], -- [bindtextdomain ("", ""); --return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], -- gt_cv_func_gnugettext_libintl=yes, -- gt_cv_func_gnugettext_libintl=no) -- dnl Now see whether libintl exists and depends on libiconv. -- if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then -- LIBS="$LIBS $LIBICONV" -- AC_TRY_LINK([#include --]ifelse([$2], [need-formatstring-macros], --[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION --#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) --#endif --changequote(,)dnl --typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; --changequote([,])dnl --], [])[extern int _nl_msg_cat_cntr; --extern --#ifdef __cplusplus --"C" --#endif --const char *_nl_expand_alias ();], -- [bindtextdomain ("", ""); --return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], -- [LIBINTL="$LIBINTL $LIBICONV" -- LTLIBINTL="$LTLIBINTL $LTLIBICONV" -- gt_cv_func_gnugettext_libintl=yes -- ]) -- fi -- CPPFLAGS="$gt_save_CPPFLAGS" -- LIBS="$gt_save_LIBS"]) -- fi -- -- dnl If an already present or preinstalled GNU gettext() is found, -- dnl use it. But if this macro is used in GNU gettext, and GNU -- dnl gettext is already preinstalled in libintl, we update this -- dnl libintl. (Cf. the install rule in intl/Makefile.in.) -- if test "$gt_cv_func_gnugettext_libc" = "yes" \ -- || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ -- && test "$PACKAGE" != gettext; }; then -- gt_use_preinstalled_gnugettext=yes -- else -- dnl Reset the values set by searching for libintl. -- LIBINTL= -- LTLIBINTL= -- INCINTL= -- fi -- -- ifelse(gt_included_intl, yes, [ -- if test "$gt_use_preinstalled_gnugettext" != "yes"; then -- dnl GNU gettext is not found in the C library. -- dnl Fall back on included GNU gettext library. -- nls_cv_use_gnu_gettext=yes -- fi -- fi -- -- if test "$nls_cv_use_gnu_gettext" = "yes"; then -- dnl Mark actions used to generate GNU NLS library. -- INTLOBJS="\$(GETTOBJS)" -- BUILD_INCLUDED_LIBINTL=yes -- USE_INCLUDED_LIBINTL=yes -- LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" -- LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" -- LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` -- fi -- -- if test "$gt_use_preinstalled_gnugettext" = "yes" \ -- || test "$nls_cv_use_gnu_gettext" = "yes"; then -- dnl Mark actions to use GNU gettext tools. -- CATOBJEXT=.gmo -- fi -- ]) -- -- if test "$gt_use_preinstalled_gnugettext" = "yes" \ -- || test "$nls_cv_use_gnu_gettext" = "yes"; then -- AC_DEFINE(ENABLE_NLS, 1, -- [Define to 1 if translation of program messages to the user's native language -- is requested.]) -- else -- USE_NLS=no -- fi -- fi -- -- if test "$USE_NLS" = "yes"; then -- -- if test "$gt_use_preinstalled_gnugettext" = "yes"; then -- if test "$gt_cv_func_gnugettext_libintl" = "yes"; then -- AC_MSG_CHECKING([how to link with libintl]) -- AC_MSG_RESULT([$LIBINTL]) -- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) -- fi -- -- dnl For backward compatibility. Some packages may be using this. -- AC_DEFINE(HAVE_GETTEXT, 1, -- [Define if the GNU gettext() function is already present or preinstalled.]) -- AC_DEFINE(HAVE_DCGETTEXT, 1, -- [Define if the GNU dcgettext() function is already present or preinstalled.]) -- fi -- -- dnl We need to process the po/ directory. -- POSUB=po -- fi -- -- ifelse(gt_included_intl, yes, [ -- dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL -- dnl to 'yes' because some of the testsuite requires it. -- if test "$PACKAGE" = gettext; then -- BUILD_INCLUDED_LIBINTL=yes -- fi -- -- dnl Make all variables we use known to autoconf. -- AC_SUBST(BUILD_INCLUDED_LIBINTL) -- AC_SUBST(USE_INCLUDED_LIBINTL) -- AC_SUBST(CATOBJEXT) -- AC_SUBST(INTLOBJS) -- -- dnl For backward compatibility. Some configure.ins may be using this. -- nls_cv_header_intl= -- nls_cv_header_libgt= -- -- dnl For backward compatibility. Some Makefiles may be using this. -- DATADIRNAME=share -- AC_SUBST(DATADIRNAME) -- -- dnl For backward compatibility. Some Makefiles may be using this. -- INSTOBJEXT=.mo -- AC_SUBST(INSTOBJEXT) -- -- dnl For backward compatibility. Some Makefiles may be using this. -- GENCAT=gencat -- AC_SUBST(GENCAT) -- -- dnl Enable libtool support if the surrounding package wishes it. -- INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix -- AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) -- ]) -- -- dnl For backward compatibility. Some Makefiles may be using this. -- INTLLIBS="$LIBINTL" -- AC_SUBST(INTLLIBS) -- -- dnl Make all documented variables known to autoconf. -- AC_SUBST(LIBINTL) -- AC_SUBST(LTLIBINTL) -- AC_SUBST(POSUB) --]) -- -- --dnl Checks for all prerequisites of the po subdirectory, --dnl except for USE_NLS. --AC_DEFUN([AM_PO_SUBDIRS], --[ -- AC_REQUIRE([AC_PROG_MAKE_SET])dnl -- AC_REQUIRE([AC_PROG_INSTALL])dnl -- AC_REQUIRE([AM_MKINSTALLDIRS])dnl -- -- dnl Perform the following tests also if --disable-nls has been given, -- dnl because they are needed for "make dist" to work. -- -- dnl Search for GNU msgfmt in the PATH. -- dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. -- dnl The second test excludes FreeBSD msgfmt. -- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, -- [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && -- (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], -- :) -- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) -- -- dnl Search for GNU xgettext 0.11 or newer in the PATH. -- dnl The first test excludes Solaris xgettext and early GNU xgettext versions. -- dnl The second test excludes FreeBSD xgettext. -- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, -- [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && -- (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], -- :) -- dnl Remove leftover from FreeBSD xgettext call. -- rm -f messages.po -- -- dnl Search for GNU msgmerge 0.11 or newer in the PATH. -- AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, -- [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) -- -- dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. -- dnl Test whether we really found GNU msgfmt. -- if test "$GMSGFMT" != ":"; then -- dnl If it is no GNU msgfmt we define it as : so that the -- dnl Makefiles still can work. -- if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && -- (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -- : ; -- else -- GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` -- AC_MSG_RESULT( -- [found $GMSGFMT program is not GNU msgfmt; ignore it]) -- GMSGFMT=":" -- fi -- fi -- -- dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. -- dnl Test whether we really found GNU xgettext. -- if test "$XGETTEXT" != ":"; then -- dnl If it is no GNU xgettext we define it as : so that the -- dnl Makefiles still can work. -- if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && -- (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -- : ; -- else -- AC_MSG_RESULT( -- [found xgettext program is not GNU xgettext; ignore it]) -- XGETTEXT=":" -- fi -- dnl Remove leftover from FreeBSD xgettext call. -- rm -f messages.po -- fi -- -- AC_OUTPUT_COMMANDS([ -- for ac_file in $CONFIG_FILES; do -- # Support "outfile[:infile[:infile...]]" -- case "$ac_file" in -- *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; -- esac -- # PO directories have a Makefile.in generated from Makefile.in.in. -- case "$ac_file" in */Makefile.in) -- # Adjust a relative srcdir. -- ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` -- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" -- ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` -- # In autoconf-2.13 it is called $ac_given_srcdir. -- # In autoconf-2.50 it is called $srcdir. -- test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" -- case "$ac_given_srcdir" in -- .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; -- /*) top_srcdir="$ac_given_srcdir" ;; -- *) top_srcdir="$ac_dots$ac_given_srcdir" ;; -- esac -- if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then -- rm -f "$ac_dir/POTFILES" -- test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" -- cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" -- # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend -- # on $ac_dir but don't depend on user-specified configuration -- # parameters. -- if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then -- # The LINGUAS file contains the set of available languages. -- if test -n "$ALL_LINGUAS"; then -- test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" -- fi -- ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` -- # Hide the ALL_LINGUAS assigment from automake. -- eval 'ALL_LINGUAS''=$ALL_LINGUAS_' -- fi -- case "$ac_given_srcdir" in -- .) srcdirpre= ;; -- *) srcdirpre='$(srcdir)/' ;; -- esac -- POFILES= -- GMOFILES= -- UPDATEPOFILES= -- DUMMYPOFILES= -- for lang in $ALL_LINGUAS; do -- POFILES="$POFILES $srcdirpre$lang.po" -- GMOFILES="$GMOFILES $srcdirpre$lang.gmo" -- UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" -- DUMMYPOFILES="$DUMMYPOFILES $lang.nop" -- done -- # CATALOGS depends on both $ac_dir and the user's LINGUAS -- # environment variable. -- INST_LINGUAS= -- if test -n "$ALL_LINGUAS"; then -- for presentlang in $ALL_LINGUAS; do -- useit=no -- if test "%UNSET%" != "$LINGUAS"; then -- desiredlanguages="$LINGUAS" -- else -- desiredlanguages="$ALL_LINGUAS" -- fi -- for desiredlang in $desiredlanguages; do -- # Use the presentlang catalog if desiredlang is -- # a. equal to presentlang, or -- # b. a variant of presentlang (because in this case, -- # presentlang can be used as a fallback for messages -- # which are not translated in the desiredlang catalog). -- case "$desiredlang" in -- "$presentlang"*) useit=yes;; -- esac -- done -- if test $useit = yes; then -- INST_LINGUAS="$INST_LINGUAS $presentlang" -- fi -- done -- fi -- CATALOGS= -- if test -n "$INST_LINGUAS"; then -- for lang in $INST_LINGUAS; do -- CATALOGS="$CATALOGS $lang.gmo" -- done -- fi -- test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" -- sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" -- for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do -- if test -f "$f"; then -- case "$f" in -- *.orig | *.bak | *~) ;; -- *) cat "$f" >> "$ac_dir/Makefile" ;; -- esac -- fi -- done -- fi -- ;; -- esac -- done], -- [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute -- # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it -- # from automake. -- eval 'ALL_LINGUAS''="$ALL_LINGUAS"' -- # Capture the value of LINGUAS because we need it to compute CATALOGS. -- LINGUAS="${LINGUAS-%UNSET%}" -- ]) --]) -- -- --dnl Checks for all prerequisites of the intl subdirectory, --dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, --dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. --AC_DEFUN([AM_INTL_SUBDIR], --[ -- AC_REQUIRE([AC_PROG_INSTALL])dnl -- AC_REQUIRE([AM_MKINSTALLDIRS])dnl -- AC_REQUIRE([AC_PROG_CC])dnl -- AC_REQUIRE([AC_CANONICAL_HOST])dnl -- AC_REQUIRE([AC_PROG_RANLIB])dnl -- AC_REQUIRE([AC_ISC_POSIX])dnl -- AC_REQUIRE([AC_HEADER_STDC])dnl -- AC_REQUIRE([AC_C_CONST])dnl -- AC_REQUIRE([AC_C_INLINE])dnl -- AC_REQUIRE([AC_TYPE_OFF_T])dnl -- AC_REQUIRE([AC_TYPE_SIZE_T])dnl -- AC_REQUIRE([AC_FUNC_ALLOCA])dnl -- AC_REQUIRE([AC_FUNC_MMAP])dnl -- AC_REQUIRE([jm_GLIBC21])dnl -- AC_REQUIRE([gt_INTDIV0])dnl -- AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl -- AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl -- AC_REQUIRE([gt_INTTYPES_PRI])dnl -- -- AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ --stdlib.h string.h unistd.h sys/param.h]) -- AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ --geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ --strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) -- -- AM_ICONV -- AM_LANGINFO_CODESET -- if test $ac_cv_header_locale_h = yes; then -- AM_LC_MESSAGES -- fi -- -- dnl intl/plural.c is generated from intl/plural.y. It requires bison, -- dnl because plural.y uses bison specific features. It requires at least -- dnl bison-1.26 because earlier versions generate a plural.c that doesn't -- dnl compile. -- dnl bison is only needed for the maintainer (who touches plural.y). But in -- dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put -- dnl the rule in general Makefile. Now, some people carelessly touch the -- dnl files or have a broken "make" program, hence the plural.c rule will -- dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not -- dnl present or too old. -- AC_CHECK_PROGS([INTLBISON], [bison]) -- if test -z "$INTLBISON"; then -- ac_verc_fail=yes -- else -- dnl Found it, now check the version. -- AC_MSG_CHECKING([version of bison]) --changequote(<<,>>)dnl -- ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -- case $ac_prog_version in -- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; -- 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) --changequote([,])dnl -- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; -- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; -- esac -- AC_MSG_RESULT([$ac_prog_version]) -- fi -- if test $ac_verc_fail = yes; then -- INTLBISON=: -- fi --]) -- -- --AC_DEFUN([AM_MKINSTALLDIRS], --[ -- dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly -- dnl find the mkinstalldirs script in another subdir but $(top_srcdir). -- dnl Try to locate is. -- MKINSTALLDIRS= -- if test -n "$ac_aux_dir"; then -- MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" -- fi -- if test -z "$MKINSTALLDIRS"; then -- MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" -- fi -- AC_SUBST(MKINSTALLDIRS) --]) -- -- --dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) --AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) -- --# lib-prefix.m4 serial 1 (gettext-0.11) --dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -- --dnl From Bruno Haible. -- --dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed --dnl to access previously installed libraries. The basic assumption is that --dnl a user will want packages to use other packages he previously installed --dnl with the same --prefix option. --dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate --dnl libraries, but is otherwise very convenient. --AC_DEFUN([AC_LIB_PREFIX], --[ -- AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) -- AC_REQUIRE([AC_PROG_CC]) -- AC_REQUIRE([AC_CANONICAL_HOST]) -- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -- dnl By default, look in $includedir and $libdir. -- use_additional=yes -- AC_LIB_WITH_FINAL_PREFIX([ -- eval additional_includedir=\"$includedir\" -- eval additional_libdir=\"$libdir\" -- ]) -- AC_ARG_WITH([lib-prefix], --[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib -- --without-lib-prefix don't search for libraries in includedir and libdir], --[ -- if test "X$withval" = "Xno"; then -- use_additional=no -- else -- if test "X$withval" = "X"; then -- AC_LIB_WITH_FINAL_PREFIX([ -- eval additional_includedir=\"$includedir\" -- eval additional_libdir=\"$libdir\" -- ]) -- else -- additional_includedir="$withval/include" -- additional_libdir="$withval/lib" -- fi -- fi --]) -- if test $use_additional = yes; then -- dnl Potentially add $additional_includedir to $CPPFLAGS. -- dnl But don't add it -- dnl 1. if it's the standard /usr/include, -- dnl 2. if it's already present in $CPPFLAGS, -- dnl 3. if it's /usr/local/include and we are using GCC on Linux, -- dnl 4. if it doesn't exist as a directory. -- if test "X$additional_includedir" != "X/usr/include"; then -- haveit= -- for x in $CPPFLAGS; do -- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -- if test "X$x" = "X-I$additional_includedir"; then -- haveit=yes -- break -- fi -- done -- if test -z "$haveit"; then -- if test "X$additional_includedir" = "X/usr/local/include"; then -- if test -n "$GCC"; then -- case $host_os in -- linux*) haveit=yes;; -- esac -- fi -- fi -- if test -z "$haveit"; then -- if test -d "$additional_includedir"; then -- dnl Really add $additional_includedir to $CPPFLAGS. -- CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" -- fi -- fi -- fi -- fi -- dnl Potentially add $additional_libdir to $LDFLAGS. -- dnl But don't add it -- dnl 1. if it's the standard /usr/lib, -- dnl 2. if it's already present in $LDFLAGS, -- dnl 3. if it's /usr/local/lib and we are using GCC on Linux, -- dnl 4. if it doesn't exist as a directory. -- if test "X$additional_libdir" != "X/usr/lib"; then -- haveit= -- for x in $LDFLAGS; do -- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -- if test "X$x" = "X-L$additional_libdir"; then -- haveit=yes -- break -- fi -- done -- if test -z "$haveit"; then -- if test "X$additional_libdir" = "X/usr/local/lib"; then -- if test -n "$GCC"; then -- case $host_os in -- linux*) haveit=yes;; -- esac -- fi -- fi -- if test -z "$haveit"; then -- if test -d "$additional_libdir"; then -- dnl Really add $additional_libdir to $LDFLAGS. -- LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" -- fi -- fi -- fi -- fi -- fi --]) -- --dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, --dnl acl_final_exec_prefix, containing the values to which $prefix and --dnl $exec_prefix will expand at the end of the configure script. --AC_DEFUN([AC_LIB_PREPARE_PREFIX], --[ -- dnl Unfortunately, prefix and exec_prefix get only finally determined -- dnl at the end of configure. -- if test "X$prefix" = "XNONE"; then -- acl_final_prefix="$ac_default_prefix" -- else -- acl_final_prefix="$prefix" -- fi -- if test "X$exec_prefix" = "XNONE"; then -- acl_final_exec_prefix='${prefix}' -- else -- acl_final_exec_prefix="$exec_prefix" -- fi -- acl_save_prefix="$prefix" -- prefix="$acl_final_prefix" -- eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" -- prefix="$acl_save_prefix" --]) -- --dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the --dnl variables prefix and exec_prefix bound to the values they will have --dnl at the end of the configure script. --AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], --[ -- acl_save_prefix="$prefix" -- prefix="$acl_final_prefix" -- acl_save_exec_prefix="$exec_prefix" -- exec_prefix="$acl_final_exec_prefix" -- $1 -- exec_prefix="$acl_save_exec_prefix" -- prefix="$acl_save_prefix" --]) -- --# lib-link.m4 serial 3 (gettext-0.11.3) --dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -- --dnl From Bruno Haible. -- --dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and --dnl the libraries corresponding to explicit and implicit dependencies. --dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and --dnl augments the CPPFLAGS variable. --AC_DEFUN([AC_LIB_LINKFLAGS], --[ -- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -- AC_REQUIRE([AC_LIB_RPATH]) -- define([Name],[translit([$1],[./-], [___])]) -- define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -- AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ -- AC_LIB_LINKFLAGS_BODY([$1], [$2]) -- ac_cv_lib[]Name[]_libs="$LIB[]NAME" -- ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" -- ac_cv_lib[]Name[]_cppflags="$INC[]NAME" -- ]) -- LIB[]NAME="$ac_cv_lib[]Name[]_libs" -- LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" -- INC[]NAME="$ac_cv_lib[]Name[]_cppflags" -- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) -- AC_SUBST([LIB]NAME) -- AC_SUBST([LTLIB]NAME) -- dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the -- dnl results of this search when this library appears as a dependency. -- HAVE_LIB[]NAME=yes -- undefine([Name]) -- undefine([NAME]) --]) -- --dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) --dnl searches for libname and the libraries corresponding to explicit and --dnl implicit dependencies, together with the specified include files and --dnl the ability to compile and link the specified testcode. If found, it --dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and --dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and --dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs --dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. --AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], --[ -- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -- AC_REQUIRE([AC_LIB_RPATH]) -- define([Name],[translit([$1],[./-], [___])]) -- define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -- -- dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME -- dnl accordingly. -- AC_LIB_LINKFLAGS_BODY([$1], [$2]) -- -- dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, -- dnl because if the user has installed lib[]Name and not disabled its use -- dnl via --without-lib[]Name-prefix, he wants to use it. -- ac_save_CPPFLAGS="$CPPFLAGS" -- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) -- -- AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ -- ac_save_LIBS="$LIBS" -- LIBS="$LIBS $LIB[]NAME" -- AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) -- LIBS="$ac_save_LIBS" -- ]) -- if test "$ac_cv_lib[]Name" = yes; then -- HAVE_LIB[]NAME=yes -- AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) -- AC_MSG_CHECKING([how to link with lib[]$1]) -- AC_MSG_RESULT([$LIB[]NAME]) -- else -- HAVE_LIB[]NAME=no -- dnl If $LIB[]NAME didn't lead to a usable library, we don't need -- dnl $INC[]NAME either. -- CPPFLAGS="$ac_save_CPPFLAGS" -- LIB[]NAME= -- LTLIB[]NAME= -- fi -- AC_SUBST([HAVE_LIB]NAME) -- AC_SUBST([LIB]NAME) -- AC_SUBST([LTLIB]NAME) -- undefine([Name]) -- undefine([NAME]) --]) -- --dnl Determine the platform dependent parameters needed to use rpath: --dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, --dnl hardcode_direct, hardcode_minus_L, --dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. --AC_DEFUN([AC_LIB_RPATH], --[ -- AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS -- AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld -- AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host -- AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir -- AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ -- CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ -- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh -- . ./conftest.sh -- rm -f ./conftest.sh -- acl_cv_rpath=done -- ]) -- wl="$acl_cv_wl" -- libext="$acl_cv_libext" -- shlibext="$acl_cv_shlibext" -- hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" -- hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" -- hardcode_direct="$acl_cv_hardcode_direct" -- hardcode_minus_L="$acl_cv_hardcode_minus_L" -- sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" -- sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" -- dnl Determine whether the user wants rpath handling at all. -- AC_ARG_ENABLE(rpath, -- [ --disable-rpath do not hardcode runtime library paths], -- :, enable_rpath=yes) --]) -- --dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and --dnl the libraries corresponding to explicit and implicit dependencies. --dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. --AC_DEFUN([AC_LIB_LINKFLAGS_BODY], --[ -- define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -- dnl By default, look in $includedir and $libdir. -- use_additional=yes -- AC_LIB_WITH_FINAL_PREFIX([ -- eval additional_includedir=\"$includedir\" -- eval additional_libdir=\"$libdir\" -- ]) -- AC_ARG_WITH([lib$1-prefix], --[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib -- --without-lib$1-prefix don't search for lib$1 in includedir and libdir], --[ -- if test "X$withval" = "Xno"; then -- use_additional=no -- else -- if test "X$withval" = "X"; then -- AC_LIB_WITH_FINAL_PREFIX([ -- eval additional_includedir=\"$includedir\" -- eval additional_libdir=\"$libdir\" -- ]) -- else -- additional_includedir="$withval/include" -- additional_libdir="$withval/lib" -+ additional_includedir="$withval/include" -+ additional_libdir="$withval/lib" - fi - fi - ]) -@@ -5419,7 +1429,7 @@ - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in -- linux*) haveit=yes;; -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi -@@ -5468,7 +1478,7 @@ - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in -- linux*) haveit=yes;; -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi -@@ -5552,695 +1562,8143 @@ - done - fi - else -- dnl Didn't find the library; assume it is in the system directories -- dnl known to the linker and runtime loader. (All the system -- dnl directories known to the linker should also be known to the -- dnl runtime loader, otherwise the system is severely misconfigured.) -- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" -- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" -+ dnl Didn't find the library; assume it is in the system directories -+ dnl known to the linker and runtime loader. (All the system -+ dnl directories known to the linker should also be known to the -+ dnl runtime loader, otherwise the system is severely misconfigured.) -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" -+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" -+ fi -+ fi -+ fi -+ done -+ done -+ if test "X$rpathdirs" != "X"; then -+ if test -n "$hardcode_libdir_separator"; then -+ dnl Weird platform: only the last -rpath option counts, the user must -+ dnl pass all path elements in one option. We can arrange that for a -+ dnl single library, but not when more than one $LIBNAMEs are used. -+ alldirs= -+ for found_dir in $rpathdirs; do -+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" -+ done -+ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. -+ acl_save_libdir="$libdir" -+ libdir="$alldirs" -+ eval flag=\"$hardcode_libdir_flag_spec\" -+ libdir="$acl_save_libdir" -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" -+ else -+ dnl The -rpath options are cumulative. -+ for found_dir in $rpathdirs; do -+ acl_save_libdir="$libdir" -+ libdir="$found_dir" -+ eval flag=\"$hardcode_libdir_flag_spec\" -+ libdir="$acl_save_libdir" -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" -+ done -+ fi -+ fi -+ if test "X$ltrpathdirs" != "X"; then -+ dnl When using libtool, the option that works for both libraries and -+ dnl executables is -R. The -R options are cumulative. -+ for found_dir in $ltrpathdirs; do -+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" -+ done -+ fi -+]) -+ -+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -+dnl unless already present in VAR. -+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -+dnl contains two or three consecutive elements that belong together. -+AC_DEFUN([AC_LIB_APPENDTOVAR], -+[ -+ for element in [$2]; do -+ haveit= -+ for x in $[$1]; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X$element"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ [$1]="${[$1]}${[$1]:+ }$element" -+ fi -+ done -+]) -+ -+# lib-prefix.m4 serial 4 (gettext-0.14.2) -+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+ -+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -+dnl require excessive bracketing. -+ifdef([AC_HELP_STRING], -+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) -+ -+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -+dnl to access previously installed libraries. The basic assumption is that -+dnl a user will want packages to use other packages he previously installed -+dnl with the same --prefix option. -+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -+dnl libraries, but is otherwise very convenient. -+AC_DEFUN([AC_LIB_PREFIX], -+[ -+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) -+ AC_REQUIRE([AC_PROG_CC]) -+ AC_REQUIRE([AC_CANONICAL_HOST]) -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ dnl By default, look in $includedir and $libdir. -+ use_additional=yes -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) -+ AC_LIB_ARG_WITH([lib-prefix], -+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib -+ --without-lib-prefix don't search for libraries in includedir and libdir], -+[ -+ if test "X$withval" = "Xno"; then -+ use_additional=no -+ else -+ if test "X$withval" = "X"; then -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) -+ else -+ additional_includedir="$withval/include" -+ additional_libdir="$withval/lib" -+ fi -+ fi -+]) -+ if test $use_additional = yes; then -+ dnl Potentially add $additional_includedir to $CPPFLAGS. -+ dnl But don't add it -+ dnl 1. if it's the standard /usr/include, -+ dnl 2. if it's already present in $CPPFLAGS, -+ dnl 3. if it's /usr/local/include and we are using GCC on Linux, -+ dnl 4. if it doesn't exist as a directory. -+ if test "X$additional_includedir" != "X/usr/include"; then -+ haveit= -+ for x in $CPPFLAGS; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-I$additional_includedir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test "X$additional_includedir" = "X/usr/local/include"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ if test -d "$additional_includedir"; then -+ dnl Really add $additional_includedir to $CPPFLAGS. -+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" -+ fi -+ fi -+ fi -+ fi -+ dnl Potentially add $additional_libdir to $LDFLAGS. -+ dnl But don't add it -+ dnl 1. if it's the standard /usr/lib, -+ dnl 2. if it's already present in $LDFLAGS, -+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux, -+ dnl 4. if it doesn't exist as a directory. -+ if test "X$additional_libdir" != "X/usr/lib"; then -+ haveit= -+ for x in $LDFLAGS; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-L$additional_libdir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test "X$additional_libdir" = "X/usr/local/lib"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux*) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ if test -d "$additional_libdir"; then -+ dnl Really add $additional_libdir to $LDFLAGS. -+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" -+ fi -+ fi -+ fi -+ fi -+ fi -+]) -+ -+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -+dnl acl_final_exec_prefix, containing the values to which $prefix and -+dnl $exec_prefix will expand at the end of the configure script. -+AC_DEFUN([AC_LIB_PREPARE_PREFIX], -+[ -+ dnl Unfortunately, prefix and exec_prefix get only finally determined -+ dnl at the end of configure. -+ if test "X$prefix" = "XNONE"; then -+ acl_final_prefix="$ac_default_prefix" -+ else -+ acl_final_prefix="$prefix" -+ fi -+ if test "X$exec_prefix" = "XNONE"; then -+ acl_final_exec_prefix='${prefix}' -+ else -+ acl_final_exec_prefix="$exec_prefix" -+ fi -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" -+ prefix="$acl_save_prefix" -+]) -+ -+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -+dnl variables prefix and exec_prefix bound to the values they will have -+dnl at the end of the configure script. -+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -+[ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ $1 -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+]) -+ -+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -+ -+# serial 47 Debian 1.5.20-2 AC_PROG_LIBTOOL -+ -+ -+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -+# ----------------------------------------------------------- -+# If this macro is not defined by Autoconf, define it here. -+m4_ifdef([AC_PROVIDE_IFELSE], -+ [], -+ [m4_define([AC_PROVIDE_IFELSE], -+ [m4_ifdef([AC_PROVIDE_$1], -+ [$2], [$3])])]) -+ -+ -+# AC_PROG_LIBTOOL -+# --------------- -+AC_DEFUN([AC_PROG_LIBTOOL], -+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. -+ AC_PROVIDE_IFELSE([AC_PROG_CXX], -+ [AC_LIBTOOL_CXX], -+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX -+ ])]) -+dnl And a similar setup for Fortran 77 support -+ AC_PROVIDE_IFELSE([AC_PROG_F77], -+ [AC_LIBTOOL_F77], -+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -+])]) -+ -+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. -+ AC_PROVIDE_IFELSE([AC_PROG_GCJ], -+ [AC_LIBTOOL_GCJ], -+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], -+ [AC_LIBTOOL_GCJ], -+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], -+ [AC_LIBTOOL_GCJ], -+ [ifdef([AC_PROG_GCJ], -+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) -+ ifdef([A][M_PROG_GCJ], -+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) -+ ifdef([LT_AC_PROG_GCJ], -+ [define([LT_AC_PROG_GCJ], -+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -+])])# AC_PROG_LIBTOOL -+ -+ -+# _AC_PROG_LIBTOOL -+# ---------------- -+AC_DEFUN([_AC_PROG_LIBTOOL], -+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl -+ -+# This can be used to rebuild libtool when needed -+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" -+ -+# Always use our own libtool. -+LIBTOOL='$(SHELL) $(top_builddir)/libtool' -+AC_SUBST(LIBTOOL)dnl -+ -+# Prevent multiple expansion -+define([AC_PROG_LIBTOOL], []) -+])# _AC_PROG_LIBTOOL -+ -+ -+# AC_LIBTOOL_SETUP -+# ---------------- -+AC_DEFUN([AC_LIBTOOL_SETUP], -+[AC_PREREQ(2.50)dnl -+AC_REQUIRE([AC_ENABLE_SHARED])dnl -+AC_REQUIRE([AC_ENABLE_STATIC])dnl -+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -+AC_REQUIRE([AC_CANONICAL_HOST])dnl -+AC_REQUIRE([AC_CANONICAL_BUILD])dnl -+AC_REQUIRE([AC_PROG_CC])dnl -+AC_REQUIRE([AC_PROG_LD])dnl -+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -+AC_REQUIRE([AC_PROG_NM])dnl -+ -+AC_REQUIRE([AC_PROG_LN_S])dnl -+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -+AC_REQUIRE([AC_OBJEXT])dnl -+AC_REQUIRE([AC_EXEEXT])dnl -+dnl -+ -+AC_LIBTOOL_SYS_MAX_CMD_LEN -+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -+AC_LIBTOOL_OBJDIR -+ -+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -+_LT_AC_PROG_ECHO_BACKSLASH -+ -+case $host_os in -+aix3*) -+ # AIX sometimes has problems with the GCC collect2 program. For some -+ # reason, if we set the COLLECT_NAMES environment variable, the problems -+ # vanish in a puff of smoke. -+ if test "X${COLLECT_NAMES+set}" != Xset; then -+ COLLECT_NAMES= -+ export COLLECT_NAMES -+ fi -+ ;; -+esac -+ -+# Sed substitution that helps us do robust quoting. It backslashifies -+# metacharacters that are still active within double-quoted strings. -+Xsed='sed -e 1s/^X//' -+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] -+ -+# Same as above, but do not quote variable references. -+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] -+ -+# Sed substitution to delay expansion of an escaped shell variable in a -+# double_quote_subst'ed string. -+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -+ -+# Sed substitution to avoid accidental globbing in evaled expressions -+no_glob_subst='s/\*/\\\*/g' -+ -+# Constants: -+rm="rm -f" -+ -+# Global variables: -+default_ofile=libtool -+can_build_shared=yes -+ -+# All known linkers require a `.a' archive for static linking (except MSVC, -+# which needs '.lib'). -+libext=a -+ltmain="$ac_aux_dir/ltmain.sh" -+ofile="$default_ofile" -+with_gnu_ld="$lt_cv_prog_gnu_ld" -+ -+AC_CHECK_TOOL(AR, ar, false) -+AC_CHECK_TOOL(RANLIB, ranlib, :) -+AC_CHECK_TOOL(STRIP, strip, :) -+ -+old_CC="$CC" -+old_CFLAGS="$CFLAGS" -+ -+# Set sane defaults for various variables -+test -z "$AR" && AR=ar -+test -z "$AR_FLAGS" && AR_FLAGS=cru -+test -z "$AS" && AS=as -+test -z "$CC" && CC=cc -+test -z "$LTCC" && LTCC=$CC -+test -z "$DLLTOOL" && DLLTOOL=dlltool -+test -z "$LD" && LD=ld -+test -z "$LN_S" && LN_S="ln -s" -+test -z "$MAGIC_CMD" && MAGIC_CMD=file -+test -z "$NM" && NM=nm -+test -z "$SED" && SED=sed -+test -z "$OBJDUMP" && OBJDUMP=objdump -+test -z "$RANLIB" && RANLIB=: -+test -z "$STRIP" && STRIP=: -+test -z "$ac_objext" && ac_objext=o -+ -+# Determine commands to create old-style static archives. -+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -+old_postinstall_cmds='chmod 644 $oldlib' -+old_postuninstall_cmds= -+ -+if test -n "$RANLIB"; then -+ case $host_os in -+ openbsd*) -+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" -+ ;; -+ *) -+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -+ ;; -+ esac -+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -+fi -+ -+_LT_CC_BASENAME([$compiler]) -+ -+# Only perform the check for file, if the check method requires it -+case $deplibs_check_method in -+file_magic*) -+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then -+ AC_PATH_MAGIC -+ fi -+ ;; -+esac -+ -+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -+enable_win32_dll=yes, enable_win32_dll=no) -+ -+AC_ARG_ENABLE([libtool-lock], -+ [AC_HELP_STRING([--disable-libtool-lock], -+ [avoid locking (might break parallel builds)])]) -+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -+ -+AC_ARG_WITH([pic], -+ [AC_HELP_STRING([--with-pic], -+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], -+ [pic_mode="$withval"], -+ [pic_mode=default]) -+test -z "$pic_mode" && pic_mode=default -+ -+# Use C for the default configuration in the libtool script -+tagname= -+AC_LIBTOOL_LANG_C_CONFIG -+_LT_AC_TAGCONFIG -+])# AC_LIBTOOL_SETUP -+ -+ -+# _LT_AC_SYS_COMPILER -+# ------------------- -+AC_DEFUN([_LT_AC_SYS_COMPILER], -+[AC_REQUIRE([AC_PROG_CC])dnl -+ -+# If no C compiler was specified, use CC. -+LTCC=${LTCC-"$CC"} -+ -+# Allow CC to be a program name with arguments. -+compiler=$CC -+])# _LT_AC_SYS_COMPILER -+ -+ -+# _LT_CC_BASENAME(CC) -+# ------------------- -+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -+AC_DEFUN([_LT_CC_BASENAME], -+[for cc_temp in $1""; do -+ case $cc_temp in -+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; -+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+]) -+ -+ -+# _LT_COMPILER_BOILERPLATE -+# ------------------------ -+# Check for compiler boilerplate output or warnings with -+# the simple compiler test code. -+AC_DEFUN([_LT_COMPILER_BOILERPLATE], -+[ac_outfile=conftest.$ac_objext -+printf "$lt_simple_compile_test_code" >conftest.$ac_ext -+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_compiler_boilerplate=`cat conftest.err` -+$rm conftest* -+])# _LT_COMPILER_BOILERPLATE -+ -+ -+# _LT_LINKER_BOILERPLATE -+# ---------------------- -+# Check for linker boilerplate output or warnings with -+# the simple link test code. -+AC_DEFUN([_LT_LINKER_BOILERPLATE], -+[ac_outfile=conftest.$ac_objext -+printf "$lt_simple_link_test_code" >conftest.$ac_ext -+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_linker_boilerplate=`cat conftest.err` -+$rm conftest* -+])# _LT_LINKER_BOILERPLATE -+ -+ -+# _LT_AC_SYS_LIBPATH_AIX -+# ---------------------- -+# Links a minimal program and checks the executable -+# for the system default hardcoded library path. In most cases, -+# this is /usr/lib:/lib, but when the MPI compilers are used -+# the location of the communication and MPI libs are included too. -+# If we don't find anything, use the default library path according -+# to the aix ld manual. -+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi],[]) -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+])# _LT_AC_SYS_LIBPATH_AIX -+ -+ -+# _LT_AC_SHELL_INIT(ARG) -+# ---------------------- -+AC_DEFUN([_LT_AC_SHELL_INIT], -+[ifdef([AC_DIVERSION_NOTICE], -+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], -+ [AC_DIVERT_PUSH(NOTICE)]) -+$1 -+AC_DIVERT_POP -+])# _LT_AC_SHELL_INIT -+ -+ -+# _LT_AC_PROG_ECHO_BACKSLASH -+# -------------------------- -+# Add some code to the start of the generated configure script which -+# will find an echo command which doesn't interpret backslashes. -+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -+[_LT_AC_SHELL_INIT([ -+# Check that we are running under the correct shell. -+SHELL=${CONFIG_SHELL-/bin/sh} -+ -+case X$ECHO in -+X*--fallback-echo) -+ # Remove one level of quotation (which was required for Make). -+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` -+ ;; -+esac -+ -+echo=${ECHO-echo} -+if test "X[$]1" = X--no-reexec; then -+ # Discard the --no-reexec flag, and continue. -+ shift -+elif test "X[$]1" = X--fallback-echo; then -+ # Avoid inline document here, it may be left over -+ : -+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then -+ # Yippee, $echo works! -+ : -+else -+ # Restart under the correct shell. -+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -+fi -+ -+if test "X[$]1" = X--fallback-echo; then -+ # used as fallback echo -+ shift -+ cat </dev/null 2>&1 && unset CDPATH -+ -+if test -z "$ECHO"; then -+if test "X${echo_test_string+set}" != Xset; then -+# find a string as large as possible, as long as the shell can cope with it -+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do -+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... -+ if (echo_test_string=`eval $cmd`) 2>/dev/null && -+ echo_test_string=`eval $cmd` && -+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null -+ then -+ break -+ fi -+ done -+fi -+ -+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ : -+else -+ # The Solaris, AIX, and Digital Unix default echo programs unquote -+ # backslashes. This makes it impossible to quote backslashes using -+ # echo "$something" | sed 's/\\/\\\\/g' -+ # -+ # So, first we look for a working echo in the user's PATH. -+ -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ for dir in $PATH /usr/ucb; do -+ IFS="$lt_save_ifs" -+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && -+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ echo="$dir/echo" -+ break -+ fi -+ done -+ IFS="$lt_save_ifs" -+ -+ if test "X$echo" = Xecho; then -+ # We didn't find a better echo, so look for alternatives. -+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ # This shell has a builtin print -r that does the trick. -+ echo='print -r' -+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && -+ test "X$CONFIG_SHELL" != X/bin/ksh; then -+ # If we have ksh, try running configure again with it. -+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -+ export ORIGINAL_CONFIG_SHELL -+ CONFIG_SHELL=/bin/ksh -+ export CONFIG_SHELL -+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} -+ else -+ # Try using printf. -+ echo='printf %s\n' -+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ # Cool, printf works -+ : -+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && -+ test "X$echo_testing_string" = 'X\t' && -+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL -+ export CONFIG_SHELL -+ SHELL="$CONFIG_SHELL" -+ export SHELL -+ echo="$CONFIG_SHELL [$]0 --fallback-echo" -+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && -+ test "X$echo_testing_string" = 'X\t' && -+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ echo="$CONFIG_SHELL [$]0 --fallback-echo" -+ else -+ # maybe with a smaller string... -+ prev=: -+ -+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do -+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null -+ then -+ break -+ fi -+ prev="$cmd" -+ done -+ -+ if test "$prev" != 'sed 50q "[$]0"'; then -+ echo_test_string=`eval $prev` -+ export echo_test_string -+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} -+ else -+ # Oops. We lost completely, so just stick with echo. -+ echo=echo -+ fi -+ fi -+ fi -+ fi -+fi -+fi -+ -+# Copy echo and quote the copy suitably for passing to libtool from -+# the Makefile, instead of quoting the original, which is used later. -+ECHO=$echo -+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then -+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -+fi -+ -+AC_SUBST(ECHO) -+])])# _LT_AC_PROG_ECHO_BACKSLASH -+ -+ -+# _LT_AC_LOCK -+# ----------- -+AC_DEFUN([_LT_AC_LOCK], -+[AC_ARG_ENABLE([libtool-lock], -+ [AC_HELP_STRING([--disable-libtool-lock], -+ [avoid locking (might break parallel builds)])]) -+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -+ -+# Some flags need to be propagated to the compiler or linker for good -+# libtool support. -+case $host in -+ia64-*-hpux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+ if AC_TRY_EVAL(ac_compile); then -+ case `/usr/bin/file conftest.$ac_objext` in -+ *ELF-32*) -+ HPUX_IA64_MODE="32" -+ ;; -+ *ELF-64*) -+ HPUX_IA64_MODE="64" -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; -+*-*-irix6*) -+ # Find out which ABI we are using. -+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext -+ if AC_TRY_EVAL(ac_compile); then -+ if test "$lt_cv_prog_gnu_ld" = yes; then -+ case `/usr/bin/file conftest.$ac_objext` in -+ *32-bit*) -+ LD="${LD-ld} -melf32bsmip" -+ ;; -+ *N32*) -+ LD="${LD-ld} -melf32bmipn32" -+ ;; -+ *64-bit*) -+ LD="${LD-ld} -melf64bmip" -+ ;; -+ esac -+ else -+ case `/usr/bin/file conftest.$ac_objext` in -+ *32-bit*) -+ LD="${LD-ld} -32" -+ ;; -+ *N32*) -+ LD="${LD-ld} -n32" -+ ;; -+ *64-bit*) -+ LD="${LD-ld} -64" -+ ;; -+ esac -+ fi -+ fi -+ rm -rf conftest* -+ ;; -+ -+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+ if AC_TRY_EVAL(ac_compile); then -+ case `/usr/bin/file conftest.o` in -+ *32-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ ppc64-*linux*|powerpc64-*linux*) -+ LD="${LD-ld} -m elf32ppclinux" -+ ;; -+ s390x-*linux*) -+ LD="${LD-ld} -m elf_s390" -+ ;; -+ sparc64-*linux*) -+ LD="${LD-ld} -m elf32_sparc" -+ ;; -+ esac -+ ;; -+ *64-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_x86_64" -+ ;; -+ ppc*-*linux*|powerpc*-*linux*) -+ LD="${LD-ld} -m elf64ppc" -+ ;; -+ s390*-*linux*) -+ LD="${LD-ld} -m elf64_s390" -+ ;; -+ sparc*-*linux*) -+ LD="${LD-ld} -m elf64_sparc" -+ ;; -+ esac -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; -+ -+*-*-sco3.2v5*) -+ # On SCO OpenServer 5, we need -belf to get full-featured binaries. -+ SAVE_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -belf" -+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, -+ [AC_LANG_PUSH(C) -+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) -+ AC_LANG_POP]) -+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then -+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf -+ CFLAGS="$SAVE_CFLAGS" -+ fi -+ ;; -+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -+[*-*-cygwin* | *-*-mingw* | *-*-pw32*) -+ AC_CHECK_TOOL(DLLTOOL, dlltool, false) -+ AC_CHECK_TOOL(AS, as, false) -+ AC_CHECK_TOOL(OBJDUMP, objdump, false) -+ ;; -+ ]) -+esac -+ -+need_locks="$enable_libtool_lock" -+ -+])# _LT_AC_LOCK -+ -+ -+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -+# ---------------------------------------------------------------- -+# Check whether the given compiler option works -+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -+[AC_REQUIRE([LT_AC_PROG_SED]) -+AC_CACHE_CHECK([$1], [$2], -+ [$2=no -+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ lt_compiler_flag="$3" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ # The option is referenced via a variable to avoid confusing sed. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) -+ (eval "$lt_compile" 2>conftest.err) -+ ac_status=$? -+ cat conftest.err >&AS_MESSAGE_LOG_FD -+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD -+ if (exit $ac_status) && test -s "$ac_outfile"; then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings other than the usual output. -+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then -+ $2=yes -+ fi -+ fi -+ $rm conftest* -+]) -+ -+if test x"[$]$2" = xyes; then -+ ifelse([$5], , :, [$5]) -+else -+ ifelse([$6], , :, [$6]) -+fi -+])# AC_LIBTOOL_COMPILER_OPTION -+ -+ -+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -+# [ACTION-SUCCESS], [ACTION-FAILURE]) -+# ------------------------------------------------------------ -+# Check whether the given compiler option works -+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -+[AC_CACHE_CHECK([$1], [$2], -+ [$2=no -+ save_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS $3" -+ printf "$lt_simple_link_test_code" > conftest.$ac_ext -+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then -+ # The linker can only warn and ignore the option if not recognized -+ # So say no if there are warnings -+ if test -s conftest.err; then -+ # Append any errors to the config.log. -+ cat conftest.err 1>&AS_MESSAGE_LOG_FD -+ $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if diff conftest.exp conftest.er2 >/dev/null; then -+ $2=yes -+ fi -+ else -+ $2=yes -+ fi -+ fi -+ $rm conftest* -+ LDFLAGS="$save_LDFLAGS" -+]) -+ -+if test x"[$]$2" = xyes; then -+ ifelse([$4], , :, [$4]) -+else -+ ifelse([$5], , :, [$5]) -+fi -+])# AC_LIBTOOL_LINKER_OPTION -+ -+ -+# AC_LIBTOOL_SYS_MAX_CMD_LEN -+# -------------------------- -+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -+[# find the maximum length of command line arguments -+AC_MSG_CHECKING([the maximum length of command line arguments]) -+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl -+ i=0 -+ teststring="ABCD" -+ -+ case $build_os in -+ msdosdjgpp*) -+ # On DJGPP, this test can blow up pretty badly due to problems in libc -+ # (any single argument exceeding 2000 bytes causes a buffer overrun -+ # during glob expansion). Even if it were fixed, the result of this -+ # check would be larger than it should be. -+ lt_cv_sys_max_cmd_len=12288; # 12K is about right -+ ;; -+ -+ gnu*) -+ # Under GNU Hurd, this test is not required because there is -+ # no limit to the length of command line arguments. -+ # Libtool will interpret -1 as no limit whatsoever -+ lt_cv_sys_max_cmd_len=-1; -+ ;; -+ -+ cygwin* | mingw*) -+ # On Win9x/ME, this test blows up -- it succeeds, but takes -+ # about 5 minutes as the teststring grows exponentially. -+ # Worse, since 9x/ME are not pre-emptively multitasking, -+ # you end up with a "frozen" computer, even though with patience -+ # the test eventually succeeds (with a max line length of 256k). -+ # Instead, let's just punt: use the minimum linelength reported by -+ # all of the supported platforms: 8192 (on NT/2K/XP). -+ lt_cv_sys_max_cmd_len=8192; -+ ;; -+ -+ amigaos*) -+ # On AmigaOS with pdksh, this test takes hours, literally. -+ # So we just punt and use a minimum line length of 8192. -+ lt_cv_sys_max_cmd_len=8192; -+ ;; -+ -+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) -+ # This has been around since 386BSD, at least. Likely further. -+ if test -x /sbin/sysctl; then -+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` -+ elif test -x /usr/sbin/sysctl; then -+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` -+ else -+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs -+ fi -+ # And add a safety zone -+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` -+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` -+ ;; -+ osf*) -+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure -+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not -+ # nice to cause kernel panics so lets avoid the loop below. -+ # First set a reasonable default. -+ lt_cv_sys_max_cmd_len=16384 -+ # -+ if test -x /sbin/sysconfig; then -+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in -+ *1*) lt_cv_sys_max_cmd_len=-1 ;; -+ esac -+ fi -+ ;; -+ *) -+ # If test is not a shell built-in, we'll probably end up computing a -+ # maximum length that is only half of the actual maximum length, but -+ # we can't tell. -+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} -+ while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ -+ = "XX$teststring") >/dev/null 2>&1 && -+ new_result=`expr "X$teststring" : ".*" 2>&1` && -+ lt_cv_sys_max_cmd_len=$new_result && -+ test $i != 17 # 1/2 MB should be enough -+ do -+ i=`expr $i + 1` -+ teststring=$teststring$teststring -+ done -+ teststring= -+ # Add a significant safety factor because C++ compilers can tack on massive -+ # amounts of additional arguments before passing them to the linker. -+ # It appears as though 1/2 is a usable value. -+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` -+ ;; -+ esac -+]) -+if test -n $lt_cv_sys_max_cmd_len ; then -+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -+else -+ AC_MSG_RESULT(none) -+fi -+])# AC_LIBTOOL_SYS_MAX_CMD_LEN -+ -+ -+# _LT_AC_CHECK_DLFCN -+# -------------------- -+AC_DEFUN([_LT_AC_CHECK_DLFCN], -+[AC_CHECK_HEADERS(dlfcn.h)dnl -+])# _LT_AC_CHECK_DLFCN -+ -+ -+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -+# ------------------------------------------------------------------ -+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -+if test "$cross_compiling" = yes; then : -+ [$4] -+else -+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -+ lt_status=$lt_dlunknown -+ cat > conftest.$ac_ext < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LT_DLGLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LT_DLGLOBAL DL_GLOBAL -+# else -+# define LT_DLGLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LT_DLLAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LT_DLLAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LT_DLLAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LT_DLLAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LT_DLLAZY_OR_NOW DL_NOW -+# else -+# define LT_DLLAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+#ifdef __cplusplus -+extern "C" void exit (int); -+#endif -+ -+void fnord() { int i=42;} -+int main () -+{ -+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -+ int status = $lt_dlunknown; -+ -+ if (self) -+ { -+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -+ /* dlclose (self); */ -+ } -+ -+ exit (status); -+}] -+EOF -+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then -+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null -+ lt_status=$? -+ case x$lt_status in -+ x$lt_dlno_uscore) $1 ;; -+ x$lt_dlneed_uscore) $2 ;; -+ x$lt_unknown|x*) $3 ;; -+ esac -+ else : -+ # compilation failed -+ $3 -+ fi -+fi -+rm -fr conftest* -+])# _LT_AC_TRY_DLOPEN_SELF -+ -+ -+# AC_LIBTOOL_DLOPEN_SELF -+# ------------------- -+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -+if test "x$enable_dlopen" != xyes; then -+ enable_dlopen=unknown -+ enable_dlopen_self=unknown -+ enable_dlopen_self_static=unknown -+else -+ lt_cv_dlopen=no -+ lt_cv_dlopen_libs= -+ -+ case $host_os in -+ beos*) -+ lt_cv_dlopen="load_add_on" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ ;; -+ -+ mingw* | pw32*) -+ lt_cv_dlopen="LoadLibrary" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ cygwin*) -+ lt_cv_dlopen="dlopen" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ darwin*) -+ # if libdl is installed we need to link against it -+ AC_CHECK_LIB([dl], [dlopen], -+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ -+ lt_cv_dlopen="dyld" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ ]) -+ ;; -+ -+ *) -+ AC_CHECK_FUNC([shl_load], -+ [lt_cv_dlopen="shl_load"], -+ [AC_CHECK_LIB([dld], [shl_load], -+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], -+ [AC_CHECK_FUNC([dlopen], -+ [lt_cv_dlopen="dlopen"], -+ [AC_CHECK_LIB([dl], [dlopen], -+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], -+ [AC_CHECK_LIB([svld], [dlopen], -+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], -+ [AC_CHECK_LIB([dld], [dld_link], -+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) -+ ]) -+ ]) -+ ]) -+ ]) -+ ]) -+ ;; -+ esac -+ -+ if test "x$lt_cv_dlopen" != xno; then -+ enable_dlopen=yes -+ else -+ enable_dlopen=no -+ fi -+ -+ case $lt_cv_dlopen in -+ dlopen) -+ save_CPPFLAGS="$CPPFLAGS" -+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -+ -+ save_LDFLAGS="$LDFLAGS" -+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -+ -+ save_LIBS="$LIBS" -+ LIBS="$lt_cv_dlopen_libs $LIBS" -+ -+ AC_CACHE_CHECK([whether a program can dlopen itself], -+ lt_cv_dlopen_self, [dnl -+ _LT_AC_TRY_DLOPEN_SELF( -+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, -+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) -+ ]) -+ -+ if test "x$lt_cv_dlopen_self" = xyes; then -+ LDFLAGS="$LDFLAGS $link_static_flag" -+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself], -+ lt_cv_dlopen_self_static, [dnl -+ _LT_AC_TRY_DLOPEN_SELF( -+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, -+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) -+ ]) -+ fi -+ -+ CPPFLAGS="$save_CPPFLAGS" -+ LDFLAGS="$save_LDFLAGS" -+ LIBS="$save_LIBS" -+ ;; -+ esac -+ -+ case $lt_cv_dlopen_self in -+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; -+ *) enable_dlopen_self=unknown ;; -+ esac -+ -+ case $lt_cv_dlopen_self_static in -+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; -+ *) enable_dlopen_self_static=unknown ;; -+ esac -+fi -+])# AC_LIBTOOL_DLOPEN_SELF -+ -+ -+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -+# --------------------------------- -+# Check to see if options -c and -o are simultaneously supported by compiler -+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], -+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no -+ $rm -r conftest 2>/dev/null -+ mkdir conftest -+ cd conftest -+ mkdir out -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ lt_compiler_flag="-o out/conftest2.$ac_objext" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) -+ (eval "$lt_compile" 2>out/conftest.err) -+ ac_status=$? -+ cat out/conftest.err >&AS_MESSAGE_LOG_FD -+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD -+ if (exit $ac_status) && test -s out/conftest2.$ac_objext -+ then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings -+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp -+ $SED '/^$/d' out/conftest.err >out/conftest.er2 -+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then -+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes -+ fi -+ fi -+ chmod u+w . 2>&AS_MESSAGE_LOG_FD -+ $rm conftest* -+ # SGI C++ compiler will create directory out/ii_files/ for -+ # template instantiation -+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files -+ $rm out/* && rmdir out -+ cd .. -+ rmdir conftest -+ $rm conftest* -+]) -+])# AC_LIBTOOL_PROG_CC_C_O -+ -+ -+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -+# ----------------------------------------- -+# Check to see if we can do hard links to lock some files if needed -+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -+[AC_REQUIRE([_LT_AC_LOCK])dnl -+ -+hard_links="nottested" -+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then -+ # do not overwrite the value of need_locks provided by the user -+ AC_MSG_CHECKING([if we can lock with hard links]) -+ hard_links=yes -+ $rm conftest* -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ touch conftest.a -+ ln conftest.a conftest.b 2>&5 || hard_links=no -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ AC_MSG_RESULT([$hard_links]) -+ if test "$hard_links" = no; then -+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) -+ need_locks=warn -+ fi -+else -+ need_locks=no -+fi -+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS -+ -+ -+# AC_LIBTOOL_OBJDIR -+# ----------------- -+AC_DEFUN([AC_LIBTOOL_OBJDIR], -+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -+[rm -f .libs 2>/dev/null -+mkdir .libs 2>/dev/null -+if test -d .libs; then -+ lt_cv_objdir=.libs -+else -+ # MS-DOS does not allow filenames that begin with a dot. -+ lt_cv_objdir=_libs -+fi -+rmdir .libs 2>/dev/null]) -+objdir=$lt_cv_objdir -+])# AC_LIBTOOL_OBJDIR -+ -+ -+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -+# ---------------------------------------------- -+# Check hardcoding attributes. -+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -+[AC_MSG_CHECKING([how to hardcode library paths into programs]) -+_LT_AC_TAGVAR(hardcode_action, $1)= -+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ -+ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ -+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then -+ -+ # We can hardcode non-existant directories. -+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && -+ # If the only mechanism to avoid hardcoding is shlibpath_var, we -+ # have to relink, otherwise we might link with an installed library -+ # when we should be linking with a yet-to-be-installed one -+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && -+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then -+ # Linking always hardcodes the temporary library directory. -+ _LT_AC_TAGVAR(hardcode_action, $1)=relink -+ else -+ # We can link without hardcoding, and we can hardcode nonexisting dirs. -+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate -+ fi -+else -+ # We cannot hardcode anything, or else we can only hardcode existing -+ # directories. -+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -+fi -+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) -+ -+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then -+ # Fast installation is not supported -+ enable_fast_install=no -+elif test "$shlibpath_overrides_runpath" = yes || -+ test "$enable_shared" = no; then -+ # Fast installation is not necessary -+ enable_fast_install=needless -+fi -+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH -+ -+ -+# AC_LIBTOOL_SYS_LIB_STRIP -+# ------------------------ -+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -+[striplib= -+old_striplib= -+AC_MSG_CHECKING([whether stripping libraries is possible]) -+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then -+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -+ test -z "$striplib" && striplib="$STRIP --strip-unneeded" -+ AC_MSG_RESULT([yes]) -+else -+# FIXME - insert some real tests, host_os isn't really good enough -+ case $host_os in -+ darwin*) -+ if test -n "$STRIP" ; then -+ striplib="$STRIP -x" -+ AC_MSG_RESULT([yes]) -+ else -+ AC_MSG_RESULT([no]) -+fi -+ ;; -+ *) -+ AC_MSG_RESULT([no]) -+ ;; -+ esac -+fi -+])# AC_LIBTOOL_SYS_LIB_STRIP -+ -+ -+# AC_LIBTOOL_SYS_DYNAMIC_LINKER -+# ----------------------------- -+# PORTME Fill in your ld.so characteristics -+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -+[AC_MSG_CHECKING([dynamic linker characteristics]) -+library_names_spec= -+libname_spec='lib$name' -+soname_spec= -+shrext_cmds=".so" -+postinstall_cmds= -+postuninstall_cmds= -+finish_cmds= -+finish_eval= -+shlibpath_var= -+shlibpath_overrides_runpath=unknown -+version_type=none -+dynamic_linker="$host_os ld.so" -+sys_lib_dlsearch_path_spec="/lib /usr/lib" -+if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -+ # if the path contains ";" then we assume it to be the separator -+ # otherwise default to the standard path separator (i.e. ":") - it is -+ # assumed that no part of a normal pathname contains ";" but that should -+ # okay in the real world where ";" in dirpaths is itself problematic. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+else -+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -+fi -+need_lib_prefix=unknown -+hardcode_into_libs=no -+ -+# when you set need_version to no, make sure it does not cause -set_version -+# flags to be left without arguments -+need_version=unknown -+ -+case $host_os in -+aix3*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' -+ shlibpath_var=LIBPATH -+ -+ # AIX 3 has no versioning support, so we append a major version to the name. -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ -+aix4* | aix5*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ hardcode_into_libs=yes -+ if test "$host_cpu" = ia64; then -+ # AIX 5 supports IA64 -+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ else -+ # With GCC up to 2.95.x, collect2 would create an import file -+ # for dependence libraries. The import file would start with -+ # the line `#! .'. This would cause the generated library to -+ # depend on `.', always an invalid library. This was fixed in -+ # development snapshots of GCC prior to 3.0. -+ case $host_os in -+ aix4 | aix4.[[01]] | aix4.[[01]].*) -+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' -+ echo ' yes ' -+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then -+ : -+ else -+ can_build_shared=no -+ fi -+ ;; -+ esac -+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct -+ # soname into executable. Probably we can add versioning support to -+ # collect2, so additional links can be useful in future. -+ if test "$aix_use_runtimelinking" = yes; then -+ # If using run time linking (on AIX 4.2 or later) use lib.so -+ # instead of lib.a to let people know that these are not -+ # typical AIX shared libraries. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ else -+ # We preserve .a as extension for shared libraries through AIX4.2 -+ # and later when we are not doing run time linking. -+ library_names_spec='${libname}${release}.a $libname.a' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ fi -+ shlibpath_var=LIBPATH -+ fi -+ ;; -+ -+amigaos*) -+ library_names_spec='$libname.ixlibrary $libname.a' -+ # Create ${libname}_ixlibrary.a entries in /sys/libs. -+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' -+ ;; -+ -+beos*) -+ library_names_spec='${libname}${shared_ext}' -+ dynamic_linker="$host_os ld.so" -+ shlibpath_var=LIBRARY_PATH -+ ;; -+ -+bsdi[[45]]*) -+ version_type=linux -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -+ # the default ld.so.conf also contains /usr/contrib/lib and -+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -+ # libtool to hard-code these into programs -+ ;; -+ -+cygwin* | mingw* | pw32*) -+ version_type=windows -+ shrext_cmds=".dll" -+ need_version=no -+ need_lib_prefix=no -+ -+ case $GCC,$host_os in -+ yes,cygwin* | yes,mingw* | yes,pw32*) -+ library_names_spec='$libname.dll.a' -+ # DLL is installed to $(libdir)/../bin by postinstall_cmds -+ postinstall_cmds='base_file=`basename \${file}`~ -+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ -+ dldir=$destdir/`dirname \$dlpath`~ -+ test -d \$dldir || mkdir -p \$dldir~ -+ $install_prog $dir/$dlname \$dldir/$dlname~ -+ chmod a+x \$dldir/$dlname' -+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ -+ dlpath=$dir/\$dldll~ -+ $rm \$dlpath' -+ shlibpath_overrides_runpath=yes -+ -+ case $host_os in -+ cygwin*) -+ # Cygwin DLLs use 'cyg' prefix rather than 'lib' -+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" -+ ;; -+ mingw*) -+ # MinGW DLLs use traditional 'lib' prefix -+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then -+ # It is most probably a Windows format PATH printed by -+ # mingw gcc, but we are running on Cygwin. Gcc prints its search -+ # path with ; separators, and with drive letters. We can handle the -+ # drive letters (cygwin fileutils understands them), so leave them, -+ # especially as we might pass files found there to a mingw objdump, -+ # which wouldn't understand a cygwinified path. Ahh. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+ ;; -+ pw32*) -+ # pw32 DLLs use 'pw' prefix rather than 'lib' -+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -+ ;; -+ esac -+ ;; -+ -+ *) -+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' -+ ;; -+ esac -+ dynamic_linker='Win32 ld.exe' -+ # FIXME: first we should search . and the directory the executable is in -+ shlibpath_var=PATH -+ ;; -+ -+darwin* | rhapsody*) -+ dynamic_linker="$host_os dyld" -+ version_type=darwin -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' -+ soname_spec='${libname}${release}${major}$shared_ext' -+ shlibpath_overrides_runpath=yes -+ shlibpath_var=DYLD_LIBRARY_PATH -+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. -+ if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` -+ else -+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' -+ fi -+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' -+ ;; -+ -+dgux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+freebsd1*) -+ dynamic_linker=no -+ ;; -+ -+kfreebsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+freebsd* | dragonfly*) -+ # DragonFly does not have aout. When/if they implement a new -+ # versioning mechanism, adjust this. -+ if test -x /usr/bin/objformat; then -+ objformat=`/usr/bin/objformat` -+ else -+ case $host_os in -+ freebsd[[123]]*) objformat=aout ;; -+ *) objformat=elf ;; -+ esac -+ fi -+ version_type=freebsd-$objformat -+ case $version_type in -+ freebsd-elf*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' -+ need_version=no -+ need_lib_prefix=no -+ ;; -+ freebsd-*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' -+ need_version=yes -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_os in -+ freebsd2*) -+ shlibpath_overrides_runpath=yes -+ ;; -+ freebsd3.[[01]]* | freebsdelf3.[[01]]*) -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ *) # from 3.2 on -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ ;; -+ esac -+ ;; -+ -+gnu*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ hardcode_into_libs=yes -+ ;; -+ -+hpux9* | hpux10* | hpux11*) -+ # Give a soname corresponding to the major version so that dld.sl refuses to -+ # link against other versions. -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ case $host_cpu in -+ ia64*) -+ shrext_cmds='.so' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.so" -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ if test "X$HPUX_IA64_MODE" = X32; then -+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" -+ else -+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" -+ fi -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ hppa*64*) -+ shrext_cmds='.sl' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ *) -+ shrext_cmds='.sl' -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=SHLIB_PATH -+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ esac -+ # HP-UX runs *really* slowly unless shared libraries are mode 555. -+ postinstall_cmds='chmod 555 $lib' -+ ;; -+ -+irix5* | irix6* | nonstopux*) -+ case $host_os in -+ nonstopux*) version_type=nonstopux ;; -+ *) -+ if test "$lt_cv_prog_gnu_ld" = yes; then -+ version_type=linux -+ else -+ version_type=irix -+ fi ;; -+ esac -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' -+ case $host_os in -+ irix5* | nonstopux*) -+ libsuff= shlibsuff= -+ ;; -+ *) -+ case $LD in # libtool.m4 will add one of these switches to LD -+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") -+ libsuff= shlibsuff= libmagic=32-bit;; -+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") -+ libsuff=32 shlibsuff=N32 libmagic=N32;; -+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") -+ libsuff=64 shlibsuff=64 libmagic=64-bit;; -+ *) libsuff= shlibsuff= libmagic=never-match;; -+ esac -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -+ hardcode_into_libs=yes -+ ;; -+ -+# No shared lib support for Linux oldld, aout, or coff. -+linux*oldld* | linux*aout* | linux*coff*) -+ dynamic_linker=no -+ ;; -+ -+# This must be Linux ELF. -+linux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ # This implies no fast_install, which is unacceptable. -+ # Some rework will be needed to allow for fast_install -+ # before this can be enabled. -+ hardcode_into_libs=yes -+ -+ # Append ld.so.conf contents to the search path -+ if test -f /etc/ld.so.conf; then -+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -+ fi -+ -+ # We used to test for /lib/ld.so.1 and disable shared libraries on -+ # powerpc, because MkLinux only supported shared libraries with the -+ # GNU dynamic linker. Since this was broken with cross compilers, -+ # most powerpc-linux boxes support dynamic linking these days and -+ # people can always --disable-shared, the test was removed, and we -+ # assume the GNU/Linux dynamic linker is in use. -+ dynamic_linker='GNU/Linux ld.so' -+ ;; -+ -+netbsdelf*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='NetBSD ld.elf_so' -+ ;; -+ -+knetbsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+netbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ dynamic_linker='NetBSD (a.out) ld.so' -+ else -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ dynamic_linker='NetBSD ld.elf_so' -+ fi -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ -+newsos6) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+nto-qnx*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+openbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. -+ case $host_os in -+ openbsd3.3 | openbsd3.3.*) need_version=yes ;; -+ *) need_version=no ;; -+ esac -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ case $host_os in -+ openbsd2.[[89]] | openbsd2.[[89]].*) -+ shlibpath_overrides_runpath=no -+ ;; -+ *) -+ shlibpath_overrides_runpath=yes -+ ;; -+ esac -+ else -+ shlibpath_overrides_runpath=yes -+ fi -+ ;; -+ -+os2*) -+ libname_spec='$name' -+ shrext_cmds=".dll" -+ need_lib_prefix=no -+ library_names_spec='$libname${shared_ext} $libname.a' -+ dynamic_linker='OS/2 ld.exe' -+ shlibpath_var=LIBPATH -+ ;; -+ -+osf3* | osf4* | osf5*) -+ version_type=osf -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -+ ;; -+ -+sco3.2v5*) -+ version_type=osf -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+solaris*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ # ldd complains unless libraries are executable -+ postinstall_cmds='chmod +x $lib' -+ ;; -+ -+sunos4*) -+ version_type=sunos -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ if test "$with_gnu_ld" = yes; then -+ need_lib_prefix=no -+ fi -+ need_version=yes -+ ;; -+ -+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_vendor in -+ sni) -+ shlibpath_overrides_runpath=no -+ need_lib_prefix=no -+ export_dynamic_flag_spec='${wl}-Blargedynsym' -+ runpath_var=LD_RUN_PATH -+ ;; -+ siemens) -+ need_lib_prefix=no -+ ;; -+ motorola) -+ need_lib_prefix=no -+ need_version=no -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -+ ;; -+ esac -+ ;; -+ -+sysv4*MP*) -+ if test -d /usr/nec ;then -+ version_type=linux -+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' -+ soname_spec='$libname${shared_ext}.$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ fi -+ ;; -+ -+uts4*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+*) -+ dynamic_linker=no -+ ;; -+esac -+AC_MSG_RESULT([$dynamic_linker]) -+test "$dynamic_linker" = no && can_build_shared=no -+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER -+ -+ -+# _LT_AC_TAGCONFIG -+# ---------------- -+AC_DEFUN([_LT_AC_TAGCONFIG], -+[AC_ARG_WITH([tags], -+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], -+ [include additional configurations @<:@automatic@:>@])], -+ [tagnames="$withval"]) -+ -+if test -f "$ltmain" && test -n "$tagnames"; then -+ if test ! -f "${ofile}"; then -+ AC_MSG_WARN([output file `$ofile' does not exist]) -+ fi -+ -+ if test -z "$LTCC"; then -+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`" -+ if test -z "$LTCC"; then -+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) -+ else -+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) -+ fi -+ fi -+ -+ # Extract list of available tagged configurations in $ofile. -+ # Note that this assumes the entire list is on one line. -+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` -+ -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for tagname in $tagnames; do -+ IFS="$lt_save_ifs" -+ # Check whether tagname contains only valid characters -+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in -+ "") ;; -+ *) AC_MSG_ERROR([invalid tag name: $tagname]) -+ ;; -+ esac -+ -+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null -+ then -+ AC_MSG_ERROR([tag name \"$tagname\" already exists]) -+ fi -+ -+ # Update the list of available tags. -+ if test -n "$tagname"; then -+ echo appending configuration tag \"$tagname\" to $ofile -+ -+ case $tagname in -+ CXX) -+ if test -n "$CXX" && ( test "X$CXX" != "Xno" && -+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || -+ (test "X$CXX" != "Xg++"))) ; then -+ AC_LIBTOOL_LANG_CXX_CONFIG -+ else -+ tagname="" -+ fi -+ ;; -+ -+ F77) -+ if test -n "$F77" && test "X$F77" != "Xno"; then -+ AC_LIBTOOL_LANG_F77_CONFIG -+ else -+ tagname="" -+ fi -+ ;; -+ -+ GCJ) -+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then -+ AC_LIBTOOL_LANG_GCJ_CONFIG -+ else -+ tagname="" -+ fi -+ ;; -+ -+ RC) -+ AC_LIBTOOL_LANG_RC_CONFIG -+ ;; -+ -+ *) -+ AC_MSG_ERROR([Unsupported tag name: $tagname]) -+ ;; -+ esac -+ -+ # Append the new tag name to the list of available tags. -+ if test -n "$tagname" ; then -+ available_tags="$available_tags $tagname" -+ fi -+ fi -+ done -+ IFS="$lt_save_ifs" -+ -+ # Now substitute the updated list of available tags. -+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then -+ mv "${ofile}T" "$ofile" -+ chmod +x "$ofile" -+ else -+ rm -f "${ofile}T" -+ AC_MSG_ERROR([unable to update list of available tagged configurations.]) -+ fi -+fi -+])# _LT_AC_TAGCONFIG -+ -+ -+# AC_LIBTOOL_DLOPEN -+# ----------------- -+# enable checks for dlopen support -+AC_DEFUN([AC_LIBTOOL_DLOPEN], -+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -+])# AC_LIBTOOL_DLOPEN -+ -+ -+# AC_LIBTOOL_WIN32_DLL -+# -------------------- -+# declare package support for building win32 DLLs -+AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -+])# AC_LIBTOOL_WIN32_DLL -+ -+ -+# AC_ENABLE_SHARED([DEFAULT]) -+# --------------------------- -+# implement the --enable-shared flag -+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -+AC_DEFUN([AC_ENABLE_SHARED], -+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -+AC_ARG_ENABLE([shared], -+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], -+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], -+ [p=${PACKAGE-default} -+ case $enableval in -+ yes) enable_shared=yes ;; -+ no) enable_shared=no ;; -+ *) -+ enable_shared=no -+ # Look at the argument we got. We use all the common list separators. -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for pkg in $enableval; do -+ IFS="$lt_save_ifs" -+ if test "X$pkg" = "X$p"; then -+ enable_shared=yes -+ fi -+ done -+ IFS="$lt_save_ifs" -+ ;; -+ esac], -+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -+])# AC_ENABLE_SHARED -+ -+ -+# AC_DISABLE_SHARED -+# ----------------- -+#- set the default shared flag to --disable-shared -+AC_DEFUN([AC_DISABLE_SHARED], -+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -+AC_ENABLE_SHARED(no) -+])# AC_DISABLE_SHARED -+ -+ -+# AC_ENABLE_STATIC([DEFAULT]) -+# --------------------------- -+# implement the --enable-static flag -+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -+AC_DEFUN([AC_ENABLE_STATIC], -+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -+AC_ARG_ENABLE([static], -+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], -+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], -+ [p=${PACKAGE-default} -+ case $enableval in -+ yes) enable_static=yes ;; -+ no) enable_static=no ;; -+ *) -+ enable_static=no -+ # Look at the argument we got. We use all the common list separators. -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for pkg in $enableval; do -+ IFS="$lt_save_ifs" -+ if test "X$pkg" = "X$p"; then -+ enable_static=yes -+ fi -+ done -+ IFS="$lt_save_ifs" -+ ;; -+ esac], -+ [enable_static=]AC_ENABLE_STATIC_DEFAULT) -+])# AC_ENABLE_STATIC -+ -+ -+# AC_DISABLE_STATIC -+# ----------------- -+# set the default static flag to --disable-static -+AC_DEFUN([AC_DISABLE_STATIC], -+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -+AC_ENABLE_STATIC(no) -+])# AC_DISABLE_STATIC -+ -+ -+# AC_ENABLE_FAST_INSTALL([DEFAULT]) -+# --------------------------------- -+# implement the --enable-fast-install flag -+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -+AC_DEFUN([AC_ENABLE_FAST_INSTALL], -+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -+AC_ARG_ENABLE([fast-install], -+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], -+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], -+ [p=${PACKAGE-default} -+ case $enableval in -+ yes) enable_fast_install=yes ;; -+ no) enable_fast_install=no ;; -+ *) -+ enable_fast_install=no -+ # Look at the argument we got. We use all the common list separators. -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for pkg in $enableval; do -+ IFS="$lt_save_ifs" -+ if test "X$pkg" = "X$p"; then -+ enable_fast_install=yes -+ fi -+ done -+ IFS="$lt_save_ifs" -+ ;; -+ esac], -+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -+])# AC_ENABLE_FAST_INSTALL -+ -+ -+# AC_DISABLE_FAST_INSTALL -+# ----------------------- -+# set the default to --disable-fast-install -+AC_DEFUN([AC_DISABLE_FAST_INSTALL], -+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -+AC_ENABLE_FAST_INSTALL(no) -+])# AC_DISABLE_FAST_INSTALL -+ -+ -+# AC_LIBTOOL_PICMODE([MODE]) -+# -------------------------- -+# implement the --with-pic flag -+# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -+AC_DEFUN([AC_LIBTOOL_PICMODE], -+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -+pic_mode=ifelse($#,1,$1,default) -+])# AC_LIBTOOL_PICMODE -+ -+ -+# AC_PROG_EGREP -+# ------------- -+# This is predefined starting with Autoconf 2.54, so this conditional -+# definition can be removed once we require Autoconf 2.54 or later. -+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], -+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 -+ then ac_cv_prog_egrep='grep -E' -+ else ac_cv_prog_egrep='egrep' -+ fi]) -+ EGREP=$ac_cv_prog_egrep -+ AC_SUBST([EGREP]) -+])]) -+ -+ -+# AC_PATH_TOOL_PREFIX -+# ------------------- -+# find a file program which can recognise shared library -+AC_DEFUN([AC_PATH_TOOL_PREFIX], -+[AC_REQUIRE([AC_PROG_EGREP])dnl -+AC_MSG_CHECKING([for $1]) -+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -+[case $MAGIC_CMD in -+[[\\/*] | ?:[\\/]*]) -+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. -+ ;; -+*) -+ lt_save_MAGIC_CMD="$MAGIC_CMD" -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+dnl $ac_dummy forces splitting on constant user-supplied paths. -+dnl POSIX.2 word splitting is done only on the output of word expansions, -+dnl not every word. This closes a longstanding sh security hole. -+ ac_dummy="ifelse([$2], , $PATH, [$2])" -+ for ac_dir in $ac_dummy; do -+ IFS="$lt_save_ifs" -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$1; then -+ lt_cv_path_MAGIC_CMD="$ac_dir/$1" -+ if test -n "$file_magic_test_file"; then -+ case $deplibs_check_method in -+ "file_magic "*) -+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` -+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | -+ $EGREP "$file_magic_regex" > /dev/null; then -+ : -+ else -+ cat <&2 -+ -+*** Warning: the command libtool uses to detect shared libraries, -+*** $file_magic_cmd, produces output that libtool cannot recognize. -+*** The result is that libtool may fail to recognize shared libraries -+*** as such. This will affect the creation of libtool libraries that -+*** depend on shared libraries, but programs linked with such libtool -+*** libraries will work regardless of this problem. Nevertheless, you -+*** may want to report the problem to your system manager and/or to -+*** bug-libtool@gnu.org -+ -+EOF -+ fi ;; -+ esac -+ fi -+ break -+ fi -+ done -+ IFS="$lt_save_ifs" -+ MAGIC_CMD="$lt_save_MAGIC_CMD" -+ ;; -+esac]) -+MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -+if test -n "$MAGIC_CMD"; then -+ AC_MSG_RESULT($MAGIC_CMD) -+else -+ AC_MSG_RESULT(no) -+fi -+])# AC_PATH_TOOL_PREFIX -+ -+ -+# AC_PATH_MAGIC -+# ------------- -+# find a file program which can recognise a shared library -+AC_DEFUN([AC_PATH_MAGIC], -+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -+if test -z "$lt_cv_path_MAGIC_CMD"; then -+ if test -n "$ac_tool_prefix"; then -+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) -+ else -+ MAGIC_CMD=: -+ fi -+fi -+])# AC_PATH_MAGIC -+ -+ -+# AC_PROG_LD -+# ---------- -+# find the pathname to the GNU or non-GNU linker -+AC_DEFUN([AC_PROG_LD], -+[AC_ARG_WITH([gnu-ld], -+ [AC_HELP_STRING([--with-gnu-ld], -+ [assume the C compiler uses GNU ld @<:@default=no@:>@])], -+ [test "$withval" = no || with_gnu_ld=yes], -+ [with_gnu_ld=no]) -+AC_REQUIRE([LT_AC_PROG_SED])dnl -+AC_REQUIRE([AC_PROG_CC])dnl -+AC_REQUIRE([AC_CANONICAL_HOST])dnl -+AC_REQUIRE([AC_CANONICAL_BUILD])dnl -+ac_prog=ld -+if test "$GCC" = yes; then -+ # Check if gcc -print-prog-name=ld gives a path. -+ AC_MSG_CHECKING([for ld used by $CC]) -+ case $host in -+ *-*-mingw*) -+ # gcc leaves a trailing carriage return which upsets mingw -+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; -+ *) -+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; -+ esac -+ case $ac_prog in -+ # Accept absolute paths. -+ [[\\/]]* | ?:[[\\/]]*) -+ re_direlt='/[[^/]][[^/]]*/\.\./' -+ # Canonicalize the pathname of ld -+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` -+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` -+ done -+ test -z "$LD" && LD="$ac_prog" -+ ;; -+ "") -+ # If it fails, then pretend we aren't using GCC. -+ ac_prog=ld -+ ;; -+ *) -+ # If it is relative, then search for the first ld in PATH. -+ with_gnu_ld=unknown -+ ;; -+ esac -+elif test "$with_gnu_ld" = yes; then -+ AC_MSG_CHECKING([for GNU ld]) -+else -+ AC_MSG_CHECKING([for non-GNU ld]) -+fi -+AC_CACHE_VAL(lt_cv_path_LD, -+[if test -z "$LD"; then -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ for ac_dir in $PATH; do -+ IFS="$lt_save_ifs" -+ test -z "$ac_dir" && ac_dir=. -+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then -+ lt_cv_path_LD="$ac_dir/$ac_prog" -+ # Check to see if the program is GNU ld. I'd rather use --version, -+ # but apparently some variants of GNU ld only accept -v. -+ # Break only if it was the GNU/non-GNU ld that we prefer. -+ case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then -+ case $host_cpu in -+ i*86 ) -+ # Not sure whether the presence of OpenBSD here was a mistake. -+ # Let's accept both of them until this is cleared up. -+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' -+ lt_cv_file_magic_cmd=/usr/bin/file -+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` -+ ;; -+ esac -+ else -+ lt_cv_deplibs_check_method=pass_all -+ fi -+ ;; -+ -+gnu*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ -+hpux10.20* | hpux11*) -+ lt_cv_file_magic_cmd=/usr/bin/file -+ case $host_cpu in -+ ia64*) -+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' -+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so -+ ;; -+ hppa*64*) -+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] -+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl -+ ;; -+ *) -+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' -+ lt_cv_file_magic_test_file=/usr/lib/libc.sl -+ ;; -+ esac -+ ;; -+ -+irix5* | irix6* | nonstopux*) -+ case $LD in -+ *-32|*"-32 ") libmagic=32-bit;; -+ *-n32|*"-n32 ") libmagic=N32;; -+ *-64|*"-64 ") libmagic=64-bit;; -+ *) libmagic=never-match;; -+ esac -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ -+# This must be Linux ELF. -+linux*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ -+netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then -+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' -+ else -+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' -+ fi -+ ;; -+ -+newos6*) -+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' -+ lt_cv_file_magic_cmd=/usr/bin/file -+ lt_cv_file_magic_test_file=/usr/lib/libnls.so -+ ;; -+ -+nto-qnx*) -+ lt_cv_deplibs_check_method=unknown -+ ;; -+ -+openbsd*) -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' -+ else -+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' -+ fi -+ ;; -+ -+osf3* | osf4* | osf5*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ -+sco3.2v5*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ -+solaris*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ -+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ case $host_vendor in -+ motorola) -+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' -+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` -+ ;; -+ ncr) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ sequent) -+ lt_cv_file_magic_cmd='/bin/file' -+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' -+ ;; -+ sni) -+ lt_cv_file_magic_cmd='/bin/file' -+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" -+ lt_cv_file_magic_test_file=/lib/libc.so -+ ;; -+ siemens) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ esac -+ ;; -+ -+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+esac -+]) -+file_magic_cmd=$lt_cv_file_magic_cmd -+deplibs_check_method=$lt_cv_deplibs_check_method -+test -z "$deplibs_check_method" && deplibs_check_method=unknown -+])# AC_DEPLIBS_CHECK_METHOD -+ -+ -+# AC_PROG_NM -+# ---------- -+# find the pathname to a BSD-compatible name lister -+AC_DEFUN([AC_PROG_NM], -+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -+[if test -n "$NM"; then -+ # Let the user override the test. -+ lt_cv_path_NM="$NM" -+else -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do -+ IFS="$lt_save_ifs" -+ test -z "$ac_dir" && ac_dir=. -+ tmp_nm="$ac_dir/${ac_tool_prefix}nm" -+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then -+ # Check to see if the nm accepts a BSD-compat flag. -+ # Adding the `sed 1q' prevents false positives on HP-UX, which says: -+ # nm: unknown option "B" ignored -+ # Tru64's nm complains that /dev/null is an invalid object file -+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in -+ */dev/null* | *'Invalid file or object type'*) -+ lt_cv_path_NM="$tmp_nm -B" -+ break -+ ;; -+ *) -+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in -+ */dev/null*) -+ lt_cv_path_NM="$tmp_nm -p" -+ break -+ ;; -+ *) -+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but -+ continue # so that we can try to find one that supports BSD flags -+ ;; -+ esac -+ esac -+ fi -+ done -+ IFS="$lt_save_ifs" -+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -+fi]) -+NM="$lt_cv_path_NM" -+])# AC_PROG_NM -+ -+ -+# AC_CHECK_LIBM -+# ------------- -+# check for math library -+AC_DEFUN([AC_CHECK_LIBM], -+[AC_REQUIRE([AC_CANONICAL_HOST])dnl -+LIBM= -+case $host in -+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) -+ # These system don't have libm, or don't need it -+ ;; -+*-ncr-sysv4.3*) -+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") -+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") -+ ;; -+*) -+ AC_CHECK_LIB(m, cos, LIBM="-lm") -+ ;; -+esac -+])# AC_CHECK_LIBM -+ -+ -+# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -+# ----------------------------------- -+# sets LIBLTDL to the link flags for the libltdl convenience library and -+# LTDLINCL to the include flags for the libltdl header and adds -+# --enable-ltdl-convenience to the configure arguments. Note that -+# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -+# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -+# (note the single quotes!). If your package is not flat and you're not -+# using automake, define top_builddir and top_srcdir appropriately in -+# the Makefiles. -+AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -+ case $enable_ltdl_convenience in -+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; -+ "") enable_ltdl_convenience=yes -+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; -+ esac -+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la -+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) -+ # For backwards non-gettext consistent compatibility... -+ INCLTDL="$LTDLINCL" -+])# AC_LIBLTDL_CONVENIENCE -+ -+ -+# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -+# ----------------------------------- -+# sets LIBLTDL to the link flags for the libltdl installable library and -+# LTDLINCL to the include flags for the libltdl header and adds -+# --enable-ltdl-install to the configure arguments. Note that -+# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -+# and an installed libltdl is not found, it is assumed to be `libltdl'. -+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -+# '${top_srcdir}/' (note the single quotes!). If your package is not -+# flat and you're not using automake, define top_builddir and top_srcdir -+# appropriately in the Makefiles. -+# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -+AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -+ AC_CHECK_LIB(ltdl, lt_dlinit, -+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], -+ [if test x"$enable_ltdl_install" = xno; then -+ AC_MSG_WARN([libltdl not installed, but installation disabled]) -+ else -+ enable_ltdl_install=yes -+ fi -+ ]) -+ if test x"$enable_ltdl_install" = x"yes"; then -+ ac_configure_args="$ac_configure_args --enable-ltdl-install" -+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la -+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) -+ else -+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no" -+ LIBLTDL="-lltdl" -+ LTDLINCL= -+ fi -+ # For backwards non-gettext consistent compatibility... -+ INCLTDL="$LTDLINCL" -+])# AC_LIBLTDL_INSTALLABLE -+ -+ -+# AC_LIBTOOL_CXX -+# -------------- -+# enable support for C++ libraries -+AC_DEFUN([AC_LIBTOOL_CXX], -+[AC_REQUIRE([_LT_AC_LANG_CXX]) -+])# AC_LIBTOOL_CXX -+ -+ -+# _LT_AC_LANG_CXX -+# --------------- -+AC_DEFUN([_LT_AC_LANG_CXX], -+[AC_REQUIRE([AC_PROG_CXX]) -+AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -+])# _LT_AC_LANG_CXX -+ -+# _LT_AC_PROG_CXXCPP -+# --------------- -+AC_DEFUN([_LT_AC_PROG_CXXCPP], -+[ -+AC_REQUIRE([AC_PROG_CXX]) -+if test -n "$CXX" && ( test "X$CXX" != "Xno" && -+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || -+ (test "X$CXX" != "Xg++"))) ; then -+ AC_PROG_CXXCPP -+fi -+])# _LT_AC_PROG_CXXCPP -+ -+# AC_LIBTOOL_F77 -+# -------------- -+# enable support for Fortran 77 libraries -+AC_DEFUN([AC_LIBTOOL_F77], -+[AC_REQUIRE([_LT_AC_LANG_F77]) -+])# AC_LIBTOOL_F77 -+ -+ -+# _LT_AC_LANG_F77 -+# --------------- -+AC_DEFUN([_LT_AC_LANG_F77], -+[AC_REQUIRE([AC_PROG_F77]) -+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -+])# _LT_AC_LANG_F77 -+ -+ -+# AC_LIBTOOL_GCJ -+# -------------- -+# enable support for GCJ libraries -+AC_DEFUN([AC_LIBTOOL_GCJ], -+[AC_REQUIRE([_LT_AC_LANG_GCJ]) -+])# AC_LIBTOOL_GCJ -+ -+ -+# _LT_AC_LANG_GCJ -+# --------------- -+AC_DEFUN([_LT_AC_LANG_GCJ], -+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], -+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], -+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], -+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], -+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], -+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -+])# _LT_AC_LANG_GCJ -+ -+ -+# AC_LIBTOOL_RC -+# -------------- -+# enable support for Windows resource files -+AC_DEFUN([AC_LIBTOOL_RC], -+[AC_REQUIRE([LT_AC_PROG_RC]) -+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -+])# AC_LIBTOOL_RC -+ -+ -+# AC_LIBTOOL_LANG_C_CONFIG -+# ------------------------ -+# Ensure that the configuration vars for the C compiler are -+# suitably defined. Those variables are subsequently used by -+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -+AC_DEFUN([_LT_AC_LANG_C_CONFIG], -+[lt_save_CC="$CC" -+AC_LANG_PUSH(C) -+ -+# Source file extension for C test sources. -+ac_ext=c -+ -+# Object file extension for compiled C test sources. -+objext=o -+_LT_AC_TAGVAR(objext, $1)=$objext -+ -+# Code to be used in simple compile tests -+lt_simple_compile_test_code="int some_variable = 0;\n" -+ -+# Code to be used in simple link tests -+lt_simple_link_test_code='int main(){return(0);}\n' -+ -+_LT_AC_SYS_COMPILER -+ -+# save warnings/boilerplate of simple test code -+_LT_COMPILER_BOILERPLATE -+_LT_LINKER_BOILERPLATE -+ -+# -+# Check for any special shared library compilation flags. -+# -+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -+if test "$GCC" = no; then -+ case $host_os in -+ sco3.2v5*) -+ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' -+ ;; -+ esac -+fi -+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then -+ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) -+ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : -+ else -+ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) -+ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no -+ fi -+fi -+ -+ -+# -+# Check to make sure the static flag actually works. -+# -+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], -+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), -+ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), -+ [], -+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -+ -+ -+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -+AC_LIBTOOL_PROG_COMPILER_PIC($1) -+AC_LIBTOOL_PROG_CC_C_O($1) -+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -+AC_LIBTOOL_PROG_LD_SHLIBS($1) -+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -+AC_LIBTOOL_SYS_LIB_STRIP -+AC_LIBTOOL_DLOPEN_SELF($1) -+ -+# Report which librarie types wil actually be built -+AC_MSG_CHECKING([if libtool supports shared libraries]) -+AC_MSG_RESULT([$can_build_shared]) -+ -+AC_MSG_CHECKING([whether to build shared libraries]) -+test "$can_build_shared" = "no" && enable_shared=no -+ -+# On AIX, shared libraries and static libraries use the same namespace, and -+# are all built from PIC. -+case $host_os in -+aix3*) -+ test "$enable_shared" = yes && enable_static=no -+ if test -n "$RANLIB"; then -+ archive_cmds="$archive_cmds~\$RANLIB \$lib" -+ postinstall_cmds='$RANLIB $lib' -+ fi -+ ;; -+ -+aix4* | aix5*) -+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then -+ test "$enable_shared" = yes && enable_static=no -+ fi -+ ;; -+esac -+AC_MSG_RESULT([$enable_shared]) -+ -+AC_MSG_CHECKING([whether to build static libraries]) -+# Make sure either enable_shared or enable_static is yes. -+test "$enable_shared" = yes || enable_static=yes -+AC_MSG_RESULT([$enable_static]) -+ -+AC_LIBTOOL_CONFIG($1) -+ -+AC_LANG_POP -+CC="$lt_save_CC" -+])# AC_LIBTOOL_LANG_C_CONFIG -+ -+ -+# AC_LIBTOOL_LANG_CXX_CONFIG -+# -------------------------- -+# Ensure that the configuration vars for the C compiler are -+# suitably defined. Those variables are subsequently used by -+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -+[AC_LANG_PUSH(C++) -+AC_REQUIRE([AC_PROG_CXX]) -+AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -+ -+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+_LT_AC_TAGVAR(allow_undefined_flag, $1)= -+_LT_AC_TAGVAR(always_export_symbols, $1)=no -+_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -+_LT_AC_TAGVAR(hardcode_direct, $1)=no -+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -+_LT_AC_TAGVAR(hardcode_automatic, $1)=no -+_LT_AC_TAGVAR(module_cmds, $1)= -+_LT_AC_TAGVAR(module_expsym_cmds, $1)= -+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -+_LT_AC_TAGVAR(no_undefined_flag, $1)= -+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no -+ -+# Dependencies to place before and after the object being linked: -+_LT_AC_TAGVAR(predep_objects, $1)= -+_LT_AC_TAGVAR(postdep_objects, $1)= -+_LT_AC_TAGVAR(predeps, $1)= -+_LT_AC_TAGVAR(postdeps, $1)= -+_LT_AC_TAGVAR(compiler_lib_search_path, $1)= -+ -+# Source file extension for C++ test sources. -+ac_ext=cpp -+ -+# Object file extension for compiled C++ test sources. -+objext=o -+_LT_AC_TAGVAR(objext, $1)=$objext -+ -+# Code to be used in simple compile tests -+lt_simple_compile_test_code="int some_variable = 0;\n" -+ -+# Code to be used in simple link tests -+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' -+ -+# ltmain only uses $CC for tagged configurations so make sure $CC is set. -+_LT_AC_SYS_COMPILER -+ -+# save warnings/boilerplate of simple test code -+_LT_COMPILER_BOILERPLATE -+_LT_LINKER_BOILERPLATE -+ -+# Allow CC to be a program name with arguments. -+lt_save_CC=$CC -+lt_save_LD=$LD -+lt_save_GCC=$GCC -+GCC=$GXX -+lt_save_with_gnu_ld=$with_gnu_ld -+lt_save_path_LD=$lt_cv_path_LD -+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then -+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -+else -+ unset lt_cv_prog_gnu_ld -+fi -+if test -n "${lt_cv_path_LDCXX+set}"; then -+ lt_cv_path_LD=$lt_cv_path_LDCXX -+else -+ unset lt_cv_path_LD -+fi -+test -z "${LDCXX+set}" || LD=$LDCXX -+CC=${CXX-"c++"} -+compiler=$CC -+_LT_AC_TAGVAR(compiler, $1)=$CC -+_LT_CC_BASENAME([$compiler]) -+ -+# We don't want -fno-exception wen compiling C++ code, so set the -+# no_builtin_flag separately -+if test "$GXX" = yes; then -+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -+else -+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -+fi -+ -+if test "$GXX" = yes; then -+ # Set up default GNU C++ configuration -+ -+ AC_PROG_LD -+ -+ # Check if GNU C++ uses GNU ld as the underlying linker, since the -+ # archiving commands below assume that GNU ld is being used. -+ if test "$with_gnu_ld" = yes; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' -+ -+ # If archive_cmds runs LD, not CC, wlarc should be empty -+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to -+ # investigate it a little bit more. (MM) -+ wlarc='${wl}' -+ -+ # ancient GNU ld didn't support --whole-archive et. al. -+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ -+ grep 'no-whole-archive' > /dev/null; then -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ else -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -+ fi -+ else -+ with_gnu_ld=no -+ wlarc= -+ -+ # A generic and very simple default shared library creation -+ # command for GNU C++ for the case where it uses the native -+ # linker, instead of GNU ld. If possible, this setting should -+ # overridden to take advantage of the native linker features on -+ # the platform it is being used on. -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' -+ fi -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' -+ -+else -+ GXX=no -+ with_gnu_ld=no -+ wlarc= -+fi -+ -+# PORTME: fill in a description of your system's C++ link characteristics -+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -+_LT_AC_TAGVAR(ld_shlibs, $1)=yes -+case $host_os in -+ aix3*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ aix4* | aix5*) -+ if test "$host_cpu" = ia64; then -+ # On IA64, the linker does run time linking by default, so we don't -+ # have to do anything special. -+ aix_use_runtimelinking=no -+ exp_sym_flag='-Bexport' -+ no_entry_flag="" -+ else -+ aix_use_runtimelinking=no -+ -+ # Test if we are trying to use run time linking or normal -+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we -+ # need to do runtime linking. -+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) -+ for ld_flag in $LDFLAGS; do -+ case $ld_flag in -+ *-brtl*) -+ aix_use_runtimelinking=yes -+ break -+ ;; -+ esac -+ done -+ esac -+ -+ exp_sym_flag='-bexport' -+ no_entry_flag='-bnoentry' -+ fi -+ -+ # When large executables or shared objects are built, AIX ld can -+ # have problems creating the table of contents. If linking a library -+ # or program results in "error TOC overflow" add -mminimal-toc to -+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -+ -+ _LT_AC_TAGVAR(archive_cmds, $1)='' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ -+ if test "$GXX" = yes; then -+ case $host_os in aix4.[[012]]|aix4.[[012]].*) -+ # We only want to do this on AIX 4.2 and lower, the check -+ # below for broken collect2 doesn't work under 4.3+ -+ collect2name=`${CC} -print-prog-name=collect2` -+ if test -f "$collect2name" && \ -+ strings "$collect2name" | grep resolve_lib_name >/dev/null -+ then -+ # We have reworked collect2 -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ else -+ # We have old collect2 -+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported -+ # It fails to find uninstalled libraries when the uninstalled -+ # path is not listed in the libpath. Setting hardcode_minus_L -+ # to unsupported forces relinking -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -+ fi -+ esac -+ shared_flag='-shared' -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag="$shared_flag "'${wl}-G' -+ fi -+ else -+ # not using gcc -+ if test "$host_cpu" = ia64; then -+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release -+ # chokes on -Wl,-G. The following line is correct: -+ shared_flag='-G' -+ else -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag='${wl}-G' -+ else -+ shared_flag='${wl}-bM:SRE' -+ fi -+ fi -+ fi -+ -+ # It seems that -bexpall does not export symbols beginning with -+ # underscore (_), so it is better to generate a list of symbols to export. -+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes -+ if test "$aix_use_runtimelinking" = yes; then -+ # Warning - without using the other runtime loading flags (-brtl), -+ # -berok will link without error, but may produce a broken library. -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' -+ # Determine the default libpath from the value encoded in an empty executable. -+ _LT_AC_SYS_LIBPATH_AIX -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" -+ -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -+ else -+ if test "$host_cpu" = ia64; then -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -+ else -+ # Determine the default libpath from the value encoded in an empty executable. -+ _LT_AC_SYS_LIBPATH_AIX -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" -+ # Warning - without using the other run time loading flags, -+ # -berok will link without error, but may produce a broken library. -+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' -+ # -bexpall does not export symbols beginning with underscore (_) -+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes -+ # Exported symbols can be pulled into shared objects from archives -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes -+ # This is similar to how AIX traditionally builds its shared libraries. -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' -+ fi -+ fi -+ ;; -+ chorus*) -+ case $cc_basename in -+ *) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ ;; -+ -+ -+ cygwin* | mingw* | pw32*) -+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, -+ # as there is no search path for DLLs. -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported -+ _LT_AC_TAGVAR(always_export_symbols, $1)=no -+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes -+ -+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ # If the export-symbols file already is a .def file (1st line -+ # is EXPORTS), use it as is; otherwise, prepend... -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -+ cp $export_symbols $output_objdir/$soname.def; -+ else -+ echo EXPORTS > $output_objdir/$soname.def; -+ cat $export_symbols >> $output_objdir/$soname.def; -+ fi~ -+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ else -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ darwin* | rhapsody*) -+ case $host_os in -+ rhapsody* | darwin1.[[012]]) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' -+ ;; -+ *) # Darwin 1.3 on -+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ else -+ case ${MACOSX_DEPLOYMENT_TARGET} in -+ 10.[[012]]) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ ;; -+ 10.*) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' -+ ;; -+ esac -+ fi -+ ;; -+ esac -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ -+ if test "$GXX" = yes ; then -+ lt_int_apple_cc_single_mod=no -+ output_verbose_link_cmd='echo' -+ if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then -+ lt_int_apple_cc_single_mod=yes -+ fi -+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ fi -+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ fi -+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ case $cc_basename in -+ xlc*) -+ output_verbose_link_cmd='echo' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' -+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ ;; -+ *) -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ fi -+ ;; -+ -+ dgux*) -+ case $cc_basename in -+ ec++*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ ghcx*) -+ # Green Hills C++ Compiler -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ ;; -+ freebsd[[12]]*) -+ # C++ shared libraries reported to be fairly broken before switch to ELF -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ freebsd-elf*) -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+ ;; -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF -+ # conventions -+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes -+ ;; -+ gnu*) -+ ;; -+ hpux9*) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, -+ # but as the default -+ # location of the library. -+ -+ case $cc_basename in -+ CC*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ aCC*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ else -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ esac -+ ;; -+ hpux10*|hpux11*) -+ if test $with_gnu_ld = no; then -+ case $host_cpu in -+ hppa*64*) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ ;; -+ ia64*) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ ;; -+ *) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' -+ ;; -+ esac -+ fi -+ case $host_cpu in -+ hppa*64*) -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ ia64*) -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, -+ # but as the default -+ # location of the library. -+ ;; -+ *) -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, -+ # but as the default -+ # location of the library. -+ ;; -+ esac -+ -+ case $cc_basename in -+ CC*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ aCC*) -+ case $host_cpu in -+ hppa*64*|ia64*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' -+ ;; -+ *) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' -+ ;; -+ esac -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes; then -+ if test $with_gnu_ld = no; then -+ case $host_cpu in -+ ia64*|hppa*64*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' -+ ;; -+ *) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' -+ ;; -+ esac -+ fi -+ else -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ esac -+ ;; -+ irix5* | irix6*) -+ case $cc_basename in -+ CC*) -+ # SGI C++ -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ -+ # Archives containing C++ object files must be created using -+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is -+ # necessary to make sure instantiated templates are included -+ # in the archive. -+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' -+ ;; -+ *) -+ if test "$GXX" = yes; then -+ if test "$with_gnu_ld" = no; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' -+ fi -+ fi -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ ;; -+ esac -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ ;; -+ linux*) -+ case $cc_basename in -+ KCC*) -+ # Kuck and Associates, Inc. (KAI) C++ Compiler -+ -+ # KCC will only create a shared library if the output file -+ # ends with ".so" (or ".sl" for HP-UX), so rename the library -+ # to its proper name (with version) after linking. -+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' -+ -+ # Archives containing C++ object files must be created using -+ # "CC -Bstatic", where "CC" is the KAI C++ compiler. -+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' -+ ;; -+ icpc*) -+ # Intel C++ -+ with_gnu_ld=yes -+ # version 8.0 and above of icpc choke on multiply defined symbols -+ # if we add $predep_objects and $postdep_objects, however 7.1 and -+ # earlier do not add the objects themselves. -+ case `$CC -V 2>&1` in -+ *"Version 7."*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ ;; -+ *) # Version 8.0 or newer -+ tmp_idyn= -+ case $host_cpu in -+ ia64*) tmp_idyn=' -i_dynamic';; -+ esac -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ ;; -+ esac -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' -+ ;; -+ pgCC*) -+ # Portland Group C++ compiler -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ ;; -+ cxx*) -+ # Compaq C++ -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' -+ -+ runpath_var=LD_RUN_PATH -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ esac -+ ;; -+ lynxos*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ m88k*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ mvs*) -+ case $cc_basename in -+ cxx*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ ;; -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' -+ wlarc= -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ fi -+ # Workaround some broken pre-1.5 toolchains -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' -+ ;; -+ openbsd2*) -+ # C++ shared libraries are fairly broken -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ openbsd*) -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ fi -+ output_verbose_link_cmd='echo' -+ ;; -+ osf3*) -+ case $cc_basename in -+ KCC*) -+ # Kuck and Associates, Inc. (KAI) C++ Compiler -+ -+ # KCC will only create a shared library if the output file -+ # ends with ".so" (or ".sl" for HP-UX), so rename the library -+ # to its proper name (with version) after linking. -+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ -+ # Archives containing C++ object files must be created using -+ # "CC -Bstatic", where "CC" is the KAI C++ compiler. -+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' -+ -+ ;; -+ RCC*) -+ # Rational C++ 2.4.1 -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ cxx*) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' -+ -+ else -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ esac -+ ;; -+ osf4* | osf5*) -+ case $cc_basename in -+ KCC*) -+ # Kuck and Associates, Inc. (KAI) C++ Compiler -+ -+ # KCC will only create a shared library if the output file -+ # ends with ".so" (or ".sl" for HP-UX), so rename the library -+ # to its proper name (with version) after linking. -+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ -+ # Archives containing C++ object files must be created using -+ # the KAI C++ compiler. -+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' -+ ;; -+ RCC*) -+ # Rational C++ 2.4.1 -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ cxx*) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ -+ echo "-hidden">> $lib.exp~ -+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ -+ $rm $lib.exp' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' -+ -+ else -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ esac -+ ;; -+ psos*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ sco*) -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+ case $cc_basename in -+ CC*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ ;; -+ sunos4*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.x -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ lcc*) -+ # Lucid -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ ;; -+ solaris*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.2, 5.x and Centerline C++ -+ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes -+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ case $host_os in -+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; -+ *) -+ # The C++ compiler is used as linker so we must use $wl -+ # flag to pass the commands to the underlying system -+ # linker. We must also pass each convience library through -+ # to the system linker between allextract/defaultextract. -+ # The C++ compiler will combine linker options so we -+ # cannot just pass the convience library names through -+ # without $wl. -+ # Supported since Solaris 2.6 (maybe 2.5.1?) -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' -+ ;; -+ esac -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ -+ output_verbose_link_cmd='echo' -+ -+ # Archives containing C++ object files must be created using -+ # "CC -xar", where "CC" is the Sun C++ compiler. This is -+ # necessary to make sure instantiated templates are included -+ # in the archive. -+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' -+ ;; -+ gcx*) -+ # Green Hills C++ Compiler -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' -+ -+ # The C++ compiler must be used to create the archive. -+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' -+ ;; -+ *) -+ # GNU C++ compiler with Solaris linker -+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then -+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' -+ if $CC --version | grep -v '^2\.7' > /dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" -+ else -+ # g++ 2.7 appears to require `-G' NOT `-shared' on this -+ # platform. -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" -+ fi -+ -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' -+ fi -+ ;; -+ esac -+ ;; -+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+ ;; -+ tandem*) -+ case $cc_basename in -+ NCC*) -+ # NonStop-UX NCC 3.20 -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ ;; -+ vxworks*) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+esac -+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no -+ -+_LT_AC_TAGVAR(GCC, $1)="$GXX" -+_LT_AC_TAGVAR(LD, $1)="$LD" -+ -+AC_LIBTOOL_POSTDEP_PREDEP($1) -+AC_LIBTOOL_PROG_COMPILER_PIC($1) -+AC_LIBTOOL_PROG_CC_C_O($1) -+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -+AC_LIBTOOL_PROG_LD_SHLIBS($1) -+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -+AC_LIBTOOL_SYS_LIB_STRIP -+AC_LIBTOOL_DLOPEN_SELF($1) -+ -+AC_LIBTOOL_CONFIG($1) -+ -+AC_LANG_POP -+CC=$lt_save_CC -+LDCXX=$LD -+LD=$lt_save_LD -+GCC=$lt_save_GCC -+with_gnu_ldcxx=$with_gnu_ld -+with_gnu_ld=$lt_save_with_gnu_ld -+lt_cv_path_LDCXX=$lt_cv_path_LD -+lt_cv_path_LD=$lt_save_path_LD -+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -+])# AC_LIBTOOL_LANG_CXX_CONFIG -+ -+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -+# ------------------------ -+# Figure out "hidden" library dependencies from verbose -+# compiler output when linking a shared library. -+# Parse the compiler output and extract the necessary -+# objects, libraries and library flags. -+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -+dnl we can't use the lt_simple_compile_test_code here, -+dnl because it contains code intended for an executable, -+dnl not a library. It's possible we should let each -+dnl tag define a new lt_????_link_test_code variable, -+dnl but it's only used here... -+ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -+ifelse([$1], [], -+[#! $SHELL -+ -+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -+# NOTE: Changes made to this file will be lost: look at ltmain.sh. -+# -+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -+# Free Software Foundation, Inc. -+# -+# This file is part of GNU Libtool: -+# Originally by Gordon Matzigkeit , 1996 -+# -+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+# -+# As a special exception to the GNU General Public License, if you -+# distribute this file as part of a program that contains a -+# configuration script generated by Autoconf, you may include it under -+# the same distribution terms that you use for the rest of that program. -+ -+# A sed program that does not truncate output. -+SED=$lt_SED -+ -+# Sed that helps us avoid accidentally triggering echo(1) options like -n. -+Xsed="$SED -e 1s/^X//" -+ -+# The HP-UX ksh and POSIX shell print the target directory to stdout -+# if CDPATH is set. -+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -+ -+# The names of the tagged configurations supported by this script. -+available_tags= -+ -+# ### BEGIN LIBTOOL CONFIG], -+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) -+ -+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -+ -+# Shell to use when invoking shell scripts. -+SHELL=$lt_SHELL -+ -+# Whether or not to build shared libraries. -+build_libtool_libs=$enable_shared -+ -+# Whether or not to build static libraries. -+build_old_libs=$enable_static -+ -+# Whether or not to add -lc for building shared libraries. -+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) -+ -+# Whether or not to disallow shared libs when runtime libs are static -+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) -+ -+# Whether or not to optimize for fast installation. -+fast_install=$enable_fast_install -+ -+# The host system. -+host_alias=$host_alias -+host=$host -+host_os=$host_os -+ -+# The build system. -+build_alias=$build_alias -+build=$build -+build_os=$build_os -+ -+# An echo program that does not interpret backslashes. -+echo=$lt_echo -+ -+# The archiver. -+AR=$lt_AR -+AR_FLAGS=$lt_AR_FLAGS -+ -+# A C compiler. -+LTCC=$lt_LTCC -+ -+# A language-specific compiler. -+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) -+ -+# Is the compiler the GNU C compiler? -+with_gcc=$_LT_AC_TAGVAR(GCC, $1) -+ -+# An ERE matcher. -+EGREP=$lt_EGREP -+ -+# The linker used to build libraries. -+LD=$lt_[]_LT_AC_TAGVAR(LD, $1) -+ -+# Whether we need hard or soft links. -+LN_S=$lt_LN_S -+ -+# A BSD-compatible nm program. -+NM=$lt_NM -+ -+# A symbol stripping program -+STRIP=$lt_STRIP -+ -+# Used to examine libraries when file_magic_cmd begins "file" -+MAGIC_CMD=$MAGIC_CMD -+ -+# Used on cygwin: DLL creation program. -+DLLTOOL="$DLLTOOL" -+ -+# Used on cygwin: object dumper. -+OBJDUMP="$OBJDUMP" -+ -+# Used on cygwin: assembler. -+AS="$AS" -+ -+# The name of the directory that contains temporary libtool files. -+objdir=$objdir -+ -+# How to create reloadable object files. -+reload_flag=$lt_reload_flag -+reload_cmds=$lt_reload_cmds -+ -+# How to pass a linker flag through the compiler. -+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) -+ -+# Object file suffix (normally "o"). -+objext="$ac_objext" -+ -+# Old archive suffix (normally "a"). -+libext="$libext" -+ -+# Shared library suffix (normally ".so"). -+shrext_cmds='$shrext_cmds' -+ -+# Executable file suffix (normally ""). -+exeext="$exeext" -+ -+# Additional compiler flags for building library objects. -+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -+pic_mode=$pic_mode -+ -+# What is the maximum length of a command? -+max_cmd_len=$lt_cv_sys_max_cmd_len -+ -+# Does compiler simultaneously support -c and -o options? -+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) -+ -+# Must we lock files when doing compilation? -+need_locks=$lt_need_locks -+ -+# Do we need the lib prefix for modules? -+need_lib_prefix=$need_lib_prefix -+ -+# Do we need a version for libraries? -+need_version=$need_version -+ -+# Whether dlopen is supported. -+dlopen_support=$enable_dlopen -+ -+# Whether dlopen of programs is supported. -+dlopen_self=$enable_dlopen_self -+ -+# Whether dlopen of statically linked programs is supported. -+dlopen_self_static=$enable_dlopen_self_static -+ -+# Compiler flag to prevent dynamic linking. -+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) -+ -+# Compiler flag to turn off builtin functions. -+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -+ -+# Compiler flag to allow reflexive dlopens. -+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) -+ -+# Compiler flag to generate shared objects directly from archives. -+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) -+ -+# Compiler flag to generate thread-safe objects. -+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) -+ -+# Library versioning type. -+version_type=$version_type -+ -+# Format of library name prefix. -+libname_spec=$lt_libname_spec -+ -+# List of archive names. First name is the real one, the rest are links. -+# The last name is the one that the linker finds with -lNAME. -+library_names_spec=$lt_library_names_spec -+ -+# The coded name of the library, if different from the real name. -+soname_spec=$lt_soname_spec -+ -+# Commands used to build and install an old-style archive. -+RANLIB=$lt_RANLIB -+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -+old_postinstall_cmds=$lt_old_postinstall_cmds -+old_postuninstall_cmds=$lt_old_postuninstall_cmds -+ -+# Create an old-style archive from a shared archive. -+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) -+ -+# Create a temporary old-style archive to link instead of a shared archive. -+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) -+ -+# Commands used to build and install a shared archive. -+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -+postinstall_cmds=$lt_postinstall_cmds -+postuninstall_cmds=$lt_postuninstall_cmds -+ -+# Commands used to build a loadable module (assumed same as above if empty) -+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) -+ -+# Commands to strip libraries. -+old_striplib=$lt_old_striplib -+striplib=$lt_striplib -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) -+ -+# The library search path used internally by the compiler when linking -+# a shared library. -+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) -+ -+# Method to check whether dependent libraries are shared objects. -+deplibs_check_method=$lt_deplibs_check_method -+ -+# Command to use when deplibs_check_method == file_magic. -+file_magic_cmd=$lt_file_magic_cmd -+ -+# Flag that allows shared libraries with undefined symbols to be built. -+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) -+ -+# Flag that forces no undefined symbols. -+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) -+ -+# Commands used to finish a libtool library installation in a directory. -+finish_cmds=$lt_finish_cmds -+ -+# Same as above, but a single script fragment to be evaled but not shown. -+finish_eval=$lt_finish_eval -+ -+# Take the output of nm and produce a listing of raw symbols and C names. -+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -+ -+# Transform the output of nm in a proper C declaration -+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -+ -+# Transform the output of nm in a C name address pair -+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -+ -+# This is the shared library runtime path variable. -+runpath_var=$runpath_var -+ -+# This is the shared library path variable. -+shlibpath_var=$shlibpath_var -+ -+# Is shlibpath searched before the hard-coded library search path? -+shlibpath_overrides_runpath=$shlibpath_overrides_runpath -+ -+# How to hardcode a shared library path into an executable. -+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) -+ -+# Whether we should hardcode library paths into libraries. -+hardcode_into_libs=$hardcode_into_libs -+ -+# Flag to hardcode \$libdir into a binary during linking. -+# This must work even if \$libdir does not exist. -+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) -+ -+# If ld is used when linking, flag to hardcode \$libdir into -+# a binary during linking. This must work even if \$libdir does -+# not exist. -+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) -+ -+# Whether we need a single -rpath flag with a separated argument. -+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) -+ -+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -+# resulting binary. -+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) -+ -+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -+# resulting binary. -+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) -+ -+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -+# the resulting binary. -+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) -+ -+# Set to yes if building a shared library automatically hardcodes DIR into the library -+# and all subsequent libraries and executables linked against it. -+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) -+ -+# Variables whose values should be saved in libtool wrapper scripts and -+# restored at relink time. -+variables_saved_for_relink="$variables_saved_for_relink" -+ -+# Whether libtool must link a program against all its dependency libraries. -+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) -+ -+# Compile-time system search path for libraries -+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -+ -+# Run-time system search path for libraries -+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -+ -+# Fix the shell variable \$srcfile for the compiler. -+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" -+ -+# Set to yes if exported symbols are required. -+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) -+ -+# The commands to list exported symbols. -+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) -+ -+# The commands to extract the exported symbol list from a shared archive. -+extract_expsyms_cmds=$lt_extract_expsyms_cmds -+ -+# Symbols that should not be listed in the preloaded symbols. -+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) -+ -+# Symbols that must always be exported. -+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) -+ -+ifelse([$1],[], -+[# ### END LIBTOOL CONFIG], -+[# ### END LIBTOOL TAG CONFIG: $tagname]) -+ -+__EOF__ -+ -+ifelse([$1],[], [ -+ case $host_os in -+ aix3*) -+ cat <<\EOF >> "$cfgfile" -+ -+# AIX sometimes has problems with the GCC collect2 program. For some -+# reason, if we set the COLLECT_NAMES environment variable, the problems -+# vanish in a puff of smoke. -+if test "X${COLLECT_NAMES+set}" != Xset; then -+ COLLECT_NAMES= -+ export COLLECT_NAMES -+fi -+EOF -+ ;; -+ esac -+ -+ # We use sed instead of cat because bash on DJGPP gets confused if -+ # if finds mixed CR/LF and LF-only lines. Since sed operates in -+ # text mode, it properly converts lines to CR/LF. This bash problem -+ # is reportedly fixed, but why not run on old versions too? -+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) -+ -+ mv -f "$cfgfile" "$ofile" || \ -+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") -+ chmod +x "$ofile" -+]) -+else -+ # If there is no Makefile yet, we rely on a make rule to execute -+ # `config.status --recheck' to rerun these tests and create the -+ # libtool script then. -+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` -+ if test -f "$ltmain_in"; then -+ test -f Makefile && make "$ltmain" -+ fi -+fi -+])# AC_LIBTOOL_CONFIG -+ -+ -+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -+# ------------------------------------------- -+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -+ -+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -+ -+if test "$GCC" = yes; then -+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -+ -+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], -+ lt_cv_prog_compiler_rtti_exceptions, -+ [-fno-rtti -fno-exceptions], [], -+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -+fi -+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI -+ -+ -+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -+# --------------------------------- -+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -+[AC_REQUIRE([AC_CANONICAL_HOST]) -+AC_REQUIRE([AC_PROG_NM]) -+AC_REQUIRE([AC_OBJEXT]) -+# Check for command to grab the raw symbol name followed by C symbol from nm. -+AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -+[ -+# These are sane defaults that work on at least a few old systems. -+# [They come from Ultrix. What could be older than Ultrix?!! ;)] -+ -+# Character class describing NM global symbol codes. -+symcode='[[BCDEGRST]]' -+ -+# Regexp to match symbols that can be accessed directly from C. -+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' -+ -+# Transform an extracted symbol line into a proper C declaration -+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" -+ -+# Transform an extracted symbol line into symbol name and symbol address -+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -+ -+# Define system-specific variables. -+case $host_os in -+aix*) -+ symcode='[[BCDT]]' -+ ;; -+cygwin* | mingw* | pw32*) -+ symcode='[[ABCDGISTW]]' -+ ;; -+hpux*) # Its linker distinguishes data from code symbols -+ if test "$host_cpu" = ia64; then -+ symcode='[[ABCDEGRST]]' -+ fi -+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -+ ;; -+linux*) -+ if test "$host_cpu" = ia64; then -+ symcode='[[ABCDGIRSTW]]' -+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -+ fi -+ ;; -+irix* | nonstopux*) -+ symcode='[[BCDEGRST]]' -+ ;; -+osf*) -+ symcode='[[BCDEGQRST]]' -+ ;; -+solaris* | sysv5*) -+ symcode='[[BDRT]]' -+ ;; -+sysv4) -+ symcode='[[DFNSTU]]' -+ ;; -+esac -+ -+# Handle CRLF in mingw tool chain -+opt_cr= -+case $build_os in -+mingw*) -+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp -+ ;; -+esac -+ -+# If we're using GNU nm, then use its standard symbol codes. -+case `$NM -V 2>&1` in -+*GNU* | *'with BFD'*) -+ symcode='[[ABCDGIRSTW]]' ;; -+esac -+ -+# Try without a prefix undercore, then with it. -+for ac_symprfx in "" "_"; do -+ -+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. -+ symxfrm="\\1 $ac_symprfx\\2 \\2" -+ -+ # Write the raw and C identifiers. -+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" -+ -+ # Check to see that the pipe works correctly. -+ pipe_works=no -+ -+ rm -f conftest* -+ cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then -+ # Try sorting and uniquifying the output. -+ if sort "$nlist" | uniq > "$nlist"T; then -+ mv -f "$nlist"T "$nlist" -+ else -+ rm -f "$nlist"T -+ fi -+ -+ # Make sure that we snagged all the symbols we need. -+ if grep ' nm_test_var$' "$nlist" >/dev/null; then -+ if grep ' nm_test_func$' "$nlist" >/dev/null; then -+ cat < conftest.$ac_ext -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+EOF -+ # Now generate the symbol file. -+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' -+ -+ cat <> conftest.$ac_ext -+#if defined (__STDC__) && __STDC__ -+# define lt_ptr_t void * -+#else -+# define lt_ptr_t char * -+# define const -+#endif -+ -+/* The mapping between symbol names and symbols. */ -+const struct { -+ const char *name; -+ lt_ptr_t address; -+} -+lt_preloaded_symbols[[]] = -+{ -+EOF -+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext -+ cat <<\EOF >> conftest.$ac_ext -+ {0, (lt_ptr_t) 0} -+}; -+ -+#ifdef __cplusplus -+} -+#endif -+EOF -+ # Now try linking the two files. -+ mv conftest.$ac_objext conftstm.$ac_objext -+ lt_save_LIBS="$LIBS" -+ lt_save_CFLAGS="$CFLAGS" -+ LIBS="conftstm.$ac_objext" -+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" -+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then -+ pipe_works=yes -+ fi -+ LIBS="$lt_save_LIBS" -+ CFLAGS="$lt_save_CFLAGS" -+ else -+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD -+ fi -+ else -+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD -+ fi -+ else -+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD -+ fi -+ else -+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD -+ cat conftest.$ac_ext >&5 -+ fi -+ rm -f conftest* conftst* -+ -+ # Do not use the global_symbol_pipe unless it works. -+ if test "$pipe_works" = yes; then -+ break -+ else -+ lt_cv_sys_global_symbol_pipe= -+ fi -+done -+]) -+if test -z "$lt_cv_sys_global_symbol_pipe"; then -+ lt_cv_sys_global_symbol_to_cdecl= -+fi -+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then -+ AC_MSG_RESULT(failed) -+else -+ AC_MSG_RESULT(ok) -+fi -+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -+ -+ -+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -+# --------------------------------------- -+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= -+ -+AC_MSG_CHECKING([for $compiler option to produce PIC]) -+ ifelse([$1],[CXX],[ -+ # C++ specific cases for pic, static, wl, etc. -+ if test "$GXX" = yes; then -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' -+ -+ case $host_os in -+ aix*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ fi -+ ;; -+ amigaos*) -+ # FIXME: we need at least 68020 code to build shared libraries, but -+ # adding the `-m68020' flag to GCC prevents building anything better, -+ # like `-m68040'. -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' -+ ;; -+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ # PIC is the default for these OSes. -+ ;; -+ mingw* | os2* | pw32*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' -+ ;; -+ darwin* | rhapsody*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' -+ ;; -+ *djgpp*) -+ # DJGPP does not support shared libraries at all -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -+ ;; -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic -+ fi -+ ;; -+ hpux*) -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ ;; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' -+ ;; -+ esac -+ ;; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' -+ ;; -+ esac -+ else -+ case $host_os in -+ aix4* | aix5*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ else -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' -+ fi -+ ;; -+ chorus*) -+ case $cc_basename in -+ cxch68*) -+ # Green Hills C++ Compiler -+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" -+ ;; -+ esac -+ ;; -+ darwin*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ case $cc_basename in -+ xlc*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ ;; -+ esac -+ ;; -+ dgux*) -+ case $cc_basename in -+ ec++*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ ;; -+ ghcx*) -+ # Green Hills C++ Compiler -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ # FreeBSD uses GNU C++ -+ ;; -+ hpux9* | hpux10* | hpux11*) -+ case $cc_basename in -+ CC*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" -+ if test "$host_cpu" != ia64; then -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' -+ fi -+ ;; -+ aCC*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' -+ ;; -+ esac -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ irix5* | irix6* | nonstopux*) -+ case $cc_basename in -+ CC*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' -+ # CC pic flag -KPIC is the default. -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ linux*) -+ case $cc_basename in -+ KCC*) -+ # KAI C++ Compiler -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' -+ ;; -+ icpc* | ecpc*) -+ # Intel C++ -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' -+ ;; -+ pgCC*) -+ # Portland Group C++ compiler. -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ ;; -+ cxx*) -+ # Compaq C++ -+ # Make sure the PIC flag is empty. It appears that all Alpha -+ # Linux and Compaq Tru64 Unix objects are PIC. -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ lynxos*) -+ ;; -+ m88k*) -+ ;; -+ mvs*) -+ case $cc_basename in -+ cxx*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ ;; -+ osf3* | osf4* | osf5*) -+ case $cc_basename in -+ KCC*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' -+ ;; -+ RCC*) -+ # Rational C++ 2.4.1 -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' -+ ;; -+ cxx*) -+ # Digital/Compaq C++ -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ # Make sure the PIC flag is empty. It appears that all Alpha -+ # Linux and Compaq Tru64 Unix objects are PIC. -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ psos*) -+ ;; -+ sco*) -+ case $cc_basename in -+ CC*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ solaris*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.2, 5.x and Centerline C++ -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' -+ ;; -+ gcx*) -+ # Green Hills C++ Compiler -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ sunos4*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.x -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ ;; -+ lcc*) -+ # Lucid -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ tandem*) -+ case $cc_basename in -+ NCC*) -+ # NonStop-UX NCC 3.20 -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ unixware*) -+ ;; -+ vxworks*) -+ ;; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no -+ ;; -+ esac -+ fi -+], -+[ -+ if test "$GCC" = yes; then -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' -+ -+ case $host_os in -+ aix*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ fi -+ ;; -+ -+ amigaos*) -+ # FIXME: we need at least 68020 code to build shared libraries, but -+ # adding the `-m68020' flag to GCC prevents building anything better, -+ # like `-m68040'. -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' -+ ;; -+ -+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ # PIC is the default for these OSes. -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' -+ ;; -+ -+ darwin* | rhapsody*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' -+ ;; -+ -+ msdosdjgpp*) -+ # Just because we use GCC doesn't mean we suddenly get shared libraries -+ # on systems that don't support them. -+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no -+ enable_shared=no -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic -+ fi -+ ;; -+ -+ hpux*) -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' -+ ;; -+ esac -+ ;; -+ -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' -+ ;; -+ esac -+ else -+ # PORTME Check for flag to pass linker flags through the system compiler. -+ case $host_os in -+ aix*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ else -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' -+ fi -+ ;; -+ darwin*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ case $cc_basename in -+ xlc*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ ;; -+ esac -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' -+ ;; -+ -+ hpux9* | hpux10* | hpux11*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' -+ ;; -+ esac -+ # Is there a better lt_prog_compiler_static that works with the bundled CC? -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ # PIC (with -KPIC) is the default. -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' -+ ;; -+ -+ newsos6) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ ;; -+ -+ linux*) -+ case $cc_basename in -+ icc* | ecc*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' -+ ;; -+ pgcc* | pgf77* | pgf90* | pgf95*) -+ # Portland Group compilers (*not* the Pentium gcc compiler, -+ # which looks to be a dead project) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ ;; -+ ccc*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ # All Alpha code is PIC. -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' -+ ;; -+ esac -+ ;; -+ -+ osf3* | osf4* | osf5*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ # All OSF/1 code is PIC. -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' -+ ;; -+ -+ sco3.2v5*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' -+ ;; -+ -+ solaris*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ case $cc_basename in -+ f77* | f90* | f95*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; -+ esac -+ ;; -+ -+ sunos4*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ ;; -+ -+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec ;then -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ fi -+ ;; -+ -+ unicos*) -+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' -+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no -+ ;; -+ -+ uts4*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' -+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' -+ ;; -+ -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no -+ ;; -+ esac -+ fi -+]) -+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) -+ -+# -+# Check to make sure the PIC flag actually works. -+# -+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then -+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], -+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), -+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], -+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in -+ "" | " "*) ;; -+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; -+ esac], -+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -+fi -+case $host_os in -+ # For platforms which do not support PIC, -DPIC is meaningless: -+ *djgpp*) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -+ ;; -+ *) -+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" -+ ;; -+esac -+]) -+ -+ -+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -+# ------------------------------------ -+# See if the linker supports building shared libraries. -+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -+ifelse([$1],[CXX],[ -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ case $host_os in -+ aix4* | aix5*) -+ # If we're using GNU nm, then we don't want the "-C" option. -+ # -C means demangle to AIX nm, but means don't demangle with GNU nm -+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' -+ else -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' -+ fi -+ ;; -+ pw32*) -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" -+ ;; -+ cygwin* | mingw*) -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' -+ ;; -+ linux*) -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=no -+ ;; -+ *) -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ ;; -+ esac -+],[ -+ runpath_var= -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)= -+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no -+ _LT_AC_TAGVAR(archive_cmds, $1)= -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)= -+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= -+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no -+ _LT_AC_TAGVAR(module_cmds, $1)= -+ _LT_AC_TAGVAR(module_expsym_cmds, $1)= -+ _LT_AC_TAGVAR(always_export_symbols, $1)=no -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ # include_expsyms should be a list of space-separated symbols to be *always* -+ # included in the symbol list -+ _LT_AC_TAGVAR(include_expsyms, $1)= -+ # exclude_expsyms can be an extended regexp of symbols to exclude -+ # it will be wrapped by ` (' and `)$', so one must not match beginning or -+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -+ # as well as any symbol that contains `d'. -+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" -+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -+ # platforms (ab)use it in PIC code, but their linkers get confused if -+ # the symbol is explicitly referenced. Since portable code cannot -+ # rely on this symbol name, it's probably fine to never include it in -+ # preloaded symbol tables. -+ extract_expsyms_cmds= -+ # Just being paranoid about ensuring that cc_basename is set. -+ _LT_CC_BASENAME([$compiler]) -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ # FIXME: the MSVC++ port hasn't been tested in a loooong time -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ if test "$GCC" != yes; then -+ with_gnu_ld=no -+ fi -+ ;; -+ openbsd*) -+ with_gnu_ld=no -+ ;; -+ esac -+ -+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes -+ if test "$with_gnu_ld" = yes; then -+ # If archive_cmds runs LD, not CC, wlarc should be empty -+ wlarc='${wl}' -+ -+ # Set some defaults for GNU ld with shared library support. These -+ # are reset later if shared libraries are not supported. Putting them -+ # here allows them to be overridden if necessary. -+ runpath_var=LD_RUN_PATH -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' -+ # ancient GNU ld didn't support --whole-archive et. al. -+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ else -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -+ fi -+ supports_anon_versioning=no -+ case `$LD -v 2>/dev/null` in -+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 -+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... -+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... -+ *\ 2.11.*) ;; # other 2.11 versions -+ *) supports_anon_versioning=yes ;; -+ esac -+ -+ # See if GNU ld supports shared libraries. -+ case $host_os in -+ aix3* | aix4* | aix5*) -+ # On AIX/PPC, the GNU linker is very broken -+ if test "$host_cpu" != ia64; then -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ cat <&2 -+ -+*** Warning: the GNU linker, at least up to release 2.9.1, is reported -+*** to be unable to reliably create shared libraries on AIX. -+*** Therefore, libtool is disabling shared libraries support. If you -+*** really care for shared libraries, you may want to modify your PATH -+*** so that a non-GNU linker is found, and then restart. -+ -+EOF -+ fi -+ ;; -+ -+ amigaos*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ -+ # Samuel A. Falvo II reports -+ # that the semantics of dynamic libraries on AmigaOS, at least up -+ # to version 4, is to share data among multiple programs linked -+ # with the same dynamic library. Since this doesn't match the -+ # behavior of shared libraries on other platforms, we can't use -+ # them. -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ -+ beos*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported -+ # Joseph Beckenbach says some releases of gcc -+ # support --undefined. This deserves some investigation. FIXME -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ else -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, -+ # as there is no search path for DLLs. -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported -+ _LT_AC_TAGVAR(always_export_symbols, $1)=no -+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' -+ -+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ # If the export-symbols file already is a .def file (1st line -+ # is EXPORTS), use it as is; otherwise, prepend... -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -+ cp $export_symbols $output_objdir/$soname.def; -+ else -+ echo EXPORTS > $output_objdir/$soname.def; -+ cat $export_symbols >> $output_objdir/$soname.def; -+ fi~ -+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ else -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ -+ linux*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ tmp_addflag= -+ case $cc_basename,$host_cpu in -+ pgcc*) # Portland Group C compiler -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag' -+ ;; -+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag -Mnomain' ;; -+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 -+ tmp_addflag=' -i_dynamic' ;; -+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 -+ tmp_addflag=' -i_dynamic -nofor_main' ;; -+ ifc* | ifort*) # Intel Fortran compiler -+ tmp_addflag=' -nofor_main' ;; -+ esac -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ -+ if test $supports_anon_versioning = yes; then -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ -+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -+ $echo "local: *; };" >> $output_objdir/$libname.ver~ -+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' -+ fi -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=no -+ else -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' -+ wlarc= -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ fi -+ ;; -+ -+ solaris* | sysv5*) -+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ cat <&2 -+ -+*** Warning: The releases 2.8.* of the GNU linker cannot reliably -+*** create shared libraries on Solaris systems. Therefore, libtool -+*** is disabling shared libraries support. We urge you to upgrade GNU -+*** binutils to release 2.9.1 or newer. Another option is to modify -+*** your PATH or compiler configuration so that the native linker is -+*** used, and then restart. -+ -+EOF -+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ -+ sunos4*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ wlarc= -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ *) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ fi -+ ;; -+ esac -+ -+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then -+ runpath_var= -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -+ fi -+ else -+ # PORTME fill in a description of your system's linker (not GNU ld) -+ case $host_os in -+ aix3*) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported -+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' -+ # Note: this linker hardcodes the directories in LIBPATH if there -+ # are no directories specified by -L. -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ if test "$GCC" = yes && test -z "$link_static_flag"; then -+ # Neither direct hardcoding nor static linking is supported with a -+ # broken collect2. -+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported -+ fi -+ ;; -+ -+ aix4* | aix5*) -+ if test "$host_cpu" = ia64; then -+ # On IA64, the linker does run time linking by default, so we don't -+ # have to do anything special. -+ aix_use_runtimelinking=no -+ exp_sym_flag='-Bexport' -+ no_entry_flag="" -+ else -+ # If we're using GNU nm, then we don't want the "-C" option. -+ # -C means demangle to AIX nm, but means don't demangle with GNU nm -+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' -+ else -+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' -+ fi -+ aix_use_runtimelinking=no -+ -+ # Test if we are trying to use run time linking or normal -+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we -+ # need to do runtime linking. -+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) -+ for ld_flag in $LDFLAGS; do -+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then -+ aix_use_runtimelinking=yes -+ break -+ fi -+ done -+ esac -+ -+ exp_sym_flag='-bexport' -+ no_entry_flag='-bnoentry' -+ fi -+ -+ # When large executables or shared objects are built, AIX ld can -+ # have problems creating the table of contents. If linking a library -+ # or program results in "error TOC overflow" add -mminimal-toc to -+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -+ -+ _LT_AC_TAGVAR(archive_cmds, $1)='' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ -+ if test "$GCC" = yes; then -+ case $host_os in aix4.[[012]]|aix4.[[012]].*) -+ # We only want to do this on AIX 4.2 and lower, the check -+ # below for broken collect2 doesn't work under 4.3+ -+ collect2name=`${CC} -print-prog-name=collect2` -+ if test -f "$collect2name" && \ -+ strings "$collect2name" | grep resolve_lib_name >/dev/null -+ then -+ # We have reworked collect2 -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ else -+ # We have old collect2 -+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported -+ # It fails to find uninstalled libraries when the uninstalled -+ # path is not listed in the libpath. Setting hardcode_minus_L -+ # to unsupported forces relinking -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -+ fi -+ esac -+ shared_flag='-shared' -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag="$shared_flag "'${wl}-G' -+ fi -+ else -+ # not using gcc -+ if test "$host_cpu" = ia64; then -+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release -+ # chokes on -Wl,-G. The following line is correct: -+ shared_flag='-G' -+ else -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag='${wl}-G' -+ else -+ shared_flag='${wl}-bM:SRE' -+ fi -+ fi -+ fi -+ -+ # It seems that -bexpall does not export symbols beginning with -+ # underscore (_), so it is better to generate a list of symbols to export. -+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes -+ if test "$aix_use_runtimelinking" = yes; then -+ # Warning - without using the other runtime loading flags (-brtl), -+ # -berok will link without error, but may produce a broken library. -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' -+ # Determine the default libpath from the value encoded in an empty executable. -+ _LT_AC_SYS_LIBPATH_AIX -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -+ else -+ if test "$host_cpu" = ia64; then -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -+ else -+ # Determine the default libpath from the value encoded in an empty executable. -+ _LT_AC_SYS_LIBPATH_AIX -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" -+ # Warning - without using the other run time loading flags, -+ # -berok will link without error, but may produce a broken library. -+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' -+ # -bexpall does not export symbols beginning with underscore (_) -+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes -+ # Exported symbols can be pulled into shared objects from archives -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes -+ # This is similar to how AIX traditionally builds its shared libraries. -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' -+ fi -+ fi -+ ;; -+ -+ amigaos*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ # see comment about different semantics on the GNU ld section -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ -+ bsdi[[45]]*) -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ # hardcode_libdir_flag_spec is actually meaningless, as there is -+ # no search path for DLLs. -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported -+ # Tell ltmain to make .lib files, not .a files. -+ libext=lib -+ # Tell ltmain to make .dll files, not .so files. -+ shrext_cmds=".dll" -+ # FIXME: Setting linknames here is a bad hack. -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' -+ # The linker will automatically build a .lib file if we build a DLL. -+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' -+ # FIXME: Should let the user specify the lib program. -+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' -+ _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' -+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes -+ ;; -+ -+ darwin* | rhapsody*) -+ case $host_os in -+ rhapsody* | darwin1.[[012]]) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' -+ ;; -+ *) # Darwin 1.3 on -+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ else -+ case ${MACOSX_DEPLOYMENT_TARGET} in -+ 10.[[012]]) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ ;; -+ 10.*) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' -+ ;; -+ esac -+ fi -+ ;; -+ esac -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ if test "$GCC" = yes ; then -+ output_verbose_link_cmd='echo' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ case $cc_basename in -+ xlc*) -+ output_verbose_link_cmd='echo' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' -+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ ;; -+ *) -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ fi -+ ;; -+ -+ dgux*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ freebsd1*) -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ -+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor -+ # support. Future versions do this automatically, but an explicit c++rt0.o -+ # does not break anything, and helps significantly (at the cost of a little -+ # extra space). -+ freebsd2.2*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ # Unfortunately, older versions of FreeBSD 2 do not have this feature. -+ freebsd2*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ hpux9*) -+ if test "$GCC" = yes; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ fi -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' -+ ;; -+ -+ hpux10* | hpux11*) -+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*|ia64*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ *) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ esac -+ else -+ case $host_cpu in -+ hppa*64*|ia64*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ *) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ esac -+ fi -+ if test "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ ia64*) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ ;; -+ *) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ ;; -+ esac -+ fi -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ if test "$GCC" = yes; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' -+ fi -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF -+ fi -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ newsos6) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ openbsd*) -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' -+ else -+ case $host_os in -+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' -+ ;; -+ *) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' -+ ;; -+ esac -+ fi -+ ;; -+ -+ os2*) -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported -+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' -+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' -+ ;; -+ -+ osf3*) -+ if test "$GCC" = yes; then -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ fi -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ ;; -+ -+ osf4* | osf5*) # as osf3* with the addition of -msym flag -+ if test "$GCC" = yes; then -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' -+ else -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ -+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' -+ -+ # Both c and cxx compiler support -rpath directly -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' -+ fi -+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: -+ ;; -+ -+ sco3.2v5*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ;; -+ -+ solaris*) -+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' -+ if test "$GCC" = yes; then -+ wlarc='${wl}' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' -+ else -+ wlarc='' -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ fi -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ case $host_os in -+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; -+ *) -+ # The compiler driver will combine linker options so we -+ # cannot just pass the convience library names through -+ # without $wl, iff we do not link with $LD. -+ # Luckily, gcc supports the same syntax we need for Sun Studio. -+ # Supported since Solaris 2.6 (maybe 2.5.1?) -+ case $wlarc in -+ '') -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; -+ *) -+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; -+ esac ;; -+ esac -+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes -+ ;; -+ -+ sunos4*) -+ if test "x$host_vendor" = xsequent; then -+ # Use $CC to link under sequent, because it throws in some extra .o -+ # files that make .init and .fini sections work. -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' -+ fi -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ sysv4) -+ case $host_vendor in -+ sni) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? -+ ;; -+ siemens) -+ ## LD is ld it makes a PLAMLIB -+ ## CC just makes a GrossModule. -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no -+ ;; -+ motorola) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie -+ ;; -+ esac -+ runpath_var='LD_RUN_PATH' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ sysv4.3*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes -+ fi -+ ;; -+ -+ sysv4.2uw2*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes -+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ hardcode_runpath_var=yes -+ runpath_var=LD_RUN_PATH -+ ;; -+ -+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) -+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' -+ if test "$GCC" = yes; then -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ fi -+ runpath_var='LD_RUN_PATH' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ sysv5*) -+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' -+ # $CC -shared without GNU ld will not create a library from C++ -+ # object files and a static libstdc++, better avoid it by now -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ runpath_var='LD_RUN_PATH' -+ ;; -+ -+ uts4*) -+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' -+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no -+ ;; -+ -+ *) -+ _LT_AC_TAGVAR(ld_shlibs, $1)=no -+ ;; -+ esac -+ fi -+]) -+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no -+ -+variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -+if test "$GCC" = yes; then -+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -+fi -+ -+# -+# Do we need to explicitly link libc? -+# -+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -+x|xyes) -+ # Assume -lc should be added -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes -+ -+ if test "$enable_shared" = yes && test "$GCC" = yes; then -+ case $_LT_AC_TAGVAR(archive_cmds, $1) in -+ *'~'*) -+ # FIXME: we may have to deal with multi-command sequences. -+ ;; -+ '$CC '*) -+ # Test whether the compiler implicitly links with -lc since on some -+ # systems, -lgcc has to come before -lc. If gcc already passes -lc -+ # to ld, don't add -lc before -lgcc. -+ AC_MSG_CHECKING([whether -lc should be explicitly linked in]) -+ $rm conftest* -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then -+ soname=conftest -+ lib=conftest -+ libobjs=conftest.$ac_objext -+ deplibs= -+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) -+ compiler_flags=-v -+ linker_flags=-v -+ verstring= -+ output_objdir=. -+ libname=conftest -+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)= -+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) -+ then -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -+ else -+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes -+ fi -+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag -+ else -+ cat conftest.err 1>&5 -+ fi -+ $rm conftest* -+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) -+ ;; -+ esac -+ fi -+ ;; -+esac -+])# AC_LIBTOOL_PROG_LD_SHLIBS -+ -+ -+# _LT_AC_FILE_LTDLL_C -+# ------------------- -+# Be careful that the start marker always follows a newline. -+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -+# /* ltdll.c starts here */ -+# #define WIN32_LEAN_AND_MEAN -+# #include -+# #undef WIN32_LEAN_AND_MEAN -+# #include -+# -+# #ifndef __CYGWIN__ -+# # ifdef __CYGWIN32__ -+# # define __CYGWIN__ __CYGWIN32__ -+# # endif -+# #endif -+# -+# #ifdef __cplusplus -+# extern "C" { -+# #endif -+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -+# #ifdef __cplusplus -+# } -+# #endif -+# -+# #ifdef __CYGWIN__ -+# #include -+# DECLARE_CYGWIN_DLL( DllMain ); -+# #endif -+# HINSTANCE __hDllInstance_base; -+# -+# BOOL APIENTRY -+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -+# { -+# __hDllInstance_base = hInst; -+# return TRUE; -+# } -+# /* ltdll.c ends here */ -+])# _LT_AC_FILE_LTDLL_C -+ -+ -+# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -+# --------------------------------- -+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) -+ -+ -+# old names -+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) -+ -+# This is just to silence aclocal about the macro not being used -+ifelse([AC_DISABLE_FAST_INSTALL]) -+ -+AC_DEFUN([LT_AC_PROG_GCJ], -+[AC_CHECK_TOOL(GCJ, gcj, no) -+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" -+ AC_SUBST(GCJFLAGS) -+]) -+ -+AC_DEFUN([LT_AC_PROG_RC], -+[AC_CHECK_TOOL(RC, windres, no) -+]) -+ -+# NOTE: This macro has been submitted for inclusion into # -+# GNU Autoconf as AC_PROG_SED. When it is available in # -+# a released version of Autoconf we should remove this # -+# macro and use it instead. # -+# LT_AC_PROG_SED -+# -------------- -+# Check for a fully-functional sed program, that truncates -+# as few characters as possible. Prefer GNU sed if found. -+AC_DEFUN([LT_AC_PROG_SED], -+[AC_MSG_CHECKING([for a sed that does not truncate output]) -+AC_CACHE_VAL(lt_cv_path_SED, -+[# Loop through the user's path and test for sed and gsed. -+# Then use that list of sed's as ones to test for truncation. -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for lt_ac_prog in sed gsed; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then -+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" -+ fi -+ done -+ done -+done -+lt_ac_max=0 -+lt_ac_count=0 -+# Add /usr/xpg4/bin/sed as it is typically found on Solaris -+# along with /bin/sed that truncates output. -+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do -+ test ! -f $lt_ac_sed && continue -+ cat /dev/null > conftest.in -+ lt_ac_count=0 -+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in -+ # Check for GNU sed and select it if it is found. -+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then -+ lt_cv_path_SED=$lt_ac_sed -+ break -+ fi -+ while true; do -+ cat conftest.in conftest.in >conftest.tmp -+ mv conftest.tmp conftest.in -+ cp conftest.in conftest.nl -+ echo >>conftest.nl -+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break -+ cmp -s conftest.out conftest.nl || break -+ # 10000 chars as input seems more than enough -+ test $lt_ac_count -gt 10 && break -+ lt_ac_count=`expr $lt_ac_count + 1` -+ if test $lt_ac_count -gt $lt_ac_max; then -+ lt_ac_max=$lt_ac_count -+ lt_cv_path_SED=$lt_ac_sed -+ fi -+ done -+done -+]) -+SED=$lt_cv_path_SED -+AC_MSG_RESULT([$SED]) -+]) -+ -+# longdouble.m4 serial 1 (gettext-0.12) -+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+dnl Test whether the compiler supports the 'long double' type. -+dnl Prerequisite: AC_PROG_CC -+ -+AC_DEFUN([gt_TYPE_LONGDOUBLE], -+[ -+ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, -+ [if test "$GCC" = yes; then -+ gt_cv_c_long_double=yes -+ else -+ AC_TRY_COMPILE([ -+ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ -+ long double foo = 0.0; -+ /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ -+ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; -+ ], , -+ gt_cv_c_long_double=yes, gt_cv_c_long_double=no) -+ fi]) -+ if test $gt_cv_c_long_double = yes; then -+ AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) -+ fi -+]) -+ -+# longlong.m4 serial 5 -+dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Paul Eggert. -+ -+# Define HAVE_LONG_LONG if 'long long' works. -+ -+AC_DEFUN([gl_AC_TYPE_LONG_LONG], -+[ -+ AC_CACHE_CHECK([for long long], ac_cv_type_long_long, -+ [AC_TRY_LINK([long long ll = 1LL; int i = 63;], -+ [long long llmax = (long long) -1; -+ return ll << i | ll >> i | llmax / ll | llmax % ll;], -+ ac_cv_type_long_long=yes, -+ ac_cv_type_long_long=no)]) -+ if test $ac_cv_type_long_long = yes; then -+ AC_DEFINE(HAVE_LONG_LONG, 1, -+ [Define if you have the 'long long' type.]) -+ fi -+]) -+ -+# nls.m4 serial 2 (gettext-0.14.3) -+dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+dnl -+dnl This file can can be used in projects which are not available under -+dnl the GNU General Public License or the GNU Library General Public -+dnl License but which still want to provide support for the GNU gettext -+dnl functionality. -+dnl Please note that the actual code of the GNU gettext library is covered -+dnl by the GNU Library General Public License, and the rest of the GNU -+dnl gettext package package is covered by the GNU General Public License. -+dnl They are *not* in the public domain. -+ -+dnl Authors: -+dnl Ulrich Drepper , 1995-2000. -+dnl Bruno Haible , 2000-2003. -+ -+AC_PREREQ(2.50) -+ -+AC_DEFUN([AM_NLS], -+[ -+ AC_MSG_CHECKING([whether NLS is requested]) -+ dnl Default is enabled NLS -+ AC_ARG_ENABLE(nls, -+ [ --disable-nls do not use Native Language Support], -+ USE_NLS=$enableval, USE_NLS=yes) -+ AC_MSG_RESULT($USE_NLS) -+ AC_SUBST(USE_NLS) -+]) -+ -+AC_DEFUN([AM_MKINSTALLDIRS], -+[ -+ dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing. -+ m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])]) -+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly -+ dnl find the mkinstalldirs script in another subdir but $(top_srcdir). -+ dnl Try to locate it. -+ MKINSTALLDIRS= -+ if test -n "$ac_aux_dir"; then -+ case "$ac_aux_dir" in -+ /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; -+ *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; -+ esac -+ fi -+ if test -z "$MKINSTALLDIRS"; then -+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" -+ fi -+ AC_SUBST(MKINSTALLDIRS) -+]) -+ -+# po.m4 serial 7 (gettext-0.14.3) -+dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+dnl -+dnl This file can can be used in projects which are not available under -+dnl the GNU General Public License or the GNU Library General Public -+dnl License but which still want to provide support for the GNU gettext -+dnl functionality. -+dnl Please note that the actual code of the GNU gettext library is covered -+dnl by the GNU Library General Public License, and the rest of the GNU -+dnl gettext package package is covered by the GNU General Public License. -+dnl They are *not* in the public domain. -+ -+dnl Authors: -+dnl Ulrich Drepper , 1995-2000. -+dnl Bruno Haible , 2000-2003. -+ -+AC_PREREQ(2.50) -+ -+dnl Checks for all prerequisites of the po subdirectory. -+AC_DEFUN([AM_PO_SUBDIRS], -+[ -+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl -+ AC_REQUIRE([AC_PROG_INSTALL])dnl -+ AC_REQUIRE([AM_MKINSTALLDIRS])dnl -+ AC_REQUIRE([AM_NLS])dnl -+ -+ dnl Perform the following tests also if --disable-nls has been given, -+ dnl because they are needed for "make dist" to work. -+ -+ dnl Search for GNU msgfmt in the PATH. -+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. -+ dnl The second test excludes FreeBSD msgfmt. -+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, -+ [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && -+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], -+ :) -+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) -+ -+ dnl Search for GNU xgettext 0.12 or newer in the PATH. -+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions. -+ dnl The second test excludes FreeBSD xgettext. -+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, -+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && -+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], -+ :) -+ dnl Remove leftover from FreeBSD xgettext call. -+ rm -f messages.po -+ -+ dnl Search for GNU msgmerge 0.11 or newer in the PATH. -+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, -+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) -+ -+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. -+ dnl Test whether we really found GNU msgfmt. -+ if test "$GMSGFMT" != ":"; then -+ dnl If it is no GNU msgfmt we define it as : so that the -+ dnl Makefiles still can work. -+ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && -+ (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -+ : ; -+ else -+ GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` -+ AC_MSG_RESULT( -+ [found $GMSGFMT program is not GNU msgfmt; ignore it]) -+ GMSGFMT=":" -+ fi -+ fi -+ -+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. -+ dnl Test whether we really found GNU xgettext. -+ if test "$XGETTEXT" != ":"; then -+ dnl If it is no GNU xgettext we define it as : so that the -+ dnl Makefiles still can work. -+ if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && -+ (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -+ : ; -+ else -+ AC_MSG_RESULT( -+ [found xgettext program is not GNU xgettext; ignore it]) -+ XGETTEXT=":" -+ fi -+ dnl Remove leftover from FreeBSD xgettext call. -+ rm -f messages.po -+ fi -+ -+ AC_OUTPUT_COMMANDS([ -+ for ac_file in $CONFIG_FILES; do -+ # Support "outfile[:infile[:infile...]]" -+ case "$ac_file" in -+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; -+ esac -+ # PO directories have a Makefile.in generated from Makefile.in.in. -+ case "$ac_file" in */Makefile.in) -+ # Adjust a relative srcdir. -+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` -+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" -+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` -+ # In autoconf-2.13 it is called $ac_given_srcdir. -+ # In autoconf-2.50 it is called $srcdir. -+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" -+ case "$ac_given_srcdir" in -+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; -+ /*) top_srcdir="$ac_given_srcdir" ;; -+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;; -+ esac -+ # Treat a directory as a PO directory if and only if it has a -+ # POTFILES.in file. This allows packages to have multiple PO -+ # directories under different names or in different locations. -+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then -+ rm -f "$ac_dir/POTFILES" -+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" -+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" -+ POMAKEFILEDEPS="POTFILES.in" -+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend -+ # on $ac_dir but don't depend on user-specified configuration -+ # parameters. -+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then -+ # The LINGUAS file contains the set of available languages. -+ if test -n "$OBSOLETE_ALL_LINGUAS"; then -+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" -+ fi -+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` -+ # Hide the ALL_LINGUAS assigment from automake. -+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_' -+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" -+ else -+ # The set of available languages was given in configure.in. -+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' -+ fi -+ # Compute POFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) -+ # Compute UPDATEPOFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) -+ # Compute DUMMYPOFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) -+ # Compute GMOFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) -+ case "$ac_given_srcdir" in -+ .) srcdirpre= ;; -+ *) srcdirpre='$(srcdir)/' ;; -+ esac -+ POFILES= -+ UPDATEPOFILES= -+ DUMMYPOFILES= -+ GMOFILES= -+ for lang in $ALL_LINGUAS; do -+ POFILES="$POFILES $srcdirpre$lang.po" -+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" -+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop" -+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo" -+ done -+ # CATALOGS depends on both $ac_dir and the user's LINGUAS -+ # environment variable. -+ INST_LINGUAS= -+ if test -n "$ALL_LINGUAS"; then -+ for presentlang in $ALL_LINGUAS; do -+ useit=no -+ if test "%UNSET%" != "$LINGUAS"; then -+ desiredlanguages="$LINGUAS" -+ else -+ desiredlanguages="$ALL_LINGUAS" -+ fi -+ for desiredlang in $desiredlanguages; do -+ # Use the presentlang catalog if desiredlang is -+ # a. equal to presentlang, or -+ # b. a variant of presentlang (because in this case, -+ # presentlang can be used as a fallback for messages -+ # which are not translated in the desiredlang catalog). -+ case "$desiredlang" in -+ "$presentlang"*) useit=yes;; -+ esac -+ done -+ if test $useit = yes; then -+ INST_LINGUAS="$INST_LINGUAS $presentlang" -+ fi -+ done -+ fi -+ CATALOGS= -+ if test -n "$INST_LINGUAS"; then -+ for lang in $INST_LINGUAS; do -+ CATALOGS="$CATALOGS $lang.gmo" -+ done - fi -+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" -+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" -+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do -+ if test -f "$f"; then -+ case "$f" in -+ *.orig | *.bak | *~) ;; -+ *) cat "$f" >> "$ac_dir/Makefile" ;; -+ esac -+ fi -+ done - fi -- fi -- done -+ ;; -+ esac -+ done], -+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute -+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it -+ # from automake. -+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' -+ # Capture the value of LINGUAS because we need it to compute CATALOGS. -+ LINGUAS="${LINGUAS-%UNSET%}" -+ ]) -+]) -+ -+dnl Postprocesses a Makefile in a directory containing PO files. -+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], -+[ -+ # When this code is run, in config.status, two variables have already been -+ # set: -+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, -+ # - LINGUAS is the value of the environment variable LINGUAS at configure -+ # time. -+ -+changequote(,)dnl -+ # Adjust a relative srcdir. -+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` -+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" -+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` -+ # In autoconf-2.13 it is called $ac_given_srcdir. -+ # In autoconf-2.50 it is called $srcdir. -+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" -+ case "$ac_given_srcdir" in -+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; -+ /*) top_srcdir="$ac_given_srcdir" ;; -+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;; -+ esac -+ -+ # Find a way to echo strings without interpreting backslash. -+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then -+ gt_echo='echo' -+ else -+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then -+ gt_echo='printf %s\n' -+ else -+ echo_func () { -+ cat < "$ac_file.tmp" -+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then -+ # Add dependencies that cannot be formulated as a simple suffix rule. -+ for lang in $ALL_LINGUAS; do -+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` -+ cat >> "$ac_file.tmp" < /dev/null; then -+ # Add dependencies that cannot be formulated as a simple suffix rule. -+ for lang in $ALL_LINGUAS; do -+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` -+ cat >> "$ac_file.tmp" <> "$ac_file.tmp" < -+#include -+/* The string "%2$d %1$d", with dollar characters protected from the shell's -+ dollar expansion (possibly an autoconf bug). */ -+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; -+static char buf[100]; -+int main () -+{ -+ sprintf (buf, format, 33, 55); -+ return (strcmp (buf, "55 33") != 0); -+}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, -+ [ -+ AC_EGREP_CPP(notposix, [ -+#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ -+ notposix -+#endif -+ ], gt_cv_func_printf_posix="guessing no", -+ gt_cv_func_printf_posix="guessing yes") -+ ]) -+ ]) -+ case $gt_cv_func_printf_posix in -+ *yes) -+ AC_DEFINE(HAVE_POSIX_PRINTF, 1, -+ [Define if your printf() function supports format strings with positions.]) -+ ;; -+ esac -+]) -+ -+# progtest.m4 serial 4 (gettext-0.14.2) -+dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+dnl -+dnl This file can can be used in projects which are not available under -+dnl the GNU General Public License or the GNU Library General Public -+dnl License but which still want to provide support for the GNU gettext -+dnl functionality. -+dnl Please note that the actual code of the GNU gettext library is covered -+dnl by the GNU Library General Public License, and the rest of the GNU -+dnl gettext package package is covered by the GNU General Public License. -+dnl They are *not* in the public domain. -+ -+dnl Authors: -+dnl Ulrich Drepper , 1996. -+ -+AC_PREREQ(2.50) -+ -+# Search path for a program which passes the given test. -+ -+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -+AC_DEFUN([AM_PATH_PROG_WITH_TEST], -+[ -+# Prepare PATH_SEPARATOR. -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' -+ else -+ PATH_SEPARATOR=: -+ fi -+ rm -f conf$$.sh -+fi -+ -+# Find out how to test for executable files. Don't use a zero-byte file, -+# as systems may use methods other than mode bits to determine executability. -+cat >conf$$.file <<_ASEOF -+#! /bin/sh -+exit 0 -+_ASEOF -+chmod +x conf$$.file -+if test -x conf$$.file >/dev/null 2>&1; then -+ ac_executable_p="test -x" -+else -+ ac_executable_p="test -f" -+fi -+rm -f conf$$.file -+ -+# Extract the first word of "$2", so it can be a program name with args. -+set dummy $2; ac_word=[$]2 -+AC_MSG_CHECKING([for $ac_word]) -+AC_CACHE_VAL(ac_cv_path_$1, -+[case "[$]$1" in -+ [[\\/]]* | ?:[[\\/]]*) -+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path. -+ ;; -+ *) -+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR -+ for ac_dir in ifelse([$5], , $PATH, [$5]); do -+ IFS="$ac_save_IFS" -+ test -z "$ac_dir" && ac_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then -+ echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD -+ if [$3]; then -+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" -+ break 2 -+ fi -+ fi - done -- fi -- fi -- if test "X$ltrpathdirs" != "X"; then -- dnl When using libtool, the option that works for both libraries and -- dnl executables is -R. The -R options are cumulative. -- for found_dir in $ltrpathdirs; do -- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done -+ IFS="$ac_save_IFS" -+dnl If no 4th arg is given, leave the cache variable unset, -+dnl so AC_PATH_PROGS will keep looking. -+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -+])dnl -+ ;; -+esac])dnl -+$1="$ac_cv_path_$1" -+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then -+ AC_MSG_RESULT([$]$1) -+else -+ AC_MSG_RESULT(no) -+fi -+AC_SUBST($1)dnl -+]) -+ -+# signed.m4 serial 1 (gettext-0.10.40) -+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+ -+AC_DEFUN([bh_C_SIGNED], -+[ -+ AC_CACHE_CHECK([for signed], bh_cv_c_signed, -+ [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) -+ if test $bh_cv_c_signed = no; then -+ AC_DEFINE(signed, , -+ [Define to empty if the C compiler doesn't support this keyword.]) - fi - ]) - --dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, --dnl unless already present in VAR. --dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes --dnl contains two or three consecutive elements that belong together. --AC_DEFUN([AC_LIB_APPENDTOVAR], -+# size_max.m4 serial 2 -+dnl Copyright (C) 2003 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+ -+AC_DEFUN([gl_SIZE_MAX], - [ -- for element in [$2]; do -- haveit= -- for x in $[$1]; do -- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -- if test "X$x" = "X$element"; then -- haveit=yes -- break -+ AC_CHECK_HEADERS(stdint.h) -+ dnl First test whether the system already has SIZE_MAX. -+ AC_MSG_CHECKING([for SIZE_MAX]) -+ result= -+ AC_EGREP_CPP([Found it], [ -+#include -+#if HAVE_STDINT_H -+#include -+#endif -+#ifdef SIZE_MAX -+Found it -+#endif -+], result=yes) -+ if test -z "$result"; then -+ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider -+ dnl than the type 'unsigned long'. -+ dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', -+ dnl which is guaranteed to work from LONG_MIN to LONG_MAX. -+ _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, -+ [#include ], result=?) -+ _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, -+ [#include ], result=?) -+ _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, -+ [#include ], result=?) -+ if test "$fits_in_uint" = 1; then -+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type -+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. -+ AC_TRY_COMPILE([#include -+ extern size_t foo; -+ extern unsigned long foo; -+ ], [], fits_in_uint=0) -+ fi -+ if test -z "$result"; then -+ if test "$fits_in_uint" = 1; then -+ result="$res_hi$res_lo"U -+ else -+ result="$res_hi$res_lo"UL - fi -- done -- if test -z "$haveit"; then -- [$1]="${[$1]}${[$1]:+ }$element" -+ else -+ dnl Shouldn't happen, but who knows... -+ result='~(size_t)0' - fi -- done -+ fi -+ AC_MSG_RESULT([$result]) -+ if test "$result" != yes; then -+ AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], -+ [Define as the maximum value of type 'size_t', if the system doesn't define it.]) -+ fi - ]) - --# lib-ld.m4 serial 1 (gettext-0.11) --dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# stdint_h.m4 serial 5 -+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. - --dnl Subroutines of libtool.m4, --dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision --dnl with libtool.m4. -+dnl From Paul Eggert. - --dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. --AC_DEFUN([AC_LIB_PROG_LD_GNU], --[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, --[# I'd rather use --version here, but apparently some GNU ld's only accept -v. --if $LD -v 2>&1 &5; then -- acl_cv_prog_gnu_ld=yes --else -- acl_cv_prog_gnu_ld=no --fi]) --with_gnu_ld=$acl_cv_prog_gnu_ld -+# Define HAVE_STDINT_H_WITH_UINTMAX if exists, -+# doesn't clash with , and declares uintmax_t. -+ -+AC_DEFUN([gl_AC_HEADER_STDINT_H], -+[ -+ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, -+ [AC_TRY_COMPILE( -+ [#include -+#include ], -+ [uintmax_t i = (uintmax_t) -1;], -+ gl_cv_header_stdint_h=yes, -+ gl_cv_header_stdint_h=no)]) -+ if test $gl_cv_header_stdint_h = yes; then -+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, -+ [Define if exists, doesn't clash with , -+ and declares uintmax_t. ]) -+ fi -+]) -+ -+# uintmax_t.m4 serial 9 -+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Paul Eggert. -+ -+AC_PREREQ(2.13) -+ -+# Define uintmax_t to 'unsigned long' or 'unsigned long long' -+# if it is not already defined in or . -+ -+AC_DEFUN([gl_AC_TYPE_UINTMAX_T], -+[ -+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) -+ AC_REQUIRE([gl_AC_HEADER_STDINT_H]) -+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then -+ AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) -+ test $ac_cv_type_unsigned_long_long = yes \ -+ && ac_type='unsigned long long' \ -+ || ac_type='unsigned long' -+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, -+ [Define to unsigned long or unsigned long long -+ if and don't define.]) -+ else -+ AC_DEFINE(HAVE_UINTMAX_T, 1, -+ [Define if you have the 'uintmax_t' type in or .]) -+ fi -+]) -+ -+# ulonglong.m4 serial 4 -+dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Paul Eggert. -+ -+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. -+ -+AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], -+[ -+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, -+ [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], -+ [unsigned long long ullmax = (unsigned long long) -1; -+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;], -+ ac_cv_type_unsigned_long_long=yes, -+ ac_cv_type_unsigned_long_long=no)]) -+ if test $ac_cv_type_unsigned_long_long = yes; then -+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, -+ [Define if you have the 'unsigned long long' type.]) -+ fi -+]) -+ -+# wchar_t.m4 serial 1 (gettext-0.12) -+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+dnl Test whether has the 'wchar_t' type. -+dnl Prerequisite: AC_PROG_CC -+ -+AC_DEFUN([gt_TYPE_WCHAR_T], -+[ -+ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, -+ [AC_TRY_COMPILE([#include -+ wchar_t foo = (wchar_t)'\0';], , -+ gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) -+ if test $gt_cv_c_wchar_t = yes; then -+ AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) -+ fi -+]) -+ -+# wint_t.m4 serial 1 (gettext-0.12) -+dnl Copyright (C) 2003 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+dnl Test whether has the 'wint_t' type. -+dnl Prerequisite: AC_PROG_CC -+ -+AC_DEFUN([gt_TYPE_WINT_T], -+[ -+ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, -+ [AC_TRY_COMPILE([#include -+ wint_t foo = (wchar_t)'\0';], , -+ gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) -+ if test $gt_cv_c_wint_t = yes; then -+ AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) -+ fi -+]) -+ -+# xsize.m4 serial 3 -+dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+AC_DEFUN([gl_XSIZE], -+[ -+ dnl Prerequisites of lib/xsize.h. -+ AC_REQUIRE([gl_SIZE_MAX]) -+ AC_REQUIRE([AC_C_INLINE]) -+ AC_CHECK_HEADERS(stdint.h) -+]) -+ -+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# AM_AUTOMAKE_VERSION(VERSION) -+# ---------------------------- -+# Automake X.Y traces this macro to ensure aclocal.m4 has been -+# generated from the m4 files accompanying Automake X.Y. -+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) -+ -+# AM_SET_CURRENT_AUTOMAKE_VERSION -+# ------------------------------- -+# Call AM_AUTOMAKE_VERSION so it can be traced. -+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -+ [AM_AUTOMAKE_VERSION([1.9.6])]) -+ -+# AM_AUX_DIR_EXPAND -*- Autoconf -*- -+ -+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -+# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -+# -+# Of course, Automake must honor this variable whenever it calls a -+# tool from the auxiliary directory. The problem is that $srcdir (and -+# therefore $ac_aux_dir as well) can be either absolute or relative, -+# depending on how configure is run. This is pretty annoying, since -+# it makes $ac_aux_dir quite unusable in subdirectories: in the top -+# source directory, any form will work fine, but in subdirectories a -+# relative path needs to be adjusted first. -+# -+# $ac_aux_dir/missing -+# fails when called from a subdirectory if $ac_aux_dir is relative -+# $top_srcdir/$ac_aux_dir/missing -+# fails if $ac_aux_dir is absolute, -+# fails when called from a subdirectory in a VPATH build with -+# a relative $ac_aux_dir -+# -+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -+# are both prefixed by $srcdir. In an in-source build this is usually -+# harmless because $srcdir is `.', but things will broke when you -+# start a VPATH build or use an absolute $srcdir. -+# -+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -+# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -+# and then we would define $MISSING as -+# MISSING="\${SHELL} $am_aux_dir/missing" -+# This will work as long as MISSING is not called from configure, because -+# unfortunately $(top_srcdir) has no meaning in configure. -+# However there are other variables, like CC, which are often used in -+# configure, and could therefore not use this "fixed" $ac_aux_dir. -+# -+# Another solution, used here, is to always expand $ac_aux_dir to an -+# absolute PATH. The drawback is that using absolute paths prevent a -+# configured tree to be moved without reconfiguration. -+ -+AC_DEFUN([AM_AUX_DIR_EXPAND], -+[dnl Rely on autoconf to set up CDPATH properly. -+AC_PREREQ([2.50])dnl -+# expand $ac_aux_dir to an absolute path -+am_aux_dir=`cd $ac_aux_dir && pwd` - ]) - --dnl From libtool-1.4. Sets the variable LD. --AC_DEFUN([AC_LIB_PROG_LD], --[AC_ARG_WITH(gnu-ld, --[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], --test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) --AC_REQUIRE([AC_PROG_CC])dnl --AC_REQUIRE([AC_CANONICAL_HOST])dnl --ac_prog=ld --if test "$GCC" = yes; then -- # Check if gcc -print-prog-name=ld gives a path. -- AC_MSG_CHECKING([for ld used by GCC]) -- case $host in -- *-*-mingw*) -- # gcc leaves a trailing carriage return which upsets mingw -- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; -- *) -- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; -- esac -- case $ac_prog in -- # Accept absolute paths. -- [[\\/]* | [A-Za-z]:[\\/]*)] -- [re_direlt='/[^/][^/]*/\.\./'] -- # Canonicalize the path of ld -- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` -- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` -- done -- test -z "$LD" && LD="$ac_prog" -- ;; -- "") -- # If it fails, then pretend we aren't using GCC. -- ac_prog=ld -- ;; -- *) -- # If it is relative, then search for the first ld in PATH. -- with_gnu_ld=unknown -- ;; -- esac --elif test "$with_gnu_ld" = yes; then -- AC_MSG_CHECKING([for GNU ld]) --else -- AC_MSG_CHECKING([for non-GNU ld]) --fi --AC_CACHE_VAL(acl_cv_path_LD, --[if test -z "$LD"; then -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" -- for ac_dir in $PATH; do -- test -z "$ac_dir" && ac_dir=. -- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then -- acl_cv_path_LD="$ac_dir/$ac_prog" -- # Check to see if the program is GNU ld. I'd rather use --version, -- # but apparently some GNU ld's only accept -v. -- # Break only if it was the GNU/non-GNU ld that we prefer. -- if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then -- test "$with_gnu_ld" != no && break -+# AM_CONDITIONAL -*- Autoconf -*- -+ -+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 -+# Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# serial 7 -+ -+# AM_CONDITIONAL(NAME, SHELL-CONDITION) -+# ------------------------------------- -+# Define a conditional. -+AC_DEFUN([AM_CONDITIONAL], -+[AC_PREREQ(2.52)dnl -+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], -+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -+AC_SUBST([$1_TRUE]) -+AC_SUBST([$1_FALSE]) -+if $2; then -+ $1_TRUE= -+ $1_FALSE='#' -+else -+ $1_TRUE='#' -+ $1_FALSE= -+fi -+AC_CONFIG_COMMANDS_PRE( -+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then -+ AC_MSG_ERROR([[conditional "$1" was never defined. -+Usually this means the macro was only invoked conditionally.]]) -+fi])]) -+ -+ -+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -+# Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# serial 8 -+ -+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -+# written in clear, in which case automake, when reading aclocal.m4, -+# will think it sees a *use*, and therefore will trigger all it's -+# C support machinery. Also note that it means that autoscan, seeing -+# CC etc. in the Makefile, will ask for an AC_PROG_CC use... -+ -+ -+# _AM_DEPENDENCIES(NAME) -+# ---------------------- -+# See how the compiler implements dependency checking. -+# NAME is "CC", "CXX", "GCJ", or "OBJC". -+# We try a few techniques and use that to set a single cache variable. -+# -+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -+# dependency, and given that the user is not expected to run this macro, -+# just rely on AC_PROG_CC. -+AC_DEFUN([_AM_DEPENDENCIES], -+[AC_REQUIRE([AM_SET_DEPDIR])dnl -+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -+AC_REQUIRE([AM_MAKE_INCLUDE])dnl -+AC_REQUIRE([AM_DEP_TRACK])dnl -+ -+ifelse([$1], CC, [depcc="$CC" am_compiler_list=], -+ [$1], CXX, [depcc="$CXX" am_compiler_list=], -+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], -+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], -+ [depcc="$$1" am_compiler_list=]) -+ -+AC_CACHE_CHECK([dependency style of $depcc], -+ [am_cv_$1_dependencies_compiler_type], -+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then -+ # We make a subdir and do the tests there. Otherwise we can end up -+ # making bogus files that we don't know about and never remove. For -+ # instance it was reported that on HP-UX the gcc test will end up -+ # making a dummy file named `D' -- because `-MD' means `put the output -+ # in D'. -+ mkdir conftest.dir -+ # Copy depcomp to subdir because otherwise we won't find it if we're -+ # using a relative directory. -+ cp "$am_depcomp" conftest.dir -+ cd conftest.dir -+ # We will build objects and dependencies in a subdirectory because -+ # it helps to detect inapplicable dependency modes. For instance -+ # both Tru64's cc and ICC support -MD to output dependencies as a -+ # side effect of compilation, but ICC will put the dependencies in -+ # the current directory while Tru64 will put them in the object -+ # directory. -+ mkdir sub -+ -+ am_cv_$1_dependencies_compiler_type=none -+ if test "$am_compiler_list" = ""; then -+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` -+ fi -+ for depmode in $am_compiler_list; do -+ # Setup a source with many dependencies, because some compilers -+ # like to wrap large dependency lists on column 80 (with \), and -+ # we should not choose a depcomp mode which is confused by this. -+ # -+ # We need to recreate these files for each test, as the compiler may -+ # overwrite some of them when testing with obscure command lines. -+ # This happens at least with the AIX C compiler. -+ : > sub/conftest.c -+ for i in 1 2 3 4 5 6; do -+ echo '#include "conftst'$i'.h"' >> sub/conftest.c -+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with -+ # Solaris 8's {/usr,}/bin/sh. -+ touch sub/conftst$i.h -+ done -+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -+ -+ case $depmode in -+ nosideeffect) -+ # after this tag, mechanisms are not by side-effect, so they'll -+ # only be used when explicitly requested -+ if test "x$enable_dependency_tracking" = xyes; then -+ continue - else -- test "$with_gnu_ld" != yes && break -+ break -+ fi -+ ;; -+ none) break ;; -+ esac -+ # We check with `-c' and `-o' for the sake of the "dashmstdout" -+ # mode. It turns out that the SunPro C++ compiler does not properly -+ # handle `-M -o', and we need to detect this. -+ if depmode=$depmode \ -+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ -+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ -+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ -+ >/dev/null 2>conftest.err && -+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && -+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && -+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -+ # icc doesn't choke on unknown options, it will just issue warnings -+ # or remarks (even with -Werror). So we grep stderr for any message -+ # that says an option was ignored or not supported. -+ # When given -MP, icc 7.0 and 7.1 complain thusly: -+ # icc: Command line warning: ignoring option '-M'; no argument required -+ # The diagnosis changed in icc 8.0: -+ # icc: Command line remark: option '-MP' not supported -+ if (grep 'ignoring option' conftest.err || -+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else -+ am_cv_$1_dependencies_compiler_type=$depmode -+ break - fi - fi - done -- IFS="$ac_save_ifs" --else -- acl_cv_path_LD="$LD" # Let the user override the test with a path. --fi]) --LD="$acl_cv_path_LD" --if test -n "$LD"; then -- AC_MSG_RESULT($LD) -+ -+ cd .. -+ rm -rf conftest.dir - else -- AC_MSG_RESULT(no) -+ am_cv_$1_dependencies_compiler_type=none - fi --test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) --AC_LIB_PROG_LD_GNU -+]) -+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -+AM_CONDITIONAL([am__fastdep$1], [ -+ test "x$enable_dependency_tracking" != xno \ -+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) - ]) - --# iconv.m4 serial AM4 (gettext-0.11.3) --dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. - --dnl From Bruno Haible. -+# AM_SET_DEPDIR -+# ------------- -+# Choose a directory name for dependency files. -+# This macro is AC_REQUIREd in _AM_DEPENDENCIES -+AC_DEFUN([AM_SET_DEPDIR], -+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -+]) - --AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], --[ -- dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. -- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -- AC_REQUIRE([AC_LIB_RPATH]) - -- dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV -- dnl accordingly. -- AC_LIB_LINKFLAGS_BODY([iconv]) -+# AM_DEP_TRACK -+# ------------ -+AC_DEFUN([AM_DEP_TRACK], -+[AC_ARG_ENABLE(dependency-tracking, -+[ --disable-dependency-tracking speeds up one-time build -+ --enable-dependency-tracking do not reject slow dependency extractors]) -+if test "x$enable_dependency_tracking" != xno; then -+ am_depcomp="$ac_aux_dir/depcomp" -+ AMDEPBACKSLASH='\' -+fi -+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -+AC_SUBST([AMDEPBACKSLASH]) - ]) - --AC_DEFUN([AM_ICONV_LINK], --[ -- dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and -- dnl those with the standalone portable GNU libiconv installed). -+# Generate code to set up dependency tracking. -*- Autoconf -*- - -- dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV -- dnl accordingly. -- AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) -+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -+# Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - -- dnl Add $INCICONV to CPPFLAGS before performing the following checks, -- dnl because if the user has installed libiconv and not disabled its use -- dnl via --without-libiconv-prefix, he wants to use it. The first -- dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. -- am_save_CPPFLAGS="$CPPFLAGS" -- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) -+#serial 3 - -- AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ -- am_cv_func_iconv="no, consider installing GNU libiconv" -- am_cv_lib_iconv=no -- AC_TRY_LINK([#include --#include ], -- [iconv_t cd = iconv_open("",""); -- iconv(cd,NULL,NULL,NULL,NULL); -- iconv_close(cd);], -- am_cv_func_iconv=yes) -- if test "$am_cv_func_iconv" != yes; then -- am_save_LIBS="$LIBS" -- LIBS="$LIBS $LIBICONV" -- AC_TRY_LINK([#include --#include ], -- [iconv_t cd = iconv_open("",""); -- iconv(cd,NULL,NULL,NULL,NULL); -- iconv_close(cd);], -- am_cv_lib_iconv=yes -- am_cv_func_iconv=yes) -- LIBS="$am_save_LIBS" -- fi -- ]) -- if test "$am_cv_func_iconv" = yes; then -- AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) -- fi -- if test "$am_cv_lib_iconv" = yes; then -- AC_MSG_CHECKING([how to link with libiconv]) -- AC_MSG_RESULT([$LIBICONV]) -+# _AM_OUTPUT_DEPENDENCY_COMMANDS -+# ------------------------------ -+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -+[for mf in $CONFIG_FILES; do -+ # Strip MF so we end up with the name of the file. -+ mf=`echo "$mf" | sed -e 's/:.*$//'` -+ # Check whether this is an Automake generated Makefile or not. -+ # We used to match only the files named `Makefile.in', but -+ # some people rename them; so instead we look at the file content. -+ # Grep'ing the first line is not enough: some people post-process -+ # each Makefile.in and add a new line on top of each file to say so. -+ # So let's grep whole file. -+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then -+ dirpart=`AS_DIRNAME("$mf")` - else -- dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV -- dnl either. -- CPPFLAGS="$am_save_CPPFLAGS" -- LIBICONV= -- LTLIBICONV= -+ continue - fi -- AC_SUBST(LIBICONV) -- AC_SUBST(LTLIBICONV) --]) -+ # Extract the definition of DEPDIR, am__include, and am__quote -+ # from the Makefile without running `make'. -+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` -+ test -z "$DEPDIR" && continue -+ am__include=`sed -n 's/^am__include = //p' < "$mf"` -+ test -z "am__include" && continue -+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"` -+ # When using ansi2knr, U may be empty or an underscore; expand it -+ U=`sed -n 's/^U = //p' < "$mf"` -+ # Find all dependency output files, they are included files with -+ # $(DEPDIR) in their names. We invoke sed twice because it is the -+ # simplest approach to changing $(DEPDIR) to its actual value in the -+ # expansion. -+ for file in `sed -n " -+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ -+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do -+ # Make sure the directory exists. -+ test -f "$dirpart/$file" && continue -+ fdir=`AS_DIRNAME(["$file"])` -+ AS_MKDIR_P([$dirpart/$fdir]) -+ # echo "creating $dirpart/$file" -+ echo '# dummy' > "$dirpart/$file" -+ done -+done -+])# _AM_OUTPUT_DEPENDENCY_COMMANDS - --AC_DEFUN([AM_ICONV], --[ -- AM_ICONV_LINK -- if test "$am_cv_func_iconv" = yes; then -- AC_MSG_CHECKING([for iconv declaration]) -- AC_CACHE_VAL(am_cv_proto_iconv, [ -- AC_TRY_COMPILE([ --#include --#include --extern --#ifdef __cplusplus --"C" --#endif --#if defined(__STDC__) || defined(__cplusplus) --size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); --#else --size_t iconv(); --#endif --], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") -- am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) -- am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` -- AC_MSG_RESULT([$]{ac_t:- -- }[$]am_cv_proto_iconv) -- AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, -- [Define as const if the declaration of iconv() needs const.]) -- fi -+ -+# AM_OUTPUT_DEPENDENCY_COMMANDS -+# ----------------------------- -+# This macro should only be invoked once -- use via AC_REQUIRE. -+# -+# This code is only required when automatic dependency tracking -+# is enabled. FIXME. This creates each `.P' file that we will -+# need in order to bootstrap the dependency handling code. -+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -+[AC_CONFIG_COMMANDS([depfiles], -+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], -+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) - ]) - --# progtest.m4 serial 2 (gettext-0.10.40) --dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. --dnl --dnl This file can can be used in projects which are not available under --dnl the GNU General Public License or the GNU Library General Public --dnl License but which still want to provide support for the GNU gettext --dnl functionality. --dnl Please note that the actual code of the GNU gettext library is covered --dnl by the GNU Library General Public License, and the rest of the GNU --dnl gettext package package is covered by the GNU General Public License. --dnl They are *not* in the public domain. -+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -+# Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# serial 8 - --dnl Authors: --dnl Ulrich Drepper , 1996. -+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - --# Search path for a program which passes the given test. -+# Do all the work for Automake. -*- Autoconf -*- - --dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, --dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) --AC_DEFUN([AM_PATH_PROG_WITH_TEST], --[# Extract the first word of "$2", so it can be a program name with args. --set dummy $2; ac_word=[$]2 --AC_MSG_CHECKING([for $ac_word]) --AC_CACHE_VAL(ac_cv_path_$1, --[case "[$]$1" in -- /*) -- ac_cv_path_$1="[$]$1" # Let the user override the test with a path. -- ;; -- *) -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" -- for ac_dir in ifelse([$5], , $PATH, [$5]); do -- test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/$ac_word; then -- if [$3]; then -- ac_cv_path_$1="$ac_dir/$ac_word" -- break -- fi -- fi -- done -- IFS="$ac_save_ifs" --dnl If no 4th arg is given, leave the cache variable unset, --dnl so AC_PATH_PROGS will keep looking. --ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" --])dnl -- ;; --esac])dnl --$1="$ac_cv_path_$1" --if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then -- AC_MSG_RESULT([$]$1) --else -- AC_MSG_RESULT(no) --fi --AC_SUBST($1)dnl --]) -+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -+# Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --# isc-posix.m4 serial 2 (gettext-0.11.2) --dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -- --# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. -- --# This test replaces the one in autoconf. --# Currently this macro should have the same name as the autoconf macro --# because gettext's gettext.m4 (distributed in the automake package) --# still uses it. Otherwise, the use in gettext.m4 makes autoheader --# give these diagnostics: --# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX --# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX -+# serial 12 - --undefine([AC_ISC_POSIX]) -+# This macro actually does too much. Some checks are only needed if -+# your package does certain things. But this isn't really a big deal. - --AC_DEFUN([AC_ISC_POSIX], -- [ -- dnl This test replaces the obsolescent AC_ISC_POSIX kludge. -- AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) -- ] --) -+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -+# AM_INIT_AUTOMAKE([OPTIONS]) -+# ----------------------------------------------- -+# The call with PACKAGE and VERSION arguments is the old style -+# call (pre autoconf-2.50), which is being phased out. PACKAGE -+# and VERSION should now be passed to AC_INIT and removed from -+# the call to AM_INIT_AUTOMAKE. -+# We support both call styles for the transition. After -+# the next Automake release, Autoconf can make the AC_INIT -+# arguments mandatory, and then we can depend on a new Autoconf -+# release and drop the old call support. -+AC_DEFUN([AM_INIT_AUTOMAKE], -+[AC_PREREQ([2.58])dnl -+dnl Autoconf wants to disallow AM_ names. We explicitly allow -+dnl the ones we care about. -+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -+AC_REQUIRE([AC_PROG_INSTALL])dnl -+# test to see if srcdir already configured -+if test "`cd $srcdir && pwd`" != "`pwd`" && -+ test -f $srcdir/config.status; then -+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -+fi - --# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) --dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# test whether we have cygpath -+if test -z "$CYGPATH_W"; then -+ if (cygpath --version) >/dev/null 2>/dev/null; then -+ CYGPATH_W='cygpath -w' -+ else -+ CYGPATH_W=echo -+ fi -+fi -+AC_SUBST([CYGPATH_W]) - --# Test for the GNU C Library, version 2.1 or newer. --# From Bruno Haible. -+# Define the identity of the package. -+dnl Distinguish between old-style and new-style calls. -+m4_ifval([$2], -+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl -+ AC_SUBST([PACKAGE], [$1])dnl -+ AC_SUBST([VERSION], [$2])], -+[_AM_SET_OPTIONS([$1])dnl -+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl -+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - --AC_DEFUN([jm_GLIBC21], -- [ -- AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, -- ac_cv_gnu_library_2_1, -- [AC_EGREP_CPP([Lucky GNU user], -- [ --#include --#ifdef __GNU_LIBRARY__ -- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) -- Lucky GNU user -- #endif --#endif -- ], -- ac_cv_gnu_library_2_1=yes, -- ac_cv_gnu_library_2_1=no) -- ] -- ) -- AC_SUBST(GLIBC21) -- GLIBC21="$ac_cv_gnu_library_2_1" -- ] --) -+_AM_IF_OPTION([no-define],, -+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - --# intdiv0.m4 serial 1 (gettext-0.11.3) --dnl Copyright (C) 2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# Some tools Automake needs. -+AC_REQUIRE([AM_SANITY_CHECK])dnl -+AC_REQUIRE([AC_ARG_PROGRAM])dnl -+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -+AM_MISSING_PROG(AUTOCONF, autoconf) -+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -+AM_MISSING_PROG(AUTOHEADER, autoheader) -+AM_MISSING_PROG(MAKEINFO, makeinfo) -+AM_PROG_INSTALL_SH -+AM_PROG_INSTALL_STRIP -+AC_REQUIRE([AM_PROG_MKDIR_P])dnl -+# We need awk for the "check" target. The system "awk" is bad on -+# some platforms. -+AC_REQUIRE([AC_PROG_AWK])dnl -+AC_REQUIRE([AC_PROG_MAKE_SET])dnl -+AC_REQUIRE([AM_SET_LEADING_DOT])dnl -+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], -+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], -+ [_AM_PROG_TAR([v7])])]) -+_AM_IF_OPTION([no-dependencies],, -+[AC_PROVIDE_IFELSE([AC_PROG_CC], -+ [_AM_DEPENDENCIES(CC)], -+ [define([AC_PROG_CC], -+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -+AC_PROVIDE_IFELSE([AC_PROG_CXX], -+ [_AM_DEPENDENCIES(CXX)], -+ [define([AC_PROG_CXX], -+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -+]) -+]) - --dnl From Bruno Haible. - --AC_DEFUN([gt_INTDIV0], --[ -- AC_REQUIRE([AC_PROG_CC])dnl -- AC_REQUIRE([AC_CANONICAL_HOST])dnl -+# When config.status generates a header, we must update the stamp-h file. -+# This file resides in the same directory as the config header -+# that is generated. The stamp files are numbered to have different names. - -- AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], -- gt_cv_int_divbyzero_sigfpe, -- [ -- AC_TRY_RUN([ --#include --#include -+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -+# loop where config.status creates the headers, so we can generate -+# our stamp files there. -+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -+[# Compute $1's index in $config_headers. -+_am_stamp_count=1 -+for _am_header in $config_headers :; do -+ case $_am_header in -+ $1 | $1:* ) -+ break ;; -+ * ) -+ _am_stamp_count=`expr $_am_stamp_count + 1` ;; -+ esac -+done -+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - --static void --#ifdef __cplusplus --sigfpe_handler (int sig) --#else --sigfpe_handler (sig) int sig; --#endif --{ -- /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ -- exit (sig != SIGFPE); --} -+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --int x = 1; --int y = 0; --int z; --int nan; -+# AM_PROG_INSTALL_SH -+# ------------------ -+# Define $install_sh. -+AC_DEFUN([AM_PROG_INSTALL_SH], -+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -+install_sh=${install_sh-"$am_aux_dir/install-sh"} -+AC_SUBST(install_sh)]) - --int main () --{ -- signal (SIGFPE, sigfpe_handler); --/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ --#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) -- signal (SIGTRAP, sigfpe_handler); --#endif --/* Linux/SPARC yields signal SIGILL. */ --#if defined (__sparc__) && defined (__linux__) -- signal (SIGILL, sigfpe_handler); --#endif -+# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - -- z = x / y; -- nan = y / y; -- exit (1); --} --], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, -- [ -- # Guess based on the CPU. -- case "$host_cpu" in -- alpha* | i[34567]86 | m68k | s390*) -- gt_cv_int_divbyzero_sigfpe="guessing yes";; -- *) -- gt_cv_int_divbyzero_sigfpe="guessing no";; -- esac -- ]) -- ]) -- case "$gt_cv_int_divbyzero_sigfpe" in -- *yes) value=1;; -- *) value=0;; -- esac -- AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, -- [Define if integer division by zero raises signal SIGFPE.]) --]) -+# serial 2 - --# uintmax_t.m4 serial 6 (gettext-0.11) --dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# Check whether the underlying file-system supports filenames -+# with a leading dot. For instance MS-DOS doesn't. -+AC_DEFUN([AM_SET_LEADING_DOT], -+[rm -rf .tst 2>/dev/null -+mkdir .tst 2>/dev/null -+if test -d .tst; then -+ am__leading_dot=. -+else -+ am__leading_dot=_ -+fi -+rmdir .tst 2>/dev/null -+AC_SUBST([am__leading_dot])]) - --dnl From Paul Eggert. -+# Check to see how 'make' treats includes. -*- Autoconf -*- - --AC_PREREQ(2.13) -+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --# Define uintmax_t to `unsigned long' or `unsigned long long' --# if does not exist. -+# serial 3 - --AC_DEFUN([jm_AC_TYPE_UINTMAX_T], --[ -- AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) -- AC_REQUIRE([jm_AC_HEADER_STDINT_H]) -- if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then -- AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) -- test $ac_cv_type_unsigned_long_long = yes \ -- && ac_type='unsigned long long' \ -- || ac_type='unsigned long' -- AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, -- [Define to unsigned long or unsigned long long -- if and don't define.]) -- fi -+# AM_MAKE_INCLUDE() -+# ----------------- -+# Check to see how make treats includes. -+AC_DEFUN([AM_MAKE_INCLUDE], -+[am_make=${MAKE-make} -+cat > confinc << 'END' -+am__doit: -+ @echo done -+.PHONY: am__doit -+END -+# If we don't find an include directive, just comment out the code. -+AC_MSG_CHECKING([for style of include used by $am_make]) -+am__include="#" -+am__quote= -+_am_result=none -+# First try GNU make style include. -+echo "include confinc" > confmf -+# We grep out `Entering directory' and `Leaving directory' -+# messages which can occur if `w' ends up in MAKEFLAGS. -+# In particular we don't look at `^make:' because GNU make might -+# be invoked under some other name (usually "gmake"), in which -+# case it prints its new name instead of `make'. -+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then -+ am__include=include -+ am__quote= -+ _am_result=GNU -+fi -+# Now try BSD make style include. -+if test "$am__include" = "#"; then -+ echo '.include "confinc"' > confmf -+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then -+ am__include=.include -+ am__quote="\"" -+ _am_result=BSD -+ fi -+fi -+AC_SUBST([am__include]) -+AC_SUBST([am__quote]) -+AC_MSG_RESULT([$_am_result]) -+rm -f confinc confmf - ]) - --# inttypes_h.m4 serial 4 (gettext-0.11.4) --dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -+ -+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 -+# Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# serial 4 - --dnl From Paul Eggert. -+# AM_MISSING_PROG(NAME, PROGRAM) -+# ------------------------------ -+AC_DEFUN([AM_MISSING_PROG], -+[AC_REQUIRE([AM_MISSING_HAS_RUN]) -+$1=${$1-"${am_missing_run}$2"} -+AC_SUBST($1)]) - --# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, --# doesn't clash with , and declares uintmax_t. - --AC_DEFUN([jm_AC_HEADER_INTTYPES_H], --[ -- AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, -- [AC_TRY_COMPILE( -- [#include --#include ], -- [uintmax_t i = (uintmax_t) -1;], -- jm_ac_cv_header_inttypes_h=yes, -- jm_ac_cv_header_inttypes_h=no)]) -- if test $jm_ac_cv_header_inttypes_h = yes; then -- AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, --[Define if exists, doesn't clash with , -- and declares uintmax_t. ]) -- fi -+# AM_MISSING_HAS_RUN -+# ------------------ -+# Define MISSING if not defined so far and test if it supports --run. -+# If it does, set am_missing_run to use it, otherwise, to nothing. -+AC_DEFUN([AM_MISSING_HAS_RUN], -+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -+# Use eval to expand $SHELL -+if eval "$MISSING --run true"; then -+ am_missing_run="$MISSING --run " -+else -+ am_missing_run= -+ AC_MSG_WARN([`missing' script is too old or missing]) -+fi - ]) - --# stdint_h.m4 serial 2 (gettext-0.11.4) --dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --dnl From Paul Eggert. -+# AM_PROG_MKDIR_P -+# --------------- -+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -+# -+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -+# created by `make install' are always world readable, even if the -+# installer happens to have an overly restrictive umask (e.g. 077). -+# This was a mistake. There are at least two reasons why we must not -+# use `-m 0755': -+# - it causes special bits like SGID to be ignored, -+# - it may be too restrictive (some setups expect 775 directories). -+# -+# Do not use -m 0755 and let people choose whatever they expect by -+# setting umask. -+# -+# We cannot accept any implementation of `mkdir' that recognizes `-p'. -+# Some implementations (such as Solaris 8's) are not thread-safe: if a -+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -+# concurrently, both version can detect that a/ is missing, but only -+# one can create it and the other will error out. Consequently we -+# restrict ourselves to GNU make (using the --version option ensures -+# this.) -+AC_DEFUN([AM_PROG_MKDIR_P], -+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then -+ # We used to keeping the `.' as first argument, in order to -+ # allow $(mkdir_p) to be used without argument. As in -+ # $(mkdir_p) $(somedir) -+ # where $(somedir) is conditionally defined. However this is wrong -+ # for two reasons: -+ # 1. if the package is installed by a user who cannot write `.' -+ # make install will fail, -+ # 2. the above comment should most certainly read -+ # $(mkdir_p) $(DESTDIR)$(somedir) -+ # so it does not work when $(somedir) is undefined and -+ # $(DESTDIR) is not. -+ # To support the latter case, we have to write -+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), -+ # so the `.' trick is pointless. -+ mkdir_p='mkdir -p --' -+else -+ # On NextStep and OpenStep, the `mkdir' command does not -+ # recognize any option. It will interpret all options as -+ # directories to create, and then abort because `.' already -+ # exists. -+ for d in ./-p ./--version; -+ do -+ test -d $d && rmdir $d -+ done -+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. -+ if test -f "$ac_aux_dir/mkinstalldirs"; then -+ mkdir_p='$(mkinstalldirs)' -+ else -+ mkdir_p='$(install_sh) -d' -+ fi -+fi -+AC_SUBST([mkdir_p])]) - --# Define HAVE_STDINT_H_WITH_UINTMAX if exists, --# doesn't clash with , and declares uintmax_t. -+# Helper functions for option handling. -*- Autoconf -*- - --AC_DEFUN([jm_AC_HEADER_STDINT_H], --[ -- AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, -- [AC_TRY_COMPILE( -- [#include --#include ], -- [uintmax_t i = (uintmax_t) -1;], -- jm_ac_cv_header_stdint_h=yes, -- jm_ac_cv_header_stdint_h=no)]) -- if test $jm_ac_cv_header_stdint_h = yes; then -- AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, --[Define if exists, doesn't clash with , -- and declares uintmax_t. ]) -- fi --]) -+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) --dnl Copyright (C) 1999-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# serial 3 - --dnl From Paul Eggert. -+# _AM_MANGLE_OPTION(NAME) -+# ----------------------- -+AC_DEFUN([_AM_MANGLE_OPTION], -+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - --AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], --[ -- AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, -- [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], -- [unsigned long long ullmax = (unsigned long long) -1; -- return ull << i | ull >> i | ullmax / ull | ullmax % ull;], -- ac_cv_type_unsigned_long_long=yes, -- ac_cv_type_unsigned_long_long=no)]) -- if test $ac_cv_type_unsigned_long_long = yes; then -- AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, -- [Define if you have the unsigned long long type.]) -- fi --]) -+# _AM_SET_OPTION(NAME) -+# ------------------------------ -+# Set option NAME. Presently that only means defining a flag for this option. -+AC_DEFUN([_AM_SET_OPTION], -+[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - --# inttypes.m4 serial 1 (gettext-0.11.4) --dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# _AM_SET_OPTIONS(OPTIONS) -+# ---------------------------------- -+# OPTIONS is a space-separated list of Automake options. -+AC_DEFUN([_AM_SET_OPTIONS], -+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - --dnl From Paul Eggert. -+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -+# ------------------------------------------- -+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -+AC_DEFUN([_AM_IF_OPTION], -+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - --# Define HAVE_INTTYPES_H if exists and doesn't clash with --# . -+# Check to make sure that the build environment is sane. -*- Autoconf -*- - --AC_DEFUN([gt_HEADER_INTTYPES_H], --[ -- AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, -- [ -- AC_TRY_COMPILE( -- [#include --#include ], -- [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) -- ]) -- if test $gt_cv_header_inttypes_h = yes; then -- AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, -- [Define if exists and doesn't clash with .]) -- fi --]) -+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -+# Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --# inttypes-pri.m4 serial 1 (gettext-0.11.4) --dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# serial 4 - --dnl From Bruno Haible. -+# AM_SANITY_CHECK -+# --------------- -+AC_DEFUN([AM_SANITY_CHECK], -+[AC_MSG_CHECKING([whether build environment is sane]) -+# Just in case -+sleep 1 -+echo timestamp > conftest.file -+# Do `set' in a subshell so we don't clobber the current shell's -+# arguments. Must try -L first in case configure is actually a -+# symlink; some systems play weird games with the mod time of symlinks -+# (eg FreeBSD returns the mod time of the symlink's containing -+# directory). -+if ( -+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` -+ if test "$[*]" = "X"; then -+ # -L didn't work. -+ set X `ls -t $srcdir/configure conftest.file` -+ fi -+ rm -f conftest.file -+ if test "$[*]" != "X $srcdir/configure conftest.file" \ -+ && test "$[*]" != "X conftest.file $srcdir/configure"; then - --# Define PRI_MACROS_BROKEN if exists and defines the PRI* --# macros to non-string values. This is the case on AIX 4.3.3. -+ # If neither matched, then we have a broken ls. This can happen -+ # if, for instance, CONFIG_SHELL is bash and it inherits a -+ # broken ls alias from the environment. This has actually -+ # happened. Such a system could not be considered "sane". -+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -+alias in your environment]) -+ fi - --AC_DEFUN([gt_INTTYPES_PRI], --[ -- AC_REQUIRE([gt_HEADER_INTTYPES_H]) -- if test $gt_cv_header_inttypes_h = yes; then -- AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], -- gt_cv_inttypes_pri_broken, -- [ -- AC_TRY_COMPILE([#include --#ifdef PRId32 --char *p = PRId32; --#endif --], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) -- ]) -- fi -- if test "$gt_cv_inttypes_pri_broken" = yes; then -- AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, -- [Define if exists and defines unusable PRI* macros.]) -- fi --]) -+ test "$[2]" = conftest.file -+ ) -+then -+ # Ok. -+ : -+else -+ AC_MSG_ERROR([newly created file is older than distributed files! -+Check your system clock]) -+fi -+AC_MSG_RESULT(yes)]) - --# codeset.m4 serial AM1 (gettext-0.10.40) --dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. -+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --dnl From Bruno Haible. -+# AM_PROG_INSTALL_STRIP -+# --------------------- -+# One issue with vendor `install' (even GNU) is that you can't -+# specify the program used to strip binaries. This is especially -+# annoying in cross-compiling environments, where the build's strip -+# is unlikely to handle the host's binaries. -+# Fortunately install-sh will honor a STRIPPROG variable, so we -+# always use install-sh in `make install-strip', and initialize -+# STRIPPROG with the value of the STRIP variable (set by the user). -+AC_DEFUN([AM_PROG_INSTALL_STRIP], -+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -+# Installed binaries are usually stripped using `strip' when the user -+# run `make install-strip'. However `strip' might not be the right -+# tool to use in cross-compilation environments, therefore Automake -+# will honor the `STRIP' environment variable to overrule this program. -+dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -+if test "$cross_compiling" != no; then -+ AC_CHECK_TOOL([STRIP], [strip], :) -+fi -+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -+AC_SUBST([INSTALL_STRIP_PROGRAM])]) - --AC_DEFUN([AM_LANGINFO_CODESET], --[ -- AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, -- [AC_TRY_LINK([#include ], -- [char* cs = nl_langinfo(CODESET);], -- am_cv_langinfo_codeset=yes, -- am_cv_langinfo_codeset=no) -- ]) -- if test $am_cv_langinfo_codeset = yes; then -- AC_DEFINE(HAVE_LANGINFO_CODESET, 1, -- [Define if you have and nl_langinfo(CODESET).]) -- fi --]) -+# Check how to create a tarball. -*- Autoconf -*- - --# lcmessage.m4 serial 3 (gettext-0.11.3) --dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. --dnl This file is free software, distributed under the terms of the GNU --dnl General Public License. As a special exception to the GNU General --dnl Public License, this file may be distributed as part of a program --dnl that contains a configuration script generated by Autoconf, under --dnl the same distribution terms as the rest of that program. --dnl --dnl This file can can be used in projects which are not available under --dnl the GNU General Public License or the GNU Library General Public --dnl License but which still want to provide support for the GNU gettext --dnl functionality. --dnl Please note that the actual code of the GNU gettext library is covered --dnl by the GNU Library General Public License, and the rest of the GNU --dnl gettext package package is covered by the GNU General Public License. --dnl They are *not* in the public domain. -+# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. - --dnl Authors: --dnl Ulrich Drepper , 1995. -+# serial 2 - --# Check whether LC_MESSAGES is available in . -+# _AM_PROG_TAR(FORMAT) -+# -------------------- -+# Check how to create a tarball in format FORMAT. -+# FORMAT should be one of `v7', `ustar', or `pax'. -+# -+# Substitute a variable $(am__tar) that is a command -+# writing to stdout a FORMAT-tarball containing the directory -+# $tardir. -+# tardir=directory && $(am__tar) > result.tar -+# -+# Substitute a variable $(am__untar) that extract such -+# a tarball read from stdin. -+# $(am__untar) < result.tar -+AC_DEFUN([_AM_PROG_TAR], -+[# Always define AMTAR for backward compatibility. -+AM_MISSING_PROG([AMTAR], [tar]) -+m4_if([$1], [v7], -+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], -+ [m4_case([$1], [ustar],, [pax],, -+ [m4_fatal([Unknown tar format])]) -+AC_MSG_CHECKING([how to create a $1 tar archive]) -+# Loop over all known methods to create a tar archive until one works. -+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -+_am_tools=${am_cv_prog_tar_$1-$_am_tools} -+# Do not fold the above two line into one, because Tru64 sh and -+# Solaris sh will not grok spaces in the rhs of `-'. -+for _am_tool in $_am_tools -+do -+ case $_am_tool in -+ gnutar) -+ for _am_tar in tar gnutar gtar; -+ do -+ AM_RUN_LOG([$_am_tar --version]) && break -+ done -+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' -+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' -+ am__untar="$_am_tar -xf -" -+ ;; -+ plaintar) -+ # Must skip GNU tar: if it does not support --format= it doesn't create -+ # ustar tarball either. -+ (tar --version) >/dev/null 2>&1 && continue -+ am__tar='tar chf - "$$tardir"' -+ am__tar_='tar chf - "$tardir"' -+ am__untar='tar xf -' -+ ;; -+ pax) -+ am__tar='pax -L -x $1 -w "$$tardir"' -+ am__tar_='pax -L -x $1 -w "$tardir"' -+ am__untar='pax -r' -+ ;; -+ cpio) -+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L' -+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L' -+ am__untar='cpio -i -H $1 -d' -+ ;; -+ none) -+ am__tar=false -+ am__tar_=false -+ am__untar=false -+ ;; -+ esac - --AC_DEFUN([AM_LC_MESSAGES], --[ -- AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, -- [AC_TRY_LINK([#include ], [return LC_MESSAGES], -- am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) -- if test $am_cv_val_LC_MESSAGES = yes; then -- AC_DEFINE(HAVE_LC_MESSAGES, 1, -- [Define if your file defines LC_MESSAGES.]) -+ # If the value was cached, stop now. We just wanted to have am__tar -+ # and am__untar set. -+ test -n "${am_cv_prog_tar_$1}" && break -+ -+ # tar/untar a dummy directory, and stop if the command works -+ rm -rf conftest.dir -+ mkdir conftest.dir -+ echo GrepMe > conftest.dir/file -+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) -+ rm -rf conftest.dir -+ if test -s conftest.tar; then -+ AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi --]) -+done -+rm -rf conftest.dir -+ -+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -+AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -+AC_SUBST([am__tar]) -+AC_SUBST([am__untar]) -+]) # _AM_PROG_TAR - -+m4_include([acinclude.m4]) ---- gsmlib-1.10.orig/configure -+++ gsmlib-1.10/configure -@@ -1,178 +1,10 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.53. -+# Generated by GNU Autoconf 2.59. - # --# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 --# Free Software Foundation, Inc. -+# Copyright (C) 2003 Free Software Foundation, Inc. - # This configure script is free software; the Free Software Foundation - # gives unlimited permission to copy, distribute and modify it. -- --# Find the correct PATH separator. Usually this is `:', but --# DJGPP uses `;' like DOS. --if test "X${PATH_SEPARATOR+set}" != Xset; then -- UNAME=${UNAME-`uname 2>/dev/null`} -- case X$UNAME in -- *-DOS) lt_cv_sys_path_separator=';' ;; -- *) lt_cv_sys_path_separator=':' ;; -- esac -- PATH_SEPARATOR=$lt_cv_sys_path_separator --fi -- -- --# Check that we are running under the correct shell. --SHELL=${CONFIG_SHELL-/bin/sh} -- --case X$ECHO in --X*--fallback-echo) -- # Remove one level of quotation (which was required for Make). -- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` -- ;; --esac -- --echo=${ECHO-echo} --if test "X$1" = X--no-reexec; then -- # Discard the --no-reexec flag, and continue. -- shift --elif test "X$1" = X--fallback-echo; then -- # Avoid inline document here, it may be left over -- : --elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then -- # Yippee, $echo works! -- : --else -- # Restart under the correct shell. -- exec $SHELL "$0" --no-reexec ${1+"$@"} --fi -- --if test "X$1" = X--fallback-echo; then -- # used as fallback echo -- shift -- cat </dev/null && -- echo_test_string="`eval $cmd`" && -- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null -- then -- break -- fi -- done --fi -- --if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- : --else -- # The Solaris, AIX, and Digital Unix default echo programs unquote -- # backslashes. This makes it impossible to quote backslashes using -- # echo "$something" | sed 's/\\/\\\\/g' -- # -- # So, first we look for a working echo in the user's PATH. -- -- IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR -- for dir in $PATH /usr/ucb; do -- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && -- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- echo="$dir/echo" -- break -- fi -- done -- IFS="$save_ifs" -- -- if test "X$echo" = Xecho; then -- # We didn't find a better echo, so look for alternatives. -- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- # This shell has a builtin print -r that does the trick. -- echo='print -r' -- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && -- test "X$CONFIG_SHELL" != X/bin/ksh; then -- # If we have ksh, try running configure again with it. -- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -- export ORIGINAL_CONFIG_SHELL -- CONFIG_SHELL=/bin/ksh -- export CONFIG_SHELL -- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} -- else -- # Try using printf. -- echo='printf %s\n' -- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- # Cool, printf works -- : -- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && -- test "X$echo_testing_string" = 'X\t' && -- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL -- export CONFIG_SHELL -- SHELL="$CONFIG_SHELL" -- export SHELL -- echo="$CONFIG_SHELL $0 --fallback-echo" -- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && -- test "X$echo_testing_string" = 'X\t' && -- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && -- test "X$echo_testing_string" = "X$echo_test_string"; then -- echo="$CONFIG_SHELL $0 --fallback-echo" -- else -- # maybe with a smaller string... -- prev=: -- -- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do -- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null -- then -- break -- fi -- prev="$cmd" -- done -- -- if test "$prev" != 'sed 50q "$0"'; then -- echo_test_string=`eval $prev` -- export echo_test_string -- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} -- else -- # Oops. We lost completely, so just stick with echo. -- echo=echo -- fi -- fi -- fi -- fi --fi --fi -- --# Copy echo and quote the copy suitably for passing to libtool from --# the Makefile, instead of quoting the original, which is used later. --ECHO=$echo --if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then -- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" --fi -- -- -- --if expr a : '\(a\)' >/dev/null 2>&1; then -- as_expr=expr --else -- as_expr=false --fi -- -- - ## --------------------- ## - ## M4sh Initialization. ## - ## --------------------- ## -@@ -181,46 +13,57 @@ - if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: -+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' - elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix - fi -+DUALCASE=1; export DUALCASE # for MKS sh - --# NLS nuisances. - # Support unset when possible. --if (FOO=FOO; unset FOO) >/dev/null 2>&1; then -+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset - else - as_unset=false - fi - --(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && -- { $as_unset LANG || test "${LANG+set}" != set; } || -- { LANG=C; export LANG; } --(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && -- { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || -- { LC_ALL=C; export LC_ALL; } --(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && -- { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || -- { LC_TIME=C; export LC_TIME; } --(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && -- { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || -- { LC_CTYPE=C; export LC_CTYPE; } --(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && -- { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || -- { LANGUAGE=C; export LANGUAGE; } --(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && -- { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || -- { LC_COLLATE=C; export LC_COLLATE; } --(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && -- { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || -- { LC_NUMERIC=C; export LC_NUMERIC; } --(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && -- { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || -- { LC_MESSAGES=C; export LC_MESSAGES; } -+ -+# Work around bugs in pre-3.0 UWIN ksh. -+$as_unset ENV MAIL MAILPATH -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+for as_var in \ -+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ -+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ -+ LC_TELEPHONE LC_TIME -+do -+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then -+ eval $as_var=C; export $as_var -+ else -+ $as_unset $as_var -+ fi -+done -+ -+# Required to use basename. -+if expr a : '\(a\)' >/dev/null 2>&1; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi - - - # Name of the executable. --as_me=`(basename "$0") 2>/dev/null || -+as_me=`$as_basename "$0" || - $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ -@@ -231,6 +74,7 @@ - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - -+ - # PATH needs CR, and LINENO needs CR and PATH. - # Avoid depending upon Character Ranges. - as_cr_letters='abcdefghijklmnopqrstuvwxyz' -@@ -241,15 +85,15 @@ - - # The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then -- echo "#! /bin/sh" >conftest.sh -- echo "exit 0" >>conftest.sh -- chmod +x conftest.sh -- if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi -- rm -f conftest.sh -+ rm -f conf$$.sh - fi - - -@@ -297,6 +141,8 @@ - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then -+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } -+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} -@@ -369,13 +215,20 @@ - fi - rm -f conf$$ conf$$.exe conf$$.file - -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p=: -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ - as_executable_p="test -f" - - # Sed expression to map a string onto a valid CPP name. --as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - - # Sed expression to map a string onto a valid variable name. --as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" -+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - # IFS -@@ -385,76 +238,233 @@ - IFS=" $as_nl" - - # CDPATH. --$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } -- -+$as_unset CDPATH - --# Name of the host. --# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, --# so uname gets run too. --ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - --exec 6>&1 - --# --# Initializations. --# --ac_default_prefix=/usr/local --cross_compiling=no --subdirs= --MFLAGS= --MAKEFLAGS= -+# Check that we are running under the correct shell. - SHELL=${CONFIG_SHELL-/bin/sh} - --# Maximum number of lines to put in a shell here document. --# This variable seems obsolete. It should probably be removed, and --# only ac_max_sed_lines should be used. --: ${ac_max_here_lines=38} -+case X$ECHO in -+X*--fallback-echo) -+ # Remove one level of quotation (which was required for Make). -+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` -+ ;; -+esac - --# Identity of this package. --PACKAGE_NAME= --PACKAGE_TARNAME= --PACKAGE_VERSION= --PACKAGE_STRING= --PACKAGE_BUGREPORT= -+echo=${ECHO-echo} -+if test "X$1" = X--no-reexec; then -+ # Discard the --no-reexec flag, and continue. -+ shift -+elif test "X$1" = X--fallback-echo; then -+ # Avoid inline document here, it may be left over -+ : -+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then -+ # Yippee, $echo works! -+ : -+else -+ # Restart under the correct shell. -+ exec $SHELL "$0" --no-reexec ${1+"$@"} -+fi - --ac_unique_file="gsmlib/gsm_error.h" --# Factoring default headers for most tests. --ac_includes_default="\ --#include --#if HAVE_SYS_TYPES_H --# include --#endif --#if HAVE_SYS_STAT_H --# include --#endif --#if STDC_HEADERS --# include --# include --#else --# if HAVE_STDLIB_H --# include --# endif --#endif --#if HAVE_STRING_H --# if !STDC_HEADERS && HAVE_MEMORY_H --# include --# endif --# include --#endif --#if HAVE_STRINGS_H --# include --#endif --#if HAVE_INTTYPES_H --# include --#else --# if HAVE_STDINT_H --# include --# endif --#endif --#if HAVE_UNISTD_H --# include --#endif" -+if test "X$1" = X--fallback-echo; then -+ # used as fallback echo -+ shift -+ cat </dev/null 2>&1 && unset CDPATH -+ -+if test -z "$ECHO"; then -+if test "X${echo_test_string+set}" != Xset; then -+# find a string as large as possible, as long as the shell can cope with it -+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do -+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... -+ if (echo_test_string=`eval $cmd`) 2>/dev/null && -+ echo_test_string=`eval $cmd` && -+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null -+ then -+ break -+ fi -+ done -+fi -+ -+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ : -+else -+ # The Solaris, AIX, and Digital Unix default echo programs unquote -+ # backslashes. This makes it impossible to quote backslashes using -+ # echo "$something" | sed 's/\\/\\\\/g' -+ # -+ # So, first we look for a working echo in the user's PATH. -+ -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ for dir in $PATH /usr/ucb; do -+ IFS="$lt_save_ifs" -+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && -+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ echo="$dir/echo" -+ break -+ fi -+ done -+ IFS="$lt_save_ifs" -+ -+ if test "X$echo" = Xecho; then -+ # We didn't find a better echo, so look for alternatives. -+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ # This shell has a builtin print -r that does the trick. -+ echo='print -r' -+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && -+ test "X$CONFIG_SHELL" != X/bin/ksh; then -+ # If we have ksh, try running configure again with it. -+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -+ export ORIGINAL_CONFIG_SHELL -+ CONFIG_SHELL=/bin/ksh -+ export CONFIG_SHELL -+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} -+ else -+ # Try using printf. -+ echo='printf %s\n' -+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ # Cool, printf works -+ : -+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && -+ test "X$echo_testing_string" = 'X\t' && -+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL -+ export CONFIG_SHELL -+ SHELL="$CONFIG_SHELL" -+ export SHELL -+ echo="$CONFIG_SHELL $0 --fallback-echo" -+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && -+ test "X$echo_testing_string" = 'X\t' && -+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && -+ test "X$echo_testing_string" = "X$echo_test_string"; then -+ echo="$CONFIG_SHELL $0 --fallback-echo" -+ else -+ # maybe with a smaller string... -+ prev=: -+ -+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do -+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null -+ then -+ break -+ fi -+ prev="$cmd" -+ done -+ -+ if test "$prev" != 'sed 50q "$0"'; then -+ echo_test_string=`eval $prev` -+ export echo_test_string -+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} -+ else -+ # Oops. We lost completely, so just stick with echo. -+ echo=echo -+ fi -+ fi -+ fi -+ fi -+fi -+fi -+ -+# Copy echo and quote the copy suitably for passing to libtool from -+# the Makefile, instead of quoting the original, which is used later. -+ECHO=$echo -+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then -+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -+fi -+ -+ -+ -+ -+tagnames=${tagnames+${tagnames},}CXX -+ -+tagnames=${tagnames+${tagnames},}F77 -+ -+# Name of the host. -+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -+# so uname gets run too. -+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -+ -+exec 6>&1 -+ -+# -+# Initializations. -+# -+ac_default_prefix=/usr/local -+ac_config_libobj_dir=. -+cross_compiling=no -+subdirs= -+MFLAGS= -+MAKEFLAGS= -+SHELL=${CONFIG_SHELL-/bin/sh} -+ -+# Maximum number of lines to put in a shell here document. -+# This variable seems obsolete. It should probably be removed, and -+# only ac_max_sed_lines should be used. -+: ${ac_max_here_lines=38} -+ -+# Identity of this package. -+PACKAGE_NAME= -+PACKAGE_TARNAME= -+PACKAGE_VERSION= -+PACKAGE_STRING= -+PACKAGE_BUGREPORT= -+ -+ac_unique_file="gsmlib/gsm_error.h" -+# Factoring default headers for most tests. -+ac_includes_default="\ -+#include -+#if HAVE_SYS_TYPES_H -+# include -+#endif -+#if HAVE_SYS_STAT_H -+# include -+#endif -+#if STDC_HEADERS -+# include -+# include -+#else -+# if HAVE_STDLIB_H -+# include -+# endif -+#endif -+#if HAVE_STRING_H -+# if !STDC_HEADERS && HAVE_MEMORY_H -+# include -+# endif -+# include -+#endif -+#if HAVE_STRINGS_H -+# include -+#endif -+#if HAVE_INTTYPES_H -+# include -+#else -+# if HAVE_STDINT_H -+# include -+# endif -+#endif -+#if HAVE_UNISTD_H -+# include -+#endif" - -+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ALLOCA GSM_VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE GLIBC2 GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB COMPILE_INTL_TRUE COMPILE_INTL_FALSE LIBOBJS LTLIBOBJS' -+ac_subst_files='' - - # Initialize some variables set by options. - ac_init_help= -@@ -812,7 +822,7 @@ - - # Be sure to have absolute paths. - for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ -- localstatedir libdir includedir oldincludedir infodir mandir -+ localstatedir libdir includedir oldincludedir infodir mandir - do - eval ac_val=$`echo $ac_var` - case $ac_val in -@@ -852,10 +862,10 @@ - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || - $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -- X"$0" : 'X\(//\)[^/]' \| \ -- X"$0" : 'X\(//\)$' \| \ -- X"$0" : 'X\(/\)' \| \ -- . : '\(.\)' 2>/dev/null || -+ X"$0" : 'X\(//\)[^/]' \| \ -+ X"$0" : 'X\(//\)$' \| \ -+ X"$0" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || - echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } -@@ -878,6 +888,9 @@ - { (exit 1); exit 1; }; } - fi - fi -+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || -+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 -+ { (exit 1); exit 1; }; } - srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` - ac_env_build_alias_set=${build_alias+set} - ac_env_build_alias_value=$build_alias -@@ -919,6 +932,18 @@ - ac_env_CXXFLAGS_value=$CXXFLAGS - ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} - ac_cv_env_CXXFLAGS_value=$CXXFLAGS -+ac_env_CXXCPP_set=${CXXCPP+set} -+ac_env_CXXCPP_value=$CXXCPP -+ac_cv_env_CXXCPP_set=${CXXCPP+set} -+ac_cv_env_CXXCPP_value=$CXXCPP -+ac_env_F77_set=${F77+set} -+ac_env_F77_value=$F77 -+ac_cv_env_F77_set=${F77+set} -+ac_cv_env_F77_value=$F77 -+ac_env_FFLAGS_set=${FFLAGS+set} -+ac_env_FFLAGS_value=$FFLAGS -+ac_cv_env_FFLAGS_set=${FFLAGS+set} -+ac_cv_env_FFLAGS_value=$FFLAGS - - # - # Report the --help message. -@@ -952,9 +977,9 @@ - cat <<_ACEOF - Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX -- [$ac_default_prefix] -+ [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX -- [PREFIX] -+ [PREFIX] - - By default, \`make install' will install all the files in - \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -@@ -998,24 +1023,31 @@ - Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -- --disable-dependency-tracking Speeds up one-time builds -- --enable-dependency-tracking Do not reject slow dependency extractors -- --enable-shared=PKGS build shared libraries default=yes -- --enable-static=PKGS build static libraries default=yes -- --enable-fast-install=PKGS optimize for fast installation default=yes -+ --disable-dependency-tracking speeds up one-time build -+ --enable-dependency-tracking do not reject slow dependency extractors -+ --enable-shared[=PKGS] -+ build shared libraries [default=yes] -+ --enable-static[=PKGS] -+ build static libraries [default=yes] -+ --enable-fast-install[=PKGS] -+ optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) -- --disable-rpath do not hardcode runtime library paths - --disable-nls do not use Native Language Support -+ --disable-rpath do not hardcode runtime library paths - - Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) -+ --with-gnu-ld assume the C compiler uses GNU ld [default=no] -+ --with-pic try to use only PIC/non-PIC objects [default=use -+ both] -+ --with-tags[=TAGS] -+ include additional configurations [automatic] - --with-gnu-ld assume the C compiler uses GNU ld default=no -- --with-pic try to use only PIC/non-PIC objects default=use both -- --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib -+ --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib - --without-libiconv-prefix don't search for libiconv in includedir and libdir - --with-included-gettext use the GNU gettext library included here -- --with-libintl-prefix=DIR search for libintl in DIR/include and DIR/lib -+ --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib - --without-libintl-prefix don't search for libintl in includedir and libdir - - Some influential environment variables: -@@ -1028,6 +1060,9 @@ - CPP C preprocessor - CXX C++ compiler command - CXXFLAGS C++ compiler flags -+ CXXCPP C++ preprocessor -+ F77 Fortran 77 compiler command -+ FFLAGS Fortran 77 compiler flags - - Use these variables to override the choices made by `configure' or to help - it to find libraries and programs with nonstandard names/locations. -@@ -1065,12 +1100,45 @@ - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; - esac --# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be --# absolute. --ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` --ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` --ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` --ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` -+ -+# Do not use `cd foo && pwd` to compute absolute paths, because -+# the directories may not exist. -+case `pwd` in -+.) ac_abs_builddir="$ac_dir";; -+*) -+ case "$ac_dir" in -+ .) ac_abs_builddir=`pwd`;; -+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; -+ *) ac_abs_builddir=`pwd`/"$ac_dir";; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_builddir=${ac_top_builddir}.;; -+*) -+ case ${ac_top_builddir}. in -+ .) ac_abs_top_builddir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; -+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_srcdir=$ac_srcdir;; -+*) -+ case $ac_srcdir in -+ .) ac_abs_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; -+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_srcdir=$ac_top_srcdir;; -+*) -+ case $ac_top_srcdir in -+ .) ac_abs_top_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; -+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; -+ esac;; -+esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. -@@ -1081,13 +1149,13 @@ - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || -- test -f $ac_srcdir/configure.in; then -+ test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi -- cd $ac_popdir -+ cd "$ac_popdir" - done - fi - -@@ -1095,8 +1163,7 @@ - if $ac_init_version; then - cat <<\_ACEOF - --Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 --Free Software Foundation, Inc. -+Copyright (C) 2003 Free Software Foundation, Inc. - This configure script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it. - _ACEOF -@@ -1108,7 +1175,7 @@ - running configure, to aid debugging if configure makes a mistake. - - It was created by $as_me, which was --generated by GNU Autoconf 2.53. Invocation command line was -+generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -@@ -1160,27 +1227,54 @@ - - # Keep a trace of the command line. - # Strip out --no-create and --no-recursion so they do not pile up. -+# Strip out --silent because we don't want to record it for future runs. - # Also quote any args containing shell meta-characters. -+# Make two passes to allow for proper duplicate-argument suppression. - ac_configure_args= -+ac_configure_args0= -+ac_configure_args1= - ac_sep= --for ac_arg -+ac_must_keep_next=false -+for ac_pass in 1 2 - do -- case $ac_arg in -- -no-create | --no-create | --no-creat | --no-crea | --no-cre \ -- | --no-cr | --no-c | -n ) continue ;; -- -no-recursion | --no-recursion | --no-recursio | --no-recursi \ -- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) -- continue ;; -- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) -- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; -- esac -- case " $ac_configure_args " in -- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. -- *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" -- ac_sep=" " ;; -- esac -- # Get rid of the leading space. -+ for ac_arg -+ do -+ case $ac_arg in -+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil) -+ continue ;; -+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) -+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; -+ esac -+ case $ac_pass in -+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; -+ 2) -+ ac_configure_args1="$ac_configure_args1 '$ac_arg'" -+ if test $ac_must_keep_next = true; then -+ ac_must_keep_next=false # Got value, back to normal. -+ else -+ case $ac_arg in -+ *=* | --config-cache | -C | -disable-* | --disable-* \ -+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ -+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ -+ | -with-* | --with-* | -without-* | --without-* | --x) -+ case "$ac_configure_args0 " in -+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; -+ esac -+ ;; -+ -* ) ac_must_keep_next=true ;; -+ esac -+ fi -+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" -+ # Get rid of the leading space. -+ ac_sep=" " -+ ;; -+ esac -+ done - done -+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - - # When interrupted or exit'd, cleanup temporary files, and complete - # config.log. We remove comments because anyway the quotes in there -@@ -1191,6 +1285,7 @@ - # Save into config.log some information that might help in debugging. - { - echo -+ - cat <<\_ASBOX - ## ---------------- ## - ## Cache variables. ## -@@ -1203,16 +1298,45 @@ - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ -- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; -- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" -+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; -+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ -- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" -+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; - } - echo -+ -+ cat <<\_ASBOX -+## ----------------- ## -+## Output variables. ## -+## ----------------- ## -+_ASBOX -+ echo -+ for ac_var in $ac_subst_vars -+ do -+ eval ac_val=$`echo $ac_var` -+ echo "$ac_var='"'"'$ac_val'"'"'" -+ done | sort -+ echo -+ -+ if test -n "$ac_subst_files"; then -+ cat <<\_ASBOX -+## ------------- ## -+## Output files. ## -+## ------------- ## -+_ASBOX -+ echo -+ for ac_var in $ac_subst_files -+ do -+ eval ac_val=$`echo $ac_var` -+ echo "$ac_var='"'"'$ac_val'"'"'" -+ done | sort -+ echo -+ fi -+ - if test -s confdefs.h; then - cat <<\_ASBOX - ## ----------- ## -@@ -1220,14 +1344,14 @@ - ## ----------- ## - _ASBOX - echo -- sed "/^$/d" confdefs.h -+ sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 -- rm -f core core.* *.core && -+ rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -@@ -1307,7 +1431,7 @@ - # value. - ac_cache_corrupted=false - for ac_var in `(set) 2>&1 | -- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do -+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" -@@ -1324,13 +1448,13 @@ - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then -- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} -- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 - echo "$as_me: former value: $ac_old_val" >&2;} -- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 - echo "$as_me: current value: $ac_new_val" >&2;} -- ac_cache_corrupted=: -+ ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. -@@ -1378,6 +1502,7 @@ - - - -+ - ac_aux_dir= - for ac_dir in scripts $srcdir/scripts; do - if test -f $ac_dir/install-sh; then -@@ -1414,6 +1539,7 @@ - # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag - # AFS /usr/afsws/bin/install, which mishandles nonexistent args - # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -+# OS/2's system install, which has a completely different semantic - # ./install, which can be erroneously created by make from ./install.sh. - echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 - echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -@@ -1430,6 +1556,7 @@ - case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ -+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. -@@ -1437,20 +1564,20 @@ - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then -- if test $ac_prog = install && -- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -- # AIX install. It has an incompatible calling convention. -- : -- elif test $ac_prog = install && -- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -- # program-specific install script used by HP pwplus--don't use. -- : -- else -- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" -- break 3 -- fi -- fi -+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then -+ if test $ac_prog = install && -+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -+ # AIX install. It has an incompatible calling convention. -+ : -+ elif test $ac_prog = install && -+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -+ # program-specific install script used by HP pwplus--don't use. -+ : -+ else -+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" -+ break 3 -+ fi -+ fi - done - done - ;; -@@ -1685,9 +1812,7 @@ - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift -- set dummy "$as_dir/$ac_word" ${1+"$@"} -- shift -- ac_cv_prog_CC="$@" -+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi - fi - fi -@@ -1792,8 +1917,10 @@ - fi - - --test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 --echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} -+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -+See \`config.log' for more details." >&5 -+echo "$as_me: error: no acceptable C compiler found in \$PATH -+See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - - # Provide some information about the compiler. -@@ -1817,15 +1944,12 @@ - (exit $ac_status); } - - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -1835,12 +1959,12 @@ - } - _ACEOF - ac_clean_files_save=$ac_clean_files --ac_clean_files="$ac_clean_files a.out a.exe" -+ac_clean_files="$ac_clean_files a.out a.exe b.out" - # Try to create an executable without -o first, disregard a.out. - # It will help us diagnose broken compilers, and finding out an intuition - # of exeext. --echo "$as_me:$LINENO: checking for C compiler default output" >&5 --echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 - ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 -@@ -1854,26 +1978,39 @@ - # Be careful to initialize this variable, since it used to be cached. - # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. - ac_cv_exeext= --for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; -- ls a.out conftest 2>/dev/null; -- ls a.* conftest.* 2>/dev/null`; do -+# b.out is created by i960 compilers. -+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -+do -+ test -f "$ac_file" || continue - case $ac_file in -- *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; -- a.out ) # We found the default executable, but exeext='' is most -- # certainly right. -- break;; -- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` -- # FIXME: I believe we export ac_cv_exeext for Libtool --akim. -- export ac_cv_exeext -- break;; -- * ) break;; -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) -+ ;; -+ conftest.$ac_ext ) -+ # This is the source file. -+ ;; -+ [ab].out ) -+ # We found the default executable, but exeext='' is most -+ # certainly right. -+ break;; -+ *.* ) -+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` -+ # FIXME: I believe we export ac_cv_exeext for Libtool, -+ # but it would be cool to find out if it's true. Does anybody -+ # maintain Libtool? --akim. -+ export ac_cv_exeext -+ break;; -+ * ) -+ break;; - esac - done - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 --echo "$as_me: error: C compiler cannot create executables" >&2;} -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -+See \`config.log' for more details." >&5 -+echo "$as_me: error: C compiler cannot create executables -+See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - fi - -@@ -1900,9 +2037,11 @@ - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. --If you meant to cross compile, use \`--host'." >&5 -+If you meant to cross compile, use \`--host'. -+See \`config.log' for more details." >&5 - echo "$as_me: error: cannot run C compiled programs. --If you meant to cross compile, use \`--host'." >&2;} -+If you meant to cross compile, use \`--host'. -+See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -@@ -1910,7 +2049,7 @@ - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 - --rm -f a.out a.exe conftest$ac_cv_exeext -+rm -f a.out a.exe conftest$ac_cv_exeext b.out - ac_clean_files=$ac_clean_files_save - # Check the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. -@@ -1930,18 +2069,21 @@ - # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will - # work properly (i.e., refer to `conftest.exe'), while it won't with - # `rm'. --for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do -+for ac_file in conftest.exe conftest conftest.*; do -+ test -f "$ac_file" || continue - case $ac_file in -- *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` -- export ac_cv_exeext -- break;; -+ export ac_cv_exeext -+ break;; - * ) break;; - esac - done - else -- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 --echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} -+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -+See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - -@@ -1958,15 +2100,12 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -1983,16 +2122,19 @@ - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in -- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac - done - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 --echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute suffix of object files: cannot compile -+See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - -@@ -2008,15 +2150,12 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -2030,11 +2169,20 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2043,10 +2191,11 @@ - ac_compiler_gnu=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ac_compiler_gnu=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_c_compiler_gnu=$ac_compiler_gnu - - fi -@@ -2062,15 +2211,12 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -2081,11 +2227,20 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2094,10 +2249,11 @@ - ac_cv_prog_cc_g=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ac_cv_prog_cc_g=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 - echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -@@ -2116,6 +2272,120 @@ - CFLAGS= - fi - fi -+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -+if test "${ac_cv_prog_cc_stdc+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_prog_cc_stdc=no -+ac_save_CC=$CC -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+#include -+#include -+#include -+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -+struct buf { int x; }; -+FILE * (*rcsopen) (struct buf *, struct stat *, int); -+static char *e (p, i) -+ char **p; -+ int i; -+{ -+ return p[i]; -+} -+static char *f (char * (*g) (char **, int), char **p, ...) -+{ -+ char *s; -+ va_list v; -+ va_start (v,p); -+ s = g (p, va_arg (v,int)); -+ va_end (v); -+ return s; -+} -+ -+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has -+ function prototypes and stuff, but not '\xHH' hex character constants. -+ These don't provoke an error unfortunately, instead are silently treated -+ as 'x'. The following induces an error, until -std1 is added to get -+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an -+ array size at least. It's necessary to write '\x00'==0 to get something -+ that's true only with -std1. */ -+int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -+ -+int test (int i, double x); -+struct s1 {int (*f) (int a);}; -+struct s2 {int (*f) (double a);}; -+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -+int argc; -+char **argv; -+int -+main () -+{ -+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; -+ ; -+ return 0; -+} -+_ACEOF -+# Don't try gcc -ansi; that turns off useful extensions and -+# breaks some systems' header files. -+# AIX -qlanglvl=ansi -+# Ultrix and OSF/1 -std1 -+# HP-UX 10.20 and later -Ae -+# HP-UX older versions -Aa -D_HPUX_SOURCE -+# SVR4 -Xc -D__EXTENSIONS__ -+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -+do -+ CC="$ac_save_CC $ac_arg" -+ rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_prog_cc_stdc=$ac_arg -+break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext -+done -+rm -f conftest.$ac_ext conftest.$ac_objext -+CC=$ac_save_CC -+ -+fi -+ -+case "x$ac_cv_prog_cc_stdc" in -+ x|xno) -+ echo "$as_me:$LINENO: result: none needed" >&5 -+echo "${ECHO_T}none needed" >&6 ;; -+ *) -+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 -+ CC="$CC $ac_cv_prog_cc_stdc" ;; -+esac -+ - # Some people use a C++ compiler to compile C. Since we use `exit', - # in C++ we need to declare it. In case someone uses the same compiler - # for both compiling C and C++ we need to have the C++ compiler decide -@@ -2127,19 +2397,27 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ -- ''\ -- '#include ' \ -+ '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ -@@ -2147,16 +2425,13 @@ - 'void exit (int);' - do - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_declaration --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+#include - int - main () - { -@@ -2167,11 +2442,20 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2180,20 +2464,18 @@ - : - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - continue - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_declaration --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -2204,11 +2486,20 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2217,9 +2508,10 @@ - break - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done - rm -f conftest* - if test -n "$ac_declaration"; then -@@ -2230,9 +2522,10 @@ - - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -@@ -2249,8 +2542,11 @@ - ac_check_lib_save_LIBS=$LIBS - LIBS="-lintl $LIBS" - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - - /* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus -@@ -2259,12 +2555,6 @@ - /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char textdomain (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -2275,11 +2565,20 @@ - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2288,10 +2587,12 @@ - ac_cv_lib_intl_textdomain=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ac_cv_lib_intl_textdomain=no - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 -@@ -2306,14 +2607,10 @@ - fi - - --# Add the stamp file to the list of files AC keeps track of, --# along with our hook. --ac_config_headers="$ac_config_headers gsm_config.h" -+ ac_config_headers="$ac_config_headers gsm_config.h" - - -- -- --am__api_version="1.6" -+am__api_version="1.9" - echo "$as_me:$LINENO: checking whether build environment is sane" >&5 - echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 - # Just in case -@@ -2372,7 +2669,6 @@ - program_transform_name=`echo $program_transform_name | sed -f conftest.sed` - rm conftest.sed - -- - # expand $ac_aux_dir to an absolute path - am_aux_dir=`cd $ac_aux_dir && pwd` - -@@ -2386,6 +2682,39 @@ - echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} - fi - -+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then -+ # We used to keeping the `.' as first argument, in order to -+ # allow $(mkdir_p) to be used without argument. As in -+ # $(mkdir_p) $(somedir) -+ # where $(somedir) is conditionally defined. However this is wrong -+ # for two reasons: -+ # 1. if the package is installed by a user who cannot write `.' -+ # make install will fail, -+ # 2. the above comment should most certainly read -+ # $(mkdir_p) $(DESTDIR)$(somedir) -+ # so it does not work when $(somedir) is undefined and -+ # $(DESTDIR) is not. -+ # To support the latter case, we have to write -+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), -+ # so the `.' trick is pointless. -+ mkdir_p='mkdir -p --' -+else -+ # On NextStep and OpenStep, the `mkdir' command does not -+ # recognize any option. It will interpret all options as -+ # directories to create, and then abort because `.' already -+ # exists. -+ for d in ./-p ./--version; -+ do -+ test -d $d && rmdir $d -+ done -+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. -+ if test -f "$ac_aux_dir/mkinstalldirs"; then -+ mkdir_p='$(mkinstalldirs)' -+ else -+ mkdir_p='$(install_sh) -d' -+ fi -+fi -+ - for ac_prog in gawk mawk nawk awk - do - # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -2426,15 +2755,15 @@ - test -n "$AWK" && break - done - --echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 --echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 --set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` -+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` - if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.make <<\_ACEOF - all: -- @echo 'ac_maketemp="${MAKE}"' -+ @echo 'ac_maketemp="$(MAKE)"' - _ACEOF - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -@@ -2455,24 +2784,25 @@ - SET_MAKE="MAKE=${MAKE-make}" - fi - --rm -f .deps 2>/dev/null --mkdir .deps 2>/dev/null --if test -d .deps; then -- DEPDIR=.deps -+rm -rf .tst 2>/dev/null -+mkdir .tst 2>/dev/null -+if test -d .tst; then -+ am__leading_dot=. - else -- # MS-DOS does not allow filenames that begin with a dot. -- DEPDIR=_deps -+ am__leading_dot=_ - fi --rmdir .deps 2>/dev/null -+rmdir .tst 2>/dev/null - -+DEPDIR="${am__leading_dot}deps" - --ac_config_commands="$ac_config_commands depfiles" -+ ac_config_commands="$ac_config_commands depfiles" - - - am_make=${MAKE-make} - cat > confinc << 'END' --doit: -+am__doit: - @echo done -+.PHONY: am__doit - END - # If we don't find an include directive, just comment out the code. - echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -@@ -2487,7 +2817,7 @@ - # In particular we don't look at `^make:' because GNU make might - # be invoked under some other name (usually "gmake"), in which - # case it prints its new name instead of `make'. --if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then -+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -@@ -2528,7 +2858,7 @@ - - - -- # test to see if srcdir already configured -+# test to see if srcdir already configured - if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -@@ -2536,6 +2866,16 @@ - { (exit 1); exit 1; }; } - fi - -+# test whether we have cygpath -+if test -z "$CYGPATH_W"; then -+ if (cygpath --version) >/dev/null 2>/dev/null; then -+ CYGPATH_W='cygpath -w' -+ else -+ CYGPATH_W=echo -+ fi -+fi -+ -+ - # Define the identity of the package. - PACKAGE=gsmlib - VERSION=1.10 -@@ -2566,9 +2906,6 @@ - - MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -- --AMTAR=${AMTAR-"${am_missing_run}tar"} -- - install_sh=${install_sh-"$am_aux_dir/install-sh"} - - # Installed binaries are usually stripped using `strip' when the user -@@ -2661,6 +2998,13 @@ - - # We need awk for the "check" target. The system "awk" is bad on - # some platforms. -+# Always define AMTAR for backward compatibility. -+ -+AMTAR=${AMTAR-"${am_missing_run}tar"} -+ -+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' -+ -+ - - - depcc="$CC" am_compiler_list= -@@ -2681,18 +3025,34 @@ - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir -+ # We will build objects and dependencies in a subdirectory because -+ # it helps to detect inapplicable dependency modes. For instance -+ # both Tru64's cc and ICC support -MD to output dependencies as a -+ # side effect of compilation, but ICC will put the dependencies in -+ # the current directory while Tru64 will put them in the object -+ # directory. -+ mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do -+ # Setup a source with many dependencies, because some compilers -+ # like to wrap large dependency lists on column 80 (with \), and -+ # we should not choose a depcomp mode which is confused by this. -+ # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. -- echo '#include "conftest.h"' > conftest.c -- echo 'int i;' > conftest.h -- echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf -+ : > sub/conftest.c -+ for i in 1 2 3 4 5 6; do -+ echo '#include "conftst'$i'.h"' >> sub/conftest.c -+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with -+ # Solaris 8's {/usr,}/bin/sh. -+ touch sub/conftst$i.h -+ done -+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) -@@ -2710,13 +3070,25 @@ - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ -- source=conftest.c object=conftest.o \ -- depfile=conftest.Po tmpdepfile=conftest.TPo \ -- $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && -- grep conftest.h conftest.Po > /dev/null 2>&1 && -+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ -+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ -+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ -+ >/dev/null 2>conftest.err && -+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && -+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -- am_cv_CC_dependencies_compiler_type=$depmode -- break -+ # icc doesn't choke on unknown options, it will just issue warnings -+ # or remarks (even with -Werror). So we grep stderr for any message -+ # that says an option was ignored or not supported. -+ # When given -MP, icc 7.0 and 7.1 complain thusly: -+ # icc: Command line warning: ignoring option '-M'; no argument required -+ # The diagnosis changed in icc 8.0: -+ # icc: Command line remark: option '-MP' not supported -+ if (grep 'ignoring option' conftest.err || -+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else -+ am_cv_CC_dependencies_compiler_type=$depmode -+ break -+ fi - fi - done - -@@ -2733,30 +3105,44 @@ - - - -+if -+ test "x$enable_dependency_tracking" != xno \ -+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then -+ am__fastdepCC_TRUE= -+ am__fastdepCC_FALSE='#' -+else -+ am__fastdepCC_TRUE='#' -+ am__fastdepCC_FALSE= -+fi -+ -+ -+ - - # Check whether --enable-shared or --disable-shared was given. - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} --case $enableval in --yes) enable_shared=yes ;; --no) enable_shared=no ;; --*) -- enable_shared=no -- # Look at the argument we got. We use all the common list separators. -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," -- for pkg in $enableval; do -- if test "X$pkg" = "X$p"; then -- enable_shared=yes -- fi -- done -- IFS="$ac_save_ifs" -- ;; --esac -+ case $enableval in -+ yes) enable_shared=yes ;; -+ no) enable_shared=no ;; -+ *) -+ enable_shared=no -+ # Look at the argument we got. We use all the common list separators. -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for pkg in $enableval; do -+ IFS="$lt_save_ifs" -+ if test "X$pkg" = "X$p"; then -+ enable_shared=yes -+ fi -+ done -+ IFS="$lt_save_ifs" -+ ;; -+ esac - else - enable_shared=yes - fi; - -+ - if test "$CXXFLAGS" = ""; then - CXXFLAGS="-O2" - fi -@@ -2774,46 +3160,50 @@ - if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} --case $enableval in --yes) enable_static=yes ;; --no) enable_static=no ;; --*) -- enable_static=no -- # Look at the argument we got. We use all the common list separators. -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," -- for pkg in $enableval; do -- if test "X$pkg" = "X$p"; then -- enable_static=yes -- fi -- done -- IFS="$ac_save_ifs" -- ;; --esac -+ case $enableval in -+ yes) enable_static=yes ;; -+ no) enable_static=no ;; -+ *) -+ enable_static=no -+ # Look at the argument we got. We use all the common list separators. -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for pkg in $enableval; do -+ IFS="$lt_save_ifs" -+ if test "X$pkg" = "X$p"; then -+ enable_static=yes -+ fi -+ done -+ IFS="$lt_save_ifs" -+ ;; -+ esac - else - enable_static=yes - fi; -+ - # Check whether --enable-fast-install or --disable-fast-install was given. - if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} --case $enableval in --yes) enable_fast_install=yes ;; --no) enable_fast_install=no ;; --*) -- enable_fast_install=no -- # Look at the argument we got. We use all the common list separators. -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," -- for pkg in $enableval; do -- if test "X$pkg" = "X$p"; then -- enable_fast_install=yes -- fi -- done -- IFS="$ac_save_ifs" -- ;; --esac -+ case $enableval in -+ yes) enable_fast_install=yes ;; -+ no) enable_fast_install=no ;; -+ *) -+ enable_fast_install=no -+ # Look at the argument we got. We use all the common list separators. -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for pkg in $enableval; do -+ IFS="$lt_save_ifs" -+ if test "X$pkg" = "X$p"; then -+ enable_fast_install=yes -+ fi -+ done -+ IFS="$lt_save_ifs" -+ ;; -+ esac - else - enable_fast_install=yes - fi; -+ - # Make sure we can run config.sub. - $ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -@@ -2868,16 +3258,77 @@ - host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - --# Find the correct PATH separator. Usually this is `:', but --# DJGPP uses `;' like DOS. --if test "X${PATH_SEPARATOR+set}" != Xset; then -- UNAME=${UNAME-`uname 2>/dev/null`} -- case X$UNAME in -- *-DOS) lt_cv_sys_path_separator=';' ;; -- *) lt_cv_sys_path_separator=':' ;; -- esac -- PATH_SEPARATOR=$lt_cv_sys_path_separator -+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -+if test "${lt_cv_path_SED+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ # Loop through the user's path and test for sed and gsed. -+# Then use that list of sed's as ones to test for truncation. -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for lt_ac_prog in sed gsed; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then -+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" -+ fi -+ done -+ done -+done -+lt_ac_max=0 -+lt_ac_count=0 -+# Add /usr/xpg4/bin/sed as it is typically found on Solaris -+# along with /bin/sed that truncates output. -+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do -+ test ! -f $lt_ac_sed && continue -+ cat /dev/null > conftest.in -+ lt_ac_count=0 -+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in -+ # Check for GNU sed and select it if it is found. -+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then -+ lt_cv_path_SED=$lt_ac_sed -+ break -+ fi -+ while true; do -+ cat conftest.in conftest.in >conftest.tmp -+ mv conftest.tmp conftest.in -+ cp conftest.in conftest.nl -+ echo >>conftest.nl -+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break -+ cmp -s conftest.out conftest.nl || break -+ # 10000 chars as input seems more than enough -+ test $lt_ac_count -gt 10 && break -+ lt_ac_count=`expr $lt_ac_count + 1` -+ if test $lt_ac_count -gt $lt_ac_max; then -+ lt_ac_max=$lt_ac_count -+ lt_cv_path_SED=$lt_ac_sed -+ fi -+ done -+done -+ -+fi -+ -+SED=$lt_cv_path_SED -+echo "$as_me:$LINENO: result: $SED" >&5 -+echo "${ECHO_T}$SED" >&6 -+ -+echo "$as_me:$LINENO: checking for egrep" >&5 -+echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -+if test "${ac_cv_prog_egrep+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1 -+ then ac_cv_prog_egrep='grep -E' -+ else ac_cv_prog_egrep='egrep' -+ fi - fi -+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -+echo "${ECHO_T}$ac_cv_prog_egrep" >&6 -+ EGREP=$ac_cv_prog_egrep -+ - - - # Check whether --with-gnu-ld or --without-gnu-ld was given. -@@ -2890,8 +3341,8 @@ - ac_prog=ld - if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. -- echo "$as_me:$LINENO: checking for ld used by GCC" >&5 --echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 -+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw -@@ -2901,12 +3352,12 @@ - esac - case $ac_prog in - # Accept absolute paths. -- [\\/]* | [A-Za-z]:[\\/]*) -+ [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -- # Canonicalize the path of ld -- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` -+ # Canonicalize the pathname of ld -+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` -+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; -@@ -2930,22 +3381,26 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test -z "$LD"; then -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do -+ IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, -- # but apparently some GNU ld's only accept -v. -+ # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. -- if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then -+ case `"$lt_cv_path_LD" -v 2>&1 &6 - else -- # I'd rather use --version here, but apparently some GNU ld's only accept -v. --if $LD -v 2>&1 &5; then -+ # I'd rather use --version here, but apparently some GNU lds only accept -v. -+case `$LD -v 2>&1 &5 - echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -@@ -2989,7 +3447,20 @@ - echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 - echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 - reload_flag=$lt_cv_ld_reload_flag --test -n "$reload_flag" && reload_flag=" $reload_flag" -+case $reload_flag in -+"" | " "*) ;; -+*) reload_flag=" $reload_flag" ;; -+esac -+reload_cmds='$LD$reload_flag -o $output$reload_objs' -+case $host_os in -+ darwin*) -+ if test "$GCC" = yes; then -+ reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' -+ else -+ reload_cmds='$LD$reload_flag -o $output$reload_objs' -+ fi -+ ;; -+esac - - echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 - echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -@@ -3000,35 +3471,42 @@ - # Let the user override the test. - lt_cv_path_NM="$NM" - else -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do -+ IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. -- tmp_nm=$ac_dir/${ac_tool_prefix}nm -- if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then -+ tmp_nm="$ac_dir/${ac_tool_prefix}nm" -+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file -- if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then -+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in -+ */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break -- elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then -- lt_cv_path_NM="$tmp_nm -p" -- break -- else -- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but -- continue # so that we can try to find one that supports BSD flags -- fi -+ ;; -+ *) -+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in -+ */dev/null*) -+ lt_cv_path_NM="$tmp_nm -p" -+ break -+ ;; -+ *) -+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but -+ continue # so that we can try to find one that supports BSD flags -+ ;; -+ esac -+ esac - fi - done -- IFS="$ac_save_ifs" -+ IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm - fi - fi -- -+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -+echo "${ECHO_T}$lt_cv_path_NM" >&6 - NM="$lt_cv_path_NM" --echo "$as_me:$LINENO: result: $NM" >&5 --echo "${ECHO_T}$NM" >&6 - - echo "$as_me:$LINENO: checking whether ln -s works" >&5 - echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -@@ -3041,8 +3519,8 @@ - echo "${ECHO_T}no, using $LN_S" >&6 - fi - --echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 --echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 -+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 - if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -@@ -3056,7 +3534,7 @@ - # 'pass_all' -- all dependencies passed with no checks. - # 'test_compile' -- check by making test program. - # 'file_magic [[regex]]' -- check by looking for files in library path --# which responds to the $file_magic_cmd with a given egrep regex. -+# which responds to the $file_magic_cmd with a given extended regex. - # If you have `file' or equivalent on your system and you're not sure - # whether `pass_all' will *always* work, you probably want this one. - -@@ -3069,37 +3547,36 @@ - lt_cv_deplibs_check_method=pass_all - ;; - --bsdi4*) -+bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - --cygwin* | mingw* | pw32*) -+cygwin*) -+ # func_win32_libid is a shell function defined in ltmain.sh -+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' -+ lt_cv_file_magic_cmd='func_win32_libid' -+ ;; -+ -+mingw* | pw32*) -+ # Base MSYS/MinGW do not provide the 'file' command needed by -+ # func_win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - - darwin* | rhapsody*) -- lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' -- lt_cv_file_magic_cmd='/usr/bin/file -L' -- case "$host_os" in -- rhapsody* | darwin1.[012]) -- lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` -- ;; -- *) # Darwin 1.3 on -- lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' -- ;; -- esac -+ lt_cv_deplibs_check_method=pass_all - ;; - --freebsd*) -+freebsd* | kfreebsd*-gnu | dragonfly*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. -- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' -+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; -@@ -3113,50 +3590,44 @@ - lt_cv_deplibs_check_method=pass_all - ;; - --hpux10.20*|hpux11*) -- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' -+hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=/usr/lib/libc.sl -- ;; -- --irix5* | irix6*) -- case $host_os in -- irix5*) -- # this will be overridden with pass_all, but let us keep it just in case -- lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" -+ case $host_cpu in -+ ia64*) -+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' -+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so -+ ;; -+ hppa*64*) -+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' -+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) -- case $LD in -- *-32|*"-32 ") libmagic=32-bit;; -- *-n32|*"-n32 ") libmagic=N32;; -- *-64|*"-64 ") libmagic=64-bit;; -- *) libmagic=never-match;; -- esac -- # this will be overridden with pass_all, but let us keep it just in case -- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" -+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' -+ lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac -- lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` -+ ;; -+ -+irix5* | irix6* | nonstopux*) -+ case $LD in -+ *-32|*"-32 ") libmagic=32-bit;; -+ *-n32|*"-n32 ") libmagic=N32;; -+ *-64|*"-64 ") libmagic=64-bit;; -+ *) libmagic=never-match;; -+ esac - lt_cv_deplibs_check_method=pass_all - ;; - - # This must be Linux ELF. --linux-gnu*) -- case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) -- lt_cv_deplibs_check_method=pass_all ;; -- *) -- # glibc up to 2.1.1 does not perform some relocations on ARM -- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; -- esac -- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` -+linux*) -+ lt_cv_deplibs_check_method=pass_all - ;; - --netbsd*) -+netbsd* | netbsdelf*-gnu | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then -- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' -+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else -- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' -+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -@@ -3166,20 +3637,19 @@ - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -+nto-qnx*) -+ lt_cv_deplibs_check_method=unknown -+ ;; -+ - openbsd*) -- lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' -+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else -- lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' -+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - - osf3* | osf4* | osf5*) -- # this will be overridden with pass_all, but let us keep it just in case -- lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' -- lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -@@ -3189,11 +3659,6 @@ - - solaris*) - lt_cv_deplibs_check_method=pass_all -- lt_cv_file_magic_test_file=/lib/libc.so -- ;; -- --sysv5uw[78]* | sysv4*uw2*) -- lt_cv_deplibs_check_method=pass_all - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -@@ -3214,8 +3679,15 @@ - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; -+ siemens) -+ lt_cv_deplibs_check_method=pass_all -+ ;; - esac - ;; -+ -+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; - esac - - fi -@@ -3223,207 +3695,208 @@ - echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 - file_magic_cmd=$lt_cv_file_magic_cmd - deplibs_check_method=$lt_cv_deplibs_check_method -+test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - -+# If no C compiler was specified, use CC. -+LTCC=${LTCC-"$CC"} - -+# Allow CC to be a program name with arguments. -+compiler=$CC - -+# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -+if test "${enable_libtool_lock+set}" = set; then -+ enableval="$enable_libtool_lock" - --# Check for command to grab the raw symbol name followed by C symbol from nm. --echo "$as_me:$LINENO: checking command to parse $NM output" >&5 --echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6 --if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- --# These are sane defaults that work on at least a few old systems. --# [They come from Ultrix. What could be older than Ultrix?!! ;)] -- --# Character class describing NM global symbol codes. --symcode='[BCDEGRST]' -- --# Regexp to match symbols that can be accessed directly from C. --sympat='\([_A-Za-z][_A-Za-z0-9]*\)' -- --# Transform the above into a raw symbol and a C symbol. --symxfrm='\1 \2\3 \3' -- --# Transform an extracted symbol line into a proper C declaration --lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" -- --# Transform an extracted symbol line into symbol name and symbol address --lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -- --# Define system-specific variables. --case $host_os in --aix*) -- symcode='[BCDT]' -- ;; --cygwin* | mingw* | pw32*) -- symcode='[ABCDGISTW]' -- ;; --hpux*) # Its linker distinguishes data from code symbols -- lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -- lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -- ;; --irix*) -- symcode='[BCDEGRST]' -- ;; --solaris* | sysv5*) -- symcode='[BDT]' -- ;; --sysv4) -- symcode='[DFNSTU]' -- ;; --esac -- --# Handle CRLF in mingw tool chain --opt_cr= --case $host_os in --mingw*) -- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp -- ;; --esac -- --# If we're using GNU nm, then use its standard symbol codes. --if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then -- symcode='[ABCDGISTW]' --fi -- --# Try without a prefix undercore, then with it. --for ac_symprfx in "" "_"; do -- -- # Write the raw and C identifiers. --lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" -- -- # Check to see that the pipe works correctly. -- pipe_works=no -- rm -f conftest* -- cat > conftest.$ac_ext < conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then -- # Now try to grab the symbols. -- nlist=conftest.nm -- if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 -- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 -+ case `/usr/bin/file conftest.$ac_objext` in -+ *ELF-32*) -+ HPUX_IA64_MODE="32" -+ ;; -+ *ELF-64*) -+ HPUX_IA64_MODE="64" -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; -+*-*-irix6*) -+ # Find out which ABI we are using. -+ echo '#line 3740 "configure"' > conftest.$ac_ext -+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && test -s "$nlist"; then -- # Try sorting and uniquifying the output. -- if sort "$nlist" | uniq > "$nlist"T; then -- mv -f "$nlist"T "$nlist" -- else -- rm -f "$nlist"T -- fi -+ (exit $ac_status); }; then -+ if test "$lt_cv_prog_gnu_ld" = yes; then -+ case `/usr/bin/file conftest.$ac_objext` in -+ *32-bit*) -+ LD="${LD-ld} -melf32bsmip" -+ ;; -+ *N32*) -+ LD="${LD-ld} -melf32bmipn32" -+ ;; -+ *64-bit*) -+ LD="${LD-ld} -melf64bmip" -+ ;; -+ esac -+ else -+ case `/usr/bin/file conftest.$ac_objext` in -+ *32-bit*) -+ LD="${LD-ld} -32" -+ ;; -+ *N32*) -+ LD="${LD-ld} -n32" -+ ;; -+ *64-bit*) -+ LD="${LD-ld} -64" -+ ;; -+ esac -+ fi -+ fi -+ rm -rf conftest* -+ ;; - -- # Make sure that we snagged all the symbols we need. -- if egrep ' nm_test_var$' "$nlist" >/dev/null; then -- if egrep ' nm_test_func$' "$nlist" >/dev/null; then -- cat < conftest.$ac_ext --#ifdef __cplusplus --extern "C" { --#endif -+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; then -+ case `/usr/bin/file conftest.o` in -+ *32-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ ppc64-*linux*|powerpc64-*linux*) -+ LD="${LD-ld} -m elf32ppclinux" -+ ;; -+ s390x-*linux*) -+ LD="${LD-ld} -m elf_s390" -+ ;; -+ sparc64-*linux*) -+ LD="${LD-ld} -m elf32_sparc" -+ ;; -+ esac -+ ;; -+ *64-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_x86_64" -+ ;; -+ ppc*-*linux*|powerpc*-*linux*) -+ LD="${LD-ld} -m elf64ppc" -+ ;; -+ s390*-*linux*) -+ LD="${LD-ld} -m elf64_s390" -+ ;; -+ sparc*-*linux*) -+ LD="${LD-ld} -m elf64_sparc" -+ ;; -+ esac -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; - --EOF -- # Now generate the symbol file. -- eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' -+*-*-sco3.2v5*) -+ # On SCO OpenServer 5, we need -belf to get full-featured binaries. -+ SAVE_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -belf" -+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -+if test "${lt_cv_cc_needs_belf+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- cat <> conftest.$ac_ext --#if defined (__STDC__) && __STDC__ --# define lt_ptr void * --#else --# define lt_ptr char * --# define const --#endif -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --/* The mapping between symbol names and symbols. */ --const struct { -- const char *name; -- lt_ptr address; --} --lt_preloaded_symbols[] = -+int -+main () - { --EOF -- sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext -- cat <<\EOF >> conftest.$ac_ext -- {0, (lt_ptr) 0} --}; - --#ifdef __cplusplus -+ ; -+ return 0; - } --#endif --EOF -- # Now try linking the two files. -- mv conftest.$ac_objext conftstm.$ac_objext -- save_LIBS="$LIBS" -- save_CFLAGS="$CFLAGS" -- LIBS="conftstm.$ac_objext" -- CFLAGS="$CFLAGS$no_builtin_flag" -- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && test -s conftest; then -- pipe_works=yes -- fi -- LIBS="$save_LIBS" -- CFLAGS="$save_CFLAGS" -- else -- echo "cannot find nm_test_func in $nlist" >&5 -- fi -- else -- echo "cannot find nm_test_var in $nlist" >&5 -- fi -- else -- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 -- fi -- else -- echo "$progname: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- fi -- rm -f conftest* conftst* -- -- # Do not use the global_symbol_pipe unless it works. -- if test "$pipe_works" = yes; then -- break -- else -- lt_cv_sys_global_symbol_pipe= -- fi --done -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ lt_cv_cc_needs_belf=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+lt_cv_cc_needs_belf=no - fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu - --global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" --if test -z "$lt_cv_sys_global_symbol_pipe"; then -- global_symbol_to_cdecl= -- global_symbol_to_c_name_address= --else -- global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" -- global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" --fi --if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; --then -- echo "$as_me:$LINENO: result: failed" >&5 --echo "${ECHO_T}failed" >&6 --else -- echo "$as_me:$LINENO: result: ok" >&5 --echo "${ECHO_T}ok" >&6 - fi -+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 -+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then -+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf -+ CFLAGS="$SAVE_CFLAGS" -+ fi -+ ;; -+ -+esac -+ -+need_locks="$enable_libtool_lock" -+ - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' -@@ -3448,24 +3921,34 @@ - do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -- Syntax error -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ Syntax error - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -@@ -3476,7 +3959,8 @@ - : - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - # Broken: fails on valid input. - continue - fi -@@ -3485,20 +3969,24 @@ - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -@@ -3510,7 +3998,8 @@ - continue - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - # Passes both tests. - ac_preproc_ok=: - break -@@ -3539,24 +4028,34 @@ - do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -- Syntax error -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ Syntax error - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -@@ -3567,7 +4066,8 @@ - : - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - # Broken: fails on valid input. - continue - fi -@@ -3576,20 +4076,24 @@ - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -@@ -3601,7 +4105,8 @@ - continue - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - # Passes both tests. - ac_preproc_ok=: - break -@@ -3614,8 +4119,10 @@ - if $ac_preproc_ok; then - : - else -- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 --echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} -+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -+See \`config.log' for more details." >&5 -+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -+See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - -@@ -3632,49 +4139,67 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - #include - #include - #include - -+int -+main () -+{ -+ -+ ; -+ return 0; -+} - _ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi --else -- ac_cpp_err=yes --fi --if test -z "$ac_cpp_err"; then -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then - ac_cv_header_stdc=yes - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- ac_cv_header_stdc=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_header_stdc=no - fi --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - - if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - - _ACEOF - if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- egrep "memchr" >/dev/null 2>&1; then -+ $EGREP "memchr" >/dev/null 2>&1; then - : - else - ac_cv_header_stdc=no -@@ -3686,13 +4211,16 @@ - if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - - _ACEOF - if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- egrep "free" >/dev/null 2>&1; then -+ $EGREP "free" >/dev/null 2>&1; then - : - else - ac_cv_header_stdc=no -@@ -3707,16 +4235,20 @@ - : - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - #if ((' ' & 0x0FF) == 0x020) - # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') - # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) - #else --# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ -- || ('j' <= (c) && (c) <= 'r') \ -- || ('s' <= (c) && (c) <= 'z')) -+# define ISLOWER(c) \ -+ (('a' <= (c) && (c) <= 'i') \ -+ || ('j' <= (c) && (c) <= 'r') \ -+ || ('s' <= (c) && (c) <= 'z')) - # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) - #endif - -@@ -3727,7 +4259,7 @@ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) -- || toupper (i) != TOUPPER (i)) -+ || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); - } -@@ -3747,11 +4279,12 @@ - else - echo "$as_me: program exited with status $ac_status" >&5 - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ( exit $ac_status ) - ac_cv_header_stdc=no - fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi - fi - fi -@@ -3776,7 +4309,7 @@ - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ -- inttypes.h stdint.h unistd.h -+ inttypes.h stdint.h unistd.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_header" >&5 -@@ -3785,19 +4318,31 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_includes_default - - #include <$ac_header> - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -3806,10 +4351,11 @@ - eval "$as_ac_Header=yes" - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - eval "$as_ac_Header=no" - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -@@ -3840,18 +4386,30 @@ - echo "$as_me:$LINENO: checking $ac_header usability" >&5 - echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_includes_default - #include <$ac_header> - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -3860,10 +4418,11 @@ - ac_header_compiler=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ac_header_compiler=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - echo "${ECHO_T}$ac_header_compiler" >&6 - -@@ -3871,20 +4430,24 @@ - echo "$as_me:$LINENO: checking $ac_header presence" >&5 - echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include <$ac_header> - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -@@ -3895,7 +4458,8 @@ - ac_header_preproc=yes - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ac_header_preproc=no - fi - rm -f conftest.err conftest.$ac_ext -@@ -3903,26 +4467,43 @@ - echo "${ECHO_T}$ac_header_preproc" >&6 - - # So? What about this header? --case $ac_header_compiler:$ac_header_preproc in -- yes:no ) -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 - echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -- no:yes ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 - echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; - esac - echo "$as_me:$LINENO: checking for $ac_header" >&5 - echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- eval "$as_ac_Header=$ac_header_preproc" -+ eval "$as_ac_Header=\$ac_header_preproc" - fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -@@ -3937,159 +4518,65 @@ - - done - -- -- -- -- --# Only perform the check for file, if the check method requires it --case $deplibs_check_method in --file_magic*) -- if test "$file_magic_cmd" = '$MAGIC_CMD'; then -- echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 --echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 --if test "${lt_cv_path_MAGIC_CMD+set}" = set; then -+ac_ext=cc -+ac_cpp='$CXXCPP $CPPFLAGS' -+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -+if test -n "$ac_tool_prefix"; then -+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -+ do -+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -+set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- case $MAGIC_CMD in -- /*) -- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. -- ;; -- ?:/*) -- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. -- ;; -- *) -- ac_save_MAGIC_CMD="$MAGIC_CMD" -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -- ac_dummy="/usr/bin:$PATH" -- for ac_dir in $ac_dummy; do -- test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/${ac_tool_prefix}file; then -- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" -- if test -n "$file_magic_test_file"; then -- case $deplibs_check_method in -- "file_magic "*) -- file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" -- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | -- egrep "$file_magic_regex" > /dev/null; then -- : -- else -- cat <&2 -- --*** Warning: the command libtool uses to detect shared libraries, --*** $file_magic_cmd, produces output that libtool cannot recognize. --*** The result is that libtool may fail to recognize shared libraries --*** as such. This will affect the creation of libtool libraries that --*** depend on shared libraries, but programs linked with such libtool --*** libraries will work regardless of this problem. Nevertheless, you --*** may want to report the problem to your system manager and/or to --*** bug-libtool@gnu.org -+ if test -n "$CXX"; then -+ ac_cv_prog_CXX="$CXX" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done - --EOF -- fi ;; -- esac -- fi -- break -- fi -- done -- IFS="$ac_save_ifs" -- MAGIC_CMD="$ac_save_MAGIC_CMD" -- ;; --esac - fi -- --MAGIC_CMD="$lt_cv_path_MAGIC_CMD" --if test -n "$MAGIC_CMD"; then -- echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 --echo "${ECHO_T}$MAGIC_CMD" >&6 -+fi -+CXX=$ac_cv_prog_CXX -+if test -n "$CXX"; then -+ echo "$as_me:$LINENO: result: $CXX" >&5 -+echo "${ECHO_T}$CXX" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - --if test -z "$lt_cv_path_MAGIC_CMD"; then -- if test -n "$ac_tool_prefix"; then -- echo "$as_me:$LINENO: checking for file" >&5 --echo $ECHO_N "checking for file... $ECHO_C" >&6 --if test "${lt_cv_path_MAGIC_CMD+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- case $MAGIC_CMD in -- /*) -- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. -- ;; -- ?:/*) -- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. -- ;; -- *) -- ac_save_MAGIC_CMD="$MAGIC_CMD" -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -- ac_dummy="/usr/bin:$PATH" -- for ac_dir in $ac_dummy; do -- test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/file; then -- lt_cv_path_MAGIC_CMD="$ac_dir/file" -- if test -n "$file_magic_test_file"; then -- case $deplibs_check_method in -- "file_magic "*) -- file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" -- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | -- egrep "$file_magic_regex" > /dev/null; then -- : -- else -- cat <&2 -- --*** Warning: the command libtool uses to detect shared libraries, --*** $file_magic_cmd, produces output that libtool cannot recognize. --*** The result is that libtool may fail to recognize shared libraries --*** as such. This will affect the creation of libtool libraries that --*** depend on shared libraries, but programs linked with such libtool --*** libraries will work regardless of this problem. Nevertheless, you --*** may want to report the problem to your system manager and/or to --*** bug-libtool@gnu.org -- --EOF -- fi ;; -- esac -- fi -- break -- fi -+ test -n "$CXX" && break - done -- IFS="$ac_save_ifs" -- MAGIC_CMD="$ac_save_MAGIC_CMD" -- ;; --esac --fi -- --MAGIC_CMD="$lt_cv_path_MAGIC_CMD" --if test -n "$MAGIC_CMD"; then -- echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 --echo "${ECHO_T}$MAGIC_CMD" >&6 --else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 --fi -- -- else -- MAGIC_CMD=: -- fi - fi -- -- fi -- ;; --esac -- --if test -n "$ac_tool_prefix"; then -- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. --set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -+if test -z "$CXX"; then -+ ac_ct_CXX=$CXX -+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_RANLIB+set}" = set; then -+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test -n "$RANLIB"; then -- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -+ if test -n "$ac_ct_CXX"; then -+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH -@@ -4098,7 +4585,7 @@ - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -+ ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -@@ -4107,4958 +4594,18846 @@ - - fi - fi --RANLIB=$ac_cv_prog_RANLIB --if test -n "$RANLIB"; then -- echo "$as_me:$LINENO: result: $RANLIB" >&5 --echo "${ECHO_T}$RANLIB" >&6 -+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -+if test -n "$ac_ct_CXX"; then -+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -+echo "${ECHO_T}$ac_ct_CXX" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - --fi --if test -z "$ac_cv_prog_RANLIB"; then -- ac_ct_RANLIB=$RANLIB -- # Extract the first word of "ranlib", so it can be a program name with args. --set dummy ranlib; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- if test -n "$ac_ct_RANLIB"; then -- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. --else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_ac_ct_RANLIB="ranlib" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -+ test -n "$ac_ct_CXX" && break - done -+test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - -- test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" --fi --fi --ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB --if test -n "$ac_ct_RANLIB"; then -- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 --echo "${ECHO_T}$ac_ct_RANLIB" >&6 --else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 -+ CXX=$ac_ct_CXX - fi - -- RANLIB=$ac_ct_RANLIB --else -- RANLIB="$ac_cv_prog_RANLIB" --fi - --if test -n "$ac_tool_prefix"; then -- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. --set dummy ${ac_tool_prefix}strip; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_STRIP+set}" = set; then -+# Provide some information about the compiler. -+echo "$as_me:$LINENO:" \ -+ "checking for C++ compiler version" >&5 -+ac_compiler=`set X $ac_compile; echo $2` -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 -+ (eval $ac_compiler --version &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 -+ (eval $ac_compiler -v &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 -+ (eval $ac_compiler -V &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+ -+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test -n "$STRIP"; then -- ac_cv_prog_STRIP="$STRIP" # Let the user override the test. --else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_STRIP="${ac_tool_prefix}strip" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --fi --fi --STRIP=$ac_cv_prog_STRIP --if test -n "$STRIP"; then -- echo "$as_me:$LINENO: result: $STRIP" >&5 --echo "${ECHO_T}$STRIP" >&6 -+int -+main () -+{ -+#ifndef __GNUC__ -+ choke me -+#endif -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_compiler_gnu=yes - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_compiler_gnu=no - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - - fi --if test -z "$ac_cv_prog_STRIP"; then -- ac_ct_STRIP=$STRIP -- # Extract the first word of "strip", so it can be a program name with args. --set dummy strip; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then -+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -+GXX=`test $ac_compiler_gnu = yes && echo yes` -+ac_test_CXXFLAGS=${CXXFLAGS+set} -+ac_save_CXXFLAGS=$CXXFLAGS -+CXXFLAGS="-g" -+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -+if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test -n "$ac_ct_STRIP"; then -- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. --else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_ac_ct_STRIP="strip" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - -- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" --fi --fi --ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP --if test -n "$ac_ct_STRIP"; then -- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 --echo "${ECHO_T}$ac_ct_STRIP" >&6 --else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 --fi -+int -+main () -+{ - -- STRIP=$ac_ct_STRIP --else -- STRIP="$ac_cv_prog_STRIP" --fi -- -- --enable_dlopen=no --enable_win32_dll=no -- --# Check whether --enable-libtool-lock or --disable-libtool-lock was given. --if test "${enable_libtool_lock+set}" = set; then -- enableval="$enable_libtool_lock" -- --fi; --test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -- --# Some flags need to be propagated to the compiler or linker for good --# libtool support. --case $host in --*-*-irix6*) -- # Find out which ABI we are using. -- echo '#line 4259 "configure"' > conftest.$ac_ext -- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; then -- case `/usr/bin/file conftest.$ac_objext` in -- *32-bit*) -- LD="${LD-ld} -32" -- ;; -- *N32*) -- LD="${LD-ld} -n32" -- ;; -- *64-bit*) -- LD="${LD-ld} -64" -- ;; -- esac -- fi -- rm -rf conftest* -- ;; -- --*-*-sco3.2v5*) -- # On SCO OpenServer 5, we need -belf to get full-featured binaries. -- SAVE_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS -belf" -- echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 --echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 --if test "${lt_cv_cc_needs_belf+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_prog_cxx_g=yes - else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -- -- ac_ext=c --ac_cpp='$CPP $CPPFLAGS' --ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_c_compiler_gnu -- -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ac_cv_prog_cxx_g=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -+if test "$ac_test_CXXFLAGS" = set; then -+ CXXFLAGS=$ac_save_CXXFLAGS -+elif test $ac_cv_prog_cxx_g = yes; then -+ if test "$GXX" = yes; then -+ CXXFLAGS="-g -O2" -+ else -+ CXXFLAGS="-g" -+ fi -+else -+ if test "$GXX" = yes; then -+ CXXFLAGS="-O2" -+ else -+ CXXFLAGS= -+ fi -+fi -+for ac_declaration in \ -+ '' \ -+ 'extern "C" void std::exit (int) throw (); using std::exit;' \ -+ 'extern "C" void std::exit (int); using std::exit;' \ -+ 'extern "C" void exit (int) throw ();' \ -+ 'extern "C" void exit (int);' \ -+ 'void exit (int);' -+do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_declaration -+#include - int - main () - { -- -+exit (42); - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- lt_cv_cc_needs_belf=yes -+ : - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --lt_cv_cc_needs_belf=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+continue - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -- ac_ext=c --ac_cpp='$CPP $CPPFLAGS' --ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_c_compiler_gnu -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_declaration -+int -+main () -+{ -+exit (42); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - - fi --echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 --echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 -- if test x"$lt_cv_cc_needs_belf" != x"yes"; then -- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf -- CFLAGS="$SAVE_CFLAGS" -- fi -- ;; -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+rm -f conftest* -+if test -n "$ac_declaration"; then -+ echo '#ifdef __cplusplus' >>confdefs.h -+ echo $ac_declaration >>confdefs.h -+ echo '#endif' >>confdefs.h -+fi - -+ac_ext=cc -+ac_cpp='$CXXCPP $CPPFLAGS' -+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - --esac -+depcc="$CXX" am_compiler_list= - --# Sed substitution that helps us do robust quoting. It backslashifies --# metacharacters that are still active within double-quoted strings. --Xsed='sed -e s/^X//' --sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' -+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then -+ # We make a subdir and do the tests there. Otherwise we can end up -+ # making bogus files that we don't know about and never remove. For -+ # instance it was reported that on HP-UX the gcc test will end up -+ # making a dummy file named `D' -- because `-MD' means `put the output -+ # in D'. -+ mkdir conftest.dir -+ # Copy depcomp to subdir because otherwise we won't find it if we're -+ # using a relative directory. -+ cp "$am_depcomp" conftest.dir -+ cd conftest.dir -+ # We will build objects and dependencies in a subdirectory because -+ # it helps to detect inapplicable dependency modes. For instance -+ # both Tru64's cc and ICC support -MD to output dependencies as a -+ # side effect of compilation, but ICC will put the dependencies in -+ # the current directory while Tru64 will put them in the object -+ # directory. -+ mkdir sub - --# Same as above, but do not quote variable references. --double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' -+ am_cv_CXX_dependencies_compiler_type=none -+ if test "$am_compiler_list" = ""; then -+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` -+ fi -+ for depmode in $am_compiler_list; do -+ # Setup a source with many dependencies, because some compilers -+ # like to wrap large dependency lists on column 80 (with \), and -+ # we should not choose a depcomp mode which is confused by this. -+ # -+ # We need to recreate these files for each test, as the compiler may -+ # overwrite some of them when testing with obscure command lines. -+ # This happens at least with the AIX C compiler. -+ : > sub/conftest.c -+ for i in 1 2 3 4 5 6; do -+ echo '#include "conftst'$i'.h"' >> sub/conftest.c -+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with -+ # Solaris 8's {/usr,}/bin/sh. -+ touch sub/conftst$i.h -+ done -+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - --# Sed substitution to delay expansion of an escaped shell variable in a --# double_quote_subst'ed string. --delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -+ case $depmode in -+ nosideeffect) -+ # after this tag, mechanisms are not by side-effect, so they'll -+ # only be used when explicitly requested -+ if test "x$enable_dependency_tracking" = xyes; then -+ continue -+ else -+ break -+ fi -+ ;; -+ none) break ;; -+ esac -+ # We check with `-c' and `-o' for the sake of the "dashmstdout" -+ # mode. It turns out that the SunPro C++ compiler does not properly -+ # handle `-M -o', and we need to detect this. -+ if depmode=$depmode \ -+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ -+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ -+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ -+ >/dev/null 2>conftest.err && -+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && -+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && -+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -+ # icc doesn't choke on unknown options, it will just issue warnings -+ # or remarks (even with -Werror). So we grep stderr for any message -+ # that says an option was ignored or not supported. -+ # When given -MP, icc 7.0 and 7.1 complain thusly: -+ # icc: Command line warning: ignoring option '-M'; no argument required -+ # The diagnosis changed in icc 8.0: -+ # icc: Command line remark: option '-MP' not supported -+ if (grep 'ignoring option' conftest.err || -+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else -+ am_cv_CXX_dependencies_compiler_type=$depmode -+ break -+ fi -+ fi -+ done - --# Constants: --rm="rm -f" -+ cd .. -+ rm -rf conftest.dir -+else -+ am_cv_CXX_dependencies_compiler_type=none -+fi - --# Global variables: --default_ofile=libtool --can_build_shared=yes -+fi -+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 -+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - --# All known linkers require a `.a' archive for static linking (except M$VC, --# which needs '.lib'). --libext=a --ltmain="$ac_aux_dir/ltmain.sh" --ofile="$default_ofile" --with_gnu_ld="$lt_cv_prog_gnu_ld" --need_locks="$enable_libtool_lock" - --old_CC="$CC" --old_CFLAGS="$CFLAGS" -- --# Set sane defaults for various variables --test -z "$AR" && AR=ar --test -z "$AR_FLAGS" && AR_FLAGS=cru --test -z "$AS" && AS=as --test -z "$CC" && CC=cc --test -z "$DLLTOOL" && DLLTOOL=dlltool --test -z "$LD" && LD=ld --test -z "$LN_S" && LN_S="ln -s" --test -z "$MAGIC_CMD" && MAGIC_CMD=file --test -z "$NM" && NM=nm --test -z "$OBJDUMP" && OBJDUMP=objdump --test -z "$RANLIB" && RANLIB=: --test -z "$STRIP" && STRIP=: --test -z "$ac_objext" && ac_objext=o -- --if test x"$host" != x"$build"; then -- ac_tool_prefix=${host_alias}- --else -- ac_tool_prefix= --fi -- --# Transform linux* to *-*-linux-gnu*, to support old configure scripts. --case $host_os in --linux-gnu*) ;; --linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` --esac -- --case $host_os in --aix3*) -- # AIX sometimes has problems with the GCC collect2 program. For some -- # reason, if we set the COLLECT_NAMES environment variable, the problems -- # vanish in a puff of smoke. -- if test "X${COLLECT_NAMES+set}" != Xset; then -- COLLECT_NAMES= -- export COLLECT_NAMES -- fi -- ;; --esac -- --# Determine commands to create old-style static archives. --old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' --old_postinstall_cmds='chmod 644 $oldlib' --old_postuninstall_cmds= -- --if test -n "$RANLIB"; then -- case $host_os in -- openbsd*) -- old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" -- ;; -- *) -- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -- ;; -- esac -- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" --fi - --# Allow CC to be a program name with arguments. --set dummy $CC --compiler="$2" -- --echo "$as_me:$LINENO: checking for objdir" >&5 --echo $ECHO_N "checking for objdir... $ECHO_C" >&6 --rm -f .libs 2>/dev/null --mkdir .libs 2>/dev/null --if test -d .libs; then -- objdir=.libs -+if -+ test "x$enable_dependency_tracking" != xno \ -+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then -+ am__fastdepCXX_TRUE= -+ am__fastdepCXX_FALSE='#' - else -- # MS-DOS does not allow filenames that begin with a dot. -- objdir=_libs -+ am__fastdepCXX_TRUE='#' -+ am__fastdepCXX_FALSE= - fi --rmdir .libs 2>/dev/null --echo "$as_me:$LINENO: result: $objdir" >&5 --echo "${ECHO_T}$objdir" >&6 - - - --# Check whether --with-pic or --without-pic was given. --if test "${with_pic+set}" = set; then -- withval="$with_pic" -- pic_mode="$withval" --else -- pic_mode=default --fi; --test -z "$pic_mode" && pic_mode=default - --# We assume here that the value for lt_cv_prog_cc_pic will not be cached --# in isolation, and that seeing it set (from the cache) indicates that --# the associated values are set (in the cache) correctly too. --echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 --echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 --if test "${lt_cv_prog_cc_pic+set}" = set; then -+if test -n "$CXX" && ( test "X$CXX" != "Xno" && -+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || -+ (test "X$CXX" != "Xg++"))) ; then -+ ac_ext=cc -+ac_cpp='$CXXCPP $CPPFLAGS' -+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 -+if test -z "$CXXCPP"; then -+ if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- lt_cv_prog_cc_pic= -- lt_cv_prog_cc_shlib= -- lt_cv_prog_cc_wl= -- lt_cv_prog_cc_static= -- lt_cv_prog_cc_no_builtin= -- lt_cv_prog_cc_can_build_shared=$can_build_shared -- -- if test "$GCC" = yes; then -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static='-static' -- -- case $host_os in -- aix*) -- # Below there is a dirty hack to force normal static linking with -ldl -- # The problem is because libdl dynamically linked with both libc and -- # libC (AIX C++ library), which obviously doesn't included in libraries -- # list by gcc. This cause undefined symbols with -static flags. -- # This hack allows C programs to be linked with "-static -ldl", but -- # not sure about C++ programs. -- lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" -- ;; -- amigaos*) -- # FIXME: we need at least 68020 code to build shared libraries, but -- # adding the `-m68020' flag to GCC prevents building anything better, -- # like `-m68040'. -- lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' -- ;; -- beos* | irix5* | irix6* | osf3* | osf4* | osf5*) -- # PIC is the default for these OSes. -- ;; -- darwin* | rhapsody*) -- # PIC is the default on this platform -- # Common symbols not allowed in MH_DYLIB files -- lt_cv_prog_cc_pic='-fno-common' -- ;; -- cygwin* | mingw* | pw32* | os2*) -- # This hack is so that the source file can tell whether it is being -- # built for inclusion in a dll (and should export symbols for example). -- lt_cv_prog_cc_pic='-DDLL_EXPORT' -- ;; -- sysv4*MP*) -- if test -d /usr/nec; then -- lt_cv_prog_cc_pic=-Kconform_pic -- fi -- ;; -- *) -- lt_cv_prog_cc_pic='-fPIC' -- ;; -- esac -+ # Double quotes because CXXCPP needs to be expanded -+ for CXXCPP in "$CXX -E" "/lib/cpp" -+ do -+ ac_preproc_ok=false -+for ac_cxx_preproc_warn_flag in '' yes -+do -+ # Use a header file that comes with gcc, so configuring glibc -+ # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. -+ # On the NeXT, cc -E runs the code through the compiler's parser, -+ # not just through cpp. "Syntax error" is here to catch this case. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ Syntax error -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_cxx_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else -- # PORTME Check for PIC flags for the system compiler. -- case $host_os in -- aix3* | aix4* | aix5*) -- lt_cv_prog_cc_wl='-Wl,' -- # All AIX code is PIC. -- if test "$host_cpu" = ia64; then -- # AIX 5 now supports IA64 processor -- lt_cv_prog_cc_static='-Bstatic' -- else -- lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' -- fi -- ;; -- -- hpux9* | hpux10* | hpux11*) -- # Is there a better lt_cv_prog_cc_static that works with the bundled CC? -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" -- lt_cv_prog_cc_pic='+Z' -- ;; -- -- irix5* | irix6*) -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static='-non_shared' -- # PIC (with -KPIC) is the default. -- ;; -- -- cygwin* | mingw* | pw32* | os2*) -- # This hack is so that the source file can tell whether it is being -- # built for inclusion in a dll (and should export symbols for example). -- lt_cv_prog_cc_pic='-DDLL_EXPORT' -- ;; -- -- newsos6) -- lt_cv_prog_cc_pic='-KPIC' -- lt_cv_prog_cc_static='-Bstatic' -- ;; -- -- osf3* | osf4* | osf5*) -- # All OSF/1 code is PIC. -- lt_cv_prog_cc_wl='-Wl,' -- lt_cv_prog_cc_static='-non_shared' -- ;; -- -- sco3.2v5*) -- lt_cv_prog_cc_pic='-Kpic' -- lt_cv_prog_cc_static='-dn' -- lt_cv_prog_cc_shlib='-belf' -- ;; -- -- solaris*) -- lt_cv_prog_cc_pic='-KPIC' -- lt_cv_prog_cc_static='-Bstatic' -- lt_cv_prog_cc_wl='-Wl,' -- ;; -- -- sunos4*) -- lt_cv_prog_cc_pic='-PIC' -- lt_cv_prog_cc_static='-Bstatic' -- lt_cv_prog_cc_wl='-Qoption ld ' -- ;; -- -- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -- lt_cv_prog_cc_pic='-KPIC' -- lt_cv_prog_cc_static='-Bstatic' -- if test "x$host_vendor" = xsni; then -- lt_cv_prog_cc_wl='-LD' -- else -- lt_cv_prog_cc_wl='-Wl,' -- fi -- ;; -- -- uts4*) -- lt_cv_prog_cc_pic='-pic' -- lt_cv_prog_cc_static='-Bstatic' -- ;; -- -- sysv4*MP*) -- if test -d /usr/nec ;then -- lt_cv_prog_cc_pic='-Kconform_pic' -- lt_cv_prog_cc_static='-Bstatic' -- fi -- ;; -- -- *) -- lt_cv_prog_cc_can_build_shared=no -- ;; -- esac -+ ac_cpp_err= - fi -- --fi -- --if test -z "$lt_cv_prog_cc_pic"; then -- echo "$as_me:$LINENO: result: none" >&5 --echo "${ECHO_T}none" >&6 - else -- echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5 --echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6 -- -- # Check to make sure the pic_flag actually works. -- echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 --echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6 -- if test "${lt_cv_prog_cc_pic_works+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ : - else -- save_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.$ac_ext - -- ; -- return 0; --} -+ # OK, works on sane cases. Now check whether non-existent headers -+ # can be detected and how. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- case $host_os in -- hpux9* | hpux10* | hpux11*) -- # On HP-UX, both CC and GCC only warn that PIC is supported... then -- # they create non-PIC objects. So, if there were any warnings, we -- # assume that PIC is not supported. -- if test -s conftest.err; then -- lt_cv_prog_cc_pic_works=no -- else -- lt_cv_prog_cc_pic_works=yes -- fi -- ;; -- *) -- lt_cv_prog_cc_pic_works=yes -- ;; -- esac -- -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_cxx_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ # Broken: success on invalid input. -+continue - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -- lt_cv_prog_cc_pic_works=no -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ # Passes both tests. -+ac_preproc_ok=: -+break - fi --rm -f conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$save_CFLAGS" -+rm -f conftest.err conftest.$ac_ext - -+done -+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -+rm -f conftest.err conftest.$ac_ext -+if $ac_preproc_ok; then -+ break - fi - -+ done -+ ac_cv_prog_CXXCPP=$CXXCPP - -- if test "X$lt_cv_prog_cc_pic_works" = Xno; then -- lt_cv_prog_cc_pic= -- lt_cv_prog_cc_can_build_shared=no -- else -- lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" -- fi -- -- echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5 --echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6 - fi -- --# Check for any special shared library compilation flags. --if test -n "$lt_cv_prog_cc_shlib"; then -- { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5 --echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;} -- if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : -- else -- { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 --echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} -- lt_cv_prog_cc_can_build_shared=no -- fi --fi -- --echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 --echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6 --if test "${lt_cv_prog_cc_static_works+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ CXXCPP=$ac_cv_prog_CXXCPP - else -- lt_cv_prog_cc_static_works=no -- save_LDFLAGS="$LDFLAGS" -- LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" -+ ac_cv_prog_CXXCPP=$CXXCPP -+fi -+echo "$as_me:$LINENO: result: $CXXCPP" >&5 -+echo "${ECHO_T}$CXXCPP" >&6 -+ac_preproc_ok=false -+for ac_cxx_preproc_warn_flag in '' yes -+do -+ # Use a header file that comes with gcc, so configuring glibc -+ # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. -+ # On the NeXT, cc -E runs the code through the compiler's parser, -+ # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include -+#else -+# include - #endif --int --main () --{ -- -- ; -- return 0; --} -+ Syntax error - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_cxx_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ : -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.$ac_ext -+ -+ # OK, works on sane cases. Now check whether non-existent headers -+ # can be detected and how. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- lt_cv_prog_cc_static_works=yes -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_cxx_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ # Broken: success on invalid input. -+continue - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Passes both tests. -+ac_preproc_ok=: -+break - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -- LDFLAGS="$save_LDFLAGS" -+rm -f conftest.err conftest.$ac_ext - -+done -+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -+rm -f conftest.err conftest.$ac_ext -+if $ac_preproc_ok; then -+ : -+else -+ { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -+See \`config.log' for more details." >&5 -+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } - fi - -+ac_ext=cc -+ac_cpp='$CXXCPP $CPPFLAGS' -+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -+ -+fi - --# Belt *and* braces to stop my trousers falling down: --test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= --echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5 --echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6 - --pic_flag="$lt_cv_prog_cc_pic" --special_shlib_compile_flags="$lt_cv_prog_cc_shlib" --wl="$lt_cv_prog_cc_wl" --link_static_flag="$lt_cv_prog_cc_static" --no_builtin_flag="$lt_cv_prog_cc_no_builtin" --can_build_shared="$lt_cv_prog_cc_can_build_shared" -+ac_ext=f -+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_f77_compiler_gnu -+if test -n "$ac_tool_prefix"; then -+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran -+ do -+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -+set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_F77+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$F77"; then -+ ac_cv_prog_F77="$F77" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done - -+fi -+fi -+F77=$ac_cv_prog_F77 -+if test -n "$F77"; then -+ echo "$as_me:$LINENO: result: $F77" >&5 -+echo "${ECHO_T}$F77" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi - --# Check to see if options -o and -c are simultaneously supported by compiler --echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 --echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 --if test "${lt_cv_compiler_c_o+set}" = set; then -+ test -n "$F77" && break -+ done -+fi -+if test -z "$F77"; then -+ ac_ct_F77=$F77 -+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -+ if test -n "$ac_ct_F77"; then -+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_F77="$ac_prog" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+fi -+fi -+ac_ct_F77=$ac_cv_prog_ac_ct_F77 -+if test -n "$ac_ct_F77"; then -+ echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -+echo "${ECHO_T}$ac_ct_F77" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi - --$rm -r conftest 2>/dev/null --mkdir conftest --cd conftest --echo "int some_variable = 0;" > conftest.$ac_ext --mkdir out --# According to Tom Tromey, Ian Lance Taylor reported there are C compilers --# that will create temporary files in the current directory regardless of --# the output directory. Thus, making CWD read-only will cause this test --# to fail, enabling locking or at least warning the user not to do parallel --# builds. --chmod -w . --save_CFLAGS="$CFLAGS" --CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" --compiler_c_o=no --if { (eval echo configure:4795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then -- # The compiler can only warn and ignore the option if not recognized -- # So say no if there are warnings -- if test -s out/conftest.err; then -- lt_cv_compiler_c_o=no -- else -- lt_cv_compiler_c_o=yes -- fi --else -- # Append any errors to the config.log. -- cat out/conftest.err 1>&5 -- lt_cv_compiler_c_o=no --fi --CFLAGS="$save_CFLAGS" --chmod u+w . --$rm conftest* out/* --rmdir out --cd .. --rmdir conftest --$rm -r conftest 2>/dev/null -+ test -n "$ac_ct_F77" && break -+done - -+ F77=$ac_ct_F77 - fi - --compiler_c_o=$lt_cv_compiler_c_o --echo "$as_me:$LINENO: result: $compiler_c_o" >&5 --echo "${ECHO_T}$compiler_c_o" >&6 -- --if test x"$compiler_c_o" = x"yes"; then -- # Check to see if we can write to a .lo -- echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5 --echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6 -- if test "${lt_cv_compiler_o_lo+set}" = set; then -+ -+# Provide some information about the compiler. -+echo "$as_me:5311:" \ -+ "checking for Fortran 77 compiler version" >&5 -+ac_compiler=`set X $ac_compile; echo $2` -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 -+ (eval $ac_compiler --version &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 -+ (eval $ac_compiler -v &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 -+ (eval $ac_compiler -V &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+rm -f a.out -+ -+# If we don't use `.F' as extension, the preprocessor is not run on the -+# input file. (Note that this only needs to work for GNU compilers.) -+ac_save_ext=$ac_ext -+ac_ext=F -+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 -+if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- -- lt_cv_compiler_o_lo=no -- save_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS -c -o conftest.lo" -- save_objext="$ac_objext" -- ac_objext=lo - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+ program main -+#ifndef __GNUC__ -+ choke me - #endif --int --main () --{ --int some_variable = 0; -- ; -- return 0; --} -+ -+ end - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- # The compiler can only warn and ignore the option if not recognized -- # So say no if there are warnings -- if test -s conftest.err; then -- lt_cv_compiler_o_lo=no -- else -- lt_cv_compiler_o_lo=yes -- fi -- -+ ac_compiler_gnu=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --fi --rm -f conftest.$ac_objext conftest.$ac_ext -- ac_objext="$save_objext" -- CFLAGS="$save_CFLAGS" -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_compiler_gnu=no - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -- compiler_o_lo=$lt_cv_compiler_o_lo -- echo "$as_me:$LINENO: result: $compiler_o_lo" >&5 --echo "${ECHO_T}$compiler_o_lo" >&6 --else -- compiler_o_lo=no - fi -- --# Check to see if we can do hard links to lock some files if needed --hard_links="nottested" --if test "$compiler_c_o" = no && test "$need_locks" != no; then -- # do not overwrite the value of need_locks provided by the user -- echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 --echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 -- hard_links=yes -- $rm conftest* -- ln conftest.a conftest.b 2>/dev/null && hard_links=no -- touch conftest.a -- ln conftest.a conftest.b 2>&5 || hard_links=no -- ln conftest.a conftest.b 2>/dev/null && hard_links=no -- echo "$as_me:$LINENO: result: $hard_links" >&5 --echo "${ECHO_T}$hard_links" >&6 -- if test "$hard_links" = no; then -- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 --echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} -- need_locks=warn -- fi -+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 -+ac_ext=$ac_save_ext -+ac_test_FFLAGS=${FFLAGS+set} -+ac_save_FFLAGS=$FFLAGS -+FFLAGS= -+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 -+if test "${ac_cv_prog_f77_g+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- need_locks=no --fi -- --if test "$GCC" = yes; then -- # Check to see if options -fno-rtti -fno-exceptions are supported by compiler -- echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 --echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -- echo "int some_variable = 0;" > conftest.$ac_ext -- save_CFLAGS="$CFLAGS" -- CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" -- compiler_rtti_exceptions=no -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ FFLAGS=-g -+cat >conftest.$ac_ext <<_ACEOF -+ program main - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --int some_variable = 0; -- ; -- return 0; --} -+ end - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- # The compiler can only warn and ignore the option if not recognized -- # So say no if there are warnings -- if test -s conftest.err; then -- compiler_rtti_exceptions=no -- else -- compiler_rtti_exceptions=yes -- fi -- -+ ac_cv_prog_f77_g=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_prog_f77_g=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$save_CFLAGS" -- echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5 --echo "${ECHO_T}$compiler_rtti_exceptions" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -- if test "$compiler_rtti_exceptions" = "yes"; then -- no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' -+fi -+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 -+if test "$ac_test_FFLAGS" = set; then -+ FFLAGS=$ac_save_FFLAGS -+elif test $ac_cv_prog_f77_g = yes; then -+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then -+ FFLAGS="-g -O2" -+ else -+ FFLAGS="-g" -+ fi -+else -+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then -+ FFLAGS="-O2" - else -- no_builtin_flag=' -fno-builtin' -+ FFLAGS= - fi - fi - --# See if the linker supports building shared libraries. --echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5 --echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6 -+G77=`test $ac_compiler_gnu = yes && echo yes` -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu - --allow_undefined_flag= --no_undefined_flag= --need_lib_prefix=unknown --need_version=unknown --# when you set need_version to no, make sure it does not cause -set_version --# flags to be left without arguments --archive_cmds= --archive_expsym_cmds= --old_archive_from_new_cmds= --old_archive_from_expsyms_cmds= --export_dynamic_flag_spec= --whole_archive_flag_spec= --thread_safe_flag_spec= --hardcode_into_libs=no --hardcode_libdir_flag_spec= --hardcode_libdir_separator= --hardcode_direct=no --hardcode_minus_L=no --hardcode_shlibpath_var=unsupported --runpath_var= --link_all_deplibs=unknown --always_export_symbols=no --export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' --# include_expsyms should be a list of space-separated symbols to be *always* --# included in the symbol list --include_expsyms= --# exclude_expsyms can be an egrep regular expression of symbols to exclude --# it will be wrapped by ` (' and `)$', so one must not match beginning or --# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', --# as well as any symbol that contains `d'. --exclude_expsyms="_GLOBAL_OFFSET_TABLE_" --# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out --# platforms (ab)use it in PIC code, but their linkers get confused if --# the symbol is explicitly referenced. Since portable code cannot --# rely on this symbol name, it's probably fine to never include it in --# preloaded symbol tables. --extract_expsyms_cmds= - --case $host_os in --cygwin* | mingw* | pw32*) -- # FIXME: the MSVC++ port hasn't been tested in a loooong time -- # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++. -- if test "$GCC" != yes; then -- with_gnu_ld=no -- fi -- ;; --openbsd*) -- with_gnu_ld=no -- ;; --esac -- --ld_shlibs=yes --if test "$with_gnu_ld" = yes; then -- # If archive_cmds runs LD, not CC, wlarc should be empty -- wlarc='${wl}' - -- # See if GNU ld supports shared libraries. -- case $host_os in -- aix3* | aix4* | aix5*) -- # On AIX, the GNU linker is very broken -- # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. -- ld_shlibs=no -- cat <&2 -- --*** Warning: the GNU linker, at least up to release 2.9.1, is reported --*** to be unable to reliably create shared libraries on AIX. --*** Therefore, libtool is disabling shared libraries support. If you --*** really care for shared libraries, you may want to modify your PATH --*** so that a non-GNU linker is found, and then restart. -+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - --EOF -+# find the maximum length of command line arguments -+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -+if test "${lt_cv_sys_max_cmd_len+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ i=0 -+ teststring="ABCD" -+ -+ case $build_os in -+ msdosdjgpp*) -+ # On DJGPP, this test can blow up pretty badly due to problems in libc -+ # (any single argument exceeding 2000 bytes causes a buffer overrun -+ # during glob expansion). Even if it were fixed, the result of this -+ # check would be larger than it should be. -+ lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - -- amigaos*) -- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_minus_L=yes -- -- # Samuel A. Falvo II reports -- # that the semantics of dynamic libraries on AmigaOS, at least up -- # to version 4, is to share data among multiple programs linked -- # with the same dynamic library. Since this doesn't match the -- # behavior of shared libraries on other platforms, we can use -- # them. -- ld_shlibs=no -+ gnu*) -+ # Under GNU Hurd, this test is not required because there is -+ # no limit to the length of command line arguments. -+ # Libtool will interpret -1 as no limit whatsoever -+ lt_cv_sys_max_cmd_len=-1; - ;; - -- beos*) -- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -- allow_undefined_flag=unsupported -- # Joseph Beckenbach says some releases of gcc -- # support --undefined. This deserves some investigation. FIXME -- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- else -- ld_shlibs=no -- fi -+ cygwin* | mingw*) -+ # On Win9x/ME, this test blows up -- it succeeds, but takes -+ # about 5 minutes as the teststring grows exponentially. -+ # Worse, since 9x/ME are not pre-emptively multitasking, -+ # you end up with a "frozen" computer, even though with patience -+ # the test eventually succeeds (with a max line length of 256k). -+ # Instead, let's just punt: use the minimum linelength reported by -+ # all of the supported platforms: 8192 (on NT/2K/XP). -+ lt_cv_sys_max_cmd_len=8192; - ;; - -- cygwin* | mingw* | pw32*) -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec='-L$libdir' -- allow_undefined_flag=unsupported -- always_export_symbols=yes -- -- extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ -- sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ -- test -f $output_objdir/impgen.exe || (cd $output_objdir && \ -- if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ -- else $CC -o impgen impgen.c ; fi)~ -- $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' -- -- old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' -- -- # cygwin and mingw dlls have different entry points and sets of symbols -- # to exclude. -- # FIXME: what about values for MSVC? -- dll_entry=__cygwin_dll_entry@12 -- dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ -- case $host_os in -- mingw*) -- # mingw values -- dll_entry=_DllMainCRTStartup@12 -- dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ -- ;; -- esac -- -- # mingw and cygwin differ, and it's simplest to just exclude the union -- # of the two symbol sets. -- dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 -- -- # recent cygwin and mingw systems supply a stub DllMain which the user -- # can override, but on older systems we have to supply one (in ltdll.c) -- if test "x$lt_cv_need_dllmain" = "xyes"; then -- ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " -- ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ -- test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' -- else -- ltdll_obj= -- ltdll_cmds= -- fi -- -- # Extract the symbol export list from an `--export-all' def file, -- # then regenerate the def file from the symbol export list, so that -- # the compiled dll only exports the symbol export list. -- # Be careful not to strip the DATA tag left be newer dlltools. -- export_symbols_cmds="$ltdll_cmds"' -- $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ -- sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' -- -- # If the export-symbols file already is a .def file (1st line -- # is EXPORTS), use it as is. -- # If DATA tags from a recent dlltool are present, honour them! -- archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then -- cp $export_symbols $output_objdir/$soname-def; -- else -- echo EXPORTS > $output_objdir/$soname-def; -- _lt_hint=1; -- cat $export_symbols | while read symbol; do -- set dummy \$symbol; -- case \$# in -- 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; -- *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; -- esac; -- _lt_hint=`expr 1 + \$_lt_hint`; -- done; -- fi~ -- '"$ltdll_cmds"' -- $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ -- $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ -- $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' -+ amigaos*) -+ # On AmigaOS with pdksh, this test takes hours, literally. -+ # So we just punt and use a minimum line length of 8192. -+ lt_cv_sys_max_cmd_len=8192; - ;; - -- netbsd*) -- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' -- wlarc= -+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) -+ # This has been around since 386BSD, at least. Likely further. -+ if test -x /sbin/sysctl; then -+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` -+ elif test -x /usr/sbin/sysctl; then -+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else -- archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi -+ # And add a safety zone -+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` -+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; -- -- solaris* | sysv5*) -- if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then -- ld_shlibs=no -- cat <&2 -- --*** Warning: The releases 2.8.* of the GNU linker cannot reliably --*** create shared libraries on Solaris systems. Therefore, libtool --*** is disabling shared libraries support. We urge you to upgrade GNU --*** binutils to release 2.9.1 or newer. Another option is to modify --*** your PATH or compiler configuration so that the native linker is --*** used, and then restart. -- --EOF -- elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -- else -- ld_shlibs=no -+ osf*) -+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure -+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not -+ # nice to cause kernel panics so lets avoid the loop below. -+ # First set a reasonable default. -+ lt_cv_sys_max_cmd_len=16384 -+ # -+ if test -x /sbin/sysconfig; then -+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in -+ *1*) lt_cv_sys_max_cmd_len=-1 ;; -+ esac - fi - ;; -- -- sunos4*) -- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' -- wlarc= -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -- - *) -- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -- else -- ld_shlibs=no -- fi -+ # If test is not a shell built-in, we'll probably end up computing a -+ # maximum length that is only half of the actual maximum length, but -+ # we can't tell. -+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} -+ while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ -+ = "XX$teststring") >/dev/null 2>&1 && -+ new_result=`expr "X$teststring" : ".*" 2>&1` && -+ lt_cv_sys_max_cmd_len=$new_result && -+ test $i != 17 # 1/2 MB should be enough -+ do -+ i=`expr $i + 1` -+ teststring=$teststring$teststring -+ done -+ teststring= -+ # Add a significant safety factor because C++ compilers can tack on massive -+ # amounts of additional arguments before passing them to the linker. -+ # It appears as though 1/2 is a usable value. -+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac - -- if test "$ld_shlibs" = yes; then -- runpath_var=LD_RUN_PATH -- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' -- export_dynamic_flag_spec='${wl}--export-dynamic' -- case $host_os in -- cygwin* | mingw* | pw32*) -- # dlltool doesn't understand --whole-archive et. al. -- whole_archive_flag_spec= -- ;; -- *) -- # ancient GNU ld didn't support --whole-archive et. al. -- if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then -- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -- else -- whole_archive_flag_spec= -- fi -- ;; -- esac -- fi --else -- # PORTME fill in a description of your system's linker (not GNU ld) -- case $host_os in -- aix3*) -- allow_undefined_flag=unsupported -- always_export_symbols=yes -- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' -- # Note: this linker hardcodes the directories in LIBPATH if there -- # are no directories specified by -L. -- hardcode_minus_L=yes -- if test "$GCC" = yes && test -z "$link_static_flag"; then -- # Neither direct hardcoding nor static linking is supported with a -- # broken collect2. -- hardcode_direct=unsupported -- fi -- ;; -- -- aix4* | aix5*) -- if test "$host_cpu" = ia64; then -- # On IA64, the linker does run time linking by default, so we don't -- # have to do anything special. -- aix_use_runtimelinking=no -- exp_sym_flag='-Bexport' -- no_entry_flag="" -- else -- aix_use_runtimelinking=no -- -- # Test if we are trying to use run time linking or normal -- # AIX style linking. If -brtl is somewhere in LDFLAGS, we -- # need to do runtime linking. -- case $host_os in aix4.[23]|aix4.[23].*|aix5*) -- for ld_flag in $LDFLAGS; do -- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then -- aix_use_runtimelinking=yes -- break -- fi -- done -- esac -+fi - -- exp_sym_flag='-bexport' -- no_entry_flag='-bnoentry' -- fi -+if test -n $lt_cv_sys_max_cmd_len ; then -+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -+else -+ echo "$as_me:$LINENO: result: none" >&5 -+echo "${ECHO_T}none" >&6 -+fi - -- # When large executables or shared objects are built, AIX ld can -- # have problems creating the table of contents. If linking a library -- # or program results in "error TOC overflow" add -mminimal-toc to -- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - -- hardcode_direct=yes -- archive_cmds='' -- hardcode_libdir_separator=':' -- if test "$GCC" = yes; then -- case $host_os in aix4.[012]|aix4.[012].*) -- collect2name=`${CC} -print-prog-name=collect2` -- if test -f "$collect2name" && \ -- strings "$collect2name" | grep resolve_lib_name >/dev/null -- then -- # We have reworked collect2 -- hardcode_direct=yes -- else -- # We have old collect2 -- hardcode_direct=unsupported -- # It fails to find uninstalled libraries when the uninstalled -- # path is not listed in the libpath. Setting hardcode_minus_L -- # to unsupported forces relinking -- hardcode_minus_L=yes -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_libdir_separator= -- fi -- esac - -- shared_flag='-shared' -- else -- # not using gcc -- if test "$host_cpu" = ia64; then -- shared_flag='${wl}-G' -- else -- if test "$aix_use_runtimelinking" = yes; then -- shared_flag='${wl}-G' -- else -- shared_flag='${wl}-bM:SRE' -- fi -- fi -- fi - -- # It seems that -bexpall can do strange things, so it is better to -- # generate a list of symbols to export. -- always_export_symbols=yes -- if test "$aix_use_runtimelinking" = yes; then -- # Warning - without using the other runtime loading flags (-brtl), -- # -berok will link without error, but may produce a broken library. -- allow_undefined_flag='-berok' -- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' -- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -- else -- if test "$host_cpu" = ia64; then -- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' -- allow_undefined_flag="-z nodefs" -- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -- else -- hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' -- # Warning - without using the other run time loading flags, -- # -berok will link without error, but may produce a broken library. -- allow_undefined_flag='${wl}-berok' -- # This is a bit strange, but is similar to how AIX traditionally builds -- # it's shared libraries. -- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' -- fi -- fi -- ;; -+# Check for command to grab the raw symbol name followed by C symbol from nm. -+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 -+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else - -- amigaos*) -- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_minus_L=yes -- # see comment about different semantics on the GNU ld section -- ld_shlibs=no -- ;; -+# These are sane defaults that work on at least a few old systems. -+# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -- cygwin* | mingw* | pw32*) -- # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++. -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec=' ' -- allow_undefined_flag=unsupported -- # Tell ltmain to make .lib files, not .a files. -- libext=lib -- # FIXME: Setting linknames here is a bad hack. -- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' -- # The linker will automatically build a .lib file if we build a DLL. -- old_archive_from_new_cmds='true' -- # FIXME: Should let the user specify the lib program. -- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' -- fix_srcfile_path='`cygpath -w "$srcfile"`' -- ;; -- -- darwin* | rhapsody*) -- case "$host_os" in -- rhapsody* | darwin1.[012]) -- allow_undefined_flag='-undefined suppress' -- ;; -- *) # Darwin 1.3 on -- allow_undefined_flag='-flat_namespace -undefined suppress' -- ;; -- esac -- # FIXME: Relying on posixy $() will cause problems for -- # cross-compilation, but unfortunately the echo tests do not -- # yet detect zsh echo's removal of \ escapes. -- archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' -- # We need to add '_' to the symbols in $export_symbols first -- #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- whole_archive_flag_spec='-all_load $convenience' -- ;; -- -- freebsd1*) -- ld_shlibs=no -- ;; -- -- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor -- # support. Future versions do this automatically, but an explicit c++rt0.o -- # does not break anything, and helps significantly (at the cost of a little -- # extra space). -- freebsd2.2*) -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -+# Character class describing NM global symbol codes. -+symcode='[BCDEGRST]' - -- # Unfortunately, older versions of FreeBSD 2 do not have this feature. -- freebsd2*) -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes -- hardcode_minus_L=yes -- hardcode_shlibpath_var=no -- ;; -+# Regexp to match symbols that can be accessed directly from C. -+sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -- # FreeBSD 3 and greater uses gcc -shared to do shared libraries. -- freebsd*) -- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -+# Transform an extracted symbol line into a proper C declaration -+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -- hpux9* | hpux10* | hpux11*) -- case $host_os in -- hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; -- *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; -- esac -- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' -- hardcode_libdir_separator=: -- hardcode_direct=yes -- hardcode_minus_L=yes # Not in the search PATH, but as the default -- # location of the library. -- export_dynamic_flag_spec='${wl}-E' -- ;; -+# Transform an extracted symbol line into symbol name and symbol address -+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -- irix5* | irix6*) -- if test "$GCC" = yes; then -- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -- else -- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -- fi -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- hardcode_libdir_separator=: -- link_all_deplibs=yes -- ;; -+# Define system-specific variables. -+case $host_os in -+aix*) -+ symcode='[BCDT]' -+ ;; -+cygwin* | mingw* | pw32*) -+ symcode='[ABCDGISTW]' -+ ;; -+hpux*) # Its linker distinguishes data from code symbols -+ if test "$host_cpu" = ia64; then -+ symcode='[ABCDEGRST]' -+ fi -+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -+ ;; -+linux*) -+ if test "$host_cpu" = ia64; then -+ symcode='[ABCDGIRSTW]' -+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -+ fi -+ ;; -+irix* | nonstopux*) -+ symcode='[BCDEGRST]' -+ ;; -+osf*) -+ symcode='[BCDEGQRST]' -+ ;; -+solaris* | sysv5*) -+ symcode='[BDRT]' -+ ;; -+sysv4) -+ symcode='[DFNSTU]' -+ ;; -+esac - -- netbsd*) -- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out -- else -- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF -- fi -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- ;; -+# Handle CRLF in mingw tool chain -+opt_cr= -+case $build_os in -+mingw*) -+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp -+ ;; -+esac - -- newsos6) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- hardcode_libdir_separator=: -- hardcode_shlibpath_var=no -- ;; -+# If we're using GNU nm, then use its standard symbol codes. -+case `$NM -V 2>&1` in -+*GNU* | *'with BFD'*) -+ symcode='[ABCDGIRSTW]' ;; -+esac - -- openbsd*) -- hardcode_direct=yes -- hardcode_shlibpath_var=no -- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' -- export_dynamic_flag_spec='${wl}-E' -- else -- case "$host_os" in -- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) -- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-R$libdir' -- ;; -- *) -- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' -- ;; -- esac -- fi -- ;; -+# Try without a prefix undercore, then with it. -+for ac_symprfx in "" "_"; do - -- os2*) -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_minus_L=yes -- allow_undefined_flag=unsupported -- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' -- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' -- ;; -+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. -+ symxfrm="\\1 $ac_symprfx\\2 \\2" - -- osf3*) -- if test "$GCC" = yes; then -- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -- else -- allow_undefined_flag=' -expect_unresolved \*' -- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -- fi -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- hardcode_libdir_separator=: -- ;; -+ # Write the raw and C identifiers. -+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - -- osf4* | osf5*) # as osf3* with the addition of -msym flag -- if test "$GCC" = yes; then -- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -- else -- allow_undefined_flag=' -expect_unresolved \*' -- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ -- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' -+ # Check to see that the pipe works correctly. -+ pipe_works=no - -- #Both c and cxx compiler support -rpath directly -- hardcode_libdir_flag_spec='-rpath $libdir' -- fi -- hardcode_libdir_separator=: -- ;; -+ rm -f conftest* -+ cat > conftest.$ac_ext <, C++ libraries end up with a separate -- # (to the application) exception stack for one thing. -- no_undefined_flag=' -z defs' -- if test "$GCC" = yes; then -- case `$CC --version 2>/dev/null` in -- [12].*) -- cat <&2 -+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; then -+ # Now try to grab the symbols. -+ nlist=conftest.nm -+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 -+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s "$nlist"; then -+ # Try sorting and uniquifying the output. -+ if sort "$nlist" | uniq > "$nlist"T; then -+ mv -f "$nlist"T "$nlist" -+ else -+ rm -f "$nlist"T -+ fi - --*** Warning: Releases of GCC earlier than version 3.0 cannot reliably --*** create self contained shared libraries on Solaris systems, without --*** introducing a dependency on libgcc.a. Therefore, libtool is disabling --*** -no-undefined support, which will at least allow you to build shared --*** libraries. However, you may find that when you link such libraries --*** into an application without using GCC, you have to manually add --*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to --*** upgrade to a newer version of GCC. Another option is to rebuild your --*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. -+ # Make sure that we snagged all the symbols we need. -+ if grep ' nm_test_var$' "$nlist" >/dev/null; then -+ if grep ' nm_test_func$' "$nlist" >/dev/null; then -+ cat < conftest.$ac_ext -+#ifdef __cplusplus -+extern "C" { -+#endif - - EOF -- no_undefined_flag= -- ;; -- esac -- fi -- # $CC -shared without GNU ld will not create a library from C++ -- # object files and a static libstdc++, better avoid it by now -- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -- hardcode_libdir_flag_spec='-R$libdir' -- hardcode_shlibpath_var=no -- case $host_os in -- solaris2.[0-5] | solaris2.[0-5].*) ;; -- *) # Supported since Solaris 2.6 (maybe 2.5.1?) -- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; -- esac -- link_all_deplibs=yes -- ;; -- -- sunos4*) -- if test "x$host_vendor" = xsequent; then -- # Use $CC to link under sequent, because it throws in some extra .o -- # files that make .init and .fini sections work. -- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' -- else -- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' -- fi -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_direct=yes -- hardcode_minus_L=yes -- hardcode_shlibpath_var=no -- ;; -- -- sysv4) -- if test "x$host_vendor" = xsno; then -- archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes # is this really true??? -- else -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=no #Motorola manual says yes, but my tests say they lie -- fi -- runpath_var='LD_RUN_PATH' -- hardcode_shlibpath_var=no -- ;; -- -- sysv4.3*) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_shlibpath_var=no -- export_dynamic_flag_spec='-Bexport' -- ;; -- -- sysv5*) -- no_undefined_flag=' -z text' -- # $CC -shared without GNU ld will not create a library from C++ -- # object files and a static libstdc++, better avoid it by now -- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -- hardcode_libdir_flag_spec= -- hardcode_shlibpath_var=no -- runpath_var='LD_RUN_PATH' -- ;; -- -- uts4*) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_shlibpath_var=no -- ;; -- -- dgux*) -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -- hardcode_shlibpath_var=no -- ;; -+ # Now generate the symbol file. -+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - -- sysv4*MP*) -- if test -d /usr/nec; then -- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_shlibpath_var=no -- runpath_var=LD_RUN_PATH -- hardcode_runpath_var=yes -- ld_shlibs=yes -- fi -- ;; -+ cat <> conftest.$ac_ext -+#if defined (__STDC__) && __STDC__ -+# define lt_ptr_t void * -+#else -+# define lt_ptr_t char * -+# define const -+#endif - -- sysv4.2uw2*) -- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' -- hardcode_direct=yes -- hardcode_minus_L=no -- hardcode_shlibpath_var=no -- hardcode_runpath_var=yes -- runpath_var=LD_RUN_PATH -- ;; -+/* The mapping between symbol names and symbols. */ -+const struct { -+ const char *name; -+ lt_ptr_t address; -+} -+lt_preloaded_symbols[] = -+{ -+EOF -+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext -+ cat <<\EOF >> conftest.$ac_ext -+ {0, (lt_ptr_t) 0} -+}; - -- sysv5uw7* | unixware7*) -- no_undefined_flag='${wl}-z ${wl}text' -- if test "$GCC" = yes; then -- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+#ifdef __cplusplus -+} -+#endif -+EOF -+ # Now try linking the two files. -+ mv conftest.$ac_objext conftstm.$ac_objext -+ lt_save_LIBS="$LIBS" -+ lt_save_CFLAGS="$CFLAGS" -+ LIBS="conftstm.$ac_objext" -+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" -+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s conftest${ac_exeext}; then -+ pipe_works=yes -+ fi -+ LIBS="$lt_save_LIBS" -+ CFLAGS="$lt_save_CFLAGS" -+ else -+ echo "cannot find nm_test_func in $nlist" >&5 -+ fi -+ else -+ echo "cannot find nm_test_var in $nlist" >&5 -+ fi - else -- archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi -- runpath_var='LD_RUN_PATH' -- hardcode_shlibpath_var=no -- ;; -- -- *) -- ld_shlibs=no -- ;; -- esac --fi --echo "$as_me:$LINENO: result: $ld_shlibs" >&5 --echo "${ECHO_T}$ld_shlibs" >&6 --test "$ld_shlibs" = no && can_build_shared=no -- --# Check hardcoding attributes. --echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 --echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 --hardcode_action= --if test -n "$hardcode_libdir_flag_spec" || \ -- test -n "$runpath_var"; then -+ else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ fi -+ rm -f conftest* conftst* - -- # We can hardcode non-existant directories. -- if test "$hardcode_direct" != no && -- # If the only mechanism to avoid hardcoding is shlibpath_var, we -- # have to relink, otherwise we might link with an installed library -- # when we should be linking with a yet-to-be-installed one -- ## test "$hardcode_shlibpath_var" != no && -- test "$hardcode_minus_L" != no; then -- # Linking always hardcodes the temporary library directory. -- hardcode_action=relink -+ # Do not use the global_symbol_pipe unless it works. -+ if test "$pipe_works" = yes; then -+ break - else -- # We can link without hardcoding, and we can hardcode nonexisting dirs. -- hardcode_action=immediate -+ lt_cv_sys_global_symbol_pipe= - fi -+done -+ -+fi -+ -+if test -z "$lt_cv_sys_global_symbol_pipe"; then -+ lt_cv_sys_global_symbol_to_cdecl= -+fi -+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then -+ echo "$as_me:$LINENO: result: failed" >&5 -+echo "${ECHO_T}failed" >&6 - else -- # We cannot hardcode anything, or else we can only hardcode existing -- # directories. -- hardcode_action=unsupported -+ echo "$as_me:$LINENO: result: ok" >&5 -+echo "${ECHO_T}ok" >&6 - fi --echo "$as_me:$LINENO: result: $hardcode_action" >&5 --echo "${ECHO_T}$hardcode_action" >&6 - --striplib= --old_striplib= --echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 --echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 --if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then -- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -- test -z "$striplib" && striplib="$STRIP --strip-unneeded" -- echo "$as_me:$LINENO: result: yes" >&5 --echo "${ECHO_T}yes" >&6 -+echo "$as_me:$LINENO: checking for objdir" >&5 -+echo $ECHO_N "checking for objdir... $ECHO_C" >&6 -+if test "${lt_cv_objdir+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 -+ rm -f .libs 2>/dev/null -+mkdir .libs 2>/dev/null -+if test -d .libs; then -+ lt_cv_objdir=.libs -+else -+ # MS-DOS does not allow filenames that begin with a dot. -+ lt_cv_objdir=_libs - fi -+rmdir .libs 2>/dev/null -+fi -+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -+echo "${ECHO_T}$lt_cv_objdir" >&6 -+objdir=$lt_cv_objdir - --reload_cmds='$LD$reload_flag -o $output$reload_objs' --test -z "$deplibs_check_method" && deplibs_check_method=unknown - --# PORTME Fill in your ld.so characteristics --echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 --echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 --library_names_spec= --libname_spec='lib$name' --soname_spec= --postinstall_cmds= --postuninstall_cmds= --finish_cmds= --finish_eval= --shlibpath_var= --shlibpath_overrides_runpath=unknown --version_type=none --dynamic_linker="$host_os ld.so" --sys_lib_dlsearch_path_spec="/lib /usr/lib" --sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - --case $host_os in --aix3*) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix $libname.a' -- shlibpath_var=LIBPATH - -- # AIX has no versioning support, so we append a major version to the name. -- soname_spec='${libname}${release}.so$major' -- ;; - --aix4* | aix5*) -- version_type=linux -- if test "$host_cpu" = ia64; then -- # AIX 5 supports IA64 -- library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- else -- # With GCC up to 2.95.x, collect2 would create an import file -- # for dependence libraries. The import file would start with -- # the line `#! .'. This would cause the generated library to -- # depend on `.', always an invalid library. This was fixed in -- # development snapshots of GCC prior to 3.0. -- case $host_os in -- aix4 | aix4.[01] | aix4.[01].*) -- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' -- echo ' yes ' -- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then -- : -- else -- can_build_shared=no -- fi -- ;; -- esac -- # AIX (on Power*) has no versioning support, so currently we can -- # not hardcode correct soname into executable. Probably we can -- # add versioning support to collect2, so additional links can -- # be useful in future. -- if test "$aix_use_runtimelinking" = yes; then -- # If using run time linking (on AIX 4.2 or later) use lib.so -- # instead of lib.a to let people know that these are not -- # typical AIX shared libraries. -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- else -- # We preserve .a as extension for shared libraries through AIX4.2 -- # and later when we are not doing run time linking. -- library_names_spec='${libname}${release}.a $libname.a' -- soname_spec='${libname}${release}.so$major' -- fi -- shlibpath_var=LIBPATH -+case $host_os in -+aix3*) -+ # AIX sometimes has problems with the GCC collect2 program. For some -+ # reason, if we set the COLLECT_NAMES environment variable, the problems -+ # vanish in a puff of smoke. -+ if test "X${COLLECT_NAMES+set}" != Xset; then -+ COLLECT_NAMES= -+ export COLLECT_NAMES - fi - ;; -+esac - --amigaos*) -- library_names_spec='$libname.ixlibrary $libname.a' -- # Create ${libname}_ixlibrary.a entries in /sys/libs. -- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' -- ;; -+# Sed substitution that helps us do robust quoting. It backslashifies -+# metacharacters that are still active within double-quoted strings. -+Xsed='sed -e 1s/^X//' -+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - --beos*) -- library_names_spec='${libname}.so' -- dynamic_linker="$host_os ld.so" -- shlibpath_var=LIBRARY_PATH -- ;; -+# Same as above, but do not quote variable references. -+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - --bsdi4*) -- version_type=linux -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -- export_dynamic_flag_spec=-rdynamic -- # the default ld.so.conf also contains /usr/contrib/lib and -- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -- # libtool to hard-code these into programs -- ;; -+# Sed substitution to delay expansion of an escaped shell variable in a -+# double_quote_subst'ed string. -+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - --cygwin* | mingw* | pw32*) -- version_type=windows -- need_version=no -- need_lib_prefix=no -- case $GCC,$host_os in -- yes,cygwin*) -- library_names_spec='$libname.dll.a' -- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' -- postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ -- dldir=$destdir/`dirname \$dlpath`~ -- test -d \$dldir || mkdir -p \$dldir~ -- $install_prog .libs/$dlname \$dldir/$dlname' -- postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ -- dlpath=$dir/\$dldll~ -- $rm \$dlpath' -- ;; -- yes,mingw*) -- library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' -- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` -+# Sed substitution to avoid accidental globbing in evaled expressions -+no_glob_subst='s/\*/\\\*/g' -+ -+# Constants: -+rm="rm -f" -+ -+# Global variables: -+default_ofile=libtool -+can_build_shared=yes -+ -+# All known linkers require a `.a' archive for static linking (except MSVC, -+# which needs '.lib'). -+libext=a -+ltmain="$ac_aux_dir/ltmain.sh" -+ofile="$default_ofile" -+with_gnu_ld="$lt_cv_prog_gnu_ld" -+ -+if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -+set dummy ${ac_tool_prefix}ar; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_AR+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$AR"; then -+ ac_cv_prog_AR="$AR" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_AR="${ac_tool_prefix}ar" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+fi -+fi -+AR=$ac_cv_prog_AR -+if test -n "$AR"; then -+ echo "$as_me:$LINENO: result: $AR" >&5 -+echo "${ECHO_T}$AR" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+fi -+if test -z "$ac_cv_prog_AR"; then -+ ac_ct_AR=$AR -+ # Extract the first word of "ar", so it can be a program name with args. -+set dummy ar; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$ac_ct_AR"; then -+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_AR="ar" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+ test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" -+fi -+fi -+ac_ct_AR=$ac_cv_prog_ac_ct_AR -+if test -n "$ac_ct_AR"; then -+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -+echo "${ECHO_T}$ac_ct_AR" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ AR=$ac_ct_AR -+else -+ AR="$ac_cv_prog_AR" -+fi -+ -+if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -+set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_RANLIB+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$RANLIB"; then -+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+fi -+fi -+RANLIB=$ac_cv_prog_RANLIB -+if test -n "$RANLIB"; then -+ echo "$as_me:$LINENO: result: $RANLIB" >&5 -+echo "${ECHO_T}$RANLIB" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+fi -+if test -z "$ac_cv_prog_RANLIB"; then -+ ac_ct_RANLIB=$RANLIB -+ # Extract the first word of "ranlib", so it can be a program name with args. -+set dummy ranlib; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$ac_ct_RANLIB"; then -+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_RANLIB="ranlib" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -+fi -+fi -+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -+if test -n "$ac_ct_RANLIB"; then -+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -+echo "${ECHO_T}$ac_ct_RANLIB" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ RANLIB=$ac_ct_RANLIB -+else -+ RANLIB="$ac_cv_prog_RANLIB" -+fi -+ -+if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -+set dummy ${ac_tool_prefix}strip; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_STRIP+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$STRIP"; then -+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_STRIP="${ac_tool_prefix}strip" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+fi -+fi -+STRIP=$ac_cv_prog_STRIP -+if test -n "$STRIP"; then -+ echo "$as_me:$LINENO: result: $STRIP" >&5 -+echo "${ECHO_T}$STRIP" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+fi -+if test -z "$ac_cv_prog_STRIP"; then -+ ac_ct_STRIP=$STRIP -+ # Extract the first word of "strip", so it can be a program name with args. -+set dummy strip; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$ac_ct_STRIP"; then -+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_STRIP="strip" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -+fi -+fi -+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -+if test -n "$ac_ct_STRIP"; then -+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -+echo "${ECHO_T}$ac_ct_STRIP" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ STRIP=$ac_ct_STRIP -+else -+ STRIP="$ac_cv_prog_STRIP" -+fi -+ -+ -+old_CC="$CC" -+old_CFLAGS="$CFLAGS" -+ -+# Set sane defaults for various variables -+test -z "$AR" && AR=ar -+test -z "$AR_FLAGS" && AR_FLAGS=cru -+test -z "$AS" && AS=as -+test -z "$CC" && CC=cc -+test -z "$LTCC" && LTCC=$CC -+test -z "$DLLTOOL" && DLLTOOL=dlltool -+test -z "$LD" && LD=ld -+test -z "$LN_S" && LN_S="ln -s" -+test -z "$MAGIC_CMD" && MAGIC_CMD=file -+test -z "$NM" && NM=nm -+test -z "$SED" && SED=sed -+test -z "$OBJDUMP" && OBJDUMP=objdump -+test -z "$RANLIB" && RANLIB=: -+test -z "$STRIP" && STRIP=: -+test -z "$ac_objext" && ac_objext=o -+ -+# Determine commands to create old-style static archives. -+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -+old_postinstall_cmds='chmod 644 $oldlib' -+old_postuninstall_cmds= -+ -+if test -n "$RANLIB"; then -+ case $host_os in -+ openbsd*) -+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" -+ ;; -+ *) -+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -+ ;; -+ esac -+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -+fi -+ -+for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+ -+# Only perform the check for file, if the check method requires it -+case $deplibs_check_method in -+file_magic*) -+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then -+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ case $MAGIC_CMD in -+[\\/*] | ?:[\\/]*) -+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. -+ ;; -+*) -+ lt_save_MAGIC_CMD="$MAGIC_CMD" -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" -+ for ac_dir in $ac_dummy; do -+ IFS="$lt_save_ifs" -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/${ac_tool_prefix}file; then -+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" -+ if test -n "$file_magic_test_file"; then -+ case $deplibs_check_method in -+ "file_magic "*) -+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` -+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | -+ $EGREP "$file_magic_regex" > /dev/null; then -+ : -+ else -+ cat <&2 -+ -+*** Warning: the command libtool uses to detect shared libraries, -+*** $file_magic_cmd, produces output that libtool cannot recognize. -+*** The result is that libtool may fail to recognize shared libraries -+*** as such. This will affect the creation of libtool libraries that -+*** depend on shared libraries, but programs linked with such libtool -+*** libraries will work regardless of this problem. Nevertheless, you -+*** may want to report the problem to your system manager and/or to -+*** bug-libtool@gnu.org -+ -+EOF -+ fi ;; -+ esac -+ fi -+ break -+ fi -+ done -+ IFS="$lt_save_ifs" -+ MAGIC_CMD="$lt_save_MAGIC_CMD" -+ ;; -+esac -+fi -+ -+MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -+if test -n "$MAGIC_CMD"; then -+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -+echo "${ECHO_T}$MAGIC_CMD" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+if test -z "$lt_cv_path_MAGIC_CMD"; then -+ if test -n "$ac_tool_prefix"; then -+ echo "$as_me:$LINENO: checking for file" >&5 -+echo $ECHO_N "checking for file... $ECHO_C" >&6 -+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ case $MAGIC_CMD in -+[\\/*] | ?:[\\/]*) -+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. -+ ;; -+*) -+ lt_save_MAGIC_CMD="$MAGIC_CMD" -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" -+ for ac_dir in $ac_dummy; do -+ IFS="$lt_save_ifs" -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/file; then -+ lt_cv_path_MAGIC_CMD="$ac_dir/file" -+ if test -n "$file_magic_test_file"; then -+ case $deplibs_check_method in -+ "file_magic "*) -+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` -+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | -+ $EGREP "$file_magic_regex" > /dev/null; then -+ : -+ else -+ cat <&2 -+ -+*** Warning: the command libtool uses to detect shared libraries, -+*** $file_magic_cmd, produces output that libtool cannot recognize. -+*** The result is that libtool may fail to recognize shared libraries -+*** as such. This will affect the creation of libtool libraries that -+*** depend on shared libraries, but programs linked with such libtool -+*** libraries will work regardless of this problem. Nevertheless, you -+*** may want to report the problem to your system manager and/or to -+*** bug-libtool@gnu.org -+ -+EOF -+ fi ;; -+ esac -+ fi -+ break -+ fi -+ done -+ IFS="$lt_save_ifs" -+ MAGIC_CMD="$lt_save_MAGIC_CMD" -+ ;; -+esac -+fi -+ -+MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -+if test -n "$MAGIC_CMD"; then -+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -+echo "${ECHO_T}$MAGIC_CMD" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ else -+ MAGIC_CMD=: -+ fi -+fi -+ -+ fi -+ ;; -+esac -+ -+enable_dlopen=no -+enable_win32_dll=no -+ -+# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -+if test "${enable_libtool_lock+set}" = set; then -+ enableval="$enable_libtool_lock" -+ -+fi; -+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -+ -+ -+# Check whether --with-pic or --without-pic was given. -+if test "${with_pic+set}" = set; then -+ withval="$with_pic" -+ pic_mode="$withval" -+else -+ pic_mode=default -+fi; -+test -z "$pic_mode" && pic_mode=default -+ -+# Use C for the default configuration in the libtool script -+tagname= -+lt_save_CC="$CC" -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ -+# Source file extension for C test sources. -+ac_ext=c -+ -+# Object file extension for compiled C test sources. -+objext=o -+objext=$objext -+ -+# Code to be used in simple compile tests -+lt_simple_compile_test_code="int some_variable = 0;\n" -+ -+# Code to be used in simple link tests -+lt_simple_link_test_code='int main(){return(0);}\n' -+ -+ -+# If no C compiler was specified, use CC. -+LTCC=${LTCC-"$CC"} -+ -+# Allow CC to be a program name with arguments. -+compiler=$CC -+ -+ -+# save warnings/boilerplate of simple test code -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_compile_test_code" >conftest.$ac_ext -+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_compiler_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_link_test_code" >conftest.$ac_ext -+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_linker_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ -+# -+# Check for any special shared library compilation flags. -+# -+lt_prog_cc_shlib= -+if test "$GCC" = no; then -+ case $host_os in -+ sco3.2v5*) -+ lt_prog_cc_shlib='-belf' -+ ;; -+ esac -+fi -+if test -n "$lt_prog_cc_shlib"; then -+ { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 -+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} -+ if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : -+ else -+ { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} -+ lt_cv_prog_cc_can_build_shared=no -+ fi -+fi -+ -+ -+# -+# Check to make sure the static flag actually works. -+# -+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 -+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 -+if test "${lt_prog_compiler_static_works+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_prog_compiler_static_works=no -+ save_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS $lt_prog_compiler_static" -+ printf "$lt_simple_link_test_code" > conftest.$ac_ext -+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then -+ # The linker can only warn and ignore the option if not recognized -+ # So say no if there are warnings -+ if test -s conftest.err; then -+ # Append any errors to the config.log. -+ cat conftest.err 1>&5 -+ $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if diff conftest.exp conftest.er2 >/dev/null; then -+ lt_prog_compiler_static_works=yes -+ fi -+ else -+ lt_prog_compiler_static_works=yes -+ fi -+ fi -+ $rm conftest* -+ LDFLAGS="$save_LDFLAGS" -+ -+fi -+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 -+ -+if test x"$lt_prog_compiler_static_works" = xyes; then -+ : -+else -+ lt_prog_compiler_static= -+fi -+ -+ -+ -+ -+lt_prog_compiler_no_builtin_flag= -+ -+if test "$GCC" = yes; then -+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' -+ -+ -+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_cv_prog_compiler_rtti_exceptions=no -+ ac_outfile=conftest.$ac_objext -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ lt_compiler_flag="-fno-rtti -fno-exceptions" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ # The option is referenced via a variable to avoid confusing sed. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:6407: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>conftest.err) -+ ac_status=$? -+ cat conftest.err >&5 -+ echo "$as_me:6411: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s "$ac_outfile"; then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings other than the usual output. -+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then -+ lt_cv_prog_compiler_rtti_exceptions=yes -+ fi -+ fi -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 -+ -+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then -+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -+else -+ : -+fi -+ -+fi -+ -+lt_prog_compiler_wl= -+lt_prog_compiler_pic= -+lt_prog_compiler_static= -+ -+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 -+ -+ if test "$GCC" = yes; then -+ lt_prog_compiler_wl='-Wl,' -+ lt_prog_compiler_static='-static' -+ -+ case $host_os in -+ aix*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static='-Bstatic' -+ fi -+ ;; -+ -+ amigaos*) -+ # FIXME: we need at least 68020 code to build shared libraries, but -+ # adding the `-m68020' flag to GCC prevents building anything better, -+ # like `-m68040'. -+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' -+ ;; -+ -+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ # PIC is the default for these OSes. -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ lt_prog_compiler_pic='-DDLL_EXPORT' -+ ;; -+ -+ darwin* | rhapsody*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ lt_prog_compiler_pic='-fno-common' -+ ;; -+ -+ msdosdjgpp*) -+ # Just because we use GCC doesn't mean we suddenly get shared libraries -+ # on systems that don't support them. -+ lt_prog_compiler_can_build_shared=no -+ enable_shared=no -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ lt_prog_compiler_pic=-Kconform_pic -+ fi -+ ;; -+ -+ hpux*) -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ lt_prog_compiler_pic='-fPIC' -+ ;; -+ esac -+ ;; -+ -+ *) -+ lt_prog_compiler_pic='-fPIC' -+ ;; -+ esac -+ else -+ # PORTME Check for flag to pass linker flags through the system compiler. -+ case $host_os in -+ aix*) -+ lt_prog_compiler_wl='-Wl,' -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static='-Bstatic' -+ else -+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' -+ fi -+ ;; -+ darwin*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ case $cc_basename in -+ xlc*) -+ lt_prog_compiler_pic='-qnocommon' -+ lt_prog_compiler_wl='-Wl,' -+ ;; -+ esac -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ lt_prog_compiler_pic='-DDLL_EXPORT' -+ ;; -+ -+ hpux9* | hpux10* | hpux11*) -+ lt_prog_compiler_wl='-Wl,' -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ lt_prog_compiler_pic='+Z' -+ ;; -+ esac -+ # Is there a better lt_prog_compiler_static that works with the bundled CC? -+ lt_prog_compiler_static='${wl}-a ${wl}archive' -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ lt_prog_compiler_wl='-Wl,' -+ # PIC (with -KPIC) is the default. -+ lt_prog_compiler_static='-non_shared' -+ ;; -+ -+ newsos6) -+ lt_prog_compiler_pic='-KPIC' -+ lt_prog_compiler_static='-Bstatic' -+ ;; -+ -+ linux*) -+ case $cc_basename in -+ icc* | ecc*) -+ lt_prog_compiler_wl='-Wl,' -+ lt_prog_compiler_pic='-KPIC' -+ lt_prog_compiler_static='-static' -+ ;; -+ pgcc* | pgf77* | pgf90* | pgf95*) -+ # Portland Group compilers (*not* the Pentium gcc compiler, -+ # which looks to be a dead project) -+ lt_prog_compiler_wl='-Wl,' -+ lt_prog_compiler_pic='-fpic' -+ lt_prog_compiler_static='-Bstatic' -+ ;; -+ ccc*) -+ lt_prog_compiler_wl='-Wl,' -+ # All Alpha code is PIC. -+ lt_prog_compiler_static='-non_shared' -+ ;; -+ esac -+ ;; -+ -+ osf3* | osf4* | osf5*) -+ lt_prog_compiler_wl='-Wl,' -+ # All OSF/1 code is PIC. -+ lt_prog_compiler_static='-non_shared' -+ ;; -+ -+ sco3.2v5*) -+ lt_prog_compiler_pic='-Kpic' -+ lt_prog_compiler_static='-dn' -+ ;; -+ -+ solaris*) -+ lt_prog_compiler_pic='-KPIC' -+ lt_prog_compiler_static='-Bstatic' -+ case $cc_basename in -+ f77* | f90* | f95*) -+ lt_prog_compiler_wl='-Qoption ld ';; -+ *) -+ lt_prog_compiler_wl='-Wl,';; -+ esac -+ ;; -+ -+ sunos4*) -+ lt_prog_compiler_wl='-Qoption ld ' -+ lt_prog_compiler_pic='-PIC' -+ lt_prog_compiler_static='-Bstatic' -+ ;; -+ -+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ lt_prog_compiler_wl='-Wl,' -+ lt_prog_compiler_pic='-KPIC' -+ lt_prog_compiler_static='-Bstatic' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec ;then -+ lt_prog_compiler_pic='-Kconform_pic' -+ lt_prog_compiler_static='-Bstatic' -+ fi -+ ;; -+ -+ unicos*) -+ lt_prog_compiler_wl='-Wl,' -+ lt_prog_compiler_can_build_shared=no -+ ;; -+ -+ uts4*) -+ lt_prog_compiler_pic='-pic' -+ lt_prog_compiler_static='-Bstatic' -+ ;; -+ -+ *) -+ lt_prog_compiler_can_build_shared=no -+ ;; -+ esac -+ fi -+ -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic" >&6 -+ -+# -+# Check to make sure the PIC flag actually works. -+# -+if test -n "$lt_prog_compiler_pic"; then -+ -+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 -+if test "${lt_prog_compiler_pic_works+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_prog_compiler_pic_works=no -+ ac_outfile=conftest.$ac_objext -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ # The option is referenced via a variable to avoid confusing sed. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:6669: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>conftest.err) -+ ac_status=$? -+ cat conftest.err >&5 -+ echo "$as_me:6673: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s "$ac_outfile"; then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings other than the usual output. -+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then -+ lt_prog_compiler_pic_works=yes -+ fi -+ fi -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 -+ -+if test x"$lt_prog_compiler_pic_works" = xyes; then -+ case $lt_prog_compiler_pic in -+ "" | " "*) ;; -+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; -+ esac -+else -+ lt_prog_compiler_pic= -+ lt_prog_compiler_can_build_shared=no -+fi -+ -+fi -+case $host_os in -+ # For platforms which do not support PIC, -DPIC is meaningless: -+ *djgpp*) -+ lt_prog_compiler_pic= -+ ;; -+ *) -+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -+if test "${lt_cv_prog_compiler_c_o+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_cv_prog_compiler_c_o=no -+ $rm -r conftest 2>/dev/null -+ mkdir conftest -+ cd conftest -+ mkdir out -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ lt_compiler_flag="-o out/conftest2.$ac_objext" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:6731: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>out/conftest.err) -+ ac_status=$? -+ cat out/conftest.err >&5 -+ echo "$as_me:6735: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s out/conftest2.$ac_objext -+ then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings -+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp -+ $SED '/^$/d' out/conftest.err >out/conftest.er2 -+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then -+ lt_cv_prog_compiler_c_o=yes -+ fi -+ fi -+ chmod u+w . 2>&5 -+ $rm conftest* -+ # SGI C++ compiler will create directory out/ii_files/ for -+ # template instantiation -+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files -+ $rm out/* && rmdir out -+ cd .. -+ rmdir conftest -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 -+ -+ -+hard_links="nottested" -+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then -+ # do not overwrite the value of need_locks provided by the user -+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 -+ hard_links=yes -+ $rm conftest* -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ touch conftest.a -+ ln conftest.a conftest.b 2>&5 || hard_links=no -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ echo "$as_me:$LINENO: result: $hard_links" >&5 -+echo "${ECHO_T}$hard_links" >&6 -+ if test "$hard_links" = no; then -+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} -+ need_locks=warn -+ fi -+else -+ need_locks=no -+fi -+ -+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -+ -+ runpath_var= -+ allow_undefined_flag= -+ enable_shared_with_static_runtimes=no -+ archive_cmds= -+ archive_expsym_cmds= -+ old_archive_From_new_cmds= -+ old_archive_from_expsyms_cmds= -+ export_dynamic_flag_spec= -+ whole_archive_flag_spec= -+ thread_safe_flag_spec= -+ hardcode_libdir_flag_spec= -+ hardcode_libdir_flag_spec_ld= -+ hardcode_libdir_separator= -+ hardcode_direct=no -+ hardcode_minus_L=no -+ hardcode_shlibpath_var=unsupported -+ link_all_deplibs=unknown -+ hardcode_automatic=no -+ module_cmds= -+ module_expsym_cmds= -+ always_export_symbols=no -+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ # include_expsyms should be a list of space-separated symbols to be *always* -+ # included in the symbol list -+ include_expsyms= -+ # exclude_expsyms can be an extended regexp of symbols to exclude -+ # it will be wrapped by ` (' and `)$', so one must not match beginning or -+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -+ # as well as any symbol that contains `d'. -+ exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -+ # platforms (ab)use it in PIC code, but their linkers get confused if -+ # the symbol is explicitly referenced. Since portable code cannot -+ # rely on this symbol name, it's probably fine to never include it in -+ # preloaded symbol tables. -+ extract_expsyms_cmds= -+ # Just being paranoid about ensuring that cc_basename is set. -+ for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ # FIXME: the MSVC++ port hasn't been tested in a loooong time -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ if test "$GCC" != yes; then -+ with_gnu_ld=no -+ fi -+ ;; -+ openbsd*) -+ with_gnu_ld=no -+ ;; -+ esac -+ -+ ld_shlibs=yes -+ if test "$with_gnu_ld" = yes; then -+ # If archive_cmds runs LD, not CC, wlarc should be empty -+ wlarc='${wl}' -+ -+ # Set some defaults for GNU ld with shared library support. These -+ # are reset later if shared libraries are not supported. Putting them -+ # here allows them to be overridden if necessary. -+ runpath_var=LD_RUN_PATH -+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' -+ export_dynamic_flag_spec='${wl}--export-dynamic' -+ # ancient GNU ld didn't support --whole-archive et. al. -+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then -+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ else -+ whole_archive_flag_spec= -+ fi -+ supports_anon_versioning=no -+ case `$LD -v 2>/dev/null` in -+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 -+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... -+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... -+ *\ 2.11.*) ;; # other 2.11 versions -+ *) supports_anon_versioning=yes ;; -+ esac -+ -+ # See if GNU ld supports shared libraries. -+ case $host_os in -+ aix3* | aix4* | aix5*) -+ # On AIX/PPC, the GNU linker is very broken -+ if test "$host_cpu" != ia64; then -+ ld_shlibs=no -+ cat <&2 -+ -+*** Warning: the GNU linker, at least up to release 2.9.1, is reported -+*** to be unable to reliably create shared libraries on AIX. -+*** Therefore, libtool is disabling shared libraries support. If you -+*** really care for shared libraries, you may want to modify your PATH -+*** so that a non-GNU linker is found, and then restart. -+ -+EOF -+ fi -+ ;; -+ -+ amigaos*) -+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_minus_L=yes -+ -+ # Samuel A. Falvo II reports -+ # that the semantics of dynamic libraries on AmigaOS, at least up -+ # to version 4, is to share data among multiple programs linked -+ # with the same dynamic library. Since this doesn't match the -+ # behavior of shared libraries on other platforms, we can't use -+ # them. -+ ld_shlibs=no -+ ;; -+ -+ beos*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ allow_undefined_flag=unsupported -+ # Joseph Beckenbach says some releases of gcc -+ # support --undefined. This deserves some investigation. FIXME -+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ else -+ ld_shlibs=no -+ fi -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, -+ # as there is no search path for DLLs. -+ hardcode_libdir_flag_spec='-L$libdir' -+ allow_undefined_flag=unsupported -+ always_export_symbols=no -+ enable_shared_with_static_runtimes=yes -+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -+ -+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ # If the export-symbols file already is a .def file (1st line -+ # is EXPORTS), use it as is; otherwise, prepend... -+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -+ cp $export_symbols $output_objdir/$soname.def; -+ else -+ echo EXPORTS > $output_objdir/$soname.def; -+ cat $export_symbols >> $output_objdir/$soname.def; -+ fi~ -+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ else -+ ld_shlibs=no -+ fi -+ ;; -+ -+ linux*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ tmp_addflag= -+ case $cc_basename,$host_cpu in -+ pgcc*) # Portland Group C compiler -+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag' -+ ;; -+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers -+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag -Mnomain' ;; -+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 -+ tmp_addflag=' -i_dynamic' ;; -+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 -+ tmp_addflag=' -i_dynamic -nofor_main' ;; -+ ifc* | ifort*) # Intel Fortran compiler -+ tmp_addflag=' -nofor_main' ;; -+ esac -+ archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ -+ if test $supports_anon_versioning = yes; then -+ archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ -+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -+ $echo "local: *; };" >> $output_objdir/$libname.ver~ -+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' -+ fi -+ link_all_deplibs=no -+ else -+ ld_shlibs=no -+ fi -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' -+ wlarc= -+ else -+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ fi -+ ;; -+ -+ solaris* | sysv5*) -+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then -+ ld_shlibs=no -+ cat <&2 -+ -+*** Warning: The releases 2.8.* of the GNU linker cannot reliably -+*** create shared libraries on Solaris systems. Therefore, libtool -+*** is disabling shared libraries support. We urge you to upgrade GNU -+*** binutils to release 2.9.1 or newer. Another option is to modify -+*** your PATH or compiler configuration so that the native linker is -+*** used, and then restart. -+ -+EOF -+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ ld_shlibs=no -+ fi -+ ;; -+ -+ sunos4*) -+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ wlarc= -+ hardcode_direct=yes -+ hardcode_shlibpath_var=no -+ ;; -+ -+ *) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ ld_shlibs=no -+ fi -+ ;; -+ esac -+ -+ if test "$ld_shlibs" = no; then -+ runpath_var= -+ hardcode_libdir_flag_spec= -+ export_dynamic_flag_spec= -+ whole_archive_flag_spec= -+ fi -+ else -+ # PORTME fill in a description of your system's linker (not GNU ld) -+ case $host_os in -+ aix3*) -+ allow_undefined_flag=unsupported -+ always_export_symbols=yes -+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' -+ # Note: this linker hardcodes the directories in LIBPATH if there -+ # are no directories specified by -L. -+ hardcode_minus_L=yes -+ if test "$GCC" = yes && test -z "$link_static_flag"; then -+ # Neither direct hardcoding nor static linking is supported with a -+ # broken collect2. -+ hardcode_direct=unsupported -+ fi -+ ;; -+ -+ aix4* | aix5*) -+ if test "$host_cpu" = ia64; then -+ # On IA64, the linker does run time linking by default, so we don't -+ # have to do anything special. -+ aix_use_runtimelinking=no -+ exp_sym_flag='-Bexport' -+ no_entry_flag="" -+ else -+ # If we're using GNU nm, then we don't want the "-C" option. -+ # -C means demangle to AIX nm, but means don't demangle with GNU nm -+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then -+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ else -+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ fi -+ aix_use_runtimelinking=no -+ -+ # Test if we are trying to use run time linking or normal -+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we -+ # need to do runtime linking. -+ case $host_os in aix4.[23]|aix4.[23].*|aix5*) -+ for ld_flag in $LDFLAGS; do -+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then -+ aix_use_runtimelinking=yes -+ break -+ fi -+ done -+ esac -+ -+ exp_sym_flag='-bexport' -+ no_entry_flag='-bnoentry' -+ fi -+ -+ # When large executables or shared objects are built, AIX ld can -+ # have problems creating the table of contents. If linking a library -+ # or program results in "error TOC overflow" add -mminimal-toc to -+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -+ -+ archive_cmds='' -+ hardcode_direct=yes -+ hardcode_libdir_separator=':' -+ link_all_deplibs=yes -+ -+ if test "$GCC" = yes; then -+ case $host_os in aix4.[012]|aix4.[012].*) -+ # We only want to do this on AIX 4.2 and lower, the check -+ # below for broken collect2 doesn't work under 4.3+ -+ collect2name=`${CC} -print-prog-name=collect2` -+ if test -f "$collect2name" && \ -+ strings "$collect2name" | grep resolve_lib_name >/dev/null -+ then -+ # We have reworked collect2 -+ hardcode_direct=yes -+ else -+ # We have old collect2 -+ hardcode_direct=unsupported -+ # It fails to find uninstalled libraries when the uninstalled -+ # path is not listed in the libpath. Setting hardcode_minus_L -+ # to unsupported forces relinking -+ hardcode_minus_L=yes -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_separator= -+ fi -+ esac -+ shared_flag='-shared' -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag="$shared_flag "'${wl}-G' -+ fi -+ else -+ # not using gcc -+ if test "$host_cpu" = ia64; then -+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release -+ # chokes on -Wl,-G. The following line is correct: -+ shared_flag='-G' -+ else -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag='${wl}-G' -+ else -+ shared_flag='${wl}-bM:SRE' -+ fi -+ fi -+ fi -+ -+ # It seems that -bexpall does not export symbols beginning with -+ # underscore (_), so it is better to generate a list of symbols to export. -+ always_export_symbols=yes -+ if test "$aix_use_runtimelinking" = yes; then -+ # Warning - without using the other runtime loading flags (-brtl), -+ # -berok will link without error, but may produce a broken library. -+ allow_undefined_flag='-berok' -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" -+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -+ else -+ if test "$host_cpu" = ia64; then -+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' -+ allow_undefined_flag="-z nodefs" -+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -+ else -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" -+ # Warning - without using the other run time loading flags, -+ # -berok will link without error, but may produce a broken library. -+ no_undefined_flag=' ${wl}-bernotok' -+ allow_undefined_flag=' ${wl}-berok' -+ # -bexpall does not export symbols beginning with underscore (_) -+ always_export_symbols=yes -+ # Exported symbols can be pulled into shared objects from archives -+ whole_archive_flag_spec=' ' -+ archive_cmds_need_lc=yes -+ # This is similar to how AIX traditionally builds its shared libraries. -+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' -+ fi -+ fi -+ ;; -+ -+ amigaos*) -+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_minus_L=yes -+ # see comment about different semantics on the GNU ld section -+ ld_shlibs=no -+ ;; -+ -+ bsdi[45]*) -+ export_dynamic_flag_spec=-rdynamic -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ # hardcode_libdir_flag_spec is actually meaningless, as there is -+ # no search path for DLLs. -+ hardcode_libdir_flag_spec=' ' -+ allow_undefined_flag=unsupported -+ # Tell ltmain to make .lib files, not .a files. -+ libext=lib -+ # Tell ltmain to make .dll files, not .so files. -+ shrext_cmds=".dll" -+ # FIXME: Setting linknames here is a bad hack. -+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' -+ # The linker will automatically build a .lib file if we build a DLL. -+ old_archive_From_new_cmds='true' -+ # FIXME: Should let the user specify the lib program. -+ old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' -+ fix_srcfile_path='`cygpath -w "$srcfile"`' -+ enable_shared_with_static_runtimes=yes -+ ;; -+ -+ darwin* | rhapsody*) -+ case $host_os in -+ rhapsody* | darwin1.[012]) -+ allow_undefined_flag='${wl}-undefined ${wl}suppress' -+ ;; -+ *) # Darwin 1.3 on -+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then -+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ else -+ case ${MACOSX_DEPLOYMENT_TARGET} in -+ 10.[012]) -+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ ;; -+ 10.*) -+ allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' -+ ;; -+ esac -+ fi -+ ;; -+ esac -+ archive_cmds_need_lc=no -+ hardcode_direct=no -+ hardcode_automatic=yes -+ hardcode_shlibpath_var=unsupported -+ whole_archive_flag_spec='' -+ link_all_deplibs=yes -+ if test "$GCC" = yes ; then -+ output_verbose_link_cmd='echo' -+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ case $cc_basename in -+ xlc*) -+ output_verbose_link_cmd='echo' -+ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' -+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ ;; -+ *) -+ ld_shlibs=no -+ ;; -+ esac -+ fi -+ ;; -+ -+ dgux*) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_shlibpath_var=no -+ ;; -+ -+ freebsd1*) -+ ld_shlibs=no -+ ;; -+ -+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor -+ # support. Future versions do this automatically, but an explicit c++rt0.o -+ # does not break anything, and helps significantly (at the cost of a little -+ # extra space). -+ freebsd2.2*) -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -+ hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_direct=yes -+ hardcode_shlibpath_var=no -+ ;; -+ -+ # Unfortunately, older versions of FreeBSD 2 do not have this feature. -+ freebsd2*) -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct=yes -+ hardcode_minus_L=yes -+ hardcode_shlibpath_var=no -+ ;; -+ -+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' -+ hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_direct=yes -+ hardcode_shlibpath_var=no -+ ;; -+ -+ hpux9*) -+ if test "$GCC" = yes; then -+ archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ else -+ archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ fi -+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator=: -+ hardcode_direct=yes -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L=yes -+ export_dynamic_flag_spec='${wl}-E' -+ ;; -+ -+ hpux10* | hpux11*) -+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*|ia64*) -+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ *) -+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ esac -+ else -+ case $host_cpu in -+ hppa*64*|ia64*) -+ archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ *) -+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ esac -+ fi -+ if test "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*) -+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' -+ hardcode_libdir_flag_spec_ld='+b $libdir' -+ hardcode_libdir_separator=: -+ hardcode_direct=no -+ hardcode_shlibpath_var=no -+ ;; -+ ia64*) -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_direct=no -+ hardcode_shlibpath_var=no -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L=yes -+ ;; -+ *) -+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator=: -+ hardcode_direct=yes -+ export_dynamic_flag_spec='${wl}-E' -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L=yes -+ ;; -+ esac -+ fi -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ if test "$GCC" = yes; then -+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ hardcode_libdir_flag_spec_ld='-rpath $libdir' -+ fi -+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator=: -+ link_all_deplibs=yes -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out -+ else -+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF -+ fi -+ hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_direct=yes -+ hardcode_shlibpath_var=no -+ ;; -+ -+ newsos6) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct=yes -+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator=: -+ hardcode_shlibpath_var=no -+ ;; -+ -+ openbsd*) -+ hardcode_direct=yes -+ hardcode_shlibpath_var=no -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' -+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir' -+ export_dynamic_flag_spec='${wl}-E' -+ else -+ case $host_os in -+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec='-R$libdir' -+ ;; -+ *) -+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir' -+ ;; -+ esac -+ fi -+ ;; -+ -+ os2*) -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_minus_L=yes -+ allow_undefined_flag=unsupported -+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' -+ old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' -+ ;; -+ -+ osf3*) -+ if test "$GCC" = yes; then -+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ allow_undefined_flag=' -expect_unresolved \*' -+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ fi -+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator=: -+ ;; -+ -+ osf4* | osf5*) # as osf3* with the addition of -msym flag -+ if test "$GCC" = yes; then -+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -+ else -+ allow_undefined_flag=' -expect_unresolved \*' -+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ -+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' -+ -+ # Both c and cxx compiler support -rpath directly -+ hardcode_libdir_flag_spec='-rpath $libdir' -+ fi -+ hardcode_libdir_separator=: -+ ;; -+ -+ sco3.2v5*) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var=no -+ export_dynamic_flag_spec='${wl}-Bexport' -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ;; -+ -+ solaris*) -+ no_undefined_flag=' -z text' -+ if test "$GCC" = yes; then -+ wlarc='${wl}' -+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' -+ else -+ wlarc='' -+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ fi -+ hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_shlibpath_var=no -+ case $host_os in -+ solaris2.[0-5] | solaris2.[0-5].*) ;; -+ *) -+ # The compiler driver will combine linker options so we -+ # cannot just pass the convience library names through -+ # without $wl, iff we do not link with $LD. -+ # Luckily, gcc supports the same syntax we need for Sun Studio. -+ # Supported since Solaris 2.6 (maybe 2.5.1?) -+ case $wlarc in -+ '') -+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; -+ *) -+ whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; -+ esac ;; -+ esac -+ link_all_deplibs=yes -+ ;; -+ -+ sunos4*) -+ if test "x$host_vendor" = xsequent; then -+ # Use $CC to link under sequent, because it throws in some extra .o -+ # files that make .init and .fini sections work. -+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' -+ fi -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_direct=yes -+ hardcode_minus_L=yes -+ hardcode_shlibpath_var=no -+ ;; -+ -+ sysv4) -+ case $host_vendor in -+ sni) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct=yes # is this really true??? -+ ;; -+ siemens) -+ ## LD is ld it makes a PLAMLIB -+ ## CC just makes a GrossModule. -+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ reload_cmds='$CC -r -o $output$reload_objs' -+ hardcode_direct=no -+ ;; -+ motorola) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie -+ ;; -+ esac -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var=no -+ ;; -+ -+ sysv4.3*) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var=no -+ export_dynamic_flag_spec='-Bexport' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var=no -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ld_shlibs=yes -+ fi -+ ;; -+ -+ sysv4.2uw2*) -+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct=yes -+ hardcode_minus_L=no -+ hardcode_shlibpath_var=no -+ hardcode_runpath_var=yes -+ runpath_var=LD_RUN_PATH -+ ;; -+ -+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) -+ no_undefined_flag='${wl}-z ${wl}text' -+ if test "$GCC" = yes; then -+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ fi -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var=no -+ ;; -+ -+ sysv5*) -+ no_undefined_flag=' -z text' -+ # $CC -shared without GNU ld will not create a library from C++ -+ # object files and a static libstdc++, better avoid it by now -+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ hardcode_libdir_flag_spec= -+ hardcode_shlibpath_var=no -+ runpath_var='LD_RUN_PATH' -+ ;; -+ -+ uts4*) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_shlibpath_var=no -+ ;; -+ -+ *) -+ ld_shlibs=no -+ ;; -+ esac -+ fi -+ -+echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -+echo "${ECHO_T}$ld_shlibs" >&6 -+test "$ld_shlibs" = no && can_build_shared=no -+ -+variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -+if test "$GCC" = yes; then -+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -+fi -+ -+# -+# Do we need to explicitly link libc? -+# -+case "x$archive_cmds_need_lc" in -+x|xyes) -+ # Assume -lc should be added -+ archive_cmds_need_lc=yes -+ -+ if test "$enable_shared" = yes && test "$GCC" = yes; then -+ case $archive_cmds in -+ *'~'*) -+ # FIXME: we may have to deal with multi-command sequences. -+ ;; -+ '$CC '*) -+ # Test whether the compiler implicitly links with -lc since on some -+ # systems, -lgcc has to come before -lc. If gcc already passes -lc -+ # to ld, don't add -lc before -lgcc. -+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 -+ $rm conftest* -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } 2>conftest.err; then -+ soname=conftest -+ lib=conftest -+ libobjs=conftest.$ac_objext -+ deplibs= -+ wl=$lt_prog_compiler_wl -+ compiler_flags=-v -+ linker_flags=-v -+ verstring= -+ output_objdir=. -+ libname=conftest -+ lt_save_allow_undefined_flag=$allow_undefined_flag -+ allow_undefined_flag= -+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 -+ (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+ then -+ archive_cmds_need_lc=no -+ else -+ archive_cmds_need_lc=yes -+ fi -+ allow_undefined_flag=$lt_save_allow_undefined_flag -+ else -+ cat conftest.err 1>&5 -+ fi -+ $rm conftest* -+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -+echo "${ECHO_T}$archive_cmds_need_lc" >&6 -+ ;; -+ esac -+ fi -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -+library_names_spec= -+libname_spec='lib$name' -+soname_spec= -+shrext_cmds=".so" -+postinstall_cmds= -+postuninstall_cmds= -+finish_cmds= -+finish_eval= -+shlibpath_var= -+shlibpath_overrides_runpath=unknown -+version_type=none -+dynamic_linker="$host_os ld.so" -+sys_lib_dlsearch_path_spec="/lib /usr/lib" -+if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -+ # if the path contains ";" then we assume it to be the separator -+ # otherwise default to the standard path separator (i.e. ":") - it is -+ # assumed that no part of a normal pathname contains ";" but that should -+ # okay in the real world where ";" in dirpaths is itself problematic. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+else -+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -+fi -+need_lib_prefix=unknown -+hardcode_into_libs=no -+ -+# when you set need_version to no, make sure it does not cause -set_version -+# flags to be left without arguments -+need_version=unknown -+ -+case $host_os in -+aix3*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' -+ shlibpath_var=LIBPATH -+ -+ # AIX 3 has no versioning support, so we append a major version to the name. -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ -+aix4* | aix5*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ hardcode_into_libs=yes -+ if test "$host_cpu" = ia64; then -+ # AIX 5 supports IA64 -+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ else -+ # With GCC up to 2.95.x, collect2 would create an import file -+ # for dependence libraries. The import file would start with -+ # the line `#! .'. This would cause the generated library to -+ # depend on `.', always an invalid library. This was fixed in -+ # development snapshots of GCC prior to 3.0. -+ case $host_os in -+ aix4 | aix4.[01] | aix4.[01].*) -+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' -+ echo ' yes ' -+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then -+ : -+ else -+ can_build_shared=no -+ fi -+ ;; -+ esac -+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct -+ # soname into executable. Probably we can add versioning support to -+ # collect2, so additional links can be useful in future. -+ if test "$aix_use_runtimelinking" = yes; then -+ # If using run time linking (on AIX 4.2 or later) use lib.so -+ # instead of lib.a to let people know that these are not -+ # typical AIX shared libraries. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ else -+ # We preserve .a as extension for shared libraries through AIX4.2 -+ # and later when we are not doing run time linking. -+ library_names_spec='${libname}${release}.a $libname.a' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ fi -+ shlibpath_var=LIBPATH -+ fi -+ ;; -+ -+amigaos*) -+ library_names_spec='$libname.ixlibrary $libname.a' -+ # Create ${libname}_ixlibrary.a entries in /sys/libs. -+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' -+ ;; -+ -+beos*) -+ library_names_spec='${libname}${shared_ext}' -+ dynamic_linker="$host_os ld.so" -+ shlibpath_var=LIBRARY_PATH -+ ;; -+ -+bsdi[45]*) -+ version_type=linux -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -+ # the default ld.so.conf also contains /usr/contrib/lib and -+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -+ # libtool to hard-code these into programs -+ ;; -+ -+cygwin* | mingw* | pw32*) -+ version_type=windows -+ shrext_cmds=".dll" -+ need_version=no -+ need_lib_prefix=no -+ -+ case $GCC,$host_os in -+ yes,cygwin* | yes,mingw* | yes,pw32*) -+ library_names_spec='$libname.dll.a' -+ # DLL is installed to $(libdir)/../bin by postinstall_cmds -+ postinstall_cmds='base_file=`basename \${file}`~ -+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ -+ dldir=$destdir/`dirname \$dlpath`~ -+ test -d \$dldir || mkdir -p \$dldir~ -+ $install_prog $dir/$dlname \$dldir/$dlname~ -+ chmod a+x \$dldir/$dlname' -+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ -+ dlpath=$dir/\$dldll~ -+ $rm \$dlpath' -+ shlibpath_overrides_runpath=yes -+ -+ case $host_os in -+ cygwin*) -+ # Cygwin DLLs use 'cyg' prefix rather than 'lib' -+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" -+ ;; -+ mingw*) -+ # MinGW DLLs use traditional 'lib' prefix -+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then -+ # It is most probably a Windows format PATH printed by -+ # mingw gcc, but we are running on Cygwin. Gcc prints its search -+ # path with ; separators, and with drive letters. We can handle the -+ # drive letters (cygwin fileutils understands them), so leave them, -+ # especially as we might pass files found there to a mingw objdump, -+ # which wouldn't understand a cygwinified path. Ahh. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+ ;; -+ pw32*) -+ # pw32 DLLs use 'pw' prefix rather than 'lib' -+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ ;; -+ esac -+ ;; -+ -+ *) -+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' -+ ;; -+ esac -+ dynamic_linker='Win32 ld.exe' -+ # FIXME: first we should search . and the directory the executable is in -+ shlibpath_var=PATH -+ ;; -+ -+darwin* | rhapsody*) -+ dynamic_linker="$host_os dyld" -+ version_type=darwin -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' -+ soname_spec='${libname}${release}${major}$shared_ext' -+ shlibpath_overrides_runpath=yes -+ shlibpath_var=DYLD_LIBRARY_PATH -+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. -+ if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` -+ else -+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' -+ fi -+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' -+ ;; -+ -+dgux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+freebsd1*) -+ dynamic_linker=no -+ ;; -+ -+kfreebsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+freebsd* | dragonfly*) -+ # DragonFly does not have aout. When/if they implement a new -+ # versioning mechanism, adjust this. -+ if test -x /usr/bin/objformat; then -+ objformat=`/usr/bin/objformat` -+ else -+ case $host_os in -+ freebsd[123]*) objformat=aout ;; -+ *) objformat=elf ;; -+ esac -+ fi -+ version_type=freebsd-$objformat -+ case $version_type in -+ freebsd-elf*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' -+ need_version=no -+ need_lib_prefix=no -+ ;; -+ freebsd-*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' -+ need_version=yes -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_os in -+ freebsd2*) -+ shlibpath_overrides_runpath=yes -+ ;; -+ freebsd3.[01]* | freebsdelf3.[01]*) -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ *) # from 3.2 on -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ ;; -+ esac -+ ;; -+ -+gnu*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ hardcode_into_libs=yes -+ ;; -+ -+hpux9* | hpux10* | hpux11*) -+ # Give a soname corresponding to the major version so that dld.sl refuses to -+ # link against other versions. -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ case $host_cpu in -+ ia64*) -+ shrext_cmds='.so' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.so" -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ if test "X$HPUX_IA64_MODE" = X32; then -+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" -+ else -+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" -+ fi -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ hppa*64*) -+ shrext_cmds='.sl' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ *) -+ shrext_cmds='.sl' -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=SHLIB_PATH -+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ esac -+ # HP-UX runs *really* slowly unless shared libraries are mode 555. -+ postinstall_cmds='chmod 555 $lib' -+ ;; -+ -+irix5* | irix6* | nonstopux*) -+ case $host_os in -+ nonstopux*) version_type=nonstopux ;; -+ *) -+ if test "$lt_cv_prog_gnu_ld" = yes; then -+ version_type=linux -+ else -+ version_type=irix -+ fi ;; -+ esac -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' -+ case $host_os in -+ irix5* | nonstopux*) -+ libsuff= shlibsuff= -+ ;; -+ *) -+ case $LD in # libtool.m4 will add one of these switches to LD -+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") -+ libsuff= shlibsuff= libmagic=32-bit;; -+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") -+ libsuff=32 shlibsuff=N32 libmagic=N32;; -+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") -+ libsuff=64 shlibsuff=64 libmagic=64-bit;; -+ *) libsuff= shlibsuff= libmagic=never-match;; -+ esac -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -+ hardcode_into_libs=yes -+ ;; -+ -+# No shared lib support for Linux oldld, aout, or coff. -+linux*oldld* | linux*aout* | linux*coff*) -+ dynamic_linker=no -+ ;; -+ -+# This must be Linux ELF. -+linux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ # This implies no fast_install, which is unacceptable. -+ # Some rework will be needed to allow for fast_install -+ # before this can be enabled. -+ hardcode_into_libs=yes -+ -+ # Append ld.so.conf contents to the search path -+ if test -f /etc/ld.so.conf; then -+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -+ fi -+ -+ # We used to test for /lib/ld.so.1 and disable shared libraries on -+ # powerpc, because MkLinux only supported shared libraries with the -+ # GNU dynamic linker. Since this was broken with cross compilers, -+ # most powerpc-linux boxes support dynamic linking these days and -+ # people can always --disable-shared, the test was removed, and we -+ # assume the GNU/Linux dynamic linker is in use. -+ dynamic_linker='GNU/Linux ld.so' -+ ;; -+ -+netbsdelf*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='NetBSD ld.elf_so' -+ ;; -+ -+knetbsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+netbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ dynamic_linker='NetBSD (a.out) ld.so' -+ else -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ dynamic_linker='NetBSD ld.elf_so' -+ fi -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ -+newsos6) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+nto-qnx*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+openbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. -+ case $host_os in -+ openbsd3.3 | openbsd3.3.*) need_version=yes ;; -+ *) need_version=no ;; -+ esac -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ case $host_os in -+ openbsd2.[89] | openbsd2.[89].*) -+ shlibpath_overrides_runpath=no -+ ;; -+ *) -+ shlibpath_overrides_runpath=yes -+ ;; -+ esac -+ else -+ shlibpath_overrides_runpath=yes -+ fi -+ ;; -+ -+os2*) -+ libname_spec='$name' -+ shrext_cmds=".dll" -+ need_lib_prefix=no -+ library_names_spec='$libname${shared_ext} $libname.a' -+ dynamic_linker='OS/2 ld.exe' -+ shlibpath_var=LIBPATH -+ ;; -+ -+osf3* | osf4* | osf5*) -+ version_type=osf -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -+ ;; -+ -+sco3.2v5*) -+ version_type=osf -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+solaris*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ # ldd complains unless libraries are executable -+ postinstall_cmds='chmod +x $lib' -+ ;; -+ -+sunos4*) -+ version_type=sunos -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ if test "$with_gnu_ld" = yes; then -+ need_lib_prefix=no -+ fi -+ need_version=yes -+ ;; -+ -+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_vendor in -+ sni) -+ shlibpath_overrides_runpath=no -+ need_lib_prefix=no -+ export_dynamic_flag_spec='${wl}-Blargedynsym' -+ runpath_var=LD_RUN_PATH -+ ;; -+ siemens) -+ need_lib_prefix=no -+ ;; -+ motorola) -+ need_lib_prefix=no -+ need_version=no -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -+ ;; -+ esac -+ ;; -+ -+sysv4*MP*) -+ if test -d /usr/nec ;then -+ version_type=linux -+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' -+ soname_spec='$libname${shared_ext}.$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ fi -+ ;; -+ -+uts4*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+*) -+ dynamic_linker=no -+ ;; -+esac -+echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -+echo "${ECHO_T}$dynamic_linker" >&6 -+test "$dynamic_linker" = no && can_build_shared=no -+ -+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -+hardcode_action= -+if test -n "$hardcode_libdir_flag_spec" || \ -+ test -n "$runpath_var" || \ -+ test "X$hardcode_automatic" = "Xyes" ; then -+ -+ # We can hardcode non-existant directories. -+ if test "$hardcode_direct" != no && -+ # If the only mechanism to avoid hardcoding is shlibpath_var, we -+ # have to relink, otherwise we might link with an installed library -+ # when we should be linking with a yet-to-be-installed one -+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && -+ test "$hardcode_minus_L" != no; then -+ # Linking always hardcodes the temporary library directory. -+ hardcode_action=relink -+ else -+ # We can link without hardcoding, and we can hardcode nonexisting dirs. -+ hardcode_action=immediate -+ fi -+else -+ # We cannot hardcode anything, or else we can only hardcode existing -+ # directories. -+ hardcode_action=unsupported -+fi -+echo "$as_me:$LINENO: result: $hardcode_action" >&5 -+echo "${ECHO_T}$hardcode_action" >&6 -+ -+if test "$hardcode_action" = relink; then -+ # Fast installation is not supported -+ enable_fast_install=no -+elif test "$shlibpath_overrides_runpath" = yes || -+ test "$enable_shared" = no; then -+ # Fast installation is not necessary -+ enable_fast_install=needless -+fi -+ -+striplib= -+old_striplib= -+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then -+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -+ test -z "$striplib" && striplib="$STRIP --strip-unneeded" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+else -+# FIXME - insert some real tests, host_os isn't really good enough -+ case $host_os in -+ darwin*) -+ if test -n "$STRIP" ; then -+ striplib="$STRIP -x" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+ else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ ;; -+ *) -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+ ;; -+ esac -+fi -+ -+if test "x$enable_dlopen" != xyes; then -+ enable_dlopen=unknown -+ enable_dlopen_self=unknown -+ enable_dlopen_self_static=unknown -+else -+ lt_cv_dlopen=no -+ lt_cv_dlopen_libs= -+ -+ case $host_os in -+ beos*) -+ lt_cv_dlopen="load_add_on" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ ;; -+ -+ mingw* | pw32*) -+ lt_cv_dlopen="LoadLibrary" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ cygwin*) -+ lt_cv_dlopen="dlopen" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ darwin*) -+ # if libdl is installed we need to link against it -+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -+if test "${ac_cv_lib_dl_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldl $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dl_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dl_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -+if test $ac_cv_lib_dl_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -+else -+ -+ lt_cv_dlopen="dyld" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ -+fi -+ -+ ;; -+ -+ *) -+ echo "$as_me:$LINENO: checking for shl_load" >&5 -+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -+if test "${ac_cv_func_shl_load+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define shl_load to an innocuous variant, in case declares shl_load. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define shl_load innocuous_shl_load -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char shl_load (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef shl_load -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char shl_load (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_shl_load) || defined (__stub___shl_load) -+choke me -+#else -+char (*f) () = shl_load; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != shl_load; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_func_shl_load=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_func_shl_load=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -+echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -+if test $ac_cv_func_shl_load = yes; then -+ lt_cv_dlopen="shl_load" -+else -+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -+if test "${ac_cv_lib_dld_shl_load+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char shl_load (); -+int -+main () -+{ -+shl_load (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dld_shl_load=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dld_shl_load=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -+if test $ac_cv_lib_dld_shl_load = yes; then -+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -+else -+ echo "$as_me:$LINENO: checking for dlopen" >&5 -+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -+if test "${ac_cv_func_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define dlopen to an innocuous variant, in case declares dlopen. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define dlopen innocuous_dlopen -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char dlopen (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef dlopen -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_dlopen) || defined (__stub___dlopen) -+choke me -+#else -+char (*f) () = dlopen; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != dlopen; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_func_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_func_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -+if test $ac_cv_func_dlopen = yes; then -+ lt_cv_dlopen="dlopen" -+else -+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -+if test "${ac_cv_lib_dl_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldl $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dl_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dl_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -+if test $ac_cv_lib_dl_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -+else -+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -+if test "${ac_cv_lib_svld_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lsvld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_svld_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_svld_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -+if test $ac_cv_lib_svld_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -+else -+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -+if test "${ac_cv_lib_dld_dld_link+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dld_link (); -+int -+main () -+{ -+dld_link (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dld_dld_link=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dld_dld_link=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -+if test $ac_cv_lib_dld_dld_link = yes; then -+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ ;; -+ esac -+ -+ if test "x$lt_cv_dlopen" != xno; then -+ enable_dlopen=yes -+ else -+ enable_dlopen=no -+ fi -+ -+ case $lt_cv_dlopen in -+ dlopen) -+ save_CPPFLAGS="$CPPFLAGS" -+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -+ -+ save_LDFLAGS="$LDFLAGS" -+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -+ -+ save_LIBS="$LIBS" -+ LIBS="$lt_cv_dlopen_libs $LIBS" -+ -+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -+if test "${lt_cv_dlopen_self+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ lt_cv_dlopen_self=cross -+else -+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -+ lt_status=$lt_dlunknown -+ cat > conftest.$ac_ext < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LT_DLGLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LT_DLGLOBAL DL_GLOBAL -+# else -+# define LT_DLGLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LT_DLLAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LT_DLLAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LT_DLLAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LT_DLLAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LT_DLLAZY_OR_NOW DL_NOW -+# else -+# define LT_DLLAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+#ifdef __cplusplus -+extern "C" void exit (int); -+#endif -+ -+void fnord() { int i=42;} -+int main () -+{ -+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -+ int status = $lt_dlunknown; -+ -+ if (self) -+ { -+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -+ /* dlclose (self); */ -+ } -+ -+ exit (status); -+} -+EOF -+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -+ (./conftest; exit; ) >&5 2>/dev/null -+ lt_status=$? -+ case x$lt_status in -+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; -+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; -+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;; -+ esac -+ else : -+ # compilation failed -+ lt_cv_dlopen_self=no -+ fi -+fi -+rm -fr conftest* -+ -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -+echo "${ECHO_T}$lt_cv_dlopen_self" >&6 -+ -+ if test "x$lt_cv_dlopen_self" = xyes; then -+ LDFLAGS="$LDFLAGS $link_static_flag" -+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -+if test "${lt_cv_dlopen_self_static+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ lt_cv_dlopen_self_static=cross -+else -+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -+ lt_status=$lt_dlunknown -+ cat > conftest.$ac_ext < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LT_DLGLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LT_DLGLOBAL DL_GLOBAL -+# else -+# define LT_DLGLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LT_DLLAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LT_DLLAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LT_DLLAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LT_DLLAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LT_DLLAZY_OR_NOW DL_NOW -+# else -+# define LT_DLLAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+#ifdef __cplusplus -+extern "C" void exit (int); -+#endif -+ -+void fnord() { int i=42;} -+int main () -+{ -+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -+ int status = $lt_dlunknown; -+ -+ if (self) -+ { -+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -+ /* dlclose (self); */ -+ } -+ -+ exit (status); -+} -+EOF -+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -+ (./conftest; exit; ) >&5 2>/dev/null -+ lt_status=$? -+ case x$lt_status in -+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; -+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; -+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; -+ esac -+ else : -+ # compilation failed -+ lt_cv_dlopen_self_static=no -+ fi -+fi -+rm -fr conftest* -+ -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 -+ fi -+ -+ CPPFLAGS="$save_CPPFLAGS" -+ LDFLAGS="$save_LDFLAGS" -+ LIBS="$save_LIBS" -+ ;; -+ esac -+ -+ case $lt_cv_dlopen_self in -+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; -+ *) enable_dlopen_self=unknown ;; -+ esac -+ -+ case $lt_cv_dlopen_self_static in -+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; -+ *) enable_dlopen_self_static=unknown ;; -+ esac -+fi -+ -+ -+# Report which librarie types wil actually be built -+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -+echo "$as_me:$LINENO: result: $can_build_shared" >&5 -+echo "${ECHO_T}$can_build_shared" >&6 -+ -+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -+test "$can_build_shared" = "no" && enable_shared=no -+ -+# On AIX, shared libraries and static libraries use the same namespace, and -+# are all built from PIC. -+case $host_os in -+aix3*) -+ test "$enable_shared" = yes && enable_static=no -+ if test -n "$RANLIB"; then -+ archive_cmds="$archive_cmds~\$RANLIB \$lib" -+ postinstall_cmds='$RANLIB $lib' -+ fi -+ ;; -+ -+aix4* | aix5*) -+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then -+ test "$enable_shared" = yes && enable_static=no -+ fi -+ ;; -+esac -+echo "$as_me:$LINENO: result: $enable_shared" >&5 -+echo "${ECHO_T}$enable_shared" >&6 -+ -+echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -+# Make sure either enable_shared or enable_static is yes. -+test "$enable_shared" = yes || enable_static=yes -+echo "$as_me:$LINENO: result: $enable_static" >&5 -+echo "${ECHO_T}$enable_static" >&6 -+ -+# The else clause should only fire when bootstrapping the -+# libtool distribution, otherwise you forgot to ship ltmain.sh -+# with your package, and you will get complaints that there are -+# no rules to generate ltmain.sh. -+if test -f "$ltmain"; then -+ # See if we are running on zsh, and set the options which allow our commands through -+ # without removal of \ escapes. -+ if test -n "${ZSH_VERSION+set}" ; then -+ setopt NO_GLOB_SUBST -+ fi -+ # Now quote all the things that may contain metacharacters while being -+ # careful not to overquote the AC_SUBSTed values. We take copies of the -+ # variables and quote the copies for generation of the libtool script. -+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ -+ SED SHELL STRIP \ -+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ -+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ -+ deplibs_check_method reload_flag reload_cmds need_locks \ -+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ -+ lt_cv_sys_global_symbol_to_c_name_address \ -+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -+ old_postinstall_cmds old_postuninstall_cmds \ -+ compiler \ -+ CC \ -+ LD \ -+ lt_prog_compiler_wl \ -+ lt_prog_compiler_pic \ -+ lt_prog_compiler_static \ -+ lt_prog_compiler_no_builtin_flag \ -+ export_dynamic_flag_spec \ -+ thread_safe_flag_spec \ -+ whole_archive_flag_spec \ -+ enable_shared_with_static_runtimes \ -+ old_archive_cmds \ -+ old_archive_from_new_cmds \ -+ predep_objects \ -+ postdep_objects \ -+ predeps \ -+ postdeps \ -+ compiler_lib_search_path \ -+ archive_cmds \ -+ archive_expsym_cmds \ -+ postinstall_cmds \ -+ postuninstall_cmds \ -+ old_archive_from_expsyms_cmds \ -+ allow_undefined_flag \ -+ no_undefined_flag \ -+ export_symbols_cmds \ -+ hardcode_libdir_flag_spec \ -+ hardcode_libdir_flag_spec_ld \ -+ hardcode_libdir_separator \ -+ hardcode_automatic \ -+ module_cmds \ -+ module_expsym_cmds \ -+ lt_cv_prog_compiler_c_o \ -+ exclude_expsyms \ -+ include_expsyms; do -+ -+ case $var in -+ old_archive_cmds | \ -+ old_archive_from_new_cmds | \ -+ archive_cmds | \ -+ archive_expsym_cmds | \ -+ module_cmds | \ -+ module_expsym_cmds | \ -+ old_archive_from_expsyms_cmds | \ -+ export_symbols_cmds | \ -+ extract_expsyms_cmds | reload_cmds | finish_cmds | \ -+ postinstall_cmds | postuninstall_cmds | \ -+ old_postinstall_cmds | old_postuninstall_cmds | \ -+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) -+ # Double-quote double-evaled strings. -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" -+ ;; -+ *) -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -+ ;; -+ esac -+ done -+ -+ case $lt_echo in -+ *'\$0 --fallback-echo"') -+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` -+ ;; -+ esac -+ -+cfgfile="${ofile}T" -+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15 -+ $rm -f "$cfgfile" -+ { echo "$as_me:$LINENO: creating $ofile" >&5 -+echo "$as_me: creating $ofile" >&6;} -+ -+ cat <<__EOF__ >> "$cfgfile" -+#! $SHELL -+ -+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -+# NOTE: Changes made to this file will be lost: look at ltmain.sh. -+# -+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -+# Free Software Foundation, Inc. -+# -+# This file is part of GNU Libtool: -+# Originally by Gordon Matzigkeit , 1996 -+# -+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+# -+# As a special exception to the GNU General Public License, if you -+# distribute this file as part of a program that contains a -+# configuration script generated by Autoconf, you may include it under -+# the same distribution terms that you use for the rest of that program. -+ -+# A sed program that does not truncate output. -+SED=$lt_SED -+ -+# Sed that helps us avoid accidentally triggering echo(1) options like -n. -+Xsed="$SED -e 1s/^X//" -+ -+# The HP-UX ksh and POSIX shell print the target directory to stdout -+# if CDPATH is set. -+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -+ -+# The names of the tagged configurations supported by this script. -+available_tags= -+ -+# ### BEGIN LIBTOOL CONFIG -+ -+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -+ -+# Shell to use when invoking shell scripts. -+SHELL=$lt_SHELL -+ -+# Whether or not to build shared libraries. -+build_libtool_libs=$enable_shared -+ -+# Whether or not to build static libraries. -+build_old_libs=$enable_static -+ -+# Whether or not to add -lc for building shared libraries. -+build_libtool_need_lc=$archive_cmds_need_lc -+ -+# Whether or not to disallow shared libs when runtime libs are static -+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes -+ -+# Whether or not to optimize for fast installation. -+fast_install=$enable_fast_install -+ -+# The host system. -+host_alias=$host_alias -+host=$host -+host_os=$host_os -+ -+# The build system. -+build_alias=$build_alias -+build=$build -+build_os=$build_os -+ -+# An echo program that does not interpret backslashes. -+echo=$lt_echo -+ -+# The archiver. -+AR=$lt_AR -+AR_FLAGS=$lt_AR_FLAGS -+ -+# A C compiler. -+LTCC=$lt_LTCC -+ -+# A language-specific compiler. -+CC=$lt_compiler -+ -+# Is the compiler the GNU C compiler? -+with_gcc=$GCC -+ -+# An ERE matcher. -+EGREP=$lt_EGREP -+ -+# The linker used to build libraries. -+LD=$lt_LD -+ -+# Whether we need hard or soft links. -+LN_S=$lt_LN_S -+ -+# A BSD-compatible nm program. -+NM=$lt_NM -+ -+# A symbol stripping program -+STRIP=$lt_STRIP -+ -+# Used to examine libraries when file_magic_cmd begins "file" -+MAGIC_CMD=$MAGIC_CMD -+ -+# Used on cygwin: DLL creation program. -+DLLTOOL="$DLLTOOL" -+ -+# Used on cygwin: object dumper. -+OBJDUMP="$OBJDUMP" -+ -+# Used on cygwin: assembler. -+AS="$AS" -+ -+# The name of the directory that contains temporary libtool files. -+objdir=$objdir -+ -+# How to create reloadable object files. -+reload_flag=$lt_reload_flag -+reload_cmds=$lt_reload_cmds -+ -+# How to pass a linker flag through the compiler. -+wl=$lt_lt_prog_compiler_wl -+ -+# Object file suffix (normally "o"). -+objext="$ac_objext" -+ -+# Old archive suffix (normally "a"). -+libext="$libext" -+ -+# Shared library suffix (normally ".so"). -+shrext_cmds='$shrext_cmds' -+ -+# Executable file suffix (normally ""). -+exeext="$exeext" -+ -+# Additional compiler flags for building library objects. -+pic_flag=$lt_lt_prog_compiler_pic -+pic_mode=$pic_mode -+ -+# What is the maximum length of a command? -+max_cmd_len=$lt_cv_sys_max_cmd_len -+ -+# Does compiler simultaneously support -c and -o options? -+compiler_c_o=$lt_lt_cv_prog_compiler_c_o -+ -+# Must we lock files when doing compilation? -+need_locks=$lt_need_locks -+ -+# Do we need the lib prefix for modules? -+need_lib_prefix=$need_lib_prefix -+ -+# Do we need a version for libraries? -+need_version=$need_version -+ -+# Whether dlopen is supported. -+dlopen_support=$enable_dlopen -+ -+# Whether dlopen of programs is supported. -+dlopen_self=$enable_dlopen_self -+ -+# Whether dlopen of statically linked programs is supported. -+dlopen_self_static=$enable_dlopen_self_static -+ -+# Compiler flag to prevent dynamic linking. -+link_static_flag=$lt_lt_prog_compiler_static -+ -+# Compiler flag to turn off builtin functions. -+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -+ -+# Compiler flag to allow reflexive dlopens. -+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec -+ -+# Compiler flag to generate shared objects directly from archives. -+whole_archive_flag_spec=$lt_whole_archive_flag_spec -+ -+# Compiler flag to generate thread-safe objects. -+thread_safe_flag_spec=$lt_thread_safe_flag_spec -+ -+# Library versioning type. -+version_type=$version_type -+ -+# Format of library name prefix. -+libname_spec=$lt_libname_spec -+ -+# List of archive names. First name is the real one, the rest are links. -+# The last name is the one that the linker finds with -lNAME. -+library_names_spec=$lt_library_names_spec -+ -+# The coded name of the library, if different from the real name. -+soname_spec=$lt_soname_spec -+ -+# Commands used to build and install an old-style archive. -+RANLIB=$lt_RANLIB -+old_archive_cmds=$lt_old_archive_cmds -+old_postinstall_cmds=$lt_old_postinstall_cmds -+old_postuninstall_cmds=$lt_old_postuninstall_cmds -+ -+# Create an old-style archive from a shared archive. -+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds -+ -+# Create a temporary old-style archive to link instead of a shared archive. -+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds -+ -+# Commands used to build and install a shared archive. -+archive_cmds=$lt_archive_cmds -+archive_expsym_cmds=$lt_archive_expsym_cmds -+postinstall_cmds=$lt_postinstall_cmds -+postuninstall_cmds=$lt_postuninstall_cmds -+ -+# Commands used to build a loadable module (assumed same as above if empty) -+module_cmds=$lt_module_cmds -+module_expsym_cmds=$lt_module_expsym_cmds -+ -+# Commands to strip libraries. -+old_striplib=$lt_old_striplib -+striplib=$lt_striplib -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predep_objects=$lt_predep_objects -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdep_objects=$lt_postdep_objects -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predeps=$lt_predeps -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdeps=$lt_postdeps -+ -+# The library search path used internally by the compiler when linking -+# a shared library. -+compiler_lib_search_path=$lt_compiler_lib_search_path -+ -+# Method to check whether dependent libraries are shared objects. -+deplibs_check_method=$lt_deplibs_check_method -+ -+# Command to use when deplibs_check_method == file_magic. -+file_magic_cmd=$lt_file_magic_cmd -+ -+# Flag that allows shared libraries with undefined symbols to be built. -+allow_undefined_flag=$lt_allow_undefined_flag -+ -+# Flag that forces no undefined symbols. -+no_undefined_flag=$lt_no_undefined_flag -+ -+# Commands used to finish a libtool library installation in a directory. -+finish_cmds=$lt_finish_cmds -+ -+# Same as above, but a single script fragment to be evaled but not shown. -+finish_eval=$lt_finish_eval -+ -+# Take the output of nm and produce a listing of raw symbols and C names. -+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -+ -+# Transform the output of nm in a proper C declaration -+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -+ -+# Transform the output of nm in a C name address pair -+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -+ -+# This is the shared library runtime path variable. -+runpath_var=$runpath_var -+ -+# This is the shared library path variable. -+shlibpath_var=$shlibpath_var -+ -+# Is shlibpath searched before the hard-coded library search path? -+shlibpath_overrides_runpath=$shlibpath_overrides_runpath -+ -+# How to hardcode a shared library path into an executable. -+hardcode_action=$hardcode_action -+ -+# Whether we should hardcode library paths into libraries. -+hardcode_into_libs=$hardcode_into_libs -+ -+# Flag to hardcode \$libdir into a binary during linking. -+# This must work even if \$libdir does not exist. -+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -+ -+# If ld is used when linking, flag to hardcode \$libdir into -+# a binary during linking. This must work even if \$libdir does -+# not exist. -+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld -+ -+# Whether we need a single -rpath flag with a separated argument. -+hardcode_libdir_separator=$lt_hardcode_libdir_separator -+ -+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -+# resulting binary. -+hardcode_direct=$hardcode_direct -+ -+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -+# resulting binary. -+hardcode_minus_L=$hardcode_minus_L -+ -+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -+# the resulting binary. -+hardcode_shlibpath_var=$hardcode_shlibpath_var -+ -+# Set to yes if building a shared library automatically hardcodes DIR into the library -+# and all subsequent libraries and executables linked against it. -+hardcode_automatic=$hardcode_automatic -+ -+# Variables whose values should be saved in libtool wrapper scripts and -+# restored at relink time. -+variables_saved_for_relink="$variables_saved_for_relink" -+ -+# Whether libtool must link a program against all its dependency libraries. -+link_all_deplibs=$link_all_deplibs -+ -+# Compile-time system search path for libraries -+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -+ -+# Run-time system search path for libraries -+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -+ -+# Fix the shell variable \$srcfile for the compiler. -+fix_srcfile_path="$fix_srcfile_path" -+ -+# Set to yes if exported symbols are required. -+always_export_symbols=$always_export_symbols -+ -+# The commands to list exported symbols. -+export_symbols_cmds=$lt_export_symbols_cmds -+ -+# The commands to extract the exported symbol list from a shared archive. -+extract_expsyms_cmds=$lt_extract_expsyms_cmds -+ -+# Symbols that should not be listed in the preloaded symbols. -+exclude_expsyms=$lt_exclude_expsyms -+ -+# Symbols that must always be exported. -+include_expsyms=$lt_include_expsyms -+ -+# ### END LIBTOOL CONFIG -+ -+__EOF__ -+ -+ -+ case $host_os in -+ aix3*) -+ cat <<\EOF >> "$cfgfile" -+ -+# AIX sometimes has problems with the GCC collect2 program. For some -+# reason, if we set the COLLECT_NAMES environment variable, the problems -+# vanish in a puff of smoke. -+if test "X${COLLECT_NAMES+set}" != Xset; then -+ COLLECT_NAMES= -+ export COLLECT_NAMES -+fi -+EOF -+ ;; -+ esac -+ -+ # We use sed instead of cat because bash on DJGPP gets confused if -+ # if finds mixed CR/LF and LF-only lines. Since sed operates in -+ # text mode, it properly converts lines to CR/LF. This bash problem -+ # is reportedly fixed, but why not run on old versions too? -+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) -+ -+ mv -f "$cfgfile" "$ofile" || \ -+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") -+ chmod +x "$ofile" -+ -+else -+ # If there is no Makefile yet, we rely on a make rule to execute -+ # `config.status --recheck' to rerun these tests and create the -+ # libtool script then. -+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` -+ if test -f "$ltmain_in"; then -+ test -f Makefile && make "$ltmain" -+ fi -+fi -+ -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+CC="$lt_save_CC" -+ -+ -+# Check whether --with-tags or --without-tags was given. -+if test "${with_tags+set}" = set; then -+ withval="$with_tags" -+ tagnames="$withval" -+fi; -+ -+if test -f "$ltmain" && test -n "$tagnames"; then -+ if test ! -f "${ofile}"; then -+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} -+ fi -+ -+ if test -z "$LTCC"; then -+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`" -+ if test -z "$LTCC"; then -+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} -+ else -+ { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} -+ fi -+ fi -+ -+ # Extract list of available tagged configurations in $ofile. -+ # Note that this assumes the entire list is on one line. -+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` -+ -+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," -+ for tagname in $tagnames; do -+ IFS="$lt_save_ifs" -+ # Check whether tagname contains only valid characters -+ case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in -+ "") ;; -+ *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -+echo "$as_me: error: invalid tag name: $tagname" >&2;} -+ { (exit 1); exit 1; }; } -+ ;; -+ esac -+ -+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null -+ then -+ { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} -+ { (exit 1); exit 1; }; } -+ fi -+ -+ # Update the list of available tags. -+ if test -n "$tagname"; then -+ echo appending configuration tag \"$tagname\" to $ofile -+ -+ case $tagname in -+ CXX) -+ if test -n "$CXX" && ( test "X$CXX" != "Xno" && -+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || -+ (test "X$CXX" != "Xg++"))) ; then -+ ac_ext=cc -+ac_cpp='$CXXCPP $CPPFLAGS' -+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -+ -+ -+ -+ -+archive_cmds_need_lc_CXX=no -+allow_undefined_flag_CXX= -+always_export_symbols_CXX=no -+archive_expsym_cmds_CXX= -+export_dynamic_flag_spec_CXX= -+hardcode_direct_CXX=no -+hardcode_libdir_flag_spec_CXX= -+hardcode_libdir_flag_spec_ld_CXX= -+hardcode_libdir_separator_CXX= -+hardcode_minus_L_CXX=no -+hardcode_automatic_CXX=no -+module_cmds_CXX= -+module_expsym_cmds_CXX= -+link_all_deplibs_CXX=unknown -+old_archive_cmds_CXX=$old_archive_cmds -+no_undefined_flag_CXX= -+whole_archive_flag_spec_CXX= -+enable_shared_with_static_runtimes_CXX=no -+ -+# Dependencies to place before and after the object being linked: -+predep_objects_CXX= -+postdep_objects_CXX= -+predeps_CXX= -+postdeps_CXX= -+compiler_lib_search_path_CXX= -+ -+# Source file extension for C++ test sources. -+ac_ext=cpp -+ -+# Object file extension for compiled C++ test sources. -+objext=o -+objext_CXX=$objext -+ -+# Code to be used in simple compile tests -+lt_simple_compile_test_code="int some_variable = 0;\n" -+ -+# Code to be used in simple link tests -+lt_simple_link_test_code='int main(int, char *) { return(0); }\n' -+ -+# ltmain only uses $CC for tagged configurations so make sure $CC is set. -+ -+# If no C compiler was specified, use CC. -+LTCC=${LTCC-"$CC"} -+ -+# Allow CC to be a program name with arguments. -+compiler=$CC -+ -+ -+# save warnings/boilerplate of simple test code -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_compile_test_code" >conftest.$ac_ext -+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_compiler_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_link_test_code" >conftest.$ac_ext -+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_linker_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ -+# Allow CC to be a program name with arguments. -+lt_save_CC=$CC -+lt_save_LD=$LD -+lt_save_GCC=$GCC -+GCC=$GXX -+lt_save_with_gnu_ld=$with_gnu_ld -+lt_save_path_LD=$lt_cv_path_LD -+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then -+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -+else -+ unset lt_cv_prog_gnu_ld -+fi -+if test -n "${lt_cv_path_LDCXX+set}"; then -+ lt_cv_path_LD=$lt_cv_path_LDCXX -+else -+ unset lt_cv_path_LD -+fi -+test -z "${LDCXX+set}" || LD=$LDCXX -+CC=${CXX-"c++"} -+compiler=$CC -+compiler_CXX=$CC -+for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+ -+# We don't want -fno-exception wen compiling C++ code, so set the -+# no_builtin_flag separately -+if test "$GXX" = yes; then -+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -+else -+ lt_prog_compiler_no_builtin_flag_CXX= -+fi -+ -+if test "$GXX" = yes; then -+ # Set up default GNU C++ configuration -+ -+ -+# Check whether --with-gnu-ld or --without-gnu-ld was given. -+if test "${with_gnu_ld+set}" = set; then -+ withval="$with_gnu_ld" -+ test "$withval" = no || with_gnu_ld=yes -+else -+ with_gnu_ld=no -+fi; -+ac_prog=ld -+if test "$GCC" = yes; then -+ # Check if gcc -print-prog-name=ld gives a path. -+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 -+ case $host in -+ *-*-mingw*) -+ # gcc leaves a trailing carriage return which upsets mingw -+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; -+ *) -+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; -+ esac -+ case $ac_prog in -+ # Accept absolute paths. -+ [\\/]* | ?:[\\/]*) -+ re_direlt='/[^/][^/]*/\.\./' -+ # Canonicalize the pathname of ld -+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` -+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` -+ done -+ test -z "$LD" && LD="$ac_prog" -+ ;; -+ "") -+ # If it fails, then pretend we aren't using GCC. -+ ac_prog=ld -+ ;; -+ *) -+ # If it is relative, then search for the first ld in PATH. -+ with_gnu_ld=unknown -+ ;; -+ esac -+elif test "$with_gnu_ld" = yes; then -+ echo "$as_me:$LINENO: checking for GNU ld" >&5 -+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -+else -+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -+fi -+if test "${lt_cv_path_LD+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -z "$LD"; then -+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -+ for ac_dir in $PATH; do -+ IFS="$lt_save_ifs" -+ test -z "$ac_dir" && ac_dir=. -+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then -+ lt_cv_path_LD="$ac_dir/$ac_prog" -+ # Check to see if the program is GNU ld. I'd rather use --version, -+ # but apparently some variants of GNU ld only accept -v. -+ # Break only if it was the GNU/non-GNU ld that we prefer. -+ case `"$lt_cv_path_LD" -v 2>&1 &5 -+echo "${ECHO_T}$LD" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} -+ { (exit 1); exit 1; }; } -+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -+if test "${lt_cv_prog_gnu_ld+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ # I'd rather use --version here, but apparently some GNU lds only accept -v. -+case `$LD -v 2>&1 &5 -+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -+with_gnu_ld=$lt_cv_prog_gnu_ld -+ -+ -+ -+ # Check if GNU C++ uses GNU ld as the underlying linker, since the -+ # archiving commands below assume that GNU ld is being used. -+ if test "$with_gnu_ld" = yes; then -+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' -+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic' -+ -+ # If archive_cmds runs LD, not CC, wlarc should be empty -+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to -+ # investigate it a little bit more. (MM) -+ wlarc='${wl}' -+ -+ # ancient GNU ld didn't support --whole-archive et. al. -+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ -+ grep 'no-whole-archive' > /dev/null; then -+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ else -+ whole_archive_flag_spec_CXX= -+ fi -+ else -+ with_gnu_ld=no -+ wlarc= -+ -+ # A generic and very simple default shared library creation -+ # command for GNU C++ for the case where it uses the native -+ # linker, instead of GNU ld. If possible, this setting should -+ # overridden to take advantage of the native linker features on -+ # the platform it is being used on. -+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' -+ fi -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' -+ -+else -+ GXX=no -+ with_gnu_ld=no -+ wlarc= -+fi -+ -+# PORTME: fill in a description of your system's C++ link characteristics -+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -+ld_shlibs_CXX=yes -+case $host_os in -+ aix3*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ aix4* | aix5*) -+ if test "$host_cpu" = ia64; then -+ # On IA64, the linker does run time linking by default, so we don't -+ # have to do anything special. -+ aix_use_runtimelinking=no -+ exp_sym_flag='-Bexport' -+ no_entry_flag="" -+ else -+ aix_use_runtimelinking=no -+ -+ # Test if we are trying to use run time linking or normal -+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we -+ # need to do runtime linking. -+ case $host_os in aix4.[23]|aix4.[23].*|aix5*) -+ for ld_flag in $LDFLAGS; do -+ case $ld_flag in -+ *-brtl*) -+ aix_use_runtimelinking=yes -+ break -+ ;; -+ esac -+ done -+ esac -+ -+ exp_sym_flag='-bexport' -+ no_entry_flag='-bnoentry' -+ fi -+ -+ # When large executables or shared objects are built, AIX ld can -+ # have problems creating the table of contents. If linking a library -+ # or program results in "error TOC overflow" add -mminimal-toc to -+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -+ -+ archive_cmds_CXX='' -+ hardcode_direct_CXX=yes -+ hardcode_libdir_separator_CXX=':' -+ link_all_deplibs_CXX=yes -+ -+ if test "$GXX" = yes; then -+ case $host_os in aix4.[012]|aix4.[012].*) -+ # We only want to do this on AIX 4.2 and lower, the check -+ # below for broken collect2 doesn't work under 4.3+ -+ collect2name=`${CC} -print-prog-name=collect2` -+ if test -f "$collect2name" && \ -+ strings "$collect2name" | grep resolve_lib_name >/dev/null -+ then -+ # We have reworked collect2 -+ hardcode_direct_CXX=yes -+ else -+ # We have old collect2 -+ hardcode_direct_CXX=unsupported -+ # It fails to find uninstalled libraries when the uninstalled -+ # path is not listed in the libpath. Setting hardcode_minus_L -+ # to unsupported forces relinking -+ hardcode_minus_L_CXX=yes -+ hardcode_libdir_flag_spec_CXX='-L$libdir' -+ hardcode_libdir_separator_CXX= -+ fi -+ esac -+ shared_flag='-shared' -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag="$shared_flag "'${wl}-G' -+ fi -+ else -+ # not using gcc -+ if test "$host_cpu" = ia64; then -+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release -+ # chokes on -Wl,-G. The following line is correct: -+ shared_flag='-G' -+ else -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag='${wl}-G' -+ else -+ shared_flag='${wl}-bM:SRE' -+ fi -+ fi -+ fi -+ -+ # It seems that -bexpall does not export symbols beginning with -+ # underscore (_), so it is better to generate a list of symbols to export. -+ always_export_symbols_CXX=yes -+ if test "$aix_use_runtimelinking" = yes; then -+ # Warning - without using the other runtime loading flags (-brtl), -+ # -berok will link without error, but may produce a broken library. -+ allow_undefined_flag_CXX='-berok' -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" -+ -+ archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -+ else -+ if test "$host_cpu" = ia64; then -+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' -+ allow_undefined_flag_CXX="-z nodefs" -+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -+ else -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" -+ # Warning - without using the other run time loading flags, -+ # -berok will link without error, but may produce a broken library. -+ no_undefined_flag_CXX=' ${wl}-bernotok' -+ allow_undefined_flag_CXX=' ${wl}-berok' -+ # -bexpall does not export symbols beginning with underscore (_) -+ always_export_symbols_CXX=yes -+ # Exported symbols can be pulled into shared objects from archives -+ whole_archive_flag_spec_CXX=' ' -+ archive_cmds_need_lc_CXX=yes -+ # This is similar to how AIX traditionally builds its shared libraries. -+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' -+ fi -+ fi -+ ;; -+ chorus*) -+ case $cc_basename in -+ *) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ esac -+ ;; -+ -+ -+ cygwin* | mingw* | pw32*) -+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, -+ # as there is no search path for DLLs. -+ hardcode_libdir_flag_spec_CXX='-L$libdir' -+ allow_undefined_flag_CXX=unsupported -+ always_export_symbols_CXX=no -+ enable_shared_with_static_runtimes_CXX=yes -+ -+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ # If the export-symbols file already is a .def file (1st line -+ # is EXPORTS), use it as is; otherwise, prepend... -+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -+ cp $export_symbols $output_objdir/$soname.def; -+ else -+ echo EXPORTS > $output_objdir/$soname.def; -+ cat $export_symbols >> $output_objdir/$soname.def; -+ fi~ -+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ else -+ ld_shlibs_CXX=no -+ fi -+ ;; -+ darwin* | rhapsody*) -+ case $host_os in -+ rhapsody* | darwin1.[012]) -+ allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' -+ ;; -+ *) # Darwin 1.3 on -+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then -+ allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ else -+ case ${MACOSX_DEPLOYMENT_TARGET} in -+ 10.[012]) -+ allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ ;; -+ 10.*) -+ allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' -+ ;; -+ esac -+ fi -+ ;; -+ esac -+ archive_cmds_need_lc_CXX=no -+ hardcode_direct_CXX=no -+ hardcode_automatic_CXX=yes -+ hardcode_shlibpath_var_CXX=unsupported -+ whole_archive_flag_spec_CXX='' -+ link_all_deplibs_CXX=yes -+ -+ if test "$GXX" = yes ; then -+ lt_int_apple_cc_single_mod=no -+ output_verbose_link_cmd='echo' -+ if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then -+ lt_int_apple_cc_single_mod=yes -+ fi -+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then -+ archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ else -+ archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ fi -+ module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then -+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ fi -+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ case $cc_basename in -+ xlc*) -+ output_verbose_link_cmd='echo' -+ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' -+ module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ ;; -+ *) -+ ld_shlibs_CXX=no -+ ;; -+ esac -+ fi -+ ;; -+ -+ dgux*) -+ case $cc_basename in -+ ec++*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ ghcx*) -+ # Green Hills C++ Compiler -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ esac -+ ;; -+ freebsd[12]*) -+ # C++ shared libraries reported to be fairly broken before switch to ELF -+ ld_shlibs_CXX=no -+ ;; -+ freebsd-elf*) -+ archive_cmds_need_lc_CXX=no -+ ;; -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF -+ # conventions -+ ld_shlibs_CXX=yes -+ ;; -+ gnu*) -+ ;; -+ hpux9*) -+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator_CXX=: -+ export_dynamic_flag_spec_CXX='${wl}-E' -+ hardcode_direct_CXX=yes -+ hardcode_minus_L_CXX=yes # Not in the search PATH, -+ # but as the default -+ # location of the library. -+ -+ case $cc_basename in -+ CC*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ aCC*) -+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes; then -+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ else -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ fi -+ ;; -+ esac -+ ;; -+ hpux10*|hpux11*) -+ if test $with_gnu_ld = no; then -+ case $host_cpu in -+ hppa*64*) -+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' -+ hardcode_libdir_flag_spec_ld_CXX='+b $libdir' -+ hardcode_libdir_separator_CXX=: -+ ;; -+ ia64*) -+ hardcode_libdir_flag_spec_CXX='-L$libdir' -+ ;; -+ *) -+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator_CXX=: -+ export_dynamic_flag_spec_CXX='${wl}-E' -+ ;; -+ esac -+ fi -+ case $host_cpu in -+ hppa*64*) -+ hardcode_direct_CXX=no -+ hardcode_shlibpath_var_CXX=no -+ ;; -+ ia64*) -+ hardcode_direct_CXX=no -+ hardcode_shlibpath_var_CXX=no -+ hardcode_minus_L_CXX=yes # Not in the search PATH, -+ # but as the default -+ # location of the library. -+ ;; -+ *) -+ hardcode_direct_CXX=yes -+ hardcode_minus_L_CXX=yes # Not in the search PATH, -+ # but as the default -+ # location of the library. -+ ;; -+ esac -+ -+ case $cc_basename in -+ CC*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ aCC*) -+ case $host_cpu in -+ hppa*64*|ia64*) -+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' -+ ;; -+ *) -+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' -+ ;; -+ esac -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes; then -+ if test $with_gnu_ld = no; then -+ case $host_cpu in -+ ia64*|hppa*64*) -+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' -+ ;; -+ *) -+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' -+ ;; -+ esac -+ fi -+ else -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ fi -+ ;; -+ esac -+ ;; -+ irix5* | irix6*) -+ case $cc_basename in -+ CC*) -+ # SGI C++ -+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ -+ # Archives containing C++ object files must be created using -+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is -+ # necessary to make sure instantiated templates are included -+ # in the archive. -+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' -+ ;; -+ *) -+ if test "$GXX" = yes; then -+ if test "$with_gnu_ld" = no; then -+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' -+ fi -+ fi -+ link_all_deplibs_CXX=yes -+ ;; -+ esac -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_CXX=: -+ ;; -+ linux*) -+ case $cc_basename in -+ KCC*) -+ # Kuck and Associates, Inc. (KAI) C++ Compiler -+ -+ # KCC will only create a shared library if the output file -+ # ends with ".so" (or ".sl" for HP-UX), so rename the library -+ # to its proper name (with version) after linking. -+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' -+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' -+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic' -+ -+ # Archives containing C++ object files must be created using -+ # "CC -Bstatic", where "CC" is the KAI C++ compiler. -+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' -+ ;; -+ icpc*) -+ # Intel C++ -+ with_gnu_ld=yes -+ # version 8.0 and above of icpc choke on multiply defined symbols -+ # if we add $predep_objects and $postdep_objects, however 7.1 and -+ # earlier do not add the objects themselves. -+ case `$CC -V 2>&1` in -+ *"Version 7."*) -+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ ;; -+ *) # Version 8.0 or newer -+ tmp_idyn= -+ case $host_cpu in -+ ia64*) tmp_idyn=' -i_dynamic';; -+ esac -+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ ;; -+ esac -+ archive_cmds_need_lc_CXX=no -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' -+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic' -+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' -+ ;; -+ pgCC*) -+ # Portland Group C++ compiler -+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' -+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' -+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic' -+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ ;; -+ cxx*) -+ # Compaq C++ -+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' -+ -+ runpath_var=LD_RUN_PATH -+ hardcode_libdir_flag_spec_CXX='-rpath $libdir' -+ hardcode_libdir_separator_CXX=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ esac -+ ;; -+ lynxos*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ m88k*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ mvs*) -+ case $cc_basename in -+ cxx*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ esac -+ ;; -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' -+ wlarc= -+ hardcode_libdir_flag_spec_CXX='-R$libdir' -+ hardcode_direct_CXX=yes -+ hardcode_shlibpath_var_CXX=no -+ fi -+ # Workaround some broken pre-1.5 toolchains -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' -+ ;; -+ openbsd2*) -+ # C++ shared libraries are fairly broken -+ ld_shlibs_CXX=no -+ ;; -+ openbsd*) -+ hardcode_direct_CXX=yes -+ hardcode_shlibpath_var_CXX=no -+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' -+ export_dynamic_flag_spec_CXX='${wl}-E' -+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ fi -+ output_verbose_link_cmd='echo' -+ ;; -+ osf3*) -+ case $cc_basename in -+ KCC*) -+ # Kuck and Associates, Inc. (KAI) C++ Compiler -+ -+ # KCC will only create a shared library if the output file -+ # ends with ".so" (or ".sl" for HP-UX), so rename the library -+ # to its proper name (with version) after linking. -+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' -+ hardcode_libdir_separator_CXX=: -+ -+ # Archives containing C++ object files must be created using -+ # "CC -Bstatic", where "CC" is the KAI C++ compiler. -+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' -+ -+ ;; -+ RCC*) -+ # Rational C++ 2.4.1 -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ cxx*) -+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_CXX=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then -+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_CXX=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' -+ -+ else -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ fi -+ ;; -+ esac -+ ;; -+ osf4* | osf5*) -+ case $cc_basename in -+ KCC*) -+ # Kuck and Associates, Inc. (KAI) C++ Compiler -+ -+ # KCC will only create a shared library if the output file -+ # ends with ".so" (or ".sl" for HP-UX), so rename the library -+ # to its proper name (with version) after linking. -+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' -+ hardcode_libdir_separator_CXX=: -+ -+ # Archives containing C++ object files must be created using -+ # the KAI C++ compiler. -+ old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' -+ ;; -+ RCC*) -+ # Rational C++ 2.4.1 -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ cxx*) -+ allow_undefined_flag_CXX=' -expect_unresolved \*' -+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ -+ echo "-hidden">> $lib.exp~ -+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ -+ $rm $lib.exp' -+ -+ hardcode_libdir_flag_spec_CXX='-rpath $libdir' -+ hardcode_libdir_separator_CXX=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ # -+ # There doesn't appear to be a way to prevent this compiler from -+ # explicitly linking system object files so we need to strip them -+ # from the output so that they don't get included in the library -+ # dependencies. -+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' -+ ;; -+ *) -+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then -+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_CXX=: -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' -+ -+ else -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ fi -+ ;; -+ esac -+ ;; -+ psos*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ sco*) -+ archive_cmds_need_lc_CXX=no -+ case $cc_basename in -+ CC*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ esac -+ ;; -+ sunos4*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.x -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ lcc*) -+ # Lucid -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ esac -+ ;; -+ solaris*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.2, 5.x and Centerline C++ -+ archive_cmds_need_lc_CXX=yes -+ no_undefined_flag_CXX=' -zdefs' -+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' -+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' -+ -+ hardcode_libdir_flag_spec_CXX='-R$libdir' -+ hardcode_shlibpath_var_CXX=no -+ case $host_os in -+ solaris2.[0-5] | solaris2.[0-5].*) ;; -+ *) -+ # The C++ compiler is used as linker so we must use $wl -+ # flag to pass the commands to the underlying system -+ # linker. We must also pass each convience library through -+ # to the system linker between allextract/defaultextract. -+ # The C++ compiler will combine linker options so we -+ # cannot just pass the convience library names through -+ # without $wl. -+ # Supported since Solaris 2.6 (maybe 2.5.1?) -+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' -+ ;; -+ esac -+ link_all_deplibs_CXX=yes -+ -+ output_verbose_link_cmd='echo' -+ -+ # Archives containing C++ object files must be created using -+ # "CC -xar", where "CC" is the Sun C++ compiler. This is -+ # necessary to make sure instantiated templates are included -+ # in the archive. -+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' -+ ;; -+ gcx*) -+ # Green Hills C++ Compiler -+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' -+ -+ # The C++ compiler must be used to create the archive. -+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' -+ ;; -+ *) -+ # GNU C++ compiler with Solaris linker -+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then -+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs' -+ if $CC --version | grep -v '^2\.7' > /dev/null; then -+ archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' -+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" -+ else -+ # g++ 2.7 appears to require `-G' NOT `-shared' on this -+ # platform. -+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' -+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' -+ -+ # Commands to make compiler produce verbose output that lists -+ # what "hidden" libraries, object files and flags are used when -+ # linking a shared library. -+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" -+ fi -+ -+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' -+ fi -+ ;; -+ esac -+ ;; -+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) -+ archive_cmds_need_lc_CXX=no -+ ;; -+ tandem*) -+ case $cc_basename in -+ NCC*) -+ # NonStop-UX NCC 3.20 -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ esac -+ ;; -+ vxworks*) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+ *) -+ # FIXME: insert proper C++ library support -+ ld_shlibs_CXX=no -+ ;; -+esac -+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -+echo "${ECHO_T}$ld_shlibs_CXX" >&6 -+test "$ld_shlibs_CXX" = no && can_build_shared=no -+ -+GCC_CXX="$GXX" -+LD_CXX="$LD" -+ -+ -+cat > conftest.$ac_ext <&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; then -+ # Parse the compiler output and extract the necessary -+ # objects, libraries and library flags. -+ -+ # Sentinel used to keep track of whether or not we are before -+ # the conftest object file. -+ pre_test_object_deps_done=no -+ -+ # The `*' in the case matches for architectures that use `case' in -+ # $output_verbose_cmd can trigger glob expansion during the loop -+ # eval without this substitution. -+ output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` -+ -+ for p in `eval $output_verbose_link_cmd`; do -+ case $p in -+ -+ -L* | -R* | -l*) -+ # Some compilers place space between "-{L,R}" and the path. -+ # Remove the space. -+ if test $p = "-L" \ -+ || test $p = "-R"; then -+ prev=$p -+ continue -+ else -+ prev= -+ fi -+ -+ if test "$pre_test_object_deps_done" = no; then -+ case $p in -+ -L* | -R*) -+ # Internal compiler library paths should come after those -+ # provided the user. The postdeps already come after the -+ # user supplied libs so there is no need to process them. -+ if test -z "$compiler_lib_search_path_CXX"; then -+ compiler_lib_search_path_CXX="${prev}${p}" -+ else -+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" -+ fi -+ ;; -+ # The "-l" case would never come before the object being -+ # linked, so don't bother handling this case. -+ esac -+ else -+ if test -z "$postdeps_CXX"; then -+ postdeps_CXX="${prev}${p}" -+ else -+ postdeps_CXX="${postdeps_CXX} ${prev}${p}" -+ fi -+ fi -+ ;; -+ -+ *.$objext) -+ # This assumes that the test object file only shows up -+ # once in the compiler output. -+ if test "$p" = "conftest.$objext"; then -+ pre_test_object_deps_done=yes -+ continue -+ fi -+ -+ if test "$pre_test_object_deps_done" = no; then -+ if test -z "$predep_objects_CXX"; then -+ predep_objects_CXX="$p" -+ else -+ predep_objects_CXX="$predep_objects_CXX $p" -+ fi -+ else -+ if test -z "$postdep_objects_CXX"; then -+ postdep_objects_CXX="$p" -+ else -+ postdep_objects_CXX="$postdep_objects_CXX $p" -+ fi -+ fi -+ ;; -+ -+ *) ;; # Ignore the rest. -+ -+ esac -+ done -+ -+ # Clean up. -+ rm -f a.out a.exe -+else -+ echo "libtool.m4: error: problem compiling CXX test program" -+fi -+ -+$rm -f confest.$objext -+ -+# PORTME: override above test on systems where it is broken -+case $host_os in -+solaris*) -+ case $cc_basename in -+ CC*) -+ # Adding this requires a known-good setup of shared libraries for -+ # Sun compiler versions before 5.6, else PIC objects from an old -+ # archive will be linked into the output, leading to subtle bugs. -+ postdeps_CXX='-lCstd -lCrun' -+ ;; -+ esac -+esac -+ -+ -+case " $postdeps_CXX " in -+*" -lc "*) archive_cmds_need_lc_CXX=no ;; -+esac -+ -+lt_prog_compiler_wl_CXX= -+lt_prog_compiler_pic_CXX= -+lt_prog_compiler_static_CXX= -+ -+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 -+ -+ # C++ specific cases for pic, static, wl, etc. -+ if test "$GXX" = yes; then -+ lt_prog_compiler_wl_CXX='-Wl,' -+ lt_prog_compiler_static_CXX='-static' -+ -+ case $host_os in -+ aix*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static_CXX='-Bstatic' -+ fi -+ ;; -+ amigaos*) -+ # FIXME: we need at least 68020 code to build shared libraries, but -+ # adding the `-m68020' flag to GCC prevents building anything better, -+ # like `-m68040'. -+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' -+ ;; -+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ # PIC is the default for these OSes. -+ ;; -+ mingw* | os2* | pw32*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT' -+ ;; -+ darwin* | rhapsody*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ lt_prog_compiler_pic_CXX='-fno-common' -+ ;; -+ *djgpp*) -+ # DJGPP does not support shared libraries at all -+ lt_prog_compiler_pic_CXX= -+ ;; -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ lt_prog_compiler_pic_CXX=-Kconform_pic -+ fi -+ ;; -+ hpux*) -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ ;; -+ *) -+ lt_prog_compiler_pic_CXX='-fPIC' -+ ;; -+ esac -+ ;; -+ *) -+ lt_prog_compiler_pic_CXX='-fPIC' -+ ;; -+ esac -+ else -+ case $host_os in -+ aix4* | aix5*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static_CXX='-Bstatic' -+ else -+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' -+ fi -+ ;; -+ chorus*) -+ case $cc_basename in -+ cxch68*) -+ # Green Hills C++ Compiler -+ # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" -+ ;; -+ esac -+ ;; -+ darwin*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ case $cc_basename in -+ xlc*) -+ lt_prog_compiler_pic_CXX='-qnocommon' -+ lt_prog_compiler_wl_CXX='-Wl,' -+ ;; -+ esac -+ ;; -+ dgux*) -+ case $cc_basename in -+ ec++*) -+ lt_prog_compiler_pic_CXX='-KPIC' -+ ;; -+ ghcx*) -+ # Green Hills C++ Compiler -+ lt_prog_compiler_pic_CXX='-pic' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ # FreeBSD uses GNU C++ -+ ;; -+ hpux9* | hpux10* | hpux11*) -+ case $cc_basename in -+ CC*) -+ lt_prog_compiler_wl_CXX='-Wl,' -+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" -+ if test "$host_cpu" != ia64; then -+ lt_prog_compiler_pic_CXX='+Z' -+ fi -+ ;; -+ aCC*) -+ lt_prog_compiler_wl_CXX='-Wl,' -+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ lt_prog_compiler_pic_CXX='+Z' -+ ;; -+ esac -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ irix5* | irix6* | nonstopux*) -+ case $cc_basename in -+ CC*) -+ lt_prog_compiler_wl_CXX='-Wl,' -+ lt_prog_compiler_static_CXX='-non_shared' -+ # CC pic flag -KPIC is the default. -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ linux*) -+ case $cc_basename in -+ KCC*) -+ # KAI C++ Compiler -+ lt_prog_compiler_wl_CXX='--backend -Wl,' -+ lt_prog_compiler_pic_CXX='-fPIC' -+ ;; -+ icpc* | ecpc*) -+ # Intel C++ -+ lt_prog_compiler_wl_CXX='-Wl,' -+ lt_prog_compiler_pic_CXX='-KPIC' -+ lt_prog_compiler_static_CXX='-static' -+ ;; -+ pgCC*) -+ # Portland Group C++ compiler. -+ lt_prog_compiler_wl_CXX='-Wl,' -+ lt_prog_compiler_pic_CXX='-fpic' -+ lt_prog_compiler_static_CXX='-Bstatic' -+ ;; -+ cxx*) -+ # Compaq C++ -+ # Make sure the PIC flag is empty. It appears that all Alpha -+ # Linux and Compaq Tru64 Unix objects are PIC. -+ lt_prog_compiler_pic_CXX= -+ lt_prog_compiler_static_CXX='-non_shared' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ lynxos*) -+ ;; -+ m88k*) -+ ;; -+ mvs*) -+ case $cc_basename in -+ cxx*) -+ lt_prog_compiler_pic_CXX='-W c,exportall' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ ;; -+ osf3* | osf4* | osf5*) -+ case $cc_basename in -+ KCC*) -+ lt_prog_compiler_wl_CXX='--backend -Wl,' -+ ;; -+ RCC*) -+ # Rational C++ 2.4.1 -+ lt_prog_compiler_pic_CXX='-pic' -+ ;; -+ cxx*) -+ # Digital/Compaq C++ -+ lt_prog_compiler_wl_CXX='-Wl,' -+ # Make sure the PIC flag is empty. It appears that all Alpha -+ # Linux and Compaq Tru64 Unix objects are PIC. -+ lt_prog_compiler_pic_CXX= -+ lt_prog_compiler_static_CXX='-non_shared' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ psos*) -+ ;; -+ sco*) -+ case $cc_basename in -+ CC*) -+ lt_prog_compiler_pic_CXX='-fPIC' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ solaris*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.2, 5.x and Centerline C++ -+ lt_prog_compiler_pic_CXX='-KPIC' -+ lt_prog_compiler_static_CXX='-Bstatic' -+ lt_prog_compiler_wl_CXX='-Qoption ld ' -+ ;; -+ gcx*) -+ # Green Hills C++ Compiler -+ lt_prog_compiler_pic_CXX='-PIC' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ sunos4*) -+ case $cc_basename in -+ CC*) -+ # Sun C++ 4.x -+ lt_prog_compiler_pic_CXX='-pic' -+ lt_prog_compiler_static_CXX='-Bstatic' -+ ;; -+ lcc*) -+ # Lucid -+ lt_prog_compiler_pic_CXX='-pic' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ tandem*) -+ case $cc_basename in -+ NCC*) -+ # NonStop-UX NCC 3.20 -+ lt_prog_compiler_pic_CXX='-KPIC' -+ ;; -+ *) -+ ;; -+ esac -+ ;; -+ unixware*) -+ ;; -+ vxworks*) -+ ;; -+ *) -+ lt_prog_compiler_can_build_shared_CXX=no -+ ;; -+ esac -+ fi -+ -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 -+ -+# -+# Check to make sure the PIC flag actually works. -+# -+if test -n "$lt_prog_compiler_pic_CXX"; then -+ -+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 -+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_prog_compiler_pic_works_CXX=no -+ ac_outfile=conftest.$ac_objext -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ # The option is referenced via a variable to avoid confusing sed. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:11334: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>conftest.err) -+ ac_status=$? -+ cat conftest.err >&5 -+ echo "$as_me:11338: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s "$ac_outfile"; then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings other than the usual output. -+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then -+ lt_prog_compiler_pic_works_CXX=yes -+ fi -+ fi -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 -+ -+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then -+ case $lt_prog_compiler_pic_CXX in -+ "" | " "*) ;; -+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; -+ esac -+else -+ lt_prog_compiler_pic_CXX= -+ lt_prog_compiler_can_build_shared_CXX=no -+fi -+ -+fi -+case $host_os in -+ # For platforms which do not support PIC, -DPIC is meaningless: -+ *djgpp*) -+ lt_prog_compiler_pic_CXX= -+ ;; -+ *) -+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_cv_prog_compiler_c_o_CXX=no -+ $rm -r conftest 2>/dev/null -+ mkdir conftest -+ cd conftest -+ mkdir out -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ lt_compiler_flag="-o out/conftest2.$ac_objext" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:11396: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>out/conftest.err) -+ ac_status=$? -+ cat out/conftest.err >&5 -+ echo "$as_me:11400: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s out/conftest2.$ac_objext -+ then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings -+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp -+ $SED '/^$/d' out/conftest.err >out/conftest.er2 -+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then -+ lt_cv_prog_compiler_c_o_CXX=yes -+ fi -+ fi -+ chmod u+w . 2>&5 -+ $rm conftest* -+ # SGI C++ compiler will create directory out/ii_files/ for -+ # template instantiation -+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files -+ $rm out/* && rmdir out -+ cd .. -+ rmdir conftest -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 -+ -+ -+hard_links="nottested" -+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then -+ # do not overwrite the value of need_locks provided by the user -+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 -+ hard_links=yes -+ $rm conftest* -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ touch conftest.a -+ ln conftest.a conftest.b 2>&5 || hard_links=no -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ echo "$as_me:$LINENO: result: $hard_links" >&5 -+echo "${ECHO_T}$hard_links" >&6 -+ if test "$hard_links" = no; then -+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} -+ need_locks=warn -+ fi -+else -+ need_locks=no -+fi -+ -+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -+ -+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ case $host_os in -+ aix4* | aix5*) -+ # If we're using GNU nm, then we don't want the "-C" option. -+ # -C means demangle to AIX nm, but means don't demangle with GNU nm -+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then -+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ else -+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ fi -+ ;; -+ pw32*) -+ export_symbols_cmds_CXX="$ltdll_cmds" -+ ;; -+ cygwin* | mingw*) -+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -+ ;; -+ linux*) -+ link_all_deplibs_CXX=no -+ ;; -+ *) -+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ ;; -+ esac -+ -+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -+echo "${ECHO_T}$ld_shlibs_CXX" >&6 -+test "$ld_shlibs_CXX" = no && can_build_shared=no -+ -+variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -+if test "$GCC" = yes; then -+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -+fi -+ -+# -+# Do we need to explicitly link libc? -+# -+case "x$archive_cmds_need_lc_CXX" in -+x|xyes) -+ # Assume -lc should be added -+ archive_cmds_need_lc_CXX=yes -+ -+ if test "$enable_shared" = yes && test "$GCC" = yes; then -+ case $archive_cmds_CXX in -+ *'~'*) -+ # FIXME: we may have to deal with multi-command sequences. -+ ;; -+ '$CC '*) -+ # Test whether the compiler implicitly links with -lc since on some -+ # systems, -lgcc has to come before -lc. If gcc already passes -lc -+ # to ld, don't add -lc before -lgcc. -+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 -+ $rm conftest* -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } 2>conftest.err; then -+ soname=conftest -+ lib=conftest -+ libobjs=conftest.$ac_objext -+ deplibs= -+ wl=$lt_prog_compiler_wl_CXX -+ compiler_flags=-v -+ linker_flags=-v -+ verstring= -+ output_objdir=. -+ libname=conftest -+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX -+ allow_undefined_flag_CXX= -+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 -+ (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+ then -+ archive_cmds_need_lc_CXX=no -+ else -+ archive_cmds_need_lc_CXX=yes -+ fi -+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag -+ else -+ cat conftest.err 1>&5 -+ fi -+ $rm conftest* -+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 -+ ;; -+ esac -+ fi -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -+library_names_spec= -+libname_spec='lib$name' -+soname_spec= -+shrext_cmds=".so" -+postinstall_cmds= -+postuninstall_cmds= -+finish_cmds= -+finish_eval= -+shlibpath_var= -+shlibpath_overrides_runpath=unknown -+version_type=none -+dynamic_linker="$host_os ld.so" -+sys_lib_dlsearch_path_spec="/lib /usr/lib" -+if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -+ # if the path contains ";" then we assume it to be the separator -+ # otherwise default to the standard path separator (i.e. ":") - it is -+ # assumed that no part of a normal pathname contains ";" but that should -+ # okay in the real world where ";" in dirpaths is itself problematic. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+else -+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -+fi -+need_lib_prefix=unknown -+hardcode_into_libs=no -+ -+# when you set need_version to no, make sure it does not cause -set_version -+# flags to be left without arguments -+need_version=unknown -+ -+case $host_os in -+aix3*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' -+ shlibpath_var=LIBPATH -+ -+ # AIX 3 has no versioning support, so we append a major version to the name. -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ -+aix4* | aix5*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ hardcode_into_libs=yes -+ if test "$host_cpu" = ia64; then -+ # AIX 5 supports IA64 -+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ else -+ # With GCC up to 2.95.x, collect2 would create an import file -+ # for dependence libraries. The import file would start with -+ # the line `#! .'. This would cause the generated library to -+ # depend on `.', always an invalid library. This was fixed in -+ # development snapshots of GCC prior to 3.0. -+ case $host_os in -+ aix4 | aix4.[01] | aix4.[01].*) -+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' -+ echo ' yes ' -+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then -+ : -+ else -+ can_build_shared=no -+ fi -+ ;; -+ esac -+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct -+ # soname into executable. Probably we can add versioning support to -+ # collect2, so additional links can be useful in future. -+ if test "$aix_use_runtimelinking" = yes; then -+ # If using run time linking (on AIX 4.2 or later) use lib.so -+ # instead of lib.a to let people know that these are not -+ # typical AIX shared libraries. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ else -+ # We preserve .a as extension for shared libraries through AIX4.2 -+ # and later when we are not doing run time linking. -+ library_names_spec='${libname}${release}.a $libname.a' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ fi -+ shlibpath_var=LIBPATH -+ fi -+ ;; -+ -+amigaos*) -+ library_names_spec='$libname.ixlibrary $libname.a' -+ # Create ${libname}_ixlibrary.a entries in /sys/libs. -+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' -+ ;; -+ -+beos*) -+ library_names_spec='${libname}${shared_ext}' -+ dynamic_linker="$host_os ld.so" -+ shlibpath_var=LIBRARY_PATH -+ ;; -+ -+bsdi[45]*) -+ version_type=linux -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -+ # the default ld.so.conf also contains /usr/contrib/lib and -+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -+ # libtool to hard-code these into programs -+ ;; -+ -+cygwin* | mingw* | pw32*) -+ version_type=windows -+ shrext_cmds=".dll" -+ need_version=no -+ need_lib_prefix=no -+ -+ case $GCC,$host_os in -+ yes,cygwin* | yes,mingw* | yes,pw32*) -+ library_names_spec='$libname.dll.a' -+ # DLL is installed to $(libdir)/../bin by postinstall_cmds -+ postinstall_cmds='base_file=`basename \${file}`~ -+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ -+ dldir=$destdir/`dirname \$dlpath`~ -+ test -d \$dldir || mkdir -p \$dldir~ -+ $install_prog $dir/$dlname \$dldir/$dlname~ -+ chmod a+x \$dldir/$dlname' -+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ -+ dlpath=$dir/\$dldll~ -+ $rm \$dlpath' -+ shlibpath_overrides_runpath=yes -+ -+ case $host_os in -+ cygwin*) -+ # Cygwin DLLs use 'cyg' prefix rather than 'lib' -+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" -+ ;; -+ mingw*) -+ # MinGW DLLs use traditional 'lib' prefix -+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then -+ # It is most probably a Windows format PATH printed by -+ # mingw gcc, but we are running on Cygwin. Gcc prints its search -+ # path with ; separators, and with drive letters. We can handle the -+ # drive letters (cygwin fileutils understands them), so leave them, -+ # especially as we might pass files found there to a mingw objdump, -+ # which wouldn't understand a cygwinified path. Ahh. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+ ;; -+ pw32*) -+ # pw32 DLLs use 'pw' prefix rather than 'lib' -+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ ;; -+ esac -+ ;; -+ -+ *) -+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' -+ ;; -+ esac -+ dynamic_linker='Win32 ld.exe' -+ # FIXME: first we should search . and the directory the executable is in -+ shlibpath_var=PATH -+ ;; -+ -+darwin* | rhapsody*) -+ dynamic_linker="$host_os dyld" -+ version_type=darwin -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' -+ soname_spec='${libname}${release}${major}$shared_ext' -+ shlibpath_overrides_runpath=yes -+ shlibpath_var=DYLD_LIBRARY_PATH -+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. -+ if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` -+ else -+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' -+ fi -+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' -+ ;; -+ -+dgux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+freebsd1*) -+ dynamic_linker=no -+ ;; -+ -+kfreebsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+freebsd* | dragonfly*) -+ # DragonFly does not have aout. When/if they implement a new -+ # versioning mechanism, adjust this. -+ if test -x /usr/bin/objformat; then -+ objformat=`/usr/bin/objformat` -+ else -+ case $host_os in -+ freebsd[123]*) objformat=aout ;; -+ *) objformat=elf ;; -+ esac -+ fi -+ version_type=freebsd-$objformat -+ case $version_type in -+ freebsd-elf*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' -+ need_version=no -+ need_lib_prefix=no -+ ;; -+ freebsd-*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' -+ need_version=yes -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_os in -+ freebsd2*) -+ shlibpath_overrides_runpath=yes -+ ;; -+ freebsd3.[01]* | freebsdelf3.[01]*) -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ *) # from 3.2 on -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ ;; -+ esac -+ ;; -+ -+gnu*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ hardcode_into_libs=yes -+ ;; -+ -+hpux9* | hpux10* | hpux11*) -+ # Give a soname corresponding to the major version so that dld.sl refuses to -+ # link against other versions. -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ case $host_cpu in -+ ia64*) -+ shrext_cmds='.so' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.so" -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ if test "X$HPUX_IA64_MODE" = X32; then -+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" -+ else -+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" -+ fi -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ hppa*64*) -+ shrext_cmds='.sl' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ *) -+ shrext_cmds='.sl' -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=SHLIB_PATH -+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ esac -+ # HP-UX runs *really* slowly unless shared libraries are mode 555. -+ postinstall_cmds='chmod 555 $lib' -+ ;; -+ -+irix5* | irix6* | nonstopux*) -+ case $host_os in -+ nonstopux*) version_type=nonstopux ;; -+ *) -+ if test "$lt_cv_prog_gnu_ld" = yes; then -+ version_type=linux -+ else -+ version_type=irix -+ fi ;; -+ esac -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' -+ case $host_os in -+ irix5* | nonstopux*) -+ libsuff= shlibsuff= -+ ;; -+ *) -+ case $LD in # libtool.m4 will add one of these switches to LD -+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") -+ libsuff= shlibsuff= libmagic=32-bit;; -+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") -+ libsuff=32 shlibsuff=N32 libmagic=N32;; -+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") -+ libsuff=64 shlibsuff=64 libmagic=64-bit;; -+ *) libsuff= shlibsuff= libmagic=never-match;; -+ esac -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -+ hardcode_into_libs=yes -+ ;; -+ -+# No shared lib support for Linux oldld, aout, or coff. -+linux*oldld* | linux*aout* | linux*coff*) -+ dynamic_linker=no -+ ;; -+ -+# This must be Linux ELF. -+linux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ # This implies no fast_install, which is unacceptable. -+ # Some rework will be needed to allow for fast_install -+ # before this can be enabled. -+ hardcode_into_libs=yes -+ -+ # Append ld.so.conf contents to the search path -+ if test -f /etc/ld.so.conf; then -+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -+ fi -+ -+ # We used to test for /lib/ld.so.1 and disable shared libraries on -+ # powerpc, because MkLinux only supported shared libraries with the -+ # GNU dynamic linker. Since this was broken with cross compilers, -+ # most powerpc-linux boxes support dynamic linking these days and -+ # people can always --disable-shared, the test was removed, and we -+ # assume the GNU/Linux dynamic linker is in use. -+ dynamic_linker='GNU/Linux ld.so' -+ ;; -+ -+netbsdelf*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='NetBSD ld.elf_so' -+ ;; -+ -+knetbsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+netbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ dynamic_linker='NetBSD (a.out) ld.so' -+ else -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ dynamic_linker='NetBSD ld.elf_so' -+ fi -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ -+newsos6) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+nto-qnx*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+openbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. -+ case $host_os in -+ openbsd3.3 | openbsd3.3.*) need_version=yes ;; -+ *) need_version=no ;; -+ esac -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ case $host_os in -+ openbsd2.[89] | openbsd2.[89].*) -+ shlibpath_overrides_runpath=no -+ ;; -+ *) -+ shlibpath_overrides_runpath=yes -+ ;; -+ esac -+ else -+ shlibpath_overrides_runpath=yes -+ fi -+ ;; -+ -+os2*) -+ libname_spec='$name' -+ shrext_cmds=".dll" -+ need_lib_prefix=no -+ library_names_spec='$libname${shared_ext} $libname.a' -+ dynamic_linker='OS/2 ld.exe' -+ shlibpath_var=LIBPATH -+ ;; -+ -+osf3* | osf4* | osf5*) -+ version_type=osf -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -+ ;; -+ -+sco3.2v5*) -+ version_type=osf -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+solaris*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ # ldd complains unless libraries are executable -+ postinstall_cmds='chmod +x $lib' -+ ;; -+ -+sunos4*) -+ version_type=sunos -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ if test "$with_gnu_ld" = yes; then -+ need_lib_prefix=no -+ fi -+ need_version=yes -+ ;; -+ -+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_vendor in -+ sni) -+ shlibpath_overrides_runpath=no -+ need_lib_prefix=no -+ export_dynamic_flag_spec='${wl}-Blargedynsym' -+ runpath_var=LD_RUN_PATH -+ ;; -+ siemens) -+ need_lib_prefix=no -+ ;; -+ motorola) -+ need_lib_prefix=no -+ need_version=no -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -+ ;; -+ esac -+ ;; -+ -+sysv4*MP*) -+ if test -d /usr/nec ;then -+ version_type=linux -+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' -+ soname_spec='$libname${shared_ext}.$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ fi -+ ;; -+ -+uts4*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+*) -+ dynamic_linker=no -+ ;; -+esac -+echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -+echo "${ECHO_T}$dynamic_linker" >&6 -+test "$dynamic_linker" = no && can_build_shared=no -+ -+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -+hardcode_action_CXX= -+if test -n "$hardcode_libdir_flag_spec_CXX" || \ -+ test -n "$runpath_var_CXX" || \ -+ test "X$hardcode_automatic_CXX" = "Xyes" ; then -+ -+ # We can hardcode non-existant directories. -+ if test "$hardcode_direct_CXX" != no && -+ # If the only mechanism to avoid hardcoding is shlibpath_var, we -+ # have to relink, otherwise we might link with an installed library -+ # when we should be linking with a yet-to-be-installed one -+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && -+ test "$hardcode_minus_L_CXX" != no; then -+ # Linking always hardcodes the temporary library directory. -+ hardcode_action_CXX=relink -+ else -+ # We can link without hardcoding, and we can hardcode nonexisting dirs. -+ hardcode_action_CXX=immediate -+ fi -+else -+ # We cannot hardcode anything, or else we can only hardcode existing -+ # directories. -+ hardcode_action_CXX=unsupported -+fi -+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -+echo "${ECHO_T}$hardcode_action_CXX" >&6 -+ -+if test "$hardcode_action_CXX" = relink; then -+ # Fast installation is not supported -+ enable_fast_install=no -+elif test "$shlibpath_overrides_runpath" = yes || -+ test "$enable_shared" = no; then -+ # Fast installation is not necessary -+ enable_fast_install=needless -+fi -+ -+striplib= -+old_striplib= -+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then -+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -+ test -z "$striplib" && striplib="$STRIP --strip-unneeded" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+else -+# FIXME - insert some real tests, host_os isn't really good enough -+ case $host_os in -+ darwin*) -+ if test -n "$STRIP" ; then -+ striplib="$STRIP -x" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+ else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ ;; -+ *) -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+ ;; -+ esac -+fi -+ -+if test "x$enable_dlopen" != xyes; then -+ enable_dlopen=unknown -+ enable_dlopen_self=unknown -+ enable_dlopen_self_static=unknown -+else -+ lt_cv_dlopen=no -+ lt_cv_dlopen_libs= -+ -+ case $host_os in -+ beos*) -+ lt_cv_dlopen="load_add_on" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ ;; -+ -+ mingw* | pw32*) -+ lt_cv_dlopen="LoadLibrary" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ cygwin*) -+ lt_cv_dlopen="dlopen" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ darwin*) -+ # if libdl is installed we need to link against it -+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -+if test "${ac_cv_lib_dl_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldl $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dl_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dl_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -+if test $ac_cv_lib_dl_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -+else -+ -+ lt_cv_dlopen="dyld" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ -+fi -+ -+ ;; -+ -+ *) -+ echo "$as_me:$LINENO: checking for shl_load" >&5 -+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -+if test "${ac_cv_func_shl_load+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define shl_load to an innocuous variant, in case declares shl_load. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define shl_load innocuous_shl_load -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char shl_load (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef shl_load -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char shl_load (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_shl_load) || defined (__stub___shl_load) -+choke me -+#else -+char (*f) () = shl_load; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != shl_load; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_func_shl_load=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_func_shl_load=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -+echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -+if test $ac_cv_func_shl_load = yes; then -+ lt_cv_dlopen="shl_load" -+else -+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -+if test "${ac_cv_lib_dld_shl_load+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char shl_load (); -+int -+main () -+{ -+shl_load (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dld_shl_load=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dld_shl_load=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -+if test $ac_cv_lib_dld_shl_load = yes; then -+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -+else -+ echo "$as_me:$LINENO: checking for dlopen" >&5 -+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -+if test "${ac_cv_func_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define dlopen to an innocuous variant, in case declares dlopen. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define dlopen innocuous_dlopen -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char dlopen (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef dlopen -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_dlopen) || defined (__stub___dlopen) -+choke me -+#else -+char (*f) () = dlopen; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != dlopen; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_func_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_func_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -+if test $ac_cv_func_dlopen = yes; then -+ lt_cv_dlopen="dlopen" -+else -+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -+if test "${ac_cv_lib_dl_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldl $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dl_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dl_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -+if test $ac_cv_lib_dl_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -+else -+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -+if test "${ac_cv_lib_svld_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lsvld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_svld_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_svld_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -+if test $ac_cv_lib_svld_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -+else -+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -+if test "${ac_cv_lib_dld_dld_link+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dld_link (); -+int -+main () -+{ -+dld_link (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dld_dld_link=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dld_dld_link=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -+if test $ac_cv_lib_dld_dld_link = yes; then -+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ ;; -+ esac -+ -+ if test "x$lt_cv_dlopen" != xno; then -+ enable_dlopen=yes -+ else -+ enable_dlopen=no -+ fi -+ -+ case $lt_cv_dlopen in -+ dlopen) -+ save_CPPFLAGS="$CPPFLAGS" -+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -+ -+ save_LDFLAGS="$LDFLAGS" -+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -+ -+ save_LIBS="$LIBS" -+ LIBS="$lt_cv_dlopen_libs $LIBS" -+ -+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -+if test "${lt_cv_dlopen_self+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ lt_cv_dlopen_self=cross -+else -+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -+ lt_status=$lt_dlunknown -+ cat > conftest.$ac_ext < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LT_DLGLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LT_DLGLOBAL DL_GLOBAL -+# else -+# define LT_DLGLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LT_DLLAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LT_DLLAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LT_DLLAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LT_DLLAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LT_DLLAZY_OR_NOW DL_NOW -+# else -+# define LT_DLLAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+#ifdef __cplusplus -+extern "C" void exit (int); -+#endif -+ -+void fnord() { int i=42;} -+int main () -+{ -+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -+ int status = $lt_dlunknown; -+ -+ if (self) -+ { -+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -+ /* dlclose (self); */ -+ } -+ -+ exit (status); -+} -+EOF -+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -+ (./conftest; exit; ) >&5 2>/dev/null -+ lt_status=$? -+ case x$lt_status in -+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; -+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; -+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;; -+ esac -+ else : -+ # compilation failed -+ lt_cv_dlopen_self=no -+ fi -+fi -+rm -fr conftest* -+ -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -+echo "${ECHO_T}$lt_cv_dlopen_self" >&6 -+ -+ if test "x$lt_cv_dlopen_self" = xyes; then -+ LDFLAGS="$LDFLAGS $link_static_flag" -+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -+if test "${lt_cv_dlopen_self_static+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ lt_cv_dlopen_self_static=cross -+else -+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -+ lt_status=$lt_dlunknown -+ cat > conftest.$ac_ext < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LT_DLGLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LT_DLGLOBAL DL_GLOBAL -+# else -+# define LT_DLGLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LT_DLLAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LT_DLLAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LT_DLLAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LT_DLLAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LT_DLLAZY_OR_NOW DL_NOW -+# else -+# define LT_DLLAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+#ifdef __cplusplus -+extern "C" void exit (int); -+#endif -+ -+void fnord() { int i=42;} -+int main () -+{ -+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -+ int status = $lt_dlunknown; -+ -+ if (self) -+ { -+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -+ /* dlclose (self); */ -+ } -+ -+ exit (status); -+} -+EOF -+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -+ (./conftest; exit; ) >&5 2>/dev/null -+ lt_status=$? -+ case x$lt_status in -+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; -+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; -+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; -+ esac -+ else : -+ # compilation failed -+ lt_cv_dlopen_self_static=no -+ fi -+fi -+rm -fr conftest* -+ -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 -+ fi -+ -+ CPPFLAGS="$save_CPPFLAGS" -+ LDFLAGS="$save_LDFLAGS" -+ LIBS="$save_LIBS" -+ ;; -+ esac -+ -+ case $lt_cv_dlopen_self in -+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; -+ *) enable_dlopen_self=unknown ;; -+ esac -+ -+ case $lt_cv_dlopen_self_static in -+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; -+ *) enable_dlopen_self_static=unknown ;; -+ esac -+fi -+ -+ -+# The else clause should only fire when bootstrapping the -+# libtool distribution, otherwise you forgot to ship ltmain.sh -+# with your package, and you will get complaints that there are -+# no rules to generate ltmain.sh. -+if test -f "$ltmain"; then -+ # See if we are running on zsh, and set the options which allow our commands through -+ # without removal of \ escapes. -+ if test -n "${ZSH_VERSION+set}" ; then -+ setopt NO_GLOB_SUBST -+ fi -+ # Now quote all the things that may contain metacharacters while being -+ # careful not to overquote the AC_SUBSTed values. We take copies of the -+ # variables and quote the copies for generation of the libtool script. -+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ -+ SED SHELL STRIP \ -+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ -+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ -+ deplibs_check_method reload_flag reload_cmds need_locks \ -+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ -+ lt_cv_sys_global_symbol_to_c_name_address \ -+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -+ old_postinstall_cmds old_postuninstall_cmds \ -+ compiler_CXX \ -+ CC_CXX \ -+ LD_CXX \ -+ lt_prog_compiler_wl_CXX \ -+ lt_prog_compiler_pic_CXX \ -+ lt_prog_compiler_static_CXX \ -+ lt_prog_compiler_no_builtin_flag_CXX \ -+ export_dynamic_flag_spec_CXX \ -+ thread_safe_flag_spec_CXX \ -+ whole_archive_flag_spec_CXX \ -+ enable_shared_with_static_runtimes_CXX \ -+ old_archive_cmds_CXX \ -+ old_archive_from_new_cmds_CXX \ -+ predep_objects_CXX \ -+ postdep_objects_CXX \ -+ predeps_CXX \ -+ postdeps_CXX \ -+ compiler_lib_search_path_CXX \ -+ archive_cmds_CXX \ -+ archive_expsym_cmds_CXX \ -+ postinstall_cmds_CXX \ -+ postuninstall_cmds_CXX \ -+ old_archive_from_expsyms_cmds_CXX \ -+ allow_undefined_flag_CXX \ -+ no_undefined_flag_CXX \ -+ export_symbols_cmds_CXX \ -+ hardcode_libdir_flag_spec_CXX \ -+ hardcode_libdir_flag_spec_ld_CXX \ -+ hardcode_libdir_separator_CXX \ -+ hardcode_automatic_CXX \ -+ module_cmds_CXX \ -+ module_expsym_cmds_CXX \ -+ lt_cv_prog_compiler_c_o_CXX \ -+ exclude_expsyms_CXX \ -+ include_expsyms_CXX; do -+ -+ case $var in -+ old_archive_cmds_CXX | \ -+ old_archive_from_new_cmds_CXX | \ -+ archive_cmds_CXX | \ -+ archive_expsym_cmds_CXX | \ -+ module_cmds_CXX | \ -+ module_expsym_cmds_CXX | \ -+ old_archive_from_expsyms_cmds_CXX | \ -+ export_symbols_cmds_CXX | \ -+ extract_expsyms_cmds | reload_cmds | finish_cmds | \ -+ postinstall_cmds | postuninstall_cmds | \ -+ old_postinstall_cmds | old_postuninstall_cmds | \ -+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) -+ # Double-quote double-evaled strings. -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" -+ ;; -+ *) -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -+ ;; -+ esac -+ done -+ -+ case $lt_echo in -+ *'\$0 --fallback-echo"') -+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` -+ ;; -+ esac -+ -+cfgfile="$ofile" -+ -+ cat <<__EOF__ >> "$cfgfile" -+# ### BEGIN LIBTOOL TAG CONFIG: $tagname -+ -+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -+ -+# Shell to use when invoking shell scripts. -+SHELL=$lt_SHELL -+ -+# Whether or not to build shared libraries. -+build_libtool_libs=$enable_shared -+ -+# Whether or not to build static libraries. -+build_old_libs=$enable_static -+ -+# Whether or not to add -lc for building shared libraries. -+build_libtool_need_lc=$archive_cmds_need_lc_CXX -+ -+# Whether or not to disallow shared libs when runtime libs are static -+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX -+ -+# Whether or not to optimize for fast installation. -+fast_install=$enable_fast_install -+ -+# The host system. -+host_alias=$host_alias -+host=$host -+host_os=$host_os -+ -+# The build system. -+build_alias=$build_alias -+build=$build -+build_os=$build_os -+ -+# An echo program that does not interpret backslashes. -+echo=$lt_echo -+ -+# The archiver. -+AR=$lt_AR -+AR_FLAGS=$lt_AR_FLAGS -+ -+# A C compiler. -+LTCC=$lt_LTCC -+ -+# A language-specific compiler. -+CC=$lt_compiler_CXX -+ -+# Is the compiler the GNU C compiler? -+with_gcc=$GCC_CXX -+ -+# An ERE matcher. -+EGREP=$lt_EGREP -+ -+# The linker used to build libraries. -+LD=$lt_LD_CXX -+ -+# Whether we need hard or soft links. -+LN_S=$lt_LN_S -+ -+# A BSD-compatible nm program. -+NM=$lt_NM -+ -+# A symbol stripping program -+STRIP=$lt_STRIP -+ -+# Used to examine libraries when file_magic_cmd begins "file" -+MAGIC_CMD=$MAGIC_CMD -+ -+# Used on cygwin: DLL creation program. -+DLLTOOL="$DLLTOOL" -+ -+# Used on cygwin: object dumper. -+OBJDUMP="$OBJDUMP" -+ -+# Used on cygwin: assembler. -+AS="$AS" -+ -+# The name of the directory that contains temporary libtool files. -+objdir=$objdir -+ -+# How to create reloadable object files. -+reload_flag=$lt_reload_flag -+reload_cmds=$lt_reload_cmds -+ -+# How to pass a linker flag through the compiler. -+wl=$lt_lt_prog_compiler_wl_CXX -+ -+# Object file suffix (normally "o"). -+objext="$ac_objext" -+ -+# Old archive suffix (normally "a"). -+libext="$libext" -+ -+# Shared library suffix (normally ".so"). -+shrext_cmds='$shrext_cmds' -+ -+# Executable file suffix (normally ""). -+exeext="$exeext" -+ -+# Additional compiler flags for building library objects. -+pic_flag=$lt_lt_prog_compiler_pic_CXX -+pic_mode=$pic_mode -+ -+# What is the maximum length of a command? -+max_cmd_len=$lt_cv_sys_max_cmd_len -+ -+# Does compiler simultaneously support -c and -o options? -+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX -+ -+# Must we lock files when doing compilation? -+need_locks=$lt_need_locks -+ -+# Do we need the lib prefix for modules? -+need_lib_prefix=$need_lib_prefix -+ -+# Do we need a version for libraries? -+need_version=$need_version -+ -+# Whether dlopen is supported. -+dlopen_support=$enable_dlopen -+ -+# Whether dlopen of programs is supported. -+dlopen_self=$enable_dlopen_self -+ -+# Whether dlopen of statically linked programs is supported. -+dlopen_self_static=$enable_dlopen_self_static -+ -+# Compiler flag to prevent dynamic linking. -+link_static_flag=$lt_lt_prog_compiler_static_CXX -+ -+# Compiler flag to turn off builtin functions. -+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -+ -+# Compiler flag to allow reflexive dlopens. -+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX -+ -+# Compiler flag to generate shared objects directly from archives. -+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX -+ -+# Compiler flag to generate thread-safe objects. -+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX -+ -+# Library versioning type. -+version_type=$version_type -+ -+# Format of library name prefix. -+libname_spec=$lt_libname_spec -+ -+# List of archive names. First name is the real one, the rest are links. -+# The last name is the one that the linker finds with -lNAME. -+library_names_spec=$lt_library_names_spec -+ -+# The coded name of the library, if different from the real name. -+soname_spec=$lt_soname_spec -+ -+# Commands used to build and install an old-style archive. -+RANLIB=$lt_RANLIB -+old_archive_cmds=$lt_old_archive_cmds_CXX -+old_postinstall_cmds=$lt_old_postinstall_cmds -+old_postuninstall_cmds=$lt_old_postuninstall_cmds -+ -+# Create an old-style archive from a shared archive. -+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX -+ -+# Create a temporary old-style archive to link instead of a shared archive. -+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX -+ -+# Commands used to build and install a shared archive. -+archive_cmds=$lt_archive_cmds_CXX -+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -+postinstall_cmds=$lt_postinstall_cmds -+postuninstall_cmds=$lt_postuninstall_cmds -+ -+# Commands used to build a loadable module (assumed same as above if empty) -+module_cmds=$lt_module_cmds_CXX -+module_expsym_cmds=$lt_module_expsym_cmds_CXX -+ -+# Commands to strip libraries. -+old_striplib=$lt_old_striplib -+striplib=$lt_striplib -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predep_objects=$lt_predep_objects_CXX -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdep_objects=$lt_postdep_objects_CXX -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predeps=$lt_predeps_CXX -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdeps=$lt_postdeps_CXX -+ -+# The library search path used internally by the compiler when linking -+# a shared library. -+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX -+ -+# Method to check whether dependent libraries are shared objects. -+deplibs_check_method=$lt_deplibs_check_method -+ -+# Command to use when deplibs_check_method == file_magic. -+file_magic_cmd=$lt_file_magic_cmd -+ -+# Flag that allows shared libraries with undefined symbols to be built. -+allow_undefined_flag=$lt_allow_undefined_flag_CXX -+ -+# Flag that forces no undefined symbols. -+no_undefined_flag=$lt_no_undefined_flag_CXX -+ -+# Commands used to finish a libtool library installation in a directory. -+finish_cmds=$lt_finish_cmds -+ -+# Same as above, but a single script fragment to be evaled but not shown. -+finish_eval=$lt_finish_eval -+ -+# Take the output of nm and produce a listing of raw symbols and C names. -+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -+ -+# Transform the output of nm in a proper C declaration -+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -+ -+# Transform the output of nm in a C name address pair -+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -+ -+# This is the shared library runtime path variable. -+runpath_var=$runpath_var -+ -+# This is the shared library path variable. -+shlibpath_var=$shlibpath_var -+ -+# Is shlibpath searched before the hard-coded library search path? -+shlibpath_overrides_runpath=$shlibpath_overrides_runpath -+ -+# How to hardcode a shared library path into an executable. -+hardcode_action=$hardcode_action_CXX -+ -+# Whether we should hardcode library paths into libraries. -+hardcode_into_libs=$hardcode_into_libs -+ -+# Flag to hardcode \$libdir into a binary during linking. -+# This must work even if \$libdir does not exist. -+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX -+ -+# If ld is used when linking, flag to hardcode \$libdir into -+# a binary during linking. This must work even if \$libdir does -+# not exist. -+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX -+ -+# Whether we need a single -rpath flag with a separated argument. -+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX -+ -+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -+# resulting binary. -+hardcode_direct=$hardcode_direct_CXX -+ -+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -+# resulting binary. -+hardcode_minus_L=$hardcode_minus_L_CXX -+ -+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -+# the resulting binary. -+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX -+ -+# Set to yes if building a shared library automatically hardcodes DIR into the library -+# and all subsequent libraries and executables linked against it. -+hardcode_automatic=$hardcode_automatic_CXX -+ -+# Variables whose values should be saved in libtool wrapper scripts and -+# restored at relink time. -+variables_saved_for_relink="$variables_saved_for_relink" -+ -+# Whether libtool must link a program against all its dependency libraries. -+link_all_deplibs=$link_all_deplibs_CXX -+ -+# Compile-time system search path for libraries -+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -+ -+# Run-time system search path for libraries -+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -+ -+# Fix the shell variable \$srcfile for the compiler. -+fix_srcfile_path="$fix_srcfile_path_CXX" -+ -+# Set to yes if exported symbols are required. -+always_export_symbols=$always_export_symbols_CXX -+ -+# The commands to list exported symbols. -+export_symbols_cmds=$lt_export_symbols_cmds_CXX -+ -+# The commands to extract the exported symbol list from a shared archive. -+extract_expsyms_cmds=$lt_extract_expsyms_cmds -+ -+# Symbols that should not be listed in the preloaded symbols. -+exclude_expsyms=$lt_exclude_expsyms_CXX -+ -+# Symbols that must always be exported. -+include_expsyms=$lt_include_expsyms_CXX -+ -+# ### END LIBTOOL TAG CONFIG: $tagname -+ -+__EOF__ -+ -+ -+else -+ # If there is no Makefile yet, we rely on a make rule to execute -+ # `config.status --recheck' to rerun these tests and create the -+ # libtool script then. -+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` -+ if test -f "$ltmain_in"; then -+ test -f Makefile && make "$ltmain" -+ fi -+fi -+ -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+CC=$lt_save_CC -+LDCXX=$LD -+LD=$lt_save_LD -+GCC=$lt_save_GCC -+with_gnu_ldcxx=$with_gnu_ld -+with_gnu_ld=$lt_save_with_gnu_ld -+lt_cv_path_LDCXX=$lt_cv_path_LD -+lt_cv_path_LD=$lt_save_path_LD -+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -+ -+ else -+ tagname="" -+ fi -+ ;; -+ -+ F77) -+ if test -n "$F77" && test "X$F77" != "Xno"; then -+ -+ac_ext=f -+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_f77_compiler_gnu -+ -+ -+archive_cmds_need_lc_F77=no -+allow_undefined_flag_F77= -+always_export_symbols_F77=no -+archive_expsym_cmds_F77= -+export_dynamic_flag_spec_F77= -+hardcode_direct_F77=no -+hardcode_libdir_flag_spec_F77= -+hardcode_libdir_flag_spec_ld_F77= -+hardcode_libdir_separator_F77= -+hardcode_minus_L_F77=no -+hardcode_automatic_F77=no -+module_cmds_F77= -+module_expsym_cmds_F77= -+link_all_deplibs_F77=unknown -+old_archive_cmds_F77=$old_archive_cmds -+no_undefined_flag_F77= -+whole_archive_flag_spec_F77= -+enable_shared_with_static_runtimes_F77=no -+ -+# Source file extension for f77 test sources. -+ac_ext=f -+ -+# Object file extension for compiled f77 test sources. -+objext=o -+objext_F77=$objext -+ -+# Code to be used in simple compile tests -+lt_simple_compile_test_code=" subroutine t\n return\n end\n" -+ -+# Code to be used in simple link tests -+lt_simple_link_test_code=" program t\n end\n" -+ -+# ltmain only uses $CC for tagged configurations so make sure $CC is set. -+ -+# If no C compiler was specified, use CC. -+LTCC=${LTCC-"$CC"} -+ -+# Allow CC to be a program name with arguments. -+compiler=$CC -+ -+ -+# save warnings/boilerplate of simple test code -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_compile_test_code" >conftest.$ac_ext -+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_compiler_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_link_test_code" >conftest.$ac_ext -+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_linker_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ -+# Allow CC to be a program name with arguments. -+lt_save_CC="$CC" -+CC=${F77-"f77"} -+compiler=$CC -+compiler_F77=$CC -+for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+ -+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -+echo "$as_me:$LINENO: result: $can_build_shared" >&5 -+echo "${ECHO_T}$can_build_shared" >&6 -+ -+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -+test "$can_build_shared" = "no" && enable_shared=no -+ -+# On AIX, shared libraries and static libraries use the same namespace, and -+# are all built from PIC. -+case $host_os in -+aix3*) -+ test "$enable_shared" = yes && enable_static=no -+ if test -n "$RANLIB"; then -+ archive_cmds="$archive_cmds~\$RANLIB \$lib" -+ postinstall_cmds='$RANLIB $lib' -+ fi -+ ;; -+aix4* | aix5*) -+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then -+ test "$enable_shared" = yes && enable_static=no -+ fi -+ ;; -+esac -+echo "$as_me:$LINENO: result: $enable_shared" >&5 -+echo "${ECHO_T}$enable_shared" >&6 -+ -+echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -+# Make sure either enable_shared or enable_static is yes. -+test "$enable_shared" = yes || enable_static=yes -+echo "$as_me:$LINENO: result: $enable_static" >&5 -+echo "${ECHO_T}$enable_static" >&6 -+ -+test "$ld_shlibs_F77" = no && can_build_shared=no -+ -+GCC_F77="$G77" -+LD_F77="$LD" -+ -+lt_prog_compiler_wl_F77= -+lt_prog_compiler_pic_F77= -+lt_prog_compiler_static_F77= -+ -+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 -+ -+ if test "$GCC" = yes; then -+ lt_prog_compiler_wl_F77='-Wl,' -+ lt_prog_compiler_static_F77='-static' -+ -+ case $host_os in -+ aix*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static_F77='-Bstatic' -+ fi -+ ;; -+ -+ amigaos*) -+ # FIXME: we need at least 68020 code to build shared libraries, but -+ # adding the `-m68020' flag to GCC prevents building anything better, -+ # like `-m68040'. -+ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' -+ ;; -+ -+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ # PIC is the default for these OSes. -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ lt_prog_compiler_pic_F77='-DDLL_EXPORT' -+ ;; -+ -+ darwin* | rhapsody*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ lt_prog_compiler_pic_F77='-fno-common' -+ ;; -+ -+ msdosdjgpp*) -+ # Just because we use GCC doesn't mean we suddenly get shared libraries -+ # on systems that don't support them. -+ lt_prog_compiler_can_build_shared_F77=no -+ enable_shared=no -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ lt_prog_compiler_pic_F77=-Kconform_pic -+ fi -+ ;; -+ -+ hpux*) -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ lt_prog_compiler_pic_F77='-fPIC' -+ ;; -+ esac -+ ;; -+ -+ *) -+ lt_prog_compiler_pic_F77='-fPIC' -+ ;; -+ esac -+ else -+ # PORTME Check for flag to pass linker flags through the system compiler. -+ case $host_os in -+ aix*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static_F77='-Bstatic' -+ else -+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' -+ fi -+ ;; -+ darwin*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ case $cc_basename in -+ xlc*) -+ lt_prog_compiler_pic_F77='-qnocommon' -+ lt_prog_compiler_wl_F77='-Wl,' -+ ;; -+ esac -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ lt_prog_compiler_pic_F77='-DDLL_EXPORT' -+ ;; -+ -+ hpux9* | hpux10* | hpux11*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ lt_prog_compiler_pic_F77='+Z' -+ ;; -+ esac -+ # Is there a better lt_prog_compiler_static that works with the bundled CC? -+ lt_prog_compiler_static_F77='${wl}-a ${wl}archive' -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ # PIC (with -KPIC) is the default. -+ lt_prog_compiler_static_F77='-non_shared' -+ ;; -+ -+ newsos6) -+ lt_prog_compiler_pic_F77='-KPIC' -+ lt_prog_compiler_static_F77='-Bstatic' -+ ;; -+ -+ linux*) -+ case $cc_basename in -+ icc* | ecc*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ lt_prog_compiler_pic_F77='-KPIC' -+ lt_prog_compiler_static_F77='-static' -+ ;; -+ pgcc* | pgf77* | pgf90* | pgf95*) -+ # Portland Group compilers (*not* the Pentium gcc compiler, -+ # which looks to be a dead project) -+ lt_prog_compiler_wl_F77='-Wl,' -+ lt_prog_compiler_pic_F77='-fpic' -+ lt_prog_compiler_static_F77='-Bstatic' -+ ;; -+ ccc*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ # All Alpha code is PIC. -+ lt_prog_compiler_static_F77='-non_shared' -+ ;; -+ esac -+ ;; -+ -+ osf3* | osf4* | osf5*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ # All OSF/1 code is PIC. -+ lt_prog_compiler_static_F77='-non_shared' -+ ;; -+ -+ sco3.2v5*) -+ lt_prog_compiler_pic_F77='-Kpic' -+ lt_prog_compiler_static_F77='-dn' -+ ;; -+ -+ solaris*) -+ lt_prog_compiler_pic_F77='-KPIC' -+ lt_prog_compiler_static_F77='-Bstatic' -+ case $cc_basename in -+ f77* | f90* | f95*) -+ lt_prog_compiler_wl_F77='-Qoption ld ';; -+ *) -+ lt_prog_compiler_wl_F77='-Wl,';; -+ esac -+ ;; -+ -+ sunos4*) -+ lt_prog_compiler_wl_F77='-Qoption ld ' -+ lt_prog_compiler_pic_F77='-PIC' -+ lt_prog_compiler_static_F77='-Bstatic' -+ ;; -+ -+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ lt_prog_compiler_pic_F77='-KPIC' -+ lt_prog_compiler_static_F77='-Bstatic' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec ;then -+ lt_prog_compiler_pic_F77='-Kconform_pic' -+ lt_prog_compiler_static_F77='-Bstatic' -+ fi -+ ;; -+ -+ unicos*) -+ lt_prog_compiler_wl_F77='-Wl,' -+ lt_prog_compiler_can_build_shared_F77=no -+ ;; -+ -+ uts4*) -+ lt_prog_compiler_pic_F77='-pic' -+ lt_prog_compiler_static_F77='-Bstatic' -+ ;; -+ -+ *) -+ lt_prog_compiler_can_build_shared_F77=no -+ ;; -+ esac -+ fi -+ -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 -+ -+# -+# Check to make sure the PIC flag actually works. -+# -+if test -n "$lt_prog_compiler_pic_F77"; then -+ -+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 -+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_prog_compiler_pic_works_F77=no -+ ac_outfile=conftest.$ac_objext -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ lt_compiler_flag="$lt_prog_compiler_pic_F77" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ # The option is referenced via a variable to avoid confusing sed. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:13764: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>conftest.err) -+ ac_status=$? -+ cat conftest.err >&5 -+ echo "$as_me:13768: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s "$ac_outfile"; then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings other than the usual output. -+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then -+ lt_prog_compiler_pic_works_F77=yes -+ fi -+ fi -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 -+ -+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then -+ case $lt_prog_compiler_pic_F77 in -+ "" | " "*) ;; -+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; -+ esac -+else -+ lt_prog_compiler_pic_F77= -+ lt_prog_compiler_can_build_shared_F77=no -+fi -+ -+fi -+case $host_os in -+ # For platforms which do not support PIC, -DPIC is meaningless: -+ *djgpp*) -+ lt_prog_compiler_pic_F77= -+ ;; -+ *) -+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_cv_prog_compiler_c_o_F77=no -+ $rm -r conftest 2>/dev/null -+ mkdir conftest -+ cd conftest -+ mkdir out -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ lt_compiler_flag="-o out/conftest2.$ac_objext" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:13826: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>out/conftest.err) -+ ac_status=$? -+ cat out/conftest.err >&5 -+ echo "$as_me:13830: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s out/conftest2.$ac_objext -+ then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings -+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp -+ $SED '/^$/d' out/conftest.err >out/conftest.er2 -+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then -+ lt_cv_prog_compiler_c_o_F77=yes -+ fi -+ fi -+ chmod u+w . 2>&5 -+ $rm conftest* -+ # SGI C++ compiler will create directory out/ii_files/ for -+ # template instantiation -+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files -+ $rm out/* && rmdir out -+ cd .. -+ rmdir conftest -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 -+ -+ -+hard_links="nottested" -+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then -+ # do not overwrite the value of need_locks provided by the user -+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 -+ hard_links=yes -+ $rm conftest* -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ touch conftest.a -+ ln conftest.a conftest.b 2>&5 || hard_links=no -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ echo "$as_me:$LINENO: result: $hard_links" >&5 -+echo "${ECHO_T}$hard_links" >&6 -+ if test "$hard_links" = no; then -+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} -+ need_locks=warn -+ fi -+else -+ need_locks=no -+fi -+ -+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -+ -+ runpath_var= -+ allow_undefined_flag_F77= -+ enable_shared_with_static_runtimes_F77=no -+ archive_cmds_F77= -+ archive_expsym_cmds_F77= -+ old_archive_From_new_cmds_F77= -+ old_archive_from_expsyms_cmds_F77= -+ export_dynamic_flag_spec_F77= -+ whole_archive_flag_spec_F77= -+ thread_safe_flag_spec_F77= -+ hardcode_libdir_flag_spec_F77= -+ hardcode_libdir_flag_spec_ld_F77= -+ hardcode_libdir_separator_F77= -+ hardcode_direct_F77=no -+ hardcode_minus_L_F77=no -+ hardcode_shlibpath_var_F77=unsupported -+ link_all_deplibs_F77=unknown -+ hardcode_automatic_F77=no -+ module_cmds_F77= -+ module_expsym_cmds_F77= -+ always_export_symbols_F77=no -+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ # include_expsyms should be a list of space-separated symbols to be *always* -+ # included in the symbol list -+ include_expsyms_F77= -+ # exclude_expsyms can be an extended regexp of symbols to exclude -+ # it will be wrapped by ` (' and `)$', so one must not match beginning or -+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -+ # as well as any symbol that contains `d'. -+ exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" -+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -+ # platforms (ab)use it in PIC code, but their linkers get confused if -+ # the symbol is explicitly referenced. Since portable code cannot -+ # rely on this symbol name, it's probably fine to never include it in -+ # preloaded symbol tables. -+ extract_expsyms_cmds= -+ # Just being paranoid about ensuring that cc_basename is set. -+ for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ # FIXME: the MSVC++ port hasn't been tested in a loooong time -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ if test "$GCC" != yes; then -+ with_gnu_ld=no -+ fi -+ ;; -+ openbsd*) -+ with_gnu_ld=no -+ ;; -+ esac -+ -+ ld_shlibs_F77=yes -+ if test "$with_gnu_ld" = yes; then -+ # If archive_cmds runs LD, not CC, wlarc should be empty -+ wlarc='${wl}' -+ -+ # Set some defaults for GNU ld with shared library support. These -+ # are reset later if shared libraries are not supported. Putting them -+ # here allows them to be overridden if necessary. -+ runpath_var=LD_RUN_PATH -+ hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' -+ export_dynamic_flag_spec_F77='${wl}--export-dynamic' -+ # ancient GNU ld didn't support --whole-archive et. al. -+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then -+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ else -+ whole_archive_flag_spec_F77= -+ fi -+ supports_anon_versioning=no -+ case `$LD -v 2>/dev/null` in -+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 -+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... -+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... -+ *\ 2.11.*) ;; # other 2.11 versions -+ *) supports_anon_versioning=yes ;; -+ esac -+ -+ # See if GNU ld supports shared libraries. -+ case $host_os in -+ aix3* | aix4* | aix5*) -+ # On AIX/PPC, the GNU linker is very broken -+ if test "$host_cpu" != ia64; then -+ ld_shlibs_F77=no -+ cat <&2 -+ -+*** Warning: the GNU linker, at least up to release 2.9.1, is reported -+*** to be unable to reliably create shared libraries on AIX. -+*** Therefore, libtool is disabling shared libraries support. If you -+*** really care for shared libraries, you may want to modify your PATH -+*** so that a non-GNU linker is found, and then restart. -+ -+EOF -+ fi -+ ;; -+ -+ amigaos*) -+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_minus_L_F77=yes -+ -+ # Samuel A. Falvo II reports -+ # that the semantics of dynamic libraries on AmigaOS, at least up -+ # to version 4, is to share data among multiple programs linked -+ # with the same dynamic library. Since this doesn't match the -+ # behavior of shared libraries on other platforms, we can't use -+ # them. -+ ld_shlibs_F77=no -+ ;; -+ -+ beos*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ allow_undefined_flag_F77=unsupported -+ # Joseph Beckenbach says some releases of gcc -+ # support --undefined. This deserves some investigation. FIXME -+ archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ else -+ ld_shlibs_F77=no -+ fi -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, -+ # as there is no search path for DLLs. -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ allow_undefined_flag_F77=unsupported -+ always_export_symbols_F77=no -+ enable_shared_with_static_runtimes_F77=yes -+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -+ -+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ # If the export-symbols file already is a .def file (1st line -+ # is EXPORTS), use it as is; otherwise, prepend... -+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -+ cp $export_symbols $output_objdir/$soname.def; -+ else -+ echo EXPORTS > $output_objdir/$soname.def; -+ cat $export_symbols >> $output_objdir/$soname.def; -+ fi~ -+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ else -+ ld_shlibs_F77=no -+ fi -+ ;; -+ -+ linux*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ tmp_addflag= -+ case $cc_basename,$host_cpu in -+ pgcc*) # Portland Group C compiler -+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag' -+ ;; -+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers -+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag -Mnomain' ;; -+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 -+ tmp_addflag=' -i_dynamic' ;; -+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 -+ tmp_addflag=' -i_dynamic -nofor_main' ;; -+ ifc* | ifort*) # Intel Fortran compiler -+ tmp_addflag=' -nofor_main' ;; -+ esac -+ archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ -+ if test $supports_anon_versioning = yes; then -+ archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ -+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -+ $echo "local: *; };" >> $output_objdir/$libname.ver~ -+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' -+ fi -+ link_all_deplibs_F77=no -+ else -+ ld_shlibs_F77=no -+ fi -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' -+ wlarc= -+ else -+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ fi -+ ;; -+ -+ solaris* | sysv5*) -+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then -+ ld_shlibs_F77=no -+ cat <&2 -+ -+*** Warning: The releases 2.8.* of the GNU linker cannot reliably -+*** create shared libraries on Solaris systems. Therefore, libtool -+*** is disabling shared libraries support. We urge you to upgrade GNU -+*** binutils to release 2.9.1 or newer. Another option is to modify -+*** your PATH or compiler configuration so that the native linker is -+*** used, and then restart. -+ -+EOF -+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ ld_shlibs_F77=no -+ fi -+ ;; -+ -+ sunos4*) -+ archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ wlarc= -+ hardcode_direct_F77=yes -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ *) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ ld_shlibs_F77=no -+ fi -+ ;; -+ esac -+ -+ if test "$ld_shlibs_F77" = no; then -+ runpath_var= -+ hardcode_libdir_flag_spec_F77= -+ export_dynamic_flag_spec_F77= -+ whole_archive_flag_spec_F77= -+ fi -+ else -+ # PORTME fill in a description of your system's linker (not GNU ld) -+ case $host_os in -+ aix3*) -+ allow_undefined_flag_F77=unsupported -+ always_export_symbols_F77=yes -+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' -+ # Note: this linker hardcodes the directories in LIBPATH if there -+ # are no directories specified by -L. -+ hardcode_minus_L_F77=yes -+ if test "$GCC" = yes && test -z "$link_static_flag"; then -+ # Neither direct hardcoding nor static linking is supported with a -+ # broken collect2. -+ hardcode_direct_F77=unsupported -+ fi -+ ;; -+ -+ aix4* | aix5*) -+ if test "$host_cpu" = ia64; then -+ # On IA64, the linker does run time linking by default, so we don't -+ # have to do anything special. -+ aix_use_runtimelinking=no -+ exp_sym_flag='-Bexport' -+ no_entry_flag="" -+ else -+ # If we're using GNU nm, then we don't want the "-C" option. -+ # -C means demangle to AIX nm, but means don't demangle with GNU nm -+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then -+ export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ else -+ export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ fi -+ aix_use_runtimelinking=no -+ -+ # Test if we are trying to use run time linking or normal -+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we -+ # need to do runtime linking. -+ case $host_os in aix4.[23]|aix4.[23].*|aix5*) -+ for ld_flag in $LDFLAGS; do -+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then -+ aix_use_runtimelinking=yes -+ break -+ fi -+ done -+ esac -+ -+ exp_sym_flag='-bexport' -+ no_entry_flag='-bnoentry' -+ fi -+ -+ # When large executables or shared objects are built, AIX ld can -+ # have problems creating the table of contents. If linking a library -+ # or program results in "error TOC overflow" add -mminimal-toc to -+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -+ -+ archive_cmds_F77='' -+ hardcode_direct_F77=yes -+ hardcode_libdir_separator_F77=':' -+ link_all_deplibs_F77=yes -+ -+ if test "$GCC" = yes; then -+ case $host_os in aix4.[012]|aix4.[012].*) -+ # We only want to do this on AIX 4.2 and lower, the check -+ # below for broken collect2 doesn't work under 4.3+ -+ collect2name=`${CC} -print-prog-name=collect2` -+ if test -f "$collect2name" && \ -+ strings "$collect2name" | grep resolve_lib_name >/dev/null -+ then -+ # We have reworked collect2 -+ hardcode_direct_F77=yes -+ else -+ # We have old collect2 -+ hardcode_direct_F77=unsupported -+ # It fails to find uninstalled libraries when the uninstalled -+ # path is not listed in the libpath. Setting hardcode_minus_L -+ # to unsupported forces relinking -+ hardcode_minus_L_F77=yes -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_libdir_separator_F77= -+ fi -+ esac -+ shared_flag='-shared' -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag="$shared_flag "'${wl}-G' -+ fi -+ else -+ # not using gcc -+ if test "$host_cpu" = ia64; then -+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release -+ # chokes on -Wl,-G. The following line is correct: -+ shared_flag='-G' -+ else -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag='${wl}-G' -+ else -+ shared_flag='${wl}-bM:SRE' -+ fi -+ fi -+ fi -+ -+ # It seems that -bexpall does not export symbols beginning with -+ # underscore (_), so it is better to generate a list of symbols to export. -+ always_export_symbols_F77=yes -+ if test "$aix_use_runtimelinking" = yes; then -+ # Warning - without using the other runtime loading flags (-brtl), -+ # -berok will link without error, but may produce a broken library. -+ allow_undefined_flag_F77='-berok' -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+ program main -+ -+ end -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" -+ archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -+ else -+ if test "$host_cpu" = ia64; then -+ hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' -+ allow_undefined_flag_F77="-z nodefs" -+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -+ else -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+ program main -+ -+ end -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" -+ # Warning - without using the other run time loading flags, -+ # -berok will link without error, but may produce a broken library. -+ no_undefined_flag_F77=' ${wl}-bernotok' -+ allow_undefined_flag_F77=' ${wl}-berok' -+ # -bexpall does not export symbols beginning with underscore (_) -+ always_export_symbols_F77=yes -+ # Exported symbols can be pulled into shared objects from archives -+ whole_archive_flag_spec_F77=' ' -+ archive_cmds_need_lc_F77=yes -+ # This is similar to how AIX traditionally builds its shared libraries. -+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' -+ fi -+ fi -+ ;; -+ -+ amigaos*) -+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_minus_L_F77=yes -+ # see comment about different semantics on the GNU ld section -+ ld_shlibs_F77=no -+ ;; -+ -+ bsdi[45]*) -+ export_dynamic_flag_spec_F77=-rdynamic -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ # hardcode_libdir_flag_spec is actually meaningless, as there is -+ # no search path for DLLs. -+ hardcode_libdir_flag_spec_F77=' ' -+ allow_undefined_flag_F77=unsupported -+ # Tell ltmain to make .lib files, not .a files. -+ libext=lib -+ # Tell ltmain to make .dll files, not .so files. -+ shrext_cmds=".dll" -+ # FIXME: Setting linknames here is a bad hack. -+ archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' -+ # The linker will automatically build a .lib file if we build a DLL. -+ old_archive_From_new_cmds_F77='true' -+ # FIXME: Should let the user specify the lib program. -+ old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' -+ fix_srcfile_path_F77='`cygpath -w "$srcfile"`' -+ enable_shared_with_static_runtimes_F77=yes -+ ;; -+ -+ darwin* | rhapsody*) -+ case $host_os in -+ rhapsody* | darwin1.[012]) -+ allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' -+ ;; -+ *) # Darwin 1.3 on -+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then -+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ else -+ case ${MACOSX_DEPLOYMENT_TARGET} in -+ 10.[012]) -+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ ;; -+ 10.*) -+ allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' -+ ;; -+ esac -+ fi -+ ;; -+ esac -+ archive_cmds_need_lc_F77=no -+ hardcode_direct_F77=no -+ hardcode_automatic_F77=yes -+ hardcode_shlibpath_var_F77=unsupported -+ whole_archive_flag_spec_F77='' -+ link_all_deplibs_F77=yes -+ if test "$GCC" = yes ; then -+ output_verbose_link_cmd='echo' -+ archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ case $cc_basename in -+ xlc*) -+ output_verbose_link_cmd='echo' -+ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' -+ module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ ;; -+ *) -+ ld_shlibs_F77=no -+ ;; -+ esac -+ fi -+ ;; -+ -+ dgux*) -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ freebsd1*) -+ ld_shlibs_F77=no -+ ;; -+ -+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor -+ # support. Future versions do this automatically, but an explicit c++rt0.o -+ # does not break anything, and helps significantly (at the cost of a little -+ # extra space). -+ freebsd2.2*) -+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -+ hardcode_libdir_flag_spec_F77='-R$libdir' -+ hardcode_direct_F77=yes -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ # Unfortunately, older versions of FreeBSD 2 do not have this feature. -+ freebsd2*) -+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_F77=yes -+ hardcode_minus_L_F77=yes -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' -+ hardcode_libdir_flag_spec_F77='-R$libdir' -+ hardcode_direct_F77=yes -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ hpux9*) -+ if test "$GCC" = yes; then -+ archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ else -+ archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ fi -+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator_F77=: -+ hardcode_direct_F77=yes -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L_F77=yes -+ export_dynamic_flag_spec_F77='${wl}-E' -+ ;; -+ -+ hpux10* | hpux11*) -+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*|ia64*) -+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ *) -+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ esac -+ else -+ case $host_cpu in -+ hppa*64*|ia64*) -+ archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ *) -+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ esac -+ fi -+ if test "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*) -+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' -+ hardcode_libdir_flag_spec_ld_F77='+b $libdir' -+ hardcode_libdir_separator_F77=: -+ hardcode_direct_F77=no -+ hardcode_shlibpath_var_F77=no -+ ;; -+ ia64*) -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_direct_F77=no -+ hardcode_shlibpath_var_F77=no -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L_F77=yes -+ ;; -+ *) -+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator_F77=: -+ hardcode_direct_F77=yes -+ export_dynamic_flag_spec_F77='${wl}-E' -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L_F77=yes -+ ;; -+ esac -+ fi -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ if test "$GCC" = yes; then -+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' -+ fi -+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_F77=: -+ link_all_deplibs_F77=yes -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out -+ else -+ archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF -+ fi -+ hardcode_libdir_flag_spec_F77='-R$libdir' -+ hardcode_direct_F77=yes -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ newsos6) -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_F77=yes -+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_F77=: -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ openbsd*) -+ hardcode_direct_F77=yes -+ hardcode_shlibpath_var_F77=no -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' -+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' -+ export_dynamic_flag_spec_F77='${wl}-E' -+ else -+ case $host_os in -+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) -+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec_F77='-R$libdir' -+ ;; -+ *) -+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' -+ ;; -+ esac -+ fi -+ ;; -+ -+ os2*) -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_minus_L_F77=yes -+ allow_undefined_flag_F77=unsupported -+ archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' -+ old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' -+ ;; -+ -+ osf3*) -+ if test "$GCC" = yes; then -+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ allow_undefined_flag_F77=' -expect_unresolved \*' -+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ fi -+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_F77=: -+ ;; -+ -+ osf4* | osf5*) # as osf3* with the addition of -msym flag -+ if test "$GCC" = yes; then -+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' -+ else -+ allow_undefined_flag_F77=' -expect_unresolved \*' -+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ -+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' -+ -+ # Both c and cxx compiler support -rpath directly -+ hardcode_libdir_flag_spec_F77='-rpath $libdir' -+ fi -+ hardcode_libdir_separator_F77=: -+ ;; -+ -+ sco3.2v5*) -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var_F77=no -+ export_dynamic_flag_spec_F77='${wl}-Bexport' -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ;; -+ -+ solaris*) -+ no_undefined_flag_F77=' -z text' -+ if test "$GCC" = yes; then -+ wlarc='${wl}' -+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' -+ else -+ wlarc='' -+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ fi -+ hardcode_libdir_flag_spec_F77='-R$libdir' -+ hardcode_shlibpath_var_F77=no -+ case $host_os in -+ solaris2.[0-5] | solaris2.[0-5].*) ;; -+ *) -+ # The compiler driver will combine linker options so we -+ # cannot just pass the convience library names through -+ # without $wl, iff we do not link with $LD. -+ # Luckily, gcc supports the same syntax we need for Sun Studio. -+ # Supported since Solaris 2.6 (maybe 2.5.1?) -+ case $wlarc in -+ '') -+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; -+ *) -+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; -+ esac ;; -+ esac -+ link_all_deplibs_F77=yes -+ ;; -+ -+ sunos4*) -+ if test "x$host_vendor" = xsequent; then -+ # Use $CC to link under sequent, because it throws in some extra .o -+ # files that make .init and .fini sections work. -+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' -+ fi -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_direct_F77=yes -+ hardcode_minus_L_F77=yes -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ sysv4) -+ case $host_vendor in -+ sni) -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_F77=yes # is this really true??? -+ ;; -+ siemens) -+ ## LD is ld it makes a PLAMLIB -+ ## CC just makes a GrossModule. -+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ reload_cmds_F77='$CC -r -o $output$reload_objs' -+ hardcode_direct_F77=no -+ ;; -+ motorola) -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie -+ ;; -+ esac -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ sysv4.3*) -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var_F77=no -+ export_dynamic_flag_spec_F77='-Bexport' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var_F77=no -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ld_shlibs_F77=yes -+ fi -+ ;; -+ -+ sysv4.2uw2*) -+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_F77=yes -+ hardcode_minus_L_F77=no -+ hardcode_shlibpath_var_F77=no -+ hardcode_runpath_var=yes -+ runpath_var=LD_RUN_PATH -+ ;; -+ -+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) -+ no_undefined_flag_F77='${wl}-z ${wl}text' -+ if test "$GCC" = yes; then -+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ fi -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ sysv5*) -+ no_undefined_flag_F77=' -z text' -+ # $CC -shared without GNU ld will not create a library from C++ -+ # object files and a static libstdc++, better avoid it by now -+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ hardcode_libdir_flag_spec_F77= -+ hardcode_shlibpath_var_F77=no -+ runpath_var='LD_RUN_PATH' -+ ;; -+ -+ uts4*) -+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec_F77='-L$libdir' -+ hardcode_shlibpath_var_F77=no -+ ;; -+ -+ *) -+ ld_shlibs_F77=no -+ ;; -+ esac -+ fi -+ -+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -+echo "${ECHO_T}$ld_shlibs_F77" >&6 -+test "$ld_shlibs_F77" = no && can_build_shared=no -+ -+variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -+if test "$GCC" = yes; then -+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -+fi -+ -+# -+# Do we need to explicitly link libc? -+# -+case "x$archive_cmds_need_lc_F77" in -+x|xyes) -+ # Assume -lc should be added -+ archive_cmds_need_lc_F77=yes -+ -+ if test "$enable_shared" = yes && test "$GCC" = yes; then -+ case $archive_cmds_F77 in -+ *'~'*) -+ # FIXME: we may have to deal with multi-command sequences. -+ ;; -+ '$CC '*) -+ # Test whether the compiler implicitly links with -lc since on some -+ # systems, -lgcc has to come before -lc. If gcc already passes -lc -+ # to ld, don't add -lc before -lgcc. -+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 -+ $rm conftest* -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } 2>conftest.err; then -+ soname=conftest -+ lib=conftest -+ libobjs=conftest.$ac_objext -+ deplibs= -+ wl=$lt_prog_compiler_wl_F77 -+ compiler_flags=-v -+ linker_flags=-v -+ verstring= -+ output_objdir=. -+ libname=conftest -+ lt_save_allow_undefined_flag=$allow_undefined_flag_F77 -+ allow_undefined_flag_F77= -+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 -+ (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+ then -+ archive_cmds_need_lc_F77=no -+ else -+ archive_cmds_need_lc_F77=yes -+ fi -+ allow_undefined_flag_F77=$lt_save_allow_undefined_flag -+ else -+ cat conftest.err 1>&5 -+ fi -+ $rm conftest* -+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 -+ ;; -+ esac -+ fi -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -+library_names_spec= -+libname_spec='lib$name' -+soname_spec= -+shrext_cmds=".so" -+postinstall_cmds= -+postuninstall_cmds= -+finish_cmds= -+finish_eval= -+shlibpath_var= -+shlibpath_overrides_runpath=unknown -+version_type=none -+dynamic_linker="$host_os ld.so" -+sys_lib_dlsearch_path_spec="/lib /usr/lib" -+if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -+ # if the path contains ";" then we assume it to be the separator -+ # otherwise default to the standard path separator (i.e. ":") - it is -+ # assumed that no part of a normal pathname contains ";" but that should -+ # okay in the real world where ";" in dirpaths is itself problematic. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+else -+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -+fi -+need_lib_prefix=unknown -+hardcode_into_libs=no -+ -+# when you set need_version to no, make sure it does not cause -set_version -+# flags to be left without arguments -+need_version=unknown -+ -+case $host_os in -+aix3*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' -+ shlibpath_var=LIBPATH -+ -+ # AIX 3 has no versioning support, so we append a major version to the name. -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ -+aix4* | aix5*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ hardcode_into_libs=yes -+ if test "$host_cpu" = ia64; then -+ # AIX 5 supports IA64 -+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ else -+ # With GCC up to 2.95.x, collect2 would create an import file -+ # for dependence libraries. The import file would start with -+ # the line `#! .'. This would cause the generated library to -+ # depend on `.', always an invalid library. This was fixed in -+ # development snapshots of GCC prior to 3.0. -+ case $host_os in -+ aix4 | aix4.[01] | aix4.[01].*) -+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' -+ echo ' yes ' -+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then -+ : -+ else -+ can_build_shared=no -+ fi -+ ;; -+ esac -+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct -+ # soname into executable. Probably we can add versioning support to -+ # collect2, so additional links can be useful in future. -+ if test "$aix_use_runtimelinking" = yes; then -+ # If using run time linking (on AIX 4.2 or later) use lib.so -+ # instead of lib.a to let people know that these are not -+ # typical AIX shared libraries. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ else -+ # We preserve .a as extension for shared libraries through AIX4.2 -+ # and later when we are not doing run time linking. -+ library_names_spec='${libname}${release}.a $libname.a' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ fi -+ shlibpath_var=LIBPATH -+ fi -+ ;; -+ -+amigaos*) -+ library_names_spec='$libname.ixlibrary $libname.a' -+ # Create ${libname}_ixlibrary.a entries in /sys/libs. -+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' -+ ;; -+ -+beos*) -+ library_names_spec='${libname}${shared_ext}' -+ dynamic_linker="$host_os ld.so" -+ shlibpath_var=LIBRARY_PATH -+ ;; -+ -+bsdi[45]*) -+ version_type=linux -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -+ # the default ld.so.conf also contains /usr/contrib/lib and -+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -+ # libtool to hard-code these into programs -+ ;; -+ -+cygwin* | mingw* | pw32*) -+ version_type=windows -+ shrext_cmds=".dll" -+ need_version=no -+ need_lib_prefix=no -+ -+ case $GCC,$host_os in -+ yes,cygwin* | yes,mingw* | yes,pw32*) -+ library_names_spec='$libname.dll.a' -+ # DLL is installed to $(libdir)/../bin by postinstall_cmds -+ postinstall_cmds='base_file=`basename \${file}`~ -+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ -+ dldir=$destdir/`dirname \$dlpath`~ -+ test -d \$dldir || mkdir -p \$dldir~ -+ $install_prog $dir/$dlname \$dldir/$dlname~ -+ chmod a+x \$dldir/$dlname' -+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ -+ dlpath=$dir/\$dldll~ -+ $rm \$dlpath' -+ shlibpath_overrides_runpath=yes -+ -+ case $host_os in -+ cygwin*) -+ # Cygwin DLLs use 'cyg' prefix rather than 'lib' -+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" -+ ;; -+ mingw*) -+ # MinGW DLLs use traditional 'lib' prefix -+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then -+ # It is most probably a Windows format PATH printed by -+ # mingw gcc, but we are running on Cygwin. Gcc prints its search -+ # path with ; separators, and with drive letters. We can handle the -+ # drive letters (cygwin fileutils understands them), so leave them, -+ # especially as we might pass files found there to a mingw objdump, -+ # which wouldn't understand a cygwinified path. Ahh. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+ ;; -+ pw32*) -+ # pw32 DLLs use 'pw' prefix rather than 'lib' -+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ ;; -+ esac -+ ;; -+ -+ *) -+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' -+ ;; -+ esac -+ dynamic_linker='Win32 ld.exe' -+ # FIXME: first we should search . and the directory the executable is in -+ shlibpath_var=PATH -+ ;; -+ -+darwin* | rhapsody*) -+ dynamic_linker="$host_os dyld" -+ version_type=darwin -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' -+ soname_spec='${libname}${release}${major}$shared_ext' -+ shlibpath_overrides_runpath=yes -+ shlibpath_var=DYLD_LIBRARY_PATH -+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. -+ if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` -+ else -+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' -+ fi -+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' -+ ;; -+ -+dgux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+freebsd1*) -+ dynamic_linker=no -+ ;; -+ -+kfreebsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+freebsd* | dragonfly*) -+ # DragonFly does not have aout. When/if they implement a new -+ # versioning mechanism, adjust this. -+ if test -x /usr/bin/objformat; then -+ objformat=`/usr/bin/objformat` -+ else -+ case $host_os in -+ freebsd[123]*) objformat=aout ;; -+ *) objformat=elf ;; -+ esac -+ fi -+ version_type=freebsd-$objformat -+ case $version_type in -+ freebsd-elf*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' -+ need_version=no -+ need_lib_prefix=no -+ ;; -+ freebsd-*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' -+ need_version=yes -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_os in -+ freebsd2*) -+ shlibpath_overrides_runpath=yes -+ ;; -+ freebsd3.[01]* | freebsdelf3.[01]*) -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ *) # from 3.2 on -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ ;; -+ esac -+ ;; -+ -+gnu*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ hardcode_into_libs=yes -+ ;; -+ -+hpux9* | hpux10* | hpux11*) -+ # Give a soname corresponding to the major version so that dld.sl refuses to -+ # link against other versions. -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ case $host_cpu in -+ ia64*) -+ shrext_cmds='.so' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.so" -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ if test "X$HPUX_IA64_MODE" = X32; then -+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" -+ else -+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" -+ fi -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ hppa*64*) -+ shrext_cmds='.sl' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ *) -+ shrext_cmds='.sl' -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=SHLIB_PATH -+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ esac -+ # HP-UX runs *really* slowly unless shared libraries are mode 555. -+ postinstall_cmds='chmod 555 $lib' -+ ;; -+ -+irix5* | irix6* | nonstopux*) -+ case $host_os in -+ nonstopux*) version_type=nonstopux ;; -+ *) -+ if test "$lt_cv_prog_gnu_ld" = yes; then -+ version_type=linux -+ else -+ version_type=irix -+ fi ;; -+ esac -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' -+ case $host_os in -+ irix5* | nonstopux*) -+ libsuff= shlibsuff= -+ ;; -+ *) -+ case $LD in # libtool.m4 will add one of these switches to LD -+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") -+ libsuff= shlibsuff= libmagic=32-bit;; -+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") -+ libsuff=32 shlibsuff=N32 libmagic=N32;; -+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") -+ libsuff=64 shlibsuff=64 libmagic=64-bit;; -+ *) libsuff= shlibsuff= libmagic=never-match;; -+ esac -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -+ hardcode_into_libs=yes -+ ;; -+ -+# No shared lib support for Linux oldld, aout, or coff. -+linux*oldld* | linux*aout* | linux*coff*) -+ dynamic_linker=no -+ ;; -+ -+# This must be Linux ELF. -+linux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ # This implies no fast_install, which is unacceptable. -+ # Some rework will be needed to allow for fast_install -+ # before this can be enabled. -+ hardcode_into_libs=yes -+ -+ # Append ld.so.conf contents to the search path -+ if test -f /etc/ld.so.conf; then -+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -+ fi -+ -+ # We used to test for /lib/ld.so.1 and disable shared libraries on -+ # powerpc, because MkLinux only supported shared libraries with the -+ # GNU dynamic linker. Since this was broken with cross compilers, -+ # most powerpc-linux boxes support dynamic linking these days and -+ # people can always --disable-shared, the test was removed, and we -+ # assume the GNU/Linux dynamic linker is in use. -+ dynamic_linker='GNU/Linux ld.so' -+ ;; -+ -+netbsdelf*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='NetBSD ld.elf_so' -+ ;; -+ -+knetbsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+netbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ dynamic_linker='NetBSD (a.out) ld.so' -+ else -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ dynamic_linker='NetBSD ld.elf_so' -+ fi -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ -+newsos6) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+nto-qnx*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+openbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. -+ case $host_os in -+ openbsd3.3 | openbsd3.3.*) need_version=yes ;; -+ *) need_version=no ;; -+ esac -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ case $host_os in -+ openbsd2.[89] | openbsd2.[89].*) -+ shlibpath_overrides_runpath=no -+ ;; -+ *) -+ shlibpath_overrides_runpath=yes -+ ;; -+ esac -+ else -+ shlibpath_overrides_runpath=yes -+ fi -+ ;; -+ -+os2*) -+ libname_spec='$name' -+ shrext_cmds=".dll" -+ need_lib_prefix=no -+ library_names_spec='$libname${shared_ext} $libname.a' -+ dynamic_linker='OS/2 ld.exe' -+ shlibpath_var=LIBPATH -+ ;; -+ -+osf3* | osf4* | osf5*) -+ version_type=osf -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -+ ;; -+ -+sco3.2v5*) -+ version_type=osf -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+solaris*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ # ldd complains unless libraries are executable -+ postinstall_cmds='chmod +x $lib' -+ ;; -+ -+sunos4*) -+ version_type=sunos -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ if test "$with_gnu_ld" = yes; then -+ need_lib_prefix=no -+ fi -+ need_version=yes -+ ;; -+ -+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_vendor in -+ sni) -+ shlibpath_overrides_runpath=no -+ need_lib_prefix=no -+ export_dynamic_flag_spec='${wl}-Blargedynsym' -+ runpath_var=LD_RUN_PATH -+ ;; -+ siemens) -+ need_lib_prefix=no -+ ;; -+ motorola) -+ need_lib_prefix=no -+ need_version=no -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -+ ;; -+ esac -+ ;; -+ -+sysv4*MP*) -+ if test -d /usr/nec ;then -+ version_type=linux -+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' -+ soname_spec='$libname${shared_ext}.$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ fi -+ ;; -+ -+uts4*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+*) -+ dynamic_linker=no -+ ;; -+esac -+echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -+echo "${ECHO_T}$dynamic_linker" >&6 -+test "$dynamic_linker" = no && can_build_shared=no -+ -+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -+hardcode_action_F77= -+if test -n "$hardcode_libdir_flag_spec_F77" || \ -+ test -n "$runpath_var_F77" || \ -+ test "X$hardcode_automatic_F77" = "Xyes" ; then -+ -+ # We can hardcode non-existant directories. -+ if test "$hardcode_direct_F77" != no && -+ # If the only mechanism to avoid hardcoding is shlibpath_var, we -+ # have to relink, otherwise we might link with an installed library -+ # when we should be linking with a yet-to-be-installed one -+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && -+ test "$hardcode_minus_L_F77" != no; then -+ # Linking always hardcodes the temporary library directory. -+ hardcode_action_F77=relink -+ else -+ # We can link without hardcoding, and we can hardcode nonexisting dirs. -+ hardcode_action_F77=immediate -+ fi -+else -+ # We cannot hardcode anything, or else we can only hardcode existing -+ # directories. -+ hardcode_action_F77=unsupported -+fi -+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -+echo "${ECHO_T}$hardcode_action_F77" >&6 -+ -+if test "$hardcode_action_F77" = relink; then -+ # Fast installation is not supported -+ enable_fast_install=no -+elif test "$shlibpath_overrides_runpath" = yes || -+ test "$enable_shared" = no; then -+ # Fast installation is not necessary -+ enable_fast_install=needless -+fi -+ -+striplib= -+old_striplib= -+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then -+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -+ test -z "$striplib" && striplib="$STRIP --strip-unneeded" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+else -+# FIXME - insert some real tests, host_os isn't really good enough -+ case $host_os in -+ darwin*) -+ if test -n "$STRIP" ; then -+ striplib="$STRIP -x" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+ else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ ;; -+ *) -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+ ;; -+ esac -+fi -+ -+ -+ -+# The else clause should only fire when bootstrapping the -+# libtool distribution, otherwise you forgot to ship ltmain.sh -+# with your package, and you will get complaints that there are -+# no rules to generate ltmain.sh. -+if test -f "$ltmain"; then -+ # See if we are running on zsh, and set the options which allow our commands through -+ # without removal of \ escapes. -+ if test -n "${ZSH_VERSION+set}" ; then -+ setopt NO_GLOB_SUBST -+ fi -+ # Now quote all the things that may contain metacharacters while being -+ # careful not to overquote the AC_SUBSTed values. We take copies of the -+ # variables and quote the copies for generation of the libtool script. -+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ -+ SED SHELL STRIP \ -+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ -+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ -+ deplibs_check_method reload_flag reload_cmds need_locks \ -+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ -+ lt_cv_sys_global_symbol_to_c_name_address \ -+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -+ old_postinstall_cmds old_postuninstall_cmds \ -+ compiler_F77 \ -+ CC_F77 \ -+ LD_F77 \ -+ lt_prog_compiler_wl_F77 \ -+ lt_prog_compiler_pic_F77 \ -+ lt_prog_compiler_static_F77 \ -+ lt_prog_compiler_no_builtin_flag_F77 \ -+ export_dynamic_flag_spec_F77 \ -+ thread_safe_flag_spec_F77 \ -+ whole_archive_flag_spec_F77 \ -+ enable_shared_with_static_runtimes_F77 \ -+ old_archive_cmds_F77 \ -+ old_archive_from_new_cmds_F77 \ -+ predep_objects_F77 \ -+ postdep_objects_F77 \ -+ predeps_F77 \ -+ postdeps_F77 \ -+ compiler_lib_search_path_F77 \ -+ archive_cmds_F77 \ -+ archive_expsym_cmds_F77 \ -+ postinstall_cmds_F77 \ -+ postuninstall_cmds_F77 \ -+ old_archive_from_expsyms_cmds_F77 \ -+ allow_undefined_flag_F77 \ -+ no_undefined_flag_F77 \ -+ export_symbols_cmds_F77 \ -+ hardcode_libdir_flag_spec_F77 \ -+ hardcode_libdir_flag_spec_ld_F77 \ -+ hardcode_libdir_separator_F77 \ -+ hardcode_automatic_F77 \ -+ module_cmds_F77 \ -+ module_expsym_cmds_F77 \ -+ lt_cv_prog_compiler_c_o_F77 \ -+ exclude_expsyms_F77 \ -+ include_expsyms_F77; do -+ -+ case $var in -+ old_archive_cmds_F77 | \ -+ old_archive_from_new_cmds_F77 | \ -+ archive_cmds_F77 | \ -+ archive_expsym_cmds_F77 | \ -+ module_cmds_F77 | \ -+ module_expsym_cmds_F77 | \ -+ old_archive_from_expsyms_cmds_F77 | \ -+ export_symbols_cmds_F77 | \ -+ extract_expsyms_cmds | reload_cmds | finish_cmds | \ -+ postinstall_cmds | postuninstall_cmds | \ -+ old_postinstall_cmds | old_postuninstall_cmds | \ -+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) -+ # Double-quote double-evaled strings. -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" -+ ;; -+ *) -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -+ ;; -+ esac -+ done -+ -+ case $lt_echo in -+ *'\$0 --fallback-echo"') -+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` -+ ;; -+ esac -+ -+cfgfile="$ofile" -+ -+ cat <<__EOF__ >> "$cfgfile" -+# ### BEGIN LIBTOOL TAG CONFIG: $tagname -+ -+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -+ -+# Shell to use when invoking shell scripts. -+SHELL=$lt_SHELL -+ -+# Whether or not to build shared libraries. -+build_libtool_libs=$enable_shared -+ -+# Whether or not to build static libraries. -+build_old_libs=$enable_static -+ -+# Whether or not to add -lc for building shared libraries. -+build_libtool_need_lc=$archive_cmds_need_lc_F77 -+ -+# Whether or not to disallow shared libs when runtime libs are static -+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 -+ -+# Whether or not to optimize for fast installation. -+fast_install=$enable_fast_install -+ -+# The host system. -+host_alias=$host_alias -+host=$host -+host_os=$host_os -+ -+# The build system. -+build_alias=$build_alias -+build=$build -+build_os=$build_os -+ -+# An echo program that does not interpret backslashes. -+echo=$lt_echo -+ -+# The archiver. -+AR=$lt_AR -+AR_FLAGS=$lt_AR_FLAGS -+ -+# A C compiler. -+LTCC=$lt_LTCC -+ -+# A language-specific compiler. -+CC=$lt_compiler_F77 -+ -+# Is the compiler the GNU C compiler? -+with_gcc=$GCC_F77 -+ -+# An ERE matcher. -+EGREP=$lt_EGREP -+ -+# The linker used to build libraries. -+LD=$lt_LD_F77 -+ -+# Whether we need hard or soft links. -+LN_S=$lt_LN_S -+ -+# A BSD-compatible nm program. -+NM=$lt_NM -+ -+# A symbol stripping program -+STRIP=$lt_STRIP -+ -+# Used to examine libraries when file_magic_cmd begins "file" -+MAGIC_CMD=$MAGIC_CMD -+ -+# Used on cygwin: DLL creation program. -+DLLTOOL="$DLLTOOL" -+ -+# Used on cygwin: object dumper. -+OBJDUMP="$OBJDUMP" -+ -+# Used on cygwin: assembler. -+AS="$AS" -+ -+# The name of the directory that contains temporary libtool files. -+objdir=$objdir -+ -+# How to create reloadable object files. -+reload_flag=$lt_reload_flag -+reload_cmds=$lt_reload_cmds -+ -+# How to pass a linker flag through the compiler. -+wl=$lt_lt_prog_compiler_wl_F77 -+ -+# Object file suffix (normally "o"). -+objext="$ac_objext" -+ -+# Old archive suffix (normally "a"). -+libext="$libext" -+ -+# Shared library suffix (normally ".so"). -+shrext_cmds='$shrext_cmds' -+ -+# Executable file suffix (normally ""). -+exeext="$exeext" -+ -+# Additional compiler flags for building library objects. -+pic_flag=$lt_lt_prog_compiler_pic_F77 -+pic_mode=$pic_mode -+ -+# What is the maximum length of a command? -+max_cmd_len=$lt_cv_sys_max_cmd_len -+ -+# Does compiler simultaneously support -c and -o options? -+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 -+ -+# Must we lock files when doing compilation? -+need_locks=$lt_need_locks -+ -+# Do we need the lib prefix for modules? -+need_lib_prefix=$need_lib_prefix -+ -+# Do we need a version for libraries? -+need_version=$need_version -+ -+# Whether dlopen is supported. -+dlopen_support=$enable_dlopen -+ -+# Whether dlopen of programs is supported. -+dlopen_self=$enable_dlopen_self -+ -+# Whether dlopen of statically linked programs is supported. -+dlopen_self_static=$enable_dlopen_self_static -+ -+# Compiler flag to prevent dynamic linking. -+link_static_flag=$lt_lt_prog_compiler_static_F77 -+ -+# Compiler flag to turn off builtin functions. -+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 -+ -+# Compiler flag to allow reflexive dlopens. -+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 -+ -+# Compiler flag to generate shared objects directly from archives. -+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 -+ -+# Compiler flag to generate thread-safe objects. -+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 -+ -+# Library versioning type. -+version_type=$version_type -+ -+# Format of library name prefix. -+libname_spec=$lt_libname_spec -+ -+# List of archive names. First name is the real one, the rest are links. -+# The last name is the one that the linker finds with -lNAME. -+library_names_spec=$lt_library_names_spec -+ -+# The coded name of the library, if different from the real name. -+soname_spec=$lt_soname_spec -+ -+# Commands used to build and install an old-style archive. -+RANLIB=$lt_RANLIB -+old_archive_cmds=$lt_old_archive_cmds_F77 -+old_postinstall_cmds=$lt_old_postinstall_cmds -+old_postuninstall_cmds=$lt_old_postuninstall_cmds -+ -+# Create an old-style archive from a shared archive. -+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 -+ -+# Create a temporary old-style archive to link instead of a shared archive. -+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 -+ -+# Commands used to build and install a shared archive. -+archive_cmds=$lt_archive_cmds_F77 -+archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -+postinstall_cmds=$lt_postinstall_cmds -+postuninstall_cmds=$lt_postuninstall_cmds -+ -+# Commands used to build a loadable module (assumed same as above if empty) -+module_cmds=$lt_module_cmds_F77 -+module_expsym_cmds=$lt_module_expsym_cmds_F77 -+ -+# Commands to strip libraries. -+old_striplib=$lt_old_striplib -+striplib=$lt_striplib -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predep_objects=$lt_predep_objects_F77 -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdep_objects=$lt_postdep_objects_F77 -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predeps=$lt_predeps_F77 -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdeps=$lt_postdeps_F77 -+ -+# The library search path used internally by the compiler when linking -+# a shared library. -+compiler_lib_search_path=$lt_compiler_lib_search_path_F77 -+ -+# Method to check whether dependent libraries are shared objects. -+deplibs_check_method=$lt_deplibs_check_method -+ -+# Command to use when deplibs_check_method == file_magic. -+file_magic_cmd=$lt_file_magic_cmd -+ -+# Flag that allows shared libraries with undefined symbols to be built. -+allow_undefined_flag=$lt_allow_undefined_flag_F77 -+ -+# Flag that forces no undefined symbols. -+no_undefined_flag=$lt_no_undefined_flag_F77 -+ -+# Commands used to finish a libtool library installation in a directory. -+finish_cmds=$lt_finish_cmds -+ -+# Same as above, but a single script fragment to be evaled but not shown. -+finish_eval=$lt_finish_eval -+ -+# Take the output of nm and produce a listing of raw symbols and C names. -+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -+ -+# Transform the output of nm in a proper C declaration -+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -+ -+# Transform the output of nm in a C name address pair -+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -+ -+# This is the shared library runtime path variable. -+runpath_var=$runpath_var -+ -+# This is the shared library path variable. -+shlibpath_var=$shlibpath_var -+ -+# Is shlibpath searched before the hard-coded library search path? -+shlibpath_overrides_runpath=$shlibpath_overrides_runpath -+ -+# How to hardcode a shared library path into an executable. -+hardcode_action=$hardcode_action_F77 -+ -+# Whether we should hardcode library paths into libraries. -+hardcode_into_libs=$hardcode_into_libs -+ -+# Flag to hardcode \$libdir into a binary during linking. -+# This must work even if \$libdir does not exist. -+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 -+ -+# If ld is used when linking, flag to hardcode \$libdir into -+# a binary during linking. This must work even if \$libdir does -+# not exist. -+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 -+ -+# Whether we need a single -rpath flag with a separated argument. -+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 -+ -+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -+# resulting binary. -+hardcode_direct=$hardcode_direct_F77 -+ -+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -+# resulting binary. -+hardcode_minus_L=$hardcode_minus_L_F77 -+ -+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -+# the resulting binary. -+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 -+ -+# Set to yes if building a shared library automatically hardcodes DIR into the library -+# and all subsequent libraries and executables linked against it. -+hardcode_automatic=$hardcode_automatic_F77 -+ -+# Variables whose values should be saved in libtool wrapper scripts and -+# restored at relink time. -+variables_saved_for_relink="$variables_saved_for_relink" -+ -+# Whether libtool must link a program against all its dependency libraries. -+link_all_deplibs=$link_all_deplibs_F77 -+ -+# Compile-time system search path for libraries -+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -+ -+# Run-time system search path for libraries -+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -+ -+# Fix the shell variable \$srcfile for the compiler. -+fix_srcfile_path="$fix_srcfile_path_F77" -+ -+# Set to yes if exported symbols are required. -+always_export_symbols=$always_export_symbols_F77 -+ -+# The commands to list exported symbols. -+export_symbols_cmds=$lt_export_symbols_cmds_F77 -+ -+# The commands to extract the exported symbol list from a shared archive. -+extract_expsyms_cmds=$lt_extract_expsyms_cmds -+ -+# Symbols that should not be listed in the preloaded symbols. -+exclude_expsyms=$lt_exclude_expsyms_F77 -+ -+# Symbols that must always be exported. -+include_expsyms=$lt_include_expsyms_F77 -+ -+# ### END LIBTOOL TAG CONFIG: $tagname -+ -+__EOF__ -+ -+ -+else -+ # If there is no Makefile yet, we rely on a make rule to execute -+ # `config.status --recheck' to rerun these tests and create the -+ # libtool script then. -+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` -+ if test -f "$ltmain_in"; then -+ test -f Makefile && make "$ltmain" -+ fi -+fi -+ -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+CC="$lt_save_CC" -+ -+ else -+ tagname="" -+ fi -+ ;; -+ -+ GCJ) -+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then -+ -+ -+ -+# Source file extension for Java test sources. -+ac_ext=java -+ -+# Object file extension for compiled Java test sources. -+objext=o -+objext_GCJ=$objext -+ -+# Code to be used in simple compile tests -+lt_simple_compile_test_code="class foo {}\n" -+ -+# Code to be used in simple link tests -+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' -+ -+# ltmain only uses $CC for tagged configurations so make sure $CC is set. -+ -+# If no C compiler was specified, use CC. -+LTCC=${LTCC-"$CC"} -+ -+# Allow CC to be a program name with arguments. -+compiler=$CC -+ -+ -+# save warnings/boilerplate of simple test code -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_compile_test_code" >conftest.$ac_ext -+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_compiler_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_link_test_code" >conftest.$ac_ext -+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_linker_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ -+# Allow CC to be a program name with arguments. -+lt_save_CC="$CC" -+CC=${GCJ-"gcj"} -+compiler=$CC -+compiler_GCJ=$CC -+for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+ -+# GCJ did not exist at the time GCC didn't implicitly link libc in. -+archive_cmds_need_lc_GCJ=no -+ -+old_archive_cmds_GCJ=$old_archive_cmds -+ -+ -+lt_prog_compiler_no_builtin_flag_GCJ= -+ -+if test "$GCC" = yes; then -+ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' -+ -+ -+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_cv_prog_compiler_rtti_exceptions=no -+ ac_outfile=conftest.$ac_objext -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ lt_compiler_flag="-fno-rtti -fno-exceptions" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ # The option is referenced via a variable to avoid confusing sed. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:15967: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>conftest.err) -+ ac_status=$? -+ cat conftest.err >&5 -+ echo "$as_me:15971: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s "$ac_outfile"; then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings other than the usual output. -+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then -+ lt_cv_prog_compiler_rtti_exceptions=yes -+ fi -+ fi -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 -+ -+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then -+ lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -+else -+ : -+fi -+ -+fi -+ -+lt_prog_compiler_wl_GCJ= -+lt_prog_compiler_pic_GCJ= -+lt_prog_compiler_static_GCJ= -+ -+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 -+ -+ if test "$GCC" = yes; then -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ lt_prog_compiler_static_GCJ='-static' -+ -+ case $host_os in -+ aix*) -+ # All AIX code is PIC. -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ fi -+ ;; -+ -+ amigaos*) -+ # FIXME: we need at least 68020 code to build shared libraries, but -+ # adding the `-m68020' flag to GCC prevents building anything better, -+ # like `-m68040'. -+ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' -+ ;; -+ -+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ # PIC is the default for these OSes. -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' -+ ;; -+ -+ darwin* | rhapsody*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ lt_prog_compiler_pic_GCJ='-fno-common' -+ ;; -+ -+ msdosdjgpp*) -+ # Just because we use GCC doesn't mean we suddenly get shared libraries -+ # on systems that don't support them. -+ lt_prog_compiler_can_build_shared_GCJ=no -+ enable_shared=no -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ lt_prog_compiler_pic_GCJ=-Kconform_pic -+ fi -+ ;; -+ -+ hpux*) -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ lt_prog_compiler_pic_GCJ='-fPIC' -+ ;; -+ esac -+ ;; -+ -+ *) -+ lt_prog_compiler_pic_GCJ='-fPIC' -+ ;; -+ esac -+ else -+ # PORTME Check for flag to pass linker flags through the system compiler. -+ case $host_os in -+ aix*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ if test "$host_cpu" = ia64; then -+ # AIX 5 now supports IA64 processor -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ else -+ lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' -+ fi -+ ;; -+ darwin*) -+ # PIC is the default on this platform -+ # Common symbols not allowed in MH_DYLIB files -+ case $cc_basename in -+ xlc*) -+ lt_prog_compiler_pic_GCJ='-qnocommon' -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ ;; -+ esac -+ ;; -+ -+ mingw* | pw32* | os2*) -+ # This hack is so that the source file can tell whether it is being -+ # built for inclusion in a dll (and should export symbols for example). -+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' -+ ;; -+ -+ hpux9* | hpux10* | hpux11*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but -+ # not for PA HP-UX. -+ case $host_cpu in -+ hppa*64*|ia64*) -+ # +Z the default -+ ;; -+ *) -+ lt_prog_compiler_pic_GCJ='+Z' -+ ;; -+ esac -+ # Is there a better lt_prog_compiler_static that works with the bundled CC? -+ lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ # PIC (with -KPIC) is the default. -+ lt_prog_compiler_static_GCJ='-non_shared' -+ ;; -+ -+ newsos6) -+ lt_prog_compiler_pic_GCJ='-KPIC' -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ ;; -+ -+ linux*) -+ case $cc_basename in -+ icc* | ecc*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ lt_prog_compiler_pic_GCJ='-KPIC' -+ lt_prog_compiler_static_GCJ='-static' -+ ;; -+ pgcc* | pgf77* | pgf90* | pgf95*) -+ # Portland Group compilers (*not* the Pentium gcc compiler, -+ # which looks to be a dead project) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ lt_prog_compiler_pic_GCJ='-fpic' -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ ;; -+ ccc*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ # All Alpha code is PIC. -+ lt_prog_compiler_static_GCJ='-non_shared' -+ ;; -+ esac -+ ;; -+ -+ osf3* | osf4* | osf5*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ # All OSF/1 code is PIC. -+ lt_prog_compiler_static_GCJ='-non_shared' -+ ;; -+ -+ sco3.2v5*) -+ lt_prog_compiler_pic_GCJ='-Kpic' -+ lt_prog_compiler_static_GCJ='-dn' -+ ;; -+ -+ solaris*) -+ lt_prog_compiler_pic_GCJ='-KPIC' -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ case $cc_basename in -+ f77* | f90* | f95*) -+ lt_prog_compiler_wl_GCJ='-Qoption ld ';; -+ *) -+ lt_prog_compiler_wl_GCJ='-Wl,';; -+ esac -+ ;; -+ -+ sunos4*) -+ lt_prog_compiler_wl_GCJ='-Qoption ld ' -+ lt_prog_compiler_pic_GCJ='-PIC' -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ ;; -+ -+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ lt_prog_compiler_pic_GCJ='-KPIC' -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec ;then -+ lt_prog_compiler_pic_GCJ='-Kconform_pic' -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ fi -+ ;; -+ -+ unicos*) -+ lt_prog_compiler_wl_GCJ='-Wl,' -+ lt_prog_compiler_can_build_shared_GCJ=no -+ ;; -+ -+ uts4*) -+ lt_prog_compiler_pic_GCJ='-pic' -+ lt_prog_compiler_static_GCJ='-Bstatic' -+ ;; -+ -+ *) -+ lt_prog_compiler_can_build_shared_GCJ=no -+ ;; -+ esac -+ fi -+ -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 -+ -+# -+# Check to make sure the PIC flag actually works. -+# -+if test -n "$lt_prog_compiler_pic_GCJ"; then -+ -+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 -+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_prog_compiler_pic_works_GCJ=no -+ ac_outfile=conftest.$ac_objext -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ lt_compiler_flag="$lt_prog_compiler_pic_GCJ" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ # The option is referenced via a variable to avoid confusing sed. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:16229: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>conftest.err) -+ ac_status=$? -+ cat conftest.err >&5 -+ echo "$as_me:16233: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s "$ac_outfile"; then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings other than the usual output. -+ $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp -+ $SED '/^$/d' conftest.err >conftest.er2 -+ if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then -+ lt_prog_compiler_pic_works_GCJ=yes -+ fi -+ fi -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 -+ -+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then -+ case $lt_prog_compiler_pic_GCJ in -+ "" | " "*) ;; -+ *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; -+ esac -+else -+ lt_prog_compiler_pic_GCJ= -+ lt_prog_compiler_can_build_shared_GCJ=no -+fi -+ -+fi -+case $host_os in -+ # For platforms which do not support PIC, -DPIC is meaningless: -+ *djgpp*) -+ lt_prog_compiler_pic_GCJ= -+ ;; -+ *) -+ lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ lt_cv_prog_compiler_c_o_GCJ=no -+ $rm -r conftest 2>/dev/null -+ mkdir conftest -+ cd conftest -+ mkdir out -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ lt_compiler_flag="-o out/conftest2.$ac_objext" -+ # Insert the option either (1) after the last *FLAGS variable, or -+ # (2) before a word containing "conftest.", or (3) at the end. -+ # Note that $ac_compile itself does not contain backslashes and begins -+ # with a dollar sign (not a hyphen), so the echo should work correctly. -+ lt_compile=`echo "$ac_compile" | $SED \ -+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -+ -e 's:$: $lt_compiler_flag:'` -+ (eval echo "\"\$as_me:16291: $lt_compile\"" >&5) -+ (eval "$lt_compile" 2>out/conftest.err) -+ ac_status=$? -+ cat out/conftest.err >&5 -+ echo "$as_me:16295: \$? = $ac_status" >&5 -+ if (exit $ac_status) && test -s out/conftest2.$ac_objext -+ then -+ # The compiler can only warn and ignore the option if not recognized -+ # So say no if there are warnings -+ $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp -+ $SED '/^$/d' out/conftest.err >out/conftest.er2 -+ if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then -+ lt_cv_prog_compiler_c_o_GCJ=yes -+ fi -+ fi -+ chmod u+w . 2>&5 -+ $rm conftest* -+ # SGI C++ compiler will create directory out/ii_files/ for -+ # template instantiation -+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files -+ $rm out/* && rmdir out -+ cd .. -+ rmdir conftest -+ $rm conftest* -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 -+ -+ -+hard_links="nottested" -+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then -+ # do not overwrite the value of need_locks provided by the user -+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 -+ hard_links=yes -+ $rm conftest* -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ touch conftest.a -+ ln conftest.a conftest.b 2>&5 || hard_links=no -+ ln conftest.a conftest.b 2>/dev/null && hard_links=no -+ echo "$as_me:$LINENO: result: $hard_links" >&5 -+echo "${ECHO_T}$hard_links" >&6 -+ if test "$hard_links" = no; then -+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} -+ need_locks=warn -+ fi -+else -+ need_locks=no -+fi -+ -+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -+ -+ runpath_var= -+ allow_undefined_flag_GCJ= -+ enable_shared_with_static_runtimes_GCJ=no -+ archive_cmds_GCJ= -+ archive_expsym_cmds_GCJ= -+ old_archive_From_new_cmds_GCJ= -+ old_archive_from_expsyms_cmds_GCJ= -+ export_dynamic_flag_spec_GCJ= -+ whole_archive_flag_spec_GCJ= -+ thread_safe_flag_spec_GCJ= -+ hardcode_libdir_flag_spec_GCJ= -+ hardcode_libdir_flag_spec_ld_GCJ= -+ hardcode_libdir_separator_GCJ= -+ hardcode_direct_GCJ=no -+ hardcode_minus_L_GCJ=no -+ hardcode_shlibpath_var_GCJ=unsupported -+ link_all_deplibs_GCJ=unknown -+ hardcode_automatic_GCJ=no -+ module_cmds_GCJ= -+ module_expsym_cmds_GCJ= -+ always_export_symbols_GCJ=no -+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -+ # include_expsyms should be a list of space-separated symbols to be *always* -+ # included in the symbol list -+ include_expsyms_GCJ= -+ # exclude_expsyms can be an extended regexp of symbols to exclude -+ # it will be wrapped by ` (' and `)$', so one must not match beginning or -+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -+ # as well as any symbol that contains `d'. -+ exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" -+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -+ # platforms (ab)use it in PIC code, but their linkers get confused if -+ # the symbol is explicitly referenced. Since portable code cannot -+ # rely on this symbol name, it's probably fine to never include it in -+ # preloaded symbol tables. -+ extract_expsyms_cmds= -+ # Just being paranoid about ensuring that cc_basename is set. -+ for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ # FIXME: the MSVC++ port hasn't been tested in a loooong time -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ if test "$GCC" != yes; then -+ with_gnu_ld=no -+ fi -+ ;; -+ openbsd*) -+ with_gnu_ld=no -+ ;; -+ esac -+ -+ ld_shlibs_GCJ=yes -+ if test "$with_gnu_ld" = yes; then -+ # If archive_cmds runs LD, not CC, wlarc should be empty -+ wlarc='${wl}' -+ -+ # Set some defaults for GNU ld with shared library support. These -+ # are reset later if shared libraries are not supported. Putting them -+ # here allows them to be overridden if necessary. -+ runpath_var=LD_RUN_PATH -+ hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' -+ export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' -+ # ancient GNU ld didn't support --whole-archive et. al. -+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then -+ whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ else -+ whole_archive_flag_spec_GCJ= -+ fi -+ supports_anon_versioning=no -+ case `$LD -v 2>/dev/null` in -+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 -+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... -+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... -+ *\ 2.11.*) ;; # other 2.11 versions -+ *) supports_anon_versioning=yes ;; -+ esac -+ -+ # See if GNU ld supports shared libraries. -+ case $host_os in -+ aix3* | aix4* | aix5*) -+ # On AIX/PPC, the GNU linker is very broken -+ if test "$host_cpu" != ia64; then -+ ld_shlibs_GCJ=no -+ cat <&2 -+ -+*** Warning: the GNU linker, at least up to release 2.9.1, is reported -+*** to be unable to reliably create shared libraries on AIX. -+*** Therefore, libtool is disabling shared libraries support. If you -+*** really care for shared libraries, you may want to modify your PATH -+*** so that a non-GNU linker is found, and then restart. -+ -+EOF -+ fi -+ ;; -+ -+ amigaos*) -+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_minus_L_GCJ=yes -+ -+ # Samuel A. Falvo II reports -+ # that the semantics of dynamic libraries on AmigaOS, at least up -+ # to version 4, is to share data among multiple programs linked -+ # with the same dynamic library. Since this doesn't match the -+ # behavior of shared libraries on other platforms, we can't use -+ # them. -+ ld_shlibs_GCJ=no -+ ;; -+ -+ beos*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ allow_undefined_flag_GCJ=unsupported -+ # Joseph Beckenbach says some releases of gcc -+ # support --undefined. This deserves some investigation. FIXME -+ archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ else -+ ld_shlibs_GCJ=no -+ fi -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, -+ # as there is no search path for DLLs. -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ allow_undefined_flag_GCJ=unsupported -+ always_export_symbols_GCJ=no -+ enable_shared_with_static_runtimes_GCJ=yes -+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -+ -+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ # If the export-symbols file already is a .def file (1st line -+ # is EXPORTS), use it as is; otherwise, prepend... -+ archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -+ cp $export_symbols $output_objdir/$soname.def; -+ else -+ echo EXPORTS > $output_objdir/$soname.def; -+ cat $export_symbols >> $output_objdir/$soname.def; -+ fi~ -+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ else -+ ld_shlibs_GCJ=no -+ fi -+ ;; -+ -+ linux*) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ tmp_addflag= -+ case $cc_basename,$host_cpu in -+ pgcc*) # Portland Group C compiler -+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag' -+ ;; -+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers -+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' -+ tmp_addflag=' $pic_flag -Mnomain' ;; -+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 -+ tmp_addflag=' -i_dynamic' ;; -+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 -+ tmp_addflag=' -i_dynamic -nofor_main' ;; -+ ifc* | ifort*) # Intel Fortran compiler -+ tmp_addflag=' -nofor_main' ;; -+ esac -+ archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ -+ if test $supports_anon_versioning = yes; then -+ archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ -+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -+ $echo "local: *; };" >> $output_objdir/$libname.ver~ -+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' -+ fi -+ link_all_deplibs_GCJ=no -+ else -+ ld_shlibs_GCJ=no -+ fi -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' -+ wlarc= -+ else -+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ fi -+ ;; -+ -+ solaris* | sysv5*) -+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then -+ ld_shlibs_GCJ=no -+ cat <&2 -+ -+*** Warning: The releases 2.8.* of the GNU linker cannot reliably -+*** create shared libraries on Solaris systems. Therefore, libtool -+*** is disabling shared libraries support. We urge you to upgrade GNU -+*** binutils to release 2.9.1 or newer. Another option is to modify -+*** your PATH or compiler configuration so that the native linker is -+*** used, and then restart. -+ -+EOF -+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ ld_shlibs_GCJ=no -+ fi -+ ;; -+ -+ sunos4*) -+ archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ wlarc= -+ hardcode_direct_GCJ=yes -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ *) -+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then -+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ ld_shlibs_GCJ=no -+ fi -+ ;; -+ esac -+ -+ if test "$ld_shlibs_GCJ" = no; then -+ runpath_var= -+ hardcode_libdir_flag_spec_GCJ= -+ export_dynamic_flag_spec_GCJ= -+ whole_archive_flag_spec_GCJ= -+ fi -+ else -+ # PORTME fill in a description of your system's linker (not GNU ld) -+ case $host_os in -+ aix3*) -+ allow_undefined_flag_GCJ=unsupported -+ always_export_symbols_GCJ=yes -+ archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' -+ # Note: this linker hardcodes the directories in LIBPATH if there -+ # are no directories specified by -L. -+ hardcode_minus_L_GCJ=yes -+ if test "$GCC" = yes && test -z "$link_static_flag"; then -+ # Neither direct hardcoding nor static linking is supported with a -+ # broken collect2. -+ hardcode_direct_GCJ=unsupported -+ fi -+ ;; -+ -+ aix4* | aix5*) -+ if test "$host_cpu" = ia64; then -+ # On IA64, the linker does run time linking by default, so we don't -+ # have to do anything special. -+ aix_use_runtimelinking=no -+ exp_sym_flag='-Bexport' -+ no_entry_flag="" -+ else -+ # If we're using GNU nm, then we don't want the "-C" option. -+ # -C means demangle to AIX nm, but means don't demangle with GNU nm -+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then -+ export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ else -+ export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' -+ fi -+ aix_use_runtimelinking=no -+ -+ # Test if we are trying to use run time linking or normal -+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we -+ # need to do runtime linking. -+ case $host_os in aix4.[23]|aix4.[23].*|aix5*) -+ for ld_flag in $LDFLAGS; do -+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then -+ aix_use_runtimelinking=yes -+ break -+ fi -+ done -+ esac -+ -+ exp_sym_flag='-bexport' -+ no_entry_flag='-bnoentry' -+ fi -+ -+ # When large executables or shared objects are built, AIX ld can -+ # have problems creating the table of contents. If linking a library -+ # or program results in "error TOC overflow" add -mminimal-toc to -+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not -+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -+ -+ archive_cmds_GCJ='' -+ hardcode_direct_GCJ=yes -+ hardcode_libdir_separator_GCJ=':' -+ link_all_deplibs_GCJ=yes -+ -+ if test "$GCC" = yes; then -+ case $host_os in aix4.[012]|aix4.[012].*) -+ # We only want to do this on AIX 4.2 and lower, the check -+ # below for broken collect2 doesn't work under 4.3+ -+ collect2name=`${CC} -print-prog-name=collect2` -+ if test -f "$collect2name" && \ -+ strings "$collect2name" | grep resolve_lib_name >/dev/null -+ then -+ # We have reworked collect2 -+ hardcode_direct_GCJ=yes -+ else -+ # We have old collect2 -+ hardcode_direct_GCJ=unsupported -+ # It fails to find uninstalled libraries when the uninstalled -+ # path is not listed in the libpath. Setting hardcode_minus_L -+ # to unsupported forces relinking -+ hardcode_minus_L_GCJ=yes -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_libdir_separator_GCJ= -+ fi -+ esac -+ shared_flag='-shared' -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag="$shared_flag "'${wl}-G' -+ fi -+ else -+ # not using gcc -+ if test "$host_cpu" = ia64; then -+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release -+ # chokes on -Wl,-G. The following line is correct: -+ shared_flag='-G' -+ else -+ if test "$aix_use_runtimelinking" = yes; then -+ shared_flag='${wl}-G' -+ else -+ shared_flag='${wl}-bM:SRE' -+ fi -+ fi -+ fi -+ -+ # It seems that -bexpall does not export symbols beginning with -+ # underscore (_), so it is better to generate a list of symbols to export. -+ always_export_symbols_GCJ=yes -+ if test "$aix_use_runtimelinking" = yes; then -+ # Warning - without using the other runtime loading flags (-brtl), -+ # -berok will link without error, but may produce a broken library. -+ allow_undefined_flag_GCJ='-berok' -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" -+ archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" -+ else -+ if test "$host_cpu" = ia64; then -+ hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' -+ allow_undefined_flag_GCJ="-z nodefs" -+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" -+ else -+ # Determine the default libpath from the value encoded in an empty executable. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'` -+# Check for a 64-bit object if we didn't find anything. -+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -+}'`; fi -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -+ -+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" -+ # Warning - without using the other run time loading flags, -+ # -berok will link without error, but may produce a broken library. -+ no_undefined_flag_GCJ=' ${wl}-bernotok' -+ allow_undefined_flag_GCJ=' ${wl}-berok' -+ # -bexpall does not export symbols beginning with underscore (_) -+ always_export_symbols_GCJ=yes -+ # Exported symbols can be pulled into shared objects from archives -+ whole_archive_flag_spec_GCJ=' ' -+ archive_cmds_need_lc_GCJ=yes -+ # This is similar to how AIX traditionally builds its shared libraries. -+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' -+ fi -+ fi -+ ;; -+ -+ amigaos*) -+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_minus_L_GCJ=yes -+ # see comment about different semantics on the GNU ld section -+ ld_shlibs_GCJ=no -+ ;; -+ -+ bsdi[45]*) -+ export_dynamic_flag_spec_GCJ=-rdynamic -+ ;; -+ -+ cygwin* | mingw* | pw32*) -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ # hardcode_libdir_flag_spec is actually meaningless, as there is -+ # no search path for DLLs. -+ hardcode_libdir_flag_spec_GCJ=' ' -+ allow_undefined_flag_GCJ=unsupported -+ # Tell ltmain to make .lib files, not .a files. -+ libext=lib -+ # Tell ltmain to make .dll files, not .so files. -+ shrext_cmds=".dll" -+ # FIXME: Setting linknames here is a bad hack. -+ archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' -+ # The linker will automatically build a .lib file if we build a DLL. -+ old_archive_From_new_cmds_GCJ='true' -+ # FIXME: Should let the user specify the lib program. -+ old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' -+ fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' -+ enable_shared_with_static_runtimes_GCJ=yes -+ ;; -+ -+ darwin* | rhapsody*) -+ case $host_os in -+ rhapsody* | darwin1.[012]) -+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' -+ ;; -+ *) # Darwin 1.3 on -+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then -+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ else -+ case ${MACOSX_DEPLOYMENT_TARGET} in -+ 10.[012]) -+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' -+ ;; -+ 10.*) -+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' -+ ;; -+ esac -+ fi -+ ;; -+ esac -+ archive_cmds_need_lc_GCJ=no -+ hardcode_direct_GCJ=no -+ hardcode_automatic_GCJ=yes -+ hardcode_shlibpath_var_GCJ=unsupported -+ whole_archive_flag_spec_GCJ='' -+ link_all_deplibs_GCJ=yes -+ if test "$GCC" = yes ; then -+ output_verbose_link_cmd='echo' -+ archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' -+ module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ else -+ case $cc_basename in -+ xlc*) -+ output_verbose_link_cmd='echo' -+ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' -+ module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' -+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds -+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -+ ;; -+ *) -+ ld_shlibs_GCJ=no -+ ;; -+ esac -+ fi -+ ;; -+ -+ dgux*) -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ freebsd1*) -+ ld_shlibs_GCJ=no -+ ;; -+ -+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor -+ # support. Future versions do this automatically, but an explicit c++rt0.o -+ # does not break anything, and helps significantly (at the cost of a little -+ # extra space). -+ freebsd2.2*) -+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -+ hardcode_libdir_flag_spec_GCJ='-R$libdir' -+ hardcode_direct_GCJ=yes -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ # Unfortunately, older versions of FreeBSD 2 do not have this feature. -+ freebsd2*) -+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_GCJ=yes -+ hardcode_minus_L_GCJ=yes -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. -+ freebsd* | kfreebsd*-gnu | dragonfly*) -+ archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' -+ hardcode_libdir_flag_spec_GCJ='-R$libdir' -+ hardcode_direct_GCJ=yes -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ hpux9*) -+ if test "$GCC" = yes; then -+ archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ else -+ archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' -+ fi -+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator_GCJ=: -+ hardcode_direct_GCJ=yes -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L_GCJ=yes -+ export_dynamic_flag_spec_GCJ='${wl}-E' -+ ;; -+ -+ hpux10* | hpux11*) -+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*|ia64*) -+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ *) -+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -+ ;; -+ esac -+ else -+ case $host_cpu in -+ hppa*64*|ia64*) -+ archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ *) -+ archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -+ ;; -+ esac -+ fi -+ if test "$with_gnu_ld" = no; then -+ case $host_cpu in -+ hppa*64*) -+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' -+ hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' -+ hardcode_libdir_separator_GCJ=: -+ hardcode_direct_GCJ=no -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ ia64*) -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_direct_GCJ=no -+ hardcode_shlibpath_var_GCJ=no -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L_GCJ=yes -+ ;; -+ *) -+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator_GCJ=: -+ hardcode_direct_GCJ=yes -+ export_dynamic_flag_spec_GCJ='${wl}-E' -+ -+ # hardcode_minus_L: Not really in the search PATH, -+ # but as the default location of the library. -+ hardcode_minus_L_GCJ=yes -+ ;; -+ esac -+ fi -+ ;; -+ -+ irix5* | irix6* | nonstopux*) -+ if test "$GCC" = yes; then -+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' -+ fi -+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_GCJ=: -+ link_all_deplibs_GCJ=yes -+ ;; -+ -+ netbsd* | netbsdelf*-gnu | knetbsd*-gnu) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out -+ else -+ archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF -+ fi -+ hardcode_libdir_flag_spec_GCJ='-R$libdir' -+ hardcode_direct_GCJ=yes -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ newsos6) -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_GCJ=yes -+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_GCJ=: -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ openbsd*) -+ hardcode_direct_GCJ=yes -+ hardcode_shlibpath_var_GCJ=no -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' -+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' -+ export_dynamic_flag_spec_GCJ='${wl}-E' -+ else -+ case $host_os in -+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) -+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec_GCJ='-R$libdir' -+ ;; -+ *) -+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' -+ ;; -+ esac -+ fi -+ ;; -+ -+ os2*) -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_minus_L_GCJ=yes -+ allow_undefined_flag_GCJ=unsupported -+ archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' -+ old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' -+ ;; -+ -+ osf3*) -+ if test "$GCC" = yes; then -+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ else -+ allow_undefined_flag_GCJ=' -expect_unresolved \*' -+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ fi -+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator_GCJ=: -+ ;; -+ -+ osf4* | osf5*) # as osf3* with the addition of -msym flag -+ if test "$GCC" = yes; then -+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' -+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' -+ else -+ allow_undefined_flag_GCJ=' -expect_unresolved \*' -+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' -+ archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ -+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' -+ -+ # Both c and cxx compiler support -rpath directly -+ hardcode_libdir_flag_spec_GCJ='-rpath $libdir' -+ fi -+ hardcode_libdir_separator_GCJ=: -+ ;; -+ -+ sco3.2v5*) -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var_GCJ=no -+ export_dynamic_flag_spec_GCJ='${wl}-Bexport' -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ;; -+ -+ solaris*) -+ no_undefined_flag_GCJ=' -z text' -+ if test "$GCC" = yes; then -+ wlarc='${wl}' -+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' -+ else -+ wlarc='' -+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ fi -+ hardcode_libdir_flag_spec_GCJ='-R$libdir' -+ hardcode_shlibpath_var_GCJ=no -+ case $host_os in -+ solaris2.[0-5] | solaris2.[0-5].*) ;; -+ *) -+ # The compiler driver will combine linker options so we -+ # cannot just pass the convience library names through -+ # without $wl, iff we do not link with $LD. -+ # Luckily, gcc supports the same syntax we need for Sun Studio. -+ # Supported since Solaris 2.6 (maybe 2.5.1?) -+ case $wlarc in -+ '') -+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; -+ *) -+ whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; -+ esac ;; -+ esac -+ link_all_deplibs_GCJ=yes -+ ;; -+ -+ sunos4*) -+ if test "x$host_vendor" = xsequent; then -+ # Use $CC to link under sequent, because it throws in some extra .o -+ # files that make .init and .fini sections work. -+ archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' -+ fi -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_direct_GCJ=yes -+ hardcode_minus_L_GCJ=yes -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ sysv4) -+ case $host_vendor in -+ sni) -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_GCJ=yes # is this really true??? -+ ;; -+ siemens) -+ ## LD is ld it makes a PLAMLIB -+ ## CC just makes a GrossModule. -+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ reload_cmds_GCJ='$CC -r -o $output$reload_objs' -+ hardcode_direct_GCJ=no -+ ;; -+ motorola) -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie -+ ;; -+ esac -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ sysv4.3*) -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var_GCJ=no -+ export_dynamic_flag_spec_GCJ='-Bexport' -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_shlibpath_var_GCJ=no -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ld_shlibs_GCJ=yes -+ fi -+ ;; -+ -+ sysv4.2uw2*) -+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_direct_GCJ=yes -+ hardcode_minus_L_GCJ=no -+ hardcode_shlibpath_var_GCJ=no -+ hardcode_runpath_var=yes -+ runpath_var=LD_RUN_PATH -+ ;; -+ -+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) -+ no_undefined_flag_GCJ='${wl}-z ${wl}text' -+ if test "$GCC" = yes; then -+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ else -+ archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' -+ fi -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ sysv5*) -+ no_undefined_flag_GCJ=' -z text' -+ # $CC -shared without GNU ld will not create a library from C++ -+ # object files and a static libstdc++, better avoid it by now -+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' -+ hardcode_libdir_flag_spec_GCJ= -+ hardcode_shlibpath_var_GCJ=no -+ runpath_var='LD_RUN_PATH' -+ ;; -+ -+ uts4*) -+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -+ hardcode_libdir_flag_spec_GCJ='-L$libdir' -+ hardcode_shlibpath_var_GCJ=no -+ ;; -+ -+ *) -+ ld_shlibs_GCJ=no -+ ;; -+ esac -+ fi -+ -+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -+echo "${ECHO_T}$ld_shlibs_GCJ" >&6 -+test "$ld_shlibs_GCJ" = no && can_build_shared=no -+ -+variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -+if test "$GCC" = yes; then -+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -+fi -+ -+# -+# Do we need to explicitly link libc? -+# -+case "x$archive_cmds_need_lc_GCJ" in -+x|xyes) -+ # Assume -lc should be added -+ archive_cmds_need_lc_GCJ=yes -+ -+ if test "$enable_shared" = yes && test "$GCC" = yes; then -+ case $archive_cmds_GCJ in -+ *'~'*) -+ # FIXME: we may have to deal with multi-command sequences. -+ ;; -+ '$CC '*) -+ # Test whether the compiler implicitly links with -lc since on some -+ # systems, -lgcc has to come before -lc. If gcc already passes -lc -+ # to ld, don't add -lc before -lgcc. -+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 -+ $rm conftest* -+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext -+ -+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } 2>conftest.err; then -+ soname=conftest -+ lib=conftest -+ libobjs=conftest.$ac_objext -+ deplibs= -+ wl=$lt_prog_compiler_wl_GCJ -+ compiler_flags=-v -+ linker_flags=-v -+ verstring= -+ output_objdir=. -+ libname=conftest -+ lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ -+ allow_undefined_flag_GCJ= -+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 -+ (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+ then -+ archive_cmds_need_lc_GCJ=no -+ else -+ archive_cmds_need_lc_GCJ=yes -+ fi -+ allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag -+ else -+ cat conftest.err 1>&5 -+ fi -+ $rm conftest* -+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 -+ ;; -+ esac -+ fi -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -+library_names_spec= -+libname_spec='lib$name' -+soname_spec= -+shrext_cmds=".so" -+postinstall_cmds= -+postuninstall_cmds= -+finish_cmds= -+finish_eval= -+shlibpath_var= -+shlibpath_overrides_runpath=unknown -+version_type=none -+dynamic_linker="$host_os ld.so" -+sys_lib_dlsearch_path_spec="/lib /usr/lib" -+if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then -+ # if the path contains ";" then we assume it to be the separator -+ # otherwise default to the standard path separator (i.e. ":") - it is -+ # assumed that no part of a normal pathname contains ";" but that should -+ # okay in the real world where ";" in dirpaths is itself problematic. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+else -+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -+fi -+need_lib_prefix=unknown -+hardcode_into_libs=no -+ -+# when you set need_version to no, make sure it does not cause -set_version -+# flags to be left without arguments -+need_version=unknown -+ -+case $host_os in -+aix3*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' -+ shlibpath_var=LIBPATH -+ -+ # AIX 3 has no versioning support, so we append a major version to the name. -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ -+aix4* | aix5*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ hardcode_into_libs=yes -+ if test "$host_cpu" = ia64; then -+ # AIX 5 supports IA64 -+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ else -+ # With GCC up to 2.95.x, collect2 would create an import file -+ # for dependence libraries. The import file would start with -+ # the line `#! .'. This would cause the generated library to -+ # depend on `.', always an invalid library. This was fixed in -+ # development snapshots of GCC prior to 3.0. -+ case $host_os in -+ aix4 | aix4.[01] | aix4.[01].*) -+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' -+ echo ' yes ' -+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then -+ : -+ else -+ can_build_shared=no -+ fi -+ ;; -+ esac -+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct -+ # soname into executable. Probably we can add versioning support to -+ # collect2, so additional links can be useful in future. -+ if test "$aix_use_runtimelinking" = yes; then -+ # If using run time linking (on AIX 4.2 or later) use lib.so -+ # instead of lib.a to let people know that these are not -+ # typical AIX shared libraries. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ else -+ # We preserve .a as extension for shared libraries through AIX4.2 -+ # and later when we are not doing run time linking. -+ library_names_spec='${libname}${release}.a $libname.a' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ fi -+ shlibpath_var=LIBPATH -+ fi -+ ;; -+ -+amigaos*) -+ library_names_spec='$libname.ixlibrary $libname.a' -+ # Create ${libname}_ixlibrary.a entries in /sys/libs. -+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' -+ ;; -+ -+beos*) -+ library_names_spec='${libname}${shared_ext}' -+ dynamic_linker="$host_os ld.so" -+ shlibpath_var=LIBRARY_PATH -+ ;; -+ -+bsdi[45]*) -+ version_type=linux -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -+ # the default ld.so.conf also contains /usr/contrib/lib and -+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -+ # libtool to hard-code these into programs -+ ;; -+ -+cygwin* | mingw* | pw32*) -+ version_type=windows -+ shrext_cmds=".dll" -+ need_version=no -+ need_lib_prefix=no -+ -+ case $GCC,$host_os in -+ yes,cygwin* | yes,mingw* | yes,pw32*) -+ library_names_spec='$libname.dll.a' -+ # DLL is installed to $(libdir)/../bin by postinstall_cmds -+ postinstall_cmds='base_file=`basename \${file}`~ -+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ -+ dldir=$destdir/`dirname \$dlpath`~ -+ test -d \$dldir || mkdir -p \$dldir~ -+ $install_prog $dir/$dlname \$dldir/$dlname~ -+ chmod a+x \$dldir/$dlname' -+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ -+ dlpath=$dir/\$dldll~ -+ $rm \$dlpath' -+ shlibpath_overrides_runpath=yes -+ -+ case $host_os in -+ cygwin*) -+ # Cygwin DLLs use 'cyg' prefix rather than 'lib' -+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" -+ ;; -+ mingw*) -+ # MinGW DLLs use traditional 'lib' prefix -+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` -+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then -+ # It is most probably a Windows format PATH printed by -+ # mingw gcc, but we are running on Cygwin. Gcc prints its search -+ # path with ; separators, and with drive letters. We can handle the -+ # drive letters (cygwin fileutils understands them), so leave them, -+ # especially as we might pass files found there to a mingw objdump, -+ # which wouldn't understand a cygwinified path. Ahh. -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` -+ else -+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` -+ fi -+ ;; -+ pw32*) -+ # pw32 DLLs use 'pw' prefix rather than 'lib' -+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -+ ;; -+ esac -+ ;; -+ -+ *) -+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' -+ ;; -+ esac -+ dynamic_linker='Win32 ld.exe' -+ # FIXME: first we should search . and the directory the executable is in -+ shlibpath_var=PATH -+ ;; -+ -+darwin* | rhapsody*) -+ dynamic_linker="$host_os dyld" -+ version_type=darwin -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' -+ soname_spec='${libname}${release}${major}$shared_ext' -+ shlibpath_overrides_runpath=yes -+ shlibpath_var=DYLD_LIBRARY_PATH -+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. -+ if test "$GCC" = yes; then -+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` -+ else -+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' -+ fi -+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' -+ ;; -+ -+dgux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+freebsd1*) -+ dynamic_linker=no -+ ;; -+ -+kfreebsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+freebsd* | dragonfly*) -+ # DragonFly does not have aout. When/if they implement a new -+ # versioning mechanism, adjust this. -+ if test -x /usr/bin/objformat; then -+ objformat=`/usr/bin/objformat` -+ else -+ case $host_os in -+ freebsd[123]*) objformat=aout ;; -+ *) objformat=elf ;; -+ esac -+ fi -+ version_type=freebsd-$objformat -+ case $version_type in -+ freebsd-elf*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' -+ need_version=no -+ need_lib_prefix=no -+ ;; -+ freebsd-*) -+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' -+ need_version=yes -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_os in -+ freebsd2*) -+ shlibpath_overrides_runpath=yes -+ ;; -+ freebsd3.[01]* | freebsdelf3.[01]*) -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ *) # from 3.2 on -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ ;; -+ esac -+ ;; -+ -+gnu*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ hardcode_into_libs=yes -+ ;; -+ -+hpux9* | hpux10* | hpux11*) -+ # Give a soname corresponding to the major version so that dld.sl refuses to -+ # link against other versions. -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ case $host_cpu in -+ ia64*) -+ shrext_cmds='.so' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.so" -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ if test "X$HPUX_IA64_MODE" = X32; then -+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" -+ else -+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" -+ fi -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ hppa*64*) -+ shrext_cmds='.sl' -+ hardcode_into_libs=yes -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH -+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" -+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec -+ ;; -+ *) -+ shrext_cmds='.sl' -+ dynamic_linker="$host_os dld.sl" -+ shlibpath_var=SHLIB_PATH -+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ ;; -+ esac -+ # HP-UX runs *really* slowly unless shared libraries are mode 555. -+ postinstall_cmds='chmod 555 $lib' -+ ;; -+ -+irix5* | irix6* | nonstopux*) -+ case $host_os in -+ nonstopux*) version_type=nonstopux ;; -+ *) -+ if test "$lt_cv_prog_gnu_ld" = yes; then -+ version_type=linux -+ else -+ version_type=irix -+ fi ;; -+ esac -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' -+ case $host_os in -+ irix5* | nonstopux*) -+ libsuff= shlibsuff= -+ ;; -+ *) -+ case $LD in # libtool.m4 will add one of these switches to LD -+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") -+ libsuff= shlibsuff= libmagic=32-bit;; -+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") -+ libsuff=32 shlibsuff=N32 libmagic=N32;; -+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") -+ libsuff=64 shlibsuff=64 libmagic=64-bit;; -+ *) libsuff= shlibsuff= libmagic=never-match;; -+ esac -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -+ hardcode_into_libs=yes -+ ;; -+ -+# No shared lib support for Linux oldld, aout, or coff. -+linux*oldld* | linux*aout* | linux*coff*) -+ dynamic_linker=no -+ ;; -+ -+# This must be Linux ELF. -+linux*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ # This implies no fast_install, which is unacceptable. -+ # Some rework will be needed to allow for fast_install -+ # before this can be enabled. -+ hardcode_into_libs=yes -+ -+ # Append ld.so.conf contents to the search path -+ if test -f /etc/ld.so.conf; then -+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` -+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" -+ fi -+ -+ # We used to test for /lib/ld.so.1 and disable shared libraries on -+ # powerpc, because MkLinux only supported shared libraries with the -+ # GNU dynamic linker. Since this was broken with cross compilers, -+ # most powerpc-linux boxes support dynamic linking these days and -+ # people can always --disable-shared, the test was removed, and we -+ # assume the GNU/Linux dynamic linker is in use. -+ dynamic_linker='GNU/Linux ld.so' -+ ;; -+ -+netbsdelf*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='NetBSD ld.elf_so' -+ ;; -+ -+knetbsd*-gnu) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ hardcode_into_libs=yes -+ dynamic_linker='GNU ld.so' -+ ;; -+ -+netbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ need_version=no -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ dynamic_linker='NetBSD (a.out) ld.so' -+ else -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ dynamic_linker='NetBSD ld.elf_so' -+ fi -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ ;; -+ -+newsos6) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+nto-qnx*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ ;; -+ -+openbsd*) -+ version_type=sunos -+ need_lib_prefix=no -+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. -+ case $host_os in -+ openbsd3.3 | openbsd3.3.*) need_version=yes ;; -+ *) need_version=no ;; -+ esac -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -+ case $host_os in -+ openbsd2.[89] | openbsd2.[89].*) -+ shlibpath_overrides_runpath=no -+ ;; -+ *) -+ shlibpath_overrides_runpath=yes -+ ;; -+ esac -+ else -+ shlibpath_overrides_runpath=yes -+ fi -+ ;; -+ -+os2*) -+ libname_spec='$name' -+ shrext_cmds=".dll" -+ need_lib_prefix=no -+ library_names_spec='$libname${shared_ext} $libname.a' -+ dynamic_linker='OS/2 ld.exe' -+ shlibpath_var=LIBPATH -+ ;; -+ -+osf3* | osf4* | osf5*) -+ version_type=osf -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -+ ;; -+ -+sco3.2v5*) -+ version_type=osf -+ soname_spec='${libname}${release}${shared_ext}$major' -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+solaris*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ hardcode_into_libs=yes -+ # ldd complains unless libraries are executable -+ postinstall_cmds='chmod +x $lib' -+ ;; -+ -+sunos4*) -+ version_type=sunos -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' -+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ if test "$with_gnu_ld" = yes; then -+ need_lib_prefix=no -+ fi -+ need_version=yes -+ ;; -+ -+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ case $host_vendor in -+ sni) -+ shlibpath_overrides_runpath=no -+ need_lib_prefix=no -+ export_dynamic_flag_spec='${wl}-Blargedynsym' -+ runpath_var=LD_RUN_PATH -+ ;; -+ siemens) -+ need_lib_prefix=no -+ ;; -+ motorola) -+ need_lib_prefix=no -+ need_version=no -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -+ ;; -+ esac -+ ;; -+ -+sysv4*MP*) -+ if test -d /usr/nec ;then -+ version_type=linux -+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' -+ soname_spec='$libname${shared_ext}.$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ fi -+ ;; -+ -+uts4*) -+ version_type=linux -+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -+ soname_spec='${libname}${release}${shared_ext}$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+*) -+ dynamic_linker=no -+ ;; -+esac -+echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -+echo "${ECHO_T}$dynamic_linker" >&6 -+test "$dynamic_linker" = no && can_build_shared=no -+ -+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -+hardcode_action_GCJ= -+if test -n "$hardcode_libdir_flag_spec_GCJ" || \ -+ test -n "$runpath_var_GCJ" || \ -+ test "X$hardcode_automatic_GCJ" = "Xyes" ; then -+ -+ # We can hardcode non-existant directories. -+ if test "$hardcode_direct_GCJ" != no && -+ # If the only mechanism to avoid hardcoding is shlibpath_var, we -+ # have to relink, otherwise we might link with an installed library -+ # when we should be linking with a yet-to-be-installed one -+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && -+ test "$hardcode_minus_L_GCJ" != no; then -+ # Linking always hardcodes the temporary library directory. -+ hardcode_action_GCJ=relink -+ else -+ # We can link without hardcoding, and we can hardcode nonexisting dirs. -+ hardcode_action_GCJ=immediate -+ fi -+else -+ # We cannot hardcode anything, or else we can only hardcode existing -+ # directories. -+ hardcode_action_GCJ=unsupported -+fi -+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -+echo "${ECHO_T}$hardcode_action_GCJ" >&6 -+ -+if test "$hardcode_action_GCJ" = relink; then -+ # Fast installation is not supported -+ enable_fast_install=no -+elif test "$shlibpath_overrides_runpath" = yes || -+ test "$enable_shared" = no; then -+ # Fast installation is not necessary -+ enable_fast_install=needless -+fi -+ -+striplib= -+old_striplib= -+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then -+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" -+ test -z "$striplib" && striplib="$STRIP --strip-unneeded" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+else -+# FIXME - insert some real tests, host_os isn't really good enough -+ case $host_os in -+ darwin*) -+ if test -n "$STRIP" ; then -+ striplib="$STRIP -x" -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+ else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ ;; -+ *) -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+ ;; -+ esac -+fi -+ -+if test "x$enable_dlopen" != xyes; then -+ enable_dlopen=unknown -+ enable_dlopen_self=unknown -+ enable_dlopen_self_static=unknown -+else -+ lt_cv_dlopen=no -+ lt_cv_dlopen_libs= -+ -+ case $host_os in -+ beos*) -+ lt_cv_dlopen="load_add_on" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ ;; -+ -+ mingw* | pw32*) -+ lt_cv_dlopen="LoadLibrary" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ cygwin*) -+ lt_cv_dlopen="dlopen" -+ lt_cv_dlopen_libs= -+ ;; -+ -+ darwin*) -+ # if libdl is installed we need to link against it -+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -+if test "${ac_cv_lib_dl_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldl $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dl_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dl_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -+if test $ac_cv_lib_dl_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -+else -+ -+ lt_cv_dlopen="dyld" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ -+fi -+ -+ ;; -+ -+ *) -+ echo "$as_me:$LINENO: checking for shl_load" >&5 -+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -+if test "${ac_cv_func_shl_load+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define shl_load to an innocuous variant, in case declares shl_load. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define shl_load innocuous_shl_load -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char shl_load (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef shl_load -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char shl_load (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_shl_load) || defined (__stub___shl_load) -+choke me -+#else -+char (*f) () = shl_load; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != shl_load; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_func_shl_load=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_func_shl_load=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -+echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -+if test $ac_cv_func_shl_load = yes; then -+ lt_cv_dlopen="shl_load" -+else -+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -+if test "${ac_cv_lib_dld_shl_load+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char shl_load (); -+int -+main () -+{ -+shl_load (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dld_shl_load=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dld_shl_load=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -+if test $ac_cv_lib_dld_shl_load = yes; then -+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -+else -+ echo "$as_me:$LINENO: checking for dlopen" >&5 -+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -+if test "${ac_cv_func_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define dlopen to an innocuous variant, in case declares dlopen. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define dlopen innocuous_dlopen -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char dlopen (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef dlopen -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_dlopen) || defined (__stub___dlopen) -+choke me -+#else -+char (*f) () = dlopen; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != dlopen; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_func_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_func_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -+if test $ac_cv_func_dlopen = yes; then -+ lt_cv_dlopen="dlopen" -+else -+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -+if test "${ac_cv_lib_dl_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldl $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dl_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dl_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -+if test $ac_cv_lib_dl_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -+else -+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -+if test "${ac_cv_lib_svld_dlopen+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lsvld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dlopen (); -+int -+main () -+{ -+dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_svld_dlopen=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_svld_dlopen=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -+if test $ac_cv_lib_svld_dlopen = yes; then -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -+else -+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -+if test "${ac_cv_lib_dld_dld_link+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldld $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char dld_link (); -+int -+main () -+{ -+dld_link (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_dld_dld_link=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_lib_dld_dld_link=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -+if test $ac_cv_lib_dld_dld_link = yes; then -+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ ;; -+ esac -+ -+ if test "x$lt_cv_dlopen" != xno; then -+ enable_dlopen=yes -+ else -+ enable_dlopen=no -+ fi -+ -+ case $lt_cv_dlopen in -+ dlopen) -+ save_CPPFLAGS="$CPPFLAGS" -+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -+ -+ save_LDFLAGS="$LDFLAGS" -+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -+ -+ save_LIBS="$LIBS" -+ LIBS="$lt_cv_dlopen_libs $LIBS" -+ -+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -+if test "${lt_cv_dlopen_self+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ lt_cv_dlopen_self=cross -+else -+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -+ lt_status=$lt_dlunknown -+ cat > conftest.$ac_ext < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LT_DLGLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LT_DLGLOBAL DL_GLOBAL -+# else -+# define LT_DLGLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LT_DLLAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LT_DLLAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LT_DLLAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LT_DLLAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LT_DLLAZY_OR_NOW DL_NOW -+# else -+# define LT_DLLAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+#ifdef __cplusplus -+extern "C" void exit (int); -+#endif -+ -+void fnord() { int i=42;} -+int main () -+{ -+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -+ int status = $lt_dlunknown; -+ -+ if (self) -+ { -+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -+ /* dlclose (self); */ -+ } -+ -+ exit (status); -+} -+EOF -+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -+ (./conftest; exit; ) >&5 2>/dev/null -+ lt_status=$? -+ case x$lt_status in -+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; -+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; -+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;; -+ esac -+ else : -+ # compilation failed -+ lt_cv_dlopen_self=no -+ fi -+fi -+rm -fr conftest* -+ -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -+echo "${ECHO_T}$lt_cv_dlopen_self" >&6 -+ -+ if test "x$lt_cv_dlopen_self" = xyes; then -+ LDFLAGS="$LDFLAGS $link_static_flag" -+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -+if test "${lt_cv_dlopen_self_static+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ lt_cv_dlopen_self_static=cross -+else -+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -+ lt_status=$lt_dlunknown -+ cat > conftest.$ac_ext < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LT_DLGLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LT_DLGLOBAL DL_GLOBAL -+# else -+# define LT_DLGLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LT_DLLAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LT_DLLAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LT_DLLAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LT_DLLAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LT_DLLAZY_OR_NOW DL_NOW -+# else -+# define LT_DLLAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+#ifdef __cplusplus -+extern "C" void exit (int); -+#endif -+ -+void fnord() { int i=42;} -+int main () -+{ -+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -+ int status = $lt_dlunknown; -+ -+ if (self) -+ { -+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -+ /* dlclose (self); */ -+ } -+ -+ exit (status); -+} -+EOF -+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -+ (./conftest; exit; ) >&5 2>/dev/null -+ lt_status=$? -+ case x$lt_status in -+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; -+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; -+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; -+ esac -+ else : -+ # compilation failed -+ lt_cv_dlopen_self_static=no -+ fi -+fi -+rm -fr conftest* -+ -+ -+fi -+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 -+ fi -+ -+ CPPFLAGS="$save_CPPFLAGS" -+ LDFLAGS="$save_LDFLAGS" -+ LIBS="$save_LIBS" - ;; -- yes,pw32*) -- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' -+ esac -+ -+ case $lt_cv_dlopen_self in -+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; -+ *) enable_dlopen_self=unknown ;; -+ esac -+ -+ case $lt_cv_dlopen_self_static in -+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; -+ *) enable_dlopen_self_static=unknown ;; -+ esac -+fi -+ -+ -+# The else clause should only fire when bootstrapping the -+# libtool distribution, otherwise you forgot to ship ltmain.sh -+# with your package, and you will get complaints that there are -+# no rules to generate ltmain.sh. -+if test -f "$ltmain"; then -+ # See if we are running on zsh, and set the options which allow our commands through -+ # without removal of \ escapes. -+ if test -n "${ZSH_VERSION+set}" ; then -+ setopt NO_GLOB_SUBST -+ fi -+ # Now quote all the things that may contain metacharacters while being -+ # careful not to overquote the AC_SUBSTed values. We take copies of the -+ # variables and quote the copies for generation of the libtool script. -+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ -+ SED SHELL STRIP \ -+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ -+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ -+ deplibs_check_method reload_flag reload_cmds need_locks \ -+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ -+ lt_cv_sys_global_symbol_to_c_name_address \ -+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -+ old_postinstall_cmds old_postuninstall_cmds \ -+ compiler_GCJ \ -+ CC_GCJ \ -+ LD_GCJ \ -+ lt_prog_compiler_wl_GCJ \ -+ lt_prog_compiler_pic_GCJ \ -+ lt_prog_compiler_static_GCJ \ -+ lt_prog_compiler_no_builtin_flag_GCJ \ -+ export_dynamic_flag_spec_GCJ \ -+ thread_safe_flag_spec_GCJ \ -+ whole_archive_flag_spec_GCJ \ -+ enable_shared_with_static_runtimes_GCJ \ -+ old_archive_cmds_GCJ \ -+ old_archive_from_new_cmds_GCJ \ -+ predep_objects_GCJ \ -+ postdep_objects_GCJ \ -+ predeps_GCJ \ -+ postdeps_GCJ \ -+ compiler_lib_search_path_GCJ \ -+ archive_cmds_GCJ \ -+ archive_expsym_cmds_GCJ \ -+ postinstall_cmds_GCJ \ -+ postuninstall_cmds_GCJ \ -+ old_archive_from_expsyms_cmds_GCJ \ -+ allow_undefined_flag_GCJ \ -+ no_undefined_flag_GCJ \ -+ export_symbols_cmds_GCJ \ -+ hardcode_libdir_flag_spec_GCJ \ -+ hardcode_libdir_flag_spec_ld_GCJ \ -+ hardcode_libdir_separator_GCJ \ -+ hardcode_automatic_GCJ \ -+ module_cmds_GCJ \ -+ module_expsym_cmds_GCJ \ -+ lt_cv_prog_compiler_c_o_GCJ \ -+ exclude_expsyms_GCJ \ -+ include_expsyms_GCJ; do -+ -+ case $var in -+ old_archive_cmds_GCJ | \ -+ old_archive_from_new_cmds_GCJ | \ -+ archive_cmds_GCJ | \ -+ archive_expsym_cmds_GCJ | \ -+ module_cmds_GCJ | \ -+ module_expsym_cmds_GCJ | \ -+ old_archive_from_expsyms_cmds_GCJ | \ -+ export_symbols_cmds_GCJ | \ -+ extract_expsyms_cmds | reload_cmds | finish_cmds | \ -+ postinstall_cmds | postuninstall_cmds | \ -+ old_postinstall_cmds | old_postuninstall_cmds | \ -+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) -+ # Double-quote double-evaled strings. -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" -+ ;; -+ *) -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -+ ;; -+ esac -+ done -+ -+ case $lt_echo in -+ *'\$0 --fallback-echo"') -+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; -- *) -- library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' -+ esac -+ -+cfgfile="$ofile" -+ -+ cat <<__EOF__ >> "$cfgfile" -+# ### BEGIN LIBTOOL TAG CONFIG: $tagname -+ -+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -+ -+# Shell to use when invoking shell scripts. -+SHELL=$lt_SHELL -+ -+# Whether or not to build shared libraries. -+build_libtool_libs=$enable_shared -+ -+# Whether or not to build static libraries. -+build_old_libs=$enable_static -+ -+# Whether or not to add -lc for building shared libraries. -+build_libtool_need_lc=$archive_cmds_need_lc_GCJ -+ -+# Whether or not to disallow shared libs when runtime libs are static -+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ -+ -+# Whether or not to optimize for fast installation. -+fast_install=$enable_fast_install -+ -+# The host system. -+host_alias=$host_alias -+host=$host -+host_os=$host_os -+ -+# The build system. -+build_alias=$build_alias -+build=$build -+build_os=$build_os -+ -+# An echo program that does not interpret backslashes. -+echo=$lt_echo -+ -+# The archiver. -+AR=$lt_AR -+AR_FLAGS=$lt_AR_FLAGS -+ -+# A C compiler. -+LTCC=$lt_LTCC -+ -+# A language-specific compiler. -+CC=$lt_compiler_GCJ -+ -+# Is the compiler the GNU C compiler? -+with_gcc=$GCC_GCJ -+ -+# An ERE matcher. -+EGREP=$lt_EGREP -+ -+# The linker used to build libraries. -+LD=$lt_LD_GCJ -+ -+# Whether we need hard or soft links. -+LN_S=$lt_LN_S -+ -+# A BSD-compatible nm program. -+NM=$lt_NM -+ -+# A symbol stripping program -+STRIP=$lt_STRIP -+ -+# Used to examine libraries when file_magic_cmd begins "file" -+MAGIC_CMD=$MAGIC_CMD -+ -+# Used on cygwin: DLL creation program. -+DLLTOOL="$DLLTOOL" -+ -+# Used on cygwin: object dumper. -+OBJDUMP="$OBJDUMP" -+ -+# Used on cygwin: assembler. -+AS="$AS" -+ -+# The name of the directory that contains temporary libtool files. -+objdir=$objdir -+ -+# How to create reloadable object files. -+reload_flag=$lt_reload_flag -+reload_cmds=$lt_reload_cmds -+ -+# How to pass a linker flag through the compiler. -+wl=$lt_lt_prog_compiler_wl_GCJ -+ -+# Object file suffix (normally "o"). -+objext="$ac_objext" -+ -+# Old archive suffix (normally "a"). -+libext="$libext" -+ -+# Shared library suffix (normally ".so"). -+shrext_cmds='$shrext_cmds' -+ -+# Executable file suffix (normally ""). -+exeext="$exeext" -+ -+# Additional compiler flags for building library objects. -+pic_flag=$lt_lt_prog_compiler_pic_GCJ -+pic_mode=$pic_mode -+ -+# What is the maximum length of a command? -+max_cmd_len=$lt_cv_sys_max_cmd_len -+ -+# Does compiler simultaneously support -c and -o options? -+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ -+ -+# Must we lock files when doing compilation? -+need_locks=$lt_need_locks -+ -+# Do we need the lib prefix for modules? -+need_lib_prefix=$need_lib_prefix -+ -+# Do we need a version for libraries? -+need_version=$need_version -+ -+# Whether dlopen is supported. -+dlopen_support=$enable_dlopen -+ -+# Whether dlopen of programs is supported. -+dlopen_self=$enable_dlopen_self -+ -+# Whether dlopen of statically linked programs is supported. -+dlopen_self_static=$enable_dlopen_self_static -+ -+# Compiler flag to prevent dynamic linking. -+link_static_flag=$lt_lt_prog_compiler_static_GCJ -+ -+# Compiler flag to turn off builtin functions. -+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ -+ -+# Compiler flag to allow reflexive dlopens. -+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ -+ -+# Compiler flag to generate shared objects directly from archives. -+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ -+ -+# Compiler flag to generate thread-safe objects. -+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ -+ -+# Library versioning type. -+version_type=$version_type -+ -+# Format of library name prefix. -+libname_spec=$lt_libname_spec -+ -+# List of archive names. First name is the real one, the rest are links. -+# The last name is the one that the linker finds with -lNAME. -+library_names_spec=$lt_library_names_spec -+ -+# The coded name of the library, if different from the real name. -+soname_spec=$lt_soname_spec -+ -+# Commands used to build and install an old-style archive. -+RANLIB=$lt_RANLIB -+old_archive_cmds=$lt_old_archive_cmds_GCJ -+old_postinstall_cmds=$lt_old_postinstall_cmds -+old_postuninstall_cmds=$lt_old_postuninstall_cmds -+ -+# Create an old-style archive from a shared archive. -+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ -+ -+# Create a temporary old-style archive to link instead of a shared archive. -+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ -+ -+# Commands used to build and install a shared archive. -+archive_cmds=$lt_archive_cmds_GCJ -+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -+postinstall_cmds=$lt_postinstall_cmds -+postuninstall_cmds=$lt_postuninstall_cmds -+ -+# Commands used to build a loadable module (assumed same as above if empty) -+module_cmds=$lt_module_cmds_GCJ -+module_expsym_cmds=$lt_module_expsym_cmds_GCJ -+ -+# Commands to strip libraries. -+old_striplib=$lt_old_striplib -+striplib=$lt_striplib -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predep_objects=$lt_predep_objects_GCJ -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdep_objects=$lt_postdep_objects_GCJ -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predeps=$lt_predeps_GCJ -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdeps=$lt_postdeps_GCJ -+ -+# The library search path used internally by the compiler when linking -+# a shared library. -+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ -+ -+# Method to check whether dependent libraries are shared objects. -+deplibs_check_method=$lt_deplibs_check_method -+ -+# Command to use when deplibs_check_method == file_magic. -+file_magic_cmd=$lt_file_magic_cmd -+ -+# Flag that allows shared libraries with undefined symbols to be built. -+allow_undefined_flag=$lt_allow_undefined_flag_GCJ -+ -+# Flag that forces no undefined symbols. -+no_undefined_flag=$lt_no_undefined_flag_GCJ -+ -+# Commands used to finish a libtool library installation in a directory. -+finish_cmds=$lt_finish_cmds -+ -+# Same as above, but a single script fragment to be evaled but not shown. -+finish_eval=$lt_finish_eval -+ -+# Take the output of nm and produce a listing of raw symbols and C names. -+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -+ -+# Transform the output of nm in a proper C declaration -+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -+ -+# Transform the output of nm in a C name address pair -+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -+ -+# This is the shared library runtime path variable. -+runpath_var=$runpath_var -+ -+# This is the shared library path variable. -+shlibpath_var=$shlibpath_var -+ -+# Is shlibpath searched before the hard-coded library search path? -+shlibpath_overrides_runpath=$shlibpath_overrides_runpath -+ -+# How to hardcode a shared library path into an executable. -+hardcode_action=$hardcode_action_GCJ -+ -+# Whether we should hardcode library paths into libraries. -+hardcode_into_libs=$hardcode_into_libs -+ -+# Flag to hardcode \$libdir into a binary during linking. -+# This must work even if \$libdir does not exist. -+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ -+ -+# If ld is used when linking, flag to hardcode \$libdir into -+# a binary during linking. This must work even if \$libdir does -+# not exist. -+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ -+ -+# Whether we need a single -rpath flag with a separated argument. -+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ -+ -+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -+# resulting binary. -+hardcode_direct=$hardcode_direct_GCJ -+ -+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -+# resulting binary. -+hardcode_minus_L=$hardcode_minus_L_GCJ -+ -+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -+# the resulting binary. -+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ -+ -+# Set to yes if building a shared library automatically hardcodes DIR into the library -+# and all subsequent libraries and executables linked against it. -+hardcode_automatic=$hardcode_automatic_GCJ -+ -+# Variables whose values should be saved in libtool wrapper scripts and -+# restored at relink time. -+variables_saved_for_relink="$variables_saved_for_relink" -+ -+# Whether libtool must link a program against all its dependency libraries. -+link_all_deplibs=$link_all_deplibs_GCJ -+ -+# Compile-time system search path for libraries -+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -+ -+# Run-time system search path for libraries -+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -+ -+# Fix the shell variable \$srcfile for the compiler. -+fix_srcfile_path="$fix_srcfile_path_GCJ" -+ -+# Set to yes if exported symbols are required. -+always_export_symbols=$always_export_symbols_GCJ -+ -+# The commands to list exported symbols. -+export_symbols_cmds=$lt_export_symbols_cmds_GCJ -+ -+# The commands to extract the exported symbol list from a shared archive. -+extract_expsyms_cmds=$lt_extract_expsyms_cmds -+ -+# Symbols that should not be listed in the preloaded symbols. -+exclude_expsyms=$lt_exclude_expsyms_GCJ -+ -+# Symbols that must always be exported. -+include_expsyms=$lt_include_expsyms_GCJ -+ -+# ### END LIBTOOL TAG CONFIG: $tagname -+ -+__EOF__ -+ -+ -+else -+ # If there is no Makefile yet, we rely on a make rule to execute -+ # `config.status --recheck' to rerun these tests and create the -+ # libtool script then. -+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` -+ if test -f "$ltmain_in"; then -+ test -f Makefile && make "$ltmain" -+ fi -+fi -+ -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+CC="$lt_save_CC" -+ -+ else -+ tagname="" -+ fi -+ ;; -+ -+ RC) -+ -+ -+ -+# Source file extension for RC test sources. -+ac_ext=rc -+ -+# Object file extension for compiled RC test sources. -+objext=o -+objext_RC=$objext -+ -+# Code to be used in simple compile tests -+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' -+ -+# Code to be used in simple link tests -+lt_simple_link_test_code="$lt_simple_compile_test_code" -+ -+# ltmain only uses $CC for tagged configurations so make sure $CC is set. -+ -+# If no C compiler was specified, use CC. -+LTCC=${LTCC-"$CC"} -+ -+# Allow CC to be a program name with arguments. -+compiler=$CC -+ -+ -+# save warnings/boilerplate of simple test code -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_compile_test_code" >conftest.$ac_ext -+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_compiler_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ac_outfile=conftest.$ac_objext -+printf "$lt_simple_link_test_code" >conftest.$ac_ext -+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -+_lt_linker_boilerplate=`cat conftest.err` -+$rm conftest* -+ -+ -+# Allow CC to be a program name with arguments. -+lt_save_CC="$CC" -+CC=${RC-"windres"} -+compiler=$CC -+compiler_RC=$CC -+for cc_temp in $compiler""; do -+ case $cc_temp in -+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; -+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; -+ \-*) ;; -+ *) break;; -+ esac -+done -+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -+ -+lt_cv_prog_compiler_c_o_RC=yes -+ -+# The else clause should only fire when bootstrapping the -+# libtool distribution, otherwise you forgot to ship ltmain.sh -+# with your package, and you will get complaints that there are -+# no rules to generate ltmain.sh. -+if test -f "$ltmain"; then -+ # See if we are running on zsh, and set the options which allow our commands through -+ # without removal of \ escapes. -+ if test -n "${ZSH_VERSION+set}" ; then -+ setopt NO_GLOB_SUBST -+ fi -+ # Now quote all the things that may contain metacharacters while being -+ # careful not to overquote the AC_SUBSTed values. We take copies of the -+ # variables and quote the copies for generation of the libtool script. -+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ -+ SED SHELL STRIP \ -+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ -+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ -+ deplibs_check_method reload_flag reload_cmds need_locks \ -+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ -+ lt_cv_sys_global_symbol_to_c_name_address \ -+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -+ old_postinstall_cmds old_postuninstall_cmds \ -+ compiler_RC \ -+ CC_RC \ -+ LD_RC \ -+ lt_prog_compiler_wl_RC \ -+ lt_prog_compiler_pic_RC \ -+ lt_prog_compiler_static_RC \ -+ lt_prog_compiler_no_builtin_flag_RC \ -+ export_dynamic_flag_spec_RC \ -+ thread_safe_flag_spec_RC \ -+ whole_archive_flag_spec_RC \ -+ enable_shared_with_static_runtimes_RC \ -+ old_archive_cmds_RC \ -+ old_archive_from_new_cmds_RC \ -+ predep_objects_RC \ -+ postdep_objects_RC \ -+ predeps_RC \ -+ postdeps_RC \ -+ compiler_lib_search_path_RC \ -+ archive_cmds_RC \ -+ archive_expsym_cmds_RC \ -+ postinstall_cmds_RC \ -+ postuninstall_cmds_RC \ -+ old_archive_from_expsyms_cmds_RC \ -+ allow_undefined_flag_RC \ -+ no_undefined_flag_RC \ -+ export_symbols_cmds_RC \ -+ hardcode_libdir_flag_spec_RC \ -+ hardcode_libdir_flag_spec_ld_RC \ -+ hardcode_libdir_separator_RC \ -+ hardcode_automatic_RC \ -+ module_cmds_RC \ -+ module_expsym_cmds_RC \ -+ lt_cv_prog_compiler_c_o_RC \ -+ exclude_expsyms_RC \ -+ include_expsyms_RC; do -+ -+ case $var in -+ old_archive_cmds_RC | \ -+ old_archive_from_new_cmds_RC | \ -+ archive_cmds_RC | \ -+ archive_expsym_cmds_RC | \ -+ module_cmds_RC | \ -+ module_expsym_cmds_RC | \ -+ old_archive_from_expsyms_cmds_RC | \ -+ export_symbols_cmds_RC | \ -+ extract_expsyms_cmds | reload_cmds | finish_cmds | \ -+ postinstall_cmds | postuninstall_cmds | \ -+ old_postinstall_cmds | old_postuninstall_cmds | \ -+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) -+ # Double-quote double-evaled strings. -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" -+ ;; -+ *) -+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -+ ;; -+ esac -+ done -+ -+ case $lt_echo in -+ *'\$0 --fallback-echo"') -+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac -- dynamic_linker='Win32 ld.exe' -- # FIXME: first we should search . and the directory the executable is in -- shlibpath_var=PATH -- ;; - --darwin* | rhapsody*) -- dynamic_linker="$host_os dyld" -- version_type=darwin -- need_lib_prefix=no -- need_version=no -- # FIXME: Relying on posixy $() will cause problems for -- # cross-compilation, but unfortunately the echo tests do not -- # yet detect zsh echo's removal of \ escapes. -- library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' -- soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' -- shlibpath_overrides_runpath=yes -- shlibpath_var=DYLD_LIBRARY_PATH -- ;; -+cfgfile="$ofile" -+ -+ cat <<__EOF__ >> "$cfgfile" -+# ### BEGIN LIBTOOL TAG CONFIG: $tagname -+ -+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -+ -+# Shell to use when invoking shell scripts. -+SHELL=$lt_SHELL -+ -+# Whether or not to build shared libraries. -+build_libtool_libs=$enable_shared -+ -+# Whether or not to build static libraries. -+build_old_libs=$enable_static -+ -+# Whether or not to add -lc for building shared libraries. -+build_libtool_need_lc=$archive_cmds_need_lc_RC -+ -+# Whether or not to disallow shared libs when runtime libs are static -+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC -+ -+# Whether or not to optimize for fast installation. -+fast_install=$enable_fast_install -+ -+# The host system. -+host_alias=$host_alias -+host=$host -+host_os=$host_os -+ -+# The build system. -+build_alias=$build_alias -+build=$build -+build_os=$build_os -+ -+# An echo program that does not interpret backslashes. -+echo=$lt_echo -+ -+# The archiver. -+AR=$lt_AR -+AR_FLAGS=$lt_AR_FLAGS -+ -+# A C compiler. -+LTCC=$lt_LTCC -+ -+# A language-specific compiler. -+CC=$lt_compiler_RC -+ -+# Is the compiler the GNU C compiler? -+with_gcc=$GCC_RC -+ -+# An ERE matcher. -+EGREP=$lt_EGREP -+ -+# The linker used to build libraries. -+LD=$lt_LD_RC -+ -+# Whether we need hard or soft links. -+LN_S=$lt_LN_S -+ -+# A BSD-compatible nm program. -+NM=$lt_NM -+ -+# A symbol stripping program -+STRIP=$lt_STRIP -+ -+# Used to examine libraries when file_magic_cmd begins "file" -+MAGIC_CMD=$MAGIC_CMD -+ -+# Used on cygwin: DLL creation program. -+DLLTOOL="$DLLTOOL" -+ -+# Used on cygwin: object dumper. -+OBJDUMP="$OBJDUMP" -+ -+# Used on cygwin: assembler. -+AS="$AS" -+ -+# The name of the directory that contains temporary libtool files. -+objdir=$objdir -+ -+# How to create reloadable object files. -+reload_flag=$lt_reload_flag -+reload_cmds=$lt_reload_cmds -+ -+# How to pass a linker flag through the compiler. -+wl=$lt_lt_prog_compiler_wl_RC -+ -+# Object file suffix (normally "o"). -+objext="$ac_objext" -+ -+# Old archive suffix (normally "a"). -+libext="$libext" -+ -+# Shared library suffix (normally ".so"). -+shrext_cmds='$shrext_cmds' -+ -+# Executable file suffix (normally ""). -+exeext="$exeext" -+ -+# Additional compiler flags for building library objects. -+pic_flag=$lt_lt_prog_compiler_pic_RC -+pic_mode=$pic_mode -+ -+# What is the maximum length of a command? -+max_cmd_len=$lt_cv_sys_max_cmd_len -+ -+# Does compiler simultaneously support -c and -o options? -+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC -+ -+# Must we lock files when doing compilation? -+need_locks=$lt_need_locks -+ -+# Do we need the lib prefix for modules? -+need_lib_prefix=$need_lib_prefix -+ -+# Do we need a version for libraries? -+need_version=$need_version -+ -+# Whether dlopen is supported. -+dlopen_support=$enable_dlopen -+ -+# Whether dlopen of programs is supported. -+dlopen_self=$enable_dlopen_self -+ -+# Whether dlopen of statically linked programs is supported. -+dlopen_self_static=$enable_dlopen_self_static -+ -+# Compiler flag to prevent dynamic linking. -+link_static_flag=$lt_lt_prog_compiler_static_RC -+ -+# Compiler flag to turn off builtin functions. -+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC -+ -+# Compiler flag to allow reflexive dlopens. -+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC -+ -+# Compiler flag to generate shared objects directly from archives. -+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC -+ -+# Compiler flag to generate thread-safe objects. -+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC -+ -+# Library versioning type. -+version_type=$version_type -+ -+# Format of library name prefix. -+libname_spec=$lt_libname_spec -+ -+# List of archive names. First name is the real one, the rest are links. -+# The last name is the one that the linker finds with -lNAME. -+library_names_spec=$lt_library_names_spec -+ -+# The coded name of the library, if different from the real name. -+soname_spec=$lt_soname_spec -+ -+# Commands used to build and install an old-style archive. -+RANLIB=$lt_RANLIB -+old_archive_cmds=$lt_old_archive_cmds_RC -+old_postinstall_cmds=$lt_old_postinstall_cmds -+old_postuninstall_cmds=$lt_old_postuninstall_cmds -+ -+# Create an old-style archive from a shared archive. -+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC -+ -+# Create a temporary old-style archive to link instead of a shared archive. -+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC -+ -+# Commands used to build and install a shared archive. -+archive_cmds=$lt_archive_cmds_RC -+archive_expsym_cmds=$lt_archive_expsym_cmds_RC -+postinstall_cmds=$lt_postinstall_cmds -+postuninstall_cmds=$lt_postuninstall_cmds -+ -+# Commands used to build a loadable module (assumed same as above if empty) -+module_cmds=$lt_module_cmds_RC -+module_expsym_cmds=$lt_module_expsym_cmds_RC -+ -+# Commands to strip libraries. -+old_striplib=$lt_old_striplib -+striplib=$lt_striplib -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predep_objects=$lt_predep_objects_RC -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdep_objects=$lt_postdep_objects_RC -+ -+# Dependencies to place before the objects being linked to create a -+# shared library. -+predeps=$lt_predeps_RC -+ -+# Dependencies to place after the objects being linked to create a -+# shared library. -+postdeps=$lt_postdeps_RC -+ -+# The library search path used internally by the compiler when linking -+# a shared library. -+compiler_lib_search_path=$lt_compiler_lib_search_path_RC -+ -+# Method to check whether dependent libraries are shared objects. -+deplibs_check_method=$lt_deplibs_check_method -+ -+# Command to use when deplibs_check_method == file_magic. -+file_magic_cmd=$lt_file_magic_cmd -+ -+# Flag that allows shared libraries with undefined symbols to be built. -+allow_undefined_flag=$lt_allow_undefined_flag_RC -+ -+# Flag that forces no undefined symbols. -+no_undefined_flag=$lt_no_undefined_flag_RC -+ -+# Commands used to finish a libtool library installation in a directory. -+finish_cmds=$lt_finish_cmds -+ -+# Same as above, but a single script fragment to be evaled but not shown. -+finish_eval=$lt_finish_eval -+ -+# Take the output of nm and produce a listing of raw symbols and C names. -+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -+ -+# Transform the output of nm in a proper C declaration -+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -+ -+# Transform the output of nm in a C name address pair -+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - --freebsd1*) -- dynamic_linker=no -- ;; -+# This is the shared library runtime path variable. -+runpath_var=$runpath_var - --freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -- version_type=freebsd-$objformat -- case $version_type in -- freebsd-elf*) -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' -- need_version=no -- need_lib_prefix=no -- ;; -- freebsd-*) -- library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' -- need_version=yes -- ;; -- esac -- shlibpath_var=LD_LIBRARY_PATH -- case $host_os in -- freebsd2*) -- shlibpath_overrides_runpath=yes -- ;; -- *) -- shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -- ;; -- esac -- ;; -+# This is the shared library path variable. -+shlibpath_var=$shlibpath_var - --gnu*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- hardcode_into_libs=yes -- ;; -+# Is shlibpath searched before the hard-coded library search path? -+shlibpath_overrides_runpath=$shlibpath_overrides_runpath - --hpux9* | hpux10* | hpux11*) -- # Give a soname corresponding to the major version so that dld.sl refuses to -- # link against other versions. -- dynamic_linker="$host_os dld.sl" -- version_type=sunos -- need_lib_prefix=no -- need_version=no -- shlibpath_var=SHLIB_PATH -- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH -- library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' -- soname_spec='${libname}${release}.sl$major' -- # HP-UX runs *really* slowly unless shared libraries are mode 555. -- postinstall_cmds='chmod 555 $lib' -- ;; -+# How to hardcode a shared library path into an executable. -+hardcode_action=$hardcode_action_RC - --irix5* | irix6*) -- version_type=irix -- need_lib_prefix=no -- need_version=no -- soname_spec='${libname}${release}.so$major' -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' -- case $host_os in -- irix5*) -- libsuff= shlibsuff= -- ;; -- *) -- case $LD in # libtool.m4 will add one of these switches to LD -- *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; -- *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; -- *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; -- *) libsuff= shlibsuff= libmagic=never-match;; -- esac -- ;; -- esac -- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -- shlibpath_overrides_runpath=no -- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -- ;; -+# Whether we should hardcode library paths into libraries. -+hardcode_into_libs=$hardcode_into_libs - --# No shared lib support for Linux oldld, aout, or coff. --linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) -- dynamic_linker=no -- ;; -+# Flag to hardcode \$libdir into a binary during linking. -+# This must work even if \$libdir does not exist. -+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC - --# This must be Linux ELF. --linux-gnu*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=no -- # This implies no fast_install, which is unacceptable. -- # Some rework will be needed to allow for fast_install -- # before this can be enabled. -- hardcode_into_libs=yes -+# If ld is used when linking, flag to hardcode \$libdir into -+# a binary during linking. This must work even if \$libdir does -+# not exist. -+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -- # We used to test for /lib/ld.so.1 and disable shared libraries on -- # powerpc, because MkLinux only supported shared libraries with the -- # GNU dynamic linker. Since this was broken with cross compilers, -- # most powerpc-linux boxes support dynamic linking these days and -- # people can always --disable-shared, the test was removed, and we -- # assume the GNU/Linux dynamic linker is in use. -- dynamic_linker='GNU/Linux ld.so' -- ;; -+# Whether we need a single -rpath flag with a separated argument. -+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - --netbsd*) -- version_type=sunos -- need_lib_prefix=no -- need_version=no -- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -- dynamic_linker='NetBSD (a.out) ld.so' -- else -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' -- soname_spec='${libname}${release}.so$major' -- dynamic_linker='NetBSD ld.elf_so' -+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -+# resulting binary. -+hardcode_direct=$hardcode_direct_RC -+ -+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -+# resulting binary. -+hardcode_minus_L=$hardcode_minus_L_RC -+ -+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -+# the resulting binary. -+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC -+ -+# Set to yes if building a shared library automatically hardcodes DIR into the library -+# and all subsequent libraries and executables linked against it. -+hardcode_automatic=$hardcode_automatic_RC -+ -+# Variables whose values should be saved in libtool wrapper scripts and -+# restored at relink time. -+variables_saved_for_relink="$variables_saved_for_relink" -+ -+# Whether libtool must link a program against all its dependency libraries. -+link_all_deplibs=$link_all_deplibs_RC -+ -+# Compile-time system search path for libraries -+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -+ -+# Run-time system search path for libraries -+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -+ -+# Fix the shell variable \$srcfile for the compiler. -+fix_srcfile_path="$fix_srcfile_path_RC" -+ -+# Set to yes if exported symbols are required. -+always_export_symbols=$always_export_symbols_RC -+ -+# The commands to list exported symbols. -+export_symbols_cmds=$lt_export_symbols_cmds_RC -+ -+# The commands to extract the exported symbol list from a shared archive. -+extract_expsyms_cmds=$lt_extract_expsyms_cmds -+ -+# Symbols that should not be listed in the preloaded symbols. -+exclude_expsyms=$lt_exclude_expsyms_RC -+ -+# Symbols that must always be exported. -+include_expsyms=$lt_include_expsyms_RC -+ -+# ### END LIBTOOL TAG CONFIG: $tagname -+ -+__EOF__ -+ -+ -+else -+ # If there is no Makefile yet, we rely on a make rule to execute -+ # `config.status --recheck' to rerun these tests and create the -+ # libtool script then. -+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` -+ if test -f "$ltmain_in"; then -+ test -f Makefile && make "$ltmain" - fi -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -- ;; -+fi - --newsos6) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- ;; - --openbsd*) -- version_type=sunos -- need_lib_prefix=no -- need_version=no -- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then -- case "$host_os" in -- openbsd2.[89] | openbsd2.[89].*) -- shlibpath_overrides_runpath=no -- ;; -- *) -- shlibpath_overrides_runpath=yes -- ;; -- esac -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+CC="$lt_save_CC" -+ -+ ;; -+ -+ *) -+ { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -+echo "$as_me: error: Unsupported tag name: $tagname" >&2;} -+ { (exit 1); exit 1; }; } -+ ;; -+ esac -+ -+ # Append the new tag name to the list of available tags. -+ if test -n "$tagname" ; then -+ available_tags="$available_tags $tagname" -+ fi -+ fi -+ done -+ IFS="$lt_save_ifs" -+ -+ # Now substitute the updated list of available tags. -+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then -+ mv "${ofile}T" "$ofile" -+ chmod +x "$ofile" - else -- shlibpath_overrides_runpath=yes -+ rm -f "${ofile}T" -+ { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -+echo "$as_me: error: unable to update list of available tagged configurations." >&2;} -+ { (exit 1); exit 1; }; } - fi -- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' -- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- ;; -+fi -+ -+ -+ -+# This can be used to rebuild libtool when needed -+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" -+ -+# Always use our own libtool. -+LIBTOOL='$(SHELL) $(top_builddir)/libtool' -+ -+# Prevent multiple expansion - --os2*) -- libname_spec='$name' -- need_lib_prefix=no -- library_names_spec='$libname.dll $libname.a' -- dynamic_linker='OS/2 ld.exe' -- shlibpath_var=LIBPATH -- ;; - --osf3* | osf4* | osf5*) -- version_type=osf -- need_version=no -- soname_spec='${libname}${release}.so' -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -- ;; - --sco3.2v5*) -- version_type=osf -- soname_spec='${libname}${release}.so$major' -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- ;; - --solaris*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -- # ldd complains unless libraries are executable -- postinstall_cmds='chmod +x $lib' -- ;; - --sunos4*) -- version_type=sunos -- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' -- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' -- shlibpath_var=LD_LIBRARY_PATH -- shlibpath_overrides_runpath=yes -- if test "$with_gnu_ld" = yes; then -- need_lib_prefix=no -- fi -- need_version=yes -- ;; - --sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- case $host_vendor in -- sni) -- shlibpath_overrides_runpath=no -- ;; -- motorola) -- need_lib_prefix=no -- need_version=no -- shlibpath_overrides_runpath=no -- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -- ;; -- esac -- ;; - --uts4*) -- version_type=linux -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- ;; - --dgux*) -- version_type=linux -- need_lib_prefix=no -- need_version=no -- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -- soname_spec='${libname}${release}.so$major' -- shlibpath_var=LD_LIBRARY_PATH -- ;; - --sysv4*MP*) -- if test -d /usr/nec ;then -- version_type=linux -- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' -- soname_spec='$libname.so.$major' -- shlibpath_var=LD_LIBRARY_PATH -- fi -- ;; - --*) -- dynamic_linker=no -- ;; --esac --echo "$as_me:$LINENO: result: $dynamic_linker" >&5 --echo "${ECHO_T}$dynamic_linker" >&6 --test "$dynamic_linker" = no && can_build_shared=no - --# Report the final consequences. --echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 --echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 --echo "$as_me:$LINENO: result: $can_build_shared" >&5 --echo "${ECHO_T}$can_build_shared" >&6 - --echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 --echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 --test "$can_build_shared" = "no" && enable_shared=no - --# On AIX, shared libraries and static libraries use the same namespace, and --# are all built from PIC. --case "$host_os" in --aix3*) -- test "$enable_shared" = yes && enable_static=no -- if test -n "$RANLIB"; then -- archive_cmds="$archive_cmds~\$RANLIB \$lib" -- postinstall_cmds='$RANLIB $lib' -- fi -- ;; - --aix4*) -- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then -- test "$enable_shared" = yes && enable_static=no -- fi -- ;; --esac --echo "$as_me:$LINENO: result: $enable_shared" >&5 --echo "${ECHO_T}$enable_shared" >&6 - --echo "$as_me:$LINENO: checking whether to build static libraries" >&5 --echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 --# Make sure either enable_shared or enable_static is yes. --test "$enable_shared" = yes || enable_static=yes --echo "$as_me:$LINENO: result: $enable_static" >&5 --echo "${ECHO_T}$enable_static" >&6 - --if test "$hardcode_action" = relink; then -- # Fast installation is not supported -- enable_fast_install=no --elif test "$shlibpath_overrides_runpath" = yes || -- test "$enable_shared" = no; then -- # Fast installation is not necessary -- enable_fast_install=needless --fi - --variables_saved_for_relink="PATH $shlibpath_var $runpath_var" --if test "$GCC" = yes; then -- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" --fi - --if test "x$enable_dlopen" != xyes; then -- enable_dlopen=unknown -- enable_dlopen_self=unknown -- enable_dlopen_self_static=unknown --else -- lt_cv_dlopen=no -- lt_cv_dlopen_libs= - -- case $host_os in -- beos*) -- lt_cv_dlopen="load_add_on" -- lt_cv_dlopen_libs= -- lt_cv_dlopen_self=yes -- ;; - -- cygwin* | mingw* | pw32*) -- lt_cv_dlopen="LoadLibrary" -- lt_cv_dlopen_libs= -- ;; - -- *) -- echo "$as_me:$LINENO: checking for shl_load" >&5 --echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 --if test "${ac_cv_func_shl_load+set}" = set; then -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -+# On Suns, sometimes $CPP names a directory. -+if test -n "$CPP" && test -d "$CPP"; then -+ CPP= -+fi -+if test -z "$CPP"; then -+ if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -+ # Double quotes because CPP needs to be expanded -+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" -+ do -+ ac_preproc_ok=false -+for ac_c_preproc_warn_flag in '' yes -+do -+ # Use a header file that comes with gcc, so configuring glibc -+ # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. -+ # On the NeXT, cc -E runs the code through the compiler's parser, -+ # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --/* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char shl_load (); below. */ --#include --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char shl_load (); --char (*f) (); -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --/* The GNU C library defines this for functions which it implements -- to always fail with ENOSYS. Some functions are actually named -- something starting with __ and the normal name is an alias. */ --#if defined (__stub_shl_load) || defined (__stub___shl_load) --choke me -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include - #else --f = shl_load; -+# include - #endif -- -- ; -- return 0; --} -+ Syntax error - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_func_shl_load=yes -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_func_shl_load=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+ ac_cpp_err=yes - fi --echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 --echo "${ECHO_T}$ac_cv_func_shl_load" >&6 --if test $ac_cv_func_shl_load = yes; then -- lt_cv_dlopen="shl_load" --else -- echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 --echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 --if test "${ac_cv_lib_dld_shl_load+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-ldld $LIBS" --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char shl_load (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --shl_load (); -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_lib_dld_shl_load=yes -+if test -z "$ac_cpp_err"; then -+ : - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_lib_dld_shl_load=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 --echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 --if test $ac_cv_lib_dld_shl_load = yes; then -- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" --else -- echo "$as_me:$LINENO: checking for dlopen" >&5 --echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 --if test "${ac_cv_func_dlopen+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --/* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char dlopen (); below. */ --#include --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char dlopen (); --char (*f) (); -+sed 's/^/| /' conftest.$ac_ext >&5 - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --/* The GNU C library defines this for functions which it implements -- to always fail with ENOSYS. Some functions are actually named -- something starting with __ and the normal name is an alias. */ --#if defined (__stub_dlopen) || defined (__stub___dlopen) --choke me --#else --f = dlopen; --#endif -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.$ac_ext - -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -+ # OK, works on sane cases. Now check whether non-existent headers -+ # can be detected and how. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_func_dlopen=yes -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ # Broken: success on invalid input. -+continue - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_func_dlopen=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Passes both tests. -+ac_preproc_ok=: -+break -+fi -+rm -f conftest.err conftest.$ac_ext -+ -+done -+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -+rm -f conftest.err conftest.$ac_ext -+if $ac_preproc_ok; then -+ break - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+ -+ done -+ ac_cv_prog_CPP=$CPP -+ - fi --echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 --echo "${ECHO_T}$ac_cv_func_dlopen" >&6 --if test $ac_cv_func_dlopen = yes; then -- lt_cv_dlopen="dlopen" --else -- echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 --echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 --if test "${ac_cv_lib_dl_dlopen+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ CPP=$ac_cv_prog_CPP - else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-ldl $LIBS" --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char dlopen (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+ ac_cv_prog_CPP=$CPP -+fi -+echo "$as_me:$LINENO: result: $CPP" >&5 -+echo "${ECHO_T}$CPP" >&6 -+ac_preproc_ok=false -+for ac_c_preproc_warn_flag in '' yes -+do -+ # Use a header file that comes with gcc, so configuring glibc -+ # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. -+ # On the NeXT, cc -E runs the code through the compiler's parser, -+ # not just through cpp. "Syntax error" is here to catch this case. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include -+#else -+# include - #endif --int --main () --{ --dlopen (); -- ; -- return 0; --} -+ Syntax error - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_lib_dl_dlopen=yes -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_lib_dl_dlopen=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS -+ ac_cpp_err=yes - fi --echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 --echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 --if test $ac_cv_lib_dl_dlopen = yes; then -- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" --else -- echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 --echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 --if test "${ac_cv_lib_svld_dlopen+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+if test -z "$ac_cpp_err"; then -+ : - else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lsvld $LIBS" --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char dlopen (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --dlopen (); -- ; -- return 0; --} -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.$ac_ext -+ -+ # OK, works on sane cases. Now check whether non-existent headers -+ # can be detected and how. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_lib_svld_dlopen=yes -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_lib_svld_dlopen=no -+ ac_cpp_err=yes - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS -+if test -z "$ac_cpp_err"; then -+ # Broken: success on invalid input. -+continue -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ # Passes both tests. -+ac_preproc_ok=: -+break - fi --echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 --echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 --if test $ac_cv_lib_svld_dlopen = yes; then -- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -+rm -f conftest.err conftest.$ac_ext -+ -+done -+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -+rm -f conftest.err conftest.$ac_ext -+if $ac_preproc_ok; then -+ : - else -- echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 --echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 --if test "${ac_cv_lib_dld_dld_link+set}" = set; then -+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -+See \`config.log' for more details." >&5 -+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ac_ext=cc -+ac_cpp='$CXXCPP $CPPFLAGS' -+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -+if test -n "$ac_tool_prefix"; then -+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -+ do -+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -+set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-ldld $LIBS" --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char dld_link (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --dld_link (); -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_lib_dld_dld_link=yes -+ if test -n "$CXX"; then -+ ac_cv_prog_CXX="$CXX" # Let the user override the test. - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_lib_dld_dld_link=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 --echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 --if test $ac_cv_lib_dld_dld_link = yes; then -- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" --fi -- -- --fi -- -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done - - fi -- -- - fi -- -- -+CXX=$ac_cv_prog_CXX -+if test -n "$CXX"; then -+ echo "$as_me:$LINENO: result: $CXX" >&5 -+echo "${ECHO_T}$CXX" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi - -- -+ test -n "$CXX" && break -+ done - fi -- -- ;; -- esac -- -- if test "x$lt_cv_dlopen" != xno; then -- enable_dlopen=yes -- else -- enable_dlopen=no -- fi -- -- case $lt_cv_dlopen in -- dlopen) -- save_CPPFLAGS="$CPPFLAGS" -- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -- -- save_LDFLAGS="$LDFLAGS" -- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -- -- save_LIBS="$LIBS" -- LIBS="$lt_cv_dlopen_libs $LIBS" -- -- echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 --echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 --if test "${lt_cv_dlopen_self+set}" = set; then -+if test -z "$CXX"; then -+ ac_ct_CXX=$CXX -+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test "$cross_compiling" = yes; then : -- lt_cv_dlopen_self=cross -+ if test -n "$ac_ct_CXX"; then -+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. - else -- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -- lt_status=$lt_dlunknown -- cat > conftest.$ac_ext < --#endif -- --#include -- --#ifdef RTLD_GLOBAL --# define LT_DLGLOBAL RTLD_GLOBAL --#else --# ifdef DL_GLOBAL --# define LT_DLGLOBAL DL_GLOBAL --# else --# define LT_DLGLOBAL 0 --# endif --#endif -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_CXX="$ac_prog" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done - --/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -- find out it does not work in some platform. */ --#ifndef LT_DLLAZY_OR_NOW --# ifdef RTLD_LAZY --# define LT_DLLAZY_OR_NOW RTLD_LAZY --# else --# ifdef DL_LAZY --# define LT_DLLAZY_OR_NOW DL_LAZY --# else --# ifdef RTLD_NOW --# define LT_DLLAZY_OR_NOW RTLD_NOW --# else --# ifdef DL_NOW --# define LT_DLLAZY_OR_NOW DL_NOW --# else --# define LT_DLLAZY_OR_NOW 0 --# endif --# endif --# endif --# endif --#endif -+fi -+fi -+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -+if test -n "$ac_ct_CXX"; then -+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -+echo "${ECHO_T}$ac_ct_CXX" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi - --#ifdef __cplusplus --extern "C" void exit (int); --#endif -+ test -n "$ac_ct_CXX" && break -+done -+test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - --void fnord() { int i=42;} --int main () --{ -- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -- int status = $lt_dlunknown; -+ CXX=$ac_ct_CXX -+fi - -- if (self) -- { -- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -- /* dlclose (self); */ -- } - -- exit (status); --} --EOF -- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+# Provide some information about the compiler. -+echo "$as_me:$LINENO:" \ -+ "checking for C++ compiler version" >&5 -+ac_compiler=`set X $ac_compile; echo $2` -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 -+ (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -- (./conftest; exit; ) 2>/dev/null -- lt_status=$? -- case x$lt_status in -- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; -- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; -- x$lt_unknown|x*) lt_cv_dlopen_self=no ;; -- esac -- else : -- # compilation failed -- lt_cv_dlopen_self=no -- fi --fi --rm -fr conftest* -- -- --fi --echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 --echo "${ECHO_T}$lt_cv_dlopen_self" >&6 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 -+ (eval $ac_compiler -v &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } -+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 -+ (eval $ac_compiler -V &5) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } - -- if test "x$lt_cv_dlopen_self" = xyes; then -- LDFLAGS="$LDFLAGS $link_static_flag" -- echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 --echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 --if test "${lt_cv_dlopen_self_static+set}" = set; then -+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test "$cross_compiling" = yes; then : -- lt_cv_dlopen_self_static=cross --else -- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 -- lt_status=$lt_dlunknown -- cat > conftest.$ac_ext < --#endif -- --#include -- --#ifdef RTLD_GLOBAL --# define LT_DLGLOBAL RTLD_GLOBAL --#else --# ifdef DL_GLOBAL --# define LT_DLGLOBAL DL_GLOBAL --# else --# define LT_DLGLOBAL 0 --# endif --#endif -- --/* We may have to define LT_DLLAZY_OR_NOW in the command line if we -- find out it does not work in some platform. */ --#ifndef LT_DLLAZY_OR_NOW --# ifdef RTLD_LAZY --# define LT_DLLAZY_OR_NOW RTLD_LAZY --# else --# ifdef DL_LAZY --# define LT_DLLAZY_OR_NOW DL_LAZY --# else --# ifdef RTLD_NOW --# define LT_DLLAZY_OR_NOW RTLD_NOW --# else --# ifdef DL_NOW --# define LT_DLLAZY_OR_NOW DL_NOW --# else --# define LT_DLLAZY_OR_NOW 0 --# endif --# endif --# endif --# endif --#endif -- --#ifdef __cplusplus --extern "C" void exit (int); --#endif -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --void fnord() { int i=42;} --int main () -+int -+main () - { -- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); -- int status = $lt_dlunknown; -- -- if (self) -- { -- if (dlsym (self,"fnord")) status = $lt_dlno_uscore; -- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; -- /* dlclose (self); */ -- } -+#ifndef __GNUC__ -+ choke me -+#endif - -- exit (status); -+ ; -+ return 0; - } --EOF -- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then -- (./conftest; exit; ) 2>/dev/null -- lt_status=$? -- case x$lt_status in -- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; -- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; -- x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; -- esac -- else : -- # compilation failed -- lt_cv_dlopen_self_static=no -- fi --fi --rm -fr conftest* -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_compiler_gnu=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_compiler_gnu=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - - fi --echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 --echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 -- fi -+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -+GXX=`test $ac_compiler_gnu = yes && echo yes` -+ac_test_CXXFLAGS=${CXXFLAGS+set} -+ac_save_CXXFLAGS=$CXXFLAGS -+CXXFLAGS="-g" -+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -+if test "${ac_cv_prog_cxx_g+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - -- CPPFLAGS="$save_CPPFLAGS" -- LDFLAGS="$save_LDFLAGS" -- LIBS="$save_LIBS" -- ;; -- esac -+int -+main () -+{ - -- case $lt_cv_dlopen_self in -- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; -- *) enable_dlopen_self=unknown ;; -- esac -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_prog_cxx_g=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -- case $lt_cv_dlopen_self_static in -- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; -- *) enable_dlopen_self_static=unknown ;; -- esac -+ac_cv_prog_cxx_g=no - fi -- -- --if test "$enable_shared" = yes && test "$GCC" = yes; then -- case $archive_cmds in -- *'~'*) -- # FIXME: we may have to deal with multi-command sequences. -- ;; -- '$CC '*) -- # Test whether the compiler implicitly links with -lc since on some -- # systems, -lgcc has to come before -lc. If gcc already passes -lc -- # to ld, don't add -lc before -lgcc. -- echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 --echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 -- if test "${lt_cv_archive_cmds_need_lc+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -+if test "$ac_test_CXXFLAGS" = set; then -+ CXXFLAGS=$ac_save_CXXFLAGS -+elif test $ac_cv_prog_cxx_g = yes; then -+ if test "$GXX" = yes; then -+ CXXFLAGS="-g -O2" -+ else -+ CXXFLAGS="-g" -+ fi - else -- $rm conftest* -- echo 'static int dummy;' > conftest.$ac_ext -+ if test "$GXX" = yes; then -+ CXXFLAGS="-O2" -+ else -+ CXXFLAGS= -+ fi -+fi -+for ac_declaration in \ -+ '' \ -+ 'extern "C" void std::exit (int) throw (); using std::exit;' \ -+ 'extern "C" void std::exit (int); using std::exit;' \ -+ 'extern "C" void exit (int) throw ();' \ -+ 'extern "C" void exit (int);' \ -+ 'void exit (int);' -+do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_declaration -+#include -+int -+main () -+{ -+exit (42); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ : -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+continue -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_declaration -+int -+main () -+{ -+exit (42); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; then -- soname=conftest -- lib=conftest -- libobjs=conftest.$ac_objext -- deplibs= -- wl=$lt_cv_prog_cc_wl -- compiler_flags=-v -- linker_flags=-v -- verstring= -- output_objdir=. -- libname=conftest -- save_allow_undefined_flag=$allow_undefined_flag -- allow_undefined_flag= -- if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 -- (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } -- then -- lt_cv_archive_cmds_need_lc=no -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+rm -f conftest* -+if test -n "$ac_declaration"; then -+ echo '#ifdef __cplusplus' >>confdefs.h -+ echo $ac_declaration >>confdefs.h -+ echo '#endif' >>confdefs.h -+fi -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+depcc="$CXX" am_compiler_list= -+ -+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then -+ # We make a subdir and do the tests there. Otherwise we can end up -+ # making bogus files that we don't know about and never remove. For -+ # instance it was reported that on HP-UX the gcc test will end up -+ # making a dummy file named `D' -- because `-MD' means `put the output -+ # in D'. -+ mkdir conftest.dir -+ # Copy depcomp to subdir because otherwise we won't find it if we're -+ # using a relative directory. -+ cp "$am_depcomp" conftest.dir -+ cd conftest.dir -+ # We will build objects and dependencies in a subdirectory because -+ # it helps to detect inapplicable dependency modes. For instance -+ # both Tru64's cc and ICC support -MD to output dependencies as a -+ # side effect of compilation, but ICC will put the dependencies in -+ # the current directory while Tru64 will put them in the object -+ # directory. -+ mkdir sub -+ -+ am_cv_CXX_dependencies_compiler_type=none -+ if test "$am_compiler_list" = ""; then -+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` -+ fi -+ for depmode in $am_compiler_list; do -+ # Setup a source with many dependencies, because some compilers -+ # like to wrap large dependency lists on column 80 (with \), and -+ # we should not choose a depcomp mode which is confused by this. -+ # -+ # We need to recreate these files for each test, as the compiler may -+ # overwrite some of them when testing with obscure command lines. -+ # This happens at least with the AIX C compiler. -+ : > sub/conftest.c -+ for i in 1 2 3 4 5 6; do -+ echo '#include "conftst'$i'.h"' >> sub/conftest.c -+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with -+ # Solaris 8's {/usr,}/bin/sh. -+ touch sub/conftst$i.h -+ done -+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -+ -+ case $depmode in -+ nosideeffect) -+ # after this tag, mechanisms are not by side-effect, so they'll -+ # only be used when explicitly requested -+ if test "x$enable_dependency_tracking" = xyes; then -+ continue - else -- lt_cv_archive_cmds_need_lc=yes -+ break -+ fi -+ ;; -+ none) break ;; -+ esac -+ # We check with `-c' and `-o' for the sake of the "dashmstdout" -+ # mode. It turns out that the SunPro C++ compiler does not properly -+ # handle `-M -o', and we need to detect this. -+ if depmode=$depmode \ -+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ -+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ -+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ -+ >/dev/null 2>conftest.err && -+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && -+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && -+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -+ # icc doesn't choke on unknown options, it will just issue warnings -+ # or remarks (even with -Werror). So we grep stderr for any message -+ # that says an option was ignored or not supported. -+ # When given -MP, icc 7.0 and 7.1 complain thusly: -+ # icc: Command line warning: ignoring option '-M'; no argument required -+ # The diagnosis changed in icc 8.0: -+ # icc: Command line remark: option '-MP' not supported -+ if (grep 'ignoring option' conftest.err || -+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else -+ am_cv_CXX_dependencies_compiler_type=$depmode -+ break - fi -- allow_undefined_flag=$save_allow_undefined_flag -- else -- cat conftest.err 1>&5 - fi --fi -- -- echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 --echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6 -- ;; -- esac --fi --need_lc=${lt_cv_archive_cmds_need_lc-yes} -+ done - --# The second clause should only fire when bootstrapping the --# libtool distribution, otherwise you forgot to ship ltmain.sh --# with your package, and you will get complaints that there are --# no rules to generate ltmain.sh. --if test -f "$ltmain"; then -- : -+ cd .. -+ rm -rf conftest.dir - else -- # If there is no Makefile yet, we rely on a make rule to execute -- # `config.status --recheck' to rerun these tests and create the -- # libtool script then. -- test -f Makefile && make "$ltmain" -+ am_cv_CXX_dependencies_compiler_type=none - fi - --if test -f "$ltmain"; then -- trap "$rm \"${ofile}T\"; exit 1" 1 2 15 -- $rm -f "${ofile}T" -- -- echo creating $ofile -- -- # Now quote all the things that may contain metacharacters while being -- # careful not to overquote the AC_SUBSTed values. We take copies of the -- # variables and quote the copies for generation of the libtool script. -- for var in echo old_CC old_CFLAGS \ -- AR AR_FLAGS CC LD LN_S NM SHELL \ -- reload_flag reload_cmds wl \ -- pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ -- thread_safe_flag_spec whole_archive_flag_spec libname_spec \ -- library_names_spec soname_spec \ -- RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ -- old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ -- postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ -- old_striplib striplib file_magic_cmd export_symbols_cmds \ -- deplibs_check_method allow_undefined_flag no_undefined_flag \ -- finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ -- global_symbol_to_c_name_address \ -- hardcode_libdir_flag_spec hardcode_libdir_separator \ -- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -- compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do -- -- case $var in -- reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ -- old_postinstall_cmds | old_postuninstall_cmds | \ -- export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ -- extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ -- postinstall_cmds | postuninstall_cmds | \ -- finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) -- # Double-quote double-evaled strings. -- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" -- ;; -- *) -- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -- ;; -- esac -- done -+fi -+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 -+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - -- cat <<__EOF__ > "${ofile}T" --#! $SHELL - --# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. --# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) --# NOTE: Changes made to this file will be lost: look at ltmain.sh. --# --# Copyright (C) 1996-2000 Free Software Foundation, Inc. --# Originally by Gordon Matzigkeit , 1996 --# --# 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. --# --# As a special exception to the GNU General Public License, if you --# distribute this file as part of a program that contains a --# configuration script generated by Autoconf, you may include it under --# the same distribution terms that you use for the rest of that program. - --# Sed that helps us avoid accidentally triggering echo(1) options like -n. --Xsed="sed -e s/^X//" -+if -+ test "x$enable_dependency_tracking" != xno \ -+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then -+ am__fastdepCXX_TRUE= -+ am__fastdepCXX_FALSE='#' -+else -+ am__fastdepCXX_TRUE='#' -+ am__fastdepCXX_FALSE= -+fi - --# The HP-UX ksh and POSIX shell print the target directory to stdout --# if CDPATH is set. --if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - --# ### BEGIN LIBTOOL CONFIG - --# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -+if test "$cross_compiling" = yes; then -+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot run test program while cross compiling -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --# Shell to use when invoking shell scripts. --SHELL=$lt_SHELL -+#include -+main() -+{ -+#if defined(__GNUC__) && \ -+ ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -+ return 1; -+#endif -+ return 0; -+} - --# Whether or not to build shared libraries. --build_libtool_libs=$enable_shared -+_ACEOF -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ : -+else -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Whether or not to build static libraries. --build_old_libs=$enable_static -+( exit $ac_status ) -+echo "need at least gcc 2.95 to compile correctly" -+exit 1 -+fi -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi - --# Whether or not to add -lc for building shared libraries. --build_libtool_need_lc=$need_lc -+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -+# for constant arguments. Useless! -+echo "$as_me:$LINENO: checking for working alloca.h" >&5 -+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -+if test "${ac_cv_working_alloca_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+char *p = (char *) alloca (2 * sizeof (int)); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_working_alloca_h=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Whether or not to optimize for fast installation. --fast_install=$enable_fast_install -+ac_cv_working_alloca_h=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -+if test $ac_cv_working_alloca_h = yes; then - --# The host system. --host_alias=$host_alias --host=$host -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_ALLOCA_H 1 -+_ACEOF - --# An echo program that does not interpret backslashes. --echo=$lt_echo -+fi - --# The archiver. --AR=$lt_AR --AR_FLAGS=$lt_AR_FLAGS -+echo "$as_me:$LINENO: checking for alloca" >&5 -+echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -+if test "${ac_cv_func_alloca_works+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef __GNUC__ -+# define alloca __builtin_alloca -+#else -+# ifdef _MSC_VER -+# include -+# define alloca _alloca -+# else -+# if HAVE_ALLOCA_H -+# include -+# else -+# ifdef _AIX -+ #pragma alloca -+# else -+# ifndef alloca /* predefined by HP cc +Olibcalls */ -+char *alloca (); -+# endif -+# endif -+# endif -+# endif -+#endif - --# The default C compiler. --CC=$lt_CC -+int -+main () -+{ -+char *p = (char *) alloca (1); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_func_alloca_works=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Is the compiler the GNU C compiler? --with_gcc=$GCC -+ac_cv_func_alloca_works=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 - --# The linker used to build libraries. --LD=$lt_LD -+if test $ac_cv_func_alloca_works = yes; then - --# Whether we need hard or soft links. --LN_S=$lt_LN_S -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_ALLOCA 1 -+_ACEOF - --# A BSD-compatible nm program. --NM=$lt_NM -+else -+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions -+# that cause trouble. Some versions do not even contain alloca or -+# contain a buggy version. If you still want to use their alloca, -+# use ar to extract alloca.o from them instead of compiling alloca.c. - --# A symbol stripping program --STRIP=$STRIP -+ALLOCA=alloca.$ac_objext - --# Used to examine libraries when file_magic_cmd begins "file" --MAGIC_CMD=$MAGIC_CMD -+cat >>confdefs.h <<\_ACEOF -+#define C_ALLOCA 1 -+_ACEOF - --# Used on cygwin: DLL creation program. --DLLTOOL="$DLLTOOL" - --# Used on cygwin: object dumper. --OBJDUMP="$OBJDUMP" -+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -+if test "${ac_cv_os_cray+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#if defined(CRAY) && ! defined(CRAY2) -+webecray -+#else -+wenotbecray -+#endif - --# Used on cygwin: assembler. --AS="$AS" -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "webecray" >/dev/null 2>&1; then -+ ac_cv_os_cray=yes -+else -+ ac_cv_os_cray=no -+fi -+rm -f conftest* - --# The name of the directory that contains temporary libtool files. --objdir=$objdir -+fi -+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -+echo "${ECHO_T}$ac_cv_os_cray" >&6 -+if test $ac_cv_os_cray = yes; then -+ for ac_func in _getb67 GETB67 getb67; do -+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -+echo "$as_me:$LINENO: checking for $ac_func" >&5 -+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_var+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define $ac_func to an innocuous variant, in case declares $ac_func. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define $ac_func innocuous_$ac_func - --# How to create reloadable object files. --reload_flag=$lt_reload_flag --reload_cmds=$lt_reload_cmds -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char $ac_func (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ - --# How to pass a linker flag through the compiler. --wl=$lt_wl -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif - --# Object file suffix (normally "o"). --objext="$ac_objext" -+#undef $ac_func - --# Old archive suffix (normally "a"). --libext="$libext" -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char $ac_func (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -+choke me -+#else -+char (*f) () = $ac_func; -+#endif -+#ifdef __cplusplus -+} -+#endif - --# Executable file suffix (normally ""). --exeext="$exeext" -+int -+main () -+{ -+return f != $ac_func; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ eval "$as_ac_var=yes" -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Additional compiler flags for building library objects. --pic_flag=$lt_pic_flag --pic_mode=$pic_mode -+eval "$as_ac_var=no" -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -+if test `eval echo '${'$as_ac_var'}'` = yes; then - --# Does compiler simultaneously support -c and -o options? --compiler_c_o=$lt_compiler_c_o -+cat >>confdefs.h <<_ACEOF -+#define CRAY_STACKSEG_END $ac_func -+_ACEOF - --# Can we write directly to a .lo ? --compiler_o_lo=$lt_compiler_o_lo -+ break -+fi - --# Must we lock files when doing compilation ? --need_locks=$lt_need_locks -+ done -+fi - --# Do we need the lib prefix for modules? --need_lib_prefix=$need_lib_prefix -+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -+if test "${ac_cv_c_stack_direction+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$cross_compiling" = yes; then -+ ac_cv_c_stack_direction=0 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+int -+find_stack_direction () -+{ -+ static char *addr = 0; -+ auto char dummy; -+ if (addr == 0) -+ { -+ addr = &dummy; -+ return find_stack_direction (); -+ } -+ else -+ return (&dummy > addr) ? 1 : -1; -+} - --# Do we need a version for libraries? --need_version=$need_version -+int -+main () -+{ -+ exit (find_stack_direction () < 0); -+} -+_ACEOF -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_c_stack_direction=1 -+else -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Whether dlopen is supported. --dlopen_support=$enable_dlopen -+( exit $ac_status ) -+ac_cv_c_stack_direction=-1 -+fi -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+fi -+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 - --# Whether dlopen of programs is supported. --dlopen_self=$enable_dlopen_self -+cat >>confdefs.h <<_ACEOF -+#define STACK_DIRECTION $ac_cv_c_stack_direction -+_ACEOF - --# Whether dlopen of statically linked programs is supported. --dlopen_self_static=$enable_dlopen_self_static - --# Compiler flag to prevent dynamic linking. --link_static_flag=$lt_link_static_flag -+fi - --# Compiler flag to turn off builtin functions. --no_builtin_flag=$lt_no_builtin_flag - --# Compiler flag to allow reflexive dlopens. --export_dynamic_flag_spec=$lt_export_dynamic_flag_spec -+echo "$as_me:$LINENO: checking for getopt_long in -lc" >&5 -+echo $ECHO_N "checking for getopt_long in -lc... $ECHO_C" >&6 -+if test "${ac_cv_lib_c_getopt_long+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lc $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --# Compiler flag to generate shared objects directly from archives. --whole_archive_flag_spec=$lt_whole_archive_flag_spec -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char getopt_long (); -+int -+main () -+{ -+getopt_long (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_c_getopt_long=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Compiler flag to generate thread-safe objects. --thread_safe_flag_spec=$lt_thread_safe_flag_spec -+ac_cv_lib_c_getopt_long=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_c_getopt_long" >&5 -+echo "${ECHO_T}$ac_cv_lib_c_getopt_long" >&6 -+if test $ac_cv_lib_c_getopt_long = yes; then -+ cat >>confdefs.h <<\_ACEOF -+#define HAVE_GETOPT_LONG 1 -+_ACEOF - --# Library versioning type. --version_type=$version_type -+fi - --# Format of library name prefix. --libname_spec=$lt_libname_spec - --# List of archive names. First name is the real one, the rest are links. --# The last name is the one that the linker finds with -lNAME. --library_names_spec=$lt_library_names_spec -+echo "$as_me:$LINENO: checking for alarm in -lc" >&5 -+echo $ECHO_N "checking for alarm in -lc... $ECHO_C" >&6 -+if test "${ac_cv_lib_c_alarm+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lc $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --# The coded name of the library, if different from the real name. --soname_spec=$lt_soname_spec -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char alarm (); -+int -+main () -+{ -+alarm (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_lib_c_alarm=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Commands used to build and install an old-style archive. --RANLIB=$lt_RANLIB --old_archive_cmds=$lt_old_archive_cmds --old_postinstall_cmds=$lt_old_postinstall_cmds --old_postuninstall_cmds=$lt_old_postuninstall_cmds -+ac_cv_lib_c_alarm=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_lib_c_alarm" >&5 -+echo "${ECHO_T}$ac_cv_lib_c_alarm" >&6 -+if test $ac_cv_lib_c_alarm = yes; then -+ cat >>confdefs.h <<\_ACEOF -+#define HAVE_ALARM 1 -+_ACEOF - --# Create an old-style archive from a shared archive. --old_archive_from_new_cmds=$lt_old_archive_from_new_cmds -+fi - --# Create a temporary old-style archive to link instead of a shared archive. --old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - --# Commands used to build and install a shared archive. --archive_cmds=$lt_archive_cmds --archive_expsym_cmds=$lt_archive_expsym_cmds --postinstall_cmds=$lt_postinstall_cmds --postuninstall_cmds=$lt_postuninstall_cmds - --# Commands to strip libraries. --old_striplib=$lt_old_striplib --striplib=$lt_striplib -+for ac_header in netinet/in.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Method to check whether dependent libraries are shared objects. --deplibs_check_method=$lt_deplibs_check_method -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 - --# Command to use when deplibs_check_method == file_magic. --file_magic_cmd=$lt_file_magic_cmd -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Flag that allows shared libraries with undefined symbols to be built. --allow_undefined_flag=$lt_allow_undefined_flag -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 - --# Flag that forces no undefined symbols. --no_undefined_flag=$lt_no_undefined_flag -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ eval "$as_ac_Header=\$ac_header_preproc" -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - --# Commands used to finish a libtool library installation in a directory. --finish_cmds=$lt_finish_cmds -+fi -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF - --# Same as above, but a single script fragment to be evaled but not shown. --finish_eval=$lt_finish_eval -+fi - --# Take the output of nm and produce a listing of raw symbols and C names. --global_symbol_pipe=$lt_global_symbol_pipe -+done - --# Transform the output of nm in a proper C declaration --global_symbol_to_cdecl=$lt_global_symbol_to_cdecl - --# Transform the output of nm in a C name address pair --global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address - --# This is the shared library runtime path variable. --runpath_var=$runpath_var -+for ac_header in string.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# This is the shared library path variable. --shlibpath_var=$shlibpath_var -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 - --# Is shlibpath searched before the hard-coded library search path? --shlibpath_overrides_runpath=$shlibpath_overrides_runpath -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# How to hardcode a shared library path into an executable. --hardcode_action=$hardcode_action -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 - --# Whether we should hardcode library paths into libraries. --hardcode_into_libs=$hardcode_into_libs -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ eval "$as_ac_Header=\$ac_header_preproc" -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - --# Flag to hardcode \$libdir into a binary during linking. --# This must work even if \$libdir does not exist. --hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -+fi -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF - --# Whether we need a single -rpath flag with a separated argument. --hardcode_libdir_separator=$lt_hardcode_libdir_separator -+fi - --# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the --# resulting binary. --hardcode_direct=$hardcode_direct -+done - --# Set to yes if using the -LDIR flag during linking hardcodes DIR into the --# resulting binary. --hardcode_minus_L=$hardcode_minus_L - --# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into --# the resulting binary. --hardcode_shlibpath_var=$hardcode_shlibpath_var - --# Variables whose values should be saved in libtool wrapper scripts and --# restored at relink time. --variables_saved_for_relink="$variables_saved_for_relink" -+for ac_header in libintl.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Whether libtool must link a program against all its dependency libraries. --link_all_deplibs=$link_all_deplibs -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 - --# Compile-time system search path for libraries --sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Run-time system search path for libraries --sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 - --# Fix the shell variable \$srcfile for the compiler. --fix_srcfile_path="$fix_srcfile_path" -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ eval "$as_ac_Header=\$ac_header_preproc" -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - --# Set to yes if exported symbols are required. --always_export_symbols=$always_export_symbols -+fi -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF - --# The commands to list exported symbols. --export_symbols_cmds=$lt_export_symbols_cmds -+fi - --# The commands to extract the exported symbol list from a shared archive. --extract_expsyms_cmds=$lt_extract_expsyms_cmds -+done - --# Symbols that should not be listed in the preloaded symbols. --exclude_expsyms=$lt_exclude_expsyms - --# Symbols that must always be exported. --include_expsyms=$lt_include_expsyms -+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -+if test "${ac_cv_c_const+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --# ### END LIBTOOL CONFIG -+int -+main () -+{ -+/* FIXME: Include the comments suggested by Paul. */ -+#ifndef __cplusplus -+ /* Ultrix mips cc rejects this. */ -+ typedef int charset[2]; -+ const charset x; -+ /* SunOS 4.1.1 cc rejects this. */ -+ char const *const *ccp; -+ char **p; -+ /* NEC SVR4.0.2 mips cc rejects this. */ -+ struct point {int x, y;}; -+ static struct point const zero = {0,0}; -+ /* AIX XL C 1.02.0.0 rejects this. -+ It does not let you subtract one const X* pointer from another in -+ an arm of an if-expression whose if-part is not a constant -+ expression */ -+ const char *g = "string"; -+ ccp = &g + (g ? g-g : 0); -+ /* HPUX 7.0 cc rejects these. */ -+ ++ccp; -+ p = (char**) ccp; -+ ccp = (char const *const *) p; -+ { /* SCO 3.2v4 cc rejects this. */ -+ char *t; -+ char const *s = 0 ? (char *) 0 : (char const *) 0; - --__EOF__ -+ *t++ = 0; -+ } -+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ -+ int x[] = {25, 17}; -+ const int *foo = &x[0]; -+ ++foo; -+ } -+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ -+ typedef const int *iptr; -+ iptr p = 0; -+ ++p; -+ } -+ { /* AIX XL C 1.02.0.0 rejects this saying -+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ -+ struct s { int j; const int *ap[3]; }; -+ struct s *b; b->j = 5; -+ } -+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ -+ const int foo = 10; -+ } -+#endif - -- case $host_os in -- aix3*) -- cat <<\EOF >> "${ofile}T" -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_c_const=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# AIX sometimes has problems with the GCC collect2 program. For some --# reason, if we set the COLLECT_NAMES environment variable, the problems --# vanish in a puff of smoke. --if test "X${COLLECT_NAMES+set}" != Xset; then -- COLLECT_NAMES= -- export COLLECT_NAMES -+ac_cv_c_const=no - fi --EOF -- ;; -- esac -- -- case $host_os in -- cygwin* | mingw* | pw32* | os2*) -- cat <<'EOF' >> "${ofile}T" -- # This is a source program that is used to create dlls on Windows -- # Don't remove nor modify the starting and closing comments --# /* ltdll.c starts here */ --# #define WIN32_LEAN_AND_MEAN --# #include --# #undef WIN32_LEAN_AND_MEAN --# #include --# --# #ifndef __CYGWIN__ --# # ifdef __CYGWIN32__ --# # define __CYGWIN__ __CYGWIN32__ --# # endif --# #endif --# --# #ifdef __cplusplus --# extern "C" { --# #endif --# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); --# #ifdef __cplusplus --# } --# #endif --# --# #ifdef __CYGWIN__ --# #include --# DECLARE_CYGWIN_DLL( DllMain ); --# #endif --# HINSTANCE __hDllInstance_base; --# --# BOOL APIENTRY --# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) --# { --# __hDllInstance_base = hInst; --# return TRUE; --# } --# /* ltdll.c ends here */ -- # This is a source program that is used to create import libraries -- # on Windows for dlls which lack them. Don't remove nor modify the -- # starting and closing comments --# /* impgen.c starts here */ --# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. --# --# This file is part of GNU libtool. --# --# 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. --# */ --# --# #include /* for printf() */ --# #include /* for open(), lseek(), read() */ --# #include /* for O_RDONLY, O_BINARY */ --# #include /* for strdup() */ --# --# /* O_BINARY isn't required (or even defined sometimes) under Unix */ --# #ifndef O_BINARY --# #define O_BINARY 0 --# #endif --# --# static unsigned int --# pe_get16 (fd, offset) --# int fd; --# int offset; --# { --# unsigned char b[2]; --# lseek (fd, offset, SEEK_SET); --# read (fd, b, 2); --# return b[0] + (b[1]<<8); --# } --# --# static unsigned int --# pe_get32 (fd, offset) --# int fd; --# int offset; --# { --# unsigned char b[4]; --# lseek (fd, offset, SEEK_SET); --# read (fd, b, 4); --# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); --# } --# --# static unsigned int --# pe_as32 (ptr) --# void *ptr; --# { --# unsigned char *b = ptr; --# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); --# } --# --# int --# main (argc, argv) --# int argc; --# char *argv[]; --# { --# int dll; --# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; --# unsigned long export_rva, export_size, nsections, secptr, expptr; --# unsigned long name_rvas, nexp; --# unsigned char *expdata, *erva; --# char *filename, *dll_name; --# --# filename = argv[1]; --# --# dll = open(filename, O_RDONLY|O_BINARY); --# if (dll < 1) --# return 1; --# --# dll_name = filename; --# --# for (i=0; filename[i]; i++) --# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') --# dll_name = filename + i +1; --# --# pe_header_offset = pe_get32 (dll, 0x3c); --# opthdr_ofs = pe_header_offset + 4 + 20; --# num_entries = pe_get32 (dll, opthdr_ofs + 92); --# --# if (num_entries < 1) /* no exports */ --# return 1; --# --# export_rva = pe_get32 (dll, opthdr_ofs + 96); --# export_size = pe_get32 (dll, opthdr_ofs + 100); --# nsections = pe_get16 (dll, pe_header_offset + 4 +2); --# secptr = (pe_header_offset + 4 + 20 + --# pe_get16 (dll, pe_header_offset + 4 + 16)); --# --# expptr = 0; --# for (i = 0; i < nsections; i++) --# { --# char sname[8]; --# unsigned long secptr1 = secptr + 40 * i; --# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); --# unsigned long vsize = pe_get32 (dll, secptr1 + 16); --# unsigned long fptr = pe_get32 (dll, secptr1 + 20); --# lseek(dll, secptr1, SEEK_SET); --# read(dll, sname, 8); --# if (vaddr <= export_rva && vaddr+vsize > export_rva) --# { --# expptr = fptr + (export_rva - vaddr); --# if (export_rva + export_size > vaddr + vsize) --# export_size = vsize - (export_rva - vaddr); --# break; --# } --# } --# --# expdata = (unsigned char*)malloc(export_size); --# lseek (dll, expptr, SEEK_SET); --# read (dll, expdata, export_size); --# erva = expdata - export_rva; --# --# nexp = pe_as32 (expdata+24); --# name_rvas = pe_as32 (expdata+32); --# --# printf ("EXPORTS\n"); --# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) -- -- mv -f "${ofile}T" "$ofile" || \ -- (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") -- chmod +x "$ofile" -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi -+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -+echo "${ECHO_T}$ac_cv_c_const" >&6 -+if test $ac_cv_c_const = no; then - -+cat >>confdefs.h <<\_ACEOF -+#define const -+_ACEOF - -+fi - - -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - --# This can be used to rebuild libtool when needed --LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" -- --# Always use our own libtool. --LIBTOOL='$(SHELL) $(top_builddir)/libtool' -- --# Prevent multiple expansion -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "vsnprintf" >/dev/null 2>&1; then -+ cat >>confdefs.h <<\_ACEOF -+#define HAVE_VSNPRINTF 1 -+_ACEOF - -+fi -+rm -f conftest* - - --ac_ext=c --ac_cpp='$CPP $CPPFLAGS' --ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_c_compiler_gnu --echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 --echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 --# On Suns, sometimes $CPP names a directory. --if test -n "$CPP" && test -d "$CPP"; then -- CPP= --fi --if test -z "$CPP"; then -- if test "${ac_cv_prog_CPP+set}" = set; then -+echo "$as_me:$LINENO: checking for unsigned short int" >&5 -+echo $ECHO_N "checking for unsigned short int... $ECHO_C" >&6 -+if test "${ac_cv_type_unsigned_short_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- # Double quotes because CPP needs to be expanded -- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" -- do -- ac_preproc_ok=false --for ac_c_preproc_warn_flag in '' yes --do -- # Use a header file that comes with gcc, so configuring glibc -- # with a fresh cross-compiler works. -- # On the NeXT, cc -E runs the code through the compiler's parser, -- # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -- Syntax error -+/* confdefs.h. */ - _ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+if ((unsigned short int *) 0) -+ return 0; -+if (sizeof (unsigned short int)) -+ return 0; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi --else -- ac_cpp_err=yes --fi --if test -z "$ac_cpp_err"; then -- : -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_type_unsigned_short_int=yes - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- # Broken: fails on valid input. --continue -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_unsigned_short_int=no - fi --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short_int" >&5 -+echo "${ECHO_T}$ac_cv_type_unsigned_short_int" >&6 - -- # OK, works on sane cases. Now check whether non-existent headers -- # can be detected and how. -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -+echo "$as_me:$LINENO: checking size of unsigned short int" >&5 -+echo $ECHO_N "checking size of unsigned short int... $ECHO_C" >&6 -+if test "${ac_cv_sizeof_unsigned_short_int+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test "$ac_cv_type_unsigned_short_int" = yes; then -+ # The cast to unsigned long works around a bug in the HP C Compiler -+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -+ # This bug is HP SR number 8606223364. -+ if test "$cross_compiling" = yes; then -+ # Depending upon the size, compute the lo and hi bounds. -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) >= 0)]; -+test_array [0] = 0 -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi --else -- ac_cpp_err=yes --fi --if test -z "$ac_cpp_err"; then -- # Broken: success on invalid input. --continue -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_lo=0 ac_mid=0 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) <= $ac_mid)]; -+test_array [0] = 0 -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- # Passes both tests. --ac_preproc_ok=: --break --fi --rm -f conftest.err conftest.$ac_ext -+sed 's/^/| /' conftest.$ac_ext >&5 - --done --# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.err conftest.$ac_ext --if $ac_preproc_ok; then -- break -+ac_lo=`expr $ac_mid + 1` -+ if test $ac_lo -le $ac_mid; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid + 1` - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -- done -- ac_cv_prog_CPP=$CPP -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) < 0)]; -+test_array [0] = 0 - --fi -- CPP=$ac_cv_prog_CPP --else -- ac_cv_prog_CPP=$CPP --fi --echo "$as_me:$LINENO: result: $CPP" >&5 --echo "${ECHO_T}$CPP" >&6 --ac_preproc_ok=false --for ac_c_preproc_warn_flag in '' yes --do -- # Use a header file that comes with gcc, so configuring glibc -- # with a fresh cross-compiler works. -- # On the NeXT, cc -E runs the code through the compiler's parser, -- # not just through cpp. "Syntax error" is here to catch this case. -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -- Syntax error -+ ; -+ return 0; -+} - _ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi --else -- ac_cpp_err=yes --fi --if test -z "$ac_cpp_err"; then -- : --else -- echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- # Broken: fails on valid input. --continue --fi --rm -f conftest.err conftest.$ac_ext -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=-1 ac_mid=-1 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) >= $ac_mid)]; -+test_array [0] = 0 - -- # OK, works on sane cases. Now check whether non-existent headers -- # can be detected and how. -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -+ ; -+ return 0; -+} - _ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi --else -- ac_cpp_err=yes --fi --if test -z "$ac_cpp_err"; then -- # Broken: success on invalid input. --continue -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_lo=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- # Passes both tests. --ac_preproc_ok=: --break --fi --rm -f conftest.err conftest.$ac_ext -- --done --# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.err conftest.$ac_ext --if $ac_preproc_ok; then -- : --else -- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 --echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} -- { (exit 1); exit 1; }; } --fi -- --ac_ext=c --ac_cpp='$CPP $CPPFLAGS' --ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_c_compiler_gnu -- --ac_ext=cc --ac_cpp='$CXXCPP $CPPFLAGS' --ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_cxx_compiler_gnu --if test -n "$ac_tool_prefix"; then -- for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -- do -- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. --set dummy $ac_tool_prefix$ac_prog; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_CXX+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- if test -n "$CXX"; then -- ac_cv_prog_CXX="$CXX" # Let the user override the test. --else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_hi=`expr '(' $ac_mid ')' - 1` -+ if test $ac_mid -le $ac_hi; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid` - fi --fi --CXX=$ac_cv_prog_CXX --if test -n "$CXX"; then -- echo "$as_me:$LINENO: result: $CXX" >&5 --echo "${ECHO_T}$CXX" >&6 --else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 --fi -- -- test -n "$CXX" && break -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done --fi --if test -z "$CXX"; then -- ac_ct_CXX=$CXX -- for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC --do -- # Extract the first word of "$ac_prog", so it can be a program name with args. --set dummy $ac_prog; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- if test -n "$ac_ct_CXX"; then -- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. - else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_ac_ct_CXX="$ac_prog" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo= ac_hi= - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --ac_ct_CXX=$ac_cv_prog_ac_ct_CXX --if test -n "$ac_ct_CXX"; then -- echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 --echo "${ECHO_T}$ac_ct_CXX" >&6 --else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 --fi -- -- test -n "$ac_ct_CXX" && break --done --test -n "$ac_ct_CXX" || ac_ct_CXX="g++" -- -- CXX=$ac_ct_CXX --fi -- -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+# Binary search between lo and hi bounds. -+while test "x$ac_lo" != "x$ac_hi"; do -+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) <= $ac_mid)]; -+test_array [0] = 0 - --# Provide some information about the compiler. --echo "$as_me:$LINENO:" \ -- "checking for C++ compiler version" >&5 --ac_compiler=`set X $ac_compile; echo $2` --{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 -- (eval $ac_compiler --version &5) 2>&5 -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } --{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 -- (eval $ac_compiler -v &5) 2>&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } --{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 -- (eval $ac_compiler -V &5) 2>&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } -+ (exit $ac_status); }; }; then -+ ac_hi=$ac_mid -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 --echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 --if test "${ac_cv_cxx_compiler_gnu+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ac_lo=`expr '(' $ac_mid ')' + 1` -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+case $ac_lo in -+?*) ac_cv_sizeof_unsigned_short_int=$ac_lo;; -+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short int), 77 -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute sizeof (unsigned short int), 77 -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } ;; -+esac -+else -+ if test "$cross_compiling" = yes; then -+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -+echo "$as_me: error: internal error: not reached in cross-compile" >&2;} -+ { (exit 1); exit 1; }; } - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+long longval () { return (long) (sizeof (unsigned short int)); } -+unsigned long ulongval () { return (long) (sizeof (unsigned short int)); } -+#include -+#include - int - main () - { --#ifndef __GNUC__ -- choke me --#endif -+ -+ FILE *f = fopen ("conftest.val", "w"); -+ if (! f) -+ exit (1); -+ if (((long) (sizeof (unsigned short int))) < 0) -+ { -+ long i = longval (); -+ if (i != ((long) (sizeof (unsigned short int)))) -+ exit (1); -+ fprintf (f, "%ld\n", i); -+ } -+ else -+ { -+ unsigned long i = ulongval (); -+ if (i != ((long) (sizeof (unsigned short int)))) -+ exit (1); -+ fprintf (f, "%lu\n", i); -+ } -+ exit (ferror (f) || fclose (f) != 0); - - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_compiler_gnu=yes -+ ac_cv_sizeof_unsigned_short_int=`cat conftest.val` - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_compiler_gnu=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext --ac_cv_cxx_compiler_gnu=$ac_compiler_gnu -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+( exit $ac_status ) -+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short int), 77 -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute sizeof (unsigned short int), 77 -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } - fi --echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 --echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 --GXX=`test $ac_compiler_gnu = yes && echo yes` --ac_test_CXXFLAGS=${CXXFLAGS+set} --ac_save_CXXFLAGS=$CXXFLAGS --CXXFLAGS="-g" --echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 --echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 --if test "${ac_cv_prog_cxx_g+set}" = set; then -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+fi -+rm -f conftest.val -+else -+ ac_cv_sizeof_unsigned_short_int=0 -+fi -+fi -+echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short_int" >&5 -+echo "${ECHO_T}$ac_cv_sizeof_unsigned_short_int" >&6 -+cat >>confdefs.h <<_ACEOF -+#define SIZEOF_UNSIGNED_SHORT_INT $ac_cv_sizeof_unsigned_short_int -+_ACEOF -+ -+ -+echo "$as_me:$LINENO: checking for unsigned long int" >&5 -+echo $ECHO_N "checking for unsigned long int... $ECHO_C" >&6 -+if test "${ac_cv_type_unsigned_long_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { -- -+if ((unsigned long int *) 0) -+ return 0; -+if (sizeof (unsigned long int)) -+ return 0; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_prog_cxx_g=yes -+ ac_cv_type_unsigned_long_int=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_prog_cxx_g=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_unsigned_long_int=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 --echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 --if test "$ac_test_CXXFLAGS" = set; then -- CXXFLAGS=$ac_save_CXXFLAGS --elif test $ac_cv_prog_cxx_g = yes; then -- if test "$GXX" = yes; then -- CXXFLAGS="-g -O2" -- else -- CXXFLAGS="-g" -- fi -+echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_int" >&5 -+echo "${ECHO_T}$ac_cv_type_unsigned_long_int" >&6 -+ -+echo "$as_me:$LINENO: checking size of unsigned long int" >&5 -+echo $ECHO_N "checking size of unsigned long int... $ECHO_C" >&6 -+if test "${ac_cv_sizeof_unsigned_long_int+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test "$GXX" = yes; then -- CXXFLAGS="-O2" -- else -- CXXFLAGS= -- fi --fi --for ac_declaration in \ -- ''\ -- '#include ' \ -- 'extern "C" void std::exit (int) throw (); using std::exit;' \ -- 'extern "C" void std::exit (int); using std::exit;' \ -- 'extern "C" void exit (int) throw ();' \ -- 'extern "C" void exit (int);' \ -- 'void exit (int);' --do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include --$ac_declaration --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ if test "$ac_cv_type_unsigned_long_int" = yes; then -+ # The cast to unsigned long works around a bug in the HP C Compiler -+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -+ # This bug is HP SR number 8606223364. -+ if test "$cross_compiling" = yes; then -+ # Depending upon the size, compute the lo and hi bounds. -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { --exit (42); -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) >= 0)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- : --else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --continue --fi --rm -f conftest.$ac_objext conftest.$ac_ext -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_declaration --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ ac_lo=0 ac_mid=0 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { --exit (42); -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) <= $ac_mid)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- break -+ ac_hi=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --fi --rm -f conftest.$ac_objext conftest.$ac_ext --done --rm -f conftest* --if test -n "$ac_declaration"; then -- echo '#ifdef __cplusplus' >>confdefs.h -- echo $ac_declaration >>confdefs.h -- echo '#endif' >>confdefs.h --fi -- --ac_ext=c --ac_cpp='$CPP $CPPFLAGS' --ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_c_compiler_gnu -- --depcc="$CXX" am_compiler_list= -- --echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 --echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 --if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then -- # We make a subdir and do the tests there. Otherwise we can end up -- # making bogus files that we don't know about and never remove. For -- # instance it was reported that on HP-UX the gcc test will end up -- # making a dummy file named `D' -- because `-MD' means `put the output -- # in D'. -- mkdir conftest.dir -- # Copy depcomp to subdir because otherwise we won't find it if we're -- # using a relative directory. -- cp "$am_depcomp" conftest.dir -- cd conftest.dir -- -- am_cv_CXX_dependencies_compiler_type=none -- if test "$am_compiler_list" = ""; then -- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` -- fi -- for depmode in $am_compiler_list; do -- # We need to recreate these files for each test, as the compiler may -- # overwrite some of them when testing with obscure command lines. -- # This happens at least with the AIX C compiler. -- echo '#include "conftest.h"' > conftest.c -- echo 'int i;' > conftest.h -- echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf -- -- case $depmode in -- nosideeffect) -- # after this tag, mechanisms are not by side-effect, so they'll -- # only be used when explicitly requested -- if test "x$enable_dependency_tracking" = xyes; then -- continue -- else -- break -- fi -- ;; -- none) break ;; -- esac -- # We check with `-c' and `-o' for the sake of the "dashmstdout" -- # mode. It turns out that the SunPro C++ compiler does not properly -- # handle `-M -o', and we need to detect this. -- if depmode=$depmode \ -- source=conftest.c object=conftest.o \ -- depfile=conftest.Po tmpdepfile=conftest.TPo \ -- $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && -- grep conftest.h conftest.Po > /dev/null 2>&1 && -- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -- am_cv_CXX_dependencies_compiler_type=$depmode -- break -- fi -- done -- -- cd .. -- rm -rf conftest.dir --else -- am_cv_CXX_dependencies_compiler_type=none --fi -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo=`expr $ac_mid + 1` -+ if test $ac_lo -le $ac_mid; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid + 1` - fi --echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 --echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 --CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type -- -- -- --if test "$cross_compiling" = yes; then -- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 --echo "$as_me: error: cannot run test program while cross compiling" >&2;} -- { (exit 1); exit 1; }; } -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --#include --main() --{ --#if defined(__GNUC__) && \ -- ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -- return 1; --#endif -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) < 0)]; -+test_array [0] = 0 -+ -+ ; - return 0; - } -- - _ACEOF --rm -f conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- : --else -- echo "$as_me: program exited with status $ac_status" >&5 --echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --( exit $ac_status ) --echo "need at least gcc 2.95 to compile correctly" --exit 1 --fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext --fi -- --# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works --# for constant arguments. Useless! --echo "$as_me:$LINENO: checking for working alloca.h" >&5 --echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 --if test "${ac_cv_working_alloca_h+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ ac_hi=-1 ac_mid=-1 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { --char *p = (char *) alloca (2 * sizeof (int)); -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) >= $ac_mid)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_working_alloca_h=yes -+ ac_lo=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_working_alloca_h=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --fi --echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 --echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 --if test $ac_cv_working_alloca_h = yes; then -- --cat >>confdefs.h <<\_ACEOF --#define HAVE_ALLOCA_H 1 --_ACEOF -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_hi=`expr '(' $ac_mid ')' - 1` -+ if test $ac_mid -le $ac_hi; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid` - fi -- --echo "$as_me:$LINENO: checking for alloca" >&5 --echo $ECHO_N "checking for alloca... $ECHO_C" >&6 --if test "${ac_cv_func_alloca_works+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#ifdef __GNUC__ --# define alloca __builtin_alloca --#else --# ifdef _MSC_VER --# include --# define alloca _alloca --# else --# if HAVE_ALLOCA_H --# include --# else --# ifdef _AIX -- #pragma alloca --# else --# ifndef alloca /* predefined by HP cc +Olibcalls */ --char *alloca (); --# endif --# endif --# endif --# endif --#endif -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ac_lo= ac_hi= -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+# Binary search between lo and hi bounds. -+while test "x$ac_lo" != "x$ac_hi"; do -+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { --char *p = (char *) alloca (1); -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) <= $ac_mid)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_func_alloca_works=yes -+ ac_hi=$ac_mid - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_func_alloca_works=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --fi --echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 --echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 -- --if test $ac_cv_func_alloca_works = yes; then -- --cat >>confdefs.h <<\_ACEOF --#define HAVE_ALLOCA 1 --_ACEOF -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo=`expr '(' $ac_mid ')' + 1` -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+case $ac_lo in -+?*) ac_cv_sizeof_unsigned_long_int=$ac_lo;; -+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long int), 77 -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute sizeof (unsigned long int), 77 -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } ;; -+esac - else -- # The SVR3 libPW and SVR4 libucb both contain incompatible functions --# that cause trouble. Some versions do not even contain alloca or --# contain a buggy version. If you still want to use their alloca, --# use ar to extract alloca.o from them instead of compiling alloca.c. -- --ALLOCA=alloca.$ac_objext -- --cat >>confdefs.h <<\_ACEOF --#define C_ALLOCA 1 --_ACEOF -- -- --echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 --echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 --if test "${ac_cv_os_cray+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ if test "$cross_compiling" = yes; then -+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -+echo "$as_me: error: internal error: not reached in cross-compile" >&2;} -+ { (exit 1); exit 1; }; } - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#if defined(CRAY) && ! defined(CRAY2) --webecray --#else --wenotbecray --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+long longval () { return (long) (sizeof (unsigned long int)); } -+unsigned long ulongval () { return (long) (sizeof (unsigned long int)); } -+#include -+#include -+int -+main () -+{ -+ -+ FILE *f = fopen ("conftest.val", "w"); -+ if (! f) -+ exit (1); -+ if (((long) (sizeof (unsigned long int))) < 0) -+ { -+ long i = longval (); -+ if (i != ((long) (sizeof (unsigned long int)))) -+ exit (1); -+ fprintf (f, "%ld\n", i); -+ } -+ else -+ { -+ unsigned long i = ulongval (); -+ if (i != ((long) (sizeof (unsigned long int)))) -+ exit (1); -+ fprintf (f, "%lu\n", i); -+ } -+ exit (ferror (f) || fclose (f) != 0); - -+ ; -+ return 0; -+} - _ACEOF --if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- egrep "webecray" >/dev/null 2>&1; then -- ac_cv_os_cray=yes -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_sizeof_unsigned_long_int=`cat conftest.val` - else -- ac_cv_os_cray=no --fi --rm -f conftest* -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+( exit $ac_status ) -+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long int), 77 -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute sizeof (unsigned long int), 77 -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } - fi --echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 --echo "${ECHO_T}$ac_cv_os_cray" >&6 --if test $ac_cv_os_cray = yes; then -- for ac_func in _getb67 GETB67 getb67; do -- as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` --echo "$as_me:$LINENO: checking for $ac_func" >&5 --echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 --if eval "test \"\${$as_ac_var+set}\" = set"; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+fi -+rm -f conftest.val - else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --/* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char $ac_func (); below. */ --#include --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char $ac_func (); --char (*f) (); -+ ac_cv_sizeof_unsigned_long_int=0 -+fi -+fi -+echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_int" >&5 -+echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_int" >&6 -+cat >>confdefs.h <<_ACEOF -+#define SIZEOF_UNSIGNED_LONG_INT $ac_cv_sizeof_unsigned_long_int -+_ACEOF - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ -+echo "$as_me:$LINENO: checking for unsigned int" >&5 -+echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6 -+if test "${ac_cv_type_unsigned_int+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { --/* The GNU C library defines this for functions which it implements -- to always fail with ENOSYS. Some functions are actually named -- something starting with __ and the normal name is an alias. */ --#if defined (__stub_$ac_func) || defined (__stub___$ac_func) --choke me --#else --f = $ac_func; --#endif -- -+if ((unsigned int *) 0) -+ return 0; -+if (sizeof (unsigned int)) -+ return 0; - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- eval "$as_ac_var=yes" -+ ac_cv_type_unsigned_int=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --eval "$as_ac_var=no" --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 --if test `eval echo '${'$as_ac_var'}'` = yes; then -- --cat >>confdefs.h <<_ACEOF --#define CRAY_STACKSEG_END $ac_func --_ACEOF -+sed 's/^/| /' conftest.$ac_ext >&5 - -- break -+ac_cv_type_unsigned_int=no - fi -- -- done -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi -+echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5 -+echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6 - --echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 --echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 --if test "${ac_cv_c_stack_direction+set}" = set; then -+echo "$as_me:$LINENO: checking size of unsigned int" >&5 -+echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6 -+if test "${ac_cv_sizeof_unsigned_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -+ if test "$ac_cv_type_unsigned_int" = yes; then -+ # The cast to unsigned long works around a bug in the HP C Compiler -+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -+ # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then -- ac_cv_c_stack_direction=0 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ # Depending upon the size, compute the lo and hi bounds. -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int --find_stack_direction () -+main () - { -- static char *addr = 0; -- auto char dummy; -- if (addr == 0) -- { -- addr = &dummy; -- return find_stack_direction (); -- } -- else -- return (&dummy > addr) ? 1 : -1; --} -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= 0)]; -+test_array [0] = 0 - -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_lo=0 ac_mid=0 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { -- exit (find_stack_direction () < 0); -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; -+test_array [0] = 0 -+ -+ ; -+ return 0; - } - _ACEOF --rm -f conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_c_stack_direction=1 -+ ac_hi=$ac_mid; break - else -- echo "$as_me: program exited with status $ac_status" >&5 --echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --( exit $ac_status ) --ac_cv_c_stack_direction=-1 --fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext --fi --fi --echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 --echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -- --cat >>confdefs.h <<_ACEOF --#define STACK_DIRECTION $ac_cv_c_stack_direction --_ACEOF -- -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo=`expr $ac_mid + 1` -+ if test $ac_lo -le $ac_mid; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid + 1` - fi -- -- --echo "$as_me:$LINENO: checking for getopt_long in -lc" >&5 --echo $ECHO_N "checking for getopt_long in -lc... $ECHO_C" >&6 --if test "${ac_cv_lib_c_getopt_long+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lc $LIBS" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) < 0)]; -+test_array [0] = 0 - --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char getopt_long (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=-1 ac_mid=-1 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { --getopt_long (); -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= $ac_mid)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_lib_c_getopt_long=yes -+ ac_lo=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_lib_c_getopt_long=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --echo "$as_me:$LINENO: result: $ac_cv_lib_c_getopt_long" >&5 --echo "${ECHO_T}$ac_cv_lib_c_getopt_long" >&6 --if test $ac_cv_lib_c_getopt_long = yes; then -- cat >>confdefs.h <<\_ACEOF --#define HAVE_GETOPT_LONG 1 --_ACEOF -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_hi=`expr '(' $ac_mid ')' - 1` -+ if test $ac_mid -le $ac_hi; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid` - fi -- -- --echo "$as_me:$LINENO: checking for alarm in -lc" >&5 --echo $ECHO_N "checking for alarm in -lc... $ECHO_C" >&6 --if test "${ac_cv_lib_c_alarm+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lc $LIBS" --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char alarm (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ac_lo= ac_hi= -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+# Binary search between lo and hi bounds. -+while test "x$ac_lo" != "x$ac_hi"; do -+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default - int - main () - { --alarm (); -+static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_lib_c_alarm=yes -+ ac_hi=$ac_mid - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_lib_c_alarm=no --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --echo "$as_me:$LINENO: result: $ac_cv_lib_c_alarm" >&5 --echo "${ECHO_T}$ac_cv_lib_c_alarm" >&6 --if test $ac_cv_lib_c_alarm = yes; then -- cat >>confdefs.h <<\_ACEOF --#define HAVE_ALARM 1 --_ACEOF -- --fi -+sed 's/^/| /' conftest.$ac_ext >&5 - -- -- --for ac_header in netinet/in.h --do --as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ac_lo=`expr '(' $ac_mid ')' + 1` - fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+case $ac_lo in -+?*) ac_cv_sizeof_unsigned_int=$ac_lo;; -+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute sizeof (unsigned int), 77 -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } ;; -+esac - else -- # Is the header compilable? --echo "$as_me:$LINENO: checking $ac_header usability" >&5 --echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ if test "$cross_compiling" = yes; then -+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -+echo "$as_me: error: internal error: not reached in cross-compile" >&2;} -+ { (exit 1); exit 1; }; } -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_includes_default --#include <$ac_header> -+long longval () { return (long) (sizeof (unsigned int)); } -+unsigned long ulongval () { return (long) (sizeof (unsigned int)); } -+#include -+#include -+int -+main () -+{ -+ -+ FILE *f = fopen ("conftest.val", "w"); -+ if (! f) -+ exit (1); -+ if (((long) (sizeof (unsigned int))) < 0) -+ { -+ long i = longval (); -+ if (i != ((long) (sizeof (unsigned int)))) -+ exit (1); -+ fprintf (f, "%ld\n", i); -+ } -+ else -+ { -+ unsigned long i = ulongval (); -+ if (i != ((long) (sizeof (unsigned int)))) -+ exit (1); -+ fprintf (f, "%lu\n", i); -+ } -+ exit (ferror (f) || fclose (f) != 0); -+ -+ ; -+ return 0; -+} - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_header_compiler=yes -+ ac_cv_sizeof_unsigned_int=`cat conftest.val` - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_header_compiler=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 --echo "${ECHO_T}$ac_header_compiler" >&6 -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# Is the header present? --echo "$as_me:$LINENO: checking $ac_header presence" >&5 --echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include <$ac_header> -+( exit $ac_status ) -+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot compute sizeof (unsigned int), 77 -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+fi -+rm -f conftest.val -+else -+ ac_cv_sizeof_unsigned_int=0 -+fi -+fi -+echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 -+echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6 -+cat >>confdefs.h <<_ACEOF -+#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int - _ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -- ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -+ -+ -+ -+GSM_VERSION="1:4:0" -+ -+ -+LINGUAS="de" -+ALL_LINGUAS=$LINGUAS -+ -+ -+ MKINSTALLDIRS= -+ if test -n "$ac_aux_dir"; then -+ case "$ac_aux_dir" in -+ /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; -+ *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; -+ esac - fi -+ if test -z "$MKINSTALLDIRS"; then -+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" -+ fi -+ -+ -+ -+ echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -+echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 -+ # Check whether --enable-nls or --disable-nls was given. -+if test "${enable_nls+set}" = set; then -+ enableval="$enable_nls" -+ USE_NLS=$enableval - else -- ac_cpp_err=yes -+ USE_NLS=yes -+fi; -+ echo "$as_me:$LINENO: result: $USE_NLS" >&5 -+echo "${ECHO_T}$USE_NLS" >&6 -+ -+ -+ -+ -+ -+ -+# Prepare PATH_SEPARATOR. -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' -+ else -+ PATH_SEPARATOR=: -+ fi -+ rm -f conf$$.sh - fi --if test -z "$ac_cpp_err"; then -- ac_header_preproc=yes -+ -+# Find out how to test for executable files. Don't use a zero-byte file, -+# as systems may use methods other than mode bits to determine executability. -+cat >conf$$.file <<_ASEOF -+#! /bin/sh -+exit 0 -+_ASEOF -+chmod +x conf$$.file -+if test -x conf$$.file >/dev/null 2>&1; then -+ ac_executable_p="test -x" - else -- echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- ac_header_preproc=no -+ ac_executable_p="test -f" - fi --rm -f conftest.err conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 --echo "${ECHO_T}$ac_header_preproc" >&6 -+rm -f conf$$.file - --# So? What about this header? --case $ac_header_compiler:$ac_header_preproc in -- yes:no ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 --echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -- no:yes ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 --echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; --esac --echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -+# Extract the first word of "msgfmt", so it can be a program name with args. -+set dummy msgfmt; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- eval "$as_ac_Header=$ac_header_preproc" -+ case "$MSGFMT" in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. -+ ;; -+ *) -+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR -+ for ac_dir in $PATH; do -+ IFS="$ac_save_IFS" -+ test -z "$ac_dir" && ac_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then -+ echo "$as_me: trying $ac_dir/$ac_word..." >&5 -+ if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && -+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" -+ break 2 -+ fi -+ fi -+ done -+ done -+ IFS="$ac_save_IFS" -+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" -+ ;; -+esac - fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+MSGFMT="$ac_cv_path_MSGFMT" -+if test "$MSGFMT" != ":"; then -+ echo "$as_me:$LINENO: result: $MSGFMT" >&5 -+echo "${ECHO_T}$MSGFMT" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ # Extract the first word of "gmsgfmt", so it can be a program name with args. -+set dummy gmsgfmt; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_path_GMSGFMT+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ case $GMSGFMT in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done - -+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" -+ ;; -+esac - fi --if test `eval echo '${'$as_ac_Header'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 --_ACEOF -+GMSGFMT=$ac_cv_path_GMSGFMT - -+if test -n "$GMSGFMT"; then -+ echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -+echo "${ECHO_T}$GMSGFMT" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi - --done - - -+# Prepare PATH_SEPARATOR. -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' -+ else -+ PATH_SEPARATOR=: -+ fi -+ rm -f conf$$.sh -+fi - --for ac_header in string.h --do --as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+# Find out how to test for executable files. Don't use a zero-byte file, -+# as systems may use methods other than mode bits to determine executability. -+cat >conf$$.file <<_ASEOF -+#! /bin/sh -+exit 0 -+_ASEOF -+chmod +x conf$$.file -+if test -x conf$$.file >/dev/null 2>&1; then -+ ac_executable_p="test -x" -+else -+ ac_executable_p="test -f" - fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+rm -f conf$$.file -+ -+# Extract the first word of "xgettext", so it can be a program name with args. -+set dummy xgettext; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_path_XGETTEXT+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- # Is the header compilable? --echo "$as_me:$LINENO: checking $ac_header usability" >&5 --echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#include <$ac_header> --_ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_header_compiler=yes -+ case "$XGETTEXT" in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. -+ ;; -+ *) -+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR -+ for ac_dir in $PATH; do -+ IFS="$ac_save_IFS" -+ test -z "$ac_dir" && ac_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then -+ echo "$as_me: trying $ac_dir/$ac_word..." >&5 -+ if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && -+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" -+ break 2 -+ fi -+ fi -+ done -+ done -+ IFS="$ac_save_IFS" -+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" -+ ;; -+esac -+fi -+XGETTEXT="$ac_cv_path_XGETTEXT" -+if test "$XGETTEXT" != ":"; then -+ echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -+echo "${ECHO_T}$XGETTEXT" >&6 - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_header_compiler=no -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi --rm -f conftest.$ac_objext conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 --echo "${ECHO_T}$ac_header_compiler" >&6 - --# Is the header present? --echo "$as_me:$LINENO: checking $ac_header presence" >&5 --echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include <$ac_header> --_ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -- ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -+ rm -f messages.po -+ -+ -+# Prepare PATH_SEPARATOR. -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' - else -- ac_cpp_err= -+ PATH_SEPARATOR=: - fi --else -- ac_cpp_err=yes -+ rm -f conf$$.sh - fi --if test -z "$ac_cpp_err"; then -- ac_header_preproc=yes -+ -+# Find out how to test for executable files. Don't use a zero-byte file, -+# as systems may use methods other than mode bits to determine executability. -+cat >conf$$.file <<_ASEOF -+#! /bin/sh -+exit 0 -+_ASEOF -+chmod +x conf$$.file -+if test -x conf$$.file >/dev/null 2>&1; then -+ ac_executable_p="test -x" - else -- echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- ac_header_preproc=no -+ ac_executable_p="test -f" - fi --rm -f conftest.err conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 --echo "${ECHO_T}$ac_header_preproc" >&6 -+rm -f conf$$.file - --# So? What about this header? --case $ac_header_compiler:$ac_header_preproc in -- yes:no ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 --echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -- no:yes ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 --echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; --esac --echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -+# Extract the first word of "msgmerge", so it can be a program name with args. -+set dummy msgmerge; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_path_MSGMERGE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- eval "$as_ac_Header=$ac_header_preproc" -+ case "$MSGMERGE" in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. -+ ;; -+ *) -+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR -+ for ac_dir in $PATH; do -+ IFS="$ac_save_IFS" -+ test -z "$ac_dir" && ac_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then -+ echo "$as_me: trying $ac_dir/$ac_word..." >&5 -+ if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then -+ ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" -+ break 2 -+ fi -+ fi -+ done -+ done -+ IFS="$ac_save_IFS" -+ test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" -+ ;; -+esac - fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -- -+MSGMERGE="$ac_cv_path_MSGMERGE" -+if test "$MSGMERGE" != ":"; then -+ echo "$as_me:$LINENO: result: $MSGMERGE" >&5 -+echo "${ECHO_T}$MSGMERGE" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi --if test `eval echo '${'$as_ac_Header'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 --_ACEOF - --fi - --done -+ if test "$GMSGFMT" != ":"; then -+ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && -+ (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -+ : ; -+ else -+ GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` -+ echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 -+echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 -+ GMSGFMT=":" -+ fi -+ fi -+ -+ if test "$XGETTEXT" != ":"; then -+ if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && -+ (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -+ : ; -+ else -+ echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 -+echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 -+ XGETTEXT=":" -+ fi -+ rm -f messages.po -+ fi - -+ ac_config_commands="$ac_config_commands default-1" - - --for ac_header in libintl.h --do --as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ -+ echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2 or newer" >&5 -+echo $ECHO_N "checking whether we are using the GNU C Library 2 or newer... $ECHO_C" >&6 -+if test "${ac_cv_gnu_library_2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 --fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - else -- # Is the header compilable? --echo "$as_me:$LINENO: checking $ac_header usability" >&5 --echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#include <$ac_header> -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_header_compiler=yes -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+#include -+#ifdef __GNU_LIBRARY__ -+ #if (__GLIBC__ >= 2) -+ Lucky GNU user -+ #endif -+#endif -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "Lucky GNU user" >/dev/null 2>&1; then -+ ac_cv_gnu_library_2=yes - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_header_compiler=no -+ ac_cv_gnu_library_2=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 --echo "${ECHO_T}$ac_header_compiler" >&6 -+rm -f conftest* - --# Is the header present? --echo "$as_me:$LINENO: checking $ac_header presence" >&5 --echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include <$ac_header> --_ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -- ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi -+ -+ -+fi -+echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2" >&5 -+echo "${ECHO_T}$ac_cv_gnu_library_2" >&6 -+ -+ GLIBC2="$ac_cv_gnu_library_2" -+ -+ -+if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -+set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_RANLIB+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- ac_cpp_err=yes -+ if test -n "$RANLIB"; then -+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ - fi --if test -z "$ac_cpp_err"; then -- ac_header_preproc=yes -+fi -+RANLIB=$ac_cv_prog_RANLIB -+if test -n "$RANLIB"; then -+ echo "$as_me:$LINENO: result: $RANLIB" >&5 -+echo "${ECHO_T}$RANLIB" >&6 - else -- echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- ac_header_preproc=no -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi --rm -f conftest.err conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 --echo "${ECHO_T}$ac_header_preproc" >&6 - --# So? What about this header? --case $ac_header_compiler:$ac_header_preproc in -- yes:no ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 --echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -- no:yes ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 --echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; --esac --echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -+fi -+if test -z "$ac_cv_prog_RANLIB"; then -+ ac_ct_RANLIB=$RANLIB -+ # Extract the first word of "ranlib", so it can be a program name with args. -+set dummy ranlib; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- eval "$as_ac_Header=$ac_header_preproc" --fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+ if test -n "$ac_ct_RANLIB"; then -+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_RANLIB="ranlib" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done - -+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" - fi --if test `eval echo '${'$as_ac_Header'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 --_ACEOF -- -+fi -+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -+if test -n "$ac_ct_RANLIB"; then -+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -+echo "${ECHO_T}$ac_ct_RANLIB" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 - fi - --done -- -+ RANLIB=$ac_ct_RANLIB -+else -+ RANLIB="$ac_cv_prog_RANLIB" -+fi - --echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 --echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 --if test "${ac_cv_prog_cc_stdc+set}" = set; then -+echo "$as_me:$LINENO: checking for library containing strerror" >&5 -+echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 -+if test "${ac_cv_search_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- ac_cv_prog_cc_stdc=no --ac_save_CC=$CC -+ ac_func_search_save_LIBS=$LIBS -+ac_cv_search_strerror=no - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include --#include --#include --#include --/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ --struct buf { int x; }; --FILE * (*rcsopen) (struct buf *, struct stat *, int); --static char *e (p, i) -- char **p; -- int i; --{ -- return p[i]; --} --static char *f (char * (*g) (char **, int), char **p, ...) --{ -- char *s; -- va_list v; -- va_start (v,p); -- s = g (p, va_arg (v,int)); -- va_end (v); -- return s; --} --int test (int i, double x); --struct s1 {int (*f) (int a);}; --struct s2 {int (*f) (double a);}; --int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); --int argc; --char **argv; --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" - #endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char strerror (); - int - main () - { --return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; -+strerror (); - ; - return 0; - } - _ACEOF --# Don't try gcc -ansi; that turns off useful extensions and --# breaks some systems' header files. --# AIX -qlanglvl=ansi --# Ultrix and OSF/1 -std1 --# HP-UX 10.20 and later -Ae --# HP-UX older versions -Aa -D_HPUX_SOURCE --# SVR4 -Xc -D__EXTENSIONS__ --for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" --do -- CC="$ac_save_CC $ac_arg" -- rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_prog_cc_stdc=$ac_arg --break -+ ac_cv_search_strerror="none required" - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --fi --rm -f conftest.$ac_objext --done --rm -f conftest.$ac_ext conftest.$ac_objext --CC=$ac_save_CC -+sed 's/^/| /' conftest.$ac_ext >&5 - - fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+if test "$ac_cv_search_strerror" = no; then -+ for ac_lib in cposix; do -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - --case "x$ac_cv_prog_cc_stdc" in -- x|xno) -- echo "$as_me:$LINENO: result: none needed" >&5 --echo "${ECHO_T}none needed" >&6 ;; -- *) -- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 --echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 -- CC="$CC $ac_cv_prog_cc_stdc" ;; --esac -- --echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 --echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 --if test "${ac_cv_c_const+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" - #endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char strerror (); - int - main () - { --/* FIXME: Include the comments suggested by Paul. */ --#ifndef __cplusplus -- /* Ultrix mips cc rejects this. */ -- typedef int charset[2]; -- const charset x; -- /* SunOS 4.1.1 cc rejects this. */ -- char const *const *ccp; -- char **p; -- /* NEC SVR4.0.2 mips cc rejects this. */ -- struct point {int x, y;}; -- static struct point const zero = {0,0}; -- /* AIX XL C 1.02.0.0 rejects this. -- It does not let you subtract one const X* pointer from another in -- an arm of an if-expression whose if-part is not a constant -- expression */ -- const char *g = "string"; -- ccp = &g + (g ? g-g : 0); -- /* HPUX 7.0 cc rejects these. */ -- ++ccp; -- p = (char**) ccp; -- ccp = (char const *const *) p; -- { /* SCO 3.2v4 cc rejects this. */ -- char *t; -- char const *s = 0 ? (char *) 0 : (char const *) 0; -- -- *t++ = 0; -- } -- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ -- int x[] = {25, 17}; -- const int *foo = &x[0]; -- ++foo; -- } -- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ -- typedef const int *iptr; -- iptr p = 0; -- ++p; -- } -- { /* AIX XL C 1.02.0.0 rejects this saying -- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ -- struct s { int j; const int *ap[3]; }; -- struct s *b; b->j = 5; -- } -- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ -- const int foo = 10; -- } --#endif -+strerror (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_search_strerror="-l$ac_lib" -+break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ done -+fi -+LIBS=$ac_func_search_save_LIBS -+fi -+echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -+echo "${ECHO_T}$ac_cv_search_strerror" >&6 -+if test "$ac_cv_search_strerror" != no; then -+ test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" -+ -+fi -+ -+ -+ echo "$as_me:$LINENO: checking for signed" >&5 -+echo $ECHO_N "checking for signed... $ECHO_C" >&6 -+if test "${bh_cv_c_signed+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - -+int -+main () -+{ -+signed char x; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_c_const=yes -+ bh_cv_c_signed=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_c_const=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+bh_cv_c_signed=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 --echo "${ECHO_T}$ac_cv_c_const" >&6 --if test $ac_cv_c_const = no; then -+echo "$as_me:$LINENO: result: $bh_cv_c_signed" >&5 -+echo "${ECHO_T}$bh_cv_c_signed" >&6 -+ if test $bh_cv_c_signed = no; then - - cat >>confdefs.h <<\_ACEOF --#define const -+#define signed - _ACEOF - --fi -- -- --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include -+ fi - -+echo "$as_me:$LINENO: checking for inline" >&5 -+echo $ECHO_N "checking for inline... $ECHO_C" >&6 -+if test "${ac_cv_c_inline+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_cv_c_inline=no -+for ac_kw in inline __inline__ __inline; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF --if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- egrep "vsnprintf" >/dev/null 2>&1; then -- cat >>confdefs.h <<\_ACEOF --#define HAVE_VSNPRINTF 1 -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifndef __cplusplus -+typedef int foo_t; -+static $ac_kw foo_t static_foo () {return 0; } -+$ac_kw foo_t foo () {return 0; } -+#endif -+ - _ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_c_inline=$ac_kw; break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - - fi --rm -f conftest* -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+ -+fi -+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -+echo "${ECHO_T}$ac_cv_c_inline" >&6 - - --echo "$as_me:$LINENO: checking for unsigned short int" >&5 --echo $ECHO_N "checking for unsigned short int... $ECHO_C" >&6 --if test "${ac_cv_type_unsigned_short_int+set}" = set; then -+case $ac_cv_c_inline in -+ inline | yes) ;; -+ *) -+ case $ac_cv_c_inline in -+ no) ac_val=;; -+ *) ac_val=$ac_cv_c_inline;; -+ esac -+ cat >>confdefs.h <<_ACEOF -+#ifndef __cplusplus -+#define inline $ac_val -+#endif -+_ACEOF -+ ;; -+esac -+ -+echo "$as_me:$LINENO: checking for off_t" >&5 -+echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -+if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { --if ((unsigned short int *) 0) -+if ((off_t *) 0) - return 0; --if (sizeof (unsigned short int)) -+if (sizeof (off_t)) - return 0; - ; - return 0; -@@ -9066,136 +23441,198 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_type_unsigned_short_int=yes -+ ac_cv_type_off_t=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_type_unsigned_short_int=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_off_t=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short_int" >&5 --echo "${ECHO_T}$ac_cv_type_unsigned_short_int" >&6 -+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -+echo "${ECHO_T}$ac_cv_type_off_t" >&6 -+if test $ac_cv_type_off_t = yes; then -+ : -+else - --echo "$as_me:$LINENO: checking size of unsigned short int" >&5 --echo $ECHO_N "checking size of unsigned short int... $ECHO_C" >&6 --if test "${ac_cv_sizeof_unsigned_short_int+set}" = set; then -+cat >>confdefs.h <<_ACEOF -+#define off_t long -+_ACEOF -+ -+fi -+ -+echo "$as_me:$LINENO: checking for size_t" >&5 -+echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -+if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test "$ac_cv_type_unsigned_short_int" = yes; then -- # The cast to unsigned long works around a bug in the HP C Compiler -- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -- # This bug is HP SR number 8606223364. -- if test "$cross_compiling" = yes; then -- # Depending upon the size, compute the lo and hi bounds. --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) >= 0)]; --test_array [0] = 0 -- -+if ((size_t *) 0) -+ return 0; -+if (sizeof (size_t)) -+ return 0; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_lo=0 ac_mid=0 -- while :; do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ ac_cv_type_size_t=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_size_t=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -+echo "${ECHO_T}$ac_cv_type_size_t" >&6 -+if test $ac_cv_type_size_t = yes; then -+ : -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define size_t unsigned -+_ACEOF -+ -+fi -+ -+ -+ echo "$as_me:$LINENO: checking for long long" >&5 -+echo $ECHO_N "checking for long long... $ECHO_C" >&6 -+if test "${ac_cv_type_long_long+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+long long ll = 1LL; int i = 63; - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) <= $ac_mid)]; --test_array [0] = 0 -- -+long long llmax = (long long) -1; -+ return ll << i | ll >> i | llmax / ll | llmax % ll; - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_hi=$ac_mid; break -+ ac_cv_type_long_long=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo=`expr $ac_mid + 1` -- if test $ac_lo -le $ac_mid; then -- ac_lo= ac_hi= -- break -- fi -- ac_mid=`expr 2 '*' $ac_mid + 1` -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_long_long=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -- done -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -+echo "${ECHO_T}$ac_cv_type_long_long" >&6 -+ if test $ac_cv_type_long_long = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LONG_LONG 1 -+_ACEOF -+ -+ fi -+ -+ -+ echo "$as_me:$LINENO: checking for long double" >&5 -+echo $ECHO_N "checking for long double... $ECHO_C" >&6 -+if test "${gt_cv_c_long_double+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ if test "$GCC" = yes; then -+ gt_cv_c_long_double=yes -+ else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ -+ long double foo = 0.0; -+ /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ -+ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; -+ - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) < 0)]; --test_array [0] = 0 - - ; - return 0; -@@ -9203,33 +23640,62 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_hi=-1 ac_mid=-1 -- while :; do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ gt_cv_c_long_double=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_c_long_double=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ fi -+fi -+echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 -+echo "${ECHO_T}$gt_cv_c_long_double" >&6 -+ if test $gt_cv_c_long_double = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LONG_DOUBLE 1 -+_ACEOF -+ -+ fi -+ -+ -+ echo "$as_me:$LINENO: checking for wchar_t" >&5 -+echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6 -+if test "${gt_cv_c_wchar_t+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+ wchar_t foo = (wchar_t)'\0'; - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) >= $ac_mid)]; --test_array [0] = 0 - - ; - return 0; -@@ -9237,55 +23703,61 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_lo=$ac_mid; break --else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_hi=`expr '(' $ac_mid ')' - 1` -- if test $ac_mid -le $ac_hi; then -- ac_lo= ac_hi= -- break -- fi -- ac_mid=`expr 2 '*' $ac_mid` --fi --rm -f conftest.$ac_objext conftest.$ac_ext -- done -+ gt_cv_c_wchar_t=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo= ac_hi= -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_c_wchar_t=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --rm -f conftest.$ac_objext conftest.$ac_ext --# Binary search between lo and hi bounds. --while test "x$ac_lo" != "x$ac_hi"; do -- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -+echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 -+echo "${ECHO_T}$gt_cv_c_wchar_t" >&6 -+ if test $gt_cv_c_wchar_t = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_WCHAR_T 1 -+_ACEOF -+ -+ fi -+ -+ -+ echo "$as_me:$LINENO: checking for wint_t" >&5 -+echo $ECHO_N "checking for wint_t... $ECHO_C" >&6 -+if test "${gt_cv_c_wint_t+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+ wint_t foo = (wchar_t)'\0'; - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) <= $ac_mid)]; --test_array [0] = 0 - - ; - return 0; -@@ -9293,437 +23765,717 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_hi=$ac_mid -+ gt_cv_c_wint_t=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo=`expr '(' $ac_mid ')' + 1` -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_c_wint_t=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext --done --case $ac_lo in --?*) ac_cv_sizeof_unsigned_short_int=$ac_lo;; --'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short int), 77" >&5 --echo "$as_me: error: cannot compute sizeof (unsigned short int), 77" >&2;} -- { (exit 1); exit 1; }; } ;; --esac --else -- if test "$cross_compiling" = yes; then -- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 --echo "$as_me: error: cannot run test program while cross compiling" >&2;} -- { (exit 1); exit 1; }; } -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 -+echo "${ECHO_T}$gt_cv_c_wint_t" >&6 -+ if test $gt_cv_c_wint_t = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_WINT_T 1 -+_ACEOF -+ -+ fi -+ -+ -+ echo "$as_me:$LINENO: checking for inttypes.h" >&5 -+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 -+if test "${gl_cv_header_inttypes_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --long longval () { return (long) (sizeof (unsigned short int)); } --unsigned long ulongval () { return (long) (sizeof (unsigned short int)); } --#include --#include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+#include - int - main () - { -- -- FILE *f = fopen ("conftest.val", "w"); -- if (! f) -- exit (1); -- if (((long) (sizeof (unsigned short int))) < 0) -- { -- long i = longval (); -- if (i != ((long) (sizeof (unsigned short int)))) -- exit (1); -- fprintf (f, "%ld\n", i); -- } -- else -- { -- unsigned long i = ulongval (); -- if (i != ((long) (sizeof (unsigned short int)))) -- exit (1); -- fprintf (f, "%lu\n", i); -- } -- exit (ferror (f) || fclose (f) != 0); -- -+uintmax_t i = (uintmax_t) -1; - ; - return 0; - } - _ACEOF --rm -f conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_sizeof_unsigned_short_int=`cat conftest.val` --else -- echo "$as_me: program exited with status $ac_status" >&5 --echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --( exit $ac_status ) --{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short int), 77" >&5 --echo "$as_me: error: cannot compute sizeof (unsigned short int), 77" >&2;} -- { (exit 1); exit 1; }; } --fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext --fi --fi --rm -f conftest.val -+ gl_cv_header_inttypes_h=yes - else -- ac_cv_sizeof_unsigned_short_int=0 -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gl_cv_header_inttypes_h=no - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short_int" >&5 --echo "${ECHO_T}$ac_cv_sizeof_unsigned_short_int" >&6 -+echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 -+echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6 -+ if test $gl_cv_header_inttypes_h = yes; then -+ - cat >>confdefs.h <<_ACEOF --#define SIZEOF_UNSIGNED_SHORT_INT $ac_cv_sizeof_unsigned_short_int -+#define HAVE_INTTYPES_H_WITH_UINTMAX 1 - _ACEOF - -+ fi - --echo "$as_me:$LINENO: checking for unsigned long int" >&5 --echo $ECHO_N "checking for unsigned long int... $ECHO_C" >&6 --if test "${ac_cv_type_unsigned_long_int+set}" = set; then -+ -+ echo "$as_me:$LINENO: checking for stdint.h" >&5 -+echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 -+if test "${gl_cv_header_stdint_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+#include - int - main () - { --if ((unsigned long int *) 0) -- return 0; --if (sizeof (unsigned long int)) -- return 0; -+uintmax_t i = (uintmax_t) -1; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_type_unsigned_long_int=yes -+ gl_cv_header_stdint_h=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_type_unsigned_long_int=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gl_cv_header_stdint_h=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_int" >&5 --echo "${ECHO_T}$ac_cv_type_unsigned_long_int" >&6 -+echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 -+echo "${ECHO_T}$gl_cv_header_stdint_h" >&6 -+ if test $gl_cv_header_stdint_h = yes; then - --echo "$as_me:$LINENO: checking size of unsigned long int" >&5 --echo $ECHO_N "checking size of unsigned long int... $ECHO_C" >&6 --if test "${ac_cv_sizeof_unsigned_long_int+set}" = set; then -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STDINT_H_WITH_UINTMAX 1 -+_ACEOF -+ -+ fi -+ -+ -+ -+ -+ echo "$as_me:$LINENO: checking for intmax_t" >&5 -+echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 -+if test "${gt_cv_c_intmax_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test "$ac_cv_type_unsigned_long_int" = yes; then -- # The cast to unsigned long works around a bug in the HP C Compiler -- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -- # This bug is HP SR number 8606223364. -- if test "$cross_compiling" = yes; then -- # Depending upon the size, compute the lo and hi bounds. --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+#include -+#include -+#if HAVE_STDINT_H_WITH_UINTMAX -+#include -+#endif -+#if HAVE_INTTYPES_H_WITH_UINTMAX -+#include - #endif -+ - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) >= 0)]; --test_array [0] = 0 -- -+intmax_t x = -1; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_lo=0 ac_mid=0 -- while :; do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+ gt_cv_c_intmax_t=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_c_intmax_t=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 -+echo "${ECHO_T}$gt_cv_c_intmax_t" >&6 -+ if test $gt_cv_c_intmax_t = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_INTMAX_T 1 -+_ACEOF -+ -+ fi -+ -+ -+ -+ echo "$as_me:$LINENO: checking whether printf() supports POSIX/XSI format strings" >&5 -+echo $ECHO_N "checking whether printf() supports POSIX/XSI format strings... $ECHO_C" >&6 -+if test "${gt_cv_func_printf_posix+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ -+ if test "$cross_compiling" = yes; then -+ -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ -+ notposix - #endif --int --main () --{ --static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) <= $ac_mid)]; --test_array [0] = 0 - -- ; -- return 0; -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "notposix" >/dev/null 2>&1; then -+ gt_cv_func_printf_posix="guessing no" -+else -+ gt_cv_func_printf_posix="guessing yes" -+fi -+rm -f conftest* -+ -+ -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+#include -+#include -+/* The string "%2$d %1$d", with dollar characters protected from the shell's -+ dollar expansion (possibly an autoconf bug). */ -+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; -+static char buf[100]; -+int main () -+{ -+ sprintf (buf, format, 33, 55); -+ return (strcmp (buf, "55 33") != 0); - } - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_hi=$ac_mid; break -+ gt_cv_func_printf_posix=yes - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo=`expr $ac_mid + 1` -- if test $ac_lo -le $ac_mid; then -- ac_lo= ac_hi= -- break -- fi -- ac_mid=`expr 2 '*' $ac_mid + 1` -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+( exit $ac_status ) -+gt_cv_func_printf_posix=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -- done -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $gt_cv_func_printf_posix" >&5 -+echo "${ECHO_T}$gt_cv_func_printf_posix" >&6 -+ case $gt_cv_func_printf_posix in -+ *yes) -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_POSIX_PRINTF 1 -+_ACEOF -+ -+ ;; -+ esac -+ -+ -+ -+for ac_header in stdlib.h unistd.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) < 0)]; --test_array [0] = 0 -- -- ; -- return 0; --} -+#include <$ac_header> - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_hi=-1 ac_mid=-1 -- while :; do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) >= $ac_mid)]; --test_array [0] = 0 -- -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_lo=$ac_mid; break -+ ac_header_compiler=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_hi=`expr '(' $ac_mid ')' - 1` -- if test $ac_mid -le $ac_hi; then -- ac_lo= ac_hi= -- break -- fi -- ac_mid=`expr 2 '*' $ac_mid` -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -- done -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo= ac_hi= -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ eval "$as_ac_Header=\$ac_header_preproc" - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+ - fi --rm -f conftest.$ac_objext conftest.$ac_ext --# Binary search between lo and hi bounds. --while test "x$ac_lo" != "x$ac_hi"; do -- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ -+for ac_func in getpagesize -+do -+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -+echo "$as_me:$LINENO: checking for $ac_func" >&5 -+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_var+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define $ac_func to an innocuous variant, in case declares $ac_func. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define $ac_func innocuous_$ac_func -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char $ac_func (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef $ac_func -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char $ac_func (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -+choke me -+#else -+char (*f) () = $ac_func; -+#endif -+#ifdef __cplusplus -+} - #endif -+ - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) <= $ac_mid)]; --test_array [0] = 0 -- -+return f != $ac_func; - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_hi=$ac_mid -+ eval "$as_ac_var=yes" - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo=`expr '(' $ac_mid ')' + 1` -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+eval "$as_ac_var=no" -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -+if test `eval echo '${'$as_ac_var'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF -+ - fi --rm -f conftest.$ac_objext conftest.$ac_ext - done --case $ac_lo in --?*) ac_cv_sizeof_unsigned_long_int=$ac_lo;; --'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long int), 77" >&5 --echo "$as_me: error: cannot compute sizeof (unsigned long int), 77" >&2;} -- { (exit 1); exit 1; }; } ;; --esac -+ -+echo "$as_me:$LINENO: checking for working mmap" >&5 -+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test "$cross_compiling" = yes; then -- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 --echo "$as_me: error: cannot run test program while cross compiling" >&2;} -- { (exit 1); exit 1; }; } -+ ac_cv_func_mmap_fixed_mapped=no - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - $ac_includes_default --long longval () { return (long) (sizeof (unsigned long int)); } --unsigned long ulongval () { return (long) (sizeof (unsigned long int)); } --#include --#include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+/* malloc might have been renamed as rpl_malloc. */ -+#undef malloc -+ -+/* Thanks to Mike Haertel and Jim Avera for this test. -+ Here is a matrix of mmap possibilities: -+ mmap private not fixed -+ mmap private fixed at somewhere currently unmapped -+ mmap private fixed at somewhere already mapped -+ mmap shared not fixed -+ mmap shared fixed at somewhere currently unmapped -+ mmap shared fixed at somewhere already mapped -+ For private mappings, we should verify that changes cannot be read() -+ back from the file, nor mmap's back from the file at a different -+ address. (There have been systems where private was not correctly -+ implemented like the infamous i386 svr4.0, and systems where the -+ VM page cache was not coherent with the file system buffer cache -+ like early versions of FreeBSD and possibly contemporary NetBSD.) -+ For shared mappings, we should conversely verify that changes get -+ propagated back to all the places they're supposed to be. -+ -+ Grep wants private fixed already mapped. -+ The main things grep needs to know about mmap are: -+ * does it exist and is it safe to write into the mmap'd area -+ * how to use it (BSD variants) */ -+ -+#include -+#include -+ -+#if !STDC_HEADERS && !HAVE_STDLIB_H -+char *malloc (); - #endif -+ -+/* This mess was copied from the GNU getpagesize.h. */ -+#if !HAVE_GETPAGESIZE -+/* Assume that all systems that can run configure have sys/param.h. */ -+# if !HAVE_SYS_PARAM_H -+# define HAVE_SYS_PARAM_H 1 -+# endif -+ -+# ifdef _SC_PAGESIZE -+# define getpagesize() sysconf(_SC_PAGESIZE) -+# else /* no _SC_PAGESIZE */ -+# if HAVE_SYS_PARAM_H -+# include -+# ifdef EXEC_PAGESIZE -+# define getpagesize() EXEC_PAGESIZE -+# else /* no EXEC_PAGESIZE */ -+# ifdef NBPG -+# define getpagesize() NBPG * CLSIZE -+# ifndef CLSIZE -+# define CLSIZE 1 -+# endif /* no CLSIZE */ -+# else /* no NBPG */ -+# ifdef NBPC -+# define getpagesize() NBPC -+# else /* no NBPC */ -+# ifdef PAGESIZE -+# define getpagesize() PAGESIZE -+# endif /* PAGESIZE */ -+# endif /* no NBPC */ -+# endif /* no NBPG */ -+# endif /* no EXEC_PAGESIZE */ -+# else /* no HAVE_SYS_PARAM_H */ -+# define getpagesize() 8192 /* punt totally */ -+# endif /* no HAVE_SYS_PARAM_H */ -+# endif /* no _SC_PAGESIZE */ -+ -+#endif /* no HAVE_GETPAGESIZE */ -+ - int - main () - { -+ char *data, *data2, *data3; -+ int i, pagesize; -+ int fd; - -- FILE *f = fopen ("conftest.val", "w"); -- if (! f) -+ pagesize = getpagesize (); -+ -+ /* First, make a file with some known garbage in it. */ -+ data = (char *) malloc (pagesize); -+ if (!data) - exit (1); -- if (((long) (sizeof (unsigned long int))) < 0) -- { -- long i = longval (); -- if (i != ((long) (sizeof (unsigned long int)))) -- exit (1); -- fprintf (f, "%ld\n", i); -- } -- else -- { -- unsigned long i = ulongval (); -- if (i != ((long) (sizeof (unsigned long int)))) -- exit (1); -- fprintf (f, "%lu\n", i); -- } -- exit (ferror (f) || fclose (f) != 0); -+ for (i = 0; i < pagesize; ++i) -+ *(data + i) = rand (); -+ umask (0); -+ fd = creat ("conftest.mmap", 0600); -+ if (fd < 0) -+ exit (1); -+ if (write (fd, data, pagesize) != pagesize) -+ exit (1); -+ close (fd); - -- ; -- return 0; -+ /* Next, try to mmap the file at a fixed address which already has -+ something else allocated at it. If we can, also make sure that -+ we see the same garbage. */ -+ fd = open ("conftest.mmap", O_RDWR); -+ if (fd < 0) -+ exit (1); -+ data2 = (char *) malloc (2 * pagesize); -+ if (!data2) -+ exit (1); -+ data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); -+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, -+ MAP_PRIVATE | MAP_FIXED, fd, 0L)) -+ exit (1); -+ for (i = 0; i < pagesize; ++i) -+ if (*(data + i) != *(data2 + i)) -+ exit (1); -+ -+ /* Finally, make sure that changes to the mapped area do not -+ percolate back to the file as seen by read(). (This is a bug on -+ some variants of i386 svr4.0.) */ -+ for (i = 0; i < pagesize; ++i) -+ *(data2 + i) = *(data2 + i) + 1; -+ data3 = (char *) malloc (pagesize); -+ if (!data3) -+ exit (1); -+ if (read (fd, data3, pagesize) != pagesize) -+ exit (1); -+ for (i = 0; i < pagesize; ++i) -+ if (*(data + i) != *(data3 + i)) -+ exit (1); -+ close (fd); -+ exit (0); - } - _ACEOF - rm -f conftest$ac_exeext -@@ -9737,279 +24489,268 @@ - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_sizeof_unsigned_long_int=`cat conftest.val` -+ ac_cv_func_mmap_fixed_mapped=yes - else - echo "$as_me: program exited with status $ac_status" >&5 - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ( exit $ac_status ) --{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long int), 77" >&5 --echo "$as_me: error: cannot compute sizeof (unsigned long int), 77" >&2;} -- { (exit 1); exit 1; }; } --fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext --fi -+ac_cv_func_mmap_fixed_mapped=no - fi --rm -f conftest.val --else -- ac_cv_sizeof_unsigned_long_int=0 -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi - fi --echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_int" >&5 --echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_int" >&6 --cat >>confdefs.h <<_ACEOF --#define SIZEOF_UNSIGNED_LONG_INT $ac_cv_sizeof_unsigned_long_int -+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -+if test $ac_cv_func_mmap_fixed_mapped = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_MMAP 1 - _ACEOF - -+fi -+rm -f conftest.mmap - --echo "$as_me:$LINENO: checking for unsigned int" >&5 --echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6 --if test "${ac_cv_type_unsigned_int+set}" = set; then -+ -+ echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 -+echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6 -+if test "${ac_cv_gnu_library_2_1+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+#include -+#ifdef __GNU_LIBRARY__ -+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) -+ Lucky GNU user -+ #endif - #endif --int --main () --{ --if ((unsigned int *) 0) -- return 0; --if (sizeof (unsigned int)) -- return 0; -- ; -- return 0; --} -+ - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_type_unsigned_int=yes -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "Lucky GNU user" >/dev/null 2>&1; then -+ ac_cv_gnu_library_2_1=yes - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_type_unsigned_int=no -+ ac_cv_gnu_library_2_1=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest* -+ -+ -+ - fi --echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5 --echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6 -+echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 -+echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6 - --echo "$as_me:$LINENO: checking size of unsigned int" >&5 --echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6 --if test "${ac_cv_sizeof_unsigned_int+set}" = set; then -+ GLIBC21="$ac_cv_gnu_library_2_1" -+ -+ -+ -+ -+ echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 -+echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6 -+if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- if test "$ac_cv_type_unsigned_int" = yes; then -- # The cast to unsigned long works around a bug in the HP C Compiler -- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -- # This bug is HP SR number 8606223364. -- if test "$cross_compiling" = yes; then -- # Depending upon the size, compute the lo and hi bounds. --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= 0)]; --test_array [0] = 0 - -- ; -- return 0; --} -+ if test "$cross_compiling" = yes; then -+ -+ # Guess based on the CPU. -+ case "$host_cpu" in -+ alpha* | i3456786 | m68k | s390*) -+ gt_cv_int_divbyzero_sigfpe="guessing yes";; -+ *) -+ gt_cv_int_divbyzero_sigfpe="guessing no";; -+ esac -+ -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_lo=0 ac_mid=0 -- while :; do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+#include -+#include -+ -+static void -+#ifdef __cplusplus -+sigfpe_handler (int sig) -+#else -+sigfpe_handler (sig) int sig; - #endif --int --main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; --test_array [0] = 0 -+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ -+ exit (sig != SIGFPE); -+} - -- ; -- return 0; -+int x = 1; -+int y = 0; -+int z; -+int nan; -+ -+int main () -+{ -+ signal (SIGFPE, sigfpe_handler); -+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ -+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) -+ signal (SIGTRAP, sigfpe_handler); -+#endif -+/* Linux/SPARC yields signal SIGILL. */ -+#if defined (__sparc__) && defined (__linux__) -+ signal (SIGILL, sigfpe_handler); -+#endif -+ -+ z = x / y; -+ nan = y / y; -+ exit (1); - } -+ - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_hi=$ac_mid; break -+ gt_cv_int_divbyzero_sigfpe=yes - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo=`expr $ac_mid + 1` -- if test $ac_lo -le $ac_mid; then -- ac_lo= ac_hi= -- break -- fi -- ac_mid=`expr 2 '*' $ac_mid + 1` -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+( exit $ac_status ) -+gt_cv_int_divbyzero_sigfpe=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -- done -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 -+echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6 -+ case "$gt_cv_int_divbyzero_sigfpe" in -+ *yes) value=1;; -+ *) value=0;; -+ esac -+ -+cat >>confdefs.h <<_ACEOF -+#define INTDIV0_RAISES_SIGFPE $value -+_ACEOF -+ -+ -+ -+ echo "$as_me:$LINENO: checking for unsigned long long" >&5 -+echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 -+if test "${ac_cv_type_unsigned_long_long+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+unsigned long long ull = 1ULL; int i = 63; - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) < 0)]; --test_array [0] = 0 -- -+unsigned long long ullmax = (unsigned long long) -1; -+ return ull << i | ull >> i | ullmax / ull | ullmax % ull; - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_hi=-1 ac_mid=-1 -- while :; do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= $ac_mid)]; --test_array [0] = 0 -- -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_lo=$ac_mid; break --else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_hi=`expr '(' $ac_mid ')' - 1` -- if test $ac_mid -le $ac_hi; then -- ac_lo= ac_hi= -- break -- fi -- ac_mid=`expr 2 '*' $ac_mid` --fi --rm -f conftest.$ac_objext conftest.$ac_ext -- done -+ ac_cv_type_unsigned_long_long=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo= ac_hi= -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_unsigned_long_long=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - fi --rm -f conftest.$ac_objext conftest.$ac_ext --# Binary search between lo and hi bounds. --while test "x$ac_lo" != "x$ac_hi"; do -- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 -+echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 -+ if test $ac_cv_type_unsigned_long_long = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_UNSIGNED_LONG_LONG 1 -+_ACEOF -+ -+ fi -+ -+ -+ -+ -+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then -+ -+ test $ac_cv_type_unsigned_long_long = yes \ -+ && ac_type='unsigned long long' \ -+ || ac_type='unsigned long' -+ -+cat >>confdefs.h <<_ACEOF -+#define uintmax_t $ac_type -+_ACEOF -+ -+ else -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_UINTMAX_T 1 -+_ACEOF -+ -+ fi -+ -+ -+ echo "$as_me:$LINENO: checking for inttypes.h" >&5 -+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 -+if test "${gt_cv_header_inttypes_h+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+#include - int - main () - { --static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; --test_array [0] = 0 - - ; - return 0; -@@ -10017,1079 +24758,1229 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_hi=$ac_mid -+ gt_cv_header_inttypes_h=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_lo=`expr '(' $ac_mid ')' + 1` -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_header_inttypes_h=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext --done --case $ac_lo in --?*) ac_cv_sizeof_unsigned_int=$ac_lo;; --'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77" >&5 --echo "$as_me: error: cannot compute sizeof (unsigned int), 77" >&2;} -- { (exit 1); exit 1; }; } ;; --esac --else -- if test "$cross_compiling" = yes; then -- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 --echo "$as_me: error: cannot run test program while cross compiling" >&2;} -- { (exit 1); exit 1; }; } -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 -+echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6 -+ if test $gt_cv_header_inttypes_h = yes; then -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_INTTYPES_H 1 -+_ACEOF -+ -+ fi -+ -+ -+ -+ if test $gt_cv_header_inttypes_h = yes; then -+ echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 -+echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6 -+if test "${gt_cv_inttypes_pri_broken+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --long longval () { return (long) (sizeof (unsigned int)); } --unsigned long ulongval () { return (long) (sizeof (unsigned int)); } --#include --#include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ - -- FILE *f = fopen ("conftest.val", "w"); -- if (! f) -- exit (1); -- if (((long) (sizeof (unsigned int))) < 0) -- { -- long i = longval (); -- if (i != ((long) (sizeof (unsigned int)))) -- exit (1); -- fprintf (f, "%ld\n", i); -- } -- else -- { -- unsigned long i = ulongval (); -- if (i != ((long) (sizeof (unsigned int)))) -- exit (1); -- fprintf (f, "%lu\n", i); -- } -- exit (ferror (f) || fclose (f) != 0); -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+#ifdef PRId32 -+char *p = PRId32; -+#endif -+ -+int -+main () -+{ - - ; - return 0; - } - _ACEOF --rm -f conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_sizeof_unsigned_int=`cat conftest.val` --else -- echo "$as_me: program exited with status $ac_status" >&5 --echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --( exit $ac_status ) --{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77" >&5 --echo "$as_me: error: cannot compute sizeof (unsigned int), 77" >&2;} -- { (exit 1); exit 1; }; } --fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext --fi --fi --rm -f conftest.val -+ gt_cv_inttypes_pri_broken=no - else -- ac_cv_sizeof_unsigned_int=0 -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_inttypes_pri_broken=yes - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ - fi --echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 --echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6 -+echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 -+echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6 -+ fi -+ if test "$gt_cv_inttypes_pri_broken" = yes; then -+ - cat >>confdefs.h <<_ACEOF --#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int -+#define PRI_MACROS_BROKEN 1 - _ACEOF - -- -- --GSM_VERSION="1:4:0" -- -- --LINGUAS="de" --ALL_LINGUAS=$LINGUAS -- -- MKINSTALLDIRS= -- if test -n "$ac_aux_dir"; then -- MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" -- fi -- if test -z "$MKINSTALLDIRS"; then -- MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - - - -- -- -- # Extract the first word of "msgfmt", so it can be a program name with args. --set dummy msgfmt; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_path_MSGFMT+set}" = set; then -+for ac_header in stdint.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- case "$MSGFMT" in -- /*) -- ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. -- ;; -- *) -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" -- for ac_dir in $PATH; do -- test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/$ac_word; then -- if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && -- (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -- ac_cv_path_MSGFMT="$ac_dir/$ac_word" -- break -- fi -- fi -- done -- IFS="$ac_save_ifs" -- test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" -- ;; --esac - fi --MSGFMT="$ac_cv_path_MSGFMT" --if test "$MSGFMT" != ":"; then -- echo "$as_me:$LINENO: result: $MSGFMT" >&5 --echo "${ECHO_T}$MSGFMT" >&6 -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 --fi -- -- # Extract the first word of "gmsgfmt", so it can be a program name with args. --set dummy gmsgfmt; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_path_GMSGFMT+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes - else -- case $GMSGFMT in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" -- ;; --esac -+ac_header_compiler=no - fi --GMSGFMT=$ac_cv_path_GMSGFMT -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 - --if test -n "$GMSGFMT"; then -- echo "$as_me:$LINENO: result: $GMSGFMT" >&5 --echo "${ECHO_T}$GMSGFMT" >&6 -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 -+ ac_cpp_err=yes - fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 - -- # Extract the first word of "xgettext", so it can be a program name with args. --set dummy xgettext; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_path_XGETTEXT+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- case "$XGETTEXT" in -- /*) -- ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. -- ;; -- *) -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" -- for ac_dir in $PATH; do -- test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/$ac_word; then -- if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && -- (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -- ac_cv_path_XGETTEXT="$ac_dir/$ac_word" -- break -- fi -- fi -- done -- IFS="$ac_save_ifs" -- test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" -- ;; -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; - esac --fi --XGETTEXT="$ac_cv_path_XGETTEXT" --if test "$XGETTEXT" != ":"; then -- echo "$as_me:$LINENO: result: $XGETTEXT" >&5 --echo "${ECHO_T}$XGETTEXT" >&6 -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 -+ eval "$as_ac_Header=\$ac_header_preproc" - fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -- rm -f messages.po -- -- # Extract the first word of "msgmerge", so it can be a program name with args. --set dummy msgmerge; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_path_MSGMERGE+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- case "$MSGMERGE" in -- /*) -- ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. -- ;; -- *) -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" -- for ac_dir in $PATH; do -- test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/$ac_word; then -- if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then -- ac_cv_path_MSGMERGE="$ac_dir/$ac_word" -- break -- fi -- fi -- done -- IFS="$ac_save_ifs" -- test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" -- ;; --esac - fi --MSGMERGE="$ac_cv_path_MSGMERGE" --if test "$MSGMERGE" != ":"; then -- echo "$as_me:$LINENO: result: $MSGMERGE" >&5 --echo "${ECHO_T}$MSGMERGE" >&6 --else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ - fi - -+done - -- if test "$GMSGFMT" != ":"; then -- if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && -- (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -- : ; -- else -- GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` -- echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 --echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 -- GMSGFMT=":" -- fi -- fi -+ echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 -+echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6 -+ result= -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - -- if test "$XGETTEXT" != ":"; then -- if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && -- (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then -- : ; -- else -- echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 --echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 -- XGETTEXT=":" -- fi -- rm -f messages.po -- fi -+#include -+#if HAVE_STDINT_H -+#include -+#endif -+#ifdef SIZE_MAX -+Found it -+#endif - -- ac_config_commands="$ac_config_commands default-1" -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "Found it" >/dev/null 2>&1; then -+ result=yes -+fi -+rm -f conftest* - -+ if test -z "$result"; then -+ if test "$cross_compiling" = yes; then -+ # Depending upon the size, compute the lo and hi bounds. -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((~(size_t)0 / 10) >= 0)]; -+test_array [0] = 0 - --if test -n "$ac_tool_prefix"; then -- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. --set dummy ${ac_tool_prefix}ranlib; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_RANLIB+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- if test -n "$RANLIB"; then -- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. --else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_lo=0 ac_mid=0 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((~(size_t)0 / 10) <= $ac_mid)]; -+test_array [0] = 0 - --fi --fi --RANLIB=$ac_cv_prog_RANLIB --if test -n "$RANLIB"; then -- echo "$as_me:$LINENO: result: $RANLIB" >&5 --echo "${ECHO_T}$RANLIB" >&6 -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=$ac_mid; break - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 --fi -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo=`expr $ac_mid + 1` -+ if test $ac_lo -le $ac_mid; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid + 1` - fi --if test -z "$ac_cv_prog_RANLIB"; then -- ac_ct_RANLIB=$RANLIB -- # Extract the first word of "ranlib", so it can be a program name with args. --set dummy ranlib; ac_word=$2 --echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 --if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -- if test -n "$ac_ct_RANLIB"; then -- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((~(size_t)0 / 10) < 0)]; -+test_array [0] = 0 -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=-1 ac_mid=-1 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((~(size_t)0 / 10) >= $ac_mid)]; -+test_array [0] = 0 -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_lo=$ac_mid; break - else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_prog_ac_ct_RANLIB="ranlib" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -- test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" --fi -+ac_hi=`expr '(' $ac_mid ')' - 1` -+ if test $ac_mid -le $ac_hi; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid` - fi --ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB --if test -n "$ac_ct_RANLIB"; then -- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 --echo "${ECHO_T}$ac_ct_RANLIB" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 --fi -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -- RANLIB=$ac_ct_RANLIB --else -- RANLIB="$ac_cv_prog_RANLIB" -+ac_lo= ac_hi= - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+# Binary search between lo and hi bounds. -+while test "x$ac_lo" != "x$ac_hi"; do -+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((~(size_t)0 / 10) <= $ac_mid)]; -+test_array [0] = 0 - -- -- echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 --echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 --if test "${ac_cv_lib_cposix_strerror+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=$ac_mid - else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lcposix $LIBS" --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char strerror (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ac_lo=`expr '(' $ac_mid ')' + 1` -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+case $ac_lo in -+?*) res_hi=$ac_lo;; -+'') result=? ;; -+esac -+else -+ if test "$cross_compiling" = yes; then -+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -+echo "$as_me: error: internal error: not reached in cross-compile" >&2;} -+ { (exit 1); exit 1; }; } -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+long longval () { return ~(size_t)0 / 10; } -+unsigned long ulongval () { return ~(size_t)0 / 10; } -+#include -+#include - int - main () - { --strerror (); -+ -+ FILE *f = fopen ("conftest.val", "w"); -+ if (! f) -+ exit (1); -+ if ((~(size_t)0 / 10) < 0) -+ { -+ long i = longval (); -+ if (i != (~(size_t)0 / 10)) -+ exit (1); -+ fprintf (f, "%ld\n", i); -+ } -+ else -+ { -+ unsigned long i = ulongval (); -+ if (i != (~(size_t)0 / 10)) -+ exit (1); -+ fprintf (f, "%lu\n", i); -+ } -+ exit (ferror (f) || fclose (f) != 0); -+ - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext -+rm -f conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_lib_cposix_strerror=yes -+ res_hi=`cat conftest.val` - else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_lib_cposix_strerror=no -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+( exit $ac_status ) -+result=? - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 --echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 --if test $ac_cv_lib_cposix_strerror = yes; then -- LIBS="$LIBS -lcposix" - fi -+rm -f conftest.val -+ if test "$cross_compiling" = yes; then -+ # Depending upon the size, compute the lo and hi bounds. -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((~(size_t)0 % 10) >= 0)]; -+test_array [0] = 0 - -- -- --echo "$as_me:$LINENO: checking for inline" >&5 --echo $ECHO_N "checking for inline... $ECHO_C" >&6 --if test "${ac_cv_c_inline+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- ac_cv_c_inline=no --for ac_kw in inline __inline__ __inline; do -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#ifndef __cplusplus --static $ac_kw int static_foo () {return 0; } --$ac_kw int foo () {return 0; } --#endif -- -+ ; -+ return 0; -+} - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_c_inline=$ac_kw; break --else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --fi --rm -f conftest.$ac_objext conftest.$ac_ext --done -- --fi --echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 --echo "${ECHO_T}$ac_cv_c_inline" >&6 --case $ac_cv_c_inline in -- inline | yes) ;; -- no) --cat >>confdefs.h <<\_ACEOF --#define inline --_ACEOF -- ;; -- *) cat >>confdefs.h <<_ACEOF --#define inline $ac_cv_c_inline -+ ac_lo=0 ac_mid=0 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF -- ;; --esac -- --echo "$as_me:$LINENO: checking for off_t" >&5 --echo $ECHO_N "checking for off_t... $ECHO_C" >&6 --if test "${ac_cv_type_off_t+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - int - main () - { --if ((off_t *) 0) -- return 0; --if (sizeof (off_t)) -- return 0; -+static int test_array [1 - 2 * !((~(size_t)0 % 10) <= $ac_mid)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_type_off_t=yes -+ ac_hi=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_type_off_t=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_lo=`expr $ac_mid + 1` -+ if test $ac_lo -le $ac_mid; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid + 1` - fi --echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 --echo "${ECHO_T}$ac_cv_type_off_t" >&6 --if test $ac_cv_type_off_t = yes; then -- : -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --cat >>confdefs.h <<_ACEOF --#define off_t long -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF -- --fi -- --echo "$as_me:$LINENO: checking for size_t" >&5 --echo $ECHO_N "checking for size_t... $ECHO_C" >&6 --if test "${ac_cv_type_size_t+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - int - main () - { --if ((size_t *) 0) -- return 0; --if (sizeof (size_t)) -- return 0; -+static int test_array [1 - 2 * !((~(size_t)0 % 10) < 0)]; -+test_array [0] = 0 -+ - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_type_size_t=yes --else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_type_size_t=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext --fi --echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 --echo "${ECHO_T}$ac_cv_type_size_t" >&6 --if test $ac_cv_type_size_t = yes; then -- : --else -- --cat >>confdefs.h <<_ACEOF --#define size_t unsigned -+ ac_hi=-1 ac_mid=-1 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((~(size_t)0 % 10) >= $ac_mid)]; -+test_array [0] = 0 - --fi -- -- -- --for ac_header in stdlib.h unistd.h --do --as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 --else -- # Is the header compilable? --echo "$as_me:$LINENO: checking $ac_header usability" >&5 --echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#include <$ac_header> -+ ; -+ return 0; -+} - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_header_compiler=yes --else -- echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_header_compiler=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 --echo "${ECHO_T}$ac_header_compiler" >&6 -- --# Is the header present? --echo "$as_me:$LINENO: checking $ac_header presence" >&5 --echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include <$ac_header> --_ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi --else -- ac_cpp_err=yes --fi --if test -z "$ac_cpp_err"; then -- ac_header_preproc=yes -+ (exit $ac_status); }; }; then -+ ac_lo=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- ac_header_preproc=no --fi --rm -f conftest.err conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 --echo "${ECHO_T}$ac_header_preproc" >&6 -+sed 's/^/| /' conftest.$ac_ext >&5 - --# So? What about this header? --case $ac_header_compiler:$ac_header_preproc in -- yes:no ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 --echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -- no:yes ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 --echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; --esac --echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- eval "$as_ac_Header=$ac_header_preproc" -+ac_hi=`expr '(' $ac_mid ')' - 1` -+ if test $ac_mid -le $ac_hi; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid` - fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo= ac_hi= - fi --if test `eval echo '${'$as_ac_Header'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 --_ACEOF -- -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi -- --done -- -- --for ac_func in getpagesize --do --as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` --echo "$as_me:$LINENO: checking for $ac_func" >&5 --echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 --if eval "test \"\${$as_ac_var+set}\" = set"; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+# Binary search between lo and hi bounds. -+while test "x$ac_lo" != "x$ac_hi"; do -+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --/* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char $ac_func (); below. */ --#include --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char $ac_func (); --char (*f) (); -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - int - main () - { --/* The GNU C library defines this for functions which it implements -- to always fail with ENOSYS. Some functions are actually named -- something starting with __ and the normal name is an alias. */ --#if defined (__stub_$ac_func) || defined (__stub___$ac_func) --choke me --#else --f = $ac_func; --#endif -+static int test_array [1 - 2 * !((~(size_t)0 % 10) <= $ac_mid)]; -+test_array [0] = 0 - - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- eval "$as_ac_var=yes" -+ ac_hi=$ac_mid - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --eval "$as_ac_var=no" --fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext --fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 --if test `eval echo '${'$as_ac_var'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 --_ACEOF -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo=`expr '(' $ac_mid ')' + 1` - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -- --echo "$as_me:$LINENO: checking for working mmap" >&5 --echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 --if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+case $ac_lo in -+?*) res_lo=$ac_lo;; -+'') result=? ;; -+esac - else - if test "$cross_compiling" = yes; then -- ac_cv_func_mmap_fixed_mapped=no -+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -+echo "$as_me: error: internal error: not reached in cross-compile" >&2;} -+ { (exit 1); exit 1; }; } - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --/* malloc might have been renamed as rpl_malloc. */ --#undef malloc -- --/* Thanks to Mike Haertel and Jim Avera for this test. -- Here is a matrix of mmap possibilities: -- mmap private not fixed -- mmap private fixed at somewhere currently unmapped -- mmap private fixed at somewhere already mapped -- mmap shared not fixed -- mmap shared fixed at somewhere currently unmapped -- mmap shared fixed at somewhere already mapped -- For private mappings, we should verify that changes cannot be read() -- back from the file, nor mmap's back from the file at a different -- address. (There have been systems where private was not correctly -- implemented like the infamous i386 svr4.0, and systems where the -- VM page cache was not coherent with the file system buffer cache -- like early versions of FreeBSD and possibly contemporary NetBSD.) -- For shared mappings, we should conversely verify that changes get -- propagated back to all the places they're supposed to be. -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+long longval () { return ~(size_t)0 % 10; } -+unsigned long ulongval () { return ~(size_t)0 % 10; } -+#include -+#include -+int -+main () -+{ - -- Grep wants private fixed already mapped. -- The main things grep needs to know about mmap are: -- * does it exist and is it safe to write into the mmap'd area -- * how to use it (BSD variants) */ -+ FILE *f = fopen ("conftest.val", "w"); -+ if (! f) -+ exit (1); -+ if ((~(size_t)0 % 10) < 0) -+ { -+ long i = longval (); -+ if (i != (~(size_t)0 % 10)) -+ exit (1); -+ fprintf (f, "%ld\n", i); -+ } -+ else -+ { -+ unsigned long i = ulongval (); -+ if (i != (~(size_t)0 % 10)) -+ exit (1); -+ fprintf (f, "%lu\n", i); -+ } -+ exit (ferror (f) || fclose (f) != 0); - --#include --#include -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ res_lo=`cat conftest.val` -+else -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --#if !STDC_HEADERS && !HAVE_STDLIB_H --char *malloc (); --#endif -+( exit $ac_status ) -+result=? -+fi -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+fi -+rm -f conftest.val -+ if test "$cross_compiling" = yes; then -+ # Depending upon the size, compute the lo and hi bounds. -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; -+test_array [0] = 0 - --/* This mess was copied from the GNU getpagesize.h. */ --#if !HAVE_GETPAGESIZE --/* Assume that all systems that can run configure have sys/param.h. */ --# if !HAVE_SYS_PARAM_H --# define HAVE_SYS_PARAM_H 1 --# endif -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_lo=0 ac_mid=0 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; -+test_array [0] = 0 - --# ifdef _SC_PAGESIZE --# define getpagesize() sysconf(_SC_PAGESIZE) --# else /* no _SC_PAGESIZE */ --# if HAVE_SYS_PARAM_H --# include --# ifdef EXEC_PAGESIZE --# define getpagesize() EXEC_PAGESIZE --# else /* no EXEC_PAGESIZE */ --# ifdef NBPG --# define getpagesize() NBPG * CLSIZE --# ifndef CLSIZE --# define CLSIZE 1 --# endif /* no CLSIZE */ --# else /* no NBPG */ --# ifdef NBPC --# define getpagesize() NBPC --# else /* no NBPC */ --# ifdef PAGESIZE --# define getpagesize() PAGESIZE --# endif /* PAGESIZE */ --# endif /* no NBPC */ --# endif /* no NBPG */ --# endif /* no EXEC_PAGESIZE */ --# else /* no HAVE_SYS_PARAM_H */ --# define getpagesize() 8192 /* punt totally */ --# endif /* no HAVE_SYS_PARAM_H */ --# endif /* no _SC_PAGESIZE */ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=$ac_mid; break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --#endif /* no HAVE_GETPAGESIZE */ -+ac_lo=`expr $ac_mid + 1` -+ if test $ac_lo -le $ac_mid; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid + 1` -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - int - main () - { -- char *data, *data2, *data3; -- int i, pagesize; -- int fd; -- -- pagesize = getpagesize (); -- -- /* First, make a file with some known garbage in it. */ -- data = (char *) malloc (pagesize); -- if (!data) -- exit (1); -- for (i = 0; i < pagesize; ++i) -- *(data + i) = rand (); -- umask (0); -- fd = creat ("conftest.mmap", 0600); -- if (fd < 0) -- exit (1); -- if (write (fd, data, pagesize) != pagesize) -- exit (1); -- close (fd); -- -- /* Next, try to mmap the file at a fixed address which already has -- something else allocated at it. If we can, also make sure that -- we see the same garbage. */ -- fd = open ("conftest.mmap", O_RDWR); -- if (fd < 0) -- exit (1); -- data2 = (char *) malloc (2 * pagesize); -- if (!data2) -- exit (1); -- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); -- if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, -- MAP_PRIVATE | MAP_FIXED, fd, 0L)) -- exit (1); -- for (i = 0; i < pagesize; ++i) -- if (*(data + i) != *(data2 + i)) -- exit (1); -+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; -+test_array [0] = 0 - -- /* Finally, make sure that changes to the mapped area do not -- percolate back to the file as seen by read(). (This is a bug on -- some variants of i386 svr4.0.) */ -- for (i = 0; i < pagesize; ++i) -- *(data2 + i) = *(data2 + i) + 1; -- data3 = (char *) malloc (pagesize); -- if (!data3) -- exit (1); -- if (read (fd, data3, pagesize) != pagesize) -- exit (1); -- for (i = 0; i < pagesize; ++i) -- if (*(data + i) != *(data3 + i)) -- exit (1); -- close (fd); -- exit (0); -+ ; -+ return 0; - } - _ACEOF --rm -f conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_cv_func_mmap_fixed_mapped=yes --else -- echo "$as_me: program exited with status $ac_status" >&5 --echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --( exit $ac_status ) --ac_cv_func_mmap_fixed_mapped=no --fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext --fi --fi --echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 --echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 --if test $ac_cv_func_mmap_fixed_mapped = yes; then -+ ac_hi=-1 ac_mid=-1 -+ while :; do -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; -+test_array [0] = 0 - --cat >>confdefs.h <<\_ACEOF --#define HAVE_MMAP 1 -+ ; -+ return 0; -+} - _ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_lo=$ac_mid; break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_hi=`expr '(' $ac_mid ')' - 1` -+ if test $ac_mid -le $ac_hi; then -+ ac_lo= ac_hi= -+ break -+ fi -+ ac_mid=`expr 2 '*' $ac_mid` - fi --rm -f conftest.mmap -- -- -- echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 --echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6 --if test "${ac_cv_gnu_library_2_1+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ done - else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - --#include --#ifdef __GNU_LIBRARY__ -- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) -- Lucky GNU user -- #endif --#endif -+ac_lo= ac_hi= -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+# Binary search between lo and hi bounds. -+while test "x$ac_lo" != "x$ac_hi"; do -+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; -+test_array [0] = 0 - -+ ; -+ return 0; -+} - _ACEOF --if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -- egrep "Lucky GNU user" >/dev/null 2>&1; then -- ac_cv_gnu_library_2_1=yes -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_hi=$ac_mid - else -- ac_cv_gnu_library_2_1=no --fi --rm -f conftest* -- -- -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_lo=`expr '(' $ac_mid ')' + 1` - fi --echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 --echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6 -- -- GLIBC21="$ac_cv_gnu_library_2_1" -- -- -- -- -- echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 --echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6 --if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+case $ac_lo in -+?*) fits_in_uint=$ac_lo;; -+'') result=? ;; -+esac - else -- -- if test "$cross_compiling" = yes; then -- -- # Guess based on the CPU. -- case "$host_cpu" in -- alpha* | i3456786 | m68k | s390*) -- gt_cv_int_divbyzero_sigfpe="guessing yes";; -- *) -- gt_cv_int_divbyzero_sigfpe="guessing no";; -- esac -- -+ if test "$cross_compiling" = yes; then -+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -+echo "$as_me: error: internal error: not reached in cross-compile" >&2;} -+ { (exit 1); exit 1; }; } - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -- -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+long longval () { return sizeof (size_t) <= sizeof (unsigned int); } -+unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } -+#include - #include --#include -- --static void --#ifdef __cplusplus --sigfpe_handler (int sig) --#else --sigfpe_handler (sig) int sig; --#endif -+int -+main () - { -- /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ -- exit (sig != SIGFPE); --} -- --int x = 1; --int y = 0; --int z; --int nan; - --int main () --{ -- signal (SIGFPE, sigfpe_handler); --/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ --#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) -- signal (SIGTRAP, sigfpe_handler); --#endif --/* Linux/SPARC yields signal SIGILL. */ --#if defined (__sparc__) && defined (__linux__) -- signal (SIGILL, sigfpe_handler); --#endif -+ FILE *f = fopen ("conftest.val", "w"); -+ if (! f) -+ exit (1); -+ if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) -+ { -+ long i = longval (); -+ if (i != (sizeof (size_t) <= sizeof (unsigned int))) -+ exit (1); -+ fprintf (f, "%ld\n", i); -+ } -+ else -+ { -+ unsigned long i = ulongval (); -+ if (i != (sizeof (size_t) <= sizeof (unsigned int))) -+ exit (1); -+ fprintf (f, "%lu\n", i); -+ } -+ exit (ferror (f) || fclose (f) != 0); - -- z = x / y; -- nan = y / y; -- exit (1); -+ ; -+ return 0; - } -- - _ACEOF - rm -f conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -@@ -11102,329 +25993,378 @@ - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- gt_cv_int_divbyzero_sigfpe=yes -+ fits_in_uint=`cat conftest.val` - else - echo "$as_me: program exited with status $ac_status" >&5 - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - ( exit $ac_status ) --gt_cv_int_divbyzero_sigfpe=no -+result=? - fi --rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi -- - fi --echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 --echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6 -- case "$gt_cv_int_divbyzero_sigfpe" in -- *yes) value=1;; -- *) value=0;; -- esac -- --cat >>confdefs.h <<_ACEOF --#define INTDIV0_RAISES_SIGFPE $value --_ACEOF -- -- -+rm -f conftest.val -+ if test "$fits_in_uint" = 1; then -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+ extern size_t foo; -+ extern unsigned long foo; - -- echo "$as_me:$LINENO: checking for inttypes.h" >&5 --echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 --if test "${jm_ac_cv_header_inttypes_h+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include --#include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { --uintmax_t i = (uintmax_t) -1; -+ - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- jm_ac_cv_header_inttypes_h=yes -+ fits_in_uint=0 - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --jm_ac_cv_header_inttypes_h=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - fi --echo "$as_me:$LINENO: result: $jm_ac_cv_header_inttypes_h" >&5 --echo "${ECHO_T}$jm_ac_cv_header_inttypes_h" >&6 -- if test $jm_ac_cv_header_inttypes_h = yes; then -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ fi -+ if test -z "$result"; then -+ if test "$fits_in_uint" = 1; then -+ result="$res_hi$res_lo"U -+ else -+ result="$res_hi$res_lo"UL -+ fi -+ else -+ result='~(size_t)0' -+ fi -+ fi -+ echo "$as_me:$LINENO: result: $result" >&5 -+echo "${ECHO_T}$result" >&6 -+ if test "$result" != yes; then - - cat >>confdefs.h <<_ACEOF --#define HAVE_INTTYPES_H_WITH_UINTMAX 1 -+#define SIZE_MAX $result - _ACEOF - - fi - - -- echo "$as_me:$LINENO: checking for stdint.h" >&5 --echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 --if test "${jm_ac_cv_header_stdint_h+set}" = set; then -+ -+ -+ -+for ac_header in stdint.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include --#include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --uintmax_t i = (uintmax_t) -1; -- ; -- return 0; --} -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- jm_ac_cv_header_stdint_h=yes -+ ac_header_compiler=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --jm_ac_cv_header_stdint_h=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no - fi --echo "$as_me:$LINENO: result: $jm_ac_cv_header_stdint_h" >&5 --echo "${ECHO_T}$jm_ac_cv_header_stdint_h" >&6 -- if test $jm_ac_cv_header_stdint_h = yes; then -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 - --cat >>confdefs.h <<_ACEOF --#define HAVE_STDINT_H_WITH_UINTMAX 1 -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ - _ACEOF -- -- fi -- -- -- echo "$as_me:$LINENO: checking for unsigned long long" >&5 --echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 --if test "${ac_cv_type_unsigned_long_long+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --unsigned long long ull = 1; int i = 63; --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif --int --main () --{ --unsigned long long ullmax = (unsigned long long) -1; -- return ull << i | ull >> i | ullmax / ull | ullmax % ull; -- ; -- return 0; --} -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- ac_cv_type_unsigned_long_long=yes -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_cv_type_unsigned_long_long=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ eval "$as_ac_Header=\$ac_header_preproc" - fi --echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 --echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 -- if test $ac_cv_type_unsigned_long_long = yes; then -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - --cat >>confdefs.h <<\_ACEOF --#define HAVE_UNSIGNED_LONG_LONG 1 -+fi -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - -- fi -- -- -- -- -- if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then -- -- test $ac_cv_type_unsigned_long_long = yes \ -- && ac_type='unsigned long long' \ -- || ac_type='unsigned long' -+fi - --cat >>confdefs.h <<_ACEOF --#define uintmax_t $ac_type --_ACEOF -+done - -- fi - - -- echo "$as_me:$LINENO: checking for inttypes.h" >&5 --echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 --if test "${gt_cv_header_inttypes_h+set}" = set; then -+ echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 -+echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6 -+if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include --#include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+ gt_save_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ gt_save_LIBS="$LIBS" -+ LIBS="$LIBS -framework CoreFoundation" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - int - main () - { -- -+CFPreferencesCopyAppValue(NULL, NULL) - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- gt_cv_header_inttypes_h=yes -+ gt_cv_func_CFPreferencesCopyAppValue=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --gt_cv_header_inttypes_h=no --fi --rm -f conftest.$ac_objext conftest.$ac_ext -+sed 's/^/| /' conftest.$ac_ext >&5 - -+gt_cv_func_CFPreferencesCopyAppValue=no - fi --echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 --echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6 -- if test $gt_cv_header_inttypes_h = yes; then -- --cat >>confdefs.h <<_ACEOF --#define HAVE_INTTYPES_H 1 --_ACEOF -- -- fi -- -- -- -- if test $gt_cv_header_inttypes_h = yes; then -- echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 --echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6 --if test "${gt_cv_inttypes_pri_broken+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- -- cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include --#ifdef PRId32 --char *p = PRId32; --#endif -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ CPPFLAGS="$gt_save_CPPFLAGS" -+ LIBS="$gt_save_LIBS" -+fi -+echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 -+echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6 -+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_CFPREFERENCESCOPYAPPVALUE 1 -+_ACEOF -+ -+ fi -+ echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 -+echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6 -+if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gt_save_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ gt_save_LIBS="$LIBS" -+ LIBS="$LIBS -framework CoreFoundation" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - int - main () - { -- -+CFLocaleCopyCurrent(); - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext --if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- gt_cv_inttypes_pri_broken=no -+ gt_cv_func_CFLocaleCopyCurrent=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --gt_cv_inttypes_pri_broken=yes --fi --rm -f conftest.$ac_objext conftest.$ac_ext -+sed 's/^/| /' conftest.$ac_ext >&5 - -+gt_cv_func_CFLocaleCopyCurrent=no - fi --echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 --echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6 -- fi -- if test "$gt_cv_inttypes_pri_broken" = yes; then -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ CPPFLAGS="$gt_save_CPPFLAGS" -+ LIBS="$gt_save_LIBS" -+fi -+echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 -+echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6 -+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - --cat >>confdefs.h <<_ACEOF --#define PRI_MACROS_BROKEN 1 -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_CFLOCALECOPYCURRENT 1 - _ACEOF - - fi -+ INTL_MACOSX_LIBS= -+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then -+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" -+ fi -+ - - - if test "X$prefix" = "XNONE"; then -@@ -11450,6 +26390,19 @@ - else - with_gnu_ld=no - fi; -+# Prepare PATH_SEPARATOR. -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' -+ else -+ PATH_SEPARATOR=: -+ fi -+ rm -f conf$$.sh -+fi - ac_prog=ld - if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. -@@ -11501,11 +26454,12 @@ - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. -- if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then -- test "$with_gnu_ld" != no && break -- else -- test "$with_gnu_ld" != yes && break -- fi -+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in -+ *GNU* | *'with BFD'*) -+ test "$with_gnu_ld" != no && break ;; -+ *) -+ test "$with_gnu_ld" != yes && break ;; -+ esac - fi - done - IFS="$ac_save_ifs" -@@ -11531,11 +26485,12 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. --if $LD -v 2>&1 &5; then -- acl_cv_prog_gnu_ld=yes --else -- acl_cv_prog_gnu_ld=no --fi -+case `$LD -v 2>&1 &5 - echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 -@@ -11543,6 +26498,7 @@ - - - -+ - echo "$as_me:$LINENO: checking for shared library run path origin" >&5 - echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 - if test "${acl_cv_rpath+set}" = set; then -@@ -11565,8 +26521,6 @@ - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" -- sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" -- sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" - # Check whether --enable-rpath or --disable-rpath was given. - if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" -@@ -11790,7 +26744,7 @@ - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in -- linux*) haveit=yes;; -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi -@@ -11834,7 +26788,7 @@ - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in -- linux*) haveit=yes;; -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi -@@ -11964,223 +26918,722 @@ - - - -+ echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 -+echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6 -+if test "${ac_cv_type_ptrdiff_t+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+if ((ptrdiff_t *) 0) -+ return 0; -+if (sizeof (ptrdiff_t)) -+ return 0; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_type_ptrdiff_t=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_ptrdiff_t=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 -+echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6 -+if test $ac_cv_type_ptrdiff_t = yes; then -+ : -+else -+ -+cat >>confdefs.h <<\_ACEOF -+#define ptrdiff_t long -+_ACEOF -+ -+ -+fi -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ -+stdlib.h string.h unistd.h sys/param.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------------------ ## -+## Report this to the AC_PACKAGE_NAME lists. ## -+## ------------------------------------------ ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ eval "$as_ac_Header=\$ac_header_preproc" -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+ -+fi -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+for ac_func in asprintf fwprintf getcwd getegid geteuid getgid getuid \ -+mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ -+strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ -+__fsetlocking -+do -+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -+echo "$as_me:$LINENO: checking for $ac_func" >&5 -+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_var+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define $ac_func to an innocuous variant, in case declares $ac_func. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define $ac_func innocuous_$ac_func -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char $ac_func (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef $ac_func -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char $ac_func (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -+choke me -+#else -+char (*f) () = $ac_func; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != $ac_func; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ eval "$as_ac_var=yes" -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+eval "$as_ac_var=no" -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -+if test `eval echo '${'$as_ac_var'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+done -+ -+ -+ -+ echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 -+echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6 -+if test "${ac_cv_have_decl__snprintf+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+#ifndef _snprintf -+ char *p = (char *) _snprintf; -+#endif - -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_have_decl__snprintf=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_cv_have_decl__snprintf=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 -+echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6 -+ if test $ac_cv_have_decl__snprintf = yes; then -+ gt_value=1 -+ else -+ gt_value=0 -+ fi - -+cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL__SNPRINTF $gt_value -+_ACEOF - - - --for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ --stdlib.h string.h unistd.h sys/param.h --do --as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --if eval "test \"\${$as_ac_Header+set}\" = set"; then -- echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking whether _snwprintf is declared" >&5 -+echo $ECHO_N "checking whether _snwprintf is declared... $ECHO_C" >&6 -+if test "${ac_cv_have_decl__snwprintf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 --fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - else -- # Is the header compilable? --echo "$as_me:$LINENO: checking $ac_header usability" >&5 --echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --$ac_includes_default --#include <$ac_header> -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+#ifndef _snwprintf -+ char *p = (char *) _snwprintf; -+#endif -+ -+ ; -+ return 0; -+} - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- ac_header_compiler=yes -+ ac_cv_have_decl__snwprintf=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --ac_header_compiler=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_have_decl__snwprintf=no - fi --rm -f conftest.$ac_objext conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 --echo "${ECHO_T}$ac_header_compiler" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_have_decl__snwprintf" >&5 -+echo "${ECHO_T}$ac_cv_have_decl__snwprintf" >&6 -+ if test $ac_cv_have_decl__snwprintf = yes; then -+ gt_value=1 -+ else -+ gt_value=0 -+ fi - --# Is the header present? --echo "$as_me:$LINENO: checking $ac_header presence" >&5 --echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 --cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --#include <$ac_header> -+cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL__SNWPRINTF $gt_value - _ACEOF --if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ -+ -+ -+ -+ echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 -+echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 -+if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+#ifndef feof_unlocked -+ char *p = (char *) feof_unlocked; -+#endif -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -- egrep -v '^ *\+' conftest.er1 >conftest.err -+ grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null; then -- if test -s conftest.err; then -- ac_cpp_err=$ac_c_preproc_warn_flag -- else -- ac_cpp_err= -- fi --else -- ac_cpp_err=yes --fi --if test -z "$ac_cpp_err"; then -- ac_header_preproc=yes -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_have_decl_feof_unlocked=yes - else - echo "$as_me: failed program was:" >&5 -- cat conftest.$ac_ext >&5 -- ac_header_preproc=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_have_decl_feof_unlocked=no - fi --rm -f conftest.err conftest.$ac_ext --echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 --echo "${ECHO_T}$ac_header_preproc" >&6 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 -+echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 -+ if test $ac_cv_have_decl_feof_unlocked = yes; then -+ gt_value=1 -+ else -+ gt_value=0 -+ fi - --# So? What about this header? --case $ac_header_compiler:$ac_header_preproc in -- yes:no ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 --echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -- no:yes ) -- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 --echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; --esac --echo "$as_me:$LINENO: checking for $ac_header" >&5 --echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 --if eval "test \"\${$as_ac_Header+set}\" = set"; then -+cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL_FEOF_UNLOCKED $gt_value -+_ACEOF -+ -+ -+ -+ echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 -+echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 -+if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else -- eval "$as_ac_Header=$ac_header_preproc" --fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ - --fi --if test `eval echo '${'$as_ac_Header'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+#ifndef fgets_unlocked -+ char *p = (char *) fgets_unlocked; -+#endif -+ -+ ; -+ return 0; -+} - _ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_have_decl_fgets_unlocked=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 - -+ac_cv_have_decl_fgets_unlocked=no - fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 -+echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 -+ if test $ac_cv_have_decl_fgets_unlocked = yes; then -+ gt_value=1 -+ else -+ gt_value=0 -+ fi - --done -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -+cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL_FGETS_UNLOCKED $gt_value -+_ACEOF - - - --for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ --geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ --strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next --do --as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` --echo "$as_me:$LINENO: checking for $ac_func" >&5 --echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 --if eval "test \"\${$as_ac_var+set}\" = set"; then -+ echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 -+echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 -+if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" --/* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char $ac_func (); below. */ --#include --/* Override any gcc2 internal prototype to avoid an error. */ --#ifdef __cplusplus --extern "C" --#endif --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char $ac_func (); --char (*f) (); -- --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include - int - main () - { --/* The GNU C library defines this for functions which it implements -- to always fail with ENOSYS. Some functions are actually named -- something starting with __ and the normal name is an alias. */ --#if defined (__stub_$ac_func) || defined (__stub___$ac_func) --choke me --#else --f = $ac_func; -+ -+#ifndef getc_unlocked -+ char *p = (char *) getc_unlocked; - #endif - - ; - return 0; - } - _ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- eval "$as_ac_var=yes" -+ ac_cv_have_decl_getc_unlocked=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --eval "$as_ac_var=no" -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_have_decl_getc_unlocked=no - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 --echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 --if test `eval echo '${'$as_ac_var'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 -+echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 -+ if test $ac_cv_have_decl_getc_unlocked = yes; then -+ gt_value=1 -+ else -+ gt_value=0 -+ fi -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL_GETC_UNLOCKED $gt_value - _ACEOF - --fi --done -+ -+ -+ case $gt_cv_func_printf_posix in -+ *yes) HAVE_POSIX_PRINTF=1 ;; -+ *) HAVE_POSIX_PRINTF=0 ;; -+ esac -+ -+ if test "$ac_cv_func_asprintf" = yes; then -+ HAVE_ASPRINTF=1 -+ else -+ HAVE_ASPRINTF=0 -+ fi -+ -+ if test "$ac_cv_func_snprintf" = yes; then -+ HAVE_SNPRINTF=1 -+ else -+ HAVE_SNPRINTF=0 -+ fi -+ -+ if test "$ac_cv_func_wprintf" = yes; then -+ HAVE_WPRINTF=1 -+ else -+ HAVE_WPRINTF=0 -+ fi - - - -@@ -12222,16 +27675,13 @@ - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - #include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -12244,11 +27694,20 @@ - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -12257,23 +27716,22 @@ - am_cv_func_iconv=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - #include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -12286,11 +27744,20 @@ - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -12300,9 +27767,11 @@ - am_cv_func_iconv=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi - -@@ -12337,8 +27806,11 @@ - else - - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - - #include - #include -@@ -12352,12 +27824,6 @@ - size_t iconv(); - #endif - --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -12368,11 +27834,20 @@ - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -- (eval $ac_compile) 2>&5 -+ (eval $ac_compile) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest.$ac_objext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -12381,10 +27856,11 @@ - am_cv_proto_iconv_arg1="" - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - am_cv_proto_iconv_arg1="const" - fi --rm -f conftest.$ac_objext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" - fi - -@@ -12407,15 +27883,12 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -12426,11 +27899,20 @@ - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -12439,10 +27921,12 @@ - am_cv_langinfo_codeset=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - am_cv_langinfo_codeset=no - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - - fi - echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -@@ -12459,19 +27943,16 @@ - - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 - echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 --if test "${am_cv_val_LC_MESSAGES+set}" = set; then -+if test "${gt_cv_val_LC_MESSAGES+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { -@@ -12482,27 +27963,38 @@ - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -- am_cv_val_LC_MESSAGES=yes -+ gt_cv_val_LC_MESSAGES=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 --am_cv_val_LC_MESSAGES=no -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_val_LC_MESSAGES=no - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - fi --echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 --echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 -- if test $am_cv_val_LC_MESSAGES = yes; then -+echo "$as_me:$LINENO: result: $gt_cv_val_LC_MESSAGES" >&5 -+echo "${ECHO_T}$gt_cv_val_LC_MESSAGES" >&6 -+ if test $gt_cv_val_LC_MESSAGES = yes; then - - cat >>confdefs.h <<\_ACEOF - #define HAVE_LC_MESSAGES 1 -@@ -12512,6 +28004,10 @@ - - fi - -+ if test -n "$INTL_MACOSX_LIBS"; then -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ fi -+ - for ac_prog in bison - do - # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -12545,46 +28041,187 @@ - echo "$as_me:$LINENO: result: $INTLBISON" >&5 - echo "${ECHO_T}$INTLBISON" >&6 - else -- echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6 -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ test -n "$INTLBISON" && break -+done -+ -+ if test -z "$INTLBISON"; then -+ ac_verc_fail=yes -+ else -+ echo "$as_me:$LINENO: checking version of bison" >&5 -+echo $ECHO_N "checking version of bison... $ECHO_C" >&6 -+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ case $ac_prog_version in -+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; -+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) -+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; -+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; -+ esac -+ echo "$as_me:$LINENO: result: $ac_prog_version" >&5 -+echo "${ECHO_T}$ac_prog_version" >&6 -+ fi -+ if test $ac_verc_fail = yes; then -+ INTLBISON=: -+ fi -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 -+echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6 -+if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gt_save_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ gt_save_LIBS="$LIBS" -+ LIBS="$LIBS -framework CoreFoundation" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+CFPreferencesCopyAppValue(NULL, NULL) -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ gt_cv_func_CFPreferencesCopyAppValue=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_func_CFPreferencesCopyAppValue=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ CPPFLAGS="$gt_save_CPPFLAGS" -+ LIBS="$gt_save_LIBS" -+fi -+echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 -+echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6 -+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_CFPREFERENCESCOPYAPPVALUE 1 -+_ACEOF -+ -+ fi -+ echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 -+echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6 -+if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gt_save_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" -+ gt_save_LIBS="$LIBS" -+ LIBS="$LIBS -framework CoreFoundation" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+CFLocaleCopyCurrent(); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ gt_cv_func_CFLocaleCopyCurrent=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_func_CFLocaleCopyCurrent=no - fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ CPPFLAGS="$gt_save_CPPFLAGS" -+ LIBS="$gt_save_LIBS" -+fi -+echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 -+echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6 -+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - -- test -n "$INTLBISON" && break --done -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_CFLOCALECOPYCURRENT 1 -+_ACEOF - -- if test -z "$INTLBISON"; then -- ac_verc_fail=yes -- else -- echo "$as_me:$LINENO: checking version of bison" >&5 --echo $ECHO_N "checking version of bison... $ECHO_C" >&6 -- ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -- case $ac_prog_version in -- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; -- 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) -- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; -- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; -- esac -- echo "$as_me:$LINENO: result: $ac_prog_version" >&5 --echo "${ECHO_T}$ac_prog_version" >&6 - fi -- if test $ac_verc_fail = yes; then -- INTLBISON=: -+ INTL_MACOSX_LIBS= -+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then -+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" - fi - - - - -- -- -- -- -- -- -- -- -- -- -- - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 - echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. -@@ -12599,6 +28236,7 @@ - - - -+ - BUILD_INCLUDED_LIBINTL=no - USE_INCLUDED_LIBINTL=no - -@@ -12636,33 +28274,39 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - extern int _nl_msg_cat_cntr; - extern int *_nl_domain_bindings; --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif - int - main () - { - bindtextdomain ("", ""); --return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings -+return * gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -12671,10 +28315,12 @@ - gt_cv_func_gnugettext1_libc=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - gt_cv_func_gnugettext1_libc=no - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 - echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 -@@ -12892,7 +28538,7 @@ - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in -- linux*) haveit=yes;; -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi -@@ -12936,7 +28582,7 @@ - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in -- linux*) haveit=yes;; -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi -@@ -13069,37 +28715,43 @@ - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - extern int _nl_msg_cat_cntr; - extern - #ifdef __cplusplus - "C" - #endif --const char *_nl_expand_alias (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+const char *_nl_expand_alias (const char *); - int - main () - { - bindtextdomain ("", ""); --return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) -+return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -13108,44 +28760,52 @@ - gt_cv_func_gnugettext1_libintl=yes - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - gt_cv_func_gnugettext1_libintl=no - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF --#line $LINENO "configure" --#include "confdefs.h" -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ - #include - extern int _nl_msg_cat_cntr; - extern - #ifdef __cplusplus - "C" - #endif --const char *_nl_expand_alias (); --#ifdef F77_DUMMY_MAIN --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } --#endif -+const char *_nl_expand_alias (const char *); - int - main () - { - bindtextdomain ("", ""); --return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) -+return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>&5 -+ (eval $ac_link) 2>conftest.er1 - ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -s conftest$ac_exeext' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -13157,9 +28817,11 @@ - - else - echo "$as_me: failed program was:" >&5 --cat conftest.$ac_ext >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ - fi --rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS" -@@ -13170,7 +28832,8 @@ - - if test "$gt_cv_func_gnugettext1_libc" = "yes" \ - || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ -- && test "$PACKAGE" != gettext; }; then -+ && test "$PACKAGE" != gettext-runtime \ -+ && test "$PACKAGE" != gettext-tools; }; then - gt_use_preinstalled_gnugettext=yes - else - LIBINTL= -@@ -13185,20 +28848,28 @@ - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then -- INTLOBJS="\$(GETTOBJS)" -- BUILD_INCLUDED_LIBINTL=yes -+ BUILD_INCLUDED_LIBINTL=yes - USE_INCLUDED_LIBINTL=yes - LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV" - LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV" - LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` - fi - -+ CATOBJEXT= - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - CATOBJEXT=.gmo - fi - - -+ if test -n "$INTL_MACOSX_LIBS"; then -+ if test "$gt_use_preinstalled_gnugettext" = "yes" \ -+ || test "$nls_cv_use_gnu_gettext" = "yes"; then -+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" -+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" -+ fi -+ fi -+ - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - -@@ -13211,6 +28882,26 @@ - fi - fi - -+ echo "$as_me:$LINENO: checking whether to use NLS" >&5 -+echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6 -+ echo "$as_me:$LINENO: result: $USE_NLS" >&5 -+echo "${ECHO_T}$USE_NLS" >&6 -+ if test "$USE_NLS" = "yes"; then -+ echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 -+echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6 -+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then -+ if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then -+ gt_source="external libintl" -+ else -+ gt_source="libc" -+ fi -+ else -+ gt_source="included intl directory" -+ fi -+ echo "$as_me:$LINENO: result: $gt_source" >&5 -+echo "${ECHO_T}$gt_source" >&6 -+ fi -+ - if test "$USE_NLS" = "yes"; then - - if test "$gt_use_preinstalled_gnugettext" = "yes"; then -@@ -13260,7 +28951,7 @@ - fi - - -- if test "$PACKAGE" = gettext; then -+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then - BUILD_INCLUDED_LIBINTL=yes - fi - -@@ -13268,7 +28959,6 @@ - - - -- - nls_cv_header_intl= - nls_cv_header_libgt= - -@@ -13281,6 +28971,12 @@ - GENCAT=gencat - - -+ INTLOBJS= -+ if test "$USE_INCLUDED_LIBINTL" = yes; then -+ INTLOBJS="\$(GETTOBJS)" -+ fi -+ -+ - INTL_LIBTOOL_SUFFIX_PREFIX= - - -@@ -13318,8 +29014,8 @@ - fi - - --ac_config_files="$ac_config_files Makefile gsmlib/Makefile tests/Makefile apps/Makefile win32/Makefile doc/Makefile scripts/Makefile intl/Makefile po/Makefile.in ext/Makefile" --ac_config_commands="$ac_config_commands default" -+ ac_config_files="$ac_config_files Makefile gsmlib/Makefile tests/Makefile apps/Makefile win32/Makefile doc/Makefile scripts/Makefile intl/Makefile po/Makefile.in ext/Makefile" -+ ac_config_commands="$ac_config_commands default" - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure - # tests run on this system so they can be shared between configure -@@ -13330,7 +29026,7 @@ - # config.status only pays attention to the cache file if you give it - # the --recheck option to rerun configure. - # --# `ac_cv_env_foo' variables (set or unset) will be overriden when -+# `ac_cv_env_foo' variables (set or unset) will be overridden when - # loading this file, other *unset* `ac_cv_foo' will be assigned the - # following values. - -@@ -13348,13 +29044,13 @@ - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ -- "s/'/'\\\\''/g; -- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" -+ "s/'/'\\\\''/g; -+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ -- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" -+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; - } | -@@ -13365,7 +29061,7 @@ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache --if cmp -s $cache_file confcache; then :; else -+if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file -@@ -13384,18 +29080,33 @@ - # trailing colons and then remove the whole line if VPATH becomes empty - # (actually we leave an empty line to preserve line numbers). - if test "x$srcdir" = x.; then -- ac_vpsub='/^[ ]*VPATH[ ]*=/{ -+ ac_vpsub='/^[ ]*VPATH[ ]*=/{ - s/:*\$(srcdir):*/:/; - s/:*\${srcdir}:*/:/; - s/:*@srcdir@:*/:/; --s/^\([^=]*=[ ]*\):*/\1/; -+s/^\([^=]*=[ ]*\):*/\1/; - s/:*$//; --s/^[^=]*=[ ]*$//; -+s/^[^=]*=[ ]*$//; - }' - fi - - DEFS=-DHAVE_CONFIG_H - -+ac_libobjs= -+ac_ltlibobjs= -+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue -+ # 1. Remove the extension, and $U if already installed. -+ ac_i=`echo "$ac_i" | -+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'` -+ # 2. Add them. -+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" -+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -+done -+LIBOBJS=$ac_libobjs -+ -+LTLIBOBJS=$ac_ltlibobjs -+ -+ - if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. - Usually this means the macro was only invoked conditionally." >&5 -@@ -13403,6 +29114,27 @@ - Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } - fi -+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi - if test -z "${COMPILE_INTL_TRUE}" && test -z "${COMPILE_INTL_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"COMPILE_INTL\" was never defined. - Usually this means the macro was only invoked conditionally." >&5 -@@ -13424,11 +29156,12 @@ - # configure, is in config.log if it exists. - - debug=false -+ac_cs_recheck=false -+ac_cs_silent=false - SHELL=\${CONFIG_SHELL-$SHELL} - _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF -- - ## --------------------- ## - ## M4sh Initialization. ## - ## --------------------- ## -@@ -13437,46 +29170,57 @@ - if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: -+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' - elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix - fi -+DUALCASE=1; export DUALCASE # for MKS sh - --# NLS nuisances. - # Support unset when possible. --if (FOO=FOO; unset FOO) >/dev/null 2>&1; then -+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset - else - as_unset=false - fi - --(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && -- { $as_unset LANG || test "${LANG+set}" != set; } || -- { LANG=C; export LANG; } --(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && -- { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || -- { LC_ALL=C; export LC_ALL; } --(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && -- { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || -- { LC_TIME=C; export LC_TIME; } --(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && -- { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || -- { LC_CTYPE=C; export LC_CTYPE; } --(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && -- { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || -- { LANGUAGE=C; export LANGUAGE; } --(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && -- { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || -- { LC_COLLATE=C; export LC_COLLATE; } --(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && -- { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || -- { LC_NUMERIC=C; export LC_NUMERIC; } --(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && -- { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || -- { LC_MESSAGES=C; export LC_MESSAGES; } -+ -+# Work around bugs in pre-3.0 UWIN ksh. -+$as_unset ENV MAIL MAILPATH -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+for as_var in \ -+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ -+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ -+ LC_TELEPHONE LC_TIME -+do -+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then -+ eval $as_var=C; export $as_var -+ else -+ $as_unset $as_var -+ fi -+done -+ -+# Required to use basename. -+if expr a : '\(a\)' >/dev/null 2>&1; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi - - - # Name of the executable. --as_me=`(basename "$0") 2>/dev/null || -+as_me=`$as_basename "$0" || - $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ -@@ -13487,6 +29231,7 @@ - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - -+ - # PATH needs CR, and LINENO needs CR and PATH. - # Avoid depending upon Character Ranges. - as_cr_letters='abcdefghijklmnopqrstuvwxyz' -@@ -13497,15 +29242,15 @@ - - # The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then -- echo "#! /bin/sh" >conftest.sh -- echo "exit 0" >>conftest.sh -- chmod +x conftest.sh -- if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi -- rm -f conftest.sh -+ rm -f conf$$.sh - fi - - -@@ -13554,6 +29299,8 @@ - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then -+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } -+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} -@@ -13627,13 +29374,20 @@ - fi - rm -f conf$$ conf$$.exe conf$$.file - -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p=: -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ - as_executable_p="test -f" - - # Sed expression to map a string onto a valid CPP name. --as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - - # Sed expression to map a string onto a valid variable name. --as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" -+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - # IFS -@@ -13643,7 +29397,7 @@ - IFS=" $as_nl" - - # CDPATH. --$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } -+$as_unset CDPATH - - exec 6>&1 - -@@ -13660,7 +29414,7 @@ - cat >&5 <<_CSEOF - - This file was extended by $as_me, which was --generated by GNU Autoconf 2.53. Invocation command line was -+generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS -@@ -13700,12 +29454,13 @@ - - -h, --help print this help, then exit - -V, --version print version number, then exit -+ -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] -- instantiate the configuration file FILE -+ instantiate the configuration file FILE - --header=FILE[:TEMPLATE] -- instantiate the configuration header FILE -+ instantiate the configuration header FILE - - Configuration files: - $config_files -@@ -13722,11 +29477,10 @@ - cat >>$CONFIG_STATUS <<_ACEOF - ac_cs_version="\\ - config.status --configured by $0, generated by GNU Autoconf 2.53, -+configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - --Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 --Free Software Foundation, Inc. -+Copyright (C) 2003 Free Software Foundation, Inc. - This config.status script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it." - srcdir=$srcdir -@@ -13743,25 +29497,25 @@ - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` -- shift -- set dummy "$ac_option" "$ac_optarg" ${1+"$@"} -- shift -+ ac_shift=: -+ ;; -+ -*) -+ ac_option=$1 -+ ac_optarg=$2 -+ ac_shift=shift - ;; -- -*);; - *) # This is not an option, so the user has probably given explicit - # arguments. -+ ac_option=$1 - ac_need_defaults=false;; - esac - -- case $1 in -+ case $ac_option in - # Handling of the options. - _ACEOF --cat >>$CONFIG_STATUS <<_ACEOF -- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -- echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" -- exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; --_ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF -+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -+ ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) -@@ -13776,13 +29530,16 @@ - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) -- shift -- CONFIG_FILES="$CONFIG_FILES $1" -+ $ac_shift -+ CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) -- shift -- CONFIG_HEADERS="$CONFIG_HEADERS $1" -+ $ac_shift -+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil | --si | --s) -+ ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -@@ -13797,6 +29554,20 @@ - shift - done - -+ac_configure_extra_args= -+ -+if $ac_cs_silent; then -+ exec 6>/dev/null -+ ac_configure_extra_args="$ac_configure_extra_args --silent" -+fi -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF -+if \$ac_cs_recheck; then -+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 -+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -+fi -+ - _ACEOF - - cat >>$CONFIG_STATUS <<_ACEOF -@@ -13805,10 +29576,10 @@ - # - - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" --# Capture the value of obsolete $ALL_LINGUAS because we need it to compute -- # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it -+# Capture the value of obsolete ALL_LINGUAS because we need it to compute -+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake. -- eval 'ALL_LINGUAS''="$ALL_LINGUAS"' -+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - -@@ -13852,6 +29623,9 @@ - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands - fi - -+# Have a temporary directory for convenience. Make it in the build tree -+# simply because there is no reason to put it here, and in addition, -+# creating and moving files from /tmp can sometimes cause problems. - # Create a temporary directory, and hook for its removal unless debugging. - $debug || - { -@@ -13860,17 +29634,17 @@ - } - - # Create a (secure) tmp directory for tmp files. --: ${TMPDIR=/tmp} -+ - { -- tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && -+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" - } || - { -- tmp=$TMPDIR/cs$$-$RANDOM -+ tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) - } || - { -- echo "$me: cannot create a temporary directory in $TMPDIR" >&2 -+ echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } - } - -@@ -13928,6 +29702,7 @@ - s,@ac_ct_CC@,$ac_ct_CC,;t t - s,@EXEEXT@,$EXEEXT,;t t - s,@OBJEXT@,$OBJEXT,;t t -+s,@CYGPATH_W@,$CYGPATH_W,;t t - s,@PACKAGE@,$PACKAGE,;t t - s,@VERSION@,$VERSION,;t t - s,@ACLOCAL@,$ACLOCAL,;t t -@@ -13935,13 +29710,17 @@ - s,@AUTOMAKE@,$AUTOMAKE,;t t - s,@AUTOHEADER@,$AUTOHEADER,;t t - s,@MAKEINFO@,$MAKEINFO,;t t --s,@AMTAR@,$AMTAR,;t t - s,@install_sh@,$install_sh,;t t - s,@STRIP@,$STRIP,;t t - s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t - s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -+s,@mkdir_p@,$mkdir_p,;t t - s,@AWK@,$AWK,;t t - s,@SET_MAKE@,$SET_MAKE,;t t -+s,@am__leading_dot@,$am__leading_dot,;t t -+s,@AMTAR@,$AMTAR,;t t -+s,@am__tar@,$am__tar,;t t -+s,@am__untar@,$am__untar,;t t - s,@DEPDIR@,$DEPDIR,;t t - s,@am__include@,$am__include,;t t - s,@am__quote@,$am__quote,;t t -@@ -13949,6 +29728,8 @@ - s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t - s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t - s,@CCDEPMODE@,$CCDEPMODE,;t t -+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t - s,@build@,$build,;t t - s,@build_cpu@,$build_cpu,;t t - s,@build_vendor@,$build_vendor,;t t -@@ -13957,35 +29738,50 @@ - s,@host_cpu@,$host_cpu,;t t - s,@host_vendor@,$host_vendor,;t t - s,@host_os@,$host_os,;t t -+s,@EGREP@,$EGREP,;t t - s,@LN_S@,$LN_S,;t t - s,@ECHO@,$ECHO,;t t -+s,@AR@,$AR,;t t -+s,@ac_ct_AR@,$ac_ct_AR,;t t - s,@RANLIB@,$RANLIB,;t t - s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t - s,@CPP@,$CPP,;t t --s,@LIBTOOL@,$LIBTOOL,;t t - s,@CXX@,$CXX,;t t - s,@CXXFLAGS@,$CXXFLAGS,;t t - s,@ac_ct_CXX@,$ac_ct_CXX,;t t - s,@CXXDEPMODE@,$CXXDEPMODE,;t t -+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t -+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t -+s,@CXXCPP@,$CXXCPP,;t t -+s,@F77@,$F77,;t t -+s,@FFLAGS@,$FFLAGS,;t t -+s,@ac_ct_F77@,$ac_ct_F77,;t t -+s,@LIBTOOL@,$LIBTOOL,;t t - s,@ALLOCA@,$ALLOCA,;t t - s,@GSM_VERSION@,$GSM_VERSION,;t t - s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -+s,@USE_NLS@,$USE_NLS,;t t - s,@MSGFMT@,$MSGFMT,;t t - s,@GMSGFMT@,$GMSGFMT,;t t - s,@XGETTEXT@,$XGETTEXT,;t t - s,@MSGMERGE@,$MSGMERGE,;t t -+s,@GLIBC2@,$GLIBC2,;t t - s,@GLIBC21@,$GLIBC21,;t t -+s,@INTL_MACOSX_LIBS@,$INTL_MACOSX_LIBS,;t t -+s,@HAVE_POSIX_PRINTF@,$HAVE_POSIX_PRINTF,;t t -+s,@HAVE_ASPRINTF@,$HAVE_ASPRINTF,;t t -+s,@HAVE_SNPRINTF@,$HAVE_SNPRINTF,;t t -+s,@HAVE_WPRINTF@,$HAVE_WPRINTF,;t t - s,@LIBICONV@,$LIBICONV,;t t - s,@LTLIBICONV@,$LTLIBICONV,;t t - s,@INTLBISON@,$INTLBISON,;t t --s,@USE_NLS@,$USE_NLS,;t t - s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t - s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t - s,@CATOBJEXT@,$CATOBJEXT,;t t --s,@INTLOBJS@,$INTLOBJS,;t t - s,@DATADIRNAME@,$DATADIRNAME,;t t - s,@INSTOBJEXT@,$INSTOBJEXT,;t t - s,@GENCAT@,$GENCAT,;t t -+s,@INTLOBJS@,$INTLOBJS,;t t - s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t - s,@INTLLIBS@,$INTLLIBS,;t t - s,@LIBINTL@,$LIBINTL,;t t -@@ -13993,6 +29789,8 @@ - s,@POSUB@,$POSUB,;t t - s,@COMPILE_INTL_TRUE@,$COMPILE_INTL_TRUE,;t t - s,@COMPILE_INTL_FALSE@,$COMPILE_INTL_FALSE,;t t -+s,@LIBOBJS@,$LIBOBJS,;t t -+s,@LTLIBOBJS@,$LTLIBOBJS,;t t - CEOF - - _ACEOF -@@ -14022,9 +29820,9 @@ - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then -- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" -+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else -- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" -+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end -@@ -14042,46 +29840,51 @@ - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin -- cat >$tmp/stdin -- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ cat >$tmp/stdin -+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || - $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -- X"$ac_file" : 'X\(//\)[^/]' \| \ -- X"$ac_file" : 'X\(//\)$' \| \ -- X"$ac_file" : 'X\(/\)' \| \ -- . : '\(.\)' 2>/dev/null || -+ X"$ac_file" : 'X\(//\)[^/]' \| \ -+ X"$ac_file" : 'X\(//\)$' \| \ -+ X"$ac_file" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || - echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` -- { case "$ac_dir" in -- [\\/]* | ?:[\\/]* ) as_incr_dir=;; -- *) as_incr_dir=.;; --esac --as_dummy="$ac_dir" --for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do -- case $as_mkdir_dir in -- # Skip DOS drivespec -- ?:) as_incr_dir=$as_mkdir_dir ;; -- *) -- as_incr_dir=$as_incr_dir/$as_mkdir_dir -- test -d "$as_incr_dir" || -- mkdir "$as_incr_dir" || -- { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 --echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} -- { (exit 1); exit 1; }; } -- ;; -- esac --done; } -+ { if $as_mkdir_p; then -+ mkdir -p "$ac_dir" -+ else -+ as_dir="$ac_dir" -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} -+ { (exit 1); exit 1; }; }; } - - ac_builddir=. - -@@ -14108,12 +29911,45 @@ - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; - esac --# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be --# absolute. --ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` --ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` --ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` --ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` -+ -+# Do not use `cd foo && pwd` to compute absolute paths, because -+# the directories may not exist. -+case `pwd` in -+.) ac_abs_builddir="$ac_dir";; -+*) -+ case "$ac_dir" in -+ .) ac_abs_builddir=`pwd`;; -+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; -+ *) ac_abs_builddir=`pwd`/"$ac_dir";; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_builddir=${ac_top_builddir}.;; -+*) -+ case ${ac_top_builddir}. in -+ .) ac_abs_top_builddir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; -+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_srcdir=$ac_srcdir;; -+*) -+ case $ac_srcdir in -+ .) ac_abs_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; -+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_srcdir=$ac_top_srcdir;; -+*) -+ case $ac_top_srcdir in -+ .) ac_abs_top_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; -+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; -+ esac;; -+esac - - - case $INSTALL in -@@ -14121,11 +29957,6 @@ - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - -- if test x"$ac_file" != x-; then -- { echo "$as_me:$LINENO: creating $ac_file" >&5 --echo "$as_me: creating $ac_file" >&6;} -- rm -f "$ac_file" -- fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ -@@ -14135,7 +29966,7 @@ - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | -- sed 's,.*/,,'` by configure." -+ sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. -@@ -14144,26 +29975,32 @@ - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) -- # Absolute (can't be DOS-style, as IFS=:) -- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+ # Absolute (can't be DOS-style, as IFS=:) -+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } -- echo $f;; -+ echo "$f";; - *) # Relative -- if test -f "$f"; then -- # Build tree -- echo $f -- elif test -f "$srcdir/$f"; then -- # Source tree -- echo $srcdir/$f -- else -- # /dev/null tree -- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+ if test -f "$f"; then -+ # Build tree -+ echo "$f" -+ elif test -f "$srcdir/$f"; then -+ # Source tree -+ echo "$srcdir/$f" -+ else -+ # /dev/null tree -+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } -- fi;; -+ fi;; - esac - done` || { (exit 1); exit 1; } -+ -+ if test x"$ac_file" != x-; then -+ { echo "$as_me:$LINENO: creating $ac_file" >&5 -+echo "$as_me: creating $ac_file" >&6;} -+ rm -f "$ac_file" -+ fi - _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -@@ -14203,12 +30040,12 @@ - # NAME is the cpp macro being defined and VALUE is the value it is being given. - # - # ac_d sets the value in "#define NAME VALUE" lines. --ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' --ac_dB='[ ].*$,\1#\2' -+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -+ac_dB='[ ].*$,\1#\2' - ac_dC=' ' - ac_dD=',;t' - # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". --ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' - ac_uB='$,\1#\2define\3' - ac_uC=' ' - ac_uD=',;t' -@@ -14217,11 +30054,11 @@ - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin -- cat >$tmp/stdin -- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ cat >$tmp/stdin -+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - -@@ -14235,28 +30072,29 @@ - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) -- # Absolute (can't be DOS-style, as IFS=:) -- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+ # Absolute (can't be DOS-style, as IFS=:) -+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } -- echo $f;; -+ # Do quote $f, to prevent DOS paths from being IFS'd. -+ echo "$f";; - *) # Relative -- if test -f "$f"; then -- # Build tree -- echo $f -- elif test -f "$srcdir/$f"; then -- # Source tree -- echo $srcdir/$f -- else -- # /dev/null tree -- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+ if test -f "$f"; then -+ # Build tree -+ echo "$f" -+ elif test -f "$srcdir/$f"; then -+ # Source tree -+ echo "$srcdir/$f" -+ else -+ # /dev/null tree -+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } -- fi;; -+ fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. -- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in -+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - - _ACEOF - -@@ -14279,9 +30117,9 @@ - s,[\\$`],\\&,g - t clear - : clear --s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp - t end --s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp - : end - _ACEOF - # If some macros were called several times there might be several times -@@ -14295,13 +30133,13 @@ - # example, in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - cat >>conftest.undefs <<\_ACEOF --s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, - _ACEOF - - # Break up conftest.defines because some shells have a limit on the size - # of here documents, and old seds have small limits too (100 cmds). - echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS --echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS - echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS - echo ' :' >>$CONFIG_STATUS - rm -f conftest.tail -@@ -14310,7 +30148,7 @@ - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. -- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS -+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS -@@ -14325,7 +30163,7 @@ - mv conftest.tail conftest.defines - done - rm -f conftest.defines --echo ' fi # egrep' >>$CONFIG_STATUS -+echo ' fi # grep' >>$CONFIG_STATUS - echo >>$CONFIG_STATUS - - # Break up conftest.undefs because some shells have a limit on the size -@@ -14337,7 +30175,7 @@ - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' -- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS -+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS -@@ -14365,41 +30203,46 @@ - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then -- if cmp -s $ac_file $tmp/config.h 2>/dev/null; then -+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 - echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || - $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -- X"$ac_file" : 'X\(//\)[^/]' \| \ -- X"$ac_file" : 'X\(//\)$' \| \ -- X"$ac_file" : 'X\(/\)' \| \ -- . : '\(.\)' 2>/dev/null || -+ X"$ac_file" : 'X\(//\)[^/]' \| \ -+ X"$ac_file" : 'X\(//\)$' \| \ -+ X"$ac_file" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || - echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` -- { case "$ac_dir" in -- [\\/]* | ?:[\\/]* ) as_incr_dir=;; -- *) as_incr_dir=.;; --esac --as_dummy="$ac_dir" --for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do -- case $as_mkdir_dir in -- # Skip DOS drivespec -- ?:) as_incr_dir=$as_mkdir_dir ;; -- *) -- as_incr_dir=$as_incr_dir/$as_mkdir_dir -- test -d "$as_incr_dir" || -- mkdir "$as_incr_dir" || -- { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 --echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} -- { (exit 1); exit 1; }; } -- ;; -- esac --done; } -+ { if $as_mkdir_p; then -+ mkdir -p "$ac_dir" -+ else -+ as_dir="$ac_dir" -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} -+ { (exit 1); exit 1; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file -@@ -14408,13 +30251,29 @@ - cat $tmp/config.h - rm -f $tmp/config.h - fi -- # Run the commands associated with the file. -- case $ac_file in -- gsm_config.h ) # update the timestamp --echo 'timestamp for gsm_config.h' >"./stamp-h1" -- ;; -+# Compute $ac_file's index in $config_headers. -+_am_stamp_count=1 -+for _am_header in $config_headers :; do -+ case $_am_header in -+ $ac_file | $ac_file:* ) -+ break ;; -+ * ) -+ _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac - done -+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || -+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X$ac_file : 'X\(//\)[^/]' \| \ -+ X$ac_file : 'X\(//\)$' \| \ -+ X$ac_file : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X$ac_file | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'`/stamp-h$_am_stamp_count -+done - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - -@@ -14426,16 +30285,41 @@ - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || - $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -- X"$ac_dest" : 'X\(//\)[^/]' \| \ -- X"$ac_dest" : 'X\(//\)$' \| \ -- X"$ac_dest" : 'X\(/\)' \| \ -- . : '\(.\)' 2>/dev/null || -+ X"$ac_dest" : 'X\(//\)[^/]' \| \ -+ X"$ac_dest" : 'X\(//\)$' \| \ -+ X"$ac_dest" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || - echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` -+ { if $as_mkdir_p; then -+ mkdir -p "$ac_dir" -+ else -+ as_dir="$ac_dir" -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} -+ { (exit 1); exit 1; }; }; } -+ - ac_builddir=. - - if test "$ac_dir" != .; then -@@ -14461,12 +30345,45 @@ - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; - esac --# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be --# absolute. --ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` --ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` --ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` --ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` -+ -+# Do not use `cd foo && pwd` to compute absolute paths, because -+# the directories may not exist. -+case `pwd` in -+.) ac_abs_builddir="$ac_dir";; -+*) -+ case "$ac_dir" in -+ .) ac_abs_builddir=`pwd`;; -+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; -+ *) ac_abs_builddir=`pwd`/"$ac_dir";; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_builddir=${ac_top_builddir}.;; -+*) -+ case ${ac_top_builddir}. in -+ .) ac_abs_top_builddir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; -+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_srcdir=$ac_srcdir;; -+*) -+ case $ac_srcdir in -+ .) ac_abs_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; -+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_srcdir=$ac_top_srcdir;; -+*) -+ case $ac_top_srcdir in -+ .) ac_abs_top_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; -+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; -+ esac;; -+esac - - - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -@@ -14484,10 +30401,10 @@ - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || - $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -- X"$mf" : 'X\(//\)[^/]' \| \ -- X"$mf" : 'X\(//\)$' \| \ -- X"$mf" : 'X\(/\)' \| \ -- . : '\(.\)' 2>/dev/null || -+ X"$mf" : 'X\(//\)[^/]' \| \ -+ X"$mf" : 'X\(//\)$' \| \ -+ X"$mf" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || - echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } -@@ -14497,61 +30414,60 @@ - else - continue - fi -- grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue -- # Extract the definition of DEP_FILES from the Makefile without -- # running `make'. -- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` -+ # Extract the definition of DEPDIR, am__include, and am__quote -+ # from the Makefile without running `make'. -+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue -+ am__include=`sed -n 's/^am__include = //p' < "$mf"` -+ test -z "am__include" && continue -+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it -- U=`sed -n -e '/^U = / s///p' < "$mf"` -- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" -- # We invoke sed twice because it is the simplest approach to -- # changing $(DEPDIR) to its actual value in the expansion. -- for file in `sed -n -e ' -- /^DEP_FILES = .*\\\\$/ { -- s/^DEP_FILES = // -- :loop -- s/\\\\$// -- p -- n -- /\\\\$/ b loop -- p -- } -- /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ -+ U=`sed -n 's/^U = //p' < "$mf"` -+ # Find all dependency output files, they are included files with -+ # $(DEPDIR) in their names. We invoke sed twice because it is the -+ # simplest approach to changing $(DEPDIR) to its actual value in the -+ # expansion. -+ for file in `sed -n " -+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || - $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -- X"$file" : 'X\(//\)[^/]' \| \ -- X"$file" : 'X\(//\)$' \| \ -- X"$file" : 'X\(/\)' \| \ -- . : '\(.\)' 2>/dev/null || -+ X"$file" : 'X\(//\)[^/]' \| \ -+ X"$file" : 'X\(//\)$' \| \ -+ X"$file" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || - echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` -- { case $dirpart/$fdir in -- [\\/]* | ?:[\\/]* ) as_incr_dir=;; -- *) as_incr_dir=.;; --esac --as_dummy=$dirpart/$fdir --for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do -- case $as_mkdir_dir in -- # Skip DOS drivespec -- ?:) as_incr_dir=$as_mkdir_dir ;; -- *) -- as_incr_dir=$as_incr_dir/$as_mkdir_dir -- test -d "$as_incr_dir" || -- mkdir "$as_incr_dir" || -- { { echo "$as_me:$LINENO: error: cannot create $dirpart/$fdir" >&5 --echo "$as_me: error: cannot create $dirpart/$fdir" >&2;} -- { (exit 1); exit 1; }; } -- ;; -- esac --done; } -+ { if $as_mkdir_p; then -+ mkdir -p $dirpart/$fdir -+ else -+ as_dir=$dirpart/$fdir -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} -+ { (exit 1); exit 1; }; }; } - - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" -@@ -14578,35 +30494,51 @@ - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac -+ # Treat a directory as a PO directory if and only if it has a -+ # POTFILES.in file. This allows packages to have multiple PO -+ # directories under different names or in different locations. - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" -- # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend -+ POMAKEFILEDEPS="POTFILES.in" -+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. -- if test -n "$ALL_LINGUAS"; then -+ if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi -- ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` -+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' -+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" -+ else -+ # The set of available languages was given in configure.in. -+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi -+ # Compute POFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) -+ # Compute UPDATEPOFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) -+ # Compute DUMMYPOFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) -+ # Compute GMOFILES -+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= -- GMOFILES= - UPDATEPOFILES= - DUMMYPOFILES= -+ GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" -- GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" -+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. -@@ -14641,7 +30573,7 @@ - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" -- sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" -+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in -@@ -14677,8 +30609,11 @@ - # need to make the FD available again. - if test "$no_create" != yes; then - ac_cs_success=: -+ ac_config_status_args= -+ test "$silent" = yes && -+ ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null -- $SHELL $CONFIG_STATUS || ac_cs_success=false -+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. ---- gsmlib-1.10.orig/stamp-h.in -+++ gsmlib-1.10/stamp-h.in -@@ -0,0 +1 @@ -+timestamp ---- gsmlib-1.10.orig/apps/gsmsmsstore.cc -+++ gsmlib-1.10/apps/gsmsmsstore.cc -@@ -292,19 +292,14 @@ - sourceStore = new SortedSMSStore(sourceMeTa->getSMSStore(storeName)); - } - -- // make sure destination file exists -+ // make sure destination file exists if specified -+ // Use isFile() for its exception-throwing properties, and discard -+ // return value cos we don't care (yet) whether it's a device or a -+ // regular file. - if (destination != "") -- { -- try -- { -- ofstream f(destination.c_str(), ios::out | ios::app | ios::binary); -- } -- catch (exception) -- { -- } -- } -+ isFile(destination); - -- // start accessing destination destination store or file -+ // start accessing destination store or file - if (operation == CopyOp || operation == BackupOp || operation == AddOp || - operation == DeleteOp) - if (destination == "-") ---- gsmlib-1.10.orig/apps/gsmsmsd.cc -+++ gsmlib-1.10/apps/gsmsmsd.cc -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #endif - #if defined(HAVE_GETOPT_LONG) || defined(WIN32) - #include -@@ -39,6 +40,7 @@ - #include - #include - #include -+#include - - using namespace std; - using namespace gsmlib; -@@ -53,6 +55,12 @@ - {"store", required_argument, (int*)NULL, 't'}, - {"device", required_argument, (int*)NULL, 'd'}, - {"spool", required_argument, (int*)NULL, 's'}, -+ {"sent", required_argument, (int*)NULL, 'S'}, -+ {"failed", required_argument, (int*)NULL, 'F'}, -+ {"priorities", required_argument, (int*)NULL, 'P'}, -+#ifndef WIN32 -+ {"syslog", no_argument, (int*)NULL, 'L'}, -+#endif - {"sca", required_argument, (int*)NULL, 'C'}, - {"flush", no_argument, (int*)NULL, 'f'}, - {"concatenate", required_argument, (int*)NULL, 'c'}, -@@ -178,9 +186,21 @@ - - bool requestStatusReport = false; - --void sendSMS(string spoolDir, Ref at) -+void sendSMS(string spoolDirBase, string sentDirBase, string failedDirBase, -+ unsigned int priority, bool enableSyslog, Ref at) - { -- if (spoolDir != "") -+ string spoolDir = spoolDirBase; -+ string sentDir = sentDirBase; -+ string failedDir = failedDirBase; -+ if ( priority >= 1 ) -+ { -+ spoolDir = spoolDirBase + stringPrintf(_("%d"),priority); -+ sentDir = sentDirBase + stringPrintf(_("%d"),priority); -+ failedDir = failedDirBase + stringPrintf(_("%d"),priority); -+ } -+ if ( priority > 1 ) -+ sendSMS(spoolDirBase, sentDirBase, failedDirBase, priority-1, enableSyslog, at); -+ if (spoolDirBase != "") - { - // look into spoolDir for any outgoing SMS that should be sent - #ifdef WIN32 -@@ -211,6 +231,8 @@ - strcmp(entry->d_name, "..") != 0) - #endif - { -+ if ( priority > 1 ) -+ sendSMS(spoolDirBase, sentDirBase, failedDirBase, priority-1, enableSyslog, at); - // read in file - // the first line is interpreted as the phone number - // the rest is the message -@@ -221,11 +243,30 @@ - #endif - ifstream ifs(filename.c_str()); - if (! ifs) -+#ifndef WIN32 -+ if (enableSyslog) -+ { -+ syslog(LOG_WARNING, "Could not open SMS spool file %s", -+ filename.c_str()); -+ if (failedDirBase != "") { -+ string failedfilename = failedDir + "/" + entry->d_name; -+ rename(filename.c_str(),failedfilename.c_str()); -+ } -+ continue; -+ } -+ else -+#endif - throw GsmException( - stringPrintf(_("count not open SMS spool file %s"), - filename.c_str()), ParameterError); - char phoneBuf[1001]; - ifs.getline(phoneBuf, 1000); -+ for(int i=0;i<1000;i++) -+ if(phoneBuf[i]=='\t' || phoneBuf[i]==0) -+ { // ignore everything after a in the phone number -+ phoneBuf[i]=0; -+ break; -+ } - string text; - while (! ifs.eof()) - { -@@ -252,17 +293,51 @@ - submitSMS->setStatusReportRequest(requestStatusReport); - Address destAddr(phoneNumber); - submitSMS->setDestinationAddress(destAddr); -- if (concatenatedMessageId == -1) -- me->sendSMSs(submitSMS, text, true); -- else -+ try - { -- // maximum for concatenatedMessageId is 255 -- if (concatenatedMessageId > 256) -- concatenatedMessageId = 0; -- me->sendSMSs(submitSMS, text, false, concatenatedMessageId++); -+ if (concatenatedMessageId == -1) -+ me->sendSMSs(submitSMS, text, true); -+ else -+ { -+ // maximum for concatenatedMessageId is 255 -+ if (concatenatedMessageId > 256) -+ concatenatedMessageId = 0; -+ me->sendSMSs(submitSMS, text, false, concatenatedMessageId++); -+ } -+#ifndef WIN32 -+ if (enableSyslog) -+ syslog(LOG_NOTICE, "Sent SMS to %s from file %s", phoneBuf, filename.c_str()); -+#endif -+ if (sentDirBase != "") { -+#ifdef WIN32 -+ string sentfilename = sentDir + "\\" + fileInfo.name; -+#else -+ string sentfilename = sentDir + "/" + entry->d_name; -+#endif -+ rename(filename.c_str(),sentfilename.c_str()); -+ } else { -+ unlink(filename.c_str()); -+ } -+ } -+ catch (GsmException &me) -+ { -+#ifndef WIN32 -+ if (enableSyslog) -+ syslog(LOG_WARNING, "Failed sending SMS to %s from file %s: %s", phoneBuf, -+ filename.c_str(), me.what()); -+ else -+#endif -+ cerr << "Failed sending SMS to " << phoneBuf << " from " -+ << filename << ": " << me.what() << endl; -+ if (failedDirBase != "") { -+#ifdef WIN32 -+ string failedfilename = failedDir + "\\" + fileInfo.name; -+#else -+ string failedfilename = failedDir + "/" + entry->d_name; -+#endif -+ rename(filename.c_str(),failedfilename.c_str()); -+ } - } -- -- unlink(filename.c_str()); - #ifdef WIN32 - } - moreFiles = _findnext(fileHandle, &fileInfo) == 0; -@@ -276,10 +351,18 @@ - } - } - -+#ifndef WIN32 -+void syslogExit(int exitcode, int *dummy) -+{ -+ syslog(LOG_NOTICE, "exited (exit %d)",exitcode); -+} -+#endif -+ - // *** main program - - int main(int argc, char *argv[]) - { -+ bool enableSyslog = false; - try - { - string device = "/dev/mobilephone"; -@@ -291,13 +374,16 @@ - bool flushSMS = false; - bool onlyReceptionIndication = true; - string spoolDir; -+ string sentDir = ""; -+ string failedDir = ""; -+ unsigned int priorities = 0; - string initString = DEFAULT_INIT_STRING; - bool swHandshake = false; - string concatenatedMessageIdStr; - - int opt; - int dummy; -- while((opt = getopt_long(argc, argv, "c:C:I:t:fd:a:b:hvs:XDr", -+ while((opt = getopt_long(argc, argv, "c:C:I:t:fd:a:b:hvs:S:F:P:LXDr", - longOpts, &dummy)) != -1) - switch (opt) - { -@@ -328,6 +414,18 @@ - case 's': - spoolDir = optarg; - break; -+ case 'L': -+ enableSyslog = true; -+ break; -+ case 'S': -+ sentDir = optarg; -+ break; -+ case 'F': -+ failedDir = optarg; -+ break; -+ case 'P': -+ priorities = abs(atoi(optarg)); -+ break; - case 'f': - flushSMS = true; - break; -@@ -360,11 +458,21 @@ - << _(" -d, --device sets the device to connect to") << endl - << _(" -D, --direct enable direct routing of SMSs") << endl - << _(" -f, --flush flush SMS from store") << endl -+ << _(" -F, --failed directory to move failed SMS to,") << endl -+ << _(" if unset, the SMS will be deleted") << endl - << _(" -h, --help prints this message") << endl - << _(" -I, --init device AT init sequence") << endl -+#ifndef WIN32 -+ << _(" -L, --syslog log errors and information to syslog") -+ << endl -+#endif -+ << _(" -P, --priorities number of priority levels to use,") << endl -+ << _(" (default: none)") << endl - << _(" -r, --requeststat request SMS status report") << endl - << _(" -s, --spool spool directory for outgoing SMS") - << endl -+ << _(" -S, --sent directory to move sent SMS to,") << endl -+ << _(" if unset, the SMS will be deleted") << endl - << _(" -t, --store name of SMS store to use for flush\n" - " and/or temporary SMS storage") << endl - << endl -@@ -380,6 +488,14 @@ - << endl << endl - << _(" default is \"sms cb stat\"") << endl << endl - << _("If no action is given, the SMS is printed to stdout") -+ << endl << endl -+ << _("If -P is given, it activates the priority system and sets the") << endl -+ << _("number or levels to use. For every level, there must be directories") << endl -+ << _("named +.") << endl -+ << _("For example \"-P 2 -s queue -S send -F failed\" needs the following") <getAt()); -+ sendSMS(spoolDir, sentDir, failedDir, priorities, enableSyslog, me->getAt()); - } - } - catch (GsmException &ge) ---- gsmlib-1.10.orig/gsmlib/gsm_unix_serial.cc -+++ gsmlib-1.10/gsmlib/gsm_unix_serial.cc -@@ -20,12 +20,14 @@ - #include - #include - #include -+#include - #include - #include - #include - #include - #include - #include -+#include - - using namespace std; - using namespace gsmlib; -@@ -131,7 +133,7 @@ - { - int res = read(_fd, &c, 1); - if (res != 1) -- return -1; -+ throwModemException(_("end of file when reading from TA")); - else - readDone = true; - break; -@@ -178,11 +180,15 @@ - - // switch off non-blocking mode - int fdFlags; -- if ((fdFlags = fcntl(_fd, F_GETFL)) == -1) -+ if ((fdFlags = fcntl(_fd, F_GETFL)) == -1) { -+ close(_fd); - throwModemException(_("getting file status flags failed")); -+ } - fdFlags &= ~O_NONBLOCK; -- if (fcntl(_fd, F_SETFL, fdFlags) == -1) -+ if (fcntl(_fd, F_SETFL, fdFlags) == -1) { -+ close(_fd); - throwModemException(_("switching of non-blocking mode failed")); -+ } - - long int saveTimeoutVal = _timeoutVal; - _timeoutVal = 3; -@@ -194,17 +200,22 @@ - - // toggle DTR to reset modem - int mctl = TIOCM_DTR; -- if (ioctl(_fd, TIOCMBIC, &mctl) < 0) -+ if (ioctl(_fd, TIOCMBIC, &mctl) < 0) { -+ close(_fd); - throwModemException(_("clearing DTR failed")); -+ } - // the waiting time for DTR toggling is increased with each loop - usleep(holdoff[initTries]); -- if (ioctl(_fd, TIOCMBIS, &mctl) < 0) -+ if (ioctl(_fd, TIOCMBIS, &mctl) < 0) { -+ close(_fd); - throwModemException(_("setting DTR failed")); -- -+ } - // get line modes -- if (tcgetattr(_fd, &t) < 0) -+ if (tcgetattr(_fd, &t) < 0) { -+ close(_fd); - throwModemException(stringPrintf(_("tcgetattr device '%s'"), - device.c_str())); -+ } - - // set line speed - cfsetispeed(&t, lineSpeed); -@@ -229,9 +240,11 @@ - t.c_cc[VSUSP] = 0; - - // write back -- if(tcsetattr (_fd, TCSANOW, &t) < 0) -+ if(tcsetattr (_fd, TCSANOW, &t) < 0) { -+ close(_fd); - throwModemException(stringPrintf(_("tcsetattr device '%s'"), - device.c_str())); -+ } - // the waiting time for writing to the ME/TA is increased with each loop - usleep(holdoff[initTries]); - -@@ -279,11 +292,14 @@ - catch (GsmException &e) - { - _timeoutVal = saveTimeoutVal; -- if (initTries == 0) -+ if (initTries == 0) { -+ close(_fd); - throw e; -+ } - } - } - // no response after 3 tries -+ close(_fd); - throw GsmException(stringPrintf(_("reset modem failed '%s'"), - device.c_str()), OtherError); - } ---- gsmlib-1.10.orig/gsmlib/gsm_me_ta.cc -+++ gsmlib-1.10/gsmlib/gsm_me_ta.cc -@@ -19,6 +19,8 @@ - #include - #include - -+#include -+ - using namespace std; - using namespace gsmlib; - ---- gsmlib-1.10.orig/gsmlib/gsm_sorted_phonebook.cc -+++ gsmlib-1.10/gsmlib/gsm_sorted_phonebook.cc -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - const int MAX_LINE_SIZE = 1000; - ---- gsmlib-1.10.orig/gsmlib/gsm_sms_codec.cc -+++ gsmlib-1.10/gsmlib/gsm_sms_codec.cc -@@ -23,6 +23,7 @@ - #ifdef HAVE_STRING_H - #include - #endif -+#include - #include - using namespace std; - using namespace gsmlib; ---- gsmlib-1.10.orig/gsmlib/gsm_at.cc -+++ gsmlib-1.10/gsmlib/gsm_at.cc -@@ -106,11 +106,27 @@ - putLine("AT" + atCommand); - // and gobble up CR/LF (and possibly echoed characters if echo can't be - // switched off) -+ // Also, some mobiles (e.g., Sony Ericsson K800i) respond to commands -+ // like "at+cmgf=0" with "+CMGF: 0" on success as well as the "OK" -+ // status -- so gobble that (but not if that sort of response was expected) -+ // FIXME: this is a gross hack, should be done via capabilities or sth -+ #include -+ string::size_type loc = atCommand.find( "=", 1 ); -+ string expect; -+ if (loc != string::npos) { -+ expect = atCommand; -+ expect.replace(loc, 1, " "); -+ expect.insert(loc, ":"); -+ } else { -+ expect = ""; -+ } - do - { - s = normalize(getLine()); - } -- while (s.length() == 0 || s == "AT" + atCommand); -+ while (s.length() == 0 || s == "AT" + atCommand || -+ ((response.length() == 0 || !matchResponse(s, response)) && -+ (expect.length() > 0 && matchResponse(s, expect)))); - - // handle errors - if (matchResponse(s, "+CME ERROR:") || matchResponse(s, "+CMS ERROR:")) ---- gsmlib-1.10.orig/gsmlib/gsm_map_key.h -+++ gsmlib-1.10/gsmlib/gsm_map_key.h -@@ -27,6 +27,7 @@ - - template class MapKey - { -+ public: - SortedStore &_myStore; // my store - // different type keys - Address _addressKey; -@@ -45,6 +46,7 @@ - MapKey(SortedStore &myStore, string key) : - _myStore(myStore), _strKey(key) {} - -+/* - friend - bool operator< - #ifndef WIN32 -@@ -59,6 +61,7 @@ - #endif - (const MapKey &x, - const MapKey &y); -+*/ - }; - - // compare two keys -@@ -72,7 +75,7 @@ - // MapKey members - - template -- bool gsmlib::operator<(const MapKey &x, -+ bool operator<(const MapKey &x, - const MapKey &y) - { - assert(&x._myStore == &y._myStore); -@@ -97,7 +100,7 @@ - } - - template -- bool gsmlib::operator==(const MapKey &x, -+ bool operator==(const MapKey &x, - const MapKey &y) - { - assert(&x._myStore == &y._myStore); ---- gsmlib-1.10.orig/gsmlib/gsm_me_ta.h -+++ gsmlib-1.10/gsmlib/gsm_me_ta.h -@@ -291,8 +291,8 @@ - // 3 disable phone receive RF circuits only - // 4 disable phone both transmit and receive RF circuits - // 5...127 implementation-defined -- int MeTa::getFunctionalityLevel() throw(GsmException); -- void MeTa::setFunctionalityLevel(int level) throw(GsmException); -+ int getFunctionalityLevel() throw(GsmException); -+ void setFunctionalityLevel(int level) throw(GsmException); - - // return battery charge status (+CBC): - // 0 ME is powered by the battery -@@ -386,13 +386,13 @@ - void setCallWaitingLockStatus(FacilityClass cl, - bool lock)throw(GsmException); - -- void MeTa::setCLIRPresentation(bool enable) throw(GsmException); -+ void setCLIRPresentation(bool enable) throw(GsmException); - //(+CLIR) - - // 0:according to the subscription of the CLIR service - // 1:CLIR invocation - // 2:CLIR suppression -- int MeTa::getCLIRPresentation() throw(GsmException); -+ int getCLIRPresentation() throw(GsmException); - - friend class Phonebook; - friend class SMSStore; ---- gsmlib-1.10.orig/gsmlib/gsm_util.cc -+++ gsmlib-1.10/gsmlib/gsm_util.cc -@@ -35,6 +35,7 @@ - #define __USE_GNU - #define _GNU_SOURCE - #endif -+#include - #include - #include - ---- gsmlib-1.10.orig/intl/Makefile -+++ gsmlib-1.10/intl/Makefile -@@ -0,0 +1,214 @@ -+# Makefile for directory with message catalog handling in GNU NLS Utilities. -+# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. -+# -+# 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, 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. -+ -+PACKAGE = gsmlib -+VERSION = 1.10 -+ -+SHELL = /bin/sh -+ -+srcdir = . -+top_srcdir = .. -+top_builddir = .. -+ -+ -+prefix = /usr -+exec_prefix = ${prefix} -+transform = s,x,x, -+libdir = $(exec_prefix)/lib -+includedir = $(prefix)/include -+datadir = $(prefix)/share -+localedir = $(datadir)/locale -+gnulocaledir = $(prefix)/share/locale -+gettextsrcdir = ${prefix}/share/gettext/intl -+aliaspath = $(localedir):. -+subdir = intl -+ -+INSTALL = /usr/bin/install -c -+INSTALL_DATA = ${INSTALL} -m 644 -+MKINSTALLDIRS = $(top_builddir)/scripts/mkinstalldirs -+ -+l = @l@ -+ -+AR = ar -+CC = i486-linux-gnu-gcc -+LIBTOOL = $(SHELL) $(top_builddir)/libtool -+RANLIB = ranlib -+ -+DEFS = -DGNULOCALEDIR=\"$(gnulocaledir)\" \ -+-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" -DHAVE_CONFIG_H -+CPPFLAGS = -+CFLAGS = -D_REENTRANT -g -O2 -+LDFLAGS = -+ -+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) -+ -+HEADERS = $(COMHDRS) libgettext.h loadinfo.h -+COMHDRS = gettext.h gettextP.h hash-string.h -+SOURCES = $(COMSRCS) intl-compat.c cat-compat.c -+COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ -+finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ -+explodename.c -+OBJECTS = bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ -+finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ -+explodename.$lo -+CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo -+GETTOBJS = intl-compat.$lo -+DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \ -+xopen-msg.sed $(HEADERS) $(SOURCES) -+DISTFILES.normal = VERSION -+DISTFILES.gettext = libintl.glibc intlh.inst.in -+ -+.SUFFIXES: -+.SUFFIXES: .c .o .lo -+.c.o: -+ $(COMPILE) $< -+.c.lo: -+ $(LIBTOOL) --mode=compile $(COMPILE) $< -+ -+INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib -+ -+all: all-no -+ -+all-yes: libintl.$la intlh.inst -+all-no: -+ -+libintl.a: $(OBJECTS) -+ rm -f $@ -+ $(AR) cru $@ $(OBJECTS) -+ $(RANLIB) $@ -+ -+libintl.la: $(OBJECTS) -+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \ -+ -version-info 1:0 -rpath $(libdir) -+ -+../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot -+ cd ../po && $(MAKE) cat-id-tbl.$lo -+ -+check: all -+ -+# This installation goal is only used in GNU gettext. Packages which -+# only use the library should use install instead. -+ -+# We must not install the libintl.h/libintl.a files if we are on a -+# system which has the gettext() function in its C library or in a -+# separate library or use the catgets interface. A special case is -+# where configure found a previously installed GNU gettext library. -+# If you want to use the one which comes with this version of the -+# package, you have to use `configure --with-included-gettext'. -+install: install-exec install-data -+install-exec: all -+ if test "$(PACKAGE)" = "gettext" \ -+ && test '' = '$(GETTOBJS)'; then \ -+ if test -r $(MKINSTALLDIRS); then \ -+ $(MKINSTALLDIRS) $(libdir) $(includedir); \ -+ else \ -+ $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \ -+ fi; \ -+ $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \ -+ $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \ -+ else \ -+ : ; \ -+ fi -+install-data: all -+ if test "$(PACKAGE)" = "gettext"; then \ -+ if test -r $(MKINSTALLDIRS); then \ -+ $(MKINSTALLDIRS) $(gettextsrcdir); \ -+ else \ -+ $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ -+ fi; \ -+ $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \ -+ dists="$(DISTFILES.common)"; \ -+ for file in $$dists; do \ -+ $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \ -+ done; \ -+ else \ -+ : ; \ -+ fi -+ -+# Define this as empty until I found a useful application. -+installcheck: -+ -+uninstall: -+ dists="$(DISTFILES.common)"; \ -+ for file in $$dists; do \ -+ rm -f $(gettextsrcdir)/$$file; \ -+ done -+ -+info dvi: -+ -+$(OBJECTS): ../gsm_config.h libgettext.h -+bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h -+dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h -+ -+tags: TAGS -+ -+TAGS: $(HEADERS) $(SOURCES) -+ here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) -+ -+id: ID -+ -+ID: $(HEADERS) $(SOURCES) -+ here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) -+ -+ -+mostlyclean: -+ rm -f *.a *.o *.lo core core.* -+ -+clean: mostlyclean -+ -+distclean: clean -+ rm -f Makefile ID TAGS po2msg.sed po2tbl.sed -+ -+maintainer-clean: distclean -+ @echo "This command is intended for maintainers to use;" -+ @echo "it deletes files that may require special tools to rebuild." -+ -+ -+# GNU gettext needs not contain the file `VERSION' but contains some -+# other files which should not be distributed in other packages. -+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -+dist distdir: Makefile $(DISTFILES) -+ if test "$(PACKAGE)" = gettext; then \ -+ additional="$(DISTFILES.gettext)"; \ -+ else \ -+ additional="$(DISTFILES.normal)"; \ -+ fi; \ -+ for file in $(DISTFILES.common) $$additional; do \ -+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ -+ || cp -p $(srcdir)/$$file $(distdir); \ -+ done -+ -+dist-libc: -+ tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc -+ -+Makefile: Makefile.in ../config.status -+ cd .. \ -+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -+ -+# The dependency for intlh.inst is different in gettext and all other -+# packages. Because we cannot you GNU make features we have to solve -+# the problem while rewriting Makefile.in. -+@GT_YES@intlh.inst: intlh.inst.in ../config.status -+@GT_YES@ cd .. \ -+@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \ -+@GT_YES@ $(SHELL) ./config.status -+@GT_NO@.PHONY: intlh.inst -+@GT_NO@intlh.inst: -+ -+# Tell versions [3.59,3.63) of GNU make not to export all variables. -+# Otherwise a system limit (for SysV at least) may be exceeded. -+.NOEXPORT: ---- gsmlib-1.10.orig/po/cat-id-tbl.c -+++ gsmlib-1.10/po/cat-id-tbl.c -@@ -1,435 +0,0 @@ --/* Automatically generated by po2tbl.sed from gsmlib.pot. */ -- --#if HAVE_CONFIG_H --# include --#endif -- --#include "libgettext.h" -- --const struct _msg_ent _msg_tbl[] = { -- {"", 1}, -- {"could not execute '%s'", 2}, -- {"error writing to '%s'", 3}, -- {"error when calling opendir('%s')(errno: %d/%s)", 4}, -- {"count not open SMS spool file %s", 5}, -- {": version %s [compiled %s]", 6}, -- {"\ --: [-a action][-b baudrate][-C sca][-d device][-f][-h][-I init string]\n\ -- [-s spool dir][-t][-v]{sms_type}", 7}, -- {"\ -- -a, --action the action to execute when an SMS arrives\n\ -- (SMS is send to stdin of action)", 8}, -- {" -b, --baudrate baudrate to use for device (default: 38400)", 9}, -- {" -c, --concatenate start ID for concatenated SMS messages", 10}, -- {" -C, --sca SMS service centre address", 11}, -- {" -d, --device sets the device to connect to", 12}, -- {" -D, --direct enable direct routing of SMSs", 13}, -- {" -f, --flush flush SMS from store", 14}, -- {" -h, --help prints this message", 15}, -- {" -I, --init device AT init sequence", 16}, -- {" -r, --requeststat request SMS status report", 17}, -- {" -s, --spool spool directory for outgoing SMS", 18}, -- {"\ -- -t, --store name of SMS store to use for flush\n\ -- and/or temporary SMS storage", 19}, -- {" -v, --version prints version and exits", 20}, -- {" -X, --xonxoff switch on software handshake", 21}, -- {" sms_type may be any combination of", 22}, -- {" sms, no_sms controls reception of normal SMS", 23}, -- {" cb, no_cb controls reception of cell broadcast messages", 24}, -- {" stat, no_stat controls reception of status reports", 25}, -- {" default is \"sms cb stat\"", 26}, -- {"If no action is given, the SMS is printed to stdout", 27}, -- {"unknown option", 28}, -- {"error when calling sigaction() (errno: %d/%s)", 29}, -- {"store name must be given for flush option", 30}, -- {"Type of message: ", 31}, -- {"SMS message\n", 32}, -- {"submit report message\n", 33}, -- {"status report message\n", 34}, -- {"cell broadcast message\n", 35}, -- {"[ERROR]: ", 36}, -- {"(try setting sms_type, please refer to gsmsmsd manpage)", 37}, -- {"\ --: [-b baudrate][-c concatenatedID][-C sca][-d device][-h][-I init string]\n\ -- [-t][-v][-X] phonenumber [text]", 38}, -- {" -c, --concatenate ID for concatenated SMS messages", 39}, -- {" -d, --device sets the destination device to connect to", 40}, -- {"\ -- -t, --test convert text to GSM alphabet and vice\n\ -- versa, no SMS message is sent", 41}, -- {" phonenumber recipient's phone number", 42}, -- {"\ -- text optional text of the SMS message\n\ -- if omitted: read from stdin", 43}, -- {"phone number and text missing", 44}, -- {"more than two parameters given", 45}, -- {"text is larger than 160 characters", 46}, -- {"inserting '%s' tel# %s", 47}, -- {" (index #%d)", 48}, -- {"updating '%s' tel# %s to new tel# %s", 49}, -- {"updating '%s' tel# %s to new tel# %s(index %d)", 50}, -- {"deleting '%s' tel# %s", 51}, -- {"\ --: [-b baudrate][-c][-d device or file][-h][-I init string]\n\ -- [-p phonebook name][-s device or file][-t charset][-v][-V][-y][-X]", 52}, -- {" -c, --copy copy source entries to destination", 53}, -- {"\ -- -d, --destination sets the destination device to connect \n\ -- to, or the file to write", 54}, -- {" -D, --destination-backend sets the destination backend", 55}, -- {" -i, --index takes index positions into account", 56}, -- {" -p, --phonebook name of phonebook to use", 57}, -- {"\ -- -s, --source sets the source device to connect to,\n\ -- or the file to read", 58}, -- {"\ -- -t, --charset sets the character set to use for\n\ -- phonebook entries", 59}, -- {" -S, --source-backend sets the source backend", 60}, -- {" -V, --verbose print detailed progress messages", 61}, -- {"\ -- -y, --synchronize synchronize destination with source\n\ -- entries (destination is overwritten)\n\ -- (see gsmpb(1) for details)", 62}, -- {"both source and destination must be given", 63}, -- {"phonebook name must be given", 64}, -- {"\ --text '%s' is too large to fit into destination (maximum size %d characters)", 65}, -- {"\ --phone number '%s' is too large to fit into destination (maximum size %d \ --characters)", 66}, -- {"active ", 67}, -- {"inactive ", 68}, -- {"number: ", 69}, -- {" subaddr: ", 70}, -- {" time: ", 71}, -- {" Manufacturer: ", 72}, -- {" Model: ", 73}, -- {" Revision: ", 74}, -- {" Serial Number: ", 75}, -- {" Functionality Level: ", 76}, -- {"unsupported", 77}, -- {"> Status: ", 78}, -- {"unknown", 79}, -- {"current", 80}, -- {"available", 81}, -- {"forbidden", 82}, -- {" Long name: '", 83}, -- {" Short name: '", 84}, -- {" Numeric name: ", 85}, -- {" Mode: ", 86}, -- {"automatic", 87}, -- {"manual", 88}, -- {"deregister", 89}, -- {"manual/automatic", 90}, -- {" Voice", 91}, -- {" unknown", 92}, -- {" Data", 93}, -- {" Fax", 94}, -- {"on", 95}, -- {"off", 96}, -- {"UnconditionalReason", 97}, -- {"MobileBusyReason", 98}, -- {"NoReplyReason", 99}, -- {"NotReachableReason", 100}, -- {"0 ME is powered by the battery", 101}, -- {"1 ME has a battery connected, but is not powered by it", 102}, -- {"2 ME does not have a battery connected", 103}, -- {"3 Recognized power fault, calls inhibited", 104}, -- {"unknown facility class parameter '%c'", 105}, -- {"not enough parameters, minimum number of parameters is %d", 106}, -- {"too many parameters, maximum number of parameters is %d", 107}, -- {"\ --: [-b baudrate][-d device][-h][-I init string][-o operation]\n\ -- [-v][-X]{parameters}", 108}, -- {"\ -- -o, --operation operation to perform on the mobile \n\ -- phone with the specified parameters", 109}, -- {"\ -- parameters parameters to use for the operation\n\ -- (if an operation is given) or\n\ -- a specification which kind of\n\ -- information to read from the mobile phone", 110}, -- {"\ --Refer to gsmctl(1) for details on the available parameters and operations.", 111}, -- {"unknown information parameter '%s'", 112}, -- {"unknown opmode parameter '%s'", 113}, -- {"unknown forward reason parameter '%s'", 114}, -- {"unknown forward mode parameter '%s'", 115}, -- {"unknown operation '%s'", 116}, -- {"inserting entry #%d from source into destination", 117}, -- {"incompatible options '%c' and '%c'", 118}, -- {"\ --: [-a][-b baudrate][-c][-C sca][-d device or file]\n\ -- [-h][-I init string][-k][-l][-s device or file][-t SMS store name]\n\ -- [-v][-V][-x][-X]{indices}|[phonenumber text]", 119}, -- {"\ -- -a, --add add new SMS submit message\n\ -- (phonenumber and text) to destination", 120}, -- {"\ -- -c, --copy copy source entries to destination\n\ -- (if indices are given, copy only these entries)", 121}, -- {"\ -- -d, --destination sets the destination device to\n\ -- connect to, or the file to write to", 122}, -- {"\ -- -k, --backup backup new entries to destination\n\ -- (if indices are given, copy only these entries)", 123}, -- {" -l, --list list source to stdout", 124}, -- {" -t, --store name of SMS store to use", 125}, -- {" -x, --delete delete entries denoted by indices", 126}, -- {"no operation option given", 127}, -- {"both source and destination required", 128}, -- {"destination must not be given", 129}, -- {"source required", 130}, -- {"source must not be given", 131}, -- {"destination required", 132}, -- {"expected number, got '%s'", 133}, -- {"not enough parameters given", 134}, -- {"unexpected parameters", 135}, -- {"store name must be given", 136}, -- {"no index '%s' in source", 137}, -- {"index #%d", 138}, -- {"inserting new entry into destination", 139}, -- {"deleting entry #%d from destination", 140}, -- {"no index '%s' in destination", 141}, -- {"unspecified ME/TA error", 142}, -- {"ME/TA error '", 143}, -- {"(code %s)", 144}, -- {"ME/TA error '' (code not known)", 145}, -- {"unexpected response '%s' when sending 'AT%s'", 146}, -- {"unexpected character in PDU handshake", 147}, -- {"phone failure", 148}, -- {"no connection to phone", 149}, -- {"phone adaptor link reserved", 150}, -- {"operation not allowed", 151}, -- {"operation not supported", 152}, -- {"ph SIM PIN required", 153}, -- {"SIM not inserted", 154}, -- {"SIM PIN required", 155}, -- {"SIM PUK required", 156}, -- {"SIM failure", 157}, -- {"SIM busy", 158}, -- {"SIM wrong", 159}, -- {"incorrect password", 160}, -- {"SIM PIN2 required", 161}, -- {"SIM PUK2 required", 162}, -- {"memory full", 163}, -- {"invalid index", 164}, -- {"not found", 165}, -- {"memory failure", 166}, -- {"text string too long", 167}, -- {"invalid characters in text string", 168}, -- {"dial string too long", 169}, -- {"invalid characters in dial string", 170}, -- {"no network service", 171}, -- {"network timeout", 172}, -- {"invalid ME error %d", 173}, -- {"Unassigned (unallocated) number", 174}, -- {"Operator determined barring", 175}, -- {"Call barred", 176}, -- {"Network failure", 177}, -- {"Short message transfer rejected", 178}, -- {"Congestion", 179}, -- {"Destination out of service", 180}, -- {"Unidentified subscriber", 181}, -- {"Facility rejected", 182}, -- {"Unknown subscriber", 183}, -- {"Network out of order", 184}, -- {"Temporary failure", 185}, -- {"Resources unavailable, unspecified", 186}, -- {"Requested facility not subscribed", 187}, -- {"Requested facility not implemented", 188}, -- {"Invalid Transaction Identifier", 189}, -- {"Semantically incorrect message", 190}, -- {"Invalid mandatory information", 191}, -- {"Message type non-existent or not implemented", 192}, -- {"Message not compatible with short message protocol state", 193}, -- {"Information element non-existent or not implemented", 194}, -- {"Protocol error, unspecified", 195}, -- {"Interworking, unspecified", 196}, -- {"Telematic interworking not supported", 197}, -- {"Short message Type 0 not supported", 198}, -- {"Cannot replace short message", 199}, -- {"Unspecified TP-PID error", 200}, -- {"Data coding scheme (alphabet) not supported", 201}, -- {"Message class not supported", 202}, -- {"Unspecifiec TP-DCS error", 203}, -- {"Command cannot be actioned", 204}, -- {"Command unsupported", 205}, -- {"Unspecified TP-Command error", 206}, -- {"TPDU not supported", 207}, -- {"SC busy", 208}, -- {"No SC subscription", 209}, -- {"SC system failure", 210}, -- {"Invalid SME address", 211}, -- {"Destination SME barred", 212}, -- {"SM Rejected-Duplicated SM", 213}, -- {"SIM SMS storage full", 214}, -- {"No SMS storage capability in SIM", 215}, -- {"Error in MS", 216}, -- {"Memory Capacity Exceed", 217}, -- {"Unspecified error cause", 218}, -- {"ME failure", 219}, -- {"SMS service of ME reserved", 220}, -- {"invalid PDU mode parameter", 221}, -- {"invalid text mode parameter", 222}, -- {"PH-SIM PIN required", 223}, -- {"invalid memory index", 224}, -- {"SMSC address unknown", 225}, -- {"no +CNMA acknowledgement expected", 226}, -- {"unknown error", 227}, -- {"invalid SMS error %d", 228}, -- {"Short message received by the SME", 229}, -- {"\ --Short message forwarded by the SC to the SME but the SC is unable to confirm \ --delivery", 230}, -- {"Short message replaced by the SC", 231}, -- {"reserved", 232}, -- {"SME busy", 233}, -- {"No response from SME", 234}, -- {"Service rejected", 235}, -- {"Quality of service not available", 236}, -- {"Error in SME", 237}, -- {" (Temporary error, SC is not making any more transfer attempts)", 238}, -- {" (Temporary error, SC still trying to transfer SM)", 239}, -- {"Remote Procedure Error", 240}, -- {"Incompatible destination", 241}, -- {"Connection rejected by SME", 242}, -- {"Not obtainable", 243}, -- {"No interworking available", 244}, -- {"SM validity period expired", 245}, -- {"SM deleted by originating SME", 246}, -- {"SM deleted by SC administration", 247}, -- {"SM does not exit", 248}, -- {" (Permanent Error, SC is not making any more transfer attempts)", 249}, -- {"unexpected number format %d", 250}, -- {"unexpected unsolicited event '%s'", 251}, -- {"unable to set operator", 252}, -- {"call forward time must be in the range 0..30", 253}, -- {"Functionality Level commands not supported by ME", 254}, -- {"Requested Functionality Level out of range", 255}, -- {"unsupported alphabet for SMS", 256}, -- {"SMS text is larger than allowed", 257}, -- {"not more than 255 concatenated SMSs allowed", 258}, -- {"only serviceLevel 0 or 1 supported", 259}, -- {"cannot route SMS messages to TE", 260}, -- {"cannot route cell broadcast messages to TE", 261}, -- {"cannot route status reports messages to TE", 262}, -- {"cannot route status report messages to TE", 263}, -- {"expected parameter", 264}, -- {"expected '\"'", 265}, -- {"expected number", 266}, -- {"unexpected end of string '%s'", 267}, -- {" (at position %d of string '%s')", 268}, -- {"expected '%c'", 269}, -- {"expected ')' or ','", 270}, -- {"expected ')', ',' or '-'", 271}, -- {"range of the form a-b-c not allowed", 272}, -- {"range of the form a- no allowed", 273}, -- {"expected comma", 274}, -- {"expected end of line", 275}, -- {"\ --length of text '%s' exceeds maximum text length (%d characters) of phonebook \ --'%s'", 276}, -- {"\ --length of telephone number '%s' exceeds maximum telephone number length (%d \ --characters) of phonebook '%s'", 277}, -- {"phonebook full", 278}, -- {"attempt to overwrite phonebook entry", 279}, -- {"SIM card changed while accessing phonebook", 280}, -- {"unhandled SMS TPDU type", 281}, -- {"can only send SMS-SUBMIT and SMS-COMMAND TPDUs", 282}, -- {"no device given for sending SMS", 283}, -- {"Message type: SMS-DELIVER", 284}, -- {"SC address: '", 285}, -- {"More messages to send: ", 286}, -- {"Reply path: ", 287}, -- {"User data header indicator: ", 288}, -- {"Status report indication: ", 289}, -- {"Originating address: '", 290}, -- {"Protocol identifier: 0x", 291}, -- {"Data coding scheme: ", 292}, -- {"SC timestamp: ", 293}, -- {"User data length: ", 294}, -- {"User data header: 0x", 295}, -- {"User data: '", 296}, -- {"Message type: SMS-SUBMIT", 297}, -- {"Reject duplicates: ", 298}, -- {"Validity period format: ", 299}, -- {"not present", 300}, -- {"relative", 301}, -- {"absolute", 302}, -- {"Status report request: ", 303}, -- {"Message reference: ", 304}, -- {"Destination address: '", 305}, -- {"Validity period: ", 306}, -- {"Message type: SMS-STATUS-REPORT", 307}, -- {"Status report qualifier: ", 308}, -- {"Recipient address: '", 309}, -- {"Discharge time: ", 310}, -- {"Status: 0x", 311}, -- {"Message type: SMS-COMMAND", 312}, -- {"Command type: 0x", 313}, -- {"Message number: ", 314}, -- {"Command data length: ", 315}, -- {"Command data: '", 316}, -- {"Message type: SMS-DELIVER-REPORT", 317}, -- {"Protocol identifier present: ", 318}, -- {"Data coding scheme present: ", 319}, -- {"User data length present: ", 320}, -- {"Message type: SMS-SUBMIT-REPORT", 321}, -- {" minutes", 322}, -- {" days", 323}, -- {" weeks", 324}, -- {"compressed ", 325}, -- {"voicemail message waiting", 326}, -- {"fax message waiting", 327}, -- {"electronic mail message waiting", 328}, -- {"other message waiting", 329}, -- {"default alphabet", 330}, -- {"8-bit alphabet", 331}, -- {"16-bit alphabet", 332}, -- {"reserved alphabet", 333}, -- {"bad hexadecimal PDU format", 334}, -- {"premature end of PDU", 335}, -- {"unknown time period format", 336}, -- {"interrupted when reading from TA", 337}, -- {"reading from TA", 338}, -- {"timeout when reading from TA", 339}, -- {"opening device '%s'", 340}, -- {"getting file status flags failed", 341}, -- {"switching of non-blocking mode failed", 342}, -- {"clearing DTR failed", 343}, -- {"setting DTR failed", 344}, -- {"tcgetattr device '%s'", 345}, -- {"tcsetattr device '%s'", 346}, -- {"reset modem failed '%s'", 347}, -- {"interrupted when writing to TA", 348}, -- {"writing to TA", 349}, -- {"timeout when writing to TA", 350}, -- {"unknown baudrate '%s'", 351}, -- {"error when calling stat('%s') (errno: %d/%s)", 352}, -- {"file '%s' is neither file nor character device", 353}, -- {"maxmimum number of symbolic links exceeded", 354}, -- {"error renaming '%s' to '%s'", 355}, -- {"text '%s' contains illegal character '\"'", 356}, -- {"illegal character in telephone number '%s'", 357}, -- {"error reading from file '%s", 358}, -- {"entry '%s' lacks index", 359}, -- {"line '%s' has invalid format", 360}, -- {"error opening file '%s' for writing", 361}, -- {"", 362}, -- {"error writing to file '%s'", 363}, -- {"attempt to change phonebook read from ", 364}, -- {"cannot open file '%s'", 365}, -- {"", 366}, -- {"indices must be unique in phonebook", 367}, -- {"error reading from file '%s'", 368}, -- {"file '%s' has wrong version", 369}, -- {"corrupt SMS store file '%s'", 370}, -- {"attempt to change SMS store read from ", 371}, --}; -- --int _msg_tbl_length = 371; ---- gsmlib-1.10.orig/po/de.po -+++ gsmlib-1.10/po/de.po -@@ -233,7 +233,7 @@ - - #: apps/gsmsendsms.cc:171 - msgid " phonenumber recipient's phone number" --msgstr " Telefonummer die Telefonnumer des Empfängers" -+msgstr " Telefonummer die Telefonnummer des Empfängers" - - #: apps/gsmsendsms.cc:172 - msgid "" -@@ -295,7 +295,7 @@ - - #: apps/gsmpb.cc:325 - msgid " -c, --copy copy source entries to destination" --msgstr " -c, --copy kopiere Quell-Enträge zum Zielgerät/-datei" -+msgstr " -c, --copy kopiere Quell-Einträge zum Zielgerät/-datei" - - #: apps/gsmpb.cc:327 - msgid "" -@@ -626,14 +626,14 @@ - msgstr "" - ": [-a][-b Baud-Rate][-c][-C sca][-d Gerät oder Datei]\n" - " [-h][-I Init String][-k][-l][-s Gerät oder Datei][-t SMS Speichername]\n" --" [-v][-V][-x][-X]{Indices}|[Telefonnumer Text]" -+" [-v][-V][-x][-X]{Indices}|[Telefonnummer Text]" - - #: apps/gsmsmsstore.cc:191 - msgid "" - " -a, --add add new SMS submit message\n" - " (phonenumber and text) to destination" - msgstr "" --" -a, --add füge neue SMS-Submit-Nachricht (Telefonnumer und\n" -+" -a, --add füge neue SMS-Submit-Nachricht (Telefonnummer und\n" - " Text) in das Zielgerät/-datei ein" - - #: apps/gsmsmsstore.cc:197 -@@ -1437,7 +1437,7 @@ - - #: gsmlib/gsm_sms.cc:450 gsmlib/gsm_sms.cc:626 - msgid "Destination address: '" --msgstr "Zieladdresse: '" -+msgstr "Zieladresse: '" - - #: gsmlib/gsm_sms.cc:455 - msgid "Validity period: " ---- gsmlib-1.10.orig/po/gsmlib.pot -+++ gsmlib-1.10/po/gsmlib.pot -@@ -7,7 +7,8 @@ - msgid "" - msgstr "" - "Project-Id-Version: PACKAGE VERSION\n" --"POT-Creation-Date: 2002-10-22 22:48+0200\n" -+"Report-Msgid-Bugs-To: \n" -+"POT-Creation-Date: 2008-10-06 14:36+1100\n" - "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" - "Last-Translator: FULL NAME \n" - "Language-Team: LANGUAGE \n" -@@ -15,168 +16,225 @@ - "Content-Type: text/plain; charset=CHARSET\n" - "Content-Transfer-Encoding: 8bit\n" - --#: apps/gsmsmsd.cc:164 -+#: apps/gsmsmsd.cc:172 - #, c-format - msgid "could not execute '%s'" - msgstr "" - --#: apps/gsmsmsd.cc:168 -+#: apps/gsmsmsd.cc:176 - #, c-format - msgid "error writing to '%s'" - msgstr "" - --#: apps/gsmsmsd.cc:196 -+#: apps/gsmsmsd.cc:197 apps/gsmsmsd.cc:198 apps/gsmsmsd.cc:199 -+#, c-format -+msgid "%d" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:216 - #, c-format - msgid "error when calling opendir('%s')(errno: %d/%s)" - msgstr "" - --#: apps/gsmsmsd.cc:225 -+#: apps/gsmsmsd.cc:260 - #, c-format - msgid "count not open SMS spool file %s" - msgstr "" - --#: apps/gsmsmsd.cc:341 apps/gsmsendsms.cc:144 apps/gsmpb.cc:311 -+#: apps/gsmsmsd.cc:439 apps/gsmsendsms.cc:144 apps/gsmpb.cc:311 - #: apps/gsmctl.cc:380 apps/gsmsmsstore.cc:179 - #, c-format - msgid ": version %s [compiled %s]" - msgstr "" - --#: apps/gsmsmsd.cc:346 -+#: apps/gsmsmsd.cc:444 - msgid "" - ": [-a action][-b baudrate][-C sca][-d device][-f][-h][-I init string]\n" - " [-s spool dir][-t][-v]{sms_type}" - msgstr "" - --#: apps/gsmsmsd.cc:350 -+#: apps/gsmsmsd.cc:448 - msgid "" - " -a, --action the action to execute when an SMS arrives\n" - " (SMS is send to stdin of action)" - msgstr "" - --#: apps/gsmsmsd.cc:354 apps/gsmsendsms.cc:153 apps/gsmpb.cc:322 -+#: apps/gsmsmsd.cc:452 apps/gsmsendsms.cc:153 apps/gsmpb.cc:322 - #: apps/gsmctl.cc:389 apps/gsmsmsstore.cc:194 - msgid " -b, --baudrate baudrate to use for device (default: 38400)" - msgstr "" - --#: apps/gsmsmsd.cc:357 -+#: apps/gsmsmsd.cc:455 - msgid " -c, --concatenate start ID for concatenated SMS messages" - msgstr "" - --#: apps/gsmsmsd.cc:359 apps/gsmsendsms.cc:158 apps/gsmsmsstore.cc:200 -+#: apps/gsmsmsd.cc:457 apps/gsmsendsms.cc:158 apps/gsmsmsstore.cc:200 - msgid " -C, --sca SMS service centre address" - msgstr "" - --#: apps/gsmsmsd.cc:360 -+#: apps/gsmsmsd.cc:458 - msgid " -d, --device sets the device to connect to" - msgstr "" - --#: apps/gsmsmsd.cc:361 -+#: apps/gsmsmsd.cc:459 - msgid " -D, --direct enable direct routing of SMSs" - msgstr "" - --#: apps/gsmsmsd.cc:362 -+#: apps/gsmsmsd.cc:460 - msgid " -f, --flush flush SMS from store" - msgstr "" - --#: apps/gsmsmsd.cc:363 apps/gsmsendsms.cc:161 apps/gsmpb.cc:332 -+#: apps/gsmsmsd.cc:461 -+msgid " -F, --failed directory to move failed SMS to," -+msgstr "" -+ -+#: apps/gsmsmsd.cc:462 apps/gsmsmsd.cc:475 -+msgid " if unset, the SMS will be deleted" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:463 apps/gsmsendsms.cc:161 apps/gsmpb.cc:332 - #: apps/gsmctl.cc:394 apps/gsmsmsstore.cc:204 - msgid " -h, --help prints this message" - msgstr "" - --#: apps/gsmsmsd.cc:364 apps/gsmsendsms.cc:162 apps/gsmpb.cc:335 -+#: apps/gsmsmsd.cc:464 apps/gsmsendsms.cc:162 apps/gsmpb.cc:335 - #: apps/gsmctl.cc:395 apps/gsmsmsstore.cc:205 - msgid " -I, --init device AT init sequence" - msgstr "" - --#: apps/gsmsmsd.cc:365 apps/gsmsendsms.cc:163 -+#: apps/gsmsmsd.cc:466 -+msgid " -L, --syslog log errors and information to syslog" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:469 -+msgid " -P, --priorities number of priority levels to use," -+msgstr "" -+ -+#: apps/gsmsmsd.cc:470 -+msgid " (default: none)" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:471 apps/gsmsendsms.cc:163 - msgid " -r, --requeststat request SMS status report" - msgstr "" - --#: apps/gsmsmsd.cc:366 -+#: apps/gsmsmsd.cc:472 - msgid " -s, --spool spool directory for outgoing SMS" - msgstr "" - --#: apps/gsmsmsd.cc:368 -+#: apps/gsmsmsd.cc:474 -+msgid " -S, --sent directory to move sent SMS to," -+msgstr "" -+ -+#: apps/gsmsmsd.cc:476 - msgid "" - " -t, --store name of SMS store to use for flush\n" - " and/or temporary SMS storage" - msgstr "" - --#: apps/gsmsmsd.cc:371 apps/gsmsendsms.cc:167 apps/gsmpb.cc:343 -+#: apps/gsmsmsd.cc:479 apps/gsmsendsms.cc:167 apps/gsmpb.cc:343 - #: apps/gsmctl.cc:399 apps/gsmsmsstore.cc:213 - msgid " -v, --version prints version and exits" - msgstr "" - --#: apps/gsmsmsd.cc:372 apps/gsmsendsms.cc:169 apps/gsmpb.cc:346 -+#: apps/gsmsmsd.cc:480 apps/gsmsendsms.cc:169 apps/gsmpb.cc:346 - #: apps/gsmctl.cc:400 apps/gsmsmsstore.cc:218 - msgid " -X, --xonxoff switch on software handshake" - msgstr "" - --#: apps/gsmsmsd.cc:374 -+#: apps/gsmsmsd.cc:482 - msgid " sms_type may be any combination of" - msgstr "" - --#: apps/gsmsmsd.cc:375 -+#: apps/gsmsmsd.cc:483 - msgid " sms, no_sms controls reception of normal SMS" - msgstr "" - --#: apps/gsmsmsd.cc:377 -+#: apps/gsmsmsd.cc:485 - msgid " cb, no_cb controls reception of cell broadcast messages" - msgstr "" - --#: apps/gsmsmsd.cc:379 -+#: apps/gsmsmsd.cc:487 - msgid " stat, no_stat controls reception of status reports" - msgstr "" - --#: apps/gsmsmsd.cc:381 -+#: apps/gsmsmsd.cc:489 - msgid " default is \"sms cb stat\"" - msgstr "" - --#: apps/gsmsmsd.cc:382 -+#: apps/gsmsmsd.cc:490 - msgid "If no action is given, the SMS is printed to stdout" - msgstr "" - --#: apps/gsmsmsd.cc:387 apps/gsmsendsms.cc:178 apps/gsmpb.cc:354 -+#: apps/gsmsmsd.cc:492 -+msgid "If -P is given, it activates the priority system and sets the" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:493 -+msgid "number or levels to use. For every level, there must be directories" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:494 -+msgid "named +." -+msgstr "" -+ -+#: apps/gsmsmsd.cc:495 -+msgid "For example \"-P 2 -s queue -S send -F failed\" needs the following" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:496 -+msgid "directories: queue1/ queue2/ send1/ send2/ failed1/ failed2/" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:497 -+msgid "Before sending one SMS from queue2, all pending SMS from queue1" -+msgstr "" -+ -+#: apps/gsmsmsd.cc:498 -+msgid "will be sent." -+msgstr "" -+ -+#: apps/gsmsmsd.cc:503 apps/gsmsendsms.cc:178 apps/gsmpb.cc:354 - #: apps/gsmctl.cc:414 apps/gsmsmsstore.cc:223 - msgid "unknown option" - msgstr "" - --#: apps/gsmsmsd.cc:426 -+#: apps/gsmsmsd.cc:542 - #, c-format - msgid "error when calling sigaction() (errno: %d/%s)" - msgstr "" - --#: apps/gsmsmsd.cc:446 -+#: apps/gsmsmsd.cc:562 - msgid "store name must be given for flush option" - msgstr "" - - #. process the new message --#: apps/gsmsmsd.cc:454 apps/gsmsmsd.cc:522 -+#: apps/gsmsmsd.cc:570 apps/gsmsmsd.cc:638 - msgid "Type of message: " - msgstr "" - --#: apps/gsmsmsd.cc:458 apps/gsmsmsd.cc:526 -+#: apps/gsmsmsd.cc:574 apps/gsmsmsd.cc:642 - msgid "SMS message\n" - msgstr "" - --#: apps/gsmsmsd.cc:461 -+#: apps/gsmsmsd.cc:577 - msgid "submit report message\n" - msgstr "" - --#: apps/gsmsmsd.cc:464 apps/gsmsmsd.cc:532 -+#: apps/gsmsmsd.cc:580 apps/gsmsmsd.cc:648 - msgid "status report message\n" - msgstr "" - --#: apps/gsmsmsd.cc:529 -+#: apps/gsmsmsd.cc:645 - msgid "cell broadcast message\n" - msgstr "" - --#: apps/gsmsmsd.cc:585 apps/gsmsmsd.cc:587 apps/gsmsendsms.cc:253 --#: apps/gsmpb.cc:503 apps/gsmctl.cc:631 apps/gsmsmsstore.cc:435 -+#: apps/gsmsmsd.cc:701 apps/gsmsmsd.cc:703 apps/gsmsendsms.cc:253 -+#: apps/gsmpb.cc:503 apps/gsmctl.cc:631 apps/gsmsmsstore.cc:430 - msgid "[ERROR]: " - msgstr "" - --#: apps/gsmsmsd.cc:588 -+#: apps/gsmsmsd.cc:704 - msgid "(try setting sms_type, please refer to gsmsmsd manpage)" - msgstr "" - -@@ -372,7 +430,7 @@ - msgstr "" - - #: apps/gsmctl.cc:131 gsmlib/gsm_error.cc:104 gsmlib/gsm_sms.cc:441 --#: gsmlib/gsm_sms_codec.cc:204 -+#: gsmlib/gsm_sms_codec.cc:205 - msgid "unknown" - msgstr "" - -@@ -541,7 +599,7 @@ - msgid "unknown operation '%s'" - msgstr "" - --#: apps/gsmsmsstore.cc:91 apps/gsmsmsstore.cc:363 apps/gsmsmsstore.cc:380 -+#: apps/gsmsmsstore.cc:91 apps/gsmsmsstore.cc:358 apps/gsmsmsstore.cc:375 - #, c-format - msgid "inserting entry #%d from source into destination" - msgstr "" -@@ -618,7 +676,7 @@ - msgid "destination required" - msgstr "" - --#: apps/gsmsmsstore.cc:254 gsmlib/gsm_util.cc:285 -+#: apps/gsmsmsstore.cc:254 gsmlib/gsm_util.cc:286 - #, c-format - msgid "expected number, got '%s'" - msgstr "" -@@ -631,30 +689,30 @@ - msgid "unexpected parameters" - msgstr "" - --#: apps/gsmsmsstore.cc:280 apps/gsmsmsstore.cc:317 -+#: apps/gsmsmsstore.cc:280 apps/gsmsmsstore.cc:312 - msgid "store name must be given" - msgstr "" - --#: apps/gsmsmsstore.cc:344 apps/gsmsmsstore.cc:377 -+#: apps/gsmsmsstore.cc:339 apps/gsmsmsstore.cc:372 - #, c-format - msgid "no index '%s' in source" - msgstr "" - --#: apps/gsmsmsstore.cc:392 -+#: apps/gsmsmsstore.cc:387 - #, c-format - msgid "index #%d" - msgstr "" - --#: apps/gsmsmsstore.cc:406 -+#: apps/gsmsmsstore.cc:401 - msgid "inserting new entry into destination" - msgstr "" - --#: apps/gsmsmsstore.cc:421 -+#: apps/gsmsmsstore.cc:416 - #, c-format - msgid "deleting entry #%d from destination" - msgstr "" - --#: apps/gsmsmsstore.cc:426 -+#: apps/gsmsmsstore.cc:421 - #, c-format - msgid "no index '%s' in destination" - msgstr "" -@@ -1107,52 +1165,52 @@ - msgid "unexpected unsolicited event '%s'" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:536 -+#: gsmlib/gsm_me_ta.cc:538 - msgid "unable to set operator" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:663 -+#: gsmlib/gsm_me_ta.cc:665 - msgid "call forward time must be in the range 0..30" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:811 -+#: gsmlib/gsm_me_ta.cc:813 - msgid "Functionality Level commands not supported by ME" - msgstr "" - - #. If the number was just out of range, we get here. --#: gsmlib/gsm_me_ta.cc:830 -+#: gsmlib/gsm_me_ta.cc:832 - msgid "Requested Functionality Level out of range" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:941 -+#: gsmlib/gsm_me_ta.cc:943 - msgid "unsupported alphabet for SMS" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:950 -+#: gsmlib/gsm_me_ta.cc:952 - msgid "SMS text is larger than allowed" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:962 -+#: gsmlib/gsm_me_ta.cc:964 - msgid "not more than 255 concatenated SMSs allowed" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:995 -+#: gsmlib/gsm_me_ta.cc:997 - msgid "only serviceLevel 0 or 1 supported" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:1108 gsmlib/gsm_me_ta.cc:1150 -+#: gsmlib/gsm_me_ta.cc:1110 gsmlib/gsm_me_ta.cc:1152 - msgid "cannot route SMS messages to TE" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:1122 gsmlib/gsm_me_ta.cc:1164 -+#: gsmlib/gsm_me_ta.cc:1124 gsmlib/gsm_me_ta.cc:1166 - msgid "cannot route cell broadcast messages to TE" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:1134 -+#: gsmlib/gsm_me_ta.cc:1136 - msgid "cannot route status reports messages to TE" - msgstr "" - --#: gsmlib/gsm_me_ta.cc:1178 -+#: gsmlib/gsm_me_ta.cc:1180 - msgid "cannot route status report messages to TE" - msgstr "" - -@@ -1314,7 +1372,7 @@ - msgid "Validity period format: " - msgstr "" - --#: gsmlib/gsm_sms.cc:432 gsmlib/gsm_sms_codec.cc:183 -+#: gsmlib/gsm_sms.cc:432 gsmlib/gsm_sms_codec.cc:184 - msgid "not present" - msgstr "" - -@@ -1402,209 +1460,212 @@ - msgid "Message type: SMS-SUBMIT-REPORT" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:188 gsmlib/gsm_sms_codec.cc:190 -+#: gsmlib/gsm_sms_codec.cc:189 gsmlib/gsm_sms_codec.cc:191 - msgid " minutes" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:192 -+#: gsmlib/gsm_sms_codec.cc:193 - msgid " days" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:194 -+#: gsmlib/gsm_sms_codec.cc:195 - msgid " weeks" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:213 -+#: gsmlib/gsm_sms_codec.cc:214 - msgid "compressed " - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:218 -+#: gsmlib/gsm_sms_codec.cc:219 - msgid "voicemail message waiting" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:221 -+#: gsmlib/gsm_sms_codec.cc:222 - msgid "fax message waiting" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:224 -+#: gsmlib/gsm_sms_codec.cc:225 - msgid "electronic mail message waiting" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:227 -+#: gsmlib/gsm_sms_codec.cc:228 - msgid "other message waiting" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:234 -+#: gsmlib/gsm_sms_codec.cc:235 - msgid "default alphabet" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:237 -+#: gsmlib/gsm_sms_codec.cc:238 - msgid "8-bit alphabet" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:240 -+#: gsmlib/gsm_sms_codec.cc:241 - msgid "16-bit alphabet" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:243 -+#: gsmlib/gsm_sms_codec.cc:244 - msgid "reserved alphabet" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:256 -+#: gsmlib/gsm_sms_codec.cc:257 - msgid "bad hexadecimal PDU format" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:285 gsmlib/gsm_sms_codec.cc:295 --#: gsmlib/gsm_sms_codec.cc:310 gsmlib/gsm_sms_codec.cc:318 --#: gsmlib/gsm_sms_codec.cc:339 gsmlib/gsm_sms_codec.cc:347 --#: gsmlib/gsm_sms_codec.cc:368 gsmlib/gsm_sms_codec.cc:382 -+#: gsmlib/gsm_sms_codec.cc:286 gsmlib/gsm_sms_codec.cc:296 -+#: gsmlib/gsm_sms_codec.cc:311 gsmlib/gsm_sms_codec.cc:319 -+#: gsmlib/gsm_sms_codec.cc:340 gsmlib/gsm_sms_codec.cc:348 -+#: gsmlib/gsm_sms_codec.cc:369 gsmlib/gsm_sms_codec.cc:383 - msgid "premature end of PDU" - msgstr "" - --#: gsmlib/gsm_sms_codec.cc:473 -+#: gsmlib/gsm_sms_codec.cc:474 - msgid "unknown time period format" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:119 -+#: gsmlib/gsm_unix_serial.cc:121 - msgid "interrupted when reading from TA" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:144 -+#: gsmlib/gsm_unix_serial.cc:136 -+msgid "end of file when reading from TA" -+msgstr "" -+ -+#: gsmlib/gsm_unix_serial.cc:146 - msgid "reading from TA" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:149 -+#: gsmlib/gsm_unix_serial.cc:151 - msgid "timeout when reading from TA" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:176 -+#: gsmlib/gsm_unix_serial.cc:178 - #, c-format - msgid "opening device '%s'" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:182 -+#: gsmlib/gsm_unix_serial.cc:185 - msgid "getting file status flags failed" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:185 -+#: gsmlib/gsm_unix_serial.cc:190 - msgid "switching of non-blocking mode failed" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:198 -+#: gsmlib/gsm_unix_serial.cc:205 - msgid "clearing DTR failed" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:202 -+#: gsmlib/gsm_unix_serial.cc:211 - msgid "setting DTR failed" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:206 -+#: gsmlib/gsm_unix_serial.cc:216 - #, c-format - msgid "tcgetattr device '%s'" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:233 -+#: gsmlib/gsm_unix_serial.cc:245 - #, c-format - msgid "tcsetattr device '%s'" - msgstr "" - --#. no response after 3 tries --#: gsmlib/gsm_unix_serial.cc:287 -+#: gsmlib/gsm_unix_serial.cc:303 - #, c-format - msgid "reset modem failed '%s'" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:332 gsmlib/gsm_unix_serial.cc:364 -+#: gsmlib/gsm_unix_serial.cc:348 gsmlib/gsm_unix_serial.cc:380 - msgid "interrupted when writing to TA" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:347 gsmlib/gsm_unix_serial.cc:356 -+#: gsmlib/gsm_unix_serial.cc:363 gsmlib/gsm_unix_serial.cc:372 - msgid "writing to TA" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:377 -+#: gsmlib/gsm_unix_serial.cc:393 - msgid "timeout when writing to TA" - msgstr "" - --#: gsmlib/gsm_unix_serial.cc:438 -+#: gsmlib/gsm_unix_serial.cc:454 - #, c-format - msgid "unknown baudrate '%s'" - msgstr "" - --#: gsmlib/gsm_util.cc:205 -+#: gsmlib/gsm_util.cc:206 - #, c-format - msgid "error when calling stat('%s') (errno: %d/%s)" - msgstr "" - --#: gsmlib/gsm_util.cc:236 -+#: gsmlib/gsm_util.cc:237 - #, c-format - msgid "file '%s' is neither file nor character device" - msgstr "" - --#: gsmlib/gsm_util.cc:240 -+#: gsmlib/gsm_util.cc:241 - msgid "maxmimum number of symbolic links exceeded" - msgstr "" - --#: gsmlib/gsm_util.cc:250 -+#: gsmlib/gsm_util.cc:251 - #, c-format - msgid "error renaming '%s' to '%s'" - msgstr "" - --#: gsmlib/gsm_util.cc:348 -+#: gsmlib/gsm_util.cc:349 - #, c-format - msgid "text '%s' contains illegal character '\"'" - msgstr "" - --#: gsmlib/gsm_util.cc:358 -+#: gsmlib/gsm_util.cc:359 - #, c-format - msgid "illegal character in telephone number '%s'" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:95 -+#: gsmlib/gsm_sorted_phonebook.cc:96 - #, c-format - msgid "error reading from file '%s" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:109 -+#: gsmlib/gsm_sorted_phonebook.cc:110 - #, c-format - msgid "entry '%s' lacks index" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:118 gsmlib/gsm_sorted_phonebook.cc:124 -+#: gsmlib/gsm_sorted_phonebook.cc:119 gsmlib/gsm_sorted_phonebook.cc:125 - #, c-format - msgid "line '%s' has invalid format" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:173 gsmlib/gsm_sorted_sms_store.cc:159 -+#: gsmlib/gsm_sorted_phonebook.cc:174 gsmlib/gsm_sorted_sms_store.cc:159 - #, c-format - msgid "error opening file '%s' for writing" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:174 gsmlib/gsm_sorted_phonebook.cc:193 -+#: gsmlib/gsm_sorted_phonebook.cc:175 gsmlib/gsm_sorted_phonebook.cc:194 - #: gsmlib/gsm_sorted_sms_store.cc:67 gsmlib/gsm_sorted_sms_store.cc:160 - msgid "" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:192 gsmlib/gsm_sorted_sms_store.cc:66 -+#: gsmlib/gsm_sorted_phonebook.cc:193 gsmlib/gsm_sorted_sms_store.cc:66 - #, c-format - msgid "error writing to file '%s'" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:216 -+#: gsmlib/gsm_sorted_phonebook.cc:217 - msgid "attempt to change phonebook read from " - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:229 gsmlib/gsm_sorted_sms_store.cc:215 -+#: gsmlib/gsm_sorted_phonebook.cc:230 gsmlib/gsm_sorted_sms_store.cc:215 - #, c-format - msgid "cannot open file '%s'" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:244 gsmlib/gsm_sorted_sms_store.cc:55 -+#: gsmlib/gsm_sorted_phonebook.cc:245 gsmlib/gsm_sorted_sms_store.cc:55 - #: gsmlib/gsm_sorted_sms_store.cc:228 - msgid "" - msgstr "" - --#: gsmlib/gsm_sorted_phonebook.cc:361 -+#: gsmlib/gsm_sorted_phonebook.cc:362 - msgid "indices must be unique in phonebook" - msgstr "" - ---- gsmlib-1.10.orig/gsmlib-1.10.debmg/debian/gsm-utils.dirs -+++ gsmlib-1.10/gsmlib-1.10.debmg/debian/gsm-utils.dirs -@@ -0,0 +1,11 @@ -+var/spool/sms/queue1 -+var/spool/sms/queue2 -+var/spool/sms/queue3 -+var/spool/sms/sent1 -+var/spool/sms/sent2 -+var/spool/sms/sent3 -+var/spool/sms/failed1 -+var/spool/sms/failed2 -+var/spool/sms/failed3 -+var/spool/sms/tmp -+var/run/gsm-utils ---- gsmlib-1.10.orig/gsmlib-1.10.debmg/debian/gsm-utils.postinst -+++ gsmlib-1.10/gsmlib-1.10.debmg/debian/gsm-utils.postinst -@@ -0,0 +1,28 @@ -+#!/bin/sh -e -+ -+# create gsmsms group if necessary. -+if ! grep -q ^gsmsms: /etc/group; then -+# echo Adding system group: gsmsms. -+ addgroup gsmsms -+fi -+ -+# create gsmsms user if necessary. -+if ! grep -q ^gsmsms: /etc/passwd; then -+# echo Adding system user: gsmsms. -+ adduser --system --ingroup gsmsms \ -+ --no-create-home --home /var/spool/sms gsmsms -+fi -+ -+# allow gsmsms to use serial lines -+if ! groups gsmsms | grep -q dialout ; then -+ adduser gsmsms dialout -+fi -+ -+# echo Updating spool directory structure: /var/spool/sms -+chown -R gsmsms:gsmsms /var/spool/sms /var/run/gsm-utils -+chmod 700 /var/spool/sms/* -+chmod 750 /var/spool/sms -+chmod 730 /var/spool/sms/queue* /var/spool/sms/tmp -+ -+# Add the rest automatically.. -+#DEBHELPER# ---- gsmlib-1.10.orig/gsmlib-1.10.debmg/debian/gsm-utils.undocumented -+++ gsmlib-1.10/gsmlib-1.10.debmg/debian/gsm-utils.undocumented -@@ -0,0 +1,2 @@ -+gsmsmsspool.1 -+gsmsmsrequeue.8 ---- gsmlib-1.10.orig/gsmlib-1.10.debmg/debian/gsm-utils.prerm -+++ gsmlib-1.10/gsmlib-1.10.debmg/debian/gsm-utils.prerm -@@ -0,0 +1,7 @@ -+#!/bin/sh -e -+ -+deluser gsmsms || true -+delgroup gsmsms || true -+ -+# Add the rest automatically.. -+#DEBHELPER# ---- gsmlib-1.10.orig/scripts/config.sub -+++ gsmlib-1.10/scripts/config.sub -@@ -1,9 +1,10 @@ - #! /bin/sh - # Configuration validation subroutine script. --# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 - # Free Software Foundation, Inc. - --timestamp='2001-09-07' -+timestamp='2008-01-16' - - # This file is (in principle) common to ALL GNU software. - # The presence of a machine in this file suggests that SOME GNU software -@@ -21,15 +22,17 @@ - # - # 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. -- -+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -+# 02110-1301, USA. -+# - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a - # configuration script generated by Autoconf, you may include it under - # the same distribution terms that you use for the rest of that program. - --# Please send patches to . -+ -+# Please send patches to . Submit a context -+# diff and a properly formatted ChangeLog entry. - # - # Configuration subroutine to validate and canonicalize a configuration type. - # Supply the specified configuration type as an argument. -@@ -69,8 +72,8 @@ - version="\ - GNU config.sub ($timestamp) - --Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 --Free Software Foundation, Inc. -+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -82,11 +85,11 @@ - while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) -- echo "$timestamp" ; exit 0 ;; -+ echo "$timestamp" ; exit ;; - --version | -v ) -- echo "$version" ; exit 0 ;; -+ echo "$version" ; exit ;; - --help | --h* | -h ) -- echo "$usage"; exit 0 ;; -+ echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. -@@ -98,7 +101,7 @@ - *local*) - # First pass through any local machine types. - echo $1 -- exit 0;; -+ exit ;; - - * ) - break ;; -@@ -117,7 +120,9 @@ - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in -- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) -+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ -+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ -+ storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; -@@ -143,7 +148,7 @@ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -- -apple | -axis) -+ -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; -@@ -168,6 +173,10 @@ - -hiux*) - os=-hiuxwe2 - ;; -+ -sco6) -+ os=-sco5v6 -+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -+ ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -@@ -184,6 +193,10 @@ - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -+ -sco5v6*) -+ # Don't forget version if it is 3.2v4 or newer. -+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -+ ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -@@ -226,32 +239,53 @@ - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ -- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ -+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ -+ | am33_2.0 \ -+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ -+ | bfin \ - | c4x | clipper \ -- | d10v | d30v | dsp16xx \ -- | fr30 \ -+ | d10v | d30v | dlx | dsp16xx \ -+ | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ -- | m32r | m68000 | m68k | m88k | mcore \ -- | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ -- | mips64vr4100 | mips64vr4100el | mips64vr4300 \ -- | mips64vr4300el | mips64vr5000 | mips64vr5000el \ -- | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ -- | mipsisa32 \ -+ | ip2k | iq2000 \ -+ | m32c | m32r | m32rle | m68000 | m68k | m88k \ -+ | maxq | mb | microblaze | mcore | mep \ -+ | mips | mipsbe | mipseb | mipsel | mipsle \ -+ | mips16 \ -+ | mips64 | mips64el \ -+ | mips64vr | mips64vrel \ -+ | mips64orion | mips64orionel \ -+ | mips64vr4100 | mips64vr4100el \ -+ | mips64vr4300 | mips64vr4300el \ -+ | mips64vr5000 | mips64vr5000el \ -+ | mips64vr5900 | mips64vr5900el \ -+ | mipsisa32 | mipsisa32el \ -+ | mipsisa32r2 | mipsisa32r2el \ -+ | mipsisa64 | mipsisa64el \ -+ | mipsisa64r2 | mipsisa64r2el \ -+ | mipsisa64sb1 | mipsisa64sb1el \ -+ | mipsisa64sr71k | mipsisa64sr71kel \ -+ | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ -+ | mt \ -+ | msp430 \ -+ | nios | nios2 \ - | ns16k | ns32k \ -- | openrisc \ -+ | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ -- | s390 | s390x \ -- | sh | sh[34] | sh[34]eb | shbe | shle \ -- | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ -- | stormy16 | strongarm \ -- | tahoe | thumb | tic80 | tron \ -- | v850 \ -+ | score \ -+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ -+ | sh64 | sh64le \ -+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ -+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ -+ | spu | strongarm \ -+ | tahoe | thumb | tic4x | tic80 | tron \ -+ | v850 | v850e \ - | we32k \ -- | x86 | xscale \ -+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; -@@ -262,6 +296,9 @@ - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; -+ ms1) -+ basic_machine=mt-unknown -+ ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and -@@ -278,41 +315,68 @@ - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ -- | alphapca5[67]-* | arc-* \ -- | arm-* | armbe-* | armle-* | armv*-* \ -- | bs2000-* \ -- | c[123]* | c30-* | [cjt]90-* | c54x-* \ -- | clipper-* | cray2-* | cydra-* \ -- | d10v-* | d30v-* \ -+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ -+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ -+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ -+ | avr-* | avr32-* \ -+ | bfin-* | bs2000-* \ -+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ -+ | clipper-* | craynv-* | cydra-* \ -+ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ -- | f30[01]-* | f700-* | fr30-* | fx80-* \ -+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ -- | m32r-* \ -- | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ -- | m88110-* | m88k-* | mcore-* \ -- | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ -- | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ -- | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ -- | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ -+ | ip2k-* | iq2000-* \ -+ | m32c-* | m32r-* | m32rle-* \ -+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ -+ | m88110-* | m88k-* | maxq-* | mcore-* \ -+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ -+ | mips16-* \ -+ | mips64-* | mips64el-* \ -+ | mips64vr-* | mips64vrel-* \ -+ | mips64orion-* | mips64orionel-* \ -+ | mips64vr4100-* | mips64vr4100el-* \ -+ | mips64vr4300-* | mips64vr4300el-* \ -+ | mips64vr5000-* | mips64vr5000el-* \ -+ | mips64vr5900-* | mips64vr5900el-* \ -+ | mipsisa32-* | mipsisa32el-* \ -+ | mipsisa32r2-* | mipsisa32r2el-* \ -+ | mipsisa64-* | mipsisa64el-* \ -+ | mipsisa64r2-* | mipsisa64r2el-* \ -+ | mipsisa64sb1-* | mipsisa64sb1el-* \ -+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ -+ | mipstx39-* | mipstx39el-* \ -+ | mmix-* \ -+ | mt-* \ -+ | msp430-* \ -+ | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ -- | s390-* | s390x-* \ -- | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ -- | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ -- | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ -- | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ -- | v850-* | vax-* \ -+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ -+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ -+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ -+ | sparclite-* \ -+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ -+ | tahoe-* | thumb-* \ -+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ -+ | tron-* \ -+ | v850-* | v850e-* | vax-* \ - | we32k-* \ -- | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ -+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ -+ | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-*) - ;; -+ # Recognize the basic CPU types without company name, with glob match. -+ xtensa*) -+ basic_machine=$basic_machine-unknown -+ ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) -@@ -329,6 +393,9 @@ - basic_machine=a29k-amd - os=-udi - ;; -+ abacus) -+ basic_machine=abacus-unknown -+ ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout -@@ -343,6 +410,12 @@ - basic_machine=a29k-none - os=-bsd - ;; -+ amd64) -+ basic_machine=x86_64-pc -+ ;; -+ amd64-*) -+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - amdahl) - basic_machine=580-amdahl - os=-sysv -@@ -374,6 +447,18 @@ - basic_machine=ns32k-sequent - os=-dynix - ;; -+ blackfin) -+ basic_machine=bfin-unknown -+ os=-linux -+ ;; -+ blackfin-*) -+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=-linux -+ ;; -+ c90) -+ basic_machine=c90-cray -+ os=-unicos -+ ;; - convex-c1) - basic_machine=c1-convex - os=-bsd -@@ -394,30 +479,45 @@ - basic_machine=c38-convex - os=-bsd - ;; -- cray | ymp) -- basic_machine=ymp-cray -+ cray | j90) -+ basic_machine=j90-cray - os=-unicos - ;; -- cray2) -- basic_machine=cray2-cray -- os=-unicos -+ craynv) -+ basic_machine=craynv-cray -+ os=-unicosmp - ;; -- [cjt]90) -- basic_machine=${basic_machine}-cray -- os=-unicos -+ cr16) -+ basic_machine=cr16-unknown -+ os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; -+ crisv32 | crisv32-* | etraxfs*) -+ basic_machine=crisv32-axis -+ ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; -+ crx) -+ basic_machine=crx-unknown -+ os=-elf -+ ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; -+ decsystem10* | dec10*) -+ basic_machine=pdp10-dec -+ os=-tops10 -+ ;; -+ decsystem20* | dec20*) -+ basic_machine=pdp10-dec -+ os=-tops20 -+ ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola -@@ -426,6 +526,10 @@ - basic_machine=m88k-motorola - os=-sysv3 - ;; -+ djgpp) -+ basic_machine=i586-pc -+ os=-msdosdjgpp -+ ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx -@@ -576,6 +680,14 @@ - basic_machine=m68k-isi - os=-sysv - ;; -+ m68knommu) -+ basic_machine=m68k-unknown -+ os=-linux -+ ;; -+ m68knommu-*) -+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=-linux -+ ;; - m88k-omron*) - basic_machine=m88k-omron - ;; -@@ -591,6 +703,10 @@ - basic_machine=i386-pc - os=-mingw32 - ;; -+ mingw32ce) -+ basic_machine=arm-unknown -+ os=-mingw32ce -+ ;; - miniframe) - basic_machine=m68000-convergent - ;; -@@ -598,32 +714,27 @@ - basic_machine=m68k-atari - os=-mint - ;; -- mipsel*-linux*) -- basic_machine=mipsel-unknown -- os=-linux-gnu -- ;; -- mips*-linux*) -- basic_machine=mips-unknown -- os=-linux-gnu -- ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; -- mmix*) -- basic_machine=mmix-knuth -- os=-mmixware -- ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; -+ morphos) -+ basic_machine=powerpc-unknown -+ os=-morphos -+ ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; -+ ms1-*) -+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` -+ ;; - mvs) - basic_machine=i370-ibm - os=-mvs -@@ -699,6 +810,13 @@ - basic_machine=hppa1.1-oki - os=-proelf - ;; -+ openrisc | openrisc-*) -+ basic_machine=or32-unknown -+ ;; -+ os400) -+ basic_machine=powerpc-ibm -+ os=-os400 -+ ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose -@@ -715,55 +833,75 @@ - basic_machine=i860-intel - os=-osf - ;; -+ parisc) -+ basic_machine=hppa-unknown -+ os=-linux -+ ;; -+ parisc-*) -+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=-linux -+ ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; -- pc532 | pc532-*) -+ pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; -- pentium | p5 | k5 | k6 | nexgen) -+ pc98) -+ basic_machine=i386-pc -+ ;; -+ pc98-*) -+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; -+ pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; -- pentiumpro | p6 | 6x86 | athlon) -+ pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; -- pentiumii | pentium2) -+ pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; -- pentium-* | p5-* | k5-* | k6-* | nexgen-*) -+ pentium4) -+ basic_machine=i786-pc -+ ;; -+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -- pentiumii-* | pentium2-*) -+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -+ pentium4-*) -+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown -- ;; -+ ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown -- ;; -+ ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown -- ;; -+ ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown -- ;; -+ ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -@@ -774,6 +912,10 @@ - basic_machine=i586-unknown - os=-pw32 - ;; -+ rdos) -+ basic_machine=i386-pc -+ os=-rdos -+ ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff -@@ -784,10 +926,30 @@ - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; -+ s390 | s390-*) -+ basic_machine=s390-ibm -+ ;; -+ s390x | s390x-*) -+ basic_machine=s390x-ibm -+ ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; -+ sb1) -+ basic_machine=mipsisa64sb1-unknown -+ ;; -+ sb1el) -+ basic_machine=mipsisa64sb1el-unknown -+ ;; -+ sde) -+ basic_machine=mipsisa32-sde -+ os=-elf -+ ;; -+ sei) -+ basic_machine=mips-sei -+ os=-seiux -+ ;; - sequent) - basic_machine=i386-sequent - ;; -@@ -795,7 +957,13 @@ - basic_machine=sh-hitachi - os=-hms - ;; -- sparclite-wrs) -+ sh5el) -+ basic_machine=sh5le-unknown -+ ;; -+ sh64) -+ basic_machine=sh64-unknown -+ ;; -+ sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; -@@ -862,22 +1030,46 @@ - os=-dynix - ;; - t3e) -- basic_machine=t3e-cray -+ basic_machine=alphaev5-cray -+ os=-unicos -+ ;; -+ t90) -+ basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; -+ tic55x | c55x*) -+ basic_machine=tic55x-unknown -+ os=-coff -+ ;; -+ tic6x | c6x*) -+ basic_machine=tic6x-unknown -+ os=-coff -+ ;; -+ tile*) -+ basic_machine=tile-unknown -+ os=-linux-gnu -+ ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; -+ toad1) -+ basic_machine=pdp10-xkl -+ os=-tops20 -+ ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; -+ tpf) -+ basic_machine=s390x-ibm -+ os=-tpf -+ ;; - udi29k) - basic_machine=a29k-amd - os=-udi -@@ -899,8 +1091,8 @@ - os=-vms - ;; - vpp*|vx|vx-*) -- basic_machine=f301-fujitsu -- ;; -+ basic_machine=f301-fujitsu -+ ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks -@@ -921,17 +1113,17 @@ - basic_machine=hppa1.1-winbond - os=-proelf - ;; -- windows32) -- basic_machine=i386-pc -- os=-windows32-msvcrt -- ;; -- xmp) -- basic_machine=xmp-cray -- os=-unicos -+ xbox) -+ basic_machine=i686-pc -+ os=-mingw32 - ;; -- xps | xps100) -+ xps | xps100) - basic_machine=xps100-honeywell - ;; -+ ymp) -+ basic_machine=ymp-cray -+ os=-unicos -+ ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim -@@ -952,16 +1144,12 @@ - op60c) - basic_machine=hppa1.1-oki - ;; -- mips) -- if [ x$os = x-linux-gnu ]; then -- basic_machine=mips-unknown -- else -- basic_machine=mips-mips -- fi -- ;; - romp) - basic_machine=romp-ibm - ;; -+ mmix) -+ basic_machine=mmix-knuth -+ ;; - rs6000) - basic_machine=rs6000-ibm - ;; -@@ -978,13 +1166,13 @@ - we32k) - basic_machine=we32k-att - ;; -- sh3 | sh4 | sh3eb | sh4eb) -+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; -- sparc | sparcv9 | sparcv9b) -+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; -- cydra) -+ cydra) - basic_machine=cydra-cydrome - ;; - orion) -@@ -999,10 +1187,6 @@ - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; -- c4x*) -- basic_machine=c4x-none -- os=-coff -- ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; -@@ -1058,17 +1242,23 @@ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ -- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ -- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ -+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ -+ | -openbsd* | -solidbsd* \ -+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ -+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ -- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ -- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ -+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ -+ | -uxpv* | -beos* | -mpeix* | -udk* \ -+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ -- | -os2* | -vos*) -+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ -+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ -+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ -+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) -@@ -1080,16 +1270,21 @@ - ;; - esac - ;; -+ -nto-qnx*) -+ ;; - -nto*) -- os=-nto-qnx -+ os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ -+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; -+ -linux-dietlibc) -+ os=-linux-dietlibc -+ ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; -@@ -1102,6 +1297,9 @@ - -opened*) - os=-openedition - ;; -+ -os400*) -+ os=-os400 -+ ;; - -wince*) - os=-wince - ;; -@@ -1120,14 +1318,23 @@ - -acis*) - os=-aos - ;; -+ -atheos*) -+ os=-atheos -+ ;; -+ -syllable*) -+ os=-syllable -+ ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; -+ -nova*) -+ os=-rtmk-nova -+ ;; - -ns2 ) -- os=-nextstep2 -+ os=-nextstep2 - ;; - -nsk*) - os=-nsk -@@ -1139,6 +1346,9 @@ - -sinix*) - os=-sysv4 - ;; -+ -tpf*) -+ os=-tpf -+ ;; - -triton*) - os=-sysv3 - ;; -@@ -1166,8 +1376,17 @@ - -xenix) - os=-xenix - ;; -- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -- os=-mint -+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -+ os=-mint -+ ;; -+ -aros*) -+ os=-aros -+ ;; -+ -kaos*) -+ os=-kaos -+ ;; -+ -zvmoe) -+ os=-zvmoe - ;; - -none) - ;; -@@ -1191,6 +1410,12 @@ - # system, and we'll never get to this point. - - case $basic_machine in -+ score-*) -+ os=-elf -+ ;; -+ spu-*) -+ os=-elf -+ ;; - *-acorn) - os=-riscix1.2 - ;; -@@ -1200,10 +1425,14 @@ - arm*-semi) - os=-aout - ;; -+ c4x-* | tic4x-*) -+ os=-coff -+ ;; -+ # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; -- pdp11-*) -+ pdp11-*) - os=-none - ;; - *-dec | vax-*) -@@ -1224,12 +1453,18 @@ - m68*-cisco) - os=-aout - ;; -+ mep-*) -+ os=-elf -+ ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; -+ or32-*) -+ os=-coff -+ ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; -@@ -1239,9 +1474,15 @@ - *-be) - os=-beos - ;; -+ *-haiku) -+ os=-haiku -+ ;; - *-ibm) - os=-aix - ;; -+ *-knuth) -+ os=-mmixware -+ ;; - *-wec) - os=-proelf - ;; -@@ -1293,19 +1534,19 @@ - *-next) - os=-nextstep3 - ;; -- *-gould) -+ *-gould) - os=-sysv - ;; -- *-highlevel) -+ *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; -- *-sgi) -+ *-sgi) - os=-irix - ;; -- *-siemens) -+ *-siemens) - os=-sysv4 - ;; - *-masscomp) -@@ -1374,10 +1615,16 @@ - -mvs* | -opened*) - vendor=ibm - ;; -+ -os400*) -+ vendor=ibm -+ ;; - -ptx*) - vendor=sequent - ;; -- -vxsim* | -vxworks*) -+ -tpf*) -+ vendor=ibm -+ ;; -+ -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) -@@ -1401,7 +1648,7 @@ - esac - - echo $basic_machine$os --exit 0 -+exit - - # Local variables: - # eval: (add-hook 'write-file-hooks 'time-stamp) ---- gsmlib-1.10.orig/scripts/ltconfig -+++ gsmlib-1.10/scripts/ltconfig -@@ -1,8 +1,8 @@ - #! /bin/sh - - # ltconfig - Create a system-specific libtool. --# Copyright (C) 1996-1998 Free Software Foundation, Inc. --# Gordon Matzigkeit , 1996 -+# Copyright (C) 1996-1999 Free Software Foundation, Inc. -+# Originally by Gordon Matzigkeit , 1996 - # - # This file is free software; you can redistribute it and/or modify it - # under the terms of the GNU General Public License as published by -@@ -32,12 +32,8 @@ - # Discard the --no-reexec flag, and continue. - shift - elif test "X$1" = X--fallback-echo; then -- # used as fallback echo -- shift -- cat </dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -@@ -46,11 +42,30 @@ - exec "$SHELL" "$0" --no-reexec ${1+"$@"} - fi - -+if test "X$1" = X--fallback-echo; then -+ # used as fallback echo -+ shift -+ cat </dev/null`} -+ case X$UNAME in -+ *-DOS) PATH_SEPARATOR=';' ;; -+ *) PATH_SEPARATOR=':' ;; -+ esac -+fi -+ - # The HP-UX ksh and POSIX shell print the target directory to stdout - # if CDPATH is set. --if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi -+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - --if test "X${echo_test_string+set}" != "Xset"; then -+if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... -@@ -70,9 +85,9 @@ - # - # So, first we look for a working echo in the user's PATH. - -- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" -+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do -- if test -f $dir/echo && -+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$dir/echo" -@@ -87,7 +102,8 @@ - test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' -- elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then -+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && -+ test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" - export ORIGINAL_CONFIG_SHELL -@@ -96,10 +112,10 @@ - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} - else - # Try using printf. -- echo='printf %s\n' -+ echo='printf "%s\n"' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && -- test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then -- # Cool, printf works -+ test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then -+ # Cool, printf works - : - elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then -@@ -110,9 +126,9 @@ - echo="$CONFIG_SHELL $0 --fallback-echo" - elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then -- echo="$CONFIG_SHELL $0 --fallback-echo" -+ echo="$CONFIG_SHELL $0 --fallback-echo" - else -- # maybe with a smaller string... -+ # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do -@@ -143,15 +159,20 @@ - # Same as above, but do not quote variable references. - double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -+# Sed substitution to delay expansion of an escaped shell variable in a -+# double_quote_subst'ed string. -+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -+ - # The name of this program. - progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - - # Constants: - PROGRAM=ltconfig - PACKAGE=libtool --VERSION=1.2d --ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' --ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' -+VERSION=1.3.5 -+TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" -+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' - rm="rm -f" - - help="Try \`$progname --help' for more information." -@@ -160,8 +181,12 @@ - default_ofile=libtool - can_build_shared=yes - enable_shared=yes --# All known linkers require a `.a' archive for static linking. -+# All known linkers require a `.a' archive for static linking (except M$VC, -+# which needs '.lib'). - enable_static=yes -+enable_fast_install=yes -+enable_dlopen=unknown -+enable_win32_dll=no - ltmain= - silent= - srcdir= -@@ -174,18 +199,24 @@ - with_gcc=no - with_gnu_ld=no - need_locks=yes -+ac_ext=c - objext=o - libext=a -+exeext= -+cache_file= - - old_AR="$AR" - old_CC="$CC" - old_CFLAGS="$CFLAGS" - old_CPPFLAGS="$CPPFLAGS" -+old_LDFLAGS="$LDFLAGS" - old_LD="$LD" - old_LN_S="$LN_S" -+old_LIBS="$LIBS" - old_NM="$NM" - old_RANLIB="$RANLIB" - old_DLLTOOL="$DLLTOOL" -+old_OBJDUMP="$OBJDUMP" - old_AS="$AS" - - # Parse the command line options. -@@ -214,6 +245,9 @@ - --debug enable verbose shell tracing - --disable-shared do not build shared libraries - --disable-static do not build static libraries -+ --disable-fast-install do not optimize for fast installation -+ --enable-dlopen enable dlopen support -+ --enable-win32-dll enable building dlls on win32 hosts - --help display this help and exit - --no-verify do not verify that HOST is a valid host type - -o, --output=FILE specify the output file [default=$default_ofile] -@@ -224,6 +258,7 @@ - --with-gcc assume that the GNU C compiler will be used - --with-gnu-ld assume that the C compiler uses the GNU linker - --disable-lock disable file locking -+ --cache-file=FILE configure cache file - - LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program - that provides basic libtool functionality. -@@ -242,6 +277,12 @@ - - --disable-static) enable_static=no ;; - -+ --disable-fast-install) enable_fast_install=no ;; -+ -+ --enable-dlopen) enable_dlopen=yes ;; -+ -+ --enable-win32-dll) enable_win32_dll=yes ;; -+ - --quiet | --silent) silent=yes ;; - - --srcdir) prev=srcdir ;; -@@ -252,13 +293,15 @@ - --output | -o) prev=ofile ;; - --output=*) ofile="$optarg" ;; - -- --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;; -+ --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;; - - --with-gcc) with_gcc=yes ;; - --with-gnu-ld) with_gnu_ld=yes ;; - - --disable-lock) need_locks=no ;; - -+ --cache-file=*) cache_file="$optarg" ;; -+ - -*) - echo "$progname: unrecognized option \`$option'" 1>&2 - echo "$help" 1>&2 -@@ -326,8 +369,13 @@ - # Only set LANG and LC_ALL to C if already set. - # These must not be set unconditionally because not all systems understand - # e.g. LANG=C (notably SCO). --if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi --if test "${LANG+set}" = set; then LANG=C; export LANG; fi -+if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi -+if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi -+ -+if test -n "$cache_file" && test -r "$cache_file"; then -+ echo "loading cache $cache_file within ltconfig" -+ . $cache_file -+fi - - if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. -@@ -343,7 +391,7 @@ - - if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. -- srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'` -+ srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. - fi - -@@ -414,7 +462,7 @@ - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. -- if test "${COLLECT_NAMES+set}" != set; then -+ if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi -@@ -429,15 +477,18 @@ - # Set a sane default for `AR'. - test -z "$AR" && AR=ar - -+# Set a sane default for `OBJDUMP'. -+test -z "$OBJDUMP" && OBJDUMP=objdump -+ - # If RANLIB is not set, then run the test. - if test "${RANLIB+set}" != "set"; then - result=no - - echo $ac_n "checking for ranlib... $ac_c" 1>&6 -- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" -+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. -- if test -f $dir/ranlib; then -+ if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then - RANLIB="ranlib" - result="ranlib" - break -@@ -453,8 +504,9 @@ - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - fi - --# Set sane defaults for `DLLTOOL' and `AS', used on cygwin32. -+# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. - test -z "$DLLTOOL" && DLLTOOL=dlltool -+test -z "$OBJDUMP" && OBJDUMP=objdump - test -z "$AS" && AS=as - - # Check to see if we are using GCC. -@@ -462,11 +514,10 @@ - # If CC is not set, then try to find GCC or a usable CC. - if test -z "$CC"; then - echo $ac_n "checking for gcc... $ac_c" 1>&6 -- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" -+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do -- IFS="$save_ifs" - test -z "$dir" && dir=. -- if test -f $dir/gcc; then -+ if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then - CC="gcc" - break - fi -@@ -483,11 +534,11 @@ - # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". - if test -z "$CC"; then - echo $ac_n "checking for cc... $ac_c" 1>&6 -- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" -+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - cc_rejected=no - for dir in $PATH; do - test -z "$dir" && dir=. -- if test -f $dir/cc; then -+ if test -f $dir/cc || test -f $dir/cc$ac_exeext; then - if test "$dir/cc" = "/usr/ucb/cc"; then - cc_rejected=yes - continue -@@ -527,7 +578,7 @@ - # Now see if the compiler is really GCC. - with_gcc=no - echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 -- echo "$progname:530: checking whether we are using GNU C" >&5 -+ echo "$progname:581: checking whether we are using GNU C" >&5 - - $rm conftest.c - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then -+ if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - with_gcc=yes - fi - $rm conftest.c -@@ -549,8 +600,8 @@ - echo $ac_n "checking for object suffix... $ac_c" 1>&6 - $rm conftest* - echo 'int i = 1;' > conftest.c --echo "$progname:552: checking for object suffix" >& 5 --if { (eval echo $progname:553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then -+echo "$progname:603: checking for object suffix" >& 5 -+if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - -@@ -568,6 +619,38 @@ - $rm conftest* - echo "$ac_t$objext" 1>&6 - -+echo $ac_n "checking for executable suffix... $ac_c" 1>&6 -+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ ac_cv_exeext="no" -+ $rm conftest* -+ echo 'main () { return 0; }' > conftest.c -+ echo "$progname:629: checking for executable suffix" >& 5 -+ if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then -+ # Append any warnings to the config.log. -+ cat conftest.err 1>&5 -+ -+ for ac_file in conftest.*; do -+ case $ac_file in -+ *.c | *.err | *.$objext ) ;; -+ *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; -+ esac -+ done -+ else -+ cat conftest.err 1>&5 -+ echo "$progname: failed program was:" >&5 -+ cat conftest.c >&5 -+ fi -+ $rm conftest* -+fi -+if test "X$ac_cv_exeext" = Xno; then -+ exeext="" -+else -+ exeext="$ac_cv_exeext" -+fi -+echo "$ac_t$ac_cv_exeext" 1>&6 -+ - echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 - pic_flag= - special_shlib_compile_flags= -@@ -580,10 +663,19 @@ - link_static_flag='-static' - - case "$host_os" in -- aix3* | aix4* | irix5* | irix6* | osf3* | osf4*) -+ beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -- cygwin32* | mingw32* | os2*) -+ aix*) -+ # Below there is a dirty hack to force normal static linking with -ldl -+ # The problem is because libdl dynamically linked with both libc and -+ # libC (AIX C++ library), which obviously doesn't included in libraries -+ # list by gcc. This cause undefined symbols with -static flags. -+ # This hack allows C programs to be linked with "-static -ldl", but -+ # we not sure about C++ programs. -+ link_static_flag="$link_static_flag ${wl}-lC" -+ ;; -+ cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - amigaos*) -@@ -592,6 +684,11 @@ - # like `-m68040'. - pic_flag='-m68020 -resident32 -malways-restore-a4' - ;; -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ pic_flag=-Kconform_pic -+ fi -+ ;; - *) - pic_flag='-fPIC' - ;; -@@ -617,11 +714,11 @@ - # PIC (with -KPIC) is the default. - ;; - -- cygwin32* | mingw32* | os2*) -+ cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - -- osf3* | osf4*) -+ osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - wl='-Wl,' - link_static_flag='-non_shared' -@@ -645,7 +742,7 @@ - wl='-Qoption ld ' - ;; - -- sysv4.2uw2* | sysv5*) -+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' -@@ -655,7 +752,12 @@ - pic_flag='-pic' - link_static_flag='-Bstatic' - ;; -- -+ sysv4*MP*) -+ if test -d /usr/nec ;then -+ pic_flag='-Kconform_pic' -+ link_static_flag='-Bstatic' -+ fi -+ ;; - *) - can_build_shared=no - ;; -@@ -671,22 +773,30 @@ - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $pic_flag -DPIC" -- echo "$progname:674: checking if $compiler PIC flag $pic_flag works" >&5 -- if { (eval echo $progname:675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then -+ echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 -+ if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 -- -- # On HP-UX, both CC and GCC only warn that PIC is supported... then they -- # create non-PIC objects. So, if there were any warnings, we assume that -- # PIC is not supported. -- if test -s conftest.err; then -- echo "$ac_t"no 1>&6 -- can_build_shared=no -- pic_flag= -- else -+ -+ case "$host_os" in -+ hpux9* | hpux10* | hpux11*) -+ # On HP-UX, both CC and GCC only warn that PIC is supported... then they -+ # create non-PIC objects. So, if there were any warnings, we assume that -+ # PIC is not supported. -+ if test -s conftest.err; then -+ echo "$ac_t"no 1>&6 -+ can_build_shared=no -+ pic_flag= -+ else -+ echo "$ac_t"yes 1>&6 -+ pic_flag=" $pic_flag" -+ fi -+ ;; -+ *) - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" -- fi -+ ;; -+ esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 -@@ -702,16 +812,26 @@ - - # Check to see if options -o and -c are simultaneously supported by compiler - echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 -+$rm -r conftest 2>/dev/null -+mkdir conftest -+cd conftest - $rm conftest* - echo "int some_variable = 0;" > conftest.c -+mkdir out -+# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -+# that will create temporary files in the current directory regardless of -+# the output directory. Thus, making CWD read-only will cause this test -+# to fail, enabling locking or at least warning the user not to do parallel -+# builds. -+chmod -w . - save_CFLAGS="$CFLAGS" --CFLAGS="$CFLAGS -c -o conftest2.o" --echo "$progname:709: checking if $compiler supports -c -o file.o" >&5 --if { (eval echo $progname:710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then -+CFLAGS="$CFLAGS -o out/conftest2.o" -+echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 -+if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings -- if test -s conftest.err; then -+ if test -s out/conftest.err; then - echo "$ac_t"no 1>&6 - compiler_c_o=no - else -@@ -720,12 +840,17 @@ - fi - else - # Append any errors to the config.log. -- cat conftest.err 1>&5 -+ cat out/conftest.err 1>&5 - compiler_c_o=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" --$rm conftest* -+chmod u+w . -+$rm conftest* out/* -+rmdir out -+cd .. -+rmdir conftest -+$rm -r conftest 2>/dev/null - - if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo -@@ -734,8 +859,8 @@ - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" -- echo "$progname:737: checking if $compiler supports -c -o file.lo" >&5 --if { (eval echo $progname:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then -+ echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 -+if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings -@@ -743,8 +868,8 @@ - echo "$ac_t"no 1>&6 - compiler_o_lo=no - else -- echo "$ac_t"yes 1>&6 -- compiler_o_lo=yes -+ echo "$ac_t"yes 1>&6 -+ compiler_o_lo=yes - fi - else - # Append any errors to the config.log. -@@ -786,17 +911,17 @@ - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" -- echo "$progname:789: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -- if { (eval echo $progname:790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then -+ echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -+ if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then -- echo "$ac_t"no 1>&6 -- compiler_rtti_exceptions=no -+ echo "$ac_t"no 1>&6 -+ compiler_rtti_exceptions=no - else -- echo "$ac_t"yes 1>&6 -- compiler_rtti_exceptions=yes -+ echo "$ac_t"yes 1>&6 -+ compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. -@@ -830,8 +955,8 @@ - echo 'main(){return(0);}' > conftest.c - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $link_static_flag" --echo "$progname:833: checking if $compiler static flag $link_static_flag works" >&5 --if { (eval echo $progname:834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then -+echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 -+if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - echo "$ac_t$link_static_flag" 1>&6 - else - echo "$ac_t"none 1>&6 -@@ -843,9 +968,9 @@ - if test -z "$LN_S"; then - # Check to see if we can use ln -s, or we need hard links. - echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 -- $rm conftestdata -- if ln -s X conftestdata 2>/dev/null; then -- $rm conftestdata -+ $rm conftest.dat -+ if ln -s X conftest.dat 2>/dev/null; then -+ $rm conftest.dat - LN_S="ln -s" - else - LN_S=ln -@@ -863,48 +988,18 @@ - if test "$with_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 -- echo "$progname:866: checking for ld used by GCC" >&5 -+ echo "$progname:991: checking for ld used by GCC" >&5 - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. -- /* | [A-Za-z]:/*) -+ [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -- sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%' -- # Canonicalize the path of ld -- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` -- done -- case "$host_os" in -- cygwin*) -- # Convert to a UNC path for cygwin -- test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"` -- ;; -- *) -- test -z "$LD" && LD="$ac_prog" -- ;; -- esac -- ;; -- ## -- ## FIXME: The code fails later on if we try to use an $LD with -- ## '\\' path separators. -- ## -- [A-Za-z]:[\\]*) -- re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)' -- sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%' -- sub_uncdir='s%\\%/%g' - # Canonicalize the path of ld -+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -- ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"` -+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done -- case "$host_os" in -- cygwin*) -- # Convert to a UNC path for cygwin -- test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"` -- ;; -- *) -- test -z "$LD" && LD="$ac_prog" -- ;; -- esac -+ test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we are not using GCC. -@@ -917,17 +1012,17 @@ - esac - elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld... $ac_c" 1>&6 -- echo "$progname:920: checking for GNU ld" >&5 -+ echo "$progname:1015: checking for GNU ld" >&5 - else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -- echo "$progname:923: checking for non-GNU ld" >&5 -+ echo "$progname:1018: checking for non-GNU ld" >&5 - fi - - if test -z "$LD"; then -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. -- if test -f "$ac_dir/$ac_prog"; then -+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. -@@ -969,130 +1064,208 @@ - - allow_undefined_flag= - no_undefined_flag= -+need_lib_prefix=unknown -+need_version=unknown -+# when you set need_version to no, make sure it does not cause -set_version -+# flags to be left without arguments - archive_cmds= --archive_sym_cmds= -+archive_expsym_cmds= - old_archive_from_new_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= -+thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - runpath_var= -+always_export_symbols=no -+export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -+# include_expsyms should be a list of space-separated symbols to be *always* -+# included in the symbol list -+include_expsyms= -+# exclude_expsyms can be an egrep regular expression of symbols to exclude -+# it will be wrapped by ` (' and `)$', so one must not match beginning or -+# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -+# as well as any symbol that contains `d'. -+exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -+# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -+# platforms (ab)use it in PIC code, but their linkers get confused if -+# the symbol is explicitly referenced. Since portable code cannot -+# rely on this symbol name, it's probably fine to never include it in -+# preloaded symbol tables. - - case "$host_os" in --aix3* | aix4*) -- # On AIX, the GNU linker works like the native linker. -- with_gnu_ld=no -+cygwin* | mingw*) -+ # FIXME: the MSVC++ port hasn't been tested in a loooong time -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ if test "$with_gcc" != yes; then -+ with_gnu_ld=no -+ fi - ;; -+ - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then -+ # If archive_cmds runs LD, not CC, wlarc should be empty -+ wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case "$host_os" in -+ aix3* | aix4*) -+ # On AIX, the GNU linker is very broken -+ ld_shlibs=no -+ cat <&2 -+ -+*** Warning: the GNU linker, at least up to release 2.9.1, is reported -+*** to be unable to reliably create shared libraries on AIX. -+*** Therefore, libtool is disabling shared libraries support. If you -+*** really care for shared libraries, you may want to modify your PATH -+*** so that a non-GNU linker is found, and then restart. -+ -+EOF -+ ;; -+ - amigaos*) -- archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' -+ archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes -- ;; - -- sunos4*) -- archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs' -- hardcode_direct=yes -- hardcode_minus_L=yes -- hardcode_shlibpath_var=no -+ # Samuel A. Falvo II reports -+ # that the semantics of dynamic libraries on AmigaOS, at least up -+ # to version 4, is to share data among multiple programs linked -+ # with the same dynamic library. Since this doesn't match the -+ # behavior of shared libraries on other platforms, we can use -+ # them. -+ ld_shlibs=no - ;; - -- cygwin32* | mingw32*) -- if test "$with_gcc" = yes; then -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec='-L$libdir' -+ beos*) -+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported -- # Very, very bogus. -- echo ' --#define WIN32_LEAN_AND_MEAN --#include --#undef WIN32_LEAN_AND_MEAN --#include -+ # Joseph Beckenbach says some releases of gcc -+ # support --undefined. This deserves some investigation. FIXME -+ archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' -+ else -+ ld_shlibs=no -+ fi -+ ;; - --BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -+ cygwin* | mingw*) -+ # hardcode_libdir_flag_spec is actually meaningless, as there is -+ # no search path for DLLs. -+ hardcode_libdir_flag_spec='-L$libdir' -+ allow_undefined_flag=unsupported -+ always_export_symbols=yes - --#include --DECLARE_CYGWIN_DLL( DllMain ); --HINSTANCE __hDllInstance_base; -+ # Extract the symbol export list from an `--export-all' def file, -+ # then regenerate the def file from the symbol export list, so that -+ # the compiled dll only exports the symbol export list. -+ # Be careful not to strip the DATA tag left by newer dlltools. -+ export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ -+ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ -+ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ -+ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' -+ -+ # If DATA tags from a recent dlltool are present, honour them! -+ archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ -+ _lt_hint=1; -+ cat $export_symbols | while read symbol; do -+ set dummy \$symbol; -+ case \$# in -+ 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; -+ *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; -+ esac; -+ _lt_hint=`expr 1 + \$_lt_hint`; -+ done~ -+ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ -+ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ -+ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ -+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ -+ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ -+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ -+ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - --BOOL APIENTRY --DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) --{ -- __hDllInstance_base = hInst; -- return TRUE; --} --' > ltdll.c -- archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~ -- $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~ -- $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $rm ltdll.$objext $soname-base $soname-exp' -- archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~ -- cat "$export_symbols" >> $lib-def~ -- $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $rm ltdll.$objext $soname-base $soname-exp' -- old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp' -- else -- # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++. -- with_gnu_ld=no -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec=' ' -- allow_undefined_flag=unsupported -- # Tell ltmain to make .lib files, not .a files. -- libext=lib -- # FIXME: Setting linknames here is a bad hack. -- archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' -- # The linker will automatically build a .lib file if we build a DLL. -- old_archive_from_new_cmds='true' -- # FIXME: Should let the user specify the lib program. -- old_archive_cmds='lib /OUT:$oldlib$oldobjs' -- fix_srcfile_path='`cygpath -w $srcfile`' -+ old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' -+ ;; -+ -+ netbsd*) -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' -+ # can we support soname and/or expsyms with a.out? -oliva - fi - ;; - -+ solaris* | sysv5*) -+ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then -+ ld_shlibs=no -+ cat <&2 -+ -+*** Warning: The releases 2.8.* of the GNU linker cannot reliably -+*** create shared libraries on Solaris systems. Therefore, libtool -+*** is disabling shared libraries support. We urge you to upgrade GNU -+*** binutils to release 2.9.1 or newer. Another option is to modify -+*** your PATH or compiler configuration so that the native linker is -+*** used, and then restart. -+ -+EOF -+ elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -+ else -+ ld_shlibs=no -+ fi -+ ;; -+ -+ sunos4*) -+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' -+ wlarc= -+ hardcode_direct=yes -+ hardcode_shlibpath_var=no -+ ;; -+ - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then -- archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs' -- archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib$libobjs$deplibs' -+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' -+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - -- if test "$ld_shlibs" = yes && test "$with_gnu_ld" = yes; then -+ if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' -- whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' -+ case $host_os in -+ cygwin* | mingw*) -+ # dlltool doesn't understand --whole-archive et. al. -+ whole_archive_flag_spec= -+ ;; -+ *) -+ # ancient GNU ld didn't support --whole-archive et. al. -+ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then -+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' -+ else -+ whole_archive_flag_spec= -+ fi -+ ;; -+ esac - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case "$host_os" in - aix3*) - allow_undefined_flag=unsupported -- archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~ -- $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' -- archive_sym_cmds='$LD -o $objdir/$soname$libobjs$deplibs -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' -+ always_export_symbols=yes -+ archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes -@@ -1104,80 +1277,67 @@ - ;; - - aix4*) -- allow_undefined_flag=unsupported -- archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp else cat $export_symbols > $lib.exp~ -- $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname' -- archive_sym_cmds='$CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname' -- hardcode_direct=yes -- hardcode_minus_L=yes -- ;; -+ hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' -+ hardcode_libdir_separator=':' -+ if test "$with_gcc" = yes; then -+ collect2name=`${CC} -print-prog-name=collect2` -+ if test -f "$collect2name" && \ -+ strings "$collect2name" | grep resolve_lib_name >/dev/null -+ then -+ # We have reworked collect2 -+ hardcode_direct=yes -+ else -+ # We have old collect2 -+ hardcode_direct=unsupported -+ # It fails to find uninstalled libraries when the uninstalled -+ # path is not listed in the libpath. Setting hardcode_minus_L -+ # to unsupported forces relinking -+ hardcode_minus_L=yes -+ hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_separator= -+ fi -+ shared_flag='-shared' -+ else -+ shared_flag='${wl}-bM:SRE' -+ hardcode_direct=yes -+ fi -+ allow_undefined_flag=' ${wl}-berok' -+ archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' -+ archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' -+ case "$host_os" in aix4.[01]|aix4.[01].*) -+ # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on -+ always_export_symbols=yes ;; -+ esac -+ ;; - - amigaos*) -- archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' -+ archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes -+ # see comment about different semantics on the GNU ld section -+ ld_shlibs=no - ;; - -- cygwin32* | mingw32*) -- if test "$with_gcc" = yes; then -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec='-L$libdir' -- allow_undefined_flag=unsupported -- # Very, very bogus. -- echo ' --#define WIN32_LEAN_AND_MEAN --#include --#undef WIN32_LEAN_AND_MEAN --#include -- --BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -- --#include --DECLARE_CYGWIN_DLL( DllMain ); --HINSTANCE __hDllInstance_base; -+ cygwin* | mingw*) -+ # When not using gcc, we currently assume that we are using -+ # Microsoft Visual C++. -+ # hardcode_libdir_flag_spec is actually meaningless, as there is -+ # no search path for DLLs. -+ hardcode_libdir_flag_spec=' ' -+ allow_undefined_flag=unsupported -+ # Tell ltmain to make .lib files, not .a files. -+ libext=lib -+ # FIXME: Setting linknames here is a bad hack. -+ archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' -+ # The linker will automatically build a .lib file if we build a DLL. -+ old_archive_from_new_cmds='true' -+ # FIXME: Should let the user specify the lib program. -+ old_archive_cmds='lib /OUT:$oldlib$oldobjs' -+ fix_srcfile_path='`cygpath -w $srcfile`' -+ ;; - --BOOL APIENTRY --DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) --{ -- __hDllInstance_base = hInst; -- return TRUE; --} --' > ltdll.c -- archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~ -- $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~ -- $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $rm ltdll.$objext $soname-base $soname-exp' -- archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~ -- cat "$export_symbols" >> $lib-def~ -- $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~ -- $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~ -- $rm ltdll.$objext $soname-base $soname-exp' -- old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp' -- else -- # When not using gcc, we currently assume that we are using -- # Microsoft Visual C++. -- # hardcode_libdir_flag_spec is actually meaningless, as there is -- # no search path for DLLs. -- hardcode_libdir_flag_spec=' ' -- allow_undefined_flag=unsupported -- # Tell ltmain to make .lib files, not .a files. -- libext=lib -- # FIXME: Setting linknames here is a bad hack. -- archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' -- # The linker will automatically build a .lib file if we build a DLL. -- old_archive_from_new_cmds='true' -- # FIXME: Should let the user specify the lib program. -- old_archive_cmds='lib /OUT:$oldlib$oldobjs' -- fix_srcfile_path='`cygpath -w $srcfile`' -- fi -+ freebsd1*) -+ ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor -@@ -1185,65 +1345,64 @@ - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) -- archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o' -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes -- hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) -- archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - -- # FreeBSD 3, at last, uses gcc -shared to do shared libraries. -- freebsd3*) -- archive_cmds='$CC -shared -o $lib$libobjs$deplibs' -+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. -+ freebsd*) -+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes -- hardcode_minus_L=no - hardcode_shlibpath_var=no - ;; - -- hpux9*) -- archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs~test $objdir/$soname = $lib || mv $objdir/$soname $lib' -- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' -- hardcode_direct=yes -- hardcode_minus_L=yes -- export_dynamic_flag_spec='${wl}-E' -- ;; -- -- hpux10* | hpux11*) -- archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs' -+ hpux9* | hpux10* | hpux11*) -+ case "$host_os" in -+ hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; -+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; -+ esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' -+ hardcode_libdir_separator=: - hardcode_direct=yes -- hardcode_minus_L=yes -+ hardcode_minus_L=yes # Not in the search PATH, but as the default -+ # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$with_gcc" = yes; then -- archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs' -+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else -- archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs' -+ archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator=: - ;; - - netbsd*) -- # Tested with NetBSD 1.2 ld -- archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' -- hardcode_libdir_flag_spec='-R$libdir' -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out -+ else -+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF -+ fi -+ hardcode_libdir_flag_spec='${wl}-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - openbsd*) -- archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' -+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no -@@ -1253,102 +1412,169 @@ - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported -- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp$libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib$libobjs$deplibs $objdir/$libname.def' -+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' - ;; - -- osf3* | osf4*) -+ osf3*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -- archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs' -+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' -- archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs' -+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - -- sco3.2v5*) -- archive_cmds='$LD -G -o $lib$libobjs$deplibs' -+ osf4* | osf5*) # As osf3* with the addition of the -msym flag -+ if test "$with_gcc" = yes; then -+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' -+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' -+ else -+ allow_undefined_flag=' -expect_unresolved \*' -+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' -+ fi -+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -+ hardcode_libdir_separator=: -+ ;; -+ rhapsody*) -+ archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' -+ hardcode_libdir_flags_spec='-L$libdir' - hardcode_direct=yes -+ hardcode_shlibpath_var=no -+ ;; -+ -+ sco3.2v5*) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' -+ hardcode_shlibpath_var=no -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now -- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs$deplibs' -- archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" >> $lib.exp~ -- $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib$libobjs$deplibs~$rm $lib.exp' -+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' -+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no -- -- # Solaris 2 before 2.5 hardcodes -L paths. - case "$host_os" in -- solaris2.[0-4]*) -- hardcode_minus_L=yes -- ;; -+ solaris2.[0-5] | solaris2.[0-5].*) ;; -+ *) # Supported since Solaris 2.6 (maybe 2.5.1?) -+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - ;; - - sunos4*) -- # Why do we need -Bstatic? To avoid inter-library dependencies, maybe... -- if test "$with_gcc" = yes; then -- archive_cmds='$CC -shared ${wl}-Bstatic -o $lib$libobjs$deplibs' -- else -- archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs' -- fi -+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - -+ sysv4) -+ if test "x$host_vendor" = xsequent; then -+ # Use $CC to link under sequent, because it throws in some extra .o -+ # files that make .init and .fini sections work. -+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' -+ else -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' -+ fi -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var=no -+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie -+ ;; -+ -+ sysv4.3*) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' -+ hardcode_shlibpath_var=no -+ export_dynamic_flag_spec='-Bexport' -+ ;; -+ -+ sysv5*) -+ no_undefined_flag=' -z text' -+ # $CC -shared without GNU ld will not create a library from C++ -+ # object files and a static libstdc++, better avoid it by now -+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' -+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ -+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' -+ hardcode_libdir_flag_spec= -+ hardcode_shlibpath_var=no -+ runpath_var='LD_RUN_PATH' -+ ;; -+ - uts4*) -- archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' -- hardcode_direct=no -- hardcode_minus_L=no - hardcode_shlibpath_var=no - ;; - - dgux*) -- archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' -- hardcode_direct=no -+ hardcode_shlibpath_var=no -+ ;; -+ -+ sysv4*MP*) -+ if test -d /usr/nec; then -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' -+ hardcode_shlibpath_var=no -+ runpath_var=LD_RUN_PATH -+ hardcode_runpath_var=yes -+ ld_shlibs=yes -+ fi -+ ;; -+ -+ sysv4.2uw2*) -+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' -+ hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no -+ hardcode_runpath_var=yes -+ runpath_var=LD_RUN_PATH -+ ;; -+ -+ unixware7*) -+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' -+ runpath_var='LD_RUN_PATH' -+ hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no -- can_build_shared=no - ;; - esac - fi - echo "$ac_t$ld_shlibs" 1>&6 -+test "$ld_shlibs" = no && can_build_shared=no - - if test -z "$NM"; then - echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 - case "$NM" in -- /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path. -+ [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. - *) -- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" -- for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" -+ for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do - test -z "$ac_dir" && ac_dir=. -- if test -f $ac_dir/nm; then -- # Check to see if the nm accepts a BSD-compat flag. -- # Adding the `sed 1q' prevents false positives on HP-UX, which says: -- # nm: unknown option "B" ignored -- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then -- NM="$ac_dir/nm -B" -- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then -- NM="$ac_dir/nm -p" -+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then -+ # Check to see if the nm accepts a BSD-compat flag. -+ # Adding the `sed 1q' prevents false positives on HP-UX, which says: -+ # nm: unknown option "B" ignored -+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then -+ NM="$ac_dir/nm -B" -+ break -+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then -+ NM="$ac_dir/nm -p" -+ break - else -- NM="$ac_dir/nm" -+ NM=${NM="$ac_dir/nm"} # keep the first match, but -+ continue # so that we can try to find one that supports BSD flags - fi -- break - fi - done - IFS="$ac_save_ifs" -@@ -1365,52 +1591,54 @@ - # [They come from Ultrix. What could be older than Ultrix?!! ;)] - - # Character class describing NM global symbol codes. --symcode='[BCDEGRSTU]' -+symcode='[BCDEGRST]' - - # Regexp to match symbols that can be accessed directly from C. - sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - - # Transform the above into a raw symbol and a C symbol. --symxfrm='\1 \1' -+symxfrm='\1 \2\3 \3' -+ -+# Transform an extracted symbol line into a proper C declaration -+global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - - # Define system-specific variables. - case "$host_os" in - aix*) -- symcode='[BCDTU]' -+ symcode='[BCDT]' -+ ;; -+cygwin* | mingw*) -+ symcode='[ABCDGISTW]' - ;; --sunos* | cygwin32* | mingw32*) -- sympat='_\([_A-Za-z][_A-Za-z0-9]*\)' -- symxfrm='_\1 \1' -+hpux*) # Its linker distinguishes data from code symbols -+ global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" - ;; - irix*) -- # Cannot use undefined symbols on IRIX because inlined functions mess us up. - symcode='[BCDEGRST]' - ;; - solaris*) -- symcode='[BDTU]' -+ symcode='[BDT]' -+ ;; -+sysv4) -+ symcode='[DFNSTU]' - ;; - esac - - # If we're using GNU nm, then use its standard symbol codes. - if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then -- symcode='[ABCDGISTUW]' -+ symcode='[ABCDGISTW]' - fi - --case "$host_os" in --cygwin32* | mingw32*) -- # We do not want undefined symbols on cygwin32. The user must -- # arrange to define them via -l arguments. -- symcode='[ABCDGISTW]' -- ;; --esac -+# Try without a prefix undercore, then with it. -+for ac_symprfx in "" "_"; do - --# Write the raw and C identifiers. --global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'" -+ # Write the raw and C identifiers. -+ global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" - --# Check to see that the pipe works correctly. --pipe_works=no --$rm conftest* --cat > conftest.c < conftest.c <&5 --if { (eval echo $progname:1426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then -- # Now try to grab the symbols. -- nlist=conftest.nm -- if { echo "$progname:1429: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then -- -- # Try sorting and uniquifying the output. -- if sort "$nlist" | uniq > "$nlist"T; then -- mv -f "$nlist"T "$nlist" -- wcout=`wc "$nlist" 2>/dev/null` -- count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'` -- (test "$count" -ge 0) 2>/dev/null || count=-1 -- else -- rm -f "$nlist"T -- count=-1 -- fi -+ echo "$progname:1653: checking if global_symbol_pipe works" >&5 -+ if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then -+ # Now try to grab the symbols. -+ nlist=conftest.nm -+ if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then -+ -+ # Try sorting and uniquifying the output. -+ if sort "$nlist" | uniq > "$nlist"T; then -+ mv -f "$nlist"T "$nlist" -+ else -+ rm -f "$nlist"T -+ fi - -- # Make sure that we snagged all the symbols we need. -- if egrep ' nm_test_var$' "$nlist" >/dev/null; then -- if egrep ' nm_test_func$' "$nlist" >/dev/null; then -- cat < conftest.c -+ # Make sure that we snagged all the symbols we need. -+ if egrep ' nm_test_var$' "$nlist" >/dev/null; then -+ if egrep ' nm_test_func$' "$nlist" >/dev/null; then -+ cat < conftest.c - #ifdef __cplusplus - extern "C" { - #endif - - EOF -- # Now generate the symbol file. -- sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c -+ # Now generate the symbol file. -+ eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' - -- cat <> conftest.c -+ cat <> conftest.c - #if defined (__STDC__) && __STDC__ --# define __ptr_t void * -+# define lt_ptr_t void * - #else --# define __ptr_t char * -+# define lt_ptr_t char * -+# define const - #endif - --/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */ --int dld_preloaded_symbol_count = $count; -- - /* The mapping between symbol names and symbols. */ --struct { -- char *name; -- __ptr_t address; -+const struct { -+ const char *name; -+ lt_ptr_t address; - } --dld_preloaded_symbols[] = -+lt_preloaded_symbols[] = - { - EOF -- sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c -- cat <<\EOF >> conftest.c -- {0, (__ptr_t) 0} -+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c -+ cat <<\EOF >> conftest.c -+ {0, (lt_ptr_t) 0} - }; - - #ifdef __cplusplus - } - #endif - EOF -- # Now try linking the two files. -- mv conftest.$objext conftestm.$objext -- save_LIBS="$LIBS" -- save_CFLAGS="$CFLAGS" -- LIBS="conftestm.$objext" -- CFLAGS="$CFLAGS$no_builtin_flag" -- if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then -- pipe_works=yes -- else -- echo "$progname: failed program was:" >&5 -- cat conftest.c >&5 -- fi -- LIBS="$save_LIBS" -+ # Now try linking the two files. -+ mv conftest.$objext conftstm.$objext -+ save_LIBS="$LIBS" -+ save_CFLAGS="$CFLAGS" -+ LIBS="conftstm.$objext" -+ CFLAGS="$CFLAGS$no_builtin_flag" -+ if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then -+ pipe_works=yes -+ else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.c >&5 -+ fi -+ LIBS="$save_LIBS" -+ else -+ echo "cannot find nm_test_func in $nlist" >&5 -+ fi - else -- echo "cannot find nm_test_func in $nlist" >&5 -+ echo "cannot find nm_test_var in $nlist" >&5 - fi - else -- echo "cannot find nm_test_var in $nlist" >&5 -+ echo "cannot run $global_symbol_pipe" >&5 - fi - else -- echo "cannot run $global_symbol_pipe" >&5 -+ echo "$progname: failed program was:" >&5 -+ cat conftest.c >&5 - fi -+ $rm conftest* conftst* -+ -+ # Do not use the global_symbol_pipe unless it works. -+ if test "$pipe_works" = yes; then -+ break -+ else -+ global_symbol_pipe= -+ fi -+done -+if test "$pipe_works" = yes; then -+ echo "${ac_t}ok" 1>&6 - else -- echo "$progname: failed program was:" >&5 -- cat conftest.c >&5 -+ echo "${ac_t}failed" 1>&6 - fi --$rm conftest* - --# Do not use the global_symbol_pipe unless it works. --echo "$ac_t$pipe_works" 1>&6 --test "$pipe_works" = yes || global_symbol_pipe= -+if test -z "$global_symbol_pipe"; then -+ global_symbol_to_cdecl= -+fi - - # Check hardcoding attributes. - echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 -@@ -1517,10 +1752,12 @@ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. -- if test "$hardcode_direct" != no && \ -- test "$hardcode_minus_L" != no && \ -- test "$hardcode_shlibpath_var" != no; then -- -+ if test "$hardcode_direct" != no && -+ # If the only mechanism to avoid hardcoding is shlibpath_var, we -+ # have to relink, otherwise we might link with an installed library -+ # when we should be linking with a yet-to-be-installed one -+ ## test "$hardcode_shlibpath_var" != no && -+ test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else -@@ -1552,26 +1789,27 @@ - finish_cmds= - finish_eval= - shlibpath_var= -+shlibpath_overrides_runpath=unknown - version_type=none - dynamic_linker="$host_os ld.so" --sys_lib_search_path="/lib /usr/lib /usr/local/lib" --check_shared_deplibs_method='none' -+sys_lib_dlsearch_path_spec="/lib /usr/lib" -+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -+file_magic_cmd= -+file_magic_test_file= -+deplibs_check_method='unknown' - # Need to set the preceding variable on all platforms that support - # interlibrary dependencies. - # 'none' -- dependencies not supported. -+# `unknown' -- same as none, but documents that we really don't know. - # 'pass_all' -- all dependencies passed with no checks. - # 'test_compile' -- check by making test program. --# 'file_regex' -- check by looking for filenames that look like the shared --# library in the library path. --# 'file_magic [regex]' -- check by looking for files in library path which --# responds to the "file" command with a given regex. This is actually a --# superset of the file_regex command. If you have file on your system, you'll --# want to use this instead. --# Notes: regexes are run through expr. -- -+# 'file_magic [regex]' -- check by looking for files in library path -+# which responds to the $file_magic_cmd with a given egrep regex. -+# If you have `file' or equivalent on your system and you're not sure -+# whether `pass_all' will *always* work, you probably want this one. - echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 - case "$host_os" in --aix3* | aix4*) -+aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH -@@ -1580,44 +1818,111 @@ - soname_spec='${libname}${release}.so$major' - ;; - -+aix4*) -+ version_type=linux -+ # AIX has no versioning support, so currently we can not hardcode correct -+ # soname into executable. Probably we can add versioning support to -+ # collect2, so additional links can be useful in future. -+ # We preserve .a as extension for shared libraries though AIX4.2 -+ # and later linker supports .so -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' -+ shlibpath_var=LIBPATH -+ deplibs_check_method=pass_all -+ ;; -+ - amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -+beos*) -+ library_names_spec='${libname}.so' -+ dynamic_linker="$host_os ld.so" -+ shlibpath_var=LIBRARY_PATH -+ deplibs_check_method=pass_all -+ lt_cv_dlopen="load_add_on" -+ lt_cv_dlopen_libs= -+ lt_cv_dlopen_self=yes -+ ;; -+ - bsdi4*) - version_type=linux -- library_names_spec='${libname}.so.$major ${libname}.so' -- soname_spec='${libname}.so' -- finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir' -+ need_version=no -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -+ soname_spec='${libname}${release}.so$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH -+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' -+ file_magic_cmd=/usr/bin/file -+ file_magic_test_file=/shlib/libc.so -+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" -+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" -+ export_dynamic_flag_spec=-rdynamic -+ # the default ld.so.conf also contains /usr/contrib/lib and -+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow -+ # libtool to hard-code these into programs - ;; - --cygwin32* | mingw32*) -+cygwin* | mingw*) - version_type=windows -+ need_version=no -+ need_lib_prefix=no - if test "$with_gcc" = yes; then - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' - else - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - fi - dynamic_linker='Win32 ld.exe' -- libname_spec='$name' -+ deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' -+ file_magic_cmd='${OBJDUMP} -f' -+ # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH -+ lt_cv_dlopen="LoadLibrary" -+ lt_cv_dlopen_libs= - ;; - --freebsd2* | freebsd3*) -+freebsd1*) -+ dynamic_linker=no -+ ;; -+ -+freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat -- library_names_spec='${libname}${release}.so$versuffix $libname.so' -- finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir' -+ case "$version_type" in -+ freebsd-elf*) -+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' -+ file_magic_cmd=/usr/bin/file -+ file_magic_test_file=`echo /usr/lib/libc.so*` -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' -+ need_version=no -+ need_lib_prefix=no -+ ;; -+ freebsd-*) -+ deplibs_check_method=unknown -+ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' -+ need_version=yes -+ ;; -+ esac - shlibpath_var=LD_LIBRARY_PATH -+ case "$host_os" in -+ freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) -+ shlibpath_overrides_runpath=yes -+ ;; -+ *) # from 3.2 on -+ shlibpath_overrides_runpath=no -+ ;; -+ esac - ;; - - gnu*) - version_type=linux -- library_names_spec='${libname}${release}.so$versuffix ${libname}.so' -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' -+ soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH -+ deplibs_check_method=pass_all - ;; - - hpux9* | hpux10* | hpux11*) -@@ -1625,25 +1930,52 @@ - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos -+ need_lib_prefix=no -+ need_version=no - shlibpath_var=SHLIB_PATH -+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' -+ case "$host_os" in -+ hpux10.20*) -+ # TODO: Does this work for hpux-11 too? -+ deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' -+ file_magic_cmd=/usr/bin/file -+ file_magic_test_file=/usr/lib/libc.sl -+ ;; -+ esac - ;; - --irix5*) -- version_type=osf -- soname_spec='${libname}${release}.so' -- library_names_spec='${libname}${release}.so$versuffix $libname.so' -- shlibpath_var=LD_LIBRARY_PATH -- ;; -- --irix6*) -- version_type=osf -- soname_spec='${libname}${release}.so' -- library_names_spec='${libname}${release}.so$versuffix $libname.so' -- shlibpath_var=LD_LIBRARYN32_PATH -+irix5* | irix6*) -+ version_type=irix -+ need_lib_prefix=no -+ need_version=no -+ soname_spec='${libname}${release}.so.$major' -+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' -+ case "$host_os" in -+ irix5*) -+ libsuff= shlibsuff= -+ # this will be overridden with pass_all, but let us keep it just in case -+ deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" -+ ;; -+ *) -+ case "$LD" in # libtool.m4 will add one of these switches to LD -+ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; -+ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; -+ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; -+ *) libsuff= shlibsuff= libmagic=never-match;; -+ esac -+ ;; -+ esac -+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" -+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" -+ file_magic_cmd=/usr/bin/file -+ file_magic_test_file=`echo /lib${libsuff}/libc.so*` -+ deplibs_check_method='pass_all' - ;; - - # No shared lib support for Linux oldld, aout, or coff. -@@ -1654,12 +1986,14 @@ - # This must be Linux ELF. - linux-gnu*) - version_type=linux -+ need_lib_prefix=no -+ need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH -- check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object' -- sys_lib_search_path="/lib /usr/lib /usr/local/lib `echo $LD_LIBRARY_PATH | sed -e 's/:/ /g'`" -+ shlibpath_overrides_runpath=no -+ deplibs_check_method=pass_all - - if test -f /lib/ld.so.1; then - dynamic_linker='GNU ld.so' -@@ -1672,26 +2006,60 @@ - fi - ;; - --netbsd* | openbsd*) -+netbsd*) -+ version_type=sunos -+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then -+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' -+ dynamic_linker='NetBSD (a.out) ld.so' -+ else -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' -+ soname_spec='${libname}${release}.so$major' -+ dynamic_linker='NetBSD ld.elf_so' -+ fi -+ shlibpath_var=LD_LIBRARY_PATH -+ ;; -+ -+openbsd*) - version_type=sunos -- library_names_spec='${libname}${release}.so$versuffix' -+ if test "$with_gnu_ld" = yes; then -+ need_lib_prefix=no -+ need_version=no -+ fi -+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - - os2*) - libname_spec='$name' -+ need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - --osf3* | osf4*) -+osf3* | osf4* | osf5*) - version_type=osf -+ need_version=no - soname_spec='${libname}${release}.so' -- library_names_spec='${libname}${release}.so$versuffix $libname.so' -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH -- check_shared_deplibs_method='pass_all' -+ # this will be overridden with pass_all, but let us keep it just in case -+ deplibs_check_method='file_magic COFF format alpha shared library' -+ file_magic_cmd=/usr/bin/file -+ file_magic_test_file=/shlib/libc.so -+ deplibs_check_method='pass_all' -+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" -+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" -+ ;; -+ -+rhapsody*) -+ version_type=sunos -+ library_names_spec='${libname}.so' -+ soname_spec='${libname}.so' -+ shlibpath_var=DYLD_LIBRARY_PATH -+ deplibs_check_method=pass_all - ;; - - sco3.2v5*) -@@ -1703,11 +2071,17 @@ - - solaris*) - version_type=linux -+ need_lib_prefix=no -+ need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' -+ deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" -+ file_magic_cmd=/usr/bin/file -+ file_magic_test_file=/lib/libc.so - ;; - - sunos4*) -@@ -1715,29 +2089,63 @@ - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=yes -+ if test "$with_gnu_ld" = yes; then -+ need_lib_prefix=no -+ fi -+ need_version=yes - ;; - --sysv4.2uw2*) -+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH -+ case "$host_vendor" in -+ sequent) -+ file_magic_cmd='/bin/file' -+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' -+ ;; -+ ncr) -+ deplibs_check_method='pass_all' -+ ;; -+ motorola) -+ need_lib_prefix=no -+ need_version=no -+ shlibpath_overrides_runpath=no -+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' -+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' -+ file_magic_cmd=/usr/bin/file -+ file_magic_test_file=`echo /usr/lib/libc.so*` -+ ;; -+ esac - ;; - - uts4*) - version_type=linux -- library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so' -- soname_spec='${libname}${release}.so.$major' -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -+ soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - - dgux*) - version_type=linux -+ need_lib_prefix=no -+ need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -+sysv4*MP*) -+ if test -d /usr/nec ;then -+ version_type=linux -+ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' -+ soname_spec='$libname.so.$major' -+ shlibpath_var=LD_LIBRARY_PATH -+ fi -+ ;; -+ - *) - dynamic_linker=no - ;; -@@ -1748,19 +2156,58 @@ - # Report the final consequences. - echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 - -+# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in -+# configure.in, otherwise build static only libraries. -+case "$host_os" in -+cygwin* | mingw* | os2*) -+ if test x$can_build_shared = xyes; then -+ test x$enable_win32_dll = xno && can_build_shared=no -+ echo "checking if package supports dlls... $can_build_shared" 1>&6 -+ fi -+;; -+esac -+ -+if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then -+ case "$deplibs_check_method" in -+ "file_magic "*) -+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" -+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | -+ egrep "$file_magic_regex" > /dev/null; then -+ : -+ else -+ cat <&2 -+ -+*** Warning: the command libtool uses to detect shared libraries, -+*** $file_magic_cmd, produces output that libtool cannot recognize. -+*** The result is that libtool may fail to recognize shared libraries -+*** as such. This will affect the creation of libtool libraries that -+*** depend on shared libraries, but programs linked with such libtool -+*** libraries will work regardless of this problem. Nevertheless, you -+*** may want to report the problem to your system manager and/or to -+*** bug-libtool@gnu.org -+ -+EOF -+ fi ;; -+ esac -+fi -+ - echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case "$host_os" in --aix*) -+aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -+ -+aix4*) -+ test "$enable_shared" = yes && enable_static=no -+ ;; - esac - - echo "$ac_t$enable_shared" 1>&6 -@@ -1770,6 +2217,15 @@ - - echo "checking whether to build static libraries... $enable_static" 1>&6 - -+if test "$hardcode_action" = relink; then -+ # Fast installation is not supported -+ enable_fast_install=no -+elif test "$shlibpath_overrides_runpath" = yes || -+ test "$enable_shared" = no; then -+ # Fast installation is not necessary -+ enable_fast_install=needless -+fi -+ - echo $ac_n "checking for objdir... $ac_c" 1>&6 - rm -f .libs 2>/dev/null - mkdir .libs 2>/dev/null -@@ -1782,6 +2238,449 @@ - rmdir .libs 2>/dev/null - echo "$ac_t$objdir" 1>&6 - -+if test "x$enable_dlopen" != xyes; then -+ enable_dlopen=unknown -+ enable_dlopen_self=unknown -+ enable_dlopen_self_static=unknown -+else -+if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then -+ lt_cv_dlopen=no lt_cv_dlopen_libs= -+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -+echo "$progname:2248: checking for dlopen in -ldl" >&5 -+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ ac_save_LIBS="$LIBS" -+LIBS="-ldl $LIBS" -+cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=yes" -+else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=no" -+fi -+rm -f conftest* -+LIBS="$ac_save_LIBS" -+ -+fi -+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -+else -+ echo "$ac_t""no" 1>&6 -+echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -+echo "$progname:2288: checking for dlopen" >&5 -+if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.$ac_ext < -+/* Override any gcc2 internal prototype to avoid an error. */ -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char dlopen(); -+ -+int main() { -+ -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_dlopen) || defined (__stub___dlopen) -+choke me -+#else -+dlopen(); -+#endif -+ -+; return 0; } -+EOF -+if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* -+ eval "ac_cv_func_dlopen=yes" -+else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_func_dlopen=no" -+fi -+rm -f conftest* -+fi -+if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ lt_cv_dlopen="dlopen" -+else -+ echo "$ac_t""no" 1>&6 -+echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -+echo "$progname:2335: checking for dld_link in -ldld" >&5 -+ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` -+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ ac_save_LIBS="$LIBS" -+LIBS="-ldld $LIBS" -+cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=yes" -+else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=no" -+fi -+rm -f conftest* -+LIBS="$ac_save_LIBS" -+ -+fi -+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -+else -+ echo "$ac_t""no" 1>&6 -+echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -+echo "$progname:2375: checking for shl_load" >&5 -+if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.$ac_ext < -+/* Override any gcc2 internal prototype to avoid an error. */ -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char shl_load(); -+ -+int main() { -+ -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_shl_load) || defined (__stub___shl_load) -+choke me -+#else -+shl_load(); -+#endif -+ -+; return 0; } -+EOF -+if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* -+ eval "ac_cv_func_shl_load=yes" -+else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_func_shl_load=no" -+fi -+rm -f conftest* -+fi -+ -+if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ lt_cv_dlopen="shl_load" -+else -+ echo "$ac_t""no" 1>&6 -+echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -+echo "$progname:2423: checking for shl_load in -ldld" >&5 -+ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` -+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ ac_save_LIBS="$LIBS" -+LIBS="-ldld $LIBS" -+cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=yes" -+else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=no" -+fi -+rm -f conftest* -+LIBS="$ac_save_LIBS" -+ -+fi -+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+ -+fi -+ -+fi -+ -+ if test "x$lt_cv_dlopen" != xno; then -+ enable_dlopen=yes -+ fi -+ -+ case "$lt_cv_dlopen" in -+ dlopen) -+for ac_hdr in dlfcn.h; do -+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -+echo "$progname:2488: checking for $ac_hdr" >&5 -+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.$ac_ext < -+int fnord = 0; -+EOF -+ac_try="$ac_compile >/dev/null 2>conftest.out" -+{ (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -+if test -z "$ac_err"; then -+ rm -rf conftest* -+ eval "ac_cv_header_$ac_safe=yes" -+else -+ echo "$ac_err" >&5 -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_header_$ac_safe=no" -+fi -+rm -f conftest* -+fi -+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+done -+ -+ if test "x$ac_cv_header_dlfcn_h" = xyes; then -+ CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -+ fi -+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -+ LIBS="$lt_cv_dlopen_libs $LIBS" -+ -+ echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -+echo "$progname:2526: checking whether a program can dlopen itself" >&5 -+if test "${lt_cv_dlopen_self+set}" = set; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test "$cross_compiling" = yes; then -+ lt_cv_dlopen_self=cross -+ else -+ cat > conftest.c < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LTDL_GLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LTDL_GLOBAL DL_GLOBAL -+# else -+# define LTDL_GLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LTDL_LAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LTDL_LAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LTDL_LAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LTDL_LAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LTDL_LAZY_OR_NOW DL_NOW -+# else -+# define LTDL_LAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+fnord() { int i=42;} -+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); -+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); -+ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } -+ -+EOF -+if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -+then -+ lt_cv_dlopen_self=yes -+else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -fr conftest* -+ lt_cv_dlopen_self=no -+fi -+rm -fr conftest* -+fi -+ -+fi -+ -+echo "$ac_t""$lt_cv_dlopen_self" 1>&6 -+ -+ if test "$lt_cv_dlopen_self" = yes; then -+ LDFLAGS="$LDFLAGS $link_static_flag" -+ echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -+echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 -+if test "${lt_cv_dlopen_self_static+set}" = set; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test "$cross_compiling" = yes; then -+ lt_cv_dlopen_self_static=cross -+ else -+ cat > conftest.c < -+#endif -+ -+#include -+ -+#ifdef RTLD_GLOBAL -+# define LTDL_GLOBAL RTLD_GLOBAL -+#else -+# ifdef DL_GLOBAL -+# define LTDL_GLOBAL DL_GLOBAL -+# else -+# define LTDL_GLOBAL 0 -+# endif -+#endif -+ -+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we -+ find out it does not work in some platform. */ -+#ifndef LTDL_LAZY_OR_NOW -+# ifdef RTLD_LAZY -+# define LTDL_LAZY_OR_NOW RTLD_LAZY -+# else -+# ifdef DL_LAZY -+# define LTDL_LAZY_OR_NOW DL_LAZY -+# else -+# ifdef RTLD_NOW -+# define LTDL_LAZY_OR_NOW RTLD_NOW -+# else -+# ifdef DL_NOW -+# define LTDL_LAZY_OR_NOW DL_NOW -+# else -+# define LTDL_LAZY_OR_NOW 0 -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+fnord() { int i=42;} -+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); -+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); -+ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } -+ -+EOF -+if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -+then -+ lt_cv_dlopen_self_static=yes -+else -+ echo "$progname: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -fr conftest* -+ lt_cv_dlopen_self_static=no -+fi -+rm -fr conftest* -+fi -+ -+fi -+ -+echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 -+fi -+ ;; -+ esac -+ -+ case "$lt_cv_dlopen_self" in -+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; -+ *) enable_dlopen_self=unknown ;; -+ esac -+ -+ case "$lt_cv_dlopen_self_static" in -+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; -+ *) enable_dlopen_self_static=unknown ;; -+ esac -+fi -+ - # Copy echo and quote the copy, instead of the original, because it is - # used later. - ltecho="$echo" -@@ -1790,30 +2689,36 @@ - fi - LTSHELL="$SHELL" - -+LTCONFIG_VERSION="$VERSION" -+ - # Only quote variables if we're using ltmain.sh. - case "$ltmain" in - *.sh) - # Now quote all the things that may contain metacharacters. -- for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ -- old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL VERSION \ -+ for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ -+ old_LD old_LDFLAGS old_LIBS \ -+ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ -+ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ -- whole_archive_flag_spec libname_spec library_names_spec soname_spec \ -+ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ -+ library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ -- old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \ -- check_shared_deplibs_method allow_undefined_flag no_undefined_flag \ -- finish_cmds finish_eval global_symbol_pipe \ -- hardcode_libdir_flag_spec hardcode_libdir_separator sys_lib_search_path \ -- compiler_c_o compiler_o_lo need_locks; do -+ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ -+ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ -+ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ -+ hardcode_libdir_flag_spec hardcode_libdir_separator \ -+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ -+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case "$var" in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ -- archive_cmds | archive_sym_cmds | \ -+ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - postinstall_cmds | postuninstall_cmds | \ -- finish_cmds | sys_lib_search_path) -+ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. -- eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\"" -+ eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" -@@ -1823,8 +2728,7 @@ - - case "$ltecho" in - *'\$0 --fallback-echo"') -- ltecho=`$echo "X$ltecho" | -- $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` -+ ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -@@ -1835,11 +2739,11 @@ - #! $SHELL - - # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. --# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION) -+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) - # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. - # --# Copyright (C) 1996-1998 Free Software Foundation, Inc. --# Gordon Matzigkeit , 1996 -+# Copyright (C) 1996-1999 Free Software Foundation, Inc. -+# Originally by Gordon Matzigkeit , 1996 - # - # 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 -@@ -1865,7 +2769,7 @@ - - # The HP-UX ksh and POSIX shell print the target directory to stdout - # if CDPATH is set. --if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi -+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - - ### BEGIN LIBTOOL CONFIG - EOF -@@ -1874,8 +2778,9 @@ - - *) - # Double-quote the variables that need it (for aesthetics). -- for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ -- old_LN_S old_DLLTOOL old_AS; do -+ for var in old_CC old_CFLAGS old_CPPFLAGS \ -+ old_LD old_LDFLAGS old_LIBS \ -+ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do - eval "$var=\\\"\$var\\\"" - done - -@@ -1886,7 +2791,7 @@ - $rm "$cfgfile" - cat < "$cfgfile" - # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. --# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION) -+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) - EOF - ;; - esac -@@ -1895,15 +2800,16 @@ - # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - # - # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ --# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ --# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\ -+# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ -+# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ -+# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ - # $0$ltconfig_args - # - # Compiler and other test output produced by $progname, useful for - # debugging $progname, is in ./config.log if it exists. - - # The version of $progname that generated this script. --LTCONFIG_VERSION=$VERSION -+LTCONFIG_VERSION=$LTCONFIG_VERSION - - # Shell to use when invoking shell scripts. - SHELL=$LTSHELL -@@ -1914,6 +2820,9 @@ - # Whether or not to build static libraries. - build_old_libs=$enable_static - -+# Whether or not to optimize for fast installation. -+fast_install=$enable_fast_install -+ - # The host system. - host_alias=$host_alias - host=$host -@@ -1936,10 +2845,13 @@ - # A BSD-compatible nm program. - NM=$NM - --# Used on cygwin32: DLL creation program. -+# Used on cygwin: DLL creation program. - DLLTOOL="$DLLTOOL" - --# Used on cygwin32: assembler. -+# Used on cygwin: object dumper. -+OBJDUMP="$OBJDUMP" -+ -+# Used on cygwin: assembler. - AS="$AS" - - # The name of the directory that contains temporary libtool files. -@@ -1958,10 +2870,13 @@ - # Old archive suffix (normally "a"). - libext="$libext" - -+# Executable file suffix (normally ""). -+exeext="$exeext" -+ - # Additional compiler flags for building library objects. - pic_flag=$pic_flag - --# Does compiler simultaneously support -c and -o options -+# Does compiler simultaneously support -c and -o options? - compiler_c_o=$compiler_c_o - - # Can we write directly to a .lo ? -@@ -1970,6 +2885,21 @@ - # Must we lock files when doing compilation ? - need_locks=$need_locks - -+# Do we need the lib prefix for modules? -+need_lib_prefix=$need_lib_prefix -+ -+# Do we need a version for libraries? -+need_version=$need_version -+ -+# Whether dlopen is supported. -+dlopen=$enable_dlopen -+ -+# Whether dlopen of programs is supported. -+dlopen_self=$enable_dlopen_self -+ -+# Whether dlopen of statically linked programs is supported. -+dlopen_self_static=$enable_dlopen_self_static -+ - # Compiler flag to prevent dynamic linking. - link_static_flag=$link_static_flag - -@@ -1982,6 +2912,9 @@ - # Compiler flag to generate shared objects directly from archives. - whole_archive_flag_spec=$whole_archive_flag_spec - -+# Compiler flag to generate thread-safe objects. -+thread_safe_flag_spec=$thread_safe_flag_spec -+ - # Library versioning type. - version_type=$version_type - -@@ -2006,12 +2939,15 @@ - - # Commands used to build and install a shared archive. - archive_cmds=$archive_cmds --archive_sym_cmds=$archive_sym_cmds -+archive_expsym_cmds=$archive_expsym_cmds - postinstall_cmds=$postinstall_cmds - postuninstall_cmds=$postuninstall_cmds - - # Method to check whether dependent libraries are shared objects. --check_shared_deplibs_method=$check_shared_deplibs_method -+deplibs_check_method=$deplibs_check_method -+ -+# Command to use when deplibs_check_method == file_magic. -+file_magic_cmd=$file_magic_cmd - - # Flag that allows shared libraries with undefined symbols to be built. - allow_undefined_flag=$allow_undefined_flag -@@ -2028,12 +2964,18 @@ - # Take the output of nm and produce a listing of raw symbols and C names. - global_symbol_pipe=$global_symbol_pipe - -+# Transform the output of nm in a proper C declaration -+global_symbol_to_cdecl=$global_symbol_to_cdecl -+ - # This is the shared library runtime path variable. - runpath_var=$runpath_var - - # This is the shared library path variable. - shlibpath_var=$shlibpath_var - -+# Is shlibpath searched before the hard-coded library search path? -+shlibpath_overrides_runpath=$shlibpath_overrides_runpath -+ - # How to hardcode a shared library path into an executable. - hardcode_action=$hardcode_action - -@@ -2056,11 +2998,27 @@ - # the resulting binary. - hardcode_shlibpath_var=$hardcode_shlibpath_var - --# System search path for libraries --sys_lib_search_path=$sys_lib_search_path -+# Compile-time system search path for libraries -+sys_lib_search_path_spec=$sys_lib_search_path_spec -+ -+# Run-time system search path for libraries -+sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec - - # Fix the shell variable \$srcfile for the compiler. - fix_srcfile_path="$fix_srcfile_path" -+ -+# Set to yes if exported symbols are required. -+always_export_symbols=$always_export_symbols -+ -+# The commands to list exported symbols. -+export_symbols_cmds=$export_symbols_cmds -+ -+# Symbols that should not be listed in the preloaded symbols. -+exclude_expsyms=$exclude_expsyms -+ -+# Symbols that must always be exported. -+include_expsyms=$include_expsyms -+ - EOF - - case "$ltmain" in -@@ -2074,7 +3032,7 @@ - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. --if test "${COLLECT_NAMES+set}" != set; then -+if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi -@@ -2083,7 +3041,11 @@ - esac - - # Append the ltmain.sh script. -- cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) -+ sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) -+ # We use sed instead of cat because bash on DJGPP gets confused if -+ # if finds mixed CR/LF and LF-only lines. Since sed operates in -+ # text mode, it properly converts lines to CR/LF. This bash problem -+ # is reportedly fixed, but why not run on old versions too? - - chmod +x "$ofile" - ;; -@@ -2093,6 +3055,58 @@ - echo "FIXME: would compile $ltmain" - ;; - esac -+ -+test -n "$cache_file" || exit 0 -+ -+# AC_CACHE_SAVE -+trap '' 1 2 15 -+cat > confcache <<\EOF -+# This file is a shell script that caches the results of configure -+# tests run on this system so they can be shared between configure -+# scripts and configure runs. It is not useful on other systems. -+# If it contains results you don't want to keep, you may remove or edit it. -+# -+# By default, configure uses ./config.cache as the cache file, -+# creating it if it does not exist already. You can give configure -+# the --cache-file=FILE option to use a different cache file; that is -+# what configure does when it calls configure scripts in -+# subdirectories, so they share the cache. -+# Giving --cache-file=/dev/null disables caching, for debugging configure. -+# config.status only pays attention to the cache file if you give it the -+# --recheck option to rerun configure. -+# -+EOF -+# The following way of writing the cache mishandles newlines in values, -+# but we know of no workaround that is simple, portable, and efficient. -+# So, don't put newlines in cache variables' values. -+# Ultrix sh set writes to stderr and can't be redirected directly, -+# and sets the high bit in the cache file unless we assign to the vars. -+(set) 2>&1 | -+ case `(ac_space=' '; set | grep ac_space) 2>&1` in -+ *ac_space=\ *) -+ # `set' does not quote correctly, so add quotes (double-quote substitution -+ # turns \\\\ into \\, and sed turns \\ into \). -+ sed -n \ -+ -e "s/'/'\\\\''/g" \ -+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" -+ ;; -+ *) -+ # `set' quotes correctly as required by POSIX, so do not add quotes. -+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' -+ ;; -+ esac >> confcache -+if cmp -s $cache_file confcache; then -+ : -+else -+ if test -w $cache_file; then -+ echo "updating cache $cache_file" -+ cat confcache > $cache_file -+ else -+ echo "not updating unwritable cache $cache_file" -+ fi -+fi -+rm -f confcache -+ - exit 0 - - # Local Variables: ---- gsmlib-1.10.orig/scripts/config.guess -+++ gsmlib-1.10/scripts/config.guess -@@ -1,9 +1,10 @@ - #! /bin/sh - # Attempt to guess a canonical system name. --# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 - # Free Software Foundation, Inc. - --timestamp='2001-09-04' -+timestamp='2008-01-23' - - # This file is free software; you can redistribute it and/or modify it - # under the terms of the GNU General Public License as published by -@@ -17,15 +18,18 @@ - # - # 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. -+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -+# 02110-1301, USA. - # - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a - # configuration script generated by Autoconf, you may include it under - # the same distribution terms that you use for the rest of that program. - --# Written by Per Bothner . --# Please send patches to . -+ -+# Originally written by Per Bothner . -+# Please send patches to . Submit a context -+# diff and a properly formatted ChangeLog entry. - # - # This script attempts to guess a canonical system name similar to - # config.sub. If it succeeds, it prints the system name on stdout, and -@@ -52,8 +56,8 @@ - GNU config.guess ($timestamp) - - Originally written by Per Bothner. --Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 --Free Software Foundation, Inc. -+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -65,11 +69,11 @@ - while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) -- echo "$timestamp" ; exit 0 ;; -+ echo "$timestamp" ; exit ;; - --version | -v ) -- echo "$version" ; exit 0 ;; -+ echo "$version" ; exit ;; - --help | --h* | -h ) -- echo "$usage"; exit 0 ;; -+ echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. -@@ -87,30 +91,42 @@ - exit 1 - fi - -+trap 'exit 1' 1 2 15 - --dummy=dummy-$$ --trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 -+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -+# compiler to aid in system detection is discouraged as it requires -+# temporary files to be created and, as you can see below, it is a -+# headache to deal with in a portable fashion. - --# CC_FOR_BUILD -- compiler used by this script. - # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still - # use `HOST_CC' if defined, but it is deprecated. - --set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in -- ,,) echo "int dummy(){}" > $dummy.c ; -- for c in cc gcc c89 ; do -- ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; -- if test $? = 0 ; then -+# Portable tmp directory creation inspired by the Autoconf team. -+ -+set_cc_for_build=' -+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -+: ${TMPDIR=/tmp} ; -+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || -+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || -+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || -+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -+dummy=$tmp/dummy ; -+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -+case $CC_FOR_BUILD,$HOST_CC,$CC in -+ ,,) echo "int x;" > $dummy.c ; -+ for c in cc gcc c89 c99 ; do -+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; -- rm -f $dummy.c $dummy.o $dummy.rel ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; --esac' -+esac ; set_cc_for_build= ;' - - # This is needed to find uname on a Pyramid OSx when run in the BSD universe. - # (ghazi@noc.rutgers.edu 1994-08-24) -@@ -127,29 +143,31 @@ - - case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) -- # Netbsd (nbsd) targets should (where applicable) match one or -+ # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. -- # Determine the machine/vendor (is the vendor relevant). -- case "${UNAME_MACHINE}" in -- amiga) machine=m68k-unknown ;; -- arm32) machine=arm-unknown ;; -- atari*) machine=m68k-atari ;; -- sun3*) machine=m68k-sun ;; -- mac68k) machine=m68k-apple ;; -- macppc) machine=powerpc-apple ;; -- hp3[0-9][05]) machine=m68k-hp ;; -- ibmrt|romp-ibm) machine=romp-ibm ;; -- *) machine=${UNAME_MACHINE}-unknown ;; -+ # -+ # Note: NetBSD doesn't particularly care about the vendor -+ # portion of the name. We always set it to "unknown". -+ sysctl="sysctl -n hw.machine_arch" -+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ -+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` -+ case "${UNAME_MACHINE_ARCH}" in -+ armeb) machine=armeb-unknown ;; -+ arm*) machine=arm-unknown ;; -+ sh3el) machine=shl-unknown ;; -+ sh3eb) machine=sh-unknown ;; -+ sh5el) machine=sh5le-unknown ;; -+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. -- case "${UNAME_MACHINE}" in -- i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) -+ case "${UNAME_MACHINE_ARCH}" in -+ arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null -@@ -166,120 +184,128 @@ - ;; - esac - # The OS release -- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` -+ # Debian GNU/NetBSD machines have a different userland, and -+ # thus, need a distinct triplet. However, they do not need -+ # kernel version information, so it can be replaced with a -+ # suitable tag, in the style of linux-gnu. -+ case "${UNAME_VERSION}" in -+ Debian*) -+ release='-gnu' -+ ;; -+ *) -+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` -+ ;; -+ esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" -- exit 0 ;; -+ exit ;; -+ *:OpenBSD:*:*) -+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` -+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} -+ exit ;; -+ *:ekkoBSD:*:*) -+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} -+ exit ;; -+ *:SolidBSD:*:*) -+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} -+ exit ;; -+ macppc:MirBSD:*:*) -+ echo powerpc-unknown-mirbsd${UNAME_RELEASE} -+ exit ;; -+ *:MirBSD:*:*) -+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} -+ exit ;; - alpha:OSF1:*:*) -- if test $UNAME_RELEASE = "V4.0"; then -+ case $UNAME_RELEASE in -+ *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` -- fi -+ ;; -+ *5.*) -+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` -+ ;; -+ esac -+ # According to Compaq, /usr/sbin/psrinfo has been available on -+ # OSF/1 and Tru64 systems produced since 1995. I hope that -+ # covers most systems running today. This code pipes the CPU -+ # types through head -n 1, so we only detect the type of CPU 0. -+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` -+ case "$ALPHA_CPU_TYPE" in -+ "EV4 (21064)") -+ UNAME_MACHINE="alpha" ;; -+ "EV4.5 (21064)") -+ UNAME_MACHINE="alpha" ;; -+ "LCA4 (21066/21068)") -+ UNAME_MACHINE="alpha" ;; -+ "EV5 (21164)") -+ UNAME_MACHINE="alphaev5" ;; -+ "EV5.6 (21164A)") -+ UNAME_MACHINE="alphaev56" ;; -+ "EV5.6 (21164PC)") -+ UNAME_MACHINE="alphapca56" ;; -+ "EV5.7 (21164PC)") -+ UNAME_MACHINE="alphapca57" ;; -+ "EV6 (21264)") -+ UNAME_MACHINE="alphaev6" ;; -+ "EV6.7 (21264A)") -+ UNAME_MACHINE="alphaev67" ;; -+ "EV6.8CB (21264C)") -+ UNAME_MACHINE="alphaev68" ;; -+ "EV6.8AL (21264B)") -+ UNAME_MACHINE="alphaev68" ;; -+ "EV6.8CX (21264D)") -+ UNAME_MACHINE="alphaev68" ;; -+ "EV6.9A (21264/EV69A)") -+ UNAME_MACHINE="alphaev69" ;; -+ "EV7 (21364)") -+ UNAME_MACHINE="alphaev7" ;; -+ "EV7.9 (21364A)") -+ UNAME_MACHINE="alphaev79" ;; -+ esac -+ # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. -- cat <$dummy.s -- .data --\$Lformat: -- .byte 37,100,45,37,120,10,0 # "%d-%x\n" -- -- .text -- .globl main -- .align 4 -- .ent main --main: -- .frame \$30,16,\$26,0 -- ldgp \$29,0(\$27) -- .prologue 1 -- .long 0x47e03d80 # implver \$0 -- lda \$2,-1 -- .long 0x47e20c21 # amask \$2,\$1 -- lda \$16,\$Lformat -- mov \$0,\$17 -- not \$1,\$18 -- jsr \$26,printf -- ldgp \$29,0(\$26) -- mov 0,\$16 -- jsr \$26,exit -- .end main --EOF -- eval $set_cc_for_build -- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null -- if test "$?" = 0 ; then -- case `./$dummy` in -- 0-0) -- UNAME_MACHINE="alpha" -- ;; -- 1-0) -- UNAME_MACHINE="alphaev5" -- ;; -- 1-1) -- UNAME_MACHINE="alphaev56" -- ;; -- 1-101) -- UNAME_MACHINE="alphapca56" -- ;; -- 2-303) -- UNAME_MACHINE="alphaev6" -- ;; -- 2-307) -- UNAME_MACHINE="alphaev67" -- ;; -- 2-1307) -- UNAME_MACHINE="alphaev68" -- ;; -- esac -- fi -- rm -f $dummy.s $dummy -- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -- exit 0 ;; -+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -+ exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix -- exit 0 ;; -+ exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 -- exit 0 ;; -+ exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 -- exit 0;; -- amiga:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos -- exit 0 ;; -- arc64:OpenBSD:*:*) -- echo mips64el-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- arc:OpenBSD:*:*) -- echo mipsel-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- hkmips:OpenBSD:*:*) -- echo mips-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- pmax:OpenBSD:*:*) -- echo mipsel-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- sgi:OpenBSD:*:*) -- echo mips-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- wgrisc:OpenBSD:*:*) -- echo mipsel-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; -+ *:[Mm]orph[Oo][Ss]:*:*) -+ echo ${UNAME_MACHINE}-unknown-morphos -+ exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition -- exit 0 ;; -+ exit ;; -+ *:z/VM:*:*) -+ echo s390-ibm-zvmoe -+ exit ;; -+ *:OS400:*:*) -+ echo powerpc-ibm-os400 -+ exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} -- exit 0;; -+ exit ;; -+ arm:riscos:*:*|arm:RISCOS:*:*) -+ echo arm-unknown-riscos -+ exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp -- exit 0;; -+ exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then -@@ -287,25 +313,32 @@ - else - echo pyramid-pyramid-bsd - fi -- exit 0 ;; -+ exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 -- exit 0 ;; -+ exit ;; -+ DRS?6000:unix:4.0:6*) -+ echo sparc-icl-nx6 -+ exit ;; -+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) -+ case `/usr/bin/uname -p` in -+ sparc) echo sparc-icl-nx7; exit ;; -+ esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -- i86pc:SunOS:5.*:*) -+ exit ;; -+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) -@@ -314,12 +347,12 @@ - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` -- exit 0 ;; -+ exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - sun*:*:4.2BSD:*) -- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` -+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) -@@ -329,16 +362,10 @@ - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac -- exit 0 ;; -+ exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} -- exit 0 ;; -- sparc*:NetBSD:*) -- echo `uname -p`-unknown-netbsd${UNAME_RELEASE} -- exit 0 ;; -- atari*:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor -@@ -349,49 +376,40 @@ - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} -- exit 0 ;; -- sun3*:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- mac68k:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- mvme68k:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- mvme88k:OpenBSD:*:*) -- echo m88k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; -+ m68k:machten:*:*) -+ echo m68k-apple-machten${UNAME_RELEASE} -+ exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 -- exit 0 ;; -+ exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -@@ -415,27 +433,33 @@ - exit (-1); - } - EOF -- $CC_FOR_BUILD $dummy.c -o $dummy \ -- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ -- && rm -f $dummy.c $dummy && exit 0 -- rm -f $dummy.c $dummy -+ $CC_FOR_BUILD -o $dummy $dummy.c && -+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && -+ SYSTEM_NAME=`$dummy $dummyarg` && -+ { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax -- exit 0 ;; -+ exit ;; -+ Motorola:*:4.3:PL8-*) -+ echo powerpc-harris-powermax -+ exit ;; -+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) -+ echo powerpc-harris-powermax -+ exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix -- exit 0 ;; -+ exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 -- exit 0 ;; -+ exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 -- exit 0 ;; -+ exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 -- exit 0 ;; -+ exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` -@@ -451,29 +475,29 @@ - else - echo i586-dg-dgux${UNAME_RELEASE} - fi -- exit 0 ;; -+ exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 -- exit 0 ;; -+ exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 -- exit 0 ;; -+ exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 -- exit 0 ;; -+ exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd -- exit 0 ;; -+ exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` -- exit 0 ;; -+ exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. -- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id -- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' -+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id -+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix -- exit 0 ;; -+ exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` -@@ -481,7 +505,7 @@ - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} -- exit 0 ;; -+ exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build -@@ -496,17 +520,20 @@ - exit(0); - } - EOF -- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 -- rm -f $dummy.c $dummy -- echo rs6000-ibm-aix3.2.5 -+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` -+ then -+ echo "$SYSTEM_NAME" -+ else -+ echo rs6000-ibm-aix3.2.5 -+ fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi -- exit 0 ;; -- *:AIX:*:[45]) -- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` -+ exit ;; -+ *:AIX:*:[456]) -+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else -@@ -518,38 +545,36 @@ - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} -- exit 0 ;; -+ exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix -- exit 0 ;; -+ exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 -- exit 0 ;; -+ exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to -- exit 0 ;; # report: romp-ibm BSD 4.3 -+ exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx -- exit 0 ;; -+ exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 -- exit 0 ;; -+ exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd -- exit 0 ;; -+ exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 -- exit 0 ;; -+ exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) -- case "${HPUX_REV}" in -- 11.[0-9][0-9]) -- if [ -x /usr/bin/getconf ]; then -- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` -+ if [ -x /usr/bin/getconf ]; then -+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 -@@ -558,13 +583,13 @@ - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; -+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac -- fi ;; -- esac -- if [ "${HP_ARCH}" = "" ]; then -- eval $set_cc_for_build -- sed 's/^ //' << EOF >$dummy.c -+ fi -+ if [ "${HP_ARCH}" = "" ]; then -+ eval $set_cc_for_build -+ sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include -@@ -597,17 +622,37 @@ - exit (0); - } - EOF -- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` -- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi -- rm -f $dummy.c $dummy -- fi ;; -+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` -+ test -z "$HP_ARCH" && HP_ARCH=hppa -+ fi ;; - esac -+ if [ ${HP_ARCH} = "hppa2.0w" ] -+ then -+ eval $set_cc_for_build -+ -+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating -+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler -+ # generating 64-bit code. GNU and HP use different nomenclature: -+ # -+ # $ CC_FOR_BUILD=cc ./config.guess -+ # => hppa2.0w-hp-hpux11.23 -+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess -+ # => hppa64-hp-hpux11.23 -+ -+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | -+ grep __LP64__ >/dev/null -+ then -+ HP_ARCH="hppa2.0w" -+ else -+ HP_ARCH="hppa64" -+ fi -+ fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} -- exit 0 ;; -+ exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} -- exit 0 ;; -+ exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -@@ -635,158 +680,247 @@ - exit (0); - } - EOF -- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 -- rm -f $dummy.c $dummy -+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && -+ { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 -- exit 0 ;; -+ exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd -- exit 0 ;; -+ exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd -- exit 0 ;; -+ exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix -- exit 0 ;; -+ exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf -- exit 0 ;; -+ exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf -- exit 0 ;; -+ exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi -- exit 0 ;; -+ exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites -- exit 0 ;; -- hppa*:OpenBSD:*:*) -- echo hppa-unknown-openbsd -- exit 0 ;; -+ exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd -- exit 0 ;; -+ exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi -- exit 0 ;; -+ exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd -- exit 0 ;; -+ exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd -- exit 0 ;; -+ exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd -- exit 0 ;; -- CRAY*X-MP:*:*:*) -- echo xmp-cray-unicos -- exit 0 ;; -+ exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -- CRAY*T3D:*:*:*) -- echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -- CRAY-2:*:*:*) -- echo cray2-cray-unicos -- exit 0 ;; -+ exit ;; -+ *:UNICOS/mp:*:*) -+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -+ exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -- exit 0 ;; -- hp300:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; -+ 5000:UNIX_System_V:4.*:*) -+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` -+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -+ exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:FreeBSD:*:*) -- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` -- exit 0 ;; -- *:OpenBSD:*:*) -- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` -- exit 0 ;; -+ case ${UNAME_MACHINE} in -+ pc98) -+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ amd64) -+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ *) -+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ esac -+ exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin -- exit 0 ;; -- i*:MINGW*:*) -+ exit ;; -+ *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 -- exit 0 ;; -+ exit ;; -+ i*:windows32*:*) -+ # uname -m includes "-pc" on this system. -+ echo ${UNAME_MACHINE}-mingw32 -+ exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 -- exit 0 ;; -+ exit ;; -+ *:Interix*:[3456]*) -+ case ${UNAME_MACHINE} in -+ x86) -+ echo i586-pc-interix${UNAME_RELEASE} -+ exit ;; -+ EM64T | authenticamd) -+ echo x86_64-unknown-interix${UNAME_RELEASE} -+ exit ;; -+ IA64) -+ echo ia64-unknown-interix${UNAME_RELEASE} -+ exit ;; -+ esac ;; -+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) -+ echo i${UNAME_MACHINE}-pc-mks -+ exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? -- echo i386-pc-interix -- exit 0 ;; -+ echo i586-pc-interix -+ exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin -- exit 0 ;; -+ exit ;; -+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) -+ echo x86_64-unknown-cygwin -+ exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin -- exit 0 ;; -+ exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - *:GNU:*:*) -+ # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` -- exit 0 ;; -+ exit ;; -+ *:GNU/*:*:*) -+ # other systems with GNU libc and userland -+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu -+ exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix -- exit 0 ;; -+ exit ;; - arm*:Linux:*:*) -+ eval $set_cc_for_build -+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ -+ | grep -q __ARM_EABI__ -+ then -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ else -+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi -+ fi -+ exit ;; -+ avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; -+ cris:Linux:*:*) -+ echo cris-axis-linux-gnu -+ exit ;; -+ crisv32:Linux:*:*) -+ echo crisv32-axis-linux-gnu -+ exit ;; -+ frv:Linux:*:*) -+ echo frv-unknown-linux-gnu -+ exit ;; - ia64:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux -- exit 0 ;; -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; -+ m32r*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - mips:Linux:*:*) -- case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in -- big) echo mips-unknown-linux-gnu && exit 0 ;; -- little) echo mipsel-unknown-linux-gnu && exit 0 ;; -- esac -+ eval $set_cc_for_build -+ sed 's/^ //' << EOF >$dummy.c -+ #undef CPU -+ #undef mips -+ #undef mipsel -+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) -+ CPU=mipsel -+ #else -+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) -+ CPU=mips -+ #else -+ CPU= -+ #endif -+ #endif -+EOF -+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -+ /^CPU/{ -+ s: ::g -+ p -+ }'`" -+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; -+ mips64:Linux:*:*) -+ eval $set_cc_for_build -+ sed 's/^ //' << EOF >$dummy.c -+ #undef CPU -+ #undef mips64 -+ #undef mips64el -+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) -+ CPU=mips64el -+ #else -+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) -+ CPU=mips64 -+ #else -+ CPU= -+ #endif -+ #endif -+EOF -+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -+ /^CPU/{ -+ s: ::g -+ p -+ }'`" -+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } -+ ;; -+ or32:Linux:*:*) -+ echo or32-unknown-linux-gnu -+ exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; -@@ -800,7 +934,7 @@ - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} -- exit 0 ;; -+ exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in -@@ -808,27 +942,37 @@ - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac -- exit 0 ;; -+ exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux -- exit 0 ;; -+ exit ;; -+ sh64*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; -+ vax:Linux:*:*) -+ echo ${UNAME_MACHINE}-dec-linux-gnu -+ exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu -- exit 0 ;; -+ exit ;; -+ xtensa*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. -- ld_supported_targets=`cd /; ld --help 2>&1 \ -+ # Set LC_ALL=C to ensure ld outputs messages in English. -+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// -@@ -840,52 +984,58 @@ - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" -- exit 0 ;; -+ exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" -- exit 0 ;; -+ exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" -- exit 0 ;; -+ exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build -- cat >$dummy.c < --#ifdef __cplusplus --#include /* for printf() prototype */ -- int main (int argc, char *argv[]) { --#else -- int main (argc, argv) int argc; char *argv[]; { --#endif --#ifdef __ELF__ --# ifdef __GLIBC__ --# if __GLIBC__ >= 2 -- printf ("%s-pc-linux-gnu\n", argv[1]); --# else -- printf ("%s-pc-linux-gnulibc1\n", argv[1]); --# endif --# else -- printf ("%s-pc-linux-gnulibc1\n", argv[1]); --# endif --#else -- printf ("%s-pc-linux-gnuaout\n", argv[1]); --#endif -- return 0; --} -+ sed 's/^ //' << EOF >$dummy.c -+ #include -+ #ifdef __ELF__ -+ # ifdef __GLIBC__ -+ # if __GLIBC__ >= 2 -+ LIBC=gnu -+ # else -+ LIBC=gnulibc1 -+ # endif -+ # else -+ LIBC=gnulibc1 -+ # endif -+ #else -+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) -+ LIBC=gnu -+ #else -+ LIBC=gnuaout -+ #endif -+ #endif -+ #ifdef __dietlibc__ -+ LIBC=dietlibc -+ #endif - EOF -- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 -- rm -f $dummy.c $dummy -- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 -+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -+ /^LIBC/{ -+ s: ::g -+ p -+ }'`" -+ test x"${LIBC}" != x && { -+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}" -+ exit -+ } -+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 -- exit 0 ;; -+ exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... -@@ -893,7 +1043,27 @@ - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} -- exit 0 ;; -+ exit ;; -+ i*86:OS/2:*:*) -+ # If we were able to find `uname', then EMX Unix compatibility -+ # is probably installed. -+ echo ${UNAME_MACHINE}-pc-os2-emx -+ exit ;; -+ i*86:XTS-300:*:STOP) -+ echo ${UNAME_MACHINE}-unknown-stop -+ exit ;; -+ i*86:atheos:*:*) -+ echo ${UNAME_MACHINE}-unknown-atheos -+ exit ;; -+ i*86:syllable:*:*) -+ echo ${UNAME_MACHINE}-pc-syllable -+ exit ;; -+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) -+ echo i386-unknown-lynxos${UNAME_RELEASE} -+ exit ;; -+ i*86:*DOS:*:*) -+ echo ${UNAME_MACHINE}-pc-msdosdjgpp -+ exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then -@@ -901,99 +1071,100 @@ - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi -- exit 0 ;; -- i*86:*:5:[78]*) -+ exit ;; -+ i*86:*:5:[678]*) -+ # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} -- exit 0 ;; -+ exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then -- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` -- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 -- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ -+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` -+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 -+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 -- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ -+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 -- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ -+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi -- exit 0 ;; -- i*86:*DOS:*:*) -- echo ${UNAME_MACHINE}-pc-msdosdjgpp -- exit 0 ;; -+ exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp -- exit 0 ;; -+ exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 -- exit 0 ;; -+ exit ;; - paragon:*:*:*) - echo i860-intel-osf1 -- exit 0 ;; -+ exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi -- exit 0 ;; -+ exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv -- exit 0 ;; -- M68*:*:R3V[567]*:*) -- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; -- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) -+ exit ;; -+ mc68k:UNIX:SYSTEM5:3.51m) -+ echo m68k-convergent-sysv -+ exit ;; -+ M680?0:D-NIX:5.3:*) -+ echo m68k-diab-dnix -+ exit ;; -+ M68*:*:R3V[5678]*:*) -+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; -+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -- && echo i486-ncr-sysv4.3${OS_REL} && exit 0 -+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ -- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; -+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -- && echo i486-ncr-sysv4 && exit 0 ;; -+ && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 -- exit 0 ;; -- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) -- echo i386-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 -- exit 0 ;; -+ exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 -- exit 0 ;; -+ exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` -@@ -1001,82 +1172,107 @@ - else - echo ns32k-sni-sysv - fi -- exit 0 ;; -+ exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 -- exit 0 ;; -+ exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 -- exit 0 ;; -+ exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 -- exit 0 ;; -+ exit ;; -+ i*86:VOS:*:*) -+ # From Paul.Green@stratus.com. -+ echo ${UNAME_MACHINE}-stratus-vos -+ exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos -- exit 0 ;; -+ exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 -- exit 0 ;; -+ exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi -- exit 0 ;; -+ exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos -- exit 0 ;; -+ exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos -- exit 0 ;; -+ exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos -- exit 0 ;; -+ exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; -+ SX-6:SUPER-UX:*:*) -+ echo sx6-nec-superux${UNAME_RELEASE} -+ exit ;; -+ SX-7:SUPER-UX:*:*) -+ echo sx7-nec-superux${UNAME_RELEASE} -+ exit ;; -+ SX-8:SUPER-UX:*:*) -+ echo sx8-nec-superux${UNAME_RELEASE} -+ exit ;; -+ SX-8R:SUPER-UX:*:*) -+ echo sx8r-nec-superux${UNAME_RELEASE} -+ exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:Darwin:*:*) -- echo `uname -p`-apple-darwin${UNAME_RELEASE} -- exit 0 ;; -+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown -+ case $UNAME_PROCESSOR in -+ unknown) UNAME_PROCESSOR=powerpc ;; -+ esac -+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} -+ exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) -- if test "${UNAME_MACHINE}" = "x86pc"; then -+ UNAME_PROCESSOR=`uname -p` -+ if test "$UNAME_PROCESSOR" = "x86"; then -+ UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi -- echo `uname -p`-${UNAME_MACHINE}-nto-qnx -- exit 0 ;; -+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} -+ exit ;; - *:QNX:*:4*) - echo i386-pc-qnx -- exit 0 ;; -- NSR-[KW]:NONSTOP_KERNEL:*:*) -+ exit ;; -+ NSE-?:NONSTOP_KERNEL:*:*) -+ echo nse-tandem-nsk${UNAME_RELEASE} -+ exit ;; -+ NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux -- exit 0 ;; -+ exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv -- exit 0 ;; -+ exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 -@@ -1087,36 +1283,47 @@ - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 -- exit 0 ;; -- i*86:OS/2:*:*) -- # If we were able to find `uname', then EMX Unix compatibility -- # is probably installed. -- echo ${UNAME_MACHINE}-pc-os2-emx -- exit 0 ;; -+ exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 -- exit 0 ;; -+ exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex -- exit 0 ;; -+ exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 -- exit 0 ;; -+ exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 -- exit 0 ;; -+ exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 -- exit 0 ;; -+ exit ;; - *:ITS:*:*) - echo pdp10-unknown-its -- exit 0 ;; -- i*86:XTS-300:*:STOP) -- echo ${UNAME_MACHINE}-unknown-stop -- exit 0 ;; -- i*86:atheos:*:*) -- echo ${UNAME_MACHINE}-unknown-atheos -- exit 0 ;; -+ exit ;; -+ SEI:*:*:SEIUX) -+ echo mips-sei-seiux${UNAME_RELEASE} -+ exit ;; -+ *:DragonFly:*:*) -+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` -+ exit ;; -+ *:*VMS:*:*) -+ UNAME_MACHINE=`(uname -p) 2>/dev/null` -+ case "${UNAME_MACHINE}" in -+ A*) echo alpha-dec-vms ; exit ;; -+ I*) echo ia64-dec-vms ; exit ;; -+ V*) echo vax-dec-vms ; exit ;; -+ esac ;; -+ *:XENIX:*:SysV) -+ echo i386-pc-xenix -+ exit ;; -+ i*86:skyos:*:*) -+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' -+ exit ;; -+ i*86:rdos:*:*) -+ echo ${UNAME_MACHINE}-pc-rdos -+ exit ;; - esac - - #echo '(No uname command or uname output not recognized.)' 1>&2 -@@ -1148,7 +1355,7 @@ - #endif - - #if defined (__arm) && defined (__acorn) && defined (__unix) -- printf ("arm-acorn-riscix"); exit (0); -+ printf ("arm-acorn-riscix\n"); exit (0); - #endif - - #if defined (hp300) && !defined (hpux) -@@ -1237,12 +1444,12 @@ - } - EOF - --$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 --rm -f $dummy.c $dummy -+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && -+ { echo "$SYSTEM_NAME"; exit; } - - # Apollos put the system type in the environment. - --test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } -+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - - # Convex versions that predate uname can use getsysinfo(1) - -@@ -1251,22 +1458,22 @@ - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd -- exit 0 ;; -+ exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi -- exit 0 ;; -+ exit ;; - c34*) - echo c34-convex-bsd -- exit 0 ;; -+ exit ;; - c38*) - echo c38-convex-bsd -- exit 0 ;; -+ exit ;; - c4*) - echo c4-convex-bsd -- exit 0 ;; -+ exit ;; - esac - fi - -@@ -1277,7 +1484,9 @@ - the operating system you are using. It is advised that you - download the most up to date version of the config scripts from - -- ftp://ftp.gnu.org/pub/gnu/config/ -+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -+and -+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - - If the version you run ($0) is already up to date, please - send the following data and any information you think might be ---- gsmlib-1.10.orig/scripts/ltmain.sh -+++ gsmlib-1.10/scripts/ltmain.sh -@@ -1,7 +1,7 @@ - # ltmain.sh - Provide generalized library-building support services. - # NOTE: Changing this file will not affect anything until you rerun configure. - # --# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 - # Free Software Foundation, Inc. - # Originally by Gordon Matzigkeit , 1996 - # -@@ -17,13 +17,41 @@ - # - # 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. -+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a - # configuration script generated by Autoconf, you may include it under - # the same distribution terms that you use for the rest of that program. - -+basename="s,^.*/,,g" -+ -+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -+# is ksh but when the shell is invoked as "sh" and the current value of -+# the _XPG environment variable is not equal to 1 (one), the special -+# positional parameter $0, within a function call, is the name of the -+# function. -+progpath="$0" -+ -+# The name of this program: -+progname=`echo "$progpath" | $SED $basename` -+modename="$progname" -+ -+# Global variables: -+EXIT_SUCCESS=0 -+EXIT_FAILURE=1 -+ -+PROGRAM=ltmain.sh -+PACKAGE=libtool -+VERSION="1.5.20 Debian 1.5.20-2" -+TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)" -+ -+# See if we are running on zsh, and set the options which allow our -+# commands through without removal of \ escapes. -+if test -n "${ZSH_VERSION+set}" ; then -+ setopt NO_GLOB_SUBST -+fi -+ - # Check that we have a working $echo. - if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. -@@ -36,7 +64,7 @@ - : - else - # Restart under the correct shell, and then maybe $echo will work. -- exec $SHELL "$0" --no-reexec ${1+"$@"} -+ exec $SHELL "$progpath" --no-reexec ${1+"$@"} - fi - - if test "X$1" = X--fallback-echo; then -@@ -45,19 +73,9 @@ - cat <&2 -- echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 -- exit 1 -+ $echo "$modename: not configured to build any kind of library" 1>&2 -+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 -+ exit $EXIT_FAILURE - fi - - # Global variables. -@@ -105,8 +135,225 @@ - lo2o="s/\\.lo\$/.${objext}/" - o2lo="s/\\.${objext}\$/.lo/" - -+##################################### -+# Shell function definitions: -+# This seems to be the best place for them -+ -+# func_win32_libid arg -+# return the library type of file 'arg' -+# -+# Need a lot of goo to handle *both* DLLs and import libs -+# Has to be a shell function in order to 'eat' the argument -+# that is supplied when $file_magic_command is called. -+func_win32_libid () -+{ -+ win32_libid_type="unknown" -+ win32_fileres=`file -L $1 2>/dev/null` -+ case $win32_fileres in -+ *ar\ archive\ import\ library*) # definitely import -+ win32_libid_type="x86 archive import" -+ ;; -+ *ar\ archive*) # could be an import, or static -+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ -+ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then -+ win32_nmres=`eval $NM -f posix -A $1 | \ -+ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` -+ if test "X$win32_nmres" = "Ximport" ; then -+ win32_libid_type="x86 archive import" -+ else -+ win32_libid_type="x86 archive static" -+ fi -+ fi -+ ;; -+ *DLL*) -+ win32_libid_type="x86 DLL" -+ ;; -+ *executable*) # but shell scripts are "executable" too... -+ case $win32_fileres in -+ *MS\ Windows\ PE\ Intel*) -+ win32_libid_type="x86 DLL" -+ ;; -+ esac -+ ;; -+ esac -+ $echo $win32_libid_type -+} -+ -+ -+# func_infer_tag arg -+# Infer tagged configuration to use if any are available and -+# if one wasn't chosen via the "--tag" command line option. -+# Only attempt this if the compiler in the base compile -+# command doesn't match the default compiler. -+# arg is usually of the form 'gcc ...' -+func_infer_tag () -+{ -+ if test -n "$available_tags" && test -z "$tagname"; then -+ CC_quoted= -+ for arg in $CC; do -+ case $arg in -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -+ arg="\"$arg\"" -+ ;; -+ esac -+ CC_quoted="$CC_quoted $arg" -+ done -+ case $@ in -+ # Blanks in the command may have been stripped by the calling shell, -+ # but not from the CC environment variable when configure was run. -+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; -+ # Blanks at the start of $base_compile will cause this to fail -+ # if we don't check for them as well. -+ *) -+ for z in $available_tags; do -+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then -+ # Evaluate the configuration. -+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" -+ CC_quoted= -+ for arg in $CC; do -+ # Double-quote args containing other shell metacharacters. -+ case $arg in -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -+ arg="\"$arg\"" -+ ;; -+ esac -+ CC_quoted="$CC_quoted $arg" -+ done -+ case "$@ " in -+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) -+ # The compiler in the base compile command matches -+ # the one in the tagged configuration. -+ # Assume this is the tagged configuration we want. -+ tagname=$z -+ break -+ ;; -+ esac -+ fi -+ done -+ # If $tagname still isn't set, then no tagged configuration -+ # was found and let the user know that the "--tag" command -+ # line option must be used. -+ if test -z "$tagname"; then -+ $echo "$modename: unable to infer tagged configuration" -+ $echo "$modename: specify a tag with \`--tag'" 1>&2 -+ exit $EXIT_FAILURE -+# else -+# $echo "$modename: using $tagname tagged configuration" -+ fi -+ ;; -+ esac -+ fi -+} -+ -+ -+# func_extract_an_archive dir oldlib -+func_extract_an_archive () -+{ -+ f_ex_an_ar_dir="$1"; shift -+ f_ex_an_ar_oldlib="$1" -+ -+ $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" -+ $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? -+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then -+ : -+ else -+ $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 -+ exit $EXIT_FAILURE -+ fi -+} -+ -+# func_extract_archives gentop oldlib ... -+func_extract_archives () -+{ -+ my_gentop="$1"; shift -+ my_oldlibs=${1+"$@"} -+ my_oldobjs="" -+ my_xlib="" -+ my_xabs="" -+ my_xdir="" -+ my_status="" -+ -+ $show "${rm}r $my_gentop" -+ $run ${rm}r "$my_gentop" -+ $show "$mkdir $my_gentop" -+ $run $mkdir "$my_gentop" -+ my_status=$? -+ if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then -+ exit $my_status -+ fi -+ -+ for my_xlib in $my_oldlibs; do -+ # Extract the objects. -+ case $my_xlib in -+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; -+ *) my_xabs=`pwd`"/$my_xlib" ;; -+ esac -+ my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` -+ my_xdir="$my_gentop/$my_xlib" -+ -+ $show "${rm}r $my_xdir" -+ $run ${rm}r "$my_xdir" -+ $show "$mkdir $my_xdir" -+ $run $mkdir "$my_xdir" -+ status=$? -+ if test "$status" -ne 0 && test ! -d "$my_xdir"; then -+ exit $status -+ fi -+ case $host in -+ *-darwin*) -+ $show "Extracting $my_xabs" -+ # Do not bother doing anything if just a dry run -+ if test -z "$run"; then -+ darwin_orig_dir=`pwd` -+ cd $my_xdir || exit $? -+ darwin_archive=$my_xabs -+ darwin_curdir=`pwd` -+ darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` -+ darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` -+ if test -n "$darwin_arches"; then -+ darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` -+ darwin_arch= -+ $show "$darwin_base_archive has multiple architectures $darwin_arches" -+ for darwin_arch in $darwin_arches ; do -+ mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" -+ lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" -+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" -+ func_extract_an_archive "`pwd`" "${darwin_base_archive}" -+ cd "$darwin_curdir" -+ $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" -+ done # $darwin_arches -+ ## Okay now we have a bunch of thin objects, gotta fatten them up :) -+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` -+ darwin_file= -+ darwin_files= -+ for darwin_file in $darwin_filelist; do -+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` -+ lipo -create -output "$darwin_file" $darwin_files -+ done # $darwin_filelist -+ ${rm}r unfat-$$ -+ cd "$darwin_orig_dir" -+ else -+ cd "$darwin_orig_dir" -+ func_extract_an_archive "$my_xdir" "$my_xabs" -+ fi # $darwin_arches -+ fi # $run -+ ;; -+ *) -+ func_extract_an_archive "$my_xdir" "$my_xabs" -+ ;; -+ esac -+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` -+ done -+ func_extract_archives_result="$my_oldobjs" -+} -+# End of Shell function definitions -+##################################### -+ -+# Darwin sucks -+eval std_shrext=\"$shrext_cmds\" -+ - # Parse our command line options once, thoroughly. --while test $# -gt 0 -+while test "$#" -gt 0 - do - arg="$1" - shift -@@ -122,6 +369,34 @@ - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; -+ tag) -+ tagname="$arg" -+ preserve_args="${preserve_args}=$arg" -+ -+ # Check whether tagname contains only valid characters -+ case $tagname in -+ *[!-_A-Za-z0-9,/]*) -+ $echo "$progname: invalid tag name: $tagname" 1>&2 -+ exit $EXIT_FAILURE -+ ;; -+ esac -+ -+ case $tagname in -+ CC) -+ # Don't test for the "default" C tag, as we know, it's there, but -+ # not specially marked. -+ ;; -+ *) -+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then -+ taglist="$taglist $tagname" -+ # Evaluate the configuration. -+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" -+ else -+ $echo "$progname: ignoring unknown tag $tagname" 1>&2 -+ fi -+ ;; -+ esac -+ ;; - *) - eval "$prev=\$arg" - ;; -@@ -139,18 +414,27 @@ - ;; - - --version) -- echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" -- exit 0 -+ $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" -+ $echo -+ $echo "Copyright (C) 2005 Free Software Foundation, Inc." -+ $echo "This is free software; see the source for copying conditions. There is NO" -+ $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -+ exit $? - ;; - - --config) -- sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 -- exit 0 -+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath -+ # Now print the configurations for the tags. -+ for tagname in $taglist; do -+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" -+ done -+ exit $? - ;; - - --debug) -- echo "$progname: enabling shell trace mode" -+ $echo "$progname: enabling shell trace mode" - set -x -+ preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) -@@ -158,18 +442,18 @@ - ;; - - --features) -- echo "host: $host" -+ $echo "host: $host" - if test "$build_libtool_libs" = yes; then -- echo "enable shared libraries" -+ $echo "enable shared libraries" - else -- echo "disable shared libraries" -+ $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then -- echo "enable static libraries" -+ $echo "enable static libraries" - else -- echo "disable static libraries" -+ $echo "disable static libraries" - fi -- exit 0 -+ exit $? - ;; - - --finish) mode="finish" ;; -@@ -181,6 +465,15 @@ - - --quiet | --silent) - show=: -+ preserve_args="$preserve_args $arg" -+ ;; -+ -+ --tag) prevopt="--tag" prev=tag ;; -+ --tag=*) -+ set tag "$optarg" ${1+"$@"} -+ shift -+ prev=tag -+ preserve_args="$preserve_args --tag" - ;; - - -dlopen) -@@ -191,7 +484,7 @@ - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - - *) -@@ -204,7 +497,7 @@ - if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # If this variable is set in any of the actions, the command in it -@@ -216,8 +509,10 @@ - - # Infer the operation mode. - if test -z "$mode"; then -+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 -+ $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in -- *cc | *++ | gcc* | *-gcc*) -+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do -@@ -258,7 +553,7 @@ - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. -@@ -272,158 +567,127 @@ - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= -- prev= -- lastarg= -- srcfile="$nonopt" -+ srcfile="$nonopt" # always keep a non-empty value in "srcfile" -+ suppress_opt=yes - suppress_output= -+ arg_mode=normal -+ libobj= -+ later= - -- user_target=no - for arg - do -- case $prev in -- "") ;; -- xcompiler) -- # Aesthetically quote the previous argument. -- prev= -- lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` -- -- case $arg in -- # Double-quote args containing other shell metacharacters. -- # Many Bourne shells cannot handle close brackets correctly -- # in scan sets, so we specify it separately. -- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -- arg="\"$arg\"" -- ;; -- esac -- -- # Add the previous argument to base_compile. -- if test -z "$base_compile"; then -- base_compile="$lastarg" -- else -- base_compile="$base_compile $lastarg" -- fi -- continue -+ case $arg_mode in -+ arg ) -+ # do not "continue". Instead, add this to base_compile -+ lastarg="$arg" -+ arg_mode=normal - ;; -- esac - -- # Accept any command-line options. -- case $arg in -- -o) -- if test "$user_target" != "no"; then -- $echo "$modename: you cannot specify \`-o' more than once" 1>&2 -- exit 1 -- fi -- user_target=next -- ;; -- -- -static) -- build_old_libs=yes -+ target ) -+ libobj="$arg" -+ arg_mode=normal - continue - ;; - -- -prefer-pic) -- pic_mode=yes -- continue -- ;; -+ normal ) -+ # Accept any command-line options. -+ case $arg in -+ -o) -+ if test -n "$libobj" ; then -+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2 -+ exit $EXIT_FAILURE -+ fi -+ arg_mode=target -+ continue -+ ;; - -- -prefer-non-pic) -- pic_mode=no -- continue -- ;; -+ -static | -prefer-pic | -prefer-non-pic) -+ later="$later $arg" -+ continue -+ ;; - -- -Xcompiler) -- prev=xcompiler -- continue -- ;; -+ -no-suppress) -+ suppress_opt=no -+ continue -+ ;; - -- -Wc,*) -- args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` -- lastarg= -- save_ifs="$IFS"; IFS=',' -- for arg in $args; do -- IFS="$save_ifs" -+ -Xcompiler) -+ arg_mode=arg # the next one goes into the "base_compile" arg list -+ continue # The current "srcfile" will either be retained or -+ ;; # replaced later. I would guess that would be a bug. -+ -+ -Wc,*) -+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` -+ lastarg= -+ save_ifs="$IFS"; IFS=',' -+ for arg in $args; do -+ IFS="$save_ifs" - -- # Double-quote args containing other shell metacharacters. -- # Many Bourne shells cannot handle close brackets correctly -- # in scan sets, so we specify it separately. -- case $arg in -- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -- arg="\"$arg\"" -- ;; -- esac -- lastarg="$lastarg $arg" -- done -- IFS="$save_ifs" -- lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` -+ # Double-quote args containing other shell metacharacters. -+ # Many Bourne shells cannot handle close brackets correctly -+ # in scan sets, so we specify it separately. -+ case $arg in -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -+ arg="\"$arg\"" -+ ;; -+ esac -+ lastarg="$lastarg $arg" -+ done -+ IFS="$save_ifs" -+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - -- # Add the arguments to base_compile. -- if test -z "$base_compile"; then -- base_compile="$lastarg" -- else -+ # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" -- fi -- continue -- ;; -- esac -+ continue -+ ;; - -- case $user_target in -- next) -- # The next one is the -o target name -- user_target=yes -- continue -- ;; -- yes) -- # We got the output file -- user_target=set -- libobj="$arg" -- continue -+ * ) -+ # Accept the current argument as the source file. -+ # The previous "srcfile" becomes the current argument. -+ # -+ lastarg="$srcfile" -+ srcfile="$arg" -+ ;; -+ esac # case $arg - ;; -- esac -- -- # Accept the current argument as the source file. -- lastarg="$srcfile" -- srcfile="$arg" -+ esac # case $arg_mode - - # Aesthetically quote the previous argument. -- -- # Backslashify any backslashes, double quotes, and dollar signs. -- # These are the only characters that are still specially -- # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - -+ case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly -- # in scan sets, so we specify it separately. -- case $lastarg in -+ # in scan sets, and some SunOS ksh mistreat backslash-escaping -+ # in scan sets (worked around with variable expansion), -+ # and furthermore cannot handle '|' '&' '(' ')' in scan sets -+ # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - -- # Add the previous argument to base_compile. -- if test -z "$base_compile"; then -- base_compile="$lastarg" -- else -- base_compile="$base_compile $lastarg" -- fi -- done -+ base_compile="$base_compile $lastarg" -+ done # for arg - -- case $user_target in -- set) -+ case $arg_mode in -+ arg) -+ $echo "$modename: you must specify an argument for -Xcompile" -+ exit $EXIT_FAILURE - ;; -- no) -- # Get the name of the library object. -- libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` -+ target) -+ $echo "$modename: you must specify a target with \`-o'" 1>&2 -+ exit $EXIT_FAILURE - ;; - *) -- $echo "$modename: you must specify a target with \`-o'" 1>&2 -- exit 1 -+ # Get the name of the library object. -+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo -- xform='[cCFSfmso]' -+ xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; -@@ -431,10 +695,13 @@ - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; -+ *.ii) xform=ii ;; -+ *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; -+ *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` -@@ -443,25 +710,63 @@ - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - -+ func_infer_tag $base_compile -+ -+ for arg in $later; do -+ case $arg in -+ -static) -+ build_old_libs=yes -+ continue -+ ;; -+ -+ -prefer-pic) -+ pic_mode=yes -+ continue -+ ;; -+ -+ -prefer-non-pic) -+ pic_mode=no -+ continue -+ ;; -+ esac -+ done -+ -+ qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` -+ case $qlibobj in -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -+ qlibobj="\"$qlibobj\"" ;; -+ esac -+ test "X$libobj" != "X$qlibobj" \ -+ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ -+ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." -+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` -+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$obj"; then -+ xdir= -+ else -+ xdir=$xdir/ -+ fi -+ lobj=${xdir}$objdir/$objname -+ - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then -- removelist="$obj $libobj" -+ removelist="$obj $lobj $libobj ${libobj}T" - else -- removelist="$libobj" -+ removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist -- trap "$run $rm $removelist; exit 1" 1 2 15 -+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in -@@ -480,8 +785,9 @@ - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" -- trap "$run $rm $removelist; exit 1" 1 2 15 -+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else -+ output_obj= - need_locks=no - lockfile= - fi -@@ -489,13 +795,13 @@ - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then -- until $run ln "$0" "$lockfile" 2>/dev/null; do -+ until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then -- echo "\ -+ $echo "\ - *** ERROR, $lockfile exists and contains: - `cat $lockfile 2>/dev/null` - -@@ -507,14 +813,33 @@ - compiler." - - $run $rm $removelist -- exit 1 -+ exit $EXIT_FAILURE - fi -- echo $srcfile > "$lockfile" -+ $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi -+ qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` -+ case $qsrcfile in -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -+ qsrcfile="\"$qsrcfile\"" ;; -+ esac -+ -+ $run $rm "$libobj" "${libobj}T" -+ -+ # Create a libtool object file (analogous to a ".la" file), -+ # but don't create it if we're doing a dry run. -+ test -z "$run" && cat > ${libobj}T </dev/null`" != x"$srcfile"; then -- echo "\ -+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then -+ $echo "\ - *** ERROR, $lockfile contains: - `cat $lockfile 2>/dev/null` - -@@ -583,13 +893,13 @@ - compiler." - - $run $rm $removelist -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one -- if test x"$output_obj" != x"$libobj"; then -- $show "$mv $output_obj $libobj" -- if $run $mv $output_obj $libobj; then : -+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then -+ $show "$mv $output_obj $lobj" -+ if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist -@@ -597,77 +907,50 @@ - fi - fi - -- # If we have no pic_flag, then copy the object into place and finish. -- if (test -z "$pic_flag" || test "$pic_mode" != default) && -- test "$build_old_libs" = yes; then -- # Rename the .lo from within objdir to obj -- if test -f $obj; then -- $show $rm $obj -- $run $rm $obj -- fi -+ # Append the name of the PIC object to the libtool object file. -+ test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != x"$srcfile"; then -- echo "\ -+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then -+ $echo "\ - *** ERROR, $lockfile contains: - `cat $lockfile 2>/dev/null` - -@@ -682,11 +965,11 @@ - compiler." - - $run $rm $removelist -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Just move the object if needed -- if test x"$output_obj" != x"$obj"; then -+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else -@@ -696,29 +979,31 @@ - fi - fi - -- # Create an invalid libtool object if no PIC, so that we do not -- # accidentally link it into a program. -- if test "$build_libtool_libs" != yes; then -- $show "echo timestamp > $libobj" -- $run eval "echo timestamp > \$libobj" || exit $? -- else -- # Move the .lo from within objdir -- $show "$mv $libobj $lo_libobj" -- if $run $mv $libobj $lo_libobj; then : -- else -- error=$? -- $run $rm $removelist -- exit $error -- fi -- fi -+ # Append the name of the non-PIC object the libtool object file. -+ # Only append if the libtool object file exists. -+ test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null 2>&1; then -+ pic_object= -+ non_pic_object= -+ -+ # Read the .lo file -+ # If there is no directory component, then add one. -+ case $arg in -+ */* | *\\*) . $arg ;; -+ *) . ./$arg ;; -+ esac -+ -+ if test -z "$pic_object" || \ -+ test -z "$non_pic_object" || -+ test "$pic_object" = none && \ -+ test "$non_pic_object" = none; then -+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2 -+ exit $EXIT_FAILURE -+ fi -+ -+ # Extract subdirectory from the argument. -+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$arg"; then -+ xdir= -+ else -+ xdir="$xdir/" -+ fi -+ -+ if test "$pic_object" != none; then -+ # Prepend the subdirectory the object is found in. -+ pic_object="$xdir$pic_object" -+ -+ if test "$prev" = dlfiles; then -+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then -+ dlfiles="$dlfiles $pic_object" -+ prev= -+ continue -+ else -+ # If libtool objects are unsupported, then we need to preload. -+ prev=dlprefiles -+ fi -+ fi -+ -+ # CHECK ME: I think I busted this. -Ossama -+ if test "$prev" = dlprefiles; then -+ # Preload the old-style object. -+ dlprefiles="$dlprefiles $pic_object" -+ prev= -+ fi -+ -+ # A PIC object. -+ libobjs="$libobjs $pic_object" -+ arg="$pic_object" -+ fi -+ -+ # Non-PIC object. -+ if test "$non_pic_object" != none; then -+ # Prepend the subdirectory the object is found in. -+ non_pic_object="$xdir$non_pic_object" -+ -+ # A standard non-PIC object -+ non_pic_objects="$non_pic_objects $non_pic_object" -+ if test -z "$pic_object" || test "$pic_object" = none ; then -+ arg="$non_pic_object" -+ fi -+ fi -+ else -+ # Only an error if not doing a dry-run. -+ if test -z "$run"; then -+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 -+ exit $EXIT_FAILURE -+ else -+ # Dry-run case. -+ -+ # Extract subdirectory from the argument. -+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$arg"; then -+ xdir= -+ else -+ xdir="$xdir/" -+ fi -+ -+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` -+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` -+ libobjs="$libobjs $pic_object" -+ non_pic_objects="$non_pic_objects $non_pic_object" -+ fi -+ fi -+ done -+ else -+ $echo "$modename: link input file \`$save_arg' does not exist" -+ exit $EXIT_FAILURE -+ fi -+ arg=$save_arg -+ prev= -+ continue -+ ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then -@@ -938,13 +1341,33 @@ - finalize_command="$finalize_command $wl$qarg" - continue - ;; -+ xcclinker) -+ linker_flags="$linker_flags $qarg" -+ compiler_flags="$compiler_flags $qarg" -+ prev= -+ compile_command="$compile_command $qarg" -+ finalize_command="$finalize_command $qarg" -+ continue -+ ;; -+ shrext) -+ shrext_cmds="$arg" -+ prev= -+ continue -+ ;; -+ darwin_framework) -+ compiler_flags="$compiler_flags $arg" -+ compile_command="$compile_command $arg" -+ finalize_command="$finalize_command $arg" -+ prev= -+ continue -+ ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac -- fi # test -n $prev -+ fi # test -n "$prev" - - prevarg="$arg" - -@@ -986,7 +1409,7 @@ - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" -- exit 1 -+ exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms -@@ -996,6 +1419,14 @@ - continue - ;; - -+ -framework|-arch) -+ prev=darwin_framework -+ compiler_flags="$compiler_flags $arg" -+ compile_command="$compile_command $arg" -+ finalize_command="$finalize_command $arg" -+ continue -+ ;; -+ - -inst-prefix-dir) - prev=inst_prefix - continue -@@ -1005,7 +1436,7 @@ - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in -- no/*-*-irix*) -+ no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; -@@ -1022,7 +1453,7 @@ - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - dir="$absdir" - ;; -@@ -1056,25 +1487,75 @@ - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; -- *-*-openbsd*) -+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; -- esac -- elif test "X$arg" = "X-lc_r"; then -- case $host in -- *-*-openbsd*) -- # Do not include libc_r directly, use -pthread flag. -+ *-*-rhapsody* | *-*-darwin1.[012]) -+ # Rhapsody C and math libraries are in the System framework -+ deplibs="$deplibs -framework System" - continue -- ;; - esac -+ elif test "X$arg" = "X-lc_r"; then -+ case $host in -+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) -+ # Do not include libc_r directly, use -pthread flag. -+ continue -+ ;; -+ esac - fi - deplibs="$deplibs $arg" - continue - ;; - -- -module) -- module=yes -+ # Tru64 UNIX uses -model [arg] to determine the layout of C++ -+ # classes, name mangling, and exception handling. -+ -model) -+ compile_command="$compile_command $arg" -+ compiler_flags="$compiler_flags $arg" -+ finalize_command="$finalize_command $arg" -+ prev=xcompiler -+ continue -+ ;; -+ -+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) -+ compiler_flags="$compiler_flags $arg" -+ compile_command="$compile_command $arg" -+ finalize_command="$finalize_command $arg" -+ continue -+ ;; -+ -+ -module) -+ module=yes -+ continue -+ ;; -+ -+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler -+ # -r[0-9][0-9]* specifies the processor on the SGI compiler -+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler -+ # +DA*, +DD* enable 64-bit mode on the HP compiler -+ # -q* pass through compiler args for the IBM compiler -+ # -m* pass through architecture-specific compiler args for GCC -+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) -+ -+ # Unknown arguments in both finalize_command and compile_command need -+ # to be aesthetically quoted because they are evaled later. -+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` -+ case $arg in -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -+ arg="\"$arg\"" -+ ;; -+ esac -+ compile_command="$compile_command $arg" -+ finalize_command="$finalize_command $arg" -+ if test "$with_gcc" = "yes" ; then -+ compiler_flags="$compiler_flags $arg" -+ fi -+ continue -+ ;; -+ -+ -shrext) -+ prev=shrext - continue - ;; - -@@ -1102,8 +1583,18 @@ - continue - ;; - -+ -objectlist) -+ prev=objectlist -+ continue -+ ;; -+ - -o) prev=output ;; - -+ -precious-files-regex) -+ prev=precious_regex -+ continue -+ ;; -+ - -release) - prev=release - continue -@@ -1126,7 +1617,7 @@ - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in -@@ -1154,6 +1645,11 @@ - prev=vinfo - continue - ;; -+ -version-number) -+ prev=vinfo -+ vinfo_number=yes -+ continue -+ ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` -@@ -1202,6 +1698,11 @@ - continue - ;; - -+ -XCClinker) -+ prev=xcclinker -+ continue -+ ;; -+ - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need -@@ -1214,29 +1715,101 @@ - esac - ;; - -- *.lo | *.$objext) -- # A library or standard object. -- if test "$prev" = dlfiles; then -- # This file was specified with -dlopen. -- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then -- dlfiles="$dlfiles $arg" -- prev= -- continue -- else -- # If libtool objects are unsupported, then we need to preload. -- prev=dlprefiles -- fi -- fi -+ *.$objext) -+ # A standard object. -+ objs="$objs $arg" -+ ;; - -- if test "$prev" = dlprefiles; then -- # Preload the old-style object. -- dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` -- prev= -- else -+ *.lo) -+ # A libtool-controlled object. -+ -+ # Check to see that this really is a libtool object. -+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ pic_object= -+ non_pic_object= -+ -+ # Read the .lo file -+ # If there is no directory component, then add one. - case $arg in -- *.lo) libobjs="$libobjs $arg" ;; -- *) objs="$objs $arg" ;; -+ */* | *\\*) . $arg ;; -+ *) . ./$arg ;; - esac -+ -+ if test -z "$pic_object" || \ -+ test -z "$non_pic_object" || -+ test "$pic_object" = none && \ -+ test "$non_pic_object" = none; then -+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2 -+ exit $EXIT_FAILURE -+ fi -+ -+ # Extract subdirectory from the argument. -+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$arg"; then -+ xdir= -+ else -+ xdir="$xdir/" -+ fi -+ -+ if test "$pic_object" != none; then -+ # Prepend the subdirectory the object is found in. -+ pic_object="$xdir$pic_object" -+ -+ if test "$prev" = dlfiles; then -+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then -+ dlfiles="$dlfiles $pic_object" -+ prev= -+ continue -+ else -+ # If libtool objects are unsupported, then we need to preload. -+ prev=dlprefiles -+ fi -+ fi -+ -+ # CHECK ME: I think I busted this. -Ossama -+ if test "$prev" = dlprefiles; then -+ # Preload the old-style object. -+ dlprefiles="$dlprefiles $pic_object" -+ prev= -+ fi -+ -+ # A PIC object. -+ libobjs="$libobjs $pic_object" -+ arg="$pic_object" -+ fi -+ -+ # Non-PIC object. -+ if test "$non_pic_object" != none; then -+ # Prepend the subdirectory the object is found in. -+ non_pic_object="$xdir$non_pic_object" -+ -+ # A standard non-PIC object -+ non_pic_objects="$non_pic_objects $non_pic_object" -+ if test -z "$pic_object" || test "$pic_object" = none ; then -+ arg="$non_pic_object" -+ fi -+ fi -+ else -+ # Only an error if not doing a dry-run. -+ if test -z "$run"; then -+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 -+ exit $EXIT_FAILURE -+ else -+ # Dry-run case. -+ -+ # Extract subdirectory from the argument. -+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$arg"; then -+ xdir= -+ else -+ xdir="$xdir/" -+ fi -+ -+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` -+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` -+ libobjs="$libobjs $pic_object" -+ non_pic_objects="$non_pic_objects $non_pic_object" -+ fi - fi - ;; - -@@ -1287,7 +1860,7 @@ - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then -@@ -1296,6 +1869,7 @@ - finalize_command="$finalize_command $arg" - fi - -+ oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" -@@ -1330,7 +1904,7 @@ - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; -@@ -1338,7 +1912,17 @@ - *) linkmode=prog ;; # Anything else should be a program. - esac - -+ case $host in -+ *cygwin* | *mingw* | *pw32*) -+ # don't eliminate duplications in $postdeps and $predeps -+ duplicate_compiler_generated_deps=yes -+ ;; -+ *) -+ duplicate_compiler_generated_deps=$duplicate_deps -+ ;; -+ esac - specialdeplibs= -+ - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) -@@ -1358,7 +1942,7 @@ - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= -- if test "X$duplicate_deps" = "Xyes" ; then -+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; -@@ -1383,7 +1967,7 @@ - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - done -@@ -1400,39 +1984,58 @@ - ;; - esac - for pass in $passes; do -+ if test "$linkmode,$pass" = "lib,link" || -+ test "$linkmode,$pass" = "prog,scan"; then -+ libs="$deplibs" -+ deplibs= -+ fi - if test "$linkmode" = prog; then -- # Determine which files to process - case $pass in -- dlopen) -- libs="$dlfiles" -- save_deplibs="$deplibs" # Collect dlpreopened libraries -- deplibs= -- ;; -+ dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; -- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; -+ link) -+ libs="$deplibs %DEPLIBS%" -+ test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" -+ ;; - esac - fi -+ if test "$pass" = dlopen; then -+ # Collect dlpreopened libraries -+ save_deplibs="$deplibs" -+ deplibs= -+ fi - for deplib in $libs; do - lib= - found=no - case $deplib in -- -l*) -- if test "$linkmode" = oldlib && test "$linkmode" = obj; then -- $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 -- continue -+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) -+ if test "$linkmode,$pass" = "prog,link"; then -+ compile_deplibs="$deplib $compile_deplibs" -+ finalize_deplibs="$deplib $finalize_deplibs" -+ else -+ compiler_flags="$compiler_flags $deplib" - fi -- if test "$pass" = conv; then -- deplibs="$deplib $deplibs" -+ continue -+ ;; -+ -l*) -+ if test "$linkmode" != lib && test "$linkmode" != prog; then -+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do -- # Search the libtool library -- lib="$searchdir/lib${name}.la" -- if test -f "$lib"; then -- found=yes -- break -- fi -+ for search_ext in .la $std_shrext .so .a; do -+ # Search the libtool library -+ lib="$searchdir/lib${name}${search_ext}" -+ if test -f "$lib"; then -+ if test "$search_ext" = ".la"; then -+ found=yes -+ else -+ found=no -+ fi -+ break 2 -+ fi -+ done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library -@@ -1444,6 +2047,42 @@ - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue -+ else # deplib is a libtool library -+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, -+ # We need to do some special things here, and not later. -+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then -+ case " $predeps $postdeps " in -+ *" $deplib "*) -+ if (${SED} -e '2q' $lib | -+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ library_names= -+ old_library= -+ case $lib in -+ */* | *\\*) . $lib ;; -+ *) . ./$lib ;; -+ esac -+ for l in $old_library $library_names; do -+ ll="$l" -+ done -+ if test "X$ll" = "X$old_library" ; then # only static version available -+ found=no -+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` -+ test "X$ladir" = "X$lib" && ladir="." -+ lib=$ladir/$old_library -+ if test "$linkmode,$pass" = "prog,link"; then -+ compile_deplibs="$deplib $compile_deplibs" -+ finalize_deplibs="$deplib $finalize_deplibs" -+ else -+ deplibs="$deplib $deplibs" -+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" -+ fi -+ continue -+ fi -+ fi -+ ;; -+ *) ;; -+ esac -+ fi - fi - ;; # -l - -L*) -@@ -1461,14 +2100,14 @@ - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" -- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi -+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) -- $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 -+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue -@@ -1493,16 +2132,33 @@ - fi - case $linkmode in - lib) -- if test "$deplibs_check_method" != pass_all; then -- echo -- echo "*** Warning: This library needs some functionality provided by $deplib." -- echo "*** I have the capability to make that library automatically link in when" -- echo "*** you link to this library. But I can only do this if you have a" -- echo "*** shared version of the library, which you do not appear to have." -+ valid_a_lib=no -+ case $deplibs_check_method in -+ match_pattern*) -+ set dummy $deplibs_check_method -+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` -+ if eval $echo \"$deplib\" 2>/dev/null \ -+ | $SED 10q \ -+ | $EGREP "$match_pattern_regex" > /dev/null; then -+ valid_a_lib=yes -+ fi -+ ;; -+ pass_all) -+ valid_a_lib=yes -+ ;; -+ esac -+ if test "$valid_a_lib" != yes; then -+ $echo -+ $echo "*** Warning: Trying to link with static lib archive $deplib." -+ $echo "*** I have the capability to make that library automatically link in when" -+ $echo "*** you link to this library. But I can only do this if you have a" -+ $echo "*** shared version of the library, which you do not appear to have" -+ $echo "*** because the file extensions .$libext of this argument makes me believe" -+ $echo "*** that it is just a static archive that I should not used here." - else -- echo -- echo "*** Warning: Linking the shared library $output against the" -- echo "*** static library $deplib is not portable!" -+ $echo -+ $echo "*** Warning: Linking the shared library $output against the" -+ $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue -@@ -1519,14 +2175,18 @@ - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) -- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then -- # If there is no dlopen support or we're linking statically, -- # we need to preload. -- newdlprefiles="$newdlprefiles $deplib" -- compile_deplibs="$deplib $compile_deplibs" -- finalize_deplibs="$deplib $finalize_deplibs" -- else -- newdlfiles="$newdlfiles $deplib" -+ if test "$pass" = conv; then -+ deplibs="$deplib $deplibs" -+ elif test "$linkmode" = prog; then -+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then -+ # If there is no dlopen support or we're linking statically, -+ # we need to preload. -+ newdlprefiles="$newdlprefiles $deplib" -+ compile_deplibs="$deplib $compile_deplibs" -+ finalize_deplibs="$deplib $finalize_deplibs" -+ else -+ newdlfiles="$newdlfiles $deplib" -+ fi - fi - continue - ;; -@@ -1538,14 +2198,14 @@ - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. -- if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : -+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` -@@ -1558,8 +2218,11 @@ - library_names= - old_library= - # If the library was installed with an old release of libtool, -- # it will not redefine variable installed. -+ # it will not redefine variables installed, or shouldnotlink - installed=yes -+ shouldnotlink=no -+ avoidtemprpath= -+ - - # Read the .la file - case $lib in -@@ -1569,8 +2232,7 @@ - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || -- { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then -- # Add dl[pre]opened files of deplib -+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi -@@ -1581,7 +2243,7 @@ - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" -@@ -1598,11 +2260,12 @@ - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - -+ - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do -@@ -1610,19 +2273,23 @@ - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi -- if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then -+ if test -z "$dlname" || -+ test "$dlopen_support" != yes || -+ test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking -- # statically, we need to preload. -- dlprefiles="$dlprefiles $lib" -+ # statically, we need to preload. We also need to preload any -+ # dependent libraries so libltdl's deplib preloader doesn't -+ # bomb out in the load deplibs phase. -+ dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi -@@ -1654,11 +2321,19 @@ - dir="$libdir" - absdir="$libdir" - fi -+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else -- dir="$ladir/$objdir" -- absdir="$abs_ladir/$objdir" -- # Remove this search path later -- notinst_path="$notinst_path $abs_ladir" -+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then -+ dir="$ladir" -+ absdir="$abs_ladir" -+ # Remove this search path later -+ notinst_path="$notinst_path $abs_ladir" -+ else -+ dir="$ladir/$objdir" -+ absdir="$abs_ladir/$objdir" -+ # Remove this search path later -+ notinst_path="$notinst_path $abs_ladir" -+ fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - -@@ -1666,7 +2341,7 @@ - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). -@@ -1688,11 +2363,12 @@ - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else -- deplibs="$lib $deplibs" -+ deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - -+ - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" -@@ -1726,13 +2402,19 @@ - continue - fi # $linkmode = prog... - -- link_static=no # Whether the deplib will be linked statically -- if test -n "$library_names" && -- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then -- # Link against this shared library -+ if test "$linkmode,$pass" = "prog,link"; then -+ if test -n "$library_names" && -+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then -+ # We need to hardcode the library path -+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then -+ # Make sure the rpath contains only unique directories. -+ case "$temp_rpath " in -+ *" $dir "*) ;; -+ *" $absdir "*) ;; -+ *) temp_rpath="$temp_rpath $absdir" ;; -+ esac -+ fi - -- if test "$linkmode,$pass" = "prog,link" || -- { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. -@@ -1754,17 +2436,6 @@ - esac - ;; - esac -- if test "$linkmode" = prog; then -- # We need to hardcode the library path -- if test -n "$shlibpath_var"; then -- # Make sure the rpath contains only unique directories. -- case "$temp_rpath " in -- *" $dir "*) ;; -- *" $absdir "*) ;; -- *) temp_rpath="$temp_rpath $dir" ;; -- esac -- fi -- fi - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && -@@ -1774,11 +2445,52 @@ - # We only need to search for static libraries - continue - fi -+ fi - -+ link_static=no # Whether the deplib will be linked statically -+ if test -n "$library_names" && -+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi -+ # This is a shared library -+ -+ # Warn about portability, can't link against -module's on -+ # some systems (darwin) -+ if test "$shouldnotlink" = yes && test "$pass" = link ; then -+ $echo -+ if test "$linkmode" = prog; then -+ $echo "*** Warning: Linking the executable $output against the loadable module" -+ else -+ $echo "*** Warning: Linking the shared library $output against the loadable module" -+ fi -+ $echo "*** $linklib is not portable!" -+ fi -+ if test "$linkmode" = lib && -+ test "$hardcode_into_libs" = yes; then -+ # Hardcode the library path. -+ # Skip directories that are in the system default run-time -+ # search path. -+ case " $sys_lib_dlsearch_path " in -+ *" $absdir "*) ;; -+ *) -+ case "$compile_rpath " in -+ *" $absdir "*) ;; -+ *) compile_rpath="$compile_rpath $absdir" -+ esac -+ ;; -+ esac -+ case " $sys_lib_dlsearch_path " in -+ *" $libdir "*) ;; -+ *) -+ case "$finalize_rpath " in -+ *" $libdir "*) ;; -+ *) finalize_rpath="$finalize_rpath $libdir" -+ esac -+ ;; -+ esac -+ fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname -@@ -1792,7 +2504,7 @@ - elif test -n "$soname_spec"; then - # bleh windows - case $host in -- *cygwin*) -+ *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; -@@ -1804,17 +2516,18 @@ - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" -- soname=`echo $soroot | sed -e 's/^.*\///'` -- newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" -+ soname=`$echo $soroot | ${SED} -e 's/^.*\///'` -+ newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' -- eval cmds=\"$extract_expsyms_cmds\" -+ cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done -@@ -1825,9 +2538,10 @@ - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' -- eval cmds=\"$old_archive_from_expsyms_cmds\" -+ cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done -@@ -1847,6 +2561,22 @@ - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" -+ case $host in -+ *-*-sco3.2v5* ) add_dir="-L$dir" ;; -+ *-*-darwin* ) -+ # if the lib is a module then we can not link against -+ # it, someone is ignoring the new warnings I added -+ if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then -+ $echo "** Warning, lib $linklib is a module, not a shared library" -+ if test -z "$old_library" ; then -+ $echo -+ $echo "** And there doesn't seem to be a static archive available" -+ $echo "** The link will probably fail, sorry" -+ else -+ add="$dir/$old_library" -+ fi -+ fi -+ esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; -@@ -1865,6 +2595,14 @@ - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" -+ # Try looking first in the location we're being installed to. -+ if test -n "$inst_prefix_dir"; then -+ case $libdir in -+ [\\/]*) -+ add_dir="$add_dir -L$inst_prefix_dir$libdir" -+ ;; -+ esac -+ fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" -@@ -1878,7 +2616,7 @@ - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" -- exit 1 -+ exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then -@@ -1912,16 +2650,7 @@ - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then -- # Try looking first in the location we're being installed to. -- add_dir= -- if test -n "$inst_prefix_dir"; then -- case "$libdir" in -- [\\/]*) -- add_dir="-L$inst_prefix_dir$libdir" -- ;; -- esac -- fi -- add_dir="$add_dir -L$libdir" -+ add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in -@@ -1929,18 +2658,24 @@ - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" -+ elif test "$hardcode_automatic" = yes; then -+ if test -n "$inst_prefix_dir" && -+ test -f "$inst_prefix_dir$libdir/$linklib" ; then -+ add="$inst_prefix_dir$libdir/$linklib" -+ else -+ add="$libdir/$linklib" -+ fi - else - # We cannot seem to hardcode it, guess we'll fake it. -+ add_dir="-L$libdir" - # Try looking first in the location we're being installed to. -- add_dir= - if test -n "$inst_prefix_dir"; then -- case "$libdir" in -- [\\/]*) -- add_dir="-L$inst_prefix_dir$libdir" -- ;; -+ case $libdir in -+ [\\/]*) -+ add_dir="$add_dir -L$inst_prefix_dir$libdir" -+ ;; - esac - fi -- add_dir="$add_dir -L$libdir" - add="-l$name" - fi - -@@ -1953,15 +2688,6 @@ - fi - fi - elif test "$linkmode" = prog; then -- if test "$alldeplibs" = yes && -- { test "$deplibs_check_method" = pass_all || -- { test "$build_libtool_libs" = yes && -- test -n "$library_names"; }; }; then -- # We only need to search for static libraries -- continue -- fi -- -- # Try to link the static library - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. -@@ -1981,20 +2707,21 @@ - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. -- echo -- echo "*** Warning: This library needs some functionality provided by $lib." -- echo "*** I have the capability to make that library automatically link in when" -- echo "*** you link to this library. But I can only do this if you have a" -- echo "*** shared version of the library, which you do not appear to have." -+ $echo -+ $echo "*** Warning: This system can not link to static lib archive $lib." -+ $echo "*** I have the capability to make that library automatically link in when" -+ $echo "*** you link to this library. But I can only do this if you have a" -+ $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then -- echo "*** Therefore, libtool will create a static module, that should work " -- echo "*** as long as the dlopening application is linked with the -dlopen flag." -+ $echo "*** But as you try to build a module library, libtool will still create " -+ $echo "*** a static module, that should work as long as the dlopening application" -+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then -- echo -- echo "*** However, this would only work if libtool was able to extract symbol" -- echo "*** lists from a program, using \`nm' or equivalent, but libtool could" -- echo "*** not find such a program. So, this module is probably useless." -- echo "*** \`nm' from GNU binutils and a full rebuild may help." -+ $echo -+ $echo "*** However, this would only work if libtool was able to extract symbol" -+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" -+ $echo "*** not find such a program. So, this module is probably useless." -+ $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module -@@ -2004,8 +2731,6 @@ - fi - fi - else -- convenience="$convenience $dir/$old_library" -- old_convenience="$old_convenience $dir/$old_library" - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi -@@ -2013,7 +2738,8 @@ - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && -- { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || -+ { test "$hardcode_into_libs" != yes || -+ test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= -@@ -2065,29 +2791,75 @@ - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then -- path="-L$absdir/$objdir" -+ path="$absdir/$objdir" - else -- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` -+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi -- path="-L$absdir" -+ path="$absdir" - fi -+ depdepl= -+ case $host in -+ *-*-darwin*) -+ # we do not want to link against static libs, -+ # but need to link against shared -+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` -+ if test -n "$deplibrary_names" ; then -+ for tmp in $deplibrary_names ; do -+ depdepl=$tmp -+ done -+ if test -f "$path/$depdepl" ; then -+ depdepl="$path/$depdepl" -+ fi -+ # do not add paths which are already there -+ case " $newlib_search_path " in -+ *" $path "*) ;; -+ *) newlib_search_path="$newlib_search_path $path";; -+ esac -+ fi -+ path="" -+ ;; -+ *) -+ path="-L$path" -+ ;; -+ esac -+ ;; -+ -l*) -+ case $host in -+ *-*-darwin*) -+ # Again, we only want to link against shared libraries -+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` -+ for tmp in $newlib_search_path ; do -+ if test -f "$tmp/lib$tmp_libs.dylib" ; then -+ eval depdepl="$tmp/lib$tmp_libs.dylib" -+ break -+ fi -+ done -+ path="" -+ ;; -+ *) continue ;; -+ esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; -- *) deplibs="$deplibs $path" ;; -+ *) deplibs="$path $deplibs" ;; -+ esac -+ case " $deplibs " in -+ *" $depdepl "*) ;; -+ *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs -+ dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do -@@ -2095,7 +2867,6 @@ - done - fi - if test "$pass" != dlopen; then -- test "$pass" != scan && dependency_libs="$newdependency_libs" - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= -@@ -2118,9 +2889,30 @@ - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do -+ # FIXME: Pedantically, this is the right thing to do, so -+ # that some nasty dependency loop isn't accidentally -+ # broken: -+ #new_libs="$deplib $new_libs" -+ # Pragmatically, this seems to cause very few problems in -+ # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; -+ -R*) ;; - *) -+ # And here is the reason: when a library appears more -+ # than once as an explicit dependence of a library, or -+ # is implicitly linked in more than once by the -+ # compiler, it is considered special, and multiple -+ # occurrences thereof are not removed. Compare this -+ # with having the same library being listed as a -+ # dependency of multiple other libraries: in this case, -+ # we know (pedantically, we assume) the library does not -+ # need to be listed more than once, so we keep only the -+ # last copy. This is not always right, but it is rare -+ # enough that we require users that really mean to play -+ # such unportable linking tricks to link the library -+ # using -Wl,-lname, so that libtool does not consider it -+ # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) -@@ -2148,11 +2940,20 @@ - eval $var=\"$tmp_libs\" - done # for var - fi -- if test "$pass" = "conv" && -- { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then -- libs="$deplibs" # reset libs -- deplibs= -- fi -+ # Last step: remove runtime libs from dependency_libs -+ # (they stay in deplibs) -+ tmp_libs= -+ for i in $dependency_libs ; do -+ case " $predeps $postdeps $compiler_lib_search_path " in -+ *" $i "*) -+ i="" -+ ;; -+ esac -+ if test -n "$i" ; then -+ tmp_libs="$tmp_libs $i" -+ fi -+ done -+ dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" -@@ -2161,6 +2962,10 @@ - - case $linkmode in - oldlib) -+ if test -n "$deplibs"; then -+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 -+ fi -+ - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi -@@ -2174,7 +2979,7 @@ - fi - - if test -n "$vinfo"; then -- $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 -+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then -@@ -2196,17 +3001,19 @@ - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` -+ eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` -+ eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` -@@ -2217,11 +3024,11 @@ - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 -- exit 1 -+ exit $EXIT_FAILURE - else -- echo -- echo "*** Warning: Linking the shared library $output against the non-libtool" -- echo "*** objects $objs is not portable!" -+ $echo -+ $echo "*** Warning: Linking the shared library $output against the non-libtool" -+ $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi -@@ -2240,14 +3047,16 @@ - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. -- libext=al -+ # Some compilers have problems with a `.al' extension so -+ # convenience libraries should have the same extension an -+ # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then -- $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 -+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then -@@ -2263,45 +3072,87 @@ - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - -- current="$2" -- revision="$3" -- age="$4" -+ # convert absolute version numbers to libtool ages -+ # this retains compatibility with .la files and attempts -+ # to make the code below a bit more comprehensible -+ -+ case $vinfo_number in -+ yes) -+ number_major="$2" -+ number_minor="$3" -+ number_revision="$4" -+ # -+ # There are really only two kinds -- those that -+ # use the current revision as the major version -+ # and those that subtract age and use age as -+ # a minor version. But, then there is irix -+ # which has an extra 1 added just for fun -+ # -+ case $version_type in -+ darwin|linux|osf|windows) -+ current=`expr $number_major + $number_minor` -+ age="$number_minor" -+ revision="$number_revision" -+ ;; -+ freebsd-aout|freebsd-elf|sunos) -+ current="$number_major" -+ revision="$number_minor" -+ age="0" -+ ;; -+ irix|nonstopux) -+ current=`expr $number_major + $number_minor - 1` -+ age="$number_minor" -+ revision="$number_minor" -+ ;; -+ *) -+ $echo "$modename: unknown library version type \`$version_type'" 1>&2 -+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 -+ exit $EXIT_FAILURE -+ ;; -+ esac -+ ;; -+ no) -+ current="$2" -+ revision="$3" -+ age="$4" -+ ;; -+ esac - - # Check that each of the things are valid numbers. - case $current in -- [0-9]*) ;; -+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) -- $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 -+ $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - - case $revision in -- [0-9]*) ;; -+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) -- $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 -+ $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - - case $age in -- [0-9]*) ;; -+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) -- $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 -+ $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Calculate the version variables. -@@ -2318,7 +3169,7 @@ - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` -- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" -+ verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) -@@ -2331,16 +3182,21 @@ - versuffix=".$current"; - ;; - -- irix) -+ irix | nonstopux) - major=`expr $current - $age + 1` -- verstring="sgi$major.$revision" -+ -+ case $version_type in -+ nonstopux) verstring_prefix=nonstopux ;; -+ *) verstring_prefix=sgi ;; -+ esac -+ verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` -- verstring="sgi$major.$iface:$verstring" -+ verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. -@@ -2354,7 +3210,7 @@ - ;; - - osf) -- major=`expr $current - $age` -+ major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - -@@ -2384,20 +3240,19 @@ - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 -- echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 -- exit 1 -+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 -+ exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= -- verstring="0.0" - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely -- verstring="" -+ verstring= - ;; - *) - verstring="0.0" -@@ -2431,9 +3286,30 @@ - fi - - if test "$mode" != relink; then -- # Remove our outputs. -- $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" -- $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* -+ # Remove our outputs, but don't remove object files since they -+ # may have been created when compiling PIC objects. -+ removelist= -+ tempremovelist=`$echo "$output_objdir/*"` -+ for p in $tempremovelist; do -+ case $p in -+ *.$objext) -+ ;; -+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) -+ if test "X$precious_files_regex" != "X"; then -+ if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 -+ then -+ continue -+ fi -+ fi -+ removelist="$removelist $p" -+ ;; -+ *) ;; -+ esac -+ done -+ if test -n "$removelist"; then -+ $show "${rm}r $removelist" -+ $run ${rm}r $removelist -+ fi - fi - - # Now set the variables for building old libraries. -@@ -2446,9 +3322,9 @@ - - # Eliminate all temporary directories. - for path in $notinst_path; do -- lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` -- deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` -- dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` -+ lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` -+ deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` -+ dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then -@@ -2499,10 +3375,11 @@ - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; -- *-*-openbsd*) -+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. -+ test "X$arg" = "X-lc" && continue - ;; -- *) -+ *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" -@@ -2531,7 +3408,7 @@ - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just -- # implementing what was already the behaviour. -+ # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) -@@ -2544,64 +3421,88 @@ - int main() { return 0; } - EOF - $rm conftest -- $CC -o conftest conftest.c $deplibs -+ $LTCC -o conftest conftest.c $deplibs - if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - for i in $deplibs; do -- name="`expr $i : '-l\(.*\)'`" -+ name=`expr $i : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. -- if test -n "$name" && test "$name" != "0"; then -- libname=`eval \\$echo \"$libname_spec\"` -- deplib_matches=`eval \\$echo \"$library_names_spec\"` -- set dummy $deplib_matches -- deplib_match=$2 -- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then -- newdeplibs="$newdeplibs $i" -- else -- droppeddeps=yes -- echo -- echo "*** Warning: This library needs some functionality provided by $i." -- echo "*** I have the capability to make that library automatically link in when" -- echo "*** you link to this library. But I can only do this if you have a" -- echo "*** shared version of the library, which you do not appear to have." -+ if test "$name" != "" && test "$name" -ne "0"; then -+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then -+ case " $predeps $postdeps " in -+ *" $i "*) -+ newdeplibs="$newdeplibs $i" -+ i="" -+ ;; -+ esac -+ fi -+ if test -n "$i" ; then -+ libname=`eval \\$echo \"$libname_spec\"` -+ deplib_matches=`eval \\$echo \"$library_names_spec\"` -+ set dummy $deplib_matches -+ deplib_match=$2 -+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then -+ newdeplibs="$newdeplibs $i" -+ else -+ droppeddeps=yes -+ $echo -+ $echo "*** Warning: dynamic linker does not accept needed library $i." -+ $echo "*** I have the capability to make that library automatically link in when" -+ $echo "*** you link to this library. But I can only do this if you have a" -+ $echo "*** shared version of the library, which I believe you do not have" -+ $echo "*** because a test_compile did reveal that the linker did not use it for" -+ $echo "*** its dynamic dependency list that programs get resolved with at runtime." -+ fi - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else -- # Error occured in the first compile. Let's try to salvage the situation: -- # Compile a seperate program for each library. -+ # Error occurred in the first compile. Let's try to salvage -+ # the situation: Compile a separate program for each library. - for i in $deplibs; do -- name="`expr $i : '-l\(.*\)'`" -- # If $name is empty we are operating on a -L argument. -- if test -n "$name" && test "$name" != "0"; then -+ name=`expr $i : '-l\(.*\)'` -+ # If $name is empty we are operating on a -L argument. -+ if test "$name" != "" && test "$name" != "0"; then - $rm conftest -- $CC -o conftest conftest.c $i -+ $LTCC -o conftest conftest.c $i - # Did it work? - if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` -- libname=`eval \\$echo \"$libname_spec\"` -- deplib_matches=`eval \\$echo \"$library_names_spec\"` -- set dummy $deplib_matches -- deplib_match=$2 -- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then -- newdeplibs="$newdeplibs $i" -- else -- droppeddeps=yes -- echo -- echo "*** Warning: This library needs some functionality provided by $i." -- echo "*** I have the capability to make that library automatically link in when" -- echo "*** you link to this library. But I can only do this if you have a" -- echo "*** shared version of the library, which you do not appear to have." -+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then -+ case " $predeps $postdeps " in -+ *" $i "*) -+ newdeplibs="$newdeplibs $i" -+ i="" -+ ;; -+ esac -+ fi -+ if test -n "$i" ; then -+ libname=`eval \\$echo \"$libname_spec\"` -+ deplib_matches=`eval \\$echo \"$library_names_spec\"` -+ set dummy $deplib_matches -+ deplib_match=$2 -+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then -+ newdeplibs="$newdeplibs $i" -+ else -+ droppeddeps=yes -+ $echo -+ $echo "*** Warning: dynamic linker does not accept needed library $i." -+ $echo "*** I have the capability to make that library automatically link in when" -+ $echo "*** you link to this library. But I can only do this if you have a" -+ $echo "*** shared version of the library, which you do not appear to have" -+ $echo "*** because a test_compile did reveal that the linker did not use this one" -+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime." -+ fi - fi - else - droppeddeps=yes -- echo -- echo "*** Warning! Library $i is needed by this library but I was not able to" -- echo "*** make it link in! You will probably need to install it or some" -- echo "*** library that it depends on before this library will be fully" -- echo "*** functional. Installing it before continuing would be even better." -+ $echo -+ $echo "*** Warning! Library $i is needed by this library but I was not able to" -+ $echo "*** make it link in! You will probably need to install it or some" -+ $echo "*** library that it depends on before this library will be fully" -+ $echo "*** functional. Installing it before continuing would be even better." - fi - else - newdeplibs="$newdeplibs $i" -@@ -2613,13 +3514,22 @@ - set dummy $deplibs_check_method - file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do -- name="`expr $a_deplib : '-l\(.*\)'`" -+ name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. -- if test -n "$name" && test "$name" != "0"; then -- libname=`eval \\$echo \"$libname_spec\"` -- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do -- potential_libs=`ls $i/$libname[.-]* 2>/dev/null` -- for potent_lib in $potential_libs; do -+ if test "$name" != "" && test "$name" != "0"; then -+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then -+ case " $predeps $postdeps " in -+ *" $a_deplib "*) -+ newdeplibs="$newdeplibs $a_deplib" -+ a_deplib="" -+ ;; -+ esac -+ fi -+ if test -n "$a_deplib" ; then -+ libname=`eval \\$echo \"$libname_spec\"` -+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do -+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null` -+ for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then -@@ -2632,28 +3542,36 @@ - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do -- potliblink=`ls -ld $potlib | sed 's/.* -> //'` -+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ -- | sed 10q \ -- | egrep "$file_magic_regex" > /dev/null; then -+ | ${SED} 10q \ -+ | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi -- done -- done -+ done -+ done -+ fi - if test -n "$a_deplib" ; then - droppeddeps=yes -- echo -- echo "*** Warning: This library needs some functionality provided by $a_deplib." -- echo "*** I have the capability to make that library automatically link in when" -- echo "*** you link to this library. But I can only do this if you have a" -- echo "*** shared version of the library, which you do not appear to have." -+ $echo -+ $echo "*** Warning: linker path does not have real file for library $a_deplib." -+ $echo "*** I have the capability to make that library automatically link in when" -+ $echo "*** you link to this library. But I can only do this if you have a" -+ $echo "*** shared version of the library, which you do not appear to have" -+ $echo "*** because I did check the linker path looking for a file starting" -+ if test -z "$potlib" ; then -+ $echo "*** with $libname but no candidates were found. (...for file magic test)" -+ else -+ $echo "*** with $libname and none of the candidates passed a file format test" -+ $echo "*** using a file magic. Last file checked: $potlib" -+ fi - fi - else - # Add a -L argument. -@@ -2665,29 +3583,47 @@ - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do -- name="`expr $a_deplib : '-l\(.*\)'`" -+ name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then -- libname=`eval \\$echo \"$libname_spec\"` -- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do -- potential_libs=`ls $i/$libname[.-]* 2>/dev/null` -- for potent_lib in $potential_libs; do -- if eval echo \"$potent_lib\" 2>/dev/null \ -- | sed 10q \ -- | egrep "$match_pattern_regex" > /dev/null; then -- newdeplibs="$newdeplibs $a_deplib" -- a_deplib="" -- break 2 -- fi -+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then -+ case " $predeps $postdeps " in -+ *" $a_deplib "*) -+ newdeplibs="$newdeplibs $a_deplib" -+ a_deplib="" -+ ;; -+ esac -+ fi -+ if test -n "$a_deplib" ; then -+ libname=`eval \\$echo \"$libname_spec\"` -+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do -+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null` -+ for potent_lib in $potential_libs; do -+ potlib="$potent_lib" # see symlink-check above in file_magic test -+ if eval $echo \"$potent_lib\" 2>/dev/null \ -+ | ${SED} 10q \ -+ | $EGREP "$match_pattern_regex" > /dev/null; then -+ newdeplibs="$newdeplibs $a_deplib" -+ a_deplib="" -+ break 2 -+ fi -+ done - done -- done -+ fi - if test -n "$a_deplib" ; then - droppeddeps=yes -- echo -- echo "*** Warning: This library needs some functionality provided by $a_deplib." -- echo "*** I have the capability to make that library automatically link in when" -- echo "*** you link to this library. But I can only do this if you have a" -- echo "*** shared version of the library, which you do not appear to have." -+ $echo -+ $echo "*** Warning: linker path does not have real file for library $a_deplib." -+ $echo "*** I have the capability to make that library automatically link in when" -+ $echo "*** you link to this library. But I can only do this if you have a" -+ $echo "*** shared version of the library, which you do not appear to have" -+ $echo "*** because I did check the linker path looking for a file starting" -+ if test -z "$potlib" ; then -+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)" -+ else -+ $echo "*** with $libname and none of the candidates passed a file format test" -+ $echo "*** using a regex pattern. Last file checked: $potlib" -+ fi - fi - else - # Add a -L argument. -@@ -2697,16 +3633,23 @@ - ;; - none | unknown | *) - newdeplibs="" -- if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -- -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | -- grep . >/dev/null; then -- echo -+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -+ -e 's/ -[LR][^ ]*//g'` -+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then -+ for i in $predeps $postdeps ; do -+ # can't use Xsed below, because $i might contain '/' -+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` -+ done -+ fi -+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ -+ | grep . >/dev/null; then -+ $echo - if test "X$deplibs_check_method" = "Xnone"; then -- echo "*** Warning: inter-library dependencies are not supported in this platform." -+ $echo "*** Warning: inter-library dependencies are not supported in this platform." - else -- echo "*** Warning: inter-library dependencies are not known to be supported." -+ $echo "*** Warning: inter-library dependencies are not known to be supported." - fi -- echo "*** All declared inter-library dependencies are being dropped." -+ $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; -@@ -2726,17 +3669,17 @@ - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then -- echo -- echo "*** Warning: libtool could not satisfy all declared inter-library" -- echo "*** dependencies of module $libname. Therefore, libtool will create" -- echo "*** a static module, that should work as long as the dlopening" -- echo "*** application is linked with the -dlopen flag." -+ $echo -+ $echo "*** Warning: libtool could not satisfy all declared inter-library" -+ $echo "*** dependencies of module $libname. Therefore, libtool will create" -+ $echo "*** a static module, that should work as long as the dlopening" -+ $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then -- echo -- echo "*** However, this would only work if libtool was able to extract symbol" -- echo "*** lists from a program, using \`nm' or equivalent, but libtool could" -- echo "*** not find such a program. So, this module is probably useless." -- echo "*** \`nm' from GNU binutils and a full rebuild may help." -+ $echo -+ $echo "*** However, this would only work if libtool was able to extract symbol" -+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" -+ $echo "*** not find such a program. So, this module is probably useless." -+ $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" -@@ -2746,16 +3689,16 @@ - build_libtool_libs=no - fi - else -- echo "*** The inter-library dependencies that have been dropped here will be" -- echo "*** automatically added whenever a program is linked with this library" -- echo "*** or is declared to -dlopen it." -+ $echo "*** The inter-library dependencies that have been dropped here will be" -+ $echo "*** automatically added whenever a program is linked with this library" -+ $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then -- echo -- echo "*** Since this library must not contain undefined symbols," -- echo "*** because either the platform does not support them or" -- echo "*** it was explicitly requested with -no-undefined," -- echo "*** libtool will only create a static version of it." -+ $echo -+ $echo "*** Since this library must not contain undefined symbols," -+ $echo "*** because either the platform does not support them or" -+ $echo "*** it was explicitly requested with -no-undefined," -+ $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module -@@ -2813,7 +3756,11 @@ - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" -- eval dep_rpath=\"$hardcode_libdir_flag_spec\" -+ if test -n "$hardcode_libdir_flag_spec_ld"; then -+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" -+ else -+ eval dep_rpath=\"$hardcode_libdir_flag_spec\" -+ fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. -@@ -2833,6 +3780,7 @@ - fi - - # Get the real and link names of the library. -+ eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" -@@ -2843,7 +3791,9 @@ - else - soname="$realname" - fi -- test -z "$dlname" && dlname=$soname -+ if test -z "$dlname"; then -+ dlname=$soname -+ fi - - lib="$output_objdir/$realname" - for link -@@ -2851,23 +3801,6 @@ - linknames="$linknames $link" - done - -- # Ensure that we have .o objects for linkers which dislike .lo -- # (e.g. aix) in case we are running --disable-static -- for obj in $libobjs; do -- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` -- if test "X$xdir" = "X$obj"; then -- xdir="." -- else -- xdir="$xdir" -- fi -- baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` -- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` -- if test ! -f $xdir/$oldobj; then -- $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" -- $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? -- fi -- done -- - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - -@@ -2877,17 +3810,29 @@ - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols -- eval cmds=\"$export_symbols_cmds\" -+ cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -- $show "$cmd" -- $run eval "$cmd" || exit $? -+ eval cmd=\"$cmd\" -+ if len=`expr "X$cmd" : ".*"` && -+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then -+ $show "$cmd" -+ $run eval "$cmd" || exit $? -+ skipped_export=false -+ else -+ # The command line is too long to execute in one step. -+ $show "using reloadable object file for export list..." -+ skipped_export=: -+ # Break out early, otherwise skipped_export may be -+ # set to false by a later but shorter cmd. -+ break -+ fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then -- $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" -- $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' -+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" -+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi -@@ -2898,46 +3843,30 @@ - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - -+ tmp_deplibs= -+ for test_deplib in $deplibs; do -+ case " $convenience " in -+ *" $test_deplib "*) ;; -+ *) -+ tmp_deplibs="$tmp_deplibs $test_deplib" -+ ;; -+ esac -+ done -+ deplibs="$tmp_deplibs" -+ - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then -+ save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" -- $show "${rm}r $gentop" -- $run ${rm}r "$gentop" -- $show "mkdir $gentop" -- $run mkdir "$gentop" -- status=$? -- if test "$status" -ne 0 && test ! -d "$gentop"; then -- exit $status -- fi - generated="$generated $gentop" - -- for xlib in $convenience; do -- # Extract the objects. -- case $xlib in -- [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; -- *) xabs=`pwd`"/$xlib" ;; -- esac -- xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` -- xdir="$gentop/$xlib" -- -- $show "${rm}r $xdir" -- $run ${rm}r "$xdir" -- $show "mkdir $xdir" -- $run mkdir "$xdir" -- status=$? -- if test "$status" -ne 0 && test ! -d "$xdir"; then -- exit $status -- fi -- $show "(cd $xdir && $AR x $xabs)" -- $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? -- -- libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` -- done -+ func_extract_archives $gentop $convenience -+ libobjs="$libobjs $func_extract_archives_result" - fi - fi -- -+ - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" -@@ -2949,23 +3878,175 @@ - fi - - # Do each of the archive commands. -+ if test "$module" = yes && test -n "$module_cmds" ; then -+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then -+ eval test_cmds=\"$module_expsym_cmds\" -+ cmds=$module_expsym_cmds -+ else -+ eval test_cmds=\"$module_cmds\" -+ cmds=$module_cmds -+ fi -+ else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then -- eval cmds=\"$archive_expsym_cmds\" -+ eval test_cmds=\"$archive_expsym_cmds\" -+ cmds=$archive_expsym_cmds -+ else -+ eval test_cmds=\"$archive_cmds\" -+ cmds=$archive_cmds -+ fi -+ fi -+ -+ if test "X$skipped_export" != "X:" && -+ len=`expr "X$test_cmds" : ".*" 2>/dev/null` && -+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then -+ : - else -- eval cmds=\"$archive_cmds\" -+ # The command line is too long to link in one step, link piecewise. -+ $echo "creating reloadable object files..." -+ -+ # Save the value of $output and $libobjs because we want to -+ # use them later. If we have whole_archive_flag_spec, we -+ # want to use save_libobjs as it was before -+ # whole_archive_flag_spec was expanded, because we can't -+ # assume the linker understands whole_archive_flag_spec. -+ # This may have to be revisited, in case too many -+ # convenience libraries get linked in and end up exceeding -+ # the spec. -+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then -+ save_libobjs=$libobjs -+ fi -+ save_output=$output -+ output_la=`$echo "X$output" | $Xsed -e "$basename"` -+ -+ # Clear the reloadable object creation command queue and -+ # initialize k to one. -+ test_cmds= -+ concat_cmds= -+ objlist= -+ delfiles= -+ last_robj= -+ k=1 -+ output=$output_objdir/$output_la-${k}.$objext -+ # Loop over the list of objects to be linked. -+ for obj in $save_libobjs -+ do -+ eval test_cmds=\"$reload_cmds $objlist $last_robj\" -+ if test "X$objlist" = X || -+ { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && -+ test "$len" -le "$max_cmd_len"; }; then -+ objlist="$objlist $obj" -+ else -+ # The command $test_cmds is almost too long, add a -+ # command to the queue. -+ if test "$k" -eq 1 ; then -+ # The first file doesn't have a previous command to add. -+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\" -+ else -+ # All subsequent reloadable object files will link in -+ # the last one created. -+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" -+ fi -+ last_robj=$output_objdir/$output_la-${k}.$objext -+ k=`expr $k + 1` -+ output=$output_objdir/$output_la-${k}.$objext -+ objlist=$obj -+ len=1 -+ fi -+ done -+ # Handle the remaining objects by creating one last -+ # reloadable object file. All subsequent reloadable object -+ # files will link in the last one created. -+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~ -+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" -+ -+ if ${skipped_export-false}; then -+ $show "generating symbol list for \`$libname.la'" -+ export_symbols="$output_objdir/$libname.exp" -+ $run $rm $export_symbols -+ libobjs=$output -+ # Append the command to create the export file. -+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" -+ fi -+ -+ # Set up a command to remove the reloadable object files -+ # after they are used. -+ i=0 -+ while test "$i" -lt "$k" -+ do -+ i=`expr $i + 1` -+ delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" -+ done -+ -+ $echo "creating a temporary reloadable object file: $output" -+ -+ # Loop through the commands generated above and execute them. -+ save_ifs="$IFS"; IFS='~' -+ for cmd in $concat_cmds; do -+ IFS="$save_ifs" -+ $show "$cmd" -+ $run eval "$cmd" || exit $? -+ done -+ IFS="$save_ifs" -+ -+ libobjs=$output -+ # Restore the value of output. -+ output=$save_output -+ -+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then -+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" -+ fi -+ # Expand the library linking commands again to reset the -+ # value of $libobjs for piecewise linking. -+ -+ # Do each of the archive commands. -+ if test "$module" = yes && test -n "$module_cmds" ; then -+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then -+ cmds=$module_expsym_cmds -+ else -+ cmds=$module_cmds -+ fi -+ else -+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then -+ cmds=$archive_expsym_cmds -+ else -+ cmds=$archive_cmds -+ fi -+ fi -+ -+ # Append the command to remove the reloadable object files -+ # to the just-reset $cmds. -+ eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" -- $run eval "$cmd" || exit $? -+ $run eval "$cmd" || { -+ lt_exit=$? -+ -+ # Restore the uninstalled library and exit -+ if test "$mode" = relink; then -+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' -+ fi -+ -+ exit $lt_exit -+ } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? -- exit 0 -+ -+ if test -n "$convenience"; then -+ if test -z "$whole_archive_flag_spec"; then -+ $show "${rm}r $gentop" -+ $run ${rm}r "$gentop" -+ fi -+ fi -+ -+ exit $EXIT_SUCCESS - fi - - # Create links to the real library. -@@ -3013,7 +4094,7 @@ - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` -@@ -3042,38 +4123,10 @@ - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" -- $show "${rm}r $gentop" -- $run ${rm}r "$gentop" -- $show "mkdir $gentop" -- $run mkdir "$gentop" -- status=$? -- if test "$status" -ne 0 && test ! -d "$gentop"; then -- exit $status -- fi - generated="$generated $gentop" - -- for xlib in $convenience; do -- # Extract the objects. -- case $xlib in -- [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; -- *) xabs=`pwd`"/$xlib" ;; -- esac -- xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` -- xdir="$gentop/$xlib" -- -- $show "${rm}r $xdir" -- $run ${rm}r "$xdir" -- $show "mkdir $xdir" -- $run mkdir "$xdir" -- status=$? -- if test "$status" -ne 0 && test ! -d "$xdir"; then -- exit $status -- fi -- $show "(cd $xdir && $AR x $xabs)" -- $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? -- -- reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` -- done -+ func_extract_archives $gentop $convenience -+ reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - -@@ -3081,10 +4134,11 @@ - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" -- eval cmds=\"$reload_cmds\" -+ cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done -@@ -3097,7 +4151,7 @@ - $run ${rm}r $gentop - fi - -- exit 0 -+ exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then -@@ -3108,37 +4162,24 @@ - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. -- $show "echo timestamp > $libobj" -- $run eval "echo timestamp > $libobj" || exit $? -- exit 0 -+ # $show "echo timestamp > $libobj" -+ # $run eval "echo timestamp > $libobj" || exit $? -+ exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" -- eval cmds=\"$reload_cmds\" -+ cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" -- else -- # Just create a symlink. -- $show $rm $libobj -- $run $rm $libobj -- xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` -- if test "X$xdir" = "X$libobj"; then -- xdir="." -- else -- xdir="$xdir" -- fi -- baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` -- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` -- $show "(cd $xdir && $LN_S $oldobj $baseobj)" -- $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? - fi - - if test -n "$gentop"; then -@@ -3146,12 +4187,12 @@ - $run ${rm}r $gentop - fi - -- exit 0 -+ exit $EXIT_SUCCESS - ;; - - prog) - case $host in -- *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; -+ *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 -@@ -3176,6 +4217,16 @@ - ;; - esac - -+ case $host in -+ *darwin*) -+ # Don't allow lazy linking, it breaks C++ global constructors -+ if test "$tagname" = CXX ; then -+ compile_command="$compile_command ${wl}-bind_at_load" -+ finalize_command="$finalize_command ${wl}-bind_at_load" -+ fi -+ ;; -+ esac -+ - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - -@@ -3326,31 +4377,31 @@ - done - - if test -n "$exclude_expsyms"; then -- $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' -+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then -- $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' -+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then -- export_symbols="$output_objdir/$output.exp" -+ export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols -- $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' -+ $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else -- $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' -- $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' -+ $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' -+ $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" -- name=`echo "$arg" | sed -e 's%^.*/%%'` -- $run eval 'echo ": $name " >> "$nlist"' -+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` -+ $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - -@@ -3359,12 +4410,18 @@ - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then -- egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T -+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. -- if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then -+ if grep -v "^: " < "$nlist" | -+ if sort -k 3 /dev/null 2>&1; then -+ sort -k 3 -+ else -+ sort +2 -+ fi | -+ uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S -@@ -3373,7 +4430,7 @@ - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else -- echo '/* NONE */' >> "$output_objdir/$dlsyms" -+ $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ -@@ -3388,7 +4445,26 @@ - #endif - - /* The mapping between symbol names and symbols. */ -+" -+ -+ case $host in -+ *cygwin* | *mingw* ) -+ $echo >> "$output_objdir/$dlsyms" "\ -+/* DATA imports from DLLs on WIN32 can't be const, because -+ runtime relocations are performed -- see ld's documentation -+ on pseudo-relocs */ -+struct { -+" -+ ;; -+ * ) -+ $echo >> "$output_objdir/$dlsyms" "\ - const struct { -+" -+ ;; -+ esac -+ -+ -+ $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; - } -@@ -3425,18 +4501,18 @@ - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; -- *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; -+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; -- *) pic_flag_for_symtable=" $pic_flag -DPIC";; -+ *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. -- $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" -- $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? -+ $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" -+ $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" -@@ -3448,7 +4524,7 @@ - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - else -@@ -3536,7 +4612,7 @@ - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? -- exit 0 -+ exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then -@@ -3591,10 +4667,10 @@ - fi - - # Quote $echo for shipping. -- if test "X$echo" = "X$SHELL $0 --fallback-echo"; then -- case $0 in -- [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; -- *) qecho="$SHELL `pwd`/$0 --fallback-echo";; -+ if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then -+ case $progpath in -+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; -+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else -@@ -3606,15 +4682,231 @@ - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in -- *.exe) output=`echo $output|sed 's,.exe$,,'` ;; -+ *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in -- *cygwin*) exeext=.exe ;; -+ *cygwin*) -+ exeext=.exe -+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac -+ case $host in -+ *cygwin* | *mingw* ) -+ cwrappersource=`$echo ${objdir}/lt-${outputname}.c` -+ cwrapper=`$echo ${output}.exe` -+ $rm $cwrappersource $cwrapper -+ trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 -+ -+ cat > $cwrappersource <> $cwrappersource<<"EOF" -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#if defined(PATH_MAX) -+# define LT_PATHMAX PATH_MAX -+#elif defined(MAXPATHLEN) -+# define LT_PATHMAX MAXPATHLEN -+#else -+# define LT_PATHMAX 1024 -+#endif -+ -+#ifndef DIR_SEPARATOR -+#define DIR_SEPARATOR '/' -+#endif -+ -+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ -+ defined (__OS2__) -+#define HAVE_DOS_BASED_FILE_SYSTEM -+#ifndef DIR_SEPARATOR_2 -+#define DIR_SEPARATOR_2 '\\' -+#endif -+#endif -+ -+#ifndef DIR_SEPARATOR_2 -+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -+#else /* DIR_SEPARATOR_2 */ -+# define IS_DIR_SEPARATOR(ch) \ -+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -+#endif /* DIR_SEPARATOR_2 */ -+ -+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -+#define XFREE(stale) do { \ -+ if (stale) { free ((void *) stale); stale = 0; } \ -+} while (0) -+ -+const char *program_name = NULL; -+ -+void * xmalloc (size_t num); -+char * xstrdup (const char *string); -+char * basename (const char *name); -+char * fnqualify(const char *path); -+char * strendzap(char *str, const char *pat); -+void lt_fatal (const char *message, ...); -+ -+int -+main (int argc, char *argv[]) -+{ -+ char **newargz; -+ int i; -+ -+ program_name = (char *) xstrdup ((char *) basename (argv[0])); -+ newargz = XMALLOC(char *, argc+2); -+EOF -+ -+ cat >> $cwrappersource <> $cwrappersource <<"EOF" -+ newargz[1] = fnqualify(argv[0]); -+ /* we know the script has the same name, without the .exe */ -+ /* so make sure newargz[1] doesn't end in .exe */ -+ strendzap(newargz[1],".exe"); -+ for (i = 1; i < argc; i++) -+ newargz[i+1] = xstrdup(argv[i]); -+ newargz[argc+1] = NULL; -+EOF -+ -+ cat >> $cwrappersource <> $cwrappersource <<"EOF" -+ return 127; -+} -+ -+void * -+xmalloc (size_t num) -+{ -+ void * p = (void *) malloc (num); -+ if (!p) -+ lt_fatal ("Memory exhausted"); -+ -+ return p; -+} -+ -+char * -+xstrdup (const char *string) -+{ -+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -+; -+} -+ -+char * -+basename (const char *name) -+{ -+ const char *base; -+ -+#if defined (HAVE_DOS_BASED_FILE_SYSTEM) -+ /* Skip over the disk name in MSDOS pathnames. */ -+ if (isalpha (name[0]) && name[1] == ':') -+ name += 2; -+#endif -+ -+ for (base = name; *name; name++) -+ if (IS_DIR_SEPARATOR (*name)) -+ base = name + 1; -+ return (char *) base; -+} -+ -+char * -+fnqualify(const char *path) -+{ -+ size_t size; -+ char *p; -+ char tmp[LT_PATHMAX + 1]; -+ -+ assert(path != NULL); -+ -+ /* Is it qualified already? */ -+#if defined (HAVE_DOS_BASED_FILE_SYSTEM) -+ if (isalpha (path[0]) && path[1] == ':') -+ return xstrdup (path); -+#endif -+ if (IS_DIR_SEPARATOR (path[0])) -+ return xstrdup (path); -+ -+ /* prepend the current directory */ -+ /* doesn't handle '~' */ -+ if (getcwd (tmp, LT_PATHMAX) == NULL) -+ lt_fatal ("getcwd failed"); -+ size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ -+ p = XMALLOC(char, size); -+ sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); -+ return p; -+} -+ -+char * -+strendzap(char *str, const char *pat) -+{ -+ size_t len, patlen; -+ -+ assert(str != NULL); -+ assert(pat != NULL); -+ -+ len = strlen(str); -+ patlen = strlen(pat); -+ -+ if (patlen <= len) -+ { -+ str += len - patlen; -+ if (strcmp(str, pat) == 0) -+ *str = '\0'; -+ } -+ return str; -+} -+ -+static void -+lt_error_core (int exit_status, const char * mode, -+ const char * message, va_list ap) -+{ -+ fprintf (stderr, "%s: %s: ", program_name, mode); -+ vfprintf (stderr, message, ap); -+ fprintf (stderr, ".\n"); -+ -+ if (exit_status >= 0) -+ exit (exit_status); -+} -+ -+void -+lt_fatal (const char *message, ...) -+{ -+ va_list ap; -+ va_start (ap, message); -+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap); -+ va_end (ap); -+} -+EOF -+ # we should really use a build-platform specific compiler -+ # here, but OTOH, the wrappers (shell script and this C one) -+ # are only useful if you want to execute the "real" binary. -+ # Since the "real" binary is built for $host, then this -+ # wrapper might as well be built for $host, too. -+ $run $LTCC -s -o $cwrapper $cwrappersource -+ ;; -+ esac - $rm $output -- trap "$rm $output; exit 1" 1 2 15 -+ trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ - #! $SHELL -@@ -3630,12 +4922,12 @@ - - # Sed substitution that helps us do robust quoting. It backslashifies - # metacharacters that are still active within double-quoted strings. --Xsed='sed -e 1s/^X//' -+Xsed='${SED} -e 1s/^X//' - sed_quote_subst='$sed_quote_subst' - - # The HP-UX ksh and POSIX shell print the target directory to stdout - # if CDPATH is set. --if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi -+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - relink_command=\"$relink_command\" - -@@ -3668,7 +4960,7 @@ - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. -- file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` -+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - -@@ -3681,7 +4973,7 @@ - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` -- file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` -+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. -@@ -3690,12 +4982,12 @@ - " - - if test "$fast_install" = yes; then -- echo >> $output "\ -+ $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ -- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ -+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" -@@ -3706,7 +4998,7 @@ - $rm \"\$progdir/\$file\" - fi" - -- echo >> $output "\ -+ $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then -@@ -3714,7 +5006,7 @@ - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" -- exit 1 -+ exit $EXIT_FAILURE - fi - fi - -@@ -3724,13 +5016,13 @@ - $rm \"\$progdir/\$file\" - fi" - else -- echo >> $output "\ -+ $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" - " - fi - -- echo >> $output "\ -+ $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - -@@ -3761,47 +5053,35 @@ - # Run the actual program with our arguments. - " - case $host in -- # win32 systems need to use the prog path for dll -- # lookup to work -- *-*-cygwin* | *-*-pw32*) -- $echo >> $output "\ -- exec \$progdir/\$program \${1+\"\$@\"} --" -- ;; -- - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ -- exec \$progdir\\\\\$program \${1+\"\$@\"} -+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} - " - ;; - - *) - $echo >> $output "\ -- # Export the path to the program. -- PATH=\"\$progdir:\$PATH\" -- export PATH -- -- exec \$program \${1+\"\$@\"} -+ exec \"\$progdir/\$program\" \${1+\"\$@\"} - " - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" -- exit 1 -+ exit $EXIT_FAILURE - fi - else - # The program doesn't exist. -- \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 -+ \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 -- echo \"See the $PACKAGE documentation for more information.\" 1>&2 -- exit 1 -+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2 -+ exit $EXIT_FAILURE - fi - fi\ - " - chmod +x $output - fi -- exit 0 -+ exit $EXIT_SUCCESS - ;; - esac - -@@ -3817,74 +5097,130 @@ - oldobjs="$libobjs_save" - build_libtool_libs=no - else -- oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` -+ oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" -- $show "${rm}r $gentop" -- $run ${rm}r "$gentop" -- $show "mkdir $gentop" -- $run mkdir "$gentop" -- status=$? -- if test "$status" -ne 0 && test ! -d "$gentop"; then -- exit $status -- fi - generated="$generated $gentop" - -- # Add in members from convenience archives. -- for xlib in $addlibs; do -- # Extract the objects. -- case $xlib in -- [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; -- *) xabs=`pwd`"/$xlib" ;; -- esac -- xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` -- xdir="$gentop/$xlib" -- -- $show "${rm}r $xdir" -- $run ${rm}r "$xdir" -- $show "mkdir $xdir" -- $run mkdir "$xdir" -- status=$? -- if test "$status" -ne 0 && test ! -d "$xdir"; then -- exit $status -- fi -- $show "(cd $xdir && $AR x $xabs)" -- $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? -- -- oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` -- done -+ func_extract_archives $gentop $addlibs -+ oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then -- eval cmds=\"$old_archive_from_new_cmds\" -+ cmds=$old_archive_from_new_cmds - else -- # Ensure that we have .o objects in place in case we decided -- # not to build a shared library, and have fallen back to building -- # static libs even though --disable-static was passed! -- for oldobj in $oldobjs; do -- if test ! -f $oldobj; then -- xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` -- if test "X$xdir" = "X$oldobj"; then -- xdir="." -- else -- xdir="$xdir" -+ # POSIX demands no paths to be encoded in archives. We have -+ # to avoid creating archives with duplicate basenames if we -+ # might have to extract them afterwards, e.g., when creating a -+ # static archive out of a convenience library, or when linking -+ # the entirety of a libtool archive into another (currently -+ # not supported by libtool). -+ if (for obj in $oldobjs -+ do -+ $echo "X$obj" | $Xsed -e 's%^.*/%%' -+ done | sort | sort -uc >/dev/null 2>&1); then -+ : -+ else -+ $echo "copying selected object files to avoid basename conflicts..." -+ -+ if test -z "$gentop"; then -+ gentop="$output_objdir/${outputname}x" -+ generated="$generated $gentop" -+ -+ $show "${rm}r $gentop" -+ $run ${rm}r "$gentop" -+ $show "$mkdir $gentop" -+ $run $mkdir "$gentop" -+ status=$? -+ if test "$status" -ne 0 && test ! -d "$gentop"; then -+ exit $status - fi -- baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` -- obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` -- $show "(cd $xdir && ${LN_S} $obj $baseobj)" -- $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? - fi -- done -+ -+ save_oldobjs=$oldobjs -+ oldobjs= -+ counter=1 -+ for obj in $save_oldobjs -+ do -+ objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` -+ case " $oldobjs " in -+ " ") oldobjs=$obj ;; -+ *[\ /]"$objbase "*) -+ while :; do -+ # Make sure we don't pick an alternate name that also -+ # overlaps. -+ newobj=lt$counter-$objbase -+ counter=`expr $counter + 1` -+ case " $oldobjs " in -+ *[\ /]"$newobj "*) ;; -+ *) if test ! -f "$gentop/$newobj"; then break; fi ;; -+ esac -+ done -+ $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" -+ $run ln "$obj" "$gentop/$newobj" || -+ $run cp "$obj" "$gentop/$newobj" -+ oldobjs="$oldobjs $gentop/$newobj" -+ ;; -+ *) oldobjs="$oldobjs $obj" ;; -+ esac -+ done -+ fi - - eval cmds=\"$old_archive_cmds\" -+ -+ if len=`expr "X$cmds" : ".*"` && -+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then -+ cmds=$old_archive_cmds -+ else -+ # the command line is too long to link in one step, link in parts -+ $echo "using piecewise archive linking..." -+ save_RANLIB=$RANLIB -+ RANLIB=: -+ objlist= -+ concat_cmds= -+ save_oldobjs=$oldobjs -+ -+ # Is there a better way of finding the last object in the list? -+ for obj in $save_oldobjs -+ do -+ last_oldobj=$obj -+ done -+ for obj in $save_oldobjs -+ do -+ oldobjs="$objlist $obj" -+ objlist="$objlist $obj" -+ eval test_cmds=\"$old_archive_cmds\" -+ if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && -+ test "$len" -le "$max_cmd_len"; then -+ : -+ else -+ # the above command should be used before it gets too long -+ oldobjs=$objlist -+ if test "$obj" = "$last_oldobj" ; then -+ RANLIB=$save_RANLIB -+ fi -+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~ -+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" -+ objlist= -+ fi -+ done -+ RANLIB=$save_RANLIB -+ oldobjs=$objlist -+ if test "X$oldobjs" = "X" ; then -+ eval cmds=\"\$concat_cmds\" -+ else -+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\" -+ fi -+ fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do -+ eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? -@@ -3916,8 +5252,12 @@ - fi - done - # Quote the link command for shipping. -- relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" -+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` -+ if test "$hardcode_automatic" = yes ; then -+ relink_command= -+ fi -+ - - # Only create the output if not a dry run. - if test -z "$run"; then -@@ -3933,10 +5273,10 @@ - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` -- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` -+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; -@@ -3947,10 +5287,10 @@ - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` -- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` -+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done -@@ -3958,20 +5298,39 @@ - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` -- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` -+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" -+ else -+ newdlfiles= -+ for lib in $dlfiles; do -+ case $lib in -+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; -+ *) abs=`pwd`"/$lib" ;; -+ esac -+ newdlfiles="$newdlfiles $abs" -+ done -+ dlfiles="$newdlfiles" -+ newdlprefiles= -+ for lib in $dlprefiles; do -+ case $lib in -+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; -+ *) abs=`pwd`"/$lib" ;; -+ esac -+ newdlprefiles="$newdlprefiles $abs" -+ done -+ dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in -- *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; -+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ - # $outputname - a libtool library file -@@ -4000,6 +5359,9 @@ - # Is this an already installed library? - installed=$installed - -+# Should we warn about portability when linking against -modules? -+shouldnotlink=$module -+ - # Files to dlopen/dlpreopen - dlopen='$dlfiles' - dlpreopen='$dlprefiles' -@@ -4019,7 +5381,7 @@ - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac -- exit 0 -+ exit $EXIT_SUCCESS - ;; - - # libtool install mode -@@ -4030,11 +5392,11 @@ - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. -- $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then -+ $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in -- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac -@@ -4043,14 +5405,14 @@ - shift - else - install_prog= -- arg="$nonopt" -+ arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in -- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac -@@ -4068,28 +5430,31 @@ - do - if test -n "$dest"; then - files="$files $dest" -- dest="$arg" -+ dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; -- -f) prev="-f" ;; -- -g) prev="-g" ;; -- -m) prev="-m" ;; -- -o) prev="-o" ;; -+ -f) -+ case " $install_prog " in -+ *[\\\ /]cp\ *) ;; -+ *) prev=$arg ;; -+ esac -+ ;; -+ -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; -- -*) ;; -- -+ -*) -+ ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else -- dest="$arg" -+ dest=$arg - continue - fi - ;; -@@ -4098,7 +5463,7 @@ - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in -- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) -+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac -@@ -4108,13 +5473,13 @@ - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - if test -z "$files"; then -@@ -4124,7 +5489,7 @@ - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. -@@ -4145,7 +5510,7 @@ - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - fi - case $destdir in -@@ -4157,7 +5522,7 @@ - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - done -@@ -4182,11 +5547,11 @@ - - *.la) - # Check to see that this really is a libtool archive. -- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : -+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - library_names= -@@ -4218,21 +5583,24 @@ - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. -- inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` -+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. -+ # At present, this check doesn't affect windows .dll's that -+ # are installed into $libdir/../bin (currently, that works fine) -+ # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. -- relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` -+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else -- relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` -+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 -@@ -4240,7 +5608,7 @@ - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - fi - -@@ -4264,23 +5632,36 @@ - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. -+ # Try `ln -sf' first, because the `ln' binary might depend on -+ # the symlink we replace! Solaris /bin/ln does not understand -f, -+ # so we also need to try rm && ln -s. - for linkname - do - if test "$linkname" != "$realname"; then -- $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" -- $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" -+ $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" -+ $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" -- eval cmds=\"$postinstall_cmds\" -+ cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" -- $run eval "$cmd" || exit $? -+ $run eval "$cmd" || { -+ lt_exit=$? -+ -+ # Restore the uninstalled library and exit -+ if test "$mode" = relink; then -+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' -+ fi -+ -+ exit $lt_exit -+ } - done - IFS="$save_ifs" - fi -@@ -4318,7 +5699,7 @@ - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - -@@ -4336,7 +5717,7 @@ - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi -- exit 0 -+ exit $EXIT_SUCCESS - ;; - - *) -@@ -4348,21 +5729,47 @@ - destfile="$destdir/$destfile" - fi - -+ # If the file is missing, and there is a .exe on the end, strip it -+ # because it is most likely a libtool script we actually want to -+ # install -+ stripped_ext="" -+ case $file in -+ *.exe) -+ if test ! -f "$file"; then -+ file=`$echo $file|${SED} 's,.exe$,,'` -+ stripped_ext=".exe" -+ fi -+ ;; -+ esac -+ - # Do a test to see if this is really a libtool program. -- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ case $host in -+ *cygwin*|*mingw*) -+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` -+ ;; -+ *) -+ wrapper=$file -+ ;; -+ esac -+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - -+ # Note that it is not necessary on cygwin/mingw to append a dot to -+ # foo even if both foo and FILE.exe exist: automatic-append-.exe -+ # behavior happens only for exec(3), not for open(2)! Also, sourcing -+ # `FILE.' does not work on cygwin managed mounts. -+ # - # If there is no directory component, then add one. -- case $file in -- */* | *\\*) . $file ;; -- *) . ./$file ;; -+ case $wrapper in -+ */* | *\\*) . ${wrapper} ;; -+ *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then -- $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 -- exit 1 -+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 -+ exit $EXIT_FAILURE - fi - - finalize=yes -@@ -4384,10 +5791,15 @@ - done - - relink_command= -+ # Note that it is not necessary on cygwin/mingw to append a dot to -+ # foo even if both foo and FILE.exe exist: automatic-append-.exe -+ # behavior happens only for exec(3), not for open(2)! Also, sourcing -+ # `FILE.' does not work on cygwin managed mounts. -+ # - # If there is no directory component, then add one. -- case $file in -- */* | *\\*) . $file ;; -- *) . ./$file ;; -+ case $wrapper in -+ */* | *\\*) . ${wrapper} ;; -+ *) . ./${wrapper} ;; - esac - - outputname= -@@ -4395,17 +5807,17 @@ - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" -- tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` -- if test $? = 0 ; then : -- else -- tmpdir="$tmpdir/libtool-$$" -- fi -- if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : -+ tmpdir="$tmpdir/libtool-$$" -+ save_umask=`umask` -+ umask 0077 -+ if $mkdir "$tmpdir"; then -+ umask $save_umask - else -+ umask $save_umask - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi -- file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` -+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` -@@ -4423,14 +5835,14 @@ - fi - else - # Install the binary that we compiled earlier. -- file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` -+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another -- # one anyways -+ # one anyway - case $install_prog,$host in -- /usr/bin/install*,*cygwin*) -+ */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok -@@ -4439,7 +5851,7 @@ - destfile=$destfile.exe - ;; - *:*.exe) -- destfile=`echo $destfile | sed -e 's,.exe$,,'` -+ destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; -@@ -4460,16 +5872,17 @@ - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - -- if test -n "$stripme" && test -n "$striplib"; then -+ if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. -- eval cmds=\"$old_postinstall_cmds\" -+ cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done -@@ -4483,9 +5896,9 @@ - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" -- exec_cmd='$SHELL $0 --finish$current_libdirs' -+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else -- exit 0 -+ exit $EXIT_SUCCESS - fi - ;; - -@@ -4504,10 +5917,11 @@ - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. -- eval cmds=\"$finish_cmds\" -+ cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" -@@ -4524,43 +5938,43 @@ - fi - - # Exit here if they wanted silent mode. -- test "$show" = : && exit 0 -+ test "$show" = : && exit $EXIT_SUCCESS - -- echo "----------------------------------------------------------------------" -- echo "Libraries have been installed in:" -+ $echo "----------------------------------------------------------------------" -+ $echo "Libraries have been installed in:" - for libdir in $libdirs; do -- echo " $libdir" -+ $echo " $libdir" - done -- echo -- echo "If you ever happen to want to link against installed libraries" -- echo "in a given directory, LIBDIR, you must either use libtool, and" -- echo "specify the full pathname of the library, or use the \`-LLIBDIR'" -- echo "flag during linking and do at least one of the following:" -+ $echo -+ $echo "If you ever happen to want to link against installed libraries" -+ $echo "in a given directory, LIBDIR, you must either use libtool, and" -+ $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" -+ $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then -- echo " - add LIBDIR to the \`$shlibpath_var' environment variable" -- echo " during execution" -+ $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" -+ $echo " during execution" - fi - if test -n "$runpath_var"; then -- echo " - add LIBDIR to the \`$runpath_var' environment variable" -- echo " during linking" -+ $echo " - add LIBDIR to the \`$runpath_var' environment variable" -+ $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - -- echo " - use the \`$flag' linker flag" -+ $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then -- echo " - have your system administrator run these commands:$admincmds" -+ $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then -- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" -+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi -- echo -- echo "See any operating system documentation about shared libraries for" -- echo "more information, such as the ld(1) and ld.so(8) manual pages." -- echo "----------------------------------------------------------------------" -- exit 0 -+ $echo -+ $echo "See any operating system documentation about shared libraries for" -+ $echo "more information, such as the ld(1) and ld.so(8) manual pages." -+ $echo "----------------------------------------------------------------------" -+ exit $EXIT_SUCCESS - ;; - - # libtool execute mode -@@ -4572,7 +5986,7 @@ - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. -@@ -4580,18 +5994,18 @@ - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. -- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : -+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - # Read the libtool library. -@@ -4618,7 +6032,7 @@ - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - ;; - -@@ -4658,7 +6072,7 @@ - -*) ;; - *) - # Do a test to see if this is really a libtool program. -- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; -@@ -4681,7 +6095,7 @@ - eval "export $shlibpath_var" - fi - -- # Restore saved enviroment variables -+ # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi -@@ -4698,7 +6112,7 @@ - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" -- exit 0 -+ exit $EXIT_SUCCESS - fi - ;; - -@@ -4726,18 +6140,19 @@ - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - - rmdirs= - -+ origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. -- objdir="$objdir" -+ objdir="$origobjdir" - else -- objdir="$dir/$objdir" -+ objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" -@@ -4767,7 +6182,7 @@ - case $name in - *.la) - # Possibly a libtool archive, so verify it. -- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. -@@ -4780,10 +6195,11 @@ - if test "$mode" = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. -- eval cmds=\"$postuninstall_cmds\" -+ cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then -@@ -4795,10 +6211,11 @@ - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. -- eval cmds=\"$old_postuninstall_cmds\" -+ cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then -@@ -4813,22 +6230,52 @@ - ;; - - *.lo) -- if test "$build_old_libs" = yes; then -- oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` -- rmfiles="$rmfiles $dir/$oldobj" -+ # Possibly a libtool object, so verify it. -+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ -+ # Read the .lo file -+ . $dir/$name -+ -+ # Add PIC object to the list of files to remove. -+ if test -n "$pic_object" \ -+ && test "$pic_object" != none; then -+ rmfiles="$rmfiles $dir/$pic_object" -+ fi -+ -+ # Add non-PIC object to the list of files to remove. -+ if test -n "$non_pic_object" \ -+ && test "$non_pic_object" != none; then -+ rmfiles="$rmfiles $dir/$non_pic_object" -+ fi - fi - ;; - - *) -- # Do a test to see if this is a libtool program. -- if test "$mode" = clean && -- (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -- relink_command= -- . $dir/$file -+ if test "$mode" = clean ; then -+ noexename=$name -+ case $file in -+ *.exe) -+ file=`$echo $file|${SED} 's,.exe$,,'` -+ noexename=`$echo $name|${SED} 's,.exe$,,'` -+ # $file with .exe has already been added to rmfiles, -+ # add $file without .exe -+ rmfiles="$rmfiles $file" -+ ;; -+ esac -+ # Do a test to see if this is a libtool program. -+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ relink_command= -+ . $dir/$noexename - -- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" -- if test "$fast_install" = yes && test -n "$relink_command"; then -- rmfiles="$rmfiles $objdir/lt-$name" -+ # note $name still contains .exe if it was in $file originally -+ # as does the version of $file that was added into $rmfiles -+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" -+ if test "$fast_install" = yes && test -n "$relink_command"; then -+ rmfiles="$rmfiles $objdir/lt-$name" -+ fi -+ if test "X$noexename" != "X$name" ; then -+ rmfiles="$rmfiles $objdir/lt-${noexename}.c" -+ fi - fi - fi - ;; -@@ -4836,6 +6283,7 @@ - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done -+ objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do -@@ -4851,20 +6299,20 @@ - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - fi - fi # test -z "$show_help" - - if test -n "$exec_cmd"; then - eval exec $exec_cmd -- exit 1 -+ exit $EXIT_FAILURE - fi - - # We need to display help for each of the modes. -@@ -4883,6 +6331,7 @@ - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages -+ --tag=TAG use configuration variables from tag TAG - --version print version information - - MODE must be one of the following: -@@ -4896,8 +6345,10 @@ - uninstall remove libraries from an installed directory - - MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for --a more detailed description of MODE." -- exit 0 -+a more detailed description of MODE. -+ -+Report bugs to ." -+ exit $EXIT_SUCCESS - ;; - - clean) -@@ -5008,6 +6459,9 @@ - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -+ -objectlist FILE Use a list of object files found in FILE to specify objects -+ -precious-files-regex REGEX -+ don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -@@ -5049,14 +6503,34 @@ - *) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 -- exit 1 -+ exit $EXIT_FAILURE - ;; - esac - --echo -+$echo - $echo "Try \`$modename --help' for more information about other modes." - --exit 0 -+exit $? -+ -+# The TAGs below are defined such that we never get into a situation -+# in which we disable both kinds of libraries. Given conflicting -+# choices, we go for a static library, that is the most portable, -+# since we can't tell whether shared libraries were disabled because -+# the user asked for that or because the platform doesn't support -+# them. This is particularly important on AIX, because we don't -+# support having both static and shared libraries enabled at the same -+# time on that platform, so we default to a shared-only configuration. -+# If a disable-shared tag is given, we'll fallback to a static-only -+# configuration. But we'll never go from static-only to shared-only. -+ -+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -+build_libtool_libs=no -+build_old_libs=yes -+# ### END LIBTOOL TAG CONFIG: disable-shared -+ -+# ### BEGIN LIBTOOL TAG CONFIG: disable-static -+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` -+# ### END LIBTOOL TAG CONFIG: disable-static - - # Local Variables: - # mode:shell-script ---- gsmlib-1.10.orig/doc/gsmsmsstore.man -+++ gsmlib-1.10/doc/gsmsmsstore.man -@@ -15,36 +15,36 @@ - gsmsmsstore \- SMS store manipulation program - .SH SYNOPSIS - .B gsmsmsstore --[ \fB-a\fP ] --[ \fB--add\fP ] --[ \fB-b\fP \fIbaudrate\fP ] --[ \fB--baudrate\fP \fIbaudrate\fP ] --[ \fB-c\fP ] --[ \fB--copy\fP ] --[ \fB-C\fP \fIservice centre address\fP ] --[ \fB--sca\fP \fIservice centre address\fP ] --[ \fB-d\fP \fIdestination device or file\fP ] --[ \fB--destination\fP \fIdestination device or file\fP ] --[ \fB-h\fP ] --[ \fB--help\fP ] --[ \fB-I\fP \fIinit string\fP ] --[ \fB--init\fP \fIinit string\fP ] --[ \fB-k\fP ] --[ \fB--backup\fP ] --[ \fB-l\fP ] --[ \fB--list\fP ] --[ \fB-s\fP \fIsource device or file\fP ] --[ \fB--source\fP \fIsource device or file\fP ] --[ \fB-t\fP \fISMS store name\fP ] --[ \fB--store\fP \fISMS store name\fP ] --[ \fB-v\fP ] --[ \fB--version\fP ] --[ \fB-V\fP ] --[ \fB--verbose\fP ] --[ \fB-x\fP ] --[ \fB--delete\fP ] --[ \fB-X\fP ] --[ \fB--xonxoff\fP ] -+[ \fB\-a\fP ] -+[ \fB\-\-add\fP ] -+[ \fB\-b\fP \fIbaudrate\fP ] -+[ \fB\-\-baudrate\fP \fIbaudrate\fP ] -+[ \fB\-c\fP ] -+[ \fB\-\-copy\fP ] -+[ \fB\-C\fP \fIservice centre address\fP ] -+[ \fB\-\-sca\fP \fIservice centre address\fP ] -+[ \fB\-d\fP \fIdestination device or file\fP ] -+[ \fB\-\-destination\fP \fIdestination device or file\fP ] -+[ \fB\-h\fP ] -+[ \fB\-\-help\fP ] -+[ \fB\-I\fP \fIinit string\fP ] -+[ \fB\-\-init\fP \fIinit string\fP ] -+[ \fB\-k\fP ] -+[ \fB\-\-backup\fP ] -+[ \fB\-l\fP ] -+[ \fB\-\-list\fP ] -+[ \fB\-s\fP \fIsource device or file\fP ] -+[ \fB\-\-source\fP \fIsource device or file\fP ] -+[ \fB\-t\fP \fISMS store name\fP ] -+[ \fB\-\-store\fP \fISMS store name\fP ] -+[ \fB\-v\fP ] -+[ \fB\-\-version\fP ] -+[ \fB\-V\fP ] -+[ \fB\-\-verbose\fP ] -+[ \fB\-x\fP ] -+[ \fB\-\-delete\fP ] -+[ \fB\-X\fP ] -+[ \fB\-\-xonxoff\fP ] - { \fIindices\fP } - [ \fIphonenumber\fP \fItext\fP ] - .PP -@@ -57,19 +57,19 @@ - \fIgsmsmsstore\fP reads entries from the source which can be a mobile - phone (if a serial device file is given) or a file (if a file name is - given). The source is never modified. \fIgsmsmsstore\fP writes SMS --messages to a destination file or device in the case of \fB--copy\fP, --\fB--backup\fP, and \fB--add\fP. -+messages to a destination file or device in the case of \fB\-\-copy\fP, -+\fB\-\-backup\fP, and \fB\-\-add\fP. - .PP --The \fB--list\fP option does not change any file but just lists the -+The \fB\-\-list\fP option does not change any file but just lists the - contents to standard output. - .PP --The \fB--backup\fP and \fB--copy\fP options require both source and --destination files or devices. The \fB--list\fP option requires a --source. The \fB--add\fP and \fB--delete\fP options require a -+The \fB\-\-backup\fP and \fB\-\-copy\fP options require both source and -+destination files or devices. The \fB\-\-list\fP option requires a -+source. The \fB\-\-add\fP and \fB\-\-delete\fP options require a - destination file or device. - .PP --If "-" is given as the parameter for the \fB--source\fP or --\fB--destination\fP options, the SMS store is read from standard input -+If "\-" is given as the parameter for the \fB\-\-source\fP or -+\fB\-\-destination\fP options, the SMS store is read from standard input - and/or written to standard output, respectively. - .PP - SMS message files are not human-readable. -@@ -79,61 +79,61 @@ - .PP - .SH OPTIONS - .TP --\fB-a\fP, \fB--add\fP -+\fB\-a\fP, \fB\-\-add\fP - Adds an SMS submit message with recipient address \fIphonenumber\fP and - text \fItext\fP to the destination. - .TP --\fB-b\fP \fIbaudrate\fP, \fB--baudrate\fP \fIbaudrate\fP -+\fB\-b\fP \fIbaudrate\fP, \fB\-\-baudrate\fP \fIbaudrate\fP - The baud rate to use. The default baudrate is 38400. - .TP --\fB-c\fP, \fB--copy\fP -+\fB\-c\fP, \fB\-\-copy\fP - This causes the contents of the source to be copied to the - destination. After this operation the destination has exactly the same - contents as the source. If \fIindices\fP are given on the command - line only those SMS messages denoted by the indices are copied to the - destination. - .TP --\fB-C\fP \fIservice centre address\fP, \fB--sca\fP \fIservice centre address\fP -+\fB\-C\fP \fIservice centre address\fP, \fB\-\-sca\fP \fIservice centre address\fP - Sets the service centre address to use for all SUBMIT SMSs (may not - work with some phones). - .TP --\fB-d\fP \fIdestination\fP, \fB--destination\fP \fIdestination\fP -+\fB\-d\fP \fIdestination\fP, \fB\-\-destination\fP \fIdestination\fP - The destination device or file. - .TP --\fB-h\fP, \fB--help\fP -+\fB\-h\fP, \fB\-\-help\fP - Prints an option summary. - .TP --\fB-I\fP \fIinit string\fP, \fB--init\fP \fIinit string\fP -+\fB\-I\fP \fIinit string\fP, \fB\-\-init\fP \fIinit string\fP - Initialization string to send to the TA (default: "E0"). Note that the - sequence "ATZ" is sent first. - .TP --\fB-k\fP, \fB--backup\fP -+\fB\-k\fP, \fB\-\-backup\fP - This causes those entries to be added from the source to the - destination that are not already present in the destination. If - \fIindices\fP are given on the command line only those SMS messages - denoted by the indices are backed up (ie. added) to the destination. - .TP --\fB-l\fP, \fB--list\fP -+\fB\-l\fP, \fB\-\-list\fP - Prints out the entire contents of the source in human-readable form. - .TP --\fB-s\fP \fIsource\fP, \fB--source\fP \fIsource\fP -+\fB\-s\fP \fIsource\fP, \fB\-\-source\fP \fIsource\fP - The source device or file. - .TP --\fB-t\fP \fISMS store name\fP, \fB--store\fP \fISMS store name\fP -+\fB\-t\fP \fISMS store name\fP, \fB\-\-store\fP \fISMS store name\fP - The name of the SMS store to read from or write to. This information is - only used for device sources and destinations. A commonly available message - store is "SM" (SIM card). - .TP --\fB-v\fP, \fB--version\fP -+\fB\-v\fP, \fB\-\-version\fP - Prints the program version. - .TP --\fB-V\fP, \fB--verbose\fP -+\fB\-V\fP, \fB\-\-verbose\fP - Prints out a detailed progress report. - .TP --\fB-x\fP, \fB--delete\fP -+\fB\-x\fP, \fB\-\-delete\fP - Delete the SMS messages as denoted by the \fIindices\fP from the destination. - .TP --\fB-X\fP, \fB--xonxoff\fP -+\fB\-X\fP, \fB\-\-xonxoff\fP - Uses software handshaking (XON/XOFF) for accessing the device. - .PP - .SH EXAMPLES -@@ -141,15 +141,15 @@ - to \fI/dev/mobilephone\fP to the standard output: - .PP - .nf --gsmsmsstore -b 19200 -s /dev/mobilephone -t SM -l -+gsmsmsstore \-b 19200 \-s /dev/mobilephone \-t SM \-l - .fi - .PP - The following adds entries 4, 7, and 10 from the device - \fI/dev/mobilephone\fP to the file \fIsmsstore\fP: - .PP - .nf --gsmsmsstore -s /dev/mobilephone -d /home/fred/smsstore -- -t SM -b 4 7 10 -+gsmsmsstore \-s /dev/mobilephone \-d /home/fred/smsstore -+ \-t SM \-b 4 7 10 - .fi - .PP - .SH AUTHOR ---- gsmlib-1.10.orig/doc/gsmsmsd.man -+++ gsmlib-1.10/doc/gsmsmsd.man -@@ -17,34 +17,34 @@ - .PP - .SH SYNOPSIS - .B gsmsmsd --[ \fB-a\fP \fIaction\fP ] --[ \fB--action\fP \fIaction\fP ] --[ \fB-b\fP \fIbaudrate\fP ] --[ \fB--baudrate\fP \fIbaudrate\fP ] --[ \fB-c\fP \fIconcatenatedID\fP ] --[ \fB--concatenate\fP \fIconcatenatedID\fP ] --[ \fB-C\fP \fIservice centre address\fP ] --[ \fB--sca\fP \fIservice centre address\fP ] --[ \fB-d\fP \fIdevice\fP ] --[ \fB--device\fP \fIdevice\fP ] --[ \fB-D\fP ] --[ \fB--direct\fP ] --[ \fB-f\fP ] --[ \fB--flush\fP ] --[ \fB-h\fP ] --[ \fB--help\fP ] --[ \fB-I\fP \fIinit string\fP ] --[ \fB--init\fP \fIinit string\fP ] --[ \fB-r\fP ] --[ \fB--requeststat\fP ] --[ \fB-s\fP \fIspool directory\fP ] --[ \fB--spool\fP \fIspool directory\fP ] --[ \fB-t\fP \fISMS store name\fP ] --[ \fB--store\fP \fISMS store name\fP ] --[ \fB-v\fP ] --[ \fB--version\fP ] --[ \fB-X\fP ] --[ \fB--xonxoff\fP ] -+[ \fB\-a\fP \fIaction\fP ] -+[ \fB\-\-action\fP \fIaction\fP ] -+[ \fB\-b\fP \fIbaudrate\fP ] -+[ \fB\-\-baudrate\fP \fIbaudrate\fP ] -+[ \fB\-c\fP \fIconcatenatedID\fP ] -+[ \fB\-\-concatenate\fP \fIconcatenatedID\fP ] -+[ \fB\-C\fP \fIservice centre address\fP ] -+[ \fB\-\-sca\fP \fIservice centre address\fP ] -+[ \fB\-d\fP \fIdevice\fP ] -+[ \fB\-\-device\fP \fIdevice\fP ] -+[ \fB\-D\fP ] -+[ \fB\-\-direct\fP ] -+[ \fB\-f\fP ] -+[ \fB\-\-flush\fP ] -+[ \fB\-h\fP ] -+[ \fB\-\-help\fP ] -+[ \fB\-I\fP \fIinit string\fP ] -+[ \fB\-\-init\fP \fIinit string\fP ] -+[ \fB\-r\fP ] -+[ \fB\-\-requeststat\fP ] -+[ \fB\-s\fP \fIspool directory\fP ] -+[ \fB\-\-spool\fP \fIspool directory\fP ] -+[ \fB\-t\fP \fISMS store name\fP ] -+[ \fB\-\-store\fP \fISMS store name\fP ] -+[ \fB\-v\fP ] -+[ \fB\-\-version\fP ] -+[ \fB\-X\fP ] -+[ \fB\-\-xonxoff\fP ] - { \fIsms_type\fP } - .PP - .SH DESCRIPTION -@@ -65,10 +65,10 @@ - \fIgsmsmsd\fP needs one empty storage slot for SMS messages in the - mobile phone, otherwise SMS reception will not work. The SMS store to - use for temporary storage of incoming SMS can be selected using the --\fB--store\fP option, otherwise the ME default store is used. -+\fB\-\-store\fP option, otherwise the ME default store is used. - .PP - To terminate \fIgsmsmsd\fP cleanly (without losing SMS messages) one --should send either SIGINT (CTRL-C on the command line) or SIGTERM to -+should send either SIGINT (CTRL\-C on the command line) or SIGTERM to - the process. - .PP - Error messages are printed to the standard error output. If the program -@@ -89,14 +89,14 @@ - .PP - .SH OPTIONS - .TP --\fB-a\fP \fIaction\fP, \fB--action\fP \fIaction\fP -+\fB\-a\fP \fIaction\fP, \fB\-\-action\fP \fIaction\fP - The action to execute for each incoming SMS message. If no action - is given the SMS is written to the standard output. - .TP --\fB-b\fP \fIbaudrate\fP, \fB--baudrate\fP \fIbaudrate\fP -+\fB\-b\fP \fIbaudrate\fP, \fB\-\-baudrate\fP \fIbaudrate\fP - The baud rate to use. - .TP --\fB-c\fP \fIconcatenatedID\fP, \fB--concatenate\fP \fIconcatenatedID\fP -+\fB\-c\fP \fIconcatenatedID\fP, \fB\-\-concatenate\fP \fIconcatenatedID\fP - If an ID is given, large SMSs are split into several, concatenated - SMSs. All SMSs have the same ID and are numbered consecutively so that - the receiving phone can assemble them in the correct order. IDs must -@@ -108,43 +108,43 @@ - carried in the user data header element at the beginning of the SMS - user data. This information may show up as garbage in such phones. - .TP --\fB-C\fP \fIservice centre address\fP, \fB--sca\fP \fIservice centre address\fP -+\fB\-C\fP \fIservice centre address\fP, \fB\-\-sca\fP \fIservice centre address\fP - Sets the service centre address to use for all SUBMIT SMSs (may not - work with some phones). - .TP --\fB-d\fP \fIdevice\fP, \fB--device\fP \fIdevice\fP -+\fB\-d\fP \fIdevice\fP, \fB\-\-device\fP \fIdevice\fP - The device to which the GSM modem is connected. The default is - \fI/dev/mobilephone\fP. - .TP --\fB-D\fP, \fB--direct\fP -+\fB\-D\fP, \fB\-\-direct\fP - Enables direct routing of incoming SMS messages to the TE. This is not - supported by many mobile phone/GSM modem combinations. Therefore, the - default is to store incoming SMS temporarily before processing them in - the indicated store. - .TP --\fB-f\fP, \fB--flush\fP -+\fB\-f\fP, \fB\-\-flush\fP - This option causes \fIgsmsmsd\fP to flush (ie. read and erase) - existing SMS messages from --the SMS store selected by the \fB--store\fP option. The action given --by the \fB--action\fP option is executed on each of the flushed -+the SMS store selected by the \fB\-\-store\fP option. The action given -+by the \fB\-\-action\fP option is executed on each of the flushed - SMS. This option should be used to ensure that enough space is - available in the SMS store for temporary storage of incoming SMS, - otherwise incoming SMS might be ignored silently by the ME. - .TP --\fB-h\fP, \fB--help\fP -+\fB\-h\fP, \fB\-\-help\fP - Prints an option summary. - .TP --\fB-I\fP \fIinit string\fP, \fB--init\fP \fIinit string\fP -+\fB\-I\fP \fIinit string\fP, \fB\-\-init\fP \fIinit string\fP - Initialization string to send to the TA (default: "E0"). Note that the - sequence "ATZ" is sent first. - .TP --\fB-r\fP, \fB--requeststat\fP -+\fB\-r\fP, \fB\-\-requeststat\fP - Request status reports for sent SMS. Note: This option only makes - sense if the phone supports routing of status reports to the - TE. Otherwise the status reports might show on the phone's display or - get lost. - .TP --\fB-s\fP \fIspool directory\fP, \fB--spool\fP \fIspool directory\fP -+\fB\-s\fP \fIspool directory\fP, \fB\-\-spool\fP \fIspool directory\fP - This option sets the spool directory where \fIgsmsmsd\fP expects SMS - messages to send. The format of SMS files is very simple: The first - line contains the phone number of the recipient. Everything else after -@@ -154,18 +154,18 @@ - \fIgsmsmsd\fP polls the spool directory every 5 seconds. Sent - SMS message files are removed. - .TP --\fB-t\fP \fISMS store name\fP, \fB--store\fP \fISMS store name\fP --The name of the SMS store to read from (for the \fB--flush\fP option) -+\fB\-t\fP \fISMS store name\fP, \fB\-\-store\fP \fISMS store name\fP -+The name of the SMS store to read from (for the \fB\-\-flush\fP option) - or write to (for temporary SMS storage). This option must --be must be used in conjunction with the \fB--flush\fP option. If this -+be must be used in conjunction with the \fB\-\-flush\fP option. If this - option is omitted the ME uses it's default SMS store for temporary - storage of incoming SMS. A commonly available message - store is "SM" (SIM card). - .TP --\fB-v\fP, \fB--version\fP -+\fB\-v\fP, \fB\-\-version\fP - Prints the program version. - .TP --\fB-X\fP, \fB--xonxoff\fP -+\fB\-X\fP, \fB\-\-xonxoff\fP - Uses software handshaking (XON/XOFF) for accessing the device. - .PP - .SH EXAMPLES -@@ -173,14 +173,14 @@ - as a mail to the user "smsadmin": - .PP - .nf --gsmsmsd -d /dev/ttyS2 -b 19200 -a "mail smsadmin" -+gsmsmsd \-d /dev/ttyS2 \-b 19200 \-a "mail smsadmin" - .fi - .PP - This is the format of SMS deliver messages as output from \fIgsmsmsd\fP: - .PP - .nf - ---------------------------------------------------------------- --Message type: SMS-DELIVER -+Message type: SMS\-DELIVER - SC address: '491710762100' - More messages to send: 1 - Reply path: 0 -@@ -202,7 +202,7 @@ - .PP - .nf - ---------------------------------------------------------------- --Message type: SMS-STATUS-REPORT -+Message type: SMS\-STATUS\-REPORT - SC address: '' - More messages to send: 0 - Status report qualifier: 0 -@@ -219,8 +219,8 @@ - directory for SMS to send: - .PP - .nf --gsmsmsd -d /dev/ttyS2 --spool /tmp/spooldir -f --store sm \\ ----action 'mail smsadmin' -+gsmsmsd \-d /dev/ttyS2 \-\-spool /tmp/spooldir \-f \-\-store sm \\ -+\-\-action 'mail smsadmin' - .fi - .PP - .SH FILES ---- gsmlib-1.10.orig/doc/gsmctl.man -+++ gsmlib-1.10/doc/gsmctl.man -@@ -1,6 +1,6 @@ - .TH GSMCTL 8 "##DATE##" "gsmctl v##VERSION##" - .SH NAME --gsmctl \- GSM mobile phone control program -+gsmctl, gsmsiectl \- GSM mobile phone control program - .SH SYNOPSIS - .B gsmctl - .RB [\| \-b -@@ -25,6 +25,30 @@ - .RB | \ \-\-operation - .IR operation \ | - .I parameters -+.PP -+.B gsmsiectl -+.RB [\| \-b -+.IR baudrate \|] -+.RB [\| \-\-baudrate -+.IR baudrate\| ] -+.RB [ \|\-d -+.IR device\| ] -+.RB [ \|\-\-device -+.IR device\fP ] -+.RB [ \|\-h\| ] -+.RB [ \|\-\-help\| ] -+.RB [ \|\-I -+.IR "init string" \|] -+.RB [ \|\-\-init -+.IR "init string" \|] -+.RB [ \|\-v\| ] -+.RB [ \|\-\-version\| ] -+.RB [ \|\-X\| ] -+.RB [ \|\-\-xonxoff\| ] -+.BI \-o \ operation -+.RB | \ \-\-operation -+.IR operation \ | -+.I parameters - .SH DESCRIPTION - .B gsmctl - can request information from or perform operations on an GSM mobile -@@ -38,7 +62,7 @@ - If no - .I device - is given, the device --.I/dev/mobilephone -+.I /dev/mobilephone - is used. If no - .I baudrate - is given, a default baud rate of 38400 is used. -@@ -61,6 +85,12 @@ - .B OPERATIONS - for more details. - .PP -+.B gsmsiectl -+is the same program with some extension for Siemens mobile phones. -+Some extra -+.B OPERATIONS -+are available in this case. -+.PP - Error messages are printed to the standard error output. If the - program terminates on error the error code 1 is returned. - .SH OPTIONS -@@ -252,14 +282,14 @@ - .I SIM PUK - ME is waiting SIM PUK to be given. - .TP --.I PH-SIM PIN --ME is waiting phone-to-SIM card password to be given. -+.I PH\-SIM PIN -+ME is waiting phone/-to/-SIM card password to be given. - .TP --.I PH-FSIM PIN --ME is waiting phone-to-very first SIM card password to be given. -+.I PH/-FSIM PIN -+ME is waiting phone/-to/-very first SIM card password to be given. - .TP --.I PH-FSIM PUK --ME is waiting phone-to-very first SIM card unblocking password to be -+.I PH/-FSIM PUK -+ME is waiting phone/-to/-very first SIM card unblocking password to be - given. - .TP - .I SIM PIN2 -@@ -268,13 +298,13 @@ - .I SIM PUK2 - ME is waiting SIM PUK2 to be given. - .TP --.I PH-NET PIN -+.I PH/-NET PIN - ME is waiting network personalisation password to be given. - .TP --.I PH-NET PUK -+.I PH/-NET PUK - ME is waiting network personalisation unblocking password to be given. - .TP --.I PH-NETSUB PIN -+.I PH/-NETSUB PIN - ME is waiting network subset personalisation password to be given. - .RE - .TP 7 -@@ -458,6 +488,33 @@ - This is the reverse operation to \fBlock\fP. See above for a - description of the parameters. - .RE -+.PP -+.B Extra operators for gsmsiectl: -+.PP -+.B cset -+.RS -+Charset info. -+.RE -+.PP -+.B pbook -+.RS -+Phone book info. -+.RE -+.PP -+.B signal -+.RS -+Signal tone info. -+.RE -+.PP -+.B ring -+.RS -+Ringing tone info. -+.RE -+.PP -+.B binary -+.RS -+Binary info. -+.RE - .SH EXAMPLES - The following invocation of - .I gsmctl -@@ -482,11 +539,11 @@ - .HP - Serial Number: 448058511817585 - .HP -- Status: available Long name: 'D1-TELEKOM' Short name: '' Numeric name: 26201 -+ Status: available Long name: 'D1/-TELEKOM' Short name: '' Numeric name: 26201 - .HP - Status: forbidden Long name: 'D2 PRIVAT' Short name: '' Numeric name: 26202 - .HP -- Long name: 'D1-TELEKOM' Short name: '' Numeric name: 26201 Mode: automatic -+ Long name: 'D1/-TELEKOM' Short name: '' Numeric name: 26201 Mode: automatic - .HP - 'CS' - .HP ---- gsmlib-1.10.orig/doc/gsmsendsms.man -+++ gsmlib-1.10/doc/gsmsendsms.man -@@ -17,26 +17,26 @@ - .PP - .SH SYNOPSIS - .B gsmsendsms --[ \fB-b\fP \fIbaudrate\fP ] --[ \fB--baudrate\fP \fIbaudrate\fP ] --[ \fB-c\fP \fIconcatenatedID\fP ] --[ \fB--concatenate\fP \fIconcatenatedID\fP ] --[ \fB-C\fP \fIservice centre address\fP ] --[ \fB--sca\fP \fIservice centre address\fP ] --[ \fB-d\fP \fIdevice\fP ] --[ \fB--device\fP \fIdevice\fP ] --[ \fB-h\fP ] --[ \fB--help\fP ] --[ \fB-I\fP \fIinit string\fP ] --[ \fB--init\fP \fIinit string\fP ] --[ \fB-r\fP ] --[ \fB--requeststat\fP ] --[ \fB-t\fP ] --[ \fB--test\fP ] --[ \fB-v\fP ] --[ \fB--version\fP ] --[ \fB-X\fP ] --[ \fB--xonxoff\fP ] -+[ \fB\-b\fP \fIbaudrate\fP ] -+[ \fB\-\-baudrate\fP \fIbaudrate\fP ] -+[ \fB\-c\fP \fIconcatenatedID\fP ] -+[ \fB\-\-concatenate\fP \fIconcatenatedID\fP ] -+[ \fB\-C\fP \fIservice centre address\fP ] -+[ \fB\-\-sca\fP \fIservice centre address\fP ] -+[ \fB\-d\fP \fIdevice\fP ] -+[ \fB\-\-device\fP \fIdevice\fP ] -+[ \fB\-h\fP ] -+[ \fB\-\-help\fP ] -+[ \fB\-I\fP \fIinit string\fP ] -+[ \fB\-\-init\fP \fIinit string\fP ] -+[ \fB\-r\fP ] -+[ \fB\-\-requeststat\fP ] -+[ \fB\-t\fP ] -+[ \fB\-\-test\fP ] -+[ \fB\-v\fP ] -+[ \fB\-\-version\fP ] -+[ \fB\-X\fP ] -+[ \fB\-\-xonxoff\fP ] - \fIphonenumber\fP - [ \fItext\fP ] - .PP -@@ -51,7 +51,7 @@ - \fIgsmsendsms\fP accepts a phone number (recipient address) and the - short message text as parameters. The text may have a maximum length - of 160 characters which is the maximum SMS message length. The GSM --default alphabet is used for encoding. ASCII and Latin-1 characters -+default alphabet is used for encoding. ASCII and Latin\-1 characters - that can not be encoded using the GSM default alphabet are converted - to the GSM delta character (GSM code 16). - .PP -@@ -60,10 +60,10 @@ - .PP - .SH OPTIONS - .TP --\fB-b\fP \fIbaudrate\fP, \fB--baudrate\fP \fIbaudrate\fP -+\fB\-b\fP \fIbaudrate\fP, \fB\-\-baudrate\fP \fIbaudrate\fP - The baud rate to use. - .TP --\fB-c\fP \fIconcatenatedID\fP, \fB--concatenate\fP \fIconcatenatedID\fP -+\fB\-c\fP \fIconcatenatedID\fP, \fB\-\-concatenate\fP \fIconcatenatedID\fP - If an ID is given, large SMSs are split into several, concatenated - SMSs. All SMSs have the same ID and are numbered consecutively so that - the receiving phone can assemble them in the correct order. IDs must -@@ -73,37 +73,37 @@ - carried in the user data header element at the beginning of the SMS - user data. This information may show up as garbage in such phones. - .TP --\fB-C\fP \fIservice centre address\fP, \fB--sca\fP \fIservice centre address\fP -+\fB\-C\fP \fIservice centre address\fP, \fB\-\-sca\fP \fIservice centre address\fP - Sets the service centre address to use for all SUBMIT SMSs (may not - work with some phones). - .TP --\fB-d\fP \fIdevice\fP, \fB--device\fP \fIdevice\fP -+\fB\-d\fP \fIdevice\fP, \fB\-\-device\fP \fIdevice\fP - The device to which the GSM modem is connected. The default is - \fI/dev/mobilephone\fP. - .TP --\fB-h\fP, \fB--help\fP -+\fB\-h\fP, \fB\-\-help\fP - Prints an option summary. - .TP --\fB-I\fP \fIinit string\fP, \fB--init\fP \fIinit string\fP -+\fB-I\fP \fIinit string\fP, \fB\-\-init\fP \fIinit string\fP - Initialization string to send to the TA (default: "E0"). Note that the - sequence "ATZ" is sent first. - .TP --\fB-r\fP, \fB--requeststat\fP -+\fB\-r\fP, \fB\-\-requeststat\fP - Request status reports for sent SMS. - .TP --\fB-t\fP, \fB--test\fP -+\fB\-t\fP, \fB\-\-test\fP - If this option is given the text is converted --to the GSM default alphabet and back to Latin-1. This option can be --used to find out how ASCII or Latin-1 texts are converted to the GSM -+to the GSM default alphabet and back to Latin\-1. This option can be -+used to find out how ASCII or Latin\-1 texts are converted to the GSM - default alphabet. Characters that can not be converted to the GSM default --alphabet are reported as ASCII code 172 (Latin-1 boolean "not") -+alphabet are reported as ASCII code 172 (Latin\-1 boolean "not") - after this double conversion. No SMS messages are sent, a connection - to a mobile phone is not established. - .TP --\fB-v\fP, \fB--version\fP -+\fB\-v\fP, \fB\-\-version\fP - Prints the program version. - .TP --\fB-X\fP, \fB--xonxoff\fP -+\fB\-X\fP, \fB\-\-xonxoff\fP - Uses software handshaking (XON/XOFF) for accessing the device. - .PP - .SH EXAMPLES -@@ -111,8 +111,8 @@ - SMS message to the number "1234": - .PP - .nf --gsmsendsms -d /dev/ttyS2 -b 19200 1234 "This is a test." --echo "This is a test." | gsmsendsms -d /dev/ttyS2 -b 19200 1234 -+gsmsendsms \-d /dev/ttyS2 \-b 19200 1234 "This is a test." -+echo "This is a test." | gsmsendsms \-d /dev/ttyS2 \-b 19200 1234 - .fi - .PP - .SH FILES ---- gsmlib-1.10.orig/doc/gsmpb.man -+++ gsmlib-1.10/doc/gsmpb.man -@@ -15,32 +15,32 @@ - gsmpb \- GSM mobile phone phonebook manipulation program - .SH SYNOPSIS - .B gsmpb --[ \fB-b\fP \fIbaudrate\fP ] --[ \fB--baudrate\fP \fIbaudrate\fP ] --[ \fB-c\fP ] --[ \fB--copy\fP ] --[ \fB-d\fP \fIdestination device or file\fP ] --[ \fB--destination\fP \fIdestination device or file\fP ] --[ \fB-h\fP ] --[ \fB--help\fP ] --[ \fB-i\fP ] --[ \fB--index\fP ] --[ \fB-I\fP \fIinit string\fP ] --[ \fB--init\fP \fIinit string\fP ] --[ \fB-p\fP \fIphonebook name\fP ] --[ \fB--phonebook\fP \fIphonebook name\fP ] --[ \fB-s\fP \fIsource device or file\fP ] --[ \fB--source\fP \fIsource device or file\fP ] --[ \fB-t\fP \fIcharacter set\fP ] --[ \fB--charset\fP \fIcharacter set\fP ] --[ \fB-v\fP ] --[ \fB--version\fP ] --[ \fB-V\fP ] --[ \fB--verbose\fP ] --[ \fB-X\fP ] --[ \fB--xonxoff\fP ] --[ \fB-y\fP ] --[ \fB--synchronize\fP ] -+[ \fB\-b\fP \fIbaudrate\fP ] -+[ \fB\-\-baudrate\fP \fIbaudrate\fP ] -+[ \fB\-c\fP ] -+[ \fB\-\-copy\fP ] -+[ \fB\-d\fP \fIdestination device or file\fP ] -+[ \fB\-\-destination\fP \fIdestination device or file\fP ] -+[ \fB\-h\fP ] -+[ \fB\-\-help\fP ] -+[ \fB\-i\fP ] -+[ \fB\-\-index\fP ] -+[ \fB\-I\fP \fIinit string\fP ] -+[ \fB\-\-init\fP \fIinit string\fP ] -+[ \fB\-p\fP \fIphonebook name\fP ] -+[ \fB\-\-phonebook\fP \fIphonebook name\fP ] -+[ \fB\-s\fP \fIsource device or file\fP ] -+[ \fB\-\-source\fP \fIsource device or file\fP ] -+[ \fB\-t\fP \fIcharacter set\fP ] -+[ \fB\-\-charset\fP \fIcharacter set\fP ] -+[ \fB\-v\fP ] -+[ \fB\-\-version\fP ] -+[ \fB\-V\fP ] -+[ \fB\-\-verbose\fP ] -+[ \fB\-X\fP ] -+[ \fB\-\-xonxoff\fP ] -+[ \fB\-y\fP ] -+[ \fB\-\-synchronize\fP ] - .PP - .SH DESCRIPTION - \fIgsmpb\fP can store or retrieve phonebook entries residing in a GSM -@@ -55,45 +55,45 @@ - destination, or the destination is synchronized with regard to the - source which is the default (details see below). - .PP --If "-" is given as the parameter for the \fB--source\fP or --\fB--destination\fP options, the phonebook is read from standard input -+If "\-" is given as the parameter for the \fB\-\-source\fP or -+\fB\-\-destination\fP options, the phonebook is read from standard input - and/or written to standard output, respectively. - .PP - Phonebook entries names are encoded using the GSM default alphabet in --the mobile phone, whereas they are stored using the Latin-1 encoding -+the mobile phone, whereas they are stored using the Latin\-1 encoding - in phonebook files. When reading phonebook entries from a mobile phone --entry names are converted from the GSM default to Latin-1. Characters --that can not be converted to Latin-1 are encoded as character code --172 (Latin-1 boolean "not"). When writing file-based phonebook entries -+entry names are converted from the GSM default to Latin\-1. Characters -+that can not be converted to Latin\-1 are encoded as character code -+172 (Latin\-1 boolean "not"). When writing file-based phonebook entries - to a mobile phone a conversion to the GSM default alphabet takes - place. Characters that can not be converted are encoded as GSM delta - (code 16). If the default character set has been changed using the --\fB--charset\fP option no conversion takes place. -+\fB\-\-charset\fP option no conversion takes place. - .PP - Error messages are printed to the standard error output. If the program - terminates on error the error code 1 is returned. - .PP - .SH OPTIONS - .TP .7i --\fB-b\fP \fIbaudrate\fP, \fB--baudrate\fP \fIbaudrate\fP -+\fB\-b\fP \fIbaudrate\fP, \fB\-\-baudrate\fP \fIbaudrate\fP - The baud rate to use. The default baudrate is 38400. - .TP .7i --\fB-c\fP, \fB--copy\fP -+\fB\-c\fP, \fB\-\-copy\fP - This causes the contents of the source to be copied to the - destination. After this operation the destination has exactly the same - contents as the source. - .TP .7i --\fB-d\fP \fIdestination\fP, \fB--destination\fP \fIdestination\fP -+\fB\-d\fP \fIdestination\fP, \fB\-\-destination\fP \fIdestination\fP - The destination device or file. - .TP .7i --\fB-h\fP, \fB--help\fP -+\fB\-h\fP, \fB\-\-help\fP - Prints an option summary. - .TP .7i --\fB-I\fP \fIinit string\fP, \fB--init\fP \fIinit string\fP -+\fB\-I\fP \fIinit string\fP, \fB\-\-init\fP \fIinit string\fP - Initialization string to send to the TA (default: "E0"). Note that the - sequence "ATZ" is sent first. - .TP .7i --\fB-i\fP, \fB--index\fP -+\fB\-i\fP, \fB\-\-index\fP - If the index position is given, \fIgsmpb\fP preserves the assignment - of entries to memory slots in the mobile phone's phonebook. This can - be used to backup phonebook entries with their position into a -@@ -104,7 +104,7 @@ - be unique, ie. it is not allowed to assign one entry twice to a - specific position in the mobile phone's phonebook. - .TP .7i --\fB-p\fP \fIphonebook\fP, \fB--phonebook\fP \fIphonebook\fP -+\fB\-p\fP \fIphonebook\fP, \fB\-\-phonebook\fP \fIphonebook\fP - The name of the phonebook to read from or write to. This is only used - for device sources and destinations. Commonly available phonebooks - are: -@@ -112,10 +112,10 @@ - .po +0.7i - .ll 5.8i - \fIFD\fP --SIM fixdialling-phonebook -+SIM fixdialling\-phonebook - .TP .3i - \fILD\fP --SIM last-dialling-phonebook -+SIM last\-dialling\-phonebook - .TP .3i - \fIME\fP - ME phonebook -@@ -131,23 +131,23 @@ - .TP .7i - .po -0.7i - .ll 6.5i --\fB-s\fP \fIsource\fP, \fB--source\fP \fIsource\fP -+\fB\-s\fP \fIsource\fP, \fB\-\-source\fP \fIsource\fP - The source device or file. - .TP --\fB-t\fP \fIcharacter set\fP, \fB--charset\fP \fIcharacter set\fP -+\fB\-t\fP \fIcharacter set\fP, \fB\-\-charset\fP \fIcharacter set\fP - Set the character set to use for phonebook operations (default is the - GSM default alphabet). - .TP --\fB-v\fP, \fB--version\fP -+\fB\-v\fP, \fB\-\-version\fP - Prints the program version. - .TP .7i --\fB-V\fP, \fB--verbose\fP -+\fB\-V\fP, \fB\-\-verbose\fP - Prints out a detailed progress report. - .TP .7i --\fB-X\fP, \fB--xonxoff\fP -+\fB\-X\fP, \fB\-\-xonxoff\fP - Uses software handshaking (XON/XOFF) for accessing the device. - .TP .7i --\fB-y\fP, \fB--synchronize\fP -+\fB\-y\fP, \fB\-\-synchronize\fP - This causes the contents of the source to be synchronized with the - destination (default). Synchronization in this context means: - .TP .2i -@@ -188,7 +188,7 @@ - \fIindex\fP - The index of the entry which must be a positive number. The index may - also be empty. Indices can be used in conjunction with the --\fB--index\fP option to store the entry into a specific position in -+\fB\-\-index\fP option to store the entry into a specific position in - the mobile phone. - .TP .7i - \fItext\fP -@@ -199,7 +199,7 @@ - encoded using the GSM default alphabet (see comments above). - .TP .7i - \fIphone number\fP --Phone numbers can only contains the digits 0-9 and the '+' sign. A '+' -+Phone numbers can only contains the digits 0\-9 and the '+' sign. A '+' - sign denotes an international number. - .PP - .SH EXAMPLES -@@ -207,8 +207,8 @@ - SIM phonebook with the file $HOME/.phonebook: - .PP - .nf --gsmpb --synchronize -b 19200 -d /dev/mobilephone \\ -- -s $HOME/.phonebook -p "SM" -+gsmpb \-\-synchronize \-b 19200 \-d /dev/mobilephone \\ -+ \-s $HOME/.phonebook \-p "SM" - .fi - .PP - .SH AUTHOR ---- gsmlib-1.10.orig/debian/compat -+++ gsmlib-1.10/debian/compat -@@ -0,0 +1 @@ -+4 ---- gsmlib-1.10.orig/debian/gsm-utils.cron.d -+++ gsmlib-1.10/debian/gsm-utils.cron.d -@@ -0,0 +1,3 @@ -+# /etc/cron.d/gsm-utils: crontab fragment for gsm-utils -+ -+*/5 * * * * root if [ -x /usr/bin/gsmsmsrequeue ]; then /usr/bin/gsmsmsrequeue; fi ---- gsmlib-1.10.orig/debian/copyright -+++ gsmlib-1.10/debian/copyright -@@ -0,0 +1,34 @@ -+This package was debianized by Mikael Hedin on -+Thu, 14 Dec 2000 01:06:40 +0100. -+ -+It was downloaded from http://www.pxh.de/fs/gsmlib/index.html -+ -+Upstream Author: Peter Hofmann -+ -+ext/gsmsiexfer.cc:// * Author: Christian W. Zuckschwerdt -+ -+Copyright: -+ -+ Copyright (C) 1999-2002 Peter Hofmann -+ -+License: -+ -+ This package is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2 of the License, or (at your option) any later version. -+ -+ This package 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with this package; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ -+On Debian systems, the complete text of the GNU Lesser General -+Public License can be found in `/usr/share/common-licenses/LGPL'. -+ -+The Debian packaging is (C) 2000, Mikael Hedin and -+is licensed under the GPL, see `/usr/share/common-licenses/GPL'. ---- gsmlib-1.10.orig/debian/gsm-utils.dirs -+++ gsmlib-1.10/debian/gsm-utils.dirs -@@ -0,0 +1,11 @@ -+var/spool/sms/queue1 -+var/spool/sms/queue2 -+var/spool/sms/queue3 -+var/spool/sms/sent1 -+var/spool/sms/sent2 -+var/spool/sms/sent3 -+var/spool/sms/failed1 -+var/spool/sms/failed2 -+var/spool/sms/failed3 -+var/spool/sms/tmp -+var/run/gsm-utils ---- gsmlib-1.10.orig/debian/gsm-utils.default -+++ gsmlib-1.10/debian/gsm-utils.default -@@ -0,0 +1,18 @@ -+PHONEDEV=/dev/mobilephone # or /dev/ttyS0 or /dev/ircomm0 -+BAUDRATE=9600 -+PIN="" # or 1234 -+ -+# RUNGSMSMS: If set to anything other that 'yes', the asterisk init.d script -+# will not run. The default is 'yes'. -+# You should probaly also install the crontab from /usr/share/doc/gsm-utils/examples -+RUNGSMSMS=no -+ -+SPOOLDIR=/var/spool/sms -+PRIORITIES=3 -+ -+SMSADMIN=root -+SUBJECT="SMS delivery report:" -+ -+SMSPROCESSOR="" # or /usr/bin/gsmsmsprocessor -+ -+do_accounting () { true; } # it's your turn ---- gsmlib-1.10.orig/debian/watch -+++ gsmlib-1.10/debian/watch -@@ -0,0 +1,2 @@ -+version=2 -+http://www.pxh.de/fs/gsmlib/download/content.html gsmlib-(.*)\.tar\.gz ---- gsmlib-1.10.orig/debian/gsm-utils.postinst -+++ gsmlib-1.10/debian/gsm-utils.postinst -@@ -0,0 +1,28 @@ -+#!/bin/sh -e -+ -+# create gsmsms group if necessary. -+if ! grep -q ^gsmsms: /etc/group; then -+# echo Adding system group: gsmsms. -+ addgroup --system gsmsms -+fi -+ -+# create gsmsms user if necessary. -+if ! grep -q ^gsmsms: /etc/passwd; then -+# echo Adding system user: gsmsms. -+ adduser --system --ingroup gsmsms \ -+ --no-create-home --home /var/spool/sms gsmsms -+fi -+ -+# allow gsmsms to use serial lines -+if ! groups gsmsms | grep -q dialout ; then -+ adduser gsmsms dialout -+fi -+ -+# echo Updating spool directory structure: /var/spool/sms -+chown -R gsmsms:gsmsms /var/spool/sms /var/run/gsm-utils -+chmod 700 /var/spool/sms/* -+chmod 750 /var/spool/sms -+chmod 730 /var/spool/sms/queue* /var/spool/sms/tmp -+ -+# Add the rest automatically.. -+#DEBHELPER# ---- gsmlib-1.10.orig/debian/control -+++ gsmlib-1.10/debian/control -@@ -0,0 +1,45 @@ -+Source: gsmlib -+Section: comm -+Priority: extra -+Maintainer: Mark Purcell -+Build-Depends: debhelper (>= 3.0.0), chrpath -+Standards-Version: 3.7.3 -+Homepage: http://www.pxh.de/fs/gsmlib/ -+ -+Package: libgsmme-dev -+Section: libdevel -+Architecture: any -+Depends: libgsmme1c2a (= ${binary:Version}), libc6-dev -+Description: Header files and static libraries for gsmlib -+ Headers and static libraries for use when compiling programs with -+ gsmlib. -+ . -+ gsmlib is a library for access to a GSM mobile phone using the -+ standards ETSI GSM 07.07, ETSI GSM 07.05, and others. -+ -+Package: libgsmme1c2a -+Conflicts: libgsmme1, libgsmme1c102, libgsmme1c2 -+Replaces: libgsmme1c102, libgsmme1c2 -+Section: libs -+Architecture: any -+Depends: ${shlibs:Depends} -+Description: GSM mobile phone access library -+ Library to access GSM mobile phones through GSM modems or IrDA devices. -+ Features include: -+ . -+ * modification of phone books stored in the mobile phone or on the -+ SIM card -+ * reading and writing of SMS messages stored in the mobile phone -+ * sending and reception of SMS messages -+ . -+ gsmlib uses standard ETSI GSM 07.07, ETSI GSM 07.05, and others. -+ -+Package: gsm-utils -+Section: comm -+Architecture: any -+Depends: ${shlibs:Depends}, adduser -+Description: GSM mobile phone access applications -+ Some simple command line programs to access a GSM mobile phone via -+ GSM modem or IrDA. Functions include: modification of phone books and -+ reading, writing, sending and receiving SMS messages. Uses the GSM -+ standards ETSI GSM 07.07, ETSI GSM 07.05, and others. ---- gsmlib-1.10.orig/debian/gsm-utils.postrm -+++ gsmlib-1.10/debian/gsm-utils.postrm -@@ -0,0 +1,43 @@ -+#!/bin/sh -+# postrm script for #PACKAGE# -+# -+# see: dh_installdeb(1) -+ -+set -e -+ -+# summary of how this script can be called: -+# * `remove' -+# * `purge' -+# * `upgrade' -+# * `failed-upgrade' -+# * `abort-install' -+# * `abort-install' -+# * `abort-upgrade' -+# * `disappear' -+# -+# for details, see http://www.debian.org/doc/debian-policy/ or -+# the debian-policy package -+ -+ -+case "$1" in -+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) -+ ;; -+ -+ purge) -+ deluser gsmsms -+ ;; -+ -+ *) -+ echo "postrm called with unknown argument \`$1'" >&2 -+ exit 1 -+ ;; -+esac -+ -+# dh_installdeb will replace this with shell code automatically -+# generated by other debhelper scripts. -+ -+#DEBHELPER# -+ -+exit 0 -+ -+ ---- gsmlib-1.10.orig/debian/gsmsiexfer.1 -+++ gsmlib-1.10/debian/gsmsiexfer.1 -@@ -0,0 +1,29 @@ -+.\" -*- eval: (nroff-mode) -*- -+.de TQ -+.br -+.ns -+.TP \\$1 -+.. -+.\" Like TP, but if specified indent is more than half -+.\" the current line-length - indent, use the default indent. -+.de Tp -+.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP -+.el .TP "\\$1" -+.. -+.TH GSMSIEXFER 1 "" "gsmsiexfer" -+.SH NAME -+gsmsiexfer \- Siemens ME file transfer program for Siemens phones S25, S35, S45, ME45, SL45 -+.SH SYNOPSIS -+.B gsmsiexfer \-\-help -+.PP -+.SH DESCRIPTION -+\fIgsmsiexer\fP comes with no man page. Try gsmsiexfer \-\-help, or -+read the source. -+.PP -+.SH "SEE ALSO" -+.BR gsminfo(7), -+.BR gsmctl(1), -+.BR gsmsendsms(1), -+.BR gsmsmsd(8), -+.BR gsmsmsstore(1). -+ ---- gsmlib-1.10.orig/debian/gsm-utils.examples -+++ gsmlib-1.10/debian/gsm-utils.examples -@@ -0,0 +1,2 @@ -+contrib/gsm-utils.cron.d -+contrib/gsm-utils.init ---- gsmlib-1.10.orig/debian/dirs -+++ gsmlib-1.10/debian/dirs -@@ -0,0 +1 @@ -+/var/run/gsm-utils ---- gsmlib-1.10.orig/debian/libgsmme-dev.docs -+++ gsmlib-1.10/debian/libgsmme-dev.docs -@@ -0,0 +1,2 @@ -+doc/README.developers -+doc/README.NLS ---- gsmlib-1.10.orig/debian/gsm-utils.init -+++ gsmlib-1.10/debian/gsm-utils.init -@@ -0,0 +1,87 @@ -+#! /bin/sh -+### BEGIN INIT INFO -+# Provides: gsm-utils -+# Required-Start: $remote_fs $syslog -+# Required-Stop: $remote_fs $syslog -+# Default-Start: 2 3 4 5 -+# Default-Stop: 0 1 6 -+# Short-Description: Start daemon at boot time -+# Description: Enable service provided by daemon. -+### END INIT INFO -+# -+# /etc/init.d/gsm-utils: Controls the GSM SMS send daemon -+# -+# written by Matthias Goebl -+ -+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -+DAEMON=/usr/bin/gsmsmsd -+NAME=gsmsmsd -+DESC="GSM SMS send daemon" -+ -+test -x $DAEMON || exit 0 -+ -+if [ "$RUNGSMSMS" != "yes" ];then -+ echo "GSM SMS deamon not yet configured. Edit /etc/default/gsm-utils first." -+ exit 0 -+fi -+ -+ -+PHONEDEV=/dev/mobilephone # or /dev/ttyS0 or /dev/ircomm0 -+BAUDRATE=9600 -+PIN="" # or 1234 -+SMSPROCESSOR="" # or /usr/bin/gsmsmsprocessor -+SPOOLDIR=/var/spool/sms -+PRIORITIES=3 -+STARTOPTS="" -+SMSUSER="gsmsms:gsmsms" -+test -r /etc/default/gsm-utils && . /etc/default/gsm-utils # for overwriting some parameters -+ -+OPTIONS="-d $PHONEDEV -b $BAUDRATE -L -P $PRIORITIES" -+OPTIONS="$OPTIONS -s $SPOOLDIR/queue -S $SPOOLDIR/sent -F $SPOOLDIR/failed" -+test -n "$SMSPROCESSOR" && OPTIONS="$OPTIONS -a $SMSPROCESSOR" -+test -n "$SMSUSER" && STARTOPTS="$STARTOPTS --chuid $SMSUSER" -+test -r /etc/default/gsm-utils && . /etc/default/gsm-utils # for overwriting OPTIONS -+ -+case "$1" in -+ start) -+ echo -n "Starting $DESC: " -+ if [ -n "$PIN" ];then -+ echo -n "entering PIN.. " -+ ( -+ # This is ugly.. But if the PIN is already entered, the ME returns -+ # "ERROR" and makes gsmctl retrying.. -+ /usr/bin/gsmctl -d $PHONEDEV -b $BAUDRATE -I "+cpin=$PIN" & -+ PID=$! -+ sleep 3 -+ kill $PID 2>/dev/null -+ ) >/dev/null 2>&1 -+ fi -+ echo -n "$NAME" -+ start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS -+ echo "." -+ ;; -+ stop) -+ echo -n "Stopping $DESC: $NAME " -+ start-stop-daemon --stop --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --exec $DAEMON -+ sleep 5 -+ echo "." -+ ;; -+ restart|force-reload) -+ echo -n "Restarting $DESC: $NAME" -+ start-stop-daemon --stop --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --make-pidfile --background --exec $DAEMON -- $OPTIONS -+ sleep 5 -+ start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS -+ echo "." -+ ;; -+ *) -+ N=/etc/init.d/gsm-utils -+ echo "Usage: $N {start|stop|restart|force-reload}" >&2 -+ exit 1 -+ ;; -+esac -+ -+exit 0 ---- gsmlib-1.10.orig/debian/changelog -+++ gsmlib-1.10/debian/changelog -@@ -0,0 +1,284 @@ -+gsmlib (1.10-13) unstable; urgency=low -+ -+ * Ack NMU, Thanks Michael, Christoph & Petter -+ * debian/control add Homepage: -+ * Update debian/copyright; gsm-lib/COPYING actually specifies LGPL: -+ - fixes lintian:copyright-without-copyright-notice -+ * Update manpages fixes lintian:hyphen-used-as-minus-sign -+ * Update debian/gsm-utils.init -+ - fixes lintian:init.d-script-missing-lsb-short-description -+ * Bug fixes from ubuntu -+ - Don't install contrib/gsm-utils.init dh_installinit debian/gsm-utils.init -+ - Create /var/run/gsm-utils -+ * Add case 'L' to apps/gsmsmsd.cc - thks to Andrew Suffield -+ - syslog support does not work (Closes: #346240) -+ * gsm-utils.init really call restart with --stop first -+ - init script calls --start twice (Closes: #377448) -+ * Explictly set /bin/bash: gsmsmsspool & gsmsmsrequeue -+ - bashism in /bin/sh script (Closes: #464981) -+ - gsmsmsrequeue contains bashism or function error (Closes: #459396) -+ * Patch apps/gsmsmsstore.cc - thks Isaac Wilcox -+ - gsmsmsstore device existence check causes problems with RFCOMM -+ devices (Closes: #340179) -+ * Only start gsmsmsd if set in /etc/default/gsm-utils. crontab -> examples -+ - gsmsmsd should be optional / start only if told so in -+ /etc/default/gsm-utils (Closes: #474093) -+ * Apply patch from Stefan Katerkamp & Jacob Nevins -+ - Gsmsendsms fails with SonyEricsson W880 (fix included) (Closes: -+ #413341) -+ -+ -- Mark Purcell Mon, 06 Oct 2008 15:01:49 +1100 -+ -+gsmlib (1.10-12.5) unstable; urgency=low -+ -+ * Non-maintainer upload. -+ * Yet another bashism that was later on reported on the old bug report, thus -+ again closes: #464981 -+ * Also found a shell related problem in debian/rules and fixed it. -+ * Bumped standard to 3.7.3. -+ -+ -- Michael Meskes Mon, 14 Apr 2008 10:48:19 +0200 -+ -+gsmlib (1.10-12.4) unstable; urgency=low -+ -+ * Non-maintainer upload. -+ * Argh, somehow I mananged to upload without fixing the bug completely, -+ sorry. Added those missing braces, closes: #464981. -+ -+ -- Michael Meskes Wed, 09 Apr 2008 14:46:08 +0200 -+ -+gsmlib (1.10-12.3) unstable; urgency=high -+ -+ * Non-maintainer upload. -+ * Removed bashism in contrib/gsmsmsrequeue (Closes: #464981). -+ -+ -- Michael Meskes Sun, 06 Apr 2008 15:37:35 +0200 -+ -+gsmlib (1.10-12.2) unstable; urgency=low -+ -+ * Non-maintainer upload. -+ * Fix FTBFS with GCC 4.3: 'strerror' was not declared in this scope, thanks -+ to Cyril Brulebois for the patch (Closes: #455402). -+ -+ -- Christoph Berg Fri, 04 Apr 2008 18:01:05 +0200 -+ -+gsmlib (1.10-12.1) unstable; urgency=low -+ -+ * Non-maintainer upload to solve release goal. -+ * Add LSB dependency header to init.d scripts (Closes: #464061). -+ -+ -- Petter Reinholdtsen Fri, 28 Mar 2008 11:39:20 +0100 -+ -+gsmlib (1.10-12) unstable; urgency=low -+ -+ * addgroup --system gsmsms works better. Thanks Jon -+ * only delete gsmsms on purge -+ - gsm-utils: deletes and recreates the gsmsms user on each upgrade -+ (Closes: #346238) -+ - gsm-utils fails installation / addgroup: The user gsmsms; does -+ not exist (Closes: #445404) -+ * lintian cleanup: debian-rules-ignores-make-clean-error substvar- -+ source-version-is-deprecated -+ * Scripts are installed +x -+ - gsm-utils: uselessly installs non-executable scripts into /usr/bin -+ (Closes: #346230) -+ * Remove bogus symlink -+ - gsm-utils: wrong symlink for manpage gsmsiectl.1 (Closes: #322382) -+ - gsm-utils: gsmsiectl.1 dangling symlink (Closes: #399582) -+ * debian/gsm-utils.init reload/restart was not calling --stop. Thanks -+ Barry -+ - init script calls --start twice (Closes: #377448) -+ -+ -- Mark Purcell Mon, 08 Oct 2007 21:44:00 +0100 -+ -+gsmlib (1.10-11) unstable; urgency=low -+ -+ * Create system group gsmsms - Thanks Emmanuel -+ - gsm-utils: creates group in non-system gid range (Closes: #353967) -+ - gsm-utils: postinst should create system grp gsmsms (Closes: -+ #390266) -+ * Upgrade to compat 4 -+ * Apply gcc-4.3 patch from Martin -+ - FTBFS with GCC 4.3: missing #includes (Closes: #417222) -+ -+ -- Mark Purcell Sat, 29 Sep 2007 18:22:56 +0100 -+ -+gsmlib (1.10-10) unstable; urgency=low -+ -+ * FTBFS with G++ 4.1: extra qualifications (Closes: #356109) -+ -+ -- Mark Purcell Sat, 20 May 2006 21:54:42 +0100 -+ -+gsmlib (1.10-9) unstable; urgency=low -+ -+ * library package needs to be renamed (libstdc++ allocator change) -+ (Closes: #339179) -+ -+ -- Mark Purcell Mon, 21 Nov 2005 21:19:51 +0000 -+ -+gsmlib (1.10-8) unstable; urgency=low -+ -+ * removal of automake1.6 (Closes: #335123) -+ * fails with dash [bashisms in scripts] (Closes: #309834) -+ * Update libtool Fixes: gsmlib(GNU/k*BSD): FTBFS: out of date libtool scripts (Closes: -+ #319688) -+ * [INTL:de] German PO file corrections (Closes: #314060) -+ * Fix: old-fsf-address-in-copyright-file -+ -+ -- Mark Purcell Thu, 3 Nov 2005 22:40:19 +0000 -+ -+gsmlib (1.10-7) unstable; urgency=low -+ -+ * C++ 4.0 transition -+ * Closes: #315864: Missing manpages -+ * gsm-utils: maintainer-script-needs-depends-on-adduser postinst -+ -+ -- Mark Purcell Sat, 23 Jul 2005 00:46:31 +1000 -+ -+gsmlib (1.10-6) unstable; urgency=low -+ -+ * Rebuild for invalid dependancies -+ * Closes: #258056: libgsmme 99% cpu usage -+ - Patch from Emard -+ * Closes: #274382: FTBFS with gcc-3.4: template-id `operator< -+ <>' for `bool gsmlib::operator<(const -+ gsmlib::MapKey<gsmlib::SortedPhonebookBase>&, const -+ gsmlib::MapKey<gsmlib::SortedPhonebookBase>&)' does not -+ match any template declaration -+ - Patch from Andreas Jochens -+ * Closes: #294251: FTBFS (amd64/gcc-4.0): explicit qualification in -+ declaration of `bool gsmlib::operator<(const -+ gsmlib::MapKey<SortedStore>&, const -+ gsmlib::MapKey<SortedStore>&)' -+ - Patch from Andreas Jochens -+ * Closes: #200189: Patch and contribution -+ + Added multi-queue-priority-system and syslog patch (Matthias Goebl) -+ + Included init, spool and requeue scripts for gsmsmsd (Matthias Goebl) -+ + gsmsmsd runs with own user and group (gsmsms:gsmsms) (Matthias Goebl) -+ -+ -- Mark Purcell Tue, 17 May 2005 11:34:45 +0100 -+ -+gsmlib (1.10-5) unstable; urgency=low -+ -+ * Change Section: libdevel -+ * gsm_unix_serial.cc patch from Daniel Schepler to fix g++-3.3 -+ compliation. Thanks. (Closes: Bug#195151) -+ -+ -- Mark Purcell Sat, 19 Jul 2003 15:57:28 +1000 -+ -+gsmlib (1.10-4) unstable; urgency=low -+ -+ * Include file descriptor leak patch from Edd Dumbill (Closes: -+ Bug#168475) -+ * lintian cleanup: description-synopsis-might-not-be-phrased-properly -+ * lintian cleanup: configure-generated-file-in-source -+ -+ -- Mark Purcell Sun, 9 Feb 2003 14:04:54 +1100 -+ -+gsmlib (1.10-3) unstable; urgency=low -+ -+ * New Maintainer (Closes: Bug#180061). Thanks Mikael for your work. -+ -+ -- Mark Purcell Sat, 8 Feb 2003 16:55:26 +1100 -+ -+gsmlib (1.10-2) unstable; urgency=low -+ -+ * Rebuild to use the new c++ ABI (GCC 3.2) -+ -+ -- Mikael Hedin Thu, 23 Jan 2003 20:57:50 +0100 -+ -+gsmlib (1.10-1) unstable; urgency=low -+ -+ * New upstrem release. -+ -+ -- Mikael Hedin Wed, 6 Nov 2002 17:44:17 +0100 -+ -+gsmlib (1.9-2) unstable; urgency=low -+ -+ * Made new rules for the config.guess/sub update thing (closes: #146865, -+ #146867). -+ -+ -- Mikael Hedin Tue, 14 May 2002 09:28:03 +0200 -+ -+gsmlib (1.9-1) unstable; urgency=low -+ -+ * New upstream version. -+ * Use chrpath to get rid of rpaths. -+ * Add mini-manpage for gsmsiexfer. -+ * Remove b-d on auto-stuff, we don't use them. -+ -+ -- Mikael Hedin Mon, 13 May 2002 22:10:28 +0200 -+ -+gsmlib (1.8-2) unstable; urgency=low -+ -+ * Removed b-d on gcc 3.0, as they are no longer nessecary. -+ -+ -- Mikael Hedin Thu, 24 Jan 2002 12:59:07 +0100 -+ -+gsmlib (1.8-1) unstable; urgency=low -+ -+ * New upstream version. -+ * Revert the arch hack, now it should compile with either g++. -+ * Include the new lib in libgsmme1. Run dh_makeshlibs -V because of this. -+ * Added info for gsmsiectl in gsmctl(1). -+ -+ -- Mikael Hedin Wed, 9 Jan 2002 22:38:45 +0100 -+ -+gsmlib (1.7-2) unstable; urgency=low -+ -+ * gsm-utils: Added shlibs:Depends (closes: #126127). -+ * Spelling correction (closes: #124705, #124972) -+ * Rm libgsmme1.postins, and let dh_makeshlibs take care of ldconfig. -+ * Made explicit arch list without sparc and arm, they cannot use g++-3.0 -+ right now. -+ -+ -- Mikael Hedin Sat, 22 Dec 2001 20:27:54 +0100 -+ -+gsmlib (1.7-1) unstable; urgency=low -+ -+ * New upstream -+ * Use gcc-3.0 and g++-3.0, 2.95 doesn't compile. -+ -+ -- Mikael Hedin Thu, 1 Nov 2001 10:24:33 +0100 -+ -+gsmlib (1.6-5) unstable; urgency=low -+ -+ * Updated manpage (closes: #110973) -+ * Corrected problem with OP status (closes: #110970) -+ -+ -- Mikael Hedin Sat, 8 Sep 2001 18:12:17 +0200 -+ -+gsmlib (1.6-4) unstable; urgency=low -+ -+ * Support DEB_BUILD_OPTIONS -+ * Changed libgsmme-dev to section devel. -+ * Reran libtoolize. -+ * Lots of small patches to compile with g++-3.0. (Closes: #104411) -+ * Removed dh_testversion. -+ -+ -- Mikael Hedin Thu, 12 Jul 2001 16:06:23 +0200 -+ -+gsmlib (1.6-3) unstable; urgency=low -+ -+ * Various minor corrections. -+ -+ -- Mikael Hedin Thu, 8 Mar 2001 16:24:07 +0100 -+ -+gsmlib (1.6-2) unstable; urgency=low -+ -+ * Dont install INSTALL. Correct indentation for libgsmme1 description. -+ -+ -- Mikael Hedin Tue, 6 Mar 2001 14:55:05 +0100 -+ -+gsmlib (1.6-1) unstable; urgency=low -+ -+ * New upstream version. -+ -+ -- Mikael Hedin Mon, 29 Jan 2001 17:57:21 +0100 -+ -+gsmlib (1.5-1) unstable; urgency=low -+ -+ * Initial Release. -+ -+ -- Mikael Hedin Thu, 14 Dec 2000 01:06:40 +0100 -+ ---- gsmlib-1.10.orig/debian/gsm-utils.docs -+++ gsmlib-1.10/debian/gsm-utils.docs -@@ -0,0 +1,4 @@ -+NEWS -+README -+TODO -+doc/FAQ ---- gsmlib-1.10.orig/debian/rules -+++ gsmlib-1.10/debian/rules -@@ -0,0 +1,129 @@ -+#!/usr/bin/make -f -+ -+# Uncomment this to turn on verbose mode. -+#export DH_VERBOSE=1 -+ -+# shared library versions, option 1 -+#version=2.0.5 -+#major=2 -+# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -+me_version=`ls gsmlib/.libs/libgsmme*.so.* | \ -+ awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -+me_major=`ls gsmlib/.libs/libgsmme*.so.* | \ -+ awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` -+ex_version=`ls ext/.libs/libgsmext*.so.* | \ -+ awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -+ex_major=`ls ext/.libs/libgsmext*.so.* | \ -+ awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` -+ -+ -+export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -+export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -+ -+ -+# FOR AUTOCONF 2.13 ONLY -+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) -+ confflags += $(DEB_HOST_GNU_TYPE) -+else -+ confflags += --host $(DEB_BUILD_GNU_TYPE) --build $(DEB_HOST_GNU_TYPE) -+endif -+ -+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) -+CFLAGS += -g -+CXXFLAGS += -g -+endif -+ -+configure: configure-stamp -+configure-stamp: -+ dh_testdir -+ # Add here commands to configure the package. -+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" INSTALL_PROGRAM=$(INSTALL_PROGRAM) \ -+ ./configure $(confflags) --prefix=/usr --mandir=\$${prefix}/share/man \ -+ --infodir=\$${prefix}/share/info -+ -+ touch configure-stamp -+ -+build: configure-stamp build-stamp -+build-stamp: -+ dh_testdir -+ -+ # Add here commands to compile the package. -+ $(MAKE) -+ -+ touch build-stamp -+ -+clean: -+ dh_testdir -+ dh_testroot -+ -+ # Add here commands to clean up after the build process. -+ [ ! -f Makefile ] || $(MAKE) distclean -+ rm -f build-stamp configure-stamp config.log config.status po/de.gmo -+ -+ -test -r /usr/share/misc/config.sub && \ -+ cp -f /usr/share/misc/config.sub scripts/config.sub -+ -test -r /usr/share/misc/config.guess && \ -+ cp -f /usr/share/misc/config.guess scripts/config.guess -+ -+ dh_clean -+ -+install: build -+ dh_testdir -+ dh_testroot -+ dh_clean -k -+ dh_installdirs -+ dh_installdirs -pgsm-utils -+ -+ # Add here commands to install the package into debian/gsmlib. -+ $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp -+ chrpath -d debian/tmp/usr/bin/* -+ cp contrib/gsmsmsspool contrib/gsmsmsrequeue debian/tmp/usr/bin -+ -+ -+# Build architecture-independent files here. -+binary-indep: build install -+# We have nothing to do by default. -+ -+# Build architecture-dependent files here. -+binary-arch: build install -+ dh_testdir -+ dh_testroot -+ # -+ # build libgsmlib${major} package by moving files from gsmlib-dev -+ # -+ dh_movefiles -plibgsmme$(me_major)c2a \ -+ usr/lib/libgsmme.so.$(me_major) \ -+ usr/lib/libgsmme.so.$(me_version) \ -+ usr/lib/libgsmext.so.$(ex_major) \ -+ usr/lib/libgsmext.so.$(ex_version) \ -+ usr/share/locale -+ -+ dh_movefiles -plibgsmme-dev \ -+ usr/include \ -+ usr/lib -+ -+ dh_movefiles -pgsm-utils \ -+ usr/bin -+ -+ -+ dh_installdocs -+ dh_installexamples -+ dh_installmenu -+ dh_installinit -+ dh_installcron -+ dh_installman -pgsm-utils debian/*.1 debian/tmp/usr/share/man/man*/* -+ dh_installinfo -+ dh_installchangelogs ChangeLog -+ dh_link -+ dh_strip -+ dh_compress -+ dh_fixperms -+ dh_makeshlibs -V -+ dh_installdeb -+ dh_shlibdeps -ldebian/libgsmme1c2a/usr/lib -+ dh_gencontrol -+ dh_md5sums -+ dh_builddeb -+ -+binary: binary-indep binary-arch -+.PHONY: build clean binary-indep binary-arch binary install configure ---- gsmlib-1.10.orig/contrib/gsmsmsrequeue -+++ gsmlib-1.10/contrib/gsmsmsrequeue -@@ -0,0 +1,48 @@ -+#! /bin/bash -+# -+# /usr/bin/gsmsmsrequeue: Re-queues failed SMS -+# -+# written by Matthias Goebl -+ -+SPOOLDIR=/var/spool/sms -+PRIORITIES=3 -+SMSADMIN=root -+SUBJECT="SMS delivery report:" -+ -+send_notify() -+{ -+ tmpfile="$SPOOLDIR/tmp/"`basename "$1"` -+ status="$2" -+ if mv "$1" "$tmpfile" 2>/dev/null; then -+ # extract the first tab-separated field after the phone number as -+ # email-address to send the notification to -+ mailto=` cat "$tmpfile" | sed -ne '1s/^[^ ]* \([^ ]*\).*/\1/p' ` -+ test -z "$mailto" && mailto="$SMSADMIN" -+ cat "$tmpfile" | mail -s "$SUBJECT $status" "$mailto" -+ rm "$tmpfile" -+ fi -+} -+do_accounting() -+{ -+ true; -+} -+ -+test -r /etc/default/gsm-utils && . /etc/default/gsm-utils -+ -+for p in `seq 1 $PRIORITIES`; do -+ ls "$SPOOLDIR/failed$p" | while read file; do -+ if expr "$file" : ".*rrrrrrrrrrrr" >/dev/null; then -+ send_notify "$SPOOLDIR/failed$p/$file" "failed" -+ else -+ # re-queue SMS -+ mv "$SPOOLDIR/failed$p/$file" "$SPOOLDIR/queue$p/${file}r" 2>/dev/null -+ fi -+ done -+done -+ -+for p in `seq 1 $PRIORITIES`; do -+ ls "$SPOOLDIR/sent$p" | while read file; do -+ do_accounting "$SPOOLDIR/sent$p/$file" "sent" -+ send_notify "$SPOOLDIR/sent$p/$file" "sent" -+ done -+done ---- gsmlib-1.10.orig/contrib/gsm-utils.cron.d -+++ gsmlib-1.10/contrib/gsm-utils.cron.d -@@ -0,0 +1,3 @@ -+# /etc/cron.d/gsm-utils: crontab fragment for gsm-utils -+ -+*/5 * * * * root if [ -x /usr/bin/gsmsmsrequeue ]; then /usr/bin/gsmsmsrequeue; fi ---- gsmlib-1.10.orig/contrib/gsm-utils.default -+++ gsmlib-1.10/contrib/gsm-utils.default -@@ -0,0 +1,13 @@ -+PHONEDEV=/dev/mobilephone # or /dev/ttyS0 or /dev/ircomm0 -+BAUDRATE=9600 -+PIN="" # or 1234 -+ -+SPOOLDIR=/var/spool/sms -+PRIORITIES=3 -+ -+SMSADMIN=root -+SUBJECT="SMS delivery report:" -+ -+SMSPROCESSOR="" # or /usr/bin/gsmsmsprocessor -+ -+do_accounting () { true; } # it's your turn ---- gsmlib-1.10.orig/contrib/gsmsmsspool -+++ gsmlib-1.10/contrib/gsmsmsspool -@@ -0,0 +1,34 @@ -+#! /bin/bash -+# -+# /usr/bin/gsmsmsspool: Queues SMS for sending -+# -+# written by Matthias Goebl -+ -+SPOOLDIR=/var/spool/sms -+PRIORITIES=3 -+test -r /etc/default/gsm-utils && . /etc/default/gsm-utils -+ -+if [ -z "$1" ]; then -+ echo "Usage: gsmsmsspool NUMBER [MESSAGE]" -+ exit 1 -+fi -+ -+priority=$PRIORITIES # default priority -+test -n "$GSMSMS_PRIORITY" && priority="$GSMSMS_PRIORITY" -+mailto=`id -un` -+test -n "$GSMSMS_NOTIFY" && mailto="$GSMSMS_NOTIFY" -+ -+tmpfile="$SPOOLDIR/tmp/`date +%s`.$$" -+umask 022 -+echo "$1 $mailto" > "$tmpfile" -+if [ -n "$2" ]; then -+ echo "$2" | head -c 160 >> "$tmpfile" -+else -+ head -c 160 >> "$tmpfile" -+fi -+ -+if [ "`id -un`" = "root" ]; then -+ chown gsmsms:gsmsms "$tmpfile" -+fi -+ -+mv "$tmpfile" "$SPOOLDIR/queue$priority/" ---- gsmlib-1.10.orig/contrib/gsm-utils.init -+++ gsmlib-1.10/contrib/gsm-utils.init -@@ -0,0 +1,81 @@ -+#! /bin/sh -+### BEGIN INIT INFO -+# Provides: gsm-utils -+# Required-Start: $remote_fs $syslog -+# Required-Stop: $remote_fs $syslog -+# Default-Start: 2 3 4 5 -+# Default-Stop: 0 1 6 -+# Short-Description: Start daemon at boot time -+# Description: Enable service provided by daemon. -+### END INIT INFO -+# -+# /etc/init.d/gsm-utils: Controls the GSM SMS send daemon -+# -+# written by Matthias Goebl -+ -+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -+DAEMON=/usr/bin/gsmsmsd -+NAME=gsmsmsd -+DESC="GSM SMS send daemon" -+ -+test -x $DAEMON || exit 0 -+ -+PHONEDEV=/dev/mobilephone # or /dev/ttyS0 or /dev/ircomm0 -+BAUDRATE=9600 -+PIN="" # or 1234 -+SMSPROCESSOR="" # or /usr/bin/gsmsmsprocessor -+SPOOLDIR=/var/spool/sms -+PRIORITIES=3 -+STARTOPTS="" -+SMSUSER="gsmsms:gsmsms" -+test -r /etc/default/gsm-utils && . /etc/default/gsm-utils # for overwriting some parameters -+ -+OPTIONS="-d $PHONEDEV -b $BAUDRATE -L -P $PRIORITIES" -+OPTIONS="$OPTIONS -s $SPOOLDIR/queue -S $SPOOLDIR/sent -F $SPOOLDIR/failed" -+test -n "$SMSPROCESSOR" && OPTIONS="$OPTIONS -a $SMSPROCESSOR" -+test -n "$SMSUSER" && STARTOPTS="$STARTOPTS --chuid $SMSUSER" -+test -r /etc/default/gsm-utils && . /etc/default/gsm-utils # for overwriting OPTIONS -+ -+case "$1" in -+ start) -+ echo -n "Starting $DESC: " -+ if [ -n "$PIN" ];then -+ echo -n "entering PIN.. " -+ ( -+ # This is ugly.. But if the PIN is already entered, the ME returns -+ # "ERROR" and makes gsmctl retrying.. -+ /usr/bin/gsmctl -d $PHONEDEV -b $BAUDRATE -I "+cpin=$PIN" & -+ PID=$! -+ sleep 3 -+ kill $PID 2>/dev/null -+ ) >/dev/null 2>&1 -+ fi -+ echo -n "$NAME" -+ start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS -+ echo "." -+ ;; -+ stop) -+ echo -n "Stopping $DESC: $NAME " -+ start-stop-daemon --stop --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --exec $DAEMON -+ sleep 5 -+ echo "." -+ ;; -+ restart|force-reload) -+ echo -n "Restarting $DESC: $NAME" -+ start-stop-daemon --stop --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS -+ sleep 5 -+ start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ -+ --make-pidfile --background --exec $DAEMON -- $OPTIONS -+ echo "." -+ ;; -+ *) -+ N=/etc/init.d/gsm-utils -+ echo "Usage: $N {start|stop|restart|force-reload}" >&2 -+ exit 1 -+ ;; -+esac -+ -+exit 0 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10.orig.tar.gz b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10.orig.tar.gz deleted file mode 100644 index c3e2c3bb74..0000000000 Binary files a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10.orig.tar.gz and /dev/null differ diff --git a/src/mod/endpoints/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/gsmopen.h index 37eb15741c..fd56fd4963 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmopen.h +++ b/src/mod/endpoints/mod_gsmopen/gsmopen.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2011, Anthony Minessale II + * Copyright (C) 2005-2011, Anthony Minessale II * * Version: MPL 1.1 * @@ -23,17 +23,15 @@ * * This module (mod_gsmopen) has been contributed by: * - * Giovanni Maruzzelli (gmaruzz@gmail.com) + * Giovanni Maruzzelli * + * Maintainer: Giovanni Maruzzelli * - * Further Contributors: - * - * - * - * mod_gsmopen.c -- GSM compatible Endpoint Module + * mod_gsmopen.cpp -- GSM Modem compatible Endpoint Module * */ + #define __STDC_LIMIT_MACROS #ifdef WIN32 @@ -52,10 +50,6 @@ #define ALARM_NETWORK_NO_SIGNAL 4 #define ALARM_NETWORK_LOW_SIGNAL 5 - - - - #undef GIOVA48 #ifndef GIOVA48 @@ -64,7 +58,6 @@ #define SAMPLES_PER_FRAME 960 #endif // GIOVA48 - #ifndef GIOVA48 #define GSMOPEN_FRAME_SIZE 160 #else //GIOVA48 @@ -72,9 +65,6 @@ #endif //GIOVA48 #define SAMPLERATE_GSMOPEN 8000 -#ifndef NO_ALSA -#define GSMOPEN_ALSA -#endif // NO_ALSA #include #include #ifndef WIN32 @@ -84,21 +74,6 @@ #endif //WIN32 //#include -#ifdef GSMOPEN_ALSA -#define ALSA_PCM_NEW_HW_PARAMS_API -#define ALSA_PCM_NEW_SW_PARAMS_API -#include -#endif /* GSMOPEN_ALSA */ - -#ifdef GSMOPEN_PORTAUDIO -#include "pablio.h" -#undef WANT_SPEEX -#ifdef WANT_SPEEX -#include "speex/speex_preprocess.h" -#include "speex/speex_echo.h" -#endif /* WANT_SPEEX */ -#endif// GSMOPEN_PORTAUDIO - //#include "celliax_spandsp.h" #ifndef WIN32 #include @@ -122,19 +97,27 @@ #define PROTOCOL_FBUS2 1 #define PROTOCOL_NO_SERIAL 3 -#define AT_BUFSIZ 8192 //FIXME FIXME FIXME #define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ #define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ +#define AT_BUFSIZ AT_MESG_MAX_LENGTH //FIXME FIXME FIXME #define AT_MESG_MAX_LINES 256 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ #define AT_MESG_MAX_LINES 20 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ //#define SAMPLERATE_GSMOPEN 16000 //#define SAMPLES_PER_FRAME SAMPLERATE_GSMOPEN/50 +#ifdef GSMOPEN_C_VER +#ifdef MODGSMOPEN_C_VER +#define GSMOPEN_SVN_VERSION MODGSMOPEN_C_VER"|"GSMOPEN_C_VER +#endif +#endif + #ifndef GSMOPEN_SVN_VERSION #define GSMOPEN_SVN_VERSION SWITCH_VERSION_REVISION #endif /* GSMOPEN_SVN_VERSION */ +#include "ctb-0.16/ctb.h" + typedef enum { TFLAG_IO = (1 << 0), TFLAG_INBOUND = (1 << 1), @@ -348,7 +331,6 @@ struct private_object { unsigned long ib_failed_calls; unsigned long ob_failed_calls; - char controldevice_name[50]; /*!< \brief name of the serial device controlling the interface, possibly none */ int controldevprotocol; /*!< \brief which protocol is used for serial control of this interface */ char controldevprotocolname[50]; /*!< \brief name of the serial device controlling protocol, one of "at" "fbus2" "no_serial" "alsa_voicemodem" */ @@ -358,7 +340,7 @@ struct private_object { int controldevice_speed; #else speed_t controldevice_speed; -#endif// WIN32 +#endif // WIN32 int controldev_dead; char at_dial_pre_number[64]; @@ -435,7 +417,6 @@ struct private_object { time_t gsmopen_serial_synced_timestamp; struct s_result line_array; - int unread_sms_msg_id; int reading_sms_msg; char sms_message[4800]; @@ -449,7 +430,6 @@ struct private_object { int sms_pdu_not_supported; //char sms_receiving_program[256]; - struct timeval call_incoming_time; switch_mutex_t *controldev_lock; @@ -465,19 +445,6 @@ struct private_object { struct timeval ringtime; ciapa_t *owner; -#ifdef GSMOPEN_ALSA - snd_pcm_t *alsac; /*!< \brief handle of the ALSA capture audio device */ - snd_pcm_t *alsap; /*!< \brief handle of the ALSA playback audio device */ - char alsacname[50]; /*!< \brief name of the ALSA capture audio device */ - char alsapname[50]; /*!< \brief name of the ALSA playback audio device */ - int alsa_period_size; /*!< \brief ALSA period_size, in byte */ - int alsa_periods_in_buffer; /*!< \brief how many periods in ALSA buffer, to calculate buffer_size */ - unsigned long int alsa_buffer_size; /*!< \brief ALSA buffer_size, in byte */ - int alsawrite_filled; - int alsa_capture_is_mono; - int alsa_play_is_mono; - struct pollfd pfd; -#endif // GSMOPEN_ALSA time_t audio_play_reset_timestamp; int audio_play_reset_period; @@ -489,59 +456,59 @@ struct private_object { int no_sound; -#ifdef GSMOPEN_PORTAUDIO - int speexecho; - int speexpreprocess; - int portaudiocindex; /*!< \brief Index of the Portaudio capture audio device */ - int portaudiopindex; /*!< \brief Index of the Portaudio playback audio device */ - PABLIO_Stream *stream; + dtmf_rx_state_t dtmf_state; + int active; + int home_network_registered; + int roaming_registered; + int not_registered; + int got_signal; + char imei[128]; + int requesting_imei; + char imsi[128]; + int requesting_imsi; + int network_creg_not_supported; + char creg[128]; -#ifdef WANT_SPEEX - SpeexPreprocessState *preprocess; - SpeexEchoState *echo_state; -#endif// WANT_SPEEX -#endif// GSMOPEN_PORTAUDIO - dtmf_rx_state_t dtmf_state; - int active; - int home_network_registered; - int roaming_registered; - int not_registered; - int got_signal; - char imei[128]; - int requesting_imei; - char imsi[128]; - int requesting_imsi; - int network_creg_not_supported; - char creg[128]; + char controldevice_audio_name[50]; + int controldev_audio_fd; + int controldevice_audio_speed; + int controldev_audio_dead; + switch_mutex_t *controldev_audio_lock; + ctb::SerialPort * serialPort_serial_audio; + + ctb::SerialPort * serialPort_serial_control; + + char buffer2[320]; + int buffer2_full; }; typedef struct private_object private_t; -void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t * thread, void *obj); -int gsmopen_audio_read(private_t * tech_pvt); -int gsmopen_audio_init(private_t * tech_pvt); -int gsmopen_signaling_read(private_t * tech_pvt); +void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t *thread, void *obj); +int gsmopen_audio_read(private_t *tech_pvt); +int gsmopen_audio_init(private_t *tech_pvt); +int gsmopen_signaling_read(private_t *tech_pvt); -int gsmopen_call(private_t * tech_pvt, char *idest, int timeout); -int gsmopen_senddigit(private_t * tech_pvt, char digit); +int gsmopen_call(private_t *tech_pvt, char *idest, int timeout); +int gsmopen_senddigit(private_t *tech_pvt, char digit); void *gsmopen_do_tcp_srv_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t * thread, void *obj); +void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t *thread, void *obj); void *gsmopen_do_tcp_cli_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t * thread, void *obj); +void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t *thread, void *obj); void *gsmopen_do_gsmopenapi_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj); -int dtmf_received(private_t * tech_pvt, char *value); -int start_audio_threads(private_t * tech_pvt); -int new_inbound_channel(private_t * tech_pvt); -int outbound_channel_answered(private_t * tech_pvt); +void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t *thread, void *obj); +int dtmf_received(private_t *tech_pvt, char *value); +int start_audio_threads(private_t *tech_pvt); +int new_inbound_channel(private_t *tech_pvt); +int outbound_channel_answered(private_t *tech_pvt); //int gsmopen_signaling_write(private_t * tech_pvt, char *msg_to_gsmopen); #if defined(WIN32) && !defined(__CYGWIN__) -int gsmopen_pipe_read(switch_file_t * pipe, short *buf, int howmany); -int gsmopen_pipe_write(switch_file_t * pipe, short *buf, int howmany); +int gsmopen_pipe_read(switch_file_t *pipe, short *buf, int howmany); +int gsmopen_pipe_write(switch_file_t *pipe, short *buf, int howmany); /* Visual C do not have strsep ? */ char *strsep(char **stringp, const char *delim); #else @@ -549,59 +516,58 @@ int gsmopen_pipe_read(int pipe, short *buf, int howmany); int gsmopen_pipe_write(int pipe, short *buf, int howmany); #endif /* WIN32 */ int gsmopen_close_socket(unsigned int fd); -private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling); -int remote_party_is_ringing(private_t * tech_pvt); -int remote_party_is_early_media(private_t * tech_pvt); +private_t *find_available_gsmopen_interface_rr(private_t *tech_pvt_calling); +int remote_party_is_ringing(private_t *tech_pvt); +int remote_party_is_early_media(private_t *tech_pvt); //int gsmopen_answer(private_t * tech_pvt, char *id, char *value); #if 0 -int gsmopen_transfer(private_t * tech_pvt, char *id, char *value); +int gsmopen_transfer(private_t *tech_pvt, char *id, char *value); #endif //0 -int gsmopen_socket_create_and_bind(private_t * tech_pvt, int *which_port); - - - - +int gsmopen_socket_create_and_bind(private_t *tech_pvt, int *which_port); void *gsmopen_do_controldev_thread(void *data); -#ifdef WIN32 -int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed); -#else -int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed); -#endif //WIN32 -int gsmopen_serial_monitor(private_t * tech_pvt); -int gsmopen_serial_sync(private_t * tech_pvt); -int gsmopen_serial_sync_AT(private_t * tech_pvt); -int gsmopen_serial_config(private_t * tech_pvt); -int gsmopen_serial_config_AT(private_t * tech_pvt); +//#ifdef WIN32 +int gsmopen_serial_init(private_t *tech_pvt, int controldevice_speed); +//#else +//int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed); +//#endif //WIN32 +int gsmopen_serial_monitor(private_t *tech_pvt); +int gsmopen_serial_sync(private_t *tech_pvt); +int gsmopen_serial_sync_AT(private_t *tech_pvt); +int gsmopen_serial_config(private_t *tech_pvt); +int gsmopen_serial_config_AT(private_t *tech_pvt); -#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 2) -#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 2) +#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 0) +#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 0) #define gsmopen_serial_write_AT_expect_noexpcr_tout(P, D, S, T) gsmopen_serial_write_AT_expect1(P, D, S, 0, T) // 20.5 sec timeout, used for querying the SIM and sending SMSs -#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20) -#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20) -int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds); -int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds); -int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf); -int gsmopen_serial_read(private_t * tech_pvt); +//#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20) +//#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20) +#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 5) +#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 5) +int gsmopen_serial_write_AT(private_t *tech_pvt, const char *data); +int gsmopen_serial_write_AT_nocr(private_t *tech_pvt, const char *data); +int gsmopen_serial_write_AT_ack(private_t *tech_pvt, const char *data); +int gsmopen_serial_write_AT_ack_nocr_longtime(private_t *tech_pvt, const char *data); +int gsmopen_serial_write_AT_noack(private_t *tech_pvt, const char *data); +int gsmopen_serial_write_AT_expect1(private_t *tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds); +int gsmopen_serial_AT_expect(private_t *tech_pvt, const char *expected_string, int expect_crlf, int seconds); +int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf); +int gsmopen_serial_read(private_t *tech_pvt); #ifdef NOTDEF -int gsmopen_serial_getstatus(private_t * tech_pvt); -int gsmopen_serial_hangup(private_t * tech_pvt); -int gsmopen_serial_answer(private_t * tech_pvt); -int gsmopen_serial_answer_AT(private_t * tech_pvt); -int gsmopen_serial_hangup_AT(private_t * tech_pvt); -int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr); -int gsmopen_serial_getstatus_AT(private_t * tech_pvt); +int gsmopen_serial_getstatus(private_t *tech_pvt); +int gsmopen_serial_hangup(private_t *tech_pvt); +int gsmopen_serial_answer(private_t *tech_pvt); +int gsmopen_serial_answer_AT(private_t *tech_pvt); +int gsmopen_serial_hangup_AT(private_t *tech_pvt); +int gsmopen_serial_call_AT(private_t *tech_pvt, char *dstr); +int gsmopen_serial_getstatus_AT(private_t *tech_pvt); #endif // NOTDEF #define RESULT_FAILURE 0 #define RESULT_SUCCESS 1 -int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft); -int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft); +int utf8_to_ucs2(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft); +int ucs2_to_utf8(private_t *tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft); +int utf8_to_iso_8859_1(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *iso_8859_1_out, size_t outbytesleft); //#define PUSHA_UNLOCKA(x) pthread_cleanup_push(gsmopen_unlocka_log, (void *) x); //#define POPPA_UNLOCKA(x) pthread_cleanup_pop(0); @@ -616,50 +582,29 @@ int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t out #define ast_setstate(x, y) ERRORA("ast_setstate: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y); -int gsmopen_serial_read(private_t * tech_pvt); -int gsmopen_answer(private_t * tech_pvt); -int gsmopen_serial_answer(private_t * tech_pvt); -int gsmopen_serial_answer_AT(private_t * tech_pvt); -int gsmopen_serial_hangup(private_t * tech_pvt); -int gsmopen_serial_hangup_AT(private_t * tech_pvt); -int gsmopen_hangup(private_t * tech_pvt); -int gsmopen_serial_call(private_t * tech_pvt, char *dstr); -int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr); -int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text); - -#ifdef GSMOPEN_ALSA -int alsa_init(private_t * tech_pvt); -int alsa_shutdown(private_t * tech_pvt); -snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream); -int alsa_write(private_t * tech_pvt, short *data, int datalen); -int alsa_read(private_t * tech_pvt, short *data, int datalen); - -#endif /* GSMOPEN_ALSA */ - +int gsmopen_serial_read(private_t *tech_pvt); +int gsmopen_answer(private_t *tech_pvt); +int gsmopen_serial_answer(private_t *tech_pvt); +int gsmopen_serial_answer_AT(private_t *tech_pvt); +int gsmopen_serial_hangup(private_t *tech_pvt); +int gsmopen_serial_hangup_AT(private_t *tech_pvt); +int gsmopen_hangup(private_t *tech_pvt); +int gsmopen_serial_call(private_t *tech_pvt, char *dstr); +int gsmopen_serial_call_AT(private_t *tech_pvt, char *dstr); +int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text); void gsmopen_store_boost(char *s, double *boost); int gsmopen_sound_boost(void *data, int samples_num, double boost); -int sms_incoming(private_t * tech_pvt); -int gsmopen_ring(private_t * tech_pvt); +int sms_incoming(private_t *tech_pvt); +int gsmopen_ring(private_t *tech_pvt); -int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft); -int gsmopen_serial_getstatus_AT(private_t * tech_pvt); +int iso_8859_1_to_utf8(private_t *tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft); +int gsmopen_serial_getstatus_AT(private_t *tech_pvt); - -#ifdef GSMOPEN_PORTAUDIO - -int gsmopen_portaudio_devlist(private_t *tech_pvt); - -int gsmopen_portaudio_init(private_t *tech_pvt); - -int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen); - -int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen); - - -int gsmopen_portaudio_shutdown(private_t *tech_pvt); - -#endif // GSMOPEN_PORTAUDIO int dump_event(private_t *tech_pvt); -int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message); -int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message); +int alarm_event(private_t *tech_pvt, int alarm_code, const char *alarm_message); +int dump_event_full(private_t *tech_pvt, int is_alarm, int alarm_code, const char *alarm_message); + +int gsmopen_serial_init_audio_port(private_t *tech_pvt, int controldevice_audio_speed); +int serial_audio_init(private_t *tech_pvt); +int serial_audio_shutdown(private_t *tech_pvt); diff --git a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp index 6834a1d880..ffa4e3d014 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp +++ b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp @@ -1,46 +1,69 @@ -#include "gsmopen.h" -//#include +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2011, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * This module (mod_gsmopen) has been contributed by: + * + * Giovanni Maruzzelli + * + * Maintainer: Giovanni Maruzzelli + * + * gsmopen_protocol.cpp -- Low Level Interface for mod_gamopen + * + */ -#ifndef NO_GSMLIB -#include + + + +#include "gsmopen.h" #ifdef WIN32 -#include -#else -#include -#endif -#include -#include +#include "win_iconv.c" +#endif // WIN32 +#define WANT_GSMLIB + +#ifdef WANT_GSMLIB +#include +//#ifdef WIN32 +//#include +//#else +//#include +//#endif +//#include +//#include using namespace std; using namespace gsmlib; -#endif// NO_GSMLIB +#endif // WANT_GSMLIB + + +extern int running; //FIXME +int gsmopen_dir_entry_extension = 1; //FIXME +int option_debug = 100; //FIXME -#ifdef ASTERISK -#define gsmopen_sleep usleep -#define gsmopen_strncpy strncpy -#define tech_pvt p -extern int gsmopen_debug; -extern char *gsmopen_console_active; -#else /* FREESWITCH */ #define gsmopen_sleep switch_sleep #define gsmopen_strncpy switch_copy_string extern switch_memory_pool_t *gsmopen_module_pool; extern switch_endpoint_interface_t *gsmopen_endpoint_interface; -#endif /* ASTERISK */ -//int samplerate_gsmopen = SAMPLERATE_GSMOPEN; - -extern int running; -int gsmopen_dir_entry_extension = 1; - -int option_debug = 100; - - -#ifdef WIN32 -#define GSMLIBGIO -#else //WIN32 -#undef GSMLIBGIO -#endif //WIN32 #ifdef WIN32 /***************/ @@ -88,468 +111,22 @@ int gettimeofday(struct timeval *tv, struct sk_timezone *tz) /***************/ #endif /* WIN32 */ -#ifdef GSMOPEN_PORTAUDIO -#include "pablio.h" - -#ifndef GIOVA48 -#define SAMPLES_PER_FRAME 160 -#else // GIOVA48 -#define SAMPLES_PER_FRAME 960 -#endif // GIOVA48 - -int gsmopen_portaudio_devlist(private_t *tech_pvt) +int gsmopen_serial_init(private_t *tech_pvt, int controldevice_speed) { - int i, numDevices; - const PaDeviceInfo *deviceInfo; - numDevices = Pa_GetDeviceCount(); - if (numDevices < 0) { - return 0; - } - for (i = 0; i < numDevices; i++) { - deviceInfo = Pa_GetDeviceInfo(i); - NOTICA - ("Found PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, i, deviceInfo->name, deviceInfo->maxInputChannels, - deviceInfo->maxOutputChannels); - } + tech_pvt->serialPort_serial_control = new ctb::SerialPort(); - return numDevices; -} - -int gsmopen_portaudio_init(private_t *tech_pvt) -{ - PaError err; - int c; - PaStreamParameters inputParameters, outputParameters; - int numdevices; - const PaDeviceInfo *deviceInfo; - -#ifndef GIOVA48 - setenv("PA_ALSA_PLUGHW", "1", 1); -#endif // GIOVA48 - - err = Pa_Initialize(); - if (err != paNoError) - return err; - - numdevices = gsmopen_portaudio_devlist(tech_pvt); - - if (tech_pvt->portaudiocindex > (numdevices - 1)) { - ERRORA("Portaudio Capture id=%d is out of range: valid id are from 0 to %d\n", - GSMOPEN_P_LOG, tech_pvt->portaudiocindex, (numdevices - 1)); - return -1; - } - - if (tech_pvt->portaudiopindex > (numdevices - 1)) { - ERRORA("Portaudio Playback id=%d is out of range: valid id are from 0 to %d\n", - GSMOPEN_P_LOG, tech_pvt->portaudiopindex, (numdevices - 1)); - return -1; - } - //inputParameters.device = 0; - if (tech_pvt->portaudiocindex != -1) { - inputParameters.device = tech_pvt->portaudiocindex; - } else { - inputParameters.device = Pa_GetDefaultInputDevice(); - } - deviceInfo = Pa_GetDeviceInfo(inputParameters.device); - NOTICA - ("Using INPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - if (deviceInfo->maxInputChannels == 0) { - ERRORA - ("No INPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - return -1; - } - inputParameters.channelCount = 1; - inputParameters.sampleFormat = paInt16; - //inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultHighInputLatency; - inputParameters.suggestedLatency = 0.1; - inputParameters.hostApiSpecificStreamInfo = NULL; - - //outputParameters.device = 3; - if (tech_pvt->portaudiopindex != -1) { - outputParameters.device = tech_pvt->portaudiopindex; - } else { - outputParameters.device = Pa_GetDefaultOutputDevice(); - } - deviceInfo = Pa_GetDeviceInfo(outputParameters.device); - NOTICA - ("Using OUTPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, outputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - if (deviceInfo->maxOutputChannels == 0) { - ERRORA - ("No OUTPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - return -1; - } -#ifndef GIOVA48 - outputParameters.channelCount = 1; -#else // GIOVA48 - outputParameters.channelCount = 2; -#endif // GIOVA48 - outputParameters.sampleFormat = paInt16; - //outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultHighOutputLatency; - outputParameters.suggestedLatency = 0.1; - outputParameters.hostApiSpecificStreamInfo = NULL; - -/* build the pipe that will be polled on by pbx */ - c = pipe(tech_pvt->audiopipe); - if (c) { - ERRORA("Unable to create audio pipe\n", GSMOPEN_P_LOG); - return -1; - } - fcntl(tech_pvt->audiopipe[0], F_SETFL, O_NONBLOCK); - fcntl(tech_pvt->audiopipe[1], F_SETFL, O_NONBLOCK); - - err = -#ifndef GIOVA48 - OpenAudioStream(&tech_pvt->stream, &inputParameters, &outputParameters, 8000, - paClipOff|paDitherOff, SAMPLES_PER_FRAME, 0); - //&tech_pvt->speexecho, &tech_pvt->speexpreprocess, &tech_pvt->owner); - -#else // GIOVA48 - OpenAudioStream(&tech_pvt->stream, &inputParameters, &outputParameters, 48000, - paDitherOff | paClipOff, SAMPLES_PER_FRAME, tech_pvt->audiopipe[1], - &tech_pvt->speexecho, &tech_pvt->speexpreprocess, &tech_pvt->owner); - - -#endif// GIOVA48 - if (err != paNoError) { - ERRORA("Unable to open audio stream: %s\n", GSMOPEN_P_LOG, Pa_GetErrorText(err)); - return -1; - } - -/* the pipe is our audio fd for pbx to poll on */ - tech_pvt->gsmopen_sound_capt_fd = tech_pvt->audiopipe[0]; - - return 0; -} -//int gsmopen_portaudio_write(private_t *tech_pvt, struct ast_frame *f) -int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen) -{ - int samples; -#ifdef GIOVA48 - //short buf[GSMOPEN_FRAME_SIZE * 2]; - short buf[3840]; - short *buf2; - - //ERRORA("1 f->datalen=: %d\n", GSMOPEN_P_LOG, f->datalen); - - - - - memset(buf, '\0', GSMOPEN_FRAME_SIZE *2); - - buf2 = f->data; - - int i=0, a=0; - - for(i=0; i< f->datalen / sizeof(short); i++){ -//stereo, 2 chan 48 -> mono 8 - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - /* - */ - } - f->data = &buf; - f->datalen = f->datalen * 6; - //ERRORA("2 f->datalen=: %d\n", GSMOPEN_P_LOG, f->datalen); - //f->datalen = f->datalen; -#endif // GIOVA48 - - - samples = - WriteAudioStream(tech_pvt->stream, (short *) data, (int) (datalen / sizeof(short)), &tech_pvt->timer_write); - - if (samples != (int) (datalen / sizeof(short))) - ERRORA("WriteAudioStream wrote: %d of %d\n", GSMOPEN_P_LOG, samples, - (int) (datalen / sizeof(short))); - - return samples; -} -//struct ast_frame *gsmopen_portaudio_read(private_t *tech_pvt) -#define AST_FRIENDLY_OFFSET 0 -int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen) -{ -#if 0 - //static struct ast_frame f; - static short __buf[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - short *buf; - static short __buf2[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - short *buf2; - int samples; - //char c; - - memset(__buf, '\0', (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); - - buf = __buf + AST_FRIENDLY_OFFSET / 2; - - memset(__buf2, '\0', (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); - - buf2 = __buf2 + AST_FRIENDLY_OFFSET / 2; - -#if 0 - f.frametype = AST_FRAME_NULL; - f.subclass = 0; - f.samples = 0; - f.datalen = 0; - -#ifdef ASTERISK_VERSION_1_6_1 - f.data.ptr = NULL; -#else - f.data = NULL; -#endif /* ASTERISK_VERSION_1_6_1 */ - f.offset = 0; - f.src = gsmopen_type; - f.mallocd = 0; - f.delivery.tv_sec = 0; - f.delivery.tv_usec = 0; -#endif //0 - - //if ((samples = ReadAudioStream(tech_pvt->stream, buf, SAMPLES_PER_FRAME)) == 0) - //if ((samples = ReadAudioStream(tech_pvt->stream, data, datalen/sizeof(short))) == 0) - if (samples = ReadAudioStream(tech_pvt->stream, (short *)data, datalen, &tech_pvt->timer_read) == 0) { - //do nothing - } else { -#ifdef GIOVA48 - int i=0, a=0; - - samples = samples / 6; - for(i=0; i< samples; i++){ - buf2[i] = buf[a]; - a = a + 6; //mono, 1 chan 48 -> 8 - } - buf = buf2; - -#if 0 - /* A real frame */ - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.samples = GSMOPEN_FRAME_SIZE/6; - f.datalen = GSMOPEN_FRAME_SIZE * 2/6; -#endif //0 -#else// GIOVA48 -#if 0 - /* A real frame */ - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.samples = GSMOPEN_FRAME_SIZE; - f.datalen = GSMOPEN_FRAME_SIZE * 2; -#endif //0 -#endif// GIOVA48 - -#if 0 -#ifdef ASTERISK_VERSION_1_6_1 - f.data.ptr = buf; -#else - f.data = buf; -#endif /* ASTERISK_VERSION_1_6_1 */ - f.offset = AST_FRIENDLY_OFFSET; - f.src = gsmopen_type; - f.mallocd = 0; -#endif //0 - } - -#if 0 - read(tech_pvt->audiopipe[0], &c, 1); - - return &f; -#endif //0 -#endif //0 - - int samples; - samples = ReadAudioStream(tech_pvt->stream, (short *)data, datalen, &tech_pvt->timer_read); - //WARNINGA("samples=%d\n", GSMOPEN_P_LOG, samples); - - return samples; -} -int gsmopen_portaudio_shutdown(private_t *tech_pvt) -{ - PaError err; - - err = CloseAudioStream(tech_pvt->stream); - - if (err != paNoError) - ERRORA("not able to CloseAudioStream\n", GSMOPEN_P_LOG); - - Pa_Terminate(); - return 0; -} - - - - -#endif // GSMOPEN_PORTAUDIO -#ifndef GSMLIBGIO -int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed) -{ - int fd; - int rt; - struct termios tp; - unsigned int status = 0; - unsigned int flags = TIOCM_DTR; - -/* if there is a file descriptor, close it. But it is probably just an old value, so don't check for close success*/ - fd = tech_pvt->controldevfd; - if (fd) { - close(fd); - } -/* open the serial port */ -//#ifdef __CYGWIN__ - fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); - sleep(1); - close(fd); -//#endif /* __CYGWIN__ */ - fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); - if (fd == -1) { - perror("open error "); - DEBUGA_GSMOPEN("serial error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - tech_pvt->controldevfd = fd; + if (tech_pvt->serialPort_serial_control->Open(tech_pvt->controldevice_name, 115200, "8N1", ctb::SerialPort::NoFlowControl) >= 0) { + DEBUGA_GSMOPEN("port %s, SUCCESS open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + } else { + ERRORA("port %s, NOT open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); return -1; } -/* flush it */ - rt = tcflush(fd, TCIFLUSH); - if (rt == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } -/* attributes */ - tp.c_cflag = B0 | CS8 | CLOCAL | CREAD | HUPCL; - tp.c_iflag = IGNPAR; - tp.c_cflag &= ~CRTSCTS; - tp.c_oflag = 0; - tp.c_lflag = 0; - tp.c_cc[VMIN] = 1; - tp.c_cc[VTIME] = 0; -/* set controldevice_speed */ - rt = cfsetispeed(&tp, tech_pvt->controldevice_speed); - if (rt == -1) { - ERRORA("serial error: %s, speed was: %d", GSMOPEN_P_LOG, strerror(errno), tech_pvt->controldevice_speed); - } - rt = cfsetospeed(&tp, tech_pvt->controldevice_speed); - if (rt == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } -/* set port attributes */ - if (tcsetattr(fd, TCSADRAIN, &tp) == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } - rt = tcsetattr(fd, TCSANOW, &tp); - if (rt == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } -#ifndef __CYGWIN__ - ioctl(fd, TIOCMGET, &status); - status |= TIOCM_DTR; /* Set DTR high */ - status &= ~TIOCM_RTS; /* Set RTS low */ - ioctl(fd, TIOCMSET, &status); - ioctl(fd, TIOCMGET, &status); - ioctl(fd, TIOCMBIS, &flags); - flags = TIOCM_RTS; - ioctl(fd, TIOCMBIC, &flags); - ioctl(fd, TIOCMGET, &status); -#else /* __CYGWIN__ */ - ioctl(fd, TIOCMGET, &status); - status |= TIOCM_DTR; /* Set DTR high */ - status &= ~TIOCM_RTS; /* Set RTS low */ - ioctl(fd, TIOCMSET, &status); -#endif /* __CYGWIN__ */ - tech_pvt->controldevfd = fd; - DEBUGA_GSMOPEN("Syncing Serial, fd=%d, protocol=%d\n", GSMOPEN_P_LOG, fd, tech_pvt->controldevprotocol); - rt = gsmopen_serial_sync(tech_pvt); - if (rt == -1) { - ERRORA("Serial init error\n", GSMOPEN_P_LOG); - return -1; - } - return (fd); -} -#else //GSMLIBGIO -#ifdef WIN32 -int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed) -#else -int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed) -#endif //WIN32 -{ - int i; - string ciapa; - SMSMessageRef sms; - char content2[1000]; - int size; -#ifdef WIN32 - Ref port = new Win32SerialPort((string) tech_pvt->controldevice_name, 38400); -#else - //Ref port = new UnixSerialPort((string)argv[1], B38400); - Ref < Port > port = new UnixSerialPort((string) tech_pvt->controldevice_name, B115200); -#endif - MeTa m(port); - - //cout << "Creating GsmAt object" << endl; - Ref gsmat = new GsmAt(m); - - //cout << "Using GsmAt object" << endl; - //cout << gsmat->chat("AT", "OK", false, false) << endl; - //cout << gsmat->chat("D3472665618;") << endl; - gsmat->putLine("AT+cgmm", true); - for (i = 0; i < 4; i++) { - ciapa = gsmat->getLine(); - //cout << "PRESO: |||" << ciapa << "|||" << endl; - NOTICA("PRESO %d |||%s|||\n", GSMOPEN_P_LOG, i, ciapa.c_str()); - //gsmopen_sleep(5000); - } - - sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - -#if 0 - size = MultiByteToWideChar(CP_OEMCP, 0, username, strlen(username)+1, UserName, 0); - UserName=(wchar_t*)GlobalAlloc(GME­ M_ZEROINIT, size); - ret = MultiByteToWideChar(CP_OEMCP, 0, username, strlen(username)+1, UserName, size); - if(ret == 0) - getError(GetLastError()); -#endif //0 - return (-1); + return 0; } -#endif //GSMLIBGIO - - -int gsmopen_serial_read(private_t * tech_pvt) +int gsmopen_serial_read(private_t *tech_pvt) { if (tech_pvt->controldevprotocol == PROTOCOL_AT) return gsmopen_serial_read_AT(tech_pvt, 0, 100000, 0, NULL, 1); // a 10th of a second timeout @@ -564,8 +141,7 @@ int gsmopen_serial_read(private_t * tech_pvt) return -1; } - -int gsmopen_serial_sync(private_t * tech_pvt) +int gsmopen_serial_sync(private_t *tech_pvt) { if (tech_pvt->controldevprotocol == PROTOCOL_AT) return gsmopen_serial_sync_AT(tech_pvt); @@ -581,32 +157,8 @@ int gsmopen_serial_sync(private_t * tech_pvt) return -1; } -int gsmopen_serial_config(private_t * tech_pvt) +int gsmopen_serial_config(private_t *tech_pvt) { -#ifndef NO_GSMLIB - SMSMessageRef sms; - char content2[1000]; - //sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 - sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 - //sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 - //NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - - memset(content2, '\0', sizeof(content2)); - if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { - iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); - } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { - ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, - sizeof(content2)); - } else { - ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - - } - //NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - //NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); -#endif// NO_GSMLIB - if (tech_pvt->controldevprotocol == PROTOCOL_AT) return gsmopen_serial_config_AT(tech_pvt); #ifdef GSMOPEN_FBUS2 @@ -621,7 +173,7 @@ int gsmopen_serial_config(private_t * tech_pvt) return -1; } -int gsmopen_serial_config_AT(private_t * tech_pvt) +int gsmopen_serial_config_AT(private_t *tech_pvt) { int res; char at_command[5]; @@ -636,6 +188,21 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) /* go until first empty preinit string, or last preinit string */ while (1) { + char trash[4096]; + res = tech_pvt->serialPort_serial_control->Read(trash, 4096); + if (res) { + DEBUGA_GSMOPEN("READ %d on serialport init\n", GSMOPEN_P_LOG, res); + } + + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CFUN=1"); + if (res) { + DEBUGA_GSMOPEN("no response to AT+CFUN=1. Continuing\n", GSMOPEN_P_LOG); + } + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT^CURC=0"); + if (res) { + DEBUGA_GSMOPEN("no response to AT^CURC=0. Continuing\n", GSMOPEN_P_LOG); + } + if (strlen(tech_pvt->at_preinit_1)) { res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect); if (res) { @@ -696,6 +263,7 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) ERRORA("no response to AT\n", GSMOPEN_P_LOG); return -1; } + /* for motorola, bring it back to "normal" mode if it happens to be in another mode */ res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+mode=0"); if (res) { @@ -716,6 +284,16 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) DEBUGA_GSMOPEN("ATE0 failed\n", GSMOPEN_P_LOG); } + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CFUN=1"); + if (res) { + DEBUGA_GSMOPEN("no response to AT+CFUN=1. Continuing\n", GSMOPEN_P_LOG); + } + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT^CURC=0"); + if (res) { + DEBUGA_GSMOPEN("no response to AT^CURC=0. Continuing\n", GSMOPEN_P_LOG); + } + + /* disable extended error reporting */ res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMEE=0"); if (res) { @@ -750,7 +328,7 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) DEBUGA_GSMOPEN("AT+CREG=1 failed\n", GSMOPEN_P_LOG); tech_pvt->network_creg_not_supported = 1; } - if(!tech_pvt->network_creg_not_supported){ + if (!tech_pvt->network_creg_not_supported) { res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG?"); if (res) { DEBUGA_GSMOPEN("AT+CREG? failed\n", GSMOPEN_P_LOG); @@ -783,12 +361,38 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) } /* signal incoming SMS with a +CMTI unsolicited msg */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=3,1,0,0,0"); + //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=1,1,0,0,0"); + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=2,1,0,0,0"); if (res) { - DEBUGA_GSMOPEN("AT+CNMI=3,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); + DEBUGA_GSMOPEN("AT+CNMI=2,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); tech_pvt->sms_cnmi_not_supported = 1; tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config } + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPMS=\"ME\",\"ME\",\"ME\""); + if (res) { + DEBUGA_GSMOPEN("no response to AT+CPMS=\"ME\",\"ME\",\"ME\". Continuing\n", GSMOPEN_P_LOG); + } + /* signal incoming SMS with a +CMTI unsolicited msg */ + //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=1,1,0,0,0"); + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=2,1,0,0,0"); + if (res) { + DEBUGA_GSMOPEN("AT+CNMI=2,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); + tech_pvt->sms_cnmi_not_supported = 1; + tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config + } + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPMS=\"ME\",\"ME\",\"ME\""); + if (res) { + DEBUGA_GSMOPEN("no response to AT+CPMS=\"ME\",\"ME\",\"ME\". Continuing\n", GSMOPEN_P_LOG); + } + /* signal incoming SMS with a +CMTI unsolicited msg */ + //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=1,1,0,0,0"); + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=2,1,0,0,0"); + if (res) { + DEBUGA_GSMOPEN("AT+CNMI=2,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); + tech_pvt->sms_cnmi_not_supported = 1; + tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config + } + /* what is the Message Center address (number) to which the SMS has to be sent? */ res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCA?"); if (res) { @@ -799,23 +403,17 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) if (res) { DEBUGA_GSMOPEN("AT+CMGF? failed, continue\n", GSMOPEN_P_LOG); } -#ifdef NO_GSMLIB res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); if (res) { ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); } tech_pvt->sms_pdu_not_supported = 1; -#else // NO_GSMLIB - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); + + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message if (res) { - WARNINGA("Error setting SMS sending mode to PDU on the cellphone, falling back to TEXT mode. Continuing\n", GSMOPEN_P_LOG); - tech_pvt->sms_pdu_not_supported = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); - if (res) { - ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); - } + WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); } -#endif // NO_GSMLIB + /* what is the Charset of SMSs? */ res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS?"); if (res) { @@ -828,7 +426,6 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", GSMOPEN_P_LOG); tech_pvt->no_ucs2 = 1; } - if (tech_pvt->no_ucs2) { res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); if (res) { @@ -839,13 +436,38 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) if (res) { WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); } - } else { + } + + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); + if (res) { + ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); + } + tech_pvt->sms_pdu_not_supported = 0; + tech_pvt->no_ucs2 = 1; +#ifdef NOTDEF //GSMLIB? XXX + if (tech_pvt->no_ucs2) { + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); + if (res) { + WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,16"); //"flash", class 0 sms 7 bit + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,0"); //normal, 7 bit message + if (res) { + WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); + } + } +#endif // NOTDEF //GSMLIB? XXX + +#ifdef NOTDEF //GSMLIB? XXX + + else { //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,20"); //"flash", class 0 sms 16 bit unicode res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message if (res) { WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); } } +#endif // NOTDEF /* is the unsolicited reporting of mobile equipment event supported? */ res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMER=?"); @@ -956,21 +578,21 @@ int gsmopen_serial_config_AT(private_t * tech_pvt) return 0; } - -int gsmopen_serial_sync_AT(private_t * tech_pvt) +int gsmopen_serial_sync_AT(private_t *tech_pvt) { - gsmopen_sleep(10000); /* 10msec */ + gsmopen_sleep(10000); /* 10msec */ time(&tech_pvt->gsmopen_serial_synced_timestamp); return 0; } -int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf) + +int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf) { int select_err = 1; int res; - fd_set read_fds; struct timeval timeout; char tmp_answer[AT_BUFSIZ]; char tmp_answer2[AT_BUFSIZ]; + char tmp_answer3[AT_BUFSIZ]; char *tmp_answer_ptr; char *last_line_ptr; int i = 0; @@ -978,40 +600,63 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u int la_counter = 0; int at_ack = -1; int la_read = 0; + int timeout_in_msec; + int msecs_passed = 0; - if(!running || !tech_pvt->running){ + timeout_in_msec = (timeout_sec * 1000) + (timeout_usec ? (timeout_usec / 1000) : 0); + + if (timeout_in_msec != 100) + DEBUGA_GSMOPEN("TIMEOUT=%d\n", GSMOPEN_P_LOG, timeout_in_msec); + + if (!running || !tech_pvt->running) { return -1; } - FD_ZERO(&read_fds); - FD_SET(tech_pvt->controldevfd, &read_fds); - - //NOTICA (" INSIDE this gsmopen_serial_device %s \n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); tmp_answer_ptr = tmp_answer; memset(tmp_answer, 0, sizeof(char) * AT_BUFSIZ); + memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ); + memset(tmp_answer3, 0, sizeof(char) * AT_BUFSIZ); timeout.tv_sec = timeout_sec; timeout.tv_usec = timeout_usec; PUSHA_UNLOCKA(tech_pvt->controldev_lock); LOKKA(tech_pvt->controldev_lock); - while ((!tech_pvt->controldev_dead) && ((select_err = select(tech_pvt->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0)) { + while ((!tech_pvt->controldev_dead) && msecs_passed <= timeout_in_msec) { char *token_ptr; timeout.tv_sec = timeout_sec; //reset the timeout, linux modify it timeout.tv_usec = timeout_usec; //reset the timeout, linux modify it - read_count = read(tech_pvt->controldevfd, tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer)); + + read: + switch_sleep(20000); + msecs_passed += 20; + + if (timeout_in_msec != 100) { + //ERRORA("TIMEOUT=%d, PASSED=%d\n", GSMOPEN_P_LOG, timeout_in_msec, msecs_passed); + } + //read_count = tech_pvt->serialPort_serial_control->Readv(tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer), (timeout_sec * 1000) + (timeout_usec ? (timeout_usec / 1000) : 0)); + read_count = tech_pvt->serialPort_serial_control->Read(tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer)); + memset(tmp_answer3, 0, sizeof(char) * AT_BUFSIZ); + strcpy(tmp_answer3, tmp_answer_ptr); + + //cicopet read_count = read(tech_pvt->controldevfd, tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer)); if (read_count == 0) { + if (msecs_passed <= timeout_in_msec) { + goto read; + } + } + if (read_count == -1) { ERRORA - ("read 0 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + ("read -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); tech_pvt->controldev_dead = 1; - close(tech_pvt->controldevfd); + //cicopet close(tech_pvt->controldevfd); ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running=0; + tech_pvt->running = 0; alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active=0; - tech_pvt->name[0]='\0'; + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; UNLOCKA(tech_pvt->controldev_lock); if (tech_pvt->owner) { @@ -1022,13 +667,8 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u return -1; } - if (option_debug > 90) { - //DEBUGA_GSMOPEN("1 read %d bytes, --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer_ptr); - //DEBUGA_GSMOPEN("2 read %d bytes, --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer); - } tmp_answer_ptr = tmp_answer_ptr + read_count; - la_counter = 0; memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ); strcpy(tmp_answer2, tmp_answer); @@ -1041,6 +681,7 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); } la_counter++; + while ((token_ptr = strtok(NULL, "\n\r"))) { last_line_ptr = token_ptr; strncpy(tech_pvt->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); @@ -1050,6 +691,15 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); } la_counter++; + + if (la_counter == AT_MESG_MAX_LINES) { + ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, + AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); + WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); + at_ack = AT_ERROR; + break; + } + } } else { last_line_ptr = tmp_answer; @@ -1066,18 +716,32 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u strncpy(tech_pvt->line_array.result[la_counter], last_line_ptr, AT_MESG_MAX_LENGTH); // match expected string -> accept it withtout CRLF la_counter++; - + if (la_counter == AT_MESG_MAX_LINES) { + ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, + AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); + WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); + at_ack = AT_ERROR; + break; + } } /* if the last line read was not a complete line, we'll read the rest in the future */ else if (tmp_answer[strlen(tmp_answer) - 1] != '\r' && tmp_answer[strlen(tmp_answer) - 1] != '\n') la_counter--; /* let's list the complete lines read so far, without re-listing the lines that has yet been listed */ - if (option_debug > 1) { - for (i = la_read; i < la_counter; i++) - DEBUGA_GSMOPEN("Read line %d: |%s|\n", GSMOPEN_P_LOG, i, tech_pvt->line_array.result[i]); + for (i = la_read; i < la_counter; i++) { + DEBUGA_GSMOPEN("Read line %d: |%s| la_counter=%d\n", GSMOPEN_P_LOG, i, tech_pvt->line_array.result[i], la_counter); } + if (la_counter == AT_MESG_MAX_LINES) { + ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, + AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); + WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); + at_ack = AT_ERROR; + break; + } + + /* let's interpret the complete lines read so far (WITHOUT looking for OK, ERROR, and EXPECTED_STRING), without re-interpreting the lines that has been yet interpreted, so we're sure we don't miss anything */ for (i = la_read; i < la_counter; i++) { @@ -1154,7 +818,6 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - for (a = 7; a < strlen(tech_pvt->line_array.result[i]); a++) { if (tech_pvt->line_array.result[i][a] == ',') { commacount++; @@ -1200,11 +863,16 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u tech_pvt->line_array.result[i], tech_pvt->callid_name, tech_pvt->callid_number); } + if ((strcmp(tech_pvt->line_array.result[i], "+CMS ERROR: 500") == 0)) { + ERRORA("Received: \"%s\", generic error, maybe this account ran OUT OF CREDIT?\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else if ((strncmp(tech_pvt->line_array.result[i], "+CMS ERROR:", 11) == 0)) { + ERRORA("Received: \"%s\", what was this error about?\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } if ((strcmp(tech_pvt->line_array.result[i], "BUSY") == 0)) { tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY; if (option_debug > 1) DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_LINEBUSY\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - //if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) { + //if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) { //ast_setstate(tech_pvt->owner, GSMOPEN_STATE_BUSY); //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_BUSY); @@ -1313,18 +981,18 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u if (err < 2) { ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } else { - if (signal_quality < 11 || signal_quality == 99) { + if (signal_quality < 9 || signal_quality == 99) { ERRORA ("|%s| CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->got_signal=0; - alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna"); - } else if (signal_quality < 15) { + tech_pvt->got_signal = 0; + alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna"); + } else if (signal_quality < 11) { WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->got_signal=1; - alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "CELLPHONE GETS SIGNAL LOW"); + tech_pvt->got_signal = 1; + alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "CELLPHONE GETS SIGNAL LOW"); } else { - tech_pvt->got_signal=2; + tech_pvt->got_signal = 2; } } @@ -1339,27 +1007,29 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u if (option_debug > 1) DEBUGA_GSMOPEN("|%s| +CREG: Display: %d, Registration=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], n, stat); if (err < 2) { - WARNINGA("|%s| is not formatted as: |+CREG: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - if (stat==0) { - ERRORA - ("|%s| CELLPHONE is not registered to network, consider to move it or additional antenna\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered=1; - tech_pvt->home_network_registered=0; - tech_pvt->roaming_registered=0; - alarm_event(tech_pvt, ALARM_NO_NETWORK_REGISTRATION, "CELLPHONE is not registered to network, consider to move it or additional antenna"); - } else if (stat==1) { - DEBUGA_GSMOPEN("|%s| CELLPHONE is registered to the HOME network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered=0; - tech_pvt->home_network_registered=1; - tech_pvt->roaming_registered=0; - }else { - ERRORA("|%s| CELLPHONE is registered to a ROAMING network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered=0; - tech_pvt->home_network_registered=0; - tech_pvt->roaming_registered=1; - alarm_event(tech_pvt, ALARM_ROAMING_NETWORK_REGISTRATION, "CELLPHONE is registered to a ROAMING network"); + DEBUGA_GSMOPEN("|%s| is not formatted as: |+CREG: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + } else { + if (stat == 0) { + ERRORA + ("|%s| CELLPHONE is not registered to network, consider to move it or additional antenna\n", + GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->not_registered = 1; + tech_pvt->home_network_registered = 0; + tech_pvt->roaming_registered = 0; + alarm_event(tech_pvt, ALARM_NO_NETWORK_REGISTRATION, + "CELLPHONE is not registered to network, consider to move it or additional antenna"); + } else if (stat == 1) { + DEBUGA_GSMOPEN("|%s| CELLPHONE is registered to the HOME network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->not_registered = 0; + tech_pvt->home_network_registered = 1; + tech_pvt->roaming_registered = 0; + } else { + ERRORA("|%s| CELLPHONE is registered to a ROAMING network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + tech_pvt->not_registered = 0; + tech_pvt->home_network_registered = 0; + tech_pvt->roaming_registered = 1; + alarm_event(tech_pvt, ALARM_ROAMING_NETWORK_REGISTRATION, "CELLPHONE is registered to a ROAMING network"); + } } } @@ -1375,6 +1045,41 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u } + if ((strncmp(tech_pvt->line_array.result[i], "^CEND:1", 7) == 0)) { + tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { + //cicopet + switch_core_session_t *session = NULL; + switch_channel_t *channel = NULL; + + tech_pvt->interface_state = GSMOPEN_STATE_DOWN; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if (session) { + channel = switch_core_session_get_channel(session); + //gsmopen_hangup(tech_pvt); + switch_core_session_rwunlock(session); + switch_channel_hangup(channel, SWITCH_CAUSE_NONE); + } + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + DEBUGA_GSMOPEN("just received a remote HANGUP\n", GSMOPEN_P_LOG); + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + DEBUGA_GSMOPEN("just sent GSMOPEN_CONTROL_HANGUP\n", GSMOPEN_P_LOG); + } + // + //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } else { + ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); + } + } + /* at_call_* are unsolicited messages sent by the modem to signal us about call processing activity and events */ if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_idle) == 0)) { tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; @@ -1411,16 +1116,6 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); } - - - - - - - - - - } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_incoming) == 0)) { @@ -1454,9 +1149,9 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u DEBUGA_PBX("just sent GSMOPEN_CONTROL_ANSWER\n", GSMOPEN_P_LOG); } } else { + tech_pvt->interface_state = GSMOPEN_STATE_UP; + DEBUGA_PBX("just interface_state UP\n", GSMOPEN_P_LOG); } - //tech_pvt->interface_state = GSMOPEN_STATE_UP; - //DEBUGA_PBX("just interface_state UP\n", GSMOPEN_P_LOG); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_calling) == 0)) { @@ -1513,7 +1208,7 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u memset(at_command, 0, sizeof(at_command)); sprintf(at_command, "AT+CMGR=%d", tech_pvt->unread_sms_msg_id); - //memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); + memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); tech_pvt->reading_sms_msg = 1; res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); @@ -1521,10 +1216,12 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u if (res) { ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); +/* + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"CIAPALO1\""); if (res) { - ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); + ERRORA("AT+CSCS=\"CIAPALO1\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); } +*/ memset(at_command, 0, sizeof(at_command)); sprintf(at_command, "AT+CMGD=%d", tech_pvt->unread_sms_msg_id); /* delete the message */ tech_pvt->unread_sms_msg_id = 0; @@ -1535,62 +1232,13 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u res = sms_incoming(tech_pvt); -#if 0 - if (strlen(tech_pvt->sms_message)) { - //FIXME manager_event(EVENT_FLAG_SYSTEM, "GSMOPENincomingsms", - //FIXME "Interface: %s\r\nSMS_Message: %s\r\n", tech_pvt->name, - //FIXME tech_pvt->sms_message); - - res = sms_incoming(tech_pvt, tech_pvt->sms_message); - - if (strlen(tech_pvt->sms_receiving_program)) { - int fd1[2]; - pid_t pid1; - char *arg1[] = { tech_pvt->sms_receiving_program, (char *) NULL }; - int i; - - DEBUGA_GSMOPEN("incoming SMS message:>>>%s<<<\n", GSMOPEN_P_LOG, tech_pvt->sms_message); - res = pipe(fd1); - pid1 = fork(); - - if (pid1 == 0) { //child - int err; - - dup2(fd1[0], 0); // Connect stdin to pipe output - close(fd1[1]); // close input pipe side - close(tech_pvt->controldevfd); - setsid(); //session id - err = execvp(arg1[0], arg1); //exec our program, with stdin connected to pipe output - if (err) { - ERRORA - ("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n", - GSMOPEN_P_LOG, tech_pvt->sms_receiving_program, err, strerror(errno), tech_pvt->sms_message); - } - close(fd1[0]); // close output pipe side - } -//starting here continue the parent - close(fd1[0]); // close output pipe side - // write the msg on the pipe input - for (i = 0; i < strlen(tech_pvt->sms_message); i++) { - res = write(fd1[1], &tech_pvt->sms_message[i], 1); - } - close(fd1[1]); // close pipe input, let our program know we've finished - } else { - ERRORA - ("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n", - GSMOPEN_P_LOG, tech_pvt->sms_message); - } - } -#endif //0 -#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself if (tech_pvt->phone_callflow == CALLFLOW_CALL_IDLE && tech_pvt->interface_state == GSMOPEN_STATE_DOWN && tech_pvt->owner == NULL) { /* we're not in a call, neither calling */ res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\""); if (res) { - ERRORA("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", GSMOPEN_P_LOG); + DEBUGA_GSMOPEN("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", GSMOPEN_P_LOG); } } -#endif } //unread_msg_id } //CMTI well formatted @@ -1640,7 +1288,6 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u tech_pvt->reading_sms_msg++; } - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 17") == 0)) { /* motorola call processing unsolicited messages */ tech_pvt->phone_callflow = CALLFLOW_CALL_INFLUX; if (option_debug > 1) @@ -1873,51 +1520,51 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u /* at_indicator_* are unsolicited messages sent by the phone to signal us that some of its visual indicators on its screen has changed, based on CIND CMER ETSI docs */ if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_noservice_string) == 0)) { - ERRORA("|%s| at_indicator_noservice_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_NO_SERVICE, "at_indicator_noservice_string"); + ERRORA("|%s| at_indicator_noservice_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + alarm_event(tech_pvt, ALARM_NETWORK_NO_SERVICE, "at_indicator_noservice_string"); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nosignal_string) == 0)) { - ERRORA("|%s| at_indicator_nosignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "at_indicator_nosignal_string"); + ERRORA("|%s| at_indicator_nosignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "at_indicator_nosignal_string"); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowsignal_string) == 0)) { - WARNINGA("|%s| at_indicator_lowsignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "at_indicator_lowsignal_string"); + WARNINGA("|%s| at_indicator_lowsignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "at_indicator_lowsignal_string"); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowbattchg_string) == 0)) { - WARNINGA("|%s| at_indicator_lowbattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + WARNINGA("|%s| at_indicator_lowbattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nobattchg_string) == 0)) { - ERRORA("|%s| at_indicator_nobattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + ERRORA("|%s| at_indicator_nobattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callactive_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + DEBUGA_GSMOPEN("|%s| at_indicator_callactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallactive_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_nocallactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + DEBUGA_GSMOPEN("|%s| at_indicator_nocallactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallsetup_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_nocallsetup_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + DEBUGA_GSMOPEN("|%s| at_indicator_nocallsetup_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupincoming_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupincoming_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + DEBUGA_GSMOPEN("|%s| at_indicator_callsetupincoming_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupoutgoing_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupoutgoing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + DEBUGA_GSMOPEN("|%s| at_indicator_callsetupoutgoing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupremoteringing_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupremoteringing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + DEBUGA_GSMOPEN("|%s| at_indicator_callsetupremoteringing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); } } @@ -1957,6 +1604,8 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u strncpy(tech_pvt->imsi, tech_pvt->line_array.result[i], sizeof(tech_pvt->imsi)); } } + + /* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */ if (tech_pvt->reading_sms_msg > 1 && at_ack == -1) { int c; @@ -1965,7 +1614,6 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u memset(sms_body, '\0', sizeof(sms_body)); if (strncmp(tech_pvt->line_array.result[i], "+CMGR", 5) == 0) { /* we are reading the "header" of an SMS */ -#if 1 char content[512]; char content2[512]; int inside_comma = 0; @@ -1977,36 +1625,29 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u memset(content, '\0', sizeof(content)); - for (c = 0; c < strlen(tech_pvt->line_array.result[i]); c++) { if (tech_pvt->line_array.result[i][c] == ',' && tech_pvt->line_array.result[i][c - 1] != '\\' && inside_quote == 0) { if (inside_comma) { inside_comma = 0; DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); + &tech_pvt->line_array.result[i][c]); } else { inside_comma = 1; DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); + &tech_pvt->line_array.result[i][c]); } } if (tech_pvt->line_array.result[i][c] == '"' && tech_pvt->line_array.result[i][c - 1] != '\\') { if (inside_quote) { inside_quote = 0; DEBUGA_GSMOPEN("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); + &tech_pvt->line_array.result[i][c]); DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content); - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, content, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - memset(content2, '\0', sizeof(content2)); if (which_field == 1) { //FIXME why this? err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); - //err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); - err = 0; - strncpy(content2, content, sizeof(content2)); + err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); } else { err = 0; strncpy(content2, content, sizeof(content2)); @@ -2014,10 +1655,6 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u DEBUGA_GSMOPEN("%d content2=%s\n", GSMOPEN_P_LOG, which_field, content2); DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //if (!err) - //strncat(tech_pvt->sms_message, content2, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); memset(content, '\0', sizeof(content)); d = 0; if (which_field == 1) { @@ -2034,7 +1671,7 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u } else { inside_quote = 1; DEBUGA_GSMOPEN("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); + &tech_pvt->line_array.result[i][c]); } } if (inside_quote && tech_pvt->line_array.result[i][c] != '"') { @@ -2045,7 +1682,6 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u } } -#endif //0 } //it was the +CMGR answer from the cellphone else { DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); @@ -2054,86 +1690,76 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u char content3[1000]; strncpy(tech_pvt->sms_message, tech_pvt->line_array.result[i], sizeof(tech_pvt->sms_message)); - //int howmanyleft; - + memset(content3, '\0', sizeof(content3)); DEBUGA_GSMOPEN("sms_message=%s\n", GSMOPEN_P_LOG, tech_pvt->sms_message); ucs2_to_utf8(tech_pvt, tech_pvt->sms_message, content3, sizeof(content3)); DEBUGA_GSMOPEN("content3=%s\n", GSMOPEN_P_LOG, content3); strncpy(tech_pvt->sms_body, content3, sizeof(tech_pvt->sms_body)); - //sleep(10); - //cicopet if (tech_pvt->sms_cnmi_not_supported) { sms_incoming(tech_pvt); DEBUGA_GSMOPEN("2 content3=%s\n", GSMOPEN_P_LOG, content3); } } else { -#ifndef NO_GSMLIB - char content2[1000]; - SMSMessageRef sms; -//MessageType messagetype; -//Address servicecentreaddress; -//Timestamp servicecentretimestamp; -//Address sender_recipient_address; - sms = SMSMessage::decode(tech_pvt->line_array.result[i]); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 - DEBUGA_GSMOPEN("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + try { + char content2[1000]; + SMSMessageRef sms; + //MessageType messagetype; + //Address servicecentreaddress; + //Timestamp servicecentretimestamp; + //Address sender_recipient_address; - memset(content2, '\0', sizeof(content2)); - if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { - iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); - } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { - ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, - sizeof(content2)); - } else { - ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + sms = SMSMessage::decode(tech_pvt->line_array.result[i]); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 + + DEBUGA_GSMOPEN("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); + + memset(content2, '\0', sizeof(content2)); + if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { + iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); + } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { + ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), + content2, sizeof(content2)); + } else { + ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + + } + DEBUGA_GSMOPEN("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); + DEBUGA_GSMOPEN("dataCodingScheme=%s\n", GSMOPEN_P_LOG, sms->dataCodingScheme().toString().c_str()); + DEBUGA_GSMOPEN("address=%s\n", GSMOPEN_P_LOG, sms->address().toString().c_str()); + DEBUGA_GSMOPEN("serviceCentreAddress=%s\n", GSMOPEN_P_LOG, sms->serviceCentreAddress().toString().c_str()); + DEBUGA_GSMOPEN("serviceCentreTimestamp=%s\n", GSMOPEN_P_LOG, sms->serviceCentreTimestamp().toString().c_str()); + DEBUGA_GSMOPEN("messageType=%d\n", GSMOPEN_P_LOG, sms->messageType()); + DEBUGA_GSMOPEN("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); + + + memset(sms_body, '\0', sizeof(sms_body)); + strncpy(sms_body, content2, sizeof(sms_body)); + DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); + strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); + strncpy(tech_pvt->sms_sender, sms->address().toString().c_str(), sizeof(tech_pvt->sms_sender)); + strncpy(tech_pvt->sms_date, sms->serviceCentreTimestamp().toString().c_str(), sizeof(tech_pvt->sms_date)); + strncpy(tech_pvt->sms_datacodingscheme, sms->dataCodingScheme().toString().c_str(), sizeof(tech_pvt->sms_datacodingscheme)); + strncpy(tech_pvt->sms_servicecentreaddress, sms->serviceCentreAddress().toString().c_str(), + sizeof(tech_pvt->sms_servicecentreaddress)); + tech_pvt->sms_messagetype = sms->messageType(); + //messagetype = sms->messageType(); + //servicecentreaddress = sms->serviceCentreAddress(); + //servicecentretimestamp = sms->serviceCentreTimestamp(); + //sender_recipient_address = sms->address(); } - DEBUGA_GSMOPEN("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - DEBUGA_GSMOPEN("dataCodingScheme=%s\n", GSMOPEN_P_LOG, sms->dataCodingScheme().toString().c_str()); - DEBUGA_GSMOPEN("address=%s\n", GSMOPEN_P_LOG, sms->address().toString().c_str()); - DEBUGA_GSMOPEN("serviceCentreAddress=%s\n", GSMOPEN_P_LOG, sms->serviceCentreAddress().toString().c_str()); - DEBUGA_GSMOPEN("serviceCentreTimestamp=%s\n", GSMOPEN_P_LOG, sms->serviceCentreTimestamp().toString().c_str()); - DEBUGA_GSMOPEN("messageType=%d\n", GSMOPEN_P_LOG, sms->messageType()); - DEBUGA_GSMOPEN("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); + catch(GsmException & ge) { + ERRORA("GsmException= |||%s|||\n", GSMOPEN_P_LOG, ge.what()); + } + + - memset(sms_body, '\0', sizeof(sms_body)); - strncpy(sms_body, content2, sizeof(sms_body)); - DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); - strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); - strncpy(tech_pvt->sms_sender, sms->address().toString().c_str(), sizeof(tech_pvt->sms_sender)); - strncpy(tech_pvt->sms_date, sms->serviceCentreTimestamp().toString().c_str(), sizeof(tech_pvt->sms_date)); - strncpy(tech_pvt->sms_datacodingscheme, sms->dataCodingScheme().toString().c_str(), sizeof(tech_pvt->sms_datacodingscheme)); - strncpy(tech_pvt->sms_servicecentreaddress, sms->serviceCentreAddress().toString().c_str(), - sizeof(tech_pvt->sms_servicecentreaddress)); - tech_pvt->sms_messagetype = sms->messageType(); -//messagetype = sms->messageType(); -//servicecentreaddress = sms->serviceCentreAddress(); -//servicecentretimestamp = sms->serviceCentreTimestamp(); -//sender_recipient_address = sms->address(); -#endif// NO_GSMLIB } -#if 0 - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, tech_pvt->line_array.result[i], ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - - memset(sms_body, '\0', sizeof(sms_body)); - err = ucs2_to_utf8(tech_pvt, tech_pvt->line_array.result[i], sms_body, sizeof(sms_body)); - DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); - strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); - - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //if (!err) - //strncat(tech_pvt->sms_message, sms_body, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - - //DEBUGA_GSMOPEN("sms_message=%s\n", GSMOPEN_P_LOG, tech_pvt->sms_message); -#endif //0 } //it was the UCS2 from cellphone } //we were reading the SMS @@ -2145,11 +1771,14 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u if (look_for_ack && at_ack > -1) break; - if (la_counter > AT_MESG_MAX_LINES) { - ERRORA("Too many lines in result (>%d). Stopping reader.\n", GSMOPEN_P_LOG, AT_MESG_MAX_LINES); + if (la_counter == AT_MESG_MAX_LINES) { + ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, + AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); + WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); at_ack = AT_ERROR; break; } + } UNLOCKA(tech_pvt->controldev_lock); @@ -2157,15 +1786,14 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u if (select_err == -1) { ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name, strerror(errno)); tech_pvt->controldev_dead = 1; - close(tech_pvt->controldevfd); - tech_pvt->running=0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "select returned -1 on interface, setting controldev_dead"); - tech_pvt->active=0; - tech_pvt->name[0]='\0'; + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "select returned -1 on interface, setting controldev_dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; if (tech_pvt->owner) gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - switch_sleep(1000000); + switch_sleep(1000000); return -1; } @@ -2228,48 +1856,78 @@ int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_u return 0; } -int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data) +//cicopet int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data) +int gsmopen_serial_write_AT(private_t *tech_pvt, const char *data) { int howmany; int i; int res; int count; + char *Data = (char *) data; - howmany = strlen(data); + howmany = strlen(Data); for (i = 0; i < howmany; i++) { - res = write(tech_pvt->controldevfd, &data[i], 1); + //cicopetres = write(tech_pvt->controldevfd, &data[i], 1); + res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); if (res != 1) { - DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &data[i], res, strerror(errno)); + DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &Data[i], res, strerror(errno)); gsmopen_sleep(100000); for (count = 0; count < 10; count++) { - res = write(tech_pvt->controldevfd, &data[i], 1); + //cicopet res = write(tech_pvt->controldevfd, &data[i], 1); + res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); if (res == 1) { - DEBUGA_GSMOPEN("Successfully RE-sent (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + DEBUGA_GSMOPEN("Successfully RE-sent (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); break; } else - DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); gsmopen_sleep(100000); } if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); + + + + ERRORA + ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + //cicopet close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + + + + return -1; } } if (option_debug > 1) - DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &data[i]); - gsmopen_sleep(1000); /* release the cpu */ + DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &Data[i]); + gsmopen_sleep(1000); /* release the cpu */ } - res = write(tech_pvt->controldevfd, "\r", 1); + //cicopet res = write(tech_pvt->controldevfd, "\r", 1); + res = tech_pvt->serialPort_serial_control->Write((char *) "\r", 1); if (res != 1) { DEBUGA_GSMOPEN("Error sending (carriage return): %d (%s)\n", GSMOPEN_P_LOG, res, strerror(errno)); gsmopen_sleep(100000); for (count = 0; count < 10; count++) { - res = write(tech_pvt->controldevfd, "\r", 1); + //cicopet res = write(tech_pvt->controldevfd, "\r", 1); + res = tech_pvt->serialPort_serial_control->Write((char *) "\r", 1); if (res == 1) { DEBUGA_GSMOPEN("Successfully RE-sent carriage return: %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); @@ -2281,56 +1939,99 @@ int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data) } if (res != 1) { ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); + + ERRORA + ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + //cicopet close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + + return -1; } } if (option_debug > 1) DEBUGA_GSMOPEN("sent (carriage return)\n", GSMOPEN_P_LOG); - gsmopen_sleep(1000); /* release the cpu */ + gsmopen_sleep(1000); /* release the cpu */ return howmany; } -int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data) +int gsmopen_serial_write_AT_nocr(private_t *tech_pvt, const char *data) { int howmany; int i; int res; int count; + char *Data = (char *) data; - howmany = strlen(data); + howmany = strlen(Data); for (i = 0; i < howmany; i++) { - res = write(tech_pvt->controldevfd, &data[i], 1); + //cicopet res = write(tech_pvt->controldevfd, &data[i], 1); + res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); if (res != 1) { - DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &data[i], res, strerror(errno)); + DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &Data[i], res, strerror(errno)); gsmopen_sleep(100000); for (count = 0; count < 10; count++) { - res = write(tech_pvt->controldevfd, &data[i], 1); + //cicopet res = write(tech_pvt->controldevfd, &data[i], 1); + res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); if (res == 1) break; else - DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); gsmopen_sleep(100000); } if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); + ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); + + ERRORA + ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + //cicopet close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + + return -1; } } if (option_debug > 1) - DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &data[i]); - gsmopen_sleep(1000); /* release the cpu */ + DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &Data[i]); + gsmopen_sleep(1000); /* release the cpu */ } - gsmopen_sleep(1000); /* release the cpu */ + gsmopen_sleep(1000); /* release the cpu */ return howmany; } -int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data) +int gsmopen_serial_write_AT_noack(private_t *tech_pvt, const char *data) { if (option_debug > 1) @@ -2342,6 +2043,26 @@ int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data) ERRORA("Error sending data... (%s)\n", GSMOPEN_P_LOG, strerror(errno)); UNLOCKA(tech_pvt->controldev_lock); + + ERRORA + ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + //cicopet close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + + return -1; } UNLOCKA(tech_pvt->controldev_lock); @@ -2350,7 +2071,7 @@ int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data) return 0; } -int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data) +int gsmopen_serial_write_AT_ack(private_t *tech_pvt, const char *data) { int at_result = AT_ERROR; @@ -2361,10 +2082,30 @@ int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data) if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); UNLOCKA(tech_pvt->controldev_lock); + + ERRORA + ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + //cicopet close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + + return -1; } - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 2, NULL, 1); // 2.5 sec timeout + //cicopet at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 2, NULL, 1); // 2.5 sec timeout + at_result = gsmopen_serial_read_AT(tech_pvt, 1, 100000, 0, NULL, 1); // 1/10th sec timeout UNLOCKA(tech_pvt->controldev_lock); POPPA_UNLOCKA(tech_pvt->controldev_lock); @@ -2372,7 +2113,7 @@ int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data) } -int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data) +int gsmopen_serial_write_AT_ack_nocr_longtime(private_t *tech_pvt, const char *data) { int at_result = AT_ERROR; @@ -2383,6 +2124,26 @@ int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char * if (gsmopen_serial_write_AT_nocr(tech_pvt, data) != strlen(data)) { ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); UNLOCKA(tech_pvt->controldev_lock); + + ERRORA + ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + //cicopet close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + + return -1; } @@ -2394,7 +2155,7 @@ int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char * } -int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds) +int gsmopen_serial_write_AT_expect1(private_t *tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds) { int at_result = AT_ERROR; @@ -2405,10 +2166,30 @@ int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, cons if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); UNLOCKA(tech_pvt->controldev_lock); + + ERRORA + ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", + GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->controldev_dead = 1; + //cicopet close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + + UNLOCKA(tech_pvt->controldev_lock); + if (tech_pvt->owner) { + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + } + switch_sleep(1000000); + + return -1; } - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs + at_result = gsmopen_serial_read_AT(tech_pvt, 1, 100000, seconds, expected_string, expect_crlf); // minimum 1/10th sec timeout UNLOCKA(tech_pvt->controldev_lock); POPPA_UNLOCKA(tech_pvt->controldev_lock); @@ -2416,7 +2197,7 @@ int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, cons } -int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds) +int gsmopen_serial_AT_expect(private_t *tech_pvt, const char *expected_string, int expect_crlf, int seconds) { int at_result = AT_ERROR; @@ -2425,7 +2206,8 @@ int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, if (option_debug > 1) DEBUGA_GSMOPEN("expecting: %s\n", GSMOPEN_P_LOG, expected_string); - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs + //cicopet at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs + at_result = gsmopen_serial_read_AT(tech_pvt, 1, 100000, seconds, expected_string, expect_crlf); // minimum 1/10th sec timeout UNLOCKA(tech_pvt->controldev_lock); POPPA_UNLOCKA(tech_pvt->controldev_lock); @@ -2433,7 +2215,7 @@ int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, } -int gsmopen_serial_answer(private_t * tech_pvt) +int gsmopen_serial_answer(private_t *tech_pvt) { if (tech_pvt->controldevprotocol == PROTOCOL_AT) return gsmopen_serial_answer_AT(tech_pvt); @@ -2448,8 +2230,7 @@ int gsmopen_serial_answer(private_t * tech_pvt) return -1; } - -int gsmopen_serial_answer_AT(private_t * tech_pvt) +int gsmopen_serial_answer_AT(private_t *tech_pvt) { int res; @@ -2465,13 +2246,14 @@ int gsmopen_serial_answer_AT(private_t * tech_pvt) return -1; } } + res = gsmopen_serial_write_AT_expect(tech_pvt, "AT^DDSETEX=2", tech_pvt->at_dial_expect); //tech_pvt->interface_state = GSMOPEN_STATE_UP; //tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; DEBUGA_GSMOPEN("AT: call answered\n", GSMOPEN_P_LOG); return 0; } -int gsmopen_serial_hangup(private_t * tech_pvt) +int gsmopen_serial_hangup(private_t *tech_pvt) { if (tech_pvt->controldevprotocol == PROTOCOL_AT) return gsmopen_serial_hangup_AT(tech_pvt); @@ -2486,8 +2268,7 @@ int gsmopen_serial_hangup(private_t * tech_pvt) return -1; } - -int gsmopen_serial_hangup_AT(private_t * tech_pvt) +int gsmopen_serial_hangup_AT(private_t *tech_pvt) { int res; @@ -2500,15 +2281,22 @@ int gsmopen_serial_hangup_AT(private_t * tech_pvt) ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n", GSMOPEN_P_LOG); return -1; } + } + + res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CHUP"); + if (res) { + DEBUGA_GSMOPEN("at_hangup command timeout, command used: 'AT+CHUP'\n", GSMOPEN_P_LOG); + //return -1; + } + } tech_pvt->interface_state = GSMOPEN_STATE_DOWN; tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; return 0; } - -int gsmopen_serial_call(private_t * tech_pvt, char *dstr) +int gsmopen_serial_call(private_t *tech_pvt, char *dstr) { if (tech_pvt->controldevprotocol == PROTOCOL_AT) return gsmopen_serial_call_AT(tech_pvt, dstr); @@ -2525,7 +2313,7 @@ int gsmopen_serial_call(private_t * tech_pvt, char *dstr) return -1; } -int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr) +int gsmopen_serial_call_AT(private_t *tech_pvt, char *dstr) { int res; char at_command[256]; @@ -2552,6 +2340,7 @@ int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr) ERRORA("dial command failed, dial string was: %s\n", GSMOPEN_P_LOG, at_command); return -1; } + res = gsmopen_serial_write_AT_expect(tech_pvt, "AT^DDSETEX=2", tech_pvt->at_dial_expect); // jet - early audio //if (tech_pvt->at_early_audio) { //ast_queue_control(tech_pvt->owner, AST_CONTROL_ANSWER); @@ -2560,10 +2349,10 @@ int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr) return 0; } -int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft) +int ucs2_to_utf8(private_t *tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft) { char converted[16000]; -#ifndef WIN32 +//#ifndef WIN32 iconv_t iconv_format; int iconv_res; char *outbuf; @@ -2576,7 +2365,7 @@ int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t out memset(converted, '\0', sizeof(converted)); - DEBUGA_GSMOPEN("ucs2_in=%s\n", GSMOPEN_P_LOG, ucs2_in); + DEBUGA_GSMOPEN("ucs2_in=|%s|, utf8_out=|%s|\n", GSMOPEN_P_LOG, ucs2_in, utf8_out); /* cicopet */ for (c = 0; c < strlen(ucs2_in); c++) { sprintf(stringa, "0x%c%c", ucs2_in[c], ucs2_in[c + 1]); @@ -2590,7 +2379,8 @@ int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t out inbuf = converted; iconv_format = iconv_open("UTF8", "UCS-2BE"); - if (iconv_format == (iconv_t) - 1) { + //iconv_format = iconv_open("UTF8", "UCS2"); + if (iconv_format == (iconv_t) -1) { ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); return -1; } @@ -2599,7 +2389,11 @@ int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t out DEBUGA_GSMOPEN("1 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); +#ifdef WIN32 + iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#else // WIN32 iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#endif // WIN32 if (iconv_res == (size_t) -1) { DEBUGA_GSMOPEN("2 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); @@ -2612,14 +2406,64 @@ int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t out GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); iconv_close(iconv_format); -#endif //WIN32 +//#endif //WIN32 return 0; } -int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft) +int utf8_to_iso_8859_1(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *iso_8859_1_out, size_t outbytesleft) { - char converted[16000]; -#ifndef WIN32 + /* cicopet */ +//#ifndef WIN32 + iconv_t iconv_format; + int iconv_res; + char *outbuf; + char *inbuf; + + outbuf = iso_8859_1_out; + inbuf = utf8_in; + + iconv_format = iconv_open("ISO_8859-1", "UTF8"); + if (iconv_format == (iconv_t) -1) { + ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); + return -1; + } + outbytesleft = strlen(utf8_in) * 2; + + DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, iso_8859_1_out=%s\n", + GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, iso_8859_1_out); +#ifdef WIN32 + iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#else // WIN32 + iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#endif // WIN32 + if (iconv_res == (size_t) -1) { + DEBUGA_GSMOPEN("cannot translate in iso_8859_1 error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); + return -1; + } + DEBUGA_GSMOPEN + ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, iso_8859_1_out=%s\n", + GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, iso_8859_1_out); + iconv_close(iconv_format); +#if 0 + for (i = 0; i < 16000 - outbytesleft; i++) { + memset(stringa, '\0', sizeof(stringa)); + memset(stringa2, '\0', sizeof(stringa2)); + sprintf(stringa, "%02X", converted[i]); + DEBUGA_GSMOPEN("character is |%02X|\n", GSMOPEN_P_LOG, converted[i]); + stringa2[0] = stringa[strlen(stringa) - 2]; + stringa2[1] = stringa[strlen(stringa) - 1]; + strncat(iso_8859_1_out, stringa2, ((outbytesleft - strlen(iso_8859_1_out)) - 1)); //add the received line to the buffer + DEBUGA_GSMOPEN("stringa=%s, stringa2=%s, iso_8859_1_out=%s\n", GSMOPEN_P_LOG, stringa, stringa2, iso_8859_1_out); + } +#endif //0 +//#endif //WIN32 + return 0; +} + + +int iso_8859_1_to_utf8(private_t *tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft) +{ +//#ifndef WIN32 iconv_t iconv_format; int iconv_res; char *outbuf; @@ -2630,22 +2474,23 @@ int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out //double hexnum; //int i = 0; - memset(converted, '\0', sizeof(converted)); - DEBUGA_GSMOPEN("iso_8859_1_in=%s\n", GSMOPEN_P_LOG, iso_8859_1_in); outbuf = utf8_out; inbuf = iso_8859_1_in; iconv_format = iconv_open("UTF8", "ISO_8859-1"); - if (iconv_format == (iconv_t) - 1) { + if (iconv_format == (iconv_t) -1) { ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); return -1; } - inbytesleft = strlen(iso_8859_1_in) * 2; +#ifdef WIN32 + iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#else // WIN32 iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#endif // WIN32 if (iconv_res == (size_t) -1) { DEBUGA_GSMOPEN("ciao in=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); @@ -2656,19 +2501,16 @@ int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out (" strlen(iso_8859_1_in)=%d, iconv_res=%d, inbuf=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", GSMOPEN_P_LOG, (int) strlen(iso_8859_1_in), iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); - - iconv_close(iconv_format); -#endif //WIN32 +//#endif //WIN32 return 0; } - -int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft) +int utf8_to_ucs2(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft) { /* cicopet */ -#ifndef WIN32 +//#ifndef WIN32 iconv_t iconv_format; int iconv_res; char *outbuf; @@ -2681,25 +2523,29 @@ int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *uc memset(converted, '\0', sizeof(converted)); outbuf = converted; - inbuf = utf_in; + inbuf = utf8_in; iconv_format = iconv_open("UCS-2BE", "UTF8"); - if (iconv_format == (iconv_t) - 1) { + if (iconv_format == (iconv_t) -1) { ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); return -1; } outbytesleft = 16000; - DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted); + DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, converted=%s\n", + GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, converted); +#ifdef WIN32 + iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#else // WIN32 iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#endif // WIN32 if (iconv_res == (size_t) -1) { ERRORA("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); return -1; } DEBUGA_GSMOPEN - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", - GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted); + ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, converted=%s\n", + GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, converted); iconv_close(iconv_format); for (i = 0; i < 16000 - outbytesleft; i++) { @@ -2712,14 +2558,13 @@ int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *uc strncat(ucs2_out, stringa2, ((outbytesleft - strlen(ucs2_out)) - 1)); //add the received line to the buffer DEBUGA_GSMOPEN("stringa=%s, stringa2=%s, ucs2_out=%s\n", GSMOPEN_P_LOG, stringa, stringa2, ucs2_out); } -#endif //WIN32 +//#endif //WIN32 return 0; } - /*! \brief Answer incoming call, * Part of PBX interface */ -int gsmopen_answer(private_t * tech_pvt) +int gsmopen_answer(private_t *tech_pvt) { int res; @@ -2740,7 +2585,7 @@ int gsmopen_answer(private_t * tech_pvt) tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; while (tech_pvt->interface_state == GSMOPEN_STATE_RING) { - gsmopen_sleep(10000); //10msec + gsmopen_sleep(10000); //10msec } if (tech_pvt->interface_state != GSMOPEN_STATE_UP) { ERRORA("call answering failed\n", GSMOPEN_P_LOG); @@ -2749,11 +2594,7 @@ int gsmopen_answer(private_t * tech_pvt) if (option_debug) DEBUGA_PBX("call answered\n", GSMOPEN_P_LOG); res = 0; -#ifdef GSMOPEN_PORTAUDIO - //speex_echo_state_reset(tech_pvt->stream->echo_state); -#endif // GSMOPEN_PORTAUDIO - new_inbound_channel(tech_pvt); if (tech_pvt->owner) { DEBUGA_PBX("going to send GSMOPEN_STATE_UP\n", GSMOPEN_P_LOG); ast_setstate(tech_pvt->owner, GSMOPEN_STATE_UP); @@ -2768,19 +2609,16 @@ int gsmopen_answer(private_t * tech_pvt) return res; } -int gsmopen_ring(private_t * tech_pvt) +int gsmopen_ring(private_t *tech_pvt) { int res = 0; switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; - if (option_debug) { - //DEBUGA_PBX("ENTERING FUNC\n", GSMOPEN_P_LOG); - } - session = switch_core_session_locate(tech_pvt->session_uuid_str); if (session) { switch_core_session_rwunlock(session); + //DEBUGA_PBX("got session, let's exit\n", GSMOPEN_P_LOG); return 0; } @@ -2795,8 +2633,9 @@ int gsmopen_ring(private_t * tech_pvt) switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING); if (channel) { switch_channel_mark_ring_ready(channel); + DEBUGA_GSMOPEN("switch_channel_mark_ring_ready(channel);\n", GSMOPEN_P_LOG); } else { - ERRORA("no session\n", GSMOPEN_P_LOG); + ERRORA("no channel\n", GSMOPEN_P_LOG); } switch_core_session_rwunlock(session); } else { @@ -2804,18 +2643,13 @@ int gsmopen_ring(private_t * tech_pvt) } - - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } return res; } - /*! \brief Hangup gsmopen call * Part of PBX interface, called from ast_hangup */ -int gsmopen_hangup(private_t * tech_pvt) +int gsmopen_hangup(private_t *tech_pvt) { /* if there is not gsmopen pvt why we are here ? */ @@ -2826,7 +2660,6 @@ int gsmopen_hangup(private_t * tech_pvt) DEBUGA_GSMOPEN("ENTERING FUNC\n", GSMOPEN_P_LOG); - if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { /* actually hangup through the serial port */ @@ -2864,384 +2697,7 @@ int gsmopen_hangup(private_t * tech_pvt) return 0; } - - -#ifdef GSMOPEN_ALSA -/*! \brief ALSA pcm format, according to endianess */ -#if __BYTE_ORDER == __LITTLE_ENDIAN -snd_pcm_format_t gsmopen_format = SND_PCM_FORMAT_S16_LE; -#else -snd_pcm_format_t gsmopen_format = SND_PCM_FORMAT_S16_BE; -#endif - -/*! - * \brief Initialize the ALSA soundcard channels (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the gsmopen_pvt of the interface - * - * This function call alsa_open_dev to initialize the ALSA soundcard for each channel (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init - * - * \return zero on success, -1 on error. - */ -int alsa_init(private_t * tech_pvt) -{ - tech_pvt->alsac = alsa_open_dev(tech_pvt, SND_PCM_STREAM_CAPTURE); - if (!tech_pvt->alsac) { - ERRORA("Failed opening ALSA capture device: %s\n", GSMOPEN_P_LOG, tech_pvt->alsacname); - if (alsa_shutdown(tech_pvt)) { - ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); - return -1; - } - return -1; - } - tech_pvt->alsap = alsa_open_dev(tech_pvt, SND_PCM_STREAM_PLAYBACK); - if (!tech_pvt->alsap) { - ERRORA("Failed opening ALSA playback device: %s\n", GSMOPEN_P_LOG, tech_pvt->alsapname); - if (alsa_shutdown(tech_pvt)) { - ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); - return -1; - } - return -1; - } - - /* make valgrind very happy */ - snd_config_update_free_global(); - return 0; -} - -/*! - * \brief Shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the gsmopen_pvt of the interface - * - * This function shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init - * - * \return zero on success, -1 on error. - */ - -int alsa_shutdown(private_t * tech_pvt) -{ - - int err; - - if (tech_pvt->alsap) { - err = snd_pcm_drop(tech_pvt->alsap); - if (err < 0) { - ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsapname, snd_strerror(err)); - return -1; - } - err = snd_pcm_close(tech_pvt->alsap); - if (err < 0) { - ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsapname, snd_strerror(err)); - return -1; - } - tech_pvt->alsap = NULL; - } - if (tech_pvt->alsac) { - err = snd_pcm_drop(tech_pvt->alsac); - if (err < 0) { - ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsacname, snd_strerror(err)); - return -1; - } - err = snd_pcm_close(tech_pvt->alsac); - if (err < 0) { - ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsacname, snd_strerror(err)); - return -1; - } - tech_pvt->alsac = NULL; - } - - return 0; -} - -/*! - * \brief Setup and open the ALSA device (capture OR playback) - * \param p the gsmopen_pvt of the interface - * \param stream the ALSA capture/playback definition - * - * This function setup and open the ALSA device (capture OR playback). Called by alsa_init - * - * \return zero on success, -1 on error. - */ -snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream) -{ - - snd_pcm_t *handle = NULL; - snd_pcm_hw_params_t *params; - snd_pcm_sw_params_t *swparams; - snd_pcm_uframes_t buffer_size; - int err; - size_t n; - //snd_pcm_uframes_t xfer_align; - unsigned int rate; - snd_pcm_uframes_t start_threshold, stop_threshold; - snd_pcm_uframes_t period_size = 0; - snd_pcm_uframes_t chunk_size = 0; - int start_delay = 0; - int stop_delay = 0; - snd_pcm_state_t state; - snd_pcm_info_t *info; - unsigned int chan_num; - - period_size = tech_pvt->alsa_period_size; - - snd_pcm_hw_params_alloca(¶ms); - snd_pcm_sw_params_alloca(&swparams); - - if (stream == SND_PCM_STREAM_CAPTURE) { - err = snd_pcm_open(&handle, tech_pvt->alsacname, stream, 0 | SND_PCM_NONBLOCK); - } else { - err = snd_pcm_open(&handle, tech_pvt->alsapname, stream, 0 | SND_PCM_NONBLOCK); - } - if (err < 0) { - ERRORA - ("snd_pcm_open failed with error '%s' on device '%s', if you are using a plughw:n device please change it to be a default:n device (so to allow it to be shared with other concurrent programs), or maybe you are using an ALSA voicemodem and slmodemd" - " is running?\n", GSMOPEN_P_LOG, snd_strerror(err), stream == SND_PCM_STREAM_CAPTURE ? tech_pvt->alsacname : tech_pvt->alsapname); - return NULL; - } - - snd_pcm_info_alloca(&info); - - if ((err = snd_pcm_info(handle, info)) < 0) { - ERRORA("info error: %s", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_nonblock(handle, 1); - if (err < 0) { - ERRORA("nonblock setting error: %s", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_hw_params_any(handle, params); - if (err < 0) { - ERRORA("Broken configuration for this PCM, no configurations available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED); - if (err < 0) { - ERRORA("Access type not available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - err = snd_pcm_hw_params_set_format(handle, params, gsmopen_format); - if (err < 0) { - ERRORA("Sample format non available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - err = snd_pcm_hw_params_set_channels(handle, params, 1); - if (err < 0) { - DEBUGA_GSMOPEN("Channels count set failed: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } -#if 1 - err = snd_pcm_hw_params_get_channels(params, &chan_num); - if (err < 0) { - ERRORA("Channels count non available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - if (chan_num < 1 || chan_num > 2) { - ERRORA("Channels count MUST BE 1 or 2, it is: %d\n", GSMOPEN_P_LOG, chan_num); - ERRORA("Channels count MUST BE 1 or 2, it is: %d on %s %s\n", GSMOPEN_P_LOG, chan_num, tech_pvt->alsapname, tech_pvt->alsacname); - return NULL; - } else { - if (chan_num == 1) { - if (stream == SND_PCM_STREAM_CAPTURE) - tech_pvt->alsa_capture_is_mono = 1; - else - tech_pvt->alsa_play_is_mono = 1; - } else { - if (stream == SND_PCM_STREAM_CAPTURE) - tech_pvt->alsa_capture_is_mono = 0; - else - tech_pvt->alsa_play_is_mono = 0; - } - } -#else - tech_pvt->alsa_capture_is_mono = 1; - tech_pvt->alsa_play_is_mono = 1; -#endif - -#if 1 - rate = tech_pvt->gsmopen_sound_rate; - err = snd_pcm_hw_params_set_rate_near(handle, params, &rate, 0); - if ((float) tech_pvt->gsmopen_sound_rate * 1.05 < rate || (float) tech_pvt->gsmopen_sound_rate * 0.95 > rate) { - WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", GSMOPEN_P_LOG, tech_pvt->gsmopen_sound_rate, rate); - } - - if (err < 0) { - ERRORA("Error setting rate: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - tech_pvt->gsmopen_sound_rate = rate; - - err = snd_pcm_hw_params_set_period_size_near(handle, params, &period_size, 0); - - if (err < 0) { - ERRORA("Error setting period_size: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - tech_pvt->alsa_period_size = period_size; - - tech_pvt->alsa_buffer_size = tech_pvt->alsa_period_size * tech_pvt->alsa_periods_in_buffer; - - err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &tech_pvt->alsa_buffer_size); - - if (err < 0) { - ERRORA("Error setting buffer_size: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } -#endif - - err = snd_pcm_hw_params(handle, params); - if (err < 0) { - ERRORA("Unable to install hw params: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - snd_pcm_hw_params_get_period_size(params, &chunk_size, 0); - snd_pcm_hw_params_get_buffer_size(params, &buffer_size); - if (chunk_size == buffer_size) { - ERRORA("Can't use period equal to buffer size (%lu == %lu)\n", GSMOPEN_P_LOG, chunk_size, buffer_size); - return NULL; - } - - snd_pcm_sw_params_current(handle, swparams); - - /* - if (sleep_min) - xfer_align = 1; - err = snd_pcm_sw_params_set_sleep_min(handle, swparams, - 0); - - if (err < 0) { - ERRORA("Error setting slep_min: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - */ - n = chunk_size; - err = snd_pcm_sw_params_set_avail_min(handle, swparams, n); - if (err < 0) { - ERRORA("Error setting avail_min: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - if (stream == SND_PCM_STREAM_CAPTURE) { - start_delay = 1; - } - if (start_delay <= 0) { - start_threshold = n + (snd_pcm_uframes_t) rate *start_delay / 1000000; - } else { - start_threshold = (snd_pcm_uframes_t) rate *start_delay / 1000000; - } - if (start_threshold < 1) - start_threshold = 1; - if (start_threshold > n) - start_threshold = n; - err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold); - if (err < 0) { - ERRORA("Error setting start_threshold: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - - if (stop_delay <= 0) - stop_threshold = buffer_size + (snd_pcm_uframes_t) rate *stop_delay / 1000000; - else - stop_threshold = (snd_pcm_uframes_t) rate *stop_delay / 1000000; - - if (stream == SND_PCM_STREAM_CAPTURE) { - stop_threshold = -1; - } - - err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold); - - if (err < 0) { - ERRORA("Error setting stop_threshold: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - - if (snd_pcm_sw_params(handle, swparams) < 0) { - ERRORA("Error installing software parameters: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - - err = snd_pcm_poll_descriptors_count(handle); - if (err <= 0) { - ERRORA("Unable to get a poll descriptors count, error is %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - if (err != 1) { //number of poll descriptors - DEBUGA_GSMOPEN("Can't handle more than one device\n", GSMOPEN_P_LOG); - return NULL; - } - - err = snd_pcm_poll_descriptors(handle, &tech_pvt->pfd, err); - if (err != 1) { - ERRORA("snd_pcm_poll_descriptors failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_GSMOPEN("Acquired fd %d from the poll descriptor\n", GSMOPEN_P_LOG, tech_pvt->pfd.fd); - - if (stream == SND_PCM_STREAM_CAPTURE) { - tech_pvt->gsmopen_sound_capt_fd = tech_pvt->pfd.fd; - } - - state = snd_pcm_state(handle); - - if (state != SND_PCM_STATE_RUNNING) { - if (state != SND_PCM_STATE_PREPARED) { - err = snd_pcm_prepare(handle); - if (err) { - ERRORA("snd_pcm_prepare failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_GSMOPEN("prepared!\n", GSMOPEN_P_LOG); - } - if (stream == SND_PCM_STREAM_CAPTURE) { - err = snd_pcm_start(handle); - if (err) { - ERRORA("snd_pcm_start failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_GSMOPEN("started!\n", GSMOPEN_P_LOG); - } - } - if (option_debug > 1) { - snd_output_t *output = NULL; - err = snd_output_stdio_attach(&output, stdout, 0); - if (err < 0) { - ERRORA("snd_output_stdio_attach failed: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - snd_pcm_dump(handle, output); - -#ifndef NO_GSMLIB - SMSMessageRef sms; - char content2[1000]; - //sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 - sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大 - //sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 - //NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - - memset(content2, '\0', sizeof(content2)); - if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { - iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); - } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { - ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, - sizeof(content2)); - } else { - ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - - } - //NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - //NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); -#endif// NO_GSMLIB - - } - if (option_debug > 1) - DEBUGA_GSMOPEN("ALSA handle = %ld\n", GSMOPEN_P_LOG, (long int) handle); - return handle; - -} - -/*! \brief Write audio frames to interface */ -#endif /* GSMOPEN_ALSA */ - -int gsmopen_call(private_t * tech_pvt, char *rdest, int timeout) +int gsmopen_call(private_t *tech_pvt, char *rdest, int timeout) { //gsmopen_sleep(5000); @@ -3258,8 +2714,7 @@ int gsmopen_call(private_t * tech_pvt, char *rdest, int timeout) return 0; } - -int gsmopen_senddigit(private_t * tech_pvt, char digit) +int gsmopen_senddigit(private_t *tech_pvt, char digit) { DEBUGA_GSMOPEN("DIGIT received: %c\n", GSMOPEN_P_LOG, digit); @@ -3268,369 +2723,18 @@ int gsmopen_senddigit(private_t * tech_pvt, char digit) char at_command[256]; memset(at_command, '\0', 256); - sprintf(at_command, "%s=\"%c\"", tech_pvt->at_send_dtmf, digit); + sprintf(at_command, "%s=1,%c", tech_pvt->at_send_dtmf, digit); res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); if (res) { - ERRORA("senddigit command failed, command used: '%s=\"%c\"', giving up\n", GSMOPEN_P_LOG, tech_pvt->at_send_dtmf, digit); + DEBUGA_GSMOPEN("XXX answer (OK) takes long to come, goes into timeout. command used: '%s=1,%c'\n", GSMOPEN_P_LOG, tech_pvt->at_send_dtmf, + digit); } } return 0; } -#ifdef GSMOPEN_ALSA -/*! \brief Write audio frames to interface */ -int alsa_write(private_t * tech_pvt, short *data, int datalen) -{ - static char sizbuf[8000]; - static char sizbuf2[16000]; - static char silencebuf[8000]; - static int sizpos = 0; - int len = sizpos; - int pos; - int res = 0; - time_t now_timestamp; - /* size_t frames = 0; */ - snd_pcm_state_t state; - snd_pcm_sframes_t delayp1=0; - snd_pcm_sframes_t delayp2=0; - - if(tech_pvt->no_sound==1){ - return res; - } - - - memset(sizbuf, 255, sizeof(sizbuf)); - memset(sizbuf2, 255, sizeof(sizbuf)); - memset(silencebuf, 255, sizeof(sizbuf)); - - //ERRORA("data=%p, datalen=%d\n", GSMOPEN_P_LOG, (void *)data, datalen); - /* We have to digest the frame in 160-byte portions */ - if (datalen > sizeof(sizbuf) - sizpos) { - ERRORA("Frame too large\n", GSMOPEN_P_LOG); - res = -1; - } else { - memcpy(sizbuf + sizpos, data, datalen); - memset(data, 255, datalen); - len += datalen; - pos = 0; - - -#ifdef ALSA_MONITOR - alsa_monitor_write(sizbuf, len); -#endif - state = snd_pcm_state(tech_pvt->alsap); - if (state == SND_PCM_STATE_XRUN) { - int i; - - DEBUGA_GSMOPEN - ("You've got an ALSA write XRUN in the past (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file\n", - GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer); - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } else { - res = snd_pcm_format_set_silence(gsmopen_format, silencebuf, len / 2); - if (res < 0) { - DEBUGA_GSMOPEN("Silence error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } - for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) { - res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2); - if (res != len / 2) { - DEBUGA_GSMOPEN("Write returned a different quantity: %d\n", GSMOPEN_P_LOG, res); - res = -1; - } else if (res < 0) { - DEBUGA_GSMOPEN("Write error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } - } - } - - } - - res = snd_pcm_delay(tech_pvt->alsap, &delayp1); - if (res < 0) { - DEBUGA_GSMOPEN("Error %d on snd_pcm_delay: \"%s\"\n", GSMOPEN_P_LOG, res, snd_strerror(res)); - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - DEBUGA_GSMOPEN("snd_pcm_prepare failed: '%s'\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_delay(tech_pvt->alsap, &delayp1); - } - - delayp2 = snd_pcm_avail_update(tech_pvt->alsap); - if (delayp2 < 0) { - DEBUGA_GSMOPEN("Error %d on snd_pcm_avail_update: \"%s\"\n", GSMOPEN_P_LOG, (int) delayp2, snd_strerror(delayp2)); - - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - DEBUGA_GSMOPEN("snd_pcm_prepare failed: '%s'\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - delayp2 = snd_pcm_avail_update(tech_pvt->alsap); - } - - if ( /* delayp1 != 0 && delayp1 != 160 */ - delayp1 < 160 || delayp2 > tech_pvt->alsa_buffer_size) { - - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - DEBUGA_GSMOPEN - ("snd_pcm_prepare failed while trying to prevent an ALSA write XRUN: %s, delayp1=%d, delayp2=%d\n", - GSMOPEN_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2); - } else { - - int i; - for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) { - res = snd_pcm_format_set_silence(gsmopen_format, silencebuf, len / 2); - if (res < 0) { - DEBUGA_GSMOPEN("Silence error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } - res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2); - if (res < 0) { - DEBUGA_GSMOPEN("Write error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } else if (res != len / 2) { - DEBUGA_GSMOPEN("Write returned a different quantity: %d\n", GSMOPEN_P_LOG, res); - res = -1; - } - } - - DEBUGA_GSMOPEN - ("PREVENTING an ALSA write XRUN (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", - GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); - } - - } - - memset(sizbuf2, 0, sizeof(sizbuf2)); - if (tech_pvt->alsa_play_is_mono) { - res = snd_pcm_writei(tech_pvt->alsap, sizbuf, len / 2); - } else { - int a = 0; - int i = 0; - for (i = 0; i < 8000;) { - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i--; - sizbuf2[a] = sizbuf[i]; // comment out this line to use only left - a++; - i++; - sizbuf2[a] = sizbuf[i]; // comment out this line to use only left - a++; - i++; - } - res = snd_pcm_writei(tech_pvt->alsap, sizbuf2, len); - } - if (res == -EPIPE) { - DEBUGA_GSMOPEN - ("ALSA write EPIPE (XRUN) (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", - GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } else { - - if (tech_pvt->alsa_play_is_mono) { - res = snd_pcm_writei(tech_pvt->alsap, sizbuf, len / 2); - } else { - int a = 0; - int i = 0; - for (i = 0; i < 8000;) { - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i--; - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i++; - } - res = snd_pcm_writei(tech_pvt->alsap, sizbuf2, len); - } - - } - - } else { - if (res == -ESTRPIPE) { - ERRORA("You've got some big problems\n", GSMOPEN_P_LOG); - } else if (res == -EAGAIN) { - DEBUGA_GSMOPEN("Momentarily busy\n", GSMOPEN_P_LOG); - res = 0; - } else if (res < 0) { - ERRORA("Error %d on audio write: \"%s\"\n", GSMOPEN_P_LOG, res, snd_strerror(res)); - } - } - } - - if (tech_pvt->audio_play_reset_period) { - time(&now_timestamp); - if ((now_timestamp - tech_pvt->audio_play_reset_timestamp) > tech_pvt->audio_play_reset_period) { - if (option_debug) - DEBUGA_GSMOPEN("reset audio play\n", GSMOPEN_P_LOG); - res = snd_pcm_wait(tech_pvt->alsap, 1000); - if (res < 0) { - ERRORA("audio play wait failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_drop(tech_pvt->alsap); - if (res) { - ERRORA("audio play drop failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_wait(tech_pvt->alsap, 1000); - if (res < 0) { - ERRORA("audio play wait failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - time(&tech_pvt->audio_play_reset_timestamp); - } - } - //res = 0; - //if (res > 0) - //res = 0; - return res; -} - -#define AST_FRIENDLY_OFFSET 0 -int alsa_read(private_t * tech_pvt, short *data, int datalen) -{ - //static struct ast_frame f; - static short __buf[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - static short __buf2[(GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2]; - short *buf; - short *buf2; - static int readpos = 0; - //static int left = GSMOPEN_FRAME_SIZE; - static int left; - snd_pcm_state_t state; - int r = 0; - int off = 0; - int error = 0; - //time_t now_timestamp; - - //DEBUGA_GSMOPEN("buf=%p, datalen=%d, left=%d\n", GSMOPEN_P_LOG, (void *)buf, datalen, left); - //memset(&f, 0, sizeof(struct ast_frame)); //giova - - - - if(tech_pvt->no_sound==1){ - return r; - } - - left = datalen; - - - state = snd_pcm_state(tech_pvt->alsac); - if (state != SND_PCM_STATE_RUNNING) { - DEBUGA_GSMOPEN("ALSA read state is not SND_PCM_STATE_RUNNING\n", GSMOPEN_P_LOG); - - if (state != SND_PCM_STATE_PREPARED) { - error = snd_pcm_prepare(tech_pvt->alsac); - if (error) { - ERRORA("snd_pcm_prepare failed, %s\n", GSMOPEN_P_LOG, snd_strerror(error)); - return r; - } - DEBUGA_GSMOPEN("prepared!\n", GSMOPEN_P_LOG); - } - gsmopen_sleep(1000); - error = snd_pcm_start(tech_pvt->alsac); - if (error) { - ERRORA("snd_pcm_start failed, %s\n", GSMOPEN_P_LOG, snd_strerror(error)); - return r; - } - DEBUGA_GSMOPEN("started!\n", GSMOPEN_P_LOG); - gsmopen_sleep(1000); - } - - buf = __buf + AST_FRIENDLY_OFFSET / 2; - buf2 = __buf2 + ((AST_FRIENDLY_OFFSET / 2) * 2); - - if (tech_pvt->alsa_capture_is_mono) { - r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left); - //DEBUGA_GSMOPEN("r=%d, buf=%p, buf+readpos=%p, datalen=%d, left=%d\n", GSMOPEN_P_LOG, r, (void *)buf, (void *)(buf + readpos), datalen, left); - } else { - int a = 0; - int i = 0; - r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left); - - for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { - __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; //comment out this line to use only left - //__buf[a] = __buf2[i]; // enable this line to use only left - a++; - i++; - i++; - } - } - - if (r == -EPIPE) { - DEBUGA_GSMOPEN("ALSA XRUN on read\n", GSMOPEN_P_LOG); - return r; - } else if (r == -ESTRPIPE) { - ERRORA("-ESTRPIPE\n", GSMOPEN_P_LOG); - return r; - - } else if (r == -EAGAIN) { - int count=0; - while (r == -EAGAIN) { - gsmopen_sleep(10000); - DEBUGA_GSMOPEN("%d ALSA read -EAGAIN, the soundcard is not ready to be read by gsmopen\n", GSMOPEN_P_LOG, count); - count++; - - if (tech_pvt->alsa_capture_is_mono) { - r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left); - } else { - int a = 0; - int i = 0; - r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left); - - for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { - __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; - a++; - i++; - i++; - } - } - - } - } else if (r < 0) { - WARNINGA("ALSA Read error: %s\n", GSMOPEN_P_LOG, snd_strerror(r)); - } else if (r >= 0) { - //DEBUGA_GSMOPEN("read: r=%d, readpos=%d, left=%d, off=%d\n", GSMOPEN_P_LOG, r, readpos, left, off); - off -= r; //what is the meaning of this? a leftover, probably - } - /* Update positions */ - readpos += r; - left -= r; - - if (readpos >= GSMOPEN_FRAME_SIZE) { - int i; - /* A real frame */ - readpos = 0; - left = GSMOPEN_FRAME_SIZE; - for (i = 0; i < r; i++) - data[i] = buf[i]; - - } - return r; -} - -#endif // GSMOPEN_ALSA - - - - - -int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text) +int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text) { //char *idest = data; //char rdest[256]; @@ -3642,6 +2746,7 @@ int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text) //int found = 0; int failed = 0; int err = 0; + char mesg_test[1024]; //strncpy(rdest, idest, sizeof(rdest) - 1); DEBUGA_GSMOPEN("GSMopenSendsms: dest=%s text=%s\n", GSMOPEN_P_LOG, dest, text); @@ -3658,41 +2763,85 @@ int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text) if (tech_pvt->controldevprotocol == PROTOCOL_AT) { char smscommand[16000]; memset(smscommand, '\0', sizeof(smscommand)); + char pdu2[16000]; + memset(pdu2, '\0', sizeof(pdu2)); + int pdulenght = 0; + string pdu; PUSHA_UNLOCKA(&tech_pvt->controldev_lock); LOKKA(tech_pvt->controldev_lock); - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); - if (err) { - ERRORA("AT+CMGF=1 (set message sending to TEXT (as opposed to PDU) do not got OK from the phone\n", GSMOPEN_P_LOG); - } + if (tech_pvt->no_ucs2 || tech_pvt->sms_pdu_not_supported == 0) { + try { + int bad_8859 = 0; + + memset(mesg_test, '\0', sizeof(mesg_test)); + sprintf(mesg_test, ":) ciao belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大aèéàòçù"); //let's test the beauty of utf8 + //sprintf(mesg_test,":) ciao belè èéàòìù"); + //text=mesg_test; + + bad_8859 = utf8_to_iso_8859_1(tech_pvt, text, strlen(text), smscommand, sizeof(smscommand)); + if (!bad_8859) { + err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); + if (err) { + ERRORA("AT+CMGF=0 (set message sending to PDU (as opposed to TEXT) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + SMSMessageRef smsMessage; + smsMessage = new SMSSubmitMessage(smscommand, dest); + //string pdu = smsMessage->encode(); + pdu = smsMessage->encode(); + strncpy(pdu2, pdu.c_str(), sizeof(pdu2) - 1); + memset(smscommand, '\0', sizeof(smscommand)); + pdulenght = pdu.length() / 2 - 1; + sprintf(smscommand, "AT+CMGS=%d", pdulenght); + } else { + int ok; + + UNLOCKA(tech_pvt->controldev_lock); + POPPA_UNLOCKA(&tech_pvt->controldev_lock); + + tech_pvt->no_ucs2 = 0; + tech_pvt->sms_pdu_not_supported = 1; + ok = gsmopen_sendsms(tech_pvt, dest, text); + tech_pvt->no_ucs2 = 1; + tech_pvt->sms_pdu_not_supported = 0; + + return ok; + } + + } + catch(GsmException & ge) { + ERRORA("GsmException= |||%s|||\n", GSMOPEN_P_LOG, ge.what()); + } + - if (tech_pvt->no_ucs2) { - sprintf(smscommand, "AT+CMGS=\"%s\"", dest); //TODO: support phones that only accept pdu mode } else { char dest2[1048]; + err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); + if (err) { + ERRORA("AT+CMGF=1 (set message sending to TEXT (as opposed to PDU) do not got OK from the phone\n", GSMOPEN_P_LOG); + } + +/* err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); if (err) { ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", GSMOPEN_P_LOG); } +*/ memset(dest2, '\0', sizeof(dest2)); - utf_to_ucs2(tech_pvt, dest, strlen(dest), dest2, sizeof(dest2)); - sprintf(smscommand, "AT+CMGS=\"%s\"", dest2); //TODO: support phones that only accept pdu mode + utf8_to_ucs2(tech_pvt, dest, strlen(dest), dest2, sizeof(dest2)); + sprintf(smscommand, "AT+CMGS=\"%s\"", dest2); } - //TODO: support phones that only accept pdu mode - //TODO would be better to lock controldev here - //sprintf(smscommand, "AT+CMGS=\"%s\"", dest); //FIXME: nokia e63 want this err = gsmopen_serial_write_AT_noack(tech_pvt, smscommand); if (err) { ERRORA("Error sending SMS\n", GSMOPEN_P_LOG); failed = 1; goto uscita; } - err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf -#if 1 + err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.1s for the prompt, no crlf if (err) { DEBUGA_GSMOPEN ("Error or timeout getting prompt '> ' for sending sms directly to the remote party. BTW, seems that we cannot do that with Motorola c350, so we'll write to cellphone memory, then send from memory\n", @@ -3717,16 +2866,23 @@ int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text) goto uscita; } } -#endif - //sprintf(text,"ciao 123 belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大"); //let's test the beauty of utf - memset(smscommand, '\0', sizeof(smscommand)); - if (tech_pvt->no_ucs2) { - sprintf(smscommand, "%s", text); + if (tech_pvt->no_ucs2 || tech_pvt->sms_pdu_not_supported == 0) { + memset(smscommand, '\0', sizeof(smscommand)); + sprintf(smscommand, "%s", pdu2); } else { - utf_to_ucs2(tech_pvt, text, strlen(text), smscommand, sizeof(smscommand)); - } + memset(mesg_test, '\0', sizeof(mesg_test)); + sprintf(mesg_test, ":) ciao belè новоÑти לק ר×ת ﺎﻠﺠﻤﻋﺓ 人大aèéàòçù"); //let's test the beauty of utf8 + //text=mesg_test; + memset(smscommand, '\0', sizeof(smscommand)); + if (tech_pvt->no_ucs2) { + sprintf(smscommand, "%s", text); + } else { + utf8_to_ucs2(tech_pvt, text, strlen(text), smscommand, sizeof(smscommand)); + } + + } smscommand[strlen(smscommand)] = 0x1A; DEBUGA_GSMOPEN("smscommand len is: %d, text is:|||%s|||\n", GSMOPEN_P_LOG, (int) strlen(smscommand), smscommand); @@ -3779,12 +2935,6 @@ int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text) POPPA_UNLOCKA(&tech_pvt->controldev_lock); } - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); - if (err) { - DEBUGA_GSMOPEN("AT+CMGF=0 (set message sending to PDU (as opposed to TEXT) do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); - } - - DEBUGA_GSMOPEN("FINISH\n", GSMOPEN_P_LOG); if (failed) return -1; @@ -3820,7 +2970,7 @@ void gsmopen_store_boost(char *s, double *boost) *boost = BOOST_MAX; } #ifdef WIN32 - *boost = exp(log ((double)10) * *boost / 20) * BOOST_SCALE; + *boost = exp(log((double) 10) * *boost / 20) * BOOST_SCALE; #else *boost = exp(log(10) * *boost / 20) * BOOST_SCALE; #endif //WIN32 @@ -3828,11 +2978,10 @@ void gsmopen_store_boost(char *s, double *boost) DEBUGA_GSMOPEN("setting boost %s to %f\n", GSMOPEN_P_LOG, s, *boost); } - int gsmopen_sound_boost(void *data, int samples_num, double boost) { /* LUIGI RIZZO's magic */ - if (boost != 0 && (boost < 511 || boost > 513)) { /* scale and clip values */ + if (boost != 0 && (boost < 511 || boost > 513)) { /* scale and clip values */ int i, x; int16_t *ptr = (int16_t *) data; @@ -3853,8 +3002,7 @@ int gsmopen_sound_boost(void *data, int samples_num, double boost) return 0; } - -int gsmopen_serial_getstatus_AT(private_t * tech_pvt) +int gsmopen_serial_getstatus_AT(private_t *tech_pvt) { int res; private_t *p = tech_pvt; @@ -3868,7 +3016,6 @@ int gsmopen_serial_getstatus_AT(private_t * tech_pvt) } #endif - PUSHA_UNLOCKA(p->controldev_lock); LOKKA(p->controldev_lock); res = gsmopen_serial_write_AT_ack(p, "AT"); @@ -3900,7 +3047,6 @@ int gsmopen_serial_getstatus_AT(private_t * tech_pvt) } gsmopen_sleep(1000); } - //FIXME all the following commands in config! if (p->sms_cnmi_not_supported) { @@ -4002,3 +3148,47 @@ int gsmopen_serial_getstatus_AT(private_t * tech_pvt) POPPA_UNLOCKA(p->controldev_lock); return 0; } + +int gsmopen_serial_init_audio_port(private_t *tech_pvt, int controldevice_audio_speed) +{ + tech_pvt->serialPort_serial_audio = new ctb::SerialPort(); + + //if( tech_pvt->serialPort_serial_audio->Open( "COM8", 115200, "8N1", ctb::SerialPort::NoFlowControl ) >= 0 ) { + if (tech_pvt->serialPort_serial_audio->Open(tech_pvt->controldevice_audio_name, 115200, "8N1", ctb::SerialPort::NoFlowControl) >= 0) { + DEBUGA_GSMOPEN("port %s, SUCCESS open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_audio_name); + } else { + ERRORA("port %s, NOT open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_audio_name); + return -1; + } + + return 0; +} + +int serial_audio_init(private_t *tech_pvt) +{ + int res; + int err; + + res = gsmopen_serial_init_audio_port(tech_pvt, tech_pvt->controldevice_audio_speed); + DEBUGA_GSMOPEN("serial_audio_init res=%d\n", GSMOPEN_P_LOG, res); + + if (res == 0) + err = 0; + else + err = 1; + + return err; +} + +int serial_audio_shutdown(private_t *tech_pvt) +{ + + int res; + int err; + + res = tech_pvt->serialPort_serial_audio->Close(); + DEBUGA_GSMOPEN("serial_audio_shutdown res=%d (controldev_audio_fd is %d)\n", GSMOPEN_P_LOG, res, tech_pvt->controldev_audio_fd); + err = res; + + return err; +} diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/COPYRIGHT b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/COPYRIGHT new file mode 100644 index 0000000000..9d0d9da185 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/COPYRIGHT @@ -0,0 +1,18 @@ +Copyright + +Copyright (C) 1999-2010 Joachim Buermann (jbuermann@iftools.com) + +ctb is free software; you can redistribute it and/or modify it under +the term of the GNU Library General Public Licence as published by the +Free Software Foundation. + +This library 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 +Library General Public Licence for more details + + +EXCEPTION NOTICE +As a special exception, you may use, copy, link, modify and distribute +under the user's own terms, binary object code versions of works based +on the library. diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/GNUmakefile b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/GNUmakefile new file mode 100644 index 0000000000..e39a687d4c --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/GNUmakefile @@ -0,0 +1,293 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.5 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# 'install' program location +INSTALL ?= install + +# Location where the package is installed by 'make install' +prefix ?= /usr/local + +# Destination root (/ is used if empty) +DESTDIR ?= + +# +AR ?= ar + +# +RANLIB ?= ranlib + +# Compiler flags to link shared library +LINK_DLL_FLAGS ?= -shared + +# C++ compiler +CXX = g++ + +# Standard flags for C++ +CXXFLAGS ?= + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS ?= + +# Standard linker flags +LDFLAGS ?= + +# Set to 1 to build debug version [0,1] +DEBUG ?= 0 + +# +GPIB ?= 0 + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD -MP +CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \ + $(__OPTIMIZE_FLAG) -I../include $(CPPFLAGS) $(CXXFLAGS) +CTB_LIB_OBJECTS = \ + $(OUTPUT)/ctb_lib_fifo.o \ + $(OUTPUT)/ctb_lib_getopt.o \ + $(OUTPUT)/ctb_lib_iobase.o \ + $(OUTPUT)/ctb_lib_portscan.o \ + $(OUTPUT)/ctb_lib_serportx.o \ + $(OUTPUT)/ctb_lib_serport.o \ + $(OUTPUT)/ctb_lib_timer.o \ + $(__GPIBSRC_OBJECTS) +CTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \ + $(__OPTIMIZE_FLAG) -I../include -fPIC -DPIC $(CPPFLAGS) $(CXXFLAGS) +CTB_DLL_OBJECTS = \ + $(OUTPUT)/ctb_dll_fifo.o \ + $(OUTPUT)/ctb_dll_getopt.o \ + $(OUTPUT)/ctb_dll_iobase.o \ + $(OUTPUT)/ctb_dll_portscan.o \ + $(OUTPUT)/ctb_dll_serportx.o \ + $(OUTPUT)/ctb_dll_serport.o \ + $(OUTPUT)/ctb_dll_timer.o \ + $(__GPIBSRC_OBJECTS_1) +CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -DGPIB=$(GPIB) -D_THREAD_SAFE \ + -pthread $(__OPTIMIZE_FLAG) -I../include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)/ctbtest_ctbtest.o + +### Conditionally set variables: ### + +ifeq ($(DEBUG),0) +OUTPUT = release +endif +ifeq ($(DEBUG),1) +OUTPUT = debug +endif +ifeq ($(DEBUG),1) +LIBFLAG = d +endif +ifeq ($(GPIB),1) +GPIBFLAG = _gpib +endif +ifeq ($(GPIB),1) +GPIBINC = gpib.h +endif +ifeq ($(GPIB),1) +__GPIBSRC_OBJECTS = \ + $(OUTPUT)/ctb_lib_gpib.o +endif +ifeq ($(GPIB),1) +__GPIBSRC_OBJECTS_1 = \ + $(OUTPUT)/ctb_dll_gpib.o +endif +ifeq ($(DEBUG),0) +____DEBUG = -DNDEBUG +endif +ifeq ($(DEBUG),1) +____DEBUG = +endif +ifeq ($(DEBUG),0) +__OPTIMIZE_FLAG = -O0 +endif +ifeq ($(DEBUG),1) +__OPTIMIZE_FLAG = -O2 +endif +ifeq ($(GPIB),1) +__SYSLIB2_p = -lgpib +endif +ifeq ($(DEBUG),0) +____DEBUG_1 = +endif +ifeq ($(DEBUG),1) +____DEBUG_1 = -g +endif + + +all: $(OUTPUT) +$(OUTPUT): + @mkdir -p $(OUTPUT) + +### Targets: ### + +all: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(OUTPUT)/ctbtest tip-linux + +install: install_ctb_lib install_ctb_dll + $(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16 + for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \ + if test ! -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f` ; then \ + $(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f`; \ + fi; \ + $(INSTALL) -m 644 ../include/ctb-0.16/$$f $(DESTDIR)$(prefix)/include/ctb-0.16/$$f; \ + done + +uninstall: uninstall_ctb_lib uninstall_ctb_dll + for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \ + rm -f $(DESTDIR)$(prefix)/include/ctb-0.16/$$f; \ + done + +clean: + rm -f $(OUTPUT)/*.o + rm -f $(OUTPUT)/*.d + rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a + rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so + rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so + rm -f $(OUTPUT)/ctbtest + +htmldoc: + (cd ..; tar -cvzf manual/libctb-0.16-htmldoc.tar.gz docs/html/ ) + +tarball: + (cd ../..; tar -cvzf libctb-0.16.tar.gz \ + libctb-0.16/build/ \ + libctb-0.16/manual/refman.pdf \ + libctb-0.16/include \ + libctb-0.16/python \ + libctb-0.16/samples \ + libctb-0.16/src \ + libctb-0.16/lib/gpib32.lib \ + --exclude=release \ + --exclude=debug \ + --exclude=install \ + --exclude=output \ + --exclude=website \ + --exclude=*~ \ + --exclude=buildall.sh \ + --exclude=buildall.bat \ + --exclude=version-update.sh \ + --exclude=libctb-0.16.tar.gz \ + --exclude=*.ilk \ + --exclude=*.log \ + --exclude=*.o* \ + --exclude=*.pdb \ + --exclude=*.pyc \ + --exclude=.svn; mv libctb-0.16.tar.gz libctb-0.16/build ) + +../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a: $(CTB_LIB_OBJECTS) + rm -f $@ + $(AR) rcu $@ $(CTB_LIB_OBJECTS) + $(RANLIB) $@ + +install_ctb_lib: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a + $(INSTALL) -d $(DESTDIR)$(prefix)/lib + $(INSTALL) -m 644 ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a $(DESTDIR)$(prefix)/lib + +uninstall_ctb_lib: + rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a + +../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so: $(CTB_DLL_OBJECTS) + $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(CTB_DLL_OBJECTS) $(____DEBUG_1) -pthread -L../lib $(LDFLAGS) -lpthread $(__SYSLIB2_p) + +install_ctb_dll: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so + $(INSTALL) -d $(DESTDIR)$(prefix)/lib + $(INSTALL) -m 644 ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(DESTDIR)$(prefix)/lib + install -c ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(DESTDIR)$(prefix)/lib + +uninstall_ctb_dll: + rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so + rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so + +$(OUTPUT)/ctbtest: $(CTBTEST_OBJECTS) ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a + $(CXX) -o $@ $(CTBTEST_OBJECTS) $(____DEBUG_1) -pthread -L../lib $(LDFLAGS) ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -lpthread $(__SYSLIB2_p) + +tip-linux: + @echo " " + @echo "================================================================" + @echo " The building of ctb is finished. On Linux you'll now" + @echo " have to run (as root):" + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) install" + @echo " " + @echo " to install the libraries in $(prefix)/lib" + @echo " and the header files in $(prefix)/include/ctb-0.16" + @echo " " + @echo " Don't forget to run ldconfig (also as root)" + @echo " " + @echo " ctb comes with no guarantees and doesn't claim" + @echo " to be suitable for any purpose." + @echo "================================================================" + @echo " " + +$(OUTPUT)/ctb_lib_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_lib_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_lib_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_lib_portscan.o: ./../src/portscan.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_lib_serportx.o: ./../src/serportx.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_lib_serport.o: ./../src/linux/serport.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_lib_timer.o: ./../src/linux/timer.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_lib_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_portscan.o: ./../src/portscan.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_serportx.o: ./../src/serportx.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_serport.o: ./../src/linux/serport.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_timer.o: ./../src/linux/timer.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctb_dll_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)/ctbtest_ctbtest.o: ./../samples/ctbtest.cpp + $(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all install uninstall clean install_ctb_lib uninstall_ctb_lib \ + install_ctb_dll uninstall_ctb_dll + + +# Dependencies tracking: +-include $(OUTPUT)/*.d diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/README b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/README new file mode 100644 index 0000000000..fdcdb1d37b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/README @@ -0,0 +1,169 @@ + +CTB (Communication toolbox library) 08.02.2010 +====================================================================== + +Website: http://www.iftools.com/opensource/ctb.en.php +Version: 0.16 + + +Linux GCC compiliation +---------------------------------------------------------------- + +Type 'make DEBUG=x GPIB=x' or 'make -f GNUmakefile DEBUG=x GPIB=x' + +Type the same command with an additional install as root to copy the +headers and libs to there according system places +(i.e. /usr/local/include/ctb-0.16 and /usr/local/lib/libctb-0.16.a) +like: + +sudo make DEBUG=x GPIB=x install + + +Microsoft MingW32 compilation +---------------------------------------------------------------- + +Type mingw32-make -f makefile.gcc DEBUG=x GPIB=x + +Please note! Currently only a shared ctb library will be created. +You have to copy the ctb-VERSION.dll in the application path of +your application linked with ctb or in a global dll folder (but +not recommented!) + + +Microsoft Visual C++ compilation +---------------------------------------------------------------- + +Type 'nmake -f makefile.vc DEBUG=x GPIB=x' + +To create all libs (debug/release with and without gpib support) +just input: ./buildall.bat in the build folder. + + +Borland C++ 5.0/5.5 compilation +---------------------------------------------------------------- + +Type 'make -f makefile.bcc DEBUG=x GPIB=x' + + +Watcom C++ 10.6/11 and OpenWatcom compilation +---------------------------------------------------------------- + +Type 'wmake -f makefile.wat' + + +Python support +-------------- + +Since version 0.9 ctb also includes a python module ctb.py. +To build the python module by yourself, your system has to satisfy +the following requirements: + +- the SWIG program, you get it at http://www.swig.org/ (for linux, + take a look in your favorite distribution package manager). + The current ctb module was build with SWIG version 1.3.29 (linux) + and version 1.3.40 (Windows) +- the develop files for python (means the header and the library + files). I tested it with Python 2.4. You will get it at: + http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi +- if you want to communicate via GPIB, a GPIB installation (GPIB + controller and software, for instance a Nation Instruments or + Keithley card). On Linux the libgpib. + +Like the building of the wxctb C++ library, you also can choose +between GPIB and non GPIB (default) support. + +Compile the python module + +Linux +cd in the python/src/linux folder and type: +./makepy.sh USE_GPIB +or +./makepy.sh +if you don't need any GPIB support + +Windows +cd in the python/src/windows folder. Open the makepy.bat with your +favorite editor and set the commented enviroment variables. See the +makepy.bat file for more information, how you can do that. +After that, just type: + +./makepy.sh USE_GPIB +(for GPIB support) or +./makepy.sh +if you don't need any GPIB support + +At last set the python modul path to the ctb-0.15/python/module +path. +On linux: + +export PYTHONPATH=somepath/ctb-0.15/python/module/linux + +On Windows: + +set PYTHONPATH=drive:\somepath\ctb-0.15\python\module\win32 + + +ChangeLog +--------- + +0.16 + - added port scan function. + - bug fixes for MingW build. + +0.15 + - added ctb namespace and removed all wx prefix (also in the header + path). + - Linux: A serial port cannot opened twice or more any longer. + - 9 bit data transmission support using the parity bit as ninth bit. + - improved documentation + - Some more documentation + +0.14 + - Support for non-standard baudrates (depends on the used UART + or USB to RS232 converter. + +0.13 + - remove the expect and match mechanism. They didn't work very + well, and a future implementation should be done as a + independent library. If someone missed this functions, please + let me know. + +0.12 + - more documentation for doxygen + - replace the ugly GetSettingsAsString methods by a more intuitive + one. + - wxGPIB::Read now checks the MAV bit before reading. This resolves + some stderr stuff on linux. + +0.11 + - the gpib sources are no longer depending on the OS. They are + identical for linux and windows. + - add the current version to the ctb include path, so you can + handle a parallel installation of different versions. + For instance: The header path wx/ctb is replaced by wx/ctb-0.11 + +0.10 + - replace the former gpib async io access with the standard + NI-488 functions (ibrd,ibwrt). To avoid blocking, the internal + gpib timeout was set to the lowest value, whereas the wxIOBase + methods handles the timeout in a global and transparent manner. + - add a FindListener method in the wxGPIB class to look for all + connected gpib devices (listeners). + - The Read and Readv method of the python wxIOBase class returns + additional zero bytes, fixed. + +0.9 + - added python support for both, serial and gpib + +0.8 + - added bakefile support + +0.7 + - added GPIB (Nation Instruments GPIB cards) support + + +Authors' info +------------- + +Joachim Buermann jbuermann@iftools.com + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/libctb.bkl b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/libctb.bkl new file mode 100644 index 0000000000..eb5670bd4a --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/libctb.bkl @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + 0.16 + libctb + + + + % + + + + + + + + + + debug + release + + $(OUTPUT) + + + ..$(DIRSEP)lib + + + + + d + + + + pthread + winmm + + + + gpib + gpib32 + + + + linux + win32 + + + + _gpib + + + + + ../src/gpib.cpp + + + + + + gpib.h + + + + + off + speed + + + + ../src/fifo.cpp + ../src/getopt.cpp + ../src/iobase.cpp + ../src/portscan.cpp + ../src/serportx.cpp + ../src/$(OS)/serport.cpp + ../src/$(OS)/timer.cpp + + + + + (cd ..; tar -cvzf manual/$(value) docs/html/ ) + + + + + + $(NAME)-$(VERSION)-htmldoc.tar.gz + + + + + + (cd ../..; tar -cvzf $(value) \ + $(NAME)-$(VERSION)/build/ \ + $(NAME)-$(VERSION)/manual/refman.pdf \ + $(NAME)-$(VERSION)/include \ + $(NAME)-$(VERSION)/python \ + $(NAME)-$(VERSION)/samples \ + $(NAME)-$(VERSION)/src \ + $(NAME)-$(VERSION)/lib/gpib32.lib \ + --exclude=release \ + --exclude=debug \ + --exclude=install \ + --exclude=output \ + --exclude=website \ + --exclude=*~ \ + --exclude=buildall.sh \ + --exclude=buildall.bat \ + --exclude=g++.sh \ + --exclude=version-update.sh \ + --exclude=$(value) \ + --exclude=*.ilk \ + --exclude=*.log \ + --exclude=*.o* \ + --exclude=*.pdb \ + --exclude=*.pyc \ + --exclude=.svn; mv $(value) $(NAME)-$(VERSION)/build ) + + + + + + $(NAME)-$(VERSION).tar.gz + + + + + + ..$(DIRSEP)include$(DIRSEP)ctb-$(VERSION) + + ctb.h + fifo.h + getopt.h + $(GPIBINC) + iobase.h + linux/serport.h + linux/timer.h + portscan.h + serport.h + serportx.h + timer.h + + $(INCLUDEDIR)$(DIRSEP)ctb-$(VERSION) + + + + ../lib + ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION) + + multi + static + $(OPTIMIZE_FLAG) + + $(FILES) + $(GPIBSRC) + + ../lib + $(SYSLIB1) + $(SYSLIB2) + ../include + $(LIBDIR) + + + ../lib + multi + ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION) + static + $(OPTIMIZE_FLAG) + ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION) + + $(FILES) + $(GPIBSRC) + + ../lib + $(SYSLIB1) + $(SYSLIB2) + ../include + $(LIBDIR) + + + + + + GPIB=$(GPIB) + multi + static + $(OPTIMIZE_FLAG) + + ../samples/ctbtest.cpp + + ../include + ../lib + ctb_lib + $(SYSLIB1) + $(SYSLIB2) + + + + vc + $(FORMAT) + + + + + + @if not exist $(INSTALLDIR)\lib\$(LIBNAME)_lib mkdir $(INSTALLDIR)\lib\$(LIBNAME)_lib + + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION).lib $(INSTALLDIR)\lib\$(LIBNAME)_lib + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION).dll $(INSTALLDIR)\lib\$(LIBNAME)_lib + + @if not exist $(INSTALLDIR)\include\ctb-$(VERSION)\win32 mkdir $(INSTALLDIR)\include\ctb-$(VERSION)\win32 + @copy ..\include\ctb-$(VERSION)\*.h $(INSTALLDIR)\include\ctb-$(VERSION) + @copy ..\include\ctb-$(VERSION)\win32\*.h $(INSTALLDIR)\include\ctb-$(VERSION)\win32 + + + + + all + + @echo " " + @echo "================================================================" + @echo " The building of ctb is finished. On Linux you'll now" + @echo " have to run (as root):" + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) install" + @echo " " + @echo " to install the libraries in $(LIBDIR)" + @echo " and the header files in $(INCLUDEDIR)/ctb-$(VERSION)" + @echo " " + @echo " Don't forget to run ldconfig (also as root)" + @echo " " + @echo " ctb comes with no guarantees and doesn't claim" + @echo " to be suitable for any purpose." + @echo "================================================================" + @echo " " + + + + + all + + @echo " " + @echo "================================================================" + @echo " The building of ctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)$(DIRSEP)lib$(DIRSEP)$(LIBNAME)_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)$(DIRSEP)ctb-$(VERSION)" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " ctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + + + + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.bcc b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.bcc new file mode 100644 index 0000000000..6afadafb3f --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.bcc @@ -0,0 +1,269 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.5 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + +.autodepend + +!ifndef BCCDIR +!ifndef MAKEDIR +!error Your Borland compiler does not define MAKEDIR. Please define the BCCDIR variable, e.g. BCCDIR=d:\bc4 +!endif +BCCDIR = $(MAKEDIR)\.. +!endif + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +!ifndef CXX +CXX = bcc32 +!endif + +# Standard flags for C++ +!ifndef CXXFLAGS +CXXFLAGS = +!endif + +# Standard preprocessor flags (common for CC and CXX) +!ifndef CPPFLAGS +CPPFLAGS = -a8 -g0 +!endif + +# Standard linker flags +!ifndef LDFLAGS +LDFLAGS = +!endif + +# Set to 1 to build debug version [0,1] +!ifndef DEBUG +DEBUG = 0 +!endif + +# +!ifndef GPIB +GPIB = 0 +!endif + +# +!ifndef WXDIR +WXDIR = $(WXWIN) +!endif + +# +!ifndef INSTALLDIR +INSTALLDIR = $(WXWIN) +!endif + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CTB_LIB_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \ + $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTB_LIB_OBJECTS = \ + $(OUTPUT)\ctb_lib_fifo.obj \ + $(OUTPUT)\ctb_lib_getopt.obj \ + $(OUTPUT)\ctb_lib_iobase.obj \ + $(OUTPUT)\ctb_lib_portscan.obj \ + $(OUTPUT)\ctb_lib_serportx.obj \ + $(OUTPUT)\ctb_lib_serport.obj \ + $(OUTPUT)\ctb_lib_timer.obj \ + $(____GPIBSRC_FILENAMES_OBJECTS) +CTB_DLL_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \ + $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTB_DLL_OBJECTS = \ + $(OUTPUT)\ctb_dll_fifo.obj \ + $(OUTPUT)\ctb_dll_getopt.obj \ + $(OUTPUT)\ctb_dll_iobase.obj \ + $(OUTPUT)\ctb_dll_portscan.obj \ + $(OUTPUT)\ctb_dll_serportx.obj \ + $(OUTPUT)\ctb_dll_serport.obj \ + $(OUTPUT)\ctb_dll_timer.obj \ + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) \ + -DGPIB=$(GPIB) -tWM $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)\ctbtest_ctbtest.obj + +### Conditionally set variables: ### + +!if "$(DEBUG)" == "0" +OUTPUT = release +!endif +!if "$(DEBUG)" == "1" +OUTPUT = debug +!endif +!if "$(WXDIR)" == "" +INSTALLDIR = ..\lib +!endif +!if "$(DEBUG)" == "1" +LIBFLAG = d +!endif +!if "$(GPIB)" == "1" +GPIBFLAG = _gpib +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_OBJECTS = \ + $(OUTPUT)\ctb_lib_gpib.obj +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_1_OBJECTS = \ + $(OUTPUT)\ctb_dll_gpib.obj +!endif +!if "$(DEBUG)" == "0" +____DEBUG = -DNDEBUG +!endif +!if "$(DEBUG)" == "1" +____DEBUG = +!endif +!if "$(DEBUG)" == "0" +__OPTIMIZE_FLAG = -Od +!endif +!if "$(DEBUG)" == "1" +__OPTIMIZE_FLAG = -O2 +!endif +!if "$(GPIB)" == "1" +__SYSLIB2_p = gpib32.lib +!endif +!if "$(DEBUG)" == "0" +____DEBUG_2 = -v- +!endif +!if "$(DEBUG)" == "1" +____DEBUG_2 = -v +!endif + + +all: $(OUTPUT) +$(OUTPUT): + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all: ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean: + -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj + -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res + -if exist $(OUTPUT)\*.csm del $(OUTPUT)\*.csm + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.tds del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.tds + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilc del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilc + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ild del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ild + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilf del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilf + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ils del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ils + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + -if exist $(OUTPUT)\ctbtest.tds del $(OUTPUT)\ctbtest.tds + -if exist $(OUTPUT)\ctbtest.ilc del $(OUTPUT)\ctbtest.ilc + -if exist $(OUTPUT)\ctbtest.ild del $(OUTPUT)\ctbtest.ild + -if exist $(OUTPUT)\ctbtest.ilf del $(OUTPUT)\ctbtest.ilf + -if exist $(OUTPUT)\ctbtest.ils del $(OUTPUT)\ctbtest.ils + +..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib: $(CTB_LIB_OBJECTS) + if exist $@ del $@ + tlib /a /p4096 $@ @&&| + $(CTB_LIB_OBJECTS) +| + +..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS) + ilink32 -Tpd -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib $(LDFLAGS) @&&| + c0d32.obj $(CTB_DLL_OBJECTS),$@,, winmm.lib $(__SYSLIB2_p) import32.lib cw32mt.lib,, +| + implib -f ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16 $@ + +$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib $(LDFLAGS) @&&| + c0x32.obj $(CTBTEST_OBJECTS),$@,, ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p) import32.lib cw32mt.lib,, +| + +wxinstall: + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\borland_lib + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\borland_lib + + @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 + @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 + @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 + +tip-win32: + @echo " " + @echo "================================================================" + @echo " The building of ctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)\lib\borland_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)\ctb-0.16" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " ctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + +$(OUTPUT)\ctb_lib_fifo.obj: .\..\src\fifo.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\fifo.cpp + +$(OUTPUT)\ctb_lib_getopt.obj: .\..\src\getopt.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\getopt.cpp + +$(OUTPUT)\ctb_lib_iobase.obj: .\..\src\iobase.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\iobase.cpp + +$(OUTPUT)\ctb_lib_portscan.obj: .\..\src\portscan.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\portscan.cpp + +$(OUTPUT)\ctb_lib_serportx.obj: .\..\src\serportx.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\serportx.cpp + +$(OUTPUT)\ctb_lib_serport.obj: .\..\src\win32\serport.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\serport.cpp + +$(OUTPUT)\ctb_lib_timer.obj: .\..\src\win32\timer.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\timer.cpp + +$(OUTPUT)\ctb_lib_gpib.obj: .\..\src\gpib.cpp + $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\gpib.cpp + +$(OUTPUT)\ctb_dll_fifo.obj: .\..\src\fifo.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\fifo.cpp + +$(OUTPUT)\ctb_dll_getopt.obj: .\..\src\getopt.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\getopt.cpp + +$(OUTPUT)\ctb_dll_iobase.obj: .\..\src\iobase.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\iobase.cpp + +$(OUTPUT)\ctb_dll_portscan.obj: .\..\src\portscan.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\portscan.cpp + +$(OUTPUT)\ctb_dll_serportx.obj: .\..\src\serportx.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\serportx.cpp + +$(OUTPUT)\ctb_dll_serport.obj: .\..\src\win32\serport.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\serport.cpp + +$(OUTPUT)\ctb_dll_timer.obj: .\..\src\win32\timer.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\timer.cpp + +$(OUTPUT)\ctb_dll_gpib.obj: .\..\src\gpib.cpp + $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\gpib.cpp + +$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp + $(CXX) -q -c -P -o$@ $(CTBTEST_CXXFLAGS) .\..\samples\ctbtest.cpp + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.gcc b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.gcc new file mode 100644 index 0000000000..febca07dc8 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.gcc @@ -0,0 +1,238 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.5 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# Compiler flags to link shared library +LINK_DLL_FLAGS ?= -shared + +# C++ compiler +CXX = g++ + +# Standard flags for C++ +CXXFLAGS ?= + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS ?= + +# Standard linker flags +LDFLAGS ?= + +# Set to 1 to build debug version [0,1] +DEBUG ?= 0 + +# +GPIB ?= 0 + +# +WXDIR ?= $(WXWIN) + +# +INSTALLDIR ?= $(WXWIN) + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF$@.d -MD -MP +CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \ + -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTB_LIB_OBJECTS = \ + $(OUTPUT)\ctb_lib_fifo.o \ + $(OUTPUT)\ctb_lib_getopt.o \ + $(OUTPUT)\ctb_lib_iobase.o \ + $(OUTPUT)\ctb_lib_portscan.o \ + $(OUTPUT)\ctb_lib_serportx.o \ + $(OUTPUT)\ctb_lib_serport.o \ + $(OUTPUT)\ctb_lib_timer.o \ + $(____GPIBSRC_FILENAMES_OBJECTS) +CTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \ + -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTB_DLL_OBJECTS = \ + $(OUTPUT)\ctb_dll_fifo.o \ + $(OUTPUT)\ctb_dll_getopt.o \ + $(OUTPUT)\ctb_dll_iobase.o \ + $(OUTPUT)\ctb_dll_portscan.o \ + $(OUTPUT)\ctb_dll_serportx.o \ + $(OUTPUT)\ctb_dll_serport.o \ + $(OUTPUT)\ctb_dll_timer.o \ + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -DGPIB=$(GPIB) -mthreads \ + $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)\ctbtest_ctbtest.o + +### Conditionally set variables: ### + +ifeq ($(DEBUG),0) +OUTPUT = release +endif +ifeq ($(DEBUG),1) +OUTPUT = debug +endif +ifeq ($(WXDIR),) +INSTALLDIR = ..\lib +endif +ifeq ($(DEBUG),1) +LIBFLAG = d +endif +ifeq ($(GPIB),1) +GPIBFLAG = _gpib +endif +ifeq ($(GPIB),1) +____GPIBSRC_FILENAMES_OBJECTS = \ + $(OUTPUT)\ctb_lib_gpib.o +endif +ifeq ($(GPIB),1) +____GPIBSRC_FILENAMES_1_OBJECTS = \ + $(OUTPUT)\ctb_dll_gpib.o +endif +ifeq ($(DEBUG),0) +____DEBUG = -DNDEBUG +endif +ifeq ($(DEBUG),1) +____DEBUG = +endif +ifeq ($(DEBUG),0) +__OPTIMIZE_FLAG = -O0 +endif +ifeq ($(DEBUG),1) +__OPTIMIZE_FLAG = -O2 +endif +ifeq ($(GPIB),1) +__SYSLIB2_p = -lgpib32 +endif +ifeq ($(DEBUG),0) +____DEBUG_1 = +endif +ifeq ($(DEBUG),1) +____DEBUG_1 = -g +endif + + +all: $(OUTPUT) +$(OUTPUT): + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all: ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean: + -if exist $(OUTPUT)\*.o del $(OUTPUT)\*.o + -if exist $(OUTPUT)\*.d del $(OUTPUT)\*.d + -if exist ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a del ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll + -if exist ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a del ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + +..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a: $(CTB_LIB_OBJECTS) + if exist $@ del $@ + ar rcu $@ $(CTB_LIB_OBJECTS) + ranlib $@ + +..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS) + $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(CTB_DLL_OBJECTS) $(____DEBUG_1) -mthreads -Wl,--out-implib=..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -L..\lib $(LDFLAGS) -lwinmm $(__SYSLIB2_p) + +$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a + $(CXX) -o $@ $(CTBTEST_OBJECTS) $(____DEBUG_1) -mthreads -L..\lib $(LDFLAGS) ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -lwinmm $(__SYSLIB2_p) + +wxinstall: + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\mingw_lib + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\mingw_lib + + @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 + @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 + @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 + +tip-win32: + @echo " " + @echo "================================================================" + @echo " The building of ctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)\lib\mingw_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)\ctb-0.16" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " ctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + +$(OUTPUT)\ctb_lib_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_lib_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_lib_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_lib_portscan.o: ./../src/portscan.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_lib_serportx.o: ./../src/serportx.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_lib_serport.o: ./../src/win32/serport.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_lib_timer.o: ./../src/win32/timer.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_lib_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_fifo.o: ./../src/fifo.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_getopt.o: ./../src/getopt.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_iobase.o: ./../src/iobase.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_portscan.o: ./../src/portscan.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_serportx.o: ./../src/serportx.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_serport.o: ./../src/win32/serport.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_timer.o: ./../src/win32/timer.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctb_dll_gpib.o: ./../src/gpib.cpp + $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< + +$(OUTPUT)\ctbtest_ctbtest.o: ./../samples/ctbtest.cpp + $(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all clean + + +SHELL := $(COMSPEC) + +# Dependencies tracking: +-include $(OUTPUT)/*.d diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.vc b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.vc new file mode 100644 index 0000000000..6b773f429b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.vc @@ -0,0 +1,260 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.5 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +CXX = cl + +# Standard flags for C++ +CXXFLAGS = + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS = + +# Standard linker flags +LDFLAGS = + +# Set to 1 to build debug version [0,1] +# 0 - Release +# 1 - Debug +DEBUG = 0 + +# +GPIB = 0 + +# +WXDIR = $(WXWIN) + +# +INSTALLDIR = $(WXWIN) + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CTB_LIB_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ + $(______DEBUG) /Fd..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb \ + $(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) +CTB_LIB_OBJECTS = \ + $(OUTPUT)\ctb_lib_fifo.obj \ + $(OUTPUT)\ctb_lib_getopt.obj \ + $(OUTPUT)\ctb_lib_iobase.obj \ + $(OUTPUT)\ctb_lib_portscan.obj \ + $(OUTPUT)\ctb_lib_serportx.obj \ + $(OUTPUT)\ctb_lib_serport.obj \ + $(OUTPUT)\ctb_lib_timer.obj \ + $(____GPIBSRC_FILENAMES_OBJECTS) +CTB_DLL_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ + $(______DEBUG) /Fd..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb \ + $(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) +CTB_DLL_OBJECTS = \ + $(OUTPUT)\ctb_dll_fifo.obj \ + $(OUTPUT)\ctb_dll_getopt.obj \ + $(OUTPUT)\ctb_dll_iobase.obj \ + $(OUTPUT)\ctb_dll_portscan.obj \ + $(OUTPUT)\ctb_dll_serportx.obj \ + $(OUTPUT)\ctb_dll_serport.obj \ + $(OUTPUT)\ctb_dll_timer.obj \ + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ + $(______DEBUG) /Fd$(OUTPUT)\ctbtest.pdb /DGPIB=$(GPIB) $(__OPTIMIZE_FLAG) \ + /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = \ + $(OUTPUT)\ctbtest_ctbtest.obj + +### Conditionally set variables: ### + +!if "$(DEBUG)" == "0" +OUTPUT = release +!endif +!if "$(DEBUG)" == "1" +OUTPUT = debug +!endif +!if "$(WXDIR)" == "" +INSTALLDIR = ..\lib +!endif +!if "$(DEBUG)" == "1" +LIBFLAG = d +!endif +!if "$(GPIB)" == "1" +GPIBFLAG = _gpib +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_OBJECTS = \ + $(OUTPUT)\ctb_lib_gpib.obj +!endif +!if "$(GPIB)" == "1" +____GPIBSRC_FILENAMES_1_OBJECTS = \ + $(OUTPUT)\ctb_dll_gpib.obj +!endif +!if "$(DEBUG)" == "0" +____DEBUG = /DNDEBUG +!endif +!if "$(DEBUG)" == "1" +____DEBUG = +!endif +!if "$(DEBUG)" == "0" +____DEBUG_2 = +!endif +!if "$(DEBUG)" == "1" +____DEBUG_2 = /Zi +!endif +!if "$(DEBUG)" == "0" +____DEBUG_3 = +!endif +!if "$(DEBUG)" == "1" +____DEBUG_3 = /DEBUG +!endif +!if "$(DEBUG)" == "0" +______DEBUG = +!endif +!if "$(DEBUG)" == "1" +______DEBUG = /D_DEBUG +!endif +!if "$(DEBUG)" == "0" +____DEBUG_4 = +!endif +!if "$(DEBUG)" == "1" +____DEBUG_4 = d +!endif +!if "$(DEBUG)" == "0" +__OPTIMIZE_FLAG = /Od +!endif +!if "$(DEBUG)" == "1" +__OPTIMIZE_FLAG = /O2 +!endif +!if "$(GPIB)" == "1" +__SYSLIB2_p = gpib32.lib +!endif + + +all: $(OUTPUT) +$(OUTPUT): + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all: ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean: + -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj + -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res + -if exist $(OUTPUT)\*.pch del $(OUTPUT)\*.pch + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilk del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilk + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + -if exist $(OUTPUT)\ctbtest.ilk del $(OUTPUT)\ctbtest.ilk + -if exist $(OUTPUT)\ctbtest.pdb del $(OUTPUT)\ctbtest.pdb + +..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib: $(CTB_LIB_OBJECTS) + if exist $@ del $@ + link /LIB /NOLOGO /OUT:$@ @<< + $(CTB_LIB_OBJECTS) +<< + +..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS) + link /DLL /NOLOGO /OUT:$@ $(____DEBUG_3) /pdb:"..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb" /LIBPATH:..\lib $(LDFLAGS) @<< + $(CTB_DLL_OBJECTS) winmm.lib $(__SYSLIB2_p) /IMPLIB:..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib +<< + +$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + link /NOLOGO /OUT:$@ $(____DEBUG_3) /pdb:"$(OUTPUT)\ctbtest.pdb" /LIBPATH:..\lib $(LDFLAGS) @<< + $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p) +<< + +wxinstall: + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\vc_lib + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\vc_lib + + @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 + @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 + @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 + +tip-win32: + @echo " " + @echo "================================================================" + @echo " The building of ctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)\lib\vc_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)\ctb-0.16" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " ctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + +$(OUTPUT)\ctb_lib_fifo.obj: .\..\src\fifo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\fifo.cpp + +$(OUTPUT)\ctb_lib_getopt.obj: .\..\src\getopt.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\getopt.cpp + +$(OUTPUT)\ctb_lib_iobase.obj: .\..\src\iobase.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\iobase.cpp + +$(OUTPUT)\ctb_lib_portscan.obj: .\..\src\portscan.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\portscan.cpp + +$(OUTPUT)\ctb_lib_serportx.obj: .\..\src\serportx.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\serportx.cpp + +$(OUTPUT)\ctb_lib_serport.obj: .\..\src\win32\serport.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\serport.cpp + +$(OUTPUT)\ctb_lib_timer.obj: .\..\src\win32\timer.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\timer.cpp + +$(OUTPUT)\ctb_lib_gpib.obj: .\..\src\gpib.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\gpib.cpp + +$(OUTPUT)\ctb_dll_fifo.obj: .\..\src\fifo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\fifo.cpp + +$(OUTPUT)\ctb_dll_getopt.obj: .\..\src\getopt.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\getopt.cpp + +$(OUTPUT)\ctb_dll_iobase.obj: .\..\src\iobase.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\iobase.cpp + +$(OUTPUT)\ctb_dll_portscan.obj: .\..\src\portscan.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\portscan.cpp + +$(OUTPUT)\ctb_dll_serportx.obj: .\..\src\serportx.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\serportx.cpp + +$(OUTPUT)\ctb_dll_serport.obj: .\..\src\win32\serport.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\serport.cpp + +$(OUTPUT)\ctb_dll_timer.obj: .\..\src\win32\timer.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\timer.cpp + +$(OUTPUT)\ctb_dll_gpib.obj: .\..\src\gpib.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\gpib.cpp + +$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CTBTEST_CXXFLAGS) .\..\samples\ctbtest.cpp + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.wat b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.wat new file mode 100644 index 0000000000..5041ddac36 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.wat @@ -0,0 +1,283 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.5 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# C++ compiler +CXX = wpp386 + +# Standard flags for C++ +CXXFLAGS = + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS = + +# Standard linker flags +LDFLAGS = + +# Set to 1 to build debug version [0,1] +# 0 - Release +# 1 - Debug +DEBUG = 0 + +# +GPIB = 0 + +# +WXDIR = $(%WXWIN) + +# +INSTALLDIR = $(%WXWIN) + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +# Speed up compilation a bit: +!ifdef __LOADDLL__ +! loaddll wcc wccd +! loaddll wccaxp wccdaxp +! loaddll wcc386 wccd386 +! loaddll wpp wppdi86 +! loaddll wppaxp wppdaxp +! loaddll wpp386 wppd386 +! loaddll wlink wlink +! loaddll wlib wlibd +!endif + +# We need these variables in some bakefile-made rules: +WATCOM_CWD = $+ $(%cdrive):$(%cwd) $- + +### Conditionally set variables: ### + +OUTPUT = +!ifeq DEBUG 0 +OUTPUT = release +!endif +!ifeq DEBUG 1 +OUTPUT = debug +!endif +INSTALLDIR = +!ifeq WXDIR +INSTALLDIR = ..\lib +!endif +LIBFLAG = +!ifeq DEBUG 1 +LIBFLAG = d +!endif +GPIBFLAG = +!ifeq GPIB 1 +GPIBFLAG = _gpib +!endif +____GPIBSRC_FILENAMES_OBJECTS = +!ifeq GPIB 1 +____GPIBSRC_FILENAMES_OBJECTS = & + $(OUTPUT)\ctb_lib_gpib.obj +!endif +____GPIBSRC_FILENAMES_1_OBJECTS = +!ifeq GPIB 1 +____GPIBSRC_FILENAMES_1_OBJECTS = & + $(OUTPUT)\ctb_dll_gpib.obj +!endif +____DEBUG = +!ifeq DEBUG 0 +____DEBUG = -dNDEBUG +!endif +!ifeq DEBUG 1 +____DEBUG = +!endif +____DEBUG_0 = +!ifeq DEBUG 0 +____DEBUG_0 = -d0 +!endif +!ifeq DEBUG 1 +____DEBUG_0 = -d2 +!endif +____DEBUG_2 = +!ifeq DEBUG 0 +____DEBUG_2 = +!endif +!ifeq DEBUG 1 +____DEBUG_2 = debug all +!endif +__OPTIMIZE_FLAG = +!ifeq DEBUG 0 +__OPTIMIZE_FLAG = -od +!endif +!ifeq DEBUG 1 +__OPTIMIZE_FLAG = -ot -ox +!endif +__SYSLIB2_p = +!ifeq GPIB 1 +__SYSLIB2_p = gpib32.lib +!endif + +### Variables: ### + +CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) & + -i=..\include $(CPPFLAGS) $(CXXFLAGS) +CTB_LIB_OBJECTS = & + $(OUTPUT)\ctb_lib_fifo.obj & + $(OUTPUT)\ctb_lib_getopt.obj & + $(OUTPUT)\ctb_lib_iobase.obj & + $(OUTPUT)\ctb_lib_portscan.obj & + $(OUTPUT)\ctb_lib_serportx.obj & + $(OUTPUT)\ctb_lib_serport.obj & + $(OUTPUT)\ctb_lib_timer.obj & + $(____GPIBSRC_FILENAMES_OBJECTS) +CTB_DLL_CXXFLAGS = -bd $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) & + -i=..\include $(CPPFLAGS) $(CXXFLAGS) +CTB_DLL_OBJECTS = & + $(OUTPUT)\ctb_dll_fifo.obj & + $(OUTPUT)\ctb_dll_getopt.obj & + $(OUTPUT)\ctb_dll_iobase.obj & + $(OUTPUT)\ctb_dll_portscan.obj & + $(OUTPUT)\ctb_dll_serportx.obj & + $(OUTPUT)\ctb_dll_serport.obj & + $(OUTPUT)\ctb_dll_timer.obj & + $(____GPIBSRC_FILENAMES_1_OBJECTS) +CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_0) -dGPIB=$(GPIB) -bm & + $(__OPTIMIZE_FLAG) -i=..\include $(CPPFLAGS) $(CXXFLAGS) +CTBTEST_OBJECTS = & + $(OUTPUT)\ctbtest_ctbtest.obj + + +all : $(OUTPUT) +$(OUTPUT) : + -if not exist $(OUTPUT) mkdir $(OUTPUT) + +### Targets: ### + +all : .SYMBOLIC ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 + +clean : .SYMBOLIC + -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj + -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res + -if exist $(OUTPUT)\*.lbc del $(OUTPUT)\*.lbc + -if exist $(OUTPUT)\*.ilk del $(OUTPUT)\*.ilk + -if exist $(OUTPUT)\*.pch del $(OUTPUT)\*.pch + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll + -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe + +..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib : $(CTB_LIB_OBJECTS) + @%create $(OUTPUT)\ctb_lib.lbc + @for %i in ($(CTB_LIB_OBJECTS)) do @%append $(OUTPUT)\ctb_lib.lbc +%i + wlib -q -p4096 -n -b $^@ @$(OUTPUT)\ctb_lib.lbc + +..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll : $(CTB_DLL_OBJECTS) + @%create $(OUTPUT)\ctb_dll.lbc + @%append $(OUTPUT)\ctb_dll.lbc option quiet + @%append $(OUTPUT)\ctb_dll.lbc name $^@ + @%append $(OUTPUT)\ctb_dll.lbc option caseexact + @%append $(OUTPUT)\ctb_dll.lbc $(____DEBUG_2) libpath ..\lib $(LDFLAGS) + @for %i in ($(CTB_DLL_OBJECTS)) do @%append $(OUTPUT)\ctb_dll.lbc file %i + @for %i in ( winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\ctb_dll.lbc library %i + @%append $(OUTPUT)\ctb_dll.lbc + @%append $(OUTPUT)\ctb_dll.lbc system nt_dll + wlink @$(OUTPUT)\ctb_dll.lbc + wlib -q -n -b ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib +$^@ + +$(OUTPUT)\ctbtest.exe : $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib + @%create $(OUTPUT)\ctbtest.lbc + @%append $(OUTPUT)\ctbtest.lbc option quiet + @%append $(OUTPUT)\ctbtest.lbc name $^@ + @%append $(OUTPUT)\ctbtest.lbc option caseexact + @%append $(OUTPUT)\ctbtest.lbc $(____DEBUG_2) libpath ..\lib $(LDFLAGS) + @for %i in ($(CTBTEST_OBJECTS)) do @%append $(OUTPUT)\ctbtest.lbc file %i + @for %i in ( ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\ctbtest.lbc library %i + @%append $(OUTPUT)\ctbtest.lbc + @for %i in () do @%append $(OUTPUT)\ctbtest.lbc option stack=%i + wlink @$(OUTPUT)\ctbtest.lbc + +wxinstall : + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\watcom_lib + @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\watcom_lib + + @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 + @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 + @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 + +tip-win32 : + @echo " " + @echo "================================================================" + @echo " The building of ctb is finished. If you have an installed " + @echo " wxWidget package (WXWIN must be defined in the enviroment), " + @echo " you'll now have to run: " + @echo " " + @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " + @echo " " + @echo " to install the libraries in: " + @echo " $(INSTALLDIR)\lib\watcom_lib " + @echo " and the header files in" + @echo " $(INSTALLDIR)\ctb-0.16" + @echo " " + @echo " If you are using another compiler (Borland, Watcom, mingw,...) " + @echo " take a look in the README in this directory! " + @echo " " + @echo " ctb comes with no guarantees and doesn't claim " + @echo " to be suitable for any purpose. " + @echo "================================================================" + @echo " " + +$(OUTPUT)\ctb_lib_fifo.obj : .AUTODEPEND .\..\src\fifo.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_lib_getopt.obj : .AUTODEPEND .\..\src\getopt.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_lib_iobase.obj : .AUTODEPEND .\..\src\iobase.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_lib_portscan.obj : .AUTODEPEND .\..\src\portscan.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_lib_serportx.obj : .AUTODEPEND .\..\src\serportx.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_lib_serport.obj : .AUTODEPEND .\..\src\win32\serport.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_lib_timer.obj : .AUTODEPEND .\..\src\win32\timer.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_lib_gpib.obj : .AUTODEPEND .\..\src\gpib.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_fifo.obj : .AUTODEPEND .\..\src\fifo.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_getopt.obj : .AUTODEPEND .\..\src\getopt.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_iobase.obj : .AUTODEPEND .\..\src\iobase.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_portscan.obj : .AUTODEPEND .\..\src\portscan.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_serportx.obj : .AUTODEPEND .\..\src\serportx.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_serport.obj : .AUTODEPEND .\..\src\win32\serport.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_timer.obj : .AUTODEPEND .\..\src\win32\timer.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctb_dll_gpib.obj : .AUTODEPEND .\..\src\gpib.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< + +$(OUTPUT)\ctbtest_ctbtest.obj : .AUTODEPEND .\..\samples\ctbtest.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CTBTEST_CXXFLAGS) $< + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/ctb.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/ctb.h new file mode 100644 index 0000000000..c71929f2be --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/ctb.h @@ -0,0 +1,139 @@ +#ifndef LIBCTB_CTB_H_INCLUDED_ +#define LIBCTB_CTB_H_INCLUDED_ + +#include "ctb-0.16/fifo.h" +#if ( GPIB ) +# include "ctb-0.16/gpib.h" +#endif +#include "ctb-0.16/getopt.h" +#include "ctb-0.16/iobase.h" +//#include "ctb-0.16/kbhit.h" +#include "ctb-0.16/portscan.h" +#include "ctb-0.16/serport.h" +#include "ctb-0.16/serportx.h" +#include "ctb-0.16/timer.h" + +/*! + \mainpage ctb overview + + The ctb (communication toolbox) library was realized, to simplify the + communication with other instruments throughout the serial com ports + (at first). To make my life easier, it should works with Linux and + all win32 plattforms (excepted windows 3.1, which is a only 16bit OS) + because I develope my applications for both plattforms).\n + Some times later GPIB support was added to make ctb an integrated part + for the extensive test and calibration system of a company I worked + these days.\n + The main goal of the library was a non-blocked communication to avoid + frozen GUIs waiting for data which in some conditions never arrives. + + On the base ctb defines an abstract class IOBase, which must be + derivate for several interfaces (at now this was done for the + RS232 comports and GPIB IEEE488 interface). + + This leads to another feature: Because all classes depends on one + super class, you have just open your wanted interface and don't + worry about it's special typ later. This is like the 'Virtual + Instrument' featured by Nation Instruments LabView. + + Last not least: ctb provides one written code for Linux and Windows + (compiles well with GNU G++ and VC++). Without any dependences (execept + for a standard C++ compilier) ctb runs also in small enviroments like + embedded systems and doesn't need any graphic stuff for use. + + ctb is composed of five parts: + + - ctb::IOBase class + - ctb::SerialPort class + - ctb::GpibDevice class + - ctb::Timer class + - ctb::Fifo class + + \section IOBase IOBase class + + An abstract class for different interfaces. The idea behind this: + Similar to the virtual file system this class defines a lot of + preset member functions, which the derivate classes must be + overload.\n + In the main thing these are: open a interface (such as RS232), + reading and writing non blocked through the interface and at + last, close it.\n + For special interface settings the method ioctl was defined. + (control interface). ioctl covers some interface dependent + settings like switch on/off the RS232 status lines and must also + be defined from each derivated class. + + + \section SerialPort SerialPort class + + The class for the serial ports is named as + ctb::SerialPort. SerialPort is a wrapper for non blocked reading and + writing. This is easy under linux, but with windows a lot more + tricky. SerialPort is as simple as possible. It doesn't create any + gui events or signals, so it works also standalone. It's also not a + device driver, means, you must call the read method, if you look for + receiving data. + + You can write any desired data with any length (length type is + size_t, I think, on win32 and linux this is a 32Bit integer) and + SerialPort returns the really writen data length, also you can read + a lot of data and SerialPort returns the really received data count. + + Both, read and write returns immediatelly. Using these, the program + never blocks. Also IOBase implements a blocked read and write. You can + use these functions, if you want a definitiv count of data and never + accept less than this. Because there is a difficulty, when the + communication is interrupted or death, both blocked functions get a + timeout flag to returns after a given time interval. The timeouts + will be handled with the second timer class. + + As an additional benefit ctb features also 9 Bit transmission (with + take advantage of the parity bit), non-standard baudrates (depending + on your hardware but not on ctb) and all parity eventualities + including static parity settings like Mark and Space. + + \section GpibDevice GpibDevice class + + Named as ctb::GpibDevice. In the philosophy of the SerialPort class + GpibDevice also supports non-blocking communication. You can instant + as many GpibDevice objects as you need for instance to communicate + with a lot of different bus participants in a typical GPIB enviroment. + GPIB support was tested with PCI cards and USB adapter from Nation + Instrument and Keithley. + + \section Timer Timer class + + The idea of the ctb::Timer class is to base on the Unix C alarm + function. You create a Timer with a given alarm time and a adress of + flag, which the timer must set after the time is over. + + Because the alarm function cannot used more than once in the same + process (under windows I don't know a similar function), every timer + instance will be a separate thread after starting it. So you can start + a timer and continue in your program, make a lot of things and test + the flag whenever you want this. (For example, you read/write a + given count of data). + + \note + I think, it's a better style, to request a given count of data in + 100ms (for example) and trap the situation, if there are not enough + data after this time. And not do this for every byte! + + \section Fifo Fifo cass + Provides a simple thread safe fifo to realize a fast and simple + communication pipe between two threads (and was used also as a put + back mechanism for the wxIOBase and it's derivated classes).\n + ctb::Fifo tackles the concurrently access from different threads with an + internal temporary pointer asignment which was atomic. From there no + mutex or semaphore is involved and lead to a fast access. + + Please note:\n + The thread safeness is limited to the put/get write/read methods but + which should be sufficent for a fifo. + + + \latexonly \newpage \endlatexonly + + */ + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/fifo.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/fifo.h new file mode 100644 index 0000000000..d17079d4a2 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/fifo.h @@ -0,0 +1,96 @@ +#ifndef __LIBCTB_FIFO_H_INCLUDED_ +#define __LIBCTB_FIFO_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: fifo.h +// Purpose: +// Author: Joachim Buermann, Michael Hungershausen +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include + +/** + \file fifo.h +*/ + +namespace ctb { + +/*! + \class Fifo + A simple thread safe fifo to realize a put back mechanism for the + wxIOBase and it's derivated classes. +*/ + class Fifo + { + protected: + /*! the size of the fifo */ + size_t m_size; + /*! the start of the internal fifo buffer */ + char* m_begin; + /*! + the end of the internal fifo buffer (m_end marks the first + invalid byte AFTER the internal buffer) + */ + char* m_end; + /*! the current read position */ + char* m_rdptr; + /*! the current write position */ + char* m_wrptr; + public: + /*! + \brief the constructor initialize a fifo with the given size. + \param size size of the fifo + */ + Fifo(size_t size); + /*! + \brief the destructor destroys all internal memory. + */ + virtual ~Fifo(); + /*! + \brief clear all internal memory and set the read and write + pointers to the start of the internal memory. + \Note This function is not thread safe! Don't use it, if another + thread takes access to the fifo instance. Use a looping get() or + read() call instead of this. + */ + virtual void clear(); + /*! + \brief fetch the next available byte from the fifo. + \param ch points to a charater to store the result + \return 1 if successful, 0 otherwise + */ + virtual int get(char* ch); + /*! + \brief query the fifo for it's available bytes. + \return count of readable bytes, storing in the fifo + */ + size_t items(); + /*! + \brief put a character into the fifo. + \param ch the character to put in + \return 1 if successful, 0 otherwise + */ + virtual int put(char ch); + /*! + \brief read a given count of bytes out of the fifo. + \param data memory to store the readed data + \param count number of bytes to read + \return On success, the number of bytes read are returned, + 0 otherwise + */ + virtual int read(char* data,int count); + /*! + \brief write a given count of bytes into the fifo. + \param data start of the data to write + \param count number of bytes to write + \return On success, the number of bytes written are returned, + 0 otherwise + */ + virtual int write(char* data,int count); + }; + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/getopt.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/getopt.h new file mode 100644 index 0000000000..2efd341889 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/getopt.h @@ -0,0 +1,19 @@ +#ifndef LIBCTB_GETOPT_H_INCLUDED_ +#define LIBCTB_GETOPT_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: getopt.h +// Purpose: Simple wrapper file +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#if defined (WIN32) +# include "win32/getopt.h" +#else +# include +#endif + +#endif +// __WX_GETOPT_H diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/gpib.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/gpib.h new file mode 100644 index 0000000000..1d360a8c49 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/gpib.h @@ -0,0 +1,378 @@ +#ifndef LIBCTB_GPIB_H_INCLUDED_ +#define LIBCTB_GPIB_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: gpibx.h +// Purpose: base class for gpib devices +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "ctb-0.16/iobase.h" + +namespace ctb { + +/*! + \file gpib.h +*/ + + /*! defines the os specific name for the first gpib controller */ + extern const char* GPIB1; + + /*! defines the os specific name for the second gpib controller */ + extern const char* GPIB2; + + /*! + \enum GpibTimeout + NI488.2 API defines the following valid timeouts. + */ + enum GpibTimeout + { + /// no timeout (infinity) + GpibTimeoutNone = 0, + /// 10 micro seconds + GpibTimeout10us, + /// 30 micro seconds + GpibTimeout30us, + /// 100 micro seconds + GpibTimeout100us, + /// 300 micro seconds + GpibTimeout300us, + /// 1 milli second + GpibTimeout1ms, + /// 3 milli seconds + GpibTimeout3ms, + /// 10 milli seconds + GpibTimeout10ms, + /// 30 milli seconds + GpibTimeout30ms, + /// 0.1 seconds + GpibTimeout100ms, + /// 0.3 seconds + GpibTimeout300ms, + /// 1 second + GpibTimeout1s, + /// 3 seconds + GpibTimeout3s, + /// 10 seconds + GpibTimeout10s, + /// 30 seconds + GpibTimeout30s, + /// 100 seconds + GpibTimeout100s, + /// 300 seconds (5 minutes) + GpibTimeout300s, + /// 1000 seconds + GpibTimeout1000s + }; + + /*! + \struct Gpib_DCS + + The device control struct for the gpib communication class. + This struct should be used, if you refer advanced parameter. + */ + struct Gpib_DCS + { + /*! primary address of GPIB device */ + int m_address1; + /*! secondary address of GPIB device */ + int m_address2; + /*! I/O timeout */ + GpibTimeout m_timeout; + /*! EOT enable */ + bool m_eot; + /*! + Defines the EOS character. + Note! Defining an EOS byte does not cause the driver to + automatically send that byte at the end of write I/O + operations. The application is responsible for placing the + EOS byte at the end of the data strings that it defines. + (National Instruments NI-488.2M Function Reference Manual) + */ + unsigned char m_eosChar; + /*! + Set the EOS mode (handling).m_eosMode may be a combination + of bits ORed together. The following bits can be used: + 0x04: Terminate read when EOS is detected. + 0x08: Set EOI (End or identify line) with EOS on write function + 0x10: Compare all 8 bits of EOS byte rather than low 7 bits + (all read and write functions). + */ + unsigned char m_eosMode; + /*! buffer for internal use */ + char m_buf[32]; + /*! to avoid memory leak warnings generated by swig */ + ~Gpib_DCS() {}; + /*! + \brief the constructor initiate the device control struct with + the common useful values and set the internal timeout for the + GPIB controller to 1ms to avoid (or better reduce) blocking + */ + Gpib_DCS() { + /*! set default device address to 1 */ + m_address1 = 1; + m_address2 = 0; + /*! + set the timeout to a short value to avoid blocking + (default are 1msec) + */ + m_timeout = GpibTimeout1ms; + m_eot = true; + /*! EOS character, see above! */ + m_eosChar = 0;//'\n'; + /*! EOS mode, see above! */ + m_eosMode = 0; + }; + /*! + \brief returns the internal parameters in a more human readable + string format like 'Adr: (1,0) to:1ms'. + \return the settings as a null terminated string + */ + char* GetSettings(); + }; + +/*! + \enum GpibIoctls + + The following Ioctl calls are only valid for the GpibDevice class. +*/ + enum GpibIoctls { + /*! + Set the adress of the via gpib connected device. + */ + CTB_GPIB_SETADR = CTB_GPIB, + /*! + Get the serial poll byte + */ + CTB_GPIB_GETRSP, + /*! + Get the GPIB status + */ + CTB_GPIB_GETSTA, + /*! + Get the last GPIB error number + */ + CTB_GPIB_GETERR, + /*! + Get the GPIB line status (hardware control lines) as an + integer. The lowest 8 bits correspond to the current state + of the lines. + */ + CTB_GPIB_GETLINES, + /*! + Set the GPIB specific timeout + */ + CTB_GPIB_SETTIMEOUT, + /*! + Forces the specified device to go to local program mode + */ + CTB_GPIB_GTL, + /*! + This routine can only be used if the specified GPIB + Interface Board is the System Controller. + Remember that even though the REN line is asserted, + the device(s) will not be put into remote state until is + addressed to listen by the Active Controller + */ + CTB_GPIB_REN, + /*! + The command asserts the GPIB interface clear (IFC) line for + ast least 100us if the GPIB board is the system controller. + This initializes the GPIB and makes the interface CIC and + active controller with ATN asserted. + Note! The IFC signal resets only the GPIB interface functions + of the bus devices and not the internal device functions. + For a device reset you should use the CTB_RESET command above. + */ + CTB_GPIB_RESET_BUS, + /*! + Configure the end-of-string (EOS) termination character. + Note! Defining an EOS byte does not cause the driver to + automatically send that byte at the end of write I/O + operations. The application is responsible for placing the + EOS byte at the end of the data strings that it defines. + (National Instruments NI-488.2M Function Reference Manual) + */ + CTB_GPIB_SET_EOS_CHAR, + /*! + Get the internal EOS termination character (see above). + */ + CTB_GPIB_GET_EOS_CHAR, + /*! + Set the EOS mode (handling).m_eosMode may be a combination + of bits ORed together. The following bits can be used: + 0x04: Terminate read when EOS is detected. + 0x08: Set EOI (End or identify line) with EOS on write function + 0x10: Compare all 8 bits of EOS byte rather than low 7 bits + (all read and write functions). + */ + CTB_GPIB_SET_EOS_MODE, + /*! + Get the internal EOS mode (see above). + */ + CTB_GPIB_GET_EOS_MODE, + }; + +/*! + \class GpibDevice + GpibDevice is the basic class for communication via the GPIB bus. +*/ + class GpibDevice : public IOBase + { + protected: + /*! + \brief + the internal board identifier, 0 for the first gpib controller, + 1 for the second one + */ + int m_board; + /*! + \brief + the file descriptor of the connected gpib device + */ + int m_hd; + /*! + \brief + contains the internal conditions of the GPIB communication like + GPIB error, timeout and so on... + */ + int m_state; + /*! the internal GPIB error number */ + int m_error; + /*! the count of data read or written */ + int m_count; + /*! + \brief contains the internal settings of the GPIB connection like + address, timeout, end of string character and so one... + */ + Gpib_DCS m_dcs; + int CloseDevice(); + /*! + \brief returns a short notation or more detail description of + the given GPIB error number. + \param error the occured GPIB error + \param detailed true for a more detailed description, false + otherwise + \return a null terminated string with the short or detailed + error message. + */ + virtual const char* GetErrorString(int error,bool detailed); + /*! + Open the interface (internally to request a file descriptor for the + given interface). The second parameter is a undefined pointer of a + Gpib_DCS data struct. + \param devname the name of the GPIB device, GPIB1 means the first + GPIB controller, GPIB2 the second (if available). + \param dcs untyped pointer of advanced device parameters, + \sa struct Gpib_DCS (data struct for the gpib device) + \return zero on success, otherwise -1 + */ + int OpenDevice(const char* devname, void* dcs); + public: + GpibDevice() { + m_board = -1; + m_hd = -1; + m_state = m_count = m_error = 0; + }; + virtual ~GpibDevice() {Close();}; + /*! + \brief returns the name of the class instance. You find this useful, + if you handle different devices like a serial port or a gpib device + via a IOBase pointer. + \return name of the class. + */ + const char* ClassName() {return "ctb::GpibDevice";}; + /*! + \brief returns a more detail description of the given error + number. + \param error the occured error number + \return null terminated string with the error description + */ + virtual const char* GetErrorDescription(int error) { + return GetErrorString(error,true); + }; + /*! + \brief returns a short notation like 'EABO' of the given error + number. + \param error the occured error number + \return null terminated string with the short error notation + */ + virtual const char* GetErrorNotation(int error) { + return GetErrorString(error,false); + }; + /*! + \brief request the current settings of the connected gpib device + as a null terminated string. + \return the settings as a string like 'Adr: (1,0) to:1ms' + */ + virtual char* GetSettingsAsString() { + return m_dcs.GetSettings(); + }; + /// This is only for internal usage + int Ibrd(char* buf,size_t len); + /// This is only for internal usage + int Ibwrt(char* buf,size_t len); + /*! + \brief Many operating characteristics are only possible for + special devices. To avoid the need of a lot of different functions + and to give the user a uniform interface, all this special + operating instructions will covered by one Ioctl methode (like + the linux ioctl call). + The Ioctl command (cmd) has encoded in it whether the argument + is an in parameter or out parameter, and the size of the + argument args in bytes. Macros and defines used in specifying an + ioctl request are located in iobase.h and the header file for + the derivated device (for example in gpib.h). + \param cmd one of GpibIoctls specify the ioctl request. + \param args is a typeless pointer to a memory location, where + Ioctl reads the request arguments or write the results. + Please note, that an invalid memory location or size involving + a buffer overflow or segmention fault! + */ + virtual int Ioctl(int cmd,void* args); + /*! + Returns the current state of the device. + \return 1 if device is valid and open, otherwise 0 + */ + int IsOpen() { + return m_hd >= 0; + }; + + /*! + \brief Opens a GPIB device in a user likely way. Insteed of + using the Device Control Struct just input your parameter in a + more intuitive manner. + \param devname the name of the GPIB controler like GPIB1 or GPIB2 + \param address the address of the connected device (1...31) + \return the new file descriptor, or -1 if an error occurred + */ + int Open( const char* devname, int address ); + + // Open overrides and hides the IOBase::Open( const char* + // devname, void* dcs ) of the base class! So bring it into scope + // again! + using IOBase::Open; + + int Read(char* buf,size_t len); + + int Write(char* buf,size_t len); + + /*! + \brief FindListener returns all listening devices connected to + the GPIB bus of the given board. + This function is not member of the GPIB class, becauce it + should do it's job before you open any GPIB connection. + \param board the board nummber. Default is the first board (=0). + Valid board numbers are 0 and 1. + \return -1 if an error occurred, otherwise a setting bit for + each listener address. Bit0 is always 0 (address 0 isn't valid, + Bit1 means address 1, Bit2 address 2 and so on... + */ + static int FindListeners(int board = 0); + }; + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/iobase.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/iobase.h new file mode 100644 index 0000000000..eda03b314f --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/iobase.h @@ -0,0 +1,294 @@ +#ifndef LIBCTB_IOBASE_H_INCLUDED_ +#define LIBCTB_IOBASE_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: iobase.h +// Purpose: io basic class +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "ctb-0.16/fifo.h" +#include + +/** + \file iobase.h +*/ + +namespace ctb { + + enum { + + CTB_COMMON = 0x0000, + CTB_SERIAL = 0x0100, + CTB_GPIB = 0x0200, + CTB_TIMEOUT_INFINITY = 0xFFFFFFFF + }; + +// const unsigned int wxTIMEOUT_INFINITY = 0xFFFFFFFF; + +/*! + \enum IOBaseIoctls + + Defines the ioctl calls for derivated classes. The following Ioctl + calls are valid for all from wxIOBase derivated classes. +*/ + enum IOBaseIoctls { + /*! + Reset the connected device. For a serial (RS232) connection, + a break is send. For GPIB the IFC (Interface Clear) line is + set. + */ + CTB_RESET = CTB_COMMON + }; + +/*! + \class IOBase + An abstract class for different interfaces. The idea behind this: + Similar to the virtual file system this class defines a lot of + preset member functions, which the derivate classes must be + overload. + In the main thing these are: open a interface (such as RS232), + reading and writing non blocked through the interface and at + last, close it. + For special interface settings the method ioctl was defined. + (control interface). ioctl covers some interface dependent + settings like switch on/off the RS232 status lines and must also + be defined from each derivated class. +*/ + + class IOBase + { + protected: + /*! + \brief internal fifo (first in, first out queue) to put back + already readed bytes into the reading stream. After put back a single + byte or sequence of characters, you can read them again with the + next Read call. + */ + Fifo* m_fifo; + enum { + /// fifosize of the putback fifo + fifoSize = 256 + }; + /*! + Close the interface (internally the file descriptor, which was + connected with the interface). + \return zero on success, otherwise -1. + */ + virtual int CloseDevice() = 0; + /*! + Open the interface (internally to request a file descriptor for the + given interface). The second parameter is a undefined pointer of a + device dependent data struct. It must be undefined, because different + devices have different settings. A serial device like the com ports + points here to a data struct, includes information like baudrate, + parity, count of stopbits and wordlen and so on. Another devices + (for example a IEEE) needs a adress and EOS (end of string character) + and don't use baudrate or parity. + \param devname the name of the device, presents the given interface. + Under windows for example COM1, under Linux /dev/cua0. Use wxCOMn to + avoid plattform depended code (n is the serial port number, beginning + with 1). + \param dcs untyped pointer of advanced device parameters, + \sa struct dcs_devCUA (data struct for the serail com ports) + \return zero on success, otherwise -1 + */ + virtual int OpenDevice(const char* devname, void* dcs = 0L) = 0; + public: + /*! + Default constructor + */ + IOBase() { + m_fifo = new Fifo(fifoSize); + }; + + /*! + Default destructor + */ + virtual ~IOBase() { + delete m_fifo; + }; + /*! + \brief A little helper function to detect the class name + \return the name of the class + */ + virtual const char* ClassName() {return "ctb::IOBase";}; + /*! + Closed the interface. Internally it calls the CloseDevice() + method, which must be defined in the derivated class. + \return zero on success, or -1 if an error occurred. + */ + int Close() {return CloseDevice();}; + + /*! + In this method we can do all things, which are different + between the discrete interfaces. The method is similar to the + C ioctl function. We take a command number and a integer + pointer as command parameter. + An example for this is the reset of a connection between a PC + and one ore more other instruments. On serial (RS232) connections + mostly a break will be send, GPIB on the other hand defines a + special line on the GPIB bus, to reset all connected devices. + If you only want to reset your connection, you should use the + Ioctl methode for doing this, independent of the real type of + the connection. + \param cmd a command identifier, (under Posix such as TIOCMBIS + for RS232 interfaces), IOBaseIoctls + \param args typeless parameter pointer for the command above. + \return zero on success, or -1 if an error occurred. + */ + virtual int Ioctl(int cmd,void* args) {return -1;}; + + /*! + Returns the current state of the device. + \return 1 if device is valid and open, otherwise 0 + */ + virtual int IsOpen() = 0; + + /*! + \param devname name of the interface, we want to open + \param dcs a untyped pointer to a device control struct. If + he is NULL, the default device parameter will be used. + \return the new file descriptor, or -1 if an error occurred + + The pointer dcs will be used for special device dependent + settings. Because this is very specific, the struct or + destination of the pointer will be defined by every device + itself. (For example: a serial device class should refer + things like parity, word length and count of stop bits, + a IEEE class adress and EOS character). + */ + int Open(const char* devname,void* dcs=0L) { + return OpenDevice(devname,dcs); + }; + + /*! + \brief In some circumstances you want to put back a already + readed byte (for instance, you have overreaded it and like to + parse the recieving bytes again). + The internal fifo stores fifoSize characters until you + have to read again. + \param ch the character to put back in the input stream + \return 1, if successful, otherwise 0 + */ + int PutBack(char ch) { + return m_fifo->put(ch); + }; + + /*! + Read attempt to read len bytes from the interface into the buffer + starting with buf. Read never blocks. If there are no bytes for + reading, Read returns zero otherwise the count of bytes been readed. + \param buf starting adress of the buffer + \param len count of bytes, we want to read + \return -1 on fails, otherwise the count of readed bytes + */ + virtual int Read(char* buf,size_t len) = 0; + + /*! + \brief + ReadUntilEos read bytes from the interface until the EOS string + was received or a timeout occurs. + ReadUntilEos returns the count of bytes been readed. The received + bytes are stored on the heap point by the readbuf pointer and + must delete by the caller. + \param readbuf points to the start of the readed bytes. You must + delete them, also if you received no byte. + \param readedBytes A pointer to the variable that receives the number + of bytes read. + \param eosString is the null terminated end of string sequence. + Default is the linefeed character. + \param timeout_in_ms the function returns after this time, also + if no eos occured (default is 1s). + \param quota defines a character between those an EOS doesn't + terminate the string + \return 1 on sucess (the operation ends successfull without a timeout), + 0 if a timeout occurred and -1 otherwise + */ + virtual int ReadUntilEOS(char*& readbuf, + size_t* readedBytes, + char* eosString = "\n", + long timeout_in_ms = 1000L, + char quota = 0); + + /*! + \brief + readv() attempts to read up to len bytes from the interface + into the buffer starting at buf. + readv() is blocked till len bytes are readed or the given + timeout in milliseconds was reached. + \param buf starting address of the buffer + \param len count bytes, we want to read + \param timeout_in_ms in milliseconds. If you don't want any timeout, + you give the wxTIMEOUT_INFINITY here. + But think of it: In this case, this function never returns + if there a not enough bytes to read. + \return the number of data bytes successfully read + */ + int Readv(char* buf,size_t len,unsigned int timeout_in_ms); + + /*! + \brief + readv() attempts to read up to len bytes from the interface + into the buffer starting at buf. + readv() is blocked till len bytes are readed or the timeout_flag + points on a int greater then zero. + \param buf starting adress of the buffer + \param len count bytes, we want to read + \param timeout_flag a pointer to an integer. If you don't want + any timeout, you given a null pointer here. + But think of it: In this case, this function comes never + back, if there a not enough bytes to read. + \param nice if true go to sleep for one ms (reduce CPU last), + if there is no byte available (default is false) + */ + int Readv(char* buf,size_t len,int* timeout_flag,bool nice=false); + + /*! + Write writes up to len bytes from the buffer starting with buf + into the interface. + \param buf start adress of the buffer + \param len count of bytes, we want to write + \return on success, the number of bytes written are returned + (zero indicates nothing was written). On error, -1 is returned. + */ + virtual int Write(char* buf,size_t len) = 0; + + /*! + Writev() writes up to len bytes to the interface from the buffer, + starting at buf. + Also Writev() blocks till all bytes are written or the given + timeout in milliseconds was reached. + \param buf starting address of the buffer + \param len count bytes, we want to write + \param timeout_in_ms timeout in milliseconds. If you give + wxTIMEOUT_INFINITY here, the function blocks, till all data was + written. + \return the number of data bytes successfully written. + */ + int Writev(char* buf,size_t len,unsigned int timeout_in_ms); + + /*! + Writev() writes up to len bytes to the interface from the buffer, + starting at buf. + Also Writev() blocks till all bytes are written or the timeout_flag + points to an integer greater then zero. + \param buf starting adress of the buffer + \param len count bytes, we want to write + \param timeout_flag a pointer to an integer. You also can give a null + pointer here. This blocks, til all data is writen. + \param nice if true go to sleep for one ms (reduce CPU last), + if there is no byte available (default is false) + */ + int Writev(char* buf,size_t len,int* timeout_flag,bool nice = false); + + }; + +} // namespace ctb + +#endif + + + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/kbhit.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/kbhit.h new file mode 100644 index 0000000000..2a0545439c --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/kbhit.h @@ -0,0 +1,10 @@ +#ifndef LIBCTB_KBHIT_H_INCLUDED_ +#define LIBCTB_KBHIT_H_INCLUDED_ + +namespace ctb { + + char GetKey(); + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h new file mode 100644 index 0000000000..d88528bd25 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h @@ -0,0 +1,94 @@ +#ifndef LIBCTB_LINUX_SERPORT_H_INCLUDED_ +#define LIBCTB_LINUX_SERPORT_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: linux/serport.h +// Purpose: +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "ctb-0.16/serportx.h" +#include +#include + +namespace ctb { + +/*! + \class SerialPort + + \brief the linux version +*/ + class SerialPort : public SerialPort_x + { + protected: + /*! + \brief under Linux, the serial ports are normal file descriptor + */ + int fd; + /*! + \brief Linux defines this struct termios for controling asynchronous + communication. t covered the active settings, save_t the original + settings. + */ + struct termios t, save_t; + + /*! + \brief The Linux serial driver summing all breaks, framings, overruns + and parity errors for each port during system runtime. Because we only + need the errors during a active connection, we must save the actual + error numbers in this separate structurs. + */ + struct serial_icounter_struct save_info, last_info; + + /*! + \brief adaptor member function, to convert the plattform independent + type wxBaud into a linux conform value. + \param baud the baudrate as wxBaud type + \return speed_t linux specific data type, defined in termios.h + */ + speed_t AdaptBaudrate( int baud ); + + int CloseDevice(); + int OpenDevice(const char* devname, void* dcs); + + /*! + \brief internal member function to set an unusal (non-standard) + baudrate. Called by SetBaudrate. + */ + int SetBaudrateAny( int baudrate ); + + /*! + \brief internal member function to set a standard baudrate. + Called by SetBaudrate. + */ + int SetBaudrateStandard( int baudrate ); + + public: + SerialPort(); + + ~SerialPort(); + + int ChangeLineState( SerialLineState flags ); + + int ClrLineState( SerialLineState flags ); + + int GetLineState(); + int Ioctl(int cmd,void* args); + int IsOpen(); + int Read(char* buf,size_t len); + int SendBreak(int duration); + + int SetBaudrate( int baudrate ); + + int SetParityBit( bool parity ); + + int SetLineState( SerialLineState flags ); + + int Write(char* buf,size_t len); + }; + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/timer.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/timer.h new file mode 100644 index 0000000000..7cc1a51e01 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/timer.h @@ -0,0 +1,139 @@ +#ifndef LIBCTB_LINUX_TIMER_H_INCLUDED_ +#define LIBCTB_LINUX_TIMER_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: linux/timer.h +// Purpose: +// Author: Joachim Buermann +// Id: $Id: timer.h,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +/** + \file timer.h +*/ + +#include + +namespace ctb { + +/*! + \brief A data struct, using from class timer. +*/ + struct timer_control + { + /*! + under linux, we used usec internally + */ + unsigned int usecs; + /*! + covers the adress of the exitflag + */ + int *exitflag; + /*! + covers the adress of the exit function. NULL, if + there was no exit function. + */ + void* (*exitfnc)(void*); + }; + +/*! + \class Timer + \brief A thread based timer class for handling timeouts in + an easier way. + + On starting every timer instance will create it's own thread. + The thread makes simply nothing, until it's given time is over. + After that, he set a variable, refer by it's adress to one + and exit. + + There are a lot of situations, which the timer class must handle. + The timer instance leaves his valid range (for example, the + timer instance is local inside a function, and the function fished) + BEFORE the thread was ending. In this case, the destructor must + terminate the thread in a correct way. (This is very different + between the OS. threads are a system resource like file descriptors + and must be deallocated after using it). + + The thread should be asynchronously stopped. Means, under all + circumstance, it must be possible, to finish the timer and start + it again. + + Several timer instance can be used simultanously. +*/ + class Timer + { + protected: + /*! + control covers the time interval, the adress + of the exitflag, and if not null, a function, which will + be called on the end. + */ + timer_control control; + /*! + stopped will be set by calling the stop() method. + Internaly the timer thread steadily tests the state of + this variable. If stopped not zero, the thread will be + finished. + */ + int stopped; + /*! + under linux we use the pthread library. tid covers the + identifier for a separate threads. + */ + pthread_t tid; + /*! + here we store the time interval, whilst the timer run. + This is waste!!! + */ + unsigned int timer_secs; + + public: + /*! + The constructor creates an timer object with the given + properties. The timer at this moment is not started. This + will be done with the start() member function. + \param msec time interval after that the the variable + pointed by exitflag is setting to one. + \param exitflag the adress of an integer, which was set + to one after the given time interval. + \warning The integer variable shouldn't leave it's valid + range, before the timer was finished. So never take a + local variable. + \param exitfnc A function, which was called after msec. + If you don't want this, refer a NULL pointer. + */ + Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)); + /*! + the destructor. If his was called (for example by leaving the + valid range of the timer object), the timer thread automaticaly + will finished. The exitflag wouldn't be set, also the exitfnc + wouldn't be called. + */ + ~Timer(); + /*! + starts the timer. But now a thread will created and started. + After this, the timer thread will be running until he was stopped + by calling stop() or reached his given time interval. + */ + int start(); + /*! + stops the timer and canceled the timer thread. After timer::stop() a new + start() will started the timer from beginning. + */ + int stop(); + }; + +/*! + \brief sleepms + A plattform independent function, to go to sleep for the given + time interval. + \param ms time interval in milli seconds +*/ + void sleepms(unsigned int ms); + +} // namespace ctb + +#endif + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/portscan.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/portscan.h new file mode 100644 index 0000000000..92c4ba11d6 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/portscan.h @@ -0,0 +1,25 @@ +#ifndef LIBCTB_PORTSCAN_H_INCLUDED_ +#define LIBCTB_PORTSCAN_H_INCLUDED_ + +#include +#include + +/** + \file portscan.h +*/ + +namespace ctb { + + /*! + \brief returns all available COM ports as an array of strings. + \param result stores the available COM ports + \param checkInUse return only ports which are available AND + unused (default) + \return true if successful, false otherwise + */ + bool GetAvailablePorts( std::vector& result, + bool checkInUse = true ); + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serport.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serport.h new file mode 100644 index 0000000000..9488753d4b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serport.h @@ -0,0 +1,20 @@ +#ifndef LIBCTB_SERPORT_H_INCLUDED_ +#define LIBCTB_SERPORT_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: serport.h +// Purpose: simple wrapper file +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#if defined (WIN32) +# include "ctb-0.16/win32/serport.h" +#else +# include "ctb-0.16/linux/serport.h" +#endif + +#endif +// __SERPORT_BASE_H + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serportx.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serportx.h new file mode 100644 index 0000000000..aa55c4ec59 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serportx.h @@ -0,0 +1,451 @@ +#ifndef LIBCTB_SERPORTX_H_INCLUDED_ +#define LIBCTB_SERPORTX_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: serportx.h +// Purpose: +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "ctb-0.16/iobase.h" + +#if defined (WIN32) +# define snprintf _snprintf +#endif + +/** + \file serportx.h +*/ + +/*! + \def SERIALPORT_NAME_LEN + defines the maximum length of the os depending serial port names +*/ +#define SERIALPORT_NAME_LEN 32 + +namespace ctb { + + /*! specifices the first serial port */ + extern const char* COM1; + /*! specifies the second serial port */ + extern const char* COM2; + /*! specifies the third serial port */ + extern const char* COM3; + /*! specifies the fourth serial port */ + extern const char* COM4; + /*! specifies the fifth serial port */ + extern const char* COM5; + /*! specifies the sixth serial port */ + extern const char* COM6; + /*! specifies the seventh serial port */ + extern const char* COM7; + /*! specifies the eighth serial port */ + extern const char* COM8; + /*! specifies the ninth serial port */ + extern const char* COM9; + /*! specifies the tenth serial port */ + extern const char* COM10; + /*! specifies the eleventh serial port */ + extern const char* COM11; + /*! specifies the twelfth serial port */ + extern const char* COM12; + /*! specifies the thriteenth serial port */ + extern const char* COM13; + /*! specifies the fourteenth serial port */ + extern const char* COM14; + /*! specifies the fiveteenth serial port */ + extern const char* COM15; + /*! specifies the sixteenth serial port */ + extern const char* COM16; + /*! specifies the seventeenth serial port */ + extern const char* COM17; + /*! specifies the eighteenth serial port */ + extern const char* COM18; + /*! specifies the nineteenth serial port */ + extern const char* COM19; + /*! specifies the twentieth serial port */ + extern const char* COM20; + + /*! + \enum Parity + + \brief Defines the different modes of parity checking. Under + Linux, the struct termios will be set to provide the wanted + behaviour. + */ + enum Parity + { + /*! no parity check */ + ParityNone, + /*! odd parity check */ + ParityOdd, + /*! even parity check */ + ParityEven, + /*! mark (not implemented yet) */ + ParityMark, + /*! space (not implemented yet) */ + ParitySpace + }; + + /*! + \enum SerialLineState + + Defines the different modem control lines. The value for + each item are defined in /usr/include/bits/ioctl-types.h. + This is the linux definition. The window version translate + each item in it's own value. + modem lines defined in ioctl-types.h + \code + #define TIOCM_LE 0x001 + #define TIOCM_DTR 0x002 + #define TIOCM_RTS 0x004 + #define TIOCM_ST 0x008 + #define TIOCM_SR 0x010 + #define TIOCM_CTS 0x020 + #define TIOCM_CAR 0x040 + #define TIOCM_RNG 0x080 + #define TIOCM_DSR 0x100 + #define TIOCM_CD TIOCM_CAR + #define TIOCM_RI TIOCM_RNG + \endcode + */ + enum SerialLineState + { + /*! Data Carrier Detect (read only) */ + LinestateDcd = 0x040, + /*! Clear To Send (read only) */ + LinestateCts = 0x020, + /*! Data Set Ready (read only) */ + LinestateDsr = 0x100, + /*! Data Terminal Ready (write only) */ + LinestateDtr = 0x002, + /*! Ring Detect (read only) */ + LinestateRing = 0x080, + /*! Request To Send (write only) */ + LinestateRts = 0x004, + /*! no active line state, use this for clear */ + LinestateNull = 0x000 + }; + + /*! + \struct SerialPort_DCS + + The device control struct for the serial communication class. + This struct should be used, if you refer advanced parameter. + */ + struct SerialPort_DCS + { + /*! the baudrate */ + int baud; + /*! the parity */ + Parity parity; + /*! the wordlen */ + unsigned char wordlen; + /*! count of stopbits */ + unsigned char stopbits; + /*! rtscts flow control */ + bool rtscts; + /*! XON/XOFF flow control */ + bool xonxoff; + /*! buffer for internal use */ + char buf[16]; + SerialPort_DCS() { + baud = 38400; + parity = ParityNone; + wordlen = 8; + stopbits = 1; + rtscts = false; + xonxoff = false; + }; + // to avoid memory leak warnings generated by swig + ~SerialPort_DCS() {}; + /*! + \brief returns the internal settings of the DCS as a human + readable string like '8N1 115200'. + \return the internal settings as null terminated string + */ + char* GetSettings() { + const char ac[5] = {'N','O','E','M','S'}; + memset(buf,0,sizeof(buf)); + snprintf(buf,sizeof(buf)-1,"%i%c%i %i", + wordlen, + ac[parity], + stopbits, + baud); + return buf; + }; + }; + +/*! + \struct SerialPort_EINFO + + The internal communication error struct. It contains the number + of each error (break, framing, overrun and parity) since opening + the serial port. Each error number will be cleared if the open + methode was called. +*/ + struct SerialPort_EINFO + { + /*! number of breaks */ + int brk; + /*! number of framing errors */ + int frame; + /*! number of overrun errors */ + int overrun; + /*! number of parity errors */ + int parity; + SerialPort_EINFO() { + brk = frame = overrun = parity = 0; + }; + ~SerialPort_EINFO() {}; + }; + + /*! + \enum SerialPortIoctls + + The following Ioctl calls are only valid for the SerialPort + class. + */ + enum SerialPortIoctls { + /*! + Get all numbers of occured communication errors (breaks + framing, overrun and parity), so the args parameter of + the Ioctl call must pointed to a SerialPort_EINFO + struct. + */ + CTB_SER_GETEINFO = CTB_SERIAL, + /*! + Get integer 1, if a break occured since the last call + so the args parameter of the Ioctl methode must pointed + to an integer value. If there was no break, the result + is integer 0. + */ + CTB_SER_GETBRK, + /*! + Get integer 1, if a framing occured since the last call + so the args parameter of the Ioctl methode must pointed + to an integer value. If there was no break, the result + is integer 0. + */ + CTB_SER_GETFRM, + /*! + Get integer 1, if a overrun occured since the last call + so the args parameter of the Ioctl methode must pointed + to an integer value. If there was no break, the result + is integer 0. + */ + CTB_SER_GETOVR, + /*! + Get integer 1, if a parity occured since the last call + so the args parameter of the Ioctl methode must pointed + to an integer value. If there was no break, the result + is integer 0. + */ + CTB_SER_GETPAR, + /*! + Get the number of bytes received by the serial port driver + but not yet read by a Read or Readv Operation. + */ + CTB_SER_GETINQUE, + /*! + Set the parity bit on or off to use it as a ninth bit. + */ + CTB_SER_SETPAR + }; + +/*! + \class SerialPort_x + SerialPort_x is the basic class for serial communication via + the serial comports. It is also an abstract class and defines + all necessary methods, which the derivated plattform depended + classes must be invoke. +*/ + class SerialPort_x : public IOBase + { + protected: + /*! + \brief contains the internal settings of the serial port like + baudrate, protocol, wordlen and so on. + */ + SerialPort_DCS m_dcs; + /*! + \brief contains the internal (os specific) name of the serial + device. + */ + char m_devname[SERIALPORT_NAME_LEN]; + public: + + /*! + \enum FlowControl + \brief Specifies the flow control. + + + */ + enum FlowControl + { + NoFlowControl, /*!< No flow control at all */ + + RtsCtsFlowControl, /*!< Enable RTS/CTS hardware flow control */ + + XonXoffFlowControl /*!< Enable XON/XOFF protocol */ + }; + + SerialPort_x() {m_devname[0] = '\0';}; + virtual ~SerialPort_x() {}; + /*! + \brief returns the name of the class instance. You find this useful, + if you handle different devices like a serial port or a gpib device + via a IOBase pointer. + \return name of the class. + */ + const char* ClassName() {return "ctb::SerialPort";}; + + /*! + \brief change the linestates according to which bits + are set/unset in flags. + \param flags valid line flags are SERIAL_LINESTATE_DSR and/or + SERIAL_LINESTATE_RTS + \return zero on success, -1 if an error occurs + */ + virtual int ChangeLineState( SerialLineState flags ) = 0; + + /*! + \brief turn off status lines depending upon which bits (DSR and/or RTS) + are set in flags. + \param flags valid line flags are SERIAL_LINESTATE_DSR and/or + SERIAL_LINESTATE_RTS + \return zero on success, -1 if an error occurs + */ + virtual int ClrLineState( SerialLineState flags ) = 0; + + /*! + \brief Read the line states of DCD, CTS, DSR and RING + \return returns the appropriate bits on sucess, otherwise -1 + */ + virtual int GetLineState() = 0; + + /*! + \brief request the current settings of the connected serial port + as a null terminated string. + \return the settings as a string like '8N1 115200' + */ + virtual char* GetSettingsAsString() { + return m_dcs.GetSettings(); + }; + + /*! + \brief Many operating characteristics are only possible for + special devices. To avoid the need of a lot of different functions + and to give the user a uniform interface, all this special + operating instructions will covered by one Ioctl methode (like + the linux ioctl call). + The Ioctl command (cmd) has encoded in it whether the argument + is an in parameter or out parameter, and the size of the + argument args in bytes. Macros and defines used in specifying an + ioctl request are located in iobase.h and the header file for + the derivated device (for example in serportx.h). + \param cmd one of SerialPortIoctls specify the ioctl request. + \param args is a typeless pointer to a memory location, where + Ioctl reads the request arguments or write the results. + Please note, that an invalid memory location or size involving + a buffer overflow or segmention fault! + */ + virtual int Ioctl(int cmd,void* args) {return -1;}; + + /*! + \brief Opens a serial port in a user likely way. Insteed of + using the Device Control Struct just input your parameter in a + more intuitive manner. + \param portname the name of the serial port + \param baudrate any baudrate, also an unusual one, if your + serial device support them + \param protocol a string with the number of databits (5...8), + the parity setting (N=None,O=Odd,E=Even,M=Mark,S=Space), also + in lower case, and the count of stopbits (1...2) + \param flowControl one of NoFlowControl, RtsCtsFlowControl or + XonXoffFlowControl. + \return the new file descriptor, or -1 if an error occurred + */ + int Open( const char* portname, int baudrate, + const char* protocol = "8N1", + FlowControl flowControl = NoFlowControl ); + + /*! + \brief Opens the serial port with the given number. + \note The port numbering starts with 1 (COM1 for windows and + /dev/ttyS0 for Linux. Please note, that USB to RS232 converter + in Linux are named as /dev/ttyUSBx and from there have to + opened with their device name! + \param number of the serial port count from 1 + \param baudrate any baudrate, also an unusual one, if your + serial device support them + \param protocol a string with the number of databits (5...8), + the parity setting (N=None,O=Odd,E=Even,M=Mark,S=Space), also + in lower case, and the count of stopbits (1...2) + \param flowControl one of NoFlowControl, RtsCtsFlowControl or + XonXoffFlowControl. + \return the new file descriptor, or -1 if an error occurred + */ + int Open( const int portnumber, int baudrate, + const char* protocol = "8N1", + FlowControl flowControl = NoFlowControl ); + + // Open overrides and hides the IOBase::Open( const char* + // devname, void* dcs ) of the base class! So bring it into scope + // again! + using IOBase::Open; + + /*! + \brief Sendbreak transmits a continuous stream of zero-valued + bits for a specific duration. + \param duration If duration is zero, it transmits + zero-valued bits for at least 0.25 seconds, and not more that + 0.5 seconds. If duration is not zero, it sends zero-valued bits + for duration*N seconds, where N is at least 0.25, and not more + than 0.5. + \return zero on success, -1 if an error occurs. + */ + virtual int SendBreak(int duration) = 0; + + /*! + \brief Set the baudrate (also non-standard) + Please note: Non-standard baudrates like 70000 are not supported + by each UART and depends on the RS232 chipset you apply. + \param baudrate the new baudrate + \return zero on success, -1 if an error occurs + */ + virtual int SetBaudrate( int baudrate ) = 0; + + /*! + \brief turn on status lines depending upon which bits (DSR and/or RTS) + are set in flags. + \param flags valid line flags are SERIAL_LINESTATE_DSR and/or + SERIAL_LINESTATE_RTS + \return zero on success, -1 if an error occurs + */ + virtual int SetLineState( SerialLineState flags ) = 0; + + /*! + \brief Set the parity bit to a firm state, for instance to use + the parity bit as the ninth bit in a 9 bit dataword + communication. + \return zero on succes, a negative value if an error occurs + */ + virtual int SetParityBit( bool parity ) = 0; + + /*! + \brief check the given baudrate against a list of standard rates. + \ return true, if the baudrate is a standard value, false + otherwise + */ + static bool IsStandardRate( int rate ); + + }; + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/timer.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/timer.h new file mode 100644 index 0000000000..b1313ebfef --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/timer.h @@ -0,0 +1,19 @@ +#ifndef LIBCTB_TIMER_H_INCLUDED_ +#define LIBCTB_TIMER_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: timer.h +// Purpose: simple wrapper file +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#if defined (WIN32) +# include "win32/timer.h" +#else +# include "linux/timer.h" +#endif + +#endif + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/getopt.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/getopt.h new file mode 100644 index 0000000000..afa50d4567 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/getopt.h @@ -0,0 +1,17 @@ +#ifndef LIBCTB_WIN32_GETOPT_H_INCLUDED_ +#define LIBCTB_WIN32_GETOPT_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: win32/getopt.h +// Purpose: +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +extern char* optarg; +extern int optind; + +int getopt(int argc, char* argv[], char* optstring); + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/gpib-32.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/gpib-32.h new file mode 100644 index 0000000000..627b30acfa --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/gpib-32.h @@ -0,0 +1,414 @@ +/* + * + * + * Win32 include file + * for accessing the 32-bit GPIB DLL (gpib-32.dll) + * + * + * Contains user variables (ibsta, iberr, ibcnt, ibcntl), + * function prototypes and useful defined constants for + * calling NI-488 and NI-488.2 routines from a Microsoft + * C/C++ Win32 application. + * + * + * Copyright 1998 National Instruments Corporation + * + */ + +#ifndef DECL_32_H // ensure we are only included once +#define DECL_32_H + +#include "windows.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/***************************************************************************/ +/* HANDY CONSTANTS FOR USE BY APPLICATION PROGRAMS ... */ +/***************************************************************************/ +#define UNL 0x3f /* GPIB unlisten command */ +#define UNT 0x5f /* GPIB untalk command */ +#define GTL 0x01 /* GPIB go to local */ +#define SDC 0x04 /* GPIB selected device clear */ +#define PPC 0x05 /* GPIB parallel poll configure */ +#define GET 0x08 /* GPIB group execute trigger */ +#define TCT 0x09 /* GPIB take control */ +#define LLO 0x11 /* GPIB local lock out */ +#define DCL 0x14 /* GPIB device clear */ +#define PPU 0.16 /* GPIB parallel poll unconfigure */ +#define SPE 0x18 /* GPIB serial poll enable */ +#define SPD 0x19 /* GPIB serial poll disable */ +#define PPE 0x60 /* GPIB parallel poll enable */ +#define PPD 0x70 /* GPIB parallel poll disable */ + +/* GPIB status bit vector : */ +/* global variable ibsta and wait mask */ + +#define ERR (1<<15) /* Error detected */ +#define TIMO (1<<14) /* Timeout */ +#define END (1<<13) /* EOI or EOS detected */ +#define SRQI (1<<12) /* SRQ detected by CIC */ +#define RQS (1<<11) /* Device needs service */ +#define CMPL (1<<8) /* I/O completed */ +#define LOK (1<<7) /* Local lockout state */ +#define REM (1<<6) /* Remote state */ +#define CIC (1<<5) /* Controller-in-Charge */ +#define ATN (1<<4) /* Attention asserted */ +#define TACS (1<<3) /* Talker active */ +#define LACS (1<<2) /* Listener active */ +#define DTAS (1<<1) /* Device trigger state */ +#define DCAS (1<<0) /* Device clear state */ + +/* Error messages returned in global variable iberr */ + +#define EDVR 0 /* System error */ +#define ECIC 1 /* Function requires GPIB board to be CIC */ +#define ENOL 2 /* Write function detected no Listeners */ +#define EADR 3 /* Interface board not addressed correctly*/ +#define EARG 4 /* Invalid argument to function call */ +#define ESAC 5 /* Function requires GPIB board to be SAC */ +#define EABO 6 /* I/O operation aborted */ +#define ENEB 7 /* Non-existent interface board */ +#define EDMA 8 /* Error performing DMA */ +#define EOIP 10 /* I/O operation started before previous */ + /* operation completed */ +#define ECAP 11 /* No capability for intended operation */ +#define EFSO 12 /* File system operation error */ +#define EBUS 14 /* Command error during device call */ +#define ESTB 15 /* Serial poll status byte lost */ +#define ESRQ 16 /* SRQ remains asserted */ +#define ETAB 20 /* The return buffer is full. */ +#define ELCK 21 /* Address or board is locked. */ + +/* EOS mode bits */ + +#define BIN (1<<12) /* Eight bit compare */ +#define XEOS (1<<11) /* Send END with EOS byte */ +#define REOS (1<<10) /* Terminate read on EOS */ + +/* Timeout values and meanings */ + +#define TNONE 0 /* Infinite timeout (disabled) */ +#define T10us 1 /* Timeout of 10 us (ideal) */ +#define T30us 2 /* Timeout of 30 us (ideal) */ +#define T100us 3 /* Timeout of 100 us (ideal) */ +#define T300us 4 /* Timeout of 300 us (ideal) */ +#define T1ms 5 /* Timeout of 1 ms (ideal) */ +#define T3ms 6 /* Timeout of 3 ms (ideal) */ +#define T10ms 7 /* Timeout of 10 ms (ideal) */ +#define T30ms 8 /* Timeout of 30 ms (ideal) */ +#define T100ms 9 /* Timeout of 100 ms (ideal) */ +#define T300ms 10 /* Timeout of 300 ms (ideal) */ +#define T1s 11 /* Timeout of 1 s (ideal) */ +#define T3s 12 /* Timeout of 3 s (ideal) */ +#define T10s 13 /* Timeout of 10 s (ideal) */ +#define T30s 14 /* Timeout of 30 s (ideal) */ +#define T100s 15 /* Timeout of 100 s (ideal) */ +#define T300s 16 /* Timeout of 300 s (ideal) */ +#define T1000s 17 /* Timeout of 1000 s (ideal) */ + + +/* IBLN Constants */ +#define NO_SAD 0 +#define ALL_SAD -1 + + +/* The following constants are used for the second parameter of the + * ibconfig function. They are the "option" selection codes. + */ +#define IbcPAD 0x0001 /* Primary Address */ +#define IbcSAD 0x0002 /* Secondary Address */ +#define IbcTMO 0x0003 /* Timeout Value */ +#define IbcEOT 0x0004 /* Send EOI with last data byte? */ +#define IbcPPC 0x0005 /* Parallel Poll Configure */ +#define IbcREADDR 0x0006 /* Repeat Addressing */ +#define IbcAUTOPOLL 0x0007 /* Disable Auto Serial Polling */ +#define IbcCICPROT 0x0008 /* Use the CIC Protocol? */ +#define IbcIRQ 0x0009 /* Use PIO for I/O */ +#define IbcSC 0x000A /* Board is System Controller? */ +#define IbcSRE 0x000B /* Assert SRE on device calls? */ +#define IbcEOSrd 0x000C /* Terminate reads on EOS */ +#define IbcEOSwrt 0x000D /* Send EOI with EOS character */ +#define IbcEOScmp 0x000E /* Use 7 or 8-bit EOS compare */ +#define IbcEOSchar 0x000F /* The EOS character. */ +#define IbcPP2 0x0010 /* Use Parallel Poll Mode 2. */ +#define IbcTIMING 0x0011 /* NORMAL, HIGH, or VERY_HIGH timing. */ +#define IbcDMA 0x0012 /* Use DMA for I/O */ +#define IbcReadAdjust 0x0013 /* Swap bytes during an ibrd. */ +#define IbcWriteAdjust 0x014 /* Swap bytes during an ibwrt. */ +#define IbcSendLLO 0x0017 /* Enable/disable the sending of LLO. */ +#define IbcSPollTime 0x0018 /* Set the timeout value for serial polls. */ +#define IbcPPollTime 0x0019 /* Set the parallel poll length period. */ +#define IbcEndBitIsNormal 0x001A /* Remove EOS from END bit of IBSTA. */ +#define IbcUnAddr 0x001B /* Enable/disable device unaddressing. */ +#define IbcSignalNumber 0x001C /* Set UNIX signal number - unsupported */ +#define IbcBlockIfLocked 0x001D /* Enable/disable blocking for locked boards/devices */ +#define IbcHSCableLength 0x001F /* Length of cable specified for high speed timing.*/ +#define IbcIst 0x0020 /* Set the IST bit. */ +#define IbcRsv 0x0021 /* Set the RSV byte. */ + +/* + * Constants that can be used (in addition to the ibconfig constants) + * when calling the ibask() function. + */ + +#define IbaPAD IbcPAD +#define IbaSAD IbcSAD +#define IbaTMO IbcTMO +#define IbaEOT IbcEOT +#define IbaPPC IbcPPC +#define IbaREADDR IbcREADDR +#define IbaAUTOPOLL IbcAUTOPOLL +#define IbaCICPROT IbcCICPROT +#define IbaIRQ IbcIRQ +#define IbaSC IbcSC +#define IbaSRE IbcSRE +#define IbaEOSrd IbcEOSrd +#define IbaEOSwrt IbcEOSwrt +#define IbaEOScmp IbcEOScmp +#define IbaEOSchar IbcEOSchar +#define IbaPP2 IbcPP2 +#define IbaTIMING IbcTIMING +#define IbaDMA IbcDMA +#define IbaReadAdjust IbcReadAdjust +#define IbaWriteAdjust IbcWriteAdjust +#define IbaSendLLO IbcSendLLO +#define IbaSPollTime IbcSPollTime +#define IbaPPollTime IbcPPollTime +#define IbaEndBitIsNormal IbcEndBitIsNormal +#define IbaUnAddr IbcUnAddr +#define IbaSignalNumber IbcSignalNumber +#define IbaBlockIfLocked IbcBlockIfLocked +#define IbaHSCableLength IbcHSCableLength +#define IbaIst IbcIst +#define IbaRsv IbcRsv + +#define IbaBNA 0x0200 /* A device's access board. */ + + +/* Values used by the Send 488.2 command. */ +#define NULLend 0x00 /* Do nothing at the end of a transfer.*/ +#define NLend 0x01 /* Send NL with EOI after a transfer. */ +#define DABend 0x02 /* Send EOI with the last DAB. */ + +/* Value used by the 488.2 Receive command. + */ +#define STOPend 0x0100 + + +/* Address type (for 488.2 calls) */ + +typedef short Addr4882_t; /* System dependent: must be 16 bits */ + +/* + * This macro can be used to easily create an entry in address list + * that is required by many of the 488.2 functions. The primary address goes in the + * lower 8-bits and the secondary address goes in the upper 8-bits. + */ +#define MakeAddr(pad, sad) ((Addr4882_t)(((pad)&0xFF) | ((sad)<<8))) + +/* + * This value is used to terminate an address list. It should be + * assigned to the last entry. + */ +#ifndef NOADDR +#define NOADDR (Addr4882_t)((unsigned short)0xFFFF) +#endif + +/* + * The following two macros are used to "break apart" an address list + * entry. They take an unsigned integer and return either the primary + * or secondary address stored in the integer. + */ +#define GetPAD(val) ((val) & 0xFF) +#define GetSAD(val) (((val) >> 8) & 0xFF) + +/* iblines constants */ + +#define ValidEOI (short)0x0080 +#define ValidATN (short)0x0040 +#define ValidSRQ (short)0x0020 +#define ValidREN (short)0x0010 +#define ValidIFC (short)0x0008 +#define ValidNRFD (short)0x0004 +#define ValidNDAC (short)0x0002 +#define ValidDAV (short)0x0001 +#define BusEOI (short)0x8000 +#define BusATN (short)0x4000 +#define BusSRQ (short)0x2000 +#define BusREN (short)0x1000 +#define BusIFC (short)0x0800 +#define BusNRFD (short)0x0400 +#define BusNDAC (short)0x0200 +#define BusDAV (short)0x0100 + +/**** + **** typedef for ibnotify callback **** + ****/ +typedef int (__stdcall * GpibNotifyCallback_t)(int, int, int, long, PVOID); + +#define IBNOTIFY_REARM_FAILED 0xE00A003F + + +/*************************************************************************/ +/* */ +/* iblockx and ibunlockx definitions --- for use with GPIB-ENET only !! */ +/* */ +/*************************************************************************/ +#define TIMMEDIATE -1 +#define TINFINITE -2 +#define MAX_LOCKSHARENAME_LENGTH 64 + +#if defined(UNICODE) + #define iblockx iblockxW +#else + #define iblockx iblockxA +#endif + +extern int __stdcall iblockxA (int ud, int LockWaitTime, PCHAR LockShareName); +extern int __stdcall iblockxW (int ud, int LockWaitTime, PWCHAR LockShareName); +extern int __stdcall ibunlockx (int ud); + + +/***************************************************************************/ +/* IBSTA, IBERR, IBCNT, IBCNTL and FUNCTION PROTOTYPES */ +/* ( only included if not accessing the 32-bit DLL directly ) */ +/***************************************************************************/ +#if !defined(GPIB_DIRECT_ACCESS) + +/* + * Set up access to the user variables (ibsta, iberr, ibcnt, ibcntl). + * These are declared and exported by the 32-bit DLL. Separate copies + * exist for each process that accesses the DLL. They are shared by + * multiple threads of a single process. + */ + +extern int ibsta; +extern int iberr; +extern int ibcnt; +extern long ibcntl; + + +#if defined(UNICODE) + #define ibbna ibbnaW + #define ibfind ibfindW + #define ibrdf ibrdfW + #define ibwrtf ibwrtfW +#else + #define ibbna ibbnaA + #define ibfind ibfindA + #define ibrdf ibrdfA + #define ibwrtf ibwrtfA +#endif + +/* + * Extern 32-bit GPIB DLL functions + */ + +/* NI-488 Function Prototypes */ +extern int __stdcall ibfindA (LPCSTR udname); +extern int __stdcall ibbnaA (int ud, LPCSTR udname); +extern int __stdcall ibrdfA (int ud, LPCSTR filename); +extern int __stdcall ibwrtfA (int ud, LPCSTR filename); + +extern int __stdcall ibfindW (LPCWSTR udname); +extern int __stdcall ibbnaW (int ud, LPCWSTR udname); +extern int __stdcall ibrdfW (int ud, LPCWSTR filename); +extern int __stdcall ibwrtfW (int ud, LPCWSTR filename); + +extern int __stdcall ibask (int ud, int option, PINT v); +extern int __stdcall ibcac (int ud, int v); +extern int __stdcall ibclr (int ud); +extern int __stdcall ibcmd (int ud, PVOID buf, long cnt); +extern int __stdcall ibcmda (int ud, PVOID buf, long cnt); +extern int __stdcall ibconfig (int ud, int option, int v); +extern int __stdcall ibdev (int boardID, int pad, int sad, int tmo, int eot, int eos); +extern int __stdcall ibdiag (int ud, PVOID buf, long cnt); +extern int __stdcall ibdma (int ud, int v); +extern int __stdcall ibeos (int ud, int v); +extern int __stdcall ibeot (int ud, int v); +extern int __stdcall ibgts (int ud, int v); +extern int __stdcall ibist (int ud, int v); +extern int __stdcall iblines (int ud, PSHORT result); +extern int __stdcall ibln (int ud, int pad, int sad, PSHORT listen); +extern int __stdcall ibloc (int ud); +extern int __stdcall ibnotify (int ud, int mask, GpibNotifyCallback_t Callback, PVOID RefData); +extern int __stdcall ibonl (int ud, int v); +extern int __stdcall ibpad (int ud, int v); +extern int __stdcall ibpct (int ud); +extern int __stdcall ibpoke (int ud, long option, long v); +extern int __stdcall ibppc (int ud, int v); +extern int __stdcall ibrd (int ud, PVOID buf, long cnt); +extern int __stdcall ibrda (int ud, PVOID buf, long cnt); +extern int __stdcall ibrpp (int ud, PCHAR ppr); +extern int __stdcall ibrsc (int ud, int v); +extern int __stdcall ibrsp (int ud, PCHAR spr); +extern int __stdcall ibrsv (int ud, int v); +extern int __stdcall ibsad (int ud, int v); +extern int __stdcall ibsic (int ud); +extern int __stdcall ibsre (int ud, int v); +extern int __stdcall ibstop (int ud); +extern int __stdcall ibtmo (int ud, int v); +extern int __stdcall ibtrg (int ud); +extern int __stdcall ibwait (int ud, int mask); +extern int __stdcall ibwrt (int ud, PVOID buf, long cnt); +extern int __stdcall ibwrta (int ud, PVOID buf, long cnt); + +// GPIB-ENET only functions to support locking across machines +extern int __stdcall iblock (int ud); +extern int __stdcall ibunlock (int ud); + +/**************************************************************************/ +/* Functions to access Thread-Specific copies of the GPIB global vars */ + +extern int __stdcall ThreadIbsta (void); +extern int __stdcall ThreadIberr (void); +extern int __stdcall ThreadIbcnt (void); +extern long __stdcall ThreadIbcntl (void); + + +/**************************************************************************/ +/* NI-488.2 Function Prototypes */ + +extern void __stdcall AllSpoll (int boardID, Addr4882_t * addrlist, PSHORT results); +extern void __stdcall DevClear (int boardID, Addr4882_t addr); +extern void __stdcall DevClearList (int boardID, Addr4882_t * addrlist); +extern void __stdcall EnableLocal (int boardID, Addr4882_t * addrlist); +extern void __stdcall EnableRemote (int boardID, Addr4882_t * addrlist); +extern void __stdcall FindLstn (int boardID, Addr4882_t * addrlist, Addr4882_t * results, int limit); +extern void __stdcall FindRQS (int boardID, Addr4882_t * addrlist, PSHORT dev_stat); +extern void __stdcall PPoll (int boardID, PSHORT result); +extern void __stdcall PPollConfig (int boardID, Addr4882_t addr, int dataLine, int lineSense); +extern void __stdcall PPollUnconfig (int boardID, Addr4882_t * addrlist); +extern void __stdcall PassControl (int boardID, Addr4882_t addr); +extern void __stdcall RcvRespMsg (int boardID, PVOID buffer, long cnt, int Termination); +extern void __stdcall ReadStatusByte(int boardID, Addr4882_t addr, PSHORT result); +extern void __stdcall Receive (int boardID, Addr4882_t addr, PVOID buffer, long cnt, int Termination); +extern void __stdcall ReceiveSetup (int boardID, Addr4882_t addr); +extern void __stdcall ResetSys (int boardID, Addr4882_t * addrlist); +extern void __stdcall Send (int boardID, Addr4882_t addr, PVOID databuf, long datacnt, int eotMode); +extern void __stdcall SendCmds (int boardID, PVOID buffer, long cnt); +extern void __stdcall SendDataBytes (int boardID, PVOID buffer, long cnt, int eot_mode); +extern void __stdcall SendIFC (int boardID); +extern void __stdcall SendLLO (int boardID); +extern void __stdcall SendList (int boardID, Addr4882_t * addrlist, PVOID databuf, long datacnt, int eotMode); +extern void __stdcall SendSetup (int boardID, Addr4882_t * addrlist); +extern void __stdcall SetRWLS (int boardID, Addr4882_t * addrlist); +extern void __stdcall TestSRQ (int boardID, PSHORT result); +extern void __stdcall TestSys (int boardID, Addr4882_t * addrlist, PSHORT results); +extern void __stdcall Trigger (int boardID, Addr4882_t addr); +extern void __stdcall TriggerList (int boardID, Addr4882_t * addrlist); +extern void __stdcall WaitSRQ (int boardID, PSHORT result); + +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif // DECL_32_H + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/serport.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/serport.h new file mode 100644 index 0000000000..503f25cffb --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/serport.h @@ -0,0 +1,74 @@ +#ifndef LIBCTB_WIN32_TIMER_H_INCLUDED_ +#define LIBCTB_WIN32_TIMER_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: win32/serport.h +// Purpose: +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "../serportx.h" +#include + +namespace ctb { + + /*! + \class SerialPort + + \brief the win32 version + */ + class SerialPort : public SerialPort_x + { + protected: + /*! + \brief the win32 api equivalent for the Linux + file descriptor + */ + HANDLE fd; + /*! + \brief a very special struct in the win32 api for controling + an asynchronous serial communication through the com ports. + */ + OVERLAPPED m_ov; + + /*! + \brief The win32 API only allows to test for an existing + break, framing, overrun or parity, not for the occured numbers. + So every error event decrement this internal error struct and + can request by an Ioctl call. + */ + SerialPort_EINFO einfo; + + /*! + \brief The win32 API doesn't have any function to detect the + current state of the output lines RST and DTR (if someone knows + some function, please contact me). + So we save the state always after changing one or both lines + (for example, on Open, SetLineState and ChangeLineState) + */ + int m_rtsdtr_state; + + int CloseDevice(); + int OpenDevice(const char* devname, void* dcs); + public: + SerialPort(); + ~SerialPort(); + + int ChangeLineState( SerialLineState flags ); + int ClrLineState( SerialLineState flags ); + int GetLineState(); + int Ioctl(int cmd,void* args); + int IsOpen(); + int Read(char* buf,size_t len); + int SendBreak(int duration); + int SetBaudrate( int baudrate ); + int SetLineState( SerialLineState flags ); + int SetParityBit( bool parity ); + int Write(char* buf,size_t len); + }; + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/timer.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/timer.h new file mode 100644 index 0000000000..e750baead3 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/timer.h @@ -0,0 +1,140 @@ +#ifndef LIBCTB_WINDOWS_TIMER_H_INCLUDED_ +#define LIBCTB_WINDOWS_TIMER_H_INCLUDED_ + +///////////////////////////////////////////////////////////////////////////// +// Name: win32/timer.h +// Purpose: +// Author: Joachim Buermann +// Copyright: (c) 2010 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include + +namespace ctb { + +/*! + \brief A data struct, using from class timer. +*/ + struct timer_control + { + /*! + under win32, we used msec internally + */ + unsigned int msecs; + /*! + covers the adress of the exitflag + */ + int *exitflag; + /*! + the running thread steadily polls this variable (only under win32). + If it's not zero, the thread terminate. + */ + MMRESULT stop; + /*! + covers the adress of the exit function. NULL, if + there was no exit function. + */ + void* (*exitfnc)(void*); + }; + +/*! + \class Timer + \brief A thread based timer class for handling timeouts in + an easier way. + + On starting every timer instance will create it's own thread. + The thread makes simply nothing, until it's given time is over. + After that, he set a variable, refer by it's adress to one + and exit. + + There are a lot of situations, which the timer class must handle. + The timer instance leaves his valid range (for example, the + timer instance is local inside a function, and the function fished) + BEFORE the thread was ending. In this case, the destructor must + terminate the thread in a correct way. (This is very different + between the OS. threads are a system resource like file descriptors + and must be deallocated after using it). + + The thread should be asynchronously stopped. Means, under all + circumstance, it must be possible, to finish the timer and start + it again. + + Several timer instance can be used simultanously. +*/ + class Timer + { + protected: + /*! + \brief win32 needs this + */ + DWORD id; + /*! + \brief in win32 internal handle for the timer thread + */ + MMRESULT h; + /*! + control covers the time interval, the adress + of the exitflag, and if not null, a function, which will + be called on the end. + */ + timer_control control; + /*! + here we store the time interval, whilst the timer run. + This is waste!!! + */ + unsigned int timer_secs; + public: + /*! + The constructor creates an timer object with the given + properties. The timer at this moment is not started. This + will be done with the start() member function. + \param msec time interval after that the the variable + pointed by exitflag is setting to one. + \param exitflag the adress of an integer, which was set + to one after the given time interval. + \warning The integer variable shouldn't leave it's valid + range, before the timer was finished. So never take a + local variable. + \param exitfnc A function, which was called after msec. + If you don't want this, refer a NULL pointer. + */ + Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)); + /*! + the destructor. If his was called (for example by leaving the + valid range of the timer object), the timer thread automaticaly + will finished. The exitflag wouldn't be set, also the exitfnc + wouldn't be called. + */ + ~Timer(); + /*! + starts the timer. But now a thread will created and started. + After this, the timer thread will be running until he was stopped + by calling stop() or reached his given time interval. + */ + int start(); + /*! + stops the timer and canceled the timer thread. After timer::stop() a new + start() will started the timer from beginning. + */ + int stop(); + }; + +/*! + \fn kill_all_timer() + \warning This function don't works under win32 and will be removed next + time. So don't use that! +*/ + void kill_all_timer(); + +/*! + \fn + A plattform independent function, to go to sleep for the given + time interval. + \param ms time interval in milli seconds +*/ + void sleepms(unsigned int ms); + +} // namespace ctb + +#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/lib/EMPTY b/src/mod/endpoints/mod_gsmopen/libctb-0.16/lib/EMPTY new file mode 100644 index 0000000000..887ae9333d --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/lib/EMPTY @@ -0,0 +1 @@ +ciao diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/manual/refman.pdf b/src/mod/endpoints/mod_gsmopen/libctb-0.16/manual/refman.pdf new file mode 100644 index 0000000000..285e523de3 Binary files /dev/null and b/src/mod/endpoints/mod_gsmopen/libctb-0.16/manual/refman.pdf differ diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/ctb.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/ctb.py new file mode 100644 index 0000000000..6b541ffe39 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/ctb.py @@ -0,0 +1,455 @@ +import wxctb, sys, re + +DCD = wxctb.LinestateDcd +CTS = wxctb.LinestateCts +DSR = wxctb.LinestateDsr +DTR = wxctb.LinestateDtr +RING = wxctb.LinestateRing +RTS = wxctb.LinestateRts +NULL = wxctb.LinestateNull + +def abstract(): + import inspect + caller = inspect.getouterframes(inspect.currentframe())[1][3] + raise NotImplementedError(caller + ' must be implemented in subclass') + +class IOBase: + def __init__(self): + self.device = None + # set timeout to 1000ms (the default) + self.timeout = 1000 + + def __del__(self): + pass + + def Close(self): + if self.device: + self.device.Close() + + def GetTimeout(self): + """ + Returns the internal timeout value in milliseconds + """ + return self.timeout + + def Ioctl(self,cmd,arg): + if self.device: + self.device.Ioctl(cmd,arg) + + def Open(self): + abstract() + + def PutBack(self,char): + return self.device.PutBack(char) + + def Read(self,length): + """ + Try to read the given count of data (length) and returns the + successfully readed number of data. The function never blocks. + For example: + readed = dev.Read(100) + """ + buf = "\x00"*(length+1) + rd = self.device.Read(buf,length) + return buf[0:rd] + + def ReadBinary(self,eos="\n"): + """ + Special SCPI command. Read the next data coded as a SCPI + binary format. + A binary data transfer will be startet by '#'. The next byte + tells the count of bytes for the binary length header, + following by the length bytes. After these the data begins. + For example: + #500004xxxx + The header length covers 5 Byte, the length of the binary + data is 4 (x means the binary data bytes) + """ + try: + eoslen = len(eos) + b=self.Readv(2) + if len(b) == 2: + hl = int(b[1]) + b = self.Readv(hl) + if len(b) == hl: + dl = int(b) + # don't left over the eos string or character in the + # device input buffer + data = self.Readv(dl+eoslen) + # check, if the binary data block is complete + if data[dl] == '#': + # not complete, another block is following + for c in data[dl:dl+eoslen]: + self.PutBack(c) + + data = data[:dl] + self.ReadBinary() + return data + except: + pass + return '' + + def ReadUntilEOS(self,eos="\n",quota=0): + """ + ReadUntilEOS(eosString=\"\\n\",timeout=1000) + Reads data until the given eos string was received (default is + the linefeed character (0x0a) or the internal timeout + (default 1000ms) was reached. + ReadUntilEOS returns the result as the following tuple: + ['received string',state,readedBytes] + If a timeout occurred, state is 0, otherwise 1 + """ + return self.device.ReadUntilEOS("",0,eos,self.timeout,quota) + + def Readv(self,length): + """ + Try to read the given count of data. Readv blocks until all data + was readed successfully or the internal timeout, set with the + class member function SetTimeout(timeout), was reached. + Returns the readed data. + """ + buf = "\x00"*length + rd = self.device.Readv(buf,length,self.timeout) + return buf[0:rd] + + def ResetBus(self): + """ + If the underlaying interface needs some special reset operations + (for instance the GPIB distinguish between a normal device reset + and a special bus reset), you can put some code here) + """ + pass + + def SetTimeout(self,timeout): + """ + Set the internal timeout value in milliseconds for all blocked + operations like ReadUntilEOS, Readv and Writev. + """ + self.timeout = timeout + + def Write(self,string): + """ + Writes the given string to the device and returns immediately. + Write returns the number of data bytes successfully written or a + negativ number if an error occured. For some circumstances, not + the complete string was written. + So you have to verify the return value to check this out. + """ + return self.device.Write(string,len(string)) + + def Writev(self,string): + """ + Writes the given string to the device. The function blocks until + the complete string was written or the internal timeout, set with + SetTimeout(timeout), was reached. + Writev returns the number of data successfully written or a + negativ value, if an errors occurred. + """ + return self.device.Writev(string,len(string),self.timeout) + +class SerialPort(IOBase): + def __init__(self): + IOBase.__init__(self) + + def __del__(self): + self.Close() + + def ChangeLineState(self,lineState): + """ + Change (toggle) the state of each the lines given in the + linestate parameter. Possible values are DTR and/or RTS. + For example to toggle the RTS line only: + dev.ChangeLineState(RTS) + """ + self.device.ChangeLineState(lineState) + + def ClrLineState(self,lineState): + """ + Clear the lines given in the linestate parameter. Possible + values are DTR and/or RTS. For example to clear only + the RTS line: + dev.ClrLineState(RTS) + """ + self.device.ClrLineState(lineState) + + def GetAvailableBytes(self): + """ + Returns the available bytes in the input queue of the serial + driver. + """ + n = wxctb.new_intp() + wxctb.intp_assign(n, 0) + self.device.Ioctl(wxctb.CTB_SER_GETINQUE,n) + return wxctb.intp_value(n) + + def GetCommErrors(self): + """ + Get the internal communication errors like breaks, framing, + parity or overrun errors. + Returns the count of each error as a tuple like this: + (b,f,o,p) = dev.GetCommErrors() + b: breaks, f: framing errors, o: overruns, p: parity errors + """ + einfo = wxctb.SerialPort_EINFO() + self.device.Ioctl(wxctb.CTB_SER_GETEINFO,einfo) + return einfo.brk,einfo.frame,einfo.overrun,einfo.parity + + def GetLineState(self): + """ + Returns the current linestates of the CTS, DCD, DSR and RING + signal line as an integer value with the appropriate bits or + -1 on error. + For example: + lines = dev.GetLineState() + if lines & CTS: + print \"CTS is on\" + """ + return self.device.GetLineState() + + def Open(self,devname,baudrate,protocol='8N1',handshake='no_handshake'): + """ + Open the device devname with the given baudrate, the protocol + like '8N1' (default) and the use of the handshake [no_handshake + (default), rtscts or xonxoff] + For example: + At Linux: + dev = SerialPort() + dev.Open(\"/dev/ttyS0\",115200) + or with a datalen of 7 bits, even parity, 2 stopbits and rts/cts + handshake: + dev.Open(\"/dev/ttyS0\",115200,'7E2',True) + At Windows: + dev = SerialPort() + dev.Open(\"COM1\",115200) + dev.Open(\"COM1\",115200,'7E2',True) + Returns the handle on success or a negativ value on failure. + """ + # the following parity values are valid: + # N:None, O:Odd, E:Even, M:Mark, S:Space + parity = {'N':0,'O':1,'E':2,'M':3,'S':4} + # the regular expression ensures a valid value for the datalen + # (5...8 bit) and the count of stopbits (1,2) + reg=re.compile(r"(?P[8765])"r"(?P

[NOEMS])"r"(?P[12])") + self.device = wxctb.SerialPort() + dcs = wxctb.SerialPort_DCS() + dcs.baud = baudrate + res = reg.search(protocol) + # handle the given protocol + if res: + dcs.wordlen = int(res.group('w')) + dcs.stopbits = int(res.group('s')) + dcs.parity = parity[res.group('p')] + # valid handshake are no one, rts/cts or xon/xoff + if handshake == 'rtscts': + dcs.rtscts = True + elif handshake == 'xonxoff': + dcs.xonxoff = True + + return self.device.Open(devname,dcs) + + def Reset(self): + """ + Send a break for 0.25s. + """ + self.device.SendBreak(0) + + def SetBaudrate(self,baudrate): + """ + Set the baudrate for the device. + """ + self.device.SetBaudrate(baudrate) + + def SetLineState(self,lineState): + """ + Set the lines given in the linestate parameter. Possible + values are DTR and/or RTS. For example to set both: + dev.SetLineState( DTR | RTS) + """ + self.device.SetLineState(lineState) + + def SetParityBit(self,parity): + """ + Set the parity bit explicitly to 0 or 1. Use this function, if + you would like to simulate a 9 bit wordlen at what the ninth bit + was represented by the parity bit value. For example: + dev.SetParityBit( 0 ) + dev.Write('some data sent with parity 0') + dev.SetParityBit( 1 ) + dev.Write('another sequence with parity 1') + """ + return self.device.SetParityBit( parity ) + +class GpibDevice(IOBase): + """ + GPIB class + """ + def __init__(self): + IOBase.__init__(self) + + def __del__(self): + self.Close() + + def FindListeners(self,board = 0): + """ + Returns the address of the connected devices as a list. + If no device is listening, the list is empty. If an error + occurs an IOError exception raised. For example: + g = GPIB() + listeners = g.FindListeners() + """ + listeners = wxctb.GPIB_x_FindListeners(board) + if listeners < 0: + raise IOError("GPIB board error") + result = [] + for i in range(1,31): + if listeners & (1 << i): + result.append(i) + return result + + def GetEosChar(self): + """ + Get the internal EOS termination character (see SetEosChar). + For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosChar() + """ + eos = wxctb.new_intp() + wxctb.intp_assign(eos, 0) + self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_CHAR,eos) + return wxctb.intp_value(eos) + + def GetEosMode(self): + """ + Get the internal EOS mode (see SetEosMode). + For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosMode() + """ + mode = wxctb.new_intp() + wxctb.intp_assign(mode, 0) + self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_MODE,mode) + return wxctb.intp_value(mode) + + def GetError(self): + errorString = " "*256 + self.device.GetError(errorString,256) + return errorString + + def GetSTB(self): + """ + Returns the value of the internal GPIB status byte register. + """ + stb = wxctb.new_intp() + wxctb.intp_assign(stb, 0) + self.device.Ioctl(wxctb.CTB_GPIB_GETRSP,stb) + return wxctb.intp_value(stb) + + # This is only for internal usage!!! + def Ibrd(self,length): + buf = "\x00"*length + state = self.device.Ibrd(buf,length) + return state,buf + + # This is only for internal usage!!! + def Ibwrt(self,string): + return self.device.Ibwrt(string,len(string)) + + def Open(self,devname,adr,eosChar=10,eosMode=0x08|0x04): + """ + Open(gpibdevice,address,eosChar,eosMode) + Opens a connected device at the GPIB bus. gpibdevice means the + controller, (mostly \"gpib1\"), address the address of the desired + device in the range 1...31. The eosChar defines the EOS character + (default is linefeed), eosMode may be a combination of bits ORed + together. The following bits can be used: + 0x04: Terminate read when EOS is detected. + 0x08: Set EOI (End or identify line) with EOS on write function + 0x10: Compare all 8 bits of EOS byte rather than low 7 bits + (all read and write functions). Default is 0x12 + For example: + dev = GPIB() + dev.Open(\"gpib1\",17) + Opens the device with the address 17, linefeed as EOS (default) + and eos mode with 0x04 and 0x08. + Open returns >= 0 or a negativ value, if something going wrong. + """ + self.device = wxctb.GpibDevice() + dcs = wxctb.Gpib_DCS() + dcs.m_address1 = adr + dcs.m_eosChar = eosChar + dcs.m_eosMode = eosMode + result = self.device.Open(devname,dcs) + return result + + def Reset(self): + """ + Resets the connected device. In the GPIB definition, the device + should be reset to it's initial state, so you can restart a + formely lost communication. + """ + self.device.Ioctl(wxctb.CTB_RESET,None) + + def ResetBus(self): + """ + The command asserts the GPIB interface clear (IFC) line for + ast least 100us if the GPIB board is the system controller. + This initializes the GPIB and makes the interface CIC and + active controller with ATN asserted. + Note! The IFC signal resets only the GPIB interface functions + of the bus devices and not the internal device functions. + For a device reset you should use the Reset() command above. + """ + self.device.Ioctl(wxctb.CTB_GPIB_RESET_BUS,None) + + def SetEosChar(self,eos): + """ + Configure the end-of-string (EOS) termination character. + Note! Defining an EOS byte does not cause the driver to + automatically send that byte at the end of write I/O + operations. The application is responsible for placing the + EOS byte at the end of the data strings that it defines. + (National Instruments NI-488.2M Function Reference Manual) + For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosChar(0x10) + """ + intp = wxctb.new_intp() + wxctb.intp_assign(intp, eos) + return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_CHAR,intp) + + def SetEosMode(self,mode): + """ + Set the EOS mode (handling).m_eosMode may be a combination + of bits ORed together. The following bits can be used: + 0x04: Terminate read when EOS is detected. + 0x08: Set EOI (End or identify line) with EOS on write function + 0x10: Compare all 8 bits of EOS byte rather than low 7 bits + (all read and write functions). For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosMode(0x04 | 0x08) + """ + intp = wxctb.new_intp() + wxctb.intp_assign(intp, mode) + return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_MODE,intp) + +def GetKey(): + """ + Returns the current pressed key or '\0', if no key is pressed. + You can simply create a query loop with: + while GetKey() == '\0': + ... make some stuff ... + + """ + return wxctb.GetKey() + +def GetVersion(): + """ + Returns the version of the ctb python module. The numbering + has the following format: x.y.z + x.y means the version of the underlaying ctb lib, z the version + of the python port. + """ + return "0.16" diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/wxctb.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/wxctb.py new file mode 100644 index 0000000000..f9e0d2ee6e --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/wxctb.py @@ -0,0 +1,264 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.40 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_wxctb', [dirname(__file__)]) + except ImportError: + import _wxctb + return _wxctb + if fp is not None: + try: + _mod = imp.load_module('_wxctb', fp, pathname, description) + finally: + fp.close() + return _mod + _wxctb = swig_import_helper() + del swig_import_helper +else: + import _wxctb +del version_info +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "thisown"): return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'SwigPyObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + if (name == "thisown"): return self.this.own() + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError(name) + +def _swig_repr(self): + try: strthis = "proxy of " + self.this.__repr__() + except: strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +try: + _object = object + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 + + +def _swig_setattr_nondynamic_method(set): + def set_attr(self,name,value): + if (name == "thisown"): return self.this.own(value) + if hasattr(self,name) or (name == "this"): + set(self,name,value) + else: + raise AttributeError("You cannot add attributes to %s" % self) + return set_attr + + + +def new_intp(): + return _wxctb.new_intp() +new_intp = _wxctb.new_intp + +def copy_intp(*args, **kwargs): + return _wxctb.copy_intp(*args, **kwargs) +copy_intp = _wxctb.copy_intp + +def delete_intp(*args, **kwargs): + return _wxctb.delete_intp(*args, **kwargs) +delete_intp = _wxctb.delete_intp + +def intp_assign(*args, **kwargs): + return _wxctb.intp_assign(*args, **kwargs) +intp_assign = _wxctb.intp_assign + +def intp_value(*args, **kwargs): + return _wxctb.intp_value(*args, **kwargs) +intp_value = _wxctb.intp_value +class timer_control(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") + __repr__ = _swig_repr + usecs = _swig_property(_wxctb.timer_control_usecs_get, _wxctb.timer_control_usecs_set) + exitflag = _swig_property(_wxctb.timer_control_exitflag_get, _wxctb.timer_control_exitflag_set) + exitfnc = _swig_property(_wxctb.timer_control_exitfnc_get, _wxctb.timer_control_exitfnc_set) +timer_control_swigregister = _wxctb.timer_control_swigregister +timer_control_swigregister(timer_control) + +class Timer(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + def __init__(self, *args, **kwargs): + this = _wxctb.new_Timer(*args, **kwargs) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_Timer + __del__ = lambda self : None; + def start(self): return _wxctb.Timer_start(self) + def stop(self): return _wxctb.Timer_stop(self) +Timer_swigregister = _wxctb.Timer_swigregister +Timer_swigregister(Timer) + + +def sleepms(*args, **kwargs): + return _wxctb.sleepms(*args, **kwargs) +sleepms = _wxctb.sleepms +CTB_RESET = _wxctb.CTB_RESET +class IOBase(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _wxctb.delete_IOBase + __del__ = lambda self : None; + def ClassName(self): return _wxctb.IOBase_ClassName(self) + def Close(self): return _wxctb.IOBase_Close(self) + def Ioctl(self, *args, **kwargs): return _wxctb.IOBase_Ioctl(self, *args, **kwargs) + def IsOpen(self): return _wxctb.IOBase_IsOpen(self) + def Open(self, *args, **kwargs): return _wxctb.IOBase_Open(self, *args, **kwargs) + def PutBack(self, *args, **kwargs): return _wxctb.IOBase_PutBack(self, *args, **kwargs) + def Read(self, *args, **kwargs): return _wxctb.IOBase_Read(self, *args, **kwargs) + def ReadUntilEOS(self, *args, **kwargs): return _wxctb.IOBase_ReadUntilEOS(self, *args, **kwargs) + def Readv(self, *args, **kwargs): return _wxctb.IOBase_Readv(self, *args, **kwargs) + def Write(self, *args, **kwargs): return _wxctb.IOBase_Write(self, *args, **kwargs) + def Writev(self, *args, **kwargs): return _wxctb.IOBase_Writev(self, *args, **kwargs) +IOBase_swigregister = _wxctb.IOBase_swigregister +IOBase_swigregister(IOBase) + +ParityNone = _wxctb.ParityNone +ParityOdd = _wxctb.ParityOdd +ParityEven = _wxctb.ParityEven +ParityMark = _wxctb.ParityMark +ParitySpace = _wxctb.ParitySpace +LinestateDcd = _wxctb.LinestateDcd +LinestateCts = _wxctb.LinestateCts +LinestateDsr = _wxctb.LinestateDsr +LinestateDtr = _wxctb.LinestateDtr +LinestateRing = _wxctb.LinestateRing +LinestateRts = _wxctb.LinestateRts +LinestateNull = _wxctb.LinestateNull +class SerialPort_DCS(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + baud = _swig_property(_wxctb.SerialPort_DCS_baud_get, _wxctb.SerialPort_DCS_baud_set) + parity = _swig_property(_wxctb.SerialPort_DCS_parity_get, _wxctb.SerialPort_DCS_parity_set) + wordlen = _swig_property(_wxctb.SerialPort_DCS_wordlen_get, _wxctb.SerialPort_DCS_wordlen_set) + stopbits = _swig_property(_wxctb.SerialPort_DCS_stopbits_get, _wxctb.SerialPort_DCS_stopbits_set) + rtscts = _swig_property(_wxctb.SerialPort_DCS_rtscts_get, _wxctb.SerialPort_DCS_rtscts_set) + xonxoff = _swig_property(_wxctb.SerialPort_DCS_xonxoff_get, _wxctb.SerialPort_DCS_xonxoff_set) + buf = _swig_property(_wxctb.SerialPort_DCS_buf_get, _wxctb.SerialPort_DCS_buf_set) + def __init__(self): + this = _wxctb.new_SerialPort_DCS() + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_SerialPort_DCS + __del__ = lambda self : None; + def GetSettings(self): return _wxctb.SerialPort_DCS_GetSettings(self) +SerialPort_DCS_swigregister = _wxctb.SerialPort_DCS_swigregister +SerialPort_DCS_swigregister(SerialPort_DCS) + +class SerialPort_EINFO(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + brk = _swig_property(_wxctb.SerialPort_EINFO_brk_get, _wxctb.SerialPort_EINFO_brk_set) + frame = _swig_property(_wxctb.SerialPort_EINFO_frame_get, _wxctb.SerialPort_EINFO_frame_set) + overrun = _swig_property(_wxctb.SerialPort_EINFO_overrun_get, _wxctb.SerialPort_EINFO_overrun_set) + parity = _swig_property(_wxctb.SerialPort_EINFO_parity_get, _wxctb.SerialPort_EINFO_parity_set) + def __init__(self): + this = _wxctb.new_SerialPort_EINFO() + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_SerialPort_EINFO + __del__ = lambda self : None; +SerialPort_EINFO_swigregister = _wxctb.SerialPort_EINFO_swigregister +SerialPort_EINFO_swigregister(SerialPort_EINFO) + +CTB_SER_GETEINFO = _wxctb.CTB_SER_GETEINFO +CTB_SER_GETBRK = _wxctb.CTB_SER_GETBRK +CTB_SER_GETFRM = _wxctb.CTB_SER_GETFRM +CTB_SER_GETOVR = _wxctb.CTB_SER_GETOVR +CTB_SER_GETPAR = _wxctb.CTB_SER_GETPAR +CTB_SER_GETINQUE = _wxctb.CTB_SER_GETINQUE +CTB_SER_SETPAR = _wxctb.CTB_SER_SETPAR +class SerialPort_x(IOBase): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _wxctb.delete_SerialPort_x + __del__ = lambda self : None; + def ClassName(self): return _wxctb.SerialPort_x_ClassName(self) + def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ChangeLineState(self, *args, **kwargs) + def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ClrLineState(self, *args, **kwargs) + def GetLineState(self): return _wxctb.SerialPort_x_GetLineState(self) + def GetSettingsAsString(self): return _wxctb.SerialPort_x_GetSettingsAsString(self) + def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_x_Ioctl(self, *args, **kwargs) + def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_x_SendBreak(self, *args, **kwargs) + def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_x_SetBaudrate(self, *args, **kwargs) + def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_SetLineState(self, *args, **kwargs) + def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_x_SetParityBit(self, *args, **kwargs) + IsStandardRate = staticmethod(_wxctb.SerialPort_x_IsStandardRate) +SerialPort_x_swigregister = _wxctb.SerialPort_x_swigregister +SerialPort_x_swigregister(SerialPort_x) + +def SerialPort_x_IsStandardRate(*args, **kwargs): + return _wxctb.SerialPort_x_IsStandardRate(*args, **kwargs) +SerialPort_x_IsStandardRate = _wxctb.SerialPort_x_IsStandardRate + +COM1 = "/dev/ttyS0" +COM2 = "/dev/ttyS1" +COM3 = "/dev/ttyS2" +COM4 = "/dev/ttyS3" +COM5 = "/dev/ttyS4" +COM6 = "/dev/ttyS5" +COM7 = "/dev/ttyS6" +COM8 = "/dev/ttyS7" +COM9 = "/dev/ttyS8" + +class SerialPort(SerialPort_x): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + def __init__(self): + this = _wxctb.new_SerialPort() + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_SerialPort + __del__ = lambda self : None; + def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_ChangeLineState(self, *args, **kwargs) + def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_ClrLineState(self, *args, **kwargs) + def GetLineState(self): return _wxctb.SerialPort_GetLineState(self) + def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_Ioctl(self, *args, **kwargs) + def IsOpen(self): return _wxctb.SerialPort_IsOpen(self) + def Read(self, *args, **kwargs): return _wxctb.SerialPort_Read(self, *args, **kwargs) + def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_SendBreak(self, *args, **kwargs) + def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_SetBaudrate(self, *args, **kwargs) + def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_SetLineState(self, *args, **kwargs) + def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_SetParityBit(self, *args, **kwargs) + def Write(self, *args, **kwargs): return _wxctb.SerialPort_Write(self, *args, **kwargs) +SerialPort_swigregister = _wxctb.SerialPort_swigregister +SerialPort_swigregister(SerialPort) + + +def GetKey(): + return _wxctb.GetKey() +GetKey = _wxctb.GetKey + + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/parity.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/parity.py new file mode 100755 index 0000000000..910361b8e0 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/parity.py @@ -0,0 +1,70 @@ +#!/usr/bin/python + +import getopt, time, sys + +sys.path.insert( 0, r'/home/jb/project/libctb-0.16/python/module/linux') + +import ctb + +def main(): + + baudrate = 19200 + + devname = "" + + protocol = '8N1' + + try: + opt,arg = getopt.getopt(sys.argv[1:], + 'b:d:p:', + ['baudrate=', + 'device=', + 'protocol=' + ]) + + except getopt.GetoptError: + print "usage: parity.py [options]\n"\ + "\t-b baudrate\n"\ + "\t--baudrate=baudrate"\ + "\t-d device\n"\ + "\t--device=serial device name like /dev/ttyS0 or COM1\n"\ + "\t-h\n"\ + "\t--help print this\n"\ + "\n" + sys.exit(0) + + for o,a in opt: + + if o in ("-b","--baudrate"): + + baudrate = int(a) + + if o in ("-d","--device"): + + devname = a + + if o in ("-p","--protocol"): + + protocol = a + + + print "Using ctb version " + ctb.GetVersion() + + dev = ctb.SerialPort() + + if dev.Open( devname, baudrate, protocol ) < 0: + + print "Cannot open " + devname + "\n" + + # send the following string with a always set parity bit + dev.SetParityBit( 1 ) + + dev.Writev( "Hello World" ) + + # send the following string with a always cleared parity bit + dev.SetParityBit( 0 ) + + dev.Writev( "Hello World" ) + +main() + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/protocol.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/protocol.py new file mode 100755 index 0000000000..ff1731b895 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/protocol.py @@ -0,0 +1,88 @@ +#!/usr/bin/python + +import getopt, time, sys + +sys.path.insert( 0, r'/home/jb/project/libctb-0.16/python/module/linux') + +import ctb + +def DataBlock(): + data = '' + for c in range( 0, 256): + data += '%c' % c + + return data + +def main(): + + baudrate = 19200 + + devname = "" + + try: + opt,arg = getopt.getopt(sys.argv[1:], + 'b:d:', + ['baudrate=', + 'device=' + ]) + + except getopt.GetoptError: + print "usage: protocol.py [options]\n"\ + "\t-b baudrate\n"\ + "\t--baudrate=baudrate"\ + "\t-d device\n"\ + "\t--device=serial device name like /dev/ttyS0 or COM1\n"\ + "\t-h\n"\ + "\t--help print this\n"\ + "\n" + sys.exit(0) + + for o,a in opt: + + if o in ("-b","--baudrate"): + + baudrate = int(a) + + if o in ("-d","--device"): + + devname = a + + print "Using ctb version " + ctb.GetVersion() + + dev = ctb.SerialPort() + + protocols = [ + '8N1','8O1','8E1','8S1','8M1' + ] + + dev.SetTimeout( 1000 ) + + for protocol in protocols: + + if dev.Open( devname, baudrate, protocol ) < 0: + + print "Cannot open " + devname + "\n" + + sys.exit( 1 ) + + else: + + print( "%i %s" % ( baudrate, protocol ) ) + + for i in range(0, 4 ): + + dev.Writev( "\x33" ) + + time.sleep( 0.0006 ) + + dev.Writev( "\x31" ) + + time.sleep( 0.0006 ) + + time.sleep( 0.5 ) + + dev.Close() + + +main() + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/rtsdtr.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/rtsdtr.py new file mode 100755 index 0000000000..e67a9ffd3b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/samples/rtsdtr.py @@ -0,0 +1,53 @@ +#!/usr/bin/python + +import getopt, time, sys + +sys.path.insert( 0, r'/home/jb/project/libctb-0.16/python/module/linux') + +import ctb + +def main(): + + devname = "" + + try: + opt,arg = getopt.getopt(sys.argv[1:], + 'd:', + ['device=' + ]) + + except getopt.GetoptError: + print "usage: parity.py [options]\n"\ + "\t-d device\n"\ + "\t--device=serial device name like /dev/ttyS0 or COM1\n"\ + "\t-h\n"\ + "\t--help print this\n"\ + "\n" + sys.exit(0) + + for o,a in opt: + + if o in ("-d","--device"): + + devname = a + + print "Using ctb version " + ctb.GetVersion() + + dev = ctb.SerialPort() + + if dev.Open( devname, 38400 ) < 0: + + print "Cannot open " + devname + "\n" + + dev.SetLineState( ctb.DTR ) + + dev.ClrLineState( ctb.RTS ) + + for i in range( 0, 100 ) : + + time.sleep( 0.01 ) + + dev.ChangeLineState( ctb.DTR | ctb.RTS ) + +main() + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/ctb.html b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/ctb.html new file mode 100644 index 0000000000..7a5732fa9b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/ctb.html @@ -0,0 +1,353 @@ + + +Python: module ctb + + + + +
 
+ 
ctb
index
/mnt/s/wxaddons/wxctb-0.9/SWIG/ctb.py
+

+

+ + + + + +
 
+Modules
       
re
+
sys
+
wxctb
+

+ + + + + +
 
+Classes
       
+
wxIOBase +
+
+
wxGPIB +
wxSerialPort +
+
+
+

+ + + + + + + +
 
+class wxGPIB(wxIOBase)
   wxGPIB class
 
 Methods defined here:
+
GetError(self)
+ +
GetSTB(self)
Returns the value of the internal GPIB status byte register.
+ +
Ibrd(self, length)
# This is only for internal usage!!!
+ +
Ibwrt(self, string)
# This is only for internal usage!!!
+ +
Open(self, devname, adr)
Open(gpibdevice,address)
+Opens a connected device at the GPIB bus. gpibdevice means the
+controller, (mostly "gpib1"), address the address of the desired
+device in the range 1...31. For example:
+dev = wxGPIB()
+dev.Open("gpib1",17)
+Opens the device with the address 17.
+Open returns >= 0 or a negativ value, if something going wrong.
+ +
Reset(self)
Resets the connected device. In the GPIB definition, the device
+should be reset to it's initial state, so you can restart a
+formely lost communication.
+ +
ResetBus(self)
The command asserts the GPIB interface clear (IFC) line for
+ast least 100us if the GPIB board is the system controller.
+This initializes the GPIB and makes the interface CIC and
+active controller with ATN asserted.
+Note! The IFC signal resets only the GPIB interface functions
+of the bus devices and not the internal device functions.
+For a device reset you should use the Reset() command above.
+ +
__del__(self)
+ +
__init__(self)
+ +
+Methods inherited from wxIOBase:
+
Close(self)
+ +
GetTimeout(self)
Returns the internal timeout value in milliseconds
+ +
Ioctl(self, cmd, arg)
+ +
PutBack(self, char)
+ +
Read(self, length)
Try to read the given count of data (length) and returns the
+successfully readed number of data. The function never blocks.
+For example:
+readed = dev.Read(100)
+ +
ReadBinary(self, eos='\n')
Special SCPI command. Read the next data coded as a SCPI
+binary format.
+A binary data transfer will be startet by '#'. The next byte
+tells the count of bytes for the binary length header,
+following by the length bytes. After these the data begins.
+For example:
+#500004xxxx
+The header length covers 5 Byte, the length of the binary
+data is 4 (x means the binary data bytes)
+ +
ReadUntilEOS(self, eos='\n', quota=0)
ReadUntilEOS(eosString="\n",timeout=1000)
+Reads data until the given eos string was received (default is
+the linefeed character (0x0a) or the internal timeout
+(default 1000ms) was reached.
+ReadUntilEOS returns the result as the following tuple:
+['received string',state,readedBytes]
+If a timeout occurred, state is 0, otherwise 1
+ +
Readv(self, length)
Try to read the given count of data. Readv blocks until all data
+was readed successfully or the internal timeout, set with the
+class member function SetTimeout(timeout), was reached.
+Returns the readed data.
+ +
SetTimeout(self, timeout)
Set the internal timeout value in milliseconds for all blocked
+operations like ReadUntilEOS, Readv and Writev.
+ +
Write(self, string)
Writes the given string to the device and returns immediately.
+Write returns the number of data bytes successfully written or a
+negativ number if an error occured. For some circumstances, not
+the complete string was written.
+So you have to verify the return value to check this out.
+ +
Writev(self, string)
Writes the given string to the device. The function blocks until
+the complete string was written or the internal timeout, set with
+SetTimeout(timeout), was reached.
+Writev returns the number of data successfully written or a
+negativ value, if an errors occurred.
+ +

+ + + + + +
 
+class wxIOBase
    Methods defined here:
+
Close(self)
+ +
GetTimeout(self)
Returns the internal timeout value in milliseconds
+ +
Ioctl(self, cmd, arg)
+ +
Open(self)
+ +
PutBack(self, char)
+ +
Read(self, length)
Try to read the given count of data (length) and returns the
+successfully readed number of data. The function never blocks.
+For example:
+readed = dev.Read(100)
+ +
ReadBinary(self, eos='\n')
Special SCPI command. Read the next data coded as a SCPI
+binary format.
+A binary data transfer will be startet by '#'. The next byte
+tells the count of bytes for the binary length header,
+following by the length bytes. After these the data begins.
+For example:
+#500004xxxx
+The header length covers 5 Byte, the length of the binary
+data is 4 (x means the binary data bytes)
+ +
ReadUntilEOS(self, eos='\n', quota=0)
ReadUntilEOS(eosString="\n",timeout=1000)
+Reads data until the given eos string was received (default is
+the linefeed character (0x0a) or the internal timeout
+(default 1000ms) was reached.
+ReadUntilEOS returns the result as the following tuple:
+['received string',state,readedBytes]
+If a timeout occurred, state is 0, otherwise 1
+ +
Readv(self, length)
Try to read the given count of data. Readv blocks until all data
+was readed successfully or the internal timeout, set with the
+class member function SetTimeout(timeout), was reached.
+Returns the readed data.
+ +
ResetBus(self)
If the underlaying interface needs some special reset operations
+(for instance the GPIB distinguish between a normal device reset
+and a special bus reset), you can put some code here)
+ +
SetTimeout(self, timeout)
Set the internal timeout value in milliseconds for all blocked
+operations like ReadUntilEOS, Readv and Writev.
+ +
Write(self, string)
Writes the given string to the device and returns immediately.
+Write returns the number of data bytes successfully written or a
+negativ number if an error occured. For some circumstances, not
+the complete string was written.
+So you have to verify the return value to check this out.
+ +
Writev(self, string)
Writes the given string to the device. The function blocks until
+the complete string was written or the internal timeout, set with
+SetTimeout(timeout), was reached.
+Writev returns the number of data successfully written or a
+negativ value, if an errors occurred.
+ +
__del__(self)
+ +
__init__(self)
+ +

+ + + + + +
 
+class wxSerialPort(wxIOBase)
    Methods defined here:
+
ChangeLineState(self, lineState)
Change (toggle) the state of each the lines given in the
+linestate parameter. Possible values are wxSERIAL_LINESTATE_DTR
+(means the DTR signal) and/or wxSERIAL_LINESTATE_RTS (RTS signal).
+For example to toggle the RTS line only:
+dev.ChangeLineState(wxSERIAL_LINESTATE_RTS)
+ +
ClrLineState(self, lineState)
Clear the lines given in the linestate parameter. Possible
+values are wxSERIAL_LINESTATE_DTR (means the DTR signal) and/or
+wxSERIAL_LINESTATE_RTS (RTS signal). For example to clear only
+the RTS line:
+dev.ClrLineState(wxSERIAL_LINESTATE_RTS)
+ +
GetAvailableBytes(self)
Returns the available bytes in the input queue of the serial
+driver.
+ +
GetCommErrors(self)
Get the internal communication errors like breaks, framing,
+parity or overrun errors.
+Returns the count of each error as a tuple like this:
+(b,f,o,p) = dev.GetCommErrors()
+b: breaks, f: framing errors,  o: overruns, p: parity errors
+ +
GetLineState(self)
Returns the current linestates of the CTS, DCD, DSR and RING
+signal line as an integer value with the appropriate bits or
+-1 on error.
+For example:
+lines = dev.GetLineState()
+if lines & wxSERIAL_LINESTATE_CTS:
+    print "CTS is on"
+ +
Open(self, devname, baudrate, protocol='8N1', handshake='no_handshake')
Open the device devname with the given baudrate, the protocol
+like '8N1' (default) and the use of the handshake [no_handshake
+(default), rtscts or xonxoff]
+For example:
+At Linux:
+dev = wxSerialPort()
+dev.Open("/dev/ttyS0",115200)
+or with a datalen of 7 bits, even parity, 2 stopbits and rts/cts
+handshake:
+dev.Open("/dev/ttyS0",115200,'7E2',True)
+At Windows:
+dev = wxSerialPort()
+dev.Open("COM1",115200)
+dev.Open("COM1",115200,'7E2',True)
+Returns the handle on success or a negativ value on failure.
+ +
Reset(self)
Send a break for 0.25s.
+ +
SetBaudRate(self, baudrate)
Set the baudrate for the device.
+ +
SetLineState(self, lineState)
Set the lines given in the linestate parameter. Possible
+values are wxSERIAL_LINESTATE_DTR (means the DTR signal) and/or
+wxSERIAL_LINESTATE_RTS (RTS signal). For example to set both:
+dev.SetLineState(wxSERIAL_LINESTATE_DTR | wxSERIAL_LINESTATE_RTS)
+ +
__del__(self)
+ +
__init__(self)
+ +
+Methods inherited from wxIOBase:
+
Close(self)
+ +
GetTimeout(self)
Returns the internal timeout value in milliseconds
+ +
Ioctl(self, cmd, arg)
+ +
PutBack(self, char)
+ +
Read(self, length)
Try to read the given count of data (length) and returns the
+successfully readed number of data. The function never blocks.
+For example:
+readed = dev.Read(100)
+ +
ReadBinary(self, eos='\n')
Special SCPI command. Read the next data coded as a SCPI
+binary format.
+A binary data transfer will be startet by '#'. The next byte
+tells the count of bytes for the binary length header,
+following by the length bytes. After these the data begins.
+For example:
+#500004xxxx
+The header length covers 5 Byte, the length of the binary
+data is 4 (x means the binary data bytes)
+ +
ReadUntilEOS(self, eos='\n', quota=0)
ReadUntilEOS(eosString="\n",timeout=1000)
+Reads data until the given eos string was received (default is
+the linefeed character (0x0a) or the internal timeout
+(default 1000ms) was reached.
+ReadUntilEOS returns the result as the following tuple:
+['received string',state,readedBytes]
+If a timeout occurred, state is 0, otherwise 1
+ +
Readv(self, length)
Try to read the given count of data. Readv blocks until all data
+was readed successfully or the internal timeout, set with the
+class member function SetTimeout(timeout), was reached.
+Returns the readed data.
+ +
ResetBus(self)
If the underlaying interface needs some special reset operations
+(for instance the GPIB distinguish between a normal device reset
+and a special bus reset), you can put some code here)
+ +
SetTimeout(self, timeout)
Set the internal timeout value in milliseconds for all blocked
+operations like ReadUntilEOS, Readv and Writev.
+ +
Write(self, string)
Writes the given string to the device and returns immediately.
+Write returns the number of data bytes successfully written or a
+negativ number if an error occured. For some circumstances, not
+the complete string was written.
+So you have to verify the return value to check this out.
+ +
Writev(self, string)
Writes the given string to the device. The function blocks until
+the complete string was written or the internal timeout, set with
+SetTimeout(timeout), was reached.
+Writev returns the number of data successfully written or a
+negativ value, if an errors occurred.
+ +

+ + + + + +
 
+Functions
       
GetKey()
Returns the current pressed key or '', if no key is pressed.
+You can simply create a query loop with:
+while GetKey() == '':
+    ... make some stuff ...
+
abstract()
+

+ + + + + +
 
+Data
       wxSERIAL_LINESTATE_CTS = 32
+wxSERIAL_LINESTATE_DCD = 64
+wxSERIAL_LINESTATE_DSR = 256
+wxSERIAL_LINESTATE_DTR = 2
+wxSERIAL_LINESTATE_NULL = 0
+wxSERIAL_LINESTATE_RING = 128
+wxSERIAL_LINESTATE_RTS = 4
+ \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/ctb.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/ctb.py new file mode 100644 index 0000000000..6b541ffe39 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/ctb.py @@ -0,0 +1,455 @@ +import wxctb, sys, re + +DCD = wxctb.LinestateDcd +CTS = wxctb.LinestateCts +DSR = wxctb.LinestateDsr +DTR = wxctb.LinestateDtr +RING = wxctb.LinestateRing +RTS = wxctb.LinestateRts +NULL = wxctb.LinestateNull + +def abstract(): + import inspect + caller = inspect.getouterframes(inspect.currentframe())[1][3] + raise NotImplementedError(caller + ' must be implemented in subclass') + +class IOBase: + def __init__(self): + self.device = None + # set timeout to 1000ms (the default) + self.timeout = 1000 + + def __del__(self): + pass + + def Close(self): + if self.device: + self.device.Close() + + def GetTimeout(self): + """ + Returns the internal timeout value in milliseconds + """ + return self.timeout + + def Ioctl(self,cmd,arg): + if self.device: + self.device.Ioctl(cmd,arg) + + def Open(self): + abstract() + + def PutBack(self,char): + return self.device.PutBack(char) + + def Read(self,length): + """ + Try to read the given count of data (length) and returns the + successfully readed number of data. The function never blocks. + For example: + readed = dev.Read(100) + """ + buf = "\x00"*(length+1) + rd = self.device.Read(buf,length) + return buf[0:rd] + + def ReadBinary(self,eos="\n"): + """ + Special SCPI command. Read the next data coded as a SCPI + binary format. + A binary data transfer will be startet by '#'. The next byte + tells the count of bytes for the binary length header, + following by the length bytes. After these the data begins. + For example: + #500004xxxx + The header length covers 5 Byte, the length of the binary + data is 4 (x means the binary data bytes) + """ + try: + eoslen = len(eos) + b=self.Readv(2) + if len(b) == 2: + hl = int(b[1]) + b = self.Readv(hl) + if len(b) == hl: + dl = int(b) + # don't left over the eos string or character in the + # device input buffer + data = self.Readv(dl+eoslen) + # check, if the binary data block is complete + if data[dl] == '#': + # not complete, another block is following + for c in data[dl:dl+eoslen]: + self.PutBack(c) + + data = data[:dl] + self.ReadBinary() + return data + except: + pass + return '' + + def ReadUntilEOS(self,eos="\n",quota=0): + """ + ReadUntilEOS(eosString=\"\\n\",timeout=1000) + Reads data until the given eos string was received (default is + the linefeed character (0x0a) or the internal timeout + (default 1000ms) was reached. + ReadUntilEOS returns the result as the following tuple: + ['received string',state,readedBytes] + If a timeout occurred, state is 0, otherwise 1 + """ + return self.device.ReadUntilEOS("",0,eos,self.timeout,quota) + + def Readv(self,length): + """ + Try to read the given count of data. Readv blocks until all data + was readed successfully or the internal timeout, set with the + class member function SetTimeout(timeout), was reached. + Returns the readed data. + """ + buf = "\x00"*length + rd = self.device.Readv(buf,length,self.timeout) + return buf[0:rd] + + def ResetBus(self): + """ + If the underlaying interface needs some special reset operations + (for instance the GPIB distinguish between a normal device reset + and a special bus reset), you can put some code here) + """ + pass + + def SetTimeout(self,timeout): + """ + Set the internal timeout value in milliseconds for all blocked + operations like ReadUntilEOS, Readv and Writev. + """ + self.timeout = timeout + + def Write(self,string): + """ + Writes the given string to the device and returns immediately. + Write returns the number of data bytes successfully written or a + negativ number if an error occured. For some circumstances, not + the complete string was written. + So you have to verify the return value to check this out. + """ + return self.device.Write(string,len(string)) + + def Writev(self,string): + """ + Writes the given string to the device. The function blocks until + the complete string was written or the internal timeout, set with + SetTimeout(timeout), was reached. + Writev returns the number of data successfully written or a + negativ value, if an errors occurred. + """ + return self.device.Writev(string,len(string),self.timeout) + +class SerialPort(IOBase): + def __init__(self): + IOBase.__init__(self) + + def __del__(self): + self.Close() + + def ChangeLineState(self,lineState): + """ + Change (toggle) the state of each the lines given in the + linestate parameter. Possible values are DTR and/or RTS. + For example to toggle the RTS line only: + dev.ChangeLineState(RTS) + """ + self.device.ChangeLineState(lineState) + + def ClrLineState(self,lineState): + """ + Clear the lines given in the linestate parameter. Possible + values are DTR and/or RTS. For example to clear only + the RTS line: + dev.ClrLineState(RTS) + """ + self.device.ClrLineState(lineState) + + def GetAvailableBytes(self): + """ + Returns the available bytes in the input queue of the serial + driver. + """ + n = wxctb.new_intp() + wxctb.intp_assign(n, 0) + self.device.Ioctl(wxctb.CTB_SER_GETINQUE,n) + return wxctb.intp_value(n) + + def GetCommErrors(self): + """ + Get the internal communication errors like breaks, framing, + parity or overrun errors. + Returns the count of each error as a tuple like this: + (b,f,o,p) = dev.GetCommErrors() + b: breaks, f: framing errors, o: overruns, p: parity errors + """ + einfo = wxctb.SerialPort_EINFO() + self.device.Ioctl(wxctb.CTB_SER_GETEINFO,einfo) + return einfo.brk,einfo.frame,einfo.overrun,einfo.parity + + def GetLineState(self): + """ + Returns the current linestates of the CTS, DCD, DSR and RING + signal line as an integer value with the appropriate bits or + -1 on error. + For example: + lines = dev.GetLineState() + if lines & CTS: + print \"CTS is on\" + """ + return self.device.GetLineState() + + def Open(self,devname,baudrate,protocol='8N1',handshake='no_handshake'): + """ + Open the device devname with the given baudrate, the protocol + like '8N1' (default) and the use of the handshake [no_handshake + (default), rtscts or xonxoff] + For example: + At Linux: + dev = SerialPort() + dev.Open(\"/dev/ttyS0\",115200) + or with a datalen of 7 bits, even parity, 2 stopbits and rts/cts + handshake: + dev.Open(\"/dev/ttyS0\",115200,'7E2',True) + At Windows: + dev = SerialPort() + dev.Open(\"COM1\",115200) + dev.Open(\"COM1\",115200,'7E2',True) + Returns the handle on success or a negativ value on failure. + """ + # the following parity values are valid: + # N:None, O:Odd, E:Even, M:Mark, S:Space + parity = {'N':0,'O':1,'E':2,'M':3,'S':4} + # the regular expression ensures a valid value for the datalen + # (5...8 bit) and the count of stopbits (1,2) + reg=re.compile(r"(?P[8765])"r"(?P

[NOEMS])"r"(?P[12])") + self.device = wxctb.SerialPort() + dcs = wxctb.SerialPort_DCS() + dcs.baud = baudrate + res = reg.search(protocol) + # handle the given protocol + if res: + dcs.wordlen = int(res.group('w')) + dcs.stopbits = int(res.group('s')) + dcs.parity = parity[res.group('p')] + # valid handshake are no one, rts/cts or xon/xoff + if handshake == 'rtscts': + dcs.rtscts = True + elif handshake == 'xonxoff': + dcs.xonxoff = True + + return self.device.Open(devname,dcs) + + def Reset(self): + """ + Send a break for 0.25s. + """ + self.device.SendBreak(0) + + def SetBaudrate(self,baudrate): + """ + Set the baudrate for the device. + """ + self.device.SetBaudrate(baudrate) + + def SetLineState(self,lineState): + """ + Set the lines given in the linestate parameter. Possible + values are DTR and/or RTS. For example to set both: + dev.SetLineState( DTR | RTS) + """ + self.device.SetLineState(lineState) + + def SetParityBit(self,parity): + """ + Set the parity bit explicitly to 0 or 1. Use this function, if + you would like to simulate a 9 bit wordlen at what the ninth bit + was represented by the parity bit value. For example: + dev.SetParityBit( 0 ) + dev.Write('some data sent with parity 0') + dev.SetParityBit( 1 ) + dev.Write('another sequence with parity 1') + """ + return self.device.SetParityBit( parity ) + +class GpibDevice(IOBase): + """ + GPIB class + """ + def __init__(self): + IOBase.__init__(self) + + def __del__(self): + self.Close() + + def FindListeners(self,board = 0): + """ + Returns the address of the connected devices as a list. + If no device is listening, the list is empty. If an error + occurs an IOError exception raised. For example: + g = GPIB() + listeners = g.FindListeners() + """ + listeners = wxctb.GPIB_x_FindListeners(board) + if listeners < 0: + raise IOError("GPIB board error") + result = [] + for i in range(1,31): + if listeners & (1 << i): + result.append(i) + return result + + def GetEosChar(self): + """ + Get the internal EOS termination character (see SetEosChar). + For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosChar() + """ + eos = wxctb.new_intp() + wxctb.intp_assign(eos, 0) + self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_CHAR,eos) + return wxctb.intp_value(eos) + + def GetEosMode(self): + """ + Get the internal EOS mode (see SetEosMode). + For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosMode() + """ + mode = wxctb.new_intp() + wxctb.intp_assign(mode, 0) + self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_MODE,mode) + return wxctb.intp_value(mode) + + def GetError(self): + errorString = " "*256 + self.device.GetError(errorString,256) + return errorString + + def GetSTB(self): + """ + Returns the value of the internal GPIB status byte register. + """ + stb = wxctb.new_intp() + wxctb.intp_assign(stb, 0) + self.device.Ioctl(wxctb.CTB_GPIB_GETRSP,stb) + return wxctb.intp_value(stb) + + # This is only for internal usage!!! + def Ibrd(self,length): + buf = "\x00"*length + state = self.device.Ibrd(buf,length) + return state,buf + + # This is only for internal usage!!! + def Ibwrt(self,string): + return self.device.Ibwrt(string,len(string)) + + def Open(self,devname,adr,eosChar=10,eosMode=0x08|0x04): + """ + Open(gpibdevice,address,eosChar,eosMode) + Opens a connected device at the GPIB bus. gpibdevice means the + controller, (mostly \"gpib1\"), address the address of the desired + device in the range 1...31. The eosChar defines the EOS character + (default is linefeed), eosMode may be a combination of bits ORed + together. The following bits can be used: + 0x04: Terminate read when EOS is detected. + 0x08: Set EOI (End or identify line) with EOS on write function + 0x10: Compare all 8 bits of EOS byte rather than low 7 bits + (all read and write functions). Default is 0x12 + For example: + dev = GPIB() + dev.Open(\"gpib1\",17) + Opens the device with the address 17, linefeed as EOS (default) + and eos mode with 0x04 and 0x08. + Open returns >= 0 or a negativ value, if something going wrong. + """ + self.device = wxctb.GpibDevice() + dcs = wxctb.Gpib_DCS() + dcs.m_address1 = adr + dcs.m_eosChar = eosChar + dcs.m_eosMode = eosMode + result = self.device.Open(devname,dcs) + return result + + def Reset(self): + """ + Resets the connected device. In the GPIB definition, the device + should be reset to it's initial state, so you can restart a + formely lost communication. + """ + self.device.Ioctl(wxctb.CTB_RESET,None) + + def ResetBus(self): + """ + The command asserts the GPIB interface clear (IFC) line for + ast least 100us if the GPIB board is the system controller. + This initializes the GPIB and makes the interface CIC and + active controller with ATN asserted. + Note! The IFC signal resets only the GPIB interface functions + of the bus devices and not the internal device functions. + For a device reset you should use the Reset() command above. + """ + self.device.Ioctl(wxctb.CTB_GPIB_RESET_BUS,None) + + def SetEosChar(self,eos): + """ + Configure the end-of-string (EOS) termination character. + Note! Defining an EOS byte does not cause the driver to + automatically send that byte at the end of write I/O + operations. The application is responsible for placing the + EOS byte at the end of the data strings that it defines. + (National Instruments NI-488.2M Function Reference Manual) + For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosChar(0x10) + """ + intp = wxctb.new_intp() + wxctb.intp_assign(intp, eos) + return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_CHAR,intp) + + def SetEosMode(self,mode): + """ + Set the EOS mode (handling).m_eosMode may be a combination + of bits ORed together. The following bits can be used: + 0x04: Terminate read when EOS is detected. + 0x08: Set EOI (End or identify line) with EOS on write function + 0x10: Compare all 8 bits of EOS byte rather than low 7 bits + (all read and write functions). For example: + g = GPIB() + g.Open(\"gpib1\",1) + eos = g.GetEosMode(0x04 | 0x08) + """ + intp = wxctb.new_intp() + wxctb.intp_assign(intp, mode) + return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_MODE,intp) + +def GetKey(): + """ + Returns the current pressed key or '\0', if no key is pressed. + You can simply create a query loop with: + while GetKey() == '\0': + ... make some stuff ... + + """ + return wxctb.GetKey() + +def GetVersion(): + """ + Returns the version of the ctb python module. The numbering + has the following format: x.y.z + x.y means the version of the underlaying ctb lib, z the version + of the python port. + """ + return "0.16" diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/gpib.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/gpib.i new file mode 100644 index 0000000000..752ecd3a18 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/gpib.i @@ -0,0 +1,96 @@ +%{ +#include "ctb-0.16/gpib.h" +%} + +%include iobase.i + +namespace ctb { + +%typemap(in) void * dcs (Gpib_DCS tmp) { + /* dont check for list */ + $1 = &tmp; +} + +enum GpibTimeout +{ + GpibTimeoutNONE = 0, + GpibTimeout10us, + GpibTimeout30us, + GpibTimeout100us, + GpibTimeout300us, + GpibTimeout1ms, + GpibTimeout3ms, + GpibTimeout10ms, + GpibTimeout30ms, + GpibTimeout100ms, + GpibTimeout300ms, + GpibTimeout1s, + GpibTimeout3s, + GpibTimeout10s, + GpibTimeout30s, + GpibTimeout100s, + GpibTimeout300s, + GpibTimeout1000s +}; + +struct Gpib_DCS +{ + int m_address1; + int m_address2; + GpibTimeout m_timeout; + bool m_eot; + unsigned char m_eosChar; + unsigned char m_eosMode; + Gpib_DCS(); + ~Gpib_DCS(); + char* GetSettings(); +}; + +enum { + CTB_GPIB_SETADR = CTB_GPIB, + CTB_GPIB_GETRSP, + CTB_GPIB_GETSTA, + CTB_GPIB_GETERR, + CTB_GPIB_GETLINES, + CTB_GPIB_SETTIMEOUT, + CTB_GPIB_GTL, + CTB_GPIB_REN, + CTB_GPIB_RESET_BUS, + CTB_GPIB_SET_EOS_CHAR, + CTB_GPIB_GET_EOS_CHAR, + CTB_GPIB_SET_EOS_MODE, + CTB_GPIB_GET_EOS_MODE +}; + +class GpibDevice : public IOBase +{ +protected: + int m_board; + int m_hd; + int m_state; + int m_error; + int m_count; + int m_asyncio; + Gpib_DCS m_dcs; + int CloseDevice(); + int OpenDevice(const char* devname, void* dcs); + virtual const char* GetErrorString(int error,bool detailed); +public: + GpibDevice(); + virtual ~GpibDevice(); + const char* ClassName(); + virtual const char* GetErrorDescription(int error); + virtual const char* GetErrorNotation(int error); + virtual char* GetSettingsAsString(); + int Ibrd(char* buf,size_t len); + int Ibwrt(char* buf,size_t len); + virtual int Ioctl(int cmd,void* args); + int IsOpen(); + int Read(char* buf,size_t len); + int Write(char* buf,size_t len); + + static int FindListeners(int board = 0); + +}; + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/iobase.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/iobase.i new file mode 100644 index 0000000000..c6bc452adb --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/iobase.i @@ -0,0 +1,59 @@ +%{ +#include "ctb-0.16/iobase.h" +%} + +namespace ctb { + +enum { + CTB_RESET = CTB_COMMON +}; + +%typemap(in) char *& readbuf (char * tmp) { + /* dont check for list */ + $1 = &tmp; +} + +%typemap(argout) char *& readbuf { + PyObject * plist = PyList_New(2); + PyList_SetItem(plist, 0, PyString_FromString(*$1)); + PyList_SetItem(plist, 1, $result); + $result = plist; + delete *$1; +} + +%typemap(in) size_t * readedBytes (size_t tmp) { + /* dont check for list */ + $1 = &tmp; +} + +%typemap(argout) size_t * readedBytes { + PyList_Append($result, PyInt_FromLong(*$1)); +} + +class IOBase +{ +protected: + virtual int CloseDevice() = 0; + virtual int OpenDevice(const char* devname, void* dcs = 0L) = 0; +public: + IOBase(); + virtual ~IOBase(); + + virtual const char* ClassName(); + int Close(); + virtual int Ioctl(int cmd,void* args); + virtual int IsOpen() = 0; + int Open(const char* devname,void* dcs=0L); + int PutBack(char ch); + virtual int Read(char* buf,size_t len) = 0; + virtual int ReadUntilEOS(char*& readbuf, + size_t* readedBytes, + char* eosString = "\n", + long timeout_in_ms = 1000L, + char quota = 0); + int Readv(char* buf,size_t len,unsigned int timeout_in_ms); + virtual int Write(char* buf,size_t len) = 0; + int Writev(char* buf,size_t len,unsigned int timeout_in_ms); +}; + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/kbhit.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/kbhit.i new file mode 100644 index 0000000000..7e5b6cddd3 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/kbhit.i @@ -0,0 +1,9 @@ +%{ +#include "ctb-0.16/kbhit.h" +%} + +namespace ctb { + +char GetKey(); + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/makepy.sh b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/makepy.sh new file mode 100755 index 0000000000..40b49dfb2e --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/makepy.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +CFLAG='' +GPIB_SOURCES='' +GPIB_LIB='' +GPIB_SUPPORT='' + +# the python develop version. Please check the right version of your +# python developent enviroment +PYTHON_VERSION='2.6' + +for arg in $*; do + if [ "$arg" = "USE_GPIB" ]; then + GPIB_SOURCES='../../../src/gpib.cpp' + GPIB_LIB='-lgpib' + GPIB_SUPPORT='Yes' + else + echo '============================================================' + echo 'You run makepy.sh without GPIB support.' + echo 'If you want to create the python wxctb library with' + echo 'GPIB support, rerun the command with:' + echo 'makepy.sh USE_GPIB=1' + echo '============================================================' + GPIB_SUPPORT='No' + fi + if [ "$arg" = "USE_DEBUG" ]; then + CFLAG='-g' + fi +done + +echo "// This file is created automatically, don't change it!" > wxctb.i +echo "%module wxctb" >> wxctb.i +echo "typedef int size_t;" >> wxctb.i +echo "%include timer.i" >> wxctb.i +echo "%include serport.i" >> wxctb.i +echo "%include ../kbhit.i" >> wxctb.i +if [ "$arg" = "USE_GPIB" ]; then + echo "%include ../gpib.i" >> wxctb.i +fi + +echo "swig generates python wrapper files..." +swig -c++ -Wall -nodefault -python -keyword -new_repr -modern wxctb.i + +echo "create shared library wxctb with GPIB=$GPIB_SUPPORT for python"\ + "$PYTHON_VERSION ..." +g++ -Wall $CFLAG -shared -I /usr/include/python$PYTHON_VERSION/ \ + -I ../../../include \ + wxctb_wrap.cxx \ + ../../../src/linux/timer.cpp \ + ../../../src/linux/serport.cpp \ + ../../../src/serportx.cpp \ + ../../../src/kbhit.cpp \ + ../../../src/iobase.cpp \ + ../../../src/fifo.cpp \ + $GPIB_SOURCES \ + $GPIB_LIB \ + -o _wxctb.so + +echo "copy ctb.py, wxctb.py and _wxctb.so to the module/linux folder..." +mkdir -p ../../module/linux +cp ../ctb.py ../../module/linux/ +cp wxctb.py ../../module/linux/ +cp _wxctb.so ../../module/linux/ diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/serport.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/serport.i new file mode 100644 index 0000000000..3150fe9117 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/serport.i @@ -0,0 +1,50 @@ +%module serport + +%{ +#include "ctb-0.16/linux/serport.h" +%} + +%include ../serportx.i + +namespace ctb { + +%pythoncode { +COM1 = "/dev/ttyS0" +COM2 = "/dev/ttyS1" +COM3 = "/dev/ttyS2" +COM4 = "/dev/ttyS3" +COM5 = "/dev/ttyS4" +COM6 = "/dev/ttyS5" +COM7 = "/dev/ttyS6" +COM8 = "/dev/ttyS7" +COM9 = "/dev/ttyS8" +}; + +class SerialPort : public SerialPort_x +{ +protected: + int fd; + struct termios t, save_t; + struct serial_icounter_struct save_info, last_info; + speed_t AdaptBaudrate(int baud); + + int CloseDevice(); + int OpenDevice(const char* devname, void* dcs); +public: + SerialPort(); + ~SerialPort(); + + int ChangeLineState(SerialLineState flags); + int ClrLineState(SerialLineState flags); + int GetLineState(); + int Ioctl(int cmd,void* args); + int IsOpen(); + int Read(char* buf,size_t len); + int SendBreak(int duration); + int SetBaudrate(int baudrate); + int SetLineState(SerialLineState flags); + int SetParityBit( bool parity ); + int Write(char* buf,size_t len); +}; + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/timer.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/timer.i new file mode 100644 index 0000000000..5709224113 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/timer.i @@ -0,0 +1,37 @@ +%{ +#include "ctb-0.16/linux/timer.h" +%} + +%include cpointer.i + +// lets create new fuctions for pointer handling in python (for int *exitflag) +%pointer_functions(int, intp); + +namespace ctb { + +// perhaps we doesn''t need timer_control to export +// but we need if we want to inherit from timer in python +struct timer_control +{ + unsigned int usecs; + int *exitflag; + void* (*exitfnc)(void*); +}; + +class Timer +{ +protected: + timer_control control; + int stopped; + pthread_t tid; + unsigned int timer_secs; +public: + Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)=NULL); + ~Timer(); + int start(); + int stop(); +}; + +void sleepms(unsigned int ms); + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.i new file mode 100644 index 0000000000..7f84b5fb33 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.i @@ -0,0 +1,6 @@ +// This file is created automatically, don't change it! +%module wxctb +typedef int size_t; +%include timer.i +%include serport.i +%include ../kbhit.i diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.py new file mode 100644 index 0000000000..f9e0d2ee6e --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.py @@ -0,0 +1,264 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.40 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_wxctb', [dirname(__file__)]) + except ImportError: + import _wxctb + return _wxctb + if fp is not None: + try: + _mod = imp.load_module('_wxctb', fp, pathname, description) + finally: + fp.close() + return _mod + _wxctb = swig_import_helper() + del swig_import_helper +else: + import _wxctb +del version_info +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "thisown"): return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'SwigPyObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + if (name == "thisown"): return self.this.own() + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError(name) + +def _swig_repr(self): + try: strthis = "proxy of " + self.this.__repr__() + except: strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +try: + _object = object + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 + + +def _swig_setattr_nondynamic_method(set): + def set_attr(self,name,value): + if (name == "thisown"): return self.this.own(value) + if hasattr(self,name) or (name == "this"): + set(self,name,value) + else: + raise AttributeError("You cannot add attributes to %s" % self) + return set_attr + + + +def new_intp(): + return _wxctb.new_intp() +new_intp = _wxctb.new_intp + +def copy_intp(*args, **kwargs): + return _wxctb.copy_intp(*args, **kwargs) +copy_intp = _wxctb.copy_intp + +def delete_intp(*args, **kwargs): + return _wxctb.delete_intp(*args, **kwargs) +delete_intp = _wxctb.delete_intp + +def intp_assign(*args, **kwargs): + return _wxctb.intp_assign(*args, **kwargs) +intp_assign = _wxctb.intp_assign + +def intp_value(*args, **kwargs): + return _wxctb.intp_value(*args, **kwargs) +intp_value = _wxctb.intp_value +class timer_control(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") + __repr__ = _swig_repr + usecs = _swig_property(_wxctb.timer_control_usecs_get, _wxctb.timer_control_usecs_set) + exitflag = _swig_property(_wxctb.timer_control_exitflag_get, _wxctb.timer_control_exitflag_set) + exitfnc = _swig_property(_wxctb.timer_control_exitfnc_get, _wxctb.timer_control_exitfnc_set) +timer_control_swigregister = _wxctb.timer_control_swigregister +timer_control_swigregister(timer_control) + +class Timer(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + def __init__(self, *args, **kwargs): + this = _wxctb.new_Timer(*args, **kwargs) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_Timer + __del__ = lambda self : None; + def start(self): return _wxctb.Timer_start(self) + def stop(self): return _wxctb.Timer_stop(self) +Timer_swigregister = _wxctb.Timer_swigregister +Timer_swigregister(Timer) + + +def sleepms(*args, **kwargs): + return _wxctb.sleepms(*args, **kwargs) +sleepms = _wxctb.sleepms +CTB_RESET = _wxctb.CTB_RESET +class IOBase(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _wxctb.delete_IOBase + __del__ = lambda self : None; + def ClassName(self): return _wxctb.IOBase_ClassName(self) + def Close(self): return _wxctb.IOBase_Close(self) + def Ioctl(self, *args, **kwargs): return _wxctb.IOBase_Ioctl(self, *args, **kwargs) + def IsOpen(self): return _wxctb.IOBase_IsOpen(self) + def Open(self, *args, **kwargs): return _wxctb.IOBase_Open(self, *args, **kwargs) + def PutBack(self, *args, **kwargs): return _wxctb.IOBase_PutBack(self, *args, **kwargs) + def Read(self, *args, **kwargs): return _wxctb.IOBase_Read(self, *args, **kwargs) + def ReadUntilEOS(self, *args, **kwargs): return _wxctb.IOBase_ReadUntilEOS(self, *args, **kwargs) + def Readv(self, *args, **kwargs): return _wxctb.IOBase_Readv(self, *args, **kwargs) + def Write(self, *args, **kwargs): return _wxctb.IOBase_Write(self, *args, **kwargs) + def Writev(self, *args, **kwargs): return _wxctb.IOBase_Writev(self, *args, **kwargs) +IOBase_swigregister = _wxctb.IOBase_swigregister +IOBase_swigregister(IOBase) + +ParityNone = _wxctb.ParityNone +ParityOdd = _wxctb.ParityOdd +ParityEven = _wxctb.ParityEven +ParityMark = _wxctb.ParityMark +ParitySpace = _wxctb.ParitySpace +LinestateDcd = _wxctb.LinestateDcd +LinestateCts = _wxctb.LinestateCts +LinestateDsr = _wxctb.LinestateDsr +LinestateDtr = _wxctb.LinestateDtr +LinestateRing = _wxctb.LinestateRing +LinestateRts = _wxctb.LinestateRts +LinestateNull = _wxctb.LinestateNull +class SerialPort_DCS(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + baud = _swig_property(_wxctb.SerialPort_DCS_baud_get, _wxctb.SerialPort_DCS_baud_set) + parity = _swig_property(_wxctb.SerialPort_DCS_parity_get, _wxctb.SerialPort_DCS_parity_set) + wordlen = _swig_property(_wxctb.SerialPort_DCS_wordlen_get, _wxctb.SerialPort_DCS_wordlen_set) + stopbits = _swig_property(_wxctb.SerialPort_DCS_stopbits_get, _wxctb.SerialPort_DCS_stopbits_set) + rtscts = _swig_property(_wxctb.SerialPort_DCS_rtscts_get, _wxctb.SerialPort_DCS_rtscts_set) + xonxoff = _swig_property(_wxctb.SerialPort_DCS_xonxoff_get, _wxctb.SerialPort_DCS_xonxoff_set) + buf = _swig_property(_wxctb.SerialPort_DCS_buf_get, _wxctb.SerialPort_DCS_buf_set) + def __init__(self): + this = _wxctb.new_SerialPort_DCS() + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_SerialPort_DCS + __del__ = lambda self : None; + def GetSettings(self): return _wxctb.SerialPort_DCS_GetSettings(self) +SerialPort_DCS_swigregister = _wxctb.SerialPort_DCS_swigregister +SerialPort_DCS_swigregister(SerialPort_DCS) + +class SerialPort_EINFO(object): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + brk = _swig_property(_wxctb.SerialPort_EINFO_brk_get, _wxctb.SerialPort_EINFO_brk_set) + frame = _swig_property(_wxctb.SerialPort_EINFO_frame_get, _wxctb.SerialPort_EINFO_frame_set) + overrun = _swig_property(_wxctb.SerialPort_EINFO_overrun_get, _wxctb.SerialPort_EINFO_overrun_set) + parity = _swig_property(_wxctb.SerialPort_EINFO_parity_get, _wxctb.SerialPort_EINFO_parity_set) + def __init__(self): + this = _wxctb.new_SerialPort_EINFO() + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_SerialPort_EINFO + __del__ = lambda self : None; +SerialPort_EINFO_swigregister = _wxctb.SerialPort_EINFO_swigregister +SerialPort_EINFO_swigregister(SerialPort_EINFO) + +CTB_SER_GETEINFO = _wxctb.CTB_SER_GETEINFO +CTB_SER_GETBRK = _wxctb.CTB_SER_GETBRK +CTB_SER_GETFRM = _wxctb.CTB_SER_GETFRM +CTB_SER_GETOVR = _wxctb.CTB_SER_GETOVR +CTB_SER_GETPAR = _wxctb.CTB_SER_GETPAR +CTB_SER_GETINQUE = _wxctb.CTB_SER_GETINQUE +CTB_SER_SETPAR = _wxctb.CTB_SER_SETPAR +class SerialPort_x(IOBase): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _wxctb.delete_SerialPort_x + __del__ = lambda self : None; + def ClassName(self): return _wxctb.SerialPort_x_ClassName(self) + def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ChangeLineState(self, *args, **kwargs) + def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ClrLineState(self, *args, **kwargs) + def GetLineState(self): return _wxctb.SerialPort_x_GetLineState(self) + def GetSettingsAsString(self): return _wxctb.SerialPort_x_GetSettingsAsString(self) + def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_x_Ioctl(self, *args, **kwargs) + def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_x_SendBreak(self, *args, **kwargs) + def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_x_SetBaudrate(self, *args, **kwargs) + def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_SetLineState(self, *args, **kwargs) + def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_x_SetParityBit(self, *args, **kwargs) + IsStandardRate = staticmethod(_wxctb.SerialPort_x_IsStandardRate) +SerialPort_x_swigregister = _wxctb.SerialPort_x_swigregister +SerialPort_x_swigregister(SerialPort_x) + +def SerialPort_x_IsStandardRate(*args, **kwargs): + return _wxctb.SerialPort_x_IsStandardRate(*args, **kwargs) +SerialPort_x_IsStandardRate = _wxctb.SerialPort_x_IsStandardRate + +COM1 = "/dev/ttyS0" +COM2 = "/dev/ttyS1" +COM3 = "/dev/ttyS2" +COM4 = "/dev/ttyS3" +COM5 = "/dev/ttyS4" +COM6 = "/dev/ttyS5" +COM7 = "/dev/ttyS6" +COM8 = "/dev/ttyS7" +COM9 = "/dev/ttyS8" + +class SerialPort(SerialPort_x): + thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + __repr__ = _swig_repr + def __init__(self): + this = _wxctb.new_SerialPort() + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _wxctb.delete_SerialPort + __del__ = lambda self : None; + def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_ChangeLineState(self, *args, **kwargs) + def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_ClrLineState(self, *args, **kwargs) + def GetLineState(self): return _wxctb.SerialPort_GetLineState(self) + def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_Ioctl(self, *args, **kwargs) + def IsOpen(self): return _wxctb.SerialPort_IsOpen(self) + def Read(self, *args, **kwargs): return _wxctb.SerialPort_Read(self, *args, **kwargs) + def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_SendBreak(self, *args, **kwargs) + def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_SetBaudrate(self, *args, **kwargs) + def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_SetLineState(self, *args, **kwargs) + def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_SetParityBit(self, *args, **kwargs) + def Write(self, *args, **kwargs): return _wxctb.SerialPort_Write(self, *args, **kwargs) +SerialPort_swigregister = _wxctb.SerialPort_swigregister +SerialPort_swigregister(SerialPort) + + +def GetKey(): + return _wxctb.GetKey() +GetKey = _wxctb.GetKey + + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb_wrap.cxx b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb_wrap.cxx new file mode 100644 index 0000000000..c72f220ded --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb_wrap.cxx @@ -0,0 +1,6469 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.40 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPYTHON +#define SWIG_PYTHON_DIRECTOR_NO_VTABLE + + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + + +/* Python.h has to appear first */ +#include + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return and integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCompare(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + +/* Add PyOS_snprintf for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# define PyOS_snprintf _snprintf +# else +# define PyOS_snprintf snprintf +# endif +#endif + +/* A crude PyString_FromFormat implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 + +#ifndef SWIG_PYBUFFER_SIZE +# define SWIG_PYBUFFER_SIZE 1024 +#endif + +static PyObject * +PyString_FromFormat(const char *fmt, ...) { + va_list ap; + char buf[SWIG_PYBUFFER_SIZE * 2]; + int res; + va_start(ap, fmt); + res = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); +} +#endif + +/* Add PyObject_Del for old Pythons */ +#if PY_VERSION_HEX < 0x01060000 +# define PyObject_Del(op) PyMem_DEL((op)) +#endif +#ifndef PyObject_DEL +# define PyObject_DEL PyObject_Del +#endif + +/* A crude PyExc_StopIteration exception for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# ifndef PyExc_StopIteration +# define PyExc_StopIteration PyExc_RuntimeError +# endif +# ifndef PyObject_GenericGetAttr +# define PyObject_GenericGetAttr 0 +# endif +#endif + +/* Py_NotImplemented is defined in 2.1 and up. */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef Py_NotImplemented +# define Py_NotImplemented PyExc_RuntimeError +# endif +#endif + +/* A crude PyString_AsStringAndSize implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef PyString_AsStringAndSize +# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} +# endif +#endif + +/* PySequence_Size for old Pythons */ +#if PY_VERSION_HEX < 0x02000000 +# ifndef PySequence_Size +# define PySequence_Size PySequence_Length +# endif +#endif + +/* PyBool_FromLong for old Pythons */ +#if PY_VERSION_HEX < 0x02030000 +static +PyObject *PyBool_FromLong(long ok) +{ + PyObject *result = ok ? Py_True : Py_False; + Py_INCREF(result); + return result; +} +#endif + +/* Py_ssize_t for old Pythons */ +/* This code is as recommended by: */ +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +# define PY_SSIZE_T_MAX INT_MAX +# define PY_SSIZE_T_MIN INT_MIN +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIME PyObject* +SWIG_Python_ErrorType(int code) { + PyObject* type = 0; + switch(code) { + case SWIG_MemoryError: + type = PyExc_MemoryError; + break; + case SWIG_IOError: + type = PyExc_IOError; + break; + case SWIG_RuntimeError: + type = PyExc_RuntimeError; + break; + case SWIG_IndexError: + type = PyExc_IndexError; + break; + case SWIG_TypeError: + type = PyExc_TypeError; + break; + case SWIG_DivisionByZero: + type = PyExc_ZeroDivisionError; + break; + case SWIG_OverflowError: + type = PyExc_OverflowError; + break; + case SWIG_SyntaxError: + type = PyExc_SyntaxError; + break; + case SWIG_ValueError: + type = PyExc_ValueError; + break; + case SWIG_SystemError: + type = PyExc_SystemError; + break; + case SWIG_AttributeError: + type = PyExc_AttributeError; + break; + default: + type = PyExc_RuntimeError; + } + return type; +} + + +SWIGRUNTIME void +SWIG_Python_AddErrorMsg(const char* mesg) +{ + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + + if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + PyErr_Clear(); + Py_XINCREF(type); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + Py_DECREF(value); + } else { + PyErr_SetString(PyExc_RuntimeError, mesg); + } +} + +#if defined(SWIG_PYTHON_NO_THREADS) +# if defined(SWIG_PYTHON_THREADS) +# undef SWIG_PYTHON_THREADS +# endif +#endif +#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ +# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) +# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ +# define SWIG_PYTHON_USE_GIL +# endif +# endif +# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ +# ifndef SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# endif +# ifdef __cplusplus /* C++ code */ + class SWIG_Python_Thread_Block { + bool status; + PyGILState_STATE state; + public: + void end() { if (status) { PyGILState_Release(state); status = false;} } + SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} + ~SWIG_Python_Thread_Block() { end(); } + }; + class SWIG_Python_Thread_Allow { + bool status; + PyThreadState *save; + public: + void end() { if (status) { PyEval_RestoreThread(save); status = false; }} + SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} + ~SWIG_Python_Thread_Allow() { end(); } + }; +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block +# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow +# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() +# else /* C code */ +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() +# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() +# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) +# endif +# else /* Old thread way, not implemented, user must provide it */ +# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) +# define SWIG_PYTHON_INITIALIZE_THREADS +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) +# define SWIG_PYTHON_THREAD_END_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# endif +# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) +# define SWIG_PYTHON_THREAD_END_ALLOW +# endif +# endif +#else /* No thread support */ +# define SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# define SWIG_PYTHON_THREAD_END_BLOCK +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# define SWIG_PYTHON_THREAD_END_ALLOW +#endif + +/* ----------------------------------------------------------------------------- + * Python API portion that goes into the runtime + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* cc-mode */ +#endif +#endif + +/* ----------------------------------------------------------------------------- + * Constant declarations + * ----------------------------------------------------------------------------- */ + +/* Constant Types */ +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_const_info; + + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + +#ifdef __cplusplus +#if 0 +{ /* cc-mode */ +#endif +} +#endif + + +/* ----------------------------------------------------------------------------- + * See the LICENSE file for information on copyright, usage and redistribution + * of SWIG, and the README file for authors - http://www.swig.org/release.html. + * + * pyrun.swg + * + * This file contains the runtime support for Python modules + * and includes code for managing global variables and pointer + * type checking. + * + * ----------------------------------------------------------------------------- */ + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) +#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) +#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags) +#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) +#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) +#define swig_owntype int + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Python_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) + +#define SWIG_SetErrorObj SWIG_Python_SetErrorObj +#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg +#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) +#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + + +/* Runtime API implementation */ + +/* Error manipulation */ + +SWIGINTERN void +SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetObject(errtype, obj); + Py_DECREF(obj); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +SWIGINTERN void +SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetString(errtype, (char *) msg); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) + +/* Set a constant value */ + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { + PyDict_SetItemString(d, (char*) name, obj); + Py_DECREF(obj); +} + +/* Append a value to the result obj */ + +SWIGINTERN PyObject* +SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { +#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyList_Check(result)) { + PyObject *o2 = result; + result = PyList_New(1); + PyList_SetItem(result, 0, o2); + } + PyList_Append(result,obj); + Py_DECREF(obj); + } + return result; +#else + PyObject* o2; + PyObject* o3; + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyTuple_Check(result)) { + o2 = result; + result = PyTuple_New(1); + PyTuple_SET_ITEM(result, 0, o2); + } + o3 = PyTuple_New(1); + PyTuple_SET_ITEM(o3, 0, obj); + o2 = result; + result = PySequence_Concat(o2, o3); + Py_DECREF(o2); + Py_DECREF(o3); + } + return result; +#endif +} + +/* Unpack the argument tuple */ + +SWIGINTERN int +SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) +{ + if (!args) { + if (!min && !max) { + return 1; + } else { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", + name, (min == max ? "" : "at least "), (int)min); + return 0; + } + } + if (!PyTuple_Check(args)) { + PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); + return 0; + } else { + register Py_ssize_t l = PyTuple_GET_SIZE(args); + if (l < min) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at least "), (int)min, (int)l); + return 0; + } else if (l > max) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at most "), (int)max, (int)l); + return 0; + } else { + register int i; + for (i = 0; i < l; ++i) { + objs[i] = PyTuple_GET_ITEM(args, i); + } + for (; l < max; ++l) { + objs[l] = 0; + } + return i + 1; + } + } +} + +/* A functor is a function object with one single object argument */ +#if PY_VERSION_HEX >= 0x02020000 +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); +#else +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); +#endif + +/* + Helper for static pointer initialization for both C and C++ code, for example + static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); +*/ +#ifdef __cplusplus +#define SWIG_STATIC_POINTER(var) var +#else +#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var +#endif + +/* ----------------------------------------------------------------------------- + * Pointer declarations + * ----------------------------------------------------------------------------- */ + +/* Flags for new pointer objects */ +#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) +#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) + +#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* cc-mode */ +#endif +#endif + +/* How to access Py_None */ +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# ifndef SWIG_PYTHON_NO_BUILD_NONE +# ifndef SWIG_PYTHON_BUILD_NONE +# define SWIG_PYTHON_BUILD_NONE +# endif +# endif +#endif + +#ifdef SWIG_PYTHON_BUILD_NONE +# ifdef Py_None +# undef Py_None +# define Py_None SWIG_Py_None() +# endif +SWIGRUNTIMEINLINE PyObject * +_SWIG_Py_None(void) +{ + PyObject *none = Py_BuildValue((char*)""); + Py_DECREF(none); + return none; +} +SWIGRUNTIME PyObject * +SWIG_Py_None(void) +{ + static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); + return none; +} +#endif + +/* The python void return value */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Py_Void(void) +{ + PyObject *none = Py_None; + Py_INCREF(none); + return none; +} + +/* SwigPyClientData */ + +typedef struct { + PyObject *klass; + PyObject *newraw; + PyObject *newargs; + PyObject *destroy; + int delargs; + int implicitconv; +} SwigPyClientData; + +SWIGRUNTIMEINLINE int +SWIG_Python_CheckImplicit(swig_type_info *ty) +{ + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; + return data ? data->implicitconv : 0; +} + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_ExceptionType(swig_type_info *desc) { + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; + PyObject *klass = data ? data->klass : 0; + return (klass ? klass : PyExc_RuntimeError); +} + + +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) +{ + if (!obj) { + return 0; + } else { + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); + /* the klass element */ + data->klass = obj; + Py_INCREF(data->klass); + /* the newraw method and newargs arguments used to create a new raw instance */ + if (PyClass_Check(obj)) { + data->newraw = 0; + data->newargs = obj; + Py_INCREF(obj); + } else { +#if (PY_VERSION_HEX < 0x02020000) + data->newraw = 0; +#else + data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); +#endif + if (data->newraw) { + Py_INCREF(data->newraw); + data->newargs = PyTuple_New(1); + PyTuple_SetItem(data->newargs, 0, obj); + } else { + data->newargs = obj; + } + Py_INCREF(data->newargs); + } + /* the destroy method, aka as the C++ delete method */ + data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + if (PyErr_Occurred()) { + PyErr_Clear(); + data->destroy = 0; + } + if (data->destroy) { + int flags; + Py_INCREF(data->destroy); + flags = PyCFunction_GET_FLAGS(data->destroy); +#ifdef METH_O + data->delargs = !(flags & (METH_O)); +#else + data->delargs = 0; +#endif + } else { + data->delargs = 0; + } + data->implicitconv = 0; + return data; + } +} + +SWIGRUNTIME void +SwigPyClientData_Del(SwigPyClientData* data) +{ + Py_XDECREF(data->newraw); + Py_XDECREF(data->newargs); + Py_XDECREF(data->destroy); +} + +/* =============== SwigPyObject =====================*/ + +typedef struct { + PyObject_HEAD + void *ptr; + swig_type_info *ty; + int own; + PyObject *next; +} SwigPyObject; + +SWIGRUNTIME PyObject * +SwigPyObject_long(SwigPyObject *v) +{ + return PyLong_FromVoidPtr(v->ptr); +} + +SWIGRUNTIME PyObject * +SwigPyObject_format(const char* fmt, SwigPyObject *v) +{ + PyObject *res = NULL; + PyObject *args = PyTuple_New(1); + if (args) { + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); + if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else + res = PyString_Format(ofmt,args); +#endif + Py_DECREF(ofmt); + } + Py_DECREF(args); + } + } + return res; +} + +SWIGRUNTIME PyObject * +SwigPyObject_oct(SwigPyObject *v) +{ + return SwigPyObject_format("%o",v); +} + +SWIGRUNTIME PyObject * +SwigPyObject_hex(SwigPyObject *v) +{ + return SwigPyObject_format("%x",v); +} + +SWIGRUNTIME PyObject * +#ifdef METH_NOARGS +SwigPyObject_repr(SwigPyObject *v) +#else +SwigPyObject_repr(SwigPyObject *v, PyObject *args) +#endif +{ + const char *name = SWIG_TypePrettyName(v->ty); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); + if (v->next) { +#ifdef METH_NOARGS + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); +#else + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); +#endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else + PyString_ConcatAndDel(&repr,nrep); +#endif + } + return repr; +} + +SWIGRUNTIME int +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +{ + char *str; +#ifdef METH_NOARGS + PyObject *repr = SwigPyObject_repr(v); +#else + PyObject *repr = SwigPyObject_repr(v, NULL); +#endif + if (repr) { + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); + Py_DECREF(repr); + return 0; + } else { + return 1; + } +} + +SWIGRUNTIME PyObject * +SwigPyObject_str(SwigPyObject *v) +{ + char result[SWIG_BUFFER_SIZE]; + return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? + SWIG_Python_str_FromChar(result) : 0; +} + +SWIGRUNTIME int +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) +{ + void *i = v->ptr; + void *j = w->ptr; + return (i < j) ? -1 : ((i > j) ? 1 : 0); +} + +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + +SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); + +SWIGRUNTIME PyTypeObject* +SwigPyObject_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); + return type; +} + +SWIGRUNTIMEINLINE int +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); + +SWIGRUNTIME void +SwigPyObject_dealloc(PyObject *v) +{ + SwigPyObject *sobj = (SwigPyObject *) v; + PyObject *next = sobj->next; + if (sobj->own == SWIG_POINTER_OWN) { + swig_type_info *ty = sobj->ty; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + PyObject *destroy = data ? data->destroy : 0; + if (destroy) { + /* destroy is always a VARARGS method */ + PyObject *res; + if (data->delargs) { + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); + res = SWIG_Python_CallFunctor(destroy, tmp); + Py_DECREF(tmp); + } else { + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject *mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); + } + Py_XDECREF(res); + } +#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) + else { + const char *name = SWIG_TypePrettyName(ty); + printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); + } +#endif + } + Py_XDECREF(next); + PyObject_DEL(v); +} + +SWIGRUNTIME PyObject* +SwigPyObject_append(PyObject* v, PyObject* next) +{ + SwigPyObject *sobj = (SwigPyObject *) v; +#ifndef METH_O + PyObject *tmp = 0; + if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; + next = tmp; +#endif + if (!SwigPyObject_Check(next)) { + return NULL; + } + sobj->next = next; + Py_INCREF(next); + return SWIG_Py_Void(); +} + +SWIGRUNTIME PyObject* +#ifdef METH_NOARGS +SwigPyObject_next(PyObject* v) +#else +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *) v; + if (sobj->next) { + Py_INCREF(sobj->next); + return sobj->next; + } else { + return SWIG_Py_Void(); + } +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_disown(PyObject *v) +#else +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = 0; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +SwigPyObject_acquire(PyObject *v) +#else +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + SwigPyObject *sobj = (SwigPyObject *)v; + sobj->own = SWIG_POINTER_OWN; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +SwigPyObject_own(PyObject *v, PyObject *args) +{ + PyObject *val = 0; +#if (PY_VERSION_HEX < 0x02020000) + if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) +#else + if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) +#endif + { + return NULL; + } + else + { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { +#ifdef METH_NOARGS + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v); + } else { + SwigPyObject_disown(v); + } +#else + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } +#endif + } + return obj; + } +} + +#ifdef METH_O +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#else +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#endif + +#if PY_VERSION_HEX < 0x02020000 +SWIGINTERN PyObject * +SwigPyObject_getattr(SwigPyObject *sobj,char *name) +{ + return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); +} +#endif + +SWIGRUNTIME PyTypeObject* +_PySwigObject_type(void) { + static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; + + static PyNumberMethods SwigPyObject_as_number = { + (binaryfunc)0, /*nb_add*/ + (binaryfunc)0, /*nb_subtract*/ + (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc)0, /*nb_divide*/ +#endif + (binaryfunc)0, /*nb_remainder*/ + (binaryfunc)0, /*nb_divmod*/ + (ternaryfunc)0,/*nb_power*/ + (unaryfunc)0, /*nb_negative*/ + (unaryfunc)0, /*nb_positive*/ + (unaryfunc)0, /*nb_absolute*/ + (inquiry)0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif + (unaryfunc)0, /*nb_float*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ +#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ +#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ + 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ +#endif + }; + + static PyTypeObject swigpyobject_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp + = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ +#if PY_VERSION_HEX < 0x02020000 + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ +#else + (getattrfunc)0, /* tp_getattr */ +#endif + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyObject_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigobject_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + swigobject_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + 0,0,0,0 /* tp_alloc -> tp_next */ +#endif + }; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif + type_init = 1; + } + return &swigpyobject_type; +} + +SWIGRUNTIME PyObject * +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) +{ + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); + if (sobj) { + sobj->ptr = ptr; + sobj->ty = ty; + sobj->own = own; + sobj->next = 0; + } + return (PyObject *)sobj; +} + +/* ----------------------------------------------------------------------------- + * Implements a simple Swig Packed type, and use it instead of string + * ----------------------------------------------------------------------------- */ + +typedef struct { + PyObject_HEAD + void *pack; + swig_type_info *ty; + size_t size; +} SwigPyPacked; + +SWIGRUNTIME int +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +{ + char result[SWIG_BUFFER_SIZE]; + fputs("pack, v->size, 0, sizeof(result))) { + fputs("at ", fp); + fputs(result, fp); + } + fputs(v->ty->name,fp); + fputs(">", fp); + return 0; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_repr(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { + return SWIG_Python_str_FromFormat("", result, v->ty->name); + } else { + return SWIG_Python_str_FromFormat("", v->ty->name); + } +} + +SWIGRUNTIME PyObject * +SwigPyPacked_str(SwigPyPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); + } else { + return SWIG_Python_str_FromChar(v->ty->name); + } +} + +SWIGRUNTIME int +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) +{ + size_t i = v->size; + size_t j = w->size; + int s = (i < j) ? -1 : ((i > j) ? 1 : 0); + return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); +} + +SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); + +SWIGRUNTIME PyTypeObject* +SwigPyPacked_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); + return type; +} + +SWIGRUNTIMEINLINE int +SwigPyPacked_Check(PyObject *op) { + return ((op)->ob_type == _PySwigPacked_type()) + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); +} + +SWIGRUNTIME void +SwigPyPacked_dealloc(PyObject *v) +{ + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; + free(sobj->pack); + } + PyObject_DEL(v); +} + +SWIGRUNTIME PyTypeObject* +_PySwigPacked_type(void) { + static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; + static PyTypeObject swigpypacked_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp + = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ + (getattrfunc)0, /* tp_getattr */ + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigpacked_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + 0,0,0,0 /* tp_alloc -> tp_next */ +#endif + }; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif + type_init = 1; + } + return &swigpypacked_type; +} + +SWIGRUNTIME PyObject * +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) +{ + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); + if (sobj) { + void *pack = malloc(size); + if (pack) { + memcpy(pack, ptr, size); + sobj->pack = pack; + sobj->ty = ty; + sobj->size = size; + } else { + PyObject_DEL((PyObject *) sobj); + sobj = 0; + } + } + return (PyObject *) sobj; +} + +SWIGRUNTIME swig_type_info * +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +{ + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; + if (sobj->size != size) return 0; + memcpy(ptr, sobj->pack, size); + return sobj->ty; + } else { + return 0; + } +} + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIMEINLINE PyObject * +_SWIG_This(void) +{ + return SWIG_Python_str_FromChar("this"); +} + +SWIGRUNTIME PyObject * +SWIG_This(void) +{ + static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This(); + return swig_this; +} + +/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ + +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * +SWIG_Python_GetSwigThis(PyObject *pyobj) +{ + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; + } else { + PyObject *obj = 0; +#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) + if (PyInstance_Check(pyobj)) { + obj = _PyInstance_Lookup(pyobj, SWIG_This()); + } else { + PyObject **dictptr = _PyObject_GetDictPtr(pyobj); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; + } else { +#ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); + return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; + } +#endif + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } + } + } +#else + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } +#endif + if (obj && !SwigPyObject_Check(obj)) { + /* a PyObject is called 'this', try to get the 'real this' + SwigPyObject from it */ + return SWIG_Python_GetSwigThis(obj); + } + return (SwigPyObject *)obj; + } +} + +/* Acquire a pointer value */ + +SWIGRUNTIME int +SWIG_Python_AcquirePtr(PyObject *obj, int own) { + if (own == SWIG_POINTER_OWN) { + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); + if (sobj) { + int oldown = sobj->own; + sobj->own = own; + return oldown; + } + } + return 0; +} + +/* Convert a pointer value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { + if (!obj) return SWIG_ERROR; + if (obj == Py_None) { + if (ptr) *ptr = 0; + return SWIG_OK; + } else { + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; + while (sobj) { + void *vptr = sobj->ptr; + if (ty) { + swig_type_info *to = sobj->ty; + if (to == ty) { + /* no type cast needed */ + if (ptr) *ptr = vptr; + break; + } else { + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) { + sobj = (SwigPyObject *)sobj->next; + } else { + if (ptr) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } + } + break; + } + } + } else { + if (ptr) *ptr = vptr; + break; + } + } + if (sobj) { + if (own) + *own = *own | sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + return SWIG_OK; + } else { + int res = SWIG_ERROR; + if (flags & SWIG_POINTER_IMPLICIT_CONV) { + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; + if (data && !data->implicitconv) { + PyObject *klass = data->klass; + if (klass) { + PyObject *impconv; + data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ + impconv = SWIG_Python_CallFunctor(klass, obj); + data->implicitconv = 0; + if (PyErr_Occurred()) { + PyErr_Clear(); + impconv = 0; + } + if (impconv) { + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); + if (iobj) { + void *vptr; + res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); + if (SWIG_IsOK(res)) { + if (ptr) { + *ptr = vptr; + /* transfer the ownership to 'ptr' */ + iobj->own = 0; + res = SWIG_AddCast(res); + res = SWIG_AddNewMask(res); + } else { + res = SWIG_AddCast(res); + } + } + } + Py_DECREF(impconv); + } + } + } + } + return res; + } + } +} + +/* Convert a function ptr value */ + +SWIGRUNTIME int +SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { + if (!PyCFunction_Check(obj)) { + return SWIG_ConvertPtr(obj, ptr, ty, 0); + } else { + void *vptr = 0; + + /* here we get the method pointer for callbacks */ + const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); + const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; + if (desc) + desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; + if (!desc) + return SWIG_ERROR; + if (ty) { + swig_cast_info *tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + return SWIG_ERROR; + } + } else { + *ptr = vptr; + } + return SWIG_OK; + } +} + +/* Convert a packed value value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +/* ----------------------------------------------------------------------------- + * Create a new pointer object + * ----------------------------------------------------------------------------- */ + +/* + Create a new instance object, without calling __init__, and set the + 'this' attribute. +*/ + +SWIGRUNTIME PyObject* +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) +{ +#if (PY_VERSION_HEX >= 0x02020000) + PyObject *inst = 0; + PyObject *newraw = data->newraw; + if (newraw) { + inst = PyObject_Call(newraw, data->newargs, NULL); + if (inst) { +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + PyDict_SetItem(dict, SWIG_This(), swig_this); + } + } +#else + PyObject *key = SWIG_This(); + PyObject_SetAttr(inst, key, swig_this); +#endif + } + } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else + PyObject *dict = PyDict_New(); + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); +#endif + } + return inst; +#else +#if (PY_VERSION_HEX >= 0x02010000) + PyObject *inst; + PyObject *dict = PyDict_New(); + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + return (PyObject *) inst; +#else + PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); + if (inst == NULL) { + return NULL; + } + inst->in_class = (PyClassObject *)data->newargs; + Py_INCREF(inst->in_class); + inst->in_dict = PyDict_New(); + if (inst->in_dict == NULL) { + Py_DECREF(inst); + return NULL; + } +#ifdef Py_TPFLAGS_HAVE_WEAKREFS + inst->in_weakreflist = NULL; +#endif +#ifdef Py_TPFLAGS_GC + PyObject_GC_Init(inst); +#endif + PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); + return (PyObject *) inst; +#endif +#endif +} + +SWIGRUNTIME void +SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) +{ + PyObject *dict; +#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + PyDict_SetItem(dict, SWIG_This(), swig_this); + return; + } +#endif + dict = PyObject_GetAttrString(inst, (char*)"__dict__"); + PyDict_SetItem(dict, SWIG_This(), swig_this); + Py_DECREF(dict); +} + + +SWIGINTERN PyObject * +SWIG_Python_InitShadowInstance(PyObject *args) { + PyObject *obj[2]; + if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { + return NULL; + } else { + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + if (sthis) { + SwigPyObject_append((PyObject*) sthis, obj[1]); + } else { + SWIG_Python_SetSwigThis(obj[0], obj[1]); + } + return SWIG_Py_Void(); + } +} + +/* Create a new pointer object */ + +SWIGRUNTIME PyObject * +SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { + if (!ptr) { + return SWIG_Py_Void(); + } else { + int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; + if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { + PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); + if (inst) { + Py_DECREF(robj); + robj = inst; + } + } + return robj; + } +} + +/* Create a new packed object */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); +} + +/* -----------------------------------------------------------------------------* + * Get type list + * -----------------------------------------------------------------------------*/ + +#ifdef SWIG_LINK_RUNTIME +void *SWIG_ReturnGlobalTypeList(void *); +#endif + +SWIGRUNTIME swig_module_info * +SWIG_Python_GetModule(void) { + static void *type_pointer = (void *)0; + /* first check if module already created */ + if (!type_pointer) { +#ifdef SWIG_LINK_RUNTIME + type_pointer = SWIG_ReturnGlobalTypeList((void *)0); +#else + type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; + } +#endif + } + return (swig_module_info *) type_pointer; +} + +#if PY_MAJOR_VERSION < 2 +/* PyModule_AddObject function was introduced in Python 2.0. The following function + is copied out of Python/modsupport.c in python version 2.3.4 */ +SWIGINTERN int +PyModule_AddObject(PyObject *m, char *name, PyObject *o) +{ + PyObject *dict; + if (!PyModule_Check(m)) { + PyErr_SetString(PyExc_TypeError, + "PyModule_AddObject() needs module as first arg"); + return SWIG_ERROR; + } + if (!o) { + PyErr_SetString(PyExc_TypeError, + "PyModule_AddObject() needs non-NULL value"); + return SWIG_ERROR; + } + + dict = PyModule_GetDict(m); + if (dict == NULL) { + /* Internal error -- modules must have a dict! */ + PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", + PyModule_GetName(m)); + return SWIG_ERROR; + } + if (PyDict_SetItemString(dict, name, o)) + return SWIG_ERROR; + Py_DECREF(o); + return SWIG_OK; +} +#endif + +SWIGRUNTIME void +SWIG_Python_DestroyModule(void *vptr) +{ + swig_module_info *swig_module = (swig_module_info *) vptr; + swig_type_info **types = swig_module->types; + size_t i; + for (i =0; i < swig_module->size; ++i) { + swig_type_info *ty = types[i]; + if (ty->owndata) { + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); + } + } + Py_DECREF(SWIG_This()); +} + +SWIGRUNTIME void +SWIG_Python_SetModule(swig_module_info *swig_module) { + static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ + +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else + PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + swig_empty_runtime_method_table); +#endif + PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +} + +/* The python cached type query */ +SWIGRUNTIME PyObject * +SWIG_Python_TypeCache(void) { + static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); + return cache; +} + +SWIGRUNTIME swig_type_info * +SWIG_Python_TypeQuery(const char *type) +{ + PyObject *cache = SWIG_Python_TypeCache(); + PyObject *key = SWIG_Python_str_FromChar(type); + PyObject *obj = PyDict_GetItem(cache, key); + swig_type_info *descriptor; + if (obj) { + descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); + } else { + swig_module_info *swig_module = SWIG_Python_GetModule(); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { + obj = PyCObject_FromVoidPtr(descriptor, NULL); + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } + } + Py_DECREF(key); + return descriptor; +} + +/* + For backward compatibility only +*/ +#define SWIG_POINTER_EXCEPTION 0 +#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) +#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) + +SWIGRUNTIME int +SWIG_Python_AddErrMesg(const char* mesg, int infront) +{ + if (PyErr_Occurred()) { + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + PyErr_Fetch(&type, &value, &traceback); + if (value) { + char *tmp; + PyObject *old_str = PyObject_Str(value); + Py_XINCREF(type); + PyErr_Clear(); + if (infront) { + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + } else { + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + } + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + } + return 1; + } else { + return 0; + } +} + +SWIGRUNTIME int +SWIG_Python_ArgFail(int argnum) +{ + if (PyErr_Occurred()) { + /* add information about failing argument */ + char mesg[256]; + PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); + return SWIG_Python_AddErrMesg(mesg, 1); + } else { + return 0; + } +} + +SWIGRUNTIMEINLINE const char * +SwigPyObject_GetDesc(PyObject *self) +{ + SwigPyObject *v = (SwigPyObject *)self; + swig_type_info *ty = v ? v->ty : 0; + return ty ? ty->str : (char*)""; +} + +SWIGRUNTIME void +SWIG_Python_TypeError(const char *type, PyObject *obj) +{ + if (type) { +#if defined(SWIG_COBJECT_TYPES) + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); + if (otype) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", + type, otype); + return; + } + } else +#endif + { + const char *otype = (obj ? obj->ob_type->tp_name : 0); + if (otype) { + PyObject *str = PyObject_Str(obj); + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; + if (cstr) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", + type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); + } else { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", + type, otype); + } + Py_XDECREF(str); + return; + } + } + PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); + } else { + PyErr_Format(PyExc_TypeError, "unexpected type is received"); + } +} + + +/* Convert a pointer value, signal an exception on a type mismatch */ +SWIGRUNTIME void * +SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { + void *result; + if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { + PyErr_Clear(); +#if SWIG_POINTER_EXCEPTION + if (flags) { + SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); + SWIG_Python_ArgFail(argnum); + } +#endif + } + return result; +} + + +#ifdef __cplusplus +#if 0 +{ /* cc-mode */ +#endif +} +#endif + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_char swig_types[0] +#define SWIGTYPE_p_ctb__IOBase swig_types[1] +#define SWIGTYPE_p_ctb__SerialPort swig_types[2] +#define SWIGTYPE_p_ctb__SerialPort_DCS swig_types[3] +#define SWIGTYPE_p_ctb__SerialPort_EINFO swig_types[4] +#define SWIGTYPE_p_ctb__SerialPort_x swig_types[5] +#define SWIGTYPE_p_ctb__Timer swig_types[6] +#define SWIGTYPE_p_ctb__timer_control swig_types[7] +#define SWIGTYPE_p_f_p_void__p_void swig_types[8] +#define SWIGTYPE_p_int swig_types[9] +#define SWIGTYPE_p_p_char swig_types[10] +static swig_type_info *swig_types[12]; +static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#if (PY_VERSION_HEX <= 0x02000000) +# if !defined(SWIG_PYTHON_CLASSIC) +# error "This python version requires swig to be run with the '-classic' option" +# endif +#endif +#if (PY_VERSION_HEX <= 0x02020000) +# error "This python version requires swig to be run with the '-nomodern' option" +#endif +#if (PY_VERSION_HEX <= 0x02020000) +# error "This python version requires swig to be run with the '-nomodernargs' option" +#endif + +/*----------------------------------------------- + @(target):= _wxctb.so + ------------------------------------------------*/ +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__wxctb + +#else +# define SWIG_init init_wxctb + +#endif +#define SWIG_name "_wxctb" + +#define SWIGVERSION 0x010340 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) + + +#include + + +namespace swig { + class SwigPtr_PyObject { + protected: + PyObject *_obj; + + public: + SwigPtr_PyObject() :_obj(0) + { + } + + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) + { + Py_XINCREF(_obj); + } + + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) + { + if (initial_ref) { + Py_XINCREF(_obj); + } + } + + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) + { + Py_XINCREF(item._obj); + Py_XDECREF(_obj); + _obj = item._obj; + return *this; + } + + ~SwigPtr_PyObject() + { + Py_XDECREF(_obj); + } + + operator PyObject *() const + { + return _obj; + } + + PyObject *operator->() const + { + return _obj; + } + }; +} + + +namespace swig { + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } + + SwigVar_PyObject & operator = (PyObject* obj) + { + Py_XDECREF(_obj); + _obj = obj; + return *this; + } + }; +} + + +#include "ctb-0.16/linux/timer.h" + + + static int *new_intp() { + return (new int); + } + + static int *copy_intp(int value) { + return (new int(static_cast< const int& >(value))); + } + + static void delete_intp(int *self) { + if (self) delete self; + } + + static void intp_assign(int *self, int value) { + *self = value; + } + + static int intp_value(int *self) { + return *self; + } + + +#include +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +SWIGINTERN int +SWIG_AsVal_double (PyObject *obj, double *val) +{ + int res = SWIG_TypeError; + if (PyFloat_Check(obj)) { + if (val) *val = PyFloat_AsDouble(obj); + return SWIG_OK; + } else if (PyInt_Check(obj)) { + if (val) *val = PyInt_AsLong(obj); + return SWIG_OK; + } else if (PyLong_Check(obj)) { + double v = PyLong_AsDouble(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + double d = PyFloat_AsDouble(obj); + if (!PyErr_Occurred()) { + if (val) *val = d; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + long v = PyLong_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); + } else { + PyErr_Clear(); + } + } + } +#endif + return res; +} + + +#include + + +#include + + +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN int +SWIG_AsVal_long (PyObject *obj, long* val) +{ + if (PyInt_Check(obj)) { + if (val) *val = PyInt_AsLong(obj); + return SWIG_OK; + } else if (PyLong_Check(obj)) { + long v = PyLong_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + long v = PyInt_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + if (val) *val = (long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_int (PyObject * obj, int *val) +{ + long v; + int res = SWIG_AsVal_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = static_cast< int >(v); + } + } + return res; +} + + + #define SWIG_From_long PyInt_FromLong + + +SWIGINTERNINLINE PyObject * +SWIG_From_int (int value) +{ + return SWIG_From_long (value); +} + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) +{ + if (PyInt_Check(obj)) { + long v = PyInt_AsLong(obj); + if (v >= 0) { + if (val) *val = v; + return SWIG_OK; + } else { + return SWIG_OverflowError; + } + } else if (PyLong_Check(obj)) { + unsigned long v = PyLong_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + unsigned long v = PyLong_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { + if (val) *val = (unsigned long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v > UINT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = static_cast< unsigned int >(v); + } + } + return res; +} + + +SWIGINTERNINLINE PyObject* +SWIG_From_unsigned_SS_long (unsigned long value) +{ + return (value > LONG_MAX) ? + PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_unsigned_SS_int (unsigned int value) +{ + return SWIG_From_unsigned_SS_long (value); +} + + +#include "ctb-0.16/linux/serport.h" + + +#include "ctb-0.16/serportx.h" + + +#include "ctb-0.16/iobase.h" + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? + SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); + } else { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromStringAndSize(carray, static_cast< int >(size)); +#else + return PyString_FromStringAndSize(carray, static_cast< int >(size)); +#endif + } + } else { + return SWIG_Py_Void(); + } +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) +{ +#if PY_VERSION_HEX>=0x03000000 + if (PyUnicode_Check(obj)) +#else + if (PyString_Check(obj)) +#endif + { + char *cstr; Py_ssize_t len; +#if PY_VERSION_HEX>=0x03000000 + if (!alloc && cptr) { + /* We can't allow converting without allocation, since the internal + representation of string in Python 3 is UCS-2/UCS-4 but we require + a UTF-8 representation. + TODO(bhy) More detailed explanation */ + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + PyBytes_AsStringAndSize(obj, &cstr, &len); + if(alloc) *alloc = SWIG_NEWOBJ; +#else + PyString_AsStringAndSize(obj, &cstr, &len); +#endif + if (cptr) { + if (alloc) { + /* + In python the user should not be able to modify the inner + string representation. To warranty that, if you define + SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string + buffer is always returned. + + The default behavior is just to return the pointer value, + so, be careful. + */ +#if defined(SWIG_PYTHON_SAFE_CSTRINGS) + if (*alloc != SWIG_OLDOBJ) +#else + if (*alloc == SWIG_NEWOBJ) +#endif + { + *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); + *alloc = SWIG_NEWOBJ; + } + else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } else { + #if PY_VERSION_HEX>=0x03000000 + assert(0); /* Should never reach here in Python 3 */ + #endif + *cptr = SWIG_Python_str_AsChar(obj); + } + } + if (psize) *psize = len + 1; +#if PY_VERSION_HEX>=0x03000000 + Py_XDECREF(obj); +#endif + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = (char *) vptr; + if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + + +SWIGINTERN int +SWIG_AsCharArray(PyObject * obj, char *val, size_t size) +{ + char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; + int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); + if (SWIG_IsOK(res)) { + if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize; + if (csize <= size) { + if (val) { + if (csize) memcpy(val, cptr, csize*sizeof(char)); + if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); + } + if (alloc == SWIG_NEWOBJ) { + delete[] cptr; + res = SWIG_DelNewMask(res); + } + return res; + } + if (alloc == SWIG_NEWOBJ) delete[] cptr; + } + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_char (PyObject * obj, char *val) +{ + int res = SWIG_AsCharArray(obj, val, 1); + if (!SWIG_IsOK(res)) { + long v; + res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); + if (SWIG_IsOK(res)) { + if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { + if (val) *val = static_cast< char >(v); + } else { + res = SWIG_OverflowError; + } + } + } + return res; +} + + +SWIGINTERNINLINE int +SWIG_AsVal_size_t (PyObject * obj, size_t *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); + return res; +} + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v > UCHAR_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = static_cast< unsigned char >(v); + } + } + return res; +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_unsigned_SS_char (unsigned char value) +{ + return SWIG_From_unsigned_SS_long (value); +} + + +SWIGINTERN int +SWIG_AsVal_bool (PyObject *obj, bool *val) +{ + int r = PyObject_IsTrue(obj); + if (r == -1) + return SWIG_ERROR; + if (val) *val = r ? true : false; + return SWIG_OK; +} + + +SWIGINTERNINLINE PyObject* + SWIG_From_bool (bool value) +{ + return PyBool_FromLong(value ? 1 : 0); +} + + +#include "ctb-0.16/kbhit.h" + + +SWIGINTERNINLINE PyObject * +SWIG_From_char (char c) +{ + return SWIG_FromCharPtrAndSize(&c,1); +} + +#ifdef __cplusplus +extern "C" { +#endif +SWIGINTERN PyObject *_wrap_new_intp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"new_intp",0,0)) SWIG_fail; + result = (int *)new_intp(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_copy_intp(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "value", NULL + }; + int *result = 0 ; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:copy_intp",kwnames,&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "copy_intp" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + result = (int *)copy_intp(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_intp(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + int *arg1 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "self", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_intp",kwnames,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_intp" "', argument " "1"" of type '" "int *""'"); + } + arg1 = reinterpret_cast< int * >(argp1); + delete_intp(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_intp_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + int *arg1 = (int *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "value", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:intp_assign",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intp_assign" "', argument " "1"" of type '" "int *""'"); + } + arg1 = reinterpret_cast< int * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intp_assign" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + intp_assign(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_intp_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + int *arg1 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "self", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:intp_value",kwnames,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intp_value" "', argument " "1"" of type '" "int *""'"); + } + arg1 = reinterpret_cast< int * >(argp1); + result = (int)intp_value(arg1); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_timer_control_usecs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; + unsigned int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"timer_control_usecs_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_usecs_set" "', argument " "1"" of type '" "ctb::timer_control *""'"); + } + arg1 = reinterpret_cast< ctb::timer_control * >(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "timer_control_usecs_set" "', argument " "2"" of type '" "unsigned int""'"); + } + arg2 = static_cast< unsigned int >(val2); + if (arg1) (arg1)->usecs = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_timer_control_usecs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + unsigned int result; + + if(!PyArg_UnpackTuple(args,(char *)"timer_control_usecs_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_usecs_get" "', argument " "1"" of type '" "ctb::timer_control *""'"); + } + arg1 = reinterpret_cast< ctb::timer_control * >(argp1); + result = (unsigned int) ((arg1)->usecs); + resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_timer_control_exitflag_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; + int *arg2 = (int *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitflag_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitflag_set" "', argument " "1"" of type '" "ctb::timer_control *""'"); + } + arg1 = reinterpret_cast< ctb::timer_control * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "timer_control_exitflag_set" "', argument " "2"" of type '" "int *""'"); + } + arg2 = reinterpret_cast< int * >(argp2); + if (arg1) (arg1)->exitflag = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_timer_control_exitflag_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitflag_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitflag_get" "', argument " "1"" of type '" "ctb::timer_control *""'"); + } + arg1 = reinterpret_cast< ctb::timer_control * >(argp1); + result = (int *) ((arg1)->exitflag); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_timer_control_exitfnc_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; + void *(*arg2)(void *) = (void *(*)(void *)) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitfnc_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitfnc_set" "', argument " "1"" of type '" "ctb::timer_control *""'"); + } + arg1 = reinterpret_cast< ctb::timer_control * >(argp1); + { + int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__p_void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "timer_control_exitfnc_set" "', argument " "2"" of type '" "void *(*)(void *)""'"); + } + } + if (arg1) (arg1)->exitfnc = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_timer_control_exitfnc_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + void *(*result)(void *) = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitfnc_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitfnc_get" "', argument " "1"" of type '" "ctb::timer_control *""'"); + } + arg1 = reinterpret_cast< ctb::timer_control * >(argp1); + result = (void *(*)(void *)) ((arg1)->exitfnc); + resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void__p_void); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *timer_control_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ctb__timer_control, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_new_Timer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + unsigned int arg1 ; + int *arg2 = (int *) 0 ; + void *(*arg3)(void *) = (void *(*)(void *)) NULL ; + unsigned int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "msec",(char *) "exitflag",(char *) "exitfnc", NULL + }; + ctb::Timer *result = 0 ; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:new_Timer",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Timer" "', argument " "1"" of type '" "unsigned int""'"); + } + arg1 = static_cast< unsigned int >(val1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Timer" "', argument " "2"" of type '" "int *""'"); + } + arg2 = reinterpret_cast< int * >(argp2); + if (obj2) { + { + int res = SWIG_ConvertFunctionPtr(obj2, (void**)(&arg3), SWIGTYPE_p_f_p_void__p_void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "new_Timer" "', argument " "3"" of type '" "void *(*)(void *)""'"); + } + } + } + result = (ctb::Timer *)new ctb::Timer(arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__Timer, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Timer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::Timer *arg1 = (ctb::Timer *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"delete_Timer",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__Timer, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Timer" "', argument " "1"" of type '" "ctb::Timer *""'"); + } + arg1 = reinterpret_cast< ctb::Timer * >(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Timer_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::Timer *arg1 = (ctb::Timer *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"Timer_start",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__Timer, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Timer_start" "', argument " "1"" of type '" "ctb::Timer *""'"); + } + arg1 = reinterpret_cast< ctb::Timer * >(argp1); + result = (int)(arg1)->start(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Timer_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::Timer *arg1 = (ctb::Timer *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"Timer_stop",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__Timer, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Timer_stop" "', argument " "1"" of type '" "ctb::Timer *""'"); + } + arg1 = reinterpret_cast< ctb::Timer * >(argp1); + result = (int)(arg1)->stop(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Timer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ctb__Timer, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_sleepms(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + unsigned int arg1 ; + unsigned int val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "ms", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:sleepms",kwnames,&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sleepms" "', argument " "1"" of type '" "unsigned int""'"); + } + arg1 = static_cast< unsigned int >(val1); + ctb::sleepms(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_IOBase(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"delete_IOBase",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IOBase" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_ClassName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"IOBase_ClassName",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_ClassName" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + result = (char *)(arg1)->ClassName(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_Close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"IOBase_Close",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Close" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + result = (int)(arg1)->Close(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_Ioctl(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + int arg2 ; + void *arg3 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "cmd",(char *) "args", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:IOBase_Ioctl",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Ioctl" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IOBase_Ioctl" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IOBase_Ioctl" "', argument " "3"" of type '" "void *""'"); + } + result = (int)(arg1)->Ioctl(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_IsOpen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"IOBase_IsOpen",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_IsOpen" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + result = (int)(arg1)->IsOpen(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_Open(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + char *arg2 = (char *) 0 ; + void *arg3 = (void *) 0L ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "devname",(char *) "dcs", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:IOBase_Open",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Open" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Open" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + if (obj2) { + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IOBase_Open" "', argument " "3"" of type '" "void *""'"); + } + } + result = (int)(arg1)->Open((char const *)arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_PutBack(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + char arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "ch", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:IOBase_PutBack",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_PutBack" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + ecode2 = SWIG_AsVal_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IOBase_PutBack" "', argument " "2"" of type '" "char""'"); + } + arg2 = static_cast< char >(val2); + result = (int)(arg1)->PutBack(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_Read(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "buf",(char *) "len", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:IOBase_Read",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Read" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Read" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Read" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + result = (int)(arg1)->Read(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_ReadUntilEOS(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + char **arg2 = 0 ; + size_t *arg3 = (size_t *) 0 ; + char *arg4 = (char *) "\n" ; + long arg5 = (long) 1000L ; + char arg6 = (char) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + char *tmp2 ; + size_t tmp3 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + long val5 ; + int ecode5 = 0 ; + char val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "readbuf",(char *) "readedBytes",(char *) "eosString",(char *) "timeout_in_ms",(char *) "quota", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OOO:IOBase_ReadUntilEOS",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_ReadUntilEOS" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + { + /* dont check for list */ + arg2 = &tmp2; + } + { + /* dont check for list */ + arg3 = &tmp3; + } + if (obj3) { + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IOBase_ReadUntilEOS" "', argument " "4"" of type '" "char *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + } + if (obj4) { + ecode5 = SWIG_AsVal_long(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "IOBase_ReadUntilEOS" "', argument " "5"" of type '" "long""'"); + } + arg5 = static_cast< long >(val5); + } + if (obj5) { + ecode6 = SWIG_AsVal_char(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "IOBase_ReadUntilEOS" "', argument " "6"" of type '" "char""'"); + } + arg6 = static_cast< char >(val6); + } + result = (int)(arg1)->ReadUntilEOS(*arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_From_int(static_cast< int >(result)); + { + PyObject * plist = PyList_New(2); + PyList_SetItem(plist, 0, PyString_FromString(*arg2)); + PyList_SetItem(plist, 1, resultobj); + resultobj = plist; + delete *arg2; + } + { + PyList_Append(resultobj, PyInt_FromLong(*arg3)); + } + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return resultobj; +fail: + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_Readv(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + unsigned int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + unsigned int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "buf",(char *) "len",(char *) "timeout_in_ms", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO:IOBase_Readv",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Readv" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Readv" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Readv" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOBase_Readv" "', argument " "4"" of type '" "unsigned int""'"); + } + arg4 = static_cast< unsigned int >(val4); + result = (int)(arg1)->Readv(arg2,arg3,arg4); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_Write(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "buf",(char *) "len", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:IOBase_Write",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Write" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Write" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Write" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + result = (int)(arg1)->Write(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IOBase_Writev(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + unsigned int arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + unsigned int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "buf",(char *) "len",(char *) "timeout_in_ms", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO:IOBase_Writev",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Writev" "', argument " "1"" of type '" "ctb::IOBase *""'"); + } + arg1 = reinterpret_cast< ctb::IOBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Writev" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Writev" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOBase_Writev" "', argument " "4"" of type '" "unsigned int""'"); + } + arg4 = static_cast< unsigned int >(val4); + result = (int)(arg1)->Writev(arg2,arg3,arg4); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *IOBase_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ctb__IOBase, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_baud_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_baud_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_baud_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_baud_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + if (arg1) (arg1)->baud = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_baud_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_baud_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_baud_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (int) ((arg1)->baud); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_parity_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + ctb::Parity arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_parity_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_parity_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_parity_set" "', argument " "2"" of type '" "ctb::Parity""'"); + } + arg2 = static_cast< ctb::Parity >(val2); + if (arg1) (arg1)->parity = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_parity_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + ctb::Parity result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_parity_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_parity_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (ctb::Parity) ((arg1)->parity); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_wordlen_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + unsigned char arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_wordlen_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_wordlen_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_wordlen_set" "', argument " "2"" of type '" "unsigned char""'"); + } + arg2 = static_cast< unsigned char >(val2); + if (arg1) (arg1)->wordlen = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_wordlen_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + unsigned char result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_wordlen_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_wordlen_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (unsigned char) ((arg1)->wordlen); + resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_stopbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + unsigned char arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned char val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_stopbits_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_stopbits_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_stopbits_set" "', argument " "2"" of type '" "unsigned char""'"); + } + arg2 = static_cast< unsigned char >(val2); + if (arg1) (arg1)->stopbits = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_stopbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + unsigned char result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_stopbits_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_stopbits_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (unsigned char) ((arg1)->stopbits); + resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_rtscts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_rtscts_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_rtscts_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + ecode2 = SWIG_AsVal_bool(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_rtscts_set" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + if (arg1) (arg1)->rtscts = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_rtscts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + bool result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_rtscts_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_rtscts_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (bool) ((arg1)->rtscts); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_xonxoff_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_xonxoff_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_xonxoff_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + ecode2 = SWIG_AsVal_bool(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_xonxoff_set" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + if (arg1) (arg1)->xonxoff = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_xonxoff_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + bool result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_xonxoff_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_xonxoff_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (bool) ((arg1)->xonxoff); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + char *arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + char temp2[16] ; + int res2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_buf_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_buf_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + res2 = SWIG_AsCharArray(obj1, temp2, 16); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerialPort_DCS_buf_set" "', argument " "2"" of type '" "char [16]""'"); + } + arg2 = reinterpret_cast< char * >(temp2); + if (arg2) memcpy(arg1->buf,arg2,16*sizeof(char)); + else memset(arg1->buf,0,16*sizeof(char)); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_buf_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_buf_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (char *)(char *) ((arg1)->buf); + { + size_t size = 16; + + while (size && (result[size - 1] == '\0')) --size; + + resultobj = SWIG_FromCharPtrAndSize(result, size); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_SerialPort_DCS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"new_SerialPort_DCS",0,0)) SWIG_fail; + result = (ctb::SerialPort_DCS *)new ctb::SerialPort_DCS(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__SerialPort_DCS, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_SerialPort_DCS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort_DCS",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort_DCS" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_DCS_GetSettings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_GetSettings",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_GetSettings" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); + result = (char *)(arg1)->GetSettings(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *SerialPort_DCS_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort_DCS, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_brk_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_brk_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_brk_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_brk_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + if (arg1) (arg1)->brk = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_brk_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_brk_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_brk_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + result = (int) ((arg1)->brk); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_frame_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_frame_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_frame_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_frame_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + if (arg1) (arg1)->frame = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_frame_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_frame_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_frame_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + result = (int) ((arg1)->frame); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_overrun_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_overrun_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_overrun_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_overrun_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + if (arg1) (arg1)->overrun = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_overrun_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_overrun_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_overrun_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + result = (int) ((arg1)->overrun); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_parity_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_parity_set",2,2,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_parity_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_parity_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + if (arg1) (arg1)->parity = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_EINFO_parity_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_parity_get",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_parity_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + result = (int) ((arg1)->parity); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_SerialPort_EINFO(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"new_SerialPort_EINFO",0,0)) SWIG_fail; + result = (ctb::SerialPort_EINFO *)new ctb::SerialPort_EINFO(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__SerialPort_EINFO, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_SerialPort_EINFO(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort_EINFO",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort_EINFO" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *SerialPort_EINFO_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort_EINFO, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_delete_SerialPort_x(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort_x",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort_x" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_ClassName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_x_ClassName",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_ClassName" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + result = (char *)(arg1)->ClassName(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_ChangeLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + ctb::SerialLineState arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flags", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_ChangeLineState",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_ChangeLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_ChangeLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); + } + arg2 = static_cast< ctb::SerialLineState >(val2); + result = (int)(arg1)->ChangeLineState(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_ClrLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + ctb::SerialLineState arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flags", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_ClrLineState",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_ClrLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_ClrLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); + } + arg2 = static_cast< ctb::SerialLineState >(val2); + result = (int)(arg1)->ClrLineState(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_GetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_x_GetLineState",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_GetLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + result = (int)(arg1)->GetLineState(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_GetSettingsAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_x_GetSettingsAsString",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_GetSettingsAsString" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + result = (char *)(arg1)->GetSettingsAsString(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_Ioctl(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + int arg2 ; + void *arg3 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "cmd",(char *) "args", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_x_Ioctl",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_Ioctl" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_Ioctl" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SerialPort_x_Ioctl" "', argument " "3"" of type '" "void *""'"); + } + result = (int)(arg1)->Ioctl(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_SendBreak(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "duration", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SendBreak",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SendBreak" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SendBreak" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (int)(arg1)->SendBreak(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_SetBaudrate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "baudrate", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SetBaudrate",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SetBaudrate" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SetBaudrate" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (int)(arg1)->SetBaudrate(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_SetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + ctb::SerialLineState arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flags", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SetLineState",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SetLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SetLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); + } + arg2 = static_cast< ctb::SerialLineState >(val2); + result = (int)(arg1)->SetLineState(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_SetParityBit(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "parity", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SetParityBit",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SetParityBit" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); + ecode2 = SWIG_AsVal_bool(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SetParityBit" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + result = (int)(arg1)->SetParityBit(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_x_IsStandardRate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + long arg1 ; + long val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "rate", NULL + }; + bool result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:SerialPort_x_IsStandardRate",kwnames,&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_long(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "SerialPort_x_IsStandardRate" "', argument " "1"" of type '" "long""'"); + } + arg1 = static_cast< long >(val1); + result = (bool)ctb::SerialPort_x::IsStandardRate(arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *SerialPort_x_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort_x, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_new_SerialPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort *result = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"new_SerialPort",0,0)) SWIG_fail; + result = (ctb::SerialPort *)new ctb::SerialPort(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__SerialPort, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_SerialPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_ChangeLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + ctb::SerialLineState arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flags", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_ChangeLineState",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_ChangeLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_ChangeLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); + } + arg2 = static_cast< ctb::SerialLineState >(val2); + result = (int)(arg1)->ChangeLineState(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_ClrLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + ctb::SerialLineState arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flags", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_ClrLineState",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_ClrLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_ClrLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); + } + arg2 = static_cast< ctb::SerialLineState >(val2); + result = (int)(arg1)->ClrLineState(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_GetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_GetLineState",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_GetLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + result = (int)(arg1)->GetLineState(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_Ioctl(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + int arg2 ; + void *arg3 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "cmd",(char *) "args", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_Ioctl",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_Ioctl" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_Ioctl" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SerialPort_Ioctl" "', argument " "3"" of type '" "void *""'"); + } + result = (int)(arg1)->Ioctl(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_IsOpen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if(!PyArg_UnpackTuple(args,(char *)"SerialPort_IsOpen",1,1,&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_IsOpen" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + result = (int)(arg1)->IsOpen(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_Read(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "buf",(char *) "len", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_Read",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_Read" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerialPort_Read" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SerialPort_Read" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + result = (int)(arg1)->Read(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_SendBreak(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "duration", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SendBreak",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SendBreak" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SendBreak" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (int)(arg1)->SendBreak(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_SetBaudrate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "baudrate", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SetBaudrate",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SetBaudrate" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SetBaudrate" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (int)(arg1)->SetBaudrate(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_SetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + ctb::SerialLineState arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flags", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SetLineState",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SetLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SetLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); + } + arg2 = static_cast< ctb::SerialLineState >(val2); + result = (int)(arg1)->SetLineState(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_SetParityBit(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "parity", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SetParityBit",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SetParityBit" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + ecode2 = SWIG_AsVal_bool(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SetParityBit" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + result = (int)(arg1)->SetParityBit(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SerialPort_Write(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; + char *arg2 = (char *) 0 ; + size_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "buf",(char *) "len", NULL + }; + int result; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_Write",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_Write" "', argument " "1"" of type '" "ctb::SerialPort *""'"); + } + arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerialPort_Write" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SerialPort_Write" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + result = (int)(arg1)->Write(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *SerialPort_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_GetKey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char result; + + if(!PyArg_UnpackTuple(args,(char *)"GetKey",0,0)) SWIG_fail; + result = (char)ctb::GetKey(); + resultobj = SWIG_From_char(static_cast< char >(result)); + return resultobj; +fail: + return NULL; +} + + +static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, + { (char *)"new_intp", _wrap_new_intp, METH_VARARGS, NULL}, + { (char *)"copy_intp", (PyCFunction) _wrap_copy_intp, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"delete_intp", (PyCFunction) _wrap_delete_intp, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"intp_assign", (PyCFunction) _wrap_intp_assign, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"intp_value", (PyCFunction) _wrap_intp_value, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"timer_control_usecs_set", _wrap_timer_control_usecs_set, METH_VARARGS, NULL}, + { (char *)"timer_control_usecs_get", _wrap_timer_control_usecs_get, METH_VARARGS, NULL}, + { (char *)"timer_control_exitflag_set", _wrap_timer_control_exitflag_set, METH_VARARGS, NULL}, + { (char *)"timer_control_exitflag_get", _wrap_timer_control_exitflag_get, METH_VARARGS, NULL}, + { (char *)"timer_control_exitfnc_set", _wrap_timer_control_exitfnc_set, METH_VARARGS, NULL}, + { (char *)"timer_control_exitfnc_get", _wrap_timer_control_exitfnc_get, METH_VARARGS, NULL}, + { (char *)"timer_control_swigregister", timer_control_swigregister, METH_VARARGS, NULL}, + { (char *)"new_Timer", (PyCFunction) _wrap_new_Timer, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"delete_Timer", _wrap_delete_Timer, METH_VARARGS, NULL}, + { (char *)"Timer_start", _wrap_Timer_start, METH_VARARGS, NULL}, + { (char *)"Timer_stop", _wrap_Timer_stop, METH_VARARGS, NULL}, + { (char *)"Timer_swigregister", Timer_swigregister, METH_VARARGS, NULL}, + { (char *)"sleepms", (PyCFunction) _wrap_sleepms, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"delete_IOBase", _wrap_delete_IOBase, METH_VARARGS, NULL}, + { (char *)"IOBase_ClassName", _wrap_IOBase_ClassName, METH_VARARGS, NULL}, + { (char *)"IOBase_Close", _wrap_IOBase_Close, METH_VARARGS, NULL}, + { (char *)"IOBase_Ioctl", (PyCFunction) _wrap_IOBase_Ioctl, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_IsOpen", _wrap_IOBase_IsOpen, METH_VARARGS, NULL}, + { (char *)"IOBase_Open", (PyCFunction) _wrap_IOBase_Open, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_PutBack", (PyCFunction) _wrap_IOBase_PutBack, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_Read", (PyCFunction) _wrap_IOBase_Read, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_ReadUntilEOS", (PyCFunction) _wrap_IOBase_ReadUntilEOS, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_Readv", (PyCFunction) _wrap_IOBase_Readv, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_Write", (PyCFunction) _wrap_IOBase_Write, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_Writev", (PyCFunction) _wrap_IOBase_Writev, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"IOBase_swigregister", IOBase_swigregister, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_baud_set", _wrap_SerialPort_DCS_baud_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_baud_get", _wrap_SerialPort_DCS_baud_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_parity_set", _wrap_SerialPort_DCS_parity_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_parity_get", _wrap_SerialPort_DCS_parity_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_wordlen_set", _wrap_SerialPort_DCS_wordlen_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_wordlen_get", _wrap_SerialPort_DCS_wordlen_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_stopbits_set", _wrap_SerialPort_DCS_stopbits_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_stopbits_get", _wrap_SerialPort_DCS_stopbits_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_rtscts_set", _wrap_SerialPort_DCS_rtscts_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_rtscts_get", _wrap_SerialPort_DCS_rtscts_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_xonxoff_set", _wrap_SerialPort_DCS_xonxoff_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_xonxoff_get", _wrap_SerialPort_DCS_xonxoff_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_buf_set", _wrap_SerialPort_DCS_buf_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_buf_get", _wrap_SerialPort_DCS_buf_get, METH_VARARGS, NULL}, + { (char *)"new_SerialPort_DCS", _wrap_new_SerialPort_DCS, METH_VARARGS, NULL}, + { (char *)"delete_SerialPort_DCS", _wrap_delete_SerialPort_DCS, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_GetSettings", _wrap_SerialPort_DCS_GetSettings, METH_VARARGS, NULL}, + { (char *)"SerialPort_DCS_swigregister", SerialPort_DCS_swigregister, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_brk_set", _wrap_SerialPort_EINFO_brk_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_brk_get", _wrap_SerialPort_EINFO_brk_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_frame_set", _wrap_SerialPort_EINFO_frame_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_frame_get", _wrap_SerialPort_EINFO_frame_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_overrun_set", _wrap_SerialPort_EINFO_overrun_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_overrun_get", _wrap_SerialPort_EINFO_overrun_get, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_parity_set", _wrap_SerialPort_EINFO_parity_set, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_parity_get", _wrap_SerialPort_EINFO_parity_get, METH_VARARGS, NULL}, + { (char *)"new_SerialPort_EINFO", _wrap_new_SerialPort_EINFO, METH_VARARGS, NULL}, + { (char *)"delete_SerialPort_EINFO", _wrap_delete_SerialPort_EINFO, METH_VARARGS, NULL}, + { (char *)"SerialPort_EINFO_swigregister", SerialPort_EINFO_swigregister, METH_VARARGS, NULL}, + { (char *)"delete_SerialPort_x", _wrap_delete_SerialPort_x, METH_VARARGS, NULL}, + { (char *)"SerialPort_x_ClassName", _wrap_SerialPort_x_ClassName, METH_VARARGS, NULL}, + { (char *)"SerialPort_x_ChangeLineState", (PyCFunction) _wrap_SerialPort_x_ChangeLineState, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_ClrLineState", (PyCFunction) _wrap_SerialPort_x_ClrLineState, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_GetLineState", _wrap_SerialPort_x_GetLineState, METH_VARARGS, NULL}, + { (char *)"SerialPort_x_GetSettingsAsString", _wrap_SerialPort_x_GetSettingsAsString, METH_VARARGS, NULL}, + { (char *)"SerialPort_x_Ioctl", (PyCFunction) _wrap_SerialPort_x_Ioctl, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_SendBreak", (PyCFunction) _wrap_SerialPort_x_SendBreak, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_SetBaudrate", (PyCFunction) _wrap_SerialPort_x_SetBaudrate, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_SetLineState", (PyCFunction) _wrap_SerialPort_x_SetLineState, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_SetParityBit", (PyCFunction) _wrap_SerialPort_x_SetParityBit, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_IsStandardRate", (PyCFunction) _wrap_SerialPort_x_IsStandardRate, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_x_swigregister", SerialPort_x_swigregister, METH_VARARGS, NULL}, + { (char *)"new_SerialPort", _wrap_new_SerialPort, METH_VARARGS, NULL}, + { (char *)"delete_SerialPort", _wrap_delete_SerialPort, METH_VARARGS, NULL}, + { (char *)"SerialPort_ChangeLineState", (PyCFunction) _wrap_SerialPort_ChangeLineState, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_ClrLineState", (PyCFunction) _wrap_SerialPort_ClrLineState, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_GetLineState", _wrap_SerialPort_GetLineState, METH_VARARGS, NULL}, + { (char *)"SerialPort_Ioctl", (PyCFunction) _wrap_SerialPort_Ioctl, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_IsOpen", _wrap_SerialPort_IsOpen, METH_VARARGS, NULL}, + { (char *)"SerialPort_Read", (PyCFunction) _wrap_SerialPort_Read, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_SendBreak", (PyCFunction) _wrap_SerialPort_SendBreak, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_SetBaudrate", (PyCFunction) _wrap_SerialPort_SetBaudrate, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_SetLineState", (PyCFunction) _wrap_SerialPort_SetLineState, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_SetParityBit", (PyCFunction) _wrap_SerialPort_SetParityBit, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_Write", (PyCFunction) _wrap_SerialPort_Write, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"SerialPort_swigregister", SerialPort_swigregister, METH_VARARGS, NULL}, + { (char *)"GetKey", _wrap_GetKey, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_ctb__SerialPort_xTo_p_ctb__IOBase(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((ctb::IOBase *) ((ctb::SerialPort_x *) x)); +} +static void *_p_ctb__SerialPortTo_p_ctb__IOBase(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((ctb::IOBase *) (ctb::SerialPort_x *) ((ctb::SerialPort *) x)); +} +static void *_p_ctb__SerialPortTo_p_ctb__SerialPort_x(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((ctb::SerialPort_x *) ((ctb::SerialPort *) x)); +} +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ctb__IOBase = {"_p_ctb__IOBase", "ctb::IOBase *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ctb__SerialPort = {"_p_ctb__SerialPort", "ctb::SerialPort *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ctb__SerialPort_DCS = {"_p_ctb__SerialPort_DCS", "ctb::SerialPort_DCS *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ctb__SerialPort_EINFO = {"_p_ctb__SerialPort_EINFO", "ctb::SerialPort_EINFO *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ctb__SerialPort_x = {"_p_ctb__SerialPort_x", "ctb::SerialPort_x *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ctb__Timer = {"_p_ctb__Timer", "ctb::Timer *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ctb__timer_control = {"_p_ctb__timer_control", "ctb::timer_control *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_void__p_void = {"_p_f_p_void__p_void", "void *(*)(void *)", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *|size_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_char, + &_swigt__p_ctb__IOBase, + &_swigt__p_ctb__SerialPort, + &_swigt__p_ctb__SerialPort_DCS, + &_swigt__p_ctb__SerialPort_EINFO, + &_swigt__p_ctb__SerialPort_x, + &_swigt__p_ctb__Timer, + &_swigt__p_ctb__timer_control, + &_swigt__p_f_p_void__p_void, + &_swigt__p_int, + &_swigt__p_p_char, +}; + +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ctb__IOBase[] = { {&_swigt__p_ctb__IOBase, 0, 0, 0}, {&_swigt__p_ctb__SerialPort_x, _p_ctb__SerialPort_xTo_p_ctb__IOBase, 0, 0}, {&_swigt__p_ctb__SerialPort, _p_ctb__SerialPortTo_p_ctb__IOBase, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ctb__SerialPort[] = { {&_swigt__p_ctb__SerialPort, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ctb__SerialPort_DCS[] = { {&_swigt__p_ctb__SerialPort_DCS, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ctb__SerialPort_EINFO[] = { {&_swigt__p_ctb__SerialPort_EINFO, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ctb__SerialPort_x[] = { {&_swigt__p_ctb__SerialPort_x, 0, 0, 0}, {&_swigt__p_ctb__SerialPort, _p_ctb__SerialPortTo_p_ctb__SerialPort_x, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ctb__Timer[] = { {&_swigt__p_ctb__Timer, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ctb__timer_control[] = { {&_swigt__p_ctb__timer_control, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_f_p_void__p_void[] = { {&_swigt__p_f_p_void__p_void, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_char, + _swigc__p_ctb__IOBase, + _swigc__p_ctb__SerialPort, + _swigc__p_ctb__SerialPort_DCS, + _swigc__p_ctb__SerialPort_EINFO, + _swigc__p_ctb__SerialPort_x, + _swigc__p_ctb__Timer, + _swigc__p_ctb__timer_control, + _swigc__p_f_p_void__p_void, + _swigc__p_int, + _swigc__p_p_char, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { +{0, 0, 0, 0.0, 0, 0}}; + +#ifdef __cplusplus +} +#endif +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found, init; + + clientdata = clientdata; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + + /* Python-specific SWIG API */ +#define SWIG_newvarlink() SWIG_Python_newvarlink() +#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) +#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) + + /* ----------------------------------------------------------------------------- + * global variable support code. + * ----------------------------------------------------------------------------- */ + + typedef struct swig_globalvar { + char *name; /* Name of global variable */ + PyObject *(*get_attr)(void); /* Return the current value */ + int (*set_attr)(PyObject *); /* Set the value */ + struct swig_globalvar *next; + } swig_globalvar; + + typedef struct swig_varlinkobject { + PyObject_HEAD + swig_globalvar *vars; + } swig_varlinkobject; + + SWIGINTERN PyObject * + swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else + return PyString_FromString(""); +#endif + } + + SWIGINTERN PyObject * + swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else + PyObject *str = PyString_FromString("("); + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + PyString_ConcatAndDel(&str,PyString_FromString(var->name)); + if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); + } + PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif + return str; + } + + SWIGINTERN int + swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; + PyObject *str = swig_varlink_str(v); + fprintf(fp,"Swig global variables "); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(str); + return 0; + } + + SWIGINTERN void + swig_varlink_dealloc(swig_varlinkobject *v) { + swig_globalvar *var = v->vars; + while (var) { + swig_globalvar *n = var->next; + free(var->name); + free(var); + var = n; + } + } + + SWIGINTERN PyObject * + swig_varlink_getattr(swig_varlinkobject *v, char *n) { + PyObject *res = NULL; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->get_attr)(); + break; + } + var = var->next; + } + if (res == NULL && !PyErr_Occurred()) { + PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + } + return res; + } + + SWIGINTERN int + swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { + int res = 1; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->set_attr)(p); + break; + } + var = var->next; + } + if (res == 1 && !PyErr_Occurred()) { + PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + } + return res; + } + + SWIGINTERN PyTypeObject* + swig_varlink_type(void) { + static char varlink__doc__[] = "Swig var link object"; + static PyTypeObject varlink_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp + = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* Number of items in variable part (ob_size) */ +#endif + (char *)"swigvarlink", /* Type name (tp_name) */ + sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ + 0, /* Itemsize (tp_itemsize) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (printfunc) swig_varlink_print, /* Print (tp_print) */ + (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ + (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ + 0, /* tp_compare */ + (reprfunc) swig_varlink_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) swig_varlink_str, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + varlink__doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + 0,0,0,0 /* tp_alloc -> tp_next */ +#endif + }; + varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + varlink_type.ob_type = &PyType_Type; +#endif + type_init = 1; + } + return &varlink_type; + } + + /* Create a variable linking object for use later */ + SWIGINTERN PyObject * + SWIG_Python_newvarlink(void) { + swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); + if (result) { + result->vars = 0; + } + return ((PyObject*) result); + } + + SWIGINTERN void + SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + swig_varlinkobject *v = (swig_varlinkobject *) p; + swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); + if (gv) { + size_t size = strlen(name)+1; + gv->name = (char *)malloc(size); + if (gv->name) { + strncpy(gv->name,name,size); + gv->get_attr = get_attr; + gv->set_attr = set_attr; + gv->next = v->vars; + } + } + v->vars = gv; + } + + SWIGINTERN PyObject * + SWIG_globals(void) { + static PyObject *_SWIG_globals = 0; + if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); + return _SWIG_globals; + } + + /* ----------------------------------------------------------------------------- + * constants/methods manipulation + * ----------------------------------------------------------------------------- */ + + /* Install Constants */ + SWIGINTERN void + SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { + PyObject *obj = 0; + size_t i; + for (i = 0; constants[i].type; ++i) { + switch(constants[i].type) { + case SWIG_PY_POINTER: + obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); + break; + case SWIG_PY_BINARY: + obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); + break; + default: + obj = 0; + break; + } + if (obj) { + PyDict_SetItemString(d, constants[i].name, obj); + Py_DECREF(obj); + } + } + } + + /* -----------------------------------------------------------------------------*/ + /* Fix SwigMethods to carry the callback ptrs when needed */ + /* -----------------------------------------------------------------------------*/ + + SWIGINTERN void + SWIG_Python_FixMethods(PyMethodDef *methods, + swig_const_info *const_table, + swig_type_info **types, + swig_type_info **types_initial) { + size_t i; + for (i = 0; methods[i].ml_name; ++i) { + const char *c = methods[i].ml_doc; + if (c && (c = strstr(c, "swig_ptr: "))) { + int j; + swig_const_info *ci = 0; + const char *name = c + 10; + for (j = 0; const_table[j].type; ++j) { + if (strncmp(const_table[j].name, name, + strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]); + break; + } + } + if (ci) { + size_t shift = (ci->ptype) - types; + swig_type_info *ty = types_initial[shift]; + size_t ldoc = (c - methods[i].ml_doc); + size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; + char *ndoc = (char*)malloc(ldoc + lptr + 10); + if (ndoc) { + char *buff = ndoc; + void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; + if (ptr) { + strncpy(buff, methods[i].ml_doc, ldoc); + buff += ldoc; + strncpy(buff, "swig_ptr: ", 10); + buff += 10; + SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); + methods[i].ml_doc = ndoc; + } + } + } + } + } + } + +#ifdef __cplusplus +} +#endif + +/* -----------------------------------------------------------------------------* + * Partial Init method + * -----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" +#endif + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif + + /* Fix SwigMethods to carry the callback ptrs when needed */ + SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else + m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif + d = PyModule_GetDict(m); + + SWIG_InitializeModule(0); + SWIG_InstallConstants(d,swig_const_table); + + + SWIG_Python_SetConstant(d, "CTB_RESET",SWIG_From_int(static_cast< int >(ctb::CTB_RESET))); + SWIG_Python_SetConstant(d, "ParityNone",SWIG_From_int(static_cast< int >(ctb::ParityNone))); + SWIG_Python_SetConstant(d, "ParityOdd",SWIG_From_int(static_cast< int >(ctb::ParityOdd))); + SWIG_Python_SetConstant(d, "ParityEven",SWIG_From_int(static_cast< int >(ctb::ParityEven))); + SWIG_Python_SetConstant(d, "ParityMark",SWIG_From_int(static_cast< int >(ctb::ParityMark))); + SWIG_Python_SetConstant(d, "ParitySpace",SWIG_From_int(static_cast< int >(ctb::ParitySpace))); + SWIG_Python_SetConstant(d, "LinestateDcd",SWIG_From_int(static_cast< int >(ctb::LinestateDcd))); + SWIG_Python_SetConstant(d, "LinestateCts",SWIG_From_int(static_cast< int >(ctb::LinestateCts))); + SWIG_Python_SetConstant(d, "LinestateDsr",SWIG_From_int(static_cast< int >(ctb::LinestateDsr))); + SWIG_Python_SetConstant(d, "LinestateDtr",SWIG_From_int(static_cast< int >(ctb::LinestateDtr))); + SWIG_Python_SetConstant(d, "LinestateRing",SWIG_From_int(static_cast< int >(ctb::LinestateRing))); + SWIG_Python_SetConstant(d, "LinestateRts",SWIG_From_int(static_cast< int >(ctb::LinestateRts))); + SWIG_Python_SetConstant(d, "LinestateNull",SWIG_From_int(static_cast< int >(ctb::LinestateNull))); + SWIG_Python_SetConstant(d, "CTB_SER_GETEINFO",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETEINFO))); + SWIG_Python_SetConstant(d, "CTB_SER_GETBRK",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETBRK))); + SWIG_Python_SetConstant(d, "CTB_SER_GETFRM",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETFRM))); + SWIG_Python_SetConstant(d, "CTB_SER_GETOVR",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETOVR))); + SWIG_Python_SetConstant(d, "CTB_SER_GETPAR",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETPAR))); + SWIG_Python_SetConstant(d, "CTB_SER_GETINQUE",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETINQUE))); + SWIG_Python_SetConstant(d, "CTB_SER_SETPAR",SWIG_From_int(static_cast< int >(ctb::CTB_SER_SETPAR))); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif +} + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/serportx.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/serportx.i new file mode 100644 index 0000000000..083daddab4 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/serportx.i @@ -0,0 +1,84 @@ +%{ +#include "ctb-0.16/serportx.h" +%} + +%include iobase.i + +namespace ctb { + +enum Parity +{ + ParityNone, + ParityOdd, + ParityEven, + ParityMark, + ParitySpace +}; + +enum SerialLineState +{ + LinestateDcd = 0x040, + LinestateCts = 0x020, + LinestateDsr = 0x100, + LinestateDtr = 0x002, + LinestateRing = 0x080, + LinestateRts = 0x004, + LinestateNull = 0x000 +}; + +struct SerialPort_DCS +{ + int baud; + Parity parity; + unsigned char wordlen; + unsigned char stopbits; + bool rtscts; + bool xonxoff; + char buf[16]; + SerialPort_DCS(); + ~SerialPort_DCS(); + char* GetSettings(); +}; + +struct SerialPort_EINFO +{ + int brk; + int frame; + int overrun; + int parity; + SerialPort_EINFO(); + ~SerialPort_EINFO(); +}; + +enum { + CTB_SER_GETEINFO = CTB_SERIAL, + CTB_SER_GETBRK, + CTB_SER_GETFRM, + CTB_SER_GETOVR, + CTB_SER_GETPAR, + CTB_SER_GETINQUE, + CTB_SER_SETPAR, +}; + +class SerialPort_x : public IOBase +{ +protected: + SerialPort_DCS m_dcs; + char m_devname[SERIALPORT_NAME_LEN]; +public: + SerialPort_x(); + virtual ~SerialPort_x(); + const char* ClassName(); + virtual int ChangeLineState(SerialLineState flags) = 0; + virtual int ClrLineState(SerialLineState flags) = 0; + virtual int GetLineState() = 0; + virtual char* GetSettingsAsString(); + virtual int Ioctl(int cmd,void* args); + virtual int SendBreak(int duration) = 0; + virtual int SetBaudrate(int baudrate) = 0; + virtual int SetLineState(SerialLineState flags) = 0; + virtual int SetParityBit( bool parity ) = 0; + static bool IsStandardRate( long rate ); +}; + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/makepy.bat b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/makepy.bat new file mode 100644 index 0000000000..8320cb9e57 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/makepy.bat @@ -0,0 +1,65 @@ +@ECHO OFF + +REM ################################################################## +REM # set the path/settings of your compiler enviroment and remove the +REM # comment command (REM) +REM # (you don't need this, if you set it always in your system +REM # enviroment) +REM ################################################################## +REM CALL "c:\Programme\Microsoft Visual C++ Toolkit 2003\vcvars32.bat" + +REM ################################################################## +REM # set the path to your python24 (or python23) library, for example +REM # works for me with C:\Program Files\Python2.4\libs\python24.lib +REM ################################################################## +SET PYTHON_LIB="C:\Program Files\Python2.4\libs\python24.lib" + +REM ################################################################## +REM # set the include path of your python24 (python23) deleveloper +REM # header files. For me, it's on C:\Program Files +REM ################################################################## +SET PYTHON_INCLUDE="C:\Program Files\Python2.4\include" + +REM ################################################################## +REM # after installing swig, set the path, so the script can find it +REM ################################################################## +SET SWIG="C:\Program Files\swigwin-1.3.40\swig" + +REM ################################################################## +REM # DON'T CHANGE ANYMORE AT THE FOLLOWING LINES!!! +REM ################################################################## + +SET GPIB_LIB= +SET GPIB_SRC= + +ECHO // This file is created automatically, don't change it! > wxctb.i +ECHO %%module wxctb >> wxctb.i +ECHO typedef int size_t; >> wxctb.i +ECHO %%include timer.i >> wxctb.i +ECHO %%include serport.i >> wxctb.i +ECHO %%include ../kbhit.i >> wxctb.i + +IF NOT [%1]==[USE_GPIB] GOTO nogpib +SET GPIB_LIB=../../../lib/gpib32.lib +SET GPIB_SRC=../../../src/gpib.cpp +ECHO %%include ../gpib.i >> wxctb.i + +:nogpib + + +DEL *.obj wxctb_wrap.cxx *.lib *.dll *.exp + +ECHO "swig generates python wrapper files..." +%SWIG% -c++ -Wall -nodefault -python -keyword -new_repr -modern wxctb.i + +ECHO "create shared library wxctb for python 2.4..." +cl /LD /D WIN32 /I %PYTHON_INCLUDE% /I ../../../include wxctb_wrap.cxx ../../../src/win32/serport.cpp ../../../src/serportx.cpp ../../../src/win32/timer.cpp ../../../src/kbhit.cpp ../../../src/iobase.cpp %GPIB_SRC% ../../../src/fifo.cpp /link %PYTHON_LIB% winmm.lib %GPIB_LIB% + +MOVE wxctb_wrap.dll _wxctb.dll + +ECHO "copy ctb.py, wxctb.py and _wxctb.so to the module/win32 folder..." +MKDIR ..\..\module\win32 +COPY ..\ctb.py ..\..\module\win32 +COPY wxctb.py ..\..\module\win32 +COPY _wxctb.dll ..\..\module\win32 + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/serport.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/serport.i new file mode 100644 index 0000000000..84cb69887c --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/serport.i @@ -0,0 +1,57 @@ +%{ +#include "ctb-0.16/win32/serport.h" +%} + +%include ../serportx.i + +namespace ctb { + +%pythoncode { +COM1 = "com1" +COM2 = "com2" +COM3 = "com3" +COM4 = "com4" +COM5 = "com5" +COM6 = "com6" +COM7 = "com7" +COM8 = "com8" +COM9 = "com9" +COM10 = "\\\\.\\com10" +COM11 = "\\\\.\\com11" +COM12 = "\\\\.\\com12" +COM13 = "\\\\.\\com13" +COM14 = "\\\\.\\com14" +COM15 = "\\\\.\\com15" +COM16 = "\\\\.\\com16" +COM17 = "\\\\.\\com17" +COM18 = "\\\\.\\com18" +COM19 = "\\\\.\\com19" +}; + +class SerialPort : public SerialPort_x +{ +protected: + HANDLE fd; + OVERLAPPED ov; + SerialPort_EINFO einfo; + + int CloseDevice(); + int OpenDevice(const char* devname, void* dcs); +public: + SerialPort(); + ~SerialPort(); + + int ChangeLineState(SerialLineState flags); + int ClrLineState(SerialLineState flags); + int GetLineState(); + int Ioctl(int cmd,void* args); + int IsOpen(); + int Read(char* buf,size_t len); + int SendBreak(int duration); + int SetBaudrate(int baudrate); + int SetLineState(SerialLineState flags); + int SetParityBit( bool parity ); + int Write(char* buf,size_t len); +}; + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/timer.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/timer.i new file mode 100644 index 0000000000..b95f26a0d4 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/timer.i @@ -0,0 +1,39 @@ +%{ +#include "ctb-0.16/win32/timer.h" +%} + +%include cpointer.i + +// lets create new fuctions for pointer handling in python (for int *exitflag) +%pointer_functions(int, intp); + +namespace ctb { + +// perhaps we doesn''t need timer_control to export +// but we need if we want to inherit from timer in python +struct timer_control +{ + unsigned int msecs; + int *exitflag; + MMRESULT stop; + void* (*exitfnc)(void*); +}; + +class Timer +{ +protected: + + DWORD id; + MMRESULT h; + timer_control control; + unsigned int timer_secs; +public: + Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)=NULL); + ~Timer(); + int start(); + int stop(); +}; + +void sleepms(unsigned int ms); + +}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/wxctb.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/wxctb.i new file mode 100644 index 0000000000..d00350fb03 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/wxctb.i @@ -0,0 +1,6 @@ +// This file is created automatically, don't change it! +%module wxctb +typedef int size_t; +%include timer.i +%include serport.i +%include ../kbhit.i diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/samples/ctbtest.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/samples/ctbtest.cpp new file mode 100644 index 0000000000..bf84e20ed7 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/samples/ctbtest.cpp @@ -0,0 +1,181 @@ +#include "ctb-0.16/ctb.h" + +#include +#include +#include + +#include +#include + +using namespace std; + +// ----------------- options ------------------------------- +const char* options="a:b:d:e:hlp:t:"; + +const char* helpMessage = +{ + "A simple serial port class test\n" + "ctbtest [options]\n" + "available options are:\n" + "-a : address (only GPIB)\n" + "-b : baudrate [any value], default is 38400\n" + "-d : connected device, default is COM1\n" + "-e : eos\n" + "-h : print this\n" + "-l : list all available serial ports\n" + "-p : protocol like 8N1\n" + "-t : communication timeout in ms (default is 100ms)\n" +}; + +int main(int argc,char* argv[]) +{ + int address = 15; + + int baudrate = 19200; + + string devname = ctb::COM1; + + string eos = "\r\n"; + + string protocol = "8N1"; + + int timeout = 100; + + bool showAvailablePorts = false; + + int quit = 0; + + int val; + + while ( ( val=getopt( argc, argv, (char*)options ) ) != EOF ) { + switch ( val ) { + case 'a' : address = strtol( optarg, NULL, 10 ); break; + case 'b' : baudrate = strtol( optarg, NULL, 10 ); break; + case 'd' : devname = optarg; break; + case 'h' : cerr << helpMessage << endl; exit( 0 ); + case 'l' : showAvailablePorts = true; break; + case 'p' : protocol = optarg; break; + case 't' : timeout = strtol( optarg, NULL, 10 ); break; + } + } + + ctb::IOBase* device = NULL; + + std::vector ports; + + if( ctb::GetAvailablePorts( ports ) && showAvailablePorts ) { + + for( int i = 0; i < ports.size(); + std::cout << ports[ i++ ] << endl ) {}; + + return 0; + + } + + +#if ( GPIB ) + if( ( devname == ctb::GPIB1 ) || ( devname == ctb::GPIB2 ) ) { + + ctb::GpibDevice* gpibDevice = new ctb::GpibDevice(); + + if( gpibDevice->Open( devname.c_str(), address ) >= 0 ) { + + device = gpibDevice; + + } + + } + else { +#endif + + ctb::SerialPort* serialPort = new ctb::SerialPort(); + + if( serialPort->Open( devname.c_str(), baudrate, + protocol.c_str(), + ctb::SerialPort::NoFlowControl ) >= 0 ) { + + device = serialPort; + + } + +#if ( GPIB ) + } +#endif + + if( ! device ) { + + cout << "Cannot open " << devname.c_str() << endl; + + return -1; + + } + + // up to know you don't have to worry any longer about the kind of + // the connected device. As long as you do nothing something device + // specific (like toggle some modem control lines), the access is + // the same for each device. + + string line; + + char receiveBuf[ 128 ]; + + cout << "Enter your command or just press Enter without any\n" + "input for exit!"; + + while( true ) { + + cout << endl << "Your input >"; + + // read the string to send + getline( cin, line ); + + // add some defined EOS (end of string sequence or character) + if( line.empty() ) { + + break; + + } + + line += eos; + + // send data throughout the connected device independent of the typ + if( device->Writev( (char*)line.c_str(), + line.size(), + timeout ) != line.size() ) { + + cerr << "Incomplete data transmission" << endl; + + } + + int readed = 0; + + do { + + // in case of an event driven GUI you better use a non blocking + // Read(...) in your idle function. Here we have to wait for the + // response before we send another user command... + readed = device->Readv( receiveBuf, + sizeof( receiveBuf ) - 1, + timeout); + + // something received? + if( readed > 0 ) { + + receiveBuf[ readed ] = 0; + + cout << receiveBuf; + + } + + } while( readed > 0 ); + + cout << endl; + + } // while( true ) + + device->Close(); + + delete device; + + return 0; +} diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/fifo.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/fifo.cpp new file mode 100644 index 0000000000..c03e320846 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/fifo.cpp @@ -0,0 +1,130 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: fifo.cpp +// Purpose: +// Author: Joachim Buermann, Michael Hungershausen +// Id: $Id$ +// Copyright: (c) 2006,2007 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "ctb-0.16/fifo.h" + +namespace ctb { + + Fifo::Fifo(size_t size) : + m_size(size) + { + m_begin = new char[size]; + m_end = m_begin + m_size; + m_rdptr = m_wrptr = m_begin; + }; + + Fifo::~Fifo() + { + delete m_begin; + }; + + void Fifo::clear() + { + m_rdptr = m_wrptr = m_begin; + }; + + int Fifo::get(char* ch) + { + if(m_rdptr != m_wrptr) { + *ch = *m_rdptr++; + if(m_rdptr >= m_end) { + m_rdptr = m_begin; + } + return 1; + } + return 0; + }; + + size_t Fifo::items() + { + char* tmp_wrptr = m_wrptr; + // the rdptr will only changed by the reader. If we suppose, that + // the caller of the items() method is identical with the reader, + // this should be thread save. + char* tmp_rdptr = m_rdptr; + + // if the write pointer is identical with the read, there are no + // more data in the Fifo + if(tmp_wrptr == tmp_rdptr) { + return 0; + } + // the write pointer is greater as the read pointer, so we just + // can calculate the difference for the remaining data + if(tmp_wrptr > tmp_rdptr) { + return (tmp_wrptr - tmp_rdptr); + } + // the write pointer has circulate and stands against the read + // pointer + else { + return (m_size - (tmp_rdptr - tmp_wrptr)); + } + }; + + int Fifo::put(char ch) + { + // for a thread safe operation, the write of a data byte must be + // atomic. So we first assign the current position of the write + // pointer to a temporary pointer. + // Increment it for the comparison with the end of the internal + // buffer and the read pointer + char* tmp_wrptr = m_wrptr + 1; + if(tmp_wrptr >= m_end) { + tmp_wrptr = m_begin; + } + if(tmp_wrptr == m_rdptr) { + return 0; + } + // this don't changes the write pointer! + *m_wrptr = ch; + // that's the trick! The following assignment is atomic and cannot + // interrupted within a read access by the read thread + m_wrptr = tmp_wrptr; + return 1; + }; + + int Fifo::read(char* data,int n) + { + int nresult = 0; + while(n--) { + // the same as get() + if(m_rdptr != m_wrptr) { + *data = *m_rdptr++; + if(m_rdptr >= m_end) { + m_rdptr = m_begin; + } + } + else { + break; + } + nresult++; + data++; + } + return nresult; + }; + + int Fifo::write(char* data,int n) + { + int nresult = 0; + while(n--) { + // the same as put() + char* tmp_wrptr = m_wrptr + 1; + if(tmp_wrptr >= m_end) { + tmp_wrptr = m_begin; + } + if(tmp_wrptr == m_rdptr) { + break; + } + *m_wrptr = *data++; + m_wrptr = tmp_wrptr; + nresult++; + } + return nresult; + }; + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/getopt.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/getopt.cpp new file mode 100644 index 0000000000..69afb2e7b7 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/getopt.cpp @@ -0,0 +1,14 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: getopt.cpp +// Purpose: simple wrapper file +// Author: Joachim Buermann +// Id: $Id: timer.h,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#if defined (WIN32) +# include "win32/getopt.cpp" +#endif + + diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/gpib.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/gpib.cpp new file mode 100644 index 0000000000..f6ee5b3d7d --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/gpib.cpp @@ -0,0 +1,338 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: gpibx.cpp +// Purpose: +// Author: Joachim Buermann +// Id: $Id: gpibx.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001,2004 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "ctb-0.16/gpib.h" +#include "ctb-0.16/timer.h" +#include +#include +#ifdef WIN32 +# include "ctb-0.16/win32/gpib-32.h" +# define snprintf _snprintf +#elif __GNUG__ +# include +#endif + +namespace ctb { + + const char* GPIB1 = "gpib1"; + const char* GPIB2 = "gpib2"; + + struct gpibErr_t { + int m_errno; + const char* m_notation; + const char* m_description; + }; + + static gpibErr_t gpibErrors[] = { + {0,"EDVR","DOS Error"}, + {1,"ECIC","Specified GPIB Interface Board is Not Active Controller"}, + {2,"ENOL","No present listing device"}, + {3,"EADR","GPIB Board has not been addressed properly"}, + {4,"EARG","Invalid argument"}, + {5,"ESAC","Specified GPIB Interface Board is not System Controller"}, + {6,"EABO","I/O operation aborted (time-out)"}, + {7,"ENEB","Non-existent GPIB board"}, + {10,"EOIP","Routine not allowed during asynchronous I/O operation"}, + {11,"ECAP","No capability for operation"}, + {12,"EFSO","File System Error"}, + {14,"EBUS","Command byte transfer error"}, + {15,"ESTB","Serial poll status byte lost"}, + {16,"ESQR","SRQ stuck in ON position"}, + {20,"ETAB","Table problem"}, + {247,"EINT","No interrupt configured on board"}, + {248,"EWMD","Windows is not in Enhanced mode"}, + {249,"EVDD","GPIB driver is not installed"}, + {250,"EOVR","Buffer Overflow"}, + {251,"ESML","Two library calls running simultaneously"}, + {252,"ECFG","Board type does not match GPIB.CFG"}, + {253,"ETMR","No Windows timers available"}, + {254,"ESLC","No Windows selectors available"}, + {255,"EBRK","Control-Break pressed"} + }; + + char* Gpib_DCS::GetSettings() + { + const char* to[] = { + "None","10us","30us","100us","300us","1ms","3ms","10ms","30ms", + "100ms","300ms","1s","3s","10s","30s","100s","300s","1000s" + }; + memset(m_buf,0,sizeof(m_buf)); + snprintf(m_buf,sizeof(m_buf)-1,"Adr: (%i,%i) to:%s", + m_address1, + m_address2, + to[m_timeout]); + return m_buf; + }; + + int GpibDevice::CloseDevice() + { + if(m_hd != -1) { + // goto local... + ibloc(m_hd); + // ...and switch device offline + ibonl(m_hd,0); + m_hd = -1; + m_board = -1; + } + return 0; + }; + + const char* GpibDevice::GetErrorString(int error,bool detailed) + { + for(size_t i=0;i<(sizeof(gpibErrors)/sizeof(gpibErr_t));i++) { + if(gpibErrors[i].m_errno == error) { + if(detailed) { + return gpibErrors[i].m_description; + } + else { + return gpibErrors[i].m_notation; + } + } + } + return 0; + }; + +// This is only for internal usage + int GpibDevice::Ibrd(char* buf,size_t len) + { + return ibrd(m_hd,buf,len); + }; + +// This is only for internal usage + int GpibDevice::Ibwrt(char* buf,size_t len) + { + return ibwrt(m_hd,buf,len); + }; + + int GpibDevice::Ioctl(int cmd,void* args) + { + switch(cmd) { + case CTB_RESET: + if(m_hd >= 0) { + ibclr(m_hd); + return 0; + } + return -1; + case CTB_GPIB_GETRSP: { + char spr = 0; + if(m_hd >= 0) { + ibrsp(m_hd,&spr); + *(int*)args = (int)spr; + return 0; + } + return 1; } + case CTB_GPIB_GETSTA: + *(int*)args = m_state; + return 0; + case CTB_GPIB_GETERR: + *(int*)args = m_error; + return 0; + case CTB_GPIB_GETLINES: { + short state = 0; + if(m_hd >= 0) { + iblines(m_board,&state); + *(int*)args = (int)state; + return 0; + } + return -1; } + case CTB_GPIB_SETTIMEOUT: { + if(m_hd >= 0) { + GpibTimeout timeout; + unsigned long to = *(unsigned long*)args; + // convert the timeout in ms (given by args) into the + // traditional NI-488.2 timeout period + if(to > 1000000) timeout = GpibTimeout1000s; + else if(to >= 300000) timeout = GpibTimeout300s; + else if(to >= 100000) timeout = GpibTimeout100s; + else if(to >= 30000) timeout = GpibTimeout30s; + else if(to >= 10000) timeout = GpibTimeout10s; + else if(to >= 3000) timeout = GpibTimeout3s; + else if(to >= 1000) timeout = GpibTimeout1s; + else if(to >= 300) timeout = GpibTimeout300ms; + else if(to >= 100) timeout = GpibTimeout100ms; + else if(to >= 30) timeout = GpibTimeout30ms; + else if(to >= 10) timeout = GpibTimeout10ms; + else if(to >= 3) timeout = GpibTimeout3ms; + else if(to >= 1) timeout = GpibTimeout1ms; + else timeout = GpibTimeoutNone; + ibtmo(m_hd,timeout); + return 0; + } + return -1; } + case CTB_GPIB_GTL: + // Forces the specified device to go to local program mode + if(m_hd >= 0) { + ibloc(m_hd); + return 0; + } + return -1; + case CTB_GPIB_REN: + // This routine can only be used if the specified GPIB + // Interface Board is the System Controller. + // Remember that even though the REN line is asserted, + // the device(s) will not be put into remote state until is + // addressed to listen by the Active Controller + if(m_hd) { + char adr = (char)m_dcs.m_address1; + ibsre(m_board,1); + ibcmd(m_board,&adr,1); + return 0; + } + return -1; + case CTB_GPIB_RESET_BUS: + ibsic(m_board); + return 0; + case CTB_GPIB_GET_EOS_CHAR: + if( m_hd ) { + *(int*)args = (int)m_dcs.m_eosChar; + return 0; + } + return -1; + case CTB_GPIB_SET_EOS_CHAR: +#ifdef __GNUG__ + // FIXME! + // Doesn't work with linux-gpib-3.2.08. All EOS beside 0x00 + // are blocking during sending data to the device. (Look at + // function my_ibwrt in linux-gpib-3.2.08/lib/ibWrt.c + if( m_hd ) { + m_dcs.m_eosChar = (char)*(int*)args; + ibeos(m_hd,(m_dcs.m_eosMode << 8) | m_dcs.m_eosChar); + return 0; + } +#endif + return -1; + case CTB_GPIB_GET_EOS_MODE: + if( m_hd ) { + *(int*)args = (int)m_dcs.m_eosMode; + return 0; + } + return -1; + case CTB_GPIB_SET_EOS_MODE: + if( m_hd ) { + m_dcs.m_eosMode = (char)*(int*)args; + ibeos(m_hd,(m_dcs.m_eosMode << 8) | m_dcs.m_eosChar); + return 0; + } + return -1; + } + // error or unknown command + return -1; + }; + + int GpibDevice::FindListeners(int board) + { + int listeners = 0; + if((unsigned int)board > 1) { + return -1; + } + // reset the GPIB, otherwise no connected device is found (linux) + SendIFC(board); + // list of primary addresses to searching for. Must be terminated + // with NOADDR. + Addr4882_t addrlist[31]; + // The range of valid addresses is 1...30, 0 is reservated by the + // controller, 31 is not valid + for(int i = 0;i < 30; i++) addrlist[i] = (Addr4882_t) i + 1; + addrlist[30] = NOADDR; + // place to store the results + Addr4882_t results[31]; + memset(results,0,sizeof(results)); + FindLstn(board, addrlist, results, 31); + if(ibsta & ERR) { + return -1; + } + for(int i=0;i<=30;i++) { + if(results[i]) { + listeners |= 1 << results[i]; + } + } + return listeners; + }; + + int GpibDevice::Open( const char* devname, int address ) + { + m_dcs.m_address1 = address; + + return OpenDevice( devname, &m_dcs ); + } + + + int GpibDevice::OpenDevice(const char* devname, void* dcs) + { + // if dcs isn't NULL, type cast + if(dcs) m_dcs = *(Gpib_DCS*)dcs; + + if(strncmp(devname,"gpib1",5) == 0) m_board = 0; + else if(strncmp(devname,"gpib2",5) == 0) m_board = 1; + if(m_board < 0) { + return -1; + } + // check for a valid timeout + if((unsigned int)m_dcs.m_timeout > GpibTimeout1000s) { + m_dcs.m_timeout = GpibTimeout10us; + } + + m_hd = ibdev(m_board, + m_dcs.m_address1, + m_dcs.m_address2, + m_dcs.m_timeout, + m_dcs.m_eot, +#ifdef __GNUG__ + // FIXME! + // linux-gpib-3.2.08 doesn't work with any EOS (blocks). + // Because we always has to add an EOS on the message + // (independent of the m_eosChar setting), we can ignore it! + 0 +#else + (m_dcs.m_eosMode << 8) | m_dcs.m_eosChar +#endif + ); + if(m_hd < 0) { + // no gpib controller installed (not found) + return -2; + } + // test for a connected listener (device with given address) + short int listen = 0; + ibln(m_board,m_dcs.m_address1,NO_SAD,&listen); + if(!listen) { + // no listener at the given address + CloseDevice(); + return -3; + } + // reset device + ibclr(m_hd); + // save state, error and count + m_state = ThreadIbsta(); + m_count = ThreadIbcnt(); + m_error = ThreadIberr(); + // no error + return 0; + }; + + int GpibDevice::Read(char* buf,size_t len) + { + // if something is in the fifo, first read that + if(m_fifo->items() > 0) { + return m_fifo->read(buf,len); + } + m_state = ibrd(m_hd,buf,len); + m_error = ThreadIberr(); + m_count = ThreadIbcnt(); + return m_count; + }; + + int GpibDevice::Write(char* buf,size_t len) + { + m_state = ibwrt(m_hd,buf,len); + m_error = ThreadIberr(); + m_count = ThreadIbcnt(); + return m_count; + }; + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/iobase.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/iobase.cpp new file mode 100644 index 0000000000..b92ba4f2d6 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/iobase.cpp @@ -0,0 +1,211 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: iobase.cpp +// Purpose: +// Author: Joachim Buermann +// Id: $Id: iobase.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "ctb-0.16/iobase.h" +#include "ctb-0.16/timer.h" + +namespace ctb { + +#define DELTA_BUFSIZE 512 + + int IOBase::Readv(char* buf,size_t len,unsigned int timeout_in_ms) + { + char *cp = buf; + int n = 0; + int timeout = 0; + size_t toread = len; + + Timer t(timeout_in_ms,&timeout,NULL); + if(timeout_in_ms != 0xFFFFFFFF) { + t.start(); + } + + while(!timeout && (toread > 0)) { + if((n = Read(cp,toread)) < 0) { + break; + } + if(!n) { + sleepms(1); + } + toread -= n; + cp += n; + } + // ok, all bytes received + return(len - toread); + }; + +/* + Readv() calls the member function Read() repeatedly, til all + demand bytes were received. To avoid an endless loop, you + can refer an integer, which was set unequal zero after a + specific time. (See the timer class) +*/ + int IOBase::Readv(char* buf,size_t len,int* timeout_flag,bool nice) + { + size_t toread = len; + int n = 0; + char *cp = buf; + + while(toread > 0) { + if(timeout_flag && (*timeout_flag > 0)) { + return (len - toread); + } + if((n = Read(cp,toread)) < 0) { + return (len - toread); + } + if(!n && nice) { + sleepms(1); + } + if (n > 0) + { + toread -= n; + cp += n; + } + } + // ok, all bytes received + return(len - toread); + }; + + int IOBase::ReadUntilEOS(char*& readbuf, + size_t* readedBytes, + char* eosString, + long timeout_in_ms, + char quota) + { + int n = 0; + int timeout = 0; + int bufsize = DELTA_BUFSIZE; + int result = 0; + int quoted = 0; + char* buf = new char[bufsize]; + char* des = buf; + char* eos = eosString; + char ch; + + Timer t(timeout_in_ms,&timeout,NULL); + t.start(); + + while(!timeout) { + if(des >= &buf[bufsize]) { + // buffer full, realloc more memory + char* tmp = new char[bufsize + DELTA_BUFSIZE + 1]; + memcpy(tmp,buf,bufsize); + delete[] buf; + buf = tmp; + des = &buf[bufsize]; + bufsize += DELTA_BUFSIZE; + } + // read next byte + n = Read(&ch,1); + if(n < 0) { + // an error occured + result = -1; + break; + } + else if(n == 0) { + // no data available, give up the processor for some time + // to reduce the cpu last + sleepms(10); + continue; + } + // if eos is composed of more than one char, and the current + // byte doesn't match the next eos character, we handle the + // readed byte as a normal char (and not an eos) + if((eos != eosString) && (ch != *eos)) { + // FIXME! + // write all characters, which was matched the eos string + // until now (with the first wrong character all received + // eos characters are invalid and must handled as normal + // characters). + + // This doesn't work right and is only a little workaround + // because the received eos chars are lost + PutBack(ch); + // because we doesn't match the eos string, we must 'reset' + // the eos match + eos = eosString; + continue; + } + else { + if((ch == *eos) && !quoted) { + if(*++eos == 0) { + // the eos string is complete + result = 1; + break; + } + continue; + } + } + if(ch == quota) { + quoted ^= 1; + } + *des++ = ch; + } + *des = 0; + readbuf = buf; + *readedBytes = des - buf; + return result; + }; + + int IOBase::Writev(char* buf,size_t len,unsigned int timeout_in_ms) + { + char *cp = buf; + int n = 0; + int timeout = 0; + size_t towrite = len; + + Timer t(timeout_in_ms,&timeout,NULL); + if(timeout_in_ms != 0xFFFFFFFF) { + t.start(); + } + + while(!timeout && (towrite > 0)) { + if((n = Write(cp,towrite)) < 0) { + // an error occurs + break; + } + if(!n) { + sleepms(1); + } + towrite -= n; + cp += n; + } + return (len - towrite); + }; + +/* + Similar to Readv(). Writev() calls Write() repeatedly till + all bytes are written. +*/ + int IOBase::Writev(char* buf,size_t len,int* timeout_flag,bool nice) + { + size_t towrite = len; + int n = 0; + char *cp = buf; + + while(towrite > 0) { + if(timeout_flag && (*timeout_flag > 0)) { + return (len - towrite); + } + if((n = Write(cp,towrite)) < 0) { + // an error occurs + return (len - towrite); + } + if(!n && nice) { + sleepms(1); + } + towrite -= n; + cp += n; + } + return(len); + }; + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/kbhit.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/kbhit.cpp new file mode 100644 index 0000000000..4a244ea251 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/kbhit.cpp @@ -0,0 +1,37 @@ +#if defined ( WIN32 ) +# include +#else +# include +# include +#endif + +namespace ctb { + + char GetKey() + { +#if defined ( WIN32 ) + if(_kbhit()) { + return _getch(); + } + return '\0'; +#else + int ch; + static struct termios t, save_t; + tcgetattr(0,&t); + save_t = t; + t.c_lflag &= ~(ICANON); + t.c_cc[VMIN] = 0; + t.c_cc[VTIME] = 0; + tcsetattr(0,TCSANOW,&t); + + ch = fgetc(stdin); + + tcsetattr(0,TCSANOW,&save_t); + if(ch != EOF) { + return ch; + } + return '\0'; +#endif + } + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp new file mode 100644 index 0000000000..a369abc5e7 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp @@ -0,0 +1,443 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: linux/serport.cpp +// Purpose: +// Author: Joachim Buermann +// Id: $Id: serport.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "ctb-0.16/linux/serport.h" + +#include +#include +#include +#include +#include +#include +#include + +#define CMSPAR 010000000000 /* mark or space (stick) parity */ + +namespace ctb { + + const char* COM1 = "/dev/ttyS0"; + const char* COM2 = "/dev/ttyS1"; + const char* COM3 = "/dev/ttyS2"; + const char* COM4 = "/dev/ttyS3"; + const char* COM5 = "/dev/ttyS4"; + const char* COM6 = "/dev/ttyS5"; + const char* COM7 = "/dev/ttyS6"; + const char* COM8 = "/dev/ttyS7"; + const char* COM9 = "/dev/ttyS8"; + const char* COM10 = "/dev/ttyS9"; + const char* COM11= "/dev/ttyS10"; + const char* COM12= "/dev/ttyS11"; + const char* COM13 = "/dev/ttyS12"; + const char* COM14 = "/dev/ttyS13"; + const char* COM15 = "/dev/ttyS14"; + const char* COM16 = "/dev/ttyS15"; + const char* COM17 = "/dev/ttyS16"; + const char* COM18 = "/dev/ttyS17"; + const char* COM19 = "/dev/ttyS18"; + const char* COM20 = "/dev/ttyS19"; + + SerialPort::SerialPort() : + SerialPort_x() + { + fd = -1; + }; + + SerialPort::~SerialPort() + { + Close(); + }; + + speed_t SerialPort::AdaptBaudrate( int baud ) + { + switch(baud) { + case 150: return B150; + case 300: return B300; + case 600: return B600; + case 1200: return B1200; + case 2400: return B2400; + case 4800: return B4800; + case 9600: return B9600; + case 19200: return B19200; + case 57600: return B57600; + case 115200: return B115200; + case 230400: return B230400; + case 460800: return B460800; + case 921600: return B921600; + + // NOTE! The speed of 38400 is required, if you want to set + // an non-standard baudrate. See below! + default: return B38400; + } + }; + + int SerialPort::CloseDevice() + { + int err = 0; + // only close an open file handle + if(fd < 0) return EBADF; + // With some systems, it is recommended to flush the serial port's + // Output before closing it, in order to avoid a possible hang of + // the process... + // Thanks to Germain (I couldn't answer you, because your email + // address was invalid) + tcflush(fd, TCOFLUSH); + + // Don't recover the orgin settings while the device is open. This + // implicate a mismatched data output! + // Just close device + err = close( fd ); + + fd = -1; + + return err; + }; + + int SerialPort::ChangeLineState( SerialLineState flags ) + { + int state; + ioctl(fd,TIOCMGET,&state); + state ^= flags; + return ioctl(fd,TIOCMSET,&state); + }; + + int SerialPort::ClrLineState( SerialLineState flags ) + { + return ioctl(fd,TIOCMBIC,&flags); + }; + + int SerialPort::GetLineState() + { + SerialLineState flags = LinestateNull; + + if( ioctl( fd, TIOCMGET, &flags ) < 0 ) { + + return -1; + + } + return (int)( flags & 0x1FF ); + }; + +// +// included from /usr/include/linux/serial.h +// +// struct serial_icounter_struct { +// int cts, dsr, rng, dcd; +// int rx, tx; +// int frame, overrun, parity, brk; +// int buf_overrun; +// int reserved[9]; +// }; +// + int SerialPort::Ioctl(int cmd, void* args) + { + int count = 0; + int err = 0; + struct serial_icounter_struct info; + SerialPort_EINFO einfo; + + switch(cmd) { + case CTB_RESET: + return SendBreak(0); + case CTB_SER_GETEINFO: + err = ioctl(fd,TIOCGICOUNT,&info); + if(err) return err; + einfo.brk = info.brk - save_info.brk; + einfo.frame = info.frame - save_info.frame; + einfo.overrun = info.overrun - save_info.overrun; + einfo.parity = info.parity - save_info.parity; + *(SerialPort_EINFO*)args = einfo; + break; + case CTB_SER_GETBRK: + err = ioctl(fd,TIOCGICOUNT,&info); + if(err) return err; + if(last_info.brk != info.brk) count = 1; + break; + case CTB_SER_GETFRM: + err = ioctl(fd,TIOCGICOUNT,&info); + if(err) return err; + if(last_info.frame != info.frame) count = 1; + break; + case CTB_SER_GETOVR: + err = ioctl(fd,TIOCGICOUNT,&info); + if(err) return err; + if(last_info.overrun != info.overrun) count = 1; + break; + case CTB_SER_GETPAR: + err = ioctl(fd,TIOCGICOUNT,&info); + if(err) return err; + if(last_info.parity != info.parity) count = 1; + break; + case CTB_SER_GETINQUE: + err = ioctl(fd,TIOCINQ,&count); + if(err) return err; + *(int*)args = count; + return 0; + case CTB_SER_SETPAR: + return SetParityBit( *(int*)args == 1 ); + default: + return -1; + } + last_info = info; + return 0; + }; + + int SerialPort::IsOpen() + { + return (fd != -1); + }; + + int SerialPort::OpenDevice(const char* devname, void* dcs) + { + // if dcs isn't NULL, type cast + if(dcs) m_dcs = *(SerialPort_DCS*)dcs; + // open serial comport device for reading and writing, + // don't wait (O_NONBLOCK) + fd = open(devname, O_RDWR | O_NOCTTY | O_NONBLOCK); + if(fd >= 0) { + + // exclusive use + int dummy; + + ioctl( fd, TIOCEXCL, &dummy ); + + tcgetattr(fd,&t); + save_t = t; + + // save the device name + strncpy(m_devname,(char*)devname,sizeof(m_devname)); + // we write an eos to avoid a buffer overflow + m_devname[sizeof(m_devname)-1] = '\0'; + + // Fill the internal terios struct. + // If the given baudrate is an non-standard one, the AdaptBaudrate + // call returns the linux specific value B38400 which is a + // condition for the later switch to an unusual baudrate! + cfsetspeed(&t, AdaptBaudrate( m_dcs.baud ) ); + + //cfsetospeed(&t, AdaptBaudrate( m_dcs.baud ) ); + + // parity settings + switch( m_dcs.parity ) { + + case ParityNone: + t.c_cflag &= ~PARENB; break; + + case ParityOdd: + t.c_cflag |= PARENB; + t.c_cflag |= PARODD; + break; + + case ParityEven: + t.c_cflag |= PARENB; + t.c_cflag &= ~PARODD; + break; + + case ParityMark: + t.c_cflag |= PARENB | CMSPAR | PARODD; + break; + + case ParitySpace: + t.c_cflag |= PARENB | CMSPAR; + t.c_cflag &= ~PARODD; + break; + } + + // stopbits + if(m_dcs.stopbits == 2) + t.c_cflag |= CSTOPB; + else + t.c_cflag &= ~CSTOPB; + // wordlen + t.c_cflag &= ~CSIZE; + if(m_dcs.wordlen == 7) t.c_cflag |= CS7; + else if(m_dcs.wordlen == 6) t.c_cflag |= CS6; + else if(m_dcs.wordlen == 5) t.c_cflag |= CS5; + // this is the default + else t.c_cflag |= CS8; + // rts/cts + if(m_dcs.rtscts == false) + t.c_cflag &= ~CRTSCTS; + else + t.c_cflag |= CRTSCTS; + + t.c_lflag &= ~(ICANON | ECHO | ISIG | IEXTEN); + t.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON | IXOFF | IXANY); + t.c_iflag |= IGNPAR; + t.c_oflag &= ~OPOST; + + if(m_dcs.xonxoff == true) { + t.c_iflag |= (IXON | IXOFF); + } + + // look out! + // MIN = 1 means, in TIME (1/10 secs) defined timeout + // will be started AFTER receiving the first byte + // so we must set MIN = 0. (timeout starts immediately, abort + // also without readed byte) + t.c_cc[VMIN] = 0; + // timeout in 1/10 secs + // no timeout for non blocked transfer + t.c_cc[VTIME] = 0; + // write the settings + tcsetattr(fd,TCSANOW,&t); + // it's careless, but in the moment we don't test + // the return of tcsetattr (normally there is no error) + + // request the actual numbers of breaks, framing, overrun + // and parity errors (because Linux summing all of them during + // system lifetime, not only while serial port is open. + ioctl(fd,TIOCGICOUNT,&save_info); + // it's also careless, but we assume, that there was no error + last_info = save_info; + + // in case of a non-standard rate, the termios struct have to set + // with the B38400 rate, see above! + if( ! IsStandardRate( m_dcs.baud ) ) { + + SetBaudrateAny( m_dcs.baud ); + + } + } + return fd; + }; + + int SerialPort::Read(char* buf,size_t len) + { + if(m_fifo->items() > 0) { + return m_fifo->read(buf,len); + } + // Read() (using read() ) will return an 'error' EAGAIN as it is + // set to non-blocking. This is not a true error within the + // functionality of Read, and thus should be handled by the caller. + int n = read(fd,buf,len); + if((n < 0) && (errno == EAGAIN)) return 0; + return n; + }; + + int SerialPort::SendBreak(int duration) + { + // the parameter is equal with linux + return tcsendbreak(fd,duration); + }; + + /* + Note: The following hints are copied from the ftdi_sio.c sources of + the kernel modul for the USB to RS232 converter using an FTDI + chipset (FT232BM or similar). Thanks to all those people + contribute code and above all helpful comments to this modul. + */ + + /* + * The logic involved in setting the baudrate can be cleanly split in 3 steps. + * Obtaining the actual baud rate is a little tricky since unix traditionally + * somehow ignored the possibility to set non-standard baud rates. + * 1. Standard baud rates are set in tty->termios->c_cflag + * 2. If these are not enough, you can set any speed using alt_speed as + * follows: + * - set tty->termios->c_cflag speed to B38400 + * - set your real speed in tty->alt_speed; it gets ignored when + * alt_speed==0, (or) + * - call TIOCSSERIAL ioctl with (struct serial_struct) set as follows: + * flags & ASYNC_SPD_MASK == ASYNC_SPD_[HI, VHI, SHI, WARP], this just + * sets alt_speed to (HI: 57600, VHI: 115200, SHI: 230400, WARP: 460800) + * ** Steps 1, 2 are done courtesy of tty_get_baud_rate + * 3. You can also set baud rate by setting custom divisor as follows + * - set tty->termios->c_cflag speed to B38400 + * - call TIOCSSERIAL ioctl with (struct serial_struct) set as follows: + * o flags & ASYNC_SPD_MASK == ASYNC_SPD_CUST + * o custom_divisor set to baud_base / your_new_baudrate + * ** Step 3 is done courtesy of code borrowed from serial.c - I should really + * spend some time and separate+move this common code to serial.c, it is + * replicated in nearly every serial driver you see. + */ + + int SerialPort::SetBaudrateAny( int baudrate ) + { + struct serial_struct ser_info; + + int result = ioctl( fd, TIOCGSERIAL, &ser_info ); + + ser_info.flags = ASYNC_SPD_CUST | ASYNC_LOW_LATENCY; + + ser_info.custom_divisor = ser_info.baud_base / baudrate; + + result = ioctl( fd, TIOCSSERIAL, &ser_info ); + + return result; + } + + int SerialPort::SetBaudrateStandard( int baudrate ) + { + speed_t baud = AdaptBaudrate( baudrate ); + // setting the input baudrate + if(cfsetspeed(&t,baud) < 0) { + return -1; + } + // take over + m_dcs.baud = baudrate; + + tcsetattr(fd,TCSANOW,&t); + + return tcgetattr( fd, &t ); + + }; + + int SerialPort::SetBaudrate( int baudrate ) + { + return IsStandardRate( baudrate ) ? + SetBaudrateStandard( baudrate ) : + SetBaudrateAny( baudrate ); + + } + + int SerialPort::SetLineState( SerialLineState flags ) + { + return ioctl(fd,TIOCMBIS,&flags); + }; + + int SerialPort::SetParityBit( bool parity ) + { + // waits until all output has been transmitted + tcdrain( fd ); + + // now read the current termios settings and manipulate + // the parity + tcgetattr( fd, &t ); + + if( parity ) { + + t.c_cflag |= PARENB | CMSPAR | PARODD; + + } + else { + + t.c_cflag |= PARENB | CMSPAR; + + t.c_cflag &= ~PARODD; + + } + + tcsetattr( fd,TCSANOW, &t ); + + tcgetattr( fd, &t ); + + return 0; + } + + int SerialPort::Write(char* buf,size_t len) + { + // Write() (using write() ) will return an 'error' EAGAIN as it is + // set to non-blocking. This is not a true error within the + // functionality of Write, and thus should be handled by the caller. + int n = write(fd,buf,len); + if((n < 0) && (errno == EAGAIN)) return 0; + return n; + }; + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/timer.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/timer.cpp new file mode 100644 index 0000000000..f1c50f613b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/timer.cpp @@ -0,0 +1,97 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: linux/timer.cpp +// Purpose: +// Author: Joachim Buermann +// Id: $Id: timer.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + + +#include "ctb-0.16/timer.h" +#include + +namespace ctb { + +// a dummy function, see below + static void timer_exit(void* arg) + { + }; + + static void* timer_fnc(void* arg) + { + // the timer thread should be canceled every time + // (asyncronously) + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,NULL); + // this is tricky, but absolutly necessarily to avoid segfaults + // if the destructor finished a running thread + pthread_cleanup_push(timer_exit,NULL); + timer_control *tc = (timer_control*)arg; + // linux allows a real sleep, means the timer thread will + // be sleeping (no reduce of the system performance) + usleep(tc->usecs); + // time is over, system reawake the thread. + // if there is an exit function, calling it + if(tc->exitfnc) tc->exitfnc(NULL); + // set the exit flag + if(tc->exitflag) *tc->exitflag = 1; + // deallocate the system resources (thread) + pthread_cleanup_pop(1); + return NULL; + }; + + // the constructor initiate the internal control struct + Timer::Timer( unsigned int msecs, int* exitflag, void*( *exitfnc )(void*) ) + { + control.usecs = msecs * 1000; + control.exitflag = exitflag; + control.exitfnc = exitfnc; + stopped = 1; + }; + + // if a timer instance leave it's valid range, it automaticaly will + // be finished + Timer::~Timer() + { + if(!stopped) { + // only a running thread may be canceled + stop(); + } + }; + + // starts the timer thread + int Timer::start() + { + stopped = 0; + if(pthread_create(&tid, // result parameter, covers the id + // of the new threads + NULL, // thread attribute object, NULL means + // the defaults + timer_fnc, // start function of the thread + &control // start function parameter, must refer + // as void* + ) == -1) { + return -1; // there was something going wrong + } + pthread_detach(tid); // thread status must be "detach". In the other + // case, the destructor call of a running + // thread throws a segfault + return 0; + }; + + // stop the timer thread + int Timer::stop() + { + if(control.exitflag && (*control.exitflag == 0)) { + pthread_cancel(tid); + } + stopped = 1; + return 0; + }; + + void sleepms(unsigned int ms) + { + usleep(ms * 1000); + }; + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/portscan.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/portscan.cpp new file mode 100644 index 0000000000..f13766e9fa --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/portscan.cpp @@ -0,0 +1,109 @@ +#include "ctb-0.16/ctb.h" +#include "ctb-0.16/portscan.h" + +#include + +#ifndef _WIN32 +# include +#endif + +namespace ctb { + + bool GetAvailablePorts( std::vector& result, + bool checkInUse ) + { +#ifdef _WIN32 + + std::stringstream devname; + + for( int i = 1; i < 100; i++ ) { + + devname.clear(); devname.str( "" ); + + // some systems like WinCE doesn't like the extended port numbering... + i < 10 ? devname << "com" << i : devname << "\\\\.\\com" << i; + + COMMCONFIG cc; + + DWORD dwSize = sizeof( cc ); + + if ( ::GetDefaultCommConfig( devname.str().c_str(), &cc, &dwSize ) ) { + + if( cc.dwProviderSubType == PST_RS232 ) { + + ctb::SerialPort com; + + if( com.Open( devname.str().c_str() ) < 0 ) { + + continue; + + } + + result.push_back( devname.str().c_str() ); + + } + } + } + +#else + glob_t globbuf; + + // search for standard serial ports + int res = glob( "/dev/ttyS*", GLOB_ERR, NULL, &globbuf ); + + if( res == 0 ) { + + // no error, glob was successful + for( int i = 0; i < globbuf.gl_pathc; i++ ) { + + if( checkInUse ) { + + ctb::SerialPort com; + + if( com.Open( globbuf.gl_pathv[ i ] ) < 0 ) { + + continue; + + } + + result.push_back( std::string( globbuf.gl_pathv[ i ] ) ); + + } + } + + } + globfree( &globbuf ); + + // search for USB to RS232 converters + res = glob( "/dev/ttyUSB*", GLOB_ERR, NULL, &globbuf ); + + if( res == 0 ) { + + // no error, glob was successful + for( int i = 0; i < globbuf.gl_pathc; i++ ) { + + if( checkInUse ) { + + ctb::SerialPort com; + + if( com.Open( globbuf.gl_pathv[ i ] ) < 0 ) { + + continue; + + } + + result.push_back( std::string( globbuf.gl_pathv[ i ] ) ); + + } + } + + } + + globfree( &globbuf ); +#endif + + return result.size(); + + } + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/serportx.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/serportx.cpp new file mode 100644 index 0000000000..c59bcc002f --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/serportx.cpp @@ -0,0 +1,104 @@ +#include "ctb-0.16/serportx.h" + +#include + +namespace ctb { + + int SerialPort_x::Open( const char* portname, int baudrate, + const char* protocol, + FlowControl flowControl ) + { + SerialPort_DCS dcs; + + dcs.baud = baudrate; + + // default wordlen is 8 + if( ( protocol[ 0 ] >= '5' ) && ( protocol[ 0 ] <= '8' )) { + + dcs.wordlen = protocol[ 0 ] - '0'; + + } + else { + + return -1; + + } + + // protocol is given as a string like "8N1", the first + // character specifies the data bits (5...8), the second + // the parity (None,Odd,Even,Mark,Space). + // The third character defines the stopbit (1...2). + switch( protocol[ 1 ] ) { + case 'N': case 'n': dcs.parity = ParityNone; break; + case 'O': case 'o': dcs.parity = ParityOdd; break; + case 'E': case 'e': dcs.parity = ParityEven; break; + case 'M': case 'm': dcs.parity = ParityMark; break; + case 'S': case 's': dcs.parity = ParitySpace; break; + // all other parameters cause an error! + default: return -1; + } + // default stopbits is 1 + if( ( protocol[ 2 ] >= '1' ) && ( protocol[ 2 ] <= '2' )) { + + dcs.stopbits = protocol[ 2 ] - '0'; + + } + else { + + return -1; + + } + // default flow control is disabled + dcs.rtscts = ( flowControl == RtsCtsFlowControl ); + + dcs.xonxoff = ( flowControl == XonXoffFlowControl ); + + // save the settings in the internal dcs for later use + m_dcs = dcs; + + return OpenDevice( portname, &m_dcs ); + + } + + int SerialPort_x::Open( const int portnumber, int baudrate, + const char* protocol, + FlowControl flowControl ) + { + // portnumbers start with 1 + if( portnumber < 1 ) { + + return -1; + + } + std::stringstream devname; + +#if defined ( WIN32 ) + // some systems like WinCE doesn't like the extended port numbering... + portnumber < 10 ? devname << "com" << portnumber : + devname << "\\\\.\\com" << portnumber; +#else + devname << "/dev/ttyS" << ( portnumber - 1 ); +#endif + + return Open( devname.str().c_str(), baudrate, protocol, flowControl ); + } + + bool SerialPort_x::IsStandardRate( int rate ) + { + const int rates[] = { + 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, + 115200, 230400, 460800, 921600 + }; + + for( unsigned int i = 0; i < ( sizeof( rates ) / sizeof( int ) ); i++ ) { + + if( rate == rates[ i ] ) { + + return true; + + } + } + return false; + } + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp new file mode 100644 index 0000000000..c8454b9bde --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp @@ -0,0 +1,66 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: win32/getopt.cpp +// Purpose: +// Author: unknown, I found it in the internet +// Id: $Id: getopt.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001 ? +// Licence: (I think Open Source) +///////////////////////////////////////////////////////////////////////////// + +#include +#include + +char *optarg; /* Global argument pointer. */ +int optind = 0; /* Global argv index. */ + +static char *scan = NULL; /* Private scan pointer. */ + +/* found char, or NULL if none */ +static char *index(const char* s,char charwanted) +{ + return(strchr((char*)s, charwanted)); +} + +int getopt(int argc, char* argv[], char* optstring) +{ + register char c; + register char *place; + + optarg = NULL; + + if (scan == NULL || *scan == '\0') { + if (optind == 0) + optind++; + + if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') + return(EOF); + if (strcmp(argv[optind], "--")==0) { + optind++; + return(EOF); + } + + scan = argv[optind]+1; + optind++; + } + + c = *scan++; + place = index(optstring, c); + + if (place == NULL || c == ':') { + fprintf(stderr, "%s: unknown option -%c\n", argv[0], c); + return('?'); + } + + place++; + if (*place == ':') { + if (*scan != '\0') { + optarg = scan; + scan = NULL; + } else { + optarg = argv[optind]; + optind++; + } + } + + return(c); +} diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/serport.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/serport.cpp new file mode 100644 index 0000000000..23b50ab32b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/serport.cpp @@ -0,0 +1,452 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: serport.cpp +// Purpose: +// Author: Joachim Buermann +// Id: $Id: serport.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ +// Copyright: (c) 2001 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include +#include "ctb-0.16/serport.h" + +#define SERIALPORT_BUFSIZE 4096 + +namespace ctb { + + const char* COM1 = "com1"; + const char* COM2 = "com2"; + const char* COM3 = "com3"; + const char* COM4 = "com4"; + const char* COM5 = "com5"; + const char* COM6 = "com6"; + const char* COM7 = "com7"; + const char* COM8 = "com8"; + const char* COM9 = "com9"; + const char* COM10 = "\\\\.\\com10"; + const char* COM11 = "\\\\.\\com11"; + const char* COM12 = "\\\\.\\com12"; + const char* COM13 = "\\\\.\\com13"; + const char* COM14 = "\\\\.\\com14"; + const char* COM15 = "\\\\.\\com15"; + const char* COM16 = "\\\\.\\com16"; + const char* COM17 = "\\\\.\\com17"; + const char* COM18 = "\\\\.\\com18"; + const char* COM19 = "\\\\.\\com19"; + const char* COM20 = "\\\\.\\com20"; + + SerialPort::SerialPort() + { + memset( &m_ov, 0, sizeof( OVERLAPPED ) ); + fd = INVALID_HANDLE_VALUE; + m_rtsdtr_state = LinestateNull; + }; + + SerialPort::~SerialPort() + { + Close(); + }; + + int SerialPort::CloseDevice() + { + if(fd != INVALID_HANDLE_VALUE) { + CloseHandle(m_ov.hEvent); + CloseHandle(fd); + fd = INVALID_HANDLE_VALUE; + } + return 0; + }; + + int SerialPort::ChangeLineState( SerialLineState flags ) + { + bool ok = false; + if(flags & LinestateDtr) { + if(m_rtsdtr_state & LinestateDtr) { + ok = EscapeCommFunction(fd,CLRDTR); + } + else { + ok = EscapeCommFunction(fd,SETDTR); + } + m_rtsdtr_state ^= LinestateDtr; + } + if(flags & LinestateRts) { + if(m_rtsdtr_state & LinestateRts) { + ok = EscapeCommFunction(fd,CLRRTS); + } + else { + ok = EscapeCommFunction(fd,SETRTS); + } + m_rtsdtr_state ^= LinestateRts; + } + if(!ok) return -1; + return 0; + }; + + int SerialPort::ClrLineState( SerialLineState flags ) + { + BOOL ok = false; + if(flags & LinestateDtr) { + ok = EscapeCommFunction(fd,CLRDTR); + m_rtsdtr_state &= ~LinestateDtr; + } + if(flags & LinestateRts) { + ok = EscapeCommFunction(fd,CLRRTS); + m_rtsdtr_state &= ~LinestateRts; + } + if(!ok) return -1; + return 0; + }; + + int SerialPort::GetLineState() + { + BOOL ok = false; + DWORD stat; + int flags = 0; + if(GetCommModemStatus(fd,&stat)) { + if(stat & MS_CTS_ON) + flags |= LinestateCts; + if(stat & MS_DSR_ON) + flags |= LinestateDsr; + if(stat & MS_RING_ON) + flags |= LinestateRing; + if(stat & MS_RLSD_ON) + flags |= LinestateDcd; + ok = true; + } + if(!ok) return -1; + return flags; + }; + + int SerialPort::Ioctl(int cmd,void* args) + { + COMSTAT comstat; + DWORD errors; + int result = 0; + bool brk; + switch(cmd) { + case CTB_RESET: + return SendBreak(0); + case CTB_SER_GETEINFO: + if(ClearCommError(fd,&errors,&comstat)) { + // actualize the last events + if(errors & CE_BREAK) einfo.brk++; + if(errors & CE_FRAME) einfo.frame++; + if(errors & CE_OVERRUN) einfo.overrun++; + if(errors & CE_RXPARITY) einfo.parity++; + *(SerialPort_EINFO*)args = einfo; + return 0; + } + case CTB_SER_GETBRK: + if(ClearCommError(fd,&errors,&comstat)) { + if(errors & CE_BREAK) result = 1; + einfo.brk += result; + *(int*)args = result; + return 0; + } + break; + case CTB_SER_GETFRM: + if(ClearCommError(fd,&errors,&comstat)) { + if(errors & CE_FRAME) result = 1; + einfo.frame += result; + *(int*)args = result; + return 0; + } + case CTB_SER_GETOVR: + if(ClearCommError(fd,&errors,&comstat)) { + if(errors & CE_OVERRUN) result = 1; + einfo.overrun += result; + *(int*)args = result; + return 0; + } + break; + case CTB_SER_GETPAR: + if(ClearCommError(fd,&errors,&comstat)) { + if(errors & CE_RXPARITY) result = 1; + einfo.parity += result; + *(int*)args = result; + return 0; + } + break; + case CTB_SER_GETINQUE: + if(ClearCommError(fd,&errors,&comstat)) { + *(int*)args = (int)comstat.cbInQue; + return 0; + } + break; + case CTB_SER_SETPAR: + return SetParityBit( *(int*)args == 1 ); + } + // error or unknown command + return -1; + }; + + int SerialPort::IsOpen() + { + return (fd != INVALID_HANDLE_VALUE); + }; + + int SerialPort::OpenDevice(const char* devname, void* dcs) + { + // if dcs isn't NULL, type cast + if(dcs) m_dcs = *(SerialPort_DCS*)dcs; + + fd = CreateFile(devname, // device name + GENERIC_READ | GENERIC_WRITE, // O_RDWR + 0, // not shared + NULL, // default value for object security ?!? + OPEN_EXISTING, // file (device) exists + FILE_FLAG_OVERLAPPED, // asynchron handling + NULL); // no more handle flags + + if(fd == INVALID_HANDLE_VALUE) { + return -1; + } + // save the device name + strncpy(m_devname,(char*)devname,sizeof(m_devname)); + // we write an eos to avoid a buffer overflow + m_devname[sizeof(m_devname)-1] = '\0'; + + // device control block + DCB dcb; + memset(&dcb,0,sizeof(dcb)); + dcb.DCBlength = sizeof(dcb); + dcb.BaudRate = m_dcs.baud; + dcb.fBinary = 1; + + m_rtsdtr_state = LinestateNull; + + // Specifies whether the CTS (clear-to-send) signal is monitored + // for output flow control. If this member is TRUE and CTS is turned + // off, output is suspended until CTS is sent again. + dcb.fOutxCtsFlow = m_dcs.rtscts; + + // Specifies the DTR (data-terminal-ready) flow control. + // This member can be one of the following values: + // DTR_CONTROL_DISABLE Disables the DTR line when the device is + // opened and leaves it disabled. + // DTR_CONTROL_ENABLE Enables the DTR line when the device is + // opened and leaves it on. + // DTR_CONTROL_HANDSHAKE Enables DTR handshaking. If handshaking is + // enabled, it is an error for the application + // to adjust the line by using the + // EscapeCommFunction function. + dcb.fDtrControl = DTR_CONTROL_DISABLE; + m_rtsdtr_state |= LinestateDtr; + // Specifies the RTS flow control. If this value is zero, the + // default is RTS_CONTROL_HANDSHAKE. This member can be one of + // the following values: + // RTS_CONTROL_DISABLE Disables the RTS line when device is + // opened and leaves it disabled. + // RTS_CONTROL_ENABLED Enables the RTS line when device is + // opened and leaves it on. + // RTS_CONTROL_HANDSHAKE Enables RTS handshaking. The driver + // raises the RTS line when the + // "type-ahead" (input)buffer is less than + // one-half full and lowers the RTS line + // when the buffer is more than three-quarters + // full. If handshaking is enabled, it is an + // error for the application to adjust the + // line by using the EscapeCommFunction function. + // RTS_CONTROL_TOGGLE Specifies that the RTS line will be high if + // bytes are available for transmission. After + // all buffered bytes have been send, the RTS + // line will be low. + if(m_dcs.rtscts) dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; + else { + dcb.fRtsControl = RTS_CONTROL_DISABLE; + m_rtsdtr_state |= LinestateRts; + } + // Specifies the XON/XOFF flow control. + // If fOutX is true (the default is false), transmission stops when the + // XOFF character is received and starts again, when the XON character + // is received. + dcb.fOutX = m_dcs.xonxoff; + // If fInX is true (default is false), the XOFF character is sent when + // the input buffer comes within XoffLim bytes of being full, and the + // XON character is sent, when the input buffer comes within XonLim + // bytes of being empty. + dcb.fInX = m_dcs.xonxoff; + // default character for XOFF is 0x13 (hex 13) + dcb.XoffChar = 0x13; + // default character for XON is 0x11 (hex 11) + dcb.XonChar = 0x11; + // set the minimum number of bytes allowed in the input buffer before + // the XON character is sent (3/4 of full size) + dcb.XonLim = (SERIALPORT_BUFSIZE >> 2) * 3; + // set the maximum number of free bytes in the input buffer, before the + // XOFF character is sent (3/4 of full size) + dcb.XoffLim = (SERIALPORT_BUFSIZE >> 2) * 3; + + // parity + switch( m_dcs.parity ) { + + case ParityOdd: dcb.Parity = ODDPARITY; break; + case ParityEven: dcb.Parity = EVENPARITY; break; + case ParityMark: dcb.Parity = MARKPARITY; break; + case ParitySpace: dcb.Parity = SPACEPARITY; break; + default: dcb.Parity = NOPARITY; + + } + // stopbits + if(m_dcs.stopbits == 2) dcb.StopBits = TWOSTOPBITS; + else dcb.StopBits = ONESTOPBIT; + // wordlen, valid values are 5,6,7,8 + dcb.ByteSize = m_dcs.wordlen; + + if(!SetCommState(fd,&dcb)) + return -2; + + // create event for overlapped I/O + // we need a event object, which inform us about the + // end of an operation (here reading device) + m_ov.hEvent = CreateEvent(NULL,// LPSECURITY_ATTRIBUTES lpsa + TRUE, // BOOL fManualReset + TRUE, // BOOL fInitialState + NULL); // LPTSTR lpszEventName + if(m_ov.hEvent == INVALID_HANDLE_VALUE) { + return -3; + } + + /* THIS IS OBSOLETE!!! + // event should be triggered, if there are some received data + if(!SetCommMask(fd,EV_RXCHAR)) + return -4; + */ + + COMMTIMEOUTS cto = {MAXDWORD,0,0,0,0}; + if(!SetCommTimeouts(fd,&cto)) + return -5; + + // for a better performance with win95/98 I increased the internal + // buffer to SERIALPORT_BUFSIZE (normal size is 1024, but this can + // be a little bit to small, if you use a higher baudrate like 115200) + if(!SetupComm(fd,SERIALPORT_BUFSIZE,SERIALPORT_BUFSIZE)) + return -6; + + // clear the internal error struct + memset(&einfo,0,sizeof(einfo)); + return 0; + }; + + int SerialPort::Read(char* buf,size_t len) + { + DWORD read; + int m = m_fifo->items(); + while(len) { + if(m_fifo->get(buf) == 1) { + len--; + buf++; + } + else { + break; + } + } + if(!ReadFile(fd,buf,len,&read,&m_ov)) { + // if we use a asynchrone reading, ReadFile gives always + // FALSE + // ERROR_IO_PENDING means ok, other values show an error + if(GetLastError() != ERROR_IO_PENDING) { + // oops..., error in communication + return -1; + } + } + else { + // ok, we have read all wanted bytes + return (int)read + m; + } + return 0; + }; + + int SerialPort::SendBreak(int duration) + { + if(duration <= 0) duration = 1; + if(!SetCommBreak(fd)) return -1; + // win32 Sleep parameter is ms + Sleep(duration * 250); + if(!ClearCommBreak(fd)) return -1; + // no error + return 0; + }; + +/* + FIXME! : We need some additional code to check the success of the + baudrate modulation (non-standard rates depend on the used + UART chipset). +*/ + int SerialPort::SetBaudrate( int baudrate ) + { + DCB dcb; + + // get the current dcb... + if(!GetCommState(fd,&dcb)) { + return -1; + } + dcb.BaudRate = baudrate; + // and write it back + if(!SetCommState(fd,&dcb)) { + return -1; + } + m_dcs.baud = baudrate; + return 0; + } + + int SerialPort::SetLineState( SerialLineState flags ) + { + BOOL ok = false; + if(flags & LinestateDtr) { + ok = EscapeCommFunction(fd,SETDTR); + // save the new state + m_rtsdtr_state |= LinestateDtr; + } + if(flags & LinestateRts) { + ok = EscapeCommFunction(fd,SETRTS); + // save the new state + m_rtsdtr_state |= LinestateRts; + } + if(!ok) return -1; + return 0; + }; + + int SerialPort::SetParityBit( bool parity ) + { + DCB dcb; + + if( ! GetCommState( fd, &dcb ) ) { + + return -1; + + } + + parity ? dcb.Parity = MARKPARITY : dcb.Parity = SPACEPARITY; + + if( ! SetCommState( fd, &dcb ) ) { + + return -2; + + } + return 0; + } + + int SerialPort::Write(char* buf,size_t len) + { + DWORD write; + if(!WriteFile(fd,buf,len,&write,&m_ov)) { + if(GetLastError() != ERROR_IO_PENDING) { + return -1; + } + else { + // VERY IMPORTANT to flush the data out of the internal + // buffer + FlushFileBuffers(fd); + // first you must call GetOverlappedResult, then you + // get the REALLY transmitted count of bytes + if(!GetOverlappedResult(fd,&m_ov,&write,TRUE)) { + // ooops... something is going wrong + return (int)write; + } + } + } + return write; + }; + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/timer.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/timer.cpp new file mode 100644 index 0000000000..617aa5b5ad --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/timer.cpp @@ -0,0 +1,85 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: win32/timer.cpp +// Purpose: +// Author: Joachim Buermann +// Id: $Id: timer.cpp,v 1.2 2004/11/30 12:39:17 jb Exp $ +// Copyright: (c) 2001 Joachim Buermann +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include +#include + +#ifdef WIN32 +#include +# ifndef DWORD_PTR +# define DWORD_PTR DWORD* +# endif +#endif + +#include "ctb-0.16/timer.h" + +namespace ctb { + + static void WINAPI timer_fnc(UINT uTimerID, + UINT uMsg, + DWORD_PTR dwUser, + DWORD_PTR dw1, + DWORD_PTR dw2) + { + timer_control *tc = (timer_control*)dwUser; + + if(tc->exitfnc) tc->exitfnc(NULL); + if(tc->exitflag) *tc->exitflag = 1; + tc->stop = 0; + }; + + Timer::Timer(unsigned int msecs,int* exitflag,void*(*exitfnc)(void*)) + { + control.msecs = msecs; + if(!control.msecs) control.msecs = 1; + control.exitflag = exitflag; + control.exitfnc = exitfnc; + control.stop = 0; + }; + + Timer::~Timer() + { + stop(); // stop the thread + }; + + int Timer::start() + { + stop(); + control.stop = timeSetEvent(control.msecs, + (control.msecs > 10) ? 5 : 1, + (LPTIMECALLBACK) timer_fnc, + (DWORD) &control, + TIME_ONESHOT | TIME_CALLBACK_FUNCTION); + return 0; + }; + + int Timer::stop() + { + if (control.stop) + timeKillEvent(control.stop); + control.stop = 0; + return 0; + }; + + void kill_all_timer() + { + }; + + void sleepms(unsigned int ms) + { + // set the granularity of Sleep() for the application, that + // calls it so Sleep(1) will truly sleep for just a millisecond, + // rather than the default 10! + // See: http://www.geisswerks.com/ryan/FAQS/timing.html + timeBeginPeriod(1); + SleepEx(ms,false); + timeEndPeriod(1); + }; + +} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/mobigater b/src/mod/endpoints/mod_gsmopen/mobigater new file mode 120000 index 0000000000..cfea4c01b2 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/mobigater @@ -0,0 +1 @@ +alsa_nogsmlib_nocplusplus \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2008.vcproj b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2008.vcproj index 98c5d842ab..a57e518ddd 100644 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2008.vcproj +++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2008.vcproj @@ -1,7 +1,7 @@ + @@ -39,7 +42,7 @@ /> @@ -107,6 +110,7 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2010.vcxproj b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2010.vcxproj new file mode 100644 index 0000000000..bf4c80fd16 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2010.vcxproj @@ -0,0 +1,170 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_gsmopen + {74B120FF-6935-4DFE-A142-CDB6BEA99C90} + mod_skypiax + Win32Proj + + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) + NO_ALSA;%(PreprocessorDefinitions) + + + Level4 + false + + + gsmlib.lib ctbd-0.16.lib "..\..\..\..\w32\library\debug\freeswitchcore.lib" "..\..\..\..\libs\libteletone\Debug\libteletone.lib" ksuser.lib "..\..\..\..\libs\win32\apr\debug\libapr-1.lib" +rpcrt4.lib "..\..\..\..\debug\libtiff.lib" "..\..\..\..\libs\spandsp\src\debug\spandsp.lib" %(AdditionalOptions) + gsmlib\gsmlib-1.10-patched-13ubuntu\win32\Debug;libctb-0.16\lib;%(AdditionalLibraryDirectories) + false + + + + + + + gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) + + + + + rpcrt4.lib %(AdditionalOptions) + false + + + + + + + X64 + + + gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) + NO_ALSA;%(PreprocessorDefinitions) + + + Level4 + false + + + gsmlib.lib ctbd-0.16.lib "..\..\..\..\w32\library\debug\freeswitchcore.lib" "..\..\..\..\libs\libteletone\Debug\libteletone.lib" ksuser.lib "..\..\..\..\libs\win32\apr\debug\libapr-1.lib" +rpcrt4.lib "..\..\..\..\debug\libtiff.lib" "..\..\..\..\libs\spandsp\src\debug\spandsp.lib" %(AdditionalOptions) + gsmlib\gsmlib-1.10-patched-13ubuntu\win32\Debug;libctb-0.16\lib;%(AdditionalLibraryDirectories) + false + + + MachineX64 + + + + + X64 + + + gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) + + + + + rpcrt4.lib %(AdditionalOptions) + false + + + MachineX64 + + + + + + + + + + + + {26c82fce-e0cf-4d10-a00c-d8e582ffeb53} + + + + + + \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp index 7db2452a95..837d20ed30 100644 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp +++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2011, Anthony Minessale II + * Copyright (C) 2005-2011, Anthony Minessale II * * Version: MPL 1.1 * @@ -23,14 +23,11 @@ * * This module (mod_gsmopen) has been contributed by: * - * Giovanni Maruzzelli (gmaruzz@gmail.com) + * Giovanni Maruzzelli * + * Maintainer: Giovanni Maruzzelli * - * Further Contributors: - * - * - * - * mod_gsmopen.c -- GSM compatible Endpoint Module + * mod_gsmopen.cpp -- GSM Modem compatible Endpoint Module * */ @@ -83,14 +80,13 @@ int gettimeofday(struct timeval *tv, struct sk_timezone *tz) /***************/ #endif /* WIN32 */ #endif //0 -SWITCH_BEGIN_EXTERN_C -SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load); +SWITCH_BEGIN_EXTERN_C SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown); SWITCH_MODULE_DEFINITION(mod_gsmopen, mod_gsmopen_load, mod_gsmopen_shutdown, NULL); SWITCH_END_EXTERN_C #define GSMOPEN_CHAT_PROTO "sms" #if 1 -SWITCH_STANDARD_API(gsm_function); + SWITCH_STANDARD_API(gsm_function); /* BEGIN: Changes here */ #define GSM_SYNTAX "list [full] || console || AT_command || remove < interface_name | interface_id > || reload" /* END: Changes heres */ @@ -123,6 +119,7 @@ const char *interface_status[] = { /* should match GSMOPEN_STATE_xxx in gsmopen. "HANG_RQ", "PREANSW" }; + const char *phone_callflow[] = { /* should match CALLFLOW_XXX in gsmopen.h */ "CALL_IDLE", "CALL_DOWN", @@ -153,7 +150,6 @@ const char *phone_callflow[] = { /* should match CALLFLOW_XXX in gsmopen.h */ "STATUS_RMTEHOLD" }; - static struct { int debug; char *ip; @@ -210,9 +206,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id); static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id); static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig); -static switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *session); +static switch_status_t gsmopen_tech_init(private_t *tech_pvt, switch_core_session_t *session); -static switch_status_t gsmopen_codec(private_t * tech_pvt, int sample_rate, int codec_ms) +static switch_status_t gsmopen_codec(private_t *tech_pvt, int sample_rate, int codec_ms) { switch_core_session_t *session = NULL; @@ -249,14 +245,9 @@ static switch_status_t gsmopen_codec(private_t * tech_pvt, int sample_rate, int } -switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *session) +switch_status_t gsmopen_tech_init(private_t *tech_pvt, switch_core_session_t *session) { -#ifdef WANT_SPEEX - int ciapa; - long level; - int tmp; -#endif// WANT_SPEEX switch_assert(tech_pvt != NULL); switch_assert(session != NULL); tech_pvt->read_frame.data = tech_pvt->databuf; @@ -275,27 +266,16 @@ switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *s } //teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, tech_pvt->read_codec.implementation->actual_samples_per_second); //teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, 8000); - dtmf_rx_init(&tech_pvt->dtmf_state, NULL, NULL); - dtmf_rx_parms(&tech_pvt->dtmf_state, 0, 10, 10, -99); + dtmf_rx_init(&tech_pvt->dtmf_state, NULL, NULL); + dtmf_rx_parms(&tech_pvt->dtmf_state, 0, 10, 10, -99); -#ifdef GSMOPEN_ALSA - if(tech_pvt->no_sound==0){ - if (alsa_init(tech_pvt)) { - ERRORA("alsa_init failed\n", GSMOPEN_P_LOG); + if (tech_pvt->no_sound == 0) { + if (serial_audio_init(tech_pvt)) { + ERRORA("serial_audio_init failed\n", GSMOPEN_P_LOG); return SWITCH_STATUS_FALSE; } } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if(tech_pvt->no_sound==0){ - if (gsmopen_portaudio_init(tech_pvt)) { - ERRORA("gsmopen_portaudio_init failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - - } - } -#endif// GSMOPEN_PORTAUDIO if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, gsmopen_module_pool) != SWITCH_STATUS_SUCCESS) { @@ -313,98 +293,9 @@ switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *s switch_core_timer_sync(&tech_pvt->timer_write); -#ifdef WANT_SPEEX - /* Echo canceller with 100 ms tail length */ -#ifndef GIOVA48 - tech_pvt->echo_state = speex_echo_state_init(160, 1024); - ciapa = 8000; -#else// GIOVA48 - tech_pvt->echo_state = speex_echo_state_init(960, 4800); - ciapa = 48000; -#endif // GIOVA48 - speex_echo_ctl(tech_pvt->echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &ciapa); - -#if 1 //NO MORE - /* Setup preprocessor and associate with echo canceller for residual echo suppression */ -#ifndef GIOVA48 - tech_pvt->preprocess = speex_preprocess_state_init(160, 8000); -#else// GIOVA48 - tech_pvt->preprocess = speex_preprocess_state_init(960, 48000); -#endif // GIOVA48 - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_ECHO_STATE, - tech_pvt->echo_state); - -#if 0 - /* Setup preprocessor various other goodies */ - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_AGC, &tmp); - //level=8000.1; - //speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_AGC_LEVEL, &level); - - // Let's turn off all of the 'denoisers' (eg denoise and dereverb, and vad too) because they start automatic gain on mic input on cm108 usb, also if it (the agc on usb) disbled through mixer - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DEREVERB, &tmp); - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_VAD, &tmp); -#endif - - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC, &tmp); - fprintf(stderr, "AGC is: %d\n", tmp); - level = 1.0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_LEVEL, &level); - fprintf(stderr, "AGC_LEVEL is: %f\n", level); - //tmp=1; - //speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_TARGET, &tmp); - //fprintf( stderr, "AGC_TARGET is: %d\n", tmp ); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_DENOISE, &tmp); - fprintf(stderr, "DENOISE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_DEREVERB, &tmp); - fprintf(stderr, "DEREVERB is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_VAD, &tmp); - fprintf(stderr, "VAD is: %d\n", tmp); - -#if 0 - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_NOISE_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_NOISE_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE, - &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_MAX_GAIN, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_INCREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_DECREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_PROB_START, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_START is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_PROB_CONTINUE, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_CONTINUE is: %d\n", tmp); -#endif //0 -#endif// 0 //NO MORE - -#endif // WANT_SPEEX - - - + switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_HANGUP); + switch_mutex_unlock(tech_pvt->flag_mutex); DEBUGA_GSMOPEN("gsmopen_codec SUCCESS\n", GSMOPEN_P_LOG); return SWITCH_STATUS_SUCCESS; } @@ -436,7 +327,6 @@ static switch_status_t interface_exists(char *the_interface) } } else { /* look by gsmopen_user */ - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { if (strlen(globals.GSMOPEN_INTERFACES[i].gsmopen_user)) { if (strcmp(globals.GSMOPEN_INTERFACES[i].gsmopen_user, the_interface) == 0) { @@ -452,38 +342,42 @@ static switch_status_t interface_exists(char *the_interface) static switch_status_t remove_interface(char *the_interface) { int x = 10; +#ifdef WIN32 + switch_size_t howmany = 8; +#else unsigned int howmany = 8; +#endif + int interface_id = -1; private_t *tech_pvt = NULL; switch_status_t status; //running = 0; + //XXX if (*the_interface == '#') { /* remove by interface id or interface name */ + //XXX the_interface++; + switch_assert(the_interface); + interface_id = atoi(the_interface); - //XXX if (*the_interface == '#') { /* remove by interface id or interface name */ - //XXX the_interface++; - switch_assert(the_interface); - interface_id = atoi(the_interface); + if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { + /* take a number as interface id */ + tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + } else { - if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { - /* take a number as interface id */ - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - } else { - - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - break; - } + for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { + if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { + tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + break; } } - //XXX } //else { /* remove by gsmopen_user */ - //for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - //if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].gsmopen_user, the_interface) == 0) { - //tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - //break; - //} - //} + } + //XXX } //else { /* remove by gsmopen_user */ + //for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { + //if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].gsmopen_user, the_interface) == 0) { + //tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; + //break; + //} + //} //} if (!tech_pvt) { @@ -584,7 +478,9 @@ static switch_status_t channel_on_init(switch_core_session_t *session) channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); //ERRORA("%s CHANNEL INIT\n", GSMOPEN_P_LOG, tech_pvt->name); + switch_mutex_lock(tech_pvt->flag_mutex); switch_set_flag(tech_pvt, TFLAG_IO); + switch_mutex_unlock(tech_pvt->flag_mutex); /* Move channel's state machine to ROUTING. This means the call is trying to get from the initial start where the call because, to the point @@ -606,7 +502,6 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session) tech_pvt = (private_t *) switch_core_session_get_private(session); - if (tech_pvt) { DEBUGA_GSMOPEN("%s CHANNEL DESTROY %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); @@ -621,20 +516,9 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session) switch_core_timer_destroy(&tech_pvt->timer_read); switch_core_timer_destroy(&tech_pvt->timer_write); -#ifdef GSMOPEN_ALSA - if(tech_pvt->no_sound==0){ - alsa_shutdown(tech_pvt); - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if(tech_pvt->no_sound==0){ - if (gsmopen_portaudio_shutdown(tech_pvt)) { - ERRORA("gsmopen_portaudio_shutdown failed\n", GSMOPEN_P_LOG); - + if (tech_pvt->no_sound == 0) { + serial_audio_shutdown(tech_pvt); } - } -#endif// GSMOPEN_PORTAUDIO - *tech_pvt->session_uuid_str = '\0'; tech_pvt->interface_state = GSMOPEN_STATE_IDLE; @@ -654,7 +538,6 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session) switch_channel_t *channel = NULL; private_t *tech_pvt = NULL; - channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); @@ -671,11 +554,12 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session) } } - DEBUGA_GSMOPEN("%s CHANNEL HANGUP\n", GSMOPEN_P_LOG, tech_pvt->name); + switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_IO); switch_clear_flag(tech_pvt, TFLAG_VOICE); switch_set_flag(tech_pvt, TFLAG_HANGUP); + switch_mutex_unlock(tech_pvt->flag_mutex); gsmopen_hangup(tech_pvt); @@ -745,18 +629,18 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int switch (sig) { case SWITCH_SIG_KILL: DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_KILL\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - //switch_mutex_lock(tech_pvt->flag_mutex); + switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_IO); switch_clear_flag(tech_pvt, TFLAG_VOICE); switch_set_flag(tech_pvt, TFLAG_HANGUP); - //switch_mutex_unlock(tech_pvt->flag_mutex); + switch_mutex_unlock(tech_pvt->flag_mutex); break; case SWITCH_SIG_BREAK: DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_BREAK\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); //switch_set_flag(tech_pvt, TFLAG_BREAK); - //switch_mutex_lock(tech_pvt->flag_mutex); + switch_mutex_lock(tech_pvt->flag_mutex); switch_set_flag(tech_pvt, TFLAG_BREAK); - //switch_mutex_unlock(tech_pvt->flag_mutex); + switch_mutex_unlock(tech_pvt->flag_mutex); break; default: break; @@ -764,6 +648,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int return SWITCH_STATUS_SUCCESS; } + static switch_status_t channel_on_consume_media(switch_core_session_t *session) { private_t *tech_pvt = NULL; @@ -774,7 +659,6 @@ static switch_status_t channel_on_consume_media(switch_core_session_t *session) return SWITCH_STATUS_SUCCESS; } - static switch_status_t channel_on_exchange_media(switch_core_session_t *session) { private_t *tech_pvt = NULL; @@ -809,18 +693,11 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch switch_channel_t *channel = NULL; private_t *tech_pvt = NULL; switch_byte_t *data; -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - int samples; - char digit_str[256]; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) -#ifdef GSMOPEN_PORTAUDIO -#ifdef WANT_SPEEX - spx_int16_t *speexptr; - spx_int16_t pcm2[160]; - int i; -#endif// GSMOPEN_ALSA -#endif// WANT_SPEEX + int samples; + int samples2; + char digit_str[256]; + char buffer2[640]; channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); @@ -834,7 +711,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch return SWITCH_STATUS_FALSE; } - tech_pvt->read_frame.flags = SFF_NONE; *frame = NULL; @@ -842,84 +718,58 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch return SWITCH_STATUS_FALSE; } -#ifndef GSMOPEN_PORTAUDIO switch_core_timer_next(&tech_pvt->timer_read); -#endif// GSMOPEN_PORTAUDIO - if(tech_pvt->no_sound==1){ + if (tech_pvt->no_sound) { goto cng; + } + samples = tech_pvt->serialPort_serial_audio->Read(buffer2, 640); + + if (samples >= 320) { + tech_pvt->buffer2_full = 0; + + if (samples >= 640) { + DEBUGA_GSMOPEN("read more than 320, samples=%d\n", GSMOPEN_P_LOG, samples); + memcpy(tech_pvt->buffer2, buffer2 + 320, 320); + tech_pvt->buffer2_full = 1; + } + samples = 320; + memcpy(tech_pvt->read_frame.data, buffer2, 320); + } else { + if (samples != 0) { + DEBUGA_GSMOPEN("read less than 320, samples=%d\n", GSMOPEN_P_LOG, samples); + } + if (tech_pvt->buffer2_full) { + memcpy(tech_pvt->read_frame.data, tech_pvt->buffer2, 320); + tech_pvt->buffer2_full = 0; + samples = 320; + DEBUGA_GSMOPEN("samples=%d FROM BUFFER\n", GSMOPEN_P_LOG, samples); } -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) -#ifdef GSMOPEN_ALSA - //if ((samples = snd_pcm_readi(tech_pvt->alsac, tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) - if ((samples = alsa_read(tech_pvt, (short *) tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if ((samples = gsmopen_portaudio_read(tech_pvt, (short *) tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) -#endif// GSMOPEN_PORTAUDIO - { -#ifdef GSMOPEN_PORTAUDIO -#ifdef WANT_SPEEX - - if (tech_pvt->speexecho) { - speexptr = ((spx_int16_t *) tech_pvt->read_frame.data); - /* Perform echo cancellation */ - speex_echo_capture(tech_pvt->echo_state, speexptr, pcm2); -#ifndef GIOVA48 - for (i = 0; i < 160; i++) -#else //GIOVA48 - for (i = 0; i < 960; i++) -#endif //GIOVA48 - speexptr[i] = pcm2[i]; - } - /* Apply noise/echo residual suppression */ - if (tech_pvt->speexpreprocess) { - speex_preprocess_run(tech_pvt->preprocess, speexptr); - } - - DEBUGA_GSMOPEN("read\n", GSMOPEN_P_LOG); -#endif //WANT_SPEEX -#endif // GSMOPEN_PORTAUDIO - - - - - - tech_pvt->read_frame.datalen = samples * 2; - tech_pvt->read_frame.samples = samples; - -#ifndef GSMOPEN_PORTAUDIO - tech_pvt->read_frame.timestamp = tech_pvt->timer_read.samplecount; -#endif// GSMOPEN_PORTAUDIO - - *frame = &tech_pvt->read_frame; - - //status = SWITCH_STATUS_SUCCESS; - switch_set_flag(tech_pvt, TFLAG_VOICE); } - //WARNINGA("samples=%d\n", GSMOPEN_P_LOG, samples); - if (samples != 160) { - ERRORA("samples=%d\n", GSMOPEN_P_LOG, samples); + tech_pvt->read_frame.datalen = samples; + tech_pvt->read_frame.samples = samples / 2; + tech_pvt->read_frame.timestamp = tech_pvt->timer_read.samplecount; + + *frame = &tech_pvt->read_frame; + + switch_mutex_lock(tech_pvt->flag_mutex); + switch_set_flag(tech_pvt, TFLAG_VOICE); + switch_mutex_unlock(tech_pvt->flag_mutex); + + if (samples != 320) { + if (samples != 0) { + DEBUGA_GSMOPEN("samples=%d, goto cng\n", GSMOPEN_P_LOG, samples); + } goto cng; } -//DEBUGA_GSMOPEN("samples=%d tech_pvt->read_frame.timestamp=%d\n", GSMOPEN_P_LOG, samples, tech_pvt->read_frame.timestamp); - -//usleep(17000); -//usleep(17000); - - - - memset(digit_str, 0, sizeof(digit_str)); - //teletone_dtmf_detect(&tech_pvt->dtmf_detect, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); - //teletone_dtmf_get(&tech_pvt->dtmf_detect, digit_str, sizeof(digit_str)); - dtmf_rx(&tech_pvt->dtmf_state, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); - dtmf_rx_get(&tech_pvt->dtmf_state, digit_str, sizeof(digit_str)); + dtmf_rx(&tech_pvt->dtmf_state, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); + dtmf_rx_get(&tech_pvt->dtmf_state, digit_str, sizeof(digit_str)); - gsmopen_sound_boost(tech_pvt->read_frame.data, tech_pvt->read_frame.samples, tech_pvt->capture_boost); + gsmopen_sound_boost(tech_pvt->read_frame.data, tech_pvt->read_frame.samples, tech_pvt->capture_boost); if (digit_str[0]) { switch_time_t new_dtmf_timestamp = switch_time_now(); @@ -928,21 +778,23 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch switch_channel_t *channel = switch_core_session_get_channel(session); while (p && *p) { - switch_dtmf_t dtmf = {0}; + switch_dtmf_t dtmf = { 0 }; dtmf.digit = *p; dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; switch_channel_queue_dtmf(channel, &dtmf); p++; } - NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", GSMOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, - (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); + DEBUGA_GSMOPEN("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", GSMOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, + (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp; } } while (switch_test_flag(tech_pvt, TFLAG_IO)) { if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { + switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_BREAK); - DEBUGA_GSMOPEN("CHANNEL READ FRAME goto CNG\n", GSMOPEN_P_LOG); + switch_mutex_unlock(tech_pvt->flag_mutex); + DEBUGA_GSMOPEN("BREAK: CHANNEL READ FRAME goto CNG\n", GSMOPEN_P_LOG); goto cng; } @@ -952,7 +804,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch } if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { + switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_VOICE); + switch_mutex_unlock(tech_pvt->flag_mutex); if (!tech_pvt->read_frame.datalen) { DEBUGA_GSMOPEN("CHANNEL READ CONTINUE\n", GSMOPEN_P_LOG); continue; @@ -960,14 +814,13 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch *frame = &tech_pvt->read_frame; #ifdef BIGENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { - switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2); + switch_swap_linear((int16_t *) (*frame)->data, (int) (*frame)->datalen / 2); } #endif - //WARNINGA("HERE\n", GSMOPEN_P_LOG); + //DEBUGA_GSMOPEN("HERE\n", GSMOPEN_P_LOG); return SWITCH_STATUS_SUCCESS; } - WARNINGA("HERE\n", GSMOPEN_P_LOG); DEBUGA_GSMOPEN("CHANNEL READ no TFLAG_VOICE\n", GSMOPEN_P_LOG); return SWITCH_STATUS_FALSE; @@ -975,7 +828,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch DEBUGA_GSMOPEN("CHANNEL READ FALSE\n", GSMOPEN_P_LOG); return SWITCH_STATUS_FALSE; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) cng: data = (switch_byte_t *) tech_pvt->read_frame.data; data[0] = 65; @@ -983,9 +835,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch tech_pvt->read_frame.datalen = 2; tech_pvt->read_frame.flags = SFF_CNG; *frame = &tech_pvt->read_frame; -#ifdef GSMOPEN_PORTAUDIO - //speex_echo_state_reset(tech_pvt->stream->echo_state); -#endif // GSMOPEN_PORTAUDIO return SWITCH_STATUS_SUCCESS; } @@ -994,14 +843,8 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc { switch_channel_t *channel = NULL; private_t *tech_pvt = NULL; -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + unsigned int sent; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) -#ifdef GSMOPEN_PORTAUDIO -#ifdef WANT_SPEEX - spx_int16_t *speexptr; -#endif// GSMOPEN_ALSA -#endif// WANT_SPEEX channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); @@ -1017,7 +860,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc #ifdef BIGENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { #ifdef WIN32 - switch_swap_linear((int16_t *)frame->data, (int) frame->datalen / 2); + switch_swap_linear((int16_t *) frame->data, (int) frame->datalen / 2); #else switch_swap_linear(frame->data, (int) frame->datalen / 2); #endif //WIN32 @@ -1025,40 +868,14 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc #endif //switch_core_timer_next(&tech_pvt->timer_write); - //sent = frame->datalen; - - //ERRORA("PLAY \n", GSMOPEN_P_LOG); - //snd_pcm_writei(tech_pvt->alsap, (short *) frame->data, (int) (frame->datalen / 2)); - gsmopen_sound_boost(frame->data, frame->samples, tech_pvt->playback_boost); -#ifdef GSMOPEN_ALSA - - switch_core_timer_next(&tech_pvt->timer_write); - sent = alsa_write(tech_pvt, (short *) frame->data, (int) (frame->datalen)); -//DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent); + if (!tech_pvt->no_sound) { + sent = tech_pvt->serialPort_serial_audio->Write((char *) frame->data, (int) (frame->datalen)); - if (sent && sent != frame->datalen / 2 && sent != -1) { - DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent); + if (sent && sent != frame->datalen && sent != -1) { + DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent); + } } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - sent = gsmopen_portaudio_write(tech_pvt, (short *) frame->data, (int) (frame->datalen)); -//DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent); - - if (sent && sent != frame->datalen / 2 && sent != -1) { - DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent); - } - -#ifdef WANT_SPEEX - if (tech_pvt->speexecho) { - speexptr = (spx_int16_t *) frame->data; - /* Put frame into playback buffer */ - speex_echo_playback(tech_pvt->echo_state, speexptr); - DEBUGA_GSMOPEN("write\n", GSMOPEN_P_LOG); - } -#endif //WANT_SPEEX -#endif // GSMOPEN_PORTAUDIO - //NOTICA("sent=%d\n", GSMOPEN_P_LOG, sent); return SWITCH_STATUS_SUCCESS; } @@ -1074,14 +891,12 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session) switch_assert(tech_pvt != NULL); //ERRORA("%s CHANNEL INIT\n", GSMOPEN_P_LOG, tech_pvt->name); + switch_mutex_lock(tech_pvt->flag_mutex); switch_set_flag(tech_pvt, TFLAG_IO); + switch_mutex_unlock(tech_pvt->flag_mutex); + gsmopen_serial_answer(tech_pvt); - /* Move channel's state machine to ROUTING. This means the call is trying - to get from the initial start where the call because, to the point - where a destination has been identified. If the channel is simply - left in the initial state, nothing will happen. */ - switch_channel_set_state(channel, CS_ROUTING); switch_mutex_lock(globals.mutex); globals.calls++; @@ -1089,19 +904,9 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session) DEBUGA_GSMOPEN("%s CHANNEL ANSWER %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); - - - - - - - - - - - - - + if (channel) { + switch_channel_mark_answered(channel); + } DEBUGA_GSMOPEN("ANSWERED! \n", GSMOPEN_P_LOG); @@ -1112,10 +917,6 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s { switch_channel_t *channel; private_t *tech_pvt; -#if defined(GSMOPEN_ALSA) - int samples; - short tmp_buffer[1280]; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); @@ -1126,8 +927,21 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s switch (msg->message_id) { case SWITCH_MESSAGE_INDICATE_ANSWER: { - DEBUGA_GSMOPEN("MSG_ID=%d, TO BE ANSWERED!\n", GSMOPEN_P_LOG, msg->message_id); - channel_answer_channel(session); + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_ANSWER\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + if (tech_pvt->interface_state != GSMOPEN_STATE_UP && tech_pvt->phone_callflow != CALLFLOW_CALL_ACTIVE) { + DEBUGA_GSMOPEN("MSG_ID=%d, TO BE ANSWERED!\n", GSMOPEN_P_LOG, msg->message_id); + channel_answer_channel(session); + } + } + break; + + case SWITCH_MESSAGE_INDICATE_PROGRESS: + { + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_PROGRESS\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + if (tech_pvt->interface_state != GSMOPEN_STATE_UP && tech_pvt->phone_callflow != CALLFLOW_CALL_ACTIVE) { + DEBUGA_GSMOPEN("MSG_ID=%d, TO BE ANSWERED!\n", GSMOPEN_P_LOG, msg->message_id); + channel_answer_channel(session); + } } break; case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC: @@ -1136,25 +950,22 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s switch_core_timer_sync(&tech_pvt->timer_read); switch_core_timer_sync(&tech_pvt->timer_write); -#ifdef GSMOPEN_ALSA - while ((samples = alsa_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 4)) > 160) { - //WARNINGA("read %d samples\n", GSMOPEN_P_LOG, samples); - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - //while ((samples = gsmopen_portaudio_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 2)) > 160) { - //WARNINGA("read %d samples\n", GSMOPEN_P_LOG, samples); - //} -#ifdef WANT_SPEEX - speex_echo_state_reset(tech_pvt->echo_state); -#endif// WANT_SPEEX -#endif// GSMOPEN_PORTAUDIO break; - + case SWITCH_MESSAGE_INDICATE_TRANSFER: + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_TRANSFER\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + break; + case SWITCH_MESSAGE_INDICATE_BRIDGE: + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_BRIDGE\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + break; + case SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY: + DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); + break; default: { - DEBUGA_GSMOPEN("MSG_ID=%d\n", GSMOPEN_P_LOG, msg->message_id); + if (msg->message_id != SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC && msg->message_id != SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE) { + DEBUGA_GSMOPEN("MSG_ID=%d\n", GSMOPEN_P_LOG, msg->message_id); + } } break; } @@ -1219,7 +1030,6 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi DEBUGA_GSMOPEN("1 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); switch_core_session_add_stream(*new_session, NULL); - if (!zstr(outbound_profile->destination_number)) { int i; char *slash; @@ -1296,7 +1106,6 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } - if (outbound_profile) { char name[128]; @@ -1324,7 +1133,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi caller_profile = tech_pvt->caller_profile; caller_profile->destination_number = rdest; + switch_mutex_lock(tech_pvt->flag_mutex); switch_set_flag(tech_pvt, TFLAG_OUTBOUND); + switch_mutex_unlock(tech_pvt->flag_mutex); switch_channel_set_state(channel, CS_INIT); gsmopen_call(tech_pvt, rdest, 30); switch_mutex_unlock(globals.mutex); @@ -1346,6 +1157,23 @@ static switch_status_t load_config(int reload_type) switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; private_t *tech_pvt = NULL; +#ifdef WIN32 + DEBUGA_GSMOPEN("Windows CODEPAGE Input =%d\n", GSMOPEN_P_LOG, GetConsoleCP()); + SetConsoleCP(65001); + DEBUGA_GSMOPEN("Windows CODEPAGE Input =%d\n", GSMOPEN_P_LOG, GetConsoleCP()); + DEBUGA_GSMOPEN("Windows CODEPAGE Output =%d\n", GSMOPEN_P_LOG, GetConsoleOutputCP()); + SetConsoleOutputCP(65001); + DEBUGA_GSMOPEN("Windows CODEPAGE Output =%d\n", GSMOPEN_P_LOG, GetConsoleOutputCP()); + //let's hope to have unicode in console now. You need to use Lucida Console or, much better, Courier New font for the command prompt to show unicode +#endif // WIN32 + NOTICA("GSMOPEN Charset Output Test 0 %s\n", GSMOPEN_P_LOG, "èéòàù"); + NOTICA("GSMOPEN Charset Output Test 1 %s\n", GSMOPEN_P_LOG, "ç°§^£"); + NOTICA("GSMOPEN Charset Output Test 2 %s\n", GSMOPEN_P_LOG, "новоÑти"); + NOTICA("GSMOPEN Charset Output Test 3 %s\n", GSMOPEN_P_LOG, "ﺎﻠﺠﻤﻋﺓ"); + NOTICA("GSMOPEN Charset Output Test 4 %s\n", GSMOPEN_P_LOG, "ר×ת"); + NOTICA("GSMOPEN Charset Output Test 5 %s\n", GSMOPEN_P_LOG, "לק"); + NOTICA("GSMOPEN Charset Output Test 6 %s\n", GSMOPEN_P_LOG, "人大"); + switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, gsmopen_module_pool); if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { ERRORA("open of %s failed\n", GSMOPEN_P_LOG, cf); @@ -1391,7 +1219,8 @@ static switch_status_t load_config(int reload_type) const char *context = "default"; const char *dialplan = "XML"; const char *destination = "5000"; - const char *controldevice_name = "/dev/ttyACM0"; + const char *controldevice_name = "/dev/ttyUSB3"; + const char *controldevice_audio_name = "/dev/ttyUSB2"; char *digit_timeout = NULL; char *max_digits = NULL; char *hotline = NULL; @@ -1400,7 +1229,6 @@ static switch_status_t load_config(int reload_type) char *fail_dial_regex = NULL; const char *enable_callerid = "true"; - const char *at_dial_pre_number = "ATD"; const char *at_dial_post_number = ";"; const char *at_dial_expect = "OK"; @@ -1408,7 +1236,7 @@ static switch_status_t load_config(int reload_type) const char *at_hangup_expect = "OK"; const char *at_answer = "ATA"; const char *at_answer_expect = "OK"; - const char *at_send_dtmf = "AT+VTS"; + const char *at_send_dtmf = "AT^DTMF"; const char *at_preinit_1 = ""; const char *at_preinit_1_expect = ""; const char *at_preinit_2 = ""; @@ -1427,17 +1255,17 @@ static switch_status_t load_config(int reload_type) const char *at_postinit_3_expect = "OK"; const char *at_postinit_4 = "at+sidet=0"; const char *at_postinit_4_expect = "OK"; - const char *at_postinit_5 = "at+clvl=99"; + const char *at_postinit_5 = "at+clvl=3"; const char *at_postinit_5_expect = "OK"; const char *at_query_battchg = "AT+CBC"; const char *at_query_battchg_expect = "OK"; const char *at_query_signal = "AT+CSQ"; const char *at_query_signal_expect = "OK"; const char *at_call_idle = "+MCST: 1"; - const char *at_call_incoming = "+MCST: 2"; - const char *at_call_active = "+CSSI: 7"; + const char *at_call_incoming = "RING"; + const char *at_call_active = "^CONN:1,0"; const char *at_call_failed = "+MCST: 65"; - const char *at_call_calling = "+CSSI: 1"; + const char *at_call_calling = "^ORIG:1,0"; const char *at_indicator_noservice_string = "CIEV: 2;0"; const char *at_indicator_nosignal_string = "CIEV: 5;0"; const char *at_indicator_lowsignal_string = "CIEV: 5;1"; @@ -1450,42 +1278,27 @@ static switch_status_t load_config(int reload_type) const char *at_indicator_callsetupoutgoing_string = "CIEV: 6;2"; const char *at_indicator_callsetupremoteringing_string = "CIEV: 6;3"; //const char *sms_receiving_program = "/usr/local/bin/ciapalo"; - const char *alsacname = "plughw:1"; - const char *alsapname = "plughw:1"; const char *at_early_audio = "0"; const char *at_after_preinit_pause = "500000"; const char *at_initial_pause = "500000"; const char *at_has_clcc = "0"; const char *at_has_ecam = "0"; - const char *alsa_period_size = "160"; - const char *alsa_periods_in_buffer = "4"; const char *gsmopen_sound_rate = "8000"; - const char *alsa_play_is_mono = "1"; - const char *alsa_capture_is_mono = "1"; - const char *capture_boost = "5"; - const char *playback_boost = "10"; -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) + const char *capture_boost = "0"; + const char *playback_boost = "0"; const char *no_sound = "0"; -#else - const char *no_sound = "1"; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) const char *portaudiocindex = "1"; const char *portaudiopindex = "1"; const char *speexecho = "1"; const char *speexpreprocess = "1"; uint32_t interface_id = 0; -#ifdef WIN32 int controldevice_speed = 115200; //FIXME TODO -#else - uint32_t controldevice_speed = B115200; //FIXME TODO -#endif //WIN32 + int controldevice_audio_speed = 115200; //FIXME TODO uint32_t controldevprotocol = PROTOCOL_AT; //FIXME TODO uint32_t running = 1; //FIXME TODO const char *gsmopen_serial_sync_period = "300"; //FIXME TODO - - tech_pvt = NULL; for (param = switch_xml_child(myinterface, "param"); param; param = param->next) { @@ -1504,6 +1317,8 @@ static switch_status_t load_config(int reload_type) destination = val; } else if (!strcasecmp(var, "controldevice_name")) { controldevice_name = val; + } else if (!strcasecmp(var, "controldevice_audio_name")) { + controldevice_audio_name = val; } else if (!strcasecmp(var, "digit_timeout")) { digit_timeout = val; } else if (!strcasecmp(var, "max_digits")) { @@ -1616,10 +1431,6 @@ static switch_status_t load_config(int reload_type) at_indicator_callsetupremoteringing_string = val; //} else if (!strcasecmp(var, "sms_receiving_program")) { //sms_receiving_program = val; - } else if (!strcasecmp(var, "alsacname")) { - alsacname = val; - } else if (!strcasecmp(var, "alsapname")) { - alsapname = val; } else if (!strcasecmp(var, "portaudiocindex")) { portaudiocindex = val; } else if (!strcasecmp(var, "portaudiopindex")) { @@ -1638,16 +1449,8 @@ static switch_status_t load_config(int reload_type) at_has_clcc = val; } else if (!strcasecmp(var, "at_has_ecam")) { at_has_ecam = val; - } else if (!strcasecmp(var, "alsa_period_size")) { - alsa_period_size = val; - } else if (!strcasecmp(var, "alsa_periods_in_buffer")) { - alsa_periods_in_buffer = val; } else if (!strcasecmp(var, "gsmopen_sound_rate")) { gsmopen_sound_rate = val; - } else if (!strcasecmp(var, "alsa_play_is_mono")) { - alsa_play_is_mono = val; - } else if (!strcasecmp(var, "alsa_capture_is_mono")) { - alsa_capture_is_mono = val; } else if (!strcasecmp(var, "capture_boost")) { capture_boost = val; } else if (!strcasecmp(var, "playback_boost")) { @@ -1658,7 +1461,6 @@ static switch_status_t load_config(int reload_type) gsmopen_serial_sync_period = val; } - } /* BEGIN: Changes here */ @@ -1705,27 +1507,10 @@ static switch_status_t load_config(int reload_type) ERRORA("interface param 'at_has_ecam' MUST be a number, now at_has_ecam='%s'\n", GSMOPEN_P_LOG, at_has_ecam); continue; } - if (!switch_is_number(alsa_period_size)) { - ERRORA("interface param 'alsa_period_size' MUST be a number, now alsa_period_size='%s'\n", GSMOPEN_P_LOG, alsa_period_size); - continue; - } - if (!switch_is_number(alsa_periods_in_buffer)) { - ERRORA("interface param 'alsa_periods_in_buffer' MUST be a number, now alsa_periods_in_buffer='%s'\n", GSMOPEN_P_LOG, - alsa_periods_in_buffer); - continue; - } if (!switch_is_number(gsmopen_sound_rate)) { ERRORA("interface param 'gsmopen_sound_rate' MUST be a number, now gsmopen_sound_rate='%s'\n", GSMOPEN_P_LOG, gsmopen_sound_rate); continue; } - if (!switch_is_number(alsa_play_is_mono)) { - ERRORA("interface param 'alsa_play_is_mono' MUST be a number, now alsa_play_is_mono='%s'\n", GSMOPEN_P_LOG, alsa_play_is_mono); - continue; - } - if (!switch_is_number(alsa_capture_is_mono)) { - ERRORA("interface param 'alsa_capture_is_mono' MUST be a number, now alsa_capture_is_mono='%s'\n", GSMOPEN_P_LOG, alsa_capture_is_mono); - continue; - } if (!switch_is_number(capture_boost)) { ERRORA("interface param 'capture_boost' MUST be a number, now capture_boost='%s'\n", GSMOPEN_P_LOG, capture_boost); continue; @@ -1739,11 +1524,11 @@ static switch_status_t load_config(int reload_type) continue; } if (!switch_is_number(gsmopen_serial_sync_period)) { - ERRORA("interface param 'gsmopen_serial_sync_period' MUST be a number, now gsmopen_serial_sync_period='%s'\n", GSMOPEN_P_LOG, gsmopen_serial_sync_period); + ERRORA("interface param 'gsmopen_serial_sync_period' MUST be a number, now gsmopen_serial_sync_period='%s'\n", GSMOPEN_P_LOG, + gsmopen_serial_sync_period); continue; } - if (interface_id && interface_id < GSMOPEN_MAX_INTERFACES) { private_t newconf; switch_threadattr_t *gsmopen_api_thread_attr = NULL; @@ -1752,11 +1537,10 @@ static switch_status_t load_config(int reload_type) memset(&newconf, '\0', sizeof(newconf)); globals.GSMOPEN_INTERFACES[interface_id] = newconf; - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; switch_mutex_init(&globals.GSMOPEN_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, gsmopen_module_pool); - + switch_mutex_init(&globals.GSMOPEN_INTERFACES[interface_id].controldev_audio_lock, SWITCH_MUTEX_NESTED, gsmopen_module_pool); switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].id, id); switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].name, name); @@ -1764,6 +1548,7 @@ static switch_status_t load_config(int reload_type) switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dialplan, dialplan); switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].destination, destination); switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].controldevice_name, controldevice_name); + switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].controldevice_audio_name, controldevice_audio_name); switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dial_regex, dial_regex); switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].hold_music, hold_music); switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].fail_dial_regex, fail_dial_regex); @@ -1817,46 +1602,20 @@ static switch_status_t load_config(int reload_type) switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, at_indicator_callsetupremoteringing_string); //switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].sms_receiving_program, sms_receiving_program); -#ifdef GSMOPEN_ALSA - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsacname, alsacname); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsapname, alsapname); -#endif// GSMOPEN_ALSA - -#ifdef GSMOPEN_PORTAUDIO - globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex = atoi(portaudiocindex); - globals.GSMOPEN_INTERFACES[interface_id].portaudiopindex = atoi(portaudiopindex); - globals.GSMOPEN_INTERFACES[interface_id].speexecho = atoi(speexecho); - globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess = atoi(speexpreprocess); -#endif// GSMOPEN_PORTAUDIO globals.GSMOPEN_INTERFACES[interface_id].at_early_audio = atoi(at_early_audio); globals.GSMOPEN_INTERFACES[interface_id].at_after_preinit_pause = atoi(at_after_preinit_pause); globals.GSMOPEN_INTERFACES[interface_id].at_initial_pause = atoi(at_initial_pause); globals.GSMOPEN_INTERFACES[interface_id].at_has_clcc = atoi(at_has_clcc); globals.GSMOPEN_INTERFACES[interface_id].at_has_ecam = atoi(at_has_ecam); -#ifdef GSMOPEN_ALSA - globals.GSMOPEN_INTERFACES[interface_id].alsa_period_size = atoi(alsa_period_size); - globals.GSMOPEN_INTERFACES[interface_id].alsa_periods_in_buffer = atoi(alsa_periods_in_buffer); - globals.GSMOPEN_INTERFACES[interface_id].gsmopen_sound_rate = atoi(gsmopen_sound_rate); - globals.GSMOPEN_INTERFACES[interface_id].alsa_play_is_mono = atoi(alsa_play_is_mono); - globals.GSMOPEN_INTERFACES[interface_id].alsa_capture_is_mono = atoi(alsa_capture_is_mono); -#endif// GSMOPEN_ALSA globals.GSMOPEN_INTERFACES[interface_id].capture_boost = atoi(capture_boost); globals.GSMOPEN_INTERFACES[interface_id].playback_boost = atoi(playback_boost); -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) globals.GSMOPEN_INTERFACES[interface_id].no_sound = atoi(no_sound); -#else - globals.GSMOPEN_INTERFACES[interface_id].no_sound = 1; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period = atoi(gsmopen_serial_sync_period); - - + globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period = atoi(gsmopen_serial_sync_period); globals.GSMOPEN_INTERFACES[interface_id].controldevice_speed = controldevice_speed; //FIXME globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol = controldevprotocol; //FIXME globals.GSMOPEN_INTERFACES[interface_id].running = running; //FIXME - - WARNINGA("STARTING interface_id=%d\n", GSMOPEN_P_LOG, interface_id); DEBUGA_GSMOPEN("id=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].id); DEBUGA_GSMOPEN("name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].name); @@ -1865,24 +1624,10 @@ static switch_status_t load_config(int reload_type) DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].dialplan); DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].destination); DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].controldevice_name); -#ifdef GSMOPEN_ALSA - DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsacname); - DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsapname); -#endif// GSMOPEN_ALSA + DEBUGA_GSMOPEN("controldevice_audio_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].controldevice_audio_name); + DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, + (int) globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period); - -#ifdef GSMOPEN_PORTAUDIO - //FIXME - //globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex = 1; - //globals.GSMOPEN_INTERFACES[interface_id].portaudiopindex = 1; - //globals.GSMOPEN_INTERFACES[interface_id].speexecho = 1; - //globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess = 1; - DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex); - DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex); - DEBUGA_GSMOPEN("speexecho=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].speexecho); - DEBUGA_GSMOPEN("speexpreprocess=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess); -#endif// GSMOPEN_PORTAUDIO - DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int)globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period); /* init the serial port */ if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) { globals.GSMOPEN_INTERFACES[interface_id].controldevfd = @@ -1891,10 +1636,10 @@ static switch_status_t load_config(int reload_type) ERRORA("gsmopen_serial_init failed\n", GSMOPEN_P_LOG); ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; + globals.GSMOPEN_INTERFACES[interface_id].running = 0; alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + globals.GSMOPEN_INTERFACES[interface_id].active = 0; + globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; continue; } } @@ -1905,8 +1650,8 @@ static switch_status_t load_config(int reload_type) if (res) { int count = 0; ERRORA("gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG); - while(res && count < 5){ - switch_sleep(100000); //0.1 seconds + while (res && count < 5) { + switch_sleep(100000); //0.1 seconds res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]); count++; if (res) { @@ -1916,69 +1661,43 @@ static switch_status_t load_config(int reload_type) if (res) { ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; + globals.GSMOPEN_INTERFACES[interface_id].running = 0; alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_config failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + globals.GSMOPEN_INTERFACES[interface_id].active = 0; + globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; continue; } } } - if(globals.GSMOPEN_INTERFACES[interface_id].no_sound==0){ -#ifdef GSMOPEN_ALSA - if (alsa_init(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("alsa_init failed\n", GSMOPEN_P_LOG); + if (globals.GSMOPEN_INTERFACES[interface_id].no_sound == 0) { + if (serial_audio_init(&globals.GSMOPEN_INTERFACES[interface_id])) { + ERRORA("serial_audio_init failed\n", GSMOPEN_P_LOG); ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "alsa_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + globals.GSMOPEN_INTERFACES[interface_id].running = 0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "serial_audio_init failed"); + globals.GSMOPEN_INTERFACES[interface_id].active = 0; + globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; continue; } - if (alsa_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); + if (serial_audio_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { + ERRORA("serial_audio_shutdown failed\n", GSMOPEN_P_LOG); ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "alsa_shutdown failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if (gsmopen_portaudio_init(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("gsmopen_portaudio_init failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_portaudio_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; + globals.GSMOPEN_INTERFACES[interface_id].running = 0; + alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "serial_audio_shutdown failed"); + globals.GSMOPEN_INTERFACES[interface_id].active = 0; + globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; continue; } - if (gsmopen_portaudio_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("gsmopen_portaudio_shutdown failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_portaudio_shutdown failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - - } -#endif// GSMOPEN_PORTAUDIO } - globals.GSMOPEN_INTERFACES[interface_id].active=1; + globals.GSMOPEN_INTERFACES[interface_id].active = 1; //gsmopen_store_boost((char *)"5", &globals.GSMOPEN_INTERFACES[interface_id].capture_boost); //FIXME //gsmopen_store_boost((char *)"10", &globals.GSMOPEN_INTERFACES[interface_id].playback_boost); //FIXME @@ -2016,18 +1735,8 @@ static switch_status_t load_config(int reload_type) DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].dialplan); DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].destination); DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_name); -#ifdef GSMOPEN_ALSA - DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsacname); - DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].portaudiocindex); - DEBUGA_GSMOPEN("portaudiopindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].portaudiopindex); - DEBUGA_GSMOPEN("speexecho=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].speexecho); - DEBUGA_GSMOPEN("speexpreprocess=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].speexpreprocess); -#endif// GSMOPEN_PORTAUDIO - DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int)globals.GSMOPEN_INTERFACES[i].gsmopen_serial_sync_period); - + DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int) globals.GSMOPEN_INTERFACES[i].gsmopen_serial_sync_period); + DEBUGA_GSMOPEN("controldevice_audio_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_audio_name); } } } @@ -2045,12 +1754,12 @@ static switch_status_t chat_send(switch_event_t *message_event) private_t *tech_pvt = NULL; int i = 0, found = 0; - const char *proto; - const char *from; - const char *to; - const char *subject; - const char *body; - //const char *type; + const char *proto; + const char *from; + const char *to; + const char *subject; + const char *body; + //const char *type; const char *hint; proto = switch_event_get_header(message_event, "proto"); @@ -2063,7 +1772,7 @@ static switch_status_t chat_send(switch_event_t *message_event) switch_assert(proto != NULL); - DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, + DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, hint ? hint : "NULL"); if (!to || !strlen(to)) { @@ -2085,9 +1794,12 @@ static switch_status_t chat_send(switch_event_t *message_event) } } - if (!strlen(hint)) { //FIXME FIXME FIXME + if (hint == NULL || !strlen(hint)) { //FIXME FIXME FIXME hint = from; } + if (subject == NULL || !strlen(subject)) { //FIXME FIXME FIXME + subject = "SIMPLE MESSAGE"; + } if (to && (user = strdup(to))) { if ((host = strchr(user, '@'))) { *host++ = '\0'; @@ -2135,30 +1847,30 @@ static switch_status_t chat_send(switch_event_t *message_event) } static switch_status_t compat_chat_send(const char *proto, const char *from, const char *to, - const char *subject, const char *body, const char *type, const char *hint) + const char *subject, const char *body, const char *type, const char *hint) { - switch_event_t *message_event; - switch_status_t status; + switch_event_t *message_event; + switch_status_t status; - if (switch_event_create(&message_event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "proto", proto); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "from", from); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "to", to); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint); + if (switch_event_create(&message_event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "proto", proto); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "from", from); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "to", to); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint); - if (body) { - switch_event_add_body(message_event, "%s", body); - } - } else { - abort(); - } + if (body) { + switch_event_add_body(message_event, "%s", body); + } + } else { + abort(); + } - status = chat_send(message_event); - switch_event_destroy(&message_event); + status = chat_send(message_event); + switch_event_destroy(&message_event); - return status; + return status; } @@ -2194,7 +1906,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load) SWITCH_ADD_API(commands_api_interface, "gsm", "gsm console AT_command", gsm_function, GSM_SYNTAX); SWITCH_ADD_API(commands_api_interface, "gsmopen", "gsmopen interface AT_command", gsmopen_function, GSMOPEN_SYNTAX); #endif //0 - SWITCH_ADD_API(commands_api_interface, "gsmopen_boost_audio", "gsmopen_boost_audio interface AT_command", gsmopen_boost_audio_function, GSMOPEN_BOOST_AUDIO_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "gsmopen_boost_audio", "gsmopen_boost_audio interface AT_command", gsmopen_boost_audio_function, + GSMOPEN_BOOST_AUDIO_SYNTAX); SWITCH_ADD_API(commands_api_interface, "gsmopen_dump", "gsmopen_dump interface", gsmopen_dump_function, GSMOPEN_DUMP_SYNTAX); SWITCH_ADD_API(commands_api_interface, "gsmopen_sendsms", "gsmopen_sendsms interface destination_number SMS_text", sendsms_function, SENDSMS_SYNTAX); @@ -2211,7 +1924,11 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown) int x; private_t *tech_pvt = NULL; switch_status_t status; +#ifdef WIN32 + switch_size_t howmany = 8; +#else unsigned int howmany = 8; +#endif int interface_id; int fd; @@ -2251,9 +1968,16 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown) //DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); if (fd) { //close(fd); - //tech_pvt->controldevfd = -1; + tech_pvt->controldevfd = -1; DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); } + + serial_audio_shutdown(tech_pvt); + + int res; + res = tech_pvt->serialPort_serial_control->Close(); + DEBUGA_GSMOPEN("serial_shutdown res=%d (controldevfd is %d)\n", GSMOPEN_P_LOG, res, tech_pvt->controldevfd); + #ifndef WIN32 shutdown(tech_pvt->audiogsmopenpipe[0], 2); close(tech_pvt->audiogsmopenpipe[0]); @@ -2283,13 +2007,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown) return SWITCH_STATUS_SUCCESS; } - -void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj) +void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t *thread, void *obj) { return gsmopen_do_gsmopenapi_thread_func(obj); } -int dtmf_received(private_t * tech_pvt, char *value) +int dtmf_received(private_t *tech_pvt, char *value) { switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; @@ -2320,7 +2043,7 @@ int dtmf_received(private_t * tech_pvt, char *value) return 0; } -int new_inbound_channel(private_t * tech_pvt) +int new_inbound_channel(private_t *tech_pvt) { switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; @@ -2359,16 +2082,13 @@ int new_inbound_channel(private_t * tech_pvt) return 0; } } - if (channel) { - //switch_channel_mark_answered(channel); - } - DEBUGA_GSMOPEN("new_inbound_channel\n", GSMOPEN_P_LOG); + DEBUGA_GSMOPEN("EXITING new_inbound_channel\n", GSMOPEN_P_LOG); return 0; } -int remote_party_is_ringing(private_t * tech_pvt) +int remote_party_is_ringing(private_t *tech_pvt) { switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; @@ -2398,7 +2118,7 @@ int remote_party_is_ringing(private_t * tech_pvt) return 0; } -int remote_party_is_early_media(private_t * tech_pvt) +int remote_party_is_early_media(private_t *tech_pvt) { switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; @@ -2432,7 +2152,7 @@ int remote_party_is_early_media(private_t * tech_pvt) return 0; } -int outbound_channel_answered(private_t * tech_pvt) +int outbound_channel_answered(private_t *tech_pvt) { switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; @@ -2466,7 +2186,7 @@ int outbound_channel_answered(private_t * tech_pvt) return 0; } -private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling) +private_t *find_available_gsmopen_interface_rr(private_t *tech_pvt_calling) { private_t *tech_pvt = NULL; int i; @@ -2700,7 +2420,7 @@ SWITCH_STANDARD_API(gsmopen_dump_function) for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { tech_pvt = &globals.GSMOPEN_INTERFACES[i]; //stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); found = 1; @@ -2716,66 +2436,51 @@ SWITCH_STANDARD_API(gsmopen_dump_function) stream->write_function(stream, "dumping interface '%s'\n\n", globals.GSMOPEN_INTERFACES[i].name); tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->active); stream->write_function(stream, "active = %s\n", value); - if(!tech_pvt->network_creg_not_supported){ - snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); + if (!tech_pvt->network_creg_not_supported) { + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->not_registered); stream->write_function(stream, "not_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->home_network_registered); stream->write_function(stream, "home_network_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->roaming_registered); stream->write_function(stream, "roaming_registered = %s\n", value); - }else{ + } else { stream->write_function(stream, "not_registered = %s\n", "N/A"); stream->write_function(stream, "home_network_registered = %s\n", "N/A"); stream->write_function(stream, "roaming_registered = %s\n", "N/A"); } - snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->got_signal); stream->write_function(stream, "got_signal = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running); stream->write_function(stream, "running = %s\n", value); stream->write_function(stream, "imei = %s\n", tech_pvt->imei); stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->controldev_dead); stream->write_function(stream, "controldev_dead = %s\n", value); stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->no_sound); stream->write_function(stream, "no_sound = %s\n", value); -#ifdef GSMOPEN_ALSA - stream->write_function(stream, "alsacname = %s\n", tech_pvt->alsacname); - stream->write_function(stream, "alsapname = %s\n", tech_pvt->alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); - stream->write_function(stream, "portaudiocindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); - stream->write_function(stream, "portaudiopindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); - stream->write_function(stream, "speexecho = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); - stream->write_function(stream, "speexpreprocess = %s\n", value); -#endif// GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); + snprintf(value, sizeof(value) - 1, "%f", tech_pvt->playback_boost); stream->write_function(stream, "playback_boost = %s\n", value); - snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); + snprintf(value, sizeof(value) - 1, "%f", tech_pvt->capture_boost); stream->write_function(stream, "capture_boost = %s\n", value); stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); stream->write_function(stream, "context = %s\n", tech_pvt->context); stream->write_function(stream, "destination = %s\n", tech_pvt->destination); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_calls); stream->write_function(stream, "ib_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_calls); stream->write_function(stream, "ob_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_failed_calls); stream->write_function(stream, "ib_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_failed_calls); stream->write_function(stream, "ob_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->interface_state); stream->write_function(stream, "interface_state = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->phone_callflow); stream->write_function(stream, "phone_callflow = %s\n", value); stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); stream->write_function(stream, "\n"); @@ -2785,86 +2490,72 @@ SWITCH_STANDARD_API(gsmopen_dump_function) } - } else if(found){ + } else if (found) { stream->write_function(stream, "dumping interface '%s'\n\n", argv[0]); tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->active); stream->write_function(stream, "active = %s\n", value); - if(!tech_pvt->network_creg_not_supported){ - snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); + if (!tech_pvt->network_creg_not_supported) { + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->not_registered); stream->write_function(stream, "not_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->home_network_registered); stream->write_function(stream, "home_network_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->roaming_registered); stream->write_function(stream, "roaming_registered = %s\n", value); - }else{ + } else { stream->write_function(stream, "not_registered = %s\n", "N/A"); stream->write_function(stream, "home_network_registered = %s\n", "N/A"); stream->write_function(stream, "roaming_registered = %s\n", "N/A"); } - snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->got_signal); stream->write_function(stream, "got_signal = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running); stream->write_function(stream, "running = %s\n", value); stream->write_function(stream, "imei = %s\n", tech_pvt->imei); stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->controldev_dead); stream->write_function(stream, "controldev_dead = %s\n", value); stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->no_sound); stream->write_function(stream, "no_sound = %s\n", value); -#ifdef GSMOPEN_ALSA - stream->write_function(stream, "alsacname = %s\n", tech_pvt->alsacname); - stream->write_function(stream, "alsapname = %s\n", tech_pvt->alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); - stream->write_function(stream, "portaudiocindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); - stream->write_function(stream, "portaudiopindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); - stream->write_function(stream, "speexecho = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); - stream->write_function(stream, "speexpreprocess = %s\n", value); -#endif// GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); + snprintf(value, sizeof(value) - 1, "%f", tech_pvt->playback_boost); stream->write_function(stream, "playback_boost = %s\n", value); - snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); + snprintf(value, sizeof(value) - 1, "%f", tech_pvt->capture_boost); stream->write_function(stream, "capture_boost = %s\n", value); stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); stream->write_function(stream, "context = %s\n", tech_pvt->context); stream->write_function(stream, "destination = %s\n", tech_pvt->destination); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_calls); stream->write_function(stream, "ib_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_calls); stream->write_function(stream, "ob_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_failed_calls); stream->write_function(stream, "ib_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_failed_calls); stream->write_function(stream, "ob_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->interface_state); stream->write_function(stream, "interface_state = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->phone_callflow); stream->write_function(stream, "phone_callflow = %s\n", value); stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); stream->write_function(stream, "\n"); dump_event(tech_pvt); - } else{ + } else { stream->write_function(stream, "interface '%s' was not found\n", argv[0]); } } else { stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_DUMP_SYNTAX); } -end: + end: switch_safe_free(mycmd); return SWITCH_STATUS_SUCCESS; } + SWITCH_STANDARD_API(gsmopen_boost_audio_function) { char *mycmd = NULL, *argv[10] = { 0 }; @@ -2875,14 +2566,14 @@ SWITCH_STANDARD_API(gsmopen_boost_audio_function) argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); } - if (argc == 1 || argc==3) { + if (argc == 1 || argc == 3) { int i; int found = 0; for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { tech_pvt = &globals.GSMOPEN_INTERFACES[i]; stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); found = 1; @@ -2895,21 +2586,27 @@ SWITCH_STANDARD_API(gsmopen_boost_audio_function) } else { if (argc == 1) { - stream->write_function(stream,"[%s] capture boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); - stream->write_function(stream,"[%s] playback boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); + stream->write_function(stream, "[%s] capture boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, + globals.GSMOPEN_INTERFACES[i].capture_boost); + stream->write_function(stream, "[%s] playback boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, + globals.GSMOPEN_INTERFACES[i].playback_boost); stream->write_function(stream, "%s usage: %s", argv[0], GSMOPEN_BOOST_AUDIO_SYNTAX); goto end; } else if ((strncmp("play", argv[1], strlen(argv[1])) == 0)) { if (switch_is_number(argv[2])) { - stream->write_function(stream,"[%s] playback boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); + stream->write_function(stream, "[%s] playback boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, + globals.GSMOPEN_INTERFACES[i].playback_boost); gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].playback_boost); //FIXME - stream->write_function(stream,"[%s] playback boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); + stream->write_function(stream, "[%s] playback boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, + globals.GSMOPEN_INTERFACES[i].playback_boost); } - }else if ((strncmp("capt", argv[1], strlen(argv[1])) == 0)) { + } else if ((strncmp("capt", argv[1], strlen(argv[1])) == 0)) { if (switch_is_number(argv[2])) { - stream->write_function(stream,"[%s] capture boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); + stream->write_function(stream, "[%s] capture boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, + globals.GSMOPEN_INTERFACES[i].capture_boost); gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].capture_boost); //FIXME - stream->write_function(stream,"[%s] capture boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); + stream->write_function(stream, "[%s] capture boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, + globals.GSMOPEN_INTERFACES[i].capture_boost); } } else { stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX); @@ -2924,9 +2621,8 @@ SWITCH_STANDARD_API(gsmopen_boost_audio_function) return SWITCH_STATUS_SUCCESS; } - #if 0 -int gsmopen_transfer(private_t * tech_pvt, char *id, char *value) +int gsmopen_transfer(private_t *tech_pvt, char *id, char *value) { char msg_to_gsmopen[1024]; int i; @@ -3054,68 +2750,63 @@ void *gsmopen_do_gsmopenapi_thread_func(void *obj) time_t now_timestamp; //if (gsmopen_present(GSMopenHandles)) - while (running && tech_pvt->running) { - int res; - //gsmopen_sleep(1000000); //1 sec - //DEBUGA_GSMOPEN("ciao!\n", GSMOPEN_P_LOG); - res = gsmopen_serial_read(tech_pvt); - if (res == -1) { //manage the graceful interface shutdown - tech_pvt->controldev_dead = 1; - close(tech_pvt->controldevfd); - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running=0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active=0; - tech_pvt->name[0]='\0'; - switch_sleep(1000000); - } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_RING - && tech_pvt->phone_callflow != CALLFLOW_CALL_HANGUP_REQUESTED) { - //WARNINGA("INCOMING RING\n", GSMOPEN_P_LOG); + while (running && tech_pvt->running) { + int res; + //gsmopen_sleep(1000000); //1 sec + //DEBUGA_GSMOPEN("ciao!\n", GSMOPEN_P_LOG); + res = gsmopen_serial_read(tech_pvt); + if (res == -1) { //manage the graceful interface shutdown + tech_pvt->controldev_dead = 1; + close(tech_pvt->controldevfd); + ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); + tech_pvt->running = 0; + alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); + tech_pvt->active = 0; + tech_pvt->name[0] = '\0'; + switch_sleep(1000000); + } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_RING + && tech_pvt->phone_callflow != CALLFLOW_CALL_HANGUP_REQUESTED) { + //WARNINGA("INCOMING RING\n", GSMOPEN_P_LOG); - gsmopen_ring(tech_pvt); + gsmopen_ring(tech_pvt); - //FIXME gsmopen_answer(tech_pvt); - //new_inbound_channel(tech_pvt); - //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { - //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); - //FIXME } + //FIXME gsmopen_answer(tech_pvt); + //new_inbound_channel(tech_pvt); + //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { + //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); + //FIXME } + } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_DIALING) { + DEBUGA_GSMOPEN("WE'RE DIALING, let's take the earlymedia\n", GSMOPEN_P_LOG); + tech_pvt->interface_state = CALLFLOW_STATUS_EARLYMEDIA; + remote_party_is_early_media(tech_pvt); + //new_inbound_channel(tech_pvt); + //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { + //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); + //FIXME } - } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_DIALING) { - WARNINGA("WE'RE DIALING, let's take the earlymedia\n", GSMOPEN_P_LOG); - tech_pvt->interface_state = CALLFLOW_STATUS_EARLYMEDIA; - remote_party_is_early_media(tech_pvt); - //new_inbound_channel(tech_pvt); - //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { - //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); - //FIXME } - - - - - } else if (tech_pvt->interface_state == CALLFLOW_CALL_REMOTEANSWER) { - WARNINGA("REMOTE PARTY ANSWERED\n", GSMOPEN_P_LOG); - outbound_channel_answered(tech_pvt); - //new_inbound_channel(tech_pvt); - //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { - //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); - //FIXME } - } - switch_sleep(100); //give other threads a chance - time(&now_timestamp); - - if ((now_timestamp - tech_pvt->gsmopen_serial_synced_timestamp) > tech_pvt->gsmopen_serial_sync_period) { //TODO find a sensible period. 5min? in config? - gsmopen_serial_sync(tech_pvt); - gsmopen_serial_getstatus_AT(tech_pvt); - } + } else if (tech_pvt->interface_state == CALLFLOW_CALL_REMOTEANSWER) { + DEBUGA_GSMOPEN("REMOTE PARTY ANSWERED\n", GSMOPEN_P_LOG); + outbound_channel_answered(tech_pvt); + //new_inbound_channel(tech_pvt); + //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { + //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); + //FIXME } } + switch_sleep(100); //give other threads a chance + time(&now_timestamp); + + if ((now_timestamp - tech_pvt->gsmopen_serial_synced_timestamp) > tech_pvt->gsmopen_serial_sync_period) { //TODO find a sensible period. 5min? in config? + gsmopen_serial_sync(tech_pvt); + gsmopen_serial_getstatus_AT(tech_pvt); + } + } DEBUGA_GSMOPEN("EXIT\n", GSMOPEN_P_LOG); //running = 0; return NULL; } - SWITCH_STANDARD_API(sendsms_function) { char *mycmd = NULL, *argv[3] = { 0 }; @@ -3172,7 +2863,7 @@ SWITCH_STANDARD_API(sendsms_function) return SWITCH_STATUS_SUCCESS; } -int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message) +int dump_event_full(private_t *tech_pvt, int is_alarm, int alarm_code, const char *alarm_message) { switch_event_t *event; char value[512]; @@ -3181,82 +2872,68 @@ int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const ch switch_status_t status; session = switch_core_session_locate(tech_pvt->session_uuid_str); - if(session){ + if (session) { channel = switch_core_session_get_channel(session); } - if (is_alarm){ - ERRORA("ALARM on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name ); + if (is_alarm) { + ERRORA("ALARM on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name); status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_ALARM); - }else{ - DEBUGA_GSMOPEN("DUMP on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name ); + } else { + DEBUGA_GSMOPEN("DUMP on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name); status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_DUMP); } if (status == SWITCH_STATUS_SUCCESS) { - if (is_alarm){ - snprintf(value, sizeof(value)-1, "%d", alarm_code); + if (is_alarm) { + snprintf(value, sizeof(value) - 1, "%d", alarm_code); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_code", value); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_message", alarm_message); } switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_name", tech_pvt->name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_id", tech_pvt->id); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->active); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "active", value); - if(!tech_pvt->network_creg_not_supported){ - snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); + if (!tech_pvt->network_creg_not_supported) { + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->not_registered); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->home_network_registered); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->roaming_registered); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", value); - }else{ + } else { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", "N/A"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", "N/A"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", "N/A"); } - snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->got_signal); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "got_signal", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "running", value); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imei", tech_pvt->imei); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imsi", tech_pvt->imsi); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->controldev_dead); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldev_dead", value); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->no_sound); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "no_sound", value); -#ifdef GSMOPEN_ALSA - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsacname", tech_pvt->alsacname); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsapname", tech_pvt->alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiocindex", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiopindex", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexecho", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexpreprocess", value); -#endif// GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); + snprintf(value, sizeof(value) - 1, "%f", tech_pvt->playback_boost); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "playback_boost", value); - snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); + snprintf(value, sizeof(value) - 1, "%f", tech_pvt->capture_boost); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "capture_boost", value); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialplan", tech_pvt->dialplan); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", tech_pvt->context); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "destination", tech_pvt->destination); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_calls); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_calls", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_calls); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_calls", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_failed_calls); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_failed_calls", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); + snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_failed_calls); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_failed_calls", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->interface_state); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_state", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); + snprintf(value, sizeof(value) - 1, "%d", tech_pvt->phone_callflow); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "phone_callflow", value); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "session_uuid_str", tech_pvt->session_uuid_str); if (strlen(tech_pvt->session_uuid_str)) { @@ -3278,18 +2955,17 @@ int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const ch return 0; } -int dump_event(private_t * tech_pvt) +int dump_event(private_t *tech_pvt) { return dump_event_full(tech_pvt, 0, 0, NULL); } - -int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message) +int alarm_event(private_t *tech_pvt, int alarm_code, const char *alarm_message) { return dump_event_full(tech_pvt, 1, alarm_code, alarm_message); } -int sms_incoming(private_t * tech_pvt) +int sms_incoming(private_t *tech_pvt) { switch_event_t *event; switch_core_session_t *session = NULL; @@ -3299,6 +2975,7 @@ int sms_incoming(private_t * tech_pvt) DEBUGA_GSMOPEN("received SMS on interface %s: DATE=%s, SENDER=%s, BODY=%s|\n", GSMOPEN_P_LOG, tech_pvt->name, tech_pvt->sms_date, tech_pvt->sms_sender, tech_pvt->sms_body); +#ifdef NOTDEF if (!zstr(tech_pvt->session_uuid_str)) { session = switch_core_session_locate(tech_pvt->session_uuid_str); } @@ -3314,6 +2991,14 @@ int sms_incoming(private_t * tech_pvt) //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", tech_pvt->name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_proto", GSMOPEN_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_user", tech_pvt->sms_sender); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_host", "from_host"); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_full", "from_full"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_user", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_host", "to_host"); switch_event_add_body(event, "%s\n", tech_pvt->sms_body); if (session) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); @@ -3361,12 +3046,43 @@ int sms_incoming(private_t * tech_pvt) if (session) { switch_core_session_rwunlock(session); } +#endif //NOTDEF + /* mod_sms begin */ + if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", GSMOPEN_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->sms_sender); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "date", tech_pvt->sms_date); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "datacodingscheme", tech_pvt->sms_datacodingscheme); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "servicecentreaddress", tech_pvt->sms_servicecentreaddress); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "messagetype", "%d", tech_pvt->sms_messagetype); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", tech_pvt->name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_proto", GSMOPEN_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_user", tech_pvt->sms_sender); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_host", "from_host"); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_full", "from_full"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_user", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_host", "to_host"); + switch_event_add_body(event, "%s\n", tech_pvt->sms_body); + //switch_core_chat_send("GLOBAL", event); /* mod_sms */ + switch_core_chat_send("GLOBAL", event); /* mod_sms */ + } else { + + ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); + } + /* mod_sms end */ + + //memset(&tech_pvt->chatmessages[which], '\0', sizeof(&tech_pvt->chatmessages[which]) ); //memset(tech_pvt->sms_message, '\0', sizeof(tech_pvt->sms_message)); return 0; } - #ifdef NOTDEF SWITCH_STANDARD_API(gsmopen_chat_function) { @@ -3413,8 +3129,9 @@ SWITCH_STANDARD_API(gsmopen_chat_function) //chat_send(p*roto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint); //chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, hint); - NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", GSMOPEN_P_LOG, GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, - argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), tech_pvt->name); + NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", GSMOPEN_P_LOG, GSMOPEN_CHAT_PROTO, + tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), + tech_pvt->name); chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, tech_pvt->name); @@ -3461,7 +3178,6 @@ SWITCH_STANDARD_API(gsmopen_chat_function) } #endif // NOTDEF - /* For Emacs: * Local Variables: * mode:c diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/Makefile deleted file mode 100644 index c2cf8be76b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -MODNAME=mod_gsmopen -SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' -LOCAL_CFLAGS += $(SVNDEF) -DNO_ALSA -I../../../../../../libs/spandsp/src -I../../../../../..//libs/tiff-3.8.2/libtiff -LOCAL_LDFLAGS=-lgsmme -L../../../../../../libs/spandsp/src -avoid-version -module -no-undefined -shared -lspandsp -LOCAL_OBJS=gsmopen_protocol.o -include ../../../../../../build/modmake.rules diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/gsmopen.h deleted file mode 120000 index 663f1cbc4d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/gsmopen.h +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/gsmopen_protocol.cpp deleted file mode 120000 index b03564bdd9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/gsmopen_protocol.cpp +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen_protocol.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/mod_gsmopen.cpp b/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/mod_gsmopen.cpp deleted file mode 120000 index a0686ea786..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_gsmlib_cplusplus/mod_gsmopen/mod_gsmopen.cpp +++ /dev/null @@ -1 +0,0 @@ -../../mod_gsmopen.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/Makefile deleted file mode 100644 index 3a50b1f227..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -MODNAME=mod_gsmopen -SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' -LOCAL_CFLAGS += $(SVNDEF) -DNO_GSMLIB -DNO_ALSA -I../../../../../../libs/spandsp/src -I../../../../../..//libs/tiff-3.8.2/libtiff -LOCAL_LDFLAGS=-L../../../../../../libs/spandsp/src -avoid-version -module -no-undefined -shared -lspandsp -LOCAL_OBJS=gsmopen_protocol.o -include ../../../../../../build/modmake.rules diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h deleted file mode 120000 index 663f1cbc4d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c b/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c deleted file mode 120000 index b03564bdd9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen_protocol.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c b/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c deleted file mode 120000 index a0686ea786..0000000000 --- a/src/mod/endpoints/mod_gsmopen/noaudio_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c +++ /dev/null @@ -1 +0,0 @@ -../../mod_gsmopen.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/pa_ringbuffer.c b/src/mod/endpoints/mod_gsmopen/pa_ringbuffer.c deleted file mode 100644 index b632c06084..0000000000 --- a/src/mod/endpoints/mod_gsmopen/pa_ringbuffer.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * $Id: pa_ringbuffer.c 1164 2006-12-21 15:34:50Z bjornroche $ - * Portable Audio I/O Library - * Ring Buffer utility. - * - * Author: Phil Burk, http://www.softsynth.com - * modified for SMP safety on Mac OS X by Bjorn Roche - * modified for SMP safety on Linux by Leland Lucius - * also, allowed for const where possible - * Note that this is safe only for a single-thread reader and a - * single-thread writer. - * - * This program uses the PortAudio Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** - @file - @ingroup common_src -*/ - -#include -#include -#include -#include "pa_ringbuffer.h" -#include - -/**************** - * First, we'll define some memory barrier primitives based on the system. - * right now only OS X, FreeBSD, and Linux are supported. In addition to providing - * memory barriers, these functions should ensure that data cached in registers - * is written out to cache where it can be snooped by other CPUs. (ie, the volatile - * keyword should not be required) - * - * the primitives that must be defined are: - * - * PaUtil_FullMemoryBarrier() - * PaUtil_ReadMemoryBarrier() - * PaUtil_WriteMemoryBarrier() - * - ****************/ -#define __VIA_HACK__ -#if defined(__VIA_HACK__) -#define NO_BARRIER -#endif - -#if defined(NO_BARRIER) -# define PaUtil_FullMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() -#else - -#if defined(__APPLE__) //|| defined(__FreeBSD__) -# include - /* Here are the memory barrier functions. Mac OS X and FreeBSD only provide - full memory barriers, so the three types of barriers are the same. */ -# define PaUtil_FullMemoryBarrier() OSMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() OSMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() OSMemoryBarrier() -#elif defined(__GNUC__) - - /* GCC understands volatile asm and "memory" to mean it - * should not reorder memory read/writes */ -# if defined( __PPC__ ) -# define PaUtil_FullMemoryBarrier() __asm__ volatile("sync":::"memory") -# define PaUtil_ReadMemoryBarrier() __asm__ volatile("sync":::"memory") -# define PaUtil_WriteMemoryBarrier() __asm__ volatile("sync":::"memory") -# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || defined( __i686__ ) || defined(__x86_64__) -# define PaUtil_FullMemoryBarrier() __asm__ volatile("mfence":::"memory") -# define PaUtil_ReadMemoryBarrier() __asm__ volatile("lfence":::"memory") -# define PaUtil_WriteMemoryBarrier() __asm__ volatile("sfence":::"memory") -# else -# define PaUtil_FullMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() -# endif -#elif defined(_MSC_VER) -# include -# pragma intrinsic(_ReadWriteBarrier) -# pragma intrinsic(_ReadBarrier) -# pragma intrinsic(_WriteBarrier) -# define PaUtil_FullMemoryBarrier() _ReadWriteBarrier() -# define PaUtil_ReadMemoryBarrier() _ReadBarrier() -# define PaUtil_WriteMemoryBarrier() _WriteBarrier() -#else -# define PaUtil_FullMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() -#endif -#endif -/*************************************************************************** - * Initialize FIFO. - * numBytes must be power of 2, returns -1 if not. - */ -long PaUtil_InitializeRingBuffer(PaUtilRingBuffer * rbuf, long numBytes, void *dataPtr) -{ - if (((numBytes - 1) & numBytes) != 0) - return -1; /* Not Power of two. */ - rbuf->bufferSize = numBytes; - rbuf->buffer = (char *) dataPtr; - PaUtil_FlushRingBuffer(rbuf); - rbuf->bigMask = (numBytes * 2) - 1; - rbuf->smallMask = (numBytes) - 1; - return 0; -} - -/*************************************************************************** -** Return number of bytes available for reading. */ -long PaUtil_GetRingBufferReadAvailable(PaUtilRingBuffer * rbuf) -{ - PaUtil_ReadMemoryBarrier(); - return ((rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask); -} - -/*************************************************************************** -** Return number of bytes available for writing. */ -long PaUtil_GetRingBufferWriteAvailable(PaUtilRingBuffer * rbuf) -{ - /* Since we are calling PaUtil_GetRingBufferReadAvailable, we don't need an aditional MB */ - return (rbuf->bufferSize - PaUtil_GetRingBufferReadAvailable(rbuf)); -} - -/*************************************************************************** -** Clear buffer. Should only be called when buffer is NOT being read. */ -void PaUtil_FlushRingBuffer(PaUtilRingBuffer * rbuf) -{ - rbuf->writeIndex = rbuf->readIndex = 0; -} - -/*************************************************************************** -** Get address of region(s) to which we can write data. -** If the region is contiguous, size2 will be zero. -** If non-contiguous, size2 will be the size of second region. -** Returns room available to be written or numBytes, whichever is smaller. -*/ -long PaUtil_GetRingBufferWriteRegions(PaUtilRingBuffer * rbuf, long numBytes, void **dataPtr1, long *sizePtr1, void **dataPtr2, long *sizePtr2) -{ - long index; - long available = PaUtil_GetRingBufferWriteAvailable(rbuf); - if (numBytes > available) - numBytes = available; - /* Check to see if write is not contiguous. */ - index = rbuf->writeIndex & rbuf->smallMask; - if ((index + numBytes) > rbuf->bufferSize) { - /* Write data in two blocks that wrap the buffer. */ - long firstHalf = rbuf->bufferSize - index; - *dataPtr1 = &rbuf->buffer[index]; - *sizePtr1 = firstHalf; - *dataPtr2 = &rbuf->buffer[0]; - *sizePtr2 = numBytes - firstHalf; - } else { - *dataPtr1 = &rbuf->buffer[index]; - *sizePtr1 = numBytes; - *dataPtr2 = NULL; - *sizePtr2 = 0; - } - return numBytes; -} - - -/*************************************************************************** -*/ -long PaUtil_AdvanceRingBufferWriteIndex(PaUtilRingBuffer * rbuf, long numBytes) -{ - /* we need to ensure that previous writes are seen before we update the write index */ - PaUtil_WriteMemoryBarrier(); - return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask; -} - -/*************************************************************************** -** Get address of region(s) from which we can read data. -** If the region is contiguous, size2 will be zero. -** If non-contiguous, size2 will be the size of second region. -** Returns room available to be written or numBytes, whichever is smaller. -*/ -long PaUtil_GetRingBufferReadRegions(PaUtilRingBuffer * rbuf, long numBytes, void **dataPtr1, long *sizePtr1, void **dataPtr2, long *sizePtr2) -{ - long index; - long available = PaUtil_GetRingBufferReadAvailable(rbuf); - if (numBytes > available) - numBytes = available; - /* Check to see if read is not contiguous. */ - index = rbuf->readIndex & rbuf->smallMask; - if ((index + numBytes) > rbuf->bufferSize) { - /* Write data in two blocks that wrap the buffer. */ - long firstHalf = rbuf->bufferSize - index; - *dataPtr1 = &rbuf->buffer[index]; - *sizePtr1 = firstHalf; - *dataPtr2 = &rbuf->buffer[0]; - *sizePtr2 = numBytes - firstHalf; - } else { - *dataPtr1 = &rbuf->buffer[index]; - *sizePtr1 = numBytes; - *dataPtr2 = NULL; - *sizePtr2 = 0; - } - return numBytes; -} - -/*************************************************************************** -*/ -long PaUtil_AdvanceRingBufferReadIndex(PaUtilRingBuffer * rbuf, long numBytes) -{ - /* we need to ensure that previous writes are always seen before updating the index. */ - PaUtil_WriteMemoryBarrier(); - return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask; -} - -/*************************************************************************** -** Return bytes written. */ -long PaUtil_WriteRingBuffer(PaUtilRingBuffer * rbuf, const void *data, long numBytes) -{ - long size1, size2, numWritten; - void *data1, *data2; - numWritten = PaUtil_GetRingBufferWriteRegions(rbuf, numBytes, &data1, &size1, &data2, &size2); - if (size2 > 0) { - - memcpy(data1, data, size1); - data = ((char *) data) + size1; - memcpy(data2, data, size2); - } else { - memcpy(data1, data, size1); - } - PaUtil_AdvanceRingBufferWriteIndex(rbuf, numWritten); - return numWritten; -} - -/*************************************************************************** -** Return bytes read. */ -long PaUtil_ReadRingBuffer(PaUtilRingBuffer * rbuf, void *data, long numBytes) -{ - long size1, size2, numRead; - void *data1, *data2; - numRead = PaUtil_GetRingBufferReadRegions(rbuf, numBytes, &data1, &size1, &data2, &size2); - if (size2 > 0) { - memcpy(data, data1, size1); - data = ((char *) data) + size1; - memcpy(data, data2, size2); - } else { - memcpy(data, data1, size1); - } - PaUtil_AdvanceRingBufferReadIndex(rbuf, numRead); - return numRead; -} diff --git a/src/mod/endpoints/mod_gsmopen/pa_ringbuffer.h b/src/mod/endpoints/mod_gsmopen/pa_ringbuffer.h deleted file mode 100644 index ae026c02dd..0000000000 --- a/src/mod/endpoints/mod_gsmopen/pa_ringbuffer.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef PA_RINGBUFFER_H -#define PA_RINGBUFFER_H -/* - * $Id: pa_ringbuffer.h 1151 2006-11-29 02:11:16Z leland_lucius $ - * Portable Audio I/O Library - * Ring Buffer utility. - * - * Author: Phil Burk, http://www.softsynth.com - * modified for SMP safety on OS X by Bjorn Roche. - * also allowed for const where possible. - * Note that this is safe only for a single-thread reader - * and a single-thread writer. - * - * This program is distributed with the PortAudio Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src -*/ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - typedef struct PaUtilRingBuffer { - long bufferSize; /* Number of bytes in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */ - long writeIndex; /* Index of next writable byte. Set by PaUtil_AdvanceRingBufferWriteIndex. */ - long readIndex; /* Index of next readable byte. Set by PaUtil_AdvanceRingBufferReadIndex. */ - long bigMask; /* Used for wrapping indices with extra bit to distinguish full/empty. */ - long smallMask; /* Used for fitting indices to buffer. */ - char *buffer; - } PaUtilRingBuffer; - -/** Initialize Ring Buffer. - - @param rbuf The ring buffer. - - @param numBytes The number of bytes in the buffer and must be power of 2. - - @param dataPtr A pointer to a previously allocated area where the data - will be maintained. It must be numBytes long. - - @return -1 if numBytes is not a power of 2, otherwise 0. -*/ - long PaUtil_InitializeRingBuffer(PaUtilRingBuffer * rbuf, long numBytes, void *dataPtr); - -/** Clear buffer. Should only be called when buffer is NOT being read. - - @param rbuf The ring buffer. -*/ - void PaUtil_FlushRingBuffer(PaUtilRingBuffer * rbuf); - -/** Retrieve the number of bytes available in the ring buffer for writing. - - @param rbuf The ring buffer. - - @return The number of bytes available for writing. -*/ - long PaUtil_GetRingBufferWriteAvailable(PaUtilRingBuffer * rbuf); - -/** Retrieve the number of bytes available in the ring buffer for reading. - - @param rbuf The ring buffer. - - @return The number of bytes available for reading. -*/ - long PaUtil_GetRingBufferReadAvailable(PaUtilRingBuffer * rbuf); - -/** Write data to the ring buffer. - - @param rbuf The ring buffer. - - @param data The address of new data to write to the buffer. - - @param numBytes The number of bytes to be written. - - @return The number of bytes written. -*/ - long PaUtil_WriteRingBuffer(PaUtilRingBuffer * rbuf, const void *data, long numBytes); - -/** Read data from the ring buffer. - - @param rbuf The ring buffer. - - @param data The address where the data should be stored. - - @param numBytes The number of bytes to be read. - - @return The number of bytes read. -*/ - long PaUtil_ReadRingBuffer(PaUtilRingBuffer * rbuf, void *data, long numBytes); - -/** Get address of region(s) to which we can write data. - - @param rbuf The ring buffer. - - @param numBytes The number of bytes desired. - - @param dataPtr1 The address where the first (or only) region pointer will be - stored. - - @param sizePtr1 The address where the first (or only) region length will be - stored. - - @param dataPtr2 The address where the second region pointer will be stored if - the first region is too small to satisfy numBytes. - - @param sizePtr2 The address where the second region length will be stored if - the first region is too small to satisfy numBytes. - - @return The room available to be written or numBytes, whichever is smaller. -*/ - long PaUtil_GetRingBufferWriteRegions(PaUtilRingBuffer * rbuf, long numBytes, void **dataPtr1, long *sizePtr1, void **dataPtr2, long *sizePtr2); - -/** Advance the write index to the next location to be written. - - @param rbuf The ring buffer. - - @param numBytes The number of bytes to advance. - - @return The new position. -*/ - long PaUtil_AdvanceRingBufferWriteIndex(PaUtilRingBuffer * rbuf, long numBytes); - -/** Get address of region(s) from which we can write data. - - @param rbuf The ring buffer. - - @param numBytes The number of bytes desired. - - @param dataPtr1 The address where the first (or only) region pointer will be - stored. - - @param sizePtr1 The address where the first (or only) region length will be - stored. - - @param dataPtr2 The address where the second region pointer will be stored if - the first region is too small to satisfy numBytes. - - @param sizePtr2 The address where the second region length will be stored if - the first region is too small to satisfy numBytes. - - @return The number of bytes available for reading. -*/ - long PaUtil_GetRingBufferReadRegions(PaUtilRingBuffer * rbuf, long numBytes, void **dataPtr1, long *sizePtr1, void **dataPtr2, long *sizePtr2); - -/** Advance the read index to the next location to be read. - - @param rbuf The ring buffer. - - @param numBytes The number of bytes to advance. - - @return The new position. -*/ - long PaUtil_AdvanceRingBufferReadIndex(PaUtilRingBuffer * rbuf, long numBytes); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_RINGBUFFER_H */ diff --git a/src/mod/endpoints/mod_gsmopen/pablio.c b/src/mod/endpoints/mod_gsmopen/pablio.c deleted file mode 100644 index aa54d7ae15..0000000000 --- a/src/mod/endpoints/mod_gsmopen/pablio.c +++ /dev/null @@ -1,720 +0,0 @@ -/* - * $Id: pablio.c 1151 2006-11-29 02:11:16Z leland_lucius $ - * pablio.c - * Portable Audio Blocking Input/Output utility. - * - * Author: Phil Burk, http://www.softsynth.com - * - * This program uses the PortAudio Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ -#define WANT_SPEEX -#include -#include -#include -#include -#include "portaudio.h" -#include "pa_ringbuffer.h" -#include "pablio.h" -#include -#include -#ifdef WANT_SPEEX -#include "speex/speex_preprocess.h" -#include "speex/speex_echo.h" - SpeexPreprocessState *preprocess; - SpeexPreprocessState *preprocess2; - SpeexEchoState *echo_state; - - int speexecho=1; - int speexpreprocess=1; -#endif// WANT_SPEEX - -/************************************************************************/ -/******** Prototypes ****************************************************/ -/************************************************************************/ - -static int iblockingIOCallback(const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo * timeInfo, PaStreamCallbackFlags statusFlags, void *userData); -static int oblockingIOCallback(const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo * timeInfo, PaStreamCallbackFlags statusFlags, void *userData); - -static int ioblockingIOCallback(const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo * timeInfo, PaStreamCallbackFlags statusFlags, void *userData); - -static PaError PABLIO_InitFIFO(PaUtilRingBuffer * rbuf, long numFrames, long bytesPerFrame); -static PaError PABLIO_TermFIFO(PaUtilRingBuffer * rbuf); - -/************************************************************************/ -/******** Functions *****************************************************/ -/************************************************************************/ - -/* Called from PortAudio. - * Read and write data - */ -static int iblockingIOCallback(const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo * timeInfo, PaStreamCallbackFlags statusFlags, void *userData) -{ - PABLIO_Stream *data = (PABLIO_Stream *) userData; - long numBytes = data->bytesPerFrame * framesPerBuffer; -#ifdef WANT_SPEEX - spx_int16_t *speexptr=NULL; - spx_int16_t pcm2[160]; - int i; -#endif// WANT_SPEEX - - /* This may get called with NULL inputBuffer during initial setup. */ - if (inputBuffer != NULL) { -#ifdef WANT_SPEEX - //FIXME speex_echo_cancellation(echo_state, inputBuffer, outputBuffer, pcm2); - //FIXME speexptr=(spx_int16_t *)inputBuffer; - //FIXME for (i = 0; i < 160; i++) - //FIXME speexptr[i] = pcm2[i]; - //FIXME speex_preprocess_run(preprocess, speexptr); -#if 1 - if (speexecho) { - speexptr = ((spx_int16_t *) inputBuffer); - - /* Perform echo cancellation */ - speex_echo_capture(echo_state, speexptr, pcm2); -#ifndef GIOVA48 - for (i = 0; i < 160; i++) -#else //GIOVA48 - for (i = 0; i < 960; i++) -#endif //GIOVA48 - speexptr[i] = pcm2[i]; - //printf("read\n"); - } - if (speexpreprocess) { - speex_preprocess_run(preprocess, speexptr); - } - /* Apply noise/echo residual suppression */ -#endif -#endif //WANT_SPEEX - - - if (PaUtil_WriteRingBuffer(&data->inFIFO, inputBuffer, numBytes) != numBytes) { - PaUtil_FlushRingBuffer(&data->inFIFO); - PaUtil_WriteRingBuffer(&data->inFIFO, inputBuffer, numBytes); - printf("HEEEEEEEEEEEj\n"); - speex_echo_state_reset(echo_state); - } - } - - return 0; -} - -static int oblockingIOCallback(const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo * timeInfo, PaStreamCallbackFlags statusFlags, void *userData) -{ - PABLIO_Stream *data = (PABLIO_Stream *) userData; - long numBytes = data->bytesPerFrame * framesPerBuffer; -#ifdef WANT_SPEEX - spx_int16_t *speexptr=NULL; - //spx_int16_t pcm2[160]; - //int i; -#endif// WANT_SPEEX - - - if (outputBuffer != NULL) { - int i; - int numRead = PaUtil_ReadRingBuffer(&data->outFIFO, outputBuffer, numBytes); - /* Zero out remainder of buffer if we run out of data. */ - for (i = numRead; i < numBytes; i++) { - ((char *) outputBuffer)[i] = 0; - } - - if(numRead == 0){ - //printf("ZERO\n"); - //usleep(60000); - //speex_echo_state_reset(echo_state); - } -#ifdef WANT_SPEEX - //FIXME speexptr = (spx_int16_t *) outputBuffer; - //FIXME speex_preprocess_run(preprocess2, speexptr); -#if 1 - if (speexecho ) { - speexptr = (spx_int16_t *) outputBuffer; - if (speexpreprocess && numRead) { - //speex_preprocess_run(preprocess2, speexptr); - } - - - - /* Put frame into playback buffer */ - speex_echo_playback(echo_state, speexptr); - //printf("write\n"); - } - -#endif -#endif //WANT_SPEEX - - - } - - return 0; -} - -static int ioblockingIOCallback(const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo * timeInfo, PaStreamCallbackFlags statusFlags, void *userData) -{ - - -//write - oblockingIOCallback(inputBuffer, outputBuffer, framesPerBuffer, timeInfo, statusFlags, userData); -//read - iblockingIOCallback(inputBuffer, outputBuffer, framesPerBuffer, timeInfo, statusFlags, userData); - - return 0; -} - -/* Allocate buffer. */ -static PaError PABLIO_InitFIFO(PaUtilRingBuffer * rbuf, long numFrames, long bytesPerFrame) -{ - long numBytes = numFrames * bytesPerFrame; - char *buffer = (char *) malloc(numBytes); - if (buffer == NULL) - return paInsufficientMemory; - memset(buffer, 0, numBytes); - return (PaError) PaUtil_InitializeRingBuffer(rbuf, numBytes, buffer); -} - -/* Free buffer. */ -static PaError PABLIO_TermFIFO(PaUtilRingBuffer * rbuf) -{ - if (rbuf->buffer) - free(rbuf->buffer); - rbuf->buffer = NULL; - return paNoError; -} - -/************************************************************ - * Write data to ring buffer. - * Will not return until all the data has been written. - */ -long WriteAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer) -{ - long bytesWritten; - char *p = (char *) data; - long numBytes = aStream->bytesPerFrame * numFrames; - - switch_core_timer_next(timer); - - bytesWritten = PaUtil_WriteRingBuffer(&aStream->outFIFO, p, numBytes); - numBytes -= bytesWritten; - p += bytesWritten; - - if (numBytes > 0) { - PaUtil_FlushRingBuffer(&aStream->outFIFO); - printf("2HEEEEEEEEEEEj\n"); - speex_echo_state_reset(echo_state); - return 0; - } - return numFrames; -} - -/************************************************************ - * Read data from ring buffer. - * Will not return until all the data has been read. - */ -long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer) -{ - long bytesRead = 0; - char *p = (char *) data; - long avail, totalBytes = 0, neededBytes = aStream->bytesPerFrame * numFrames; - int max = 5000; - - switch_core_timer_next(timer); - - while(totalBytes < neededBytes && --max > 0) { - - avail = PaUtil_GetRingBufferReadAvailable(&aStream->inFIFO); - //printf("AVAILABLE BYTES %ld , neededBytes %ld, pass %d\n", avail, neededBytes, 5000 - max); - if (avail >= neededBytes * 6) { - PaUtil_FlushRingBuffer(&aStream->inFIFO); - printf("3HEEEEEEEEEEEj\n"); - speex_echo_state_reset(echo_state); - avail = 0; - } else { - - bytesRead = 0; - - if (totalBytes < neededBytes && avail >= neededBytes) { - bytesRead = PaUtil_ReadRingBuffer(&aStream->inFIFO, p, neededBytes); - totalBytes += bytesRead; - } - - if (bytesRead) { - p += bytesRead; - } else { - switch_cond_next(); - } - } - } - - //printf("return=%ld\n", totalBytes / aStream->bytesPerFrame); - return totalBytes / aStream->bytesPerFrame; -} - -/************************************************************ - * Return the number of frames that could be written to the stream without - * having to wait. - */ -long GetAudioStreamWriteable(PABLIO_Stream * aStream) -{ - int bytesEmpty = PaUtil_GetRingBufferWriteAvailable(&aStream->outFIFO); - return bytesEmpty / aStream->bytesPerFrame; -} - -/************************************************************ - * Return the number of frames that are available to be read from the - * stream without having to wait. - */ -long GetAudioStreamReadable(PABLIO_Stream * aStream) -{ - int bytesFull = PaUtil_GetRingBufferReadAvailable(&aStream->inFIFO); - return bytesFull / aStream->bytesPerFrame; -} - -/***********************************************************/ -static unsigned long RoundUpToNextPowerOf2(unsigned long n) -{ - long numBits = 0; - if (((n - 1) & n) == 0) - return n; - while (n > 0) { - n = n >> 1; - numBits++; - } - return (1 << numBits); -} - - - -/************************************************************ - * Opens a PortAudio stream with default characteristics. - * Allocates PABLIO_Stream structure. - * - */ -PaError OpenAudioStream(PABLIO_Stream ** rwblPtr, - const PaStreamParameters * inputParameters, - const PaStreamParameters * outputParameters, - double sampleRate, PaStreamFlags streamFlags, - long samples_per_packet, - int do_dual) -{ - long bytesPerSample = 2; - PaError err; - PABLIO_Stream *aStream; - long numFrames; - //long numBytes; - int channels = 1; -#ifdef WANT_SPEEX - int ciapa; - float level; - int tmp; -#endif //WANT_SPEEX - - - if (!(inputParameters || outputParameters)) { - return -1; - } - - /* Allocate PABLIO_Stream structure for caller. */ - aStream = (PABLIO_Stream *) malloc(sizeof(PABLIO_Stream)); - switch_assert(aStream); - memset(aStream, 0, sizeof(PABLIO_Stream)); - - if (inputParameters) { - channels = inputParameters->channelCount; - } else if (outputParameters) { - channels = outputParameters->channelCount; - } - - numFrames = RoundUpToNextPowerOf2(samples_per_packet * 5); - aStream->bytesPerFrame = bytesPerSample; - - /* Initialize Ring Buffers */ - - if (inputParameters) { - err = PABLIO_InitFIFO(&aStream->inFIFO, numFrames, aStream->bytesPerFrame); - if (err != paNoError) { - goto error; - } - aStream-> has_in = 1; - } - - if (outputParameters) { - err = PABLIO_InitFIFO(&aStream->outFIFO, numFrames, aStream->bytesPerFrame); - if (err != paNoError) { - goto error; - } - aStream-> has_out = 1; - } -#ifdef WANT_SPEEX - /* Echo canceller with 100 ms tail length */ -#ifndef GIOVA48 - echo_state = speex_echo_state_init(160, 1600); - ciapa = 8000; -#else// GIOVA48 - echo_state = speex_echo_state_init(960, 4800); - ciapa = 48000; -#endif // GIOVA48 - speex_echo_ctl(echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &ciapa); - -#if 1 //NO MORE - /* Setup preprocessor and associate with echo canceller for residual echo suppression */ -#ifndef GIOVA48 - preprocess = speex_preprocess_state_init(160, 8000); -#else// GIOVA48 - preprocess = speex_preprocess_state_init(960, 48000); -#endif // GIOVA48 - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_ECHO_STATE, - echo_state); - -#if 0 - /* Setup preprocessor various other goodies */ - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC, &tmp); - level=8000.1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC_LEVEL, &level); - - tmp = 8000; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC_TARGET, &tmp); - - //FIXME tmp = 60; - //FIXME speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC_MAX_GAIN, &tmp); - //FIXME fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); - //FIXME tmp = 40; - //FIXME speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC_INCREMENT, &tmp); - //FIXME fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); - //FIXME tmp = -40; - //FIXME speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC_DECREMENT, &tmp); - //FIXME fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); - -#if 0 - // Let's turn off all of the 'denoisers' (eg denoise and dereverb, and vad too) because they start automatic gain on mic input on cm108 usb, also if it (the agc on usb) disbled through mixer - tmp = 0; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 0; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_DEREVERB, &tmp); - tmp = 0; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_VAD, &tmp); -#endif - - //tmp = 0; - //speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 1; -#endif //0 - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC, &tmp); - fprintf(stderr, "AGC is: %d\n", tmp); - level = 1.0; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_LEVEL, &level); - fprintf(stderr, "AGC_LEVEL is: %f\n", level); - //tmp=1; - //speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_TARGET, &tmp); - //fprintf( stderr, "AGC_TARGET is: %d\n", tmp ); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_DENOISE, &tmp); - fprintf(stderr, "DENOISE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_DEREVERB, &tmp); - fprintf(stderr, "DEREVERB is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_VAD, &tmp); - fprintf(stderr, "VAD is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_MAX_GAIN, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_INCREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_DECREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); - -#if 0 - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_NOISE_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_NOISE_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE, - &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_MAX_GAIN, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_INCREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_AGC_DECREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_PROB_START, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_START is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_GET_PROB_CONTINUE, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_CONTINUE is: %d\n", tmp); -#endif //0 -#endif// 0 //NO MORE - - - - - - - - - -#if 1 //NO MORE - /* Setup preprocessor and associate with echo canceller for residual echo suppression */ -#ifndef GIOVA48 - preprocess2 = speex_preprocess_state_init(160, 8000); -#else// GIOVA48 - preprocess = speex_preprocess_state_init(960, 48000); -#endif // GIOVA48 - - /* Setup preprocessor various other goodies */ - tmp = 0; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_AGC, &tmp); - - tmp = 24000; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_AGC_TARGET, &tmp); - - //tmp = 60; - //speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_AGC_MAX_GAIN, &tmp); - tmp = 40; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_AGC_INCREMENT, &tmp); - tmp = -40; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_AGC_DECREMENT, &tmp); - -#if 0 - // Let's turn off all of the 'denoisers' (eg denoise and dereverb, and vad too) because they start automatic gain on mic input on cm108 usb, also if it (the agc on usb) disbled through mixer - tmp = 0; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 0; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_DEREVERB, &tmp); - tmp = 0; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_VAD, &tmp); -#endif - - //tmp = 0; - //speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC, &tmp); - fprintf(stderr, "AGC is: %d\n", tmp); - level = 1.0; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_LEVEL, &level); - fprintf(stderr, "AGC_LEVEL is: %f\n", level); - //tmp=1; - //speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_TARGET, &tmp); - //fprintf( stderr, "AGC_TARGET is: %d\n", tmp ); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_DENOISE, &tmp); - fprintf(stderr, "DENOISE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_DEREVERB, &tmp); - fprintf(stderr, "DEREVERB is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_VAD, &tmp); - fprintf(stderr, "VAD is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_MAX_GAIN, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_INCREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_DECREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); - -#if 0 - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_NOISE_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_NOISE_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE, - &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_MAX_GAIN, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_INCREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_AGC_DECREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_PROB_START, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_START is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(preprocess2, SPEEX_PREPROCESS_GET_PROB_CONTINUE, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_CONTINUE is: %d\n", tmp); -#endif //0 -#endif// 0 //NO MORE - - - - -#endif // WANT_SPEEX - - - /* Open a PortAudio stream that we will use to communicate with the underlying - * audio drivers. */ - - aStream->do_dual = do_dual; - - if (aStream->do_dual) { - err = Pa_OpenStream(&aStream->istream, inputParameters, NULL, sampleRate, samples_per_packet, streamFlags, iblockingIOCallback, aStream); - if (err != paNoError) { - goto error; - } - err = Pa_OpenStream(&aStream->ostream, NULL, outputParameters, sampleRate, samples_per_packet, streamFlags, oblockingIOCallback, aStream); - if (err != paNoError) { - goto error; - } - } else { - err = Pa_OpenStream(&aStream->iostream, inputParameters, outputParameters, sampleRate, samples_per_packet, streamFlags, ioblockingIOCallback, aStream); - } - - if (err != paNoError) { - goto error; - } - - if (aStream->do_dual) { - err = Pa_StartStream(aStream->istream); - - if (err != paNoError) { - goto error; - } - - err = Pa_StartStream(aStream->ostream); - - if (err != paNoError) { - goto error; - } - - } else { - err = Pa_StartStream(aStream->iostream); - } - - if (err != paNoError) { - goto error; - } - - *rwblPtr = aStream; - - //switch_yield(500000); - - return paNoError; - - error: - - CloseAudioStream(aStream); - - *rwblPtr = NULL; - return err; -} - -/************************************************************/ -PaError CloseAudioStream(PABLIO_Stream * aStream) -{ - int bytesEmpty; - int byteSize; - - - byteSize = aStream->outFIFO.bufferSize; - - if (aStream->has_out) { - /* If we are writing data, make sure we play everything written. */ - if (byteSize > 0) { - bytesEmpty = PaUtil_GetRingBufferWriteAvailable(&aStream->outFIFO); - while (bytesEmpty < byteSize) { - Pa_Sleep(10); - bytesEmpty = PaUtil_GetRingBufferWriteAvailable(&aStream->outFIFO); - } - } - } - - if (aStream->do_dual) { - if (aStream->has_in && aStream->istream) { - if (Pa_IsStreamActive(aStream->istream)) { - Pa_StopStream(aStream->istream); - } - - Pa_CloseStream(aStream->istream); - aStream->istream = NULL; - } - - if (aStream->has_out && aStream->ostream) { - if (Pa_IsStreamActive(aStream->ostream)) { - Pa_StopStream(aStream->ostream); - } - - Pa_CloseStream(aStream->ostream); - aStream->ostream = NULL; - } - - } else { - if (aStream->iostream) { - if (Pa_IsStreamActive(aStream->iostream)) { - Pa_StopStream(aStream->iostream); - } - - Pa_CloseStream(aStream->iostream); - aStream->iostream = NULL; - } - } - - if (aStream->has_in) { - PABLIO_TermFIFO(&aStream->inFIFO); - } - - if (aStream->has_out) { - PABLIO_TermFIFO(&aStream->outFIFO); - } - - free(aStream); - //switch_yield(500000); - - return paNoError; -} - diff --git a/src/mod/endpoints/mod_gsmopen/pablio.h b/src/mod/endpoints/mod_gsmopen/pablio.h deleted file mode 100644 index c933a11426..0000000000 --- a/src/mod/endpoints/mod_gsmopen/pablio.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef _PABLIO_H -#define _PABLIO_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* - * $Id: pablio.h 1083 2006-08-23 07:30:49Z rossb $ - * PABLIO.h - * Portable Audio Blocking read/write utility. - * - * Author: Phil Burk, http://www.softsynth.com/portaudio/ - * - * Include file for PABLIO, the Portable Audio Blocking I/O Library. - * PABLIO is built on top of PortAudio, the Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -#include -#include -#include -#include "pa_ringbuffer.h" -#include "portaudio.h" - -#include - - typedef struct { - PaUtilRingBuffer inFIFO; - PaUtilRingBuffer outFIFO; - PaStream *istream; - PaStream *ostream; - PaStream *iostream; - int bytesPerFrame; - int do_dual; - int has_in; - int has_out; - } PABLIO_Stream; - -/* Values for flags for OpenAudioStream(). */ -#define PABLIO_READ (1<<0) -#define PABLIO_WRITE (1<<1) -#define PABLIO_READ_WRITE (PABLIO_READ|PABLIO_WRITE) -#define PABLIO_MONO (1<<2) -#define PABLIO_STEREO (1<<3) - -/************************************************************ - * Write data to ring buffer. - * Will not return until all the data has been written. - */ - long WriteAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer); - -/************************************************************ - * Read data from ring buffer. - * Will not return until all the data has been read. - */ - long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer); - -/************************************************************ - * Return the number of frames that could be written to the stream without - * having to wait. - */ - long GetAudioStreamWriteable(PABLIO_Stream * aStream); - -/************************************************************ - * Return the number of frames that are available to be read from the - * stream without having to wait. - */ - long GetAudioStreamReadable(PABLIO_Stream * aStream); - -/************************************************************ - * Opens a PortAudio stream with default characteristics. - * Allocates PABLIO_Stream structure. - * - * flags parameter can be an ORed combination of: - * PABLIO_READ, PABLIO_WRITE, or PABLIO_READ_WRITE, - * and either PABLIO_MONO or PABLIO_STEREO - */ - PaError OpenAudioStream(PABLIO_Stream ** rwblPtr, - const PaStreamParameters * inputParameters, - const PaStreamParameters * outputParameters, - double sampleRate, PaStreamCallbackFlags statusFlags, long samples_per_packet, int do_dual); - - PaError CloseAudioStream(PABLIO_Stream * aStream); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _PABLIO_H */ diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_devlist.c b/src/mod/endpoints/mod_gsmopen/portaudio_devlist.c deleted file mode 100644 index 02a8160221..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_devlist.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * gcc -Wall portaudio_devlist.c -o portaudio_devlist -lportaudio - */ -#include -#include -#include - -int main(int argc, char **argv) -{ - int i, c, numDevices; - const PaDeviceInfo *deviceInfo; - PaError err; - char name[256]; - - err = Pa_Initialize(); - if (err != paNoError) - return err; - - - numDevices = Pa_GetDeviceCount(); - if (numDevices < 0) { - return 0; - } - if(argc==1){ - printf("usage: %s [input | output]\n", argv[0]); - return 1; - } - for (i = 0; i < numDevices; i++) { - deviceInfo = Pa_GetDeviceInfo(i); - memset(name, '\0', sizeof(name)); - for(c=0; cname); c++){ - if( deviceInfo->name[c] == ' ') - name[c]='_'; - else - name[c]= deviceInfo->name[c]; - } - if( !strcmp(argv[1], "input")&& deviceInfo->maxInputChannels) - { - printf("%d \"%s\" \n", - i, - name); - } - else if( !strcmp(argv[1], "output")&& deviceInfo->maxOutputChannels) - { - printf("%d \"%s\" \n", - i, - name); - } - } - - return numDevices; -} - - diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/Makefile deleted file mode 100644 index 2ffe125b8f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -MODNAME=mod_gsmopen -SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' -LOCAL_CFLAGS += $(SVNDEF) -DNO_ALSA -DGSMOPEN_PORTAUDIO -I../../../../../../libs/spandsp/src -I../../../../../..//libs/tiff-3.8.2/libtiff -LOCAL_LDFLAGS=-lportaudio -lspeex -lspeexdsp -lgsmme -L../../../../../../libs/spandsp/src -lspandsp -LOCAL_OBJS=gsmopen_protocol.o pablio.o pa_ringbuffer.o -include ../../../../../../build/modmake.rules diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/filtra48down8.c b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/filtra48down8.c deleted file mode 120000 index 95dcddeb47..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/filtra48down8.c +++ /dev/null @@ -1 +0,0 @@ -../../filtra48down8.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/filtra8up48.c b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/filtra8up48.c deleted file mode 120000 index ab063a3388..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/filtra8up48.c +++ /dev/null @@ -1 +0,0 @@ -../../filtra8up48.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/gsmopen.h deleted file mode 120000 index 663f1cbc4d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/gsmopen.h +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/gsmopen_protocol.cpp deleted file mode 120000 index b03564bdd9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/gsmopen_protocol.cpp +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen_protocol.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/mod_gsmopen.cpp b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/mod_gsmopen.cpp deleted file mode 120000 index a0686ea786..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/mod_gsmopen.cpp +++ /dev/null @@ -1 +0,0 @@ -../../mod_gsmopen.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pa_ringbuffer.c b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pa_ringbuffer.c deleted file mode 120000 index d0f4a92d6c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pa_ringbuffer.c +++ /dev/null @@ -1 +0,0 @@ -../../pa_ringbuffer.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pa_ringbuffer.h b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pa_ringbuffer.h deleted file mode 120000 index 695ee41274..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pa_ringbuffer.h +++ /dev/null @@ -1 +0,0 @@ -../../pa_ringbuffer.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pablio.c b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pablio.c deleted file mode 120000 index 76d569934f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pablio.c +++ /dev/null @@ -1 +0,0 @@ -../../pablio.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pablio.h b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pablio.h deleted file mode 120000 index 865b997b25..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/pablio.h +++ /dev/null @@ -1 +0,0 @@ -../../pablio.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/portaudio_devlist.c b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/portaudio_devlist.c deleted file mode 120000 index 24c8da084a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/portaudio_devlist.c +++ /dev/null @@ -1 +0,0 @@ -../../portaudio_devlist.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/usb-cm-108-2.txt b/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/usb-cm-108-2.txt deleted file mode 120000 index 47c6b46e93..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_gsmlib_cplusplus_noalsa/mod_gsmopen/usb-cm-108-2.txt +++ /dev/null @@ -1 +0,0 @@ -../../usb-cm-108-2.txt \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/Makefile deleted file mode 100644 index eb5c0e9d5f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -MODNAME=mod_gsmopen -SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' -LOCAL_CFLAGS += $(SVNDEF) -DNO_GSMLIB -DNO_ALSA -DGSMOPEN_PORTAUDIO -I../../../../../../libs/spandsp/src -I../../../../../..//libs/tiff-3.8.2/libtiff -LOCAL_LDFLAGS=-lportaudio -lspeex -lspeexdsp -L../../../../../../libs/spandsp/src -lspandsp -LOCAL_OBJS=gsmopen_protocol.o pablio.o pa_ringbuffer.o -include ../../../../../../build/modmake.rules diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/filtra48down8.c b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/filtra48down8.c deleted file mode 120000 index 95dcddeb47..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/filtra48down8.c +++ /dev/null @@ -1 +0,0 @@ -../../filtra48down8.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/filtra8up48.c b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/filtra8up48.c deleted file mode 120000 index ab063a3388..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/filtra8up48.c +++ /dev/null @@ -1 +0,0 @@ -../../filtra8up48.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/gsmopen.h deleted file mode 120000 index 663f1cbc4d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/gsmopen.h +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/gsmopen_protocol.c b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/gsmopen_protocol.c deleted file mode 120000 index b03564bdd9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/gsmopen_protocol.c +++ /dev/null @@ -1 +0,0 @@ -../../gsmopen_protocol.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/mod_gsmopen.c b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/mod_gsmopen.c deleted file mode 120000 index a0686ea786..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/mod_gsmopen.c +++ /dev/null @@ -1 +0,0 @@ -../../mod_gsmopen.cpp \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pa_ringbuffer.c b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pa_ringbuffer.c deleted file mode 120000 index d0f4a92d6c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pa_ringbuffer.c +++ /dev/null @@ -1 +0,0 @@ -../../pa_ringbuffer.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pa_ringbuffer.h b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pa_ringbuffer.h deleted file mode 120000 index 695ee41274..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pa_ringbuffer.h +++ /dev/null @@ -1 +0,0 @@ -../../pa_ringbuffer.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pablio.c b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pablio.c deleted file mode 120000 index 76d569934f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pablio.c +++ /dev/null @@ -1 +0,0 @@ -../../pablio.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pablio.h b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pablio.h deleted file mode 120000 index 865b997b25..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/pablio.h +++ /dev/null @@ -1 +0,0 @@ -../../pablio.h \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/portaudio_devlist.c b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/portaudio_devlist.c deleted file mode 120000 index 24c8da084a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/portaudio_devlist.c +++ /dev/null @@ -1 +0,0 @@ -../../portaudio_devlist.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/usb-cm-108-2.txt b/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/usb-cm-108-2.txt deleted file mode 120000 index 47c6b46e93..0000000000 --- a/src/mod/endpoints/mod_gsmopen/portaudio_nogsmlib_nocplusplus_noalsa/mod_gsmopen/usb-cm-108-2.txt +++ /dev/null @@ -1 +0,0 @@ -../../usb-cm-108-2.txt \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/test.cc b/src/mod/endpoints/mod_gsmopen/test.cc deleted file mode 100644 index f59711ef92..0000000000 --- a/src/mod/endpoints/mod_gsmopen/test.cc +++ /dev/null @@ -1,206 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: testgsmlib.cc -// * -// * Purpose: Test general gsm functions (without SMS/phonebook) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 17.5.1999 -// ************************************************************************* -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef WIN32 -#include -#else -#include -#endif -#include -#include - -using namespace std; -using namespace gsmlib; - -// some time-consuming tests can be switched off by commenting out the -// following macros -#define TEST_OPERATOR_INFO - -void printForwardReason(string s, ForwardInfo &info) -{ - cout << " " << s << ": " - << (info._active ? "active " : "inactive ") - << "number: " << info._number - << " subaddr: " << info._subAddr - << " time: " << info._time << endl; -} - -int main(int argc, char *argv[]) -{ - string ciapa; - int i; - - if(argc<2){ - cout << (string)"You gave no \"device\" argument!" << endl; - return -1; - } - try - { - cout << (string)"Opening device " + argv[1] << endl; -#ifdef WIN32 - Ref port = new Win32SerialPort((string)argv[1], 38400); -#else - //Ref port = new UnixSerialPort((string)argv[1], B38400); - Ref port = new UnixSerialPort((string)argv[1], B115200); -#endif - - - cout << "Creating MeTa object" << endl; - MeTa m(port); - - cout << "Creating GsmAt object" << endl; - Ref gsmat = new GsmAt(m); - - cout << "Using GsmAt object" << endl; - //cout << gsmat->chat("AT", "OK", false, false) << endl; - //cout << gsmat->chat("D3472665618;") << endl; - gsmat->putLine("ATI9", true); - for(i=0; i<9; i++){ - ciapa = gsmat->getLine(); - cout << "PRESO: |||" << ciapa << "|||" << endl; - //usleep(5000); - } - -#ifdef NOTDEF - cout << "Getting ME info" << endl; - MEInfo mei = m.getMEInfo(); - - cout << " Manufacturer: " << mei._manufacturer << endl - << " Model: " << mei._model << endl - << " Revision: " << mei._revision << endl - << " Serial Number: " << mei._serialNumber << endl << endl; - -#ifdef TEST_OPERATOR_INFO - try - { - cout << "Getting operator info" << endl; - vector opis = m.getAvailableOPInfo(); - for (vector::iterator i = opis.begin(); i != opis.end(); ++i) - { - cout << " Status: "; - switch (i->_status) - { - case 0: cout << "unknown"; break; - case 1: cout << "current"; break; - case 2: cout << "available"; break; - case 3: cout << "forbidden"; break; - } - cout << endl - << " Long name: '" << i->_longName << "' " - << " Short name: '" << i->_shortName << "' " - << " Numeric name: " << i->_numericName << endl; - } - } - catch (GsmException &ge) - { - if (ge.getErrorCode() == 0) - cout << "phone failure ignored" << endl; - else - throw; - } - cout << endl; -#endif // TEST_OPERATOR_INFO - - cout << "Current operator info" << endl; - OPInfo opi = m.getCurrentOPInfo(); - cout << " Long name: '" << opi._longName << "' " - << " Short name: '" << opi._shortName << "' " - << " Numeric name: " << opi._numericName << endl - << " Mode: "; - switch (opi._mode) - { - case 0: cout << "automatic"; break; - case 1: cout << "manual"; break; - case 2: cout << "deregister"; break; - case 4: cout << "manual/automatic"; break; - } - cout << endl; - - cout << "Facility lock capabilities" << endl << " "; - vector fclc = m.getFacilityLockCapabilities(); - for (vector::iterator i = fclc.begin(); i != fclc.end(); ++i) - cout << *i << " "; - cout << endl << endl; - - cout << "Facility lock states" << endl; - for (vector::iterator k = fclc.begin(); k != fclc.end(); ++k) - if (*k != "AB" && *k != "AG" && *k != "AC") - { - cout << " " << *k; - if (m.getFacilityLockStatus(*k, VoiceFacility)) - cout << " Voice"; - if (m.getFacilityLockStatus(*k, DataFacility)) - cout << " Data"; - if (m.getFacilityLockStatus(*k, FaxFacility)) - cout << " Fax"; - } - cout << endl; - - cout << "Facilities with password" << endl; - vector pwi = m.getPasswords(); - for (vector::iterator j = pwi.begin(); j != pwi.end(); ++j) - cout << " " << j->_facility << " len " << j->_maxPasswdLen << endl; - cout << endl; - - cout << "Network caller line identification identification: " - << (m.getNetworkCLIP() ? "on" : "off") << endl << endl; - - cout << "Call forwarding information" << endl; - for (int r = 0; r < 4; ++r) - { - switch (r) - { - case 0: cout << "UnconditionalReason" << endl; break; - case 1: cout << "MobileBusyReason" << endl; break; - case 2: cout << "NoReplyReason" << endl; break; - case 3: cout << "NotReachableReason" << endl; break; - } - ForwardInfo voice, fax, data; - m.getCallForwardInfo((ForwardReason)r, voice, fax, data); - printForwardReason("Voice", voice); - printForwardReason("Data", data); - printForwardReason("Fax", fax); - } - cout << endl; - - cout << "Battery charge status" << endl; - int bcs = m.getBatteryChargeStatus(); - switch (bcs) - { - case 0: cout << "ME is powered by the battery" << endl; break; - case 1: cout << "ME has a battery connected, but is not powered by it" - << endl; break; - case 2: cout << "ME does not have a battery connected" << endl; break; - case 3: cout << "Recognized power fault, calls inhibited" << endl; break; - } - cout << endl; - - cout << "Battery charge: " << m.getBatteryCharge() << endl << endl; - - cout << "Signal strength: " << m.getSignalStrength() << endl << endl; - - cout << "Bit error rate: " << m.getBitErrorRate() << endl << endl; -#endif //NOTDEF - } - catch (GsmException &ge) - { - cerr << "GsmException '" << ge.what() << "'" << endl; - return 1; - } - - - return 0; -} - - diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv.c b/src/mod/endpoints/mod_gsmopen/win_iconv.c new file mode 100644 index 0000000000..94c8d4a1e7 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv.c @@ -0,0 +1,1986 @@ +/* + * iconv library using Win32 API to conversion. + * + * This file is placed in the public domain. + * + * Last Change: 2009-07-06 + * + * ENVIRONMENT VARIABLE: + * WINICONV_LIBICONV_DLL + * If $WINICONV_LIBICONV_DLL is set, win_iconv uses the DLL. If + * loading the DLL or iconv_open() failed, falls back to internal + * conversion. If a few DLL are specified as comma separated list, + * the first loadable DLL is used. The DLL should have iconv_open(), + * iconv_close() and iconv(). Or libiconv_open(), libiconv_close() + * and libiconv(). + * (only available when USE_LIBICONV_DLL is defined at compile time) + * + * Win32 API does not support strict encoding conversion for some + * codepage. And MLang function drop or replace invalid bytes and does + * not return useful error status as iconv. This implementation cannot + * be used for encoding validation purpose. + */ + +/* for WC_NO_BEST_FIT_CHARS */ +#ifndef WINVER +# define WINVER 0x0500 +#endif + +#include +#include +#include +#include + +#if 0 +# define MAKE_EXE +# define MAKE_DLL +# define USE_LIBICONV_DLL +#endif + +#if !defined(DEFAULT_LIBICONV_DLL) +# define DEFAULT_LIBICONV_DLL "" +#endif + +#define MB_CHAR_MAX 16 + +#define UNICODE_MODE_BOM_DONE 1 +#define UNICODE_MODE_SWAPPED 2 + +#define FLAG_USE_BOM 1 +#define FLAG_TRANSLIT 2 /* //TRANSLIT */ +#define FLAG_IGNORE 4 /* //IGNORE (not implemented) */ + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; + +typedef void* iconv_t; + +iconv_t iconv_open(const char *tocode, const char *fromcode); +int iconv_close(iconv_t cd); +size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +/* libiconv interface for vim */ +#if defined(MAKE_DLL) +int +iconvctl (iconv_t cd, int request, void* argument) +{ + /* not supported */ + return 0; +} +#endif + +typedef struct compat_t compat_t; +typedef struct csconv_t csconv_t; +typedef struct rec_iconv_t rec_iconv_t; + +typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode); +typedef int (*f_iconv_close)(iconv_t cd); +typedef size_t (*f_iconv)(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +typedef int* (*f_errno)(void); +typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize); +typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize); + +#define COMPAT_IN 1 +#define COMPAT_OUT 2 + +/* unicode mapping for compatibility with other conversion table. */ +struct compat_t { + uint in; + uint out; + uint flag; +}; + +struct csconv_t { + int codepage; + int flags; + f_mbtowc mbtowc; + f_wctomb wctomb; + f_mblen mblen; + f_flush flush; + DWORD mode; + compat_t *compat; +}; + +struct rec_iconv_t { + iconv_t cd; + f_iconv_close iconv_close; + f_iconv iconv; + f_errno _errno; + csconv_t from; + csconv_t to; +#if defined(USE_LIBICONV_DLL) + HMODULE hlibiconv; +#endif +}; + +static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static int win_iconv_close(iconv_t cd); +static size_t win_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +static int load_mlang(); +static int make_csconv(const char *name, csconv_t *cv); +static int name_to_codepage(const char *name); +static uint utf16_to_ucs4(const ushort *wbuf); +static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize); +static int mbtowc_flags(int codepage); +static int must_use_null_useddefaultchar(int codepage); +static char *strrstr(const char *str, const char *token); +static char *xstrndup(const char *s, size_t n); +static int seterror(int err); + +#if defined(USE_LIBICONV_DLL) +static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size); +static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname); + +static HMODULE hwiniconv; +#endif + +static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize); + +static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize); + +static struct { + int codepage; + const char *name; +} codepage_alias[] = { + {65001, "CP65001"}, + {65001, "UTF8"}, + {65001, "UTF-8"}, + + {1200, "CP1200"}, + {1200, "UTF16LE"}, + {1200, "UTF-16LE"}, + {1200, "UCS-2LE"}, + + {1201, "CP1201"}, + {1201, "UTF16BE"}, + {1201, "UTF-16BE"}, + {1201, "UCS-2BE"}, + {1201, "unicodeFFFE"}, + + {12000, "CP12000"}, + {12000, "UTF32LE"}, + {12000, "UTF-32LE"}, + + {12001, "CP12001"}, + {12001, "UTF32BE"}, + {12001, "UTF-32BE"}, + +#ifndef GLIB_COMPILATION + /* + * Default is big endian. + * See rfc2781 4.3 Interpreting text labelled as UTF-16. + */ + {1201, "UTF16"}, + {1201, "UTF-16"}, + {12001, "UTF32"}, + {12001, "UTF-32"}, +#else + /* Default is little endian, because the platform is */ + {1200, "UTF16"}, + {1200, "UTF-16"}, + {1200, "UCS-2"}, + {12000, "UTF32"}, + {12000, "UTF-32"}, +#endif + + /* copy from libiconv `iconv -l` */ + /* !IsValidCodePage(367) */ + {20127, "ANSI_X3.4-1968"}, + {20127, "ANSI_X3.4-1986"}, + {20127, "ASCII"}, + {20127, "CP367"}, + {20127, "IBM367"}, + {20127, "ISO-IR-6"}, + {20127, "ISO646-US"}, + {20127, "ISO_646.IRV:1991"}, + {20127, "US"}, + {20127, "US-ASCII"}, + {20127, "CSASCII"}, + + /* !IsValidCodePage(819) */ + {1252, "CP819"}, + {1252, "IBM819"}, + {28591, "ISO-8859-1"}, + {28591, "ISO-IR-100"}, + {28591, "ISO8859-1"}, + {28591, "ISO_8859-1"}, + {28591, "ISO_8859-1:1987"}, + {28591, "L1"}, + {28591, "LATIN1"}, + {28591, "CSISOLATIN1"}, + + {1250, "CP1250"}, + {1250, "MS-EE"}, + {1250, "WINDOWS-1250"}, + + {1251, "CP1251"}, + {1251, "MS-CYRL"}, + {1251, "WINDOWS-1251"}, + + {1252, "CP1252"}, + {1252, "MS-ANSI"}, + {1252, "WINDOWS-1252"}, + + {1253, "CP1253"}, + {1253, "MS-GREEK"}, + {1253, "WINDOWS-1253"}, + + {1254, "CP1254"}, + {1254, "MS-TURK"}, + {1254, "WINDOWS-1254"}, + + {1255, "CP1255"}, + {1255, "MS-HEBR"}, + {1255, "WINDOWS-1255"}, + + {1256, "CP1256"}, + {1256, "MS-ARAB"}, + {1256, "WINDOWS-1256"}, + + {1257, "CP1257"}, + {1257, "WINBALTRIM"}, + {1257, "WINDOWS-1257"}, + + {1258, "CP1258"}, + {1258, "WINDOWS-1258"}, + + {850, "850"}, + {850, "CP850"}, + {850, "IBM850"}, + {850, "CSPC850MULTILINGUAL"}, + + /* !IsValidCodePage(862) */ + {862, "862"}, + {862, "CP862"}, + {862, "IBM862"}, + {862, "CSPC862LATINHEBREW"}, + + {866, "866"}, + {866, "CP866"}, + {866, "IBM866"}, + {866, "CSIBM866"}, + + /* !IsValidCodePage(154) */ + {154, "CP154"}, + {154, "CYRILLIC-ASIAN"}, + {154, "PT154"}, + {154, "PTCP154"}, + {154, "CSPTCP154"}, + + /* !IsValidCodePage(1133) */ + {1133, "CP1133"}, + {1133, "IBM-CP1133"}, + + {874, "CP874"}, + {874, "WINDOWS-874"}, + + /* !IsValidCodePage(51932) */ + {51932, "CP51932"}, + {51932, "MS51932"}, + {51932, "WINDOWS-51932"}, + {51932, "EUC-JP"}, + + {932, "CP932"}, + {932, "MS932"}, + {932, "SHIFFT_JIS"}, + {932, "SHIFFT_JIS-MS"}, + {932, "SJIS"}, + {932, "SJIS-MS"}, + {932, "SJIS-OPEN"}, + {932, "SJIS-WIN"}, + {932, "WINDOWS-31J"}, + {932, "WINDOWS-932"}, + {932, "CSWINDOWS31J"}, + + {50221, "CP50221"}, + {50221, "ISO-2022-JP"}, + {50221, "ISO-2022-JP-MS"}, + {50221, "ISO2022-JP"}, + {50221, "ISO2022-JP-MS"}, + {50221, "MS50221"}, + {50221, "WINDOWS-50221"}, + + {936, "CP936"}, + {936, "GBK"}, + {936, "MS936"}, + {936, "WINDOWS-936"}, + + {950, "CP950"}, + {950, "BIG5"}, + + {949, "CP949"}, + {949, "UHC"}, + {949, "EUC-KR"}, + + {1361, "CP1361"}, + {1361, "JOHAB"}, + + {437, "437"}, + {437, "CP437"}, + {437, "IBM437"}, + {437, "CSPC8CODEPAGE437"}, + + {737, "CP737"}, + + {775, "CP775"}, + {775, "IBM775"}, + {775, "CSPC775BALTIC"}, + + {852, "852"}, + {852, "CP852"}, + {852, "IBM852"}, + {852, "CSPCP852"}, + + /* !IsValidCodePage(853) */ + {853, "CP853"}, + + {855, "855"}, + {855, "CP855"}, + {855, "IBM855"}, + {855, "CSIBM855"}, + + {857, "857"}, + {857, "CP857"}, + {857, "IBM857"}, + {857, "CSIBM857"}, + + /* !IsValidCodePage(858) */ + {858, "CP858"}, + + {860, "860"}, + {860, "CP860"}, + {860, "IBM860"}, + {860, "CSIBM860"}, + + {861, "861"}, + {861, "CP-IS"}, + {861, "CP861"}, + {861, "IBM861"}, + {861, "CSIBM861"}, + + {863, "863"}, + {863, "CP863"}, + {863, "IBM863"}, + {863, "CSIBM863"}, + + {864, "CP864"}, + {864, "IBM864"}, + {864, "CSIBM864"}, + + {865, "865"}, + {865, "CP865"}, + {865, "IBM865"}, + {865, "CSIBM865"}, + + {869, "869"}, + {869, "CP-GR"}, + {869, "CP869"}, + {869, "IBM869"}, + {869, "CSIBM869"}, + + /* !IsValidCodePage(1152) */ + {1125, "CP1125"}, + + /* + * Code Page Identifiers + * http://msdn2.microsoft.com/en-us/library/ms776446.aspx + */ + {37, "IBM037"}, /* IBM EBCDIC US-Canada */ + {437, "IBM437"}, /* OEM United States */ + {500, "IBM500"}, /* IBM EBCDIC International */ + {708, "ASMO-708"}, /* Arabic (ASMO 708) */ + /* 709 Arabic (ASMO-449+, BCON V4) */ + /* 710 Arabic - Transparent Arabic */ + {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */ + {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */ + {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */ + {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */ + {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */ + {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */ + {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */ + {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */ + {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */ + {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */ + {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */ + {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */ + {864, "IBM864"}, /* OEM Arabic; Arabic (864) */ + {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */ + {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */ + {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */ + {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */ + {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */ + {875, "cp875"}, /* IBM EBCDIC Greek Modern */ + {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */ + {932, "shift-jis"}, /* alternative name for it */ + {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */ + {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */ + {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */ + {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */ + {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */ + {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */ + {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */ + {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */ + {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */ + {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */ + {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */ + {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */ + {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */ + {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */ + {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */ + {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */ + {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */ + {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */ + {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */ + {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */ + {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */ + {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */ + {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */ + {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */ + {1361, "Johab"}, /* Korean (Johab) */ + {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */ + {10001, "x-mac-japanese"}, /* Japanese (Mac) */ + {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */ + {10003, "x-mac-korean"}, /* Korean (Mac) */ + {10004, "x-mac-arabic"}, /* Arabic (Mac) */ + {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */ + {10006, "x-mac-greek"}, /* Greek (Mac) */ + {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */ + {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */ + {10010, "x-mac-romanian"}, /* Romanian (Mac) */ + {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */ + {10021, "x-mac-thai"}, /* Thai (Mac) */ + {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */ + {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */ + {10081, "x-mac-turkish"}, /* Turkish (Mac) */ + {10082, "x-mac-croatian"}, /* Croatian (Mac) */ + {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */ + {20001, "x-cp20001"}, /* TCA Taiwan */ + {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */ + {20003, "x-cp20003"}, /* IBM5550 Taiwan */ + {20004, "x-cp20004"}, /* TeleText Taiwan */ + {20005, "x-cp20005"}, /* Wang Taiwan */ + {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */ + {20106, "x-IA5-German"}, /* IA5 German (7-bit) */ + {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */ + {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */ + {20127, "us-ascii"}, /* US-ASCII (7-bit) */ + {20261, "x-cp20261"}, /* T.61 */ + {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */ + {20273, "IBM273"}, /* IBM EBCDIC Germany */ + {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */ + {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */ + {20280, "IBM280"}, /* IBM EBCDIC Italy */ + {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */ + {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */ + {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */ + {20297, "IBM297"}, /* IBM EBCDIC France */ + {20420, "IBM420"}, /* IBM EBCDIC Arabic */ + {20423, "IBM423"}, /* IBM EBCDIC Greek */ + {20424, "IBM424"}, /* IBM EBCDIC Hebrew */ + {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */ + {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */ + {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */ + {20871, "IBM871"}, /* IBM EBCDIC Icelandic */ + {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */ + {20905, "IBM905"}, /* IBM EBCDIC Turkish */ + {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */ + {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */ + {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */ + {20949, "x-cp20949"}, /* Korean Wansung */ + {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */ + /* 21027 (deprecated) */ + {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */ + {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */ + {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */ + {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */ + {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */ + {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */ + {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */ + {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */ + {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */ + {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */ + {28597, "iso8859-7"}, /* ISO 8859-7 Greek */ + {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */ + {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */ + {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */ + {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */ + {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */ + {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */ + {29001, "x-Europa"}, /* Europa 3 */ + {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */ + {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */ + {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */ + {50225, "iso-2022-kr"}, /* ISO 2022 Korean */ + {50225, "iso2022-kr"}, /* ISO 2022 Korean */ + {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */ + /* 50229 ISO 2022 Traditional Chinese */ + /* 50930 EBCDIC Japanese (Katakana) Extended */ + /* 50931 EBCDIC US-Canada and Japanese */ + /* 50933 EBCDIC Korean Extended and Korean */ + /* 50935 EBCDIC Simplified Chinese Extended and Simplified Chinese */ + /* 50936 EBCDIC Simplified Chinese */ + /* 50937 EBCDIC US-Canada and Traditional Chinese */ + /* 50939 EBCDIC Japanese (Latin) Extended and Japanese */ + {51932, "euc-jp"}, /* EUC Japanese */ + {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */ + {51949, "euc-kr"}, /* EUC Korean */ + /* 51950 EUC Traditional Chinese */ + {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */ + {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */ + {57002, "x-iscii-de"}, /* ISCII Devanagari */ + {57003, "x-iscii-be"}, /* ISCII Bengali */ + {57004, "x-iscii-ta"}, /* ISCII Tamil */ + {57005, "x-iscii-te"}, /* ISCII Telugu */ + {57006, "x-iscii-as"}, /* ISCII Assamese */ + {57007, "x-iscii-or"}, /* ISCII Oriya */ + {57008, "x-iscii-ka"}, /* ISCII Kannada */ + {57009, "x-iscii-ma"}, /* ISCII Malayalam */ + {57010, "x-iscii-gu"}, /* ISCII Gujarati */ + {57011, "x-iscii-pa"}, /* ISCII Punjabi */ + + {0, NULL} +}; + +/* + * SJIS SHIFTJIS table CP932 table + * ---- --------------------------- -------------------------------- + * 5C U+00A5 YEN SIGN U+005C REVERSE SOLIDUS + * 7E U+203E OVERLINE U+007E TILDE + * 815C U+2014 EM DASH U+2015 HORIZONTAL BAR + * 815F U+005C REVERSE SOLIDUS U+FF3C FULLWIDTH REVERSE SOLIDUS + * 8160 U+301C WAVE DASH U+FF5E FULLWIDTH TILDE + * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO + * 817C U+2212 MINUS SIGN U+FF0D FULLWIDTH HYPHEN-MINUS + * 8191 U+00A2 CENT SIGN U+FFE0 FULLWIDTH CENT SIGN + * 8192 U+00A3 POUND SIGN U+FFE1 FULLWIDTH POUND SIGN + * 81CA U+00AC NOT SIGN U+FFE2 FULLWIDTH NOT SIGN + * + * EUC-JP and ISO-2022-JP should be compatible with CP932. + * + * Kernel and MLang have different Unicode mapping table. Make sure + * which API is used. + */ +static compat_t cp932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0x301C, 0xFF5E, COMPAT_OUT}, + {0x2016, 0x2225, COMPAT_OUT}, + {0x2212, 0xFF0D, COMPAT_OUT}, + {0x00A2, 0xFFE0, COMPAT_OUT}, + {0x00A3, 0xFFE1, COMPAT_OUT}, + {0x00AC, 0xFFE2, COMPAT_OUT}, + {0, 0, 0} +}; + +static compat_t cp20932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN}, + {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN}, + {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN}, + {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN}, + {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN}, + {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN}, + {0, 0, 0} +}; + +static compat_t *cp51932_compat = cp932_compat; + +/* cp20932_compat for kernel. cp932_compat for mlang. */ +static compat_t *cp5022x_compat = cp932_compat; + +typedef HRESULT (WINAPI *CONVERTINETSTRING)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + DWORD dwDstEncoding, + LPCSTR lpSrcStr, + LPINT lpnSrcSize, + LPBYTE lpDstStr, + LPINT lpnDstSize +); +typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + LPCSTR lpSrcStr, + LPINT lpnMultiCharCount, + LPWSTR lpDstStr, + LPINT lpnWideCharCount +); +typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)( + LPDWORD lpdwMode, + DWORD dwEncoding, + LPCWSTR lpSrcStr, + LPINT lpnWideCharCount, + LPSTR lpDstStr, + LPINT lpnMultiCharCount +); +typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)( + DWORD dwSrcEncoding, + DWORD dwDstEncoding +); +typedef HRESULT (WINAPI *LCIDTORFC1766A)( + LCID Locale, + LPSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *LCIDTORFC1766W)( + LCID Locale, + LPWSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *RFC1766TOLCIDA)( + LCID *pLocale, + LPSTR pszRfc1766 +); +typedef HRESULT (WINAPI *RFC1766TOLCIDW)( + LCID *pLocale, + LPWSTR pszRfc1766 +); +static CONVERTINETSTRING ConvertINetString; +static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode; +static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte; +static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable; +static LCIDTORFC1766A LcidToRfc1766A; +static RFC1766TOLCIDA Rfc1766ToLcidA; + +static int +load_mlang() +{ + HMODULE h; + if (ConvertINetString != NULL) + return TRUE; + h = LoadLibrary("mlang.dll"); + if (!h) + return FALSE; + ConvertINetString = (CONVERTINETSTRING)GetProcAddress(h, "ConvertINetString"); + ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddress(h, "ConvertINetMultiByteToUnicode"); + ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddress(h, "ConvertINetUnicodeToMultiByte"); + IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddress(h, "IsConvertINetStringAvailable"); + LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddress(h, "LcidToRfc1766A"); + Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddress(h, "Rfc1766ToLcidA"); + return TRUE; +} + +iconv_t +iconv_open(const char *tocode, const char *fromcode) +{ + rec_iconv_t *cd; + + cd = (rec_iconv_t *)calloc(1, sizeof(rec_iconv_t)); + if (cd == NULL) + return (iconv_t)(-1); + +#if defined(USE_LIBICONV_DLL) + errno = 0; + if (libiconv_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; +#endif + + /* reset the errno to prevent reporting wrong error code. + * 0 for unsorted error. */ + errno = 0; + if (win_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; + + free(cd); + + return (iconv_t)(-1); +} + +int +iconv_close(iconv_t _cd) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + int r = cd->iconv_close(cd->cd); + int e = *(cd->_errno()); +#if defined(USE_LIBICONV_DLL) + if (cd->hlibiconv != NULL) + FreeLibrary(cd->hlibiconv); +#endif + free(cd); + errno = e; + return r; +} + +size_t +iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft); + errno = *(cd->_errno()); + return r; +} + +static int +win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to)) + return FALSE; + cd->iconv_close = win_iconv_close; + cd->iconv = win_iconv; + cd->_errno = _errno; + cd->cd = (iconv_t)cd; + return TRUE; +} + +static int +win_iconv_close(iconv_t cd) +{ + return 0; +} + +static size_t +win_iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */ + int insize; + int outsize; + int wsize; + DWORD frommode; + DWORD tomode; + uint wc; + compat_t *cp; + int i; + + if (inbuf == NULL || *inbuf == NULL) + { + if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL) + { + tomode = cd->to.mode; + outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + cd->to.mode = tomode; + return (size_t)(-1); + } + *outbuf += outsize; + *outbytesleft -= outsize; + } + cd->from.mode = 0; + cd->to.mode = 0; + return 0; + } + + while (*inbytesleft != 0) + { + frommode = cd->from.mode; + tomode = cd->to.mode; + wsize = MB_CHAR_MAX; + + insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize); + if (insize == -1) + { + cd->from.mode = frommode; + return (size_t)(-1); + } + + if (wsize == 0) + { + *inbuf += insize; + *inbytesleft -= insize; + continue; + } + + if (cd->from.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->from.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc) + { + ucs4_to_utf16(cp[i].in, wbuf, &wsize); + break; + } + } + } + + if (cd->to.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->to.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc) + { + ucs4_to_utf16(cp[i].out, wbuf, &wsize); + break; + } + } + } + + outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + cd->from.mode = frommode; + cd->to.mode = tomode; + return (size_t)(-1); + } + + *inbuf += insize; + *outbuf += outsize; + *inbytesleft -= insize; + *outbytesleft -= outsize; + } + + return 0; +} + +static int +make_csconv(const char *_name, csconv_t *cv) +{ + CPINFOEX cpinfoex; + int use_compat = TRUE; + int flag = 0; + char *name; + char *p; + + name = xstrndup(_name, strlen(_name)); + if (name == NULL) + return FALSE; + + /* check for option "enc_name//opt1//opt2" */ + while ((p = strrstr(name, "//")) != NULL) + { + if (_stricmp(p + 2, "nocompat") == 0) + use_compat = FALSE; + else if (_stricmp(p + 2, "translit") == 0) + flag |= FLAG_TRANSLIT; + else if (_stricmp(p + 2, "ignore") == 0) + flag |= FLAG_IGNORE; + *p = 0; + } + + cv->mode = 0; + cv->flags = flag; + cv->mblen = NULL; + cv->flush = NULL; + cv->compat = NULL; + cv->codepage = name_to_codepage(name); + if (cv->codepage == 1200 || cv->codepage == 1201) + { + cv->mbtowc = utf16_mbtowc; + cv->wctomb = utf16_wctomb; + if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 12000 || cv->codepage == 12001) + { + cv->mbtowc = utf32_mbtowc; + cv->wctomb = utf32_wctomb; + if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 65001) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + cv->mblen = utf8_mblen; + } + else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang()) + { + cv->mbtowc = iso2022jp_mbtowc; + cv->wctomb = iso2022jp_wctomb; + cv->flush = iso2022jp_flush; + } + else if (cv->codepage == 51932 && load_mlang()) + { + cv->mbtowc = mlang_mbtowc; + cv->wctomb = mlang_wctomb; + cv->mblen = eucjp_mblen; + } + else if (IsValidCodePage(cv->codepage) + && GetCPInfoEx(cv->codepage, 0, &cpinfoex) != 0) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + if (cpinfoex.MaxCharSize == 1) + cv->mblen = sbcs_mblen; + else if (cpinfoex.MaxCharSize == 2) + cv->mblen = dbcs_mblen; + else + cv->mblen = mbcs_mblen; + } + else + { + /* not supported */ + free(name); + errno = EINVAL; + return FALSE; + } + + if (use_compat) + { + switch (cv->codepage) + { + case 932: cv->compat = cp932_compat; break; + case 20932: cv->compat = cp20932_compat; break; + case 51932: cv->compat = cp51932_compat; break; + case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break; + } + } + + free(name); + + return TRUE; +} + +static int +name_to_codepage(const char *name) +{ + int i; + + if (*name == '\0' || + strcmp(name, "char") == 0) + return GetACP(); + else if (strcmp(name, "wchar_t") == 0) + return 1200; + else if (_strnicmp(name, "cp", 2) == 0) + return atoi(name + 2); /* CP123 */ + else if ('0' <= name[0] && name[0] <= '9') + return atoi(name); /* 123 */ + else if (_strnicmp(name, "xx", 2) == 0) + return atoi(name + 2); /* XX123 for debug */ + + for (i = 0; codepage_alias[i].name != NULL; ++i) + if (_stricmp(name, codepage_alias[i].name) == 0) + return codepage_alias[i].codepage; + return -1; +} + +/* + * http://www.faqs.org/rfcs/rfc2781.html + */ +static uint +utf16_to_ucs4(const ushort *wbuf) +{ + uint wc = wbuf[0]; + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000; + return wc; +} + +static void +ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize) +{ + if (wc < 0x10000) + { + wbuf[0] = wc; + *wbufsize = 1; + } + else + { + wc -= 0x10000; + wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF); + wbuf[1] = 0xDC00 | (wc & 0x3FF); + *wbufsize = 2; + } +} + +/* + * Check if codepage is one of those for which the dwFlags parameter + * to MultiByteToWideChar() must be zero. Return zero or + * MB_ERR_INVALID_CHARS. The docs in Platform SDK for for Windows + * Server 2003 R2 claims that also codepage 65001 is one of these, but + * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave + * out 65001 (UTF-8), and that indeed seems to be the case on XP, it + * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting + * from UTF-8. + */ +static int +mbtowc_flags(int codepage) +{ + return (codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS; +} + +/* + * Check if codepage is one those for which the lpUsedDefaultChar + * parameter to WideCharToMultiByte() must be NULL. The docs in + * Platform SDK for for Windows Server 2003 R2 claims that this is the + * list below, while the MSDN docs for MSVS2008 claim that it is only + * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform + * SDK seems to be correct, at least for XP. + */ +static int +must_use_null_useddefaultchar(int codepage) +{ + return (codepage == 65000 || codepage == 65001 || + codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 42); +} + +static char * +strrstr(const char *str, const char *token) +{ + int len = strlen(token); + const char *p = str + strlen(str); + + while (str <= --p) + if (p[0] == token[0] && strncmp(p, token, len) == 0) + return (char *)p; + return NULL; +} + +static char * +xstrndup(const char *s, size_t n) +{ + char *p; + + p = (char *)malloc(n + 1); + if (p == NULL) + return NULL; + memcpy(p, s, n); + p[n] = '\0'; + return p; +} + +static int +seterror(int err) +{ + errno = err; + return -1; +} + +#if defined(USE_LIBICONV_DLL) +static int +libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + HMODULE hlibiconv = NULL; + HMODULE hmsvcrt = NULL; + char *dllname; + const char *p; + const char *e; + f_iconv_open _iconv_open; + + /* + * always try to load dll, so that we can switch dll in runtime. + */ + + /* XXX: getenv() can't get variable set by SetEnvironmentVariable() */ + p = getenv("WINICONV_LIBICONV_DLL"); + if (p == NULL) + p = DEFAULT_LIBICONV_DLL; + /* parse comma separated value */ + for ( ; *p != 0; p = (*e == ',') ? e + 1 : e) + { + e = strchr(p, ','); + if (p == e) + continue; + else if (e == NULL) + e = p + strlen(p); + dllname = xstrndup(p, e - p); + if (dllname == NULL) + return FALSE; + hlibiconv = LoadLibrary(dllname); + free(dllname); + if (hlibiconv != NULL) + { + if (hlibiconv == hwiniconv) + { + FreeLibrary(hlibiconv); + hlibiconv = NULL; + continue; + } + break; + } + } + + if (hlibiconv == NULL) + goto failed; + + hmsvcrt = find_imported_module_by_funcname(hlibiconv, "_errno"); + if (hmsvcrt == NULL) + goto failed; + + _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "libiconv_open"); + if (_iconv_open == NULL) + _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "iconv_open"); + cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "libiconv_close"); + if (cd->iconv_close == NULL) + cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "iconv_close"); + cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "libiconv"); + if (cd->iconv == NULL) + cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "iconv"); + cd->_errno = (f_errno)GetProcAddress(hmsvcrt, "_errno"); + if (_iconv_open == NULL || cd->iconv_close == NULL + || cd->iconv == NULL || cd->_errno == NULL) + goto failed; + + cd->cd = _iconv_open(tocode, fromcode); + if (cd->cd == (iconv_t)(-1)) + goto failed; + + cd->hlibiconv = hlibiconv; + return TRUE; + +failed: + if (hlibiconv != NULL) + FreeLibrary(hlibiconv); + /* do not free hmsvcrt which is obtained by GetModuleHandle() */ + return FALSE; +} + +/* + * Reference: + * http://forums.belution.com/ja/vc/000/234/78s.shtml + * http://nienie.com/~masapico/api_ImageDirectoryEntryToData.html + * + * The formal way is + * imagehlp.h or dbghelp.h + * imagehlp.lib or dbghelp.lib + * ImageDirectoryEntryToData() + */ +#define TO_DOS_HEADER(base) ((PIMAGE_DOS_HEADER)(base)) +#define TO_NT_HEADERS(base) ((PIMAGE_NT_HEADERS)((LPBYTE)(base) + TO_DOS_HEADER(base)->e_lfanew)) +static PVOID +MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size) +{ + /* TODO: MappedAsImage? */ + PIMAGE_DATA_DIRECTORY p; + p = TO_NT_HEADERS(Base)->OptionalHeader.DataDirectory + DirectoryEntry; + if (p->VirtualAddress == 0) { + *Size = 0; + return NULL; + } + *Size = p->Size; + return (PVOID)((LPBYTE)Base + p->VirtualAddress); +} + +static HMODULE +find_imported_module_by_funcname(HMODULE hModule, const char *funcname) +{ + DWORD Base; + ULONG Size; + PIMAGE_IMPORT_DESCRIPTOR Imp; + PIMAGE_THUNK_DATA Name; /* Import Name Table */ + PIMAGE_IMPORT_BY_NAME ImpName; + + Base = (DWORD)hModule; + Imp = MyImageDirectoryEntryToData( + (LPVOID)Base, + TRUE, + IMAGE_DIRECTORY_ENTRY_IMPORT, + &Size); + if (Imp == NULL) + return NULL; + for ( ; Imp->OriginalFirstThunk != 0; ++Imp) + { + Name = (PIMAGE_THUNK_DATA)(Base + Imp->OriginalFirstThunk); + for ( ; Name->u1.Ordinal != 0; ++Name) + { + if (!IMAGE_SNAP_BY_ORDINAL(Name->u1.Ordinal)) + { + ImpName = (PIMAGE_IMPORT_BY_NAME) + (Base + (DWORD)Name->u1.AddressOfData); + if (strcmp((char *)ImpName->Name, funcname) == 0) + return GetModuleHandle((char *)(Base + Imp->Name)); + } + } + } + return NULL; +} +#endif + +static int +sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + return 1; +} + +static int +dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1; + if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = 0; + + if (cv->codepage == 54936) { + if (buf[0] <= 0x7F) len = 1; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 2 && + ((buf[1] >= 0x40 && buf[1] <= 0x7E) || + (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 4 && + buf[1] >= 0x30 && buf[1] <= 0x39) len = 4; + else + return seterror(EINVAL); + return len; + } + else + return seterror(EINVAL); +} + +static int +utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = 0; + + if (buf[0] < 0x80) len = 1; + else if ((buf[0] & 0xE0) == 0xC0) len = 2; + else if ((buf[0] & 0xF0) == 0xE0) len = 3; + else if ((buf[0] & 0xF8) == 0xF0) len = 4; + else if ((buf[0] & 0xFC) == 0xF8) len = 5; + else if ((buf[0] & 0xFE) == 0xFC) len = 6; + + if (len == 0) + return seterror(EILSEQ); + else if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + if (buf[0] < 0x80) /* ASCII */ + return 1; + else if (buf[0] == 0x8E) /* JIS X 0201 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF)) + return seterror(EILSEQ); + return 2; + } + else if (buf[0] == 0x8F) /* JIS X 0212 */ + { + if (bufsize < 3) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE) + || !(0xA1 <= buf[2] && buf[2] <= 0xFE)) + return seterror(EILSEQ); + return 3; + } + else /* JIS X 0208 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE) + || !(0xA1 <= buf[1] && buf[1] <= 0xFE)) + return seterror(EILSEQ); + return 2; + } +} + +static int +kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage), + (const char *)buf, len, (wchar_t *)wbuf, *wbufsize); + if (*wbufsize == 0) + return seterror(EILSEQ); + return len; +} + +static int +kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + BOOL usedDefaultChar = 0; + BOOL *p = NULL; + int flags = 0; + int len; + + if (bufsize == 0) + return seterror(E2BIG); + if (!must_use_null_useddefaultchar(cv->codepage)) + { + p = &usedDefaultChar; +#ifdef WC_NO_BEST_FIT_CHARS + if (!(cv->flags & FLAG_TRANSLIT)) + flags |= WC_NO_BEST_FIT_CHARS; +#endif + } + len = WideCharToMultiByte(cv->codepage, flags, + (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p); + if (len == 0) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + return seterror(E2BIG); + return seterror(EILSEQ); + } + else if (usedDefaultChar) + return seterror(EILSEQ); + else if (cv->mblen(cv, buf, len) != len) /* validate result */ + return seterror(EILSEQ); + return len; +} + +/* + * It seems that the mode (cv->mode) is fixnum. + * For example, when converting iso-2022-jp(cp50221) to unicode: + * in ascii sequence: mode=0xC42C0000 + * in jisx0208 sequence: mode=0xC42C0001 + * "C42C" is same for each convert session. + * It should be: ((codepage-1)<<16)|state + */ +static int +mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + int insize; + HRESULT hr; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + insize = len; + hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage, + (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len) + return seterror(EILSEQ); + return len; +} + +static int +mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */ + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + + hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) + return seterror(EILSEQ); + memcpy(buf, tmpbuf, tmpsize); + return tmpsize; +} + +static int +utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + + /* swap endian: 1200 <-> 1201 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 2) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[0] = (buf[1] << 8) | buf[0]; + else if (codepage == 1201) /* big endian */ + wbuf[0] = (buf[0] << 8) | buf[1]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wbuf[0] == 0xFFFE) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 2; + } + else if (wbuf[0] == 0xFEFF) + { + *wbufsize = 0; + return 2; + } + } + + if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF) + return seterror(EILSEQ); + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[1] = (buf[3] << 8) | buf[2]; + else if (codepage == 1201) /* big endian */ + wbuf[1] = (buf[2] << 8) | buf[3]; + if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF)) + return seterror(EILSEQ); + *wbufsize = 2; + return 4; + } + *wbufsize = 1; + return 2; +} + +static int +utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + memcpy(buf, "\xFF\xFE", 2); + else if (cv->codepage == 1201) /* big endian */ + memcpy(buf, "\xFE\xFF", 2); + + r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2); + if (r == -1) + return -1; + return r + 2; + } + + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[0] = (wbuf[0] & 0x00FF); + buf[1] = (wbuf[0] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[0] = (wbuf[0] & 0xFF00) >> 8; + buf[1] = (wbuf[0] & 0x00FF); + } + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[2] = (wbuf[1] & 0x00FF); + buf[3] = (wbuf[1] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[2] = (wbuf[1] & 0xFF00) >> 8; + buf[3] = (wbuf[1] & 0x00FF); + } + return 4; + } + return 2; +} + +static int +utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + uint wc; + + /* swap endian: 12000 <-> 12001 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 12000) /* little endian */ + wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; + else if (codepage == 12001) /* big endian */ + wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wc == 0xFFFE0000) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 4; + } + else if (wc == 0x0000FEFF) + { + *wbufsize = 0; + return 4; + } + } + + if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc) + return seterror(EILSEQ); + ucs4_to_utf16(wc, wbuf, wbufsize); + return 4; +} + +static int +utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + uint wc; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 12000) /* little endian */ + memcpy(buf, "\xFF\xFE\x00\x00", 4); + else if (cv->codepage == 12001) /* big endian */ + memcpy(buf, "\x00\x00\xFE\xFF", 4); + + r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4); + if (r == -1) + return -1; + return r + 4; + } + + if (bufsize < 4) + return seterror(E2BIG); + wc = utf16_to_ucs4(wbuf); + if (cv->codepage == 12000) /* little endian */ + { + buf[0] = wc & 0x000000FF; + buf[1] = (wc & 0x0000FF00) >> 8; + buf[2] = (wc & 0x00FF0000) >> 16; + buf[3] = (wc & 0xFF000000) >> 24; + } + else if (cv->codepage == 12001) /* big endian */ + { + buf[0] = (wc & 0xFF000000) >> 24; + buf[1] = (wc & 0x00FF0000) >> 16; + buf[2] = (wc & 0x0000FF00) >> 8; + buf[3] = wc & 0x000000FF; + } + return 4; +} + +/* + * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) + * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow + * 1 byte Kana) + * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte + * Kana - SO/SI) + * + * MultiByteToWideChar() and WideCharToMultiByte() behave differently + * depending on Windows version. On XP, WideCharToMultiByte() doesn't + * terminate result sequence with ascii escape. But Vista does. + * Use MLang instead. + */ + +#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift)) +#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF) +#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF) + +#define ISO2022_SI 0 +#define ISO2022_SO 1 + +/* shift in */ +static const char iso2022_SI_seq[] = "\x0F"; +/* shift out */ +static const char iso2022_SO_seq[] = "\x0E"; + +typedef struct iso2022_esc_t iso2022_esc_t; +struct iso2022_esc_t { + const char *esc; + int esc_len; + int len; + int cs; +}; + +#define ISO2022JP_CS_ASCII 0 +#define ISO2022JP_CS_JISX0201_ROMAN 1 +#define ISO2022JP_CS_JISX0201_KANA 2 +#define ISO2022JP_CS_JISX0208_1978 3 +#define ISO2022JP_CS_JISX0208_1983 4 +#define ISO2022JP_CS_JISX0212 5 + +static iso2022_esc_t iso2022jp_esc[] = { + {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII}, + {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN}, + {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA}, + {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */ + {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983}, + {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212}, + {NULL, 0, 0, 0} +}; + +static int +iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int insize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + if (buf[0] == 0x1B) + { + for (i = 0; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (bufsize < esc_len) + { + if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0) + return seterror(EINVAL); + } + else + { + if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0) + { + cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI); + *wbufsize = 0; + return esc_len; + } + } + } + /* not supported escape sequence */ + return seterror(EILSEQ); + } + else if (buf[0] == iso2022_SO_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO); + *wbufsize = 0; + return 1; + } + else if (buf[0] == iso2022_SI_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI); + *wbufsize = 0; + return 1; + } + + cs = ISO2022_MODE_CS(cv->mode); + shift = ISO2022_MODE_SHIFT(cv->mode); + + /* reset the mode for informal sequence */ + if (buf[0] < 0x20) + { + cs = ISO2022JP_CS_ASCII; + shift = ISO2022_SI; + } + + len = iesc[cs].len; + if (bufsize < len) + return seterror(EINVAL); + for (i = 0; i < len; ++i) + if (!(buf[i] < 0x80)) + return seterror(EILSEQ); + esc_len = iesc[cs].esc_len; + memcpy(tmp, iesc[cs].esc, esc_len); + if (shift == ISO2022_SO) + { + memcpy(tmp + esc_len, iso2022_SO_seq, 1); + esc_len += 1; + } + memcpy(tmp + esc_len, buf, len); + + if ((cv->codepage == 50220 || cv->codepage == 50221 + || cv->codepage == 50222) && shift == ISO2022_SO) + { + /* XXX: shift-out cannot be used for mbtowc (both kernel and + * mlang) */ + esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len; + memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len); + memcpy(tmp + esc_len, buf, len); + } + + insize = len + esc_len; + hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage, + (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len + esc_len) + return seterror(EILSEQ); + + /* Check for conversion error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (wbuf[0] == buf[0] + && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + return seterror(EILSEQ); + + /* reset the mode for informal sequence */ + if (cv->mode != ISO2022_MODE(cs, shift)) + cv->mode = ISO2022_MODE(cs, shift); + + return len; +} + +static int +iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + /* + * MultiByte = [escape sequence] + character + [escape sequence] + * + * Whether trailing escape sequence is added depends on which API is + * used (kernel or MLang, and its version). + */ + hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + + if (tmpsize == 1) + { + cs = ISO2022JP_CS_ASCII; + esc_len = 0; + } + else + { + for (i = 1; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (strncmp(tmp, iesc[i].esc, esc_len) == 0) + { + cs = iesc[i].cs; + break; + } + } + if (iesc[i].esc == NULL) + /* not supported escape sequence */ + return seterror(EILSEQ); + } + + shift = ISO2022_SI; + if (tmp[esc_len] == iso2022_SO_seq[0]) + { + shift = ISO2022_SO; + esc_len += 1; + } + + len = iesc[cs].len; + + /* Check for converting error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80)) + return seterror(EILSEQ); + else if (tmpsize < esc_len + len) + return seterror(EILSEQ); + + if (cv->mode == ISO2022_MODE(cs, shift)) + { + /* remove escape sequence */ + if (esc_len != 0) + memmove(tmp, tmp + esc_len, len); + esc_len = 0; + } + else + { + if (cs == ISO2022JP_CS_ASCII) + { + esc_len = iesc[ISO2022JP_CS_ASCII].esc_len; + memmove(tmp + esc_len, tmp, len); + memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len); + } + if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO) + { + /* shift-in before changing to other mode */ + memmove(tmp + 1, tmp, len + esc_len); + memcpy(tmp, iso2022_SI_seq, 1); + esc_len += 1; + } + } + + if (bufsize < len + esc_len) + return seterror(E2BIG); + memcpy(buf, tmp, len + esc_len); + cv->mode = ISO2022_MODE(cs, shift); + return len + esc_len; +} + +static int +iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + int esc_len; + + if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + { + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + esc_len += 1; + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + if (bufsize < esc_len) + return seterror(E2BIG); + + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + { + memcpy(buf, iso2022_SI_seq, 1); + esc_len += 1; + } + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + { + memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc, + iesc[ISO2022JP_CS_ASCII].esc_len); + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + } + return esc_len; + } + return 0; +} + +#if defined(MAKE_DLL) && defined(USE_LIBICONV_DLL) +BOOL WINAPI +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) +{ + switch( fdwReason ) + { + case DLL_PROCESS_ATTACH: + hwiniconv = (HMODULE)hinstDLL; + break; + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} +#endif + +#if defined(MAKE_EXE) +#include +#include +#include +int +main(int argc, char **argv) +{ + char *fromcode = NULL; + char *tocode = NULL; + int i; + char inbuf[BUFSIZ]; + char outbuf[BUFSIZ]; + const char *pin; + char *pout; + size_t inbytesleft; + size_t outbytesleft; + size_t rest = 0; + iconv_t cd; + size_t r; + FILE *in = stdin; + + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); + + for (i = 1; i < argc; ++i) + { + if (strcmp(argv[i], "-l") == 0) + { + for (i = 0; codepage_alias[i].name != NULL; ++i) + printf("%s\n", codepage_alias[i].name); + return 0; + } + + if (strcmp(argv[i], "-f") == 0) + fromcode = argv[++i]; + else if (strcmp(argv[i], "-t") == 0) + tocode = argv[++i]; + else + { + in = fopen(argv[i], "rb"); + if (in == NULL) + { + fprintf(stderr, "cannot open %s\n", argv[i]); + return 1; + } + break; + } + } + + if (fromcode == NULL || tocode == NULL) + { + printf("usage: %s -f from-enc -t to-enc [file]\n", argv[0]); + return 0; + } + + cd = iconv_open(tocode, fromcode); + if (cd == (iconv_t)(-1)) + { + perror("iconv_open error"); + return 1; + } + + while ((inbytesleft = fread(inbuf + rest, 1, sizeof(inbuf) - rest, in)) != 0 + || rest != 0) + { + inbytesleft += rest; + pin = inbuf; + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); + if (r == (size_t)(-1) && errno != E2BIG && (errno != EINVAL || feof(in))) + { + perror("conversion error"); + return 1; + } + memmove(inbuf, pin, inbytesleft); + rest = inbytesleft; + } + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, NULL, NULL, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); + if (r == (size_t)(-1)) + { + perror("conversion error"); + return 1; + } + + iconv_close(cd); + + return 0; +} +#endif + diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/Makefile b/src/mod/endpoints/mod_gsmopen/win_iconv/Makefile new file mode 100644 index 0000000000..c0969f607f --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/Makefile @@ -0,0 +1,72 @@ + +# comma separated list (e.g. "iconv.dll,libiconv.dll") +DEFAULT_LIBICONV_DLL ?= \"\" + +CFLAGS += -pedantic -Wall +CFLAGS += -DUSE_LIBICONV_DLL +CFLAGS += -DDEFAULT_LIBICONV_DLL=$(DEFAULT_LIBICONV_DLL) + +all: iconv.dll libiconv.a win_iconv.exe + +dist: test win_iconv.zip + +iconv.dll: win_iconv.c + gcc $(CFLAGS) -c win_iconv.c -DMAKE_DLL + dllwrap --dllname iconv.dll --def iconv.def win_iconv.o $(SPECS_FLAGS) + strip iconv.dll + +libiconv.a: win_iconv.c + gcc $(CFLAGS) -c win_iconv.c + ar rcs libiconv.a win_iconv.o + ranlib libiconv.a + +win_iconv.exe: win_iconv.c + gcc $(CFLAGS) -s -o win_iconv.exe win_iconv.c -DMAKE_EXE + +libmlang.a: mlang.def + dlltool --kill-at --input-def mlang.def --output-lib libmlang.a + +test: + gcc $(CFLAGS) -s -o win_iconv_test.exe win_iconv_test.c + ./win_iconv_test.exe + +win_iconv.zip: msvcrt msvcr70 msvcr71 + rm -rf win_iconv + svn export . win_iconv + cp msvcrt/iconv.dll msvcrt/win_iconv.exe win_iconv/ + mkdir win_iconv/msvcr70 + cp msvcr70/iconv.dll win_iconv/msvcr70/ + mkdir win_iconv/msvcr71 + cp msvcr71/iconv.dll win_iconv/msvcr71/ + zip -r win_iconv.zip win_iconv + +msvcrt: + svn export . msvcrt; \ + cd msvcrt; \ + $(MAKE); + +msvcr70: + svn export . msvcr70; \ + cd msvcr70; \ + gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr70/ > specs; \ + $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs"; + +msvcr71: + svn export . msvcr71; \ + cd msvcr71; \ + gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr71/ > specs; \ + $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs"; + +clean: + rm -f win_iconv.exe + rm -f win_iconv.o + rm -f iconv.dll + rm -f libiconv.a + rm -f win_iconv_test.exe + rm -f libmlang.a + rm -rf win_iconv + rm -rf win_iconv.zip + rm -rf msvcrt + rm -rf msvcr70 + rm -rf msvcr71 + diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.def b/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.def new file mode 100644 index 0000000000..f609c86a59 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.def @@ -0,0 +1,24 @@ +LIBRARY ICONV.DLL +EXPORTS + iconv + iconv_open + iconv_close + iconvctl + libiconv=iconv + libiconv_open=iconv_open + libiconv_close=iconv_close + libiconvctl=iconvctl +;; libiconv-1.11.dll +;; TODO for binary compatibility +; _libiconv_version @1 +; aliases2_lookup @2 +; aliases_lookup @3 +; iconv_canonicalize @4 +; libiconv @5 +; libiconv_close @6 +; libiconv_open @7 +; libiconv_relocate @8 +; libiconv_set_relocation_prefix @9 +; libiconvctl @10 +; libiconvlist @11 +; locale_charset @12 diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.h b/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.h new file mode 100644 index 0000000000..7c941fe435 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.h @@ -0,0 +1,5 @@ +#include +typedef void* iconv_t; +iconv_t iconv_open(const char *tocode, const char *fromcode); +int iconv_close(iconv_t cd); +size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.def b/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.def new file mode 100644 index 0000000000..cb475aeea8 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.def @@ -0,0 +1,11 @@ +LIBRARY MLANG.DLL +EXPORTS + ConvertINetMultiByteToUnicode@24 + ;; ConvertINetReset (not documented) + ConvertINetString@28 + ConvertINetUnicodeToMultiByte@24 + IsConvertINetStringAvailable@8 + LcidToRfc1766A@12 + LcidToRfc1766W@12 + Rfc1766ToLcidA@8 + Rfc1766ToLcidW@8 diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.h b/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.h new file mode 100644 index 0000000000..525f484e98 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.h @@ -0,0 +1,54 @@ +HRESULT WINAPI ConvertINetString( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + DWORD dwDstEncoding, + LPCSTR lpSrcStr, + LPINT lpnSrcSize, + LPBYTE lpDstStr, + LPINT lpnDstSize +); + +HRESULT WINAPI ConvertINetMultiByteToUnicode( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + LPCSTR lpSrcStr, + LPINT lpnMultiCharCount, + LPWSTR lpDstStr, + LPINT lpnWideCharCount +); + +HRESULT WINAPI ConvertINetUnicodeToMultiByte( + LPDWORD lpdwMode, + DWORD dwEncoding, + LPCWSTR lpSrcStr, + LPINT lpnWideCharCount, + LPSTR lpDstStr, + LPINT lpnMultiCharCount +); + +HRESULT WINAPI IsConvertINetStringAvailable( + DWORD dwSrcEncoding, + DWORD dwDstEncoding +); + +HRESULT WINAPI LcidToRfc1766A( + LCID Locale, + LPSTR pszRfc1766, + int nChar +); + +HRESULT WINAPI LcidToRfc1766W( + LCID Locale, + LPWSTR pszRfc1766, + int nChar +); + +HRESULT WINAPI Rfc1766ToLcidA( + LCID *pLocale, + LPSTR pszRfc1766 +); + +HRESULT WINAPI Rfc1766ToLcidW( + LCID *pLocale, + LPWSTR pszRfc1766 +); diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/readme.txt b/src/mod/endpoints/mod_gsmopen/win_iconv/readme.txt new file mode 100644 index 0000000000..c4fb7d692b --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/readme.txt @@ -0,0 +1,3 @@ +win_iconv is a iconv library using Win32 API to conversion. +win_iconv is placed in the public domain. +Yukihiro Nakadaira diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv.c b/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv.c new file mode 100644 index 0000000000..94c8d4a1e7 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv.c @@ -0,0 +1,1986 @@ +/* + * iconv library using Win32 API to conversion. + * + * This file is placed in the public domain. + * + * Last Change: 2009-07-06 + * + * ENVIRONMENT VARIABLE: + * WINICONV_LIBICONV_DLL + * If $WINICONV_LIBICONV_DLL is set, win_iconv uses the DLL. If + * loading the DLL or iconv_open() failed, falls back to internal + * conversion. If a few DLL are specified as comma separated list, + * the first loadable DLL is used. The DLL should have iconv_open(), + * iconv_close() and iconv(). Or libiconv_open(), libiconv_close() + * and libiconv(). + * (only available when USE_LIBICONV_DLL is defined at compile time) + * + * Win32 API does not support strict encoding conversion for some + * codepage. And MLang function drop or replace invalid bytes and does + * not return useful error status as iconv. This implementation cannot + * be used for encoding validation purpose. + */ + +/* for WC_NO_BEST_FIT_CHARS */ +#ifndef WINVER +# define WINVER 0x0500 +#endif + +#include +#include +#include +#include + +#if 0 +# define MAKE_EXE +# define MAKE_DLL +# define USE_LIBICONV_DLL +#endif + +#if !defined(DEFAULT_LIBICONV_DLL) +# define DEFAULT_LIBICONV_DLL "" +#endif + +#define MB_CHAR_MAX 16 + +#define UNICODE_MODE_BOM_DONE 1 +#define UNICODE_MODE_SWAPPED 2 + +#define FLAG_USE_BOM 1 +#define FLAG_TRANSLIT 2 /* //TRANSLIT */ +#define FLAG_IGNORE 4 /* //IGNORE (not implemented) */ + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; + +typedef void* iconv_t; + +iconv_t iconv_open(const char *tocode, const char *fromcode); +int iconv_close(iconv_t cd); +size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +/* libiconv interface for vim */ +#if defined(MAKE_DLL) +int +iconvctl (iconv_t cd, int request, void* argument) +{ + /* not supported */ + return 0; +} +#endif + +typedef struct compat_t compat_t; +typedef struct csconv_t csconv_t; +typedef struct rec_iconv_t rec_iconv_t; + +typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode); +typedef int (*f_iconv_close)(iconv_t cd); +typedef size_t (*f_iconv)(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +typedef int* (*f_errno)(void); +typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize); +typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize); + +#define COMPAT_IN 1 +#define COMPAT_OUT 2 + +/* unicode mapping for compatibility with other conversion table. */ +struct compat_t { + uint in; + uint out; + uint flag; +}; + +struct csconv_t { + int codepage; + int flags; + f_mbtowc mbtowc; + f_wctomb wctomb; + f_mblen mblen; + f_flush flush; + DWORD mode; + compat_t *compat; +}; + +struct rec_iconv_t { + iconv_t cd; + f_iconv_close iconv_close; + f_iconv iconv; + f_errno _errno; + csconv_t from; + csconv_t to; +#if defined(USE_LIBICONV_DLL) + HMODULE hlibiconv; +#endif +}; + +static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static int win_iconv_close(iconv_t cd); +static size_t win_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +static int load_mlang(); +static int make_csconv(const char *name, csconv_t *cv); +static int name_to_codepage(const char *name); +static uint utf16_to_ucs4(const ushort *wbuf); +static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize); +static int mbtowc_flags(int codepage); +static int must_use_null_useddefaultchar(int codepage); +static char *strrstr(const char *str, const char *token); +static char *xstrndup(const char *s, size_t n); +static int seterror(int err); + +#if defined(USE_LIBICONV_DLL) +static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size); +static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname); + +static HMODULE hwiniconv; +#endif + +static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize); + +static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize); + +static struct { + int codepage; + const char *name; +} codepage_alias[] = { + {65001, "CP65001"}, + {65001, "UTF8"}, + {65001, "UTF-8"}, + + {1200, "CP1200"}, + {1200, "UTF16LE"}, + {1200, "UTF-16LE"}, + {1200, "UCS-2LE"}, + + {1201, "CP1201"}, + {1201, "UTF16BE"}, + {1201, "UTF-16BE"}, + {1201, "UCS-2BE"}, + {1201, "unicodeFFFE"}, + + {12000, "CP12000"}, + {12000, "UTF32LE"}, + {12000, "UTF-32LE"}, + + {12001, "CP12001"}, + {12001, "UTF32BE"}, + {12001, "UTF-32BE"}, + +#ifndef GLIB_COMPILATION + /* + * Default is big endian. + * See rfc2781 4.3 Interpreting text labelled as UTF-16. + */ + {1201, "UTF16"}, + {1201, "UTF-16"}, + {12001, "UTF32"}, + {12001, "UTF-32"}, +#else + /* Default is little endian, because the platform is */ + {1200, "UTF16"}, + {1200, "UTF-16"}, + {1200, "UCS-2"}, + {12000, "UTF32"}, + {12000, "UTF-32"}, +#endif + + /* copy from libiconv `iconv -l` */ + /* !IsValidCodePage(367) */ + {20127, "ANSI_X3.4-1968"}, + {20127, "ANSI_X3.4-1986"}, + {20127, "ASCII"}, + {20127, "CP367"}, + {20127, "IBM367"}, + {20127, "ISO-IR-6"}, + {20127, "ISO646-US"}, + {20127, "ISO_646.IRV:1991"}, + {20127, "US"}, + {20127, "US-ASCII"}, + {20127, "CSASCII"}, + + /* !IsValidCodePage(819) */ + {1252, "CP819"}, + {1252, "IBM819"}, + {28591, "ISO-8859-1"}, + {28591, "ISO-IR-100"}, + {28591, "ISO8859-1"}, + {28591, "ISO_8859-1"}, + {28591, "ISO_8859-1:1987"}, + {28591, "L1"}, + {28591, "LATIN1"}, + {28591, "CSISOLATIN1"}, + + {1250, "CP1250"}, + {1250, "MS-EE"}, + {1250, "WINDOWS-1250"}, + + {1251, "CP1251"}, + {1251, "MS-CYRL"}, + {1251, "WINDOWS-1251"}, + + {1252, "CP1252"}, + {1252, "MS-ANSI"}, + {1252, "WINDOWS-1252"}, + + {1253, "CP1253"}, + {1253, "MS-GREEK"}, + {1253, "WINDOWS-1253"}, + + {1254, "CP1254"}, + {1254, "MS-TURK"}, + {1254, "WINDOWS-1254"}, + + {1255, "CP1255"}, + {1255, "MS-HEBR"}, + {1255, "WINDOWS-1255"}, + + {1256, "CP1256"}, + {1256, "MS-ARAB"}, + {1256, "WINDOWS-1256"}, + + {1257, "CP1257"}, + {1257, "WINBALTRIM"}, + {1257, "WINDOWS-1257"}, + + {1258, "CP1258"}, + {1258, "WINDOWS-1258"}, + + {850, "850"}, + {850, "CP850"}, + {850, "IBM850"}, + {850, "CSPC850MULTILINGUAL"}, + + /* !IsValidCodePage(862) */ + {862, "862"}, + {862, "CP862"}, + {862, "IBM862"}, + {862, "CSPC862LATINHEBREW"}, + + {866, "866"}, + {866, "CP866"}, + {866, "IBM866"}, + {866, "CSIBM866"}, + + /* !IsValidCodePage(154) */ + {154, "CP154"}, + {154, "CYRILLIC-ASIAN"}, + {154, "PT154"}, + {154, "PTCP154"}, + {154, "CSPTCP154"}, + + /* !IsValidCodePage(1133) */ + {1133, "CP1133"}, + {1133, "IBM-CP1133"}, + + {874, "CP874"}, + {874, "WINDOWS-874"}, + + /* !IsValidCodePage(51932) */ + {51932, "CP51932"}, + {51932, "MS51932"}, + {51932, "WINDOWS-51932"}, + {51932, "EUC-JP"}, + + {932, "CP932"}, + {932, "MS932"}, + {932, "SHIFFT_JIS"}, + {932, "SHIFFT_JIS-MS"}, + {932, "SJIS"}, + {932, "SJIS-MS"}, + {932, "SJIS-OPEN"}, + {932, "SJIS-WIN"}, + {932, "WINDOWS-31J"}, + {932, "WINDOWS-932"}, + {932, "CSWINDOWS31J"}, + + {50221, "CP50221"}, + {50221, "ISO-2022-JP"}, + {50221, "ISO-2022-JP-MS"}, + {50221, "ISO2022-JP"}, + {50221, "ISO2022-JP-MS"}, + {50221, "MS50221"}, + {50221, "WINDOWS-50221"}, + + {936, "CP936"}, + {936, "GBK"}, + {936, "MS936"}, + {936, "WINDOWS-936"}, + + {950, "CP950"}, + {950, "BIG5"}, + + {949, "CP949"}, + {949, "UHC"}, + {949, "EUC-KR"}, + + {1361, "CP1361"}, + {1361, "JOHAB"}, + + {437, "437"}, + {437, "CP437"}, + {437, "IBM437"}, + {437, "CSPC8CODEPAGE437"}, + + {737, "CP737"}, + + {775, "CP775"}, + {775, "IBM775"}, + {775, "CSPC775BALTIC"}, + + {852, "852"}, + {852, "CP852"}, + {852, "IBM852"}, + {852, "CSPCP852"}, + + /* !IsValidCodePage(853) */ + {853, "CP853"}, + + {855, "855"}, + {855, "CP855"}, + {855, "IBM855"}, + {855, "CSIBM855"}, + + {857, "857"}, + {857, "CP857"}, + {857, "IBM857"}, + {857, "CSIBM857"}, + + /* !IsValidCodePage(858) */ + {858, "CP858"}, + + {860, "860"}, + {860, "CP860"}, + {860, "IBM860"}, + {860, "CSIBM860"}, + + {861, "861"}, + {861, "CP-IS"}, + {861, "CP861"}, + {861, "IBM861"}, + {861, "CSIBM861"}, + + {863, "863"}, + {863, "CP863"}, + {863, "IBM863"}, + {863, "CSIBM863"}, + + {864, "CP864"}, + {864, "IBM864"}, + {864, "CSIBM864"}, + + {865, "865"}, + {865, "CP865"}, + {865, "IBM865"}, + {865, "CSIBM865"}, + + {869, "869"}, + {869, "CP-GR"}, + {869, "CP869"}, + {869, "IBM869"}, + {869, "CSIBM869"}, + + /* !IsValidCodePage(1152) */ + {1125, "CP1125"}, + + /* + * Code Page Identifiers + * http://msdn2.microsoft.com/en-us/library/ms776446.aspx + */ + {37, "IBM037"}, /* IBM EBCDIC US-Canada */ + {437, "IBM437"}, /* OEM United States */ + {500, "IBM500"}, /* IBM EBCDIC International */ + {708, "ASMO-708"}, /* Arabic (ASMO 708) */ + /* 709 Arabic (ASMO-449+, BCON V4) */ + /* 710 Arabic - Transparent Arabic */ + {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */ + {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */ + {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */ + {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */ + {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */ + {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */ + {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */ + {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */ + {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */ + {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */ + {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */ + {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */ + {864, "IBM864"}, /* OEM Arabic; Arabic (864) */ + {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */ + {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */ + {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */ + {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */ + {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */ + {875, "cp875"}, /* IBM EBCDIC Greek Modern */ + {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */ + {932, "shift-jis"}, /* alternative name for it */ + {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */ + {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */ + {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */ + {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */ + {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */ + {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */ + {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */ + {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */ + {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */ + {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */ + {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */ + {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */ + {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */ + {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */ + {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */ + {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */ + {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */ + {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */ + {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */ + {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */ + {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */ + {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */ + {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */ + {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */ + {1361, "Johab"}, /* Korean (Johab) */ + {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */ + {10001, "x-mac-japanese"}, /* Japanese (Mac) */ + {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */ + {10003, "x-mac-korean"}, /* Korean (Mac) */ + {10004, "x-mac-arabic"}, /* Arabic (Mac) */ + {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */ + {10006, "x-mac-greek"}, /* Greek (Mac) */ + {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */ + {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */ + {10010, "x-mac-romanian"}, /* Romanian (Mac) */ + {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */ + {10021, "x-mac-thai"}, /* Thai (Mac) */ + {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */ + {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */ + {10081, "x-mac-turkish"}, /* Turkish (Mac) */ + {10082, "x-mac-croatian"}, /* Croatian (Mac) */ + {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */ + {20001, "x-cp20001"}, /* TCA Taiwan */ + {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */ + {20003, "x-cp20003"}, /* IBM5550 Taiwan */ + {20004, "x-cp20004"}, /* TeleText Taiwan */ + {20005, "x-cp20005"}, /* Wang Taiwan */ + {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */ + {20106, "x-IA5-German"}, /* IA5 German (7-bit) */ + {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */ + {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */ + {20127, "us-ascii"}, /* US-ASCII (7-bit) */ + {20261, "x-cp20261"}, /* T.61 */ + {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */ + {20273, "IBM273"}, /* IBM EBCDIC Germany */ + {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */ + {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */ + {20280, "IBM280"}, /* IBM EBCDIC Italy */ + {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */ + {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */ + {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */ + {20297, "IBM297"}, /* IBM EBCDIC France */ + {20420, "IBM420"}, /* IBM EBCDIC Arabic */ + {20423, "IBM423"}, /* IBM EBCDIC Greek */ + {20424, "IBM424"}, /* IBM EBCDIC Hebrew */ + {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */ + {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */ + {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */ + {20871, "IBM871"}, /* IBM EBCDIC Icelandic */ + {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */ + {20905, "IBM905"}, /* IBM EBCDIC Turkish */ + {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */ + {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */ + {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */ + {20949, "x-cp20949"}, /* Korean Wansung */ + {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */ + /* 21027 (deprecated) */ + {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */ + {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */ + {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */ + {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */ + {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */ + {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */ + {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */ + {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */ + {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */ + {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */ + {28597, "iso8859-7"}, /* ISO 8859-7 Greek */ + {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */ + {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */ + {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */ + {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */ + {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */ + {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */ + {29001, "x-Europa"}, /* Europa 3 */ + {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */ + {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */ + {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */ + {50225, "iso-2022-kr"}, /* ISO 2022 Korean */ + {50225, "iso2022-kr"}, /* ISO 2022 Korean */ + {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */ + /* 50229 ISO 2022 Traditional Chinese */ + /* 50930 EBCDIC Japanese (Katakana) Extended */ + /* 50931 EBCDIC US-Canada and Japanese */ + /* 50933 EBCDIC Korean Extended and Korean */ + /* 50935 EBCDIC Simplified Chinese Extended and Simplified Chinese */ + /* 50936 EBCDIC Simplified Chinese */ + /* 50937 EBCDIC US-Canada and Traditional Chinese */ + /* 50939 EBCDIC Japanese (Latin) Extended and Japanese */ + {51932, "euc-jp"}, /* EUC Japanese */ + {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */ + {51949, "euc-kr"}, /* EUC Korean */ + /* 51950 EUC Traditional Chinese */ + {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */ + {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */ + {57002, "x-iscii-de"}, /* ISCII Devanagari */ + {57003, "x-iscii-be"}, /* ISCII Bengali */ + {57004, "x-iscii-ta"}, /* ISCII Tamil */ + {57005, "x-iscii-te"}, /* ISCII Telugu */ + {57006, "x-iscii-as"}, /* ISCII Assamese */ + {57007, "x-iscii-or"}, /* ISCII Oriya */ + {57008, "x-iscii-ka"}, /* ISCII Kannada */ + {57009, "x-iscii-ma"}, /* ISCII Malayalam */ + {57010, "x-iscii-gu"}, /* ISCII Gujarati */ + {57011, "x-iscii-pa"}, /* ISCII Punjabi */ + + {0, NULL} +}; + +/* + * SJIS SHIFTJIS table CP932 table + * ---- --------------------------- -------------------------------- + * 5C U+00A5 YEN SIGN U+005C REVERSE SOLIDUS + * 7E U+203E OVERLINE U+007E TILDE + * 815C U+2014 EM DASH U+2015 HORIZONTAL BAR + * 815F U+005C REVERSE SOLIDUS U+FF3C FULLWIDTH REVERSE SOLIDUS + * 8160 U+301C WAVE DASH U+FF5E FULLWIDTH TILDE + * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO + * 817C U+2212 MINUS SIGN U+FF0D FULLWIDTH HYPHEN-MINUS + * 8191 U+00A2 CENT SIGN U+FFE0 FULLWIDTH CENT SIGN + * 8192 U+00A3 POUND SIGN U+FFE1 FULLWIDTH POUND SIGN + * 81CA U+00AC NOT SIGN U+FFE2 FULLWIDTH NOT SIGN + * + * EUC-JP and ISO-2022-JP should be compatible with CP932. + * + * Kernel and MLang have different Unicode mapping table. Make sure + * which API is used. + */ +static compat_t cp932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0x301C, 0xFF5E, COMPAT_OUT}, + {0x2016, 0x2225, COMPAT_OUT}, + {0x2212, 0xFF0D, COMPAT_OUT}, + {0x00A2, 0xFFE0, COMPAT_OUT}, + {0x00A3, 0xFFE1, COMPAT_OUT}, + {0x00AC, 0xFFE2, COMPAT_OUT}, + {0, 0, 0} +}; + +static compat_t cp20932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN}, + {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN}, + {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN}, + {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN}, + {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN}, + {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN}, + {0, 0, 0} +}; + +static compat_t *cp51932_compat = cp932_compat; + +/* cp20932_compat for kernel. cp932_compat for mlang. */ +static compat_t *cp5022x_compat = cp932_compat; + +typedef HRESULT (WINAPI *CONVERTINETSTRING)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + DWORD dwDstEncoding, + LPCSTR lpSrcStr, + LPINT lpnSrcSize, + LPBYTE lpDstStr, + LPINT lpnDstSize +); +typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + LPCSTR lpSrcStr, + LPINT lpnMultiCharCount, + LPWSTR lpDstStr, + LPINT lpnWideCharCount +); +typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)( + LPDWORD lpdwMode, + DWORD dwEncoding, + LPCWSTR lpSrcStr, + LPINT lpnWideCharCount, + LPSTR lpDstStr, + LPINT lpnMultiCharCount +); +typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)( + DWORD dwSrcEncoding, + DWORD dwDstEncoding +); +typedef HRESULT (WINAPI *LCIDTORFC1766A)( + LCID Locale, + LPSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *LCIDTORFC1766W)( + LCID Locale, + LPWSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *RFC1766TOLCIDA)( + LCID *pLocale, + LPSTR pszRfc1766 +); +typedef HRESULT (WINAPI *RFC1766TOLCIDW)( + LCID *pLocale, + LPWSTR pszRfc1766 +); +static CONVERTINETSTRING ConvertINetString; +static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode; +static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte; +static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable; +static LCIDTORFC1766A LcidToRfc1766A; +static RFC1766TOLCIDA Rfc1766ToLcidA; + +static int +load_mlang() +{ + HMODULE h; + if (ConvertINetString != NULL) + return TRUE; + h = LoadLibrary("mlang.dll"); + if (!h) + return FALSE; + ConvertINetString = (CONVERTINETSTRING)GetProcAddress(h, "ConvertINetString"); + ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddress(h, "ConvertINetMultiByteToUnicode"); + ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddress(h, "ConvertINetUnicodeToMultiByte"); + IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddress(h, "IsConvertINetStringAvailable"); + LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddress(h, "LcidToRfc1766A"); + Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddress(h, "Rfc1766ToLcidA"); + return TRUE; +} + +iconv_t +iconv_open(const char *tocode, const char *fromcode) +{ + rec_iconv_t *cd; + + cd = (rec_iconv_t *)calloc(1, sizeof(rec_iconv_t)); + if (cd == NULL) + return (iconv_t)(-1); + +#if defined(USE_LIBICONV_DLL) + errno = 0; + if (libiconv_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; +#endif + + /* reset the errno to prevent reporting wrong error code. + * 0 for unsorted error. */ + errno = 0; + if (win_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; + + free(cd); + + return (iconv_t)(-1); +} + +int +iconv_close(iconv_t _cd) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + int r = cd->iconv_close(cd->cd); + int e = *(cd->_errno()); +#if defined(USE_LIBICONV_DLL) + if (cd->hlibiconv != NULL) + FreeLibrary(cd->hlibiconv); +#endif + free(cd); + errno = e; + return r; +} + +size_t +iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft); + errno = *(cd->_errno()); + return r; +} + +static int +win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to)) + return FALSE; + cd->iconv_close = win_iconv_close; + cd->iconv = win_iconv; + cd->_errno = _errno; + cd->cd = (iconv_t)cd; + return TRUE; +} + +static int +win_iconv_close(iconv_t cd) +{ + return 0; +} + +static size_t +win_iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */ + int insize; + int outsize; + int wsize; + DWORD frommode; + DWORD tomode; + uint wc; + compat_t *cp; + int i; + + if (inbuf == NULL || *inbuf == NULL) + { + if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL) + { + tomode = cd->to.mode; + outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + cd->to.mode = tomode; + return (size_t)(-1); + } + *outbuf += outsize; + *outbytesleft -= outsize; + } + cd->from.mode = 0; + cd->to.mode = 0; + return 0; + } + + while (*inbytesleft != 0) + { + frommode = cd->from.mode; + tomode = cd->to.mode; + wsize = MB_CHAR_MAX; + + insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize); + if (insize == -1) + { + cd->from.mode = frommode; + return (size_t)(-1); + } + + if (wsize == 0) + { + *inbuf += insize; + *inbytesleft -= insize; + continue; + } + + if (cd->from.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->from.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc) + { + ucs4_to_utf16(cp[i].in, wbuf, &wsize); + break; + } + } + } + + if (cd->to.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->to.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc) + { + ucs4_to_utf16(cp[i].out, wbuf, &wsize); + break; + } + } + } + + outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + cd->from.mode = frommode; + cd->to.mode = tomode; + return (size_t)(-1); + } + + *inbuf += insize; + *outbuf += outsize; + *inbytesleft -= insize; + *outbytesleft -= outsize; + } + + return 0; +} + +static int +make_csconv(const char *_name, csconv_t *cv) +{ + CPINFOEX cpinfoex; + int use_compat = TRUE; + int flag = 0; + char *name; + char *p; + + name = xstrndup(_name, strlen(_name)); + if (name == NULL) + return FALSE; + + /* check for option "enc_name//opt1//opt2" */ + while ((p = strrstr(name, "//")) != NULL) + { + if (_stricmp(p + 2, "nocompat") == 0) + use_compat = FALSE; + else if (_stricmp(p + 2, "translit") == 0) + flag |= FLAG_TRANSLIT; + else if (_stricmp(p + 2, "ignore") == 0) + flag |= FLAG_IGNORE; + *p = 0; + } + + cv->mode = 0; + cv->flags = flag; + cv->mblen = NULL; + cv->flush = NULL; + cv->compat = NULL; + cv->codepage = name_to_codepage(name); + if (cv->codepage == 1200 || cv->codepage == 1201) + { + cv->mbtowc = utf16_mbtowc; + cv->wctomb = utf16_wctomb; + if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 12000 || cv->codepage == 12001) + { + cv->mbtowc = utf32_mbtowc; + cv->wctomb = utf32_wctomb; + if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 65001) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + cv->mblen = utf8_mblen; + } + else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang()) + { + cv->mbtowc = iso2022jp_mbtowc; + cv->wctomb = iso2022jp_wctomb; + cv->flush = iso2022jp_flush; + } + else if (cv->codepage == 51932 && load_mlang()) + { + cv->mbtowc = mlang_mbtowc; + cv->wctomb = mlang_wctomb; + cv->mblen = eucjp_mblen; + } + else if (IsValidCodePage(cv->codepage) + && GetCPInfoEx(cv->codepage, 0, &cpinfoex) != 0) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + if (cpinfoex.MaxCharSize == 1) + cv->mblen = sbcs_mblen; + else if (cpinfoex.MaxCharSize == 2) + cv->mblen = dbcs_mblen; + else + cv->mblen = mbcs_mblen; + } + else + { + /* not supported */ + free(name); + errno = EINVAL; + return FALSE; + } + + if (use_compat) + { + switch (cv->codepage) + { + case 932: cv->compat = cp932_compat; break; + case 20932: cv->compat = cp20932_compat; break; + case 51932: cv->compat = cp51932_compat; break; + case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break; + } + } + + free(name); + + return TRUE; +} + +static int +name_to_codepage(const char *name) +{ + int i; + + if (*name == '\0' || + strcmp(name, "char") == 0) + return GetACP(); + else if (strcmp(name, "wchar_t") == 0) + return 1200; + else if (_strnicmp(name, "cp", 2) == 0) + return atoi(name + 2); /* CP123 */ + else if ('0' <= name[0] && name[0] <= '9') + return atoi(name); /* 123 */ + else if (_strnicmp(name, "xx", 2) == 0) + return atoi(name + 2); /* XX123 for debug */ + + for (i = 0; codepage_alias[i].name != NULL; ++i) + if (_stricmp(name, codepage_alias[i].name) == 0) + return codepage_alias[i].codepage; + return -1; +} + +/* + * http://www.faqs.org/rfcs/rfc2781.html + */ +static uint +utf16_to_ucs4(const ushort *wbuf) +{ + uint wc = wbuf[0]; + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000; + return wc; +} + +static void +ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize) +{ + if (wc < 0x10000) + { + wbuf[0] = wc; + *wbufsize = 1; + } + else + { + wc -= 0x10000; + wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF); + wbuf[1] = 0xDC00 | (wc & 0x3FF); + *wbufsize = 2; + } +} + +/* + * Check if codepage is one of those for which the dwFlags parameter + * to MultiByteToWideChar() must be zero. Return zero or + * MB_ERR_INVALID_CHARS. The docs in Platform SDK for for Windows + * Server 2003 R2 claims that also codepage 65001 is one of these, but + * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave + * out 65001 (UTF-8), and that indeed seems to be the case on XP, it + * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting + * from UTF-8. + */ +static int +mbtowc_flags(int codepage) +{ + return (codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS; +} + +/* + * Check if codepage is one those for which the lpUsedDefaultChar + * parameter to WideCharToMultiByte() must be NULL. The docs in + * Platform SDK for for Windows Server 2003 R2 claims that this is the + * list below, while the MSDN docs for MSVS2008 claim that it is only + * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform + * SDK seems to be correct, at least for XP. + */ +static int +must_use_null_useddefaultchar(int codepage) +{ + return (codepage == 65000 || codepage == 65001 || + codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 42); +} + +static char * +strrstr(const char *str, const char *token) +{ + int len = strlen(token); + const char *p = str + strlen(str); + + while (str <= --p) + if (p[0] == token[0] && strncmp(p, token, len) == 0) + return (char *)p; + return NULL; +} + +static char * +xstrndup(const char *s, size_t n) +{ + char *p; + + p = (char *)malloc(n + 1); + if (p == NULL) + return NULL; + memcpy(p, s, n); + p[n] = '\0'; + return p; +} + +static int +seterror(int err) +{ + errno = err; + return -1; +} + +#if defined(USE_LIBICONV_DLL) +static int +libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + HMODULE hlibiconv = NULL; + HMODULE hmsvcrt = NULL; + char *dllname; + const char *p; + const char *e; + f_iconv_open _iconv_open; + + /* + * always try to load dll, so that we can switch dll in runtime. + */ + + /* XXX: getenv() can't get variable set by SetEnvironmentVariable() */ + p = getenv("WINICONV_LIBICONV_DLL"); + if (p == NULL) + p = DEFAULT_LIBICONV_DLL; + /* parse comma separated value */ + for ( ; *p != 0; p = (*e == ',') ? e + 1 : e) + { + e = strchr(p, ','); + if (p == e) + continue; + else if (e == NULL) + e = p + strlen(p); + dllname = xstrndup(p, e - p); + if (dllname == NULL) + return FALSE; + hlibiconv = LoadLibrary(dllname); + free(dllname); + if (hlibiconv != NULL) + { + if (hlibiconv == hwiniconv) + { + FreeLibrary(hlibiconv); + hlibiconv = NULL; + continue; + } + break; + } + } + + if (hlibiconv == NULL) + goto failed; + + hmsvcrt = find_imported_module_by_funcname(hlibiconv, "_errno"); + if (hmsvcrt == NULL) + goto failed; + + _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "libiconv_open"); + if (_iconv_open == NULL) + _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "iconv_open"); + cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "libiconv_close"); + if (cd->iconv_close == NULL) + cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "iconv_close"); + cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "libiconv"); + if (cd->iconv == NULL) + cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "iconv"); + cd->_errno = (f_errno)GetProcAddress(hmsvcrt, "_errno"); + if (_iconv_open == NULL || cd->iconv_close == NULL + || cd->iconv == NULL || cd->_errno == NULL) + goto failed; + + cd->cd = _iconv_open(tocode, fromcode); + if (cd->cd == (iconv_t)(-1)) + goto failed; + + cd->hlibiconv = hlibiconv; + return TRUE; + +failed: + if (hlibiconv != NULL) + FreeLibrary(hlibiconv); + /* do not free hmsvcrt which is obtained by GetModuleHandle() */ + return FALSE; +} + +/* + * Reference: + * http://forums.belution.com/ja/vc/000/234/78s.shtml + * http://nienie.com/~masapico/api_ImageDirectoryEntryToData.html + * + * The formal way is + * imagehlp.h or dbghelp.h + * imagehlp.lib or dbghelp.lib + * ImageDirectoryEntryToData() + */ +#define TO_DOS_HEADER(base) ((PIMAGE_DOS_HEADER)(base)) +#define TO_NT_HEADERS(base) ((PIMAGE_NT_HEADERS)((LPBYTE)(base) + TO_DOS_HEADER(base)->e_lfanew)) +static PVOID +MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size) +{ + /* TODO: MappedAsImage? */ + PIMAGE_DATA_DIRECTORY p; + p = TO_NT_HEADERS(Base)->OptionalHeader.DataDirectory + DirectoryEntry; + if (p->VirtualAddress == 0) { + *Size = 0; + return NULL; + } + *Size = p->Size; + return (PVOID)((LPBYTE)Base + p->VirtualAddress); +} + +static HMODULE +find_imported_module_by_funcname(HMODULE hModule, const char *funcname) +{ + DWORD Base; + ULONG Size; + PIMAGE_IMPORT_DESCRIPTOR Imp; + PIMAGE_THUNK_DATA Name; /* Import Name Table */ + PIMAGE_IMPORT_BY_NAME ImpName; + + Base = (DWORD)hModule; + Imp = MyImageDirectoryEntryToData( + (LPVOID)Base, + TRUE, + IMAGE_DIRECTORY_ENTRY_IMPORT, + &Size); + if (Imp == NULL) + return NULL; + for ( ; Imp->OriginalFirstThunk != 0; ++Imp) + { + Name = (PIMAGE_THUNK_DATA)(Base + Imp->OriginalFirstThunk); + for ( ; Name->u1.Ordinal != 0; ++Name) + { + if (!IMAGE_SNAP_BY_ORDINAL(Name->u1.Ordinal)) + { + ImpName = (PIMAGE_IMPORT_BY_NAME) + (Base + (DWORD)Name->u1.AddressOfData); + if (strcmp((char *)ImpName->Name, funcname) == 0) + return GetModuleHandle((char *)(Base + Imp->Name)); + } + } + } + return NULL; +} +#endif + +static int +sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + return 1; +} + +static int +dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1; + if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = 0; + + if (cv->codepage == 54936) { + if (buf[0] <= 0x7F) len = 1; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 2 && + ((buf[1] >= 0x40 && buf[1] <= 0x7E) || + (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 4 && + buf[1] >= 0x30 && buf[1] <= 0x39) len = 4; + else + return seterror(EINVAL); + return len; + } + else + return seterror(EINVAL); +} + +static int +utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = 0; + + if (buf[0] < 0x80) len = 1; + else if ((buf[0] & 0xE0) == 0xC0) len = 2; + else if ((buf[0] & 0xF0) == 0xE0) len = 3; + else if ((buf[0] & 0xF8) == 0xF0) len = 4; + else if ((buf[0] & 0xFC) == 0xF8) len = 5; + else if ((buf[0] & 0xFE) == 0xFC) len = 6; + + if (len == 0) + return seterror(EILSEQ); + else if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + if (buf[0] < 0x80) /* ASCII */ + return 1; + else if (buf[0] == 0x8E) /* JIS X 0201 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF)) + return seterror(EILSEQ); + return 2; + } + else if (buf[0] == 0x8F) /* JIS X 0212 */ + { + if (bufsize < 3) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE) + || !(0xA1 <= buf[2] && buf[2] <= 0xFE)) + return seterror(EILSEQ); + return 3; + } + else /* JIS X 0208 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE) + || !(0xA1 <= buf[1] && buf[1] <= 0xFE)) + return seterror(EILSEQ); + return 2; + } +} + +static int +kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage), + (const char *)buf, len, (wchar_t *)wbuf, *wbufsize); + if (*wbufsize == 0) + return seterror(EILSEQ); + return len; +} + +static int +kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + BOOL usedDefaultChar = 0; + BOOL *p = NULL; + int flags = 0; + int len; + + if (bufsize == 0) + return seterror(E2BIG); + if (!must_use_null_useddefaultchar(cv->codepage)) + { + p = &usedDefaultChar; +#ifdef WC_NO_BEST_FIT_CHARS + if (!(cv->flags & FLAG_TRANSLIT)) + flags |= WC_NO_BEST_FIT_CHARS; +#endif + } + len = WideCharToMultiByte(cv->codepage, flags, + (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p); + if (len == 0) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + return seterror(E2BIG); + return seterror(EILSEQ); + } + else if (usedDefaultChar) + return seterror(EILSEQ); + else if (cv->mblen(cv, buf, len) != len) /* validate result */ + return seterror(EILSEQ); + return len; +} + +/* + * It seems that the mode (cv->mode) is fixnum. + * For example, when converting iso-2022-jp(cp50221) to unicode: + * in ascii sequence: mode=0xC42C0000 + * in jisx0208 sequence: mode=0xC42C0001 + * "C42C" is same for each convert session. + * It should be: ((codepage-1)<<16)|state + */ +static int +mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + int insize; + HRESULT hr; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + insize = len; + hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage, + (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len) + return seterror(EILSEQ); + return len; +} + +static int +mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */ + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + + hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) + return seterror(EILSEQ); + memcpy(buf, tmpbuf, tmpsize); + return tmpsize; +} + +static int +utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + + /* swap endian: 1200 <-> 1201 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 2) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[0] = (buf[1] << 8) | buf[0]; + else if (codepage == 1201) /* big endian */ + wbuf[0] = (buf[0] << 8) | buf[1]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wbuf[0] == 0xFFFE) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 2; + } + else if (wbuf[0] == 0xFEFF) + { + *wbufsize = 0; + return 2; + } + } + + if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF) + return seterror(EILSEQ); + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[1] = (buf[3] << 8) | buf[2]; + else if (codepage == 1201) /* big endian */ + wbuf[1] = (buf[2] << 8) | buf[3]; + if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF)) + return seterror(EILSEQ); + *wbufsize = 2; + return 4; + } + *wbufsize = 1; + return 2; +} + +static int +utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + memcpy(buf, "\xFF\xFE", 2); + else if (cv->codepage == 1201) /* big endian */ + memcpy(buf, "\xFE\xFF", 2); + + r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2); + if (r == -1) + return -1; + return r + 2; + } + + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[0] = (wbuf[0] & 0x00FF); + buf[1] = (wbuf[0] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[0] = (wbuf[0] & 0xFF00) >> 8; + buf[1] = (wbuf[0] & 0x00FF); + } + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[2] = (wbuf[1] & 0x00FF); + buf[3] = (wbuf[1] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[2] = (wbuf[1] & 0xFF00) >> 8; + buf[3] = (wbuf[1] & 0x00FF); + } + return 4; + } + return 2; +} + +static int +utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + uint wc; + + /* swap endian: 12000 <-> 12001 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 12000) /* little endian */ + wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; + else if (codepage == 12001) /* big endian */ + wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wc == 0xFFFE0000) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 4; + } + else if (wc == 0x0000FEFF) + { + *wbufsize = 0; + return 4; + } + } + + if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc) + return seterror(EILSEQ); + ucs4_to_utf16(wc, wbuf, wbufsize); + return 4; +} + +static int +utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + uint wc; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 12000) /* little endian */ + memcpy(buf, "\xFF\xFE\x00\x00", 4); + else if (cv->codepage == 12001) /* big endian */ + memcpy(buf, "\x00\x00\xFE\xFF", 4); + + r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4); + if (r == -1) + return -1; + return r + 4; + } + + if (bufsize < 4) + return seterror(E2BIG); + wc = utf16_to_ucs4(wbuf); + if (cv->codepage == 12000) /* little endian */ + { + buf[0] = wc & 0x000000FF; + buf[1] = (wc & 0x0000FF00) >> 8; + buf[2] = (wc & 0x00FF0000) >> 16; + buf[3] = (wc & 0xFF000000) >> 24; + } + else if (cv->codepage == 12001) /* big endian */ + { + buf[0] = (wc & 0xFF000000) >> 24; + buf[1] = (wc & 0x00FF0000) >> 16; + buf[2] = (wc & 0x0000FF00) >> 8; + buf[3] = wc & 0x000000FF; + } + return 4; +} + +/* + * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) + * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow + * 1 byte Kana) + * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte + * Kana - SO/SI) + * + * MultiByteToWideChar() and WideCharToMultiByte() behave differently + * depending on Windows version. On XP, WideCharToMultiByte() doesn't + * terminate result sequence with ascii escape. But Vista does. + * Use MLang instead. + */ + +#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift)) +#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF) +#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF) + +#define ISO2022_SI 0 +#define ISO2022_SO 1 + +/* shift in */ +static const char iso2022_SI_seq[] = "\x0F"; +/* shift out */ +static const char iso2022_SO_seq[] = "\x0E"; + +typedef struct iso2022_esc_t iso2022_esc_t; +struct iso2022_esc_t { + const char *esc; + int esc_len; + int len; + int cs; +}; + +#define ISO2022JP_CS_ASCII 0 +#define ISO2022JP_CS_JISX0201_ROMAN 1 +#define ISO2022JP_CS_JISX0201_KANA 2 +#define ISO2022JP_CS_JISX0208_1978 3 +#define ISO2022JP_CS_JISX0208_1983 4 +#define ISO2022JP_CS_JISX0212 5 + +static iso2022_esc_t iso2022jp_esc[] = { + {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII}, + {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN}, + {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA}, + {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */ + {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983}, + {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212}, + {NULL, 0, 0, 0} +}; + +static int +iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int insize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + if (buf[0] == 0x1B) + { + for (i = 0; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (bufsize < esc_len) + { + if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0) + return seterror(EINVAL); + } + else + { + if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0) + { + cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI); + *wbufsize = 0; + return esc_len; + } + } + } + /* not supported escape sequence */ + return seterror(EILSEQ); + } + else if (buf[0] == iso2022_SO_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO); + *wbufsize = 0; + return 1; + } + else if (buf[0] == iso2022_SI_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI); + *wbufsize = 0; + return 1; + } + + cs = ISO2022_MODE_CS(cv->mode); + shift = ISO2022_MODE_SHIFT(cv->mode); + + /* reset the mode for informal sequence */ + if (buf[0] < 0x20) + { + cs = ISO2022JP_CS_ASCII; + shift = ISO2022_SI; + } + + len = iesc[cs].len; + if (bufsize < len) + return seterror(EINVAL); + for (i = 0; i < len; ++i) + if (!(buf[i] < 0x80)) + return seterror(EILSEQ); + esc_len = iesc[cs].esc_len; + memcpy(tmp, iesc[cs].esc, esc_len); + if (shift == ISO2022_SO) + { + memcpy(tmp + esc_len, iso2022_SO_seq, 1); + esc_len += 1; + } + memcpy(tmp + esc_len, buf, len); + + if ((cv->codepage == 50220 || cv->codepage == 50221 + || cv->codepage == 50222) && shift == ISO2022_SO) + { + /* XXX: shift-out cannot be used for mbtowc (both kernel and + * mlang) */ + esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len; + memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len); + memcpy(tmp + esc_len, buf, len); + } + + insize = len + esc_len; + hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage, + (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len + esc_len) + return seterror(EILSEQ); + + /* Check for conversion error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (wbuf[0] == buf[0] + && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + return seterror(EILSEQ); + + /* reset the mode for informal sequence */ + if (cv->mode != ISO2022_MODE(cs, shift)) + cv->mode = ISO2022_MODE(cs, shift); + + return len; +} + +static int +iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + /* + * MultiByte = [escape sequence] + character + [escape sequence] + * + * Whether trailing escape sequence is added depends on which API is + * used (kernel or MLang, and its version). + */ + hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + + if (tmpsize == 1) + { + cs = ISO2022JP_CS_ASCII; + esc_len = 0; + } + else + { + for (i = 1; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (strncmp(tmp, iesc[i].esc, esc_len) == 0) + { + cs = iesc[i].cs; + break; + } + } + if (iesc[i].esc == NULL) + /* not supported escape sequence */ + return seterror(EILSEQ); + } + + shift = ISO2022_SI; + if (tmp[esc_len] == iso2022_SO_seq[0]) + { + shift = ISO2022_SO; + esc_len += 1; + } + + len = iesc[cs].len; + + /* Check for converting error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80)) + return seterror(EILSEQ); + else if (tmpsize < esc_len + len) + return seterror(EILSEQ); + + if (cv->mode == ISO2022_MODE(cs, shift)) + { + /* remove escape sequence */ + if (esc_len != 0) + memmove(tmp, tmp + esc_len, len); + esc_len = 0; + } + else + { + if (cs == ISO2022JP_CS_ASCII) + { + esc_len = iesc[ISO2022JP_CS_ASCII].esc_len; + memmove(tmp + esc_len, tmp, len); + memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len); + } + if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO) + { + /* shift-in before changing to other mode */ + memmove(tmp + 1, tmp, len + esc_len); + memcpy(tmp, iso2022_SI_seq, 1); + esc_len += 1; + } + } + + if (bufsize < len + esc_len) + return seterror(E2BIG); + memcpy(buf, tmp, len + esc_len); + cv->mode = ISO2022_MODE(cs, shift); + return len + esc_len; +} + +static int +iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + int esc_len; + + if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + { + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + esc_len += 1; + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + if (bufsize < esc_len) + return seterror(E2BIG); + + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + { + memcpy(buf, iso2022_SI_seq, 1); + esc_len += 1; + } + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + { + memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc, + iesc[ISO2022JP_CS_ASCII].esc_len); + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + } + return esc_len; + } + return 0; +} + +#if defined(MAKE_DLL) && defined(USE_LIBICONV_DLL) +BOOL WINAPI +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) +{ + switch( fdwReason ) + { + case DLL_PROCESS_ATTACH: + hwiniconv = (HMODULE)hinstDLL; + break; + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} +#endif + +#if defined(MAKE_EXE) +#include +#include +#include +int +main(int argc, char **argv) +{ + char *fromcode = NULL; + char *tocode = NULL; + int i; + char inbuf[BUFSIZ]; + char outbuf[BUFSIZ]; + const char *pin; + char *pout; + size_t inbytesleft; + size_t outbytesleft; + size_t rest = 0; + iconv_t cd; + size_t r; + FILE *in = stdin; + + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); + + for (i = 1; i < argc; ++i) + { + if (strcmp(argv[i], "-l") == 0) + { + for (i = 0; codepage_alias[i].name != NULL; ++i) + printf("%s\n", codepage_alias[i].name); + return 0; + } + + if (strcmp(argv[i], "-f") == 0) + fromcode = argv[++i]; + else if (strcmp(argv[i], "-t") == 0) + tocode = argv[++i]; + else + { + in = fopen(argv[i], "rb"); + if (in == NULL) + { + fprintf(stderr, "cannot open %s\n", argv[i]); + return 1; + } + break; + } + } + + if (fromcode == NULL || tocode == NULL) + { + printf("usage: %s -f from-enc -t to-enc [file]\n", argv[0]); + return 0; + } + + cd = iconv_open(tocode, fromcode); + if (cd == (iconv_t)(-1)) + { + perror("iconv_open error"); + return 1; + } + + while ((inbytesleft = fread(inbuf + rest, 1, sizeof(inbuf) - rest, in)) != 0 + || rest != 0) + { + inbytesleft += rest; + pin = inbuf; + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); + if (r == (size_t)(-1) && errno != E2BIG && (errno != EINVAL || feof(in))) + { + perror("conversion error"); + return 1; + } + memmove(inbuf, pin, inbytesleft); + rest = inbytesleft; + } + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, NULL, NULL, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); + if (r == (size_t)(-1)) + { + perror("conversion error"); + return 1; + } + + iconv_close(cd); + + return 0; +} +#endif + diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv_test.c b/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv_test.c new file mode 100644 index 0000000000..25b5574fa6 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv_test.c @@ -0,0 +1,261 @@ + +#include "win_iconv.c" +#include + +const char * +tohex(const char *str, int size) +{ + static char buf[BUFSIZ]; + char *pbuf = buf; + int i; + buf[0] = 0; + for (i = 0; i < size; ++i) + pbuf += sprintf(pbuf, "%02X", str[i] & 0xFF); + return buf; +} + +const char * +errstr(int errcode) +{ + static char buf[BUFSIZ]; + switch (errcode) + { + case 0: return "NOERROR"; + case EINVAL: return "EINVAL"; + case EILSEQ: return "EILSEQ"; + case E2BIG: return "E2BIG"; + } + sprintf(buf, "%d\n", errcode); + return buf; +} + +#ifdef USE_LIBICONV_DLL +int use_dll; + +int +setdll(const char *dllpath) +{ + char buf[BUFSIZ]; + rec_iconv_t cd; + + sprintf(buf, "WINICONV_LIBICONV_DLL=%s", dllpath); + putenv(buf); + if (libiconv_iconv_open(&cd, "ascii", "ascii")) + { + FreeLibrary(cd.hlibiconv); + use_dll = TRUE; + return TRUE; + } + use_dll = FALSE; + return FALSE; +} +#endif + +/* + * We can test the codepage that is installed in the system. + */ +int +check_enc(const char *encname, int codepage) +{ + iconv_t cd; + int cp; + cd = iconv_open("utf-8", encname); + if (cd == (iconv_t)(-1)) + { + printf("%s(%d) IS NOT SUPPORTED: SKIP THE TEST\n", encname, codepage); + return FALSE; + } + cp = ((rec_iconv_t *)cd)->from.codepage; + if (cp != codepage) + { + printf("%s(%d) ALIAS IS MAPPED TO DIFFERENT CODEPAGE (%d)\n", encname, codepage, cp); + exit(1); + } + iconv_close(cd); + return TRUE; +} + +int use_dll; + +void +test(const char *from, const char *fromstr, int fromsize, const char *to, const char *tostr, int tosize, int errcode, int bufsize, int line) +{ + char outbuf[BUFSIZ]; + const char *pin; + char *pout; + size_t inbytesleft; + size_t outbytesleft; + iconv_t cd; + size_t r; + char dllpath[_MAX_PATH]; + + cd = iconv_open(to, from); + if (cd == (iconv_t)(-1)) + { + printf("%s -> %s: NG: INVALID ENCODING NAME: line=%d\n", from, to, line); + exit(1); + } + +#ifdef USE_LIBICONV_DLL + if (((rec_iconv_t *)cd)->hlibiconv != NULL) + GetModuleFileName(((rec_iconv_t *)cd)->hlibiconv, dllpath, sizeof(dllpath)); + + if (use_dll && ((rec_iconv_t *)cd)->hlibiconv == NULL) + { + printf("%s: %s -> %s: NG: FAILED TO USE DLL: line=%d\n", dllpath, from, to, line); + exit(1); + } + else if (!use_dll && ((rec_iconv_t *)cd)->hlibiconv != NULL) + { + printf("%s: %s -> %s: NG: DLL IS LOADED UNEXPECTEDLY: line=%d\n", dllpath, from, to, line); + exit(1); + } +#endif + + errno = 0; + + pin = fromstr; + pout = outbuf; + inbytesleft = fromsize; + outbytesleft = bufsize; + r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); + if (r != (size_t)(-1)) + r = iconv(cd, NULL, NULL, &pout, &outbytesleft); + *pout = 0; + +#ifdef USE_LIBICONV_DLL + if (use_dll) + printf("%s: ", dllpath); +#endif + printf("%s(%s) -> ", from, tohex(fromstr, fromsize)); + printf("%s(%s%s%s): ", to, tohex(tostr, tosize), + errcode == 0 ? "" : ":", + errcode == 0 ? "" : errstr(errcode)); + if (strcmp(outbuf, tostr) == 0 && errno == errcode) + printf("OK\n"); + else + { + printf("RESULT(%s:%s): ", tohex(outbuf, sizeof(outbuf) - outbytesleft), + errstr(errno)); + printf("NG: line=%d\n", line); + exit(1); + } +} + +#define STATIC_STRLEN(arr) (sizeof(arr) - 1) + +#define success(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), 0, BUFSIZ, __LINE__) +#define einval(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EINVAL, BUFSIZ, __LINE__) +#define eilseq(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EILSEQ, BUFSIZ, __LINE__) +#define e2big(from, fromstr, to, tostr, bufsize) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), E2BIG, bufsize, __LINE__) + +int +main(int argc, char **argv) +{ +#ifdef USE_LIBICONV_DLL + /* test use of dll if $DEFAULT_LIBICONV_DLL was defined. */ + if (setdll("")) + { + success("ascii", "ABC", "ascii", "ABC"); + success("ascii", "ABC", "utf-16be", "\x00\x41\x00\x42\x00\x43"); + } + else + { + printf("\nDLL TEST IS SKIPPED\n\n"); + } + + setdll("none"); +#endif + + if (check_enc("ascii", 20127)) + { + success("ascii", "ABC", "ascii", "ABC"); + /* MSB is dropped. Hmm... */ + success("ascii", "\x80\xFF", "ascii", "\x00\x7F"); + } + + /* unicode (CP1200 CP1201 CP12000 CP12001 CP65001) */ + if (check_enc("utf-8", 65001) + && check_enc("utf-16be", 1201) && check_enc("utf-16le", 1200) + && check_enc("utf-32be", 12001) && check_enc("utf-32le", 12000) + ) + { + /* Test the BOM behavior + * 1. Remove the BOM when "fromcode" is utf-16 or utf-32. + * 2. Add the BOM when "tocode" is utf-16 or utf-32. */ + success("utf-16", "\xFE\xFF\x01\x02", "utf-16be", "\x01\x02"); + success("utf-16", "\xFF\xFE\x02\x01", "utf-16be", "\x01\x02"); + success("utf-32", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\x01\x02"); + success("utf-32", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\x01\x02"); + success("utf-16", "\xFE\xFF\x00\x01", "utf-8", "\x01"); +#ifndef GLIB_COMPILATION + success("utf-8", "\x01", "utf-16", "\xFE\xFF\x00\x01"); + success("utf-8", "\x01", "utf-32", "\x00\x00\xFE\xFF\x00\x00\x00\x01"); +#else + success("utf-8", "\x01", "utf-16", "\xFF\xFE\x01\x00"); + success("utf-8", "\x01", "utf-32", "\xFF\xFE\x00\x00\x01\x00\x00\x00"); +#endif + + success("utf-16be", "\xFE\xFF\x01\x02", "utf-16be", "\xFE\xFF\x01\x02"); + success("utf-16le", "\xFF\xFE\x02\x01", "utf-16be", "\xFE\xFF\x01\x02"); + success("utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); + success("utf-32le", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); + success("utf-16be", "\xFE\xFF\x00\x01", "utf-8", "\xEF\xBB\xBF\x01"); + success("utf-8", "\xEF\xBB\xBF\x01", "utf-8", "\xEF\xBB\xBF\x01"); + + success("utf-16be", "\x01\x02", "utf-16le", "\x02\x01"); + success("utf-16le", "\x02\x01", "utf-16be", "\x01\x02"); + success("utf-16be", "\xFE\xFF", "utf-16le", "\xFF\xFE"); + success("utf-16le", "\xFF\xFE", "utf-16be", "\xFE\xFF"); + success("utf-32be", "\x00\x00\x03\x04", "utf-32le", "\x04\x03\x00\x00"); + success("utf-32le", "\x04\x03\x00\x00", "utf-32be", "\x00\x00\x03\x04"); + success("utf-32be", "\x00\x00\xFF\xFF", "utf-16be", "\xFF\xFF"); + success("utf-16be", "\xFF\xFF", "utf-32be", "\x00\x00\xFF\xFF"); + success("utf-32be", "\x00\x01\x00\x00", "utf-16be", "\xD8\x00\xDC\x00"); + success("utf-16be", "\xD8\x00\xDC\x00", "utf-32be", "\x00\x01\x00\x00"); + success("utf-32be", "\x00\x10\xFF\xFF", "utf-16be", "\xDB\xFF\xDF\xFF"); + success("utf-16be", "\xDB\xFF\xDF\xFF", "utf-32be", "\x00\x10\xFF\xFF"); + eilseq("utf-32be", "\x00\x11\x00\x00", "utf-16be", ""); + eilseq("utf-16be", "\xDB\xFF\xE0\x00", "utf-32be", ""); + success("utf-8", "\xE3\x81\x82", "utf-16be", "\x30\x42"); + einval("utf-8", "\xE3", "utf-16be", ""); + } + + /* Japanese (CP932 CP20932 CP50220 CP50221 CP50222 CP51932) */ + if (check_enc("cp932", 932) + && check_enc("cp20932", 20932) && check_enc("euc-jp", 51932) + && check_enc("cp50220", 50220) && check_enc("cp50221", 50221) + && check_enc("cp50222", 50222) && check_enc("iso-2022-jp", 50221)) + { + /* Test the compatibility for each other Japanese codepage. + * And validate the escape sequence handling for iso-2022-jp. */ + success("utf-16be", "\xFF\x5E", "cp932", "\x81\x60"); + success("utf-16be", "\x30\x1C", "cp932", "\x81\x60"); + success("utf-16be", "\xFF\x5E", "cp932//nocompat", "\x81\x60"); + eilseq("utf-16be", "\x30\x1C", "cp932//nocompat", ""); + success("euc-jp", "\xA4\xA2", "utf-16be", "\x30\x42"); + einval("euc-jp", "\xA4\xA2\xA4", "utf-16be", "\x30\x42"); + eilseq("euc-jp", "\xA4\xA2\xFF\xFF", "utf-16be", "\x30\x42"); + success("cp932", "\x81\x60", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); + success("UTF-16BE", "\xFF\x5E", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); + eilseq("UTF-16BE", "\x30\x1C", "iso-2022-jp//nocompat", ""); + success("UTF-16BE", "\x30\x42\x30\x44", "iso-2022-jp", "\x1B\x24\x42\x24\x22\x24\x24\x1B\x28\x42"); + success("iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42", "UTF-16BE", "\xFF\x5E"); + } + + /* + * test for //translit + * U+FF41 (FULLWIDTH LATIN SMALL LETTER A) <-> U+0062 (LATIN SMALL LETTER A) + */ + eilseq("UTF-16BE", "\xFF\x41", "iso-8859-1", ""); + success("UTF-16BE", "\xFF\x41", "iso-8859-1//translit", "a"); + + /* + * TODO: + * Test for state after iconv() failed. + * Ensure iconv() error is safe and continuable. + */ + + return 0; +} + diff --git a/src/mod/endpoints/mod_h323/mod_h323.cpp b/src/mod/endpoints/mod_h323/mod_h323.cpp index e7199e0dee..2e7050e850 100644 --- a/src/mod/endpoints/mod_h323/mod_h323.cpp +++ b/src/mod/endpoints/mod_h323/mod_h323.cpp @@ -1334,11 +1334,11 @@ void FSH323Connection::OnModeChanged(const H245_ModeDescription & newMode) else t38_options->T38FaxUdpEC = "t38UDPRedundancy"; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"T38FaxUdpEC:%s\n",t38_options->T38FaxUdpEC); - const char *uuid = switch_channel_get_variable(m_fsChannel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(m_fsChannel); if (uuid != NULL) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"uuid:%s\n",uuid); - switch_core_session_t *session = switch_core_session_locate(switch_channel_get_variable(m_fsChannel, SWITCH_SIGNAL_BOND_VARIABLE)); + switch_core_session_t *session = switch_core_session_locate(switch_channel_get_partner_uuid(m_fsChannel)); if (session) { switch_channel_t * channel = switch_core_session_get_channel(session); if (channel) { @@ -2229,7 +2229,7 @@ PBoolean FSH323_ExternalRTPChannel::Start() switch_channel_mark_pre_answered(m_fsChannel); if (m_capability->GetMainType() == H323Capability::e_Data && m_conn->m_rxChannel && m_conn->m_txChannel) { - const char *uuid = switch_channel_get_variable(m_fsChannel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(m_fsChannel); if (uuid != NULL){ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"------------------------->switch_rtp_udptl_mode\n"); switch_rtp_udptl_mode(tech_pvt->rtp_session); diff --git a/src/mod/endpoints/mod_khomp/include/applications.h b/src/mod/endpoints/mod_khomp/include/applications.h index 21b66b2b0a..14ba1d3323 100644 --- a/src/mod/endpoints/mod_khomp/include/applications.h +++ b/src/mod/endpoints/mod_khomp/include/applications.h @@ -599,7 +599,7 @@ struct Transfer return SWITCH_STATUS_FALSE; } - switch_core_session_t *peer_session = switch_core_session_locate(switch_channel_get_variable(chan,SWITCH_SIGNAL_BOND_VARIABLE)); + switch_core_session_t *peer_session = switch_core_session_locate(switch_channel_get_partner_uuid(chan)); if(!peer_session) { @@ -662,7 +662,7 @@ struct Transfer switch_channel_t * peer = switch_core_session_get_channel(peer_session); /* put the channel in hold */ - //switch_core_session_t *session = switch_core_session_locate(switch_channel_get_variable(chan,SWITCH_SIGNAL_BOND_VARIABLE)); + //switch_core_session_t *session = switch_core_session_locate(switch_channel_get_partner_uuid(chan)); //switch_channel_t *chan_core = switch_core_session_get_channel(session); const char *stream; @@ -709,7 +709,7 @@ struct Transfer switch_core_session_rwunlock(pvt->session()); switch_core_session_rwunlock(peer_session); - //switch_ivr_unhold_uuid(switch_channel_get_variable(chan,SWITCH_SIGNAL_BOND_VARIABLE)); + //switch_ivr_unhold_uuid(switch_channel_get_partner_uuid(chan)); } catch (ScopedLockFailed & err) { diff --git a/src/mod/endpoints/mod_khomp/mod_khomp.cpp b/src/mod/endpoints/mod_khomp/mod_khomp.cpp index 5e7375b0e9..557cfb46f5 100644 --- a/src/mod/endpoints/mod_khomp/mod_khomp.cpp +++ b/src/mod/endpoints/mod_khomp/mod_khomp.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c index 3ec843e187..e2a2c3daab 100644 --- a/src/mod/endpoints/mod_loopback/mod_loopback.c +++ b/src/mod/endpoints/mod_loopback/mod_loopback.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -122,8 +122,8 @@ static void clear_queue(private_t *tech_pvt) static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *session, switch_codec_t *codec) { const char *iananame = "L16"; - int rate = 8000; - int interval = 20; + uint32_t rate = 8000; + uint32_t interval = 20; switch_status_t status = SWITCH_STATUS_SUCCESS; switch_channel_t *channel = switch_core_session_get_channel(session); const switch_codec_implementation_t *read_impl; @@ -132,6 +132,15 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses iananame = codec->implementation->iananame; rate = codec->implementation->samples_per_second; interval = codec->implementation->microseconds_per_packet / 1000; + } else { + const char *var; + + if ((var = switch_channel_get_variable(channel, "loopback_initial_codec"))) { + char *dup = switch_core_session_strdup(session, var); + uint32_t bit; + iananame = switch_parse_codec_buf(dup, &interval, &rate, &bit); + } + } if (switch_core_codec_ready(&tech_pvt->read_codec)) { @@ -217,6 +226,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session) switch_core_session_t *b_session; char name[128]; switch_caller_profile_t *caller_profile; + switch_event_t *vars = NULL; tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); @@ -273,8 +283,18 @@ static switch_status_t channel_on_init(switch_core_session_t *session) switch_channel_set_flag(channel, CF_ACCEPT_CNG); - //switch_ivr_transfer_variable(session, tech_pvt->other_session, "process_cdr"); - switch_ivr_transfer_variable(session, tech_pvt->other_session, NULL); + + if ((vars = (switch_event_t *) switch_channel_get_private(channel, "__loopback_vars__"))) { + switch_event_header_t *h; + + switch_channel_set_private(channel, "__loopback_vars__", NULL); + + for (h = vars->headers; h; h = h->next) { + switch_channel_set_variable(tech_pvt->other_channel, h->name, h->value); + } + + switch_event_destroy(&vars); + } if (switch_test_flag(tech_pvt, TFLAG_APP)) { switch_set_flag(b_tech_pvt, TFLAG_APP); @@ -382,12 +402,18 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session) switch_channel_t *channel = NULL; private_t *tech_pvt = NULL; void *pop; + switch_event_t *vars; channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); tech_pvt = switch_core_session_get_private(session); + if ((vars = (switch_event_t *) switch_channel_get_private(channel, "__loopback_vars__"))) { + switch_channel_set_private(channel, "__loopback_vars__", NULL); + switch_event_destroy(&vars); + } + if (tech_pvt) { switch_core_timer_destroy(&tech_pvt->timer); @@ -624,6 +650,39 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch return status; } +static switch_status_t find_non_loopback_bridge(switch_core_session_t *session, switch_core_session_t **br_session, const char **br_uuid) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *a_uuid; + switch_core_session_t *sp; + + *br_session = NULL; + *br_uuid = NULL; + + a_uuid = switch_channel_get_partner_uuid(channel); + + while (a_uuid && (sp = switch_core_session_locate(a_uuid))) { + if (switch_core_session_check_interface(sp, loopback_endpoint_interface)) { + private_t *tech_pvt = switch_core_session_get_private(sp); + + a_uuid = switch_channel_get_partner_uuid(tech_pvt->other_channel); + switch_core_session_rwunlock(sp); + sp = NULL; + } else { + break; + } + } + + if (sp) { + *br_session = sp; + *br_uuid = a_uuid; + return SWITCH_STATUS_SUCCESS; + } + + return SWITCH_STATUS_FALSE; + +} + static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id) { switch_channel_t *channel = NULL; @@ -652,8 +711,8 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc switch_channel_test_flag(tech_pvt->other_channel, CF_BRIDGED) && switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED) && switch_channel_test_flag(tech_pvt->other_channel, CF_ANSWERED) && --tech_pvt->bowout_frame_count <= 0) { - const char *a_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); - const char *b_uuid = switch_channel_get_variable(tech_pvt->other_channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *a_uuid = NULL; + const char *b_uuid = NULL; const char *vetoa, *vetob; @@ -664,16 +723,21 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc switch_core_session_t *br_a, *br_b; switch_channel_t *ch_a = NULL, *ch_b = NULL; int good_to_go = 0; + + find_non_loopback_bridge(session, &br_a, &a_uuid); + find_non_loopback_bridge(tech_pvt->other_session, &br_b, &b_uuid); + - if ((br_a = switch_core_session_locate(a_uuid))) { + if (br_a) { ch_a = switch_core_session_get_channel(br_a); } - if ((br_b = switch_core_session_locate(b_uuid))) { + if (br_b) { ch_b = switch_core_session_get_channel(br_b); } if (ch_a && ch_b && switch_channel_test_flag(ch_a, CF_BRIDGED) && switch_channel_test_flag(ch_b, CF_BRIDGED)) { + switch_set_flag_locked(tech_pvt, TFLAG_BOWOUT); switch_set_flag_locked(tech_pvt->other_tech_pvt, TFLAG_BOWOUT); @@ -741,7 +805,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s { switch_channel_t *channel; private_t *tech_pvt; - int done = 1; + int done = 1, pass = 0; channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); @@ -799,7 +863,27 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s } - if (!done && tech_pvt->other_session && switch_test_flag(tech_pvt, TFLAG_RUNNING_APP)) { + switch (msg->message_id) { + case SWITCH_MESSAGE_INDICATE_DISPLAY: + { + + if (!zstr(msg->string_array_arg[0])) { + switch_channel_set_profile_var(tech_pvt->other_channel, "callee_id_name", msg->string_array_arg[0]); + } + + if (!zstr(msg->string_array_arg[1])) { + switch_channel_set_profile_var(tech_pvt->other_channel, "callee_id_number", msg->string_array_arg[1]); + } + + pass = 1; + } + break; + default: + break; + } + + + if (!done && tech_pvt->other_session && (pass || switch_test_flag(tech_pvt, TFLAG_RUNNING_APP))) { switch_status_t r = SWITCH_STATUS_FALSE; switch_core_session_t *other_session; @@ -835,7 +919,7 @@ static switch_status_t loopback_bowout_on_execute_state_handler(switch_core_sess /* Wait for b_channel to be fully bridged */ switch_channel_wait_for_flag(b_channel, CF_BRIDGED, SWITCH_TRUE, 5000, NULL); - uuid = switch_channel_get_variable(b_channel, SWITCH_SIGNAL_BOND_VARIABLE); + uuid = switch_channel_get_partner_uuid(b_channel); if (uuid && (other_session = switch_core_session_locate(uuid))) { switch_channel_t *other_channel = switch_core_session_get_channel(other_session); @@ -889,6 +973,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi private_t *tech_pvt; switch_channel_t *channel; switch_caller_profile_t *caller_profile; + switch_event_t *clone = NULL; switch_core_session_add_stream(*new_session, NULL); @@ -906,6 +991,10 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } + if (switch_event_dup(&clone, var_event) == SWITCH_STATUS_SUCCESS) { + switch_channel_set_private(channel, "__loopback_vars__", clone); + } + if (outbound_profile) { char *dialplan = NULL, *context = NULL; @@ -921,9 +1010,16 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi } switch_channel_set_variable(channel, "loopback_app", app); + + if (clone) { + switch_event_add_header_string(clone, SWITCH_STACK_BOTTOM, "loopback_app", app); + } if (arg) { switch_channel_set_variable(channel, "loopback_app_arg", arg); + if (clone) { + switch_event_add_header_string(clone, SWITCH_STACK_BOTTOM, "loopback_app_arg", arg); + } } switch_set_flag(tech_pvt, TFLAG_APP); diff --git a/src/mod/endpoints/mod_portaudio/Makefile.am b/src/mod/endpoints/mod_portaudio/Makefile.am index 88d8754868..4f78946963 100644 --- a/src/mod/endpoints/mod_portaudio/Makefile.am +++ b/src/mod/endpoints/mod_portaudio/Makefile.am @@ -1,3 +1,4 @@ +LIBS+=$(PA_LIBS) include $(top_srcdir)/build/modmake.rulesam MODNAME=mod_portaudio diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index 04a3011d72..c66ed8a95b 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/endpoints/mod_reference/mod_reference.c b/src/mod/endpoints/mod_reference/mod_reference.c index f895e81338..2ce4c4c19a 100644 --- a/src/mod/endpoints/mod_reference/mod_reference.c +++ b/src/mod/endpoints/mod_reference/mod_reference.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.c b/src/mod/endpoints/mod_rtmp/mod_rtmp.c index 5dd5b4adfd..6b5bc862c9 100644 --- a/src/mod/endpoints/mod_rtmp/mod_rtmp.c +++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.c @@ -1,6 +1,6 @@ /* * mod_rtmp for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2011, Barracuda Networks Inc. + * Copyright (C) 2011-2012, Barracuda Networks Inc. * * Version: MPL 1.1 * @@ -625,7 +625,7 @@ switch_call_cause_t rtmp_outgoing_channel(switch_core_session_t *session, switch /*switch_channel_mark_pre_answered(channel);*/ switch_channel_ring_ready(channel); - rtmp_send_incoming_call(*newsession); + rtmp_send_incoming_call(*newsession, var_event); switch_channel_set_state(channel, CS_INIT); switch_set_flag_locked(tech_pvt, TFLAG_IO); diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.h b/src/mod/endpoints/mod_rtmp/mod_rtmp.h index 388afeacb5..6109c8544e 100644 --- a/src/mod/endpoints/mod_rtmp/mod_rtmp.h +++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.h @@ -616,7 +616,7 @@ switch_status_t rtmp_send_message(rtmp_session_t *rsession, uint8_t amfnumber, u void rtmp_send_event(rtmp_session_t *rsession, switch_event_t *event); void rtmp_notify_call_state(switch_core_session_t *session); void rtmp_send_display_update(switch_core_session_t *session); -void rtmp_send_incoming_call(switch_core_session_t *session); +void rtmp_send_incoming_call(switch_core_session_t *session, switch_event_t *var_event); void rtmp_send_onhangup(switch_core_session_t *session); void rtmp_add_registration(rtmp_session_t *rsession, const char *auth, const char *nickname); void rtmp_clear_registration(rtmp_session_t *rsession, const char *auth, const char *nickname); diff --git a/src/mod/endpoints/mod_rtmp/rtmp.c b/src/mod/endpoints/mod_rtmp/rtmp.c index 25f769b552..a5224719e6 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp.c @@ -1,6 +1,6 @@ /* * mod_rtmp for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2011, Barracuda Networks Inc. + * Copyright (C) 2011-2012, Barracuda Networks Inc. * * Version: MPL 1.1 * @@ -357,6 +357,25 @@ void rtmp_get_user_variables(switch_event_t **event, switch_core_session_t *sess } } + +void rtmp_get_user_variables_event(switch_event_t **event, switch_event_t *var_event) +{ + switch_event_header_t *he; + + if (!*event && switch_event_create(event, SWITCH_EVENT_CLONE) != SWITCH_STATUS_SUCCESS) { + return; + } + + if ((he = var_event->headers)) { + for (; he; he = he->next) { + if (!strncmp(he->name, RTMP_USER_VARIABLE_PREFIX, strlen(RTMP_USER_VARIABLE_PREFIX))) { + switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, he->name, he->value); + } + } + } +} + + void rtmp_session_send_onattach(rtmp_session_t *rsession) { const char *uuid = ""; @@ -386,7 +405,7 @@ void rtmp_send_display_update(switch_core_session_t *session) amf0_str(switch_str_nil(tech_pvt->display_callee_id_number)), NULL); } -void rtmp_send_incoming_call(switch_core_session_t *session) +void rtmp_send_incoming_call(switch_core_session_t *session, switch_event_t *var_event) { rtmp_private_t *tech_pvt = switch_core_session_get_private(session); switch_channel_t *channel = switch_core_session_get_channel(session); @@ -394,7 +413,11 @@ void rtmp_send_incoming_call(switch_core_session_t *session) switch_event_t *event = NULL; amf0_data *obj = NULL; - rtmp_get_user_variables(&event, session); + if (var_event) { + rtmp_get_user_variables_event(&event, var_event); + } else { + rtmp_get_user_variables(&event, session); + } if (event) { amf_event_to_object(&obj, event); diff --git a/src/mod/endpoints/mod_rtmp/rtmp_sig.c b/src/mod/endpoints/mod_rtmp/rtmp_sig.c index 7aaf79d6f6..a29465ecc0 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp_sig.c +++ b/src/mod/endpoints/mod_rtmp/rtmp_sig.c @@ -1,6 +1,6 @@ /* * mod_rtmp for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2011, Barracuda Networks Inc. + * Copyright (C) 2011-2012, Barracuda Networks Inc. * * Version: MPL 1.1 * @@ -539,7 +539,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_transfer) } if ((tech_pvt = rtmp_locate_private(rsession, uuid))) { - const char *other_uuid = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *other_uuid = switch_channel_get_partner_uuid(tech_pvt->channel); switch_core_session_t *session; if (!zstr(other_uuid) && (session = switch_core_session_locate(other_uuid))) { @@ -570,8 +570,8 @@ RTMP_INVOKE_FUNCTION(rtmp_i_join) return SWITCH_STATUS_FALSE; } - if ((other_uuid[0] = switch_channel_get_variable(tech_pvt[0]->channel, SWITCH_SIGNAL_BOND_VARIABLE)) && - (other_uuid[1] = switch_channel_get_variable(tech_pvt[1]->channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((other_uuid[0] = switch_channel_get_partner_uuid(tech_pvt[0]->channel)) && + (other_uuid[1] = switch_channel_get_partner_uuid(tech_pvt[1]->channel))) { #ifndef RTMP_DONT_HOLD if (switch_test_flag(tech_pvt[0], TFLAG_DETACHED)) { @@ -725,8 +725,8 @@ RTMP_INVOKE_FUNCTION(rtmp_i_three_way) return SWITCH_STATUS_FALSE; } - if (!(other_uuid[0] = switch_channel_get_variable(tech_pvt[0]->channel, SWITCH_SIGNAL_BOND_VARIABLE)) || - !(other_uuid[1] = switch_channel_get_variable(tech_pvt[1]->channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if (!(other_uuid[0] = switch_channel_get_partner_uuid(tech_pvt[0]->channel)) || + !(other_uuid[1] = switch_channel_get_partner_uuid(tech_pvt[1]->channel))) { return SWITCH_STATUS_FALSE; /* Both calls aren't bridged */ } diff --git a/src/mod/endpoints/mod_rtmp/rtmp_tcp.c b/src/mod/endpoints/mod_rtmp/rtmp_tcp.c index 7d4bbd5465..2cfd93b677 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp_tcp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp_tcp.c @@ -1,6 +1,6 @@ /* * mod_rtmp for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2011, Barracuda Networks Inc. + * Copyright (C) 2011-2012, Barracuda Networks Inc. * * Version: MPL 1.1 * diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 8e47691c36..95f7e6c83e 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -784,12 +784,12 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener tech_pvt = switch_core_session_get_private(session); channel = switch_core_session_get_channel(session); - remote_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + remote_uuid = switch_channel_get_partner_uuid(channel); if (tech_pvt->transfer_from_call_id) { if((session2 = skinny_profile_find_session(listener->profile, listener, &line_instance, tech_pvt->transfer_from_call_id))) { switch_channel_t *channel2 = switch_core_session_get_channel(session2); - const char *remote_uuid2 = switch_channel_get_variable(channel2, SWITCH_SIGNAL_BOND_VARIABLE); + const char *remote_uuid2 = switch_channel_get_partner_uuid(channel2); if (switch_ivr_uuid_bridge(remote_uuid, remote_uuid2) == SWITCH_STATUS_SUCCESS) { switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); switch_channel_hangup(channel2, SWITCH_CAUSE_NORMAL_CLEARING); @@ -1007,6 +1007,7 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r const char *value = switch_xml_attr_soft(xbutton, "value"); if(type == SKINNY_BUTTON_LINE) { const char *caller_name = switch_xml_attr_soft(xbutton, "caller-name"); + const char *reg_metadata = switch_xml_attr_soft(xbutton, "registration-metadata"); uint32_t ring_on_idle = atoi(switch_xml_attr_soft(xbutton, "ring-on-idle")); uint32_t ring_on_active = atoi(switch_xml_attr_soft(xbutton, "ring-on-active")); uint32_t busy_trigger = atoi(switch_xml_attr_soft(xbutton, "busy-trigger")); @@ -1030,7 +1031,7 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r switch_safe_free(sql); token = switch_mprintf("skinny/%q/%q/%q:%d", profile->name, value, request->data.reg.device_name, request->data.reg.instance); url = switch_mprintf("skinny/%q/%q", profile->name, value); - switch_core_add_registration(value, profile->domain, token, url, 0, network_ip, network_port_c, "tcp"); + switch_core_add_registration(value, profile->domain, token, url, 0, network_ip, network_port_c, "tcp", reg_metadata); switch_safe_free(token); switch_safe_free(url); } diff --git a/src/mod/endpoints/mod_skypopen/install/install.pl b/src/mod/endpoints/mod_skypopen/install/install.pl index f4c04f3aef..20de07e2eb 100755 --- a/src/mod/endpoints/mod_skypopen/install/install.pl +++ b/src/mod/endpoints/mod_skypopen/install/install.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl my $myname ; -my $skype_download_url = "http://mirrors.kernel.org/archlinux/community/os/i686/skype-oss-2.0.0.72-2-i686.pkg.tar.gz"; -my $skype_download_pkg = "skype-oss-2.0.0.72-2-i686.pkg.tar.gz"; +my $skype_download_url = "http://mirrors.kernel.org/archlinux/community/os/i686/skype-oss-2.0.0.72-3-i686.pkg.tar.xz"; +my $skype_download_pkg = "skype-oss-2.0.0.72-3-i686.pkg.tar.xz"; my $skype_binary_dir = "/usr/bin"; my $skype_download_dir = "/tmp/skype_download"; my $skype_share_dir = "/usr/share/skype"; @@ -203,7 +203,7 @@ printf("\n"); system("mkdir -p $skype_download_dir"); system("cd $skype_download_dir ; wget -c $skype_download_url"); -system("cd $skype_download_dir ; tar -xzf $skype_download_pkg"); +system("cd $skype_download_dir ; tar -xJf $skype_download_pkg"); system("mkdir -p $skype_binary_dir"); system("cd $skype_download_dir/usr/bin ; cp skype $skype_binary_dir/"); diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen.c b/src/mod/endpoints/mod_skypopen/mod_skypopen.c index 0360913eb0..ce89211b83 100644 --- a/src/mod/endpoints/mod_skypopen/mod_skypopen.c +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2011, Anthony Minessale II + * Copyright (C) 2005-2011, Anthony Minessale II * * Version: MPL 1.1 * @@ -21,19 +21,17 @@ * Portions created by the Initial Developer are Copyright (C) * the Initial Developer. All Rights Reserved. * - * This module (mod_skypopen) has been contributed by: - * - * Giovanni Maruzzelli (gmaruzz@gmail.com) - * - * - * Further Contributors: + * This module (mod_gsmopen) has been contributed by: * + * Giovanni Maruzzelli * + * Maintainer: Giovanni Maruzzelli * * mod_skypopen.c -- Skype compatible Endpoint Module * */ + #include "skypopen.h" #define SKYPE_CHAT_PROTO "skype" @@ -112,6 +110,7 @@ char *interface_status[] = { /* should match SKYPOPEN_STATE_xxx in skypopen.h */ "PREANSW", "DEAD" }; + char *skype_callflow[] = { /* should match CALLFLOW_XXX in skypopen.h */ "IDLE", "DOWN", @@ -381,7 +380,7 @@ static switch_status_t interface_exists(char *the_interface) if (tech_pvt->running && tech_pvt->SkypopenHandles.disp) { XEvent e; Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); - switch_sleep(20000); + switch_sleep(20000); XFlush(tech_pvt->SkypopenHandles.disp); memset(&e, 0, sizeof(e)); e.xclient.type = ClientMessage; @@ -739,6 +738,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int return SWITCH_STATUS_SUCCESS; } + static switch_status_t channel_on_consume_media(switch_core_session_t *session) { private_t *tech_pvt = NULL; @@ -765,6 +765,7 @@ static switch_status_t channel_on_soft_execute(switch_core_session_t *session) DEBUGA_SKYPE("%s CHANNEL SOFT_EXECUTE\n", SKYPOPEN_P_LOG, tech_pvt->name); return SWITCH_STATUS_SUCCESS; } + static switch_status_t channel_on_reset(switch_core_session_t *session) { private_t *tech_pvt = NULL; @@ -873,10 +874,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch switch_mutex_unlock(tech_pvt->mutex_audio_srv); if (!bytes_read) { - switch_sleep(1000); //XXX don't like this + switch_sleep(1000); //XXX don't like this try++; - if (try < 5){ - DEBUGA_SKYPE("skypopen_audio_read going back to read\n", SKYPOPEN_P_LOG); + if (try < 5) { + //DEBUGA_SKYPE("skypopen_audio_read going back to read\n", SKYPOPEN_P_LOG); goto read; } DEBUGA_SKYPE("READ BUFFER EMPTY, skypopen_audio_read Silence\n", SKYPOPEN_P_LOG); @@ -940,19 +941,19 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch char *p = digit_str; switch_channel_t *channel = switch_core_session_get_channel(session); - if(channel){ + if (channel) { while (p && *p) { - switch_dtmf_t dtmf = {0}; + switch_dtmf_t dtmf = { 0 }; dtmf.digit = *p; dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; switch_channel_queue_dtmf(channel, &dtmf); p++; } - NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", SKYPOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, - (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); + NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", SKYPOPEN_P_LOG, digit_str, + (unsigned int) new_dtmf_timestamp, (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp; - }else{ + } else { WARNINGA("NO CHANNEL ?\n", SKYPOPEN_P_LOG); } } @@ -1077,7 +1078,7 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session) return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t * msg) +static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg) { switch_channel_t *channel; private_t *tech_pvt; @@ -1648,7 +1649,7 @@ static switch_status_t load_config(int reload_type) } else { DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPOPEN_P_LOG); } - switch_sleep(20000); + switch_sleep(20000); #endif /* WIN32 */ if (interface_id && interface_id < SKYPOPEN_MAX_INTERFACES) { @@ -1751,8 +1752,7 @@ static switch_status_t load_config(int reload_type) switch_threadattr_detach_set(skypopen_signaling_thread_attr, 0); switch_threadattr_stacksize_set(skypopen_signaling_thread_attr, SWITCH_THREAD_STACKSIZE); //switch_threadattr_priority_increase(skypopen_signaling_thread_attr); - switch_thread_create(&globals.SKYPOPEN_INTERFACES[interface_id]. - skypopen_signaling_thread, skypopen_signaling_thread_attr, + switch_thread_create(&globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread, skypopen_signaling_thread_attr, skypopen_signaling_thread_func, &globals.SKYPOPEN_INTERFACES[interface_id], skypopen_module_pool); switch_sleep(100000); @@ -1858,8 +1858,8 @@ static switch_status_t load_config(int reload_type) return SWITCH_STATUS_SUCCESS; } + static switch_status_t chat_send(switch_event_t *message_event) - { char *user = NULL, *host, *f_user = NULL, *f_host = NULL, *f_resource = NULL; private_t *tech_pvt = NULL; @@ -1867,7 +1867,7 @@ static switch_status_t chat_send(switch_event_t *message_event) char skype_msg[1024]; const char *proto; - const char *from; + const char *from; const char *to; const char *subject; const char *body; @@ -1885,7 +1885,7 @@ static switch_status_t chat_send(switch_event_t *message_event) switch_assert(proto != NULL); //DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body, type, - // hint ? hint : "NULL"); + // hint ? hint : "NULL"); DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body, hint ? hint : "NULL"); @@ -1912,9 +1912,8 @@ static switch_status_t chat_send(switch_event_t *message_event) if ((host = strchr(user, '@'))) { *host++ = '\0'; } - //DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body, type, - // hint ? hint : "NULL"); + // hint ? hint : "NULL"); DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body, hint ? hint : "NULL"); if (hint && strlen(hint)) { @@ -1950,13 +1949,14 @@ static switch_status_t chat_send(switch_event_t *message_event) snprintf(skype_msg, sizeof(skype_msg), "CHAT CREATE %s", to); skypopen_signaling_write(tech_pvt, skype_msg); - switch_sleep(20000); + switch_sleep(20000); } found = 0; while (!found) { for (i = 0; i < MAX_CHATS; i++) { + //DEBUGA_SKYPE("tech_pvt->chats[i].dialog_partner='%s' to='%s'\n", SKYPOPEN_P_LOG, tech_pvt->chats[i].dialog_partner, to); if (!strcmp(tech_pvt->chats[i].dialog_partner, to)) { snprintf(skype_msg, sizeof(skype_msg), "CHATMESSAGE %s %s", tech_pvt->chats[i].chatname, body); skypopen_signaling_write(tech_pvt, skype_msg); @@ -1969,7 +1969,9 @@ static switch_status_t chat_send(switch_event_t *message_event) } tried++; if (tried > 20) { - ERRORA("No chat with dialog_partner='%s' was found\n", SKYPOPEN_P_LOG, to); + ERRORA + ("No chat with dialog_partner='%s' was found. (If you're using mod_sms this is a bug of mod_skypopen when using mod_sms, from next incoming message it will probably work...)\n", + SKYPOPEN_P_LOG, to); break; } switch_sleep(50000); @@ -2075,7 +2077,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown) XEvent e; Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); - switch_sleep(20000); + switch_sleep(20000); XFlush(tech_pvt->SkypopenHandles.disp); memset(&e, 0, sizeof(e)); e.xclient.type = ClientMessage; @@ -2171,7 +2173,7 @@ int dtmf_received(private_t *tech_pvt, char *value) if (channel) { if (switch_channel_test_flag(channel, CF_BRIDGED) - && !switch_true(switch_channel_get_variable(channel, "skype_add_outband_dtmf_also_when_bridged"))) { + && !switch_true(switch_channel_get_variable(channel, "skype_add_outband_dtmf_also_when_bridged"))) { NOTICA @@ -2193,13 +2195,51 @@ int dtmf_received(private_t *tech_pvt, char *value) WARNINGA("received %c DTMF, but no channel?\n", SKYPOPEN_P_LOG, value[0]); } switch_core_session_rwunlock(session); - }else{ + } else { WARNINGA("received %c DTMF, but no session?\n", SKYPOPEN_P_LOG, value[0]); } return 0; } +void *SWITCH_THREAD_FUNC skypopen_do_mod_sms_thread(switch_thread_t *thread, void *obj) +{ + switch_event_t *event; + + + event = obj; + switch_core_chat_send("GLOBAL", event); /* mod_sms */ + + return event; + +} + + + +int start_mod_sms_thread(private_t *tech_pvt, switch_event_t *event) +{ + switch_threadattr_t *mod_sms_thread_thd_attr = NULL; + switch_thread_t *mod_sms_thread; + + + switch_threadattr_create(&mod_sms_thread_thd_attr, skypopen_module_pool); + switch_threadattr_detach_set(mod_sms_thread_thd_attr, 0); + switch_threadattr_stacksize_set(mod_sms_thread_thd_attr, SWITCH_THREAD_STACKSIZE); + if (switch_thread_create(&mod_sms_thread, mod_sms_thread_thd_attr, skypopen_do_mod_sms_thread, event, skypopen_module_pool) == SWITCH_STATUS_SUCCESS) { + DEBUGA_SKYPE("started mod_sms_thread thread.\n", SKYPOPEN_P_LOG); + } else { + ERRORA("failed to start mod_sms_thread thread.\n", SKYPOPEN_P_LOG); + return -1; + } + if (mod_sms_thread == NULL) { + WARNINGA("mod_sms_thread exited\n", SKYPOPEN_P_LOG); + return -1; + } + + return 0; +} + + int start_audio_threads(private_t *tech_pvt) { switch_threadattr_t *tcp_srv_thread_thd_attr = NULL; @@ -2235,7 +2275,8 @@ int start_audio_threads(private_t *tech_pvt) switch_threadattr_priority_increase(tcp_srv_thread_thd_attr); switch_mutex_lock(tech_pvt->mutex_thread_audio_srv); //DEBUGA_SKYPE("debugging_hangup srv lock\n", SKYPOPEN_P_LOG); - if (switch_thread_create(&tech_pvt->tcp_srv_thread, tcp_srv_thread_thd_attr, skypopen_do_tcp_srv_thread, tech_pvt, skypopen_module_pool) == SWITCH_STATUS_SUCCESS) { + if (switch_thread_create(&tech_pvt->tcp_srv_thread, tcp_srv_thread_thd_attr, skypopen_do_tcp_srv_thread, tech_pvt, skypopen_module_pool) == + SWITCH_STATUS_SUCCESS) { DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPOPEN_P_LOG); } else { ERRORA("failed to start tcp_srv_thread thread.\n", SKYPOPEN_P_LOG); @@ -2252,7 +2293,8 @@ int start_audio_threads(private_t *tech_pvt) switch_threadattr_priority_increase(tcp_cli_thread_thd_attr); switch_mutex_lock(tech_pvt->mutex_thread_audio_cli); //DEBUGA_SKYPE("debugging_hangup cli lock\n", SKYPOPEN_P_LOG); - if (switch_thread_create(&tech_pvt->tcp_cli_thread, tcp_cli_thread_thd_attr, skypopen_do_tcp_cli_thread, tech_pvt, skypopen_module_pool) == SWITCH_STATUS_SUCCESS) { + if (switch_thread_create(&tech_pvt->tcp_cli_thread, tcp_cli_thread_thd_attr, skypopen_do_tcp_cli_thread, tech_pvt, skypopen_module_pool) == + SWITCH_STATUS_SUCCESS) { DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPOPEN_P_LOG); } else { ERRORA("failed to start tcp_cli_thread thread.\n", SKYPOPEN_P_LOG); @@ -2470,27 +2512,26 @@ SWITCH_STANDARD_API(sk_function) goto end; } - - if (!strcasecmp(argv[0], "balances")) { - stream->write_function(stream, " Name \tBalance\tCurrency\n"); - stream->write_function(stream, " ==== \t=======\t========\n"); - - for (tmp_i = 0; tmp_i < SKYPOPEN_MAX_INTERFACES; tmp_i++) { - if (strlen(globals.SKYPOPEN_INTERFACES[tmp_i].name)) { - skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE"); - switch_sleep(20000); - - strncpy(tmp_message, globals.SKYPOPEN_INTERFACES[tmp_i].message, sizeof(globals.SKYPOPEN_INTERFACES[tmp_i].message)); - - skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE_CURRENCY"); - switch_sleep(20000); - if(strlen(tmp_message)>21 && strlen(globals.SKYPOPEN_INTERFACES[tmp_i].message) > 30) - stream->write_function(stream, " %s \t%s\t%s\n", globals.SKYPOPEN_INTERFACES[tmp_i].name, tmp_message+21, globals.SKYPOPEN_INTERFACES[tmp_i].message+30); - } - } - } - if (!strcasecmp(argv[0], "list")) { + if (!strcasecmp(argv[0], "balances")) { + stream->write_function(stream, " Name \tBalance\tCurrency\n"); + stream->write_function(stream, " ==== \t=======\t========\n"); + + for (tmp_i = 0; tmp_i < SKYPOPEN_MAX_INTERFACES; tmp_i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[tmp_i].name)) { + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE"); + switch_sleep(20000); + + strncpy(tmp_message, globals.SKYPOPEN_INTERFACES[tmp_i].message, sizeof(globals.SKYPOPEN_INTERFACES[tmp_i].message)); + + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE_CURRENCY"); + switch_sleep(20000); + if (strlen(tmp_message) > 21 && strlen(globals.SKYPOPEN_INTERFACES[tmp_i].message) > 30) + stream->write_function(stream, " %s \t%s\t%s\n", globals.SKYPOPEN_INTERFACES[tmp_i].name, tmp_message + 21, + globals.SKYPOPEN_INTERFACES[tmp_i].message + 30); + } + } + } else if (!strcasecmp(argv[0], "list")) { int i; unsigned int ib = 0; unsigned int ib_failed = 0; @@ -2503,11 +2544,11 @@ SWITCH_STANDARD_API(sk_function) for (i = 0; i < SKYPOPEN_MAX_INTERFACES; i++) { if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) { - next_flag_char = i == globals.next_interface ? '*' : ' '; - ib += globals.SKYPOPEN_INTERFACES[i].ib_calls; - ib_failed += globals.SKYPOPEN_INTERFACES[i].ib_failed_calls; - ob += globals.SKYPOPEN_INTERFACES[i].ob_calls; - ob_failed += globals.SKYPOPEN_INTERFACES[i].ob_failed_calls; + next_flag_char = i == globals.next_interface ? '*' : ' '; + ib += globals.SKYPOPEN_INTERFACES[i].ib_calls; + ib_failed += globals.SKYPOPEN_INTERFACES[i].ib_failed_calls; + ob += globals.SKYPOPEN_INTERFACES[i].ob_calls; + ob_failed += globals.SKYPOPEN_INTERFACES[i].ob_failed_calls; stream->write_function(stream, "%c %d\t[%s]\t%3u/%u\t%6u/%u\t%s\t%s\t%s\n", @@ -2966,12 +3007,24 @@ int incoming_chatmessage(private_t *tech_pvt, int which) if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SKYPE_CHAT_PROTO); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->chatmessages[which].from_handle); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); +/* mod_sms begin */ + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", tech_pvt->skype_user); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_proto", SKYPE_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_user", tech_pvt->chatmessages[which].from_handle); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_host", "from_host"); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_full", "from_full"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_user", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_host", "to_host"); +/* mod_sms end */ + switch_event_add_body(event, "%s", tech_pvt->chatmessages[which].body); + if (session) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); if (switch_core_session_queue_event(session, &event) != SWITCH_STATUS_SUCCESS) { @@ -3013,7 +3066,36 @@ int incoming_chatmessage(private_t *tech_pvt, int which) if (session) { switch_core_session_rwunlock(session); } - memset(&tech_pvt->chatmessages[which], '\0', sizeof(&tech_pvt->chatmessages[which])); + + + if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SKYPE_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->chatmessages[which].from_handle); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); +/* mod_sms begin */ + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", tech_pvt->skype_user); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_proto", SKYPE_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_user", tech_pvt->chatmessages[which].from_handle); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_host", "from_host"); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_full", "from_full"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_user", tech_pvt->name); + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_host", "to_host"); +/* mod_sms end */ + + switch_event_add_body(event, "%s", tech_pvt->chatmessages[which].body); + //switch_core_chat_send("GLOBAL", event); /* mod_sms */ + start_mod_sms_thread(tech_pvt, event); + //usleep(20000); + + } else { + ERRORA("cannot create event on interface %s. WHY?????\n", SKYPOPEN_P_LOG, tech_pvt->name); + } + return 0; } @@ -3030,19 +3112,19 @@ static switch_status_t compat_chat_send(const char *proto, const char *from, con switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject); switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type); switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint); - + if (body) { switch_event_add_body(message_event, "%s", body); } } else { abort(); - } + } status = chat_send(message_event); switch_event_destroy(&message_event); return status; - + } SWITCH_STANDARD_API(skypopen_chat_function) @@ -3084,8 +3166,9 @@ SWITCH_STANDARD_API(skypopen_chat_function) goto end; } else { - NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", SKYPOPEN_P_LOG, SKYPE_CHAT_PROTO, tech_pvt->skype_user, - argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), tech_pvt->name); + NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", SKYPOPEN_P_LOG, SKYPE_CHAT_PROTO, + tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), + tech_pvt->name); compat_chat_send(SKYPE_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, tech_pvt->name); diff --git a/src/mod/endpoints/mod_skypopen/skypopen.h b/src/mod/endpoints/mod_skypopen/skypopen.h index 2be11bf4fc..864a22c3e4 100644 --- a/src/mod/endpoints/mod_skypopen/skypopen.h +++ b/src/mod/endpoints/mod_skypopen/skypopen.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2011, Anthony Minessale II + * Copyright (C) 2005-2011, Anthony Minessale II * * Version: MPL 1.1 * @@ -21,18 +21,17 @@ * Portions created by the Initial Developer are Copyright (C) * the Initial Developer. All Rights Reserved. * - * This module (mod_skypopen) has been contributed by: + * This module (mod_gsmopen) has been contributed by: * - * Giovanni Maruzzelli (gmaruzz@gmail.com) - * - * - * Further Contributors: + * Giovanni Maruzzelli * + * Maintainer: Giovanni Maruzzelli * * mod_skypopen.c -- Skype compatible Endpoint Module * */ + #include #include @@ -112,7 +111,7 @@ typedef enum { #define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%-*s["SKYPOPEN_SVN_VERSION "] [WARNINGA %-5d][%-15s][%s,%s] " __VA_ARGS__ ); #define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%-*s ["SKYPOPEN_SVN_VERSION "] [NOTICA %-5d][%-15s][%s,%s] " __VA_ARGS__ ); -#define SKYPOPEN_P_LOG (int)((20 - (strlen(__FILE__))) + ((__LINE__ - 1000) < 0) + ((__LINE__ - 100) < 0)), " ", __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", tech_pvt ? interface_status[tech_pvt->interface_state] : "N/A", tech_pvt ? skype_callflow[tech_pvt->skype_callflow] : "N/A" +#define SKYPOPEN_P_LOG (int)((20 - (strlen(__FILE__))) + ((__LINE__ - 1000) < 0) + ((__LINE__ - 100) < 0)), " ", __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", tech_pvt ? interface_status[tech_pvt->interface_state] : "N/A", tech_pvt ? skype_callflow[tech_pvt->skype_callflow] : "N/A" /*********************************/ #define SKYPOPEN_CAUSE_NORMAL 1 diff --git a/src/mod/endpoints/mod_skypopen/skypopen_protocol.c b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c index 95746411e9..2126955452 100644 --- a/src/mod/endpoints/mod_skypopen/skypopen_protocol.c +++ b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c @@ -1,3 +1,37 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2011, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * This module (mod_gsmopen) has been contributed by: + * + * Giovanni Maruzzelli + * + * Maintainer: Giovanni Maruzzelli + * + * skypopen_protocol.c -- Low Level Interface for mod_skypopen + * + */ + + #include "skypopen.h" #ifdef ASTERISK @@ -356,7 +390,7 @@ int skypopen_signaling_read(private_t *tech_pvt) } } if (!found) { - DEBUGA_SKYPE("why we do not have a chats slot free? we have more than %d chats in parallel?\n", SKYPOPEN_P_LOG, MAX_CHATS); + ERRORA("why we do not have a chats slot free? we have more than %d chats in parallel?\n", SKYPOPEN_P_LOG, MAX_CHATS); } DEBUGA_SKYPE("CHAT %s is in position %d in the chats array, chatname=%s, dialog_partner=%s\n", SKYPOPEN_P_LOG, id, i, @@ -378,109 +412,120 @@ int skypopen_signaling_read(private_t *tech_pvt) skypopen_strncpy(prop, where, sizeof(prop) - 1); skypopen_strncpy(value, *stringp, sizeof(value) - 1); - if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "RECEIVED")) { - DEBUGA_SKYPE("RECEIVED CHATMESSAGE %s, let's see which type it is\n", SKYPOPEN_P_LOG, id); - sprintf(msg_to_skype, "GET CHATMESSAGE %s TYPE", id); - skypopen_signaling_write(tech_pvt, msg_to_skype); - } - - if (!strcasecmp(prop, "TYPE") && !strcasecmp(value, "SAID")) { - DEBUGA_SKYPE("CHATMESSAGE %s is of type SAID, let's get the other infos\n", SKYPOPEN_P_LOG, id); - found = 0; - for (i = 0; i < MAX_CHATMESSAGES; i++) { - if (strlen(tech_pvt->chatmessages[i].id) == 0) { - strncpy(tech_pvt->chatmessages[i].id, id, sizeof(tech_pvt->chatmessages[i].id)); - strncpy(tech_pvt->chatmessages[i].type, value, sizeof(tech_pvt->chatmessages[i].type)); - found = 1; - break; - } - } - if (!found) { - DEBUGA_SKYPE("why we do not have a chatmessages slot free? we have more than %d chatmessages in parallel?\n", SKYPOPEN_P_LOG, - MAX_CHATMESSAGES); - } else { - DEBUGA_SKYPE("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s\n", SKYPOPEN_P_LOG, id, i, - tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id); - sprintf(msg_to_skype, "GET CHATMESSAGE %s CHATNAME", id); - skypopen_signaling_write(tech_pvt, msg_to_skype); - //skypopen_sleep(1000); - sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_HANDLE", id); - skypopen_signaling_write(tech_pvt, msg_to_skype); - //skypopen_sleep(1000); - sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_DISPNAME", id); - skypopen_signaling_write(tech_pvt, msg_to_skype); - //skypopen_sleep(1000); - sprintf(msg_to_skype, "GET CHATMESSAGE %s BODY", id); + if (!tech_pvt->report_incoming_chatmessages) { + if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "RECEIVED")) { + sprintf(msg_to_skype, "SET CHATMESSAGE %s SEEN", id); skypopen_signaling_write(tech_pvt, msg_to_skype); } - } - - if (!strcasecmp(prop, "CHATNAME")) { - DEBUGA_SKYPE("CHATMESSAGE %s belongs to the CHAT %s\n", SKYPOPEN_P_LOG, id, value); - found = 0; - for (i = 0; i < MAX_CHATMESSAGES; i++) { - if (!strcmp(tech_pvt->chatmessages[i].id, id)) { - strncpy(tech_pvt->chatmessages[i].chatname, value, sizeof(tech_pvt->chatmessages[i].chatname)); - found = 1; - break; - } - } - if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); - } - } - if (!strcasecmp(prop, "FROM_HANDLE")) { - DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_HANDLE %s\n", SKYPOPEN_P_LOG, id, value); - found = 0; - for (i = 0; i < MAX_CHATMESSAGES; i++) { - if (!strcmp(tech_pvt->chatmessages[i].id, id)) { - strncpy(tech_pvt->chatmessages[i].from_handle, value, sizeof(tech_pvt->chatmessages[i].from_handle)); - found = 1; - break; - } - } - if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); + } else { + if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "RECEIVED")) { + DEBUGA_SKYPE("RECEIVED CHATMESSAGE %s, let's see which type it is\n", SKYPOPEN_P_LOG, id); + sprintf(msg_to_skype, "GET CHATMESSAGE %s TYPE", id); + skypopen_signaling_write(tech_pvt, msg_to_skype); } - } - if (!strcasecmp(prop, "FROM_DISPNAME")) { - DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_DISPNAME %s\n", SKYPOPEN_P_LOG, id, value); - found = 0; - for (i = 0; i < MAX_CHATMESSAGES; i++) { - if (!strcmp(tech_pvt->chatmessages[i].id, id)) { - strncpy(tech_pvt->chatmessages[i].from_dispname, value, sizeof(tech_pvt->chatmessages[i].from_dispname)); - found = 1; - break; + if (!strcasecmp(prop, "TYPE") && !strcasecmp(value, "SAID")) { + DEBUGA_SKYPE("CHATMESSAGE %s is of type SAID, let's get the other infos\n", SKYPOPEN_P_LOG, id); + found = 0; + for (i = 0; i < MAX_CHATMESSAGES; i++) { + if (strlen(tech_pvt->chatmessages[i].id) == 0) { + strncpy(tech_pvt->chatmessages[i].id, id, sizeof(tech_pvt->chatmessages[i].id)); + strncpy(tech_pvt->chatmessages[i].type, value, sizeof(tech_pvt->chatmessages[i].type)); + found = 1; + break; + } } - } - if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); - } - - } - if (!strcasecmp(prop, "BODY")) { - DEBUGA_SKYPE("CHATMESSAGE %s has BODY %s\n", SKYPOPEN_P_LOG, id, value); - found = 0; - for (i = 0; i < MAX_CHATMESSAGES; i++) { - if (!strcmp(tech_pvt->chatmessages[i].id, id)) { - strncpy(tech_pvt->chatmessages[i].body, value, sizeof(tech_pvt->chatmessages[i].body)); - found = 1; - break; - } - } - if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); - } else { - DEBUGA_SKYPE - ("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s, chatname=%s, from_handle=%s, from_dispname=%s, body=%s\n", - SKYPOPEN_P_LOG, id, i, tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id, tech_pvt->chatmessages[i].chatname, - tech_pvt->chatmessages[i].from_handle, tech_pvt->chatmessages[i].from_dispname, tech_pvt->chatmessages[i].body); - if (strcmp(tech_pvt->chatmessages[i].from_handle, tech_pvt->skype_user)) { //if the message was not sent by myself - incoming_chatmessage(tech_pvt, i); + if (!found) { + ERRORA("why we do not have a chatmessages slot free? we have more than %d chatmessages in parallel?\n", SKYPOPEN_P_LOG, + MAX_CHATMESSAGES); + } else { + DEBUGA_SKYPE("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s\n", SKYPOPEN_P_LOG, id, i, + tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id); + sprintf(msg_to_skype, "GET CHATMESSAGE %s CHATNAME", id); + skypopen_signaling_write(tech_pvt, msg_to_skype); + //skypopen_sleep(1000); + sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_HANDLE", id); + skypopen_signaling_write(tech_pvt, msg_to_skype); + //skypopen_sleep(1000); + sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_DISPNAME", id); + skypopen_signaling_write(tech_pvt, msg_to_skype); + //skypopen_sleep(1000); + sprintf(msg_to_skype, "GET CHATMESSAGE %s BODY", id); + skypopen_signaling_write(tech_pvt, msg_to_skype); } } + if (!strcasecmp(prop, "CHATNAME")) { + DEBUGA_SKYPE("CHATMESSAGE %s belongs to the CHAT %s\n", SKYPOPEN_P_LOG, id, value); + found = 0; + for (i = 0; i < MAX_CHATMESSAGES; i++) { + if (!strcmp(tech_pvt->chatmessages[i].id, id)) { + strncpy(tech_pvt->chatmessages[i].chatname, value, sizeof(tech_pvt->chatmessages[i].chatname)); + found = 1; + break; + } + } + if (!found) { + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); + } + } + if (!strcasecmp(prop, "FROM_HANDLE")) { + DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_HANDLE %s\n", SKYPOPEN_P_LOG, id, value); + found = 0; + for (i = 0; i < MAX_CHATMESSAGES; i++) { + if (!strcmp(tech_pvt->chatmessages[i].id, id)) { + strncpy(tech_pvt->chatmessages[i].from_handle, value, sizeof(tech_pvt->chatmessages[i].from_handle)); + found = 1; + break; + } + } + if (!found) { + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); + } + + } + if (!strcasecmp(prop, "FROM_DISPNAME")) { + DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_DISPNAME %s\n", SKYPOPEN_P_LOG, id, value); + found = 0; + for (i = 0; i < MAX_CHATMESSAGES; i++) { + if (!strcmp(tech_pvt->chatmessages[i].id, id)) { + strncpy(tech_pvt->chatmessages[i].from_dispname, value, sizeof(tech_pvt->chatmessages[i].from_dispname)); + found = 1; + break; + } + } + if (!found) { + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); + } + + } + if (!strcasecmp(prop, "BODY")) { + DEBUGA_SKYPE("CHATMESSAGE %s has BODY %s\n", SKYPOPEN_P_LOG, id, value); + found = 0; + for (i = 0; i < MAX_CHATMESSAGES; i++) { + if (!strcmp(tech_pvt->chatmessages[i].id, id)) { + strncpy(tech_pvt->chatmessages[i].body, value, sizeof(tech_pvt->chatmessages[i].body)); + found = 1; + break; + } + } + if (!found) { + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); + } else { + DEBUGA_SKYPE + ("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s, chatname=%s, from_handle=%s, from_dispname=%s, body=%s\n", + SKYPOPEN_P_LOG, id, i, tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id, tech_pvt->chatmessages[i].chatname, + tech_pvt->chatmessages[i].from_handle, tech_pvt->chatmessages[i].from_dispname, tech_pvt->chatmessages[i].body); + if (strcmp(tech_pvt->chatmessages[i].from_handle, tech_pvt->skype_user)) { //if the message was not sent by myself + incoming_chatmessage(tech_pvt, i); + memset(&tech_pvt->chatmessages[i], '\0', sizeof(&tech_pvt->chatmessages[i])); + + sprintf(msg_to_skype, "SET CHATMESSAGE %s SEEN", id); + skypopen_signaling_write(tech_pvt, msg_to_skype); + } + } + + } } } @@ -885,7 +930,7 @@ void *skypopen_do_tcp_srv_thread_func(void *obj) || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPOPEN_STATE_UP)) { //unsigned int fdselect; - int rt=1; + int rt = 1; //fd_set fs; //struct timeval to; int nospace; @@ -1022,7 +1067,7 @@ void *skypopen_do_tcp_cli_thread_func(void *obj) if (!(running && tech_pvt->running)) break; FD_ZERO(&fsgio); - togio.tv_usec = MS_SKYPOPEN * 1000 * 3; + togio.tv_usec = MS_SKYPOPEN * 1000 * 3; togio.tv_sec = 0; fdselectgio = s; FD_SET(fdselectgio, &fsgio); @@ -1137,7 +1182,7 @@ int skypopen_senddigit(private_t *tech_pvt, char digit) char msg_to_skype[1024]; DEBUGA_SKYPE("DIGIT received: %c\n", SKYPOPEN_P_LOG, digit); - if(digit != 'a' && digit != 'A' && digit != 'b' && digit != 'B' && digit != 'c' && digit != 'C' && digit != 'd' && digit != 'D'){ + if (digit != 'a' && digit != 'A' && digit != 'b' && digit != 'B' && digit != 'c' && digit != 'C' && digit != 'd' && digit != 'D') { sprintf(msg_to_skype, "SET CALL %s DTMF %c", tech_pvt->skype_call_id, digit); skypopen_signaling_write(tech_pvt, msg_to_skype); } else { @@ -1690,7 +1735,7 @@ void skypopen_clean_disp(void *data) DEBUGA_SKYPE("NOT destroyed disp\n", SKYPOPEN_P_LOG); } DEBUGA_SKYPE("OUT destroyed disp\n", SKYPOPEN_P_LOG); - skypopen_sleep(20000); + skypopen_sleep(20000); } void *skypopen_do_skypeapi_thread_func(void *obj) @@ -1750,7 +1795,7 @@ void *skypopen_do_skypeapi_thread_func(void *obj) if (session) { switch_channel_t *channel = switch_core_session_get_channel(session); - if(channel){ + if (channel) { switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_IO); @@ -1787,7 +1832,7 @@ void *skypopen_do_skypeapi_thread_func(void *obj) switch_channel_t *channel = switch_core_session_get_channel(session); - if(channel){ + if (channel) { switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_IO); switch_clear_flag(tech_pvt, TFLAG_VOICE); @@ -1899,7 +1944,7 @@ void *skypopen_do_skypeapi_thread_func(void *obj) case ClientMessage: if (an_event.xclient.format != 8) { - //skypopen_sleep(1000); //0.1 msec + //skypopen_sleep(1000); //0.1 msec break; } @@ -1959,11 +2004,10 @@ void *skypopen_do_skypeapi_thread_func(void *obj) //XFlush(disp); there_were_continues = 0; } - - //skypopen_sleep(1000); //0.1 msec + //skypopen_sleep(1000); //0.1 msec break; default: - //skypopen_sleep(1000); //0.1 msec + //skypopen_sleep(1000); //0.1 msec break; } //switch event.type } //while XPending diff --git a/src/mod/endpoints/mod_sofia/conf/sip_profiles/external.xml b/src/mod/endpoints/mod_sofia/conf/sip_profiles/external.xml deleted file mode 100644 index a709cbb94c..0000000000 --- a/src/mod/endpoints/mod_sofia/conf/sip_profiles/external.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_sofia/conf/sip_profiles/external/example.xml b/src/mod/endpoints/mod_sofia/conf/sip_profiles/external/example.xml deleted file mode 100644 index 70668a9ce5..0000000000 --- a/src/mod/endpoints/mod_sofia/conf/sip_profiles/external/example.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal-ipv6.xml b/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal-ipv6.xml deleted file mode 100644 index ee27a241a0..0000000000 --- a/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal-ipv6.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal.xml b/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal.xml deleted file mode 100644 index b8390c7934..0000000000 --- a/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal.xml +++ /dev/null @@ -1,385 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal/example.xml b/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal/example.xml deleted file mode 100644 index fc061f96d1..0000000000 --- a/src/mod/endpoints/mod_sofia/conf/sip_profiles/internal/example.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_sofia/conf/sofia.conf.xml b/src/mod/endpoints/mod_sofia/conf/sofia.conf.xml new file mode 100644 index 0000000000..30d8063a67 --- /dev/null +++ b/src/mod/endpoints/mod_sofia/conf/sofia.conf.xml @@ -0,0 +1,475 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index e47fb85c46..1ea162d8ff 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -172,7 +172,7 @@ static switch_status_t sofia_on_reset(switch_core_session_t *session) const char *uuid = switch_core_session_get_uuid(session); if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { - const char *other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *other_uuid = switch_channel_get_partner_uuid(channel); int x = 0; if (other_uuid) { @@ -495,7 +495,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session) val = switch_channel_get_variable(tech_pvt->channel, "disable_q850_reason"); if (!val || switch_false(val)) { - if ((val = switch_channel_get_variable(tech_pvt->channel, "sip_reason_str"))) { + if ((val = switch_channel_get_variable(tech_pvt->channel, "sip_reason"))) { switch_snprintf(reason, sizeof(reason), "%s", val); } else { if (switch_channel_test_flag(channel, CF_INTERCEPT) || cause == SWITCH_CAUSE_PICKED_OFF || cause == SWITCH_CAUSE_LOSE_RACE) { @@ -1411,7 +1411,6 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi switch (dtmf_type) { case DTMF_2833: { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Enqueuing RFC2833 DTMF %c of length %d\n", dtmf->digit, dtmf->duration); return switch_rtp_queue_rfc2833(tech_pvt->rtp_session, dtmf); } case DTMF_INFO: @@ -1421,7 +1420,6 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi } else if (dtmf->digit == 'W') { switch_yield(1000000); } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending INFO DTMF %c of length %d\n", dtmf->digit, dtmf->duration / 8); snprintf(message, sizeof(message), "Signal=%c\r\nDuration=%d\r\n", dtmf->digit, dtmf->duration / 8); switch_mutex_lock(tech_pvt->sofia_mutex); nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/dtmf-relay"), SIPTAG_PAYLOAD_STR(message), TAG_END()); @@ -1430,9 +1428,6 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi } break; case DTMF_NONE: - { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Discarding DTMF %c of length %d, DTMF type is NONE\n", dtmf->digit, dtmf->duration); - } break; default: switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Unhandled DTMF type!\n"); @@ -1592,6 +1587,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi case SWITCH_MESSAGE_INDICATE_BRIDGE: { + + switch_channel_set_variable(channel, SOFIA_REPLACES_HEADER, NULL); sofia_glue_tech_track(tech_pvt->profile, session); sofia_set_flag(tech_pvt, TFLAG_SIMPLIFY); @@ -1654,6 +1651,28 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } } goto end; + case SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE: + { + const char *event = switch_channel_get_variable(channel, "sip_blind_transfer_event"); + const char *uuid = switch_channel_get_variable(channel, "blind_transfer_uuid"); + char *xdest; + + if (event && uuid) { + nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), + NUTAG_SUBSTATE(nua_substate_terminated), + SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), + SIPTAG_PAYLOAD_STR(msg->numeric_arg ? "SIP/2.0 200 OK\r\n" : "SIP/2.0 403 Forbidden\r\n"), + SIPTAG_EVENT_STR(event), TAG_END()); + + + if (!msg->numeric_arg) { + xdest = switch_core_session_sprintf(session, "intercept:%s", uuid); + switch_ivr_session_transfer(session, xdest, "inline", NULL); + } + } + + } + goto end; case SWITCH_MESSAGE_INDICATE_UNBRIDGE: if (switch_rtp_ready(tech_pvt->rtp_session)) { @@ -1807,7 +1826,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) + if ((uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(uuid))) { other_channel = switch_core_session_get_channel(other_session); ip = switch_channel_get_variable(other_channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE); @@ -1929,6 +1948,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi switch_channel_set_flag(channel, CF_REQ_MEDIA); } sofia_set_flag_locked(tech_pvt, TFLAG_SENT_UPDATE); + switch_channel_set_variable(channel, "sip_require_timer", "false"); sofia_glue_do_invite(session); } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Request to send IMAGE on channel with not t38 options.\n", @@ -2043,7 +2063,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi const char *uuid; const char *call_id = NULL, *to_user = NULL, *to_host = NULL, *to_tag = NULL, *from_tag = NULL, *from_user = NULL, *from_host = NULL; - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *rsession; if ((rsession = switch_core_session_locate(uuid))) { switch_channel_t *rchannel = switch_core_session_get_channel(rsession); @@ -2087,20 +2107,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi case SWITCH_MESSAGE_INDICATE_DISPLAY: { const char *name = msg->string_array_arg[0], *number = msg->string_array_arg[1]; - char *arg = NULL; - char *argv[2] = { 0 }; - //int argc; - - if (zstr(name) && !zstr(msg->string_arg)) { - arg = strdup(msg->string_arg); - switch_assert(arg); - - switch_separate_string(arg, '|', argv, (sizeof(argv) / sizeof(argv[0]))); - name = argv[0]; - number = argv[1]; - - } - + if (!zstr(name)) { char message[256] = ""; const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent"); @@ -2113,6 +2120,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi number = tech_pvt->caller_profile->destination_number; } + switch_ivr_eavesdrop_update_display(session, name, number); + if (!sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY) && switch_channel_test_flag(channel, CF_ANSWERED)) { if (zstr(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) || zstr(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) { @@ -2181,13 +2190,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi tech_pvt->last_sent_callee_id_name = switch_core_session_strdup(tech_pvt->session, name); tech_pvt->last_sent_callee_id_number = switch_core_session_strdup(tech_pvt->session, number); - - switch_channel_set_variable(channel, "last_sent_callee_id_name", name); - switch_channel_set_variable(channel, "last_sent_callee_id_number", number); if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) { - const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(channel); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "SEND"); @@ -2208,8 +2214,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } } } - - switch_safe_free(arg); } break; @@ -2422,6 +2426,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi char *sdp = (char *) msg->pointer_arg; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Responding with %d [%s]\n", code, reason); + sofia_clear_flag(tech_pvt, TFLAG_REINVITED); if (!zstr((sdp))) { if (!strcasecmp(sdp, "t38")) { @@ -2994,6 +2999,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t stream->write_function(stream, "NOMEDIA \t%s\n", sofia_test_flag(profile, TFLAG_INB_NOMEDIA) ? "true" : "false"); stream->write_function(stream, "LATE-NEG \t%s\n", sofia_test_flag(profile, TFLAG_LATE_NEGOTIATION) ? "true" : "false"); stream->write_function(stream, "PROXY-MEDIA \t%s\n", sofia_test_flag(profile, TFLAG_PROXY_MEDIA) ? "true" : "false"); + stream->write_function(stream, "ZRTP-PASSTHRU \t%s\n", sofia_test_flag(profile, TFLAG_ZRTP_PASSTHRU) ? "true" : "false"); stream->write_function(stream, "AGGRESSIVENAT \t%s\n", sofia_test_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION) ? "true" : "false"); stream->write_function(stream, "STUN-ENABLED \t%s\n", sofia_test_pflag(profile, PFLAG_STUN_ENABLED) ? "true" : "false"); @@ -3272,6 +3278,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl stream->write_function(stream, " %s\n", sofia_test_flag(profile, TFLAG_INB_NOMEDIA) ? "true" : "false"); stream->write_function(stream, " %s\n", sofia_test_flag(profile, TFLAG_LATE_NEGOTIATION) ? "true" : "false"); stream->write_function(stream, " %s\n", sofia_test_flag(profile, TFLAG_PROXY_MEDIA) ? "true" : "false"); + stream->write_function(stream, " %s\n", sofia_test_flag(profile, TFLAG_ZRTP_PASSTHRU) ? "true" : "false"); stream->write_function(stream, " %s\n", sofia_test_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION) ? "true" : "false"); stream->write_function(stream, " %s\n", @@ -3637,6 +3644,17 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t if (!strcasecmp(argv[1], "stop")) { sofia_clear_pflag_locked(profile, PFLAG_RUNNING); + if (argv[2] && !strcasecmp(argv[2], "wait")) { + int loops = 20 * 2; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for %s to finish SIP transactions.\n", profile->name); + while (!sofia_test_pflag(profile, PFLAG_SHUTDOWN)) { + switch_yield(500000); + if (!--loops) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Timeout Waiting for %s to finish SIP transactions.\n", profile->name); + break; + } + } + } stream->write_function(stream, "stopping: %s", profile->name); } else { sofia_set_pflag_locked(profile, PFLAG_RESPAWN); @@ -4223,7 +4241,7 @@ SWITCH_STANDARD_API(sofia_function) "sofia global siptrace \n" "sofia capture \n" " watchdog \n\n" - "sofia profile [start | stop | restart | rescan]\n" + "sofia profile [start | stop | restart | rescan] [wait]\n" " flush_inbound_reg [ | <[user]@domain>] [reboot]\n" " check_sync [ | <[user]@domain>]\n" " [register | unregister] [ | all]\n" @@ -4868,6 +4886,17 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session sofia_clear_flag(ctech_pvt, TFLAG_ENABLE_SOA); } + if (switch_channel_test_flag(o_channel, CF_ZRTP_PASSTHRU_REQ)) { + const char *x = NULL; + sofia_glue_pass_zrtp_hash2(session, nsession); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[zrtp_passthru] Setting a-leg inherit_codec=true\n"); + switch_channel_set_variable(o_channel, "inherit_codec", "true"); + if ((x = switch_channel_get_variable(o_channel, "ep_codec_string"))) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[zrtp_passthru] Setting b-leg absolute_codec_string='%s'\n", x); + switch_channel_set_variable(nchannel, "absolute_codec_string", x); + } + } + /* SNARK: lets copy this across so we can see if we're the other leg of 3PCC + bypass_media... */ if (sofia_test_flag(ctech_pvt, TFLAG_3PCC) && (switch_channel_test_flag(o_channel, CF_PROXY_MODE) || switch_channel_test_flag(o_channel, CF_PROXY_MEDIA))) { sofia_set_flag(tech_pvt, TFLAG_3PCC_INVITE); @@ -5455,13 +5484,52 @@ static switch_status_t list_profile_gateway(const char *line, const char *cursor return status; } +SWITCH_STANDARD_APP(sofia_sla_function) +{ + private_object_t *tech_pvt; + switch_core_session_t *bargee_session; + + if (zstr(data)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: \n"); + return; + } + + if ((bargee_session = switch_core_session_locate((char *)data))) { + if (bargee_session == session) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "BARGE: %s (cannot barge on myself)\n", (char *) data); + } else { + switch_channel_t *channel; + + if (switch_core_session_check_interface(bargee_session, sofia_endpoint_interface)) { + tech_pvt = switch_core_session_get_private(bargee_session); + sofia_clear_flag(tech_pvt, TFLAG_SLA_BARGING); + sofia_set_flag(tech_pvt, TFLAG_SLA_BARGE); + switch_ivr_transfer_variable(bargee_session, session, SWITCH_SIGNAL_BOND_VARIABLE); + } + + if (switch_core_session_check_interface(session, sofia_endpoint_interface)) { + tech_pvt = switch_core_session_get_private(session); + sofia_set_flag(tech_pvt, TFLAG_SLA_BARGING); + } + + channel = switch_core_session_get_channel(session); + switch_channel_set_variable(channel, "sip_barging_uuid", (char *)data); + + } + + switch_core_session_rwunlock(bargee_session); + } + + switch_ivr_eavesdrop_session(session, data, NULL, ED_MUX_READ | ED_MUX_WRITE | ED_COPY_DISPLAY); +} + SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) { switch_chat_interface_t *chat_interface; switch_api_interface_t *api_interface; switch_management_interface_t *management_interface; - uint32_t cpus = switch_core_cpu_count(); + switch_application_interface_t *app_interface; struct in_addr in; memset(&mod_sofia_globals, 0, sizeof(mod_sofia_globals)); @@ -5491,6 +5559,22 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) switch_queue_create(&mod_sofia_globals.presence_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool); switch_queue_create(&mod_sofia_globals.mwi_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool); + mod_sofia_globals.cpu_count = switch_core_cpu_count(); + mod_sofia_globals.max_msg_queues = (mod_sofia_globals.cpu_count / 2) + 1; + if (mod_sofia_globals.max_msg_queues < 2) { + mod_sofia_globals.max_msg_queues = 2; + } + + if (mod_sofia_globals.max_msg_queues > SOFIA_MAX_MSG_QUEUE) { + mod_sofia_globals.max_msg_queues = SOFIA_MAX_MSG_QUEUE; + } + + switch_queue_create(&mod_sofia_globals.msg_queue, SOFIA_MSG_QUEUE_SIZE * mod_sofia_globals.max_msg_queues, mod_sofia_globals.pool); + + /* start one message thread */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Starting initial message thread.\n"); + sofia_msg_thread_start(0); + if (config_sofia(0, NULL) != SWITCH_STATUS_SUCCESS) { mod_sofia_globals.running = 0; return SWITCH_STATUS_GENERR; @@ -5499,10 +5583,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for profiles to start\n"); switch_yield(1500000); - /* start one message thread per cpu */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Starting %u message threads.\n", cpus); - sofia_msg_thread_start(cpus); - if (switch_event_bind_removable(modname, SWITCH_EVENT_CUSTOM, MULTICAST_EVENT, event_handler, NULL, &mod_sofia_globals.custom_node) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n"); @@ -5576,6 +5656,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) management_interface->relative_oid = "1001"; management_interface->management_function = sofia_manage; + SWITCH_ADD_APP(app_interface, "sofia_sla", "private sofia sla function", + "private sofia sla function", sofia_sla_function, "", SAF_NONE); + + SWITCH_ADD_API(api_interface, "sofia", "Sofia Controls", sofia_function, " "); SWITCH_ADD_API(api_interface, "sofia_gateway_data", "Get data from a sofia gateway", sofia_gateway_data_function, " [ivar|ovar|var] "); @@ -5596,9 +5680,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) switch_console_set_complete("add sofia profile"); switch_console_set_complete("add sofia profile restart all"); - + switch_console_set_complete("add sofia profile ::sofia::list_profiles start"); - switch_console_set_complete("add sofia profile ::sofia::list_profiles stop"); + switch_console_set_complete("add sofia profile ::sofia::list_profiles stop wait"); switch_console_set_complete("add sofia profile ::sofia::list_profiles rescan"); switch_console_set_complete("add sofia profile ::sofia::list_profiles restart"); @@ -5671,11 +5755,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown) } - for (i = 0; i < mod_sofia_globals.msg_queue_len; i++) { - switch_queue_push(mod_sofia_globals.msg_queue[i], NULL); + for (i = 0; mod_sofia_globals.msg_queue_thread[i]; i++) { + switch_queue_push(mod_sofia_globals.msg_queue, NULL); } - for (i = 0; i < mod_sofia_globals.msg_queue_len; i++) { + + for (i = 0; mod_sofia_globals.msg_queue_thread[i]; i++) { switch_status_t st; switch_thread_join(&st, mod_sofia_globals.msg_queue_thread[i]); } diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 217c95af8c..f6ea3c6496 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -24,7 +24,7 @@ * Contributor(s): * * Anthony Minessale II - * Ken Rice, Asteria Solutions Group, Inc + * Ken Rice * Paul D. Tinsley * Bret McDanel * Marcel Barbulescu @@ -78,6 +78,7 @@ typedef struct private_object private_object_t; #define MY_EVENT_REGISTER "sofia::register" #define MY_EVENT_PRE_REGISTER "sofia::pre_register" #define MY_EVENT_REGISTER_ATTEMPT "sofia::register_attempt" +#define MY_EVENT_REGISTER_FAILURE "sofia::register_failure" #define MY_EVENT_UNREGISTER "sofia::unregister" #define MY_EVENT_EXPIRE "sofia::expire" #define MY_EVENT_GATEWAY_STATE "sofia::gateway_state" @@ -150,6 +151,7 @@ typedef struct sofia_dispatch_event_s { sofia_profile_t *profile; int save; switch_core_session_t *session; + switch_memory_pool_t *pool; } sofia_dispatch_event_t; struct sofia_private { @@ -263,6 +265,9 @@ typedef enum { PFLAG_PRESENCE_MAP, PFLAG_OPTIONS_RESPOND_503_ON_BUSY, PFLAG_PRESENCE_DISABLE_EARLY, + PFLAG_CONFIRM_BLIND_TRANSFER, + PFLAG_THREAD_PER_REG, + PFLAG_MWI_USE_REG_CALLID, /* No new flags below this line */ PFLAG_MAX } PFLAGS; @@ -312,6 +317,7 @@ typedef enum { TFLAG_TPORT_LOG, TFLAG_SENT_UPDATE, TFLAG_PROXY_MEDIA, + TFLAG_ZRTP_PASSTHRU, TFLAG_HOLD_LOCK, TFLAG_3PCC_HAS_ACK, TFLAG_PASS_RFC2833, @@ -330,12 +336,15 @@ typedef enum { TFLAG_LIBERAL_DTMF, TFLAG_GOT_ACK, TFLAG_CAPTURE, + TFLAG_REINVITED, + TFLAG_SLA_BARGE, + TFLAG_SLA_BARGING, /* No new flags below this line */ TFLAG_MAX } TFLAGS; -#define SOFIA_MAX_MSG_QUEUE 101 -#define SOFIA_MSG_QUEUE_SIZE 5000 +#define SOFIA_MAX_MSG_QUEUE 64 +#define SOFIA_MSG_QUEUE_SIZE 100 struct mod_sofia_globals { switch_memory_pool_t *pool; @@ -345,12 +354,14 @@ struct mod_sofia_globals { uint32_t callid; int32_t running; int32_t threads; + int cpu_count; + int max_msg_queues; switch_mutex_t *mutex; char guess_ip[80]; char hostname[512]; switch_queue_t *presence_queue; switch_queue_t *mwi_queue; - switch_queue_t *msg_queue[SOFIA_MAX_MSG_QUEUE]; + switch_queue_t *msg_queue; switch_thread_t *msg_queue_thread[SOFIA_MAX_MSG_QUEUE]; int msg_queue_len; struct sofia_private destroy_private; @@ -509,12 +520,25 @@ typedef enum { PRES_TYPE_PASSIVE = 2 } sofia_presence_type_t; +typedef enum { + PRES_HELD_EARLY = 0, + PRES_HELD_CONFIRMED = 1, + PRES_HELD_TERMINATED = 2 +} sofia_presence_held_calls_type_t; + typedef enum { MEDIA_OPT_NONE = 0, MEDIA_OPT_MEDIA_ON_HOLD = (1 << 0), MEDIA_OPT_BYPASS_AFTER_ATT_XFER = (1 << 1) } sofia_media_options_t; +typedef enum { + PAID_DEFAULT = 0, + PAID_USER, + PAID_USER_DOMAIN, + PAID_VERBATIM +} sofia_paid_type_t; + #define MAX_RTPIP 50 struct sofia_profile { @@ -590,6 +614,7 @@ struct sofia_profile { sofia_gateway_t *gateways; //su_home_t *home; switch_hash_t *chat_hash; + switch_hash_t *mwi_debounce_hash; //switch_core_db_t *master_db; switch_thread_rwlock_t *rwlock; switch_mutex_t *flag_mutex; @@ -616,6 +641,7 @@ struct sofia_profile { int server_rport_level; int client_rport_level; sofia_presence_type_t pres_type; + sofia_presence_held_calls_type_t pres_held_type; sofia_media_options_t media_options; uint32_t force_subscription_expires; uint32_t force_publish_expires; @@ -652,6 +678,8 @@ struct sofia_profile { uint32_t sip_force_expires; uint32_t sip_expires_max_deviation; int ireg_seconds; + sofia_paid_type_t paid_type; + uint32_t rtp_digit_delay; }; struct private_object { @@ -798,6 +826,11 @@ struct private_object { switch_payload_t ianacodes[SWITCH_MAX_CODECS]; uint32_t session_timeout; enum nua_session_refresher session_refresher; + /** ZRTP **/ + char *local_sdp_audio_zrtp_hash; + char *local_sdp_video_zrtp_hash; + char *remote_sdp_audio_zrtp_hash; + char *remote_sdp_video_zrtp_hash; }; struct callback_t { @@ -905,6 +938,8 @@ void launch_sofia_profile_thread(sofia_profile_t *profile); switch_status_t sofia_presence_chat_send(switch_event_t *message_event); void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt); +void sofia_glue_pass_zrtp_hash2(switch_core_session_t *aleg_session, switch_core_session_t *bleg_session); +void sofia_glue_pass_zrtp_hash(switch_core_session_t *session); /* * \brief Sets the "ep_codec_string" channel variable, parsing r_sdp and taing codec_string in consideration @@ -1114,7 +1149,7 @@ void sofia_glue_get_addr(msg_t *msg, char *buf, size_t buflen, int *port); sofia_destination_t *sofia_glue_get_destination(char *data); void sofia_glue_free_destination(sofia_destination_t *dst); switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *user, const char *host, const char *event, const char *contenttype, - const char *body, const char *o_contact, const char *network_ip); + const char *body, const char *o_contact, const char *network_ip, const char *call_id); char *sofia_glue_get_extra_headers(switch_channel_t *channel, const char *prefix); void sofia_glue_set_extra_headers(switch_core_session_t *session, sip_t const *sip, const char *prefix); char *sofia_glue_get_extra_headers_from_event(switch_event_t *event, const char *prefix); @@ -1152,3 +1187,15 @@ void sofia_process_dispatch_event(sofia_dispatch_event_t **dep); char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool); void sofia_presence_check_subscriptions(sofia_profile_t *profile, time_t now); void sofia_msg_thread_start(int idx); + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index ebd083cae1..281aa511da 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -24,7 +24,7 @@ * Contributor(s): * * Anthony Minessale II - * Ken Rice, Asteria Solutions Group, Inc + * Ken Rice * Paul D. Tinsley * Bret McDanel * Marcel Barbulescu @@ -469,12 +469,33 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status, if (switch_event_create(&s_event, SWITCH_EVENT_NOTIFY_IN) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "event", sip->sip_event->o_type); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "pl_data", sip->sip_payload ? sip->sip_payload->pl_data : ""); - switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "sip_content_type", sip->sip_content_type->c_type); + if ( sip->sip_content_type != NULL ) + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "sip_content_type", sip->sip_content_type->c_type); switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", sofia_private->gateway->profile->sip_port); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "module_name", "mod_sofia"); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_name", sofia_private->gateway->profile->name); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_uri", sofia_private->gateway->profile->url); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "gateway_name", sofia_private->gateway->name); + if ( sip->sip_call_info != NULL ) { + sip_call_info_t *call_info = sip->sip_call_info; + int cur_len = 0; + char *tmp = NULL; + char *hold = strdup(sip_header_as_string(nua_handle_home(nh), (void *) call_info)); + cur_len = strlen(hold); + + while ( call_info->ci_next != NULL) { + call_info = call_info->ci_next; + tmp = strdup(sip_header_as_string(nua_handle_home(nh), (void *) call_info)); + cur_len = cur_len + strlen(tmp) +2; + hold = realloc(hold, cur_len); + switch_assert(hold); + strcat(hold,","); + strcat(hold, tmp); + free(tmp); + } + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Call-Info", hold); + free(hold); + } switch_event_fire(&s_event); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "dispatched freeswitch event for message-summary NOTIFY\n"); } else { @@ -578,6 +599,60 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status, status = 200; phrase = "OK"; + if (sofia_test_flag(tech_pvt, TFLAG_SLA_BARGING)) { + const char *bargee_uuid = switch_channel_get_variable(channel, "sip_barging_uuid"); + switch_core_session_t *bargee_session; + uint32_t ttl = 0; + + if ((bargee_session = switch_core_session_locate(bargee_uuid))) { + //switch_channel_t *bargee_channel = switch_core_session_get_channel(bargee_session); + if ((ttl = switch_core_media_bug_count(bargee_session, "eavesdrop")) == 1) { + if (switch_core_session_check_interface(bargee_session, sofia_endpoint_interface)) { + private_object_t *bargee_tech_pvt = switch_core_session_get_private(bargee_session); + sofia_clear_flag(bargee_tech_pvt, TFLAG_SLA_BARGE); + } + } + switch_core_session_rwunlock(bargee_session); + } + } + + if (sofia_test_flag(tech_pvt, TFLAG_SLA_BARGE)) { + switch_core_session_t *new_session, *other_session; + const char *other_uuid = switch_channel_get_partner_uuid(tech_pvt->channel); + char *cmd = NULL; + + if (!zstr(other_uuid) && (other_session = switch_core_session_locate(other_uuid))) { + switch_channel_t *other_channel = switch_core_session_get_channel(other_session); + + switch_mutex_lock(profile->ireg_mutex); + if (switch_ivr_eavesdrop_pop_eavesdropper(session, &new_session) == SWITCH_STATUS_SUCCESS) { + switch_channel_t *new_channel = switch_core_session_get_channel(new_session); + const char *new_uuid = switch_core_session_get_uuid(new_session); + + + switch_channel_set_variable(new_channel, SWITCH_SIGNAL_BOND_VARIABLE, NULL); + + switch_channel_set_flag(other_channel, CF_REDIRECT); + + switch_channel_set_state(new_channel, CS_RESET); + + switch_ivr_uuid_bridge(new_uuid, other_uuid); + cmd = switch_core_session_sprintf(session, "sleep:500,sofia_sla:%s inline", new_uuid); + + switch_channel_clear_flag(other_channel, CF_REDIRECT); + + switch_core_session_rwunlock(new_session); + } + switch_mutex_unlock(profile->ireg_mutex); + + switch_core_session_rwunlock(other_session); + } + + if (!zstr(cmd)) { + switch_ivr_eavesdrop_exec_all(session, "transfer", cmd); + } + } + sofia_set_flag_locked(tech_pvt, TFLAG_BYE); call_info = switch_channel_get_variable(channel, "presence_call_info_full"); @@ -708,7 +783,7 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons number = caller_profile->destination_number; } - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (session_b = switch_core_session_locate(uuid))) { + if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) { switch_core_session_message_t *msg; //switch_channel_t *channel_b = switch_core_session_get_channel(session_b); @@ -831,7 +906,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro caller_profile->callee_id_number = switch_sanitize_number(switch_core_strdup(caller_profile->pool, number)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s Update Callee ID to \"%s\" <%s>\n", switch_channel_get_name(channel), name, number); - if (lazy || (att && !switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if (lazy || (att && !switch_channel_get_partner_uuid(channel))) { switch_channel_flip_cid(channel); } } @@ -839,7 +914,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro if (send) { if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) { - const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(channel); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV"); if (uuid) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid); @@ -1207,6 +1282,56 @@ static void our_sofia_event_callback(nua_event_t event, } } +void *SWITCH_THREAD_FUNC sofia_msg_thread_run_once(switch_thread_t *thread, void *obj) +{ + sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) obj; + switch_memory_pool_t *pool = NULL; + + if (de) { + pool = de->pool; + de->pool = NULL; + sofia_process_dispatch_event(&de); + } + + if (pool) { + switch_core_destroy_memory_pool(&pool); + } + + return NULL; +} + +void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep) +{ + sofia_dispatch_event_t *de = *dep; + switch_threadattr_t *thd_attr = NULL; + switch_memory_pool_t *pool; + switch_thread_t *thread; + sofia_profile_t *profile = (*dep)->profile; + switch_status_t status; + + switch_core_new_memory_pool(&pool); + + + *dep = NULL; + de->pool = pool; + + switch_mutex_lock(profile->ireg_mutex); + switch_threadattr_create(&thd_attr, de->pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + status = switch_thread_create(&thread, + thd_attr, + sofia_msg_thread_run_once, + de, + de->pool); + switch_mutex_unlock(profile->ireg_mutex); + + if (status != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot create threads!\n"); + sofia_process_dispatch_event(&de); + } +} + void sofia_process_dispatch_event(sofia_dispatch_event_t **dep) { sofia_dispatch_event_t *de = *dep; @@ -1228,34 +1353,64 @@ void sofia_process_dispatch_event(sofia_dispatch_event_t **dep) nua_handle_unref(nh); nua_stack_unref(nua); + switch_os_yield(); } + +static int msg_queue_threads = 0; +//static int count = 0; + void *SWITCH_THREAD_FUNC sofia_msg_thread_run(switch_thread_t *thread, void *obj) { void *pop; switch_queue_t *q = (switch_queue_t *) obj; - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "MSG Thread Started\n"); + int my_id; - while(switch_queue_pop(q, &pop) == SWITCH_STATUS_SUCCESS && pop) { - sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) pop; - sofia_process_dispatch_event(&de); - switch_cond_next(); + for (my_id = 0; my_id < mod_sofia_globals.msg_queue_len; my_id++) { + if (mod_sofia_globals.msg_queue_thread[my_id] == thread) { + break; + } + } + + switch_mutex_lock(mod_sofia_globals.mutex); + msg_queue_threads++; + switch_mutex_unlock(mod_sofia_globals.mutex); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "MSG Thread %d Started\n", my_id); + + + for(;;) { + + if (switch_queue_pop(q, &pop) != SWITCH_STATUS_SUCCESS) { + switch_cond_next(); + continue; + } + + if (pop) { + sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) pop; + sofia_process_dispatch_event(&de); + switch_os_yield(); + } else { + break; + } } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "MSG Thread Ended\n"); + switch_mutex_lock(mod_sofia_globals.mutex); + msg_queue_threads--; + switch_mutex_unlock(mod_sofia_globals.mutex); + return NULL; } -static int IDX = 0; - void sofia_msg_thread_start(int idx) { - if (idx >= SOFIA_MAX_MSG_QUEUE || (idx < mod_sofia_globals.msg_queue_len && mod_sofia_globals.msg_queue_thread[idx])) { + if (idx >= mod_sofia_globals.max_msg_queues || + idx >= SOFIA_MAX_MSG_QUEUE || (idx < mod_sofia_globals.msg_queue_len && mod_sofia_globals.msg_queue_thread[idx])) { return; } @@ -1266,18 +1421,16 @@ void sofia_msg_thread_start(int idx) mod_sofia_globals.msg_queue_len = idx + 1; for (i = 0; i < mod_sofia_globals.msg_queue_len; i++) { - if (!mod_sofia_globals.msg_queue[i]) { + if (!mod_sofia_globals.msg_queue_thread[i]) { switch_threadattr_t *thd_attr = NULL; - switch_queue_create(&mod_sofia_globals.msg_queue[i], SOFIA_MSG_QUEUE_SIZE, mod_sofia_globals.pool); - switch_threadattr_create(&thd_attr, mod_sofia_globals.pool); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - //switch_threadattr_priority_increase(thd_attr); + switch_threadattr_priority_increase(thd_attr); switch_thread_create(&mod_sofia_globals.msg_queue_thread[i], thd_attr, sofia_msg_thread_run, - mod_sofia_globals.msg_queue[i], + mod_sofia_globals.msg_queue, mod_sofia_globals.pool); } } @@ -1286,34 +1439,35 @@ void sofia_msg_thread_start(int idx) switch_mutex_unlock(mod_sofia_globals.mutex); } - +//static int foo = 0; static void sofia_queue_message(sofia_dispatch_event_t *de) { - int idx = 0; + int launch = 0; - if (mod_sofia_globals.running == 0) { + if (mod_sofia_globals.running == 0 || !mod_sofia_globals.msg_queue) { sofia_process_dispatch_event(&de); return; } - again: - switch_mutex_lock(mod_sofia_globals.mutex); - idx = IDX; - IDX++; - if (IDX >= mod_sofia_globals.msg_queue_len) IDX = 0; - switch_mutex_unlock(mod_sofia_globals.mutex); - - sofia_msg_thread_start(idx); + if (de->profile && sofia_test_pflag(de->profile, PFLAG_THREAD_PER_REG) && de->data->e_event == nua_i_register) { + sofia_process_dispatch_event_in_thread(&de); + return; + } - if (switch_queue_trypush(mod_sofia_globals.msg_queue[idx], de) != SWITCH_STATUS_SUCCESS) { - if (mod_sofia_globals.msg_queue_len < SOFIA_MAX_MSG_QUEUE) { - sofia_msg_thread_start(idx + 1); - goto again; - } else { - switch_queue_push(mod_sofia_globals.msg_queue[idx], de); + + if ((switch_queue_size(mod_sofia_globals.msg_queue) > (SOFIA_MSG_QUEUE_SIZE * msg_queue_threads))) { + launch++; + } + + + if (launch) { + if (mod_sofia_globals.msg_queue_len < mod_sofia_globals.max_msg_queues) { + sofia_msg_thread_start(mod_sofia_globals.msg_queue_len + 1); } } + + switch_queue_push(mod_sofia_globals.msg_queue, de); } @@ -1324,8 +1478,14 @@ void sofia_event_callback(nua_event_t event, tagi_t tags[]) { sofia_dispatch_event_t *de; + int critical = (((SOFIA_MSG_QUEUE_SIZE * mod_sofia_globals.max_msg_queues) * 900) / 1000); + if (switch_queue_size(mod_sofia_globals.msg_queue) > critical) { + nua_respond(nh, 503, "System Busy", SIPTAG_RETRY_AFTER_STR("300"), TAG_END()); + return; + } + if (sofia_test_pflag(profile, PFLAG_STANDBY)) { if (event < nua_r_set_params || event > nua_r_authenticate) { nua_respond(nh, 503, "System Paused", TAG_END()); @@ -1333,6 +1493,7 @@ void sofia_event_callback(nua_event_t event, return; } + switch_mutex_lock(profile->flag_mutex); profile->queued_events++; @@ -1381,8 +1542,8 @@ void sofia_event_callback(nua_event_t event, } } - sofia_queue_message(de); + switch_os_yield(); } @@ -1619,11 +1780,6 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread /* While we're running, or there is a pending sql statment that we haven't appended to sqlbuf yet, because of a lack of buffer space */ while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || sql) { - if (sofia_test_pflag(profile, PFLAG_STANDBY)) { - switch_yield(1000000); - continue; - } - if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) { /* Do we have enough statements or is the timeout expired */ while (sql || (sofia_test_pflag(profile, PFLAG_RUNNING) && mod_sofia_globals.running == 1 && @@ -1720,18 +1876,21 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread } } - if (++ireg_loops >= IREG_SECONDS) { - time_t now = switch_epoch_time_now(NULL); - sofia_reg_check_expire(profile, now, 0); - ireg_loops = 0; - } - if (++gateway_loops >= GATEWAY_SECONDS) { - sofia_reg_check_gateway(profile, switch_epoch_time_now(NULL)); - gateway_loops = 0; - } + if (!sofia_test_pflag(profile, PFLAG_STANDBY)) { + if (++ireg_loops >= IREG_SECONDS) { + time_t now = switch_epoch_time_now(NULL); + sofia_reg_check_expire(profile, now, 0); + ireg_loops = 0; + } + + if (++gateway_loops >= GATEWAY_SECONDS) { + sofia_reg_check_gateway(profile, switch_epoch_time_now(NULL)); + gateway_loops = 0; + } - sofia_sub_check_gateway(profile, time(NULL)); + sofia_sub_check_gateway(profile, time(NULL)); + } last_check = switch_micro_time_now(); } @@ -1958,6 +2117,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void NUTAG_AUTOACK(0), NUTAG_AUTOALERT(0), NUTAG_ENABLEMESSENGER(1), + NTATAG_EXTRA_100(0), TAG_IF((profile->mflags & MFLAG_REGISTER), NUTAG_ALLOW("REGISTER")), TAG_IF((profile->mflags & MFLAG_REFER), NUTAG_ALLOW("REFER")), TAG_IF(!sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_ALLOW("PRACK")), @@ -2147,6 +2307,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void sofia_glue_del_profile(profile); switch_core_hash_destroy(&profile->chat_hash); + switch_core_hash_destroy(&profile->mwi_debounce_hash); switch_thread_rwlock_unlock(profile->rwlock); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write unlock %s\n", profile->name); @@ -2630,9 +2791,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s", proxy); } - gateway->register_from = switch_core_sprintf(gateway->pool, "", - from_user, !zstr(from_domain) ? from_domain : proxy, register_transport); - + gateway->register_from = switch_core_sprintf(gateway->pool, "", + from_user, !zstr(from_domain) ? from_domain : proxy); if (ping_freq) { if (ping_freq >= 5) { @@ -2640,10 +2800,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) gateway->ping_max = ping_max; gateway->ping_min = ping_min; gateway->ping = switch_epoch_time_now(NULL) + ping_freq; - gateway->options_to_uri = switch_core_sprintf(gateway->pool, "", - !zstr(from_domain) ? from_domain : proxy, register_transport); - //gateway->options_from_uri = switch_core_sprintf(gateway->pool, "", - // profile->extrtpip ? profile->extrtpip : profile->sipip, register_transport); + gateway->options_to_uri = switch_core_sprintf(gateway->pool, "", + !zstr(from_domain) ? from_domain : proxy); gateway->options_from_uri = gateway->options_to_uri; } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n"); @@ -2960,6 +3118,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID); } + } else if (!strcasecmp(var, "rtp-digit-delay")) { + int delay = val ? atoi(val) : 0; + + if (delay < 0) delay = 0; + + profile->rtp_digit_delay = (uint32_t) delay; } else if (!strcasecmp(var, "watchdog-enabled")) { profile->watchdog_enabled = switch_true(val); } else if (!strcasecmp(var, "watchdog-step-timeout")) { @@ -3026,6 +3190,18 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_pflag(profile, PFLAG_LOG_AUTH_FAIL); } + } else if (!strcasecmp(var, "confirm-blind-transfer")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_CONFIRM_BLIND_TRANSFER); + } else { + sofia_clear_pflag(profile, PFLAG_CONFIRM_BLIND_TRANSFER); + } + } else if (!strcasecmp(var, "mwi-use-reg-callid")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_MWI_USE_REG_CALLID); + } else { + sofia_clear_pflag(profile, PFLAG_MWI_USE_REG_CALLID); + } } else if (!strcasecmp(var, "presence-proto-lookup")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_PRESENCE_MAP); @@ -3145,12 +3321,24 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_flag(profile, TFLAG_PROXY_MEDIA); } + } else if (!strcasecmp(var, "inbound-zrtp-passthru")) { + if (switch_true(val)) { + sofia_set_flag(profile, TFLAG_ZRTP_PASSTHRU); + } else { + sofia_clear_flag(profile, TFLAG_ZRTP_PASSTHRU); + } } else if (!strcasecmp(var, "inbound-use-callid-as-uuid")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_CALLID_AS_UUID); } else { sofia_clear_pflag(profile, PFLAG_CALLID_AS_UUID); } + } else if (!strcasecmp(var, "inbound-reg-in-new-thread")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_THREAD_PER_REG); + } else { + sofia_clear_pflag(profile, PFLAG_THREAD_PER_REG); + } } else if (!strcasecmp(var, "rtp-autoflush-during-bridge")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); @@ -3497,10 +3685,26 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { profile->sip_expires_max_deviation = 0; } + } else if (!strcasecmp(var, "p-asserted-id-parse")) { + if (!strncasecmp(val, "default", 7)) { + profile->paid_type = PAID_DEFAULT; + } else if (!strncasecmp(val, "user-only", 9)) { + profile->paid_type = PAID_USER; + } else if (!strncasecmp(val, "user-domain", 11)) { + profile->paid_type = PAID_USER_DOMAIN; + } else if (!strncasecmp(val, "verbatim", 8)) { + profile->paid_type = PAID_VERBATIM; + } else { + profile->paid_type = PAID_DEFAULT; + } } } } + if (sofia_test_flag(profile, TFLAG_ZRTP_PASSTHRU)) { + sofia_set_flag(profile, TFLAG_LATE_NEGOTIATION); + } + if ((gateways_tag = switch_xml_child(xprofile, "gateways"))) { parse_gateways(profile, gateways_tag); } @@ -3636,18 +3840,6 @@ switch_status_t config_sofia(int reload, char *profile_name) mod_sofia_globals.debug_sla = atoi(val); } else if (!strcasecmp(var, "auto-restart")) { mod_sofia_globals.auto_restart = switch_true(val); - } else if (!strcasecmp(var, "message-threads")) { - int num = atoi(val); - - if (num < 1 || num > SOFIA_MAX_MSG_QUEUE - 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "message-threads must be between 1 and %d", SOFIA_MAX_MSG_QUEUE -1); - } - - if (num < 1) num = 1; - if (num > SOFIA_MAX_MSG_QUEUE - 1) num = SOFIA_MAX_MSG_QUEUE -1; - - sofia_msg_thread_start(num); - } else if (!strcasecmp(var, "reg-deny-binding-fetch-and-no-lookup")) { /* backwards compatibility */ mod_sofia_globals.reg_deny_binding_fetch_and_no_lookup = switch_true(val); /* remove when noone complains about the extra lookup */ if (switch_true(val)) { @@ -3729,9 +3921,11 @@ switch_status_t config_sofia(int reload, char *profile_name) profile->dbname = switch_core_strdup(profile->pool, url); switch_core_hash_init(&profile->chat_hash, profile->pool); + switch_core_hash_init(&profile->mwi_debounce_hash, profile->pool); switch_thread_rwlock_create(&profile->rwlock, profile->pool); switch_mutex_init(&profile->flag_mutex, SWITCH_MUTEX_NESTED, profile->pool); profile->dtmf_duration = 100; + profile->rtp_digit_delay = 40; profile->sip_force_expires = 0; profile->sip_expires_max_deviation = 0; profile->tls_version = 0; @@ -3756,6 +3950,7 @@ switch_status_t config_sofia(int reload, char *profile_name) profile->ndlb |= PFLAG_NDLB_ALLOW_NONDUP_SDP; profile->te = 101; profile->ireg_seconds = IREG_SECONDS; + profile->paid_type = PAID_DEFAULT; profile->tls_verify_policy = TPTLS_VERIFY_NONE; @@ -3811,6 +4006,18 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_LOG_AUTH_FAIL); } + } else if (!strcasecmp(var, "confirm-blind-transfer")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_CONFIRM_BLIND_TRANSFER); + } else { + sofia_clear_pflag(profile, PFLAG_CONFIRM_BLIND_TRANSFER); + } + } else if (!strcasecmp(var, "mwi-use-reg-callid")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_MWI_USE_REG_CALLID); + } else { + sofia_clear_pflag(profile, PFLAG_MWI_USE_REG_CALLID); + } } else if (!strcasecmp(var, "presence-proto-lookup")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_PRESENCE_MAP); @@ -3829,6 +4036,12 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_LIBERAL_DTMF); } + } else if (!strcasecmp(var, "rtp-digit-delay")) { + int delay = atoi(val); + if (delay < 0) { + delay = 0; + } + profile->rtp_digit_delay = (uint32_t) delay; } else if (!strcasecmp(var, "watchdog-enabled")) { profile->watchdog_enabled = switch_true(val); } else if (!strcasecmp(var, "watchdog-step-timeout")) { @@ -3968,6 +4181,8 @@ switch_status_t config_sofia(int reload, char *profile_name) } } else if (!strcasecmp(var, "inbound-proxy-media") && switch_true(val)) { sofia_set_flag(profile, TFLAG_PROXY_MEDIA); + } else if (!strcasecmp(var, "inbound-zrtp-passthru") && switch_true(val)) { + sofia_set_flag(profile, TFLAG_ZRTP_PASSTHRU); } else if (!strcasecmp(var, "force-subscription-expires")) { int tmp = atoi(val); if (tmp > 0) { @@ -3988,6 +4203,12 @@ switch_status_t config_sofia(int reload, char *profile_name) sofia_clear_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER); sofia_clear_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER); } + } else if (!strcasecmp(var, "inbound-reg-in-new-thread")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_THREAD_PER_REG); + } else { + sofia_clear_pflag(profile, PFLAG_THREAD_PER_REG); + } } else if (!strcasecmp(var, "inbound-use-callid-as-uuid")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_CALLID_AS_UUID); @@ -4203,6 +4424,12 @@ switch_status_t config_sofia(int reload, char *profile_name) } else if (switch_true(val)) { profile->pres_type = PRES_TYPE_FULL; } + } else if (!strcasecmp(var, "presence-hold-state")) { + if (!strcasecmp(val, "confirmed")) { + profile->pres_held_type = PRES_HELD_CONFIRMED; + } else if (!strcasecmp(val, "terminated")) { + profile->pres_held_type = PRES_HELD_TERMINATED; + } } else if (!strcasecmp(var, "presence-privacy")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_PRESENCE_PRIVACY); @@ -4571,9 +4798,25 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_NO_CONNECTION_REUSE); } + } else if (!strcasecmp(var, "p-asserted-id-parse")) { + if (!strncasecmp(val, "default", 7)) { + profile->paid_type = PAID_DEFAULT; + } else if (!strncasecmp(val, "user-only", 9)) { + profile->paid_type = PAID_USER; + } else if (!strncasecmp(val, "user-domain", 11)) { + profile->paid_type = PAID_USER_DOMAIN; + } else if (!strncasecmp(val, "verbatim", 8)) { + profile->paid_type = PAID_VERBATIM; + } else { + profile->paid_type = PAID_DEFAULT; + } } } + if (sofia_test_flag(profile, TFLAG_ZRTP_PASSTHRU)) { + sofia_set_flag(profile, TFLAG_LATE_NEGOTIATION); + } + if ((!profile->cng_pt) && (!sofia_test_pflag(profile, PFLAG_SUPPRESS_CNG))) { profile->cng_pt = SWITCH_RTP_CNG_PAYLOAD; } @@ -4968,7 +5211,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status goto end; } - if ((br = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((br = switch_channel_get_partner_uuid(channel))) { switch_xml_t root = NULL, domain = NULL; switch_core_session_t *a_session; switch_channel_t *a_channel; @@ -5127,7 +5370,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status if (sofia_test_flag(tech_pvt, TFLAG_SENT_UPDATE)) { sofia_clear_flag_locked(tech_pvt, TFLAG_SENT_UPDATE); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) { + if ((uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(uuid))) { const char *r_sdp = NULL; switch_core_session_message_t *msg; private_object_t *other_tech_pvt = switch_core_session_get_private(other_session); @@ -5359,7 +5602,7 @@ void *SWITCH_THREAD_FUNC media_on_hold_thread_run(switch_thread_t *thread, void switch_channel_t *channel = switch_core_session_get_channel(session); private_object_t *tech_pvt = switch_core_session_get_private(session); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) { + if ((uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(uuid))) { if (switch_core_session_compare(session, other_session)) { sofia_set_flag_locked(tech_pvt, TFLAG_HOLD_LOCK); switch_ivr_media(switch_core_session_get_uuid(other_session), SMF_REBRIDGE); @@ -5480,7 +5723,6 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, switch_channel_t *channel = NULL; private_object_t *tech_pvt = NULL; const char *replaces_str = NULL; - const char *uuid; switch_core_session_t *other_session = NULL; switch_channel_t *other_channel = NULL; //private_object_t *other_tech_pvt = NULL; @@ -5672,8 +5914,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, goto done; } } - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) - && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { other_channel = switch_core_session_get_channel(other_session); if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) { switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, r_sdp); @@ -5704,9 +5945,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (r_sdp && sofia_test_flag(tech_pvt, TFLAG_3PCC_INVITE) && !sofia_test_flag(tech_pvt, TFLAG_SDP)) { sofia_set_flag(tech_pvt, TFLAG_SDP); - - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) - && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { other_channel = switch_core_session_get_channel(other_session); //other_tech_pvt = switch_core_session_get_private(other_session); @@ -5744,6 +5983,23 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, goto done; case nua_callstate_received: if (!sofia_test_flag(tech_pvt, TFLAG_SDP)) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { + private_object_t *other_tech_pvt = switch_core_session_get_private(other_session); + + if(sofia_test_flag(other_tech_pvt, TFLAG_REINVITED)) { + + /* Due to a race between simultaneous reinvites to both legs of a bridge, + an earlier call to nua_invite silently failed. + So we reject the incoming invite with a 491 and redo the failed outgoing invite. */ + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Other leg already handling a reinvite, so responding with 491\n"); + nua_respond(tech_pvt->nh, SIP_491_REQUEST_PENDING, TAG_END()); + switch_core_session_rwunlock(other_session); + sofia_glue_do_invite(session); + goto done; + } + } + if (r_sdp && !sofia_test_flag(tech_pvt, TFLAG_SDP)) { if (switch_channel_test_flag(channel, CF_PROXY_MODE)) { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOMEDIA"); @@ -5801,7 +6057,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } if ((b_private = nua_handle_magic(bnh))) { - const char *br_b = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *br_b = switch_channel_get_partner_uuid(channel); char *br_a = b_private->uuid; @@ -5889,8 +6145,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, sofia_set_flag_locked(tech_pvt, TFLAG_NOSDP_REINVITE); if ((switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) && sofia_test_pflag(profile, PFLAG_3PCC_PROXY)) { sofia_set_flag_locked(tech_pvt, TFLAG_3PCC); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) - && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { switch_core_session_message_t *msg; msg = switch_core_session_alloc(other_session, sizeof(*msg)); msg->message_id = SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT; @@ -5931,11 +6186,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (switch_stristr("m=image", r_sdp)) { is_t38 = 1; } - + if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) - && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { switch_core_session_message_t *msg; + private_object_t *other_tech_pvt; if (switch_channel_test_flag(channel, CF_PROXY_MODE) && !is_t38 && profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) { if (switch_stristr("sendonly", r_sdp) || switch_stristr("0.0.0.0", r_sdp)) { @@ -5999,6 +6254,16 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } } + other_tech_pvt = switch_core_session_get_private(other_session); + if(sofia_test_flag(other_tech_pvt, TFLAG_REINVITED)) { + /* The other leg won the reinvite race */ + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Other leg already handling reinvite, so responding with 491\n"); + nua_respond(tech_pvt->nh, SIP_491_REQUEST_PENDING, TAG_END()); + switch_core_session_rwunlock(other_session); + goto done; + } + sofia_set_flag(tech_pvt, TFLAG_REINVITED); + msg = switch_core_session_alloc(other_session, sizeof(*msg)); msg->message_id = SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT; msg->from = __FILE__; @@ -6144,8 +6409,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } } - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) - && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { other_channel = switch_core_session_get_channel(other_session); if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) { switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, r_sdp); @@ -6161,31 +6425,30 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, switch_core_session_rwunlock(other_session); } } else { - uint8_t match = 0; - int is_ok = 1; + uint8_t match = 0; + int is_ok = 1; + if (tech_pvt->num_codecs) { + match = sofia_glue_negotiate_sdp(session, r_sdp); + } - if (tech_pvt->num_codecs) { - match = sofia_glue_negotiate_sdp(session, r_sdp); - } - - if (match) { - sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE); - if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "RTP Error!\n"); - switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RTP ERROR"); + if (match) { + sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE); + if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "RTP Error!\n"); + switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RTP ERROR"); + is_ok = 0; + } + sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE); + } else { + switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); is_ok = 0; } - sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE); - } else { - switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); - is_ok = 0; - } - if (!is_ok) { - nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END()); - switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); - } + if (!is_ok) { + nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END()); + switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); + } } goto done; } @@ -6214,8 +6477,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, switch_channel_mark_answered(channel); if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) - && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { //other_channel = switch_core_session_get_channel(other_session); //switch_channel_answer(other_channel); switch_core_session_queue_indication(other_session, SWITCH_MESSAGE_INDICATE_ANSWER); @@ -6241,8 +6503,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } } - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) - && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { other_channel = switch_core_session_get_channel(other_session); if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) { switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, r_sdp); @@ -6536,6 +6797,9 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS_MSG(de->data->e_msg), SIPTAG_EXPIRES_STR("60"), TAG_END()); + + switch_channel_set_variable(tech_pvt->channel, SOFIA_REPLACES_HEADER, NULL); + if (sip->sip_referred_by) { full_ref_by = sip_header_as_string(home, (void *) sip->sip_referred_by); } @@ -6598,8 +6862,8 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t b_tech_pvt = (private_object_t *) switch_core_session_get_private(b_session); channel_b = switch_core_session_get_channel(b_session); - br_a = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE); - br_b = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE); + br_a = switch_channel_get_partner_uuid(channel_a); + br_b = switch_channel_get_partner_uuid(channel_b); if (!switch_ivr_uuid_exists(br_a)) { br_a = NULL; @@ -6848,7 +7112,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t } nua_handle_unref(bnh); } else { /* the other channel is on a different box, we have to go find them */ - if (exten && (br_a = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE))) { + if (exten && (br_a = switch_channel_get_partner_uuid(channel_a))) { switch_core_session_t *a_session; switch_channel_t *channel = switch_core_session_get_channel(session); @@ -6969,37 +7233,54 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t if (exten) { switch_channel_t *channel = switch_core_session_get_channel(session); const char *br; + switch_core_session_t *b_session; - if ((br = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { - switch_core_session_t *b_session; + if ((br = switch_channel_get_partner_uuid(channel)) && (b_session = switch_core_session_locate(br))) { - if ((b_session = switch_core_session_locate(br))) { - switch_channel_t *b_channel = switch_core_session_get_channel(b_session); - switch_channel_set_variable(channel, "transfer_fallback_extension", from->a_user); - if (!zstr(full_ref_by)) { - switch_channel_set_variable(b_channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by); - } - if (!zstr(full_ref_to)) { - switch_channel_set_variable(b_channel, SOFIA_REFER_TO_VARIABLE, full_ref_to); - } + const char *var; + switch_channel_t *b_channel = switch_core_session_get_channel(b_session); - if (switch_true(switch_channel_get_variable(channel, "recording_follow_transfer"))) { - switch_core_media_bug_transfer_recordings(session, b_session); - } + switch_channel_set_variable(channel, "transfer_fallback_extension", from->a_user); + if (!zstr(full_ref_by)) { + switch_channel_set_variable(b_channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by); + } - switch_ivr_session_transfer(b_session, exten, NULL, NULL); - switch_core_session_rwunlock(b_session); + if (!zstr(full_ref_to)) { + switch_channel_set_variable(b_channel, SOFIA_REFER_TO_VARIABLE, full_ref_to); + } + + if (switch_true(switch_channel_get_variable(channel, "recording_follow_transfer"))) { + switch_core_media_bug_transfer_recordings(session, b_session); } switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "BLIND_TRANSFER"); - nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); + + if (((var = switch_channel_get_variable(channel, "confirm_blind_transfer")) && switch_true(var)) || + sofia_test_pflag(profile, PFLAG_CONFIRM_BLIND_TRANSFER)) { + switch_channel_set_state_flag(b_channel, CF_CONFIRM_BLIND_TRANSFER); + switch_channel_set_variable(channel, "sip_blind_transfer_event", etmp); + switch_channel_set_variable(b_channel, "blind_transfer_uuid", switch_core_session_get_uuid(session)); + switch_channel_set_variable(channel, "blind_transfer_uuid", switch_core_session_get_uuid(b_session)); + + switch_channel_set_variable(channel, "park_timeout", "600:blind_transfer"); + switch_channel_set_state(channel, CS_PARK); + } else { + nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), + NUTAG_SUBSTATE(nua_substate_terminated), + SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), + SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); + } + + switch_ivr_session_transfer(b_session, exten, NULL, NULL); + switch_core_session_rwunlock(b_session); } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot Blind Transfer 1 Legged calls\n"); switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER_ERROR"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); + NUTAG_SUBSTATE(nua_substate_terminated), + SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), + SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); } } @@ -7276,7 +7557,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t const char *uuid; switch_core_session_t *session_b; - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (session_b = switch_core_session_locate(uuid))) { + if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) { while (switch_channel_has_dtmf(channel)) { switch_dtmf_t idtmf = { 0, 0 }; if (switch_channel_dequeue_dtmf(channel, &idtmf) == SWITCH_STATUS_SUCCESS) { @@ -7460,7 +7741,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ nua_respond(nh, 400, "Missing Contact Header", TAG_END()); goto fail; } - + sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &network_port); if (sofia_test_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION)) { @@ -7784,9 +8065,17 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ if ((passerted = sip_p_asserted_identity(sip))) { if (passerted->paid_url && passerted->paid_url->url_user) { char *full_paid_header = sip_header_as_string(nh->nh_home, (void *) passerted); + //char *full_paid_header = (char *)(passerted->paid_common->h_data); from_user = passerted->paid_url->url_user; if (!zstr(full_paid_header)) { - switch_channel_set_variable(channel, "sip_P-Asserted-Identity", from_user); + if (profile->paid_type == PAID_DEFAULT || profile->paid_type == PAID_USER) { + switch_channel_set_variable(channel, "sip_P-Asserted-Identity", from_user); + } else if (profile->paid_type == PAID_USER_DOMAIN) { + switch_channel_set_variable(channel, "sip_P-Asserted-Identity", + switch_core_session_sprintf(session, "%s@%s", passerted->paid_url->url_user, passerted->paid_url->url_host)); + } else if (profile->paid_type == PAID_VERBATIM) { + switch_channel_set_variable(channel, "sip_P-Asserted-Identity", full_paid_header); + } } } if (!zstr(passerted->paid_display)) { @@ -7994,6 +8283,10 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ switch_channel_set_flag(channel, CF_PROXY_MEDIA); } + if (sofia_test_flag(tech_pvt, TFLAG_ZRTP_PASSTHRU)) { + switch_channel_set_flag(channel, CF_ZRTP_PASSTHRU_REQ); + } + if (!tech_pvt->call_id && sip->sip_call_id && sip->sip_call_id->i_id) { tech_pvt->call_id = switch_core_session_strdup(session, sip->sip_call_id->i_id); switch_channel_set_variable(channel, "sip_call_id", tech_pvt->call_id); @@ -8258,11 +8551,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ if ((b_session = switch_core_session_locate(b_private->uuid))) { switch_channel_t *b_channel = switch_core_session_get_channel(b_session); - const char *uuid; - int one_leg = 1; - private_object_t *b_tech_pvt = NULL; - const char *app = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_VARIABLE); - const char *data = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE); + const char *bridge_uuid; switch_caller_profile_t *orig_cp; const char *sent_name, *sent_number; orig_cp = switch_channel_get_caller_profile(b_channel); @@ -8282,80 +8571,63 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ tech_pvt->caller_profile->callee_id_number = switch_core_strdup(tech_pvt->caller_profile->pool, orig_cp->caller_id_number); } } - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Setting NAT mode based on %s\n", is_nat); + if (is_nat) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Setting NAT mode based on %s\n", is_nat); + } - if (app && data && !strcasecmp(app, "conference")) { - tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,conference:%s+flags{dist-dtmf}", data); - tech_pvt->caller_profile->dialplan = "inline"; - } else { - if (switch_core_session_check_interface(b_session, sofia_endpoint_interface)) { - b_tech_pvt = switch_core_session_get_private(b_session); - } + tech_pvt->caller_profile->dialplan = "inline"; - if ((uuid = switch_channel_get_variable(b_channel, SWITCH_SIGNAL_BOND_VARIABLE))) { - one_leg = 0; + bridge_uuid = switch_channel_get_partner_uuid(b_channel); + + if (call_info) { + const char *olu; + switch_core_session_t *os; + switch_codec_implementation_t read_impl = { 0 }; + char *codec_str = ""; + + if (!zstr(bridge_uuid) && switch_channel_test_flag(b_channel, CF_LEG_HOLDING)) { + olu = bridge_uuid; } else { - uuid = switch_core_session_get_uuid(b_session); + olu = b_private->uuid; } + + if ((os = switch_core_session_locate(olu))) { + switch_core_session_get_real_read_impl(os, &read_impl); + switch_core_session_rwunlock(os); - if (uuid) { - switch_core_session_t *c_session = NULL; - int do_conf = 0; - const char *c_app = NULL; - const char *c_data = NULL; + codec_str = switch_core_session_sprintf(session, "set:absolute_codec_string=%s@%di,", read_impl.iananame, + read_impl.microseconds_per_packet / 1000); + } + + + + if (!zstr(bridge_uuid) && switch_channel_test_flag(b_channel, CF_LEG_HOLDING)) { + tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, + "%sanswer,intercept:%s", codec_str, bridge_uuid); + } else { + tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, + "%sanswer,sofia_sla:%s", codec_str, b_private->uuid); + } + } else { + if (!zstr(bridge_uuid)) { + switch_channel_mark_hold(b_channel, SWITCH_FALSE); + tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", bridge_uuid); + } else { + const char *b_app = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_VARIABLE); + const char *b_data = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE); - uuid = switch_core_session_strdup(b_session, uuid); - - if (call_info && (c_session = switch_core_session_locate(uuid))) { - switch_channel_t *c_channel = switch_core_session_get_channel(c_session); - private_object_t *c_tech_pvt = NULL; - - c_app = switch_channel_get_variable(c_channel, SWITCH_CURRENT_APPLICATION_VARIABLE); - c_data = switch_channel_get_variable(c_channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE); - - if (switch_core_session_check_interface(c_session, sofia_endpoint_interface)) { - c_tech_pvt = switch_core_session_get_private(c_session); - } + if (b_data && b_app) { + tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s:%s", b_app, b_data); + } else if (b_app) { + tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s", b_app); + } - if (!one_leg && - (!b_tech_pvt || !sofia_test_flag(b_tech_pvt, TFLAG_SIP_HOLD)) && - (!c_tech_pvt || !sofia_test_flag(c_tech_pvt, TFLAG_SIP_HOLD))) { - char *ext = switch_core_session_sprintf(session, "answer,conference:%s@sla+flags{mintwo|dist-dtmf}", uuid); - - switch_channel_set_flag(c_channel, CF_REDIRECT); - switch_ivr_session_transfer(b_session, ext, "inline", NULL); - switch_ivr_session_transfer(c_session, ext, "inline", NULL); - switch_channel_clear_flag(c_channel, CF_REDIRECT); - do_conf = 1; - } - switch_core_session_rwunlock(c_session); - } - - if (do_conf) { - tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, - "answer,conference:%s@sla+flags{mintwo|dist-dtmf}", uuid); - } else { - if (one_leg && c_app) { - if (c_data) { - tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, - "answer,%s:%s", c_app, c_data); - } else { - tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, - "answer,%s", c_app); - } - } else { - switch_channel_mark_hold(b_channel, SWITCH_FALSE); - tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, - "answer,intercept:%s", uuid); - } - } - - tech_pvt->caller_profile->dialplan = "inline"; + switch_channel_hangup(b_channel, SWITCH_CAUSE_ATTENDED_TRANSFER); } } + switch_core_session_rwunlock(b_session); } } diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index de42845ba4..2cb2fdd551 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -24,7 +24,7 @@ * Contributor(s): * * Anthony Minessale II - * Ken Rice, Asteria Solutions Group, Inc + * Ken Rice * Paul D. Tinsley * Bret McDanel * Eliot Gable @@ -184,7 +184,6 @@ static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen, int rate; int already_did[128] = { 0 }; int ptime = 0, noptime = 0; - const char *zrtp; switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "m=audio %d RTP/%sAVP", port, secure ? "S" : ""); @@ -344,8 +343,11 @@ static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen, switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=ptime:%d\n", cur_ptime); } - if ((zrtp = switch_channel_get_variable(tech_pvt->channel, "sdp_zrtp_hash_string"))) { - switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=zrtp-hash:%s\n", zrtp); + if (tech_pvt->local_sdp_audio_zrtp_hash) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Adding audio a=zrtp-hash:%s\n", + tech_pvt->local_sdp_audio_zrtp_hash); + switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=zrtp-hash:%s\n", + tech_pvt->local_sdp_audio_zrtp_hash); } if (sr) { @@ -391,7 +393,6 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch switch_event_t *map = NULL, *ptmap = NULL; const char *b_sdp = NULL; int verbose_sdp = 0; - const char *zrtp; sofia_glue_check_dtmf_type(tech_pvt); @@ -545,8 +546,12 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=ptime:%d\n", ptime); } - if ((zrtp = switch_channel_get_variable(tech_pvt->channel, "sdp_zrtp_hash_string"))) { - switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=zrtp-hash:%s\n", zrtp); + + if (tech_pvt->local_sdp_audio_zrtp_hash) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Adding audio a=zrtp-hash:%s\n", + tech_pvt->local_sdp_audio_zrtp_hash); + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=zrtp-hash:%s\n", + tech_pvt->local_sdp_audio_zrtp_hash); } if (sr) { @@ -683,7 +688,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch pass_fmtp = NULL; - if (switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE)) { + if (switch_channel_get_partner_uuid(tech_pvt->channel)) { if ((of = switch_channel_get_variable_partner(tech_pvt->channel, "sip_video_fmtp"))) { pass_fmtp = of; } @@ -747,6 +752,13 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch } } + + if (tech_pvt->local_sdp_video_zrtp_hash) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Adding video a=zrtp-hash:%s\n", + tech_pvt->local_sdp_video_zrtp_hash); + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=zrtp-hash:%s\n", + tech_pvt->local_sdp_video_zrtp_hash); + } } } @@ -1614,7 +1626,6 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt) char vport_buf[25] = ""; char *new_sdp; int bad = 0; - int skip_video = 0, skip_audio = 0, skip_image = 0; if (zstr(tech_pvt->local_sdp_str)) { return; @@ -1649,14 +1660,6 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt) qe = q + len - 1; - if (switch_stristr("m=video 0", p)) { - skip_video = 1; - } else if (switch_stristr("m=audio 0", p)) { - skip_audio = 1; - } else if (switch_stristr("m=image 0", p)) { - skip_image = 1; - } - while (p && *p) { if (p >= pe) { bad = 1; @@ -1748,7 +1751,7 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt) } - } else if ((!skip_audio && !strncmp("m=audio ", p, 8)) || (!skip_image && !strncmp("m=image ", p, 8))) { + } else if ((!strncmp("m=audio ", p, 8) && *(p + 8) != '0') || (!strncmp("m=image ", p, 8) && *(p + 8) != '0')) { strncpy(q, p, 8); p += 8; @@ -1784,7 +1787,7 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt) has_audio++; - } else if (!skip_video && !strncmp("m=video ", p, 8)) { + } else if (!strncmp("m=video ", p, 8) && *(p + 8) != '0') { if (!has_video) { sofia_glue_tech_choose_video_port(tech_pvt, 1); tech_pvt->video_rm_encoding = "PROXY-VID"; @@ -2066,6 +2069,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) char *mp = NULL, *mp_type = NULL; char *record_route = NULL; const char *recover_via = NULL; + int require_timer = 1; + if (sofia_test_flag(tech_pvt, TFLAG_RECOVERING)) { const char *recover_contact = switch_channel_get_variable(tech_pvt->channel, "sip_recover_contact"); @@ -2082,7 +2087,9 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) } - rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER); + if ((rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER))) { + switch_channel_set_variable(channel, SOFIA_REPLACES_HEADER, NULL); + } switch_assert(tech_pvt != NULL); @@ -2096,6 +2103,11 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) } + if ((val = switch_channel_get_variable_dup(channel, "sip_require_timer", SWITCH_FALSE, -1)) && switch_false(val)) { + require_timer = 0; + } + + cid_name = caller_profile->caller_id_name; cid_num = caller_profile->caller_id_number; sofia_glue_tech_prepare_codecs(tech_pvt); @@ -2355,28 +2367,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) switch_channel_set_variable(channel, "sip_to_host", sofia_glue_get_host(to_str, switch_core_session_get_pool(session))); switch_channel_set_variable(channel, "sip_from_host", sofia_glue_get_host(from_str, switch_core_session_get_pool(session))); - if (!switch_channel_get_variable(channel, "presence_id")) { - char *from = switch_core_session_strdup(session, from_str); - const char *s; - - if ((s = switch_stristr("<", from))) { - from = (char *)s + 1; - } - - if (!strncasecmp(from, "sip:", 4)) { - from += 4; - } - - if (!strncasecmp(from, "sips:", 5)) { - from += 5; - } - - if ((p = strchr(from, ':')) || (p = strchr(from, ';')) || (p = strchr(from, '>'))) { - *p++ = '\0'; - } - - switch_channel_set_variable(channel, "presence_id", from); - } if (!(tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL, NUTAG_URL(url_str), @@ -2638,6 +2628,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE)), TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL)), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), + TAG_IF(!require_timer, NUTAG_TIMER_AUTOREQUIRE(0)), TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_HOLD(holdstr)), TAG_END()); } else { nua_invite(tech_pvt->nh, @@ -2663,6 +2654,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) TAG_IF(!zstr(route), SIPTAG_ROUTE_STR(route)), TAG_IF(!zstr(invite_route_uri), NUTAG_INITIAL_ROUTE_STR(invite_route_uri)), TAG_IF(tech_pvt->profile->minimum_session_expires, NUTAG_MIN_SE(tech_pvt->profile->minimum_session_expires)), + TAG_IF(!require_timer, NUTAG_TIMER_AUTOREQUIRE(0)), TAG_IF(cseq, SIPTAG_CSEQ(cseq)), NUTAG_MEDIA_ENABLE(0), SIPTAG_CONTENT_TYPE_STR(mp_type ? mp_type : "application/sdp"), @@ -3153,6 +3145,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f uint32_t rtp_hold_timeout_sec = tech_pvt->profile->rtp_hold_timeout_sec; char *timer_name = NULL; const char *var; + uint32_t delay = tech_pvt->profile->rtp_digit_delay; switch_assert(tech_pvt != NULL); @@ -3170,10 +3163,6 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f sofia_set_flag_locked(tech_pvt, TFLAG_SECURE); } - if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_liberal_dtmf")) && switch_true(var)) { - sofia_set_flag_locked(tech_pvt, TFLAG_LIBERAL_DTMF); - } - if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE)) { status = SWITCH_STATUS_SUCCESS; goto end; @@ -3554,6 +3543,20 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f tech_pvt->cng_pt = 0; } + if (((val = switch_channel_get_variable(tech_pvt->channel, "rtp_digit_delay")))) { + int delayi = atoi(val); + if (delayi < 0) delayi = 0; + delay = (uint32_t) delayi; + } + + + if (delay) { + switch_rtp_set_interdigit_delay(tech_pvt->rtp_session, delay); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, + "%s Set rtp dtmf delay to %u\n", switch_channel_get_name(tech_pvt->channel), delay); + + } + if (tech_pvt->cng_pt && !sofia_test_pflag(tech_pvt->profile, PFLAG_SUPPRESS_CNG)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Set comfort noise payload to %u\n", tech_pvt->cng_pt); switch_rtp_set_cng_pt(tech_pvt->rtp_session, tech_pvt->cng_pt); @@ -3574,9 +3577,11 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp); - if (switch_channel_test_flag(tech_pvt->channel, CF_ZRTP_PASS)) { + if (switch_channel_test_flag(tech_pvt->channel, CF_ZRTP_PASSTHRU)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_INFO, "Activating ZRTP PROXY MODE\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Disable NOTIMER_DURING_BRIDGE\n"); sofia_clear_flag(tech_pvt, TFLAG_NOTIMER_DURING_BRIDGE); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Activating audio UDPTL mode\n"); switch_rtp_udptl_mode(tech_pvt->rtp_session); } @@ -3763,7 +3768,10 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f } } } - + if (switch_channel_test_flag(tech_pvt->channel, CF_ZRTP_PASSTHRU)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Activating video UDPTL mode\n"); + switch_rtp_udptl_mode(tech_pvt->video_rtp_session); + } } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "VIDEO RTP REPORTS ERROR: [%s]\n", switch_str_nil(err)); @@ -3848,7 +3856,93 @@ static void add_audio_codec(sdp_rtpmap_t *map, int ptime, char *buf, switch_size } +void sofia_glue_pass_zrtp_hash2(switch_core_session_t *aleg_session, switch_core_session_t *bleg_session) +{ + switch_channel_t *aleg_channel = switch_core_session_get_channel(aleg_session); + private_object_t *aleg_tech_pvt = switch_core_session_get_private(aleg_session); + switch_channel_t *bleg_channel = switch_core_session_get_channel(bleg_session); + private_object_t *bleg_tech_pvt = switch_core_session_get_private(bleg_session); + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(aleg_channel), SWITCH_LOG_DEBUG, "Deciding whether to pass zrtp-hash between a-leg and b-leg\n"); + if (!(switch_channel_test_flag(aleg_tech_pvt->channel, CF_ZRTP_PASSTHRU_REQ))) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(aleg_channel), SWITCH_LOG_DEBUG, "CF_ZRTP_PASSTHRU_REQ not set on a-leg, so not propagating zrtp-hash\n"); + return; + } + if (aleg_tech_pvt->remote_sdp_audio_zrtp_hash) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(aleg_channel), SWITCH_LOG_DEBUG, "Passing a-leg remote zrtp-hash (audio) to b-leg\n"); + bleg_tech_pvt->local_sdp_audio_zrtp_hash = switch_core_session_strdup(bleg_tech_pvt->session, aleg_tech_pvt->remote_sdp_audio_zrtp_hash); + switch_channel_set_variable(bleg_channel, "l_sdp_audio_zrtp_hash", bleg_tech_pvt->local_sdp_audio_zrtp_hash); + } + if (aleg_tech_pvt->remote_sdp_video_zrtp_hash) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(aleg_channel), SWITCH_LOG_DEBUG, "Passing a-leg remote zrtp-hash (video) to b-leg\n"); + bleg_tech_pvt->local_sdp_video_zrtp_hash = switch_core_session_strdup(bleg_tech_pvt->session, aleg_tech_pvt->remote_sdp_video_zrtp_hash); + switch_channel_set_variable(bleg_channel, "l_sdp_video_zrtp_hash", bleg_tech_pvt->local_sdp_video_zrtp_hash); + } + if (bleg_tech_pvt->remote_sdp_audio_zrtp_hash) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(aleg_channel), SWITCH_LOG_DEBUG, "Passing b-leg remote zrtp-hash (audio) to a-leg\n"); + aleg_tech_pvt->local_sdp_audio_zrtp_hash = switch_core_session_strdup(aleg_tech_pvt->session, bleg_tech_pvt->remote_sdp_audio_zrtp_hash); + switch_channel_set_variable(aleg_channel, "l_sdp_audio_zrtp_hash", aleg_tech_pvt->local_sdp_audio_zrtp_hash); + } + if (bleg_tech_pvt->remote_sdp_video_zrtp_hash) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(aleg_channel), SWITCH_LOG_DEBUG, "Passing b-leg remote zrtp-hash (video) to a-leg\n"); + aleg_tech_pvt->local_sdp_video_zrtp_hash = switch_core_session_strdup(aleg_tech_pvt->session, bleg_tech_pvt->remote_sdp_video_zrtp_hash); + switch_channel_set_variable(aleg_channel, "l_sdp_video_zrtp_hash", aleg_tech_pvt->local_sdp_video_zrtp_hash); + } +} +void sofia_glue_pass_zrtp_hash(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + private_object_t *tech_pvt = switch_core_session_get_private(session); + switch_core_session_t *other_session; + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "Deciding whether to pass zrtp-hash between legs\n"); + if (!(switch_channel_test_flag(tech_pvt->channel, CF_ZRTP_PASSTHRU_REQ))) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "CF_ZRTP_PASSTHRU_REQ not set, so not propagating zrtp-hash\n"); + return; + } else if (!(switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS)) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "No partner channel found, so not propagating zrtp-hash\n"); + return; + } else { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "Found peer channel; propagating zrtp-hash if set\n"); + sofia_glue_pass_zrtp_hash2(session, other_session); + switch_core_session_rwunlock(other_session); + } +} + +static void find_zrtp_hash(switch_core_session_t *session, sdp_session_t *sdp) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + private_object_t *tech_pvt = switch_core_session_get_private(session); + sdp_media_t *m; + sdp_attribute_t *attr; + int got_audio = 0, got_video = 0; + + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "Looking for zrtp-hash\n"); + for (m = sdp->sdp_media; m; m = m->m_next) { + if (got_audio && got_video) break; + if (m->m_port && ((m->m_type == sdp_media_audio && !got_audio) + || (m->m_type == sdp_media_video && !got_video))) { + for (attr = m->m_attributes; attr; attr = attr->a_next) { + if (zstr(attr->a_name)) continue; + if (strcasecmp(attr->a_name, "zrtp-hash") || !(attr->a_value)) continue; + if (m->m_type == sdp_media_audio) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, + "Found audio zrtp-hash; setting r_sdp_audio_zrtp_hash=%s\n", attr->a_value); + switch_channel_set_variable(channel, "r_sdp_audio_zrtp_hash", attr->a_value); + tech_pvt->remote_sdp_audio_zrtp_hash = switch_core_session_strdup(tech_pvt->session, attr->a_value); + got_audio++; + } else if (m->m_type == sdp_media_video) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, + "Found video zrtp-hash; setting r_sdp_video_zrtp_hash=%s\n", attr->a_value); + switch_channel_set_variable(channel, "r_sdp_video_zrtp_hash", attr->a_value); + tech_pvt->remote_sdp_video_zrtp_hash = switch_core_session_strdup(tech_pvt->session, attr->a_value); + got_video++; + } + switch_channel_set_flag(channel, CF_ZRTP_HASH); + break; + } + } + } +} void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const char *codec_string, sdp_session_t *sdp) { @@ -3892,13 +3986,15 @@ void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const cha if (zstr(attr->a_name)) { continue; } - if (!strcasecmp(attr->a_name, "ptime")) { dptime = atoi(attr->a_value); break; } } + find_zrtp_hash(session, sdp); + sofia_glue_pass_zrtp_hash(session); + for (m = sdp->sdp_media; m; m = m->m_next) { ptime = dptime; if (m->m_type == sdp_media_image && m->m_port) { @@ -4060,6 +4156,10 @@ int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly) { int changed = 0; + if (sofia_test_flag(tech_pvt, TFLAG_SLA_BARGE) || sofia_test_flag(tech_pvt, TFLAG_SLA_BARGING)) { + return 0; + } + if (sendonly && switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED)) { if (!sofia_test_flag(tech_pvt, TFLAG_SIP_HOLD)) { const char *stream; @@ -4091,9 +4191,9 @@ int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly) if (!strcasecmp(stream, "indicate_hold")) { switch_channel_set_flag(tech_pvt->channel, CF_SUSPEND); switch_channel_set_flag(tech_pvt->channel, CF_HOLD); - switch_ivr_hold_uuid(switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE), NULL, 0); + switch_ivr_hold_uuid(switch_channel_get_partner_uuid(tech_pvt->channel), NULL, 0); } else { - switch_ivr_broadcast(switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE), stream, + switch_ivr_broadcast(switch_channel_get_partner_uuid(tech_pvt->channel), stream, SMF_ECHO_ALEG | SMF_LOOP | SMF_PRIORITY); switch_yield(250000); } @@ -4119,7 +4219,7 @@ int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly) switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets); } - if ((uuid = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (b_session = switch_core_session_locate(uuid))) { + if ((uuid = switch_channel_get_partner_uuid(tech_pvt->channel)) && (b_session = switch_core_session_locate(uuid))) { switch_channel_t *b_channel = switch_core_session_get_channel(b_session); if (switch_channel_test_flag(tech_pvt->channel, CF_HOLD)) { @@ -4490,6 +4590,10 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s } } + if ((val = switch_channel_get_variable(tech_pvt->channel, "sip_liberal_dtmf")) && switch_true(val)) { + sofia_set_flag_locked(tech_pvt, TFLAG_LIBERAL_DTMF); + } + if ((m = sdp->sdp_media) && (m->m_mode == sdp_sendonly || m->m_mode == sdp_inactive || (m->m_connections && m->m_connections->c_address && !strcmp(m->m_connections->c_address, "0.0.0.0")))) { @@ -4569,6 +4673,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s switch_channel_set_variable(tech_pvt->channel, "t38_broken_boolean", "true"); } + find_zrtp_hash(session, sdp); + sofia_glue_pass_zrtp_hash(session); + for (m = sdp->sdp_media; m; m = m->m_next) { sdp_connection_t *connection; switch_core_session_t *other_session; @@ -4690,9 +4797,6 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s ptime = atoi(attr->a_value); } else if (!strcasecmp(attr->a_name, "maxptime") && attr->a_value) { maxptime = atoi(attr->a_value); - } else if (!strcasecmp(attr->a_name, "zrtp-hash") && attr->a_value) { - switch_channel_set_variable(tech_pvt->channel, "sdp_zrtp_hash_string", attr->a_value); - switch_channel_set_flag(tech_pvt->channel, CF_ZRTP_HASH); } else if (!got_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value)) { int crypto_tag; @@ -4875,12 +4979,12 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s map_bit_rate = switch_known_bitrate((switch_payload_t)map->rm_pt); if (!ptime && !strcasecmp(map->rm_encoding, "g723")) { - ptime = codec_ms = 30; + codec_ms = 30; } if (zstr(map->rm_fmtp)) { if (!strcasecmp(map->rm_encoding, "ilbc")) { - ptime = codec_ms = 30; + codec_ms = 30; map_bit_rate = 13330; } } else { @@ -5228,7 +5332,7 @@ void sofia_glue_pass_sdp(private_object_t *tech_pvt, char *sdp) switch_core_session_t *other_session; switch_channel_t *other_channel; - if ((val = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE)) + if ((val = switch_channel_get_partner_uuid(tech_pvt->channel)) && (other_session = switch_core_session_locate(val))) { other_channel = switch_core_session_get_channel(other_session); switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, sdp); @@ -5802,7 +5906,7 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName } - if (switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) { + if (switch_channel_get_partner_uuid(channel)) { sofia_set_flag(tech_pvt, TFLAG_RECOVERING_BRIDGE); } else { switch_xml_t callflow, param, x_extension; @@ -5849,6 +5953,7 @@ int sofia_glue_recover(switch_bool_t flush) for (m = matches->head; m; m = m->next) { if ((profile = sofia_glue_find_profile(m->val))) { r += sofia_glue_profile_recover(profile, flush); + sofia_glue_release_profile(profile); } } switch_console_free_matches(&matches); @@ -5959,7 +6064,7 @@ void sofia_glue_tech_track(sofia_profile_t *profile, switch_core_session_t *sess } if (switch_ivr_generate_xml_cdr(session, &cdr) == SWITCH_STATUS_SUCCESS) { - xml_cdr_text = switch_xml_toxml(cdr, SWITCH_FALSE); + xml_cdr_text = switch_xml_toxml_nolock(cdr, SWITCH_FALSE); switch_xml_free(cdr); } @@ -6634,7 +6739,7 @@ void sofia_glue_free_destination(sofia_destination_t *dst) } switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *user, const char *host, const char *event, const char *contenttype, - const char *body, const char *o_contact, const char *network_ip) + const char *body, const char *o_contact, const char *network_ip, const char *call_id) { char *id = NULL; nua_handle_t *nh; @@ -6697,6 +6802,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use TAG_IF(user_via, SIPTAG_VIA_STR(user_via)), SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), TAG_IF(event, SIPTAG_EVENT_STR(event)), + TAG_IF(call_id, SIPTAG_CALL_ID_STR(call_id)), TAG_IF(contenttype, SIPTAG_CONTENT_TYPE_STR(contenttype)), TAG_IF(body, SIPTAG_PAYLOAD_STR(body)), TAG_END()); switch_safe_free(contact); @@ -6722,7 +6828,7 @@ void sofia_glue_tech_simplify(private_object_t *tech_pvt) - if ((uuid = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE)) + if ((uuid = switch_channel_get_partner_uuid(tech_pvt->channel)) && (other_session = switch_core_session_locate(uuid))) { other_channel = switch_core_session_get_channel(other_session); @@ -7030,14 +7136,17 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua if (contact->m_url->url_params) { - contact_str = switch_mprintf("%s %s", + contact_str = switch_mprintf("%s %s", display, contact->m_url->url_user, + contact->m_url->url_user ? "@" : "", ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, contact->m_url->url_params, np->is_nat ? ";fs_nat=yes" : ""); } else { - contact_str = switch_mprintf("%s %s", + contact_str = switch_mprintf("%s %s", display, - contact->m_url->url_user, ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : ""); + contact->m_url->url_user, + contact->m_url->url_user ? "@" : "", + ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : ""); } } diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index e64f430af7..23ae017531 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -24,7 +24,7 @@ * Contributor(s): * * Anthony Minessale II - * Ken Rice, Asteria Solutions Group, Inc + * Ken Rice * Paul D. Tinsley * Bret McDanel * @@ -90,6 +90,9 @@ struct presence_helper { switch_event_t *event; switch_stream_handle_t stream; char last_uuid[512]; + int hup; + int calls_up; + }; switch_status_t sofia_presence_chat_send(switch_event_t *message_event) @@ -555,11 +558,11 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) } if (for_everyone) { - sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' " + sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q',call_id " "from sip_registrations where hostname='%q' and profile_name='%q' and mwi_user='%q' and mwi_host='%q'", stream.data, mod_sofia_globals.hostname, profile->name, user, host); } else if (call_id) { - sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' " + sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q',call_id " "from sip_registrations where hostname='%q' and profile_name='%q' and call_id='%q'", stream.data, mod_sofia_globals.hostname, profile->name, call_id); } @@ -1112,6 +1115,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) "sip_user='%q' and sip_host='%q'", rpid, status, mod_sofia_globals.hostname, profile->name, euser, host); sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + proto = SOFIA_CHAT_PROTO; } if (zstr(uuid)) { @@ -1167,6 +1171,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) } } #endif + if (zstr(call_id) && (dh.hits && presence_source && (!strcasecmp(presence_source, "register") || switch_stristr("register", status)))) { goto done; @@ -1250,87 +1255,90 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) switch_str_nil(status), switch_str_nil(rpid), host, dh.status,dh.rpid,dh.presence_id, mod_sofia_globals.hostname, profile->name, call_id); - } + } - - helper.profile = profile; - helper.event = event; - SWITCH_STANDARD_STREAM(helper.stream); - switch_assert(helper.stream.data); + helper.hup = hup; + helper.calls_up = dh.hits; + helper.profile = profile; + helper.event = event; + SWITCH_STANDARD_STREAM(helper.stream); + switch_assert(helper.stream.data); - if (mod_sofia_globals.debug_presence > 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s START_PRESENCE_SQL (%s)\n", - event->event_id == SWITCH_EVENT_PRESENCE_IN ? "IN" : "OUT", profile->name); - } - - if (mod_sofia_globals.debug_presence) { - char *buf; - switch_event_serialize(event, &buf, SWITCH_FALSE); - switch_assert(buf); - if (mod_sofia_globals.debug_presence > 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DUMP PRESENCE SQL:\n%s\nEVENT DUMP:\n%s\n", sql, buf); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "EVENT DUMP:\n%s\n", buf); + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s START_PRESENCE_SQL (%s)\n", + event->event_id == SWITCH_EVENT_PRESENCE_IN ? "IN" : "OUT", profile->name); } - free(buf); - } - sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_sub_callback, &helper); - switch_safe_free(sql); - - if (mod_sofia_globals.debug_presence > 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s END_PRESENCE_SQL (%s)\n", - event->event_id == SWITCH_EVENT_PRESENCE_IN ? "IN" : "OUT", profile->name); - } - - - if (hup) { - /* so many phones get confused when whe hangup we have to reprobe to get them all to reset to absolute states so the lights stay correct */ - switch_event_t *s_event; - - if (switch_event_create(&s_event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); - switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "login", profile->name); - switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from", "%s@%s", euser, host); - switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "to", "%s@%s", euser, host); - switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "event_type", "presence"); - switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); - switch_event_fire(&s_event); + if (mod_sofia_globals.debug_presence) { + char *buf; + switch_event_serialize(event, &buf, SWITCH_FALSE); + switch_assert(buf); + if (mod_sofia_globals.debug_presence > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DUMP PRESENCE SQL:\n%s\nEVENT DUMP:\n%s\n", sql, buf); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "EVENT DUMP:\n%s\n", buf); + } + free(buf); } - } + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_sub_callback, &helper); + switch_safe_free(sql); - if (!zstr((char *) helper.stream.data)) { - char *this_sql = (char *) helper.stream.data; - char *next = NULL; - char *last = NULL; + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s END_PRESENCE_SQL (%s)\n", + event->event_id == SWITCH_EVENT_PRESENCE_IN ? "IN" : "OUT", profile->name); + } + + + if (hup && dh.hits < 1) { + /* so many phones get confused when whe hangup we have to reprobe to get them all to reset to absolute states so the lights stay correct */ + switch_event_t *s_event; + + if (switch_event_create(&s_event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "login", profile->name); + switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from", "%s@%s", euser, host); + switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "to", "%s@%s", euser, host); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_fire(&s_event); + } + } + + + if (!zstr((char *) helper.stream.data)) { + char *this_sql = (char *) helper.stream.data; + char *next = NULL; + char *last = NULL; - do { - if ((next = strchr(this_sql, ';'))) { - *next++ = '\0'; - while (*next == '\n' || *next == ' ' || *next == '\r') { + do { + if ((next = strchr(this_sql, ';'))) { *next++ = '\0'; + while (*next == '\n' || *next == ' ' || *next == '\r') { + *next++ = '\0'; + } } - } - if (!zstr(this_sql) && (!last || strcmp(last, this_sql))) { - sofia_glue_execute_sql(profile, &this_sql, SWITCH_FALSE); - last = this_sql; - } - this_sql = next; - } while (this_sql); - } - switch_safe_free(helper.stream.data); - helper.stream.data = NULL; + if (!zstr(this_sql) && (!last || strcmp(last, this_sql))) { + sofia_glue_execute_sql(profile, &this_sql, SWITCH_FALSE); + last = this_sql; + } + this_sql = next; + } while (this_sql); + } + switch_safe_free(helper.stream.data); + helper.stream.data = NULL; - sofia_glue_release_profile(profile); + sofia_glue_release_profile(profile); + } } + switch_console_free_matches(&matches); } - switch_console_free_matches(&matches); -} -done: -switch_safe_free(sql); -switch_safe_free(user); + done: + + switch_safe_free(sql); + switch_safe_free(user); } static int EVENT_THREAD_RUNNING = 0; @@ -1755,6 +1763,20 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * remote_user = to_user; remote_host = local_host; } + else if (proto && !strcasecmp(proto, "pickup")) { + local_user = to_user; + local_user_param = switch_mprintf(";proto=%s", proto); + event_status = "hold"; + if (skip_proto) { + buf_to_free = switch_mprintf("sip:%s", to_user); + } else { + buf_to_free = switch_mprintf("sip:pickup+%s", to_user); + } + remote_uri = buf_to_free; + strcpy(remote_display_buf, "pickup"); + remote_user = to_user; + remote_host = local_host; + } else if (proto && !strcasecmp(proto, "conf")) { local_user = to_user; local_user_param = switch_mprintf(";proto=%s", proto); @@ -2414,6 +2436,10 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * is_dialog = !strcmp(event, "dialog"); + if (helper->hup && helper->calls_up > 0 && (!is_dialog || !user_agent || !switch_stristr("polycom", user_agent) || !switch_stristr("snom", user_agent))) { + goto end; + } + if (helper->event) { switch_stream_handle_t stream = { 0 }; const char *direction = switch_str_nil(switch_event_get_header(helper->event, "presence-call-direction")); @@ -2433,6 +2459,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * int force_status = 0; const char *call_state = switch_event_get_header(helper->event, "channel-state"); char *call_info_state = switch_event_get_header(helper->event, "presence-call-info-state"); + int term = 0; if (user_agent && switch_stristr("snom", user_agent) && uuid) { default_dialog = "full" ; @@ -2440,18 +2467,21 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * if (call_state && !strcasecmp(call_state, "cs_hangup")) { astate = "hangup"; - } + holding = 0; + term = 1; + } else { - if (event_status && !strncasecmp(event_status, "hold", 4)) { - holding = 1; - } + if (event_status && !strncasecmp(event_status, "hold", 4)) { + holding = 1; + } - if (force_event_status && !event_status) { - event_status = force_event_status; - } + if (force_event_status && !event_status) { + event_status = force_event_status; + } - if (event_status && !strncasecmp(event_status, "hold", 4)) { - holding = 1; + if (event_status && !strncasecmp(event_status, "hold", 4)) { + holding = 1; + } } if (!strcasecmp(direction, "inbound")) { @@ -2545,7 +2575,13 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * } if (holding) { - astate = "early"; + if (profile->pres_held_type == PRES_HELD_CONFIRMED) { + astate = "confirmed"; + } else if (profile->pres_held_type == PRES_HELD_TERMINATED) { + astate = "terminated"; + } else { + astate = "early"; + } } @@ -2614,6 +2650,18 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * stream.write_function(&stream, "\n", uuid); } stream.write_function(&stream, "\n"); + } else if (!strcasecmp(proto, "pickup")) { + stream.write_function(&stream, "\nsip:%s@%s;proto=pickup\n", + !zstr(clean_to_user) ? clean_to_user : "unknown", host); + stream.write_function(&stream, "\n", !zstr(clean_to_user) ? clean_to_user : "unknown", host); + stream.write_function(&stream, "\n\n\n"); + stream.write_function(&stream, "\nsip:%s\n", uuid); + if (skip_proto) { + stream.write_function(&stream, "\n", uuid); + } else { + stream.write_function(&stream, "\n", uuid); + } + stream.write_function(&stream, "\n"); } else if (!strcasecmp(proto, "conf")) { stream.write_function(&stream, "\nsip:%s@%s;proto=conference\n", !zstr(clean_to_user) ? clean_to_user : "unknown", host); @@ -2647,7 +2695,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * if (!zstr(astate) && !zstr(uuid) && helper && helper->stream.data && strcmp(helper->last_uuid, uuid) && strcasecmp(astate, "terminated") && strchr(uuid, '-')) { helper->stream.write_function(&helper->stream, "update sip_dialogs set state='%s' where hostname='%q' and profile_name='%q' and uuid='%s';", - mod_sofia_globals.hostname, profile->name, astate, uuid); + astate, mod_sofia_globals.hostname, profile->name, uuid); switch_copy_string(helper->last_uuid, uuid, sizeof(helper->last_uuid)); } @@ -2660,8 +2708,6 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * open = "open"; if (switch_false(resub)) { - int term; - const char *direction = switch_event_get_header(helper->event, "Caller-Direction"); const char *op, *what = "Ring"; @@ -2703,9 +2749,9 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * rpid = "on-the-phone"; force_status = 1; } else if (!strcmp(astate, "terminated") || !strcmp(astate, "hangup")) { - rpid = "online"; - dialog_rpid = ""; - force_event_status = "Available"; + //rpid = "online"; + //dialog_rpid = ""; + //force_event_status = "Available"; term = 1; } @@ -2778,8 +2824,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * if (!zstr(uuid) && strchr(uuid, '-') && !zstr(status_line) && !zstr(rpid) && (zstr(register_source) || strcasecmp(register_source, "register"))) { char *sql = switch_mprintf("update sip_dialogs set rpid='%q',status='%q' where hostname='%q' and profile_name='%q' and uuid='%q'", - mod_sofia_globals.hostname, profile->name, - rpid, status_line, uuid); + rpid, status_line, + mod_sofia_globals.hostname, profile->name, uuid); sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); } } @@ -2868,6 +2914,7 @@ static int sofia_presence_mwi_callback2(void *pArg, int argc, char **argv, char const char *body = argv[5]; const char *o_contact = argv[2]; const char *network_ip = argv[4]; + const char *call_id = argv[6]; char *profile_name = argv[3]; struct mwi_helper *h = (struct mwi_helper *) pArg; @@ -2879,7 +2926,11 @@ static int sofia_presence_mwi_callback2(void *pArg, int argc, char **argv, char } } - sofia_glue_send_notify(profile, user, host, event, contenttype, body, o_contact, network_ip); + if (!sofia_test_pflag(profile, PFLAG_MWI_USE_REG_CALLID)) { + call_id = NULL; + } + + sofia_glue_send_notify(profile, user, host, event, contenttype, body, o_contact, network_ip, call_id); if (ext_profile) { sofia_glue_release_profile(ext_profile); @@ -3379,9 +3430,8 @@ void sofia_presence_handle_sip_i_subscribe(int status, "sub del sql: %s\n", sql); } - switch_mutex_lock(profile->ireg_mutex); switch_assert(sql != NULL); - sofia_glue_actually_execute_sql(profile, sql, NULL); + sofia_glue_actually_execute_sql(profile, sql, profile->ireg_mutex); switch_safe_free(sql); sstr = switch_mprintf("terminated;reason=noresource"); @@ -3420,7 +3470,6 @@ void sofia_presence_handle_sip_i_subscribe(int status, sstr = switch_mprintf("active;expires=%ld", exp_delta); } - switch_mutex_unlock(profile->ireg_mutex); } if (status < 200) { @@ -3588,8 +3637,8 @@ void sofia_presence_handle_sip_i_subscribe(int status, " from sip_subscriptions where hostname='%q' and profile_name='%q' and " "event='message-summary' and sip_user='%q' " "and (sip_host='%q' or presence_hosts like '%%%q%%')", - mod_sofia_globals.hostname, profile->name, - to_host, to_user, to_host, to_host))) { + to_host, mod_sofia_globals.hostname, profile->name, + to_user, to_host, to_host))) { sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_sub_reg_callback, profile); switch_safe_free(sql); @@ -3880,16 +3929,24 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n open_closed = basic->txt; } - if ((person = switch_xml_child(xml, "dm:person")) && (note = switch_xml_child(person, "dm:note"))) { - note_txt = note->txt; + if ((person = switch_xml_child(xml, "dm:person"))) { + if ((note = switch_xml_child(person, "dm:note"))) { + note_txt = note->txt; + } else if ((note = switch_xml_child(person, "rpid:note"))) { + note_txt = note->txt; + } + if ((act = switch_xml_child(person, "rpid:activities")) && act->child && act->child->name) { + if ((rpid = strchr(act->child->name, ':'))) { + rpid++; + } else { + rpid = act->child->name; + } + } + if (zstr(note_txt)) note_txt = rpid; } - if (person && (act = switch_xml_child(person, "rpid:activities")) && act->child && act->child->name) { - if ((rpid = strchr(act->child->name, ':'))) { - rpid++; - } else { - rpid = act->child->name; - } + if (!strcasecmp(open_closed, "closed")) { + rpid = note_txt = "Unregistered"; } if (sofia_test_pflag(profile, PFLAG_MULTIREG) && !open) { @@ -3901,7 +3958,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n event_type = sip_header_as_string(nh->nh_home, (void *) sip->sip_event); - if (count < 2) { + if (count != 1) { if ((sql = switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' " " and profile_name='%q' and hostname='%q'", from_user, from_host, profile->name, mod_sofia_globals.hostname))) { @@ -3928,7 +3985,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n switch_str_nil(payload->pl_data), mod_sofia_globals.hostname, profile->name, - from_user, from_host, event_type); + from_user, from_host, event_type, contact_str); sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_send_sql, &cb); switch_safe_free(sql); diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 7b85161da3..7ec9f1f93a 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -127,22 +127,20 @@ static void sofia_reg_kill_sub(sofia_gateway_t *gateway_ptr) static void sofia_reg_kill_reg(sofia_gateway_t *gateway_ptr) { - if (gateway_ptr->nh) { - nua_handle_bind(gateway_ptr->nh, NULL); - } - - if (gateway_ptr->state != REG_STATE_REGED && gateway_ptr->state != REG_STATE_UNREGISTER) { - if (gateway_ptr->nh) { - nua_handle_destroy(gateway_ptr->nh); - gateway_ptr->nh = NULL; - } + if (!gateway_ptr->nh) { return; } - if (gateway_ptr->nh) { + if (gateway_ptr->state == REG_STATE_REGED || gateway_ptr->state == REG_STATE_UNREGISTER) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "UN-Registering %s\n", gateway_ptr->name); nua_unregister(gateway_ptr->nh, NUTAG_URL(gateway_ptr->register_url), NUTAG_REGISTRAR(gateway_ptr->register_proxy), TAG_END()); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Destroying registration handle for %s\n", gateway_ptr->name); } + + nua_handle_bind(gateway_ptr->nh, NULL); + nua_handle_destroy(gateway_ptr->nh); + gateway_ptr->nh = NULL; } void sofia_reg_fire_custom_gateway_state_event(sofia_gateway_t *gateway, int status, const char *phrase) @@ -430,6 +428,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) gateway_ptr->status = SOFIA_GATEWAY_DOWN; nua_unregister(gateway_ptr->nh, NUTAG_URL(gateway_ptr->register_url), + TAG_IF(gateway_ptr->register_sticky_proxy, NUTAG_PROXY(gateway_ptr->register_sticky_proxy)), TAG_IF(user_via, SIPTAG_VIA_STR(user_via)), SIPTAG_FROM_STR(gateway_ptr->register_from), SIPTAG_TO_STR(gateway_ptr->distinct_to ? gateway_ptr->register_to : gateway_ptr->register_from), @@ -588,7 +587,7 @@ void sofia_reg_send_reboot(sofia_profile_t *profile, const char *user, const cha event = "reboot"; } - sofia_glue_send_notify(profile, user, host, event, contenttype, body, contact, network_ip); + sofia_glue_send_notify(profile, user, host, event, contenttype, body, contact, network_ip, NULL); } int sofia_sla_dialog_del_callback(void *pArg, int argc, char **argv, char **columnNames) @@ -994,6 +993,30 @@ uint32_t sofia_reg_reg_count(sofia_profile_t *profile, const char *user, const c return atoi(buf); } +static int debounce_check(sofia_profile_t *profile, const char *user, const char *host) +{ + char key[512] = ""; + int r = 0; + time_t *last, now = switch_epoch_time_now(NULL); + + snprintf(key, sizeof(key), "%s%s", user, host); + + if ((last = switch_core_hash_find(profile->mwi_debounce_hash, key))) { + if (now - *last > 30) { + *last = now; + r = 1; + } + } else { + last = switch_core_alloc(profile->pool, sizeof(*last)); + *last = now; + switch_core_hash_insert(profile->mwi_debounce_hash, key, last); + r = 1; + } + + return r; +} + + uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sip_t const *sip, sofia_dispatch_event_t *de, sofia_regtype_t regtype, char *key, uint32_t keylen, switch_event_t **v_event, const char *is_nat) @@ -1005,6 +1028,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand sip_contact_t const *contact = NULL; char *sql; switch_event_t *s_event; + const char *reg_meta = NULL; const char *to_user = NULL; const char *to_host = NULL; char *mwi_account = NULL; @@ -1243,6 +1267,20 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "username", username); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "realm", realm); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", agent); + switch (auth_res) { + case AUTH_OK: + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "auth-result", "SUCCESS"); + break; + case AUTH_RENEWED: + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "auth-result", "RENEWED"); + break; + case AUTH_STALE: + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "auth-result", "STALE"); + break; + case AUTH_FORBIDDEN: + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "auth-result", "FORBIDDEN"); + break; + } switch_event_fire(&s_event); } @@ -1380,6 +1418,17 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand (regtype == REG_INVITE) ? "INVITE" : "REGISTER", profile->name, to_user, to_host, network_ip); } + if (forbidden && switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_REGISTER_FAILURE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile-name", profile->name); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "to-user", to_user); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "to-host", to_host); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "network-ip", network_ip); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", agent); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile-name", profile->name); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "network-port", network_port_c); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "registration-type", (regtype == REG_INVITE) ? "INVITE" : "REGISTER"); + switch_event_fire(&s_event); + } switch_goto_int(r, 1, end); } } @@ -1437,6 +1486,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand to_user = var; } + if (v_event && *v_event && (var = switch_event_get_header(*v_event, "registration_metadata"))) { + reg_meta = var; + } + if (v_event && *v_event && (mwi_account = switch_event_get_header(*v_event, "mwi-account"))) { dup_mwi_account = strdup(mwi_account); switch_assert(dup_mwi_account != NULL); @@ -1511,7 +1564,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand url = switch_mprintf("sofia/%q/sip:%q", profile->name, sofia_glue_strip_proto(contact)); switch_core_add_registration(to_user, reg_host, call_id, url, (long) switch_epoch_time_now(NULL) + (long) exptime + 60, - network_ip, network_port_c, is_tls ? "tls" : is_tcp ? "tcp" : "udp"); + network_ip, network_port_c, is_tls ? "tls" : is_tcp ? "tcp" : "udp", reg_meta); switch_safe_free(url); switch_safe_free(contact); @@ -1644,11 +1697,14 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand if (contact) { if (exptime) { + int debounce_ok = debounce_check(profile, mwi_user, mwi_host); + switch_snprintf(exp_param, sizeof(exp_param), "expires=%ld", exptime); sip_contact_add_param(nua_handle_home(nh), sip->sip_contact, exp_param); - - if (sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER) || - (reg_count == 1 && sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER))) { + + if ((sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER) || + (reg_count == 1 && sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER))) && debounce_ok) { + if (switch_event_create(&s_mwi_event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) { switch_event_add_header(s_mwi_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", mwi_user, mwi_host); switch_event_add_header_string(s_mwi_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name); @@ -1656,9 +1712,9 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand } } - if (sofia_test_pflag(profile, PFLAG_PRESENCE_ON_REGISTER) || + if ((sofia_test_pflag(profile, PFLAG_PRESENCE_ON_REGISTER) || (reg_count == 1 && sofia_test_pflag(profile, PFLAG_PRESENCE_ON_FIRST_REGISTER)) - || send_pres == 1 || (reg_count == 1 && send_pres == 2)) { + || send_pres == 1 || (reg_count == 1 && send_pres == 2)) && debounce_ok) { if (sofia_test_pflag(profile, PFLAG_PRESENCE_PROBE_ON_REGISTER)) { if (switch_event_create(&s_event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { diff --git a/src/mod/endpoints/mod_unicall/mod_unicall.c b/src/mod/endpoints/mod_unicall/mod_unicall.c index e835647385..75680bd243 100644 --- a/src/mod/endpoints/mod_unicall/mod_unicall.c +++ b/src/mod/endpoints/mod_unicall/mod_unicall.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2008, Anthony Minessale II + * Copyright (C) 2005/2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c index d3e72f5d32..1fcab9fda6 100644 --- a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c +++ b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_cdr_mongodb/Makefile b/src/mod/event_handlers/mod_cdr_mongodb/Makefile index b9e04b983d..6a412a0f66 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/Makefile +++ b/src/mod/event_handlers/mod_cdr_mongodb/Makefile @@ -2,8 +2,8 @@ include ../../../../build/modmake.rules MONGODB_DRIVER=./driver/src LOCAL_CFLAGS=-I$(MONGODB_DRIVER) -LOCAL_OBJS=$(MONGODB_DRIVER)/md5.o \ - $(MONGODB_DRIVER)/mongo.o $(MONGODB_DRIVER)/net.o \ - $(MONGODB_DRIVER)/bson.o $(MONGODB_DRIVER)/numbers.o $(MONGODB_DRIVER)/encoding.o \ +LOCAL_OBJS=$(MONGODB_DRIVER)/encoding.o $(MONGODB_DRIVER)/env_posix.o \ + $(MONGODB_DRIVER)/bson.o $(MONGODB_DRIVER)/md5.o \ + $(MONGODB_DRIVER)/mongo.o $(MONGODB_DRIVER)/numbers.o local_depend: $(LOCAL_OBJS) diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/HISTORY.md b/src/mod/event_handlers/mod_cdr_mongodb/driver/HISTORY.md index f3f0fab21d..1659192909 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/HISTORY.md +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/HISTORY.md @@ -1,5 +1,35 @@ # MongoDB C Driver History +## 0.5.2 +2012-5-4 + +* Validate collection and database names on insert. +* Validate insert limits using max BSON size. +* Support getaddrinfo and SO_RCVTIMEO and SO_SNDTIMEO on Windows. +* Store errno/WSAGetLastError() on errors. +* Various bug fixes and refactorings. +* Update error reporting docs. + +## 0.5.1 + +* Env for POSIX, WIN32, and standard C. +* Various bug fixes. + +## 0.5 +2012-3-31 + +* Separate cursor-specific errors into their own enum: mongo_cursor_error_t. +* Catch $err return on bad queries and store the result in conn->getlasterrorcode + and conn->getlasterrstr. +* On queries that return $err, set cursor->err to MONGO_CURSOR_QUERY_FAIL. +* When passing bad BSON to a cursor object, set cursor->err to MONGO_CURSOR_BSON_ERROR, + and store the specific BSON error on the conn->err field. +* Remove bson_copy_basic(). +* bson_copy() will copy finished bson objects only. +* bson_copy() returns BSON_OK on success and BSON_ERROR on failure. +* Added a Makefile for easy compile and install on Linux and OS X. +* Replica set connect fixes. + ## 0.4 THIS RELEASE INCLUDES NUMEROUS BACKWARD-BREAKING CHANGES. diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/README.md b/src/mod/event_handlers/mod_cdr_mongodb/driver/README.md index 1afe39e69c..d8c7526683 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/README.md +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/README.md @@ -12,9 +12,9 @@ Until the 1.0 release, this driver should be considered alpha. Keep in mind that # Building First check out the version you want to build. *Always build from a particular tag, since HEAD may be -a work in progress.* For example, to build version 0.4, run: +a work in progress.* For example, to build version 0.5.2, run: - git checkout v0.4 + git checkout v0.5.2 You can then build the driver with scons: diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/SConstruct b/src/mod/event_handlers/mod_cdr_mongodb/driver/SConstruct deleted file mode 100644 index d3be2d89a6..0000000000 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/SConstruct +++ /dev/null @@ -1,178 +0,0 @@ -# -*- mode: python; -*- - -VERSION = "0.4" - -# --- options ---- -AddOption('--test-server', - dest='test_server', - default='127.0.0.1', - type='string', - nargs=1, - action='store', - help='IP address of server to use for testing') - -AddOption('--seed-start-port', - dest='seed_start_port', - default=30000, - type='int', - nargs=1, - action='store', - help='IP address of server to use for testing') - -AddOption('--c99', - dest='use_c99', - default=False, - action='store_true', - help='Compile with c99 (recommended for gcc)') - -AddOption('--d', - dest='optimize', - default=True, - action='store_false', - help='disable optimizations') - -AddOption('--use-platform', - dest='compile_platform', - default='GENERIC', - type='string', - nargs=1, - action='store', - help='Compile for a specific platform to take advantage ' - ' of particular system features. For the moment, this include timeouts only.' - ' Current options include LINUX, ' - ' GENERIC, and CUSTOM. If you specific CUSTOM, you must place a' - ' system-specific implementation of net.h and net.c in src/platform/custom/') - -import os, sys - -env = Environment( ENV=os.environ ) - -# ---- Docs ---- -def build_docs(env, target, source): - buildscript_path = os.path.join(os.path.abspath("docs")) - sys.path.insert(0, buildscript_path) - import buildscripts - from buildscripts import docs - docs.main() - -env.Alias("docs", [], [build_docs]) -env.AlwaysBuild("docs") - -# ---- Platforms ---- -PLATFORM_TEST_DIR = None -if "LINUX" == GetOption('compile_platform'): - env.Append( CPPFLAGS=" -D_MONGO_USE_LINUX_SYSTEM" ) - NET_LIB = "src/platform/linux/net.c" - PLATFORM_TEST_DIR = "test/platform/linux/" - PLATFORM_TESTS = [ "timeouts" ] -elif "CUSTOM" == GetOption('compile_platform'): - env.Append( CPPFLAGS=" -D_MONGO_USE_CUSTOM_SYSTEM" ) - NET_LIB = "src/platform/custom/net.c" -else: - NET_LIB = "src/net.c" - -# ---- Libraries ---- -if os.sys.platform in ["darwin", "linux2"]: - env.Append( CPPFLAGS=" -pedantic -Wall -ggdb -DMONGO_HAVE_STDINT" ) - env.Append( CPPPATH=["/opt/local/include/"] ) - env.Append( LIBPATH=["/opt/local/lib/"] ) - - if GetOption('use_c99'): - env.Append( CFLAGS=" -std=c99 " ) - env.Append( CXXDEFINES="MONGO_HAVE_STDINT" ) - else: - env.Append( CFLAGS=" -ansi " ) - - if GetOption('optimize'): - env.Append( CPPFLAGS=" -O3 " ) - # -O3 benchmarks *significantly* faster than -O2 when disabling networking -elif 'win32' == os.sys.platform: - env.Append( LIBS='ws2_32' ) - -#we shouldn't need these options in c99 mode -if not GetOption('use_c99'): - conf = Configure(env) - - if not conf.CheckType('int64_t'): - if conf.CheckType('int64_t', '#include \n'): - conf.env.Append( CPPDEFINES="MONGO_HAVE_STDINT" ) - elif conf.CheckType('int64_t', '#include \n'): - conf.env.Append( CPPDEFINES="MONGO_HAVE_UNISTD" ) - elif conf.CheckType('__int64'): - conf.env.Append( CPPDEFINES="MONGO_USE__INT64" ) - elif conf.CheckType('long long int'): - conf.env.Append( CPPDEFINES="MONGO_USE_LONG_LONG_INT" ) - else: - print "*** what is your 64 bit int type? ****" - Exit(1) - - env = conf.Finish() - -have_libjson = False -conf = Configure(env) -if conf.CheckLib('json'): - have_libjson = True -env = conf.Finish() - -if sys.byteorder == 'big': - env.Append( CPPDEFINES="MONGO_BIG_ENDIAN" ) - -env.Append( CPPPATH=["src/"] ) - -coreFiles = ["src/md5.c" ] -mFiles = [ "src/mongo.c", NET_LIB, "src/gridfs.c"] -bFiles = [ "src/bson.c", "src/numbers.c", "src/encoding.c"] -mLibFiles = coreFiles + mFiles + bFiles -bLibFiles = coreFiles + bFiles -m = env.Library( "mongoc" , mLibFiles ) -b = env.Library( "bson" , bLibFiles ) -env.Default( env.Alias( "lib" , [ m[0] , b[0] ] ) ) - -if os.sys.platform == "linux2": - env.Append( SHLINKFLAGS="-shared -Wl,-soname,libmongoc.so." + VERSION ) - env.Append( SHLINKFLAGS = "-shared -Wl,-soname,libbson.so." + VERSION ) - -dynm = env.SharedLibrary( "mongoc" , mLibFiles ) -dynb = env.SharedLibrary( "bson" , bLibFiles ) -env.Default( env.Alias( "sharedlib" , [ dynm[0] , dynb[0] ] ) ) - - - -# ---- Benchmarking ---- -benchmarkEnv = env.Clone() -benchmarkEnv.Append( CPPDEFINES=[('TEST_SERVER', r'\"%s\"'%GetOption('test_server')), -('SEED_START_PORT', r'%d'%GetOption('seed_start_port'))] ) -benchmarkEnv.Append( LIBS=[m, b] ) -benchmarkEnv.Prepend( LIBPATH=["."] ) -benchmarkEnv.Program( "benchmark" , [ "test/benchmark.c"] ) - -# ---- Tests ---- -testEnv = benchmarkEnv.Clone() -testCoreFiles = [ ] - -def run_tests( root, tests ): - for name in tests: - filename = "%s/%s.c" % (root, name) - exe = "test_" + name - test = testEnv.Program( exe , testCoreFiles + [filename] ) - test_alias = testEnv.Alias('test', [test], test[0].abspath + ' 2> ' + os.path.devnull) - AlwaysBuild(test_alias) - -tests = Split("sizes resize endian_swap bson bson_subobject simple update errors " -"count_delete auth gridfs validate examples helpers oid functions cursors replica_set") - -# Run standard tests -run_tests("test", tests) - -# Run platform tests -if not PLATFORM_TEST_DIR is None: - run_tests( PLATFORM_TEST_DIR, PLATFORM_TESTS ) - -if have_libjson: - tests.append('json') - testEnv.Append( LIBS=["json"] ) - -# special case for cpptest -test = testEnv.Program( 'test_cpp' , testCoreFiles + ['test/cpptest.cpp'] ) -test_alias = testEnv.Alias('test', [test], test[0].abspath + ' 2> '+ os.path.devnull) -AlwaysBuild(test_alias) diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.c index 349f42284c..26d17d8696 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.c @@ -33,7 +33,11 @@ static const int zero = 0; void *( *bson_malloc_func )( size_t ) = malloc; void *( *bson_realloc_func )( void *, size_t ) = realloc; void ( *bson_free )( void * ) = free; +#ifdef R_SAFETY_NET +bson_printf_func bson_printf; +#else bson_printf_func bson_printf = printf; +#endif bson_fprintf_func bson_fprintf = fprintf; bson_sprintf_func bson_sprintf = sprintf; @@ -48,33 +52,32 @@ static int ( *oid_inc_func )( void ) = NULL; READING ------------------------------ */ -bson *bson_empty( bson *obj ) { +MONGO_EXPORT bson* bson_create() { + return (bson*)bson_malloc(sizeof(bson)); +} + +MONGO_EXPORT void bson_dispose(bson* b) { + bson_free(b); +} + +MONGO_EXPORT bson *bson_empty( bson *obj ) { static char *data = "\005\0\0\0\0"; bson_init_data( obj, data ); obj->finished = 1; obj->err = 0; + obj->errstr = NULL; obj->stackPos = 0; return obj; } -void bson_copy_basic( bson *out, const bson *in ) { - if ( !out ) return; +MONGO_EXPORT int bson_copy( bson *out, const bson *in ) { + if ( !out ) return BSON_ERROR; + if ( !in->finished ) return BSON_ERROR; bson_init_size( out, bson_size( in ) ); memcpy( out->data, in->data, bson_size( in ) ); -} + out->finished = 1; -void bson_copy( bson *out, const bson *in ) { - int i; - - if ( !out ) return; - bson_copy_basic( out, in ); - out->cur = out->data + ( in->cur - in->data ); - out->dataSize = in->dataSize; - out->finished = in->finished; - out->stackPos = in->stackPos; - out->err = in->err; - for( i=0; istackPos; i++ ) - out->stack[i] = in->stack[i]; + return BSON_OK; } int bson_init_data( bson *b, char *data ) { @@ -82,6 +85,12 @@ int bson_init_data( bson *b, char *data ) { return BSON_OK; } +int bson_init_finished_data( bson *b, char *data ) { + bson_init_data( b, data ); + b->finished = 1; + return BSON_OK; +} + static void _bson_reset( bson *b ) { b->finished = 0; b->stackPos = 0; @@ -89,7 +98,7 @@ static void _bson_reset( bson *b ) { b->errstr = NULL; } -int bson_size( const bson *b ) { +MONGO_EXPORT int bson_size( const bson *b ) { int i; if ( ! b || ! b->data ) return 0; @@ -97,7 +106,12 @@ int bson_size( const bson *b ) { return i; } -const char *bson_data( bson *b ) { +MONGO_EXPORT int bson_buffer_size( const bson *b ) { + return (b->cur - b->data + 1); +} + + +MONGO_EXPORT const char *bson_data( const bson *b ) { return (const char *)b->data; } @@ -146,14 +160,14 @@ static char hexbyte( char hex ) { } } -void bson_oid_from_string( bson_oid_t *oid, const char *str ) { +MONGO_EXPORT void bson_oid_from_string( bson_oid_t *oid, const char *str ) { int i; for ( i=0; i<12; i++ ) { oid->bytes[i] = ( hexbyte( str[2*i] ) << 4 ) | hexbyte( str[2*i + 1] ); } } -void bson_oid_to_string( const bson_oid_t *oid, char *str ) { +MONGO_EXPORT void bson_oid_to_string( const bson_oid_t *oid, char *str ) { static const char hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; int i; for ( i=0; i<12; i++ ) { @@ -163,15 +177,15 @@ void bson_oid_to_string( const bson_oid_t *oid, char *str ) { str[24] = '\0'; } -void bson_set_oid_fuzz( int ( *func )( void ) ) { +MONGO_EXPORT void bson_set_oid_fuzz( int ( *func )( void ) ) { oid_fuzz_func = func; } -void bson_set_oid_inc( int ( *func )( void ) ) { +MONGO_EXPORT void bson_set_oid_inc( int ( *func )( void ) ) { oid_inc_func = func; } -void bson_oid_gen( bson_oid_t *oid ) { +MONGO_EXPORT void bson_oid_gen( bson_oid_t *oid ) { static int incr = 0; static int fuzz = 0; int i; @@ -196,18 +210,18 @@ void bson_oid_gen( bson_oid_t *oid ) { bson_big_endian32( &oid->ints[2], &i ); } -time_t bson_oid_generated_time( bson_oid_t *oid ) { +MONGO_EXPORT time_t bson_oid_generated_time( bson_oid_t *oid ) { time_t out; bson_big_endian32( &out, &oid->ints[0] ); return out; } -void bson_print( bson *b ) { +MONGO_EXPORT void bson_print( const bson *b ) { bson_print_raw( b->data , 0 ); } -void bson_print_raw( const char *data , int depth ) { +MONGO_EXPORT void bson_print_raw( const char *data , int depth ) { bson_iterator i; const char *key; int temp; @@ -223,69 +237,69 @@ void bson_print_raw( const char *data , int depth ) { key = bson_iterator_key( &i ); for ( temp=0; temp<=depth; temp++ ) - printf( "\t" ); + bson_printf( "\t" ); bson_printf( "%s : %d \t " , key , t ); switch ( t ) { case BSON_DOUBLE: - printf( "%f" , bson_iterator_double( &i ) ); + bson_printf( "%f" , bson_iterator_double( &i ) ); break; case BSON_STRING: - printf( "%s" , bson_iterator_string( &i ) ); + bson_printf( "%s" , bson_iterator_string( &i ) ); break; case BSON_SYMBOL: - printf( "SYMBOL: %s" , bson_iterator_string( &i ) ); + bson_printf( "SYMBOL: %s" , bson_iterator_string( &i ) ); break; case BSON_OID: bson_oid_to_string( bson_iterator_oid( &i ), oidhex ); - printf( "%s" , oidhex ); + bson_printf( "%s" , oidhex ); break; case BSON_BOOL: - printf( "%s" , bson_iterator_bool( &i ) ? "true" : "false" ); + bson_printf( "%s" , bson_iterator_bool( &i ) ? "true" : "false" ); break; case BSON_DATE: - printf( "%ld" , ( long int )bson_iterator_date( &i ) ); + bson_printf( "%ld" , ( long int )bson_iterator_date( &i ) ); break; case BSON_BINDATA: - printf( "BSON_BINDATA" ); + bson_printf( "BSON_BINDATA" ); break; case BSON_UNDEFINED: - printf( "BSON_UNDEFINED" ); + bson_printf( "BSON_UNDEFINED" ); break; case BSON_NULL: - printf( "BSON_NULL" ); + bson_printf( "BSON_NULL" ); break; case BSON_REGEX: - printf( "BSON_REGEX: %s", bson_iterator_regex( &i ) ); + bson_printf( "BSON_REGEX: %s", bson_iterator_regex( &i ) ); break; case BSON_CODE: - printf( "BSON_CODE: %s", bson_iterator_code( &i ) ); + bson_printf( "BSON_CODE: %s", bson_iterator_code( &i ) ); break; case BSON_CODEWSCOPE: - printf( "BSON_CODE_W_SCOPE: %s", bson_iterator_code( &i ) ); + bson_printf( "BSON_CODE_W_SCOPE: %s", bson_iterator_code( &i ) ); bson_init( &scope ); bson_iterator_code_scope( &i, &scope ); - printf( "\n\t SCOPE: " ); + bson_printf( "\n\t SCOPE: " ); bson_print( &scope ); break; case BSON_INT: - printf( "%d" , bson_iterator_int( &i ) ); + bson_printf( "%d" , bson_iterator_int( &i ) ); break; case BSON_LONG: - printf( "%lld" , ( long long int )bson_iterator_long( &i ) ); + bson_printf( "%lld" , ( uint64_t )bson_iterator_long( &i ) ); break; case BSON_TIMESTAMP: ts = bson_iterator_timestamp( &i ); - printf( "i: %d, t: %d", ts.i, ts.t ); + bson_printf( "i: %d, t: %d", ts.i, ts.t ); break; case BSON_OBJECT: case BSON_ARRAY: - printf( "\n" ); + bson_printf( "\n" ); bson_print_raw( bson_iterator_value( &i ) , depth + 1 ); break; default: bson_errprintf( "can't print type : %d\n" , t ); } - printf( "\n" ); + bson_printf( "\n" ); } } @@ -293,17 +307,25 @@ void bson_print_raw( const char *data , int depth ) { ITERATOR ------------------------------ */ -void bson_iterator_init( bson_iterator *i, const bson *b ) { +MONGO_EXPORT bson_iterator* bson_iterator_create() { + return (bson_iterator*)malloc(sizeof(bson_iterator*)); +} + +MONGO_EXPORT void bson_iterator_dispose(bson_iterator* i) { + free(i); +} + +MONGO_EXPORT void bson_iterator_init( bson_iterator *i, const bson *b ) { i->cur = b->data + 4; i->first = 1; } -void bson_iterator_from_buffer( bson_iterator *i, const char *buffer ) { +MONGO_EXPORT void bson_iterator_from_buffer( bson_iterator *i, const char *buffer ) { i->cur = buffer + 4; i->first = 1; } -bson_type bson_find( bson_iterator *it, const bson *obj, const char *name ) { +MONGO_EXPORT bson_type bson_find( bson_iterator *it, const bson *obj, const char *name ) { bson_iterator_init( it, (bson *)obj ); while( bson_iterator_next( it ) ) { if ( strcmp( name, bson_iterator_key( it ) ) == 0 ) @@ -312,11 +334,11 @@ bson_type bson_find( bson_iterator *it, const bson *obj, const char *name ) { return bson_iterator_type( it ); } -bson_bool_t bson_iterator_more( const bson_iterator *i ) { +MONGO_EXPORT bson_bool_t bson_iterator_more( const bson_iterator *i ) { return *( i->cur ); } -bson_type bson_iterator_next( bson_iterator *i ) { +MONGO_EXPORT bson_type bson_iterator_next( bson_iterator *i ) { int ds; if ( i->first ) { @@ -384,15 +406,15 @@ bson_type bson_iterator_next( bson_iterator *i ) { return ( bson_type )( *i->cur ); } -bson_type bson_iterator_type( const bson_iterator *i ) { +MONGO_EXPORT bson_type bson_iterator_type( const bson_iterator *i ) { return ( bson_type )i->cur[0]; } -const char *bson_iterator_key( const bson_iterator *i ) { +MONGO_EXPORT const char *bson_iterator_key( const bson_iterator *i ) { return i->cur + 1; } -const char *bson_iterator_value( const bson_iterator *i ) { +MONGO_EXPORT const char *bson_iterator_value( const bson_iterator *i ) { const char *t = i->cur + 1; t += strlen( t ) + 1; return t; @@ -422,11 +444,11 @@ bson_bool_t bson_iterator_bool_raw( const bson_iterator *i ) { return bson_iterator_value( i )[0]; } -bson_oid_t *bson_iterator_oid( const bson_iterator *i ) { +MONGO_EXPORT bson_oid_t *bson_iterator_oid( const bson_iterator *i ) { return ( bson_oid_t * )bson_iterator_value( i ); } -int bson_iterator_int( const bson_iterator *i ) { +MONGO_EXPORT int bson_iterator_int( const bson_iterator *i ) { switch ( bson_iterator_type( i ) ) { case BSON_INT: return bson_iterator_int_raw( i ); @@ -439,7 +461,7 @@ int bson_iterator_int( const bson_iterator *i ) { } } -double bson_iterator_double( const bson_iterator *i ) { +MONGO_EXPORT double bson_iterator_double( const bson_iterator *i ) { switch ( bson_iterator_type( i ) ) { case BSON_INT: return bson_iterator_int_raw( i ); @@ -452,7 +474,7 @@ double bson_iterator_double( const bson_iterator *i ) { } } -int64_t bson_iterator_long( const bson_iterator *i ) { +MONGO_EXPORT int64_t bson_iterator_long( const bson_iterator *i ) { switch ( bson_iterator_type( i ) ) { case BSON_INT: return bson_iterator_int_raw( i ); @@ -465,14 +487,29 @@ int64_t bson_iterator_long( const bson_iterator *i ) { } } -bson_timestamp_t bson_iterator_timestamp( const bson_iterator *i ) { +MONGO_EXPORT bson_timestamp_t bson_iterator_timestamp( const bson_iterator *i ) { bson_timestamp_t ts; bson_little_endian32( &( ts.i ), bson_iterator_value( i ) ); bson_little_endian32( &( ts.t ), bson_iterator_value( i ) + 4 ); return ts; } -bson_bool_t bson_iterator_bool( const bson_iterator *i ) { + +MONGO_EXPORT int bson_iterator_timestamp_time( const bson_iterator *i ) { + int time; + bson_little_endian32( &time, bson_iterator_value( i ) + 4 ); + return time; +} + + +MONGO_EXPORT int bson_iterator_timestamp_increment( const bson_iterator *i ) { + int increment; + bson_little_endian32( &increment, bson_iterator_value( i ) ); + return increment; +} + + +MONGO_EXPORT bson_bool_t bson_iterator_bool( const bson_iterator *i ) { switch ( bson_iterator_type( i ) ) { case BSON_BOOL: return bson_iterator_bool_raw( i ); @@ -490,15 +527,21 @@ bson_bool_t bson_iterator_bool( const bson_iterator *i ) { } } -const char *bson_iterator_string( const bson_iterator *i ) { - return bson_iterator_value( i ) + 4; +MONGO_EXPORT const char *bson_iterator_string( const bson_iterator *i ) { + switch ( bson_iterator_type( i ) ) { + case BSON_STRING: + case BSON_SYMBOL: + return bson_iterator_value( i ) + 4; + default: + return ""; + } } int bson_iterator_string_len( const bson_iterator *i ) { return bson_iterator_int_raw( i ); } -const char *bson_iterator_code( const bson_iterator *i ) { +MONGO_EXPORT const char *bson_iterator_code( const bson_iterator *i ) { switch ( bson_iterator_type( i ) ) { case BSON_STRING: case BSON_CODE: @@ -510,57 +553,59 @@ const char *bson_iterator_code( const bson_iterator *i ) { } } -void bson_iterator_code_scope( const bson_iterator *i, bson *scope ) { +MONGO_EXPORT void bson_iterator_code_scope( const bson_iterator *i, bson *scope ) { if ( bson_iterator_type( i ) == BSON_CODEWSCOPE ) { int code_len; bson_little_endian32( &code_len, bson_iterator_value( i )+4 ); bson_init_data( scope, ( void * )( bson_iterator_value( i )+8+code_len ) ); + _bson_reset( scope ); + scope->finished = 1; } else { bson_empty( scope ); } } -bson_date_t bson_iterator_date( const bson_iterator *i ) { +MONGO_EXPORT bson_date_t bson_iterator_date( const bson_iterator *i ) { return bson_iterator_long_raw( i ); } -time_t bson_iterator_time_t( const bson_iterator *i ) { +MONGO_EXPORT time_t bson_iterator_time_t( const bson_iterator *i ) { return bson_iterator_date( i ) / 1000; } -int bson_iterator_bin_len( const bson_iterator *i ) { +MONGO_EXPORT int bson_iterator_bin_len( const bson_iterator *i ) { return ( bson_iterator_bin_type( i ) == BSON_BIN_BINARY_OLD ) ? bson_iterator_int_raw( i ) - 4 : bson_iterator_int_raw( i ); } -char bson_iterator_bin_type( const bson_iterator *i ) { +MONGO_EXPORT char bson_iterator_bin_type( const bson_iterator *i ) { return bson_iterator_value( i )[4]; } -const char *bson_iterator_bin_data( const bson_iterator *i ) { +MONGO_EXPORT const char *bson_iterator_bin_data( const bson_iterator *i ) { return ( bson_iterator_bin_type( i ) == BSON_BIN_BINARY_OLD ) ? bson_iterator_value( i ) + 9 : bson_iterator_value( i ) + 5; } -const char *bson_iterator_regex( const bson_iterator *i ) { +MONGO_EXPORT const char *bson_iterator_regex( const bson_iterator *i ) { return bson_iterator_value( i ); } -const char *bson_iterator_regex_opts( const bson_iterator *i ) { +MONGO_EXPORT const char *bson_iterator_regex_opts( const bson_iterator *i ) { const char *p = bson_iterator_value( i ); return p + strlen( p ) + 1; } -void bson_iterator_subobject( const bson_iterator *i, bson *sub ) { +MONGO_EXPORT void bson_iterator_subobject( const bson_iterator *i, bson *sub ) { bson_init_data( sub, ( char * )bson_iterator_value( i ) ); _bson_reset( sub ); sub->finished = 1; } -void bson_iterator_subiterator( const bson_iterator *i, bson_iterator *sub ) { +MONGO_EXPORT void bson_iterator_subiterator( const bson_iterator *i, bson_iterator *sub ) { bson_iterator_from_buffer( sub, bson_iterator_value( i ) ); } @@ -578,7 +623,7 @@ static void _bson_init_size( bson *b, int size ) { _bson_reset( b ); } -void bson_init( bson *b ) { +MONGO_EXPORT void bson_init( bson *b ) { _bson_init_size( b, initialBufferSize ); } @@ -635,7 +680,7 @@ int bson_ensure_space( bson *b, const int bytesNeeded ) { return BSON_OK; } -int bson_finish( bson *b ) { +MONGO_EXPORT int bson_finish( bson *b ) { int i; if( b->err & BSON_NOT_UTF8 ) @@ -652,12 +697,14 @@ int bson_finish( bson *b ) { return BSON_OK; } -void bson_destroy( bson *b ) { - bson_free( b->data ); - b->err = 0; - b->data = 0; - b->cur = 0; - b->finished = 1; +MONGO_EXPORT void bson_destroy( bson *b ) { + if (b) { + bson_free( b->data ); + b->err = 0; + b->data = 0; + b->cur = 0; + b->finished = 1; + } } static int bson_append_estart( bson *b, int type, const char *name, const int dataSize ) { @@ -686,41 +733,41 @@ static int bson_append_estart( bson *b, int type, const char *name, const int da BUILDING TYPES ------------------------------ */ -int bson_append_int( bson *b, const char *name, const int i ) { +MONGO_EXPORT int bson_append_int( bson *b, const char *name, const int i ) { if ( bson_append_estart( b, BSON_INT, name, 4 ) == BSON_ERROR ) return BSON_ERROR; bson_append32( b , &i ); return BSON_OK; } -int bson_append_long( bson *b, const char *name, const int64_t i ) { +MONGO_EXPORT int bson_append_long( bson *b, const char *name, const int64_t i ) { if ( bson_append_estart( b , BSON_LONG, name, 8 ) == BSON_ERROR ) return BSON_ERROR; bson_append64( b , &i ); return BSON_OK; } -int bson_append_double( bson *b, const char *name, const double d ) { +MONGO_EXPORT int bson_append_double( bson *b, const char *name, const double d ) { if ( bson_append_estart( b, BSON_DOUBLE, name, 8 ) == BSON_ERROR ) return BSON_ERROR; bson_append64( b , &d ); return BSON_OK; } -int bson_append_bool( bson *b, const char *name, const bson_bool_t i ) { +MONGO_EXPORT int bson_append_bool( bson *b, const char *name, const bson_bool_t i ) { if ( bson_append_estart( b, BSON_BOOL, name, 1 ) == BSON_ERROR ) return BSON_ERROR; bson_append_byte( b , i != 0 ); return BSON_OK; } -int bson_append_null( bson *b, const char *name ) { +MONGO_EXPORT int bson_append_null( bson *b, const char *name ) { if ( bson_append_estart( b , BSON_NULL, name, 0 ) == BSON_ERROR ) return BSON_ERROR; return BSON_OK; } -int bson_append_undefined( bson *b, const char *name ) { +MONGO_EXPORT int bson_append_undefined( bson *b, const char *name ) { if ( bson_append_estart( b, BSON_UNDEFINED, name, 0 ) == BSON_ERROR ) return BSON_ERROR; return BSON_OK; @@ -741,31 +788,31 @@ int bson_append_string_base( bson *b, const char *name, return BSON_OK; } -int bson_append_string( bson *b, const char *name, const char *value ) { +MONGO_EXPORT int bson_append_string( bson *b, const char *name, const char *value ) { return bson_append_string_base( b, name, value, strlen ( value ), BSON_STRING ); } -int bson_append_symbol( bson *b, const char *name, const char *value ) { +MONGO_EXPORT int bson_append_symbol( bson *b, const char *name, const char *value ) { return bson_append_string_base( b, name, value, strlen ( value ), BSON_SYMBOL ); } -int bson_append_code( bson *b, const char *name, const char *value ) { +MONGO_EXPORT int bson_append_code( bson *b, const char *name, const char *value ) { return bson_append_string_base( b, name, value, strlen ( value ), BSON_CODE ); } -int bson_append_string_n( bson *b, const char *name, const char *value, int len ) { +MONGO_EXPORT int bson_append_string_n( bson *b, const char *name, const char *value, int len ) { return bson_append_string_base( b, name, value, len, BSON_STRING ); } -int bson_append_symbol_n( bson *b, const char *name, const char *value, int len ) { +MONGO_EXPORT int bson_append_symbol_n( bson *b, const char *name, const char *value, int len ) { return bson_append_string_base( b, name, value, len, BSON_SYMBOL ); } -int bson_append_code_n( bson *b, const char *name, const char *value, int len ) { +MONGO_EXPORT int bson_append_code_n( bson *b, const char *name, const char *value, int len ) { return bson_append_string_base( b, name, value, len, BSON_CODE ); } -int bson_append_code_w_scope_n( bson *b, const char *name, +MONGO_EXPORT int bson_append_code_w_scope_n( bson *b, const char *name, const char *code, int len, const bson *scope ) { int sl = len + 1; @@ -779,11 +826,11 @@ int bson_append_code_w_scope_n( bson *b, const char *name, return BSON_OK; } -int bson_append_code_w_scope( bson *b, const char *name, const char *code, const bson *scope ) { +MONGO_EXPORT int bson_append_code_w_scope( bson *b, const char *name, const char *code, const bson *scope ) { return bson_append_code_w_scope_n( b, name, code, strlen ( code ), scope ); } -int bson_append_binary( bson *b, const char *name, char type, const char *str, int len ) { +MONGO_EXPORT int bson_append_binary( bson *b, const char *name, char type, const char *str, int len ) { if ( type == BSON_BIN_BINARY_OLD ) { int subtwolen = len + 4; if ( bson_append_estart( b, BSON_BINDATA, name, 4+1+4+len ) == BSON_ERROR ) @@ -802,20 +849,20 @@ int bson_append_binary( bson *b, const char *name, char type, const char *str, i return BSON_OK; } -int bson_append_oid( bson *b, const char *name, const bson_oid_t *oid ) { +MONGO_EXPORT int bson_append_oid( bson *b, const char *name, const bson_oid_t *oid ) { if ( bson_append_estart( b, BSON_OID, name, 12 ) == BSON_ERROR ) return BSON_ERROR; bson_append( b , oid , 12 ); return BSON_OK; } -int bson_append_new_oid( bson *b, const char *name ) { +MONGO_EXPORT int bson_append_new_oid( bson *b, const char *name ) { bson_oid_t oid; bson_oid_gen( &oid ); return bson_append_oid( b, name, &oid ); } -int bson_append_regex( bson *b, const char *name, const char *pattern, const char *opts ) { +MONGO_EXPORT int bson_append_regex( bson *b, const char *name, const char *pattern, const char *opts ) { const int plen = strlen( pattern )+1; const int olen = strlen( opts )+1; if ( bson_append_estart( b, BSON_REGEX, name, plen + olen ) == BSON_ERROR ) @@ -827,14 +874,14 @@ int bson_append_regex( bson *b, const char *name, const char *pattern, const cha return BSON_OK; } -int bson_append_bson( bson *b, const char *name, const bson *bson ) { +MONGO_EXPORT int bson_append_bson( bson *b, const char *name, const bson *bson ) { if ( bson_append_estart( b, BSON_OBJECT, name, bson_size( bson ) ) == BSON_ERROR ) return BSON_ERROR; bson_append( b , bson->data , bson_size( bson ) ); return BSON_OK; } -int bson_append_element( bson *b, const char *name_or_null, const bson_iterator *elem ) { +MONGO_EXPORT int bson_append_element( bson *b, const char *name_or_null, const bson_iterator *elem ) { bson_iterator next = *elem; int size; @@ -854,7 +901,7 @@ int bson_append_element( bson *b, const char *name_or_null, const bson_iterator return BSON_OK; } -int bson_append_timestamp( bson *b, const char *name, bson_timestamp_t *ts ) { +MONGO_EXPORT int bson_append_timestamp( bson *b, const char *name, bson_timestamp_t *ts ) { if ( bson_append_estart( b, BSON_TIMESTAMP, name, 8 ) == BSON_ERROR ) return BSON_ERROR; bson_append32( b , &( ts->i ) ); @@ -863,31 +910,39 @@ int bson_append_timestamp( bson *b, const char *name, bson_timestamp_t *ts ) { return BSON_OK; } -int bson_append_date( bson *b, const char *name, bson_date_t millis ) { +MONGO_EXPORT int bson_append_timestamp2( bson *b, const char *name, int time, int increment ) { + if ( bson_append_estart( b, BSON_TIMESTAMP, name, 8 ) == BSON_ERROR ) return BSON_ERROR; + + bson_append32( b , &increment ); + bson_append32( b , &time ); + return BSON_OK; +} + +MONGO_EXPORT int bson_append_date( bson *b, const char *name, bson_date_t millis ) { if ( bson_append_estart( b, BSON_DATE, name, 8 ) == BSON_ERROR ) return BSON_ERROR; bson_append64( b , &millis ); return BSON_OK; } -int bson_append_time_t( bson *b, const char *name, time_t secs ) { +MONGO_EXPORT int bson_append_time_t( bson *b, const char *name, time_t secs ) { return bson_append_date( b, name, ( bson_date_t )secs * 1000 ); } -int bson_append_start_object( bson *b, const char *name ) { +MONGO_EXPORT int bson_append_start_object( bson *b, const char *name ) { if ( bson_append_estart( b, BSON_OBJECT, name, 5 ) == BSON_ERROR ) return BSON_ERROR; b->stack[ b->stackPos++ ] = b->cur - b->data; bson_append32( b , &zero ); return BSON_OK; } -int bson_append_start_array( bson *b, const char *name ) { +MONGO_EXPORT int bson_append_start_array( bson *b, const char *name ) { if ( bson_append_estart( b, BSON_ARRAY, name, 5 ) == BSON_ERROR ) return BSON_ERROR; b->stack[ b->stackPos++ ] = b->cur - b->data; bson_append32( b , &zero ); return BSON_OK; } -int bson_append_finish_object( bson *b ) { +MONGO_EXPORT int bson_append_finish_object( bson *b ) { char *start; int i; if ( bson_ensure_space( b, 1 ) == BSON_ERROR ) return BSON_ERROR; @@ -900,22 +955,25 @@ int bson_append_finish_object( bson *b ) { return BSON_OK; } -int bson_append_finish_array( bson *b ) { - return bson_append_finish_object( b ); +MONGO_EXPORT double bson_int64_to_double( int64_t i64 ) { + return (double)i64; } +MONGO_EXPORT int bson_append_finish_array( bson *b ) { + return bson_append_finish_object( b ); +} /* Error handling and allocators. */ static bson_err_handler err_handler = NULL; -bson_err_handler set_bson_err_handler( bson_err_handler func ) { +MONGO_EXPORT bson_err_handler set_bson_err_handler( bson_err_handler func ) { bson_err_handler old = err_handler; err_handler = func; return old; } -void *bson_malloc( int size ) { +MONGO_EXPORT void *bson_malloc( int size ) { void *p; p = bson_malloc_func( size ); bson_fatal_msg( !!p, "malloc() failed" ); @@ -933,7 +991,9 @@ int _bson_errprintf( const char *format, ... ) { va_list ap; int ret; va_start( ap, format ); +#ifndef R_SAFETY_NET ret = vfprintf( stderr, format, ap ); +#endif va_end( ap ); return ret; @@ -961,9 +1021,10 @@ void bson_fatal_msg( int ok , const char *msg ) { if ( err_handler ) { err_handler( msg ); } - +#ifndef R_SAFETY_NET bson_errprintf( "error: %s\n" , msg ); exit( -5 ); +#endif } @@ -976,3 +1037,28 @@ void bson_numstr( char *str, int i ) { else bson_sprintf( str,"%d", i ); } + +MONGO_EXPORT void bson_swap_endian64( void *outp, const void *inp ) { + const char *in = ( const char * )inp; + char *out = ( char * )outp; + + out[0] = in[7]; + out[1] = in[6]; + out[2] = in[5]; + out[3] = in[4]; + out[4] = in[3]; + out[5] = in[2]; + out[6] = in[1]; + out[7] = in[0]; + +} + +MONGO_EXPORT void bson_swap_endian32( void *outp, const void *inp ) { + const char *in = ( const char * )inp; + char *out = ( char * )outp; + + out[0] = in[3]; + out[1] = in[2]; + out[2] = in[1]; + out[3] = in[0]; +} diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.h index 2e385b9160..b83d1ca9c9 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.h +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/bson.h @@ -3,7 +3,7 @@ * @brief BSON Declarations */ -/* Copyright 2009-2011 10gen Inc. +/* Copyright 2009-2012 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,16 +18,63 @@ * limitations under the License. */ -#ifndef _BSON_H_ -#define _BSON_H_ +#ifndef BSON_H_ +#define BSON_H_ -#include "platform.h" #include #include #include #include #include +#ifdef __GNUC__ + #define MONGO_INLINE static __inline__ + #define MONGO_EXPORT +#else + #define MONGO_INLINE static + #ifdef MONGO_STATIC_BUILD + #define MONGO_EXPORT + #elif defined(MONGO_DLL_BUILD) + #define MONGO_EXPORT __declspec(dllexport) + #else + #define MONGO_EXPORT __declspec(dllimport) + #endif +#endif + +#ifdef __cplusplus +#define MONGO_EXTERN_C_START extern "C" { +#define MONGO_EXTERN_C_END } +#else +#define MONGO_EXTERN_C_START +#define MONGO_EXTERN_C_END +#endif + +#if defined(MONGO_HAVE_STDINT) || __STDC_VERSION__ >= 199901L +#include +#elif defined(MONGO_HAVE_UNISTD) +#include +#elif defined(MONGO_USE__INT64) +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#elif defined(MONGO_USE_LONG_LONG_INT) +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#else +#error Must compile with c99 or define MONGO_HAVE_STDINT, MONGO_HAVE_UNISTD, MONGO_USE__INT64, or MONGO_USE_LONG_INT. +#endif + +#ifdef MONGO_BIG_ENDIAN +#define bson_little_endian64(out, in) ( bson_swap_endian64(out, in) ) +#define bson_little_endian32(out, in) ( bson_swap_endian32(out, in) ) +#define bson_big_endian64(out, in) ( memcpy(out, in, 8) ) +#define bson_big_endian32(out, in) ( memcpy(out, in, 4) ) +#else +#define bson_little_endian64(out, in) ( memcpy(out, in, 8) ) +#define bson_little_endian32(out, in) ( memcpy(out, in, 4) ) +#define bson_big_endian64(out, in) ( bson_swap_endian64(out, in) ) +#define bson_big_endian32(out, in) ( bson_swap_endian32(out, in) ) +#endif + MONGO_EXTERN_C_START #define BSON_OK 0 @@ -84,12 +131,12 @@ typedef struct { } bson_iterator; typedef struct { - char *data; - char *cur; - int dataSize; - bson_bool_t finished; - int stack[32]; - int stackPos; + char *data; /**< Pointer to a block of data in this BSON object. */ + char *cur; /**< Pointer to the current position. */ + int dataSize; /**< The number of bytes allocated to char *data. */ + bson_bool_t finished; /**< When finished, the BSON object can no longer be modified. */ + int stack[32]; /**< A stack used to keep track of nested BSON elements. */ + int stackPos; /**< Index of current stack position. */ int err; /**< Bitfield representing errors or warnings on this buffer */ char *errstr; /**< A string representation of the most recent error or warning. */ } bson; @@ -112,6 +159,9 @@ typedef struct { READING ------------------------------ */ +MONGO_EXPORT bson* bson_create(); +MONGO_EXPORT void bson_dispose(bson* b); + /** * Size of a BSON object. * @@ -119,21 +169,22 @@ typedef struct { * * @return the size. */ -int bson_size( const bson *b ); +MONGO_EXPORT int bson_size( const bson *b ); +MONGO_EXPORT int bson_buffer_size( const bson *b ); /** * Print a string representation of a BSON object. * * @param b the BSON object to print. */ -void bson_print( bson *b ); +MONGO_EXPORT void bson_print( const bson *b ); /** * Return a pointer to the raw buffer stored by this bson object. * * @param b a BSON object */ -const char *bson_data( bson *b ); +MONGO_EXPORT const char *bson_data( const bson *b ); /** * Print a string representation of a BSON object. @@ -141,7 +192,7 @@ const char *bson_data( bson *b ); * @param bson the raw data to print. * @param depth the depth to recurse the object.x */ -void bson_print_raw( const char *bson , int depth ); +MONGO_EXPORT void bson_print_raw( const char *bson , int depth ); /** * Advance a bson_iterator to the named field. @@ -152,15 +203,18 @@ void bson_print_raw( const char *bson , int depth ); * * @return the type of the found object or BSON_EOO if it is not found. */ -bson_type bson_find( bson_iterator *it, const bson *obj, const char *name ); +MONGO_EXPORT bson_type bson_find( bson_iterator *it, const bson *obj, const char *name ); + +MONGO_EXPORT bson_iterator* bson_iterator_create(); +MONGO_EXPORT void bson_iterator_dispose(bson_iterator*); /** * Initialize a bson_iterator. * * @param i the bson_iterator to initialize. * @param bson the BSON object to associate with the iterator. */ -void bson_iterator_init( bson_iterator *i , const bson *b ); +MONGO_EXPORT void bson_iterator_init( bson_iterator *i , const bson *b ); /** * Initialize a bson iterator from a const char* buffer. Note @@ -169,7 +223,7 @@ void bson_iterator_init( bson_iterator *i , const bson *b ); * @param i the bson_iterator to initialize. * @param buffer the buffer to point to. */ -void bson_iterator_from_buffer( bson_iterator *i, const char *buffer ); +MONGO_EXPORT void bson_iterator_from_buffer( bson_iterator *i, const char *buffer ); /* more returns true for eoo. best to loop with bson_iterator_next(&it) */ /** @@ -179,7 +233,7 @@ void bson_iterator_from_buffer( bson_iterator *i, const char *buffer ); * * @return returns true if there is more data. */ -bson_bool_t bson_iterator_more( const bson_iterator *i ); +MONGO_EXPORT bson_bool_t bson_iterator_more( const bson_iterator *i ); /** * Point the iterator at the next BSON object. @@ -188,7 +242,7 @@ bson_bool_t bson_iterator_more( const bson_iterator *i ); * * @return the type of the next BSON object. */ -bson_type bson_iterator_next( bson_iterator *i ); +MONGO_EXPORT bson_type bson_iterator_next( bson_iterator *i ); /** * Get the type of the BSON object currently pointed to by the iterator. @@ -197,7 +251,7 @@ bson_type bson_iterator_next( bson_iterator *i ); * * @return the type of the current BSON object. */ -bson_type bson_iterator_type( const bson_iterator *i ); +MONGO_EXPORT bson_type bson_iterator_type( const bson_iterator *i ); /** * Get the key of the BSON object currently pointed to by the iterator. @@ -206,7 +260,7 @@ bson_type bson_iterator_type( const bson_iterator *i ); * * @return the key of the current BSON object. */ -const char *bson_iterator_key( const bson_iterator *i ); +MONGO_EXPORT const char *bson_iterator_key( const bson_iterator *i ); /** * Get the value of the BSON object currently pointed to by the iterator. @@ -215,7 +269,7 @@ const char *bson_iterator_key( const bson_iterator *i ); * * @return the value of the current BSON object. */ -const char *bson_iterator_value( const bson_iterator *i ); +MONGO_EXPORT const char *bson_iterator_value( const bson_iterator *i ); /* these convert to the right type (return 0 if non-numeric) */ /** @@ -226,7 +280,7 @@ const char *bson_iterator_value( const bson_iterator *i ); * * @return the value of the current BSON object. */ -double bson_iterator_double( const bson_iterator *i ); +MONGO_EXPORT double bson_iterator_double( const bson_iterator *i ); /** * Get the int value of the BSON object currently pointed to by the iterator. @@ -235,7 +289,7 @@ double bson_iterator_double( const bson_iterator *i ); * * @return the value of the current BSON object. */ -int bson_iterator_int( const bson_iterator *i ); +MONGO_EXPORT int bson_iterator_int( const bson_iterator *i ); /** * Get the long value of the BSON object currently pointed to by the iterator. @@ -244,7 +298,7 @@ int bson_iterator_int( const bson_iterator *i ); * * @return the value of the current BSON object. */ -int64_t bson_iterator_long( const bson_iterator *i ); +MONGO_EXPORT int64_t bson_iterator_long( const bson_iterator *i ); /* return the bson timestamp as a whole or in parts */ /** @@ -255,7 +309,9 @@ int64_t bson_iterator_long( const bson_iterator *i ); * * @return the value of the current BSON object. */ -bson_timestamp_t bson_iterator_timestamp( const bson_iterator *i ); +MONGO_EXPORT bson_timestamp_t bson_iterator_timestamp( const bson_iterator *i ); +MONGO_EXPORT int bson_iterator_timestamp_time( const bson_iterator *i ); +MONGO_EXPORT int bson_iterator_timestamp_increment( const bson_iterator *i ); /** * Get the boolean value of the BSON object currently pointed to by @@ -267,7 +323,7 @@ bson_timestamp_t bson_iterator_timestamp( const bson_iterator *i ); */ /* false: boolean false, 0 in any type, or null */ /* true: anything else (even empty strings and objects) */ -bson_bool_t bson_iterator_bool( const bson_iterator *i ); +MONGO_EXPORT bson_bool_t bson_iterator_bool( const bson_iterator *i ); /** * Get the double value of the BSON object currently pointed to by the @@ -318,7 +374,7 @@ bson_bool_t bson_iterator_bool_raw( const bson_iterator *i ); * * @return the value of the current BSON object. */ -bson_oid_t *bson_iterator_oid( const bson_iterator *i ); +MONGO_EXPORT bson_oid_t *bson_iterator_oid( const bson_iterator *i ); /** * Get the string value of the BSON object currently pointed to by the @@ -329,7 +385,7 @@ bson_oid_t *bson_iterator_oid( const bson_iterator *i ); * @return the value of the current BSON object. */ /* these can also be used with bson_code and bson_symbol*/ -const char *bson_iterator_string( const bson_iterator *i ); +MONGO_EXPORT const char *bson_iterator_string( const bson_iterator *i ); /** * Get the string length of the BSON object currently pointed to by the @@ -352,7 +408,7 @@ int bson_iterator_string_len( const bson_iterator *i ); */ /* works with bson_code, bson_codewscope, and BSON_STRING */ /* returns NULL for everything else */ -const char *bson_iterator_code( const bson_iterator *i ); +MONGO_EXPORT const char *bson_iterator_code( const bson_iterator *i ); /** * Calls bson_empty on scope if not a bson_codewscope @@ -361,7 +417,7 @@ const char *bson_iterator_code( const bson_iterator *i ); * @param scope the bson scope. */ /* calls bson_empty on scope if not a bson_codewscope */ -void bson_iterator_code_scope( const bson_iterator *i, bson *scope ); +MONGO_EXPORT void bson_iterator_code_scope( const bson_iterator *i, bson *scope ); /** * Get the date value of the BSON object currently pointed to by the @@ -372,7 +428,7 @@ void bson_iterator_code_scope( const bson_iterator *i, bson *scope ); * @return the date value of the current BSON object. */ /* both of these only work with bson_date */ -bson_date_t bson_iterator_date( const bson_iterator *i ); +MONGO_EXPORT bson_date_t bson_iterator_date( const bson_iterator *i ); /** * Get the time value of the BSON object currently pointed to by the @@ -382,7 +438,7 @@ bson_date_t bson_iterator_date( const bson_iterator *i ); * * @return the time value of the current BSON object. */ -time_t bson_iterator_time_t( const bson_iterator *i ); +MONGO_EXPORT time_t bson_iterator_time_t( const bson_iterator *i ); /** * Get the length of the BSON binary object currently pointed to by the @@ -392,7 +448,7 @@ time_t bson_iterator_time_t( const bson_iterator *i ); * * @return the length of the current BSON binary object. */ -int bson_iterator_bin_len( const bson_iterator *i ); +MONGO_EXPORT int bson_iterator_bin_len( const bson_iterator *i ); /** * Get the type of the BSON binary object currently pointed to by the @@ -402,7 +458,7 @@ int bson_iterator_bin_len( const bson_iterator *i ); * * @return the type of the current BSON binary object. */ -char bson_iterator_bin_type( const bson_iterator *i ); +MONGO_EXPORT char bson_iterator_bin_type( const bson_iterator *i ); /** * Get the value of the BSON binary object currently pointed to by the @@ -412,7 +468,7 @@ char bson_iterator_bin_type( const bson_iterator *i ); * * @return the value of the current BSON binary object. */ -const char *bson_iterator_bin_data( const bson_iterator *i ); +MONGO_EXPORT const char *bson_iterator_bin_data( const bson_iterator *i ); /** * Get the value of the BSON regex object currently pointed to by the @@ -422,7 +478,7 @@ const char *bson_iterator_bin_data( const bson_iterator *i ); * * @return the value of the current BSON regex object. */ -const char *bson_iterator_regex( const bson_iterator *i ); +MONGO_EXPORT const char *bson_iterator_regex( const bson_iterator *i ); /** * Get the options of the BSON regex object currently pointed to by the @@ -432,7 +488,7 @@ const char *bson_iterator_regex( const bson_iterator *i ); * * @return the options of the current BSON regex object. */ -const char *bson_iterator_regex_opts( const bson_iterator *i ); +MONGO_EXPORT const char *bson_iterator_regex_opts( const bson_iterator *i ); /* these work with BSON_OBJECT and BSON_ARRAY */ /** @@ -442,7 +498,7 @@ const char *bson_iterator_regex_opts( const bson_iterator *i ); * @param i the bson_iterator. * @param sub the BSON subobject destination. */ -void bson_iterator_subobject( const bson_iterator *i, bson *sub ); +MONGO_EXPORT void bson_iterator_subobject( const bson_iterator *i, bson *sub ); /** * Get a bson_iterator that on the BSON subobject. @@ -450,7 +506,7 @@ void bson_iterator_subobject( const bson_iterator *i, bson *sub ); * @param i the bson_iterator. * @param sub the iterator to point at the BSON subobject. */ -void bson_iterator_subiterator( const bson_iterator *i, bson_iterator *sub ); +MONGO_EXPORT void bson_iterator_subiterator( const bson_iterator *i, bson_iterator *sub ); /* str must be at least 24 hex chars + null byte */ /** @@ -459,7 +515,7 @@ void bson_iterator_subiterator( const bson_iterator *i, bson_iterator *sub ); * @param oid the bson_oid_t destination. * @param str a null terminated string comprised of at least 24 hex chars. */ -void bson_oid_from_string( bson_oid_t *oid, const char *str ); +MONGO_EXPORT void bson_oid_from_string( bson_oid_t *oid, const char *str ); /** * Create a string representation of the bson_oid_t. @@ -467,14 +523,14 @@ void bson_oid_from_string( bson_oid_t *oid, const char *str ); * @param oid the bson_oid_t source. * @param str the string representation destination. */ -void bson_oid_to_string( const bson_oid_t *oid, char *str ); +MONGO_EXPORT void bson_oid_to_string( const bson_oid_t *oid, char *str ); /** * Create a bson_oid object. * * @param oid the destination for the newly created bson_oid_t. */ -void bson_oid_gen( bson_oid_t *oid ); +MONGO_EXPORT void bson_oid_gen( bson_oid_t *oid ); /** * Set a function to be used to generate the second four bytes @@ -482,7 +538,7 @@ void bson_oid_gen( bson_oid_t *oid ); * * @param func a pointer to a function that returns an int. */ -void bson_set_oid_fuzz( int ( *func )( void ) ); +MONGO_EXPORT void bson_set_oid_fuzz( int ( *func )( void ) ); /** * Set a function to be used to generate the incrementing part @@ -491,14 +547,14 @@ void bson_set_oid_fuzz( int ( *func )( void ) ); * * @param func a pointer to a function that returns an int. */ -void bson_set_oid_inc( int ( *func )( void ) ); +MONGO_EXPORT void bson_set_oid_inc( int ( *func )( void ) ); /** * Get the time a bson_oid_t was created. * * @param oid the bson_oid_t. */ -time_t bson_oid_generated_time( bson_oid_t *oid ); /* Gives the time the OID was created */ +MONGO_EXPORT time_t bson_oid_generated_time( bson_oid_t *oid ); /* Gives the time the OID was created */ /* ---------------------------- BUILDING @@ -512,7 +568,7 @@ time_t bson_oid_generated_time( bson_oid_t *oid ); /* Gives the time the OID was * @note When finished, you must pass the bson object to * bson_destroy( ). */ -void bson_init( bson *b ); +MONGO_EXPORT void bson_init( bson *b ); /** * Initialize a BSON object, and point its data @@ -524,6 +580,7 @@ void bson_init( bson *b ); * @return BSON_OK or BSON_ERROR. */ int bson_init_data( bson *b , char *data ); +int bson_init_finished_data( bson *b, char *data ) ; /** * Initialize a BSON object, and set its @@ -555,7 +612,7 @@ int bson_ensure_space( bson *b, const int bytesNeeded ); * @return the standard error code. To deallocate memory, * call bson_destroy on the bson object. */ -int bson_finish( bson *b ); +MONGO_EXPORT int bson_finish( bson *b ); /** * Destroy a bson object. @@ -563,7 +620,7 @@ int bson_finish( bson *b ); * @param b the bson object to destroy. * */ -void bson_destroy( bson *b ); +MONGO_EXPORT void bson_destroy( bson *b ); /** * Returns a pointer to a static empty BSON object. @@ -573,23 +630,17 @@ void bson_destroy( bson *b ); * @return the empty initialized BSON object. */ /* returns pointer to static empty bson object */ -bson *bson_empty( bson *obj ); - -/** - * Copy BSON data only from one object to another. - * - * @param out the copy destination BSON object. - * @param in the copy source BSON object. - */ -void bson_copy_basic( bson *out, const bson *in ); +MONGO_EXPORT bson *bson_empty( bson *obj ); /** * Make a complete copy of the a BSON object. + * The source bson object must be in a finished + * state; otherwise, the copy will fail. * * @param out the copy destination BSON object. * @param in the copy source BSON object. */ -void bson_copy( bson *out, const bson *in ); /* puts data in new buffer. NOOP if out==NULL */ +MONGO_EXPORT int bson_copy( bson *out, const bson *in ); /* puts data in new buffer. NOOP if out==NULL */ /** * Append a previously created bson_oid_t to a bson object. @@ -600,7 +651,7 @@ void bson_copy( bson *out, const bson *in ); /* puts data in new buffer. NOOP if * * @return BSON_OK or BSON_ERROR. */ -int bson_append_oid( bson *b, const char *name, const bson_oid_t *oid ); +MONGO_EXPORT int bson_append_oid( bson *b, const char *name, const bson_oid_t *oid ); /** * Append a bson_oid_t to a bson. @@ -610,7 +661,7 @@ int bson_append_oid( bson *b, const char *name, const bson_oid_t *oid ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_new_oid( bson *b, const char *name ); +MONGO_EXPORT int bson_append_new_oid( bson *b, const char *name ); /** * Append an int to a bson. @@ -621,7 +672,7 @@ int bson_append_new_oid( bson *b, const char *name ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_int( bson *b, const char *name, const int i ); +MONGO_EXPORT int bson_append_int( bson *b, const char *name, const int i ); /** * Append an long to a bson. @@ -632,7 +683,7 @@ int bson_append_int( bson *b, const char *name, const int i ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_long( bson *b, const char *name, const int64_t i ); +MONGO_EXPORT int bson_append_long( bson *b, const char *name, const int64_t i ); /** * Append an double to a bson. @@ -643,7 +694,7 @@ int bson_append_long( bson *b, const char *name, const int64_t i ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_double( bson *b, const char *name, const double d ); +MONGO_EXPORT int bson_append_double( bson *b, const char *name, const double d ); /** * Append a string to a bson. @@ -654,7 +705,7 @@ int bson_append_double( bson *b, const char *name, const double d ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_string( bson *b, const char *name, const char *str ); +MONGO_EXPORT int bson_append_string( bson *b, const char *name, const char *str ); /** * Append len bytes of a string to a bson. @@ -666,7 +717,7 @@ int bson_append_string( bson *b, const char *name, const char *str ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_string_n( bson *b, const char *name, const char *str, int len ); +MONGO_EXPORT int bson_append_string_n( bson *b, const char *name, const char *str, int len ); /** * Append a symbol to a bson. @@ -677,7 +728,7 @@ int bson_append_string_n( bson *b, const char *name, const char *str, int len ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_symbol( bson *b, const char *name, const char *str ); +MONGO_EXPORT int bson_append_symbol( bson *b, const char *name, const char *str ); /** * Append len bytes of a symbol to a bson. @@ -689,7 +740,7 @@ int bson_append_symbol( bson *b, const char *name, const char *str ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_symbol_n( bson *b, const char *name, const char *str, int len ); +MONGO_EXPORT int bson_append_symbol_n( bson *b, const char *name, const char *str, int len ); /** * Append code to a bson. @@ -701,7 +752,7 @@ int bson_append_symbol_n( bson *b, const char *name, const char *str, int len ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_code( bson *b, const char *name, const char *str ); +MONGO_EXPORT int bson_append_code( bson *b, const char *name, const char *str ); /** * Append len bytes of code to a bson. @@ -713,7 +764,7 @@ int bson_append_code( bson *b, const char *name, const char *str ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_code_n( bson *b, const char *name, const char *str, int len ); +MONGO_EXPORT int bson_append_code_n( bson *b, const char *name, const char *str, int len ); /** * Append code to a bson with scope. @@ -725,7 +776,7 @@ int bson_append_code_n( bson *b, const char *name, const char *str, int len ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_code_w_scope( bson *b, const char *name, const char *code, const bson *scope ); +MONGO_EXPORT int bson_append_code_w_scope( bson *b, const char *name, const char *code, const bson *scope ); /** * Append len bytes of code to a bson with scope. @@ -738,7 +789,7 @@ int bson_append_code_w_scope( bson *b, const char *name, const char *code, const * * @return BSON_OK or BSON_ERROR. */ -int bson_append_code_w_scope_n( bson *b, const char *name, const char *code, int size, const bson *scope ); +MONGO_EXPORT int bson_append_code_w_scope_n( bson *b, const char *name, const char *code, int size, const bson *scope ); /** * Append binary data to a bson. @@ -751,7 +802,7 @@ int bson_append_code_w_scope_n( bson *b, const char *name, const char *code, int * * @return BSON_OK or BSON_ERROR. */ -int bson_append_binary( bson *b, const char *name, char type, const char *str, int len ); +MONGO_EXPORT int bson_append_binary( bson *b, const char *name, char type, const char *str, int len ); /** * Append a bson_bool_t to a bson. @@ -762,7 +813,7 @@ int bson_append_binary( bson *b, const char *name, char type, const char *str, i * * @return BSON_OK or BSON_ERROR. */ -int bson_append_bool( bson *b, const char *name, const bson_bool_t v ); +MONGO_EXPORT int bson_append_bool( bson *b, const char *name, const bson_bool_t v ); /** * Append a null value to a bson. @@ -772,7 +823,7 @@ int bson_append_bool( bson *b, const char *name, const bson_bool_t v ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_null( bson *b, const char *name ); +MONGO_EXPORT int bson_append_null( bson *b, const char *name ); /** * Append an undefined value to a bson. @@ -782,7 +833,7 @@ int bson_append_null( bson *b, const char *name ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_undefined( bson *b, const char *name ); +MONGO_EXPORT int bson_append_undefined( bson *b, const char *name ); /** * Append a regex value to a bson. @@ -794,7 +845,7 @@ int bson_append_undefined( bson *b, const char *name ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_regex( bson *b, const char *name, const char *pattern, const char *opts ); +MONGO_EXPORT int bson_append_regex( bson *b, const char *name, const char *pattern, const char *opts ); /** * Append bson data to a bson. @@ -805,7 +856,7 @@ int bson_append_regex( bson *b, const char *name, const char *pattern, const cha * * @return BSON_OK or BSON_ERROR. */ -int bson_append_bson( bson *b, const char *name, const bson *bson ); +MONGO_EXPORT int bson_append_bson( bson *b, const char *name, const bson *bson ); /** * Append a BSON element to a bson from the current point of an iterator. @@ -816,7 +867,7 @@ int bson_append_bson( bson *b, const char *name, const bson *bson ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_element( bson *b, const char *name_or_null, const bson_iterator *elem ); +MONGO_EXPORT int bson_append_element( bson *b, const char *name_or_null, const bson_iterator *elem ); /** * Append a bson_timestamp_t value to a bson. @@ -827,7 +878,8 @@ int bson_append_element( bson *b, const char *name_or_null, const bson_iterator * * @return BSON_OK or BSON_ERROR. */ -int bson_append_timestamp( bson *b, const char *name, bson_timestamp_t *ts ); +MONGO_EXPORT int bson_append_timestamp( bson *b, const char *name, bson_timestamp_t *ts ); +MONGO_EXPORT int bson_append_timestamp2( bson *b, const char *name, int time, int increment ); /* these both append a bson_date */ /** @@ -839,7 +891,7 @@ int bson_append_timestamp( bson *b, const char *name, bson_timestamp_t *ts ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_date( bson *b, const char *name, bson_date_t millis ); +MONGO_EXPORT int bson_append_date( bson *b, const char *name, bson_date_t millis ); /** * Append a time_t value to a bson. @@ -850,7 +902,7 @@ int bson_append_date( bson *b, const char *name, bson_date_t millis ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_time_t( bson *b, const char *name, time_t secs ); +MONGO_EXPORT int bson_append_time_t( bson *b, const char *name, time_t secs ); /** * Start appending a new object to a bson. @@ -860,7 +912,7 @@ int bson_append_time_t( bson *b, const char *name, time_t secs ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_start_object( bson *b, const char *name ); +MONGO_EXPORT int bson_append_start_object( bson *b, const char *name ); /** * Start appending a new array to a bson. @@ -870,7 +922,7 @@ int bson_append_start_object( bson *b, const char *name ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_start_array( bson *b, const char *name ); +MONGO_EXPORT int bson_append_start_array( bson *b, const char *name ); /** * Finish appending a new object or array to a bson. @@ -879,7 +931,7 @@ int bson_append_start_array( bson *b, const char *name ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_finish_object( bson *b ); +MONGO_EXPORT int bson_append_finish_object( bson *b ); /** * Finish appending a new object or array to a bson. This @@ -889,13 +941,13 @@ int bson_append_finish_object( bson *b ); * * @return BSON_OK or BSON_ERROR. */ -int bson_append_finish_array( bson *b ); +MONGO_EXPORT int bson_append_finish_array( bson *b ); void bson_numstr( char *str, int i ); void bson_incnumstr( char *str ); -/* Error handling and stadard library function over-riding. */ +/* Error handling and standard library function over-riding. */ /* -------------------------------------------------------- */ /* bson_err_handlers shouldn't return!!! */ @@ -912,7 +964,6 @@ extern void ( *bson_free )( void * ); extern bson_printf_func bson_printf; extern bson_fprintf_func bson_fprintf; extern bson_sprintf_func bson_sprintf; - extern bson_printf_func bson_errprintf; /** @@ -924,7 +975,7 @@ extern bson_printf_func bson_errprintf; * * @sa malloc(3) */ -void *bson_malloc( int size ); +MONGO_EXPORT void *bson_malloc( int size ); /** * Changes the size of allocated memory and checks return value, @@ -946,7 +997,7 @@ void *bson_realloc( void *ptr, int size ); * * @return the old error handling function, or NULL. */ -bson_err_handler set_bson_err_handler( bson_err_handler func ); +MONGO_EXPORT bson_err_handler set_bson_err_handler( bson_err_handler func ); /* does nothing if ok != 0 */ /** @@ -971,5 +1022,15 @@ void bson_fatal_msg( int ok, const char *msg ); */ void bson_builder_error( bson *b ); +/** + * Cast an int64_t to double. This is necessary for embedding in + * certain environments. + * + */ +MONGO_EXPORT double bson_int64_to_double( int64_t i64 ); + +MONGO_EXPORT void bson_swap_endian32( void *outp, const void *inp ); +MONGO_EXPORT void bson_swap_endian64( void *outp, const void *inp ); + MONGO_EXTERN_C_END #endif diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.c index 8d2da1502f..00ecf18c92 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.c @@ -1,5 +1,5 @@ /* - * Copyright 2009-2011 10gen, Inc. + * Copyright 2009-2012 10gen, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.h index a2a07c6d5d..f13c31ee89 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.h +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/encoding.h @@ -1,5 +1,5 @@ /* - * Copyright 2009-2011 10gen, Inc. + * Copyright 2009-2012 10gen, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef _BSON_ENCODING_H_ -#define _BSON_ENCODING_H_ +#ifndef BSON_ENCODING_H_ +#define BSON_ENCODING_H_ MONGO_EXTERN_C_START diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env.h new file mode 100644 index 0000000000..463ee32f79 --- /dev/null +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env.h @@ -0,0 +1,39 @@ +/** @file env.h */ + +/* Copyright 2009-2012 10gen Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Header for generic net.h */ +#ifndef MONGO_ENV_H_ +#define MONGO_ENV_H_ + +#include "mongo.h" + +MONGO_EXTERN_C_START + +/* This is a no-op in the generic implementation. */ +int mongo_env_set_socket_op_timeout( mongo *conn, int millis ); +int mongo_env_read_socket( mongo *conn, void *buf, int len ); +int mongo_env_write_socket( mongo *conn, const void *buf, int len ); +int mongo_env_socket_connect( mongo *conn, const char *host, int port ); + +/* Initialize socket services */ +MONGO_EXPORT int mongo_env_sock_init( void ); + +/* Close a socket */ +MONGO_EXPORT int mongo_env_close_socket( int socket ); + +MONGO_EXTERN_C_END +#endif diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_posix.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_posix.c new file mode 100644 index 0000000000..f1020ca80d --- /dev/null +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_posix.c @@ -0,0 +1,165 @@ +/* env_posix.c */ + +/* Copyright 2009-2012 10gen Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Networking and other niceties for POSIX systems. */ +#include "env.h" +#include "mongo.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef NI_MAXSERV +# define NI_MAXSERV 32 +#endif + +int mongo_env_close_socket( int socket ) { + return close( socket ); +} + +int mongo_env_sock_init( void ) { + return 0; +} + +int mongo_env_write_socket( mongo *conn, const void *buf, int len ) { + const char *cbuf = buf; +#ifdef __APPLE__ + int flags = 0; +#else + int flags = MSG_NOSIGNAL; +#endif + + while ( len ) { + int sent = send( conn->sock, cbuf, len, flags ); + if ( sent == -1 ) { + if (errno == EPIPE) + conn->connected = 0; + __mongo_set_error( conn, MONGO_IO_ERROR, strerror( errno ), errno ); + return MONGO_ERROR; + } + cbuf += sent; + len -= sent; + } + + return MONGO_OK; +} + +int mongo_env_read_socket( mongo *conn, void *buf, int len ) { + char *cbuf = buf; + while ( len ) { + int sent = recv( conn->sock, cbuf, len, 0 ); + if ( sent == 0 || sent == -1 ) { + __mongo_set_error( conn, MONGO_IO_ERROR, strerror( errno ), errno ); + return MONGO_ERROR; + } + cbuf += sent; + len -= sent; + } + + return MONGO_OK; +} + +int mongo_env_set_socket_op_timeout( mongo *conn, int millis ) { + struct timeval tv; + tv.tv_sec = millis / 1000; + tv.tv_usec = ( millis % 1000 ) * 1000; + + if ( setsockopt( conn->sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof( tv ) ) == -1 ) { + conn->err = MONGO_IO_ERROR; + __mongo_set_error( conn, MONGO_IO_ERROR, "setsockopt SO_RCVTIMEO failed.", errno ); + return MONGO_ERROR; + } + + if ( setsockopt( conn->sock, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof( tv ) ) == -1 ) { + __mongo_set_error( conn, MONGO_IO_ERROR, "setsockopt SO_SNDTIMEO failed.", errno ); + return MONGO_ERROR; + } + + return MONGO_OK; +} + +int mongo_env_socket_connect( mongo *conn, const char *host, int port ) { + char port_str[NI_MAXSERV]; + int status; + + struct addrinfo ai_hints; + struct addrinfo *ai_list = NULL; + struct addrinfo *ai_ptr = NULL; + + conn->sock = 0; + conn->connected = 0; + sprintf(port_str,"%d",port); + + bson_sprintf( port_str, "%d", port ); + + memset( &ai_hints, 0, sizeof( ai_hints ) ); +#ifdef AI_ADDRCONFIG + ai_hints.ai_flags = AI_ADDRCONFIG; +#endif + ai_hints.ai_family = AF_UNSPEC; + ai_hints.ai_socktype = SOCK_STREAM; + + status = getaddrinfo( host, port_str, &ai_hints, &ai_list ); + if ( status != 0 ) { + bson_errprintf( "getaddrinfo failed: %s", gai_strerror( status ) ); + conn->err = MONGO_CONN_ADDR_FAIL; + return MONGO_ERROR; + } + + for ( ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next ) { + conn->sock = socket( ai_ptr->ai_family, ai_ptr->ai_socktype, ai_ptr->ai_protocol ); + if ( conn->sock < 0 ) { + conn->sock = 0; + continue; + } + + status = connect( conn->sock, ai_ptr->ai_addr, ai_ptr->ai_addrlen ); + if ( status != 0 ) { + mongo_env_close_socket( conn->sock ); + conn->sock = 0; + continue; + } + + if ( ai_ptr->ai_protocol == IPPROTO_TCP ) { + int flag = 1; + + setsockopt( conn->sock, IPPROTO_TCP, TCP_NODELAY, + ( void * ) &flag, sizeof( flag ) ); + if ( conn->op_timeout_ms > 0 ) + mongo_env_set_socket_op_timeout( conn, conn->op_timeout_ms ); + } + + conn->connected = 1; + break; + } + + freeaddrinfo( ai_list ); + + if ( ! conn->connected ) { + conn->err = MONGO_CONN_FAIL; + return MONGO_ERROR; + } + + return MONGO_OK; +} diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_standard.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_standard.c new file mode 100644 index 0000000000..36fa9f65c4 --- /dev/null +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_standard.c @@ -0,0 +1,168 @@ +/* env_standard.c */ + +/* Copyright 2009-2012 10gen Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Vanilla networking designed to work on all systems. */ +#include "env.h" +#include +#include + +#ifdef _WIN32 + #ifdef _MSC_VER + #include // send,recv,socklen_t etc + #include // addrinfo + #else + #include + #include + typedef int socklen_t; + #endif +#else +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#ifndef NI_MAXSERV +# define NI_MAXSERV 32 +#endif + +int mongo_env_close_socket( int socket ) { +#ifdef _WIN32 + return closesocket( socket ); +#else + return close( socket ); +#endif +} + +int mongo_env_write_socket( mongo *conn, const void *buf, int len ) { + const char *cbuf = buf; +#ifdef _WIN32 + int flags = 0; +#else +#ifdef __APPLE__ + int flags = 0; +#else + int flags = MSG_NOSIGNAL; +#endif +#endif + + while ( len ) { + int sent = send( conn->sock, cbuf, len, flags ); + if ( sent == -1 ) { + if (errno == EPIPE) + conn->connected = 0; + conn->err = MONGO_IO_ERROR; + return MONGO_ERROR; + } + cbuf += sent; + len -= sent; + } + + return MONGO_OK; +} + +int mongo_env_read_socket( mongo *conn, void *buf, int len ) { + char *cbuf = buf; + while ( len ) { + int sent = recv( conn->sock, cbuf, len, 0 ); + if ( sent == 0 || sent == -1 ) { + conn->err = MONGO_IO_ERROR; + return MONGO_ERROR; + } + cbuf += sent; + len -= sent; + } + + return MONGO_OK; +} + +/* This is a no-op in the generic implementation. */ +int mongo_env_set_socket_op_timeout( mongo *conn, int millis ) { + return MONGO_OK; +} + +int mongo_env_socket_connect( mongo *conn, const char *host, int port ) { + struct sockaddr_in sa; + socklen_t addressSize; + int flag = 1; + + if ( ( conn->sock = socket( AF_INET, SOCK_STREAM, 0 ) ) < 0 ) { + conn->sock = 0; + conn->err = MONGO_CONN_NO_SOCKET; + return MONGO_ERROR; + } + + memset( sa.sin_zero , 0 , sizeof( sa.sin_zero ) ); + sa.sin_family = AF_INET; + sa.sin_port = htons( port ); + sa.sin_addr.s_addr = inet_addr( host ); + addressSize = sizeof( sa ); + + if ( connect( conn->sock, ( struct sockaddr * )&sa, addressSize ) == -1 ) { + mongo_env_close_socket( conn->sock ); + conn->connected = 0; + conn->sock = 0; + conn->err = MONGO_CONN_FAIL; + return MONGO_ERROR; + } + + setsockopt( conn->sock, IPPROTO_TCP, TCP_NODELAY, ( char * ) &flag, sizeof( flag ) ); + + if( conn->op_timeout_ms > 0 ) + mongo_env_set_socket_op_timeout( conn, conn->op_timeout_ms ); + + conn->connected = 1; + + return MONGO_OK; +} + +MONGO_EXPORT int mongo_env_sock_init( void ) { + +#if defined(_WIN32) + WSADATA wsaData; + WORD wVers; +#elif defined(SIGPIPE) + struct sigaction act; +#endif + + static int called_once; + static int retval; + if (called_once) return retval; + called_once = 1; + +#if defined(_WIN32) + wVers = MAKEWORD(1, 1); + retval = (WSAStartup(wVers, &wsaData) == 0); +#elif defined(MACINTOSH) + GUSISetup(GUSIwithInternetSockets); + retval = 1; +#elif defined(SIGPIPE) + retval = 1; + if (sigaction(SIGPIPE, (struct sigaction *)NULL, &act) < 0) + retval = 0; + else if (act.sa_handler == SIG_DFL) { + act.sa_handler = SIG_IGN; + if (sigaction(SIGPIPE, &act, (struct sigaction *)NULL) < 0) + retval = 0; + } +#endif + return retval; +} diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_win32.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_win32.c new file mode 100644 index 0000000000..0b301cea61 --- /dev/null +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/env_win32.c @@ -0,0 +1,183 @@ +/* env_win32.c */ + +/* Copyright 2009-2012 10gen Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Networking and other niceties for WIN32. */ +#include "env.h" +#include "mongo.h" +#include + +#ifdef _MSC_VER +#include // send,recv,socklen_t etc +#include // addrinfo +#else +#include +#include +typedef int socklen_t; +#endif + +#ifndef NI_MAXSERV +# define NI_MAXSERV 32 +#endif + +static void mongo_clear_errors( mongo *conn ) { + conn->err = 0; + memset( conn->errstr, 0, MONGO_ERR_LEN ); +} + +int mongo_env_close_socket( int socket ) { + return closesocket( socket ); +} + +int mongo_env_write_socket( mongo *conn, const void *buf, int len ) { + const char *cbuf = buf; + int flags = 0; + + while ( len ) { + int sent = send( conn->sock, cbuf, len, flags ); + if ( sent == -1 ) { + __mongo_set_error( conn, MONGO_IO_ERROR, NULL, WSAGetLastError() ); + conn->connected = 0; + return MONGO_ERROR; + } + cbuf += sent; + len -= sent; + } + + return MONGO_OK; +} + +int mongo_env_read_socket( mongo *conn, void *buf, int len ) { + char *cbuf = buf; + + while ( len ) { + int sent = recv( conn->sock, cbuf, len, 0 ); + if ( sent == 0 || sent == -1 ) { + __mongo_set_error( conn, MONGO_IO_ERROR, NULL, WSAGetLastError() ); + return MONGO_ERROR; + } + cbuf += sent; + len -= sent; + } + + return MONGO_OK; +} + +int mongo_env_set_socket_op_timeout( mongo *conn, int millis ) { + if ( setsockopt( conn->sock, SOL_SOCKET, SO_RCVTIMEO, (const char *)&millis, + sizeof( millis ) ) == -1 ) { + __mongo_set_error( conn, MONGO_IO_ERROR, "setsockopt SO_RCVTIMEO failed.", + WSAGetLastError() ); + return MONGO_ERROR; + } + + if ( setsockopt( conn->sock, SOL_SOCKET, SO_SNDTIMEO, (const char *)&millis, + sizeof( millis ) ) == -1 ) { + __mongo_set_error( conn, MONGO_IO_ERROR, "setsockopt SO_SNDTIMEO failed.", + WSAGetLastError() ); + return MONGO_ERROR; + } + + return MONGO_OK; +} + +int mongo_env_socket_connect( mongo *conn, const char *host, int port ) { + char port_str[NI_MAXSERV]; + char errstr[MONGO_ERR_LEN]; + int status; + + struct addrinfo ai_hints; + struct addrinfo *ai_list = NULL; + struct addrinfo *ai_ptr = NULL; + + conn->sock = 0; + conn->connected = 0; + + bson_sprintf( port_str, "%d", port ); + + memset( &ai_hints, 0, sizeof( ai_hints ) ); + ai_hints.ai_family = AF_UNSPEC; + ai_hints.ai_socktype = SOCK_STREAM; + ai_hints.ai_protocol = IPPROTO_TCP; + + status = getaddrinfo( host, port_str, &ai_hints, &ai_list ); + if ( status != 0 ) { + bson_sprintf( errstr, "getaddrinfo failed with error %d", status ); + __mongo_set_error( conn, MONGO_CONN_ADDR_FAIL, errstr, WSAGetLastError() ); + return MONGO_ERROR; + } + + for ( ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next ) { + conn->sock = socket( ai_ptr->ai_family, ai_ptr->ai_socktype, + ai_ptr->ai_protocol ); + + if ( conn->sock < 0 ) { + __mongo_set_error( conn, MONGO_SOCKET_ERROR, "socket() failed", + WSAGetLastError() ); + conn->sock = 0; + continue; + } + + status = connect( conn->sock, ai_ptr->ai_addr, ai_ptr->ai_addrlen ); + if ( status != 0 ) { + __mongo_set_error( conn, MONGO_SOCKET_ERROR, "connect() failed", + WSAGetLastError() ); + mongo_env_close_socket( conn->sock ); + conn->sock = 0; + continue; + } + + if ( ai_ptr->ai_protocol == IPPROTO_TCP ) { + int flag = 1; + + setsockopt( conn->sock, IPPROTO_TCP, TCP_NODELAY, + ( void * ) &flag, sizeof( flag ) ); + + if ( conn->op_timeout_ms > 0 ) + mongo_env_set_socket_op_timeout( conn, conn->op_timeout_ms ); + } + + conn->connected = 1; + break; + } + + freeaddrinfo( ai_list ); + + if ( ! conn->connected ) { + conn->err = MONGO_CONN_FAIL; + return MONGO_ERROR; + } + else { + mongo_clear_errors( conn ); + return MONGO_OK; + } +} + +MONGO_EXPORT int mongo_env_sock_init( void ) { + + WSADATA wsaData; + WORD wVers; + static int called_once; + static int retval; + + if (called_once) return retval; + + called_once = 1; + wVers = MAKEWORD(1, 1); + retval = (WSAStartup(wVers, &wsaData) == 0); + + return retval; +} diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/gridfs.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/gridfs.c index f51b397d3f..9b2d1455ef 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/gridfs.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/gridfs.c @@ -1,6 +1,6 @@ /* gridfs.c */ -/* Copyright 2009-2011 10gen Inc. +/* Copyright 2009-2012 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,27 @@ #include #include +MONGO_EXPORT gridfs* gridfs_create() { + return (gridfs*)bson_malloc(sizeof(gridfs)); +} + +MONGO_EXPORT void gridfs_dispose(gridfs* gfs) { + free(gfs); +} + +MONGO_EXPORT gridfile* gridfile_create() { + return (gridfile*)bson_malloc(sizeof(gridfile)); +} + +MONGO_EXPORT void gridfile_dispose(gridfile* gf) { + free(gf); +} + +MONGO_EXPORT void gridfile_get_descriptor(gridfile* gf, bson* out) { + *out = *gf->meta; +} + + static bson *chunk_new( bson_oid_t id, int chunkNumber, const char *data, int len ) { bson *b = bson_malloc( sizeof( bson ) ); @@ -104,7 +125,7 @@ int gridfs_init( mongo *client, const char *dbname, const char *prefix, return MONGO_OK; } -void gridfs_destroy( gridfs *gfs ) { +MONGO_EXPORT void gridfs_destroy( gridfs *gfs ) { if ( gfs == NULL ) return; if ( gfs->dbname ) bson_free( ( char * )gfs->dbname ); if ( gfs->prefix ) bson_free( ( char * )gfs->prefix ); @@ -120,14 +141,17 @@ static int gridfs_insert_file( gridfs *gfs, const char *name, bson res; bson_iterator it; int result; + int64_t d; /* Check run md5 */ bson_init( &command ); bson_append_oid( &command, "filemd5", &id ); bson_append_string( &command, "root", gfs->prefix ); bson_finish( &command ); - assert( mongo_run_command( gfs->client, gfs->dbname, &command, &res ) == MONGO_OK ); + result = mongo_run_command( gfs->client, gfs->dbname, &command, &res ); bson_destroy( &command ); + if (result != MONGO_OK) + return result; /* Create and insert BSON for file metadata */ bson_init( &ret ); @@ -137,7 +161,8 @@ static int gridfs_insert_file( gridfs *gfs, const char *name, } bson_append_long( &ret, "length", length ); bson_append_int( &ret, "chunkSize", DEFAULT_CHUNK_SIZE ); - bson_append_date( &ret, "uploadDate", ( bson_date_t )1000*time( NULL ) ); + d = ( bson_date_t )1000*time( NULL ); + bson_append_date( &ret, "uploadDate", d); bson_find( &it, &res, "md5" ); bson_append_string( &ret, "md5", bson_iterator_string( &it ) ); bson_destroy( &res ); @@ -151,7 +176,7 @@ static int gridfs_insert_file( gridfs *gfs, const char *name, return result; } -int gridfs_store_buffer( gridfs *gfs, const char *data, +MONGO_EXPORT int gridfs_store_buffer( gridfs *gfs, const char *data, gridfs_offset length, const char *remotename, const char *contenttype ) { @@ -163,7 +188,7 @@ int gridfs_store_buffer( gridfs *gfs, const char *data, bson *oChunk; /* Large files Assertion */ - assert( length <= 0xffffffff ); + /* assert( length <= 0xffffffff ); */ /* Generate and append an oid*/ bson_oid_gen( &id ); @@ -183,7 +208,7 @@ int gridfs_store_buffer( gridfs *gfs, const char *data, return gridfs_insert_file( gfs, remotename, id, length, contenttype ); } -void gridfile_writer_init( gridfile *gfile, gridfs *gfs, +MONGO_EXPORT void gridfile_writer_init( gridfile *gfile, gridfs *gfs, const char *remote_name, const char *content_type ) { gfile->gfs = gfs; @@ -200,7 +225,7 @@ void gridfile_writer_init( gridfile *gfile, gridfs *gfs, strcpy( ( char * )gfile->content_type, content_type ); } -void gridfile_write_buffer( gridfile *gfile, const char *data, +MONGO_EXPORT void gridfile_write_buffer( gridfile *gfile, const char *data, gridfs_offset length ) { int bytes_left = 0; @@ -221,14 +246,13 @@ void gridfile_write_buffer( gridfile *gfile, const char *data, gfile->pending_len += length; } else { /* At least one chunk of data to write */ + chunks_to_write = to_write / DEFAULT_CHUNK_SIZE; + bytes_left = to_write % DEFAULT_CHUNK_SIZE; /* If there's a pending chunk to be written, we need to combine * the buffer provided up to DEFAULT_CHUNK_SIZE. */ if ( gfile->pending_len > 0 ) { - chunks_to_write = to_write / DEFAULT_CHUNK_SIZE; - bytes_left = to_write % DEFAULT_CHUNK_SIZE; - data_partial_len = DEFAULT_CHUNK_SIZE - gfile->pending_len; buffer = ( char * )bson_malloc( DEFAULT_CHUNK_SIZE ); memcpy( buffer, gfile->pending_data, gfile->pending_len ); @@ -270,7 +294,7 @@ void gridfile_write_buffer( gridfile *gfile, const char *data, } } -int gridfile_writer_done( gridfile *gfile ) { +MONGO_EXPORT int gridfile_writer_done( gridfile *gfile ) { /* write any remaining pending chunk data. * pending data will always take up less than one chunk */ @@ -307,8 +331,11 @@ int gridfs_store_file( gridfs *gfs, const char *filename, /* Open the file and the correct stream */ if ( strcmp( filename, "-" ) == 0 ) fd = stdin; - else fd = fopen( filename, "rb" ); - assert( fd != NULL ); /* No such file */ + else { + fd = fopen( filename, "rb" ); + if (fd == NULL) + return MONGO_ERROR; + } /* Generate and append an oid*/ bson_oid_gen( &id ); @@ -339,7 +366,7 @@ int gridfs_store_file( gridfs *gfs, const char *filename, return gridfs_insert_file( gfs, remotename, id, length, contenttype ); } -void gridfs_remove_filename( gridfs *gfs, const char *filename ) { +MONGO_EXPORT void gridfs_remove_filename( gridfs *gfs, const char *filename ) { bson query; mongo_cursor *files; bson file; @@ -433,7 +460,7 @@ int gridfile_init( gridfs *gfs, bson *meta, gridfile *gfile ) return MONGO_OK; } -void gridfile_destroy( gridfile *gfile ) +MONGO_EXPORT void gridfile_destroy( gridfile *gfile ) { bson_destroy( gfile->meta ); @@ -444,21 +471,21 @@ bson_bool_t gridfile_exists( gridfile *gfile ) { return ( bson_bool_t )( gfile != NULL || gfile->meta == NULL ); } -const char *gridfile_get_filename( gridfile *gfile ) { +MONGO_EXPORT const char *gridfile_get_filename( gridfile *gfile ) { bson_iterator it; bson_find( &it, gfile->meta, "filename" ); return bson_iterator_string( &it ); } -int gridfile_get_chunksize( gridfile *gfile ) { +MONGO_EXPORT int gridfile_get_chunksize( gridfile *gfile ) { bson_iterator it; bson_find( &it, gfile->meta, "chunkSize" ); return bson_iterator_int( &it ); } -gridfs_offset gridfile_get_contentlength( gridfile *gfile ) { +MONGO_EXPORT gridfs_offset gridfile_get_contentlength( gridfile *gfile ) { bson_iterator it; bson_find( &it, gfile->meta, "length" ); @@ -469,7 +496,7 @@ gridfs_offset gridfile_get_contentlength( gridfile *gfile ) { return ( gridfs_offset )bson_iterator_long( &it ); } -const char *gridfile_get_contenttype( gridfile *gfile ) { +MONGO_EXPORT const char *gridfile_get_contenttype( gridfile *gfile ) { bson_iterator it; if ( bson_find( &it, gfile->meta, "contentType" ) ) @@ -477,14 +504,14 @@ const char *gridfile_get_contenttype( gridfile *gfile ) { else return NULL; } -bson_date_t gridfile_get_uploaddate( gridfile *gfile ) { +MONGO_EXPORT bson_date_t gridfile_get_uploaddate( gridfile *gfile ) { bson_iterator it; bson_find( &it, gfile->meta, "uploadDate" ); return bson_iterator_date( &it ); } -const char *gridfile_get_md5( gridfile *gfile ) { +MONGO_EXPORT const char *gridfile_get_md5( gridfile *gfile ) { bson_iterator it; bson_find( &it, gfile->meta, "md5" ); @@ -505,20 +532,16 @@ bson_bool_t gridfile_get_boolean( gridfile *gfile, const char *name ) { return bson_iterator_bool( &it ); } -bson gridfile_get_metadata( gridfile *gfile ) { - bson sub; +MONGO_EXPORT void gridfile_get_metadata( gridfile *gfile, bson* out ) { bson_iterator it; - if ( bson_find( &it, gfile->meta, "metadata" ) ) { - bson_iterator_subobject( &it, &sub ); - return sub; - } else { - bson_empty( &sub ); - return sub; - } + if ( bson_find( &it, gfile->meta, "metadata" ) ) + bson_iterator_subobject( &it, out ); + else + bson_empty( out ); } -int gridfile_get_numchunks( gridfile *gfile ) { +MONGO_EXPORT int gridfile_get_numchunks( gridfile *gfile ) { bson_iterator it; gridfs_offset length; gridfs_offset chunkSize; @@ -539,11 +562,12 @@ int gridfile_get_numchunks( gridfile *gfile ) { : ( int )( numchunks ); } -bson gridfile_get_chunk( gridfile *gfile, int n ) { +MONGO_EXPORT void gridfile_get_chunk( gridfile *gfile, int n, bson* out ) { bson query; - bson out; + bson_iterator it; bson_oid_t id; + int result; bson_init( &query ); bson_find( &it, gfile->meta, "_id" ); @@ -552,15 +576,18 @@ bson gridfile_get_chunk( gridfile *gfile, int n ) { bson_append_int( &query, "n", n ); bson_finish( &query ); - assert( mongo_find_one( gfile->gfs->client, - gfile->gfs->chunks_ns, - &query, NULL, &out ) == MONGO_OK ); - + result = (mongo_find_one(gfile->gfs->client, + gfile->gfs->chunks_ns, + &query, NULL, out ) == MONGO_OK ); bson_destroy( &query ); - return out; + if (!result) { + bson empty; + bson_empty(&empty); + bson_copy(out, &empty); + } } -mongo_cursor *gridfile_get_chunks( gridfile *gfile, int start, int size ) { +MONGO_EXPORT mongo_cursor *gridfile_get_chunks( gridfile *gfile, int start, int size ) { bson_iterator it; bson_oid_t id; bson gte; @@ -613,18 +640,18 @@ gridfs_offset gridfile_write_file( gridfile *gfile, FILE *stream ) { const int num = gridfile_get_numchunks( gfile ); for ( i=0; i Length of pending_data buffer */ } gridfile; +MONGO_EXPORT gridfs* gridfs_create(); +MONGO_EXPORT void gridfs_dispose(gridfs* gfs); +MONGO_EXPORT gridfile* gridfile_create(); +MONGO_EXPORT void gridfile_dispose(gridfile* gf); +MONGO_EXPORT void gridfile_get_descriptor(gridfile* gf, bson* out); + /** * Initializes a GridFS object * @param client - db connection @@ -60,7 +66,7 @@ typedef struct { * * @return - MONGO_OK or MONGO_ERROR. */ -int gridfs_init( mongo *client, const char *dbname, +MONGO_EXPORT int gridfs_init( mongo *client, const char *dbname, const char *prefix, gridfs *gfs ); /** @@ -69,7 +75,7 @@ int gridfs_init( mongo *client, const char *dbname, * * @param gfs a grid */ -void gridfs_destroy( gridfs *gfs ); +MONGO_EXPORT void gridfs_destroy( gridfs *gfs ); /** * Initializes a gridfile for writing incrementally with gridfs_write_buffer. @@ -77,7 +83,7 @@ void gridfs_destroy( gridfs *gfs ); * When done, you must call gridfs_writer_done to save the file metadata. * */ -void gridfile_writer_init( gridfile *gfile, gridfs *gfs, const char *remote_name, +MONGO_EXPORT void gridfile_writer_init( gridfile *gfile, gridfs *gfs, const char *remote_name, const char *content_type ); /** @@ -86,7 +92,7 @@ void gridfile_writer_init( gridfile *gfile, gridfs *gfs, const char *remote_name * stream to a GridFS file. When finished, be sure to call gridfs_writer_done. * */ -void gridfile_write_buffer( gridfile *gfile, const char *data, +MONGO_EXPORT void gridfile_write_buffer( gridfile *gfile, const char *data, gridfs_offset length ); /** @@ -96,7 +102,7 @@ void gridfile_write_buffer( gridfile *gfile, const char *data, * * @return - MONGO_OK or MONGO_ERROR. */ -int gridfile_writer_done( gridfile *gfile ); +MONGO_EXPORT int gridfile_writer_done( gridfile *gfile ); /** * Store a buffer as a GridFS file. @@ -108,7 +114,7 @@ int gridfile_writer_done( gridfile *gfile ); * * @return - MONGO_OK or MONGO_ERROR. */ -int gridfs_store_buffer( gridfs *gfs, const char *data, gridfs_offset length, +MONGO_EXPORT int gridfs_store_buffer( gridfs *gfs, const char *data, gridfs_offset length, const char *remotename, const char *contenttype ); @@ -121,7 +127,7 @@ int gridfs_store_buffer( gridfs *gfs, const char *data, gridfs_offset length, * * @return - MONGO_OK or MONGO_ERROR. */ -int gridfs_store_file( gridfs *gfs, const char *filename, +MONGO_EXPORT int gridfs_store_file( gridfs *gfs, const char *filename, const char *remotename, const char *contenttype ); /** @@ -129,7 +135,7 @@ int gridfs_store_file( gridfs *gfs, const char *filename, * @param gfs - the working GridFS * @param filename - the filename of the file/s to be removed */ -void gridfs_remove_filename( gridfs *gfs, const char *filename ); +MONGO_EXPORT void gridfs_remove_filename( gridfs *gfs, const char *filename ); /** * Find the first file matching the provided query within the @@ -141,7 +147,7 @@ void gridfs_remove_filename( gridfs *gfs, const char *filename ); * * @return MONGO_OK if successful, MONGO_ERROR otherwise */ -int gridfs_find_query( gridfs *gfs, bson *query, gridfile *gfile ); +MONGO_EXPORT int gridfs_find_query( gridfs *gfs, bson *query, gridfile *gfile ); /** * Find the first file referenced by filename within the GridFS @@ -152,7 +158,7 @@ int gridfs_find_query( gridfs *gfs, bson *query, gridfile *gfile ); * * @return MONGO_OK or MONGO_ERROR. */ -int gridfs_find_filename( gridfs *gfs, const char *filename, gridfile *gfile ); +MONGO_EXPORT int gridfs_find_filename( gridfs *gfs, const char *filename, gridfile *gfile ); /** * Initializes a GridFile containing the GridFS and file bson @@ -162,20 +168,20 @@ int gridfs_find_filename( gridfs *gfs, const char *filename, gridfile *gfile ); * * @return - MONGO_OK or MONGO_ERROR. */ -int gridfile_init( gridfs *gfs, bson *meta, gridfile *gfile ); +MONGO_EXPORT int gridfile_init( gridfs *gfs, bson *meta, gridfile *gfile ); /** * Destroys the GridFile * * @param oGridFIle - the GridFile being destroyed */ -void gridfile_destroy( gridfile *gfile ); +MONGO_EXPORT void gridfile_destroy( gridfile *gfile ); /** * Returns whether or not the GridFile exists * @param gfile - the GridFile being examined */ -bson_bool_t gridfile_exists( gridfile *gfile ); +MONGO_EXPORT bson_bool_t gridfile_exists( gridfile *gfile ); /** * Returns the filename of GridFile @@ -183,7 +189,7 @@ bson_bool_t gridfile_exists( gridfile *gfile ); * * @return - the filename of the Gridfile */ -const char *gridfile_get_filename( gridfile *gfile ); +MONGO_EXPORT const char *gridfile_get_filename( gridfile *gfile ); /** * Returns the size of the chunks of the GridFile @@ -191,7 +197,7 @@ const char *gridfile_get_filename( gridfile *gfile ); * * @return - the size of the chunks of the Gridfile */ -int gridfile_get_chunksize( gridfile *gfile ); +MONGO_EXPORT int gridfile_get_chunksize( gridfile *gfile ); /** * Returns the length of GridFile's data @@ -200,7 +206,7 @@ int gridfile_get_chunksize( gridfile *gfile ); * * @return - the length of the Gridfile's data */ -gridfs_offset gridfile_get_contentlength( gridfile *gfile ); +MONGO_EXPORT gridfs_offset gridfile_get_contentlength( gridfile *gfile ); /** * Returns the MIME type of the GridFile @@ -210,7 +216,7 @@ gridfs_offset gridfile_get_contentlength( gridfile *gfile ); * @return - the MIME type of the Gridfile * (NULL if no type specified) */ -const char *gridfile_get_contenttype( gridfile *gfile ); +MONGO_EXPORT const char *gridfile_get_contenttype( gridfile *gfile ); /** * Returns the upload date of GridFile @@ -219,7 +225,7 @@ const char *gridfile_get_contenttype( gridfile *gfile ); * * @return - the upload date of the Gridfile */ -bson_date_t gridfile_get_uploaddate( gridfile *gfile ); +MONGO_EXPORT bson_date_t gridfile_get_uploaddate( gridfile *gfile ); /** * Returns the MD5 of GridFile @@ -228,7 +234,7 @@ bson_date_t gridfile_get_uploaddate( gridfile *gfile ); * * @return - the MD5 of the Gridfile */ -const char *gridfile_get_md5( gridfile *gfile ); +MONGO_EXPORT const char *gridfile_get_md5( gridfile *gfile ); /** * Returns the field in GridFile specified by name @@ -260,7 +266,7 @@ bson_bool_t gridfile_get_boolean( gridfile *gfile, * @return - the metadata of the Gridfile in a bson object * (an empty bson is returned if none exists) */ -bson gridfile_get_metadata( gridfile *gfile ); +MONGO_EXPORT void gridfile_get_metadata( gridfile *gfile, bson* out ); /** * Returns the number of chunks in the GridFile @@ -268,7 +274,7 @@ bson gridfile_get_metadata( gridfile *gfile ); * * @return - the number of chunks in the Gridfile */ -int gridfile_get_numchunks( gridfile *gfile ); +MONGO_EXPORT int gridfile_get_numchunks( gridfile *gfile ); /** * Returns chunk n of GridFile @@ -276,7 +282,7 @@ int gridfile_get_numchunks( gridfile *gfile ); * * @return - the nth chunk of the Gridfile */ -bson gridfile_get_chunk( gridfile *gfile, int n ); +MONGO_EXPORT void gridfile_get_chunk( gridfile *gfile, int n, bson* out ); /** * Returns a mongo_cursor of *size* chunks starting with chunk *start* @@ -287,7 +293,7 @@ bson gridfile_get_chunk( gridfile *gfile, int n ); * * @return - mongo_cursor of the chunks (must be destroyed after use) */ -mongo_cursor *gridfile_get_chunks( gridfile *gfile, int start, int size ); +MONGO_EXPORT mongo_cursor *gridfile_get_chunks( gridfile *gfile, int start, int size ); /** * Writes the GridFile to a stream @@ -295,7 +301,7 @@ mongo_cursor *gridfile_get_chunks( gridfile *gfile, int start, int size ); * @param gfile - the working GridFile * @param stream - the file stream to write to */ -gridfs_offset gridfile_write_file( gridfile *gfile, FILE *stream ); +MONGO_EXPORT gridfs_offset gridfile_write_file( gridfile *gfile, FILE *stream ); /** * Reads length bytes from the GridFile to a buffer @@ -309,7 +315,7 @@ gridfs_offset gridfile_write_file( gridfile *gfile, FILE *stream ); * * @return - the number of bytes read */ -gridfs_offset gridfile_read( gridfile *gfile, gridfs_offset size, char *buf ); +MONGO_EXPORT gridfs_offset gridfile_read( gridfile *gfile, gridfs_offset size, char *buf ); /** * Updates the position in the file @@ -321,6 +327,6 @@ gridfs_offset gridfile_read( gridfile *gfile, gridfs_offset size, char *buf ); * * @return - resulting offset location */ -gridfs_offset gridfile_seek( gridfile *gfile, gridfs_offset offset ); +MONGO_EXPORT gridfs_offset gridfile_seek( gridfile *gfile, gridfs_offset offset ); #endif diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.c index d1c1e3ab0b..68edd29513 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.c @@ -309,7 +309,7 @@ mongo_md5_process(mongo_md5_state_t *pms, const mongo_md5_byte_t *data /*[64]*/) pms->abcd[3] += d; } -void +MONGO_EXPORT void mongo_md5_init(mongo_md5_state_t *pms) { pms->count[0] = pms->count[1] = 0; @@ -319,7 +319,7 @@ mongo_md5_init(mongo_md5_state_t *pms) pms->abcd[3] = 0x10325476; } -void +MONGO_EXPORT void mongo_md5_append(mongo_md5_state_t *pms, const mongo_md5_byte_t *data, int nbytes) { const mongo_md5_byte_t *p = data; @@ -357,7 +357,7 @@ mongo_md5_append(mongo_md5_state_t *pms, const mongo_md5_byte_t *data, int nbyte memcpy(pms->buf, p, left); } -void +MONGO_EXPORT void mongo_md5_finish(mongo_md5_state_t *pms, mongo_md5_byte_t digest[16]) { static const mongo_md5_byte_t pad[64] = { diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.h index 540da3a584..342b6a7307 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.h +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/md5.h @@ -47,8 +47,8 @@ 1999-05-03 lpd Original version. */ -#ifndef md5_INCLUDED -# define md5_INCLUDED +#ifndef MONGO_MD5_H_ +#define MONGO_MD5_H_ /* * This package supports both compile-time and run-time determination of CPU @@ -59,6 +59,7 @@ * run on either big- or little-endian CPUs, but will run slightly less * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. */ +#include "bson.h" typedef unsigned char mongo_md5_byte_t; /* 8-bit byte */ typedef unsigned int mongo_md5_word_t; /* 32-bit word */ @@ -75,17 +76,17 @@ extern "C" { #endif - /* Initialize the algorithm. */ - void mongo_md5_init(mongo_md5_state_t *pms); +/* Initialize the algorithm. */ +MONGO_EXPORT void mongo_md5_init(mongo_md5_state_t *pms); - /* Append a string to the message. */ - void mongo_md5_append(mongo_md5_state_t *pms, const mongo_md5_byte_t *data, int nbytes); +/* Append a string to the message. */ +MONGO_EXPORT void mongo_md5_append(mongo_md5_state_t *pms, const mongo_md5_byte_t *data, int nbytes); - /* Finish the message and return the digest. */ - void mongo_md5_finish(mongo_md5_state_t *pms, mongo_md5_byte_t digest[16]); +/* Finish the message and return the digest. */ +MONGO_EXPORT void mongo_md5_finish(mongo_md5_state_t *pms, mongo_md5_byte_t digest[16]); #ifdef __cplusplus } /* end extern "C" */ #endif -#endif /* md5_INCLUDED */ +#endif /* MONGO_MD5_H_ */ diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c index 2090e74312..eb16392297 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c @@ -1,6 +1,6 @@ /* mongo.c */ -/* Copyright 2009-2011 10gen Inc. +/* Copyright 2009-2012 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,19 +17,235 @@ #include "mongo.h" #include "md5.h" +#include "env.h" #include #include #include #include -#ifdef _USE_LINUX_SYSTEM -#include "platform/linux/net.h" -#elif defined _USE_CUSTOM_SYSTEM -#include "platform/custom/net.h" -#else -#include "net.h" -#endif +MONGO_EXPORT mongo* mongo_create() { + return (mongo*)bson_malloc(sizeof(mongo)); +} + + +MONGO_EXPORT void mongo_dispose(mongo* conn) { + free(conn); +} + +MONGO_EXPORT int mongo_get_err(mongo* conn) { + return conn->err; +} + + +MONGO_EXPORT int mongo_is_connected(mongo* conn) { + return conn->connected != 0; +} + + +MONGO_EXPORT int mongo_get_op_timeout(mongo* conn) { + return conn->op_timeout_ms; +} + + +const char* _get_host_port(mongo_host_port* hp) { + static char _hp[sizeof(hp->host)+12]; + bson_sprintf(_hp, "%s:%d", hp->host, hp->port); + return _hp; +} + + +MONGO_EXPORT const char* mongo_get_primary(mongo* conn) { + mongo* conn_ = (mongo*)conn; + return _get_host_port(conn_->primary); +} + + +MONGO_EXPORT int mongo_get_socket(mongo* conn) { + mongo* conn_ = (mongo*)conn; + return conn_->sock; +} + + +MONGO_EXPORT int mongo_get_host_count(mongo* conn) { + mongo_replset* r = conn->replset; + mongo_host_port* hp; + int count = 0; + if (!r) return 0; + for (hp = r->hosts; hp; hp = hp->next) + ++count; + return count; +} + + +MONGO_EXPORT const char* mongo_get_host(mongo* conn, int i) { + mongo_replset* r = conn->replset; + mongo_host_port* hp; + int count = 0; + if (!r) return 0; + for (hp = r->hosts; hp; hp = hp->next) { + if (count == i) + return _get_host_port(hp); + ++count; + } + return 0; +} + + +MONGO_EXPORT mongo_cursor* mongo_cursor_create() { + return (mongo_cursor*)bson_malloc(sizeof(mongo_cursor)); +} + + +MONGO_EXPORT void mongo_cursor_dispose(mongo_cursor* cursor) { + free(cursor); +} + + +MONGO_EXPORT int mongo_get_server_err(mongo* conn) { + return conn->lasterrcode; +} + + +MONGO_EXPORT const char* mongo_get_server_err_string(mongo* conn) { + return conn->lasterrstr; +} + +MONGO_EXPORT void __mongo_set_error( mongo *conn, mongo_error_t err, const char *str, + int errcode ) { + int errstr_size, str_size; + + conn->err = err; + conn->errcode = errcode; + + if( str ) { + str_size = strlen( str ) + 1; + errstr_size = str_size > MONGO_ERR_LEN ? MONGO_ERR_LEN : str_size; + memcpy( conn->errstr, str, errstr_size ); + conn->errstr[errstr_size] = '\0'; + } +} + +MONGO_EXPORT void mongo_clear_errors( mongo *conn ) { + conn->err = 0; + conn->errcode = 0; + conn->lasterrcode = 0; + memset( conn->errstr, 0, MONGO_ERR_LEN ); + memset( conn->lasterrstr, 0, MONGO_ERR_LEN ); +} + +MONGO_EXPORT int mongo_validate_ns( mongo *conn, const char *ns ) { + char *last = NULL; + char *current = NULL; + const char *db_name = ns; + char *collection_name = NULL; + char errmsg[64]; + int ns_len = 0; + + /* If the first character is a '.', fail. */ + if( *ns == '.' ) { + __mongo_set_error( conn, MONGO_NS_INVALID, "ns cannot start with a '.'.", 0 ); + return MONGO_ERROR; + } + + /* Find the division between database and collection names. */ + for( current = (char *)ns; *current != '\0'; current++ ) { + if( *current == '.' ) { + current++; + break; + } + } + + /* Fail because the ns doesn't contain a '.' + * or the collection part starts with a dot. */ + if( *current == '\0' || *current == '.' ) { + __mongo_set_error( conn, MONGO_NS_INVALID, "ns cannot start with a '.'.", 0 ); + return MONGO_ERROR; + } + + /* Fail if collection length is 0. */ + if( *(current + 1) == '\0' ) { + __mongo_set_error( conn, MONGO_NS_INVALID, "Collection name missing.", 0 ); + return MONGO_ERROR; + } + + + /* Point to the beginning of the collection name. */ + collection_name = current; + + /* Ensure that the database name is greater than one char.*/ + if( collection_name - 1 == db_name ) { + __mongo_set_error( conn, MONGO_NS_INVALID, "Database name missing.", 0 ); + return MONGO_ERROR; + } + + /* Go back and validate the database name. */ + for( current = (char *)db_name; *current != '.'; current++ ) { + switch( *current ) { + case ' ': + case '$': + case '/': + case '\\': + __mongo_set_error( conn, MONGO_NS_INVALID, + "Database name may not contain ' ', '$', '/', or '\\'", 0 ); + return MONGO_ERROR; + default: + break; + } + + ns_len++; + } + + /* Add one to the length for the '.' character. */ + ns_len++; + + /* Now validate the collection name. */ + for( current = collection_name; *current != '\0'; current++ ) { + + /* Cannot have two consecutive dots. */ + if( last && *last == '.' && *current == '.' ) { + __mongo_set_error( conn, MONGO_NS_INVALID, + "Collection may not contain two consecutive '.'", 0 ); + return MONGO_ERROR; + } + + /* Cannot contain a '$' */ + if( *current == '$' ) { + __mongo_set_error( conn, MONGO_NS_INVALID, + "Collection may not contain '$'", 0 ); + return MONGO_ERROR; + } + + last = current; + ns_len++; + } + + if( ns_len > 128 ) { + bson_sprintf( errmsg, "Namespace too long; has %d but must <= 128.", + ns_len ); + __mongo_set_error( conn, MONGO_NS_INVALID, errmsg, 0 ); + return MONGO_ERROR; + } + + /* Cannot end with a '.' */ + if( *(current - 1) == '.' ) { + __mongo_set_error( conn, MONGO_NS_INVALID, + "Collection may not end with '.'", 0 ); + return MONGO_ERROR; + } + + return MONGO_OK; +} + +static void mongo_set_last_error( mongo *conn, bson_iterator *it, bson *obj ) { + int result_len = bson_iterator_string_len( it ); + const char *result_string = bson_iterator_string( it ); + int len = result_len < MONGO_ERR_LEN ? result_len : MONGO_ERR_LEN; + memcpy( conn->lasterrstr, result_string, len ); + + if( bson_find( it, obj, "code" ) != BSON_NULL ) + conn->lasterrcode = bson_iterator_int( it ); +} static const int ZERO = 0; static const int ONE = 1; @@ -57,13 +273,13 @@ int mongo_message_send( mongo *conn, mongo_message *mm ) { bson_little_endian32( &head.responseTo, &mm->head.responseTo ); bson_little_endian32( &head.op, &mm->head.op ); - res = mongo_write_socket( conn, &head, sizeof( head ) ); + res = mongo_env_write_socket( conn, &head, sizeof( head ) ); if( res != MONGO_OK ) { bson_free( mm ); return res; } - res = mongo_write_socket( conn, &mm->data, mm->head.len - sizeof( head ) ); + res = mongo_env_write_socket( conn, &mm->data, mm->head.len - sizeof( head ) ); if( res != MONGO_OK ) { bson_free( mm ); return res; @@ -80,8 +296,8 @@ int mongo_read_response( mongo *conn, mongo_reply **reply ) { unsigned int len; int res; - mongo_read_socket( conn, &head, sizeof( head ) ); - mongo_read_socket( conn, &fields, sizeof( fields ) ); + mongo_env_read_socket( conn, &head, sizeof( head ) ); + mongo_env_read_socket( conn, &fields, sizeof( fields ) ); bson_little_endian32( &len, &head.len ); @@ -100,7 +316,7 @@ int mongo_read_response( mongo *conn, mongo_reply **reply ) { bson_little_endian32( &out->fields.start, &fields.start ); bson_little_endian32( &out->fields.num, &fields.num ); - res = mongo_read_socket( conn, &out->objs, len-sizeof( head )-sizeof( fields ) ); + res = mongo_env_read_socket( conn, &out->objs, len-sizeof( head )-sizeof( fields ) ); if( res != MONGO_OK ) { bson_free( out ); return res; @@ -133,12 +349,17 @@ static int mongo_check_is_master( mongo *conn ) { bson out; bson_iterator it; bson_bool_t ismaster = 0; + int max_bson_size = MONGO_DEFAULT_MAX_BSON_SIZE; out.data = NULL; if ( mongo_simple_int_command( conn, "admin", "ismaster", 1, &out ) == MONGO_OK ) { if( bson_find( &it, &out, "ismaster" ) ) ismaster = bson_iterator_bool( &it ); + if( bson_find( &it, &out, "maxBsonObjectSize" ) ) { + max_bson_size = bson_iterator_int( &it ); + } + conn->max_bson_size = max_bson_size; } else { return MONGO_ERROR; } @@ -153,25 +374,25 @@ static int mongo_check_is_master( mongo *conn ) { } } -void mongo_init( mongo *conn ) { - conn->replset = NULL; - conn->err = 0; - conn->errstr = NULL; - conn->lasterrcode = 0; - conn->lasterrstr = NULL; - - conn->conn_timeout_ms = 0; - conn->op_timeout_ms = 0; +MONGO_EXPORT void mongo_init_sockets( void ) { + mongo_env_sock_init(); } -int mongo_connect( mongo *conn , const char *host, int port ) { + +MONGO_EXPORT void mongo_init( mongo *conn ) { + memset( conn, 0, sizeof( mongo ) ); + conn->max_bson_size = MONGO_DEFAULT_MAX_BSON_SIZE; +} + +MONGO_EXPORT int mongo_connect( mongo *conn , const char *host, int port ) { + mongo_init( conn ); + conn->primary = bson_malloc( sizeof( mongo_host_port ) ); strncpy( conn->primary->host, host, strlen( host ) + 1 ); conn->primary->port = port; conn->primary->next = NULL; - mongo_init( conn ); - if( mongo_socket_connect( conn, host, port ) != MONGO_OK ) + if( mongo_env_socket_connect( conn, host, port ) != MONGO_OK ) return MONGO_ERROR; if( mongo_check_is_master( conn ) != MONGO_OK ) @@ -180,7 +401,7 @@ int mongo_connect( mongo *conn , const char *host, int port ) { return MONGO_OK; } -void mongo_replset_init( mongo *conn, const char *name ) { +MONGO_EXPORT void mongo_replset_init( mongo *conn, const char *name ) { mongo_init( conn ); conn->replset = bson_malloc( sizeof( mongo_replset ) ); @@ -222,7 +443,7 @@ static void mongo_replset_free_list( mongo_host_port **list ) { *list = NULL; } -void mongo_replset_add_seed( mongo *conn, const char *host, int port ) { +MONGO_EXPORT void mongo_replset_add_seed( mongo *conn, const char *host, int port ) { mongo_replset_add_node( &conn->replset->seeds, host, port ); } @@ -291,7 +512,7 @@ static void mongo_replset_check_seed( mongo *conn ) { bson_destroy( &out ); bson_destroy( &hosts ); - mongo_close_socket( conn->sock ); + mongo_env_close_socket( conn->sock ); conn->sock = 0; conn->connected = 0; @@ -306,6 +527,7 @@ static int mongo_replset_check_host( mongo *conn ) { bson_iterator it; bson_bool_t ismaster = 0; const char *set_name; + int max_bson_size = MONGO_DEFAULT_MAX_BSON_SIZE; out.data = NULL; @@ -313,6 +535,10 @@ static int mongo_replset_check_host( mongo *conn ) { if( bson_find( &it, &out, "ismaster" ) ) ismaster = bson_iterator_bool( &it ); + if( bson_find( &it, &out, "maxBsonObjectSize" ) ) + max_bson_size = bson_iterator_int( &it ); + conn->max_bson_size = max_bson_size; + if( bson_find( &it, &out, "setName" ) ) { set_name = bson_iterator_string( &it ); if( strcmp( set_name, conn->replset->name ) != 0 ) { @@ -328,13 +554,13 @@ static int mongo_replset_check_host( mongo *conn ) { if( ismaster ) { conn->replset->primary_connected = 1; } else { - mongo_close_socket( conn->sock ); + mongo_env_close_socket( conn->sock ); } return MONGO_OK; } -int mongo_replset_connect( mongo *conn ) { +MONGO_EXPORT int mongo_replset_connect( mongo *conn ) { int res = 0; mongo_host_port *node; @@ -347,15 +573,12 @@ int mongo_replset_connect( mongo *conn ) { */ node = conn->replset->seeds; while( node != NULL ) { - res = mongo_socket_connect( conn, ( const char * )&node->host, node->port ); - if( res != MONGO_OK ) - return MONGO_ERROR; - - mongo_replset_check_seed( conn ); - - if( conn->replset->hosts ) - break; - + res = mongo_env_socket_connect( conn, ( const char * )&node->host, node->port ); + if( res == MONGO_OK ) { + mongo_replset_check_seed( conn ); + if( conn->replset->hosts ) + break; + } node = node->next; } @@ -367,19 +590,22 @@ int mongo_replset_connect( mongo *conn ) { node = conn->replset->hosts; while( node != NULL ) { - res = mongo_socket_connect( conn, ( const char * )&node->host, node->port ); + res = mongo_env_socket_connect( conn, ( const char * )&node->host, node->port ); if( res == MONGO_OK ) { if( mongo_replset_check_host( conn ) != MONGO_OK ) return MONGO_ERROR; /* Primary found, so return. */ - else if( conn->replset->primary_connected ) + else if( conn->replset->primary_connected ) { + strncpy( conn->primary->host, node->host, strlen( node->host ) + 1 ); + conn->primary->port = node->port; return MONGO_OK; + } /* No primary, so close the connection. */ else { - mongo_close_socket( conn->sock ); + mongo_env_close_socket( conn->sock ); conn->sock = 0; conn->connected = 0; } @@ -394,15 +620,15 @@ int mongo_replset_connect( mongo *conn ) { return MONGO_ERROR; } -int mongo_set_op_timeout( mongo *conn, int millis ) { +MONGO_EXPORT int mongo_set_op_timeout( mongo *conn, int millis ) { conn->op_timeout_ms = millis; if( conn->sock && conn->connected ) - mongo_set_socket_op_timeout( conn, millis ); + mongo_env_set_socket_op_timeout( conn, millis ); return MONGO_OK; } -int mongo_reconnect( mongo *conn ) { +MONGO_EXPORT int mongo_reconnect( mongo *conn ) { int res; mongo_disconnect( conn ); @@ -413,10 +639,10 @@ int mongo_reconnect( mongo *conn ) { res = mongo_replset_connect( conn ); return res; } else - return mongo_socket_connect( conn, conn->primary->host, conn->primary->port ); + return mongo_env_socket_connect( conn, conn->primary->host, conn->primary->port ); } -int mongo_check_connection( mongo *conn ) { +MONGO_EXPORT int mongo_check_connection( mongo *conn ) { if( ! conn->connected ) return MONGO_ERROR; @@ -426,7 +652,7 @@ int mongo_check_connection( mongo *conn ) { return MONGO_ERROR; } -void mongo_disconnect( mongo *conn ) { +MONGO_EXPORT void mongo_disconnect( mongo *conn ) { if( ! conn->connected ) return; @@ -436,13 +662,13 @@ void mongo_disconnect( mongo *conn ) { conn->replset->hosts = NULL; } - mongo_close_socket( conn->sock ); + mongo_env_close_socket( conn->sock ); conn->sock = 0; conn->connected = 0; } -void mongo_destroy( mongo *conn ) { +MONGO_EXPORT void mongo_destroy( mongo *conn ) { mongo_disconnect( conn ); if( conn->replset ) { @@ -454,17 +680,20 @@ void mongo_destroy( mongo *conn ) { } bson_free( conn->primary ); - bson_free( conn->errstr ); - bson_free( conn->lasterrstr ); - conn->err = 0; - conn->errstr = NULL; - conn->lasterrcode = 0; - conn->lasterrstr = NULL; + mongo_clear_errors( conn ); } /* Determine whether this BSON object is valid for the given operation. */ -static int mongo_bson_valid( mongo *conn, bson *bson, int write ) { +static int mongo_bson_valid( mongo *conn, const bson *bson, int write ) { + int size; + + size = bson_size( bson ); + if( size > conn->max_bson_size ) { + conn->err = MONGO_BSON_TOO_LARGE; + return MONGO_ERROR; + } + if( ! bson->finished ) { conn->err = MONGO_BSON_NOT_FINISHED; return MONGO_ERROR; @@ -486,20 +715,21 @@ static int mongo_bson_valid( mongo *conn, bson *bson, int write ) { } conn->err = 0; - conn->errstr = NULL; return MONGO_OK; } /* Determine whether this BSON object is valid for the given operation. */ -static int mongo_cursor_bson_valid( mongo_cursor *cursor, bson *bson ) { +static int mongo_cursor_bson_valid( mongo_cursor *cursor, const bson *bson ) { if( ! bson->finished ) { - cursor->err = MONGO_BSON_NOT_FINISHED; + cursor->err = MONGO_CURSOR_BSON_ERROR; + cursor->conn->err = MONGO_BSON_NOT_FINISHED; return MONGO_ERROR; } if( bson->err & BSON_NOT_UTF8 ) { - cursor->err = MONGO_BSON_INVALID; + cursor->err = MONGO_CURSOR_BSON_ERROR; + cursor->conn->err = MONGO_BSON_INVALID; return MONGO_ERROR; } @@ -508,13 +738,17 @@ static int mongo_cursor_bson_valid( mongo_cursor *cursor, bson *bson ) { /* MongoDB CRUD API */ -int mongo_insert_batch( mongo *conn, const char *ns, - bson **bsons, int count ) { +MONGO_EXPORT int mongo_insert_batch( mongo *conn, const char *ns, + const bson **bsons, int count ) { - int size = 16 + 4 + strlen( ns ) + 1; - int i; mongo_message *mm; + int i; char *data; + int overhead = 16 + 4 + strlen( ns ) + 1; + int size = overhead; + + if( mongo_validate_ns( conn, ns ) != MONGO_OK ) + return MONGO_ERROR; for( i=0; i conn->max_bson_size ) { + conn->err = MONGO_BSON_TOO_LARGE; + return MONGO_ERROR; + } + mm = mongo_message_create( size , 0 , 0 , MONGO_OP_INSERT ); data = &mm->data; @@ -535,11 +774,14 @@ int mongo_insert_batch( mongo *conn, const char *ns, return mongo_message_send( conn, mm ); } -int mongo_insert( mongo *conn , const char *ns , bson *bson ) { +MONGO_EXPORT int mongo_insert( mongo *conn , const char *ns , const bson *bson ) { char *data; mongo_message *mm; + if( mongo_validate_ns( conn, ns ) != MONGO_OK ) + return MONGO_ERROR; + /* Make sure that BSON is valid for insert. */ if( mongo_bson_valid( conn, bson, 1 ) != MONGO_OK ) { return MONGO_ERROR; @@ -559,7 +801,7 @@ int mongo_insert( mongo *conn , const char *ns , bson *bson ) { return mongo_message_send( conn, mm ); } -int mongo_update( mongo *conn, const char *ns, const bson *cond, +MONGO_EXPORT int mongo_update( mongo *conn, const char *ns, const bson *cond, const bson *op, int flags ) { char *data; @@ -590,14 +832,9 @@ int mongo_update( mongo *conn, const char *ns, const bson *cond, return mongo_message_send( conn, mm ); } -int mongo_remove( mongo *conn, const char *ns, const bson *cond ) { +MONGO_EXPORT int mongo_remove( mongo *conn, const char *ns, const bson *cond ) { char *data; - mongo_message *mm = mongo_message_create( 16 /* header */ - + 4 /* ZERO */ - + strlen( ns ) + 1 - + 4 /* ZERO */ - + bson_size( cond ) - , 0 , 0 , MONGO_OP_DELETE ); + mongo_message *mm; /* Make sure that the BSON is valid UTF-8. * TODO: decide whether to check cond as well. @@ -606,6 +843,13 @@ int mongo_remove( mongo *conn, const char *ns, const bson *cond ) { return MONGO_ERROR; } + mm = mongo_message_create( 16 /* header */ + + 4 /* ZERO */ + + strlen( ns ) + 1 + + 4 /* ZERO */ + + bson_size( cond ) + , 0 , 0 , MONGO_OP_DELETE ); + data = &mm->data; data = mongo_data_append32( data, &ZERO ); data = mongo_data_append( data, ns, strlen( ns ) + 1 ); @@ -621,6 +865,11 @@ static int mongo_cursor_op_query( mongo_cursor *cursor ) { bson empty; char *data; mongo_message *mm; + bson temp; + bson_iterator it; + + /* Clear any errors. */ + mongo_clear_errors( cursor->conn ); /* Set up default values for query and fields, if necessary. */ if( ! cursor->query ) @@ -662,6 +911,15 @@ static int mongo_cursor_op_query( mongo_cursor *cursor ) { return MONGO_ERROR; } + if( cursor->reply->fields.num == 1 ) { + bson_init_data( &temp, &cursor->reply->objs ); + if( bson_find( &it, &temp, "$err" ) ) { + mongo_set_last_error( cursor->conn, &it, &temp ); + cursor->err = MONGO_CURSOR_QUERY_FAIL; + return MONGO_ERROR; + } + } + cursor->seen += cursor->reply->fields.num; cursor->flags |= MONGO_CURSOR_QUERY_SENT; return MONGO_OK; @@ -719,8 +977,8 @@ static int mongo_cursor_get_more( mongo_cursor *cursor ) { } } -mongo_cursor *mongo_find( mongo *conn, const char *ns, bson *query, - bson *fields, int limit, int skip, int options ) { +MONGO_EXPORT mongo_cursor *mongo_find( mongo *conn, const char *ns, const bson *query, + const bson *fields, int limit, int skip, int options ) { mongo_cursor *cursor = ( mongo_cursor * )bson_malloc( sizeof( mongo_cursor ) ); mongo_cursor_init( cursor, conn, ns ); @@ -740,13 +998,20 @@ mongo_cursor *mongo_find( mongo *conn, const char *ns, bson *query, } } -int mongo_find_one( mongo *conn, const char *ns, bson *query, - bson *fields, bson *out ) { +MONGO_EXPORT int mongo_find_one( mongo *conn, const char *ns, const bson *query, + const bson *fields, bson *out ) { - mongo_cursor *cursor = mongo_find( conn, ns, query, fields, 1, 0, 0 ); + mongo_cursor cursor[1]; + mongo_cursor_init( cursor, conn, ns ); + mongo_cursor_set_query( cursor, query ); + mongo_cursor_set_fields( cursor, fields ); + mongo_cursor_set_limit( cursor, 1 ); - if ( cursor && mongo_cursor_next( cursor ) == MONGO_OK ) { - bson_copy_basic( out, &cursor->current ); + if ( mongo_cursor_next( cursor ) == MONGO_OK ) { + bson_init_size( out, bson_size( (bson *)&cursor->current ) ); + memcpy( out->data, cursor->current.data, + bson_size( (bson *)&cursor->current ) ); + out->finished = 1; mongo_cursor_destroy( cursor ); return MONGO_OK; } else { @@ -755,56 +1020,49 @@ int mongo_find_one( mongo *conn, const char *ns, bson *query, } } -void mongo_cursor_init( mongo_cursor *cursor, mongo *conn, const char *ns ) { +MONGO_EXPORT void mongo_cursor_init( mongo_cursor *cursor, mongo *conn, const char *ns ) { + memset( cursor, 0, sizeof( mongo_cursor ) ); cursor->conn = conn; cursor->ns = ( const char * )bson_malloc( strlen( ns ) + 1 ); strncpy( ( char * )cursor->ns, ns, strlen( ns ) + 1 ); cursor->current.data = NULL; - cursor->reply = NULL; - cursor->flags = 0; - cursor->seen = 0; - cursor->err = 0; - cursor->options = 0; - cursor->query = NULL; - cursor->fields = NULL; - cursor->skip = 0; - cursor->limit = 0; } -void mongo_cursor_set_query( mongo_cursor *cursor, bson *query ) { +MONGO_EXPORT void mongo_cursor_set_query( mongo_cursor *cursor, const bson *query ) { cursor->query = query; } -void mongo_cursor_set_fields( mongo_cursor *cursor, bson *fields ) { +MONGO_EXPORT void mongo_cursor_set_fields( mongo_cursor *cursor, const bson *fields ) { cursor->fields = fields; } -void mongo_cursor_set_skip( mongo_cursor *cursor, int skip ) { +MONGO_EXPORT void mongo_cursor_set_skip( mongo_cursor *cursor, int skip ) { cursor->skip = skip; } -void mongo_cursor_set_limit( mongo_cursor *cursor, int limit ) { +MONGO_EXPORT void mongo_cursor_set_limit( mongo_cursor *cursor, int limit ) { cursor->limit = limit; } -void mongo_cursor_set_options( mongo_cursor *cursor, int options ) { +MONGO_EXPORT void mongo_cursor_set_options( mongo_cursor *cursor, int options ) { cursor->options = options; } -const char *mongo_cursor_data( mongo_cursor *cursor ) { +MONGO_EXPORT const char *mongo_cursor_data( mongo_cursor *cursor ) { return cursor->current.data; } -const bson *mongo_cursor_bson( mongo_cursor *cursor ) { +MONGO_EXPORT const bson *mongo_cursor_bson( mongo_cursor *cursor ) { return (const bson *)&(cursor->current); } -int mongo_cursor_next( mongo_cursor *cursor ) { +MONGO_EXPORT int mongo_cursor_next( mongo_cursor *cursor ) { char *next_object; char *message_end; if( ! ( cursor->flags & MONGO_CURSOR_QUERY_SENT ) ) - mongo_cursor_op_query( cursor ); + if( mongo_cursor_op_query( cursor ) != MONGO_OK ) + return MONGO_ERROR; if( !cursor->reply ) return MONGO_ERROR; @@ -826,7 +1084,7 @@ int mongo_cursor_next( mongo_cursor *cursor ) { /* first */ if ( cursor->current.data == NULL ) { - bson_init_data( &cursor->current, &cursor->reply->objs ); + bson_init_finished_data( &cursor->current, &cursor->reply->objs ); return MONGO_OK; } @@ -843,15 +1101,15 @@ int mongo_cursor_next( mongo_cursor *cursor ) { return MONGO_ERROR; } - bson_init_data( &cursor->current, &cursor->reply->objs ); + bson_init_finished_data( &cursor->current, &cursor->reply->objs ); } else { - bson_init_data( &cursor->current, next_object ); + bson_init_finished_data( &cursor->current, next_object ); } return MONGO_OK; } -int mongo_cursor_destroy( mongo_cursor *cursor ) { +MONGO_EXPORT int mongo_cursor_destroy( mongo_cursor *cursor ) { int result = MONGO_OK; if ( !cursor ) return result; @@ -883,7 +1141,7 @@ int mongo_cursor_destroy( mongo_cursor *cursor ) { /* MongoDB Helper Functions */ -int mongo_create_index( mongo *conn, const char *ns, bson *key, int options, bson *out ) { +MONGO_EXPORT int mongo_create_index( mongo *conn, const char *ns, const bson *key, int options, bson *out ) { bson b; bson_iterator it; char name[255] = {'_'}; @@ -933,10 +1191,10 @@ bson_bool_t mongo_create_simple_index( mongo *conn, const char *ns, const char * return success; } -int64_t mongo_count( mongo *conn, const char *db, const char *ns, bson *query ) { +MONGO_EXPORT double mongo_count( mongo *conn, const char *db, const char *ns, const bson *query ) { bson cmd; bson out = {NULL, 0}; - int64_t count = -1; + double count = -1; bson_init( &cmd ); bson_append_string( &cmd, "count", ns ); @@ -947,7 +1205,7 @@ int64_t mongo_count( mongo *conn, const char *db, const char *ns, bson *query ) if( mongo_run_command( conn, db, &cmd, &out ) == MONGO_OK ) { bson_iterator it; if( bson_find( &it, &out, "n" ) ) - count = bson_iterator_long( &it ); + count = bson_iterator_double( &it ); bson_destroy( &cmd ); bson_destroy( &out ); return count; @@ -958,38 +1216,51 @@ int64_t mongo_count( mongo *conn, const char *db, const char *ns, bson *query ) } } -int mongo_run_command( mongo *conn, const char *db, bson *command, +MONGO_EXPORT int mongo_run_command( mongo *conn, const char *db, const bson *command, bson *out ) { + bson response = {NULL, 0}; bson fields; int sl = strlen( db ); char *ns = bson_malloc( sl + 5 + 1 ); /* ".$cmd" + nul */ - int res; + int res, success = 0; strcpy( ns, db ); strcpy( ns+sl, ".$cmd" ); - res = mongo_find_one( conn, ns, command, bson_empty( &fields ), out ); + res = mongo_find_one( conn, ns, command, bson_empty( &fields ), &response ); bson_free( ns ); - return res; + + if( res != MONGO_OK ) + return MONGO_ERROR; + else { + bson_iterator it; + if( bson_find( &it, &response, "ok" ) ) + success = bson_iterator_bool( &it ); + + if( !success ) { + conn->err = MONGO_COMMAND_FAILED; + return MONGO_ERROR; + } else { + if( out ) + *out = response; + return MONGO_OK; + } + } } -int mongo_simple_int_command( mongo *conn, const char *db, +MONGO_EXPORT int mongo_simple_int_command( mongo *conn, const char *db, const char *cmdstr, int arg, bson *realout ) { bson out = {NULL, 0}; bson cmd; - bson_bool_t success = 0; + int result; bson_init( &cmd ); bson_append_int( &cmd, cmdstr, arg ); bson_finish( &cmd ); - if( mongo_run_command( conn, db, &cmd, &out ) == MONGO_OK ) { - bson_iterator it; - if( bson_find( &it, &out, "ok" ) ) - success = bson_iterator_bool( &it ); - } + result = mongo_run_command( conn, db, &cmd, &out ); bson_destroy( &cmd ); @@ -998,30 +1269,21 @@ int mongo_simple_int_command( mongo *conn, const char *db, else bson_destroy( &out ); - if( success ) - return MONGO_OK; - else { - conn->err = MONGO_COMMAND_FAILED; - return MONGO_ERROR; - } + return result; } -int mongo_simple_str_command( mongo *conn, const char *db, +MONGO_EXPORT int mongo_simple_str_command( mongo *conn, const char *db, const char *cmdstr, const char *arg, bson *realout ) { bson out = {NULL, 0}; - int success = 0; + int result; bson cmd; bson_init( &cmd ); bson_append_string( &cmd, cmdstr, arg ); bson_finish( &cmd ); - if( mongo_run_command( conn, db, &cmd, &out ) == MONGO_OK ) { - bson_iterator it; - if( bson_find( &it, &out, "ok" ) ) - success = bson_iterator_bool( &it ); - } + result = mongo_run_command( conn, db, &cmd, &out ); bson_destroy( &cmd ); @@ -1030,21 +1292,18 @@ int mongo_simple_str_command( mongo *conn, const char *db, else bson_destroy( &out ); - if( success ) - return MONGO_OK; - else - return MONGO_ERROR; + return result; } -int mongo_cmd_drop_db( mongo *conn, const char *db ) { +MONGO_EXPORT int mongo_cmd_drop_db( mongo *conn, const char *db ) { return mongo_simple_int_command( conn, db, "dropDatabase", 1, NULL ); } -int mongo_cmd_drop_collection( mongo *conn, const char *db, const char *collection, bson *out ) { +MONGO_EXPORT int mongo_cmd_drop_collection( mongo *conn, const char *db, const char *collection, bson *out ) { return mongo_simple_str_command( conn, db, "drop", collection, out ); } -void mongo_cmd_reset_error( mongo *conn, const char *db ) { +MONGO_EXPORT void mongo_cmd_reset_error( mongo *conn, const char *db ) { mongo_simple_int_command( conn, db, "reseterror", 1, NULL ); } @@ -1055,23 +1314,13 @@ static int mongo_cmd_get_error_helper( mongo *conn, const char *db, bson_bool_t haserror = 0; /* Reset last error codes. */ - conn->lasterrcode = 0; - bson_free( conn->lasterrstr ); - conn->lasterrstr = NULL; + mongo_clear_errors( conn ); /* If there's an error, store its code and string in the connection object. */ if( mongo_simple_int_command( conn, db, cmdtype, 1, &out ) == MONGO_OK ) { bson_iterator it; haserror = ( bson_find( &it, &out, "err" ) != BSON_NULL ); - if( haserror ) { - conn->lasterrstr = ( char * )bson_malloc( bson_iterator_string_len( &it ) ); - if( conn->lasterrstr ) { - strcpy( conn->lasterrstr, bson_iterator_string( &it ) ); - } - - if( bson_find( &it, &out, "code" ) != BSON_NULL ) - conn->lasterrcode = bson_iterator_int( &it ); - } + if( haserror ) mongo_set_last_error( conn, &it, &out ); } if( realout ) @@ -1085,15 +1334,15 @@ static int mongo_cmd_get_error_helper( mongo *conn, const char *db, return MONGO_OK; } -int mongo_cmd_get_prev_error( mongo *conn, const char *db, bson *out ) { +MONGO_EXPORT int mongo_cmd_get_prev_error( mongo *conn, const char *db, bson *out ) { return mongo_cmd_get_error_helper( conn, db, out, "getpreverror" ); } -int mongo_cmd_get_last_error( mongo *conn, const char *db, bson *out ) { +MONGO_EXPORT int mongo_cmd_get_last_error( mongo *conn, const char *db, bson *out ) { return mongo_cmd_get_error_helper( conn, db, out, "getlasterror" ); } -bson_bool_t mongo_cmd_ismaster( mongo *conn, bson *realout ) { +MONGO_EXPORT bson_bool_t mongo_cmd_ismaster( mongo *conn, bson *realout ) { bson out = {NULL,0}; bson_bool_t ismaster = 0; @@ -1133,7 +1382,7 @@ static void mongo_pass_digest( const char *user, const char *pass, char hex_dige digest2hex( digest, hex_digest ); } -int mongo_cmd_add_user( mongo *conn, const char *db, const char *user, const char *pass ) { +MONGO_EXPORT int mongo_cmd_add_user( mongo *conn, const char *db, const char *user, const char *pass ) { bson user_obj; bson pass_obj; char hex_digest[33]; @@ -1164,12 +1413,12 @@ int mongo_cmd_add_user( mongo *conn, const char *db, const char *user, const cha return res; } -bson_bool_t mongo_cmd_authenticate( mongo *conn, const char *db, const char *user, const char *pass ) { +MONGO_EXPORT bson_bool_t mongo_cmd_authenticate( mongo *conn, const char *db, const char *user, const char *pass ) { bson from_db; bson cmd; bson out; const char *nonce; - bson_bool_t success = 0; + int result; mongo_md5_state_t st; mongo_md5_byte_t digest[16]; @@ -1200,18 +1449,11 @@ bson_bool_t mongo_cmd_authenticate( mongo *conn, const char *db, const char *use bson_finish( &cmd ); bson_destroy( &from_db ); - /*bson_init( &from_db ); */ - if( mongo_run_command( conn, db, &cmd, &out ) == MONGO_OK ) { - bson_iterator it; - if( bson_find( &it, &out, "ok" ) ) - success = bson_iterator_bool( &it ); - } + + result = mongo_run_command( conn, db, &cmd, &out ); bson_destroy( &from_db ); bson_destroy( &cmd ); - if( success ) - return MONGO_OK; - else - return MONGO_ERROR; + return result; } diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.h index 6f86174101..dd4c4b4f40 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.h +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.h @@ -3,7 +3,7 @@ * @brief Main MongoDB Declarations */ -/* Copyright 2009-2011 10gen Inc. +/* Copyright 2009-2012 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,22 +18,26 @@ * limitations under the License. */ -#ifndef _MONGO_H_ -#define _MONGO_H_ +#ifndef MONGO_H_ +#define MONGO_H_ #include "bson.h" MONGO_EXTERN_C_START #define MONGO_MAJOR 0 -#define MONGO_MINOR 4 -#define MONGO_PATCH 0 +#define MONGO_MINOR 5 +#define MONGO_PATCH 2 #define MONGO_OK 0 #define MONGO_ERROR -1 #define MONGO_DEFAULT_PORT 27017 +#define MONGO_DEFAULT_MAX_BSON_SIZE 4 * 1024 * 1024 + +#define MONGO_ERR_LEN 128 + typedef enum mongo_error_t { MONGO_CONN_SUCCESS = 0, /**< Connection success! */ MONGO_CONN_NO_SOCKET, /**< Could not create a socket. */ @@ -43,15 +47,25 @@ typedef enum mongo_error_t { MONGO_CONN_BAD_SET_NAME, /**< Given rs name doesn't match this replica set. */ MONGO_CONN_NO_PRIMARY, /**< Can't find primary in replica set. Connection closed. */ - MONGO_IO_ERROR, /**< An error occurred while reading or writing on socket. */ + MONGO_IO_ERROR, /**< An error occurred while reading or writing on the socket. */ + MONGO_SOCKET_ERROR, /**< Other socket error. */ MONGO_READ_SIZE_ERROR, /**< The response is not the expected length. */ MONGO_COMMAND_FAILED, /**< The command returned with 'ok' value of 0. */ + MONGO_NS_INVALID, /**< The name for the ns (database or collection) is invalid. */ + MONGO_BSON_INVALID, /**< BSON not valid for the specified op. */ + MONGO_BSON_NOT_FINISHED, /**< BSON object has not been finished. */ + MONGO_BSON_TOO_LARGE /**< BSON object exceeds max BSON size. */ +} mongo_error_t; + +typedef enum mongo_cursor_error_t { MONGO_CURSOR_EXHAUSTED, /**< The cursor has no more results. */ MONGO_CURSOR_INVALID, /**< The cursor has timed out or is not recognized. */ MONGO_CURSOR_PENDING, /**< Tailable cursor still alive but no data. */ - MONGO_BSON_INVALID, /**< BSON not valid for the specified op. */ - MONGO_BSON_NOT_FINISHED /**< BSON object has not been finished. */ -} mongo_error_t; + MONGO_CURSOR_QUERY_FAIL, /**< The server returned an '$err' object, indicating query failure. + See conn->lasterrcode and conn->lasterrstr for details. */ + MONGO_CURSOR_BSON_ERROR /**< Something is wrong with the BSON provided. See conn->err + for details. */ +} mongo_cursor_error_t; enum mongo_cursor_flags { MONGO_CURSOR_MUST_FREE = 1, /**< mongo_cursor_destroy should free cursor. */ @@ -137,12 +151,14 @@ typedef struct mongo { int flags; /**< Flags on this connection object. */ int conn_timeout_ms; /**< Connection timeout in milliseconds. */ int op_timeout_ms; /**< Read and write timeout in milliseconds. */ + int max_bson_size; /**< Largest BSON object allowed on this connection. */ bson_bool_t connected; /**< Connection status. */ - mongo_error_t err; /**< Most recent driver error code. */ - char *errstr; /**< String version of most recent driver error code. */ - int lasterrcode; /**< getlasterror given by the server on calls. */ - char *lasterrstr; /**< getlasterror string generated by server. */ + mongo_error_t err; /**< Most recent driver error code. */ + int errcode; /**< Most recent errno or WSAGetLastError(). */ + char errstr[MONGO_ERR_LEN]; /**< String version of error. */ + int lasterrcode; /**< getlasterror code from the server. */ + char lasterrstr[MONGO_ERR_LEN]; /**< getlasterror string from the server. */ } mongo; typedef struct { @@ -152,9 +168,9 @@ typedef struct { int flags; /**< Flags used internally by this drivers. */ int seen; /**< Number returned so far. */ bson current; /**< This cursor's current bson object. */ - mongo_error_t err; /**< Errors on this cursor. */ - bson *query; /**< Bitfield containing cursor options. */ - bson *fields; /**< Bitfield containing cursor options. */ + mongo_cursor_error_t err; /**< Errors on this cursor. */ + const bson *query; /**< Bitfield containing cursor options. */ + const bson *fields;/**< Bitfield containing cursor options. */ int options; /**< Bitfield containing cursor options. */ int limit; /**< Bitfield containing cursor options. */ int skip; /**< Bitfield containing cursor options. */ @@ -162,9 +178,44 @@ typedef struct { /* Connection API */ -/** Initialize a new mongo connection object. If not created - * with mongo_new, you must initialize each mongo - * object using this function. +MONGO_EXPORT mongo* mongo_create(); +MONGO_EXPORT void mongo_dispose(mongo* conn); +MONGO_EXPORT int mongo_get_err(mongo* conn); +MONGO_EXPORT int mongo_is_connected(mongo* conn); +MONGO_EXPORT int mongo_get_op_timeout(mongo* conn); +MONGO_EXPORT const char* mongo_get_primary(mongo* conn); +MONGO_EXPORT int mongo_get_socket(mongo* conn) ; +MONGO_EXPORT int mongo_get_host_count(mongo* conn); +MONGO_EXPORT const char* mongo_get_host(mongo* conn, int i); +MONGO_EXPORT mongo_cursor* mongo_cursor_create(); +MONGO_EXPORT void mongo_cursor_dispose(mongo_cursor* cursor); +MONGO_EXPORT int mongo_get_server_err(mongo* conn); +MONGO_EXPORT const char* mongo_get_server_err_string(mongo* conn); + +/** + * Set an error this mongo connection object. Mostly for internal use. + * + * @param conn a mongo connection object. + * @param err a driver error code of mongo_error_t. + * @param errstr a string version of the error. + * @param errorcode Currently errno or WSAGetLastError(). + */ +MONGO_EXPORT void __mongo_set_error( mongo *conn, mongo_error_t err, + const char *errstr, int errorcode ); +/** + * Clear all errors stored on this mongo connection object. + * + * @param conn a mongo connection object. + */ +MONGO_EXPORT void mongo_clear_errors( mongo *conn ); + +/** Initialize sockets for Windows. + */ +MONGO_EXPORT void mongo_init_sockets(); + +/** + * Initialize a new mongo connection object. You must initialize each mongo + * object using this function. * * @note When finished, you must pass this object to * mongo_destroy( ). @@ -172,7 +223,7 @@ typedef struct { * @param conn a mongo connection object allocated on the stack * or heap. */ -void mongo_init( mongo *conn ); +MONGO_EXPORT void mongo_init( mongo *conn ); /** * Connect to a single MongoDB server. @@ -182,9 +233,9 @@ void mongo_init( mongo *conn ); * @param port the port to connect to. * * @return MONGO_OK or MONGO_ERROR on failure. On failure, a constant of type - * mongo_conn_return_t will be set on the conn->err field. + * mongo_error_t will be set on the conn->err field. */ -int mongo_connect( mongo *conn , const char *host, int port ); +MONGO_EXPORT int mongo_connect( mongo *conn , const char *host, int port ); /** * Set up this connection object for connecting to a replica set. @@ -193,7 +244,7 @@ int mongo_connect( mongo *conn , const char *host, int port ); * @param conn a mongo object. * @param name the name of the replica set to connect to. * */ -void mongo_replset_init( mongo *conn, const char *name ); +MONGO_EXPORT void mongo_replset_init( mongo *conn, const char *name ); /** * Add a seed node to the replica set connection object. @@ -204,7 +255,7 @@ void mongo_replset_init( mongo *conn, const char *name ); * @param host a numerical network address or a network hostname. * @param port the port to connect to. */ -void mongo_replset_add_seed( mongo *conn, const char *host, int port ); +MONGO_EXPORT void mongo_replset_add_seed( mongo *conn, const char *host, int port ); /** * Utility function for converting a host-port string to a mongo_host_port. @@ -215,6 +266,17 @@ void mongo_replset_add_seed( mongo *conn, const char *host, int port ); */ void mongo_parse_host( const char *host_string, mongo_host_port *host_port ); +/** + * Utility function for validation database and collection names. + * + * @param conn a mongo object. + * + * @return MONGO_OK or MONGO_ERROR on failure. On failure, a constant of type + * mongo_conn_return_t will be set on the conn->err field. + * + */ +MONGO_EXPORT int mongo_validate_ns( mongo *conn, const char *ns ); + /** * Connect to a replica set. * @@ -226,7 +288,7 @@ void mongo_parse_host( const char *host_string, mongo_host_port *host_port ); * @return MONGO_OK or MONGO_ERROR on failure. On failure, a constant of type * mongo_conn_return_t will be set on the conn->err field. */ -int mongo_replset_connect( mongo *conn ); +MONGO_EXPORT int mongo_replset_connect( mongo *conn ); /** Set a timeout for operations on this connection. This * is a platform-specific feature, and only work on *nix @@ -238,7 +300,7 @@ int mongo_replset_connect( mongo *conn ); * @return MONGO_OK. On error, return MONGO_ERROR and * set the conn->err field. */ -int mongo_set_op_timeout( mongo *conn, int millis ); +MONGO_EXPORT int mongo_set_op_timeout( mongo *conn, int millis ); /** * Ensure that this connection is healthy by performing @@ -248,7 +310,7 @@ int mongo_set_op_timeout( mongo *conn, int millis ); * * @return MONGO_OK if connected; otherwise, MONGO_ERROR. */ -int mongo_check_connection( mongo *conn ); +MONGO_EXPORT int mongo_check_connection( mongo *conn ); /** * Try reconnecting to the server using the existing connection settings. @@ -261,7 +323,7 @@ int mongo_check_connection( mongo *conn ); * @return MONGO_OK or MONGO_ERROR and * set the conn->err field. */ -int mongo_reconnect( mongo *conn ); +MONGO_EXPORT int mongo_reconnect( mongo *conn ); /** * Close the current connection to the server. After calling @@ -270,7 +332,7 @@ int mongo_reconnect( mongo *conn ); * * @param conn a mongo object. */ -void mongo_disconnect( mongo *conn ); +MONGO_EXPORT void mongo_disconnect( mongo *conn ); /** * Close any existing connection to the server and free all allocated @@ -280,7 +342,7 @@ void mongo_disconnect( mongo *conn ); * * @param conn a mongo object. */ -void mongo_destroy( mongo *conn ); +MONGO_EXPORT void mongo_destroy( mongo *conn ); /** * Insert a BSON document into a MongoDB server. This function @@ -295,7 +357,7 @@ void mongo_destroy( mongo *conn ); * field is MONGO_BSON_INVALID, check the err field * on the bson struct for the reason. */ -int mongo_insert( mongo *conn, const char *ns, bson *data ); +MONGO_EXPORT int mongo_insert( mongo *conn, const char *ns, const bson *data ); /** * Insert a batch of BSON documents into a MongoDB server. This function @@ -309,8 +371,8 @@ int mongo_insert( mongo *conn, const char *ns, bson *data ); * @return MONGO_OK or MONGO_ERROR. * */ -int mongo_insert_batch( mongo *conn , const char *ns , - bson **data , int num ); +MONGO_EXPORT int mongo_insert_batch( mongo *conn , const char *ns , + const bson **data , int num ); /** * Update a document in a MongoDB server. @@ -324,7 +386,7 @@ int mongo_insert_batch( mongo *conn , const char *ns , * @return MONGO_OK or MONGO_ERROR with error stored in conn object. * */ -int mongo_update( mongo *conn, const char *ns, const bson *cond, +MONGO_EXPORT int mongo_update( mongo *conn, const char *ns, const bson *cond, const bson *op, int flags ); /** @@ -336,7 +398,7 @@ int mongo_update( mongo *conn, const char *ns, const bson *cond, * * @return MONGO_OK or MONGO_ERROR with error stored in conn object. */ -int mongo_remove( mongo *conn, const char *ns, const bson *cond ); +MONGO_EXPORT int mongo_remove( mongo *conn, const char *ns, const bson *cond ); /** * Find documents in a MongoDB server. @@ -353,8 +415,8 @@ int mongo_remove( mongo *conn, const char *ns, const bson *cond ); * an error has occurred. For finer-grained error checking, * use the cursor builder API instead. */ -mongo_cursor *mongo_find( mongo *conn, const char *ns, bson *query, - bson *fields, int limit, int skip, int options ); +MONGO_EXPORT mongo_cursor *mongo_find( mongo *conn, const char *ns, const bson *query, + const bson *fields, int limit, int skip, int options ); /** * Initalize a new cursor object. @@ -363,7 +425,7 @@ mongo_cursor *mongo_find( mongo *conn, const char *ns, bson *query, * @param ns the namespace, represented as the the database * name and collection name separated by a dot. e.g., "test.users" */ -void mongo_cursor_init( mongo_cursor *cursor, mongo *conn, const char *ns ); +MONGO_EXPORT void mongo_cursor_init( mongo_cursor *cursor, mongo *conn, const char *ns ); /** * Set the bson object specifying this cursor's query spec. If @@ -376,7 +438,7 @@ void mongo_cursor_init( mongo_cursor *cursor, mongo *conn, const char *ns ); * $query, $orderby, $hint, and/or $explain. See * http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol for details. */ -void mongo_cursor_set_query( mongo_cursor *cursor, bson *query ); +MONGO_EXPORT void mongo_cursor_set_query( mongo_cursor *cursor, const bson *query ); /** * Set the fields to return for this cursor. If you want to return @@ -386,7 +448,7 @@ void mongo_cursor_set_query( mongo_cursor *cursor, bson *query ); * @param fields a bson object representing the fields to return. * See http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields. */ -void mongo_cursor_set_fields( mongo_cursor *cursor, bson *fields ); +MONGO_EXPORT void mongo_cursor_set_fields( mongo_cursor *cursor, const bson *fields ); /** * Set the number of documents to skip. @@ -394,7 +456,7 @@ void mongo_cursor_set_fields( mongo_cursor *cursor, bson *fields ); * @param cursor * @param skip */ -void mongo_cursor_set_skip( mongo_cursor *cursor, int skip ); +MONGO_EXPORT void mongo_cursor_set_skip( mongo_cursor *cursor, int skip ); /** * Set the number of documents to return. @@ -402,7 +464,7 @@ void mongo_cursor_set_skip( mongo_cursor *cursor, int skip ); * @param cursor * @param limit */ -void mongo_cursor_set_limit( mongo_cursor *cursor, int limit ); +MONGO_EXPORT void mongo_cursor_set_limit( mongo_cursor *cursor, int limit ); /** * Set any of the available query options (e.g., MONGO_TAILABLE). @@ -411,7 +473,7 @@ void mongo_cursor_set_limit( mongo_cursor *cursor, int limit ); * @param options a bitfield storing query options. See * mongo_cursor_bitfield_t for available constants. */ -void mongo_cursor_set_options( mongo_cursor *cursor, int options ); +MONGO_EXPORT void mongo_cursor_set_options( mongo_cursor *cursor, int options ); /** * Return the current BSON object data as a const char*. This is useful @@ -419,7 +481,7 @@ void mongo_cursor_set_options( mongo_cursor *cursor, int options ); * * @param cursor */ -const char *mongo_cursor_data( mongo_cursor *cursor ); +MONGO_EXPORT const char *mongo_cursor_data( mongo_cursor *cursor ); /** * Return the current BSON object data as a const char*. This is useful @@ -427,7 +489,7 @@ const char *mongo_cursor_data( mongo_cursor *cursor ); * * @param cursor */ -const bson *mongo_cursor_bson( mongo_cursor *cursor ); +MONGO_EXPORT const bson *mongo_cursor_bson( mongo_cursor *cursor ); /** * Iterate the cursor, returning the next item. When successful, @@ -438,7 +500,7 @@ const bson *mongo_cursor_bson( mongo_cursor *cursor ); * @return MONGO_OK. On error, returns MONGO_ERROR and sets * cursor->err with a value of mongo_error_t. */ -int mongo_cursor_next( mongo_cursor *cursor ); +MONGO_EXPORT int mongo_cursor_next( mongo_cursor *cursor ); /** * Destroy a cursor object. When finished with a cursor, you @@ -449,7 +511,7 @@ int mongo_cursor_next( mongo_cursor *cursor ); * @return MONGO_OK or an error code. On error, check cursor->conn->err * for errors. */ -int mongo_cursor_destroy( mongo_cursor *cursor ); +MONGO_EXPORT int mongo_cursor_destroy( mongo_cursor *cursor ); /** * Find a single document in a MongoDB server. @@ -462,8 +524,8 @@ int mongo_cursor_destroy( mongo_cursor *cursor ); * */ /* out can be NULL if you don't care about results. useful for commands */ -bson_bool_t mongo_find_one( mongo *conn, const char *ns, bson *query, - bson *fields, bson *out ); +MONGO_EXPORT int mongo_find_one( mongo *conn, const char *ns, const bson *query, + const bson *fields, bson *out ); /* MongoDB Helper Functions */ @@ -478,8 +540,8 @@ bson_bool_t mongo_find_one( mongo *conn, const char *ns, bson *query, * @return the number of matching documents. If the command fails, * MONGO_ERROR is returned. */ -int64_t mongo_count( mongo *conn, const char *db, const char *coll, - bson *query ); +MONGO_EXPORT double mongo_count( mongo *conn, const char *db, const char *coll, + const bson *query ); /** * Create a compouned index. @@ -494,7 +556,7 @@ int64_t mongo_count( mongo *conn, const char *db, const char *coll, * * @return MONGO_OK if index is created successfully; otherwise, MONGO_ERROR. */ -int mongo_create_index( mongo *conn, const char *ns, bson *key, int options, bson *out ); +MONGO_EXPORT int mongo_create_index( mongo *conn, const char *ns, const bson *key, int options, bson *out ); /** * Create an index with a single key. @@ -521,9 +583,9 @@ bson_bool_t mongo_create_simple_index( mongo *conn, const char *ns, const char * * @param command the BSON command to run. * @param out the BSON result of the command. * - * @return true if the command ran without error. + * @return MONGO_OK if the command ran without error. */ -bson_bool_t mongo_run_command( mongo *conn, const char *db, bson *command, bson *out ); +MONGO_EXPORT int mongo_run_command( mongo *conn, const char *db, const bson *command, bson *out ); /** * Run a command that accepts a simple string key and integer value. @@ -537,7 +599,7 @@ bson_bool_t mongo_run_command( mongo *conn, const char *db, bson *command, bson * @return MONGO_OK or an error code. * */ -int mongo_simple_int_command( mongo *conn, const char *db, +MONGO_EXPORT int mongo_simple_int_command( mongo *conn, const char *db, const char *cmd, int arg, bson *out ); /** @@ -552,7 +614,7 @@ int mongo_simple_int_command( mongo *conn, const char *db, * @return true if the command ran without error. * */ -bson_bool_t mongo_simple_str_command( mongo *conn, const char *db, const char *cmd, const char *arg, bson *out ); +MONGO_EXPORT int mongo_simple_str_command( mongo *conn, const char *db, const char *cmd, const char *arg, bson *out ); /** * Drop a database. @@ -562,7 +624,7 @@ bson_bool_t mongo_simple_str_command( mongo *conn, const char *db, const char *c * * @return MONGO_OK or an error code. */ -int mongo_cmd_drop_db( mongo *conn, const char *db ); +MONGO_EXPORT int mongo_cmd_drop_db( mongo *conn, const char *db ); /** * Drop a collection. @@ -574,7 +636,7 @@ int mongo_cmd_drop_db( mongo *conn, const char *db ); * * @return true if the collection drop was successful. */ -bson_bool_t mongo_cmd_drop_collection( mongo *conn, const char *db, const char *collection, bson *out ); +MONGO_EXPORT int mongo_cmd_drop_collection( mongo *conn, const char *db, const char *collection, bson *out ); /** * Add a database user. @@ -586,7 +648,7 @@ bson_bool_t mongo_cmd_drop_collection( mongo *conn, const char *db, const char * * * @return MONGO_OK or MONGO_ERROR. */ -int mongo_cmd_add_user( mongo *conn, const char *db, const char *user, const char *pass ); +MONGO_EXPORT int mongo_cmd_add_user( mongo *conn, const char *db, const char *user, const char *pass ); /** * Authenticate a user. @@ -598,7 +660,7 @@ int mongo_cmd_add_user( mongo *conn, const char *db, const char *user, const cha * * @return MONGO_OK on sucess and MONGO_ERROR on failure. */ -int mongo_cmd_authenticate( mongo *conn, const char *db, const char *user, const char *pass ); +MONGO_EXPORT int mongo_cmd_authenticate( mongo *conn, const char *db, const char *user, const char *pass ); /** * Check if the current server is a master. @@ -609,7 +671,7 @@ int mongo_cmd_authenticate( mongo *conn, const char *db, const char *user, const * @return true if the server is a master. */ /* return value is master status */ -bson_bool_t mongo_cmd_ismaster( mongo *conn, bson *out ); +MONGO_EXPORT bson_bool_t mongo_cmd_ismaster( mongo *conn, bson *out ); /** * Get the error for the last command with the current connection. @@ -621,7 +683,7 @@ bson_bool_t mongo_cmd_ismaster( mongo *conn, bson *out ); * @return MONGO_OK if no error and MONGO_ERROR on error. On error, check the values * of conn->lasterrcode and conn->lasterrstr for the error status. */ -int mongo_cmd_get_last_error( mongo *conn, const char *db, bson *out ); +MONGO_EXPORT int mongo_cmd_get_last_error( mongo *conn, const char *db, bson *out ); /** * Get the most recent error with the current connection. @@ -633,7 +695,7 @@ int mongo_cmd_get_last_error( mongo *conn, const char *db, bson *out ); * @return MONGO_OK if no error and MONGO_ERROR on error. On error, check the values * of conn->lasterrcode and conn->lasterrstr for the error status. */ -int mongo_cmd_get_prev_error( mongo *conn, const char *db, bson *out ); +MONGO_EXPORT int mongo_cmd_get_prev_error( mongo *conn, const char *db, bson *out ); /** * Reset the error state for the connection. @@ -641,7 +703,8 @@ int mongo_cmd_get_prev_error( mongo *conn, const char *db, bson *out ); * @param conn a mongo object. * @param db the name of the database. */ -void mongo_cmd_reset_error( mongo *conn, const char *db ); +MONGO_EXPORT void mongo_cmd_reset_error( mongo *conn, const char *db ); + MONGO_EXTERN_C_END diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/net.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/net.c deleted file mode 100644 index 5c8ad9ba5e..0000000000 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/net.c +++ /dev/null @@ -1,98 +0,0 @@ -/* net.c */ - -/* Copyright 2009-2011 10gen Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Implementation for generic version of net.h */ -#include "net.h" -#include - -int mongo_write_socket( mongo *conn, const void *buf, int len ) { - const char *cbuf = buf; - while ( len ) { - int sent = send( conn->sock, cbuf, len, 0 ); - if ( sent == -1 ) { - conn->err = MONGO_IO_ERROR; - return MONGO_ERROR; - } - cbuf += sent; - len -= sent; - } - - return MONGO_OK; -} - -int mongo_read_socket( mongo *conn, void *buf, int len ) { - char *cbuf = buf; - while ( len ) { - int sent = recv( conn->sock, cbuf, len, 0 ); - if ( sent == 0 || sent == -1 ) { - conn->err = MONGO_IO_ERROR; - return MONGO_ERROR; - } - cbuf += sent; - len -= sent; - } - - return MONGO_OK; -} - -/* This is a no-op in the generic implementation. */ -int mongo_set_socket_op_timeout( mongo *conn, int millis ) { - return MONGO_OK; -} - -static int mongo_create_socket( mongo *conn ) { - int fd; - - if( ( fd = socket( AF_INET, SOCK_STREAM, 0 ) ) == -1 ) { - conn->err = MONGO_CONN_NO_SOCKET; - return MONGO_ERROR; - } - conn->sock = fd; - - return MONGO_OK; -} - -int mongo_socket_connect( mongo *conn, const char *host, int port ) { - struct sockaddr_in sa; - socklen_t addressSize; - int flag = 1; - - if( mongo_create_socket( conn ) != MONGO_OK ) - return MONGO_ERROR; - - memset( sa.sin_zero , 0 , sizeof( sa.sin_zero ) ); - sa.sin_family = AF_INET; - sa.sin_port = htons( port ); - sa.sin_addr.s_addr = inet_addr( host ); - addressSize = sizeof( sa ); - - if ( connect( conn->sock, ( struct sockaddr * )&sa, addressSize ) == -1 ) { - mongo_close_socket( conn->sock ); - conn->connected = 0; - conn->sock = 0; - conn->err = MONGO_CONN_FAIL; - return MONGO_ERROR; - } - - setsockopt( conn->sock, IPPROTO_TCP, TCP_NODELAY, ( char * ) &flag, sizeof( flag ) ); - if( conn->op_timeout_ms > 0 ) - mongo_set_socket_op_timeout( conn, conn->op_timeout_ms ); - - conn->connected = 1; - - return MONGO_OK; -} diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/net.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/net.h deleted file mode 100644 index 49190877c8..0000000000 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/net.h +++ /dev/null @@ -1,57 +0,0 @@ -/** @file net.h */ - -/* Copyright 2009-2011 10gen Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Header for generic net.h */ -#ifndef _MONGO_NET_H_ -#define _MONGO_NET_H_ - -#include "mongo.h" - -#ifdef _WIN32 -#include -#include -#define mongo_close_socket(sock) ( closesocket(sock) ) -typedef int socklen_t; -#else -#include -#include -#include -#include -#include -#include -#include -#define mongo_close_socket(sock) ( close(sock) ) -#endif - -#ifndef _WIN32 -#include -#endif - -#if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1 -#define _MONGO_USE_GETADDRINFO -#endif - -MONGO_EXTERN_C_START - -/* This is a no-op in the generic implementation. */ -int mongo_set_socket_op_timeout( mongo *conn, int millis ); -int mongo_read_socket( mongo *conn, void *buf, int len ); -int mongo_write_socket( mongo *conn, const void *buf, int len ); -int mongo_socket_connect( mongo *conn, const char *host, int port ); - -MONGO_EXTERN_C_END -#endif diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/numbers.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/numbers.c index a63e3d73f9..b3032d5ee3 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/numbers.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/numbers.c @@ -1,4 +1,4 @@ -/* Copyright 2009-2011 10gen Inc. +/* Copyright 2009-2012 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform.h deleted file mode 100644 index 4a96af77e3..0000000000 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform.h +++ /dev/null @@ -1,94 +0,0 @@ -/** @file platform.h */ - -/** Copyright 2009-2011 10gen Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/* all platform-specific ifdefs should go here */ - -#ifndef _PLATFORM_HACKS_H_ -#define _PLATFORM_HACKS_H_ - -#ifdef __GNUC__ -#define MONGO_INLINE static __inline__ -#else -#define MONGO_INLINE static -#endif - -#ifdef __cplusplus -#define MONGO_EXTERN_C_START extern "C" { -#define MONGO_EXTERN_C_END } -#else -#define MONGO_EXTERN_C_START -#define MONGO_EXTERN_C_END -#endif - - -#if defined(MONGO_HAVE_STDINT) || __STDC_VERSION__ >= 199901L -#include -#elif defined(MONGO_HAVE_UNISTD) -#include -#elif defined(MONGO_USE__INT64) -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#elif defined(MONGO_USE_LONG_LONG_INT) -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#else -#error must have a 64bit int type -#endif - -/* big endian is only used for OID generation. little is used everywhere else */ -#ifdef MONGO_BIG_ENDIAN -#define bson_little_endian64(out, in) ( bson_swap_endian64(out, in) ) -#define bson_little_endian32(out, in) ( bson_swap_endian32(out, in) ) -#define bson_big_endian64(out, in) ( memcpy(out, in, 8) ) -#define bson_big_endian32(out, in) ( memcpy(out, in, 4) ) -#else -#define bson_little_endian64(out, in) ( memcpy(out, in, 8) ) -#define bson_little_endian32(out, in) ( memcpy(out, in, 4) ) -#define bson_big_endian64(out, in) ( bson_swap_endian64(out, in) ) -#define bson_big_endian32(out, in) ( bson_swap_endian32(out, in) ) -#endif - -MONGO_EXTERN_C_START - -MONGO_INLINE void bson_swap_endian64( void *outp, const void *inp ) { - const char *in = ( const char * )inp; - char *out = ( char * )outp; - - out[0] = in[7]; - out[1] = in[6]; - out[2] = in[5]; - out[3] = in[4]; - out[4] = in[3]; - out[5] = in[2]; - out[6] = in[1]; - out[7] = in[0]; - -} -MONGO_INLINE void bson_swap_endian32( void *outp, const void *inp ) { - const char *in = ( const char * )inp; - char *out = ( char * )outp; - - out[0] = in[3]; - out[1] = in[2]; - out[2] = in[1]; - out[3] = in[0]; -} - -MONGO_EXTERN_C_END - -#endif diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform/linux/net.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform/linux/net.c deleted file mode 100644 index b2f7c22898..0000000000 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform/linux/net.c +++ /dev/null @@ -1,183 +0,0 @@ -/* net.c */ - -/* Copyright 2009-2011 10gen Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Implementation for Linux version of net.h */ -#include "net.h" -#include - -int mongo_write_socket( mongo *conn, const void *buf, int len ) { - const char *cbuf = buf; - while ( len ) { - int sent = send( conn->sock, cbuf, len, 0 ); - if ( sent == -1 ) { - conn->err = MONGO_IO_ERROR; - return MONGO_ERROR; - } - cbuf += sent; - len -= sent; - } - - return MONGO_OK; -} - -int mongo_read_socket( mongo *conn, void *buf, int len ) { - char *cbuf = buf; - while ( len ) { - int sent = recv( conn->sock, cbuf, len, 0 ); - if ( sent == 0 || sent == -1 ) { - conn->err = MONGO_IO_ERROR; - return MONGO_ERROR; - } - cbuf += sent; - len -= sent; - } - - return MONGO_OK; -} - -static int mongo_create_socket( mongo *conn ) { - int fd; - - if( ( fd = socket( AF_INET, SOCK_STREAM, 0 ) ) == -1 ) { - conn->err = MONGO_CONN_NO_SOCKET; - return MONGO_ERROR; - } - conn->sock = fd; - - return MONGO_OK; -} - -static int mongo_set_blocking_status( mongo *conn ) { - int flags; - int blocking; - - blocking = ( conn->conn_timeout_ms == 0 ); - if( blocking ) - return MONGO_OK; - else { - if( ( flags = fcntl( conn->sock, F_GETFL ) ) == -1 ) { - conn->err = MONGO_IO_ERROR; - mongo_close_socket( conn->sock ); - return MONGO_ERROR; - } - - flags |= O_NONBLOCK; - - if( ( flags = fcntl( conn->sock, F_SETFL, flags ) ) == -1 ) { - conn->err = MONGO_IO_ERROR; - mongo_close_socket( conn->sock ); - return MONGO_ERROR; - } - } - - return MONGO_OK; -} - -int mongo_set_socket_op_timeout( mongo *conn, int millis ) { - struct timeval tv; - tv.tv_sec = millis / 1000; - tv.tv_usec = ( millis % 1000 ) * 1000; - - if ( setsockopt( conn->sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof( tv ) ) == -1 ) { - conn->err = MONGO_IO_ERROR; - return MONGO_ERROR; - } - - if ( setsockopt( conn->sock, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof( tv ) ) == -1 ) { - conn->err = MONGO_IO_ERROR; - return MONGO_ERROR; - } - - return MONGO_OK; -} - -#ifdef _MONGO_USE_GETADDRINFO -int mongo_socket_connect( mongo *conn, const char *host, int port ) { - - struct addrinfo *addrs = NULL; - struct addrinfo hints; - int flag = 1; - char port_str[12]; - int ret; - - conn->sock = 0; - conn->connected = 0; - - memset( &hints, 0, sizeof( hints ) ); - hints.ai_family = AF_INET; - hints.ai_socktype = SOCK_STREAM; - - sprintf( port_str, "%d", port ); - - if( mongo_create_socket( conn ) != MONGO_OK ) - return MONGO_ERROR; - - if( getaddrinfo( host, port_str, &hints, &addrs ) != 0 ) { - bson_errprintf( "getaddrinfo failed: %s", gai_strerror( ret ) ); - conn->err = MONGO_CONN_ADDR_FAIL; - return MONGO_ERROR; - } - - if ( connect( conn->sock, addrs->ai_addr, addrs->ai_addrlen ) == -1 ) { - mongo_close_socket( conn->sock ); - freeaddrinfo( addrs ); - conn->err = MONGO_CONN_FAIL; - return MONGO_ERROR; - } - - setsockopt( conn->sock, IPPROTO_TCP, TCP_NODELAY, ( char * )&flag, sizeof( flag ) ); - if( conn->op_timeout_ms > 0 ) - mongo_set_socket_op_timeout( conn, conn->op_timeout_ms ); - - conn->connected = 1; - freeaddrinfo( addrs ); - - return MONGO_OK; -} -#else -int mongo_socket_connect( mongo *conn, const char *host, int port ) { - struct sockaddr_in sa; - socklen_t addressSize; - int flag = 1; - - if( mongo_create_socket( conn ) != MONGO_OK ) - return MONGO_ERROR; - - memset( sa.sin_zero , 0 , sizeof( sa.sin_zero ) ); - sa.sin_family = AF_INET; - sa.sin_port = htons( port ); - sa.sin_addr.s_addr = inet_addr( host ); - addressSize = sizeof( sa ); - - if ( connect( conn->sock, ( struct sockaddr * )&sa, addressSize ) == -1 ) { - mongo_close_socket( conn->sock ); - conn->connected = 0; - conn->sock = 0; - conn->err = MONGO_CONN_FAIL; - return MONGO_ERROR; - } - - setsockopt( conn->sock, IPPROTO_TCP, TCP_NODELAY, ( char * ) &flag, sizeof( flag ) ); - - if( conn->op_timeout_ms > 0 ) - mongo_set_socket_op_timeout( conn, conn->op_timeout_ms ); - - conn->connected = 1; - - return MONGO_OK; -} -#endif diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform/linux/net.h b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform/linux/net.h deleted file mode 100644 index 054247c1e8..0000000000 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/platform/linux/net.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file net.h - * @brief Networking. - */ - -/* Copyright 2009-2011 10gen Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Header for Linux net.h */ -#ifndef _MONGO_NET_H_ -#define _MONGO_NET_H_ - -#include "mongo.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define mongo_close_socket(sock) ( close(sock) ) - -#if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1 -#define _MONGO_USE_GETADDRINFO -#endif - -MONGO_EXTERN_C_START - -int mongo_set_socket_op_timeout( mongo *conn, int millis ); -int mongo_read_socket( mongo *conn, void *buf, int len ); -int mongo_write_socket( mongo *conn, const void *buf, int len ); -int mongo_socket_connect( mongo *conn, const char *host, int port ); - -MONGO_EXTERN_C_END -#endif diff --git a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c index d721bed8a5..4c8aded61c 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -124,11 +124,16 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) /* Channel variables */ bson_append_start_object(&cdr, "variables"); - for (hi = switch_channel_variable_first(channel); hi; hi = hi->next) { - if (!zstr(hi->name) && !zstr(hi->value)) { - bson_append_string(&cdr, hi->name, hi->value); + + if ((hi = switch_channel_variable_first(channel))) { + for (; hi; hi = hi->next) { + if (!zstr(hi->name) && !zstr(hi->value)) { + bson_append_string(&cdr, hi->name, hi->value); + } } + switch_channel_variable_last(channel); } + bson_append_finish_object(&cdr); /* variables */ diff --git a/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c index 7f2a7e8b3c..9ad6b8a442 100644 --- a/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c +++ b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c index 73fe4109e7..f4e3f6c10e 100644 --- a/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c +++ b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c index aaa0cb6b85..0206f37718 100644 --- a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c +++ b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_erlang_event/handle_msg.c b/src/mod/event_handlers/mod_erlang_event/handle_msg.c index 2f45ea6203..46e9e67e85 100644 --- a/src/mod/event_handlers/mod_erlang_event/handle_msg.c +++ b/src/mod/event_handlers/mod_erlang_event/handle_msg.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c index 15a60f447a..12cf01a650 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -314,8 +314,6 @@ static void destroy_session_elem(session_elem_t *session_element) switch_channel_clear_flag(switch_core_session_get_channel(session), CF_CONTROLLED); switch_core_session_rwunlock(session); } - /* this allows the application threads to exit */ - switch_clear_flag_locked(session_element, LFLAG_SESSION_ALIVE); switch_core_destroy_memory_pool(&session_element->pool); /*switch_safe_free(s); */ } @@ -821,7 +819,7 @@ static void listener_main_loop(listener_t *listener) /* do we need the mutex when reading? */ /*switch_mutex_lock(listener->sock_mutex); */ - status = ei_xreceive_msg_tmo(listener->sockfd, &msg, &buf, 100); + status = ei_xreceive_msg_tmo(listener->sockfd, &msg, &buf, 10); /*switch_mutex_unlock(listener->sock_mutex); */ switch (status) { @@ -1285,7 +1283,6 @@ session_elem_t *attach_call_to_registered_process(listener_t *listener, char *re session_element->process.type = ERLANG_REG_PROCESS; session_element->process.reg_name = switch_core_session_strdup(session, reg_name); - switch_set_flag(session_element, LFLAG_SESSION_ALIVE); /* attach the session to the listener */ add_session_elem_to_listener(listener, session_element); @@ -1299,7 +1296,6 @@ session_elem_t *attach_call_to_pid(listener_t *listener, erlang_pid * pid, switc session_element->process.type = ERLANG_PID; memcpy(&session_element->process.pid, pid, sizeof(erlang_pid)); - switch_set_flag(session_element, LFLAG_SESSION_ALIVE); /* attach the session to the listener */ add_session_elem_to_listener(listener, session_element); ei_link(listener, ei_self(listener->ec), pid); @@ -1381,7 +1377,6 @@ session_elem_t *attach_call_to_spawned_process(listener_t *listener, char *modul memcpy(&session_element->process.pid, p->pid, sizeof(erlang_pid)); session_element->spawn_reply = NULL; - switch_set_flag(session_element, LFLAG_SESSION_ALIVE); switch_clear_flag(session_element, LFLAG_OUTBOUND_INIT); switch_clear_flag(session_element, LFLAG_WAITING_FOR_PID); @@ -1416,8 +1411,7 @@ SWITCH_STANDARD_APP(erlang_outbound_function) char *reg_name = NULL, *node, *module = NULL, *function = NULL; listener_t *listener; int argc = 0, argc2 = 0; - char *argv[80] = { 0 }, *argv2[80] = { - 0}; + char *argv[80] = { 0 }, *argv2[80] = { 0 }; char *mydata, *myarg; char uuid[SWITCH_UUID_FORMATTED_LENGTH + 1]; switch_bool_t new_session = SWITCH_FALSE; @@ -1487,19 +1481,9 @@ SWITCH_STANDARD_APP(erlang_outbound_function) } if (session_element) { - switch_ivr_park(session, NULL); - - /* keep app thread running for lifetime of session */ - if (switch_channel_down(switch_core_session_get_channel(session))) { - if ((session_element = switch_channel_get_private(switch_core_session_get_channel(session), "_erlang_session_"))) { - switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "outbound session all done\n"); - switch_clear_flag_locked(session_element, LFLAG_SESSION_ALIVE); - } else { - switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "outbound session already done\n"); - } - } } + } switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "exit erlang_outbound_function\n"); } @@ -1822,6 +1806,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_erlang_event_runtime) if ((clientfd = ei_accept_tmo(&ec, (int) listen_list.sockfd, &conn, 500)) == ERL_ERROR) { if (prefs.done) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Shutting Down\n"); + break; } else if (erl_errno == ETIMEDOUT) { continue; #ifdef WIN32 @@ -1835,9 +1820,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_erlang_event_runtime) /* if errno didn't get set, assume nothing *too* horrible occured */ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Ignorable error in ei_accept - probable bad client version, bad cookie or bad nodename\n"); - continue; } - break; + continue; } listener = new_listener(&ec, clientfd); diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h index 121e7b4f95..1721d496fb 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -35,8 +35,7 @@ typedef enum { LFLAG_WAITING_FOR_PID = (1 << 0), /* waiting for a node to return a pid */ LFLAG_OUTBOUND_INIT = (1 << 1), /* Erlang peer has been notified of this session */ - LFLAG_SESSION_ALIVE = (1 << 2), - LFLAG_SESSION_COMPLETE = (1 << 3), + LFLAG_SESSION_COMPLETE = (1 << 2), } session_flag_t; typedef enum { diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c index f0635275f6..88dd4f4c82 100644 --- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c +++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index e90d174966..d71a6fa70e 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1344,7 +1344,8 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event, } } - if (switch_test_flag(listener, LFLAG_HANDLE_DISCO) && switch_epoch_time_now(NULL) > listener->linger_timeout) { + if (switch_test_flag(listener, LFLAG_HANDLE_DISCO) && + listener->linger_timeout != (time_t) -1 && switch_epoch_time_now(NULL) > listener->linger_timeout) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(listener->session), SWITCH_LOG_DEBUG, "linger timeout, closing socket\n"); status = SWITCH_STATUS_FALSE; break; @@ -1353,21 +1354,26 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event, if (channel && switch_channel_down(channel) && !switch_test_flag(listener, LFLAG_HANDLE_DISCO)) { switch_set_flag_locked(listener, LFLAG_HANDLE_DISCO); if (switch_test_flag(listener, LFLAG_LINGER)) { - char message[128] = ""; char disco_buf[512] = ""; - - switch_snprintf(message, sizeof(message), - "Channel %s has disconnected, lingering by request from remote.\n", switch_channel_get_name(channel)); - mlen = strlen(message); - + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(listener->session), SWITCH_LOG_DEBUG, "%s Socket Linger %d\n", + switch_channel_get_name(channel), (int)listener->linger_timeout); + switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\n" "Controlled-Session-UUID: %s\n" - "Content-Disposition: linger\n" "Content-Length: %d\n\n", switch_core_session_get_uuid(listener->session), (int) mlen); + "Content-Disposition: linger\n" + "Channel-Name: %s\n" + "Linger-Time: %d\n" + "Content-Length: 0\n\n", + switch_core_session_get_uuid(listener->session), switch_channel_get_name(channel), (int)listener->linger_timeout); + + if (listener->linger_timeout != (time_t) -1) { + listener->linger_timeout += switch_epoch_time_now(NULL); + } + len = strlen(disco_buf); switch_socket_send(listener->sock, disco_buf, &len); - len = mlen; - switch_socket_send(listener->sock, message, &len); } else { status = SWITCH_STATUS_FALSE; break; @@ -2267,15 +2273,20 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even } } else if (!strncasecmp(cmd, "linger", 6)) { if (listener->session) { - uint32_t linger_time = 600; /* sounds reasonable? */ + time_t linger_time = 600; /* sounds reasonable? */ if (*(cmd+6) == ' ' && *(cmd+7)) { /*how long do you want to linger?*/ - linger_time = (uint32_t)atoi(cmd+7); + linger_time = (time_t) atoi(cmd+7); + } else { + linger_time = (time_t) -1; } - /*do we need a mutex to update linger_timeout ?*/ - listener->linger_timeout = switch_epoch_time_now(NULL) + linger_time; + listener->linger_timeout = linger_time; switch_set_flag_locked(listener, LFLAG_LINGER); - switch_snprintf(reply, reply_len, "+OK will linger %d seconds", linger_time); + if (listener->linger_timeout != (time_t) -1) { + switch_snprintf(reply, reply_len, "+OK will linger %d seconds", linger_time); + } else { + switch_snprintf(reply, reply_len, "+OK will linger"); + } } else { switch_snprintf(reply, reply_len, "-ERR not controlling a session"); } diff --git a/src/mod/event_handlers/mod_event_test/mod_event_test.c b/src/mod/event_handlers/mod_event_test/mod_event_test.c index d960b08ec5..49c411983f 100644 --- a/src/mod/event_handlers/mod_event_test/mod_event_test.c +++ b/src/mod/event_handlers/mod_event_test/mod_event_test.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_json_cdr/Makefile b/src/mod/event_handlers/mod_json_cdr/Makefile index 0620c7df63..c9dfa5399e 100644 --- a/src/mod/event_handlers/mod_json_cdr/Makefile +++ b/src/mod/event_handlers/mod_json_cdr/Makefile @@ -1,27 +1,4 @@ -json-c=json-c-0.9 BASE=../../../.. - -JSON_DIR=$(switch_srcdir)/libs/$(json-c) -JSON_BUILDDIR=$(switch_builddir)/libs/$(json-c) - -JSONLA=$(JSON_BUILDDIR)/libjson.la - -LOCAL_CFLAGS=-I$(JSON_DIR) -LOCAL_LIBADD=$(JSONLA) - include $(BASE)/build/modmake.rules -$(JSON_DIR): - $(GETLIB) $(json-c).tar.gz - -$(JSON_BUILDDIR)/Makefile: $(JSON_DIR) - mkdir -p $(JSON_BUILDDIR) - cd $(JSON_BUILDDIR) && $(DEFAULT_VARS) $(JSON_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(JSON_DIR) CPPFLAGS= LDFLAGS= - $(TOUCH_TARGET) - -$(JSONLA): $(JSON_BUILDDIR)/Makefile - cd $(JSON_BUILDDIR) && $(MAKE) - $(TOUCH_TARGET) - - diff --git a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c index aad224655c..36626461a5 100644 --- a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c +++ b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -33,7 +33,6 @@ #include #include #include -#include #define MAX_URLS 20 #define MAX_ERR_DIRS 20 @@ -181,431 +180,11 @@ static switch_status_t set_json_cdr_log_dirs() return status; } -#define JSON_ENSURE_SUCCESS(obj) if (is_error(obj)) { return; } -static void set_json_profile_data(struct json_object *json, switch_caller_profile_t *caller_profile) -{ - struct json_object *param = NULL; - - param = json_object_new_string((char *)caller_profile->username); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "username", param); - - param = json_object_new_string((char *)caller_profile->dialplan); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "dialplan", param); - - param = json_object_new_string((char *)caller_profile->caller_id_name); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "caller_id_name", param); - - param = json_object_new_string((char *)caller_profile->ani); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "ani", param); - - param = json_object_new_string((char *)caller_profile->aniii); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "aniii", param); - - param = json_object_new_string((char *)caller_profile->caller_id_number); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "caller_id_number", param); - - param = json_object_new_string((char *)caller_profile->network_addr); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "network_addr", param); - - param = json_object_new_string((char *)caller_profile->rdnis); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "rdnis", param); - - param = json_object_new_string(caller_profile->destination_number); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "destination_number", param); - - param = json_object_new_string(caller_profile->uuid); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "uuid", param); - - param = json_object_new_string((char *)caller_profile->source); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "source", param); - - param = json_object_new_string((char *)caller_profile->context); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "context", param); - - param = json_object_new_string(caller_profile->chan_name); - JSON_ENSURE_SUCCESS(param); - json_object_object_add(json, "chan_name", param); - -} - -static void set_json_chan_vars(struct json_object *json, switch_channel_t *channel) -{ - struct json_object *variable = NULL; - switch_event_header_t *hi = switch_channel_variable_first(channel); - - if (!hi) - return; - - for (; hi; hi = hi->next) { - if (!zstr(hi->name) && !zstr(hi->value)) { - char *data = hi->value; - if (globals.encode_values == ENCODING_DEFAULT) { - switch_size_t dlen = strlen(hi->value) * 3; - - if ((data = malloc(dlen))) { - memset(data, 0, dlen); - switch_url_encode(hi->value, data, dlen); - } - } - - variable = json_object_new_string(data); - if (!is_error(variable)) { - json_object_object_add(json, hi->name, variable); - } - - if (data != hi->value) { - switch_safe_free(data); - } - } - } - switch_channel_variable_last(channel); -} - - - -static switch_status_t generate_json_cdr(switch_core_session_t *session, struct json_object **json_cdr) -{ - - struct json_object *cdr = json_object_new_object(); - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_caller_profile_t *caller_profile; - struct json_object *variables, *j_main_cp, *j_caller_profile, *j_caller_extension, *j_times, *time_tag, - *j_application, *j_callflow, *j_inner_extension, *j_apps, *j_o, *j_channel_data, *j_field; - switch_app_log_t *app_log; - char tmp[512], *f; - - if (is_error(cdr)) { - return SWITCH_STATUS_FALSE; - } - - j_channel_data = json_object_new_object(); - if (is_error(j_channel_data)) { - goto error; - } - json_object_object_add(cdr, "channel_data", j_channel_data); - - - j_field = json_object_new_string((char *) switch_channel_state_name(switch_channel_get_state(channel))); - json_object_object_add(j_channel_data, "state", j_field); - - j_field = json_object_new_string(switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound"); - - json_object_object_add(j_channel_data, "direction", j_field); - - - switch_snprintf(tmp, sizeof(tmp), "%d", switch_channel_get_state(channel)); - j_field = json_object_new_string((char *) tmp); - json_object_object_add(j_channel_data, "state_number", j_field); - - - if ((f = switch_channel_get_flag_string(channel))) { - j_field = json_object_new_string((char *) f); - json_object_object_add(j_channel_data, "flags", j_field); - free(f); - } - - if ((f = switch_channel_get_cap_string(channel))) { - j_field = json_object_new_string((char *) f); - json_object_object_add(j_channel_data, "caps", j_field); - free(f); - } - - - variables = json_object_new_object(); - json_object_object_add(cdr, "variables", variables); - - if (is_error(variables)) { - goto error; - } - - set_json_chan_vars(variables, channel); - - - if ((app_log = switch_core_session_get_app_log(session))) { - switch_app_log_t *ap; - - j_apps = json_object_new_object(); - - if (is_error(j_apps)) { - goto error; - } - - json_object_object_add(cdr, "app_log", j_apps); - - for (ap = app_log; ap; ap = ap->next) { - j_application = json_object_new_object(); - - if (is_error(j_application)) { - goto error; - } - - json_object_object_add(j_application, "app_name", json_object_new_string(ap->app)); - json_object_object_add(j_application, "app_data", json_object_new_string(ap->arg ? ap->arg : "")); - - json_object_object_add(j_apps, "application", j_application); - } - } - - - caller_profile = switch_channel_get_caller_profile(channel); - - while (caller_profile) { - - j_callflow = json_object_new_object(); - - if (is_error(j_callflow)) { - goto error; - } - - json_object_object_add(cdr, "callflow", j_callflow); - - if (!zstr(caller_profile->dialplan)) { - json_object_object_add(j_callflow, "dialplan", json_object_new_string((char *)caller_profile->dialplan)); - } - - if (!zstr(caller_profile->profile_index)) { - json_object_object_add(j_callflow, "profile_index", json_object_new_string((char *)caller_profile->profile_index)); - } - - if (caller_profile->caller_extension) { - switch_caller_application_t *ap; - - j_caller_extension = json_object_new_object(); - - if (is_error(j_caller_extension)) { - goto error; - } - - json_object_object_add(j_callflow, "extension", j_caller_extension); - - json_object_object_add(j_caller_extension, "name", json_object_new_string(caller_profile->caller_extension->extension_name)); - json_object_object_add(j_caller_extension, "number", json_object_new_string(caller_profile->caller_extension->extension_number)); - - if (caller_profile->caller_extension->current_application) { - json_object_object_add(j_caller_extension, "current_app", json_object_new_string(caller_profile->caller_extension->current_application->application_name)); - } - - for (ap = caller_profile->caller_extension->applications; ap; ap = ap->next) { - j_application = json_object_new_object(); - - if (is_error(j_application)) { - goto error; - } - - - json_object_object_add(j_caller_extension, "application", j_application); - - if (ap == caller_profile->caller_extension->current_application) { - json_object_object_add(j_application, "last_executed", json_object_new_string("true")); - } - json_object_object_add(j_application, "app_name", json_object_new_string(ap->application_name)); - json_object_object_add(j_application, "app_data", json_object_new_string(switch_str_nil(ap->application_data))); - } - - if (caller_profile->caller_extension->children) { - switch_caller_profile_t *cp = NULL; - for (cp = caller_profile->caller_extension->children; cp; cp = cp->next) { - - if (!cp->caller_extension) { - continue; - } - - j_inner_extension = json_object_new_object(); - if (is_error(j_inner_extension)) { - goto error; - } - - json_object_object_add(j_caller_extension, "sub_extensions", j_inner_extension); - - - j_caller_extension = json_object_new_object(); - if (is_error(j_caller_extension)) { - goto error; - } - - json_object_object_add(j_inner_extension, "extension", j_caller_extension); - - json_object_object_add(j_caller_extension, "name", json_object_new_string(cp->caller_extension->extension_name)); - json_object_object_add(j_caller_extension, "number", json_object_new_string(cp->caller_extension->extension_number)); - - json_object_object_add(j_caller_extension, "dialplan", json_object_new_string((char *)cp->dialplan)); - - if (cp->caller_extension->current_application) { - json_object_object_add(j_caller_extension, "current_app", json_object_new_string(cp->caller_extension->current_application->application_name)); - } - - for (ap = cp->caller_extension->applications; ap; ap = ap->next) { - j_application = json_object_new_object(); - - if (is_error(j_application)) { - goto error; - } - json_object_object_add(j_caller_extension, "application", j_application); - - if (ap == cp->caller_extension->current_application) { - json_object_object_add(j_application, "last_executed", json_object_new_string("true")); - } - json_object_object_add(j_application, "app_name", json_object_new_string(ap->application_name)); - json_object_object_add(j_application, "app_data", json_object_new_string(switch_str_nil(ap->application_data))); - } - } - } - } - - j_main_cp = json_object_new_object(); - if (is_error(j_main_cp)) { - goto error; - } - - json_object_object_add(j_callflow, "caller_profile", j_main_cp); - - set_json_profile_data(j_main_cp, caller_profile); - - if (caller_profile->originator_caller_profile) { - switch_caller_profile_t *cp = NULL; - - j_o = json_object_new_object(); - if (is_error(j_o)) { - goto error; - } - - json_object_object_add(j_main_cp, "originator", j_o); - - for (cp = caller_profile->originator_caller_profile; cp; cp = cp->next) { - j_caller_profile = json_object_new_object(); - if (is_error(j_caller_profile)) { - goto error; - } - - json_object_object_add(j_o, "originator_caller_profile", j_caller_profile); - - set_json_profile_data(j_caller_profile, cp); - } - } - - if (caller_profile->originatee_caller_profile) { - switch_caller_profile_t *cp = NULL; - - j_o = json_object_new_object(); - if (is_error(j_o)) { - goto error; - } - - json_object_object_add(j_main_cp, "originatee", j_o); - - for (cp = caller_profile->originatee_caller_profile; cp; cp = cp->next) { - - j_caller_profile = json_object_new_object(); - if (is_error(j_caller_profile)) { - goto error; - } - - json_object_object_add(j_o, "originatee_caller_profile", j_caller_profile); - set_json_profile_data(j_caller_profile, cp); - } - } - - if (caller_profile->times) { - - j_times = json_object_new_object(); - if (is_error(j_times)) { - goto error; - } - - json_object_object_add(j_callflow, "times", j_times); - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->created); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "created_time", time_tag); - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->profile_created); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "profile_created_time", time_tag); - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->progress); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "progress_time", time_tag); - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->progress_media); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "progress_media_time", time_tag); - - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->answered); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "answered_time", time_tag); - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "hangup_time", time_tag); - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->resurrected); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "resurrect_time", time_tag); - - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->transferred); - time_tag = json_object_new_string(tmp); - if (is_error(time_tag)) { - goto error; - } - json_object_object_add(j_times, "transfer_time", time_tag); - - } - - caller_profile = caller_profile->next; - } - - *json_cdr = cdr; - - return SWITCH_STATUS_SUCCESS; - - error: - - if (cdr) { - json_object_put(cdr); - } - - return SWITCH_STATUS_FALSE; -} - static switch_status_t my_on_reporting(switch_core_session_t *session) { - struct json_object *json_cdr = NULL; - const char *json_text = NULL; + cJSON *json_cdr = NULL; + char *json_text = NULL; char *path = NULL; char *curl_json_text = NULL; const char *logdir = NULL; @@ -636,12 +215,12 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) a_prefix = "a_"; - if (generate_json_cdr(session, &json_cdr) != SWITCH_STATUS_SUCCESS) { + if (switch_ivr_generate_json_cdr(session, &json_cdr, globals.encode_values == ENCODING_DEFAULT) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Generating Data!\n"); return SWITCH_STATUS_FALSE; } - json_text = json_object_to_json_string(json_cdr); + json_text = cJSON_PrintUnformatted(json_cdr); if (!json_text) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n"); @@ -704,6 +283,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) switch_b64_encode((unsigned char *) json_text, need_bytes / 3, (unsigned char *) json_text_escaped, need_bytes); } + switch_safe_free(json_text); json_text = json_text_escaped; if (!(curl_json_text = switch_mprintf("cdr=%s", json_text))) { @@ -860,8 +440,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) switch_safe_free(curl_json_text); } - json_object_put(json_cdr); - switch_safe_free(json_text_escaped); + cJSON_Delete(json_cdr); + switch_safe_free(json_text); return status; } diff --git a/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c b/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c index d42914d061..77a0438cca 100644 --- a/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c +++ b/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -213,7 +213,7 @@ static switch_status_t my_on_routing(switch_core_session_t *session) } */ - if ((signal_bond = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && !zstr(signal_bond)) { + if ((signal_bond = switch_channel_get_partner_uuid(channel)) && !zstr(signal_bond)) { if (rc_avpair_add(rad_config, &send, PW_FS_OTHER_LEG_ID, (void*) signal_bond, -1, PW_FS_PEC) == NULL) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[mod_radius_cdr] Failed adding Freeswitch-Other-Leg-Id: %s\n", uuid_str); rc_destroy(rad_config); diff --git a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB index 68d83fe433..3cf8b2718f 100644 --- a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB +++ b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB @@ -1,6 +1,6 @@ -- FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application --- Copyright (C) 2005-2011, Anthony Minessale II +-- Copyright (C) 2005-2012, Anthony Minessale II -- -- Version: MPL 1.1 -- diff --git a/src/mod/event_handlers/mod_snmp/mod_snmp.c b/src/mod/event_handlers/mod_snmp/mod_snmp.c index 059646bc19..b068627de2 100644 --- a/src/mod/event_handlers/mod_snmp/mod_snmp.c +++ b/src/mod/event_handlers/mod_snmp/mod_snmp.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c index 69f135d6bd..ae0132b9a3 100644 --- a/src/mod/event_handlers/mod_snmp/subagent.c +++ b/src/mod/event_handlers/mod_snmp/subagent.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/event_handlers/mod_snmp/subagent.h b/src/mod/event_handlers/mod_snmp/subagent.h index ba3c523d49..45519a844a 100644 --- a/src/mod/event_handlers/mod_snmp/subagent.h +++ b/src/mod/event_handlers/mod_snmp/subagent.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/formats/mod_local_stream/mod_local_stream.c b/src/mod/formats/mod_local_stream/mod_local_stream.c index 4f36e20128..8402b2bfcb 100644 --- a/src/mod/formats/mod_local_stream/mod_local_stream.c +++ b/src/mod/formats/mod_local_stream/mod_local_stream.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -94,14 +94,10 @@ struct local_stream_source { typedef struct local_stream_source local_stream_source_t; -static unsigned int S = 0; - static int do_rand(void) { double r; int index; - unsigned int seed = ++S + getpid(); - srand(seed); r = ((double) rand() / ((double) (RAND_MAX) + (double) (1))); index = (int) (r * 9) + 1; return index; @@ -756,10 +752,11 @@ SWITCH_STANDARD_API(start_local_stream_function) switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; char *mycmd = NULL, *argv[8] = { 0 }; - char *local_stream_name = NULL, *path = NULL, *timer_name = NULL; + char *local_stream_name = NULL, *path = NULL, *timer_name = NULL, *chime_list = NULL, *list_dup = NULL; uint32_t prebuf = 1; - int rate = 8000, interval = 20; + int rate = 8000, shuffle = 1, interval = 20, chime_freq = 30; uint8_t channels = 1; + uint32_t chime_max = 0; int argc = 0; char *cf = "local_stream.conf"; switch_xml_t cfg, xml, directory, param; @@ -790,7 +787,7 @@ SWITCH_STANDARD_API(start_local_stream_function) } } - //shuffle = argv[3] ? switch_true(argv[3]) : 1; + shuffle = argv[3] ? switch_true(argv[3]) : 1; prebuf = argv[4] ? atoi(argv[4]) : DEFAULT_PREBUFFER_SIZE; if (argv[5]) { @@ -833,8 +830,8 @@ SWITCH_STANDARD_API(start_local_stream_function) if (tmp == 8000 || tmp == 16000 || tmp == 32000) { rate = tmp; } - //} else if (!strcasecmp(var, "shuffle")) { - //shuffle = switch_true(val); + } else if (!strcasecmp(var, "shuffle")) { + shuffle = switch_true(val); } else if (!strcasecmp(var, "prebuf")) { tmp = atoi(val); if (tmp > 0) { @@ -855,6 +852,18 @@ SWITCH_STANDARD_API(start_local_stream_function) } } else if (!strcasecmp(var, "timer-name")) { timer_name = strdup(val); + } else if (!strcasecmp(var, "chime-freq")) { + tmp = atoi(val); + if (tmp > 1) { + chime_freq = (uint32_t) tmp; + } + } else if (!strcasecmp(var, "chime-max")) { + tmp = atoi(val); + if (tmp > 1) { + chime_max = (uint32_t) tmp; + } + } else if (!strcasecmp(var, "chime-list")) { + chime_list = val; } } break; @@ -877,7 +886,7 @@ SWITCH_STANDARD_API(start_local_stream_function) switch_mutex_unlock(globals.mutex); if (source) { source->stopped = 0; - stream->write_function(stream, "+OK"); + stream->write_function(stream, "+OK stream: %s[%s] %s", source->name, source->location, source->shuffle ? "shuffle" : "no shuffle"); goto done; } @@ -897,9 +906,19 @@ SWITCH_STANDARD_API(start_local_stream_function) source->interval = interval; source->channels = channels; source->timer_name = switch_core_strdup(source->pool, timer_name ? timer_name : (argv[7] ? argv[7] : "soft")); + list_dup = switch_core_strdup(source->pool, chime_list); + source->chime_total = switch_separate_string(list_dup, ',', source->chime_list, (sizeof(source->chime_list) / sizeof(source->chime_list[0]))); + if (source->chime_total) { + source->chime_freq = chime_freq; + + if (chime_max) { + source->chime_max = chime_max * source->rate; + } + } + source->chime_counter = source->rate * source->chime_freq; source->prebuf = prebuf; source->stopped = 0; - + source->shuffle = shuffle; source->samples = switch_samples_per_packet(source->rate, source->interval); switch_mutex_init(&source->mutex, SWITCH_MUTEX_NESTED, source->pool); @@ -909,7 +928,7 @@ SWITCH_STANDARD_API(start_local_stream_function) switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_thread_create(&thread, thd_attr, read_stream_thread, source, source->pool); - stream->write_function(stream, "+OK"); + stream->write_function(stream, "+OK stream: %s[%s] %s", source->name, source->location, source->shuffle ? "shuffle" : "no shuffle"); goto done; usage: diff --git a/src/mod/formats/mod_native_file/mod_native_file.c b/src/mod/formats/mod_native_file/mod_native_file.c index d28b8dcf3a..4193987025 100644 --- a/src/mod/formats/mod_native_file/mod_native_file.c +++ b/src/mod/formats/mod_native_file/mod_native_file.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c b/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c index b7e49e9e24..5f360bb504 100644 --- a/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c +++ b/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/formats/mod_shell_stream/mod_shell_stream.c b/src/mod/formats/mod_shell_stream/mod_shell_stream.c index 11b5b10241..38969c84f6 100644 --- a/src/mod/formats/mod_shell_stream/mod_shell_stream.c +++ b/src/mod/formats/mod_shell_stream/mod_shell_stream.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c index e3c3764429..5cc7c08186 100644 --- a/src/mod/formats/mod_shout/mod_shout.c +++ b/src/mod/formats/mod_shout/mod_shout.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.c b/src/mod/formats/mod_sndfile/mod_sndfile.c index b7e4dbfd6b..42d2a71a71 100644 --- a/src/mod/formats/mod_sndfile/mod_sndfile.c +++ b/src/mod/formats/mod_sndfile/mod_sndfile.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/formats/mod_tone_stream/mod_tone_stream.c b/src/mod/formats/mod_tone_stream/mod_tone_stream.c index f02dc31cab..45f3ee65fd 100644 --- a/src/mod/formats/mod_tone_stream/mod_tone_stream.c +++ b/src/mod/formats/mod_tone_stream/mod_tone_stream.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/formats/mod_vlc/mod_vlc.c b/src/mod/formats/mod_vlc/mod_vlc.c index 990cef1409..15dd6c1d95 100644 --- a/src/mod/formats/mod_vlc/mod_vlc.c +++ b/src/mod/formats/mod_vlc/mod_vlc.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -123,6 +123,11 @@ static switch_status_t vlc_file_open(switch_file_handle_t *handle, const char *p context->m = libvlc_media_new_location(read_inst, context->path); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "VLC Path is unknown type %s\n", context->path); } + + if ( context->m == NULL ) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VLC error opening %s for reading\n", path); + return SWITCH_STATUS_GENERR; + } context->playing = 0; context->err = 0; diff --git a/src/mod/languages/mod_lua/mod_lua.cpp b/src/mod/languages/mod_lua/mod_lua.cpp index 1a2814a801..adb13a43dd 100644 --- a/src/mod/languages/mod_lua/mod_lua.cpp +++ b/src/mod/languages/mod_lua/mod_lua.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -122,7 +122,7 @@ static lua_State *lua_init(void) luaopen_freeswitch(L); lua_gc(L, LUA_GCRESTART, 0); lua_atpanic(L, panic); - error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 1, 0); + error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 0, 0); } return L; } @@ -141,10 +141,10 @@ static int lua_parse_and_execute(lua_State * L, char *input_code) if (*input_code == '~') { char *buff = input_code + 1; - error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 1, 0); //lua_pcall(L, 0, 0, 0); + error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 0, 0); //lua_pcall(L, 0, 0, 0); } else if (!strncasecmp(input_code, "#!/lua", 6)) { char *buff = input_code + 6; - error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 1, 0); //lua_pcall(L, 0, 0, 0); + error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 0, 0); //lua_pcall(L, 0, 0, 0); } else { char *args = strchr(input_code, ' '); if (args) { @@ -168,14 +168,14 @@ static int lua_parse_and_execute(lua_State * L, char *input_code) } if (code) { - error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 1, 0); + error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 0, 0); switch_safe_free(code); } } else { // Force empty argv table char *code = NULL; code = switch_mprintf("argv = {[0]='%s'};", input_code); - error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 1, 0); + error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 0, 0); switch_safe_free(code); } @@ -187,7 +187,7 @@ static int lua_parse_and_execute(lua_State * L, char *input_code) switch_assert(fdup); file = fdup; } - error = luaL_loadfile(L, file) || docall(L, 0, 1, 0); + error = luaL_loadfile(L, file) || docall(L, 0, 0, 0); switch_safe_free(fdup); } } diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index d25bcff52d..a11d584f49 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -1050,6 +1050,16 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_READ_RESULT_VARIABLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ATT_XFER_RESULT_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("att_xfer_result"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -1060,6 +1070,16 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_JSON_CDR_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("copy_json_cdr"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -1400,6 +1420,16 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_PROXY_MEDIA_VARIABLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ZRTP_PASSTHRU_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("zrtp_passthru"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -1520,6 +1550,16 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_SIGNAL_BOND_VARIABLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("originate_signal_bond"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ORIGINATOR_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -6425,6 +6465,54 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_disable_heartbeat(void * } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_pop(void * jarg1, char * jarg2, void * jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + switch_media_bug_t **arg3 = (switch_media_bug_t **) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_media_bug_t **)jarg3; + result = (switch_status_t)switch_core_media_bug_pop(arg1,(char const *)arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_exec_all(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + switch_media_bug_exec_cb_t arg3 = (switch_media_bug_exec_cb_t) 0 ; + void *arg4 = (void *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_media_bug_exec_cb_t)jarg3; + arg4 = (void *)jarg4; + result = (switch_status_t)switch_core_media_bug_exec_all(arg1,(char const *)arg2,arg3,arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_media_bug_count(void * jarg1, char * jarg2) { + unsigned long jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + uint32_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + result = (uint32_t)switch_core_media_bug_count(arg1,(char const *)arg2); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_add(void * jarg1, char * jarg2, char * jarg3, void * jarg4, void * jarg5, void * jarg6, unsigned long jarg7, void * jarg8) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -6531,6 +6619,16 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_media_bug_get_read_replace_fram } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_media_bug_set_read_demux_frame(void * jarg1, void * jarg2) { + switch_media_bug_t *arg1 = (switch_media_bug_t *) 0 ; + switch_frame_t *arg2 = (switch_frame_t *) 0 ; + + arg1 = (switch_media_bug_t *)jarg1; + arg2 = (switch_frame_t *)jarg2; + switch_core_media_bug_set_read_demux_frame(arg1,arg2); +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_media_bug_get_session(void * jarg1) { void * jresult ; switch_media_bug_t *arg1 = (switch_media_bug_t *) 0 ; @@ -6595,6 +6693,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_media_bug_set_read_replace_frame( } +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_cpu_count() { + unsigned long jresult ; + uint32_t result; + + result = (uint32_t)switch_core_cpu_count(); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_remove(void * jarg1, void * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -6647,13 +6755,15 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_close(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_remove_all(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_remove_all_function(void * jarg1, char * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; switch_status_t result; arg1 = (switch_core_session_t *)jarg1; - result = (switch_status_t)switch_core_media_bug_remove_all(arg1); + arg2 = (char *)jarg2; + result = (switch_status_t)switch_core_media_bug_remove_all_function(arg1,(char const *)arg2); jresult = result; return jresult; } @@ -8986,6 +9096,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_read_impl(void * jarg1 } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_real_read_impl(void * jarg1, void * jarg2) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + switch_codec_implementation_t *arg2 = (switch_codec_implementation_t *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (switch_codec_implementation_t *)jarg2; + result = (switch_status_t)switch_core_session_get_real_read_impl(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_write_impl(void * jarg1, void * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -10994,7 +11118,7 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_default_ptime(char * jarg1, u } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_add_registration(char * jarg1, char * jarg2, char * jarg3, char * jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_add_registration(char * jarg1, char * jarg2, char * jarg3, char * jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9) { int jresult ; char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; @@ -11004,6 +11128,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_add_registration(char * jarg1, cha char *arg6 = (char *) 0 ; char *arg7 = (char *) 0 ; char *arg8 = (char *) 0 ; + char *arg9 = (char *) 0 ; switch_status_t result; arg1 = (char *)jarg1; @@ -11014,7 +11139,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_add_registration(char * jarg1, cha arg6 = (char *)jarg6; arg7 = (char *)jarg7; arg8 = (char *)jarg8; - result = (switch_status_t)switch_core_add_registration((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8); + arg9 = (char *)jarg9; + result = (switch_status_t)switch_core_add_registration((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9); jresult = result; return jresult; } @@ -11141,6 +11267,23 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_close_extra_files(void * jarg1, int ja } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_thread_set_cpu_affinity(int jarg1) { + int jresult ; + int arg1 ; + switch_status_t result; + + arg1 = (int)jarg1; + result = (switch_status_t)switch_core_thread_set_cpu_affinity(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_os_yield() { + switch_os_yield(); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_set(void * jarg1, char * jarg2) { switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; char *arg2 = (char *) 0 ; @@ -11625,6 +11768,24 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_codec_interface( } +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_parse_codec_buf(char * jarg1, void * jarg2, void * jarg3, void * jarg4) { + char * jresult ; + char *arg1 = (char *) 0 ; + uint32_t *arg2 = (uint32_t *) 0 ; + uint32_t *arg3 = (uint32_t *) 0 ; + uint32_t *arg4 = (uint32_t *) 0 ; + char *result = 0 ; + + arg1 = (char *)jarg1; + arg2 = (uint32_t *)jarg2; + arg3 = (uint32_t *)jarg3; + arg4 = (uint32_t *)jarg4; + result = (char *)switch_parse_codec_buf(arg1,arg2,arg3,arg4); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_dialplan_interface(char * jarg1) { void * jresult ; char *arg1 = (char *) 0 ; @@ -24949,6 +25110,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_perform_mark_answered(void * ja } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_check_zrtp(void * jarg1) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + + arg1 = (switch_channel_t *)jarg1; + switch_channel_check_zrtp(arg1); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_perform_ring_ready_value(void * jarg1, int jarg2, char * jarg3, char * jarg4, int jarg5) { int jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; @@ -25291,19 +25460,21 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_event_set_extended_data(void * } -SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_expand_variables_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_expand_variables_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4, unsigned long jarg5) { char * jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; char *arg2 = (char *) 0 ; switch_event_t *arg3 = (switch_event_t *) 0 ; switch_event_t *arg4 = (switch_event_t *) 0 ; + uint32_t arg5 ; char *result = 0 ; arg1 = (switch_channel_t *)jarg1; arg2 = (char *)jarg2; arg3 = (switch_event_t *)jarg3; arg4 = (switch_event_t *)jarg4; - result = (char *)switch_channel_expand_variables_check(arg1,(char const *)arg2,arg3,arg4); + arg5 = (uint32_t)jarg5; + result = (char *)switch_channel_expand_variables_check(arg1,(char const *)arg2,arg3,arg4,arg5); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } @@ -25613,6 +25784,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_transfer_to_extension(void * j } +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_get_partner_uuid(void * jarg1) { + char * jresult ; + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_channel_t *)jarg1; + result = (char *)switch_channel_get_partner_uuid(arg1); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_buffer_create(void * jarg1, void * jarg2, void * jarg3) { int jresult ; switch_memory_pool_t *arg1 = (switch_memory_pool_t *) 0 ; @@ -26881,19 +27064,21 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_set_body(void * jarg1, char * jar } -SWIGEXPORT char * SWIGSTDCALL CSharp_switch_event_expand_headers_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_event_expand_headers_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4, unsigned long jarg5) { char * jresult ; switch_event_t *arg1 = (switch_event_t *) 0 ; char *arg2 = (char *) 0 ; switch_event_t *arg3 = (switch_event_t *) 0 ; switch_event_t *arg4 = (switch_event_t *) 0 ; + uint32_t arg5 ; char *result = 0 ; arg1 = (switch_event_t *)jarg1; arg2 = (char *)jarg2; arg3 = (switch_event_t *)jarg3; arg4 = (switch_event_t *)jarg4; - result = (char *)switch_event_expand_headers_check(arg1,(char const *)arg2,arg3,arg4); + arg5 = (uint32_t)jarg5; + result = (char *)switch_event_expand_headers_check(arg1,(char const *)arg2,arg3,arg4,arg5); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } @@ -26991,6 +27176,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_check_permission_list(void * jarg } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_event_add_presence_data_cols(void * jarg1, void * jarg2, char * jarg3) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + switch_event_t *arg2 = (switch_event_t *) 0 ; + char *arg3 = (char *) 0 ; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (switch_event_t *)jarg2; + arg3 = (char *)jarg3; + switch_event_add_presence_data_cols(arg1,arg2,(char const *)arg3); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RESAMPLE_QUALITY_get() { int jresult ; int result; @@ -27381,6 +27578,24 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_merge_sln(void * jarg1, unsig } +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_unmerge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4) { + unsigned long jresult ; + int16_t *arg1 = (int16_t *) 0 ; + uint32_t arg2 ; + int16_t *arg3 = (int16_t *) 0 ; + uint32_t arg4 ; + uint32_t result; + + arg1 = (int16_t *)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (int16_t *)jarg3; + arg4 = (uint32_t)jarg4; + result = (uint32_t)switch_unmerge_sln(arg1,arg2,arg3,arg4); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_mux_channels(void * jarg1, void * jarg2, unsigned long jarg3) { int16_t *arg1 = (int16_t *) 0 ; switch_size_t arg2 ; @@ -27825,6 +28040,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_activate_unicast(void * jarg1, char } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_generate_json_cdr(void * jarg1, void * jarg2, int jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + cJSON **arg2 = (cJSON **) 0 ; + switch_bool_t arg3 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (cJSON **)jarg2; + arg3 = (switch_bool_t)jarg3; + result = (switch_status_t)switch_ivr_generate_json_cdr(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_generate_xml_cdr(void * jarg1, void * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -28235,6 +28466,52 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_pop_eavesdropper(void * jarg1, void * jarg2) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + switch_core_session_t **arg2 = (switch_core_session_t **) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (switch_core_session_t **)jarg2; + result = (switch_status_t)switch_ivr_eavesdrop_pop_eavesdropper(arg1,arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_exec_all(void * jarg1, char * jarg2, char * jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (char *)jarg3; + result = (switch_status_t)switch_ivr_eavesdrop_exec_all(arg1,(char const *)arg2,(char const *)arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_update_display(void * jarg1, char * jarg2, char * jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (char *)jarg3; + result = (switch_status_t)switch_ivr_eavesdrop_update_display(arg1,(char const *)arg2,(char const *)arg3); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_session(void * jarg1, char * jarg2, char * jarg3, unsigned long jarg4) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -29947,6 +30224,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_kill_uuid(char * jarg1, int jarg2) } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_blind_transfer_ack(void * jarg1, int jarg2) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + switch_bool_t arg2 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (switch_bool_t)jarg2; + result = (switch_status_t)switch_ivr_blind_transfer_ack(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_BUF_LEN_get() { int jresult ; int result; @@ -30456,6 +30747,14 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_break(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_flush(void * jarg1) { + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + + arg1 = (switch_rtp_t *)jarg1; + switch_rtp_flush(arg1); +} + + SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_rtp_ready(void * jarg1) { unsigned char jresult ; switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; @@ -30996,6 +31295,16 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_rtp_check_auto_adj(void * jar } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_interdigit_delay(void * jarg1, unsigned long jarg2) { + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_rtp_t *)jarg1; + arg2 = (uint32_t)jarg2; + switch_rtp_set_interdigit_delay(arg1,arg2); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_log_node_t_data_set(void * jarg1, char * jarg2) { switch_log_node_t *arg1 = (switch_log_node_t *) 0 ; char *arg2 = (char *) 0 ; @@ -31892,6 +32201,20 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_xml_toxml(void * jarg1, int jarg2) { } +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_xml_toxml_nolock(void * jarg1, int jarg2) { + char * jresult ; + switch_xml_t arg1 = (switch_xml_t) 0 ; + switch_bool_t arg2 ; + char *result = 0 ; + + arg1 = (switch_xml_t)jarg1; + arg2 = (switch_bool_t)jarg2; + result = (char *)switch_xml_toxml_nolock(arg1,arg2); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_switch_xml_toxml_buf(void * jarg1, char * jarg2, void * jarg3, void * jarg4, int jarg5) { char * jresult ; switch_xml_t arg1 = (switch_xml_t) 0 ; diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index d7bf86d2ad..33feeaee11 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -1113,6 +1113,17 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_READ_RESULT_VARIABLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ATT_XFER_RESULT_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *) "att_xfer_result"; + + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -1124,6 +1135,17 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_JSON_CDR_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *) "copy_json_cdr"; + + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -1498,6 +1520,17 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_PROXY_MEDIA_VARIABLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ZRTP_PASSTHRU_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *) "zrtp_passthru"; + + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -6732,6 +6765,54 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_disable_heartbeat(void * } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_pop(void * jarg1, char * jarg2, void * jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + switch_media_bug_t **arg3 = (switch_media_bug_t **) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_media_bug_t **)jarg3; + result = (switch_status_t)switch_core_media_bug_pop(arg1,(char const *)arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_exec_all(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + switch_media_bug_exec_cb_t arg3 = (switch_media_bug_exec_cb_t) 0 ; + void *arg4 = (void *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_media_bug_exec_cb_t)jarg3; + arg4 = (void *)jarg4; + result = (switch_status_t)switch_core_media_bug_exec_all(arg1,(char const *)arg2,arg3,arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_media_bug_count(void * jarg1, char * jarg2) { + unsigned long jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + uint32_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + result = (uint32_t)switch_core_media_bug_count(arg1,(char const *)arg2); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_add(void * jarg1, char * jarg2, char * jarg3, void * jarg4, void * jarg5, void * jarg6, unsigned long jarg7, void * jarg8) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -6838,6 +6919,16 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_media_bug_get_read_replace_fram } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_media_bug_set_read_demux_frame(void * jarg1, void * jarg2) { + switch_media_bug_t *arg1 = (switch_media_bug_t *) 0 ; + switch_frame_t *arg2 = (switch_frame_t *) 0 ; + + arg1 = (switch_media_bug_t *)jarg1; + arg2 = (switch_frame_t *)jarg2; + switch_core_media_bug_set_read_demux_frame(arg1,arg2); +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_media_bug_get_session(void * jarg1) { void * jresult ; switch_media_bug_t *arg1 = (switch_media_bug_t *) 0 ; @@ -6902,6 +6993,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_media_bug_set_read_replace_frame( } +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_cpu_count() { + unsigned long jresult ; + uint32_t result; + + result = (uint32_t)switch_core_cpu_count(); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_remove(void * jarg1, void * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -6954,13 +7055,15 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_close(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_remove_all(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_remove_all_function(void * jarg1, char * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; switch_status_t result; arg1 = (switch_core_session_t *)jarg1; - result = (switch_status_t)switch_core_media_bug_remove_all(arg1); + arg2 = (char *)jarg2; + result = (switch_status_t)switch_core_media_bug_remove_all_function(arg1,(char const *)arg2); jresult = result; return jresult; } @@ -7030,6 +7133,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_flush_all(void * jarg1) } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_media_bug_set_pre_buffer_framecount(void * jarg1, unsigned long jarg2) { + int jresult ; + switch_media_bug_t *arg1 = (switch_media_bug_t *) 0 ; + uint32_t arg2 ; + switch_status_t result; + + arg1 = (switch_media_bug_t *)jarg1; + arg2 = (uint32_t)jarg2; + result = (switch_status_t)switch_core_media_bug_set_pre_buffer_framecount(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_port_allocator_new(unsigned short jarg1, unsigned short jarg2, unsigned long jarg3, void * jarg4) { int jresult ; switch_port_t arg1 ; @@ -9279,6 +9396,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_read_impl(void * jarg1 } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_real_read_impl(void * jarg1, void * jarg2) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + switch_codec_implementation_t *arg2 = (switch_codec_implementation_t *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (switch_codec_implementation_t *)jarg2; + result = (switch_status_t)switch_core_session_get_real_read_impl(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_write_impl(void * jarg1, void * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -11443,6 +11574,23 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_close_extra_files(void * jarg1, int ja } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_thread_set_cpu_affinity(int jarg1) { + int jresult ; + int arg1 ; + switch_status_t result; + + arg1 = (int)jarg1; + result = (switch_status_t)switch_core_thread_set_cpu_affinity(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_os_yield() { + switch_os_yield(); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_set(void * jarg1, char * jarg2) { switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; char *arg2 = (char *) 0 ; @@ -11946,6 +12094,24 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_codec_interface( } +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_parse_codec_buf(char * jarg1, void * jarg2, void * jarg3, void * jarg4) { + char * jresult ; + char *arg1 = (char *) 0 ; + uint32_t *arg2 = (uint32_t *) 0 ; + uint32_t *arg3 = (uint32_t *) 0 ; + uint32_t *arg4 = (uint32_t *) 0 ; + char *result = 0 ; + + arg1 = (char *)jarg1; + arg2 = (uint32_t *)jarg2; + arg3 = (uint32_t *)jarg3; + arg4 = (uint32_t *)jarg4; + result = (char *)switch_parse_codec_buf(arg1,arg2,arg3,arg4); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_dialplan_interface(char * jarg1) { void * jresult ; char *arg1 = (char *) 0 ; @@ -25630,6 +25796,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_perform_mark_answered(void * ja } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_check_zrtp(void * jarg1) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + + arg1 = (switch_channel_t *)jarg1; + switch_channel_check_zrtp(arg1); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_perform_ring_ready_value(void * jarg1, int jarg2, char * jarg3, char * jarg4, int jarg5) { int jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; @@ -25972,19 +26146,21 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_event_set_extended_data(void * } -SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_expand_variables_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_expand_variables_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4, unsigned long jarg5) { char * jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; char *arg2 = (char *) 0 ; switch_event_t *arg3 = (switch_event_t *) 0 ; switch_event_t *arg4 = (switch_event_t *) 0 ; + uint32_t arg5 ; char *result = 0 ; arg1 = (switch_channel_t *)jarg1; arg2 = (char *)jarg2; arg3 = (switch_event_t *)jarg3; arg4 = (switch_event_t *)jarg4; - result = (char *)switch_channel_expand_variables_check(arg1,(char const *)arg2,arg3,arg4); + arg5 = (uint32_t)jarg5; + result = (char *)switch_channel_expand_variables_check(arg1,(char const *)arg2,arg3,arg4,arg5); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } @@ -27577,19 +27753,21 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_set_body(void * jarg1, char * jar } -SWIGEXPORT char * SWIGSTDCALL CSharp_switch_event_expand_headers_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_event_expand_headers_check(void * jarg1, char * jarg2, void * jarg3, void * jarg4, unsigned long jarg5) { char * jresult ; switch_event_t *arg1 = (switch_event_t *) 0 ; char *arg2 = (char *) 0 ; switch_event_t *arg3 = (switch_event_t *) 0 ; switch_event_t *arg4 = (switch_event_t *) 0 ; + uint32_t arg5 ; char *result = 0 ; arg1 = (switch_event_t *)jarg1; arg2 = (char *)jarg2; arg3 = (switch_event_t *)jarg3; arg4 = (switch_event_t *)jarg4; - result = (char *)switch_event_expand_headers_check(arg1,(char const *)arg2,arg3,arg4); + arg5 = (uint32_t)jarg5; + result = (char *)switch_event_expand_headers_check(arg1,(char const *)arg2,arg3,arg4,arg5); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } @@ -27687,6 +27865,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_check_permission_list(void * jarg } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_event_add_presence_data_cols(void * jarg1, void * jarg2, char * jarg3) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + switch_event_t *arg2 = (switch_event_t *) 0 ; + char *arg3 = (char *) 0 ; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (switch_event_t *)jarg2; + arg3 = (char *)jarg3; + switch_event_add_presence_data_cols(arg1,arg2,(char const *)arg3); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RESAMPLE_QUALITY_get() { int jresult ; int result; @@ -28087,6 +28277,24 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_merge_sln(void * jarg1, unsig } +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_unmerge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4) { + unsigned long jresult ; + int16_t *arg1 = (int16_t *) 0 ; + uint32_t arg2 ; + int16_t *arg3 = (int16_t *) 0 ; + uint32_t arg4 ; + uint32_t result; + + arg1 = (int16_t *)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (int16_t *)jarg3; + arg4 = (uint32_t)jarg4; + result = (uint32_t)switch_unmerge_sln(arg1,arg2,arg3,arg4); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_mux_channels(void * jarg1, void * jarg2, unsigned long jarg3) { int16_t *arg1 = (int16_t *) 0 ; switch_size_t arg2 ; @@ -28545,6 +28753,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_activate_unicast(void * jarg1, char } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_generate_json_cdr(void * jarg1, void * jarg2, int jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + cJSON **arg2 = (cJSON **) 0 ; + switch_bool_t arg3 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (cJSON **)jarg2; + arg3 = (switch_bool_t)jarg3; + result = (switch_status_t)switch_ivr_generate_json_cdr(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_generate_xml_cdr(void * jarg1, void * jarg2) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -28955,6 +29179,52 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_pop_eavesdropper(void * jarg1, void * jarg2) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + switch_core_session_t **arg2 = (switch_core_session_t **) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (switch_core_session_t **)jarg2; + result = (switch_status_t)switch_ivr_eavesdrop_pop_eavesdropper(arg1,arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_exec_all(void * jarg1, char * jarg2, char * jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (char *)jarg3; + result = (switch_status_t)switch_ivr_eavesdrop_exec_all(arg1,(char const *)arg2,(char const *)arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_update_display(void * jarg1, char * jarg2, char * jarg3) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (char *)jarg3; + result = (switch_status_t)switch_ivr_eavesdrop_update_display(arg1,(char const *)arg2,(char const *)arg3); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_eavesdrop_session(void * jarg1, char * jarg2, char * jarg3, unsigned long jarg4) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -30667,6 +30937,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_kill_uuid(char * jarg1, int jarg2) } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_blind_transfer_ack(void * jarg1, int jarg2) { + int jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + switch_bool_t arg2 ; + switch_status_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (switch_bool_t)jarg2; + result = (switch_status_t)switch_ivr_blind_transfer_ack(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_BUF_LEN_get() { int jresult ; int result; @@ -31187,6 +31471,14 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_break(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_flush(void * jarg1) { + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + + arg1 = (switch_rtp_t *)jarg1; + switch_rtp_flush(arg1); +} + + SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_rtp_ready(void * jarg1) { unsigned char jresult ; switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; @@ -31727,6 +32019,16 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_rtp_check_auto_adj(void * jar } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_interdigit_delay(void * jarg1, unsigned long jarg2) { + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_rtp_t *)jarg1; + arg2 = (uint32_t)jarg2; + switch_rtp_set_interdigit_delay(arg1,arg2); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_log_node_t_data_set(void * jarg1, char * jarg2) { switch_log_node_t *arg1 = (switch_log_node_t *) 0 ; char *arg2 = (char *) 0 ; @@ -32632,6 +32934,20 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_xml_toxml(void * jarg1, int jarg2) { } +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_xml_toxml_nolock(void * jarg1, int jarg2) { + char * jresult ; + switch_xml_t arg1 = (switch_xml_t) 0 ; + switch_bool_t arg2 ; + char *result = 0 ; + + arg1 = (switch_xml_t)jarg1; + arg2 = (switch_bool_t)jarg2; + result = (char *)switch_xml_toxml_nolock(arg1,arg2); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_switch_xml_toxml_buf(void * jarg1, char * jarg2, void * jarg3, void * jarg4, int jarg5) { char * jresult ; switch_xml_t arg1 = (switch_xml_t) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index 336e468c61..3a1cc13d6b 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -1066,6 +1066,21 @@ public class freeswitch { freeswitchPINVOKE.switch_core_session_disable_heartbeat(SWIGTYPE_p_switch_core_session.getCPtr(session)); } + public static switch_status_t switch_core_media_bug_pop(SWIGTYPE_p_switch_core_session orig_session, string function, SWIGTYPE_p_p_switch_media_bug pop) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_pop(SWIGTYPE_p_switch_core_session.getCPtr(orig_session), function, SWIGTYPE_p_p_switch_media_bug.getCPtr(pop)); + return ret; + } + + public static switch_status_t switch_core_media_bug_exec_all(SWIGTYPE_p_switch_core_session orig_session, string function, SWIGTYPE_p_f_p_switch_media_bug_p_void__void cb, SWIGTYPE_p_void user_data) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_exec_all(SWIGTYPE_p_switch_core_session.getCPtr(orig_session), function, SWIGTYPE_p_f_p_switch_media_bug_p_void__void.getCPtr(cb), SWIGTYPE_p_void.getCPtr(user_data)); + return ret; + } + + public static uint switch_core_media_bug_count(SWIGTYPE_p_switch_core_session orig_session, string function) { + uint ret = freeswitchPINVOKE.switch_core_media_bug_count(SWIGTYPE_p_switch_core_session.getCPtr(orig_session), function); + return ret; + } + public static switch_status_t switch_core_media_bug_add(SWIGTYPE_p_switch_core_session session, string function, string target, SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t callback, SWIGTYPE_p_void user_data, SWIGTYPE_p_time_t stop_time, uint flags, SWIGTYPE_p_p_switch_media_bug new_bug) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_add(SWIGTYPE_p_switch_core_session.getCPtr(session), function, target, SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t.getCPtr(callback), SWIGTYPE_p_void.getCPtr(user_data), SWIGTYPE_p_time_t.getCPtr(stop_time), flags, SWIGTYPE_p_p_switch_media_bug.getCPtr(new_bug)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -1106,6 +1121,10 @@ public class freeswitch { return ret; } + public static void switch_core_media_bug_set_read_demux_frame(SWIGTYPE_p_switch_media_bug bug, switch_frame frame) { + freeswitchPINVOKE.switch_core_media_bug_set_read_demux_frame(SWIGTYPE_p_switch_media_bug.getCPtr(bug), switch_frame.getCPtr(frame)); + } + public static SWIGTYPE_p_switch_core_session switch_core_media_bug_get_session(SWIGTYPE_p_switch_media_bug bug) { IntPtr cPtr = freeswitchPINVOKE.switch_core_media_bug_get_session(SWIGTYPE_p_switch_media_bug.getCPtr(bug)); SWIGTYPE_p_switch_core_session ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_core_session(cPtr, false); @@ -1131,6 +1150,11 @@ public class freeswitch { freeswitchPINVOKE.switch_core_media_bug_set_read_replace_frame(SWIGTYPE_p_switch_media_bug.getCPtr(bug), switch_frame.getCPtr(frame)); } + public static uint switch_core_cpu_count() { + uint ret = freeswitchPINVOKE.switch_core_cpu_count(); + return ret; + } + public static switch_status_t switch_core_media_bug_remove(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_media_bug bug) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_remove(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_media_bug.getCPtr(bug)); return ret; @@ -1151,8 +1175,8 @@ public class freeswitch { return ret; } - public static switch_status_t switch_core_media_bug_remove_all(SWIGTYPE_p_switch_core_session session) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_remove_all(SWIGTYPE_p_switch_core_session.getCPtr(session)); + public static switch_status_t switch_core_media_bug_remove_all_function(SWIGTYPE_p_switch_core_session session, string function) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_remove_all_function(SWIGTYPE_p_switch_core_session.getCPtr(session), function); return ret; } @@ -1995,6 +2019,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_core_session_get_real_read_impl(SWIGTYPE_p_switch_core_session session, switch_codec_implementation impp) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_get_real_read_impl(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_codec_implementation.getCPtr(impp)); + return ret; + } + public static switch_status_t switch_core_session_get_write_impl(SWIGTYPE_p_switch_core_session session, switch_codec_implementation impp) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_get_write_impl(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_codec_implementation.getCPtr(impp)); return ret; @@ -2642,8 +2671,8 @@ public class freeswitch { return ret; } - public static switch_status_t switch_core_add_registration(string user, string realm, string token, string url, uint expires, string network_ip, string network_port, string network_proto) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_add_registration(user, realm, token, url, expires, network_ip, network_port, network_proto); + public static switch_status_t switch_core_add_registration(string user, string realm, string token, string url, uint expires, string network_ip, string network_port, string network_proto, string metadata) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_add_registration(user, realm, token, url, expires, network_ip, network_port, network_proto, metadata); return ret; } @@ -2694,6 +2723,15 @@ public class freeswitch { freeswitchPINVOKE.switch_close_extra_files(SWIGTYPE_p_int.getCPtr(keep), keep_ttl); } + public static switch_status_t switch_core_thread_set_cpu_affinity(int cpu) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_thread_set_cpu_affinity(cpu); + return ret; + } + + public static void switch_os_yield() { + freeswitchPINVOKE.switch_os_yield(); + } + public static switch_status_t switch_loadable_module_init(switch_bool_t autoload) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init((int)autoload); return ret; @@ -2715,6 +2753,11 @@ public class freeswitch { return ret; } + public static string switch_parse_codec_buf(string buf, SWIGTYPE_p_unsigned_long interval, SWIGTYPE_p_unsigned_long rate, SWIGTYPE_p_unsigned_long bit) { + string ret = freeswitchPINVOKE.switch_parse_codec_buf(buf, SWIGTYPE_p_unsigned_long.getCPtr(interval), SWIGTYPE_p_unsigned_long.getCPtr(rate), SWIGTYPE_p_unsigned_long.getCPtr(bit)); + return ret; + } + public static switch_dialplan_interface switch_loadable_module_get_dialplan_interface(string name) { IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_dialplan_interface(name); switch_dialplan_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_dialplan_interface(cPtr, false); @@ -3830,6 +3873,10 @@ public class freeswitch { return ret; } + public static void switch_channel_check_zrtp(SWIGTYPE_p_switch_channel channel) { + freeswitchPINVOKE.switch_channel_check_zrtp(SWIGTYPE_p_switch_channel.getCPtr(channel)); + } + public static switch_status_t switch_channel_perform_ring_ready_value(SWIGTYPE_p_switch_channel channel, switch_ring_ready_t rv, string file, string func, int line) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_perform_ring_ready_value(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)rv, file, func, line); return ret; @@ -3949,8 +3996,8 @@ public class freeswitch { freeswitchPINVOKE.switch_channel_event_set_extended_data(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_event.getCPtr(arg1)); } - public static string switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel channel, string arg1, switch_event var_list, switch_event api_list) { - string ret = freeswitchPINVOKE.switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel.getCPtr(channel), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list)); + public static string switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel channel, string arg1, switch_event var_list, switch_event api_list, uint recur) { + string ret = freeswitchPINVOKE.switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel.getCPtr(channel), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list), recur); return ret; } @@ -4071,6 +4118,11 @@ public class freeswitch { freeswitchPINVOKE.switch_channel_transfer_to_extension(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_caller_extension.getCPtr(caller_extension)); } + public static string switch_channel_get_partner_uuid(SWIGTYPE_p_switch_channel channel) { + string ret = freeswitchPINVOKE.switch_channel_get_partner_uuid(SWIGTYPE_p_switch_channel.getCPtr(channel)); + return ret; + } + public static switch_status_t switch_buffer_create(SWIGTYPE_p_apr_pool_t pool, SWIGTYPE_p_p_switch_buffer buffer, SWIGTYPE_p_switch_size_t max_len) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_buffer_create(SWIGTYPE_p_apr_pool_t.getCPtr(pool), SWIGTYPE_p_p_switch_buffer.getCPtr(buffer), SWIGTYPE_p_switch_size_t.getCPtr(max_len)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -4332,8 +4384,8 @@ public class freeswitch { return ret; } - public static string switch_event_expand_headers_check(switch_event arg0, string arg1, switch_event var_list, switch_event api_list) { - string ret = freeswitchPINVOKE.switch_event_expand_headers_check(switch_event.getCPtr(arg0), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list)); + public static string switch_event_expand_headers_check(switch_event arg0, string arg1, switch_event var_list, switch_event api_list, uint recur) { + string ret = freeswitchPINVOKE.switch_event_expand_headers_check(switch_event.getCPtr(arg0), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list), recur); return ret; } @@ -4361,6 +4413,10 @@ public class freeswitch { return ret; } + public static void switch_event_add_presence_data_cols(SWIGTYPE_p_switch_channel channel, switch_event arg1, string prefix) { + freeswitchPINVOKE.switch_event_add_presence_data_cols(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_event.getCPtr(arg1), prefix); + } + public static switch_status_t switch_resample_perform_create(SWIGTYPE_p_p_switch_audio_resampler_t new_resampler, uint from_rate, uint to_rate, uint to_size, int quality, uint channels, string file, string func, int line) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_resample_perform_create(SWIGTYPE_p_p_switch_audio_resampler_t.getCPtr(new_resampler), from_rate, to_rate, to_size, quality, channels, file, func, line); return ret; @@ -4417,6 +4473,11 @@ public class freeswitch { return ret; } + public static uint switch_unmerge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples) { + uint ret = freeswitchPINVOKE.switch_unmerge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples); + return ret; + } + public static void switch_mux_channels(SWIGTYPE_p_short data, SWIGTYPE_p_switch_size_t samples, uint channels) { freeswitchPINVOKE.switch_mux_channels(SWIGTYPE_p_short.getCPtr(data), SWIGTYPE_p_switch_size_t.getCPtr(samples), channels); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -4432,6 +4493,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_ivr_generate_json_cdr(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_cJSON json_cdr, switch_bool_t urlencode) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_generate_json_cdr(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_cJSON.getCPtr(json_cdr), (int)urlencode); + return ret; + } + public static switch_status_t switch_ivr_generate_xml_cdr(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_xml xml_cdr) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_generate_xml_cdr(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_xml.getCPtr(xml_cdr)); return ret; @@ -4563,6 +4629,21 @@ public class freeswitch { return ret; } + public static switch_status_t switch_ivr_eavesdrop_pop_eavesdropper(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_core_session sessionp) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_pop_eavesdropper(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_core_session.getCPtr(sessionp)); + return ret; + } + + public static switch_status_t switch_ivr_eavesdrop_exec_all(SWIGTYPE_p_switch_core_session session, string app, string arg) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_exec_all(SWIGTYPE_p_switch_core_session.getCPtr(session), app, arg); + return ret; + } + + public static switch_status_t switch_ivr_eavesdrop_update_display(SWIGTYPE_p_switch_core_session session, string name, string number) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_update_display(SWIGTYPE_p_switch_core_session.getCPtr(session), name, number); + return ret; + } + public static switch_status_t switch_ivr_eavesdrop_session(SWIGTYPE_p_switch_core_session session, string uuid, string require_group, uint flags) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_session(SWIGTYPE_p_switch_core_session.getCPtr(session), uuid, require_group, flags); return ret; @@ -5079,6 +5160,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_ivr_blind_transfer_ack(SWIGTYPE_p_switch_core_session session, switch_bool_t success) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_blind_transfer_ack(SWIGTYPE_p_switch_core_session.getCPtr(session), (int)success); + return ret; + } + public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_rtp_crypto_key_type_t type, SWIGTYPE_p_unsigned_char key, SWIGTYPE_p_switch_size_t keylen) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, (int)type, SWIGTYPE_p_unsigned_char.getCPtr(key), SWIGTYPE_p_switch_size_t.getCPtr(keylen)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -5183,6 +5269,10 @@ public class freeswitch { freeswitchPINVOKE.switch_rtp_break(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); } + public static void switch_rtp_flush(SWIGTYPE_p_switch_rtp rtp_session) { + freeswitchPINVOKE.switch_rtp_flush(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); + } + public static byte switch_rtp_ready(SWIGTYPE_p_switch_rtp rtp_session) { byte ret = freeswitchPINVOKE.switch_rtp_ready(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); return ret; @@ -5374,6 +5464,10 @@ public class freeswitch { return ret; } + public static void switch_rtp_set_interdigit_delay(SWIGTYPE_p_switch_rtp rtp_session, uint delay) { + freeswitchPINVOKE.switch_rtp_set_interdigit_delay(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), delay); + } + public static switch_status_t switch_log_init(SWIGTYPE_p_apr_pool_t pool, switch_bool_t colorize) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_log_init(SWIGTYPE_p_apr_pool_t.getCPtr(pool), (int)colorize); return ret; @@ -5495,6 +5589,11 @@ public class freeswitch { return ret; } + public static string switch_xml_toxml_nolock(switch_xml xml, switch_bool_t prn_header) { + string ret = freeswitchPINVOKE.switch_xml_toxml_nolock(switch_xml.getCPtr(xml), (int)prn_header); + return ret; + } + public static string switch_xml_toxml_buf(switch_xml xml, string buf, SWIGTYPE_p_switch_size_t buflen, SWIGTYPE_p_switch_size_t offset, switch_bool_t prn_header) { string ret = freeswitchPINVOKE.switch_xml_toxml_buf(switch_xml.getCPtr(xml), buf, SWIGTYPE_p_switch_size_t.getCPtr(buflen), SWIGTYPE_p_switch_size_t.getCPtr(offset), (int)prn_header); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -5986,7 +6085,9 @@ public class freeswitch { public static readonly string SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE = freeswitchPINVOKE.SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE_get(); public static readonly string SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE_get(); public static readonly string SWITCH_READ_RESULT_VARIABLE = freeswitchPINVOKE.SWITCH_READ_RESULT_VARIABLE_get(); + public static readonly string SWITCH_ATT_XFER_RESULT_VARIABLE = freeswitchPINVOKE.SWITCH_ATT_XFER_RESULT_VARIABLE_get(); public static readonly string SWITCH_COPY_XML_CDR_VARIABLE = freeswitchPINVOKE.SWITCH_COPY_XML_CDR_VARIABLE_get(); + public static readonly string SWITCH_COPY_JSON_CDR_VARIABLE = freeswitchPINVOKE.SWITCH_COPY_JSON_CDR_VARIABLE_get(); public static readonly string SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE = freeswitchPINVOKE.SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get(); public static readonly string SWITCH_TRANSFER_HISTORY_VARIABLE = freeswitchPINVOKE.SWITCH_TRANSFER_HISTORY_VARIABLE_get(); public static readonly string SWITCH_TRANSFER_SOURCE_VARIABLE = freeswitchPINVOKE.SWITCH_TRANSFER_SOURCE_VARIABLE_get(); @@ -6021,6 +6122,7 @@ public class freeswitch { public static readonly string SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME = freeswitchPINVOKE.SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME_get(); public static readonly string SWITCH_BYPASS_MEDIA_VARIABLE = freeswitchPINVOKE.SWITCH_BYPASS_MEDIA_VARIABLE_get(); public static readonly string SWITCH_PROXY_MEDIA_VARIABLE = freeswitchPINVOKE.SWITCH_PROXY_MEDIA_VARIABLE_get(); + public static readonly string SWITCH_ZRTP_PASSTHRU_VARIABLE = freeswitchPINVOKE.SWITCH_ZRTP_PASSTHRU_VARIABLE_get(); public static readonly string SWITCH_ENDPOINT_DISPOSITION_VARIABLE = freeswitchPINVOKE.SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get(); public static readonly string SWITCH_HOLD_MUSIC_VARIABLE = freeswitchPINVOKE.SWITCH_HOLD_MUSIC_VARIABLE_get(); public static readonly string SWITCH_TEMP_HOLD_MUSIC_VARIABLE = freeswitchPINVOKE.SWITCH_TEMP_HOLD_MUSIC_VARIABLE_get(); @@ -6033,6 +6135,7 @@ public class freeswitch { public static readonly string SWITCH_LAST_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_LAST_BRIDGE_VARIABLE_get(); public static readonly string SWITCH_SIGNAL_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_SIGNAL_BRIDGE_VARIABLE_get(); public static readonly string SWITCH_SIGNAL_BOND_VARIABLE = freeswitchPINVOKE.SWITCH_SIGNAL_BOND_VARIABLE_get(); + public static readonly string SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE = freeswitchPINVOKE.SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE_get(); public static readonly string SWITCH_ORIGINATOR_VARIABLE = freeswitchPINVOKE.SWITCH_ORIGINATOR_VARIABLE_get(); public static readonly string SWITCH_ORIGINATOR_CODEC_VARIABLE = freeswitchPINVOKE.SWITCH_ORIGINATOR_CODEC_VARIABLE_get(); public static readonly string SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE = freeswitchPINVOKE.SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE_get(); @@ -6533,9 +6636,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_READ_RESULT_VARIABLE_get")] public static extern string SWITCH_READ_RESULT_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ATT_XFER_RESULT_VARIABLE_get")] + public static extern string SWITCH_ATT_XFER_RESULT_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get")] public static extern string SWITCH_COPY_XML_CDR_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_COPY_JSON_CDR_VARIABLE_get")] + public static extern string SWITCH_COPY_JSON_CDR_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get")] public static extern string SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get(); @@ -6638,6 +6747,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_PROXY_MEDIA_VARIABLE_get")] public static extern string SWITCH_PROXY_MEDIA_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ZRTP_PASSTHRU_VARIABLE_get")] + public static extern string SWITCH_ZRTP_PASSTHRU_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get")] public static extern string SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get(); @@ -6674,6 +6786,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_SIGNAL_BOND_VARIABLE_get")] public static extern string SWITCH_SIGNAL_BOND_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE_get")] + public static extern string SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ORIGINATOR_VARIABLE_get")] public static extern string SWITCH_ORIGINATOR_VARIABLE_get(); @@ -7934,6 +8049,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_disable_heartbeat")] public static extern void switch_core_session_disable_heartbeat(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_pop")] + public static extern int switch_core_media_bug_pop(HandleRef jarg1, string jarg2, HandleRef jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_exec_all")] + public static extern int switch_core_media_bug_exec_all(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_count")] + public static extern uint switch_core_media_bug_count(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_add")] public static extern int switch_core_media_bug_add(HandleRef jarg1, string jarg2, string jarg3, HandleRef jarg4, HandleRef jarg5, HandleRef jarg6, uint jarg7, HandleRef jarg8); @@ -7958,6 +8082,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_get_read_replace_frame")] public static extern IntPtr switch_core_media_bug_get_read_replace_frame(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_set_read_demux_frame")] + public static extern void switch_core_media_bug_set_read_demux_frame(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_get_session")] public static extern IntPtr switch_core_media_bug_get_session(HandleRef jarg1); @@ -7973,6 +8100,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_set_read_replace_frame")] public static extern void switch_core_media_bug_set_read_replace_frame(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_cpu_count")] + public static extern uint switch_core_cpu_count(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_remove")] public static extern int switch_core_media_bug_remove(HandleRef jarg1, HandleRef jarg2); @@ -7985,8 +8115,8 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_close")] public static extern int switch_core_media_bug_close(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_remove_all")] - public static extern int switch_core_media_bug_remove_all(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_remove_all_function")] + public static extern int switch_core_media_bug_remove_all_function(HandleRef jarg1, string jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_enumerate")] public static extern int switch_core_media_bug_enumerate(HandleRef jarg1, HandleRef jarg2); @@ -8498,6 +8628,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_read_impl")] public static extern int switch_core_session_get_read_impl(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_real_read_impl")] + public static extern int switch_core_session_get_real_read_impl(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_write_impl")] public static extern int switch_core_session_get_write_impl(HandleRef jarg1, HandleRef jarg2); @@ -8970,7 +9103,7 @@ class freeswitchPINVOKE { public static extern uint switch_default_ptime(string jarg1, uint jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_add_registration")] - public static extern int switch_core_add_registration(string jarg1, string jarg2, string jarg3, string jarg4, uint jarg5, string jarg6, string jarg7, string jarg8); + public static extern int switch_core_add_registration(string jarg1, string jarg2, string jarg3, string jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_del_registration")] public static extern int switch_core_del_registration(string jarg1, string jarg2, string jarg3); @@ -9002,6 +9135,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_close_extra_files")] public static extern void switch_close_extra_files(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_thread_set_cpu_affinity")] + public static extern int switch_core_thread_set_cpu_affinity(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_os_yield")] + public static extern void switch_os_yield(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")] public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2); @@ -9134,6 +9273,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codec_interface")] public static extern IntPtr switch_loadable_module_get_codec_interface(string jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_parse_codec_buf")] + public static extern string switch_parse_codec_buf(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_dialplan_interface")] public static extern IntPtr switch_loadable_module_get_dialplan_interface(string jarg1); @@ -12419,6 +12561,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_perform_mark_answered")] public static extern int switch_channel_perform_mark_answered(HandleRef jarg1, string jarg2, string jarg3, int jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_check_zrtp")] + public static extern void switch_channel_check_zrtp(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_perform_ring_ready_value")] public static extern int switch_channel_perform_ring_ready_value(HandleRef jarg1, int jarg2, string jarg3, string jarg4, int jarg5); @@ -12492,7 +12637,7 @@ class freeswitchPINVOKE { public static extern void switch_channel_event_set_extended_data(HandleRef jarg1, HandleRef jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_expand_variables_check")] - public static extern string switch_channel_expand_variables_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4); + public static extern string switch_channel_expand_variables_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, uint jarg5); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_build_param_string")] public static extern string switch_channel_build_param_string(HandleRef jarg1, HandleRef jarg2, string jarg3); @@ -12569,6 +12714,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_transfer_to_extension")] public static extern void switch_channel_transfer_to_extension(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_partner_uuid")] + public static extern string switch_channel_get_partner_uuid(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_buffer_create")] public static extern int switch_buffer_create(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); @@ -12846,7 +12994,7 @@ class freeswitchPINVOKE { public static extern int switch_event_set_body(HandleRef jarg1, string jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_event_expand_headers_check")] - public static extern string switch_event_expand_headers_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4); + public static extern string switch_event_expand_headers_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, uint jarg5); [DllImport("mod_managed", EntryPoint="CSharp_switch_event_create_pres_in_detailed")] public static extern int switch_event_create_pres_in_detailed(string jarg1, string jarg2, int jarg3, string jarg4, string jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, int jarg11, string jarg12, string jarg13, string jarg14, string jarg15); @@ -12863,6 +13011,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_event_check_permission_list")] public static extern int switch_event_check_permission_list(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_event_add_presence_data_cols")] + public static extern void switch_event_add_presence_data_cols(HandleRef jarg1, HandleRef jarg2, string jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RESAMPLE_QUALITY_get")] public static extern int SWITCH_RESAMPLE_QUALITY_get(); @@ -12956,6 +13107,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_merge_sln")] public static extern uint switch_merge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_unmerge_sln")] + public static extern uint switch_unmerge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_mux_channels")] public static extern void switch_mux_channels(HandleRef jarg1, HandleRef jarg2, uint jarg3); @@ -13067,6 +13221,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_activate_unicast")] public static extern int switch_ivr_activate_unicast(HandleRef jarg1, string jarg2, ushort jarg3, string jarg4, ushort jarg5, string jarg6, string jarg7); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_generate_json_cdr")] + public static extern int switch_ivr_generate_json_cdr(HandleRef jarg1, HandleRef jarg2, int jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_generate_xml_cdr")] public static extern int switch_ivr_generate_xml_cdr(HandleRef jarg1, HandleRef jarg2); @@ -13145,6 +13302,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")] public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_pop_eavesdropper")] + public static extern int switch_ivr_eavesdrop_pop_eavesdropper(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_exec_all")] + public static extern int switch_ivr_eavesdrop_exec_all(HandleRef jarg1, string jarg2, string jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_update_display")] + public static extern int switch_ivr_eavesdrop_update_display(HandleRef jarg1, string jarg2, string jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_session")] public static extern int switch_ivr_eavesdrop_session(HandleRef jarg1, string jarg2, string jarg3, uint jarg4); @@ -13457,6 +13623,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_kill_uuid")] public static extern int switch_ivr_kill_uuid(string jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_blind_transfer_ack")] + public static extern int switch_ivr_blind_transfer_ack(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_BUF_LEN_get")] public static extern int SWITCH_RTP_MAX_BUF_LEN_get(); @@ -13577,6 +13746,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_break")] public static extern void switch_rtp_break(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_flush")] + public static extern void switch_rtp_flush(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_ready")] public static extern byte switch_rtp_ready(HandleRef jarg1); @@ -13697,6 +13869,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_check_auto_adj")] public static extern byte switch_rtp_check_auto_adj(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_interdigit_delay")] + public static extern void switch_rtp_set_interdigit_delay(HandleRef jarg1, uint jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_data_set")] public static extern void switch_log_node_t_data_set(HandleRef jarg1, string jarg2); @@ -13910,6 +14085,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_toxml")] public static extern string switch_xml_toxml(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_toxml_nolock")] + public static extern string switch_xml_toxml_nolock(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_toxml_buf")] public static extern string switch_xml_toxml_buf(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, int jarg5); @@ -17390,6 +17568,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_f_p_switch_media_bug_p_void__void(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_f_p_switch_media_bug_p_void__void() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void__void obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void { private HandleRef swigCPtr; @@ -18170,6 +18378,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_p_cJSON { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_p_cJSON(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_p_cJSON() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_p_cJSON obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_p_p_char { private HandleRef swigCPtr; @@ -23022,6 +23260,12 @@ public enum switch_channel_flag_t { CF_VIDEO_REFRESH_REQ, CF_SERVICE_AUDIO, CF_SERVICE_VIDEO, + CF_ZRTP_PASSTHRU_REQ, + CF_ZRTP_PASSTHRU, + CF_ZRTP_HASH, + CF_CHANNEL_SWAP, + CF_PICKUP, + CF_CONFIRM_BLIND_TRANSFER, CF_FLAG_MAX } @@ -24627,7 +24871,8 @@ namespace FreeSWITCH.Native { SCF_CLEAR_SQL = (1 << 17), SCF_THREADED_SYSTEM_EXEC = (1 << 18), SCF_SYNC_CLOCK_REQUESTED = (1 << 19), - SCF_CORE_ODBC_REQ = (1 << 20) + SCF_CORE_ODBC_REQ = (1 << 20), + SCF_DEBUG_SQL = (1 << 21) } } @@ -24938,6 +25183,7 @@ public enum switch_core_session_message_types_t { SWITCH_MESSAGE_INDICATE_SIGNAL_DATA, SWITCH_MESSAGE_INDICATE_INFO, SWITCH_MESSAGE_INDICATE_AUDIO_DATA, + SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE, SWITCH_MESSAGE_INVALID } @@ -25897,7 +26143,8 @@ namespace FreeSWITCH.Native { ED_NONE = 0, ED_MUX_READ = (1 << 0), ED_MUX_WRITE = (1 << 1), - ED_DTMF = (1 << 2) + ED_DTMF = (1 << 2), + ED_COPY_DISPLAY = (1 << 3) } } @@ -29893,7 +30140,8 @@ namespace FreeSWITCH.Native { SMBF_THREAD_LOCK = (1 << 7), SMBF_PRUNE = (1 << 8), SMBF_NO_PAUSE = (1 << 9), - SMBF_STEREO_SWAP = (1 << 10) + SMBF_STEREO_SWAP = (1 << 10), + SMBF_LOCK = (1 << 11) } } @@ -31284,7 +31532,8 @@ public enum switch_session_ctl_t { SCSC_PAUSE_CHECK, SCSC_READY_CHECK, SCSC_THREADED_SYSTEM_EXEC, - SCSC_SYNC_CLOCK_WHEN_IDLE + SCSC_SYNC_CLOCK_WHEN_IDLE, + SCSC_DEBUG_SQL } } diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 2aa430fa32..62dea3d5c5 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -1054,6 +1054,21 @@ public class freeswitch { freeswitchPINVOKE.switch_core_session_disable_heartbeat(SWIGTYPE_p_switch_core_session.getCPtr(session)); } + public static switch_status_t switch_core_media_bug_pop(SWIGTYPE_p_switch_core_session orig_session, string function, SWIGTYPE_p_p_switch_media_bug pop) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_pop(SWIGTYPE_p_switch_core_session.getCPtr(orig_session), function, SWIGTYPE_p_p_switch_media_bug.getCPtr(pop)); + return ret; + } + + public static switch_status_t switch_core_media_bug_exec_all(SWIGTYPE_p_switch_core_session orig_session, string function, SWIGTYPE_p_f_p_switch_media_bug_p_void__void cb, SWIGTYPE_p_void user_data) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_exec_all(SWIGTYPE_p_switch_core_session.getCPtr(orig_session), function, SWIGTYPE_p_f_p_switch_media_bug_p_void__void.getCPtr(cb), SWIGTYPE_p_void.getCPtr(user_data)); + return ret; + } + + public static uint switch_core_media_bug_count(SWIGTYPE_p_switch_core_session orig_session, string function) { + uint ret = freeswitchPINVOKE.switch_core_media_bug_count(SWIGTYPE_p_switch_core_session.getCPtr(orig_session), function); + return ret; + } + public static switch_status_t switch_core_media_bug_add(SWIGTYPE_p_switch_core_session session, string function, string target, SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t callback, SWIGTYPE_p_void user_data, SWIGTYPE_p_time_t stop_time, uint flags, SWIGTYPE_p_p_switch_media_bug new_bug) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_add(SWIGTYPE_p_switch_core_session.getCPtr(session), function, target, SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t.getCPtr(callback), SWIGTYPE_p_void.getCPtr(user_data), SWIGTYPE_p_time_t.getCPtr(stop_time), flags, SWIGTYPE_p_p_switch_media_bug.getCPtr(new_bug)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -1094,6 +1109,10 @@ public class freeswitch { return ret; } + public static void switch_core_media_bug_set_read_demux_frame(SWIGTYPE_p_switch_media_bug bug, switch_frame frame) { + freeswitchPINVOKE.switch_core_media_bug_set_read_demux_frame(SWIGTYPE_p_switch_media_bug.getCPtr(bug), switch_frame.getCPtr(frame)); + } + public static SWIGTYPE_p_switch_core_session switch_core_media_bug_get_session(SWIGTYPE_p_switch_media_bug bug) { IntPtr cPtr = freeswitchPINVOKE.switch_core_media_bug_get_session(SWIGTYPE_p_switch_media_bug.getCPtr(bug)); SWIGTYPE_p_switch_core_session ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_core_session(cPtr, false); @@ -1119,6 +1138,11 @@ public class freeswitch { freeswitchPINVOKE.switch_core_media_bug_set_read_replace_frame(SWIGTYPE_p_switch_media_bug.getCPtr(bug), switch_frame.getCPtr(frame)); } + public static uint switch_core_cpu_count() { + uint ret = freeswitchPINVOKE.switch_core_cpu_count(); + return ret; + } + public static switch_status_t switch_core_media_bug_remove(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_media_bug bug) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_remove(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_media_bug.getCPtr(bug)); return ret; @@ -1139,8 +1163,8 @@ public class freeswitch { return ret; } - public static switch_status_t switch_core_media_bug_remove_all(SWIGTYPE_p_switch_core_session session) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_remove_all(SWIGTYPE_p_switch_core_session.getCPtr(session)); + public static switch_status_t switch_core_media_bug_remove_all_function(SWIGTYPE_p_switch_core_session session, string function) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_remove_all_function(SWIGTYPE_p_switch_core_session.getCPtr(session), function); return ret; } @@ -1168,6 +1192,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_core_media_bug_set_pre_buffer_framecount(SWIGTYPE_p_switch_media_bug bug, uint framecount) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_media_bug_set_pre_buffer_framecount(SWIGTYPE_p_switch_media_bug.getCPtr(bug), framecount); + return ret; + } + public static switch_status_t switch_core_port_allocator_new(ushort start, ushort end, uint flags, SWIGTYPE_p_p_switch_core_port_allocator new_allocator) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_port_allocator_new(start, end, flags, SWIGTYPE_p_p_switch_core_port_allocator.getCPtr(new_allocator)); return ret; @@ -1978,6 +2007,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_core_session_get_real_read_impl(SWIGTYPE_p_switch_core_session session, switch_codec_implementation impp) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_get_real_read_impl(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_codec_implementation.getCPtr(impp)); + return ret; + } + public static switch_status_t switch_core_session_get_write_impl(SWIGTYPE_p_switch_core_session session, switch_codec_implementation impp) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_get_write_impl(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_codec_implementation.getCPtr(impp)); return ret; @@ -2677,6 +2711,15 @@ public class freeswitch { freeswitchPINVOKE.switch_close_extra_files(SWIGTYPE_p_int.getCPtr(keep), keep_ttl); } + public static switch_status_t switch_core_thread_set_cpu_affinity(int cpu) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_thread_set_cpu_affinity(cpu); + return ret; + } + + public static void switch_os_yield() { + freeswitchPINVOKE.switch_os_yield(); + } + public static switch_status_t switch_loadable_module_init(switch_bool_t autoload) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init((int)autoload); return ret; @@ -2698,6 +2741,11 @@ public class freeswitch { return ret; } + public static string switch_parse_codec_buf(string buf, SWIGTYPE_p_unsigned_long interval, SWIGTYPE_p_unsigned_long rate, SWIGTYPE_p_unsigned_long bit) { + string ret = freeswitchPINVOKE.switch_parse_codec_buf(buf, SWIGTYPE_p_unsigned_long.getCPtr(interval), SWIGTYPE_p_unsigned_long.getCPtr(rate), SWIGTYPE_p_unsigned_long.getCPtr(bit)); + return ret; + } + public static switch_dialplan_interface switch_loadable_module_get_dialplan_interface(string name) { IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_dialplan_interface(name); switch_dialplan_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_dialplan_interface(cPtr, false); @@ -3813,6 +3861,10 @@ public class freeswitch { return ret; } + public static void switch_channel_check_zrtp(SWIGTYPE_p_switch_channel channel) { + freeswitchPINVOKE.switch_channel_check_zrtp(SWIGTYPE_p_switch_channel.getCPtr(channel)); + } + public static switch_status_t switch_channel_perform_ring_ready_value(SWIGTYPE_p_switch_channel channel, switch_ring_ready_t rv, string file, string func, int line) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_perform_ring_ready_value(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)rv, file, func, line); return ret; @@ -3932,8 +3984,8 @@ public class freeswitch { freeswitchPINVOKE.switch_channel_event_set_extended_data(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_event.getCPtr(arg1)); } - public static string switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel channel, string arg1, switch_event var_list, switch_event api_list) { - string ret = freeswitchPINVOKE.switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel.getCPtr(channel), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list)); + public static string switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel channel, string arg1, switch_event var_list, switch_event api_list, uint recur) { + string ret = freeswitchPINVOKE.switch_channel_expand_variables_check(SWIGTYPE_p_switch_channel.getCPtr(channel), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list), recur); return ret; } @@ -4315,8 +4367,8 @@ public class freeswitch { return ret; } - public static string switch_event_expand_headers_check(switch_event arg0, string arg1, switch_event var_list, switch_event api_list) { - string ret = freeswitchPINVOKE.switch_event_expand_headers_check(switch_event.getCPtr(arg0), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list)); + public static string switch_event_expand_headers_check(switch_event arg0, string arg1, switch_event var_list, switch_event api_list, uint recur) { + string ret = freeswitchPINVOKE.switch_event_expand_headers_check(switch_event.getCPtr(arg0), arg1, switch_event.getCPtr(var_list), switch_event.getCPtr(api_list), recur); return ret; } @@ -4344,6 +4396,10 @@ public class freeswitch { return ret; } + public static void switch_event_add_presence_data_cols(SWIGTYPE_p_switch_channel channel, switch_event arg1, string prefix) { + freeswitchPINVOKE.switch_event_add_presence_data_cols(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_event.getCPtr(arg1), prefix); + } + public static switch_status_t switch_resample_perform_create(SWIGTYPE_p_p_switch_audio_resampler_t new_resampler, uint from_rate, uint to_rate, uint to_size, int quality, uint channels, string file, string func, int line) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_resample_perform_create(SWIGTYPE_p_p_switch_audio_resampler_t.getCPtr(new_resampler), from_rate, to_rate, to_size, quality, channels, file, func, line); return ret; @@ -4400,6 +4456,11 @@ public class freeswitch { return ret; } + public static uint switch_unmerge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples) { + uint ret = freeswitchPINVOKE.switch_unmerge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples); + return ret; + } + public static void switch_mux_channels(SWIGTYPE_p_short data, SWIGTYPE_p_switch_size_t samples, uint channels) { freeswitchPINVOKE.switch_mux_channels(SWIGTYPE_p_short.getCPtr(data), SWIGTYPE_p_switch_size_t.getCPtr(samples), channels); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -4415,6 +4476,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_ivr_generate_json_cdr(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_cJSON json_cdr, switch_bool_t urlencode) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_generate_json_cdr(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_cJSON.getCPtr(json_cdr), (int)urlencode); + return ret; + } + public static switch_status_t switch_ivr_generate_xml_cdr(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_xml xml_cdr) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_generate_xml_cdr(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_xml.getCPtr(xml_cdr)); return ret; @@ -4546,6 +4612,21 @@ public class freeswitch { return ret; } + public static switch_status_t switch_ivr_eavesdrop_pop_eavesdropper(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_core_session sessionp) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_pop_eavesdropper(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_core_session.getCPtr(sessionp)); + return ret; + } + + public static switch_status_t switch_ivr_eavesdrop_exec_all(SWIGTYPE_p_switch_core_session session, string app, string arg) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_exec_all(SWIGTYPE_p_switch_core_session.getCPtr(session), app, arg); + return ret; + } + + public static switch_status_t switch_ivr_eavesdrop_update_display(SWIGTYPE_p_switch_core_session session, string name, string number) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_update_display(SWIGTYPE_p_switch_core_session.getCPtr(session), name, number); + return ret; + } + public static switch_status_t switch_ivr_eavesdrop_session(SWIGTYPE_p_switch_core_session session, string uuid, string require_group, uint flags) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_eavesdrop_session(SWIGTYPE_p_switch_core_session.getCPtr(session), uuid, require_group, flags); return ret; @@ -5062,6 +5143,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_ivr_blind_transfer_ack(SWIGTYPE_p_switch_core_session session, switch_bool_t success) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_blind_transfer_ack(SWIGTYPE_p_switch_core_session.getCPtr(session), (int)success); + return ret; + } + public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_rtp_crypto_key_type_t type, SWIGTYPE_p_unsigned_char key, SWIGTYPE_p_switch_size_t keylen) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, (int)type, SWIGTYPE_p_unsigned_char.getCPtr(key), SWIGTYPE_p_switch_size_t.getCPtr(keylen)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -5166,6 +5252,10 @@ public class freeswitch { freeswitchPINVOKE.switch_rtp_break(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); } + public static void switch_rtp_flush(SWIGTYPE_p_switch_rtp rtp_session) { + freeswitchPINVOKE.switch_rtp_flush(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); + } + public static byte switch_rtp_ready(SWIGTYPE_p_switch_rtp rtp_session) { byte ret = freeswitchPINVOKE.switch_rtp_ready(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); return ret; @@ -5357,6 +5447,10 @@ public class freeswitch { return ret; } + public static void switch_rtp_set_interdigit_delay(SWIGTYPE_p_switch_rtp rtp_session, uint delay) { + freeswitchPINVOKE.switch_rtp_set_interdigit_delay(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), delay); + } + public static switch_status_t switch_log_init(SWIGTYPE_p_apr_pool_t pool, switch_bool_t colorize) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_log_init(SWIGTYPE_p_apr_pool_t.getCPtr(pool), (int)colorize); return ret; @@ -5478,6 +5572,11 @@ public class freeswitch { return ret; } + public static string switch_xml_toxml_nolock(switch_xml xml, switch_bool_t prn_header) { + string ret = freeswitchPINVOKE.switch_xml_toxml_nolock(switch_xml.getCPtr(xml), (int)prn_header); + return ret; + } + public static string switch_xml_toxml_buf(switch_xml xml, string buf, SWIGTYPE_p_switch_size_t buflen, SWIGTYPE_p_switch_size_t offset, switch_bool_t prn_header) { string ret = freeswitchPINVOKE.switch_xml_toxml_buf(switch_xml.getCPtr(xml), buf, SWIGTYPE_p_switch_size_t.getCPtr(buflen), SWIGTYPE_p_switch_size_t.getCPtr(offset), (int)prn_header); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -5969,7 +6068,9 @@ public class freeswitch { public static readonly string SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE = freeswitchPINVOKE.SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE_get(); public static readonly string SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE_get(); public static readonly string SWITCH_READ_RESULT_VARIABLE = freeswitchPINVOKE.SWITCH_READ_RESULT_VARIABLE_get(); + public static readonly string SWITCH_ATT_XFER_RESULT_VARIABLE = freeswitchPINVOKE.SWITCH_ATT_XFER_RESULT_VARIABLE_get(); public static readonly string SWITCH_COPY_XML_CDR_VARIABLE = freeswitchPINVOKE.SWITCH_COPY_XML_CDR_VARIABLE_get(); + public static readonly string SWITCH_COPY_JSON_CDR_VARIABLE = freeswitchPINVOKE.SWITCH_COPY_JSON_CDR_VARIABLE_get(); public static readonly string SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE = freeswitchPINVOKE.SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get(); public static readonly string SWITCH_TRANSFER_HISTORY_VARIABLE = freeswitchPINVOKE.SWITCH_TRANSFER_HISTORY_VARIABLE_get(); public static readonly string SWITCH_TRANSFER_SOURCE_VARIABLE = freeswitchPINVOKE.SWITCH_TRANSFER_SOURCE_VARIABLE_get(); @@ -6004,6 +6105,7 @@ public class freeswitch { public static readonly string SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME = freeswitchPINVOKE.SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME_get(); public static readonly string SWITCH_BYPASS_MEDIA_VARIABLE = freeswitchPINVOKE.SWITCH_BYPASS_MEDIA_VARIABLE_get(); public static readonly string SWITCH_PROXY_MEDIA_VARIABLE = freeswitchPINVOKE.SWITCH_PROXY_MEDIA_VARIABLE_get(); + public static readonly string SWITCH_ZRTP_PASSTHRU_VARIABLE = freeswitchPINVOKE.SWITCH_ZRTP_PASSTHRU_VARIABLE_get(); public static readonly string SWITCH_ENDPOINT_DISPOSITION_VARIABLE = freeswitchPINVOKE.SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get(); public static readonly string SWITCH_HOLD_MUSIC_VARIABLE = freeswitchPINVOKE.SWITCH_HOLD_MUSIC_VARIABLE_get(); public static readonly string SWITCH_TEMP_HOLD_MUSIC_VARIABLE = freeswitchPINVOKE.SWITCH_TEMP_HOLD_MUSIC_VARIABLE_get(); @@ -6512,9 +6614,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_READ_RESULT_VARIABLE_get")] public static extern string SWITCH_READ_RESULT_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ATT_XFER_RESULT_VARIABLE_get")] + public static extern string SWITCH_ATT_XFER_RESULT_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get")] public static extern string SWITCH_COPY_XML_CDR_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_COPY_JSON_CDR_VARIABLE_get")] + public static extern string SWITCH_COPY_JSON_CDR_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get")] public static extern string SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get(); @@ -6617,6 +6725,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_PROXY_MEDIA_VARIABLE_get")] public static extern string SWITCH_PROXY_MEDIA_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ZRTP_PASSTHRU_VARIABLE_get")] + public static extern string SWITCH_ZRTP_PASSTHRU_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get")] public static extern string SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get(); @@ -7913,6 +8024,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_disable_heartbeat")] public static extern void switch_core_session_disable_heartbeat(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_pop")] + public static extern int switch_core_media_bug_pop(HandleRef jarg1, string jarg2, HandleRef jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_exec_all")] + public static extern int switch_core_media_bug_exec_all(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_count")] + public static extern uint switch_core_media_bug_count(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_add")] public static extern int switch_core_media_bug_add(HandleRef jarg1, string jarg2, string jarg3, HandleRef jarg4, HandleRef jarg5, HandleRef jarg6, uint jarg7, HandleRef jarg8); @@ -7937,6 +8057,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_get_read_replace_frame")] public static extern IntPtr switch_core_media_bug_get_read_replace_frame(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_set_read_demux_frame")] + public static extern void switch_core_media_bug_set_read_demux_frame(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_get_session")] public static extern IntPtr switch_core_media_bug_get_session(HandleRef jarg1); @@ -7952,6 +8075,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_set_read_replace_frame")] public static extern void switch_core_media_bug_set_read_replace_frame(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_cpu_count")] + public static extern uint switch_core_cpu_count(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_remove")] public static extern int switch_core_media_bug_remove(HandleRef jarg1, HandleRef jarg2); @@ -7964,8 +8090,8 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_close")] public static extern int switch_core_media_bug_close(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_remove_all")] - public static extern int switch_core_media_bug_remove_all(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_remove_all_function")] + public static extern int switch_core_media_bug_remove_all_function(HandleRef jarg1, string jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_enumerate")] public static extern int switch_core_media_bug_enumerate(HandleRef jarg1, HandleRef jarg2); @@ -7982,6 +8108,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_flush_all")] public static extern int switch_core_media_bug_flush_all(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_media_bug_set_pre_buffer_framecount")] + public static extern int switch_core_media_bug_set_pre_buffer_framecount(HandleRef jarg1, uint jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_port_allocator_new")] public static extern int switch_core_port_allocator_new(ushort jarg1, ushort jarg2, uint jarg3, HandleRef jarg4); @@ -8474,6 +8603,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_read_impl")] public static extern int switch_core_session_get_read_impl(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_real_read_impl")] + public static extern int switch_core_session_get_real_read_impl(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_write_impl")] public static extern int switch_core_session_get_write_impl(HandleRef jarg1, HandleRef jarg2); @@ -8978,6 +9110,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_close_extra_files")] public static extern void switch_close_extra_files(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_thread_set_cpu_affinity")] + public static extern int switch_core_thread_set_cpu_affinity(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_os_yield")] + public static extern void switch_os_yield(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")] public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2); @@ -9110,6 +9248,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codec_interface")] public static extern IntPtr switch_loadable_module_get_codec_interface(string jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_parse_codec_buf")] + public static extern string switch_parse_codec_buf(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_dialplan_interface")] public static extern IntPtr switch_loadable_module_get_dialplan_interface(string jarg1); @@ -12395,6 +12536,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_perform_mark_answered")] public static extern int switch_channel_perform_mark_answered(HandleRef jarg1, string jarg2, string jarg3, int jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_check_zrtp")] + public static extern void switch_channel_check_zrtp(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_perform_ring_ready_value")] public static extern int switch_channel_perform_ring_ready_value(HandleRef jarg1, int jarg2, string jarg3, string jarg4, int jarg5); @@ -12468,7 +12612,7 @@ class freeswitchPINVOKE { public static extern void switch_channel_event_set_extended_data(HandleRef jarg1, HandleRef jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_expand_variables_check")] - public static extern string switch_channel_expand_variables_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4); + public static extern string switch_channel_expand_variables_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, uint jarg5); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_build_param_string")] public static extern string switch_channel_build_param_string(HandleRef jarg1, HandleRef jarg2, string jarg3); @@ -12822,7 +12966,7 @@ class freeswitchPINVOKE { public static extern int switch_event_set_body(HandleRef jarg1, string jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_event_expand_headers_check")] - public static extern string switch_event_expand_headers_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4); + public static extern string switch_event_expand_headers_check(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, uint jarg5); [DllImport("mod_managed", EntryPoint="CSharp_switch_event_create_pres_in_detailed")] public static extern int switch_event_create_pres_in_detailed(string jarg1, string jarg2, int jarg3, string jarg4, string jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, int jarg11, string jarg12, string jarg13, string jarg14, string jarg15); @@ -12839,6 +12983,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_event_check_permission_list")] public static extern int switch_event_check_permission_list(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_event_add_presence_data_cols")] + public static extern void switch_event_add_presence_data_cols(HandleRef jarg1, HandleRef jarg2, string jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RESAMPLE_QUALITY_get")] public static extern int SWITCH_RESAMPLE_QUALITY_get(); @@ -12932,6 +13079,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_merge_sln")] public static extern uint switch_merge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_unmerge_sln")] + public static extern uint switch_unmerge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_mux_channels")] public static extern void switch_mux_channels(HandleRef jarg1, HandleRef jarg2, uint jarg3); @@ -13043,6 +13193,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_activate_unicast")] public static extern int switch_ivr_activate_unicast(HandleRef jarg1, string jarg2, ushort jarg3, string jarg4, ushort jarg5, string jarg6, string jarg7); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_generate_json_cdr")] + public static extern int switch_ivr_generate_json_cdr(HandleRef jarg1, HandleRef jarg2, int jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_generate_xml_cdr")] public static extern int switch_ivr_generate_xml_cdr(HandleRef jarg1, HandleRef jarg2); @@ -13121,6 +13274,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")] public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_pop_eavesdropper")] + public static extern int switch_ivr_eavesdrop_pop_eavesdropper(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_exec_all")] + public static extern int switch_ivr_eavesdrop_exec_all(HandleRef jarg1, string jarg2, string jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_update_display")] + public static extern int switch_ivr_eavesdrop_update_display(HandleRef jarg1, string jarg2, string jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_eavesdrop_session")] public static extern int switch_ivr_eavesdrop_session(HandleRef jarg1, string jarg2, string jarg3, uint jarg4); @@ -13433,6 +13595,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_kill_uuid")] public static extern int switch_ivr_kill_uuid(string jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_blind_transfer_ack")] + public static extern int switch_ivr_blind_transfer_ack(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_BUF_LEN_get")] public static extern int SWITCH_RTP_MAX_BUF_LEN_get(); @@ -13553,6 +13718,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_break")] public static extern void switch_rtp_break(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_flush")] + public static extern void switch_rtp_flush(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_ready")] public static extern byte switch_rtp_ready(HandleRef jarg1); @@ -13673,6 +13841,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_check_auto_adj")] public static extern byte switch_rtp_check_auto_adj(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_interdigit_delay")] + public static extern void switch_rtp_set_interdigit_delay(HandleRef jarg1, uint jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_data_set")] public static extern void switch_log_node_t_data_set(HandleRef jarg1, string jarg2); @@ -13886,6 +14057,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_toxml")] public static extern string switch_xml_toxml(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_toxml_nolock")] + public static extern string switch_xml_toxml_nolock(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_xml_toxml_buf")] public static extern string switch_xml_toxml_buf(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, int jarg5); @@ -17324,6 +17498,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_f_p_switch_media_bug_p_void__void(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_f_p_switch_media_bug_p_void__void() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void__void obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void { private HandleRef swigCPtr; @@ -18104,6 +18308,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_p_cJSON { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_p_cJSON(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_p_cJSON() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_p_cJSON obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_p_p_char { private HandleRef swigCPtr; @@ -22958,6 +23192,12 @@ public enum switch_channel_flag_t { CF_VIDEO_REFRESH_REQ, CF_SERVICE_AUDIO, CF_SERVICE_VIDEO, + CF_ZRTP_PASSTHRU_REQ, + CF_ZRTP_PASSTHRU, + CF_ZRTP_HASH, + CF_CHANNEL_SWAP, + CF_PICKUP, + CF_CONFIRM_BLIND_TRANSFER, CF_FLAG_MAX } @@ -24541,7 +24781,8 @@ namespace FreeSWITCH.Native { SCF_CLEAR_SQL = (1 << 17), SCF_THREADED_SYSTEM_EXEC = (1 << 18), SCF_SYNC_CLOCK_REQUESTED = (1 << 19), - SCF_CORE_ODBC_REQ = (1 << 20) + SCF_CORE_ODBC_REQ = (1 << 20), + SCF_DEBUG_SQL = (1 << 21) } } @@ -24850,6 +25091,7 @@ public enum switch_core_session_message_types_t { SWITCH_MESSAGE_INDICATE_SIGNAL_DATA, SWITCH_MESSAGE_INDICATE_INFO, SWITCH_MESSAGE_INDICATE_AUDIO_DATA, + SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE, SWITCH_MESSAGE_INVALID } @@ -25795,7 +26037,8 @@ namespace FreeSWITCH.Native { ED_NONE = 0, ED_MUX_READ = (1 << 0), ED_MUX_WRITE = (1 << 1), - ED_DTMF = (1 << 2) + ED_DTMF = (1 << 2), + ED_COPY_DISPLAY = (1 << 3) } } @@ -29735,7 +29978,8 @@ namespace FreeSWITCH.Native { SMBF_THREAD_LOCK = (1 << 7), SMBF_PRUNE = (1 << 8), SMBF_NO_PAUSE = (1 << 9), - SMBF_STEREO_SWAP = (1 << 10) + SMBF_STEREO_SWAP = (1 << 10), + SMBF_LOCK = (1 << 11) } } @@ -31108,7 +31352,8 @@ public enum switch_session_ctl_t { SCSC_PAUSE_CHECK, SCSC_READY_CHECK, SCSC_THREADED_SYSTEM_EXEC, - SCSC_SYNC_CLOCK_WHEN_IDLE + SCSC_SYNC_CLOCK_WHEN_IDLE, + SCSC_DEBUG_SQL } } diff --git a/src/mod/languages/mod_perl/mod_perl.c b/src/mod/languages/mod_perl/mod_perl.c index e658a0892c..b6be17c951 100644 --- a/src/mod/languages/mod_perl/mod_perl.c +++ b/src/mod/languages/mod_perl/mod_perl.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_python/mod_python.c b/src/mod/languages/mod_python/mod_python.c index b92526e135..aab40df096 100644 --- a/src/mod/languages/mod_python/mod_python.c +++ b/src/mod/languages/mod_python/mod_python.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index f370d83ba9..e17c590a71 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h index aeb0245f11..bca61c69ea 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c index e7a68a632f..0003dda0d8 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c index 13794e65dd..819ce6e4c7 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c index 63709a4d8f..38b7890024 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c index 7bc73d07e7..f1547ad53c 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c index 4f142dbc2f..41337effc2 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/languages/mod_yaml/mod_yaml.c b/src/mod/languages/mod_yaml/mod_yaml.c index 7142997868..b6827d2960 100644 --- a/src/mod/languages/mod_yaml/mod_yaml.c +++ b/src/mod/languages/mod_yaml/mod_yaml.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/loggers/mod_console/mod_console.c b/src/mod/loggers/mod_console/mod_console.c index 06956708fc..451cca78c3 100644 --- a/src/mod/loggers/mod_console/mod_console.c +++ b/src/mod/loggers/mod_console/mod_console.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/say/mod_say_de/mod_say_de.c b/src/mod/say/mod_say_de/mod_say_de.c index 542e4e6da4..b4ae2d83b4 100644 --- a/src/mod/say/mod_say_de/mod_say_de.c +++ b/src/mod/say/mod_say_de/mod_say_de.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_en/mod_say_en.c b/src/mod/say/mod_say_en/mod_say_en.c index 4e6b21abdf..82a6837478 100644 --- a/src/mod/say/mod_say_en/mod_say_en.c +++ b/src/mod/say/mod_say_en/mod_say_en.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_es/mod_say_es.c b/src/mod/say/mod_say_es/mod_say_es.c index 91675aa872..14d853a016 100644 --- a/src/mod/say/mod_say_es/mod_say_es.c +++ b/src/mod/say/mod_say_es/mod_say_es.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/applications/mod_fax/mod_fax.2008.vcproj b/src/mod/say/mod_say_fa/mod_say_fa.2008.vcproj similarity index 74% rename from src/mod/applications/mod_fax/mod_fax.2008.vcproj rename to src/mod/say/mod_say_fa/mod_say_fa.2008.vcproj index dd10ca8a93..7cd7862cd7 100644 --- a/src/mod/applications/mod_fax/mod_fax.2008.vcproj +++ b/src/mod/say/mod_say_fa/mod_say_fa.2008.vcproj @@ -2,9 +2,9 @@ @@ -23,7 +23,7 @@ Name="Debug|Win32" ConfigurationType="2" InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops" - CharacterSet="0" + CharacterSet="2" > @@ -86,7 +84,7 @@ Name="Debug|x64" ConfigurationType="2" InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops" - CharacterSet="0" + CharacterSet="2" > @@ -215,7 +209,7 @@ Name="Release|x64" ConfigurationType="2" InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops" - CharacterSet="0" + CharacterSet="2" > - - - - diff --git a/src/mod/say/mod_say_fa/mod_say_fa.2010.vcxproj b/src/mod/say/mod_say_fa/mod_say_fa.2010.vcxproj new file mode 100644 index 0000000000..cefc30eeab --- /dev/null +++ b/src/mod/say/mod_say_fa/mod_say_fa.2010.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_fa + {85a71f08-9f6c-11e1-9967-002186cfa17e} + mod_say_fa + Win32Proj + + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {f6c55d93-b927-4483-bb69-15aef3dd2dff} + false + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + \ No newline at end of file diff --git a/src/mod/say/mod_say_fa/mod_say_fa.c b/src/mod/say/mod_say_fa/mod_say_fa.c new file mode 100644 index 0000000000..e044fca7b6 --- /dev/null +++ b/src/mod/say/mod_say_fa/mod_say_fa.c @@ -0,0 +1,685 @@ +/* + * Copyright (c) 2007, Anthony Minessale II + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the original author; nor the names of any contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Anthony Minessale II + * Mahdi Moradi + * Babak Yakhchali + * + * mod_say_fa.c -- Say for Persian + * + */ + +#include +#include +#include + +void gregorian_to_jalali(/* output */ int *j_y, int *j_m, int *j_d, + /* input */ int g_y, int g_m, int g_d); +void jalali_to_gregorian(/* output */ int *g_y, int *g_m, int *g_d, + /* input */ int j_y, int j_m, int j_d); + +SWITCH_MODULE_LOAD_FUNCTION(mod_say_fa_load); +SWITCH_MODULE_DEFINITION(mod_say_fa, mod_say_fa_load, NULL, NULL); + +#define say_num(num, meth) { \ + char tmp[80]; \ + switch_status_t tstatus; \ + switch_say_method_t smeth = say_args->method; \ + switch_say_type_t stype = say_args->type; \ + say_args->type = SST_ITEMS; say_args->method = meth; \ + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ + if ((tstatus = \ + fa_say_general_count(session, tmp, say_args, args)) \ + != SWITCH_STATUS_SUCCESS) { \ + return tstatus; \ + } \ + say_args->method = smeth; say_args->type = stype; \ + } \ + +#define say_file(...) { \ + char tmp[80]; \ + switch_status_t tstatus; \ + switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__); \ + if ((tstatus = \ + switch_ivr_play_file(session, NULL, tmp, args)) \ + != SWITCH_STATUS_SUCCESS){ \ + return tstatus; \ + } \ + if (!switch_channel_ready(switch_core_session_get_channel(session))) { \ + return SWITCH_STATUS_FALSE; \ + }} \ + +static switch_status_t play_group(switch_say_method_t method, int a, int b, int c, char *what, switch_core_session_t *session, switch_input_args_t *args) +{ + if (a) { + if ( !b && !c ) + { + if( method == SSM_COUNTED ) + { + say_file("digits/%d00om.wav", a); + } + else + say_file("digits/%d00.wav", a); + b = c = 0; + } + else + say_file("digits/%d00+.wav", a); + } + + if (b) { + if ( !c || b == 1 ) + { + if( method == SSM_COUNTED ) + { + say_file("digits/%d%dom.wav", b, c); + } + else + say_file("digits/%d%d.wav", b, c); + c = 0; + } + else + say_file("digits/%d0+.wav", b); + } + + if (c) { + if (method == SSM_COUNTED) { + say_file("digits/%dom.wav", c); + } else { + say_file("digits/%d.wav", c); + } + } + + if (what && (a || b || c)) { + say_file(what); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t fa_say_general_count(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args) +{ + int in; + int x = 0; + int sum = 0; + char what_file[50] = ""; + int places[9] = { 0 }; + char sbuf[128] = ""; + switch_status_t status; + + if (say_args->method == SSM_ITERATED) { + if ((tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf)))) { + char *p; + for (p = tosay; p && *p; p++) { + say_file("digits/%c.wav", *p); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); + return SWITCH_STATUS_GENERR; + } + return SWITCH_STATUS_SUCCESS; + } + + if (!(tosay = switch_strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); + return SWITCH_STATUS_GENERR; + } + + in = atoi(tosay); + + if (in != 0) { + for (x = 8; x >= 0; x--) { + int num = (int) pow(10, x); + if ((places[(uint32_t) x] = in / num)) { + in -= places[(uint32_t) x] * num; + } + } + + switch (say_args->method) { + case SSM_COUNTED: + case SSM_PRONOUNCED: + sum = places[5] + places[4] + places[3] + places[2] + places[1] + places[0]; + if( !sum ) + { + if( say_args->method == SSM_COUNTED ) + { + strcpy(what_file,"digits/1000000om.wav"); + } + else + strcpy(what_file,"digits/1000000.wav"); + } + else + strcpy(what_file,"digits/1000000+.wav"); + if ((status = play_group(SSM_PRONOUNCED, places[8], places[7], places[6], what_file, session, args)) != SWITCH_STATUS_SUCCESS) { + return status; + } + sum = places[2] + places[1] + places[0]; + if( !sum ) + { if( say_args->method == SSM_COUNTED ) + { + strcpy(what_file,"digits/1000om.wav"); + } + else + strcpy(what_file,"digits/1000.wav"); + } + else + strcpy(what_file,"digits/1000+.wav"); + if ((status = play_group(SSM_PRONOUNCED, places[5], places[4], places[3], what_file, session, args)) != SWITCH_STATUS_SUCCESS) { + return status; + } + if ((status = play_group(say_args->method, places[2], places[1], places[0], NULL, session, args)) != SWITCH_STATUS_SUCCESS) { + return status; + } + break; + default: + break; + } + } else { + say_file("digits/0.wav"); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t fa_say_time(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args) +{ + int32_t t; + switch_time_t target = 0, target_now = 0; + switch_time_exp_t tm, tm_now; + uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0; + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *tz = switch_channel_get_variable(channel, "timezone"); + int jalali_year = 1, jalali_month = 0, jalali_day = 0; + + if (say_args->type == SST_TIME_MEASUREMENT) { + int64_t hours = 0; + int64_t minutes = 0; + int64_t seconds = 0; + int64_t r = 0; + + if (strchr(tosay, ':')) { + char *tme = switch_core_session_strdup(session, tosay); + char *p; + + if ((p = strrchr(tme, ':'))) { + *p++ = '\0'; + seconds = atoi(p); + if ((p = strchr(tme, ':'))) { + *p++ = '\0'; + minutes = atoi(p); + if (tme) { + hours = atoi(tme); + } + } else { + minutes = atoi(tme); + } + } + } else { + if ((seconds = atol(tosay)) <= 0) { + seconds = (int64_t) switch_epoch_time_now(NULL); + } + + if (seconds >= 60) { + minutes = seconds / 60; + r = seconds % 60; + seconds = r; + } + + if (minutes >= 60) { + hours = minutes / 60; + r = minutes % 60; + minutes = r; + } + } + + if (hours) { + say_num(hours, SSM_PRONOUNCED); + if(minutes || seconds) + { + say_file("time/hour+.wav"); + } + else + say_file("time/hour.wav"); + } + + if (minutes) { + say_num(minutes, SSM_PRONOUNCED); + if( seconds ) + { + say_file("time/minutes+.wav"); + } + else + say_file("time/minutes.wav"); + } + + if (seconds) { + say_num(seconds, SSM_PRONOUNCED); + say_file("time/seconds.wav"); + } + + return SWITCH_STATUS_SUCCESS; + } + + if ((t = atol(tosay)) > 0) { + target = switch_time_make(t, 0); + target_now = switch_micro_time_now(); + } else { + target = switch_micro_time_now(); + target_now = switch_micro_time_now(); + } + + if (tz) { + int check = atoi(tz); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Timezone is [%s]\n", tz); + if (check) { + switch_time_exp_tz(&tm, target, check); + switch_time_exp_tz(&tm_now, target_now, check); + } else { + switch_time_exp_tz_name(tz, &tm, target); + switch_time_exp_tz_name(tz, &tm_now, target_now); + } + } else { + switch_time_exp_lt(&tm, target); + switch_time_exp_lt(&tm_now, target_now); + } + + switch (say_args->type) { + case SST_CURRENT_DATE_TIME: + say_date = say_time = 1; + break; + case SST_CURRENT_DATE: + say_date = 1; + break; + case SST_CURRENT_TIME: + say_time = 1; + break; + case SST_SHORT_DATE_TIME: + say_time = 1; + if (tm.tm_year != tm_now.tm_year) { + say_date = 1; + break; + } + if (tm.tm_yday == tm_now.tm_yday) { + say_today = 1; + break; + } + if (tm.tm_yday == tm_now.tm_yday - 1) { + say_yesterday = 1; + break; + } + if (tm.tm_yday >= tm_now.tm_yday - 5) { + say_dow = 1; + break; + } + if (tm.tm_mon != tm_now.tm_mon) { + say_month = say_day = say_dow = 1; + break; + } + + say_month = say_day = say_dow = 1; + + break; + default: + break; + } + + if (say_today) { + say_file("time/today.wav"); + } + if (say_yesterday) { + say_file("time/yesterday.wav"); + } + if (say_dow) { + say_file("time/day-%d.wav", tm.tm_wday); + } + + if (say_date) { + say_year = say_month = say_day = say_dow = 1; + say_today = say_yesterday = 0; + } + + gregorian_to_jalali(&jalali_year,&jalali_month,&jalali_day,tm.tm_year + 1900,tm.tm_mon + 1,tm.tm_mday); + + if (say_day) { + if(jalali_day > 20 && jalali_day != 30) + { + say_file("digits/%d+.wav", (jalali_day - jalali_day % 10)); + say_file("digits/%de.wav", jalali_day % 10); + } + else + say_file("digits/%de.wav", jalali_day); + } + + if (say_month) { + say_file("time/mon-%d.wav", jalali_month - 1); + } + + if (say_year) { + say_num(jalali_year, SSM_PRONOUNCED); + } + + if (say_time) { + int32_t hour = tm.tm_hour, pm = 0; + + if (say_date || say_today || say_yesterday || say_dow) { + say_file("time/at.wav"); + } + + if (hour > 12) { + hour -= 12; + pm = 1; + } else if (hour == 12) { + pm = 1; + } else if (hour == 0) { + hour = 12; + pm = 0; + } + + say_file("time/hour-e.wav"); + say_file("digits/%do.wav",hour); + play_group(SSM_PRONOUNCED, 0, (tm.tm_min - tm.tm_min % 10) / 10, tm.tm_min % 10, "time/minutes-e.wav", session, args); + say_file("time/%s.wav", pm ? "p-m" : "a-m"); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t fa_say_money(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args) +{ + char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */ + char *rials = NULL; + char *cents = NULL; + + if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) { + /* valid characters are 0 - 9, period (.), minus (-), and plus (+) - remove all others */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); + return SWITCH_STATUS_GENERR; + } + + rials = sbuf; + + if ((cents = strchr(sbuf, '.'))) { + *cents++ = '\0'; + if (strlen(cents) > 2) { + cents[2] = '\0'; + } + } + + /* If positive sign - skip over" */ + if (sbuf[0] == '+') { + say_file("currency/positive-e.wav"); + rials++; + } + + /* If negative say "negative" */ + if (sbuf[0] == '-') { + say_file("currency/negative-e.wav"); + rials++; + } + + /* Say rial amount */ + fa_say_general_count(session, rials, say_args, args); + say_file("currency/rials.wav"); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t fa_say_telephone(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args) +{ + char *phone_number; + int tosay_length = 0; + + if( !tosay || !strlen(tosay) ) + { + return SWITCH_STATUS_SUCCESS; + } + + if ((phone_number = strchr(tosay,'-'))) + { + *phone_number++ = '\0'; + fa_say_telephone(session,tosay,say_args,args); + fa_say_telephone(session,phone_number,say_args,args); + return SWITCH_STATUS_SUCCESS; + } + + tosay_length = strlen(tosay); + if( tosay_length == 1 ) + { + say_file("digits/%d.wav",tosay[0] - 48); + } + else if ( tosay[0] == '0' ) + { + if( tosay[1] == '0' ) + { + say_file("digits/00.wav"); + fa_say_telephone(session,tosay + 2,say_args,args); + } + else + { + say_file("digits/0.wav"); + fa_say_telephone(session,tosay + 1,say_args,args); + } + } + else if ( tosay_length % 2 ) + { + play_group(SSM_PRONOUNCED,tosay[0] - 48,tosay[1] - 48,tosay[2] - 48,NULL,session,args); + fa_say_telephone(session,tosay + 3,say_args,args); + } + else + { + play_group(SSM_PRONOUNCED,0,tosay[0] - 48,tosay[1] - 48,NULL,session,args); + fa_say_telephone(session,tosay + 2,say_args,args); + } + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t fa_say(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args) +{ + switch_say_callback_t say_cb = NULL; + + switch (say_args->type) { + case SST_NUMBER: + case SST_ITEMS: + case SST_PERSONS: + case SST_MESSAGES: + say_cb = fa_say_general_count; + break; + case SST_TIME_MEASUREMENT: + case SST_CURRENT_DATE: + case SST_CURRENT_TIME: + case SST_CURRENT_DATE_TIME: + case SST_SHORT_DATE_TIME: + say_cb = fa_say_time; + break; + case SST_IP_ADDRESS: + return switch_ivr_say_ip(session, tosay, fa_say_general_count, say_args, args); + break; + case SST_NAME_SPELLED: + case SST_NAME_PHONETIC: + return switch_ivr_say_spell(session, tosay, say_args, args); + break; + case SST_CURRENCY: + say_cb = fa_say_money; + break; + case SST_TELEPHONE_NUMBER: + say_cb = fa_say_telephone; + break; + default: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown Say type=[%d]\n", say_args->type); + break; + } + + if (say_cb) { + return say_cb(session, tosay, say_args, args); + } + + return SWITCH_STATUS_FALSE; +} + +SWITCH_MODULE_LOAD_FUNCTION(mod_say_fa_load) +{ + switch_say_interface_t *say_interface; + /* connect my internal structure to the blank pointer passed to me */ + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + say_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SAY_INTERFACE); + say_interface->interface_name = "fa"; + say_interface->say_function = fa_say; + + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; +} + +/* Utility functions */ + +int g_days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +int j_days_in_month[12] = {31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29}; + +void gregorian_to_jalali(int *j_y, int *j_m, int *j_d, + int g_y, int g_m, int g_d) +{ + int gy, gm, gd; + int jy, jm, jd; + long g_day_no, j_day_no; + int j_np; + + int i; + + gy = g_y-1600; + gm = g_m-1; + gd = g_d-1; + + g_day_no = 365*gy+(gy+3)/4-(gy+99)/100+(gy+399)/400; + for (i=0;i1 && ((gy%4==0 && gy%100!=0) || (gy%400==0))) + /* leap and after Feb */ + ++g_day_no; + g_day_no += gd; + + j_day_no = g_day_no-79; + + j_np = j_day_no / 12053; + j_day_no %= 12053; + + jy = 979+33*j_np+4*(j_day_no/1461); + j_day_no %= 1461; + + if (j_day_no >= 366) { + jy += (j_day_no-1)/365; + j_day_no = (j_day_no-1)%365; + } + + for (i = 0; i < 11 && j_day_no >= j_days_in_month[i]; ++i) { + j_day_no -= j_days_in_month[i]; + } + jm = i+1; + jd = j_day_no+1; + *j_y = jy; + *j_m = jm; + *j_d = jd; +} + +void jalali_to_gregorian(int *g_y, int *g_m, int *g_d, + int j_y, int j_m, int j_d) +{ + int gy, gm, gd; + int jy, jm, jd; + long g_day_no, j_day_no; + int leap; + + int i; + + jy = j_y-979; + jm = j_m-1; + jd = j_d-1; + + j_day_no = 365*jy + (jy/33)*8 + (jy%33+3)/4; + for (i=0; i < jm; ++i) + j_day_no += j_days_in_month[i]; + + j_day_no += jd; + + g_day_no = j_day_no+79; + + gy = 1600 + 400*(g_day_no/146097); /* 146097 = 365*400 + 400/4 - 400/100 + 400/400 */ + g_day_no = g_day_no % 146097; + + leap = 1; + if (g_day_no >= 36525) /* 36525 = 365*100 + 100/4 */ + { + g_day_no--; + gy += 100*(g_day_no/36524); /* 36524 = 365*100 + 100/4 - 100/100 */ + g_day_no = g_day_no % 36524; + + if (g_day_no >= 365) + g_day_no++; + else + leap = 0; + } + + gy += 4*(g_day_no/1461); /* 1461 = 365*4 + 4/4 */ + g_day_no %= 1461; + + if (g_day_no >= 366) { + leap = 0; + + g_day_no--; + gy += g_day_no/365; + g_day_no = g_day_no % 365; + } + + for (i = 0; g_day_no >= g_days_in_month[i] + (i == 1 && leap); i++) + g_day_no -= g_days_in_month[i] + (i == 1 && leap); + gm = i+1; + gd = g_day_no+1; + + *g_y = gy; + *g_m = gm; + *g_d = gd; +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ \ No newline at end of file diff --git a/src/mod/say/mod_say_fa/mod_say_fa.vcproj b/src/mod/say/mod_say_fa/mod_say_fa.vcproj new file mode 100644 index 0000000000..02de50a6fa --- /dev/null +++ b/src/mod/say/mod_say_fa/mod_say_fa.vcproj @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/say/mod_say_fr/mod_say_fr.c b/src/mod/say/mod_say_fr/mod_say_fr.c index 37e126ecb2..952e0c595e 100644 --- a/src/mod/say/mod_say_fr/mod_say_fr.c +++ b/src/mod/say/mod_say_fr/mod_say_fr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_he/mod_say_he.c b/src/mod/say/mod_say_he/mod_say_he.c index 62f0b59ba2..cca0cbf465 100644 --- a/src/mod/say/mod_say_he/mod_say_he.c +++ b/src/mod/say/mod_say_he/mod_say_he.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Shahar Hadas + * Copyright (c) 2011-2012, Shahar Hadas * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_hr/mod_say_hr.c b/src/mod/say/mod_say_hr/mod_say_hr.c index f08a0de0a2..e7241bd80f 100644 --- a/src/mod/say/mod_say_hr/mod_say_hr.c +++ b/src/mod/say/mod_say_hr/mod_say_hr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_hu/mod_say_hu.c b/src/mod/say/mod_say_hu/mod_say_hu.c index 847d6f811d..33d07b1b65 100644 --- a/src/mod/say/mod_say_hu/mod_say_hu.c +++ b/src/mod/say/mod_say_hu/mod_say_hu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_it/mod_say_it.c b/src/mod/say/mod_say_it/mod_say_it.c index ef4b3d2bda..1cbe1d8488 100644 --- a/src/mod/say/mod_say_it/mod_say_it.c +++ b/src/mod/say/mod_say_it/mod_say_it.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_ja/mod_say_ja.c b/src/mod/say/mod_say_ja/mod_say_ja.c index aa11a87ebf..0da0101ea7 100644 --- a/src/mod/say/mod_say_ja/mod_say_ja.c +++ b/src/mod/say/mod_say_ja/mod_say_ja.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_nl/mod_say_nl.c b/src/mod/say/mod_say_nl/mod_say_nl.c index e1e822b2f6..e823a32b12 100644 --- a/src/mod/say/mod_say_nl/mod_say_nl.c +++ b/src/mod/say/mod_say_nl/mod_say_nl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_pt/mod_say_pt.c b/src/mod/say/mod_say_pt/mod_say_pt.c index e3e7280c45..e1cc3084e1 100644 --- a/src/mod/say/mod_say_pt/mod_say_pt.c +++ b/src/mod/say/mod_say_pt/mod_say_pt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_ru/mod_say_ru.c b/src/mod/say/mod_say_ru/mod_say_ru.c index 8c413c956b..68daf19f12 100644 --- a/src/mod/say/mod_say_ru/mod_say_ru.c +++ b/src/mod/say/mod_say_ru/mod_say_ru.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_th/mod_say_th.c b/src/mod/say/mod_say_th/mod_say_th.c index 675c1a44e6..77b62c647a 100644 --- a/src/mod/say/mod_say_th/mod_say_th.c +++ b/src/mod/say/mod_say_th/mod_say_th.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/say/mod_say_zh/mod_say_zh.c b/src/mod/say/mod_say_zh/mod_say_zh.c index 0dc566289a..33fb7d2f95 100644 --- a/src/mod/say/mod_say_zh/mod_say_zh.c +++ b/src/mod/say/mod_say_zh/mod_say_zh.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Anthony Minessale II + * Copyright (c) 2007-2012, Anthony Minessale II * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/mod/sdk/autotools/src/mod_example.c b/src/mod/sdk/autotools/src/mod_example.c index b94e81cec7..1888c1e711 100644 --- a/src/mod/sdk/autotools/src/mod_example.c +++ b/src/mod/sdk/autotools/src/mod_example.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2011, Anthony Minessale II + * Copyright (C) 2005/2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/timers/mod_posix_timer/mod_posix_timer.c b/src/mod/timers/mod_posix_timer/mod_posix_timer.c index 425e98c93d..cfb6584701 100644 --- a/src/mod/timers/mod_posix_timer/mod_posix_timer.c +++ b/src/mod/timers/mod_posix_timer/mod_posix_timer.c @@ -1,5 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -21,98 +22,162 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Chris Rienzo + * Christopher M. Rienzo * Timo Teräs (based on mod_timerfd.c) * + * Maintainer: Christopher M. Rienzo + * * mod_posix_timer.c -- soft timer implemented with POSIX timers (timer_create/timer_settime/timer_getoverrun) * */ #include -#include -#include +#include /* timer_* */ +#include /* sigaction(), timer_*, etc. */ +#include /* pipe() */ +#include /* fcntl() */ +#include /* strerror() */ +#include /* uint8_t */ +#include /* errno */ +#include /* select() */ +#include /* pthread_sigmask() */ SWITCH_MODULE_LOAD_FUNCTION(mod_posix_timer_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_posix_timer_shutdown); -SWITCH_MODULE_DEFINITION(mod_posix_timer, mod_posix_timer_load, mod_posix_timer_shutdown, NULL); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_posix_timer_runtime); +SWITCH_MODULE_DEFINITION(mod_posix_timer, mod_posix_timer_load, mod_posix_timer_shutdown, mod_posix_timer_runtime); +#define SIG SIGRTMAX #define MAX_INTERVAL 2000 /* ms */ #define TIMERS_PER_INTERVAL 4 - -typedef struct { - int users; - timer_t timer; - switch_size_t tick; - switch_mutex_t *mutex; - switch_thread_cond_t *cond; - int interval; - int id; -} interval_timer_t; - -static struct { - switch_memory_pool_t *pool; - int shutdown; - interval_timer_t interval_timers[MAX_INTERVAL + 1][TIMERS_PER_INTERVAL]; - int next_interval_timer_id[MAX_INTERVAL + 1]; - switch_mutex_t *interval_timers_mutex; -} globals; +#define MAX_ACTIVE_TIMERS 256 /* one byte */ /** - * Notified by POSIX timer of a tick + * Module's internal timer data. + * Keeps track of how many users are using the timer + * and the condvar to signal threads waiting on the timer. */ -static void posix_timer_notify(union sigval data) -{ - interval_timer_t *it = (interval_timer_t *)data.sival_ptr; - switch_mutex_lock(it->mutex); - if (it->users) { - it->tick += 1 + timer_getoverrun(it->timer); - switch_thread_cond_broadcast(it->cond); - } - switch_mutex_unlock(it->mutex); +typedef struct { + /** Number of users of this timer */ + int users; + /** The POSIX timer handle */ + timer_t timer; + /** Number of ticks */ + switch_size_t tick; + /** synchronizes access to condvar, users */ + switch_mutex_t *mutex; + /** condvar for threads waiting on timer */ + switch_thread_cond_t *cond; + /** The timer period in ms */ + int interval; + /** Which timer for this interval */ + int num; + /** The timer's index into the active_interval_timers array */ + int active_id; +} interval_timer_t; - if (globals.shutdown) { - switch_mutex_lock(globals.interval_timers_mutex); - if (it->users) { - timer_delete(it->timer); - memset(&it->timer, 0, sizeof(it->timer)); - it->users = 0; +/** + * Module global data + */ +static struct { + /** Module memory pool */ + switch_memory_pool_t *pool; + /** True if module is shutting down */ + int shutdown; + /** Maps intervals to timers */ + interval_timer_t interval_timers[MAX_INTERVAL + 1][TIMERS_PER_INTERVAL]; + /** Maps IDs to timers */ + interval_timer_t *active_interval_timers[MAX_ACTIVE_TIMERS]; + /** Next timer to assign for a particular interval */ + int next_interval_timer_num[MAX_INTERVAL + 1]; + /** Synchronizes access to timer creation / deletion */ + switch_mutex_t *interval_timers_mutex; + /** Synchronizes access to active timers array */ + switch_mutex_t *active_timers_mutex; + /** number of active timers */ + int active_timers_count; + /** self-pipe to notify thread of tick from a signal handler */ + int timer_tick_pipe[2]; +} globals; + + +/** + * Handle timer signal + * @param sig the signal + * @param si the signal information + * @param cu unused + */ +static void timer_signal_handler(int sig, siginfo_t *si, void *cu) +{ + if (sig == SIG && si->si_code == SI_TIMER) { + int val = si->si_value.sival_int; + if (val >= 0 && val <= MAX_ACTIVE_TIMERS) { + uint8_t active_id = (uint8_t)val; + /* notify runtime thread that timer identified by active_id has ticked */ + write(globals.timer_tick_pipe[1], &active_id, 1); } - switch_mutex_unlock(globals.interval_timers_mutex); } } /** - * Start a new timer + * Start a new interval timer + * @param it the timer + * @param interval the timer interval + * @return SWITCH_STATUS_SUCCESS if successful */ -static switch_status_t posix_timer_start_interval(interval_timer_t *it, int interval) +static switch_status_t interval_timer_start(interval_timer_t *it, int interval) { - struct sigevent sigev; - struct itimerspec val; - if (globals.shutdown) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "module is shutting down, ignoring request\n"); return SWITCH_STATUS_GENERR; } if (it->users <= 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "starting %d ms timer #%d\n", it->interval, it->id + 1); - /* reset */ + struct sigevent sigev; + struct itimerspec val; + int active_id = -1; + int i; + + /* find an available id for this timer */ + for (i = 0; i < MAX_ACTIVE_TIMERS && active_id == -1; i++) { + switch_mutex_lock(globals.active_timers_mutex); + if(globals.active_interval_timers[i] == NULL) { + active_id = i; + } + switch_mutex_unlock(globals.active_timers_mutex); + } + if (active_id == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no more timers can be created!\n"); + return SWITCH_STATUS_GENERR; + } + it->active_id = active_id; + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "starting %d ms timer #%d (%d)\n", it->interval, it->num + 1, it->active_id); + + /* reset timer data */ it->tick = 0; it->users = 0; - /* reuse, if possible */ + /* reuse mutex/condvar */ if (it->mutex == NULL) { switch_mutex_init(&it->mutex, SWITCH_MUTEX_NESTED, globals.pool); switch_thread_cond_create(&it->cond, globals.pool); } - /* create the POSIX timer. Will notify the posix_timer_notify thread on ticks. */ + /* create the POSIX timer. Will send SIG on each tick. */ memset(&sigev, 0, sizeof(sigev)); - sigev.sigev_notify = SIGEV_THREAD; - sigev.sigev_notify_function = posix_timer_notify; - sigev.sigev_value.sival_ptr = (void *)it; + sigev.sigev_notify = SIGEV_SIGNAL; + sigev.sigev_signo = SIG; + sigev.sigev_value.sival_int = active_id; if (timer_create(CLOCK_MONOTONIC, &sigev, &it->timer) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to create timer: %s\n", strerror(errno)); return SWITCH_STATUS_GENERR; } + switch_mutex_lock(globals.active_timers_mutex); + globals.active_interval_timers[it->active_id] = it; + globals.active_timers_count++; + switch_mutex_unlock(globals.active_timers_mutex); + /* start the timer to tick at interval */ memset(&val, 0, sizeof(val)); val.it_interval.tv_sec = interval / 1000; @@ -120,6 +185,11 @@ static switch_status_t posix_timer_start_interval(interval_timer_t *it, int inte val.it_value.tv_sec = 0; val.it_value.tv_nsec = 100000; if (timer_settime(it->timer, 0, &val, NULL) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to start timer: %s\n", strerror(errno)); + switch_mutex_lock(globals.active_timers_mutex); + globals.active_interval_timers[it->active_id] = NULL; + globals.active_timers_count--; + switch_mutex_unlock(globals.active_timers_mutex); return SWITCH_STATUS_GENERR; } } @@ -129,18 +199,39 @@ static switch_status_t posix_timer_start_interval(interval_timer_t *it, int inte } /** - * Stop a timer + * Delete an interval timer + * @param it the interval timer */ -static switch_status_t posix_timer_stop_interval(interval_timer_t *it) +static void interval_timer_delete(interval_timer_t *it) +{ + /* remove from active timers */ + switch_mutex_lock(globals.active_timers_mutex); + if (globals.active_interval_timers[it->active_id]) { + globals.active_interval_timers[it->active_id] = NULL; + globals.active_timers_count--; + } + switch_mutex_unlock(globals.active_timers_mutex); + + /* delete the POSIX timer and mark interval timer as destroyed (users == 0) */ + switch_mutex_lock(it->mutex); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "deleting %d ms timer #%d (%d)\n", it->interval, it->num + 1, it->active_id); + timer_delete(it->timer); + memset(&it->timer, 0, sizeof(it->timer)); + it->users = 0; + switch_mutex_unlock(it->mutex); +} + +/** + * Remove a user from interval timer. Delete if no more users remain. + * @param it the interval timer + * @return SWITCH_STATUS_SUCCESS + */ +static switch_status_t interval_timer_stop(interval_timer_t *it) { if (it->users > 0) { it->users--; if (it->users == 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "stopping %d ms timer #%d\n", it->interval, it->id + 1); - switch_mutex_lock(it->mutex); - timer_delete(it->timer); - memset(&it->timer, 0, sizeof(it->timer)); - switch_mutex_unlock(it->mutex); + interval_timer_delete(it); } } return SWITCH_STATUS_SUCCESS; @@ -151,26 +242,27 @@ static switch_status_t posix_timer_stop_interval(interval_timer_t *it) * @param timer the timer * @return SWITCH_STATUS_SUCCESS if successful otherwise SWITCH_STATUS_GENERR */ -static switch_status_t posix_timer_init(switch_timer_t *timer) +static switch_status_t mod_posix_timer_init(switch_timer_t *timer) { interval_timer_t *it; switch_status_t status; - int interval_timer_id; + int interval_timer_num; if (timer->interval < 1 || timer->interval > MAX_INTERVAL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Bad interval: %d\n", timer->interval); return SWITCH_STATUS_GENERR; } switch_mutex_lock(globals.interval_timers_mutex); - interval_timer_id = globals.next_interval_timer_id[timer->interval]++; - if (globals.next_interval_timer_id[timer->interval] >= TIMERS_PER_INTERVAL) { - globals.next_interval_timer_id[timer->interval] = 0; + interval_timer_num = globals.next_interval_timer_num[timer->interval]++; + if (globals.next_interval_timer_num[timer->interval] >= TIMERS_PER_INTERVAL) { + globals.next_interval_timer_num[timer->interval] = 0; } - it = &globals.interval_timers[timer->interval][interval_timer_id]; - it->id = interval_timer_id; + it = &globals.interval_timers[timer->interval][interval_timer_num]; + it->num = interval_timer_num; it->interval = timer->interval; - status = posix_timer_start_interval(it, timer->interval); + status = interval_timer_start(it, timer->interval); timer->private_info = it; switch_mutex_unlock(globals.interval_timers_mutex); @@ -182,7 +274,7 @@ static switch_status_t posix_timer_init(switch_timer_t *timer) * @param timer the timer * @return SWITCH_STATUS_SUCCESS */ -static switch_status_t posix_timer_step(switch_timer_t *timer) +static switch_status_t mod_posix_timer_step(switch_timer_t *timer) { timer->tick++; timer->samplecount += timer->samples; @@ -193,16 +285,16 @@ static switch_status_t posix_timer_step(switch_timer_t *timer) /** * Timer module interface: wait for next tick * @param timer the timer - * @return SWITCH_STATUS_SUCCESS if successful + * @return SWITCH_STATUS_SUCCESS if successful */ -static switch_status_t posix_timer_next(switch_timer_t *timer) +static switch_status_t mod_posix_timer_next(switch_timer_t *timer) { interval_timer_t *it = timer->private_info; if ((int)(timer->tick - it->tick) < -1) { timer->tick = it->tick; } - posix_timer_step(timer); + mod_posix_timer_step(timer); switch_mutex_lock(it->mutex); while ((int)(timer->tick - it->tick) > 0 && !globals.shutdown) { @@ -218,7 +310,7 @@ static switch_status_t posix_timer_next(switch_timer_t *timer) * @param timer the timer * @return SWITCH_STATUS_SUCCESS */ -static switch_status_t posix_timer_sync(switch_timer_t *timer) +static switch_status_t mod_posix_timer_sync(switch_timer_t *timer) { interval_timer_t *it = timer->private_info; timer->tick = it->tick; @@ -232,7 +324,7 @@ static switch_status_t posix_timer_sync(switch_timer_t *timer) * @param step true if timer should be stepped * @return SWITCH_STATUS_SUCCESS if synched, SWITCH_STATUS_FALSE otherwise */ -static switch_status_t posix_timer_check(switch_timer_t *timer, switch_bool_t step) +static switch_status_t mod_posix_timer_check(switch_timer_t *timer, switch_bool_t step) { interval_timer_t *it = timer->private_info; int diff = (int)(timer->tick - it->tick); @@ -245,7 +337,7 @@ static switch_status_t posix_timer_check(switch_timer_t *timer, switch_bool_t st /* timer pending */ timer->diff = 0; if (step) { - posix_timer_step(timer); + mod_posix_timer_step(timer); } return SWITCH_STATUS_SUCCESS; } @@ -255,44 +347,195 @@ static switch_status_t posix_timer_check(switch_timer_t *timer, switch_bool_t st * @param timer the timer * @return SWITCH_STATUS_SUCCESS if successful */ -static switch_status_t posix_timer_destroy(switch_timer_t *timer) +static switch_status_t mod_posix_timer_destroy(switch_timer_t *timer) { interval_timer_t *it = timer->private_info; switch_status_t status; switch_mutex_lock(globals.interval_timers_mutex); - status = posix_timer_stop_interval(it); + status = interval_timer_stop(it); switch_mutex_unlock(globals.interval_timers_mutex); return status; } +/** + * Load the module + */ SWITCH_MODULE_LOAD_FUNCTION(mod_posix_timer_load) { switch_timer_interface_t *timer_interface; memset(&globals, 0, sizeof(globals)); + globals.timer_tick_pipe[0] = -1; + globals.timer_tick_pipe[1] = -1; globals.pool = pool; switch_mutex_init(&globals.interval_timers_mutex, SWITCH_MUTEX_NESTED, globals.pool); + switch_mutex_init(&globals.active_timers_mutex, SWITCH_MUTEX_NESTED, globals.pool); /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(globals.pool, modname); timer_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_TIMER_INTERFACE); timer_interface->interface_name = "posix"; - timer_interface->timer_init = posix_timer_init; - timer_interface->timer_next = posix_timer_next; - timer_interface->timer_step = posix_timer_step; - timer_interface->timer_sync = posix_timer_sync; - timer_interface->timer_check = posix_timer_check; - timer_interface->timer_destroy = posix_timer_destroy; + timer_interface->timer_init = mod_posix_timer_init; + timer_interface->timer_next = mod_posix_timer_next; + timer_interface->timer_step = mod_posix_timer_step; + timer_interface->timer_sync = mod_posix_timer_sync; + timer_interface->timer_check = mod_posix_timer_check; + timer_interface->timer_destroy = mod_posix_timer_destroy; + + /* the pipe allows a signal handler to notify the runtime thread in a async-signal-safe manner */ + if (pipe(globals.timer_tick_pipe) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create pipe\n"); + globals.shutdown = 1; + return SWITCH_STATUS_GENERR; + } + fcntl(globals.timer_tick_pipe[0], F_SETFL, O_NONBLOCK); + fcntl(globals.timer_tick_pipe[1], F_SETFL, O_NONBLOCK); + + { + struct sigaction sa; + sigset_t sigmask; + + /* Prevent SIG from annoying FS process. It will be unblocked in the runtime thread. */ + sigemptyset(&sigmask); + sigaddset(&sigmask, SIG); + sigprocmask(SIG_BLOCK, &sigmask, NULL); + + /* set up signal handler */ + memset(&sa, 0, sizeof(sa)); + sa.sa_flags = SA_SIGINFO | SA_RESTART; + sa.sa_sigaction = timer_signal_handler; + sigfillset(&sa.sa_mask); + if (sigaction(SIG, &sa, NULL) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to set up signal handler: %s\n", strerror(errno)); + globals.shutdown = 1; + return SWITCH_STATUS_GENERR; + } + } return SWITCH_STATUS_SUCCESS; } +/** + * Runtime thread watches for timer ticks sent by signal handler over pipe. Broadcasts + * ticks to session threads waiting on timer. + */ +SWITCH_MODULE_RUNTIME_FUNCTION(mod_posix_timer_runtime) +{ + uint8_t active_ids[32]; + sigset_t sigmask; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "runtime thread starting\n"); + + /* allow SIG to be delivered to this thread. */ + sigemptyset(&sigmask); + sigaddset(&sigmask, SIG); + pthread_sigmask(SIG_UNBLOCK, &sigmask, NULL); + + /* run until module shutdown */ + while (!globals.shutdown) { + int retval, i; + fd_set read_fds; + struct timeval timeout = { 0, 200 * 1000 }; /* 200 ms */ + + /* wait for timer tick */ + FD_ZERO(&read_fds); + FD_SET(globals.timer_tick_pipe[0], &read_fds); + retval = select(globals.timer_tick_pipe[0] + 1, &read_fds, NULL, NULL, &timeout); + if (retval == -1) { + if (errno == EINTR) { + /* retry */ + continue; + } + if (errno == EBADF) { + /* done */ + break; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error waiting on pipe: %s. Timer thread exiting\n", strerror(errno)); + break; + } else if (retval == 0) { + /* retry */ + continue; + } + if (!FD_ISSET(globals.timer_tick_pipe[0], &read_fds)) { + /* retry */ + continue; + } + + /* which timer ticked? */ + retval = read(globals.timer_tick_pipe[0], &active_ids, 32); + if (retval == -1) { + if (errno == EINTR || errno == EAGAIN) { + /* retry */ + continue; + } + if (errno == EBADF) { + /* done */ + break; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error reading from pipe: %s. Timer thread exiting\n", strerror(errno)); + break; + } else if (retval == 0) { + /* retry */ + continue; + } + + /* notify threads of timer tick */ + for (i = 0; i < retval; i++) { + interval_timer_t *it = NULL; + + /* find interval timer */ + switch_mutex_lock(globals.active_timers_mutex); + it = globals.active_interval_timers[(int)active_ids[i]]; + switch_mutex_unlock(globals.active_timers_mutex); + if (it == NULL) { + continue; + } + + /* send notification */ + switch_mutex_lock(it->mutex); + if (it->users) { + it->tick += 1 + timer_getoverrun(it->timer); + switch_thread_cond_broadcast(it->cond); + } + switch_mutex_unlock(it->mutex); + } + } + + globals.shutdown = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "runtime thread finished\n"); + return SWITCH_STATUS_TERM; +} + +/** + * Module shutdown + */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_posix_timer_shutdown) { + int i; globals.shutdown = 1; + + if (globals.timer_tick_pipe[0] > 0) { + close(globals.timer_tick_pipe[0]); + } + if (globals.timer_tick_pipe[1] > 0) { + close(globals.timer_tick_pipe[1]); + } + + /* Delete all active timers */ + switch_mutex_lock(globals.interval_timers_mutex); + for (i = 0; i < MAX_ACTIVE_TIMERS; i++) { + interval_timer_t *it; + switch_mutex_lock(globals.active_timers_mutex); + it = globals.active_interval_timers[i]; + switch_mutex_unlock(globals.active_timers_mutex); + if (it) { + interval_timer_delete(it); + } + } + switch_mutex_unlock(globals.interval_timers_mutex); + return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/timers/mod_posix_timer/test/Makefile b/src/mod/timers/mod_posix_timer/test/Makefile new file mode 100644 index 0000000000..eda0799146 --- /dev/null +++ b/src/mod/timers/mod_posix_timer/test/Makefile @@ -0,0 +1,6 @@ +all: + gcc ../mod_posix_timer.c main.c switch.c -I. -o timer_test -lpthread -lrt -lm -g -DLOG_LEVEL=-1 + +clean: + -rm timer_test + diff --git a/src/mod/timers/mod_posix_timer/test/README b/src/mod/timers/mod_posix_timer/test/README new file mode 100644 index 0000000000..f47c511272 --- /dev/null +++ b/src/mod/timers/mod_posix_timer/test/README @@ -0,0 +1,2 @@ +Stress test for mod_posix_timer. Runs without FreeSWITCH. + diff --git a/src/mod/timers/mod_posix_timer/test/main.c b/src/mod/timers/mod_posix_timer/test/main.c new file mode 100644 index 0000000000..44f3a34aea --- /dev/null +++ b/src/mod/timers/mod_posix_timer/test/main.c @@ -0,0 +1,461 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +extern SWITCH_MODULE_LOAD_FUNCTION(mod_posix_timer_load); +extern SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_posix_timer_shutdown); +extern SWITCH_MODULE_RUNTIME_FUNCTION(mod_posix_timer_runtime); + +switch_loadable_module_interface_t *mod = NULL; +switch_memory_pool_t pool = { 0 }; +switch_timer_interface_t *timer_if; +pthread_t module_runtime_thread_id; + +pthread_mutex_t session_mutex = PTHREAD_MUTEX_INITIALIZER; +int pass_count; +int warn_count; +int fail_count; +int total_sessions; +int session_count; +int last_reported_session_count; +int shutdown; + + +/** + * Return a random sample from a normal distrubtion centered at mean with + * the specified standard deviation. + * + * THIS FUNCTION IS NOT REENTRANT!!! + */ +double randnorm(double mean, double std_dev) +{ + static double z1 = -1.0f; + double u1, u2, z0; + + /* random numbers are generated in pairs. See if new pair needs to be calculated */ + if (z1 >= 0.0f) { + z0 = z1; + z1 = -1.0f; + } else { + /* use box-muller transform to generate random number pair over normal distribution */ + u1 = drand48(); + u2 = drand48(); + z0 = sqrt(-2.0f * log(u1)) * cos(2.0f * M_PI * u2); + z1 = sqrt(-2.0f * log(u1)) * sin(2.0f * M_PI * u2); + } + + return (z0 * std_dev) + mean; +} + +/** + * Pick a random sample according the the weights + * @param weights array of weights + * @param num_weights + */ +static int sample(int *weights, int num_weights) +{ + int total_weight = weights[num_weights - 1]; + int s = floor(drand48() * total_weight); + int i; + for (i = 0; i < num_weights; i++) { + if (s < weights[i]) { + return i; + } + } + printf ("DOH! s = %f\n", s); + return 0; +} + +/* + * Calculate x - y + * @return 0 if x is before y, the difference otherwise. + */ +double timespec_subtract(struct timespec *x, struct timespec *y) +{ + struct timespec result; + + /* Perform the carry for the later subtraction by updating y. */ + if (x->tv_nsec < y->tv_nsec) { + int nsec = (y->tv_nsec - x->tv_nsec) / 1000000000 + 1; + y->tv_nsec -= 1000000000 * nsec; + y->tv_sec += nsec; + } + if (x->tv_nsec - y->tv_nsec > 1000000000) { + int nsec = (x->tv_nsec - y->tv_nsec) / 1000000000; + y->tv_nsec += 1000000000 * nsec; + y->tv_sec -= nsec; + } + + /* Return 0 if result is negative. */ + if(x->tv_sec < y->tv_sec) { + return 0.0f; + } + + /* Return the difference */ + result.tv_sec = x->tv_sec - y->tv_sec; + result.tv_nsec = x->tv_nsec - y->tv_nsec; + return (double)result.tv_sec + (double)(result.tv_nsec / 1e9); +} + +/** + * Entry point for the runtime thread + */ +static void *module_thread(void *dummy) +{ + mod_posix_timer_runtime(); + return NULL; +} + +/** + * Load mod_posix_timer and start the runtime thread + */ +static void load_module() +{ + fail_count = 0; + warn_count = 0; + pass_count = 0; + total_sessions = 0; + session_count = 0; + last_reported_session_count = 0; + shutdown = 0; + mod_posix_timer_load(&mod, &pool); + timer_if = mod->timer; + pthread_create(&module_runtime_thread_id, NULL, module_thread, NULL); +} + +/** + * Shutdown mod_posix_timer + */ +static void shutdown_module() +{ + shutdown = 1; + mod_posix_timer_shutdown(); + pthread_join(module_runtime_thread_id, NULL); +} + +/** + * Test rapidly creating and destroying timers + */ +static void test_create_destroy() +{ + switch_timer_t *timers[3000] = { 0 }; + int intervals[4] = { 10, 20, 30, 40 }; + int interval_weights[4] = { 25, 50, 75, 100 }; + int interval_counts[4] = { 0, 0, 0, 0 }; + int toggle[2] = { 75, 100 }; + int timer_count = 0; + + int i = 0; + printf("test_create_destroy()\n"); + for(i = 0; i < 100000000; i++) { + int clear = i % 100000 == 0; + int j; + for (j = 0; j < 3000; j++) { + if (sample(toggle, 2) || clear) { + if (timers[j]) { + interval_counts[timers[j]->interval / 10 - 1]--; + timer_if->timer_destroy(timers[j]); + free(timers[j]); + timers[j] = NULL; + timer_count--; + } else if (!clear) { + int interval = intervals[sample(interval_weights, 4)]; + timers[j] = malloc(sizeof(switch_timer_t)); + memset(timers[j], 0, sizeof(switch_timer_t)); + timers[j]->interval = interval; + timers[j]->samples = interval * 8; + timer_if->timer_init(timers[j]); + timer_count++; + interval_counts[interval / 10 - 1]++; + } + } + } + if (i % 1000 == 0) { + printf("timers = %d, 10ms = %d, 20ms = %d, 30ms = %d, 40ms = %d\n", timer_count, interval_counts[0], interval_counts[1], interval_counts[2], interval_counts[3]); + } + } +} + +/** + * Session thread + */ +typedef struct session_thread_data +{ + int id; + int interval; + double duration; + double actual_duration; + int failed; + int detached; +} session_thread_data_t; + +/** + * Check the result of the session thread's test + * Log a message on failure. Save the result. + */ +static void check_result(session_thread_data_t *sd) +{ + double threshold = sd->interval / 1000.0f; + double diff = sd->actual_duration - sd->duration; + if (diff < 0) { + diff = diff * -1.0f; + } + if (diff > threshold * 2.0) { + sd->failed = 2; + } else if (diff > threshold) { + sd->failed = 1; + } else { + sd->failed = 0; + } + if (sd->failed > 1) { + printf("thread #%d FAILED : expected duration = %f, actual duration = %f, diff = %f, threshold = %f\n", sd->id, sd->duration, sd->actual_duration, diff, threshold); + } else { + //printf("thread #%d PASSED : expected duration = %f, actual duration = %f, diff = %f, threshold = %f\n", sd->id, sd->duration, sd->actual_duration, diff, threshold); + + } +} + +/** + * Creates a timer and advances it until duration expires + */ +void *session_thread(void *arg) +{ + int *pass = 0; + session_thread_data_t *d = (session_thread_data_t *)arg; + switch_timer_t timer = { 0 }; + + /* start the timer */ + timer.interval = d->interval; + timer.samples = d->interval * 8; + if (timer_if->timer_init(&timer) != SWITCH_STATUS_SUCCESS) { + printf("WTF!\n"); + goto done; + } + //timer_if->timer_sync(&timer); + + /* tick for duration */ + { + int i; + struct timespec start, end; + int ticks = floor(d->duration * 1000 / d->interval); + clock_gettime(CLOCK_MONOTONIC, &start); + for (i = 0; i < ticks && !shutdown; i++) { + timer_if->timer_next(&timer); + } + clock_gettime(CLOCK_MONOTONIC, &end); + d->actual_duration = timespec_subtract(&end, &start); + } + + /* stop the timer */ + timer_if->timer_destroy(&timer); + + if (!shutdown) { + check_result(d); + } + + pthread_mutex_lock(&session_mutex); + if (d->failed > 1) { + fail_count++; + } else if (d->failed > 0) { + warn_count++; + } else { + pass_count++; + } + session_count--; + if (session_count % 100 == 0 && last_reported_session_count != session_count) { + printf("sessions = %d\n", session_count); + last_reported_session_count = session_count; + } + pthread_mutex_unlock(&session_mutex); + +done: + if (d->detached) { + free(d); + return NULL; + } + + /* return result */ + return d; +} + + +/** + * @param thread the thread + * @param id for logging + * @param interval the timer period in ms + * @param duration_mean the mean duration for this thread to execute + * @param duration_std_dev the standard deviation from the mean duration + * @param detached if true this thread is detached + */ +static void create_session_thread(pthread_t *thread, int id, int interval, double duration_mean, double duration_std_dev, int detached) +{ + session_thread_data_t *d = malloc(sizeof(session_thread_data_t)); + pthread_mutex_lock(&session_mutex); + total_sessions++; + session_count++; + if (total_sessions % 100 == 0) { + printf("total sessions = %d, sessions = %d, pass = %d, warn = %d, fail = %d\n", total_sessions, session_count, pass_count, warn_count, fail_count); + } + if (session_count % 100 == 0 && last_reported_session_count != session_count) { + printf("sessions = %d\n", session_count); + last_reported_session_count = session_count; + } + pthread_mutex_unlock(&session_mutex); + if (interval == 0) { + printf("WTF WTF WTF!!\n"); + printf("id = %d, interval = %d, duration_mean = %f, duration_std_dev = %f, detached = %d\n", id, interval, duration_mean, duration_std_dev, detached); + } + d->id = id; + d->interval = interval; + d->duration = randnorm(duration_mean, duration_std_dev); + /* truncate duration to interval tick */ + d->duration = ceil(d->duration * 1000 / interval) * interval / 1000.0f; + d->detached = detached; + d->failed = 0; + pthread_create(thread, NULL, session_thread, d); + if (detached) { + pthread_detach(*thread); + } +} + + + +/** + * Create timers at a rate of CPS for test_duration. + * + * @param interval array of timer intervals in ms + * @param interval_weights array of timer intervals weights + * @param num_intervals size of interval array + * @param test_duration how long to run this test, in seconds + * @param cps the "calls per second". This is the rate at which session threads are created + * @param duration_mean mean duration for each thread + * @param duration_std_dev standard deviation from the mean duration + * @param num_timers number of threads to create + */ +static void test_timer_session(int *interval, int *interval_weights, int num_intervals, double test_duration, int cps, int max_sessions, double duration_mean, double duration_std_dev) +{ + int i = 0; + struct timespec start, now, period; + double elapsed = 0.0f; + + printf("test_timer_session(%d, %f, %d, %d, %f, %f)\n", interval[0], test_duration, cps, max_sessions, duration_mean, duration_std_dev); + + + /* create new call threads at CPS for test_duration */ + if (cps == 1) { + period.tv_sec = 1; + period.tv_nsec = 0; + } else { + period.tv_sec = 0; + period.tv_nsec = 1000000000 / cps; + } + + clock_gettime(CLOCK_MONOTONIC, &start); + while (elapsed < test_duration) { + pthread_t thread; + int retval = clock_nanosleep(CLOCK_MONOTONIC, 0, &period, NULL); + if (retval == -1) { + if (errno == EINTR) { + /* retry */ + continue; + } + printf("clock_nanosleep() error: %s\n", strerror(errno)); + break; + } + pthread_mutex_lock(&session_mutex); + if (session_count < max_sessions) { + pthread_mutex_unlock(&session_mutex); + create_session_thread(&thread, ++i, interval[sample(interval_weights, 4)], duration_mean, duration_std_dev, 1); + } else { + pthread_mutex_unlock(&session_mutex); + } + clock_gettime(CLOCK_MONOTONIC, &now); + elapsed = timespec_subtract(&now, &start); + } + + pthread_mutex_lock(&session_mutex); + while (session_count) { + struct timespec t; + t.tv_sec = 0; + t.tv_nsec = 200 * 1000; + pthread_mutex_unlock(&session_mutex); + clock_nanosleep(CLOCK_MONOTONIC, 0, &t, NULL); + pthread_mutex_lock(&session_mutex); + } + pthread_mutex_unlock(&session_mutex); + + + printf("test_timer_session(%d, %f, %d, %d, %f, %f) done\n", interval[0], test_duration, cps, max_sessions, duration_mean, duration_std_dev); +} + +/** + * Create num_timers in threads and tick until duration_mean elapses. + * + * @param interval timer interval in ms + * @param duration_mean mean duration for each thread + * @param duration_std_dev standard deviation from the mean duration + * @param num_timers number of threads to create + */ +static void test_timer(int interval, double duration_mean, double duration_std_dev, int num_timers) +{ + int i; + int pass = 1; + pthread_t *threads = malloc(sizeof(pthread_t) * num_timers); + printf("test_timer(%d, %f, %f, %d)\n", interval, duration_mean, duration_std_dev, num_timers); + + + /* create threads */ + for (i = 0; i < num_timers; i++) { + create_session_thread(&threads[i], i, interval, duration_mean, duration_std_dev, 0); + } + + /* wait for thread results */ + for (i = 0; i < num_timers; i++) { + void *d = NULL; + pthread_join(threads[i], &d); + if (d) { + int result; + session_thread_data_t *sd = (session_thread_data_t *)d; + pass = pass & (sd->failed < 2); + free(sd); + } + } + + printf("test_timer(%d, %f, %f, %d) : %s\n", interval, duration_mean, duration_std_dev, num_timers, pass ? "PASS" : "FAIL"); + free(threads); +} + +/** + * Main program + * + */ +int main (int argc, char **argv) +{ + //int intervals[4] = { 10, 20, 30, 40 }; + //int interval_weights[4] = { 2, 95, 97, 100 }; + int intervals[1] = { 20 }; + int interval_weights[1] = { 100 }; + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + srand48(ts.tv_nsec); + load_module(); + //test_timer(20, 5.0f, .2f, 1000); + //test_timer_session(intervals, interval_weights, 4, 2 * 86400.0f, 90, 2000, 30.0, 5.0f); + while(1) { + /* stop periodically to trigger timer shutdown */ + test_timer_session(intervals, interval_weights, 1, 60, 150, 3000, 30.0, 5.0f); + } + //test_timer(1000, 5.0f, 1); + //test_timer(20, 5.0f, .2f, 1000); + //test_timer(30, 5.0f, 1000); + //test_create_destroy(); + shutdown_module(); + return 0; +} + diff --git a/src/mod/timers/mod_posix_timer/test/switch.c b/src/mod/timers/mod_posix_timer/test/switch.c new file mode 100644 index 0000000000..e58b017d35 --- /dev/null +++ b/src/mod/timers/mod_posix_timer/test/switch.c @@ -0,0 +1,73 @@ +#include +#include +#include +#include + + +switch_loadable_module_interface_t * switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name) +{ + return malloc(sizeof(switch_loadable_module_interface_t)); +} + +void * switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, int iname) +{ + mod->timer = malloc(sizeof(switch_timer_interface_t)); + return mod->timer; +} + +switch_status_t switch_mutex_lock(switch_mutex_t *mutex) +{ + return pthread_mutex_lock(mutex); +} + +switch_status_t switch_mutex_unlock(switch_mutex_t *mutex) +{ + return pthread_mutex_unlock(mutex); +} + +switch_status_t switch_mutex_init(switch_mutex_t **mutex, int flags, switch_memory_pool_t *pool) +{ + pthread_mutexattr_t atts = { 0 }; + pthread_mutexattr_init(&atts); + if (flags == SWITCH_MUTEX_NESTED) { + pthread_mutexattr_settype(&atts, PTHREAD_MUTEX_RECURSIVE_NP); + } + *mutex = malloc(sizeof(switch_mutex_t)); + return pthread_mutex_init(*mutex, &atts); +} + +switch_status_t switch_thread_cond_create(switch_thread_cond_t **cond, switch_memory_pool_t *pool) +{ + *cond = malloc(sizeof(switch_thread_cond_t)); + return pthread_cond_init(*cond, NULL); +} + +switch_status_t switch_thread_cond_timedwait(switch_thread_cond_t *cond, switch_mutex_t *mutex, long wait) +{ + struct timespec abs_time = { 0, 0 }; + /* add wait duration to current time (wait is in microseconds, pthreads wants nanosecond resolution) */ + clock_gettime(CLOCK_REALTIME, &abs_time); + abs_time.tv_sec += wait / 1000000; + abs_time.tv_nsec += (wait % 1000000) * 1000; + /* handle overflow of tv_nsec */ + abs_time.tv_sec += abs_time.tv_nsec / 1000000000; + abs_time.tv_nsec = abs_time.tv_nsec % 1000000000; + return pthread_cond_timedwait(cond, mutex, &abs_time); +} + +switch_status_t switch_thread_cond_broadcast(switch_thread_cond_t *cond) +{ + return pthread_cond_broadcast(cond); +} + +void switch_log_printf(int dummy, int level, char *format, ...) +{ + va_list vl; + va_start(vl, format); + if (level > LOG_LEVEL) { + vprintf(format, vl); + } + va_end(vl); +} + + diff --git a/src/mod/timers/mod_posix_timer/test/switch.h b/src/mod/timers/mod_posix_timer/test/switch.h new file mode 100644 index 0000000000..7305b8b237 --- /dev/null +++ b/src/mod/timers/mod_posix_timer/test/switch.h @@ -0,0 +1,125 @@ +#ifndef SWITCH_H +#define SWITCH_H + +#include +#include +#include +#include + +#define SWITCH_STATUS_SUCCESS 0 +#define SWITCH_STATUS_GENERR 1 +#define SWITCH_STATUS_FALSE 2 +#define SWITCH_STATUS_TERM 3 + +#define SWITCH_MUTEX_NESTED 1 + +#define SWITCH_CHANNEL_LOG 0 + +#define SWITCH_LOG_DEBUG 0 +#define SWITCH_LOG_INFO 0 +#define SWITCH_LOG_ERROR 1 + +typedef int switch_status_t; +typedef size_t switch_size_t; +typedef pthread_mutex_t switch_mutex_t; +typedef pthread_cond_t switch_thread_cond_t; +typedef int switch_memory_pool_t; +typedef int switch_bool_t; + +#define SWITCH_TIMER_INTERFACE 0 + +typedef struct switch_loadable_module_interface switch_loadable_module_interface_t; +typedef struct switch_timer_interface switch_timer_interface_t; + +typedef int switch_module_flag_t; +#define SWITCH_API_VERSION 0 +#define SWITCH_MOD_DECLARE_DATA +#define SMODF_NONE 0 +#define SWITCH_MODULE_LOAD_ARGS (switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) +#define SWITCH_MODULE_RUNTIME_ARGS (void) +#define SWITCH_MODULE_SHUTDOWN_ARGS (void) +typedef switch_status_t (*switch_module_load_t) SWITCH_MODULE_LOAD_ARGS; +typedef switch_status_t (*switch_module_runtime_t) SWITCH_MODULE_RUNTIME_ARGS; +typedef switch_status_t (*switch_module_shutdown_t) SWITCH_MODULE_SHUTDOWN_ARGS; +#define SWITCH_MODULE_LOAD_FUNCTION(name) switch_status_t name SWITCH_MODULE_LOAD_ARGS +#define SWITCH_MODULE_RUNTIME_FUNCTION(name) switch_status_t name SWITCH_MODULE_RUNTIME_ARGS +#define SWITCH_MODULE_SHUTDOWN_FUNCTION(name) switch_status_t name SWITCH_MODULE_SHUTDOWN_ARGS +typedef struct switch_loadable_module_function_table { + int switch_api_version; + switch_module_load_t load; + switch_module_shutdown_t shutdown; + switch_module_runtime_t runtime; + switch_module_flag_t flags; +} switch_loadable_module_function_table_t; + +#define SWITCH_MODULE_DEFINITION_EX(name, load, shutdown, runtime, flags) \ +static const char modname[] = #name ; \ +SWITCH_MOD_DECLARE_DATA switch_loadable_module_function_table_t name##_module_interface = { \ + SWITCH_API_VERSION, \ + load, \ + shutdown, \ + runtime, \ + flags \ +} + +#define SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime) \ + SWITCH_MODULE_DEFINITION_EX(name, load, shutdown, runtime, SMODF_NONE) + + + +switch_loadable_module_interface_t * switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name); + +typedef struct { + int id; + int interval; + int tick; + int samplecount; + int samples; + int diff; + void *private_info; +} switch_timer_t; + + +/*! \brief A table of functions that a timer module implements */ +struct switch_timer_interface { + /*! the name of the interface */ + const char *interface_name; + /*! function to allocate the timer */ + switch_status_t (*timer_init) (switch_timer_t *); + /*! function to wait for one cycle to pass */ + switch_status_t (*timer_next) (switch_timer_t *); + /*! function to step the timer one step */ + switch_status_t (*timer_step) (switch_timer_t *); + /*! function to reset the timer */ + switch_status_t (*timer_sync) (switch_timer_t *); + /*! function to check if the current step has expired */ + switch_status_t (*timer_check) (switch_timer_t *, switch_bool_t); + /*! function to deallocate the timer */ + switch_status_t (*timer_destroy) (switch_timer_t *); + int refs; + switch_mutex_t *reflock; + switch_loadable_module_interface_t *parent; + struct switch_timer_interface *next; +}; + +struct switch_loadable_module_interface { + switch_timer_interface_t *timer; +}; + +void * switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, int iname); + +switch_status_t switch_mutex_lock(switch_mutex_t *mutex); + +switch_status_t switch_mutex_unlock(switch_mutex_t *mutex); + +switch_status_t switch_mutex_init(switch_mutex_t **mutex, int flags, switch_memory_pool_t *pool); + +switch_status_t switch_thread_cond_create(switch_thread_cond_t **cond, switch_memory_pool_t *pool); + +switch_status_t switch_thread_cond_timedwait(switch_thread_cond_t *cond, switch_mutex_t *mutex, long wait); + +switch_status_t switch_thread_cond_broadcast(switch_thread_cond_t *cond); + +void switch_log_printf(int dummy, int level, char *format, ...); + +#endif diff --git a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c index 684a048806..44379444e3 100644 --- a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c +++ b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c index 1a01c7f4ff..cf85acce43 100644 --- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c +++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c b/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c index 1ac0d38889..ee7a362008 100644 --- a/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c +++ b/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index 9e61312417..9b20546aec 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/mod/xml_int/mod_xml_scgi/Makefile b/src/mod/xml_int/mod_xml_scgi/Makefile new file mode 100644 index 0000000000..2c7a91d26d --- /dev/null +++ b/src/mod/xml_int/mod_xml_scgi/Makefile @@ -0,0 +1,5 @@ +BASE=../../../.. +LOCAL_SOURCES = $(BASE)/libs/libscgi/src/scgi.c +LOCAL_OBJS = $(BASE)/libs/libscgi/src/scgi.o +LOCAL_CFLAGS = -I. -I$(BASE)/libs/libscgi/src/include +include $(BASE)/build/modmake.rules diff --git a/src/mod/xml_int/mod_xml_scgi/conf/autoload_configs/xml_scgi.conf.xml b/src/mod/xml_int/mod_xml_scgi/conf/autoload_configs/xml_scgi.conf.xml new file mode 100644 index 0000000000..b9662d1638 --- /dev/null +++ b/src/mod/xml_int/mod_xml_scgi/conf/autoload_configs/xml_scgi.conf.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.2008.vcproj b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.2008.vcproj new file mode 100644 index 0000000000..7718059dd5 --- /dev/null +++ b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.2008.vcproj @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.2010.vcxproj b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.2010.vcxproj new file mode 100644 index 0000000000..cde0e239e9 --- /dev/null +++ b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.2010.vcxproj @@ -0,0 +1,131 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_xml_scgi + {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39} + mod_xml_scgi + Win32Proj + + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c new file mode 100644 index 0000000000..1ac74ebbdf --- /dev/null +++ b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c @@ -0,0 +1,455 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2012, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Anthony Minessale II + * + * mod_xml_scgi.c -- SCGI XML Gateway + * + */ +#include +#include + + +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_scgi_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_scgi_shutdown); +SWITCH_MODULE_DEFINITION(mod_xml_scgi, mod_xml_scgi_load, mod_xml_scgi_shutdown, NULL); + + +struct xml_binding { + char *host; + switch_port_t port; + char *url; + + int timeout; + switch_hash_t *vars_map; + char *bindings; + + char *server; + switch_thread_t *thread; + struct xml_binding *next; +}; + +static int GLOBAL_DEBUG = 0; + +typedef struct xml_binding xml_binding_t; + +#define XML_SCGI_MAX_BYTES 1024 * 1024 + +typedef struct hash_node { + switch_hash_t *hash; + struct hash_node *next; +} hash_node_t; + +static struct { + switch_memory_pool_t *pool; + hash_node_t *hash_root; + hash_node_t *hash_tail; + int running; + xml_binding_t *bindings; +} globals; + +#define XML_SCGI_SYNTAX "[debug_on|debug_off]" +SWITCH_STANDARD_API(xml_scgi_function) +{ + if (session) { + return SWITCH_STATUS_FALSE; + } + + if (zstr(cmd)) { + goto usage; + } + + if (!strcasecmp(cmd, "debug_on")) { + GLOBAL_DEBUG = 1; + } else if (!strcasecmp(cmd, "debug_off")) { + GLOBAL_DEBUG = 0; + } else { + goto usage; + } + + stream->write_function(stream, "OK\n"); + return SWITCH_STATUS_SUCCESS; + + usage: + stream->write_function(stream, "USAGE: %s\n", XML_SCGI_SYNTAX); + return SWITCH_STATUS_SUCCESS; +} + +void *SWITCH_THREAD_FUNC monitor_thread_run(switch_thread_t *thread, void *obj) +{ + xml_binding_t *binding = (xml_binding_t *) obj; + time_t st; + int diff; + + while(globals.running) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Running server command: %s\n", binding->server); + st = switch_epoch_time_now(NULL); + switch_system(binding->server, SWITCH_TRUE); + diff = (int) switch_epoch_time_now(NULL) - st; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Server command complete: %s\n", binding->server); + + if (globals.running && diff < 5) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Server command had short run duration, sleeping: %s\n", binding->server); + switch_yield(10000000); + } + } + + return NULL; +} + +static void launch_monitor_thread(xml_binding_t *binding) +{ + switch_threadattr_t *thd_attr = NULL; + + switch_threadattr_create(&thd_attr, globals.pool); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_threadattr_priority_increase(thd_attr); + switch_thread_create(&binding->thread, thd_attr, monitor_thread_run, binding, globals.pool); +} + + +static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params, + void *user_data) +{ + switch_xml_t xml = NULL; + char *data = NULL; + xml_binding_t *binding = (xml_binding_t *) user_data; + char hostname[256] = ""; + char basic_data[512]; + unsigned char buf[16336] = ""; + ssize_t len = -1, bytes = 0; + scgi_handle_t handle = { 0 }; + switch_stream_handle_t stream = { 0 }; + char *txt = NULL; + + strncpy(hostname, switch_core_get_switchname(), sizeof(hostname)); + + if (!binding) { + return NULL; + } + + switch_snprintf(basic_data, sizeof(basic_data), "hostname=%s§ion=%s&tag_name=%s&key_name=%s&key_value=%s", + hostname, section, switch_str_nil(tag_name), switch_str_nil(key_name), switch_str_nil(key_value)); + + data = switch_event_build_param_string(params, basic_data, binding->vars_map); + switch_assert(data); + + scgi_add_param(&handle, "REQUEST_METHOD", "POST"); + scgi_add_param(&handle, "REQUEST_URI", binding->url); + scgi_add_body(&handle, data); + + if (scgi_connect(&handle, binding->host, binding->port, binding->timeout * 1000) == SCGI_SUCCESS) { + scgi_send_request(&handle); + + SWITCH_STANDARD_STREAM(stream); + txt = (char *) stream.data; + + while((len = scgi_recv(&handle, buf, sizeof(buf))) > 0) { + char *expanded = switch_event_expand_headers(params, (char *)buf); + + bytes += len; + + if (bytes > XML_SCGI_MAX_BYTES) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Data too big!\n"); + len = -1; + break; + } + + stream.write_function(&stream, "%s", expanded); + txt = (char *) stream.data; + + if (expanded != (char *)buf) { + free(expanded); + } + + memset(buf, 0, sizeof(buf)); + } + + scgi_disconnect(&handle); + + if (len < 0 && (!txt || !strlen(txt))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s Connection Read Failed: [%s]\n", binding->url, handle.err); + goto end; + } + + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s Connection Failed: [%s]\n", binding->url, handle.err); + goto end; + } + + + + if (GLOBAL_DEBUG) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s\nPOST_DATA:\n%s\n\nRESPONSE:\n-----\n%s\n-----\n", + binding->url, data, switch_str_nil(txt)); + } + + + + if (bytes && txt) { + if (!(xml = switch_xml_parse_str_dynamic(txt, FALSE))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result! [%s]\ndata: [%s] RESPONSE[%s]\n", + binding->url, data, switch_str_nil(txt)); + } + txt = NULL; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received error trying to fetch %s\ndata: [%s] RESPONSE [%s]\n", + binding->url, data, switch_str_nil(txt)); + } + + + end: + + switch_safe_free(data); + switch_safe_free(txt); + + return xml; +} + +#define ENABLE_PARAM_VALUE "enabled" +static switch_status_t do_config(void) +{ + char *cf = "xml_scgi.conf"; + switch_xml_t cfg, xml, bindings_tag, binding_tag, param; + xml_binding_t *binding = NULL; + int x = 0; + int need_vars_map = 0; + switch_hash_t *vars_map = NULL; + + if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf); + return SWITCH_STATUS_TERM; + } + + if (!(bindings_tag = switch_xml_child(cfg, "bindings"))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing tag!\n"); + goto done; + } + + for (binding_tag = switch_xml_child(bindings_tag, "binding"); binding_tag; binding_tag = binding_tag->next) { + char *bname = (char *) switch_xml_attr_soft(binding_tag, "name"); + char *host = "127.0.0.1"; + char *port = "8080"; + char *bind_mask = NULL; + int timeout = 0; + char *server = NULL; + + hash_node_t *hash_node; + need_vars_map = 0; + vars_map = NULL; + + for (param = switch_xml_child(binding_tag, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "host")) { + bind_mask = (char *) switch_xml_attr_soft(param, "bindings"); + if (val) { + host = val; + } + } else if (!strcasecmp(var, "port")) { + port = val; + } else if (!strcasecmp(var, "timeout")) { + int tmp = atoi(val); + if (tmp >= 0) { + timeout = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't set a negative timeout!\n"); + } + } else if (!strcasecmp(var, "enable-post-var")) { + if (!vars_map && need_vars_map == 0) { + if (switch_core_hash_init(&vars_map, globals.pool) != SWITCH_STATUS_SUCCESS) { + need_vars_map = -1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't init params hash!\n"); + continue; + } + need_vars_map = 1; + } + + if (vars_map && val) { + if (switch_core_hash_insert(vars_map, val, ENABLE_PARAM_VALUE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't add %s to params hash!\n", val); + } + } + } else if (!strcasecmp(var, "server")) { + server = val; + } + } + + if (!host) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Binding has no host!\n"); + if (vars_map) { + switch_core_hash_destroy(&vars_map); + } + continue; + } + + if (!(binding = switch_core_alloc(globals.pool, sizeof(*binding)))) { + if (vars_map) { + switch_core_hash_destroy(&vars_map); + } + goto done; + } + memset(binding, 0, sizeof(*binding)); + + binding->timeout = timeout; + binding->host = switch_core_strdup(globals.pool, host); + binding->port = atoi(port); + binding->vars_map = vars_map; + binding->url = switch_mprintf("scgi://%s:%s/%s", host, port, bname); + + if (server) { + binding->server = switch_core_strdup(globals.pool, server); + } + + if (bind_mask) { + binding->bindings = switch_core_strdup(globals.pool, bind_mask); + } + + if (vars_map) { + switch_zmalloc(hash_node, sizeof(hash_node_t)); + hash_node->hash = vars_map; + hash_node->next = NULL; + + if (!globals.hash_root) { + globals.hash_root = hash_node; + globals.hash_tail = globals.hash_root; + } + + else { + globals.hash_tail->next = hash_node; + globals.hash_tail = globals.hash_tail->next; + } + + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] [%s]\n", + zstr(bname) ? "N/A" : bname, binding->url, binding->bindings ? binding->bindings : "all"); + switch_xml_bind_search_function(xml_url_fetch, switch_xml_parse_section_string(binding->bindings), binding); + + if (binding->server) { + launch_monitor_thread(binding); + } + + binding->next = globals.bindings; + globals.bindings = binding; + + + x++; + binding = NULL; + } + + done: + switch_xml_free(xml); + + return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; +} + +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_scgi_load) +{ + switch_api_interface_t *xml_scgi_api_interface; + + /* connect my internal structure to the blank pointer passed to me */ + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + memset(&globals, 0, sizeof(globals)); + globals.running = 1; + globals.pool = pool; + globals.hash_root = NULL; + globals.hash_tail = NULL; + + if (do_config() != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_FALSE; + } + + SWITCH_ADD_API(xml_scgi_api_interface, "xml_scgi", "XML SCGI", xml_scgi_function, XML_SCGI_SYNTAX); + switch_console_set_complete("add xml_scgi debug_on"); + switch_console_set_complete("add xml_scgi debug_off"); + + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_scgi_shutdown) +{ + hash_node_t *ptr = NULL; + xml_binding_t *bp; + + globals.running = 0; + + for(bp = globals.bindings; bp; bp = bp->next) { + if (bp->thread) { + switch_status_t st; + scgi_handle_t handle = { 0 }; + unsigned char buf[16336] = ""; + int x = 3; + + scgi_add_param(&handle, "REQUEST_METHOD", "POST"); + scgi_add_param(&handle, "REQUEST_URI", bp->url); + scgi_add_body(&handle, "SHUTDOWN"); + + while(x--) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sending shutdown message to server for %s\n", bp->url); + + if (scgi_connect(&handle, bp->host, bp->port, bp->timeout * 1000) == SCGI_SUCCESS) { + while(0 && scgi_recv(&handle, buf, sizeof(buf)) > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s\n", (char *) buf); + memset(buf, 0, sizeof(buf)); + } + break; + } + + switch_yield(5000000); + } + + scgi_disconnect(&handle); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for server to stop.\n"); + switch_thread_join(&st, bp->thread); + } + } + + + while (globals.hash_root) { + ptr = globals.hash_root; + switch_core_hash_destroy(&ptr->hash); + globals.hash_root = ptr->next; + switch_safe_free(ptr); + } + + switch_xml_unbind_search_function_ptr(xml_url_fetch); + + return SWITCH_STATUS_SUCCESS; +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/src/mod/xml_int/mod_xml_scgi/xml_scgi_server.pl b/src/mod/xml_int/mod_xml_scgi/xml_scgi_server.pl new file mode 100644 index 0000000000..0f4af275bc --- /dev/null +++ b/src/mod/xml_int/mod_xml_scgi/xml_scgi_server.pl @@ -0,0 +1,103 @@ +# +# Copyright (c) 2012-2013, Anthony Minessale II +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of the original author; nor the names of any contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +### EXAMPLE SERVER SIDE FOR mod_xml_SCGI +### You will need the SCGI module from CPAN + +use SCGI; +use CGI; +use IO::Socket; +use Data::Dumper; + +my $socket = IO::Socket::INET->new(Listen => 5, ReuseAddr => 1, LocalPort => 8080) + or die "cannot bind to port 8080: $!"; + +my $scgi = SCGI->new($socket, blocking => 1); + + +my $xml = qq# + +

+ + + + + + + + + +
+ +#; + +$SIG{CHLD} = "IGNORE"; + +while (my $request = $scgi->accept) { + # fork every new req into its own process (optional) + my $pid = fork(); + + if ($pid) { + $request->close(); + next; + } + + my $handle = $request->connection; + + $request->read_env; + + # get the body that contains the PARAMS + read $handle, $body, $request->env->{CONTENT_LENGTH}; + + # Dump SCGI HEADERS + print Dumper $request->env; + + # Create a CGI parser on the PARAMS + my $cgi = CGI->new($body); + my %params = $cgi->Vars(); + # might be big output + print Dumper \%params; + + + ### DO something CGI-like here with %params ... I'm just going to return static xml + + # header is not necessary but optional + #print $handle "Content-Type: text/xml\n\n"; + + print $handle $xml; + + exit unless $pid; +} + + + diff --git a/src/switch.c b/src/switch.c index 4b0abddd8c..95b73a7a04 100644 --- a/src/switch.c +++ b/src/switch.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -212,7 +212,7 @@ void WINAPI service_main(DWORD numArgs, char **args) memset(&status, 0, sizeof(SERVICE_STATUS)); status.dwServiceType = SERVICE_WIN32; status.dwCurrentState = SERVICE_START_PENDING; - status.dwControlsAccepted = SERVICE_ACCEPT_STOP; + status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; /* register our handler for service control messages */ hStatus = RegisterServiceCtrlHandler(service_name, &ServiceCtrlHandler); @@ -288,7 +288,7 @@ void daemonize(int do_wait) while(--sanity && !system_ready) { if (sanity % 2 == 0) { - printf("FreeSWITCH[%d] Waiting for background process pid:%d to be ready.....\n", getpid(), (int) pid); + printf("FreeSWITCH[%d] Waiting for background process pid:%d to be ready.....\n", (int)getpid(), (int) pid); } sleep(1); } diff --git a/src/switch_apr.c b/src/switch_apr.c index 674430ac6d..795c177049 100644 --- a/src/switch_apr.c +++ b/src/switch_apr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1241,6 +1241,10 @@ SWITCH_DECLARE(int) switch_atomic_dec(volatile switch_atomic_t *mem) #endif } +SWITCH_DECLARE(char *) switch_strerror(switch_status_t statcode, char *buf, switch_size_t bufsize) +{ + return apr_strerror(statcode, buf, bufsize); +} /* For Emacs: * Local Variables: diff --git a/src/switch_buffer.c b/src/switch_buffer.c index 0f104f5500..edfddc2e25 100644 --- a/src/switch_buffer.c +++ b/src/switch_buffer.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_caller.c b/src/switch_caller.c index fd81fe9918..021a901590 100644 --- a/src/switch_caller.c +++ b/src/switch_caller.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -479,7 +479,7 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application_printf(switch_core_ char *p; if ((p = strstr(data, "\\'"))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "App not added, Invalid character sequence in data string [%s]\n", data); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "App not added, Invalid character sequence in data string [%s]\n", data); free(data); return; } @@ -505,7 +505,7 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session if (caller_application->application_data && (p = strstr(caller_application->application_data, "\\'"))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "App not added, Invalid character sequence in data string [%s]\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "App not added, Invalid character sequence in data string [%s]\n", caller_application->application_data); return; } diff --git a/src/switch_channel.c b/src/switch_channel.c index 76161bc9c5..138123f3eb 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -831,7 +831,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_partner(switch_channel_ switch_assert(channel != NULL); if (!zstr(varname)) { - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { switch_channel_t *tchannel = switch_core_session_get_channel(session); @@ -896,7 +896,7 @@ SWITCH_DECLARE(void *) switch_channel_get_private_partner(switch_channel_t *chan switch_assert(channel != NULL); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { val = switch_core_hash_find_locked(channel->private_hash, key, channel->profile_mutex); @@ -1160,6 +1160,38 @@ SWITCH_DECLARE(uint32_t) switch_channel_del_variable_prefix(switch_channel_t *ch return r; } + +SWITCH_DECLARE(void) switch_channel_set_presence_data_vals(switch_channel_t *channel, const char *presence_data_cols) +{ + if (!zstr(presence_data_cols)) { + char *cols[128] = { 0 }; + char header_name[128] = ""; + int col_count = 0, i = 0; + char *data_copy = NULL; + + if (zstr(presence_data_cols)) { + presence_data_cols = switch_channel_get_variable_dup(channel, "presence_data_cols", SWITCH_FALSE, -1); + if (zstr(presence_data_cols)) { + return; + } + } + + data_copy = strdup(presence_data_cols); + + col_count = switch_split(data_copy, ':', cols); + + for (i = 0; i < col_count; i++) { + const char *val = NULL; + switch_snprintf(header_name, sizeof(header_name), "PD-%s", cols[i]); + val = switch_channel_get_variable(channel, cols[i]); + switch_channel_set_profile_var(channel, header_name, val); + } + + switch_safe_free(data_copy); + } +} + + SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check) { @@ -1292,7 +1324,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_partner_var_check(sw switch_assert(channel != NULL); if (!zstr(varname)) { - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { switch_channel_t *tchannel = switch_core_session_get_channel(session); @@ -1325,7 +1357,7 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t * switch_assert(channel != NULL); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { switch_channel_set_flag(switch_core_session_get_channel(session), flag); @@ -1344,7 +1376,7 @@ SWITCH_DECLARE(uint32_t) switch_channel_test_flag_partner(switch_channel_t *chan switch_assert(channel != NULL); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { r = switch_channel_test_flag(switch_core_session_get_channel(session), flag); @@ -1361,7 +1393,7 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t switch_assert(channel != NULL); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { switch_channel_clear_flag(switch_core_session_get_channel(session), flag); @@ -1383,7 +1415,7 @@ SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, sw (other_channel && switch_channel_down_nosig(other_channel)) || switch_channel_down(channel)) { break; } - switch_yield(20000); + switch_cond_next(); } } @@ -1481,7 +1513,7 @@ SWITCH_DECLARE(uint32_t) switch_channel_test_cap_partner(switch_channel_t *chann switch_assert(channel != NULL); - if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(channel))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { r = switch_channel_test_cap(switch_core_session_get_channel(session), cap); @@ -1868,12 +1900,11 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state( switch_channel_clear_flag(channel, CF_TAGGED); - - switch_mutex_lock(channel->state_mutex); - switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_DEBUG, "(%s) Running State Change %s\n", channel->name, state_names[state]); + switch_mutex_lock(channel->state_mutex); + channel->running_state = state; if (state == CS_ROUTING || state == CS_HANGUP) { @@ -2193,6 +2224,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann if ((v = switch_channel_get_variable(channel, "presence_data_cols"))) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Data-Cols", v); + switch_event_add_presence_data_cols(channel, event, "PD-"); } if ((v = switch_channel_get_variable(channel, "call_uuid"))) { @@ -2698,7 +2730,7 @@ SWITCH_DECLARE(void) switch_channel_flip_cid(switch_channel_t *channel) if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) { - const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(channel); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV"); if (uuid) { @@ -2923,7 +2955,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(swi SWITCH_DECLARE(void) switch_channel_check_zrtp(switch_channel_t *channel) { - if (switch_channel_test_flag(channel, CF_ZRTP_HASH) && !switch_channel_test_flag(channel, CF_ZRTP_PASS)) { + if (!switch_channel_test_flag(channel, CF_ZRTP_PASSTHRU) + && switch_channel_test_flag(channel, CF_ZRTP_PASSTHRU_REQ) + && switch_channel_test_flag(channel, CF_ZRTP_HASH)) { switch_core_session_t *other_session; switch_channel_t *other_channel; int doit = 1; @@ -2931,14 +2965,16 @@ SWITCH_DECLARE(void) switch_channel_check_zrtp(switch_channel_t *channel) if (switch_core_session_get_partner(channel->session, &other_session) == SWITCH_STATUS_SUCCESS) { other_channel = switch_core_session_get_channel(other_session); - if (switch_channel_test_flag(other_channel, CF_ZRTP_HASH) && !switch_channel_test_flag(other_channel, CF_ZRTP_PASS)) { + if (switch_channel_test_flag(other_channel, CF_ZRTP_HASH) && !switch_channel_test_flag(other_channel, CF_ZRTP_PASSTHRU)) { - switch_channel_set_flag(channel, CF_ZRTP_PASS); - switch_channel_set_flag(other_channel, CF_ZRTP_PASS); + switch_channel_set_flag(channel, CF_ZRTP_PASSTHRU); + switch_channel_set_flag(other_channel, CF_ZRTP_PASSTHRU); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(channel->session), SWITCH_LOG_INFO, "%s Activating ZRTP passthru mode.\n", switch_channel_get_name(channel)); + switch_channel_set_variable(channel, "zrtp_passthru_active", "true"); + switch_channel_set_variable(other_channel, "zrtp_passthru_active", "true"); switch_channel_set_variable(channel, "zrtp_secure_media", "false"); switch_channel_set_variable(other_channel, "zrtp_secure_media", "false"); doit = 0; @@ -2948,18 +2984,20 @@ SWITCH_DECLARE(void) switch_channel_check_zrtp(switch_channel_t *channel) } if (doit) { + switch_channel_set_variable(channel, "zrtp_passthru_active", "false"); switch_channel_set_variable(channel, "zrtp_secure_media", "true"); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(channel->session), SWITCH_LOG_INFO, - "%s ZRTP not negotiated on both sides, Activating ZRTP man-in-the-middle mode.\n", switch_channel_get_name(channel)); + "%s ZRTP not negotiated on both sides; disabling ZRTP passthru mode.\n", switch_channel_get_name(channel)); - switch_channel_clear_flag(channel, CF_ZRTP_PASS); + switch_channel_clear_flag(channel, CF_ZRTP_PASSTHRU); switch_channel_clear_flag(channel, CF_ZRTP_HASH); if (switch_core_session_get_partner(channel->session, &other_session) == SWITCH_STATUS_SUCCESS) { other_channel = switch_core_session_get_channel(other_session); + switch_channel_set_variable(other_channel, "zrtp_passthru_active", "false"); switch_channel_set_variable(other_channel, "zrtp_secure_media", "true"); - switch_channel_clear_flag(other_channel, CF_ZRTP_PASS); + switch_channel_clear_flag(other_channel, CF_ZRTP_PASSTHRU); switch_channel_clear_flag(other_channel, CF_ZRTP_HASH); switch_core_session_rwunlock(other_session); @@ -3346,15 +3384,19 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t * memset(c, 0, olen - cpos);\ }} \ -SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *channel, const char *in, switch_event_t *var_list, switch_event_t *api_list) +SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *channel, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur) { char *p, *c = NULL; char *data, *indup, *endof_indup; size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128; - char *cloned_sub_val = NULL, *sub_val = NULL; + char *cloned_sub_val = NULL, *sub_val = NULL, *expanded_sub_val = NULL; char *func_val = NULL, *sb = NULL; int nv = 0; + if (recur > 100) { + return (char *) in; + } + if (zstr(in)) { return (char *) in; } @@ -3375,12 +3417,16 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c memset(data, 0, olen); c = data; for (p = indup; p && p < endof_indup && *p; p++) { + int global = 0; vtype = 0; if (*p == '\\') { if (*(p + 1) == '$') { nv = 1; p++; + if (*(p + 1) == '$') { + p++; + } } else if (*(p + 1) == '\'') { p++; continue; @@ -3392,9 +3438,15 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c } if (*p == '$' && !nv) { + + if (*(p + 1) == '$') { + p++; + global++; + } + if (*(p + 1)) { if (*(p + 1) == '{') { - vtype = 1; + vtype = global ? 3 : 1; } else { nv = 1; } @@ -3416,7 +3468,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c s++; - if (vtype == 1 && *s == '{') { + if ((vtype == 1 || vtype == 3) && *s == '{') { br = 1; s++; } @@ -3477,14 +3529,14 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c vtype = 2; } - if (vtype == 1) { + if (vtype == 1 || vtype == 3) { char *expanded = NULL; int offset = 0; int ooffset = 0; char *ptr; int idx = -1; - - if ((expanded = switch_channel_expand_variables_check(channel, (char *) vname, var_list, api_list)) == vname) { + + if ((expanded = switch_channel_expand_variables_check(channel, (char *) vname, var_list, api_list, recur+1)) == vname) { expanded = NULL; } else { vname = expanded; @@ -3504,11 +3556,17 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c idx = atoi(ptr); } - if ((sub_val = (char *) switch_channel_get_variable_dup(channel, vname, SWITCH_TRUE, idx))) { + if (vtype == 3 || (sub_val = (char *) switch_channel_get_variable_dup(channel, vname, SWITCH_TRUE, idx))) { if (var_list && !switch_event_check_permission_list(var_list, vname)) { sub_val = "INVALID"; } + if ((expanded_sub_val = switch_channel_expand_variables_check(channel, sub_val, var_list, api_list, recur+1)) == sub_val) { + expanded_sub_val = NULL; + } else { + sub_val = expanded_sub_val; + } + if (offset || ooffset) { cloned_sub_val = strdup(sub_val); switch_assert(cloned_sub_val); @@ -3542,13 +3600,13 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c if (stream.data) { char *expanded_vname = NULL; - if ((expanded_vname = switch_channel_expand_variables_check(channel, (char *) vname, var_list, api_list)) == vname) { + if ((expanded_vname = switch_channel_expand_variables_check(channel, (char *) vname, var_list, api_list, recur+1)) == vname) { expanded_vname = NULL; } else { vname = expanded_vname; } - if ((expanded = switch_channel_expand_variables_check(channel, vval, var_list, api_list)) == vval) { + if ((expanded = switch_channel_expand_variables_check(channel, vval, var_list, api_list, recur+1)) == vval) { expanded = NULL; } else { vval = expanded; @@ -3588,6 +3646,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *c switch_safe_free(func_val); switch_safe_free(cloned_sub_val); + switch_safe_free(expanded_sub_val); sub_val = NULL; vname = NULL; vtype = 0; @@ -4091,6 +4150,17 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t * return status; } +SWITCH_DECLARE(const char *) switch_channel_get_partner_uuid(switch_channel_t *channel) +{ + const char *uuid = NULL; + + if (!(uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + uuid = switch_channel_get_variable(channel, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE); + } + + return uuid; +} + /* For Emacs: * Local Variables: * mode:c diff --git a/src/switch_config.c b/src/switch_config.c index 912094024e..974cbf6107 100644 --- a/src/switch_config.c +++ b/src/switch_config.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_console.c b/src/switch_console.c index 876e9386a4..6da8b82cbd 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core.c b/src/switch_core.c index 52fcdc0369..17e9b2f12b 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -747,6 +747,8 @@ SWITCH_DECLARE(int32_t) set_auto_priority(void) runtime.cpu_count = sysinfo.dwNumberOfProcessors; #endif + if (!runtime.cpu_count) runtime.cpu_count = 1; + /* If we have more than 1 cpu, we should use realtime priority so we can have priority threads */ if (runtime.cpu_count > 1) { return set_realtime_priority(); @@ -1326,6 +1328,35 @@ SWITCH_DECLARE(uint32_t) switch_core_min_dtmf_duration(uint32_t duration) return runtime.min_dtmf_duration; } +SWITCH_DECLARE(switch_status_t) switch_core_thread_set_cpu_affinity(int cpu) +{ + switch_status_t status = SWITCH_STATUS_FALSE; + + if (cpu > -1) { + +#ifdef HAVE_CPU_SET_MACROS + cpu_set_t set; + + CPU_ZERO(&set); + CPU_SET(cpu, &set); + + if (!sched_setaffinity(0, sizeof(set), &set)) { + status = SWITCH_STATUS_SUCCESS; + } + +#else +#if WIN32 + if (SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR) cpu)) { + status = SWITCH_STATUS_SUCCESS; + } +#endif +#endif + } + + return status; +} + + static void switch_core_set_serial(void) { char buf[13] = ""; @@ -1392,7 +1423,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc gethostname(runtime.hostname, sizeof(runtime.hostname)); runtime.max_db_handles = 50; - runtime.db_handle_timeout = 5000000;; + runtime.db_handle_timeout = 5000000; runtime.runlevel++; runtime.sql_buffer_len = 1024 * 32; @@ -1403,8 +1434,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc switch_set_flag((&runtime.dummy_cng_frame), SFF_CNG); switch_set_flag((&runtime), SCF_AUTO_SCHEMAS); switch_set_flag((&runtime), SCF_CLEAR_SQL); +#ifdef WIN32 switch_set_flag((&runtime), SCF_THREADED_SYSTEM_EXEC); - +#endif switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS); runtime.hard_log_level = SWITCH_LOG_DEBUG; runtime.mailer_app = "sendmail"; @@ -1424,6 +1456,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc } #endif + if (!runtime.cpu_count) runtime.cpu_count = 1; + + /* INIT APR and Create the pool context */ if (apr_initialize() != SWITCH_STATUS_SUCCESS) { *err = "FATAL ERROR! Could not initialize APR\n"; @@ -1690,7 +1725,7 @@ static void switch_load_core_config(const char *file) } else if (end_of(val) == 'm') { tmp *= (1024 * 1024); } - + if (tmp >= 32000 && tmp < 10500000) { runtime.sql_buffer_len = tmp; } else { @@ -1729,6 +1764,14 @@ static void switch_load_core_config(const char *file) switch_set_flag((&runtime), SCF_EARLY_HANGUP); } else if (!strcasecmp(var, "colorize-console") && switch_true(val)) { runtime.colorize_console = SWITCH_TRUE; + } else if (!strcasecmp(var, "core-db-pre-trans-execute") && !zstr(val)) { + runtime.core_db_pre_trans_execute = switch_core_strdup(runtime.memory_pool, val); + } else if (!strcasecmp(var, "core-db-post-trans-execute") && !zstr(val)) { + runtime.core_db_post_trans_execute = switch_core_strdup(runtime.memory_pool, val); + } else if (!strcasecmp(var, "core-db-inner-pre-trans-execute") && !zstr(val)) { + runtime.core_db_inner_pre_trans_execute = switch_core_strdup(runtime.memory_pool, val); + } else if (!strcasecmp(var, "core-db-inner-post-trans-execute") && !zstr(val)) { + runtime.core_db_inner_post_trans_execute = switch_core_strdup(runtime.memory_pool, val); } else if (!strcasecmp(var, "mailer-app") && !zstr(val)) { runtime.mailer_app = switch_core_strdup(runtime.memory_pool, val); } else if (!strcasecmp(var, "mailer-app-args") && val) { @@ -1904,7 +1947,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t return SWITCH_STATUS_GENERR; } - + switch_load_network_lists(SWITCH_FALSE); switch_load_core_config("post_load_switch.conf"); diff --git a/src/switch_core_asr.c b/src/switch_core_asr.c index 4fb64b0a0a..4db889929c 100644 --- a/src/switch_core_asr.c +++ b/src/switch_core_asr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_codec.c b/src/switch_core_codec.c index d5404c033c..e7fa3f3fe7 100644 --- a/src/switch_core_codec.c +++ b/src/switch_core_codec.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -114,6 +114,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_real_read_codec(switch_c changed_read_codec = 1; if (codec->implementation) { session->read_impl = *codec->implementation; + session->real_read_impl = *codec->implementation; } else { memset(&session->read_impl, 0, sizeof(session->read_impl)); } @@ -136,7 +137,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_real_read_codec(switch_c session->read_codec = codec; changed_read_codec = 1; if (codec->implementation) { - session->read_impl = *codec->implementation; + session->read_impl = *codec->implementation; + session->real_read_impl = *codec->implementation; } else { memset(&session->read_impl, 0, sizeof(session->read_impl)); } @@ -206,6 +208,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_read_codec(switch_core_s session->read_codec = session->real_read_codec = codec; if (codec->implementation) { session->read_impl = *codec->implementation; + session->real_read_impl = *codec->implementation; } else { memset(&session->read_impl, 0, sizeof(session->read_impl)); } @@ -319,6 +322,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_read_impl(switch_core_se return SWITCH_STATUS_FALSE; } +SWITCH_DECLARE(switch_status_t) switch_core_session_get_real_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp) +{ + if (session->real_read_impl.codec_id) { + *impp = session->real_read_impl; + return SWITCH_STATUS_SUCCESS; + } + + return SWITCH_STATUS_FALSE; +} + SWITCH_DECLARE(switch_status_t) switch_core_session_get_write_impl(switch_core_session_t *session, switch_codec_implementation_t *impp) { if (session->write_impl.codec_id) { diff --git a/src/switch_core_db.c b/src/switch_core_db.c index 3c20b0f368..7cc151dc5b 100644 --- a/src/switch_core_db.c +++ b/src/switch_core_db.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_directory.c b/src/switch_core_directory.c index 5ff4e05c6c..e86a6fd047 100644 --- a/src/switch_core_directory.c +++ b/src/switch_core_directory.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_event_hook.c b/src/switch_core_event_hook.c index 9cfe1ac79f..e3b17ca6c6 100644 --- a/src/switch_core_event_hook.c +++ b/src/switch_core_event_hook.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_file.c b/src/switch_core_file.c index 6beaa83584..ed1a03f76b 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_hash.c b/src/switch_core_hash.c index 1cfb1424ee..4ac3d2620e 100644 --- a/src/switch_core_hash.c +++ b/src/switch_core_hash.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 8b147327a2..0a3db343ed 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -41,7 +41,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor switch_io_event_hook_video_write_frame_t *ptr; switch_status_t status = SWITCH_STATUS_FALSE; - if (switch_channel_down_nosig(session->channel)) { + if (switch_channel_down(session->channel)) { return SWITCH_STATUS_FALSE; } @@ -65,7 +65,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core switch_assert(session != NULL); - if (switch_channel_down_nosig(session->channel)) { + if (switch_channel_down(session->channel)) { return SWITCH_STATUS_FALSE; } @@ -153,7 +153,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi } } - if (switch_channel_down_nosig(session->channel) || !switch_core_codec_ready(session->read_codec)) { + if (switch_channel_down(session->channel) || !switch_core_codec_ready(session->read_codec)) { *frame = NULL; status = SWITCH_STATUS_FALSE; goto even_more_done; @@ -236,14 +236,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi goto done; } - if (switch_test_flag(*frame, SFF_CNG)) { - status = SWITCH_STATUS_SUCCESS; - if (!session->bugs && !session->plc) { - goto done; - } - is_cng = 1; - } - switch_assert((*frame)->codec != NULL); if (!(session->read_codec && (*frame)->codec && (*frame)->codec->implementation) && switch_core_codec_ready((*frame)->codec)) { @@ -265,8 +257,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi do_bugs = 1; need_codec = 1; } - - if (((*frame)->flags & SFF_NOT_AUDIO)) { + + if (switch_test_flag(*frame, SFF_CNG)) { + if (!session->bugs && !session->plc) { + /* Check if other session has bugs */ + unsigned int other_session_bugs = 0; + switch_core_session_t *other_session = NULL; + if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_BRIDGED) && + switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { + if (other_session->bugs) { + other_session_bugs = 1; + } + switch_core_session_rwunlock(other_session); + } + + /* Don't process CNG frame */ + if (!other_session_bugs) { + status = SWITCH_STATUS_SUCCESS; + goto done; + } + } + is_cng = 1; + need_codec = 1; + } else if (switch_test_flag(*frame, SFF_NOT_AUDIO)) { do_resample = 0; do_bugs = 0; need_codec = 0; @@ -275,7 +288,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi if (switch_test_flag(session, SSF_READ_TRANSCODE) && !need_codec && switch_core_codec_ready(session->read_codec)) { switch_core_session_t *other_session; - const char *uuid = switch_channel_get_variable(switch_core_session_get_channel(session), SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(switch_core_session_get_channel(session)); switch_clear_flag(session, SSF_READ_TRANSCODE); if (uuid && (other_session = switch_core_session_locate(uuid))) { @@ -485,21 +498,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi continue; } - if (bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) { - switch_mutex_lock(bp->read_mutex); - switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen); - - if (bp->callback) { - ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ); - } - switch_mutex_unlock(bp->read_mutex); - } - if (ok && switch_test_flag(bp, SMBF_READ_REPLACE)) { do_bugs = 0; if (bp->callback) { bp->read_replace_frame_in = read_frame; bp->read_replace_frame_out = read_frame; + bp->read_demux_frame = NULL; if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ_REPLACE)) == SWITCH_TRUE) { read_frame = bp->read_replace_frame_out; } @@ -519,6 +523,55 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi } } + if (session->bugs) { + switch_media_bug_t *bp; + switch_bool_t ok = SWITCH_TRUE; + int prune = 0; + switch_thread_rwlock_rdlock(session->bug_rwlock); + + for (bp = session->bugs; bp; bp = bp->next) { + if (switch_channel_test_flag(session->channel, CF_PAUSE_BUGS) && !switch_core_media_bug_test_flag(bp, SMBF_NO_PAUSE)) { + continue; + } + + if (!switch_channel_test_flag(session->channel, CF_ANSWERED) && switch_core_media_bug_test_flag(bp, SMBF_ANSWER_REQ)) { + continue; + } + if (switch_test_flag(bp, SMBF_PRUNE)) { + prune++; + continue; + } + + if (ok && bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) { + switch_mutex_lock(bp->read_mutex); + if (bp->read_demux_frame) { + uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE]; + int bytes = read_frame->datalen / 2; + + memcpy(data, read_frame->data, read_frame->datalen); + switch_unmerge_sln((int16_t *)data, bytes, bp->read_demux_frame->data, bytes); + switch_buffer_write(bp->raw_read_buffer, data, read_frame->datalen); + } else { + switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen); + } + + if (bp->callback) { + ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ); + } + switch_mutex_unlock(bp->read_mutex); + } + + if ((bp->stop_time && bp->stop_time <= switch_epoch_time_now(NULL)) || ok == SWITCH_FALSE) { + switch_set_flag(bp, SMBF_PRUNE); + prune++; + } + } + switch_thread_rwlock_unlock(session->bug_rwlock); + if (prune) { + switch_core_media_bug_prune(session); + } + } + if (do_bugs) { goto done; } @@ -813,7 +866,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess if (switch_test_flag(session, SSF_WRITE_TRANSCODE) && !need_codec && switch_core_codec_ready(session->write_codec)) { switch_core_session_t *other_session; - const char *uuid = switch_channel_get_variable(switch_core_session_get_channel(session), SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(switch_core_session_get_channel(session)); if (uuid && (other_session = switch_core_session_locate(uuid))) { switch_set_flag(other_session, SSF_READ_CODEC_RESET); @@ -1101,6 +1154,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Write Buffer Failed!\n"); goto error; } + + /* Need to retrain the recording data */ + switch_core_media_bug_flush_all(session); } if (!(switch_buffer_write(session->raw_write_buffer, write_frame->data, write_frame->datalen))) { @@ -1114,7 +1170,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess while (switch_buffer_inuse(session->raw_write_buffer) >= session->write_impl.decoded_bytes_per_packet) { int rate; - if (switch_channel_down_nosig(session->channel) || !session->raw_write_buffer) { + if (switch_channel_down(session->channel) || !session->raw_write_buffer) { goto error; } if ((session->raw_write_frame.datalen = (uint32_t) @@ -1296,7 +1352,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_sessio switch_dtmf_t new_dtmf; int fed = 0; - if (switch_channel_down_nosig(session->channel)) { + if (switch_channel_down(session->channel)) { return SWITCH_STATUS_FALSE; } @@ -1339,7 +1395,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_sessio switch_status_t status = SWITCH_STATUS_FALSE; switch_dtmf_t new_dtmf; - if (switch_channel_down_nosig(session->channel)) { + if (switch_channel_down(session->channel)) { return SWITCH_STATUS_FALSE; } @@ -1413,18 +1469,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core switch_assert(session != NULL); + if (zstr(dtmf_string)) { + return SWITCH_STATUS_FALSE; + } + if (*dtmf_string == '~') { dtmf_string++; dtmf.flags = 0; } - if (switch_channel_down_nosig(session->channel)) { + if (switch_channel_down(session->channel)) { return SWITCH_STATUS_FALSE; } - if (zstr(dtmf_string)) { - return SWITCH_STATUS_FALSE; - } if (strlen(dtmf_string) > 99) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Attempt to send very large dtmf string ignored!\n"); diff --git a/src/switch_core_media_bug.c b/src/switch_core_media_bug.c index 0397aa666b..8b466b111e 100644 --- a/src/switch_core_media_bug.c +++ b/src/switch_core_media_bug.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -72,6 +72,9 @@ SWITCH_DECLARE(uint32_t) switch_core_media_bug_test_flag(switch_media_bug_t *bug SWITCH_DECLARE(uint32_t) switch_core_media_bug_set_flag(switch_media_bug_t *bug, uint32_t flag) { + if ((flag & SMBF_PRUNE)) { + switch_clear_flag(bug, SMBF_LOCK); + } return switch_set_flag(bug, flag); } @@ -105,6 +108,11 @@ SWITCH_DECLARE(void) switch_core_media_bug_set_read_replace_frame(switch_media_b bug->read_replace_frame_out = frame; } +SWITCH_DECLARE(void) switch_core_media_bug_set_read_demux_frame(switch_media_bug_t *bug, switch_frame_t *frame) +{ + bug->read_demux_frame = frame; +} + SWITCH_DECLARE(void *) switch_core_media_bug_get_user_data(switch_media_bug_t *bug) { return bug->user_data; @@ -126,6 +134,9 @@ SWITCH_DECLARE(void) switch_core_media_bug_flush(switch_media_bug_t *bug) switch_buffer_zero(bug->raw_write_buffer); switch_mutex_unlock(bug->write_mutex); } + + bug->record_frame_size = 0; + bug->record_pre_buffer_count = 0; } SWITCH_DECLARE(void) switch_core_media_bug_inuse(switch_media_bug_t *bug, switch_size_t *readp, switch_size_t *writep) @@ -172,6 +183,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b bytes = read_impl.decoded_bytes_per_packet; +#ifdef TESTINGONLY + if (0 && bug->session->recur_buffer_len) { + frame->datalen = bug->session->recur_buffer_len; + frame->samples = bug->session->recur_buffer_len / sizeof(int16_t); + frame->rate = read_impl.actual_samples_per_second; + frame->codec = NULL; + memcpy(frame->data, bug->session->recur_buffer, bug->session->recur_buffer_len); + return SWITCH_STATUS_SUCCESS; + } +#endif + + if (frame->buflen < bytes) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(bug)), SWITCH_LOG_ERROR, "%s frame buffer too small!\n", switch_channel_get_name(bug->session->channel)); @@ -203,7 +226,31 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b bug->record_pre_buffer_count++; return SWITCH_STATUS_FALSE; } - + + if (!bug->record_frame_size) { + if (do_read && do_write) { + switch_size_t frame_size; + switch_codec_implementation_t read_impl = { 0 }; + switch_codec_implementation_t other_read_impl = { 0 }; + switch_core_session_t *other_session; + + switch_core_session_get_read_impl(bug->session, &read_impl); + frame_size = read_impl.decoded_bytes_per_packet; + + if (switch_core_session_get_partner(bug->session, &other_session) == SWITCH_STATUS_SUCCESS) { + switch_core_session_get_read_impl(other_session, &other_read_impl); + switch_core_session_rwunlock(other_session); + + if (read_impl.decoded_bytes_per_packet < other_read_impl.decoded_bytes_per_packet) { + frame_size = other_read_impl.decoded_bytes_per_packet; + } + } + + bug->record_frame_size = frame_size; + } + } + + if (bug->record_frame_size) { if ((do_read && do_read < bug->record_frame_size) || (do_write && do_write < bug->record_frame_size)) { return SWITCH_STATUS_FALSE; @@ -216,16 +263,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b if (do_write && do_write > bug->record_frame_size) { do_write = bug->record_frame_size; } - } else { - if (do_read && do_write) { - if (do_read > do_write) { - do_read = do_write; - } else if (do_write > do_read) { - do_write = do_read; - } - - bug->record_frame_size = do_read; - } } fill_read = !do_read; @@ -346,6 +383,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b return SWITCH_STATUS_BREAK; } + memcpy(bug->session->recur_buffer, frame->data, frame->datalen); + bug->session->recur_buffer_len = frame->datalen; + return SWITCH_STATUS_SUCCESS; } @@ -535,6 +575,71 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_recordings(switch return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; } +SWITCH_DECLARE(switch_status_t) switch_core_media_bug_pop(switch_core_session_t *orig_session, const char *function, switch_media_bug_t **pop) +{ + switch_media_bug_t *bp; + + if (orig_session->bugs) { + switch_thread_rwlock_wrlock(orig_session->bug_rwlock); + for (bp = orig_session->bugs; bp; bp = bp->next) { + if (!strcmp(bp->function, function)) { + switch_set_flag(bp, SMBF_LOCK); + break; + } + } + switch_thread_rwlock_unlock(orig_session->bug_rwlock); + + if (bp) { + *pop = bp; + return SWITCH_STATUS_SUCCESS; + } else { + *pop = NULL; + } + } + + return SWITCH_STATUS_FALSE; +} + +SWITCH_DECLARE(uint32_t) switch_core_media_bug_count(switch_core_session_t *orig_session, const char *function) +{ + switch_media_bug_t *bp; + uint32_t x = 0; + + if (orig_session->bugs) { + switch_thread_rwlock_rdlock(orig_session->bug_rwlock); + for (bp = orig_session->bugs; bp; bp = bp->next) { + if (!switch_test_flag(bp, SMBF_PRUNE) && !switch_test_flag(bp, SMBF_LOCK) && !strcmp(bp->function, function)) { + x++; + } + } + switch_thread_rwlock_unlock(orig_session->bug_rwlock); + } + + return x; +} + +SWITCH_DECLARE(switch_status_t) switch_core_media_bug_exec_all(switch_core_session_t *orig_session, + const char *function, switch_media_bug_exec_cb_t cb, void *user_data) +{ + switch_media_bug_t *bp; + int x = 0; + + switch_assert(cb); + + if (orig_session->bugs) { + switch_thread_rwlock_wrlock(orig_session->bug_rwlock); + for (bp = orig_session->bugs; bp; bp = bp->next) { + if (!switch_test_flag(bp, SMBF_PRUNE) && !switch_test_flag(bp, SMBF_LOCK) && !strcmp(bp->function, function)) { + cb(bp, user_data); + x++; + } + } + switch_thread_rwlock_unlock(orig_session->bug_rwlock); + } + + return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; +} + SWITCH_DECLARE(switch_status_t) switch_core_media_bug_enumerate(switch_core_session_t *session, switch_stream_handle_t *stream) { switch_media_bug_t *bp; @@ -542,7 +647,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_enumerate(switch_core_sess stream->write_function(stream, "\n"); if (session->bugs) { - switch_thread_rwlock_wrlock(session->bug_rwlock); + switch_thread_rwlock_rdlock(session->bug_rwlock); for (bp = session->bugs; bp; bp = bp->next) { int thread_locked = (bp->thread_id && bp->thread_id == switch_thread_self()); stream->write_function(stream, @@ -562,7 +667,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_enumerate(switch_core_sess return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(switch_core_session_t *session) +SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all_function(switch_core_session_t *session, const char *function) { switch_media_bug_t *bp; switch_status_t status = SWITCH_STATUS_FALSE; @@ -570,10 +675,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(switch_core_ses if (session->bugs) { switch_thread_rwlock_wrlock(session->bug_rwlock); for (bp = session->bugs; bp; bp = bp->next) { - if (bp->thread_id && bp->thread_id != switch_thread_self()) { + if ((bp->thread_id && bp->thread_id != switch_thread_self()) || switch_test_flag(bp, SMBF_LOCK)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BUG is thread locked skipping.\n"); continue; } + + if (!zstr(function) && strcmp(bp->function, function)) { + continue; + } + if (bp->callback) { bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_CLOSE); @@ -597,7 +707,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_close(switch_media_bug_t * { switch_media_bug_t *bp = *bug; if (bp) { - if (bp->thread_id && bp->thread_id != switch_thread_self()) { + if ((bp->thread_id && bp->thread_id != switch_thread_self()) || switch_test_flag(bp, SMBF_LOCK)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(*bug)), SWITCH_LOG_DEBUG, "BUG is thread locked skipping.\n"); return SWITCH_STATUS_FALSE; } @@ -620,6 +730,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session { switch_media_bug_t *bp = NULL, *last = NULL; switch_status_t status = SWITCH_STATUS_FALSE; + + if (switch_core_media_bug_test_flag(*bug, SMBF_LOCK)) { + return status; + } switch_thread_rwlock_wrlock(session->bug_rwlock); if (session->bugs) { @@ -682,6 +796,8 @@ SWITCH_DECLARE(uint32_t) switch_core_media_bug_prune(switch_core_session_t *sess switch_thread_rwlock_unlock(session->bug_rwlock); if (bp) { + switch_clear_flag(bp, SMBF_LOCK); + bp->thread_id = 0; switch_core_media_bug_close(&bp); ttl++; goto top; diff --git a/src/switch_core_memory.c b/src/switch_core_memory.c index d7d8f14a0f..38a066b020 100644 --- a/src/switch_core_memory.c +++ b/src/switch_core_memory.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -646,7 +646,7 @@ switch_memory_pool_t *switch_core_memory_init(void) switch_queue_create(&memory_manager.pool_recycle_queue, 50000, memory_manager.memory_pool); switch_threadattr_create(&thd_attr, memory_manager.memory_pool); - switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_detach_set(thd_attr, 0); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_thread_create(&pool_thread_p, thd_attr, pool_thread, NULL, memory_manager.memory_pool); diff --git a/src/switch_core_port_allocator.c b/src/switch_core_port_allocator.c index 580e45bd91..4b15318274 100644 --- a/src/switch_core_port_allocator.c +++ b/src/switch_core_port_allocator.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_rwlock.c b/src/switch_core_rwlock.c index 5992fa28f1..6567aa1557 100644 --- a/src/switch_core_rwlock.c +++ b/src/switch_core_rwlock.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 0c9252ebc5..89f055858f 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -184,7 +184,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_partner(switch_core_sess { const char *uuid; - if ((uuid = switch_channel_get_variable(session->channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(session->channel, "originate_signal_bond"))) { + if ((uuid = switch_channel_get_partner_uuid(session->channel))) { if ((*partner = switch_core_session_locate(uuid))) { return SWITCH_STATUS_SUCCESS; } @@ -531,7 +531,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ switch_codec2str(read_codec, rc, sizeof(rc)); if (vid_read_codec && vid_read_codec->implementation && switch_core_codec_ready(vid_read_codec)) { vrc[0] = ','; - switch_codec2str(read_codec, vrc + 1, sizeof(vrc) - 1); + switch_codec2str(vid_read_codec, vrc + 1, sizeof(vrc) - 1); switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE, vrc + 1); } @@ -544,7 +544,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_VARIABLE, switch_core_session_get_uuid(session)); switch_channel_set_variable(peer_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(session)); // Needed by 3PCC proxy so that aleg can find bleg to pass SDP to, when final ACK arrives. - switch_channel_set_variable(channel, "originate_signal_bond", switch_core_session_get_uuid(*new_session)); + switch_channel_set_variable(channel, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(*new_session)); if ((val = switch_channel_get_variable(channel, SWITCH_PROCESS_CDR_VARIABLE))) { switch_channel_set_variable(peer_channel, SWITCH_PROCESS_CDR_VARIABLE, val); @@ -577,6 +577,10 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ } } + if (switch_channel_test_flag(channel, CF_ZRTP_PASSTHRU_REQ)) { + switch_channel_set_flag(peer_channel, CF_ZRTP_PASSTHRU_REQ); + } + if (profile) { if ((cloned_profile = switch_caller_profile_clone(*new_session, profile)) != 0) { switch_channel_set_originator_caller_profile(peer_channel, cloned_profile); @@ -640,6 +644,7 @@ static const char *message_names[] = { "SIGNAL_DATA", "INFO", "AUDIO_DATA", + "BLIND_TRANSFER_RESPONSE", "INVALID" }; @@ -681,12 +686,30 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit switch_channel_clear_flag(session->channel, CF_EARLY_MEDIA); } - if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY && - switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) { - switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line, - switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG1, "Ignoring display update.\n"); - status = SWITCH_STATUS_SUCCESS; - goto end; + if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY) { + char *arg = NULL; + + if (zstr(message->string_array_arg[0]) && !zstr(message->string_arg)) { + arg = switch_core_session_strdup(session, message->string_arg); + switch_separate_string(arg, '|', (char **)message->string_array_arg, 2); + } + + if (!zstr(message->string_array_arg[0])) { + switch_channel_set_variable(session->channel, "last_sent_callee_id_name", message->string_array_arg[0]); + } + + if (!zstr(message->string_array_arg[1])) { + switch_channel_set_variable(session->channel, "last_sent_callee_id_number", message->string_array_arg[1]); + } + + + if (switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) { + switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line, + switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG1, "Ignoring display update.\n"); + status = SWITCH_STATUS_SUCCESS; + goto end; + } + } if (switch_channel_down_nosig(session->channel) && message->message_id != SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) { @@ -704,13 +727,36 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit break; } } + + + if (message->message_id == SWITCH_MESSAGE_INDICATE_BRIDGE && + switch_channel_test_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER)) { + switch_core_session_t *other_session; + const char *uuid = switch_channel_get_variable(session->channel, "blind_transfer_uuid"); + + switch_channel_clear_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER); + + if (!zstr(uuid) && (other_session = switch_core_session_locate(uuid))) { + switch_core_session_message_t msg = { 0 }; + msg.message_id = SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE; + msg.from = __FILE__; + msg.numeric_arg = 1; + switch_core_session_receive_message(other_session, &msg); + switch_core_session_rwunlock(other_session); + } + } } + message->_file = NULL; message->_func = NULL; message->_line = 0; if (switch_channel_up_nosig(session->channel)) { + if (message->message_id == SWITCH_MESSAGE_INDICATE_BRIDGE || message->message_id == SWITCH_MESSAGE_INDICATE_UNBRIDGE) { + switch_core_media_bug_flush_all(session); + } + switch (message->message_id) { case SWITCH_MESSAGE_REDIRECT_AUDIO: case SWITCH_MESSAGE_INDICATE_ANSWER: @@ -751,7 +797,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_pass_indication(switch_core_ switch_channel_t *channel = switch_core_session_get_channel(session); switch_status_t status = SWITCH_STATUS_SUCCESS; - if (((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) && (other_session = switch_core_session_locate(uuid))) { + if (((uuid = switch_channel_get_partner_uuid(channel))) && (other_session = switch_core_session_locate(uuid))) { msg.message_id = indication; msg.from = __FILE__; status = switch_core_session_receive_message(other_session, &msg); @@ -1465,7 +1511,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session switch_mutex_lock(runtime.session_hash_mutex); if (switch_core_hash_find(session_manager.session_table, use_uuid)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Duplicate UUID!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Duplicate UUID!\n"); switch_mutex_unlock(runtime.session_hash_mutex); return SWITCH_STATUS_FALSE; } diff --git a/src/switch_core_speech.c b/src/switch_core_speech.c index 12b60538d1..f0e97f8b28 100644 --- a/src/switch_core_speech.c +++ b/src/switch_core_speech.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index af947f7b11..9b40674065 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -218,7 +218,7 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t } -#define SQL_CACHE_TIMEOUT 120 +#define SQL_CACHE_TIMEOUT 30 #define SQL_REG_TIMEOUT 15 @@ -390,7 +390,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h { if (!switch_odbc_available()) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure! ODBC NOT AVAILABLE!\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure! ODBC NOT AVAILABLE! Can't connect to DSN %s\n", connection_options->odbc_options.dsn); goto end; } @@ -415,7 +415,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h } if (!db && !odbc_dbh) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure!\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure to connect to %s %s!\n", db?"SQLITE":"ODBC", db?connection_options->core_db_options.db_path:connection_options->odbc_options.dsn); goto end; } @@ -731,6 +731,14 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_ if (io_mutex) switch_mutex_lock(io_mutex); + if (!zstr(runtime.core_db_pre_trans_execute)) { + switch_cache_db_execute_sql_real(dbh, runtime.core_db_pre_trans_execute, &errmsg); + if (errmsg) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL PRE TRANS EXEC %s [%s]\n", runtime.core_db_pre_trans_execute, errmsg); + free(errmsg); + } + } + again: while (begin_retries > 0) { @@ -781,6 +789,15 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_ break; } + + if (!zstr(runtime.core_db_inner_pre_trans_execute)) { + switch_cache_db_execute_sql_real(dbh, runtime.core_db_inner_pre_trans_execute, &errmsg); + if (errmsg) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL PRE TRANS EXEC %s [%s]\n", runtime.core_db_inner_pre_trans_execute, errmsg); + free(errmsg); + } + } + while (retries > 0) { switch_cache_db_execute_sql(dbh, sql, &errmsg); @@ -801,6 +818,14 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_ } } + if (!zstr(runtime.core_db_inner_post_trans_execute)) { + switch_cache_db_execute_sql_real(dbh, runtime.core_db_inner_post_trans_execute, &errmsg); + if (errmsg) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL POST TRANS EXEC %s [%s]\n", runtime.core_db_inner_post_trans_execute, errmsg); + free(errmsg); + } + } + done: if (runtime.odbc_dbtype == DBTYPE_DEFAULT) { @@ -810,6 +835,14 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_ switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 1); } + if (!zstr(runtime.core_db_post_trans_execute)) { + switch_cache_db_execute_sql_real(dbh, runtime.core_db_post_trans_execute, &errmsg); + if (errmsg) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL POST TRANS EXEC %s [%s]\n", runtime.core_db_post_trans_execute, errmsg); + free(errmsg); + } + } + if (io_mutex) switch_mutex_unlock(io_mutex); return status; @@ -903,7 +936,7 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand switch_core_db_exec(dbh->native_handle.core_db_dbh, drop_sql, NULL, NULL, &errmsg); } if (errmsg) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQL ERR [%s]\n[%s]\n", errmsg, reactive_sql); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQL ERR [%s]\n[%s]\n", errmsg, drop_sql); switch_core_db_free(errmsg); errmsg = NULL; } @@ -1138,7 +1171,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, static char *parse_presence_data_cols(switch_event_t *event) { - char *cols[25] = { 0 }; + char *cols[128] = { 0 }; int col_count = 0; char *data_copy; switch_stream_handle_t stream = { 0 }; @@ -1628,10 +1661,7 @@ static char create_channels_sql[] = " call_uuid VARCHAR(256),\n" " sent_callee_name VARCHAR(1024),\n" " sent_callee_num VARCHAR(256)\n" - ");\n" - "create index chidx1 on channels (hostname);\n" - "create index uuindex on channels (uuid);\n" - "create index uuindex2 on channels (call_uuid);\n"; + ");\n"; static char create_calls_sql[] = "CREATE TABLE calls (\n" @@ -1641,11 +1671,7 @@ static char create_calls_sql[] = " caller_uuid VARCHAR(256),\n" " callee_uuid VARCHAR(256),\n" " hostname VARCHAR(256)\n" - ");\n" - "create index callsidx1 on calls (hostname);\n" - "create index eruuindex on calls (caller_uuid);\n" - "create index eeuuindex on calls (callee_uuid);\n" - "create index eeuuindex2 on calls (call_uuid);\n"; + ");\n"; static char create_interfaces_sql[] = "CREATE TABLE interfaces (\n" @@ -1687,9 +1713,10 @@ static char create_registrations_sql[] = " network_ip VARCHAR(256),\n" " network_port VARCHAR(256),\n" " network_proto VARCHAR(256),\n" - " hostname VARCHAR(256)\n" - ");\n" - "create index regindex1 on registrations (reg_user,realm,hostname);\n"; + " hostname VARCHAR(256),\n" + " metadata VARCHAR(256)\n" + ");\n"; + @@ -1817,7 +1844,8 @@ static char basic_calls_sql[] = SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, const char *realm, const char *token, const char *url, uint32_t expires, - const char *network_ip, const char *network_port, const char *network_proto) + const char *network_ip, const char *network_port, const char *network_proto, + const char *metadata) { char *sql; @@ -1834,19 +1862,35 @@ SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, c } switch_queue_push(sql_manager.sql_queue[0], sql); - - sql = switch_mprintf("insert into registrations (reg_user,realm,token,url,expires,network_ip,network_port,network_proto,hostname) " - "values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')", - switch_str_nil(user), - switch_str_nil(realm), - switch_str_nil(token), - switch_str_nil(url), - expires, - switch_str_nil(network_ip), - switch_str_nil(network_port), - switch_str_nil(network_proto), - switch_core_get_switchname() - ); + + if ( !zstr(metadata) ) { + sql = switch_mprintf("insert into registrations (reg_user,realm,token,url,expires,network_ip,network_port,network_proto,hostname,metadata) " + "values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q','%q')", + switch_str_nil(user), + switch_str_nil(realm), + switch_str_nil(token), + switch_str_nil(url), + expires, + switch_str_nil(network_ip), + switch_str_nil(network_port), + switch_str_nil(network_proto), + switch_core_get_switchname(), + metadata + ); + } else { + sql = switch_mprintf("insert into registrations (reg_user,realm,token,url,expires,network_ip,network_port,network_proto,hostname) " + "values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')", + switch_str_nil(user), + switch_str_nil(realm), + switch_str_nil(token), + switch_str_nil(url), + expires, + switch_str_nil(network_ip), + switch_str_nil(network_port), + switch_str_nil(network_proto), + switch_core_get_switchname() + ); + } switch_queue_push(sql_manager.sql_queue[0], sql); @@ -1981,6 +2025,8 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_cache_db_test_reactive(dbh, "delete from registrations where reg_user='' or network_proto='tcp' or network_proto='tls'", "DROP TABLE registrations", create_registrations_sql); + switch_cache_db_test_reactive(dbh, "select metadata from registrations", NULL, "ALTER TABLE registrations ADD COLUMN metadata VARCHAR(256)"); + switch (dbh->type) { case SCDB_TYPE_ODBC: @@ -2051,6 +2097,15 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_cache_db_execute_sql(dbh, "create index nat_map_port_proto on nat (port,proto,hostname)", NULL); switch_cache_db_execute_sql(dbh, "create index channels1 on channels(hostname)", NULL); switch_cache_db_execute_sql(dbh, "create index calls1 on calls(hostname)", NULL); + switch_cache_db_execute_sql(dbh, "create index chidx1 on channels (hostname)", NULL); + switch_cache_db_execute_sql(dbh, "create index uuindex on channels (uuid)", NULL); + switch_cache_db_execute_sql(dbh, "create index uuindex2 on channels (call_uuid)", NULL); + switch_cache_db_execute_sql(dbh, "create index callsidx1 on calls (hostname)", NULL); + switch_cache_db_execute_sql(dbh, "create index eruuindex on calls (caller_uuid)", NULL); + switch_cache_db_execute_sql(dbh, "create index eeuuindex on calls (callee_uuid)", NULL); + switch_cache_db_execute_sql(dbh, "create index eeuuindex2 on calls (call_uuid)", NULL); + switch_cache_db_execute_sql(dbh, "create index regindex1 on registrations (reg_user,realm,hostname)", NULL); + skip: diff --git a/src/switch_core_state_machine.c b/src/switch_core_state_machine.c index 1b540c963f..e567daa9fb 100644 --- a/src/switch_core_state_machine.c +++ b/src/switch_core_state_machine.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -174,8 +174,11 @@ static void switch_core_standard_on_routing(switch_core_session_t *session) } if (!extension) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "No Route, Aborting\n"); - switch_channel_hangup(session->channel, SWITCH_CAUSE_NO_ROUTE_DESTINATION); + + if (switch_ivr_blind_transfer_ack(session, SWITCH_FALSE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "No Route, Aborting\n"); + switch_channel_hangup(session->channel, SWITCH_CAUSE_NO_ROUTE_DESTINATION); + } } end: @@ -188,6 +191,7 @@ static void switch_core_standard_on_routing(switch_core_session_t *session) static void switch_core_standard_on_execute(switch_core_session_t *session) { switch_caller_extension_t *extension; + const char *uuid; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard EXECUTE\n", switch_channel_get_name(session->channel)); @@ -222,6 +226,25 @@ static void switch_core_standard_on_execute(switch_core_session_t *session) } + if (switch_channel_ready(session->channel) && switch_channel_get_state(session->channel) == CS_EXECUTE && + switch_channel_test_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER) && + (uuid = switch_channel_get_variable(session->channel, "blind_transfer_uuid"))) { + switch_core_session_t *other_session; + + if ((other_session = switch_core_session_locate(uuid))) { + switch_core_session_message_t msg = { 0 }; + msg.message_id = SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE; + msg.from = __FILE__; + msg.numeric_arg = 0; + switch_core_session_receive_message(other_session, &msg); + switch_core_session_rwunlock(other_session); + + switch_channel_set_variable(session->channel, "park_timeout", "10:blind_transfer"); + switch_channel_set_state(session->channel, CS_PARK); + switch_channel_clear_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER); + } + } + if (switch_channel_ready(session->channel) && switch_channel_get_state(session->channel) == CS_EXECUTE) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "%s has executed the last dialplan instruction, hanging up.\n", switch_channel_get_name(session->channel)); diff --git a/src/switch_core_timer.c b/src/switch_core_timer.c index 1798442509..8f6ce4820a 100644 --- a/src/switch_core_timer.c +++ b/src/switch_core_timer.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 91d0980444..5408edb828 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_event.c b/src/switch_event.c index 25bab3185a..defae3586c 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -35,7 +35,7 @@ #include #include //#define SWITCH_EVENT_RECYCLE -#define DISPATCH_QUEUE_LEN 10000 +#define DISPATCH_QUEUE_LEN 100 //#define DEBUG_DISPATCH_QUEUES /*! \brief A node to store binded events */ @@ -63,7 +63,7 @@ struct switch_event_subclass { int bind; }; -#define MAX_DISPATCH_VAL 20 +#define MAX_DISPATCH_VAL 64 static unsigned int MAX_DISPATCH = MAX_DISPATCH_VAL; static unsigned int SOFT_MAX_DISPATCH = 0; static char guess_ip_v4[80] = ""; @@ -74,23 +74,20 @@ static switch_mutex_t *BLOCK = NULL; static switch_mutex_t *POOL_LOCK = NULL; static switch_memory_pool_t *RUNTIME_POOL = NULL; static switch_memory_pool_t *THRUNTIME_POOL = NULL; -#define NUMBER_OF_QUEUES 3 -static switch_thread_t *EVENT_QUEUE_THREADS[NUMBER_OF_QUEUES] = { 0 }; -static switch_queue_t *EVENT_QUEUE[NUMBER_OF_QUEUES] = { 0 }; static switch_thread_t *EVENT_DISPATCH_QUEUE_THREADS[MAX_DISPATCH_VAL] = { 0 }; static uint8_t EVENT_DISPATCH_QUEUE_RUNNING[MAX_DISPATCH_VAL] = { 0 }; -static switch_queue_t *EVENT_DISPATCH_QUEUE[MAX_DISPATCH_VAL] = { 0 }; -static int POOL_COUNT_MAX = SWITCH_CORE_QUEUE_LEN; +static switch_queue_t *EVENT_DISPATCH_QUEUE = NULL; static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL; static switch_hash_t *CUSTOM_HASH = NULL; static int THREAD_COUNT = 0; +static int DISPATCH_THREAD_COUNT = 0; static int SYSTEM_RUNNING = 0; static uint64_t EVENT_SEQUENCE_NR = 0; #ifdef SWITCH_EVENT_RECYCLE static switch_queue_t *EVENT_RECYCLE_QUEUE = NULL; static switch_queue_t *EVENT_HEADER_RECYCLE_QUEUE = NULL; #endif -static void launch_dispatch_threads(uint32_t max, int len, switch_memory_pool_t *pool); +static void launch_dispatch_threads(uint32_t max, switch_memory_pool_t *pool); static char *my_dup(const char *s) { @@ -244,15 +241,17 @@ static void *SWITCH_THREAD_FUNC switch_event_dispatch_thread(switch_thread_t *th switch_mutex_lock(EVENT_QUEUE_MUTEX); THREAD_COUNT++; + DISPATCH_THREAD_COUNT++; - for (my_id = 0; my_id < NUMBER_OF_QUEUES; my_id++) { - if (EVENT_DISPATCH_QUEUE[my_id] == queue) { + for (my_id = 0; my_id < MAX_DISPATCH_VAL; my_id++) { + if (EVENT_DISPATCH_QUEUE_THREADS[my_id] == thread) { break; } } EVENT_DISPATCH_QUEUE_RUNNING[my_id] = 1; switch_mutex_unlock(EVENT_QUEUE_MUTEX); + for (;;) { void *pop = NULL; @@ -263,7 +262,7 @@ static void *SWITCH_THREAD_FUNC switch_event_dispatch_thread(switch_thread_t *th } if (switch_queue_pop(queue, &pop) != SWITCH_STATUS_SUCCESS) { - break; + continue; } if (!pop) { @@ -278,6 +277,7 @@ static void *SWITCH_THREAD_FUNC switch_event_dispatch_thread(switch_thread_t *th switch_mutex_lock(EVENT_QUEUE_MUTEX); EVENT_DISPATCH_QUEUE_RUNNING[my_id] = 0; THREAD_COUNT--; + DISPATCH_THREAD_COUNT--; switch_mutex_unlock(EVENT_QUEUE_MUTEX); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Dispatch Thread %d Ended.\n", my_id); @@ -285,96 +285,41 @@ static void *SWITCH_THREAD_FUNC switch_event_dispatch_thread(switch_thread_t *th } - -static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, void *obj) +static switch_status_t switch_event_queue_dispatch_event(switch_event_t **eventp) { - switch_queue_t *queue = (switch_queue_t *) obj; - uint32_t index = 0; - int my_id = 0; - int auto_pause = 0; - switch_mutex_lock(EVENT_QUEUE_MUTEX); - THREAD_COUNT++; - switch_mutex_unlock(EVENT_QUEUE_MUTEX); + switch_event_t *event = *eventp; - for (my_id = 0; my_id < NUMBER_OF_QUEUES; my_id++) { - if (EVENT_QUEUE[my_id] == queue) { - break; - } + if (!SYSTEM_RUNNING) { + return SWITCH_STATUS_FALSE; } + + while (event) { + int launch = 0; - for (;;) { - void *pop = NULL; - switch_event_t *event = NULL; - int loops = 0; + switch_mutex_lock(EVENT_QUEUE_MUTEX); - if (auto_pause) { - if (!--auto_pause) { - switch_core_session_ctl(SCSC_PAUSE_INBOUND, &auto_pause); - } else { - switch_cond_next(); + if (switch_queue_size(EVENT_DISPATCH_QUEUE) > (unsigned int)(DISPATCH_QUEUE_LEN * DISPATCH_THREAD_COUNT)) { + launch++; + } + + if (launch) { + if (SOFT_MAX_DISPATCH + 1 < MAX_DISPATCH) { + launch_dispatch_threads(SOFT_MAX_DISPATCH + 1, RUNTIME_POOL); } } - if (switch_queue_pop(queue, &pop) != SWITCH_STATUS_SUCCESS) { - break; - } + switch_mutex_unlock(EVENT_QUEUE_MUTEX); - if (!pop) { - break; - } - - if (!SYSTEM_RUNNING) { - break; - } - - event = (switch_event_t *) pop; - - while (event) { - - - if (++loops > 2) { - if (auto_pause) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Event system *still* overloading.\n"); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, - "Event system overloading. Taking a 10 second break\n"); - auto_pause = 10; - switch_core_session_ctl(SCSC_PAUSE_INBOUND, &auto_pause); - } - switch_yield(1000000); - } - - for (index = 0; index < SOFT_MAX_DISPATCH; index++) { - if (switch_queue_trypush(EVENT_DISPATCH_QUEUE[index], event) == SWITCH_STATUS_SUCCESS) { - event = NULL; - break; - } - } - - if (event) { - if (SOFT_MAX_DISPATCH + 1 < MAX_DISPATCH) { - switch_mutex_lock(EVENT_QUEUE_MUTEX); - launch_dispatch_threads(SOFT_MAX_DISPATCH + 1, DISPATCH_QUEUE_LEN, RUNTIME_POOL); - switch_mutex_unlock(EVENT_QUEUE_MUTEX); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Out of event dispatch threads! Slowing things down.\n"); - switch_yield(1000000); - } - } - } + *eventp = NULL; + switch_queue_push(EVENT_DISPATCH_QUEUE, event); + event = NULL; + } - - switch_mutex_lock(EVENT_QUEUE_MUTEX); - THREAD_COUNT--; - switch_mutex_unlock(EVENT_QUEUE_MUTEX); - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Event Thread %d Ended.\n", my_id); - return NULL; - + + return SWITCH_STATUS_SUCCESS; } - SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event) { switch_event_types_t e; @@ -519,18 +464,23 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void) SYSTEM_RUNNING = 0; switch_mutex_unlock(EVENT_QUEUE_MUTEX); - for (x = 0; x < 3; x++) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping event queue %d\n", x); - switch_queue_trypush(EVENT_QUEUE[x], NULL); - switch_queue_interrupt_all(EVENT_QUEUE[x]); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch queues\n"); + + + for(x = 0; x < (uint32_t)DISPATCH_THREAD_COUNT; x++) { + switch_queue_trypush(EVENT_DISPATCH_QUEUE, NULL); } - for (x = 0; x < SOFT_MAX_DISPATCH; x++) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch queue %d\n", x); - switch_queue_trypush(EVENT_DISPATCH_QUEUE[x], NULL); - switch_queue_interrupt_all(EVENT_DISPATCH_QUEUE[x]); + switch_queue_interrupt_all(EVENT_DISPATCH_QUEUE); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch threads\n"); + + for(x = 0; x < (uint32_t)DISPATCH_THREAD_COUNT; x++) { + switch_status_t st; + switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]); } + x = 0; while (x < 10000 && THREAD_COUNT) { switch_cond_next(); if (THREAD_COUNT == last) { @@ -539,29 +489,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void) last = THREAD_COUNT; } - for (x = 0; x < SOFT_MAX_DISPATCH; x++) { + { void *pop = NULL; switch_event_t *event = NULL; - switch_status_t st; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch thread %d\n", x); - switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]); - - while (switch_queue_trypop(EVENT_DISPATCH_QUEUE[x], &pop) == SWITCH_STATUS_SUCCESS && pop) { - event = (switch_event_t *) pop; - switch_event_destroy(&event); - } - } - - for (x = 0; x < NUMBER_OF_QUEUES; x++) { - void *pop = NULL; - switch_event_t *event = NULL; - switch_status_t st; - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping queue thread %d\n", x); - switch_thread_join(&st, EVENT_QUEUE_THREADS[x]); - - while (switch_queue_trypop(EVENT_QUEUE[x], &pop) == SWITCH_STATUS_SUCCESS && pop) { + while (switch_queue_trypop(EVENT_DISPATCH_QUEUE, &pop) == SWITCH_STATUS_SUCCESS && pop) { event = (switch_event_t *) pop; switch_event_destroy(&event); } @@ -583,7 +515,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void) return SWITCH_STATUS_SUCCESS; } -static void launch_dispatch_threads(uint32_t max, int len, switch_memory_pool_t *pool) +static void launch_dispatch_threads(uint32_t max, switch_memory_pool_t *pool) { switch_threadattr_t *thd_attr; uint32_t index = 0; @@ -599,16 +531,20 @@ static void launch_dispatch_threads(uint32_t max, int len, switch_memory_pool_t } for (index = SOFT_MAX_DISPATCH; index < max && index < MAX_DISPATCH; index++) { - if (EVENT_DISPATCH_QUEUE[index]) { + if (EVENT_DISPATCH_QUEUE_THREADS[index]) { continue; } - switch_queue_create(&EVENT_DISPATCH_QUEUE[index], len, pool); + switch_threadattr_create(&thd_attr, pool); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_threadattr_priority_increase(thd_attr); - switch_thread_create(&EVENT_DISPATCH_QUEUE_THREADS[index], thd_attr, switch_event_dispatch_thread, EVENT_DISPATCH_QUEUE[index], pool); + switch_thread_create(&EVENT_DISPATCH_QUEUE_THREADS[index], thd_attr, switch_event_dispatch_thread, EVENT_DISPATCH_QUEUE, pool); while(--sanity && !EVENT_DISPATCH_QUEUE_RUNNING[index]) switch_yield(10000); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Create event dispatch thread %d\n", index); + if (index == 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Create event dispatch thread %d\n", index); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Create additional event dispatch thread %d\n", index); + } launched++; break; } @@ -618,7 +554,7 @@ static void launch_dispatch_threads(uint32_t max, int len, switch_memory_pool_t SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool) { - switch_threadattr_t *thd_attr;; + //switch_threadattr_t *thd_attr; /* This statement doesn't do anything commenting it out for now. @@ -626,6 +562,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool) switch_assert(switch_arraylen(EVENT_NAMES) == SWITCH_EVENT_ALL + 1); */ + /* don't need any more dispatch threads than we have CPU's*/ + MAX_DISPATCH = (switch_core_cpu_count() / 2) + 1; + if (MAX_DISPATCH < 2) { + MAX_DISPATCH = 2; + } switch_assert(pool != NULL); THRUNTIME_POOL = RUNTIME_POOL = pool; @@ -640,26 +581,28 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool) SYSTEM_RUNNING = -1; switch_mutex_unlock(EVENT_QUEUE_MUTEX); - switch_threadattr_create(&thd_attr, pool); + //switch_threadattr_create(&thd_attr, pool); switch_find_local_ip(guess_ip_v4, sizeof(guess_ip_v4), NULL, AF_INET); switch_find_local_ip(guess_ip_v6, sizeof(guess_ip_v6), NULL, AF_INET6); - switch_queue_create(&EVENT_QUEUE[0], POOL_COUNT_MAX + 10, THRUNTIME_POOL); - switch_queue_create(&EVENT_QUEUE[1], POOL_COUNT_MAX + 10, THRUNTIME_POOL); - switch_queue_create(&EVENT_QUEUE[2], POOL_COUNT_MAX + 10, THRUNTIME_POOL); + //switch_queue_create(&EVENT_QUEUE[0], POOL_COUNT_MAX + 10, THRUNTIME_POOL); + //switch_queue_create(&EVENT_QUEUE[1], POOL_COUNT_MAX + 10, THRUNTIME_POOL); + //switch_queue_create(&EVENT_QUEUE[2], POOL_COUNT_MAX + 10, THRUNTIME_POOL); #ifdef SWITCH_EVENT_RECYCLE switch_queue_create(&EVENT_RECYCLE_QUEUE, 250000, THRUNTIME_POOL); switch_queue_create(&EVENT_HEADER_RECYCLE_QUEUE, 250000, THRUNTIME_POOL); #endif - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_threadattr_priority_increase(thd_attr); + //switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + //switch_threadattr_priority_increase(thd_attr); - launch_dispatch_threads(1, DISPATCH_QUEUE_LEN, RUNTIME_POOL); - switch_thread_create(&EVENT_QUEUE_THREADS[0], thd_attr, switch_event_thread, EVENT_QUEUE[0], RUNTIME_POOL); - switch_thread_create(&EVENT_QUEUE_THREADS[1], thd_attr, switch_event_thread, EVENT_QUEUE[1], RUNTIME_POOL); - switch_thread_create(&EVENT_QUEUE_THREADS[2], thd_attr, switch_event_thread, EVENT_QUEUE[2], RUNTIME_POOL); + switch_queue_create(&EVENT_DISPATCH_QUEUE, DISPATCH_QUEUE_LEN * MAX_DISPATCH, pool); + launch_dispatch_threads(1, RUNTIME_POOL); + + //switch_thread_create(&EVENT_QUEUE_THREADS[0], thd_attr, switch_event_thread, EVENT_QUEUE[0], RUNTIME_POOL); + //switch_thread_create(&EVENT_QUEUE_THREADS[1], thd_attr, switch_event_thread, EVENT_QUEUE[1], RUNTIME_POOL); + //switch_thread_create(&EVENT_QUEUE_THREADS[2], thd_attr, switch_event_thread, EVENT_QUEUE[2], RUNTIME_POOL); while (!THREAD_COUNT) { switch_cond_next(); @@ -1457,7 +1400,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a, switch_event_t *e = *event; char *var_array[1024] = { 0 }; int var_count = 0; - char *next; + char *next = NULL, *vnext = NULL; if (dup) { vdatap = strdup(data); @@ -1479,6 +1422,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a, if (check_a) end = check_a; if (end) { + next = end; vdata++; *end++ = '\0'; } else { @@ -1494,13 +1438,17 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a, for (;;) { - if ((next = strchr(vdata, b))) { + if (next) { char *pnext; + *next++ = '\0'; if ((pnext = switch_strchr_strict(next, a, " "))) { next = pnext + 1; } + + vnext = switch_find_end_paren(next, a, b); + next = NULL; } @@ -1525,8 +1473,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a, } } - if (next) { - vdata = next; + if (vnext) { + vdata = vnext; } else { break; } @@ -1770,8 +1718,6 @@ SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, c SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, const char *func, int line, switch_event_t **event, void *user_data) { - int index; - switch_assert(BLOCK != NULL); switch_assert(RUNTIME_POOL != NULL); switch_assert(EVENT_QUEUE_MUTEX != NULL); @@ -1787,21 +1733,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, con (*event)->event_user_data = user_data; } - for (;;) { - for (index = (*event)->priority; index < 3; index++) { - if (switch_queue_trypush(EVENT_QUEUE[index], *event) == SWITCH_STATUS_SUCCESS) { - goto end; - } - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Event queue is full!\n"); - switch_yield(100000); + if (switch_event_queue_dispatch_event(event) != SWITCH_STATUS_SUCCESS) { + switch_event_destroy(event); + return SWITCH_STATUS_FALSE; } - end: - - *event = NULL; - return SWITCH_STATUS_SUCCESS; } @@ -1987,17 +1923,21 @@ if ((dp = realloc(data, olen))) {\ memset(c, 0, olen - cpos);\ }} \ -SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, const char *in, switch_event_t *var_list, switch_event_t *api_list) +SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur) { char *p, *c = NULL; char *data, *indup, *endof_indup; size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128; const char *sub_val = NULL; - char *cloned_sub_val = NULL; + char *cloned_sub_val = NULL, *expanded_sub_val = NULL; char *func_val = NULL; int nv = 0; char *gvar = NULL, *sb = NULL; + if (recur > 100) { + return (char *) in; + } + if (zstr(in)) { return (char *) in; } @@ -2017,12 +1957,16 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, memset(data, 0, olen); c = data; for (p = indup; p && p < endof_indup && *p; p++) { + int global = 0; vtype = 0; if (*p == '\\') { if (*(p + 1) == '$') { nv = 1; p++; + if (*(p + 1) == '$') { + p++; + } } else if (*(p + 1) == '\'') { p++; continue; @@ -2034,9 +1978,14 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, } if (*p == '$' && !nv) { + if (*(p + 1) == '$') { + p++; + global++; + } + if (*(p + 1)) { if (*(p + 1) == '{') { - vtype = 1; + vtype = global ? 3 : 1; } else { nv = 1; } @@ -2058,7 +2007,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, s++; - if (vtype == 1 && *s == '{') { + if ((vtype == 1 || vtype == 3) && *s == '{') { br = 1; s++; } @@ -2120,14 +2069,14 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, vtype = 2; } - if (vtype == 1) { + if (vtype == 1 || vtype == 3) { char *expanded = NULL; int offset = 0; int ooffset = 0; char *ptr; int idx = -1; - if ((expanded = switch_event_expand_headers_check(event, (char *) vname, var_list, api_list)) == vname) { + if ((expanded = switch_event_expand_headers_check(event, (char *) vname, var_list, api_list, recur+1)) == vname) { expanded = NULL; } else { vname = expanded; @@ -2146,7 +2095,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, idx = atoi(ptr); } - if (!(sub_val = switch_event_get_header_idx(event, vname, idx))) { + if (vtype == 3 || !(sub_val = switch_event_get_header_idx(event, vname, idx))) { switch_safe_free(gvar); if ((gvar = switch_core_get_variable_dup(vname))) { sub_val = gvar; @@ -2156,6 +2105,12 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, sub_val = "INVALID"; } + + if ((expanded_sub_val = switch_event_expand_headers_check(event, sub_val, var_list, api_list, recur+1)) == sub_val) { + expanded_sub_val = NULL; + } else { + sub_val = expanded_sub_val; + } } if (offset || ooffset) { @@ -2163,7 +2118,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, switch_assert(cloned_sub_val); sub_val = cloned_sub_val; } - + if (offset >= 0) { sub_val += offset; } else if ((size_t) abs(offset) <= strlen(sub_val)) { @@ -2175,6 +2130,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, *ptr = '\0'; } } + switch_safe_free(expanded); } else { @@ -2186,13 +2142,13 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, if (stream.data) { char *expanded_vname = NULL; - if ((expanded_vname = switch_event_expand_headers_check(event, (char *) vname, var_list, api_list)) == vname) { + if ((expanded_vname = switch_event_expand_headers_check(event, (char *) vname, var_list, api_list, recur+1)) == vname) { expanded_vname = NULL; } else { vname = expanded_vname; } - if ((expanded = switch_event_expand_headers_check(event, vval, var_list, api_list)) == vval) { + if ((expanded = switch_event_expand_headers_check(event, vval, var_list, api_list, recur+1)) == vval) { expanded = NULL; } else { vval = expanded; @@ -2232,6 +2188,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers_check(switch_event_t *event, switch_safe_free(func_val); switch_safe_free(cloned_sub_val); + switch_safe_free(expanded_sub_val); sub_val = NULL; vname = NULL; vtype = 0; @@ -2375,7 +2332,34 @@ SWITCH_DECLARE(int) switch_event_check_permission_list(switch_event_t *list, con return r; } +SWITCH_DECLARE(void) switch_event_add_presence_data_cols(switch_channel_t *channel, switch_event_t *event, const char *prefix) +{ + const char *data; + if (!prefix) prefix = ""; + + if ((data = switch_channel_get_variable(channel, "presence_data_cols"))) { + char *cols[128] = { 0 }; + char header_name[128] = ""; + int col_count = 0, i = 0; + char *data_copy = NULL; + + data_copy = strdup(data); + + col_count = switch_split(data_copy, ':', cols); + + for (i = 0; i < col_count; i++) { + const char *val = NULL; + switch_snprintf(header_name, sizeof(header_name), "%s%s", prefix, cols[i]); + + val = switch_channel_get_variable(channel, cols[i]); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, val); + } + + switch_safe_free(data_copy); + } + +} /* For Emacs: diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 955f7b50d6..08d1fcd5a4 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -170,7 +170,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, SWITCH_IVR_VERIFY_SILENCE_DIVISOR(sval); } - if (ms > 100 && sval) { + if (ms > 10 && sval) { switch_core_session_get_read_impl(session, &imp); if (switch_core_codec_init(&codec, @@ -264,7 +264,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, if (args->input_callback) { status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen); } else if (args->buf) { - switch_copy_string((char *) args->buf, (void *) &dtmf, args->buflen); + *((char *) args->buf) = dtmf.digit; status = SWITCH_STATUS_BREAK; } } @@ -535,6 +535,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se char *loop_h = switch_event_get_header(event, "loops"); char *hold_bleg = switch_event_get_header(event, "hold-bleg"); int loops = 1; + int inner = 0; if (zstr(app_arg) && !zstr(content_type) && !strcasecmp(content_type, "text/plain")) { app_arg = switch_event_get_body(event); @@ -550,9 +551,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se switch_core_session_t *b_session = NULL; switch_channel_clear_flag(channel, CF_STOP_BROADCAST); - switch_channel_set_flag(channel, CF_BROADCAST); + + if (switch_channel_test_flag(channel, CF_BROADCAST)) { + inner++; + hold_bleg = NULL; + } else { + switch_channel_set_flag(channel, CF_BROADCAST); + } if (hold_bleg && switch_true(hold_bleg)) { - if ((b_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((b_uuid = switch_channel_get_partner_uuid(channel))) { const char *stream; b_uuid = switch_core_session_strdup(session, b_uuid); @@ -592,6 +599,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se switch_channel_get_name(channel), app_name, switch_str_nil(app_arg)); b4 = switch_micro_time_now(); if (switch_core_session_execute_application(session, app_name, app_arg) != SWITCH_STATUS_SUCCESS) { + if (!inner || switch_channel_test_flag(channel, CF_STOP_BROADCAST)) switch_channel_clear_flag(channel, CF_BROADCAST); goto done; } @@ -610,7 +618,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se } } - switch_channel_clear_flag(channel, CF_BROADCAST); + if (!inner || switch_channel_test_flag(channel, CF_STOP_BROADCAST)) { + switch_channel_clear_flag(channel, CF_BROADCAST); + switch_channel_set_flag(channel, CF_BREAK); + } + } } else if (cmd_hash == CMD_UNICAST) { char *local_ip = switch_event_get_header(event, "local-ip"); @@ -1372,7 +1384,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session, switch_core_session_receive_message(session, &msg); if (moh && (stream = switch_channel_get_hold_music(channel))) { - if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((other_uuid = switch_channel_get_partner_uuid(channel))) { switch_ivr_broadcast(other_uuid, stream, SMF_ECHO_ALEG | SMF_LOOP); } } @@ -1409,7 +1421,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session switch_core_session_receive_message(session, &msg); - if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (b_session = switch_core_session_locate(other_uuid))) { + if ((other_uuid = switch_channel_get_partner_uuid(channel)) && (b_session = switch_core_session_locate(other_uuid))) { switch_channel_t *b_channel = switch_core_session_get_channel(b_session); switch_channel_stop_broadcast(b_channel); switch_channel_wait_for_flag(b_channel, CF_BROADCAST, SWITCH_FALSE, 5000, NULL); @@ -1556,7 +1568,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi } switch_core_session_receive_message(other_session, &msg); switch_channel_wait_for_flag(other_channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000, NULL); - switch_channel_wait_for_flag(other_channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL); + //switch_channel_wait_for_flag(other_channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL); switch_channel_wait_for_flag(other_channel, CF_MEDIA_SET, SWITCH_TRUE, 10000, NULL); } @@ -2460,6 +2472,260 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_ return SWITCH_STATUS_FALSE; } +static void switch_ivr_set_json_profile_data(cJSON *json, switch_caller_profile_t *caller_profile) +{ + cJSON_AddItemToObject(json, "username", cJSON_CreateString((char *)caller_profile->username)); + cJSON_AddItemToObject(json, "dialplan", cJSON_CreateString((char *)caller_profile->dialplan)); + cJSON_AddItemToObject(json, "caller_id_name", cJSON_CreateString((char *)caller_profile->caller_id_name)); + cJSON_AddItemToObject(json, "ani", cJSON_CreateString((char *)caller_profile->ani)); + cJSON_AddItemToObject(json, "aniii", cJSON_CreateString((char *)caller_profile->aniii)); + cJSON_AddItemToObject(json, "caller_id_number", cJSON_CreateString((char *)caller_profile->caller_id_number)); + cJSON_AddItemToObject(json, "network_addr", cJSON_CreateString((char *)caller_profile->network_addr)); + cJSON_AddItemToObject(json, "rdnis", cJSON_CreateString((char *)caller_profile->rdnis)); + cJSON_AddItemToObject(json, "destination_number", cJSON_CreateString(caller_profile->destination_number)); + cJSON_AddItemToObject(json, "uuid", cJSON_CreateString(caller_profile->uuid)); + cJSON_AddItemToObject(json, "source", cJSON_CreateString((char *)caller_profile->source)); + cJSON_AddItemToObject(json, "context", cJSON_CreateString((char *)caller_profile->context)); + cJSON_AddItemToObject(json, "chan_name", cJSON_CreateString(caller_profile->chan_name)); +} + +static void switch_ivr_set_json_chan_vars(cJSON *json, switch_channel_t *channel, switch_bool_t urlencode) +{ + switch_event_header_t *hi = switch_channel_variable_first(channel); + + if (!hi) + return; + + for (; hi; hi = hi->next) { + if (!zstr(hi->name) && !zstr(hi->value)) { + char *data = hi->value; + if (urlencode) { + switch_size_t dlen = strlen(hi->value) * 3; + + if ((data = malloc(dlen))) { + memset(data, 0, dlen); + switch_url_encode(hi->value, data, dlen); + } + } + + cJSON_AddItemToObject(json, hi->name, cJSON_CreateString(data)); + + if (data != hi->value) { + switch_safe_free(data); + } + } + } + switch_channel_variable_last(channel); +} + + + +SWITCH_DECLARE(switch_status_t) switch_ivr_generate_json_cdr(switch_core_session_t *session, cJSON **json_cdr, switch_bool_t urlencode) +{ + cJSON *cdr = cJSON_CreateObject(); + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_caller_profile_t *caller_profile; + cJSON *variables, *j_main_cp, *j_caller_profile, *j_caller_extension, *j_times, + *j_application, *j_callflow, *j_inner_extension, *j_apps, *j_o, *j_channel_data; + switch_app_log_t *app_log; + char tmp[512], *f; + + j_channel_data = cJSON_CreateObject(); + + cJSON_AddItemToObject(cdr, "channel_data", j_channel_data); + + cJSON_AddItemToObject(j_channel_data, "state", cJSON_CreateString((char *) switch_channel_state_name(switch_channel_get_state(channel)))); + cJSON_AddItemToObject(j_channel_data, "direction", cJSON_CreateString(switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound")); + + switch_snprintf(tmp, sizeof(tmp), "%d", switch_channel_get_state(channel)); + cJSON_AddItemToObject(j_channel_data, "state_number", cJSON_CreateString((char *) tmp)); + + if ((f = switch_channel_get_flag_string(channel))) { + cJSON_AddItemToObject(j_channel_data, "flags", cJSON_CreateString((char *) f)); + free(f); + } + + if ((f = switch_channel_get_cap_string(channel))) { + cJSON_AddItemToObject(j_channel_data, "caps", cJSON_CreateString((char *) f)); + free(f); + } + + variables = cJSON_CreateObject(); + cJSON_AddItemToObject(cdr, "variables", variables); + + switch_ivr_set_json_chan_vars(variables, channel, urlencode); + + + if ((app_log = switch_core_session_get_app_log(session))) { + switch_app_log_t *ap; + + j_apps = cJSON_CreateObject(); + + cJSON_AddItemToObject(cdr, "app_log", j_apps); + + for (ap = app_log; ap; ap = ap->next) { + j_application = cJSON_CreateObject(); + + cJSON_AddItemToObject(j_application, "app_name", cJSON_CreateString(ap->app)); + cJSON_AddItemToObject(j_application, "app_data", cJSON_CreateString(ap->arg)); + + cJSON_AddItemToObject(j_apps, "application", j_application); + } + } + + + caller_profile = switch_channel_get_caller_profile(channel); + + while (caller_profile) { + + j_callflow = cJSON_CreateObject(); + + cJSON_AddItemToObject(cdr, "callflow", j_callflow); + + if (!zstr(caller_profile->dialplan)) { + cJSON_AddItemToObject(j_callflow, "dialplan", cJSON_CreateString((char *)caller_profile->dialplan)); + } + + if (!zstr(caller_profile->profile_index)) { + cJSON_AddItemToObject(j_callflow, "profile_index", cJSON_CreateString((char *)caller_profile->profile_index)); + } + + if (caller_profile->caller_extension) { + switch_caller_application_t *ap; + + j_caller_extension = cJSON_CreateObject(); + + cJSON_AddItemToObject(j_callflow, "extension", j_caller_extension); + + cJSON_AddItemToObject(j_caller_extension, "name", cJSON_CreateString(caller_profile->caller_extension->extension_name)); + cJSON_AddItemToObject(j_caller_extension, "number", cJSON_CreateString(caller_profile->caller_extension->extension_number)); + + if (caller_profile->caller_extension->current_application) { + cJSON_AddItemToObject(j_caller_extension, "current_app", cJSON_CreateString(caller_profile->caller_extension->current_application->application_name)); + } + + for (ap = caller_profile->caller_extension->applications; ap; ap = ap->next) { + j_application = cJSON_CreateObject(); + + cJSON_AddItemToObject(j_caller_extension, "application", j_application); + + if (ap == caller_profile->caller_extension->current_application) { + cJSON_AddItemToObject(j_application, "last_executed", cJSON_CreateString("true")); + } + cJSON_AddItemToObject(j_application, "app_name", cJSON_CreateString(ap->application_name)); + cJSON_AddItemToObject(j_application, "app_data", cJSON_CreateString(switch_str_nil(ap->application_data))); + } + + if (caller_profile->caller_extension->children) { + switch_caller_profile_t *cp = NULL; + for (cp = caller_profile->caller_extension->children; cp; cp = cp->next) { + + if (!cp->caller_extension) { + continue; + } + + j_inner_extension = cJSON_CreateObject(); + cJSON_AddItemToObject(j_caller_extension, "sub_extensions", j_inner_extension); + + j_caller_extension = cJSON_CreateObject(); + cJSON_AddItemToObject(j_inner_extension, "extension", j_caller_extension); + + cJSON_AddItemToObject(j_caller_extension, "name", cJSON_CreateString(cp->caller_extension->extension_name)); + cJSON_AddItemToObject(j_caller_extension, "number", cJSON_CreateString(cp->caller_extension->extension_number)); + + cJSON_AddItemToObject(j_caller_extension, "dialplan", cJSON_CreateString((char *)cp->dialplan)); + + if (cp->caller_extension->current_application) { + cJSON_AddItemToObject(j_caller_extension, "current_app", cJSON_CreateString(cp->caller_extension->current_application->application_name)); + } + + for (ap = cp->caller_extension->applications; ap; ap = ap->next) { + j_application = cJSON_CreateObject(); + cJSON_AddItemToObject(j_caller_extension, "application", j_application); + + if (ap == cp->caller_extension->current_application) { + cJSON_AddItemToObject(j_application, "last_executed", cJSON_CreateString("true")); + } + cJSON_AddItemToObject(j_application, "app_name", cJSON_CreateString(ap->application_name)); + cJSON_AddItemToObject(j_application, "app_data", cJSON_CreateString(switch_str_nil(ap->application_data))); + } + } + } + } + + j_main_cp = cJSON_CreateObject(); + cJSON_AddItemToObject(j_callflow, "caller_profile", j_main_cp); + + switch_ivr_set_json_profile_data(j_main_cp, caller_profile); + + if (caller_profile->originator_caller_profile) { + switch_caller_profile_t *cp = NULL; + + j_o = cJSON_CreateObject(); + cJSON_AddItemToObject(j_main_cp, "originator", j_o); + + for (cp = caller_profile->originator_caller_profile; cp; cp = cp->next) { + j_caller_profile = cJSON_CreateObject(); + cJSON_AddItemToObject(j_o, "originator_caller_profile", j_caller_profile); + + switch_ivr_set_json_profile_data(j_caller_profile, cp); + } + } + + if (caller_profile->originatee_caller_profile) { + switch_caller_profile_t *cp = NULL; + + j_o = cJSON_CreateObject(); + cJSON_AddItemToObject(j_main_cp, "originatee", j_o); + + for (cp = caller_profile->originatee_caller_profile; cp; cp = cp->next) { + j_caller_profile = cJSON_CreateObject(); + cJSON_AddItemToObject(j_o, "originatee_caller_profile", j_caller_profile); + switch_ivr_set_json_profile_data(j_caller_profile, cp); + } + } + + if (caller_profile->times) { + + j_times = cJSON_CreateObject(); + cJSON_AddItemToObject(j_callflow, "times", j_times); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->created); + cJSON_AddItemToObject(j_times, "created_time", cJSON_CreateString(tmp)); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->profile_created); + cJSON_AddItemToObject(j_times, "profile_created_time", cJSON_CreateString(tmp)); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->progress); + cJSON_AddItemToObject(j_times, "progress_time", cJSON_CreateString(tmp)); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->progress_media); + cJSON_AddItemToObject(j_times, "progress_media_time", cJSON_CreateString(tmp)); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->answered); + cJSON_AddItemToObject(j_times, "answered_time", cJSON_CreateString(tmp)); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup); + cJSON_AddItemToObject(j_times, "hangup_time", cJSON_CreateString(tmp)); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->resurrected); + cJSON_AddItemToObject(j_times, "resurrect_time", cJSON_CreateString(tmp)); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->transferred); + cJSON_AddItemToObject(j_times, "transfer_time", cJSON_CreateString(tmp)); + + } + + caller_profile = caller_profile->next; + } + + *json_cdr = cdr; + + return SWITCH_STATUS_SUCCESS; + +} + + SWITCH_DECLARE(void) switch_ivr_park_session(switch_core_session_t *session) { switch_channel_t *channel = switch_core_session_get_channel(session); @@ -2934,6 +3200,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_process_fh(switch_core_session_t *ses } return SWITCH_STATUS_SUCCESS; } else if (!strcasecmp(cmd, "stop")) { + switch_set_flag(fhp, SWITCH_FILE_DONE); return SWITCH_STATUS_FALSE; } else if (!strcasecmp(cmd, "truncate")) { switch_core_file_truncate(fhp, 0); @@ -3234,6 +3501,31 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_kill_uuid(const char *uuid, switch_ca } } +SWITCH_DECLARE(switch_status_t) switch_ivr_blind_transfer_ack(switch_core_session_t *session, switch_bool_t success) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_status_t status = SWITCH_STATUS_FALSE; + + if (switch_channel_test_flag(channel, CF_CONFIRM_BLIND_TRANSFER)) { + switch_core_session_t *other_session; + const char *uuid = switch_channel_get_variable(channel, "blind_transfer_uuid"); + + switch_channel_clear_flag(channel, CF_CONFIRM_BLIND_TRANSFER); + + if (!zstr(uuid) && (other_session = switch_core_session_locate(uuid))) { + switch_core_session_message_t msg = { 0 }; + msg.message_id = SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE; + msg.from = __FILE__; + msg.numeric_arg = success; + switch_core_session_receive_message(other_session, &msg); + switch_core_session_rwunlock(other_session); + status = SWITCH_STATUS_SUCCESS; + } + } + + return status; + +} /* For Emacs: * Local Variables: diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 17aac4a63f..37da4f0486 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -644,7 +644,7 @@ SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session, swi if (args->input_callback) { status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen); } else { - switch_copy_string((char *) args->buf, (void *) &dtmf, args->buflen); + *((char *) args->buf) = dtmf.digit; status = SWITCH_STATUS_BREAK; } } @@ -1148,9 +1148,14 @@ struct eavesdrop_pvt { switch_mutex_t *r_mutex; switch_buffer_t *w_buffer; switch_mutex_t *w_mutex; + switch_core_session_t *eavesdropper; uint32_t flags; + switch_frame_t demux_frame; + uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE]; }; + + static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type) { struct eavesdrop_pvt *ep = (struct eavesdrop_pvt *) user_data; @@ -1190,13 +1195,18 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data if (switch_buffer_inuse(ep->r_buffer) >= rframe->datalen) { uint32_t bytes; switch_buffer_lock(ep->r_buffer); - bytes = (uint32_t) switch_buffer_read(ep->r_buffer, data, rframe->datalen); + bytes = (uint32_t) switch_buffer_read(ep->r_buffer, ep->data, rframe->datalen); - rframe->datalen = switch_merge_sln(rframe->data, rframe->samples, (int16_t *) data, bytes / 2) * 2; + rframe->datalen = switch_merge_sln(rframe->data, rframe->samples, (int16_t *) ep->data, bytes / 2) * 2; rframe->samples = rframe->datalen / 2; + ep->demux_frame.data = ep->data; + ep->demux_frame.datalen = bytes; + ep->demux_frame.samples = bytes / 2; + switch_buffer_unlock(ep->r_buffer); switch_core_media_bug_set_read_replace_frame(bug, rframe); + switch_core_media_bug_set_read_demux_frame(bug, &ep->demux_frame); } } } @@ -1229,6 +1239,99 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data return SWITCH_TRUE; } +SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_pop_eavesdropper(switch_core_session_t *session, switch_core_session_t **sessionp) +{ + switch_media_bug_t *bug; + switch_status_t status = SWITCH_STATUS_FALSE; + + if (switch_core_media_bug_pop(session, "eavesdrop", &bug) == SWITCH_STATUS_SUCCESS) { + struct eavesdrop_pvt *ep = (struct eavesdrop_pvt *) switch_core_media_bug_get_user_data(bug); + + if (ep && ep->eavesdropper && ep->eavesdropper != session) { + switch_core_session_read_lock(ep->eavesdropper); + *sessionp = ep->eavesdropper; + switch_core_media_bug_set_flag(bug, SMBF_PRUNE); + status = SWITCH_STATUS_SUCCESS; + } + } + + + return status; +} + +struct exec_cb_data { + switch_core_session_t *caller; + char *var; + char *val; +}; + +static void exec_cb(switch_media_bug_t *bug, void *user_data) +{ + struct exec_cb_data *data = (struct exec_cb_data *) user_data; + struct eavesdrop_pvt *ep = (struct eavesdrop_pvt *) switch_core_media_bug_get_user_data(bug); + + if (ep && ep->eavesdropper && ep->eavesdropper != data->caller) { + switch_channel_t *a = switch_core_session_get_channel(ep->eavesdropper); + switch_channel_t *b = switch_core_session_get_channel(data->caller); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s telling %s to exec %s:%s\n", + switch_channel_get_name(b), switch_channel_get_name(a), data->var, data->val); + + switch_core_session_execute_application(ep->eavesdropper, data->var, data->val); + } +} + +static void display_exec_cb(switch_media_bug_t *bug, void *user_data) +{ + struct exec_cb_data *data = (struct exec_cb_data *) user_data; + struct eavesdrop_pvt *ep = (struct eavesdrop_pvt *) switch_core_media_bug_get_user_data(bug); + + if (ep && ep->eavesdropper && ep->eavesdropper != data->caller) { + switch_core_session_message_t msg = { 0 }; + + msg.from = __FILE__; + msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY; + msg.string_array_arg[0] = data->var; + msg.string_array_arg[1] = data->val; + + switch_core_session_receive_message(ep->eavesdropper, &msg); + } +} + +SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_exec_all(switch_core_session_t *session, const char *app, const char *arg) +{ + struct exec_cb_data *data = NULL; + + data = switch_core_session_alloc(session, sizeof(*data)); + data->var = switch_core_session_strdup(session, app); + data->val = switch_core_session_strdup(session, arg); + data->caller = session; + + return switch_core_media_bug_exec_all(session, "eavesdrop", exec_cb, data); +} + + +SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_update_display(switch_core_session_t *session, const char *name, const char *number) +{ + struct exec_cb_data *data = NULL; + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_status_t status = SWITCH_STATUS_FALSE; + + data = switch_core_session_alloc(session, sizeof(*data)); + data->var = switch_core_session_strdup(session, name); + data->val = switch_core_session_strdup(session, number); + data->caller = session; + + if (!switch_channel_test_app_flag_key("EAVESDROP", channel, 1)) { + switch_channel_set_app_flag_key("EAVESDROP", channel, 1); + status = switch_core_media_bug_exec_all(session, "eavesdrop", display_exec_cb, data); + switch_channel_clear_app_flag_key("EAVESDROP", channel, 1); + } + + return status; +} + + SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session_t *session, const char *uuid, const char *require_group, switch_eavesdrop_flag_t flags) { @@ -1236,6 +1339,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session switch_status_t status = SWITCH_STATUS_FALSE; switch_channel_t *channel = switch_core_session_get_channel(session); int codec_initialized = 0; + const char *name, *num; if ((tsession = switch_core_session_locate(uuid))) { struct eavesdrop_pvt *ep = NULL; @@ -1341,6 +1445,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session write_frame.buflen = sizeof(buf); write_frame.rate = codec.implementation->actual_samples_per_second; + ep->eavesdropper = session; ep->flags = flags; switch_mutex_init(&ep->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(tsession)); switch_buffer_create_dynamic(&ep->buffer, 2048, 2048, 8192); @@ -1370,9 +1475,28 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session /* Tell the channel we are going to be in a bridge */ msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE; switch_core_session_receive_message(session, &msg); - cp = switch_channel_get_caller_profile(tchannel); - switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cp->caller_id_number, cp->caller_id_name); + name = cp->caller_id_name; + num = cp->caller_id_number; + + if (flags & ED_COPY_DISPLAY) { + const char *tmp_name = NULL, *tmp_num = NULL; + name = cp->callee_id_name; + num = cp->callee_id_number; + + if (!((tmp_name = switch_channel_get_variable(tchannel, "last_sent_callee_id_name")) + && (tmp_num = switch_channel_get_variable(tchannel, "last_sent_callee_id_number")))) { + + tmp_name = switch_channel_get_variable(tchannel, "callee_id_name"); + tmp_num = switch_channel_get_variable(tchannel, "callee_id_number"); + } + + if (tmp_name) name = tmp_name; + if (tmp_num) num = tmp_num; + + } + + switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", name, num); msg.string_arg = cid_buf; msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY; switch_core_session_receive_message(session, &msg); @@ -3944,7 +4068,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha } } - if ((flags & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) + if ((flags & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(other_uuid))) { if ((flags & SMF_EXEC_INLINE)) { switch_core_session_execute_application_get_flags(other_session, app, path, &app_flags); diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index b75549c417..4af0dbb8ff 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -70,7 +70,7 @@ static void *SWITCH_THREAD_FUNC video_bridge_thread(switch_thread_t *thread, voi } switch_core_session_kill_channel(vh->session_b, SWITCH_SIG_BREAK); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s video thread ended.\n", switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(vh->session_a), SWITCH_LOG_DEBUG, "%s video thread ended.\n", switch_channel_get_name(channel)); vh->up = 0; return NULL; @@ -228,6 +228,8 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } } + switch_channel_clear_flag(chan_a, CF_INTERCEPT); + switch_channel_clear_flag(chan_a, CF_INTERCEPTED); switch_channel_set_flag(chan_a, CF_BRIDGED); @@ -243,7 +245,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) if (bypass_media_after_bridge) { if (switch_stristr("loopback", switch_channel_get_name(chan_a)) || switch_stristr("loopback", switch_channel_get_name(chan_b))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot bypass media while bridged to a loopback address.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_WARNING, "Cannot bypass media while bridged to a loopback address.\n"); bypass_media_after_bridge = 0; } } @@ -253,7 +255,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) switch_core_session_get_read_impl(session_a, &read_impl); if (!switch_channel_media_ready(chan_a)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Channel has no media!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_ERROR, "Channel has no media!\n"); goto end_of_bridge_loop; } @@ -277,7 +279,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) silence_val = 0; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setup generated silence from %s to %s at %d\n", switch_channel_get_name(chan_a), + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "Setup generated silence from %s to %s at %d\n", switch_channel_get_name(chan_a), switch_channel_get_name(chan_b), silence_val); silence_frame.codec = &silence_codec; silence_frame.data = silence_data; @@ -380,7 +382,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) if (cb_status == SWITCH_STATUS_IGNORE) { send_dtmf = 0; } else if (cb_status != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s ended call via DTMF\n", switch_channel_get_name(chan_a)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "%s ended call via DTMF\n", switch_channel_get_name(chan_a)); switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK); goto end_of_bridge_loop; } @@ -406,7 +408,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } if (!ans_a && answer_limit && switch_epoch_time_now(NULL) > answer_limit) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Answer timeout hit on %s.\n", switch_channel_get_name(chan_a)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "Answer timeout hit on %s.\n", switch_channel_get_name(chan_a)); switch_channel_hangup(chan_a, SWITCH_CAUSE_ALLOTTED_TIMEOUT); } @@ -415,13 +417,13 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) if (!ans_b && switch_channel_test_flag(chan_b, CF_ANSWERED)) { switch_channel_pass_callee_id(chan_b, chan_a); if (switch_channel_answer(chan_a) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(chan_a)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(chan_a)); goto end_of_bridge_loop; } ans_a = 1; } else if (!pre_b && switch_channel_test_flag(chan_b, CF_EARLY_MEDIA)) { if (switch_channel_pre_answer(chan_a) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(chan_a)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(chan_a)); goto end_of_bridge_loop; } pre_b = 1; @@ -445,7 +447,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } if (switch_channel_answer(un) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(un)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(un)); goto end_of_bridge_loop; } @@ -496,13 +498,13 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) if (status != SWITCH_STATUS_BREAK && !switch_channel_test_flag(chan_a, CF_HOLD)) { if (switch_core_session_write_frame(session_b, read_frame, SWITCH_IO_FLAG_NONE, stream_id) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "%s ending bridge by request from write function\n", switch_channel_get_name(chan_b)); goto end_of_bridge_loop; } } } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s ending bridge by request from read function\n", switch_channel_get_name(chan_a)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "%s ending bridge by request from read function\n", switch_channel_get_name(chan_a)); goto end_of_bridge_loop; } } @@ -516,7 +518,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) switch_channel_set_flag(chan_b, CF_NOT_READY); switch_core_session_kill_channel(session_a, SWITCH_SIG_BREAK); switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Ending video thread.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "Ending video thread.\n"); } #endif @@ -538,7 +540,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } SWITCH_STANDARD_STREAM(stream); switch_api_execute(cmd, arg, NULL, &stream); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\nPost-Bridge Command %s(%s):\n%s\n", cmd, arg, switch_str_nil((char *) stream.data)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "\nPost-Bridge Command %s(%s):\n%s\n", cmd, arg, switch_str_nil((char *) stream.data)); switch_safe_free(stream.data); } @@ -546,7 +548,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) if ((app_name = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE))) { switch_caller_extension_t *extension = NULL; if ((extension = switch_caller_extension_new(session_a, app_name, app_name)) == 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "memory error!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_CRIT, "memory error!\n"); goto end; } app_arg = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE); @@ -572,7 +574,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) switch_core_session_kill_channel(session_a, SWITCH_SIG_BREAK); switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Ending video thread.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "Ending video thread.\n"); switch_thread_join(&st, vid_thread); switch_channel_clear_flag(chan_a, CF_NOT_READY); switch_channel_clear_flag(chan_b, CF_NOT_READY); @@ -583,7 +585,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) switch_core_session_reset(session_a, SWITCH_TRUE, SWITCH_TRUE); switch_channel_set_variable(chan_a, SWITCH_BRIDGE_VARIABLE, NULL); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "BRIDGE THREAD DONE [%s]\n", switch_channel_get_name(chan_a)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "BRIDGE THREAD DONE [%s]\n", switch_channel_get_name(chan_a)); switch_channel_clear_flag(chan_a, CF_BRIDGED); if (switch_channel_test_flag(chan_a, CF_LEG_HOLDING) && switch_channel_ready(chan_b)) { @@ -625,7 +627,7 @@ static void transfer_after_bridge(switch_core_session_t *session, const char *wh if ((argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) { switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No extension specified.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No extension specified.\n"); } } } @@ -660,13 +662,19 @@ static switch_status_t audio_bridge_on_exchange_media(switch_core_session_t *ses if (!switch_channel_test_flag(channel, CF_TRANSFER) && !switch_channel_test_flag(channel, CF_REDIRECT) && !switch_channel_test_flag(channel, CF_XFER_ZOMBIE) && bd && !bd->clean_exit && state != CS_PARK && state != CS_ROUTING && state == CS_EXCHANGE_MEDIA && !switch_channel_test_flag(channel, CF_INNER_BRIDGE)) { - if (switch_channel_test_flag(channel, CF_INTERCEPT)) { - switch_channel_hangup(channel, SWITCH_CAUSE_PICKED_OFF); + if (switch_channel_test_flag(channel, CF_INTERCEPTED)) { + switch_channel_clear_flag(channel, CF_INTERCEPT); + switch_channel_clear_flag(channel, CF_INTERCEPTED); + return SWITCH_STATUS_FALSE; } else { - if (!switch_channel_test_flag(channel, CF_ANSWERED)) { - switch_channel_hangup(channel, SWITCH_CAUSE_ORIGINATOR_CANCEL); + if (switch_channel_test_flag(channel, CF_INTERCEPT)) { + switch_channel_hangup(channel, SWITCH_CAUSE_PICKED_OFF); } else { - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); + if (!switch_channel_test_flag(channel, CF_ANSWERED)) { + switch_channel_hangup(channel, SWITCH_CAUSE_ORIGINATOR_CANCEL); + } else { + switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); + } } } } @@ -684,7 +692,7 @@ static switch_status_t audio_bridge_on_routing(switch_core_session_t *session) { switch_channel_t *channel = switch_core_session_get_channel(session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM ROUTING\n", switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CUSTOM ROUTING\n", switch_channel_get_name(channel)); /* put the channel in a passive state so we can loop audio to it */ switch_channel_set_state(channel, CS_CONSUME_MEDIA); @@ -695,7 +703,7 @@ static switch_status_t audio_bridge_on_consume_media(switch_core_session_t *sess { switch_channel_t *channel = switch_core_session_get_channel(session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM HOLD\n", switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CUSTOM HOLD\n", switch_channel_get_name(channel)); /* put the channel in a passive state so we can loop audio to it */ return SWITCH_STATUS_FALSE; @@ -731,7 +739,7 @@ static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session) { switch_channel_t *channel = switch_core_session_get_channel(session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM RESET\n", switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CUSTOM RESET\n", switch_channel_get_name(channel)); switch_channel_clear_flag(channel, CF_ORIGINATING); @@ -756,7 +764,7 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio switch_core_session_t *other_session; const char *other_uuid = NULL; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM SOFT_EXECUTE\n", switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CUSTOM SOFT_EXECUTE\n", switch_channel_get_name(channel)); switch_channel_clear_state_handler(channel, &uuid_bridge_state_handlers); if (!switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { @@ -813,7 +821,7 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio switch_core_session_rwunlock(other_session); if (switch_true(switch_channel_get_variable(channel, "uuid_bridge_continue_on_cancel"))) { switch_channel_set_state(channel, CS_EXECUTE); - } else { + } else if (!switch_channel_test_flag(channel, CF_TRANSFER)) { switch_channel_hangup(channel, SWITCH_CAUSE_ORIGINATOR_CANCEL); } goto done; @@ -962,9 +970,16 @@ static switch_status_t signal_bridge_on_hibernate(switch_core_session_t *session if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { + switch_core_session_t *other_session; + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", msg.string_arg); switch_channel_event_set_data(channel, event); + if ((other_session = switch_core_session_locate(msg.string_arg))) { + switch_channel_t *other_channel = switch_core_session_get_channel(other_session); + switch_event_add_presence_data_cols(other_channel, event, "Bridge-B-PD-"); + switch_core_session_rwunlock(other_session); + } switch_event_fire(&event); } } @@ -984,6 +999,7 @@ static switch_status_t signal_bridge_on_hibernate(switch_core_session_t *session } } switch_yield(20000); + switch_ivr_parse_all_messages(session); } } @@ -1045,16 +1061,27 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session) } } - switch_core_session_rwunlock(other_session); - } + if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { + switch_channel_clear_flag_recursive(channel, CF_BRIDGE_ORIGINATOR); + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", uuid); + switch_event_add_presence_data_cols(other_channel, event, "Bridge-B-PD-"); + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + } - if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { - switch_channel_clear_flag_recursive(channel, CF_BRIDGE_ORIGINATOR); - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", uuid); - switch_channel_event_set_data(channel, event); - switch_event_fire(&event); + switch_core_session_rwunlock(other_session); + } else { + if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { + switch_channel_clear_flag_recursive(channel, CF_BRIDGE_ORIGINATOR); + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", uuid); + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } } } @@ -1235,6 +1262,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", switch_core_session_get_uuid(peer_session)); switch_channel_event_set_data(caller_channel, event); + switch_event_add_presence_data_cols(peer_channel, event, "Bridge-B-PD-"); switch_event_fire(&event); br = 1; } @@ -1337,6 +1365,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses while (switch_channel_get_state(peer_channel) == CS_EXCHANGE_MEDIA) { + switch_ivr_parse_all_messages(session); switch_cond_next(); } @@ -1358,21 +1387,41 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE, switch_channel_cause2str(cause)); } - if (switch_channel_down_nosig(peer_channel) && switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_XML_CDR_VARIABLE))) { - switch_xml_t cdr = NULL; - char *xml_text; + if (switch_channel_down_nosig(peer_channel)) { + switch_bool_t copy_xml_cdr = switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_XML_CDR_VARIABLE)); + switch_bool_t copy_json_cdr = switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_JSON_CDR_VARIABLE)); - switch_channel_wait_for_state(peer_channel, caller_channel, CS_DESTROY); + if (copy_xml_cdr || copy_json_cdr) { + char *cdr_text = NULL; - if (switch_ivr_generate_xml_cdr(peer_session, &cdr) == SWITCH_STATUS_SUCCESS) { - if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) { - switch_channel_set_variable(caller_channel, "b_leg_cdr", xml_text); - switch_safe_free(xml_text); + switch_channel_wait_for_state(peer_channel, caller_channel, CS_DESTROY); + + if (copy_xml_cdr) { + switch_xml_t cdr = NULL; + + if (switch_ivr_generate_xml_cdr(peer_session, &cdr) == SWITCH_STATUS_SUCCESS) { + cdr_text = switch_xml_toxml(cdr, SWITCH_FALSE); + switch_xml_free(cdr); + } } - switch_xml_free(cdr); - } - } + if (copy_json_cdr) { + cJSON *cdr = NULL; + if (switch_ivr_generate_json_cdr(peer_session, &cdr, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) { + cdr_text = cJSON_PrintUnformatted(cdr); + cJSON_Delete(cdr); + } + } + + if (cdr_text) { + switch_channel_set_variable(caller_channel, "b_leg_cdr", cdr_text); + switch_channel_set_variable_name_printf(caller_channel, cdr_text, "b_leg_cdr_%s", switch_core_session_get_uuid(peer_session)); + switch_safe_free(cdr_text); + } + } + + } + switch_core_session_rwunlock(peer_session); } else { @@ -1383,7 +1432,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses } if (status != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Bridge Failed %s->%s\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Bridge Failed %s->%s\n", switch_channel_get_name(caller_channel), switch_channel_get_name(peer_channel) ); switch_channel_hangup(peer_channel, SWITCH_CAUSE_NO_ANSWER); @@ -1397,6 +1446,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", switch_core_session_get_uuid(peer_session)); switch_channel_event_set_data(caller_channel, event); + switch_event_add_presence_data_cols(peer_channel, event, "Bridge-B-PD-"); switch_event_fire(&event); } @@ -1463,21 +1513,26 @@ static void cleanup_proxy_mode_b(switch_core_session_t *session) static void cleanup_proxy_mode_a(switch_core_session_t *session) { switch_core_session_t *sbsession; - switch_channel_t *channel = switch_core_session_get_channel(session); - + int done = 0; if (switch_channel_test_flag(channel, CF_PROXY_MODE)) { - const char *sbv = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); - if (!zstr(sbv) && (sbsession = switch_core_session_locate(sbv))) { + if (switch_core_session_get_partner(session, &sbsession) == SWITCH_STATUS_SUCCESS) { switch_channel_t *sbchannel = switch_core_session_get_channel(sbsession); - /* Clear this now, otherwise will cause the one we're interested in to hang up too...*/ - switch_channel_set_variable(sbchannel, SWITCH_SIGNAL_BRIDGE_VARIABLE, NULL); - switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER); + + if (switch_channel_test_flag(sbchannel, CF_PROXY_MODE)) { + /* Clear this now, otherwise will cause the one we're interested in to hang up too...*/ + switch_channel_set_variable(sbchannel, SWITCH_SIGNAL_BRIDGE_VARIABLE, NULL); + switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER); + } else { + done = 1; + } switch_core_session_rwunlock(sbsession); } } + if (done) return; + switch_channel_set_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE, NULL); switch_channel_set_variable(channel, SWITCH_BRIDGE_VARIABLE, NULL); switch_channel_set_variable(channel, SWITCH_BRIDGE_UUID_VARIABLE, NULL); @@ -1511,7 +1566,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu if (switch_channel_down_nosig(originator_channel)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s is hungup refusing to bridge.\n", switch_channel_get_name(originatee_channel)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(originator_session), SWITCH_LOG_DEBUG, "%s is hungup refusing to bridge.\n", switch_channel_get_name(originatee_channel)); switch_core_session_rwunlock(originator_session); switch_core_session_rwunlock(originatee_session); return SWITCH_STATUS_FALSE; @@ -1526,9 +1581,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu swap_channel = originator_channel; originator_channel = originatee_channel; originatee_channel = swap_channel; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "reversing order of channels so this will work!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(originatee_session), SWITCH_LOG_WARNING, "reversing order of channels so this will work!\n"); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Neither channel is answered, cannot bridge them.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(originator_session), SWITCH_LOG_CRIT, "Neither channel is answered, cannot bridge them.\n"); switch_core_session_rwunlock(originator_session); switch_core_session_rwunlock(originatee_session); return SWITCH_STATUS_FALSE; @@ -1627,11 +1682,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu switch_core_session_rwunlock(originatee_session); } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(originator_session), SWITCH_LOG_DEBUG, "originatee uuid %s is not present\n", originatee_uuid); switch_core_session_rwunlock(originator_session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "originatee uuid %s is not present\n", originatee_uuid); } } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "originator uuid %s is not present\n", originator_uuid); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(originator_session), SWITCH_LOG_DEBUG, "originator uuid %s is not present\n", originator_uuid); } return status; @@ -1648,7 +1703,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, c switch_channel_t *rchannel = switch_core_session_get_channel(rsession); const char *brto; - if ((brto = switch_channel_get_variable(rchannel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((brto = switch_channel_get_variable(rchannel, "orignate_signal_bond")) || + (brto = switch_channel_get_partner_uuid(rchannel))) { switch_copy_string(b_uuid, brto, blen); status = SWITCH_STATUS_SUCCESS; } @@ -1670,19 +1726,19 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session if (switch_ivr_find_bridged_uuid(uuid, brto, sizeof(brto)) == SWITCH_STATUS_SUCCESS) { uuid = switch_core_session_strdup(session, brto); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no uuid bridged to %s\n", uuid); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "no uuid bridged to %s\n", uuid); return; } } if (zstr(uuid) || !(rsession = switch_core_session_locate(uuid))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no uuid %s\n", uuid); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "no uuid %s\n", uuid); return; } channel = switch_core_session_get_channel(session); rchannel = switch_core_session_get_channel(rsession); - buuid = switch_channel_get_variable(rchannel, SWITCH_SIGNAL_BOND_VARIABLE); + buuid = switch_channel_get_partner_uuid(rchannel); if ((var = switch_channel_get_variable(channel, "intercept_unbridged_only")) && switch_true(var)) { if ((switch_channel_test_flag(rchannel, CF_BRIDGED))) { diff --git a/src/switch_ivr_menu.c b/src/switch_ivr_menu.c index c171d1b02b..4b73f58793 100644 --- a/src/switch_ivr_menu.c +++ b/src/switch_ivr_menu.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index f3223723e9..c18da450a6 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -49,6 +49,7 @@ static switch_status_t originate_on_consume_media_transmit(switch_core_session_t } else { switch_ivr_sleep(session, 10, SWITCH_FALSE, NULL); } + switch_ivr_parse_all_messages(session); } } @@ -122,6 +123,7 @@ typedef struct { int bridge_early_media; switch_thread_t *ethread; switch_caller_profile_t *caller_profile_override; + switch_bool_t check_vars; switch_memory_pool_t *pool; } originate_global_t; @@ -427,6 +429,7 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat char bug_key[256] = ""; int send_ringback = 0; uint8_t ring_ready_val = 0; + int pickups = 0; oglobals->hups = 0; oglobals->idx = IDX_NADA; @@ -440,6 +443,32 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat } + for (i = 0; i < len; i++) { + if (originate_status[i].peer_channel && switch_channel_test_flag(originate_status[i].peer_channel, CF_CHANNEL_SWAP)) { + const char *key = switch_channel_get_variable(originate_status[i].peer_channel, "channel_swap_uuid"); + switch_core_session_t *swap_session, *old_session; + + if ((swap_session = switch_core_session_locate(key))) { + switch_channel_clear_flag(originate_status[i].peer_channel, CF_CHANNEL_SWAP); + switch_channel_hangup(originate_status[i].peer_channel, SWITCH_CAUSE_PICKED_OFF); + + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(originate_status[i].peer_channel), SWITCH_LOG_DEBUG, "Swapping %s for %s\n", + switch_core_session_get_name(swap_session), switch_channel_get_name(originate_status[i].peer_channel)); + + + old_session = originate_status[i].peer_session; + originate_status[i].peer_session = swap_session; + originate_status[i].peer_channel = switch_core_session_get_channel(originate_status[i].peer_session); + originate_status[i].caller_profile = switch_channel_get_caller_profile(originate_status[i].peer_channel); + switch_channel_set_flag(originate_status[i].peer_channel, CF_ORIGINATING); + + switch_channel_answer(originate_status[i].peer_channel); + switch_core_session_rwunlock(old_session); + break; + } + } + } + for (i = 0; i < len; i++) { switch_channel_state_t state; @@ -460,6 +489,11 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat } } + + if (originate_status[i].peer_channel && switch_channel_test_flag(originate_status[i].peer_channel, CF_PICKUP)) { + pickups++; + } + if (!(originate_status[i].peer_channel && originate_status[i].peer_session)) { oglobals->hups++; continue; @@ -717,7 +751,7 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat } } - if (oglobals->hups == len) { + if (oglobals->hups + pickups == len) { rval = 0; } else { rval = 1; @@ -943,6 +977,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t while (switch_channel_ready(peer_channel) && !switch_channel_media_ready(peer_channel)) { int diff = (int) (switch_micro_time_now() - start); + switch_ivr_parse_all_messages(session); + if (caller_channel && cancel_key) { if (switch_channel_has_dtmf(caller_channel)) { switch_dtmf_t dtmf = { 0, 0 }; @@ -997,6 +1033,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t switch_core_file_seek(ringback.fh, &pos, 0, SEEK_SET); switch_core_file_read(ringback.fh, write_frame.data, &olen); if (olen == 0) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_ERROR, + "Failure to read or re-read after seeking to beginning on file [%s]\n", ringback.fh->file_path); break; } } @@ -1056,6 +1094,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t switch_channel_state_t peer_state = switch_channel_get_state(peer_channel); while (switch_channel_ready(peer_channel) && switch_channel_get_state(peer_channel) == peer_state) { + switch_ivr_parse_all_messages(session); switch_channel_ready(caller_channel); switch_yield(20000); } @@ -1202,7 +1241,7 @@ static switch_status_t setup_ringback(originate_global_t *oglobals, originate_st read_codec->implementation->number_of_channels, read_codec->implementation->actual_samples_per_second, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals->session), SWITCH_LOG_ERROR, "Error Playing File\n"); switch_safe_free(tmp_data); switch_goto_status(SWITCH_STATUS_GENERR, end); //switch_goto_status(SWITCH_STATUS_FALSE, end); @@ -1224,12 +1263,12 @@ static switch_status_t setup_ringback(originate_global_t *oglobals, originate_st teletone_init_session(&ringback->ts, 0, teletone_handler, ringback); ringback->ts.rate = read_codec->implementation->actual_samples_per_second; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals->session), SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data); /* ringback->ts.debug = 1; ringback->ts.debug_stream = switch_core_get_console(); */ if (teletone_run(&ringback->ts, ringback_data)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing Tone\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals->session), SWITCH_LOG_ERROR, "Error Playing Tone\n"); teletone_destroy_session(&ringback->ts); switch_buffer_destroy(&ringback->audio_buffer); switch_goto_status(SWITCH_STATUS_GENERR, end); @@ -1311,6 +1350,7 @@ static void *SWITCH_THREAD_FUNC enterprise_originate_ringback_thread(switch_thre switch_core_session_read_lock(session); while (rb_data->running && switch_channel_ready(channel)) { + switch_ivr_parse_all_messages(session); if (status != SWITCH_STATUS_BREAK) { if (zstr(rb_data->ringback_data) || !strcasecmp(rb_data->ringback_data, "silence")) { status = switch_ivr_collect_digits_callback(session, NULL, 0, 0); @@ -1410,7 +1450,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess } /* extract channel variables, allowing multiple sets of braces */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Parsing ultra-global variables\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Parsing ultra-global variables\n"); while (*data == '<') { char *parsed = NULL; @@ -1762,6 +1802,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess caller_profile_override, ovars, flags, cancel_cause); } + oglobals.check_vars = SWITCH_TRUE; oglobals.ringback_ok = 1; oglobals.bridge_early_media = -1; oglobals.file = NULL; @@ -1779,7 +1820,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } if (session) { - const char *to_var, *bypass_media = NULL, *proxy_media = NULL; + const char *to_var, *bypass_media = NULL, *proxy_media = NULL, *zrtp_passthru = NULL; caller_channel = switch_core_session_get_channel(session); switch_channel_set_flag(caller_channel, CF_ORIGINATOR); oglobals.session = session; @@ -1792,6 +1833,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess proxy_media = switch_channel_get_variable(caller_channel, SWITCH_PROXY_MEDIA_VARIABLE); bypass_media = switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE); + zrtp_passthru = switch_channel_get_variable(caller_channel, SWITCH_ZRTP_PASSTHRU_VARIABLE); if (!zstr(proxy_media)) { if (switch_true(proxy_media)) { @@ -1801,6 +1843,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } } + if (!zstr(zrtp_passthru)) { + if (switch_true(zrtp_passthru)) { + switch_channel_set_flag(caller_channel, CF_ZRTP_PASSTHRU_REQ); + } else if (switch_channel_test_flag(caller_channel, CF_ZRTP_PASSTHRU_REQ)) { + switch_channel_clear_flag(caller_channel, CF_ZRTP_PASSTHRU_REQ); + } + } + if (bypass_media && switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(caller_channel, CF_ANSWERED)) { switch_core_session_message_t msg = { 0 }; @@ -1880,8 +1930,30 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess data++; } + if ((ovars && switch_true(switch_event_get_header(ovars,"origination_nested_vars"))) || + (caller_channel && switch_true(switch_channel_get_variable(caller_channel, "origination_nested_vars"))) + || switch_true(switch_core_get_variable("origination_nested_vars")) || switch_stristr("origination_nested_vars=true", data)) { + oglobals.check_vars = SWITCH_FALSE; + } + + /* extract channel variables, allowing multiple sets of braces */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Parsing global variables\n"); + if (*data == '<') { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Parsing ultra-global variables\n"); + while (*data == '<') { + char *parsed = NULL; + + if (switch_event_create_brackets(data, '<', '>', ',', &var_event, &parsed, SWITCH_FALSE) != SWITCH_STATUS_SUCCESS || !parsed) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Parse Error!\n"); + switch_goto_status(SWITCH_STATUS_GENERR, done); + } + + data = parsed; + } + } + + /* extract channel variables, allowing multiple sets of braces */ + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Parsing global variables\n"); while (*data == '{') { char *parsed = NULL; @@ -1931,6 +2003,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess ok = 1; } else if (!strcasecmp((char *) hi->name, "group_confirm_file")) { ok = 1; + } else if (!strcasecmp((char *) hi->name, "group_confirm_read_timeout")) { + ok = 1; } else if (!strcasecmp((char *) hi->name, "group_confirm_cancel_timeout")) { ok = 1; } else if (!strcasecmp((char *) hi->name, "forked_dial")) { @@ -2296,7 +2370,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess if (*chan_type == '[') { switch_event_create_plain(&local_var_event, SWITCH_EVENT_CHANNEL_DATA); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Parsing session specific variables\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Parsing session specific variables\n"); } while (*chan_type == '[') { @@ -2506,7 +2580,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_event_header_t *header; /* install the vars from the {} params */ for (header = var_event->headers; header; header = header->next) { - switch_channel_set_variable(originate_status[i].peer_channel, header->name, header->value); + switch_channel_set_variable_var_check(originate_status[i].peer_channel, header->name, header->value, oglobals.check_vars); } } } @@ -2515,7 +2589,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess if (local_var_event) { switch_event_header_t *header; for (header = local_var_event->headers; header; header = header->next) { - switch_channel_set_variable(originate_status[i].peer_channel, header->name, header->value); + switch_channel_set_variable_var_check(originate_status[i].peer_channel, header->name, header->value, oglobals.check_vars); } switch_event_destroy(&local_var_event); } @@ -2525,7 +2599,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_event_header_t *header; /* install the vars from the {} params */ for (header = var_event->headers; header; header = header->next) { - switch_channel_set_variable(originate_status[i].peer_channel, header->name, header->value); + switch_channel_set_variable_var_check(originate_status[i].peer_channel, header->name, header->value, oglobals.check_vars); } } } @@ -3095,7 +3169,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(peer_session)); holding = NULL; oglobals.idx = IDX_NADA; - if (caller_channel && switch_channel_up_nosig(caller_channel)) { + if (caller_channel && switch_channel_up_nosig(caller_channel) && !switch_channel_test_flag(caller_channel, CF_INTERCEPTED)) { switch_channel_hangup(caller_channel, SWITCH_CAUSE_ATTENDED_TRANSFER); } caller_channel = NULL; @@ -3156,7 +3230,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_channel_set_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, NULL); } - if (holding && oglobals.idx != IDX_TIMEOUT && oglobals.idx != IDX_KEY_CANCEL) { + if (holding && oglobals.idx != IDX_TIMEOUT && oglobals.idx != IDX_KEY_CANCEL && oglobals.idx < 0) { switch_core_session_t *holding_session; if ((holding_session = switch_core_session_locate(holding))) { @@ -3175,7 +3249,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_core_session_rwunlock(holding_session); } switch_channel_set_flag(originate_status[i].peer_channel, CF_LAZY_ATTENDED_TRANSFER); - switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session)); holding = NULL; } else { @@ -3508,8 +3581,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess if (*bleg) { switch_channel_t *bchan = switch_core_session_get_channel(*bleg); - - if (session && caller_channel) { switch_caller_profile_t *cloned_profile, *peer_profile = switch_channel_get_caller_profile(switch_core_session_get_channel(*bleg)); @@ -3521,7 +3592,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_channel_set_variable(caller_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(*bleg)); // Now main SWITCH_SIGNAL_BOND_VARIABLE is populated, don't need this one anymore... - switch_channel_set_variable(caller_channel, "originate_signal_bond", NULL); + switch_channel_set_variable(caller_channel, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE, NULL); } diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index b4178e9e85..8738071cb4 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1113,7 +1113,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess if (cur) { fh->samples = sample_start = 0; if (sleep_val_i) { - switch_ivr_sleep(session, sleep_val_i, SWITCH_FALSE, args); + status = switch_ivr_sleep(session, sleep_val_i, SWITCH_FALSE, args); + if(status != SWITCH_STATUS_SUCCESS) { + break; + } } } @@ -1594,6 +1597,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess switch_status_t tstatus; while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) { + switch_ivr_parse_all_messages(session); switch_yield(10000); } @@ -2181,6 +2185,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session } } + switch_channel_audio_sync(channel); + ilen = len; for (;;) { switch_event_t *event; @@ -2255,6 +2261,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) { + switch_ivr_parse_all_messages(session); switch_yield(10000); } @@ -2327,6 +2334,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) { + switch_ivr_parse_all_messages(session); switch_yield(10000); } @@ -2346,7 +2354,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session } } } - } done: @@ -2377,8 +2384,12 @@ SWITCH_DECLARE(void) switch_ivr_clear_speech_cache(switch_core_session_t *sessio if (cache_obj->timer.interval) { switch_core_timer_destroy(&cache_obj->timer); } - switch_core_speech_close(&cache_obj->sh, &flags); - switch_core_codec_destroy(&cache_obj->codec); + if (&cache_obj->sh && cache_obj->sh.speech_interface) { + switch_core_speech_close(&cache_obj->sh, &flags); + } + if (&cache_obj->codec) { + switch_core_codec_destroy(&cache_obj->codec); + } switch_channel_set_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME, NULL); } } @@ -2412,7 +2423,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses timer = <imer; if ((var = switch_channel_get_variable(channel, SWITCH_CACHE_SPEECH_HANDLES_VARIABLE)) && switch_true(var)) { - if ((cache_obj = switch_channel_get_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME))) { + if ((cache_obj = (cached_speech_handle_t *) switch_channel_get_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME))) { need_create = 0; if (!strcasecmp(cache_obj->tts_name, tts_name)) { need_alloc = 0; @@ -2422,7 +2433,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses } if (!cache_obj) { - cache_obj = switch_core_session_alloc(session, sizeof(*cache_obj)); + cache_obj = (cached_speech_handle_t *) switch_core_session_alloc(session, sizeof(*cache_obj)); } if (need_alloc) { switch_copy_string(cache_obj->tts_name, tts_name, sizeof(cache_obj->tts_name)); @@ -2559,7 +2570,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_soft_hold(switch_core_session_t *sess channel = switch_core_session_get_channel(session); switch_assert(channel != NULL); - if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { + if ((other_uuid = switch_channel_get_partner_uuid(channel))) { if ((other_session = switch_core_session_locate(other_uuid))) { other_channel = switch_core_session_get_channel(other_session); diff --git a/src/switch_ivr_say.c b/src/switch_ivr_say.c index 7764ee441b..0081ab16f5 100644 --- a/src/switch_ivr_say.c +++ b/src/switch_ivr_say.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_limit.c b/src/switch_limit.c index 9313ecf5cf..6e792ca53d 100644 --- a/src/switch_limit.c +++ b/src/switch_limit.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index 2a6b25bc4e..4bc0e93108 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -1981,6 +1981,10 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation for (i = 0; i < arraylen; i++) { int this_ptime = array[i]->microseconds_per_packet / 1000; + + if (!strcasecmp(array[i]->iananame, "ilbc")) { + this_ptime = 20; + } if (!sorted_ptime) { sorted_ptime = this_ptime; @@ -1999,6 +2003,10 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation for(j = i; j < arraylen; j++) { int check_ptime = array[j]->microseconds_per_packet / 1000; + if (!strcasecmp(array[i]->iananame, "ilbc")) { + check_ptime = 20; + } + if (check_ptime == sorted_ptime) { #ifdef DEBUG_CODEC_SORTING switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "swap %d %d ptime %d\n", i, j, check_ptime); @@ -2067,41 +2075,79 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs(const switch_codec_impleme } +SWITCH_DECLARE(char *) switch_parse_codec_buf(char *buf, uint32_t *interval, uint32_t *rate, uint32_t *bit) +{ + char *cur, *next = NULL, *name, *p; + + name = next = cur = buf; + + for (;;) { + if (!next) { + break; + } + + if ((p = strchr(next, '@'))) { + *p++ = '\0'; + } + next = p; + + if (cur != name) { + if (strchr(cur, 'i')) { + *interval = atoi(cur); + } else if ((strchr(cur, 'k') || strchr(cur, 'h'))) { + *rate = atoi(cur); + } else if (strchr(cur, 'b')) { + *bit = atoi(cur); + } + } + cur = next; + } + + return name; +} + SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_implementation_t **array, int arraylen, char **prefs, int preflen) { - int x, i = 0; + int x, i = 0, j = 0; switch_codec_interface_t *codec_interface; const switch_codec_implementation_t *imp; switch_mutex_lock(loadable_modules.mutex); for (x = 0; x < preflen; x++) { - char *cur, *next = NULL, *name, *p, buf[256]; + char *name, buf[256], jbuf[256]; uint32_t interval = 0, rate = 0, bit = 0; switch_copy_string(buf, prefs[x], sizeof(buf)); - name = next = cur = buf; + name = switch_parse_codec_buf(buf, &interval, &rate, &bit); - for (;;) { - if (!next) { - break; + for(j = 0; j < x; j++) { + char *jname; + uint32_t jinterval = 0, jrate = 0, jbit = 0; + uint32_t ointerval = interval, orate = rate; + + if (ointerval == 0) { + ointerval = switch_default_ptime(name, 0); + } + + if (orate == 0) { + orate = 8000; } - if ((p = strchr(next, '@'))) { - *p++ = '\0'; - } - next = p; + switch_copy_string(jbuf, prefs[j], sizeof(jbuf)); + jname = switch_parse_codec_buf(jbuf, &jinterval, &jrate, &jbit); - if (cur != name) { - if (strchr(cur, 'i')) { - interval = atoi(cur); - } else if ((strchr(cur, 'k') || strchr(cur, 'h'))) { - rate = atoi(cur); - } else if (strchr(cur, 'b')) { - bit = atoi(cur); - } + if (jinterval == 0) { + jinterval = switch_default_ptime(jname, 0); + } + + if (jrate == 0) { + jrate = 8000; + } + + if (!strcasecmp(name, jname) && ointerval == jinterval && orate == jrate) { + goto next_x; } - cur = next; } if ((codec_interface = switch_loadable_module_get_codec_interface(name)) != 0) { @@ -2164,6 +2210,10 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_ } } + + next_x: + + continue; } switch_mutex_unlock(loadable_modules.mutex); diff --git a/src/switch_log.c b/src/switch_log.c index d195b6e585..1bd931a44e 100644 --- a/src/switch_log.c +++ b/src/switch_log.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -543,7 +543,7 @@ SWITCH_DECLARE(void) switch_core_memory_reclaim_logger(void) #ifdef SWITCH_LOG_RECYCLE void *pop; int size = switch_queue_size(LOG_RECYCLE_QUEUE); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Returning %d recycled log node(s) %d bytes\n", size, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CONSOLE, "Returning %d recycled log node(s) %d bytes\n", size, (int) sizeof(switch_log_node_t) * size); while (switch_queue_trypop(LOG_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) { switch_log_node_free(&pop); diff --git a/src/switch_nat.c b/src/switch_nat.c index dd73cd8be7..b992c19fc5 100644 --- a/src/switch_nat.c +++ b/src/switch_nat.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2009, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_odbc.c b/src/switch_odbc.c index 24a25cb0af..a0204de243 100644 --- a/src/switch_odbc.c +++ b/src/switch_odbc.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_pcm.c b/src/switch_pcm.c index 51d1ced182..01a56b8e58 100644 --- a/src/switch_pcm.c +++ b/src/switch_pcm.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_regex.c b/src/switch_regex.c index 58be38cb6c..02ed65e4e2 100644 --- a/src/switch_regex.c +++ b/src/switch_regex.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_resample.c b/src/switch_resample.c index 7355384915..6722d6f448 100644 --- a/src/switch_resample.c +++ b/src/switch_resample.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -252,6 +252,25 @@ SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16 return x; } + +SWITCH_DECLARE(uint32_t) switch_unmerge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples) +{ + int i; + int32_t x; + + if (samples > other_samples) { + x = other_samples; + } else { + x = samples; + } + + for (i = 0; i < x; i++) { + data[i] -= other_data[i]; + } + + return x; +} + SWITCH_DECLARE(void) switch_mux_channels(int16_t *data, switch_size_t samples, uint32_t channels) { int16_t *buf; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 5e741c4eb7..039cad9eb6 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -71,9 +71,13 @@ static switch_mutex_t *port_lock = NULL; typedef srtp_hdr_t rtp_hdr_t; #ifdef ENABLE_ZRTP -#include +#include "zrtp.h" static zrtp_global_t *zrtp_global; +#ifndef WIN32 static zrtp_zid_t zid = { "FreeSWITCH01" }; +#else +static zrtp_zid_t zid = { "FreeSWITCH0" }; +#endif static int zrtp_on = 0; #define ZRTP_MITM_TRIES 100 #endif @@ -193,6 +197,7 @@ struct switch_rtp { uint32_t last_cng_ts; uint32_t last_write_samplecount; uint32_t delay_samples; + uint32_t next_write_samplecount; uint32_t max_next_write_samplecount; uint32_t queue_delay; switch_time_t last_write_timestamp; @@ -248,6 +253,15 @@ struct switch_rtp { uint32_t sync_packets; int rtcp_interval; switch_bool_t rtcp_fresh_frame; + + switch_time_t send_time; + switch_byte_t auto_adj_used; + uint8_t pause_jb; + uint16_t last_seq; + switch_time_t last_read_time; + switch_size_t last_flush_packet_count; + uint32_t interdigit_delay; + #ifdef ENABLE_ZRTP zrtp_session_t *zrtp_session; zrtp_profile_t *zrtp_profile; @@ -256,12 +270,7 @@ struct switch_rtp { int zinit; #endif - switch_time_t send_time; - switch_byte_t auto_adj_used; - uint8_t pause_jb; - uint16_t last_seq; - switch_time_t last_read_time; - switch_size_t last_flush_packet_count; + }; struct switch_rtcp_senderinfo { @@ -286,14 +295,15 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ { #ifdef DEBUG_2833 if (rtp_session->dtmf_data.in_digit_sanity && !(rtp_session->dtmf_data.in_digit_sanity % 100)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sanity %d\n", rtp_session->dtmf_data.in_digit_sanity); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "sanity %d\n", rtp_session->dtmf_data.in_digit_sanity); } #endif if (rtp_session->dtmf_data.in_digit_sanity && !--rtp_session->dtmf_data.in_digit_sanity) { + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); rtp_session->dtmf_data.last_digit = 0; rtp_session->dtmf_data.in_digit_ts = 0; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed DTMF sanity check.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed DTMF sanity check.\n"); } /* RFC2833 ... like all RFC RE: VoIP, guaranteed to drive you to insanity! @@ -312,13 +322,15 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ uint32_t ts; if (!(packet[0] || packet[1] || packet[2] || packet[3]) && len >= 8) { + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); packet += 4; len -= 4; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "DTMF payload offset by 4 bytes.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "DTMF payload offset by 4 bytes.\n"); } if (!(packet[0] || packet[1] || packet[2] || packet[3])) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed DTMF payload check.\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed DTMF payload check.\n"); rtp_session->dtmf_data.last_digit = 0; rtp_session->dtmf_data.in_digit_ts = 0; rtp_session->dtmf_data.in_digit_sanity = 0; @@ -336,7 +348,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ } } #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "packet[%d]: %02x %02x %02x %02x\n", (int) len, (unsigned) packet[0], (unsigned) + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "packet[%d]: %02x %02x %02x %02x\n", (int) len, (unsigned) packet[0], (unsigned) packet[1], (unsigned) packet[2], (unsigned) packet[3]); #endif @@ -345,7 +357,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ rtp_session->dtmf_data.in_digit_seq = in_digit_seq; #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "read: %c %u %u %u %u %d %d %s\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "read: %c %u %u %u %u %d %d %s\n", key, in_digit_seq, rtp_session->dtmf_data.in_digit_seq, ts, duration, rtp_session->recv_msg.header.m, end, end && !rtp_session->dtmf_data.in_digit_ts ? "ignored" : ""); #endif @@ -354,7 +366,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ rtp_session->dtmf_data.in_digit_ts) { switch_dtmf_t dtmf = { key, switch_core_min_dtmf_duration(0), 0, SWITCH_DTMF_RTP }; #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Early Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Early Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8); #endif switch_rtp_queue_rfc2833_in(rtp_session, &dtmf); rtp_session->dtmf_data.in_digit_queued = 1; @@ -373,7 +385,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ if (end) { if (!rtp_session->dtmf_data.in_digit_ts && rtp_session->dtmf_data.last_in_digit_ts != ts) { #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "start with end packet %d\n", ts); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "start with end packet %d\n", ts); #endif rtp_session->dtmf_data.last_in_digit_ts = ts; rtp_session->dtmf_data.in_digit_ts = ts; @@ -390,17 +402,17 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ dtmf.duration += rtp_session->dtmf_data.flip * 0xFFFF; rtp_session->dtmf_data.flip = 0; #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "you're welcome!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "you're welcome!\n"); #endif } #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "done digit=%c ts=%u start_ts=%u dur=%u ddur=%u\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "done digit=%c ts=%u start_ts=%u dur=%u ddur=%u\n", dtmf.digit, ts, rtp_session->dtmf_data.in_digit_ts, duration, dtmf.duration); #endif if (!(rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION) && !rtp_session->dtmf_data.in_digit_queued) { #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8); #endif switch_rtp_queue_rfc2833_in(rtp_session, &dtmf); } @@ -421,7 +433,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ } else if (!rtp_session->dtmf_data.in_digit_ts) { #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "start %d\n", ts); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "start %d\n", ts); #endif rtp_session->dtmf_data.in_digit_ts = ts; rtp_session->dtmf_data.last_in_digit_ts = ts; @@ -432,7 +444,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ rtp_session->dtmf_data.last_duration = duration; } else { #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "drop: %c %u %u %u %u %d %d\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "drop: %c %u %u %u %u %d %d\n", key, in_digit_seq, rtp_session->dtmf_data.in_digit_seq, ts, duration, rtp_session->recv_msg.header.m, end); #endif switch_cond_next(); @@ -500,7 +512,7 @@ static switch_status_t do_stun_ping(switch_rtp_t *rtp_session) elapsed = (unsigned int) ((switch_micro_time_now() - rtp_session->last_stun) / 1000); if (elapsed > 30000) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No stun for a long time (PUNT!)\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No stun for a long time (PUNT!)\n"); status = SWITCH_STATUS_FALSE; goto end; } @@ -554,7 +566,8 @@ static switch_status_t ice_out(switch_rtp_t *rtp_session) elapsed = (unsigned int) ((switch_micro_time_now() - rtp_session->last_stun) / 1000); if (elapsed > 30000) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No stun for a long time (PUNT!)\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No stun for a long time (PUNT!)\n"); status = SWITCH_STATUS_FALSE; goto end; } @@ -610,7 +623,8 @@ static void handle_ice(switch_rtp_t *rtp_session, void *data, switch_size_t len) memcpy(buf, data, cpylen); packet = switch_stun_packet_parse(buf, sizeof(buf)); if (!packet) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid STUN/ICE packet received\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid STUN/ICE packet received\n"); goto end; } end_buf = buf + ((sizeof(buf) > packet->header.length) ? packet->header.length : sizeof(buf)); @@ -705,7 +719,7 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event) switch_channel_set_variable_name_printf(channel, stream->session->sas1.buffer, "zrtp_sas1_string_%s", type); switch_channel_set_variable_name_printf(channel, stream->session->sas2.buffer, "zrtp_sas2_string", type); - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } @@ -755,19 +769,19 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event) #endif case ZRTP_EVENT_IS_CLIENT_ENROLLMENT: { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Enrolled complete!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Enrolled complete!\n"); switch_channel_set_variable_name_printf(channel, "true", "zrtp_enroll_complete_%s", type); } break; case ZRTP_EVENT_USER_ALREADY_ENROLLED: { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "User already enrolled!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "User already enrolled!\n"); switch_channel_set_variable_name_printf(channel, "true", "zrtp_already_enrolled_%s", type); if (zrtp_status_ok == zrtp_session_get(stream->session, &zrtp_session_info)) { if (zrtp_session_info.sas_is_ready) { - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } } @@ -775,12 +789,12 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event) case ZRTP_EVENT_NEW_USER_ENROLLED: { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "New user enrolled!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "New user enrolled!\n"); switch_channel_set_variable_name_printf(channel, "true", "zrtp_new_user_enrolled_%s", type); if (zrtp_status_ok == zrtp_session_get(stream->session, &zrtp_session_info)) { if (zrtp_session_info.sas_is_ready) { - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } } @@ -788,12 +802,12 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event) case ZRTP_EVENT_USER_UNENROLLED: { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "User unenrolled!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "User unenrolled!\n"); switch_channel_set_variable_name_printf(channel, "true", "zrtp_user_unenrolled_%s", type); if (zrtp_status_ok == zrtp_session_get(stream->session, &zrtp_session_info)) { if (zrtp_session_info.sas_is_ready) { - zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + zrtp_verified_set(zrtp_global, &stream->session->zid, &stream->session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); } } } @@ -848,11 +862,11 @@ SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool) zrtp_config.lic_mode = ZRTP_LICENSE_MODE_ACTIVE; switch_snprintf(zrtp_cache_path, sizeof(zrtp_cache_path), "%s%szrtp.dat", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR); zrtp_zstrcpyc((zrtp_stringn_t*)zrtp_config.def_cache_path.buffer, zrtp_cache_path); - zrtp_config.def_cache_path.length = strlen(zrtp_cache_path); + zrtp_config.def_cache_path.length = (uint16_t)strlen(zrtp_cache_path); zrtp_config.def_cache_path.max_length = 255; - zrtp_config.cb.event_cb.on_zrtp_protocol_event = zrtp_event_callback; + zrtp_config.cb.event_cb.on_zrtp_protocol_event = (void (*)(zrtp_stream_t*,zrtp_protocol_event_t))zrtp_event_callback; zrtp_config.cb.misc_cb.on_send_packet = zrtp_send_rtp_callback; - zrtp_config.cb.event_cb.on_zrtp_security_event = zrtp_event_callback; + zrtp_config.cb.event_cb.on_zrtp_security_event = (void (*)(zrtp_stream_t*,zrtp_security_event_t))zrtp_event_callback; zrtp_log_set_log_engine((zrtp_log_engine *) zrtp_logger); zrtp_log_set_level(4); @@ -1025,9 +1039,10 @@ static switch_status_t enable_remote_rtcp_socket(switch_rtp_t *rtp_session, cons } else { const char *host; char bufa[30]; + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); host = switch_get_addr(bufa, sizeof(bufa), rtp_session->rtcp_remote_addr); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setting RTCP remote addr to %s:%d\n", host, rtp_session->remote_rtcp_port); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting RTCP remote addr to %s:%d\n", host, rtp_session->remote_rtcp_port); } if (!(rtp_session->rtcp_sock_input && rtp_session->rtcp_sock_output)) { @@ -1097,7 +1112,8 @@ static switch_status_t enable_local_rtcp_socket(switch_rtp_t *rtp_session, const done: if (*err) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error allocating rtcp [%s]\n", *err); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error allocating rtcp [%s]\n", *err); status = SWITCH_STATUS_FALSE; } @@ -1246,7 +1262,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s SWITCH_DECLARE(void) switch_rtp_set_max_missed_packets(switch_rtp_t *rtp_session, uint32_t max) { if (rtp_session->missed_count >= max) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "new max missed packets(%d->%d) greater than current missed packets(%d). RTP will timeout.\n", rtp_session->missed_count, max, rtp_session->missed_count); } @@ -1391,7 +1408,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess uint32_t index, switch_rtp_crypto_key_type_t type, unsigned char *key, switch_size_t keylen) { #ifndef ENABLE_SRTP - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SRTP NOT SUPPORTED IN THIS BUILD!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "SRTP NOT SUPPORTED IN THIS BUILD!\n"); return SWITCH_STATUS_FALSE; #else switch_rtp_crypto_key_t *crypto_key; @@ -1466,10 +1483,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess } if (status == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activating Secure RTP RECV\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Activating Secure RTP RECV\n"); switch_set_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_RECV); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error allocating srtp [%d]\n", stat); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error allocating srtp [%d]\n", stat); return status; } } @@ -1486,10 +1503,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess } if (status == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activating Secure RTP SEND\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Activating Secure RTP SEND\n"); switch_set_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_SEND); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error allocating SRTP [%d]\n", stat); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error allocating SRTP [%d]\n", stat); return status; } } @@ -1543,11 +1560,13 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_change_interval(switch_rtp_t *rtp_ses if ((status = switch_core_timer_init(&rtp_session->timer, rtp_session->timer_name, ms_per_packet / 1000, samples_per_interval, rtp_session->pool)) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "RE-Starting timer [%s] %d bytes per %dms\n", rtp_session->timer_name, samples_per_interval, ms_per_packet / 1000); } else { + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); memset(&rtp_session->timer, 0, sizeof(rtp_session->timer)); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Problem RE-Starting timer [%s] %d bytes per %dms\n", rtp_session->timer_name, samples_per_interval, ms_per_packet / 1000); } @@ -1711,7 +1730,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session rtp_session->zrtp_profile->allowclear = 0; rtp_session->zrtp_profile->disclose_bit = 0; - rtp_session->zrtp_profile->cache_ttl = -1; + rtp_session->zrtp_profile->cache_ttl = (uint32_t) -1; if (zrtp_status_ok != zrtp_session_init(zrtp_global, rtp_session->zrtp_profile, zid, initiator, &rtp_session->zrtp_session)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! zRTP INIT Failed\n"); @@ -1846,7 +1865,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_stun_ping(switch_rtp_t *rtp_ if (switch_sockaddr_info_get(&rtp_session->remote_stun_addr, stun_ip, SWITCH_UNSPEC, stun_port, 0, rtp_session->pool) != SWITCH_STATUS_SUCCESS || !rtp_session->remote_stun_addr) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error resolving stun ping addr\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error resolving stun ping addr\n"); return SWITCH_STATUS_FALSE; } @@ -1998,10 +2018,12 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_sessi } if (send_rate == -1) { + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); switch_set_flag(rtp_session, SWITCH_RTP_FLAG_RTCP_PASSTHRU); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTCP passthru enabled. Remote Port: %d\n", rtp_session->remote_rtcp_port); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "RTCP passthru enabled. Remote Port: %d\n", rtp_session->remote_rtcp_port); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTCP send rate is: %d and packet rate is: %d Remote Port: %d\n", + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "RTCP send rate is: %d and packet rate is: %d Remote Port: %d\n", send_rate, rtp_session->ms_per_packet, rtp_session->remote_rtcp_port); rtp_session->rtcp_interval = send_rate/(rtp_session->ms_per_packet/1000); } @@ -2210,6 +2232,11 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session) return; } +SWITCH_DECLARE(void) switch_rtp_set_interdigit_delay(switch_rtp_t *rtp_session, uint32_t delay) +{ + rtp_session->interdigit_delay = delay; +} + SWITCH_DECLARE(switch_socket_t *) switch_rtp_get_rtp_socket(switch_rtp_t *rtp_session) { return rtp_session->sock_input; @@ -2265,7 +2292,8 @@ SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp_t *rtp_session, switch_rtp static void set_dtmf_delay(switch_rtp_t *rtp_session, uint32_t ms, uint32_t max_ms) { int upsamp, max_upsamp; - + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + if (!max_ms) max_ms = ms; upsamp = ms * (rtp_session->samples_per_second / 1000); @@ -2275,9 +2303,11 @@ static void set_dtmf_delay(switch_rtp_t *rtp_session, uint32_t ms, uint32_t max_ if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { rtp_session->max_next_write_samplecount = rtp_session->timer.samplecount + max_upsamp; + rtp_session->next_write_samplecount = rtp_session->timer.samplecount + upsamp; + rtp_session->last_write_ts += upsamp; } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Queue digit delay of %dms\n", ms); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Queue digit delay of %dms\n", ms); } static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session) @@ -2285,11 +2315,6 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session) switch_frame_flag_t flags = 0; uint32_t samples = rtp_session->samples_per_interval; - if (rtp_session->sending_dtmf > 1) { - rtp_session->sending_dtmf--; - return; - } - if (!rtp_session->last_write_ts) { return; } @@ -2329,7 +2354,7 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session) } } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%u dur=%d/%d/%d seq=%d lw=%d\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%u dur=%d/%d/%d seq=%d lw=%u\n", loops == 1 ? "middle" : "end", rtp_session->dtmf_data.out_digit, rtp_session->dtmf_data.timestamp_dtmf, rtp_session->dtmf_data.out_digit_sofar, @@ -2345,7 +2370,11 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session) } rtp_session->dtmf_data.out_digit_dur = 0; - set_dtmf_delay(rtp_session, 40, 500); + + if (rtp_session->interdigit_delay) { + set_dtmf_delay(rtp_session, rtp_session->interdigit_delay, rtp_session->interdigit_delay * 10); + } + return; } } @@ -2354,7 +2383,7 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session) void *pop; if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { - if (rtp_session->timer.samplecount < rtp_session->max_next_write_samplecount) { + if (rtp_session->timer.samplecount < rtp_session->next_write_samplecount) { return; } @@ -2380,8 +2409,7 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session) if (!rtp_session->sending_dtmf) { - rtp_session->sending_dtmf = 2; - return; + rtp_session->sending_dtmf = 1; } if (switch_queue_trypop(rtp_session->dtmf_data.dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) { @@ -2481,7 +2509,7 @@ static void do_flush(switch_rtp_t *rtp_session) switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); if (!session) { switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_READ); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n"); } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CONSOLE, "%s FLUSH\n", switch_channel_get_name(switch_core_session_get_channel(session)) @@ -2506,7 +2534,7 @@ static void do_flush(switch_rtp_t *rtp_session) if (bytes > rtp_header_len && rtp_session->recv_te && rtp_session->recv_msg.header.pt == rtp_session->recv_te) { handle_rfc2833(rtp_session, bytes, &do_cng); #ifdef DEBUG_2833 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "*** RTP packet handled in flush loop %d ***\n", do_cng); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "*** RTP packet handled in flush loop %d ***\n", do_cng); #endif } @@ -2557,29 +2585,29 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t switch_size_t num_missed = (switch_size_t)seq - (rtp_session->last_seq+1); if (num_missed == 1) { /* We missed one packet */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missed one RTP frame with sequence [%d]%s. Time since last read [%d]\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missed one RTP frame with sequence [%d]%s. Time since last read [%d]\n", rtp_session->last_seq+1, (flushed_packets_diff == 1) ? " (flushed by FS)" : " (missed)", rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0); } else { /* We missed multiple packets */ if (flushed_packets_diff == 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missed %d RTP frames from sequence [%d] to [%d] (missed). Time since last read [%d]\n", num_missed, rtp_session->last_seq+1, seq-1, rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0); } else if (flushed_packets_diff == num_missed) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missed %d RTP frames from sequence [%d] to [%d] (flushed by FS). Time since last read [%d]\n", num_missed, rtp_session->last_seq+1, seq-1, rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0); } else if (num_missed > flushed_packets_diff) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missed %d RTP frames from sequence [%d] to [%d] (%d packets flushed by FS, %d packets missed)." " Time since last read [%d]\n", num_missed, rtp_session->last_seq+1, seq-1, flushed_packets_diff, num_missed-flushed_packets_diff, rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missed %d RTP frames from sequence [%d] to [%d] (%d packets flushed by FS). Time since last read [%d]\n", num_missed, rtp_session->last_seq+1, seq-1, flushed_packets_diff, rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0); @@ -2628,7 +2656,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t *bytes = sbytes; break; case zrtp_status_drop: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); + /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error: zRTP protection drop with code %d\n", stat); */ *bytes = 0; return SWITCH_STATUS_SUCCESS; case zrtp_status_fail: @@ -2650,10 +2678,12 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t srtp_dealloc(rtp_session->recv_ctx); rtp_session->recv_ctx = NULL; if ((stat = srtp_create(&rtp_session->recv_ctx, &rtp_session->recv_policy))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! RE-Activating Secure RTP RECV\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! RE-Activating Secure RTP RECV\n"); return SWITCH_STATUS_FALSE; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "RE-Activating Secure RTP RECV\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "RE-Activating Secure RTP RECV\n"); rtp_session->srtp_errs = 0; } } @@ -2664,7 +2694,8 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t if (stat && rtp_session->recv_msg.header.pt != rtp_session->recv_te && rtp_session->recv_msg.header.pt != rtp_session->cng_pt) { if (++rtp_session->srtp_errs >= MAX_SRTP_ERRS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: SRTP unprotect failed with code %d%s\n", stat, stat == err_status_replay_fail ? " (replay check failed)" : stat == err_status_auth_fail ? " (auth check failed)" : ""); @@ -2765,7 +2796,8 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t if (stat) { if (++rtp_session->srtp_errs >= MAX_SRTP_ERRS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: SRTP RTCP unprotect failed with code %d%s\n", stat, stat == err_status_replay_fail ? " (replay check failed)" : stat == err_status_auth_fail ? " (auth check failed)" : ""); @@ -2813,9 +2845,10 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t if (*bytes) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10,"Received an RTCP packet of length %" SWITCH_SIZE_T_FMT " bytes\n", *bytes); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10,"Received an RTCP packet of length %" SWITCH_SIZE_T_FMT " bytes\n", *bytes); if (rtp_session->rtcp_recv_msg.header.version == 2) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10,"RTCP packet type is %d\n", rtp_session->rtcp_recv_msg.header.type); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10,"RTCP packet type is %d\n", rtp_session->rtcp_recv_msg.header.type); if (rtp_session->rtcp_recv_msg.header.type == 200) { struct switch_rtcp_senderinfo* sr = (struct switch_rtcp_senderinfo*)rtp_session->rtcp_recv_msg.body; @@ -2825,7 +2858,7 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t rtp_session->stats.rtcp.octet_count += sr->oc; /* sender report */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10,"Received a SR with %d report blocks, " \ + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10,"Received a SR with %d report blocks, " \ "length in words = %d, " \ "SSRC = 0x%X, " \ "NTP MSW = %u, " \ @@ -2843,7 +2876,7 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t ntohl(sr->oc)); } } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Received an unsupported RTCP packet version %d\nn", rtp_session->rtcp_recv_msg.header.version); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Received an unsupported RTCP packet version %d\nn", rtp_session->rtcp_recv_msg.header.version); } status = SWITCH_STATUS_SUCCESS; @@ -2894,14 +2927,14 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ rtp_session->read_pollfd) { if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 0) == SWITCH_STATUS_SUCCESS) { status = read_rtp_packet(rtp_session, &bytes, flags, SWITCH_FALSE); - /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Initial (%i) %d\n", status, bytes); */ + /* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Initial (%i) %d\n", status, bytes); */ if (status != SWITCH_STATUS_FALSE) { read_pretriggered = 1; } if (bytes) { if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 0) == SWITCH_STATUS_SUCCESS) { - /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Trigger %d\n", rtp_session->hot_hits); */ + /* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Trigger %d\n", rtp_session->hot_hits); */ rtp_session->hot_hits += rtp_session->samples_per_interval; } else { rtp_session->hot_hits = 0; @@ -2923,7 +2956,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ } else { if (rtp_session->sync_packets) { #if 0 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Auto-Flush catching up %d packets (%d)ms.\n", rtp_session->sync_packets, (rtp_session->ms_per_packet * rtp_session->sync_packets) / 1000); #endif @@ -2949,7 +2982,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ do_2833(rtp_session, session); - if (rtp_session->dtmf_data.out_digit_dur > 0 || rtp_session->dtmf_data.in_digit_sanity || rtp_session->sending_dtmf > 0 || + if (rtp_session->dtmf_data.out_digit_dur > 0 || rtp_session->dtmf_data.in_digit_sanity || rtp_session->sending_dtmf || switch_queue_size(rtp_session->dtmf_data.dtmf_queue) || switch_queue_size(rtp_session->dtmf_data.dtmf_inqueue)) { pt = 20000; } @@ -2970,13 +3003,13 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ read_pretriggered = 0; } else { status = read_rtp_packet(rtp_session, &bytes, flags, SWITCH_TRUE); - /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Read bytes (%i) %d\n", status, bytes); */ + /* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Read bytes (%i) %d\n", status, bytes); */ } } else { if (!SWITCH_STATUS_IS_BREAK(poll_status) && poll_status != SWITCH_STATUS_TIMEOUT) { char tmp[128] = ""; strerror_r(poll_status, tmp, sizeof(tmp)); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Poll failed with error: %d [%s]\n", poll_status, tmp); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Poll failed with error: %d [%s]\n", poll_status, tmp); ret = -1; goto end; } @@ -3015,7 +3048,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); switch_channel_t *channel = switch_core_session_get_channel(session); - const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(channel); if (uuid) { switch_core_session_t *other_session; switch_rtp_t *other_rtp_session = NULL; @@ -3032,7 +3065,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ int sbytes = (int) rtcp_bytes; int stat = srtp_protect_rtcp(other_rtp_session->send_ctx, &other_rtp_session->rtcp_send_msg.header, &sbytes); if (stat) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: SRTP RTCP protection failed with code %d\n", stat); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: SRTP RTCP protection failed with code %d\n", stat); } rtcp_bytes = sbytes; } @@ -3050,12 +3083,12 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ case zrtp_status_ok: break; case zrtp_status_drop: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); ret = (int) bytes; goto end; break; case zrtp_status_fail: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); break; default: break; @@ -3066,7 +3099,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ #endif if (switch_socket_sendto(other_rtp_session->rtcp_sock_output, other_rtp_session->rtcp_remote_addr, 0, (const char*)&other_rtp_session->rtcp_send_msg, &rtcp_bytes ) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"RTCP packet not written\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,"RTCP packet not written\n"); } @@ -3148,7 +3181,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ if (!session) { switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_READ); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n"); } else { const char *tx_host; const char *old_host; @@ -3204,7 +3237,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr); old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Auto Changing port from %s:%u to %s:%u\n", old_host, old, tx_host, switch_sockaddr_get_port(rtp_session->from_addr)); @@ -3221,7 +3254,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ); } } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Correct ip/port confirmed.\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Correct ip/port confirmed.\n"); switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ); rtp_session->auto_adj_used = 0; } @@ -3249,7 +3282,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ rtp_session->missed_count = 0; if (bytes < rtp_header_len) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Ignoring invalid RTP packet size of %ld bytes.\n", (long)bytes); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Ignoring invalid RTP packet size of %ld bytes.\n", (long)bytes); bytes = 0; goto do_continue; } @@ -3593,7 +3626,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); switch_channel_t *channel = switch_core_session_get_channel(session); - const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(channel); if (uuid) { switch_core_session_t *other_session; @@ -3616,7 +3649,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); zrtp_verified_set(zrtp_global, &rtp_session->zrtp_session->zid, - &rtp_session->zrtp_session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + &rtp_session->zrtp_session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); rtp_session->zrtp_mitm_tries++; } } @@ -3903,22 +3936,24 @@ static int rtp_common_write(switch_rtp_t *rtp_session, if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_SEND_RESET)) { + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_SECURE_SEND_RESET); srtp_dealloc(rtp_session->send_ctx); rtp_session->send_ctx = NULL; if ((stat = srtp_create(&rtp_session->send_ctx, &rtp_session->send_policy))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! RE-Activating Secure RTP SEND\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! RE-Activating Secure RTP SEND\n"); ret = -1; goto end; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "RE-Activating Secure RTP SEND\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "RE-Activating Secure RTP SEND\n"); } } stat = srtp_protect(rtp_session->send_ctx, &send_msg->header, &sbytes); if (stat) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: SRTP protection failed with code %d\n", stat); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: SRTP protection failed with code %d\n", stat); } bytes = sbytes; @@ -3929,6 +3964,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, if (zrtp_on && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA)) { unsigned int sbytes = (int) bytes; zrtp_status_t stat = zrtp_status_fail; + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); stat = zrtp_process_rtp(rtp_session->zrtp_stream, (void *) send_msg, &sbytes); @@ -3936,12 +3972,12 @@ static int rtp_common_write(switch_rtp_t *rtp_session, case zrtp_status_ok: break; case zrtp_status_drop: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); + /* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error: zRTP protection drop with code %d\n", stat); */ ret = (int) bytes; goto end; break; case zrtp_status_fail: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); break; default: break; @@ -3955,7 +3991,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, #ifdef RTP_DEBUG_WRITE_DELTA { int delta = (int) (now - rtp_session->send_time) / 1000; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "WRITE %d delta %d\n", (int) bytes, delta); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "WRITE %d delta %d\n", (int) bytes, delta); } #endif rtp_session->send_time = now; @@ -3965,7 +4001,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, if (!session) { switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_WRITE); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n"); } else { const char *tx_host; const char *old_host; @@ -4039,7 +4075,8 @@ static int rtp_common_write(switch_rtp_t *rtp_session, int sbytes = (int) rtcp_bytes; int stat = srtp_protect_rtcp(rtp_session->send_ctx, &rtp_session->rtcp_send_msg.header, &sbytes); if (stat) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: SRTP RTCP protection failed with code %d\n", stat); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: SRTP RTCP protection failed with code %d\n", stat); } rtcp_bytes = sbytes; } @@ -4074,7 +4111,8 @@ static int rtp_common_write(switch_rtp_t *rtp_session, if (switch_socket_sendto(rtp_session->rtcp_sock_output, rtp_session->rtcp_remote_addr, 0, (const char*)&rtp_session->rtcp_send_msg, &rtcp_bytes ) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"RTCP packet not written\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,"RTCP packet not written\n"); } } } @@ -4143,10 +4181,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_enable_vad(switch_rtp_t *rtp_session, codec->implementation->microseconds_per_packet / 1000, codec->implementation->number_of_channels, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, rtp_session->pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't load codec?\n"); return SWITCH_STATUS_FALSE; } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activate VAD codec %s %dms\n", codec->implementation->iananame, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Activate VAD codec %s %dms\n", codec->implementation->iananame, codec->implementation->microseconds_per_packet / 1000); rtp_session->vad_data.diff_level = 400; rtp_session->vad_data.hangunder = 15; @@ -4219,7 +4257,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); switch_channel_t *channel = switch_core_session_get_channel(session); - const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + const char *uuid = switch_channel_get_partner_uuid(channel); if (uuid) { switch_core_session_t *other_session; @@ -4241,7 +4279,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); zrtp_verified_set(zrtp_global, &rtp_session->zrtp_session->zid, - &rtp_session->zrtp_session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + &rtp_session->zrtp_session->peer_zid, (uint8_t)(zrtp_session_info.sas_is_verified ^ 1)); rtp_session->zrtp_mitm_tries++; } rtp_session->zrtp_mitm_tries++; @@ -4260,7 +4298,8 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra if (!fwd && !rtp_session->sending_dtmf && !rtp_session->queue_delay && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_RAW_WRITE) && (rtp_session->rtp_bugs & RTP_BUG_GEN_ONE_GEN_ALL)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Generating RTP locally but timestamp passthru is configured, disabling....\n"); + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Generating RTP locally but timestamp passthru is configured, disabling....\n"); switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_RAW_WRITE); rtp_session->last_write_ts = RTP_TS_RESET; } @@ -4344,13 +4383,14 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, rtp_session->write_msg.header.seq = htons(++rtp_session->seq); rtp_session->write_msg.header.ts = htonl(ts); rtp_session->write_msg.header.pt = payload; - rtp_session->write_msg.header.m = (m && !(rtp_session->rtp_bugs & RTP_BUG_NEVER_SEND_MARKER)) ? 1 : 0; + rtp_session->write_msg.header.m = m; memcpy(rtp_session->write_msg.body, data, datalen); bytes = rtp_header_len + datalen; #ifdef ENABLE_SRTP if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_SEND)) { + switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); int sbytes = (int) bytes; err_status_t stat; @@ -4359,17 +4399,17 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, srtp_dealloc(rtp_session->send_ctx); rtp_session->send_ctx = NULL; if ((stat = srtp_create(&rtp_session->send_ctx, &rtp_session->send_policy))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! RE-Activating Secure RTP SEND\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! RE-Activating Secure RTP SEND\n"); ret = -1; goto end; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "RE-Activating Secure RTP SEND\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "RE-Activating Secure RTP SEND\n"); } } stat = srtp_protect(rtp_session->send_ctx, &rtp_session->write_msg.header, &sbytes); if (stat) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: SRTP protection failed with code %d\n", stat); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error: SRTP protection failed with code %d\n", stat); } bytes = sbytes; } diff --git a/src/switch_scheduler.c b/src/switch_scheduler.c index 3268d270d1..dc68fe2f5a 100644 --- a/src/switch_scheduler.c +++ b/src/switch_scheduler.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_stun.c b/src/switch_stun.c index 9ed2f98d79..30933fff6a 100644 --- a/src/switch_stun.c +++ b/src/switch_stun.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_swig.c b/src/switch_swig.c index 71ed3f7467..08512ea7da 100644 --- a/src/switch_swig.c +++ b/src/switch_swig.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/switch_time.c b/src/switch_time.c index 7199edf9cc..381d2dc5ad 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -140,7 +140,7 @@ typedef struct timer_matrix timer_matrix_t; static timer_matrix_t TIMER_MATRIX[MAX_ELEMENTS + 1]; -static void os_yield(void) +SWITCH_DECLARE(void) switch_os_yield(void) { #if defined(WIN32) SwitchToThread(); @@ -467,7 +467,7 @@ SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t) SWITCH_DECLARE(void) switch_cond_next(void) { if (runtime.tipping_point && globals.timer_count >= runtime.tipping_point) { - os_yield(); + switch_os_yield(); return; } #ifdef DISABLE_1MS_COND @@ -633,7 +633,7 @@ static switch_status_t timer_next(switch_timer_t *timer) check_roll(); if (runtime.tipping_point && globals.timer_count >= runtime.tipping_point) { - os_yield(); + switch_os_yield(); globals.use_cond_yield = 0; } else { if (globals.use_cond_yield == 1) { @@ -795,14 +795,9 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime) runtime.profile_timer = switch_new_profile_timer(); switch_get_system_idle_time(runtime.profile_timer, &runtime.profile_time); -#ifdef HAVE_CPU_SET_MACROS - if (runtime.timer_affinity > -1) { - cpu_set_t set; - CPU_ZERO(&set); - CPU_SET(0, &set); - sched_setaffinity(runtime.timer_affinity, sizeof(set), &set); + if (runtime.timer_affinity > -1) { + switch_core_thread_set_cpu_affinity(runtime.timer_affinity); } -#endif switch_time_sync(); time_sync = runtime.time_sync; @@ -889,7 +884,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime) } if (runtime.tipping_point && globals.timer_count >= runtime.tipping_point) { - os_yield(); + switch_os_yield(); } else { if (tfd > -1 && globals.RUNNING == 1) { uint64_t exp; diff --git a/src/switch_utils.c b/src/switch_utils.c index 4edd9c8a68..07b02d37e7 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -758,10 +758,6 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, rval = SWITCH_FALSE; } - if (unlink(filename) != 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", filename); - } - if (zstr(err)) { if (file) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Emailed file [%s] to [%s]\n", filename, to); @@ -777,6 +773,11 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, if (fd > -1) { close(fd); } + + if (unlink(filename) != 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", filename); + } + if (ifd > -1) { close(ifd); } diff --git a/src/switch_xml.c b/src/switch_xml.c index 2c687839c8..585b867995 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * @@ -2451,12 +2451,22 @@ static char *switch_xml_toxml_r(switch_xml_t xml, char **s, switch_size_t *len, } } +SWITCH_DECLARE(char *) switch_xml_toxml_nolock(switch_xml_t xml, switch_bool_t prn_header) +{ + char *s = (char *) malloc(SWITCH_XML_BUFSIZE); + switch_assert(s); + return switch_xml_toxml_buf(xml, s, SWITCH_XML_BUFSIZE, 0, prn_header); +} + + SWITCH_DECLARE(char *) switch_xml_toxml(switch_xml_t xml, switch_bool_t prn_header) { char *r, *s; - switch_mutex_lock(XML_GEN_LOCK); + s = (char *) malloc(SWITCH_XML_BUFSIZE); switch_assert(s); + + switch_mutex_lock(XML_GEN_LOCK); r = switch_xml_toxml_buf(xml, s, SWITCH_XML_BUFSIZE, 0, prn_header); switch_mutex_unlock(XML_GEN_LOCK); return r; diff --git a/src/switch_xml_config.c b/src/switch_xml_config.c index 31f44ce175..c33dba4e8a 100644 --- a/src/switch_xml_config.c +++ b/src/switch_xml_config.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/src/tone2wav.c b/src/tone2wav.c index 403f45a727..99a2370189 100644 --- a/src/tone2wav.c +++ b/src/tone2wav.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II + * Copyright (C) 2005-2012, Anthony Minessale II * * Version: MPL 1.1 * diff --git a/w32/Library/FreeSwitchCore.2010.vcxproj b/w32/Library/FreeSwitchCore.2010.vcxproj index 94b5dbc55a..eb1933a7f6 100644 --- a/w32/Library/FreeSwitchCore.2010.vcxproj +++ b/w32/Library/FreeSwitchCore.2010.vcxproj @@ -88,8 +88,8 @@ Disabled - ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;%(PreprocessorDefinitions) + ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;ENABLE_ZRTP;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -146,8 +146,8 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs Disabled - ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;%(PreprocessorDefinitions) + ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;ENABLE_ZRTP;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -198,8 +198,8 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs MaxSpeed - ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;%(PreprocessorDefinitions) + ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;ENABLE_ZRTP;%(PreprocessorDefinitions) MultiThreadedDLL Use switch.h @@ -247,8 +247,8 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs MaxSpeed - ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;%(PreprocessorDefinitions) + ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-3.8.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;ENABLE_ZRTP;%(PreprocessorDefinitions) MultiThreadedDLL Use switch.h @@ -766,6 +766,9 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs {89385c74-5860-4174-9caf-a39e7c48909c} false + + {c13cc324-0032-4492-9a30-310a6bd64ff5} + {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5} diff --git a/w32/Setup/FreeSWITCHConsole.wxs b/w32/Setup/FreeSWITCHConsole.wxs new file mode 100644 index 0000000000..243e614e60 --- /dev/null +++ b/w32/Setup/FreeSWITCHConsole.wxs @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/w32/Setup/Product.wxs b/w32/Setup/Product.wxs index 2f072aa8ca..66bc63b61d 100644 --- a/w32/Setup/Product.wxs +++ b/w32/Setup/Product.wxs @@ -66,12 +66,12 @@ WorkingDirectory="INSTALLLOCATION"/> - - + - + + @@ -87,12 +87,12 @@ - - - - - - + + + + + + diff --git a/w32/Setup/Setup.wixproj b/w32/Setup/Setup.wixproj index fcba3f0ceb..f7873cac08 100644 --- a/w32/Setup/Setup.wixproj +++ b/w32/Setup/Setup.wixproj @@ -36,6 +36,7 @@ + @@ -791,6 +792,7 @@ {1af3a893-f7be-43dd-b697-8ab2397c0d67} True + True Binaries;Content;Satellites INSTALLLOCATION