diff --git a/.gitignore b/.gitignore index b85dc53ca8..55e1e9856b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ *.xz *.bz2 *.tbz2 +*.swp aclocal.m4 autom4te.cache config.cache @@ -171,3 +172,30 @@ Freeswitch.2010.sdf src/mod/codecs/mod_celt/*/*/mod_celt.log src/mod/endpoints/mod_skinny/*/*/mod_skinny_2010.log src/mod/formats/mod_shout/*/*/mod_shout.log + +/w32/Setup/obj +/src/mod/asr_tts/mod_pocketsphinx/x64/Debug/mod_pocketsphinx_manifest.rc +/src/mod/endpoints/mod_h323/x64/Debug/mod_h323_manifest.rc +/src/mod/endpoints/mod_rtmp/Win32/Debug/mod_rtmp_2010.log +/src/mod/endpoints/mod_rtmp/Win32/Release/mod_rtmp_2010.log +/src/mod/endpoints/mod_rtmp/x64/Debug/mod_rtmp_2010.log +/src/mod/endpoints/mod_rtmp/x64/Debug/mod_rtmp_manifest.rc +/src/mod/endpoints/mod_rtmp/x64/Release/mod_rtmp_2010.log +/src/mod/endpoints/mod_skinny/x64/Debug/mod_skinny_manifest.rc +/src/mod/languages/mod_managed/x64/Debug_CLR/FREESWITCH.MANAGED.DLL.metagen +/src/mod/languages/mod_managed/x64/Debug_CLR/RSAENH.DLL.bi +/src/mod/languages/mod_managed/x64/Debug_CLR/TZRES.DLL.bi +/w32/Library/x64/Debug/FreeSwitch_manifest.rc +/src/mod/endpoints/mod_h323/Win32/Debug/mod_h323_manifest.rc +/src/mod/endpoints/mod_rtmp/Win32/Debug/mod_rtmp_manifest.rc +/src/mod/endpoints/mod_skinny/Win32/Debug/mod_skinny_manifest.rc +/src/mod/languages/mod_managed/Win32/Debug_CLR/FREESWITCH.MANAGED.DLL.metagen +/src/mod/languages/mod_managed/Win32/Debug_CLR/RSAENH.DLL.bi +/src/mod/languages/mod_managed/Win32/Debug_CLR/TZRES.DLL.bi +/w32/Library/Win32/Debug/FreeSwitch_manifest.rc +/src/mod/languages/mod_managed/Win32/Release_CLR/FREESWITCH.MANAGED.DLL.metagen +/src/mod/languages/mod_managed/Win32/Release_CLR/RSAENH.DLL.bi +/src/mod/languages/mod_managed/Win32/Release_CLR/TZRES.DLL.bi +/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 diff --git a/Freeswitch.2008.sln b/Freeswitch.2008.sln index 9942878717..4b67e0ccd4 100644 --- a/Freeswitch.2008.sln +++ b/Freeswitch.2008.sln @@ -467,8 +467,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\en ProjectSection(ProjectDependencies) = postProject {1906D736-08BD-4EE1-924F-B536249B9A54} = {1906D736-08BD-4EE1-924F-B536249B9A54} {D331904D-A00A-4694-A5A3-FCFF64AB5DBE} = {D331904D-A00A-4694-A5A3-FCFF64AB5DBE} - {B4B62169-5AD4-4559-8707-3D933AC5DB39} = {B4B62169-5AD4-4559-8707-3D933AC5DB39} {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + {B4B62169-5AD4-4559-8707-3D933AC5DB39} = {B4B62169-5AD4-4559-8707-3D933AC5DB39} {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3} EndProjectSection @@ -946,6 +946,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h323", "src\mod\endpoin {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iSAC", "src\mod\codecs\mod_isac\mod_iSAC.2008.vcproj", "{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skinny", "src\mod\endpoints\mod_skinny\mod_skinny_2008.vcproj", "{CC1DD008-9406-448D-A0AD-33C3186CFADB}" ProjectSection(ProjectDependencies) = postProject {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} @@ -1137,9 +1142,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openssl", "libs\win32\opens EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_directory", "src\mod\applications\mod_directory\mod_directory.2008.vcproj", "{42E721FD-43D6-4B04-A34B-42567199FFB8}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ldns", "libs\win32\ldns\ldns-lib\ldns-lib.2008.vcproj", "{23B4D303-79FC-49E0-89E2-2280E7E28940}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_httapi", "src\mod\applications\mod_httapi\mod_httapi.2008.vcproj", "{0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_abstraction", "src\mod\applications\mod_abstraction\mod_abstraction.2008.vcproj", "{BDA173DB-F8EF-4270-9553-B453AF92E43A}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2405,6 +2423,13 @@ Global {05C9FB27-480E-4D53-B3B7-7338E2514666}.Debug|x64.ActiveCfg = Debug|x64 {05C9FB27-480E-4D53-B3B7-7338E2514666}.Release|Win32.ActiveCfg = Release|Win32 {05C9FB27-480E-4D53-B3B7-7338E2514666}.Release|x64.ActiveCfg = Release|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|Win32.ActiveCfg = All|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|Win32.Build.0 = All|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.ActiveCfg = All|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.ActiveCfg = Debug|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.ActiveCfg = Debug|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|Win32.ActiveCfg = Release|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x64.ActiveCfg = Release|x64 {CC1DD008-9406-448D-A0AD-33C3186CFADB}.All|Win32.ActiveCfg = Release|Win32 {CC1DD008-9406-448D-A0AD-33C3186CFADB}.All|x64.ActiveCfg = Release|Win32 {CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -2856,6 +2881,28 @@ Global {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|Win32.Build.0 = Release|Win32 {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.ActiveCfg = Release|x64 {23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.Build.0 = Release|x64 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.All|Win32.ActiveCfg = Release|x64 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.All|x64.ActiveCfg = Release|x64 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.All|x64.Build.0 = Release|x64 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Debug|Win32.ActiveCfg = Debug|Win32 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Debug|Win32.Build.0 = Debug|Win32 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Debug|x64.ActiveCfg = Debug|x64 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Debug|x64.Build.0 = Debug|x64 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Release|Win32.ActiveCfg = Release|Win32 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Release|Win32.Build.0 = Release|Win32 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Release|x64.ActiveCfg = Release|x64 + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169}.Release|x64.Build.0 = Release|x64 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.All|Win32.ActiveCfg = Release|x64 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.All|x64.ActiveCfg = Release|x64 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.All|x64.Build.0 = Release|x64 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Debug|Win32.ActiveCfg = Debug|Win32 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Debug|Win32.Build.0 = Debug|Win32 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Debug|x64.ActiveCfg = Debug|x64 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Debug|x64.Build.0 = Debug|x64 + {BDA173DB-F8EF-4270-9553-B453AF92E43A}.Release|Win32.ActiveCfg = Release|Win32 + {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2868,6 +2915,7 @@ Global {8DEB383C-4091-4F42-A56F-C9E46D552D79} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {2C3C2423-234B-4772-8899-D3B137E5CA35} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {0B6C905B-142E-4999-B39D-92FF7951E921} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {D5C87B19-150D-4EF3-A671-96589BD2D14A} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {4D418176-3B33-47E6-A63E-01BA34ADD21C} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {AFA983D6-4569-4F88-BA94-555ED00FD9A8} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} @@ -2903,6 +2951,8 @@ Global {1E21AFE0-6FDB-41D2-942D-863607C24B91} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {2E250296-0C08-4342-9C8A-BCBDD0E7DF65} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {42E721FD-43D6-4B04-A34B-42567199FFB8} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} + {0807C5CB-F6FF-451D-89F0-1F7B2E1D9169} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} + {BDA173DB-F8EF-4270-9553-B453AF92E43A} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} diff --git a/Freeswitch.2010.sln b/Freeswitch.2010.sln index cf7053329a..480c9d4f2f 100644 --- a/Freeswitch.2010.sln +++ b/Freeswitch.2010.sln @@ -453,6 +453,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pthread", "libs\win32\pthre EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.2010.vcxproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iSAC", "src\mod\codecs\mod_isac\mod_iSAC.2010.vcxproj", "{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.2010.vcxproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_core_db", "src\mod\languages\mod_spidermonkey\mod_spidermonkey_core_db.2010.vcxproj", "{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}" @@ -718,6 +720,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_callcenter", "src\mod\a EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_blacklist", "src\mod\applications\mod_blacklist\mod_blacklist.2010.vcxproj", "{50AAC2CE-BFC9-4912-87CC-C6381850D735}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_httapi", "src\mod\applications\mod_httapi\mod_httapi.2010.vcxproj", "{4748FF56-CA85-4809-97D6-A94C0FAC1D77}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_abstraction", "src\mod\applications\mod_abstraction\mod_abstraction.2010.vcxproj", "{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sms", "src\mod\applications\mod_sms\mod_sms.2010.vcxproj", "{2469B306-B027-4FF2-8815-C9C1EA2CAE79}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -1428,6 +1436,20 @@ Global {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.Build.0 = Release Passthrough|x64 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64 Setup.ActiveCfg = Release Passthrough|x64 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x86 Setup.ActiveCfg = Release Passthrough|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|Win32.ActiveCfg = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.ActiveCfg = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.Build.0 = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64 Setup.ActiveCfg = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64 Setup.Build.0 = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x86 Setup.ActiveCfg = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.ActiveCfg = Debug|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.ActiveCfg = Debug|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64 Setup.ActiveCfg = Debug|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x86 Setup.ActiveCfg = Debug|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|Win32.ActiveCfg = Release|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x64.ActiveCfg = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x64 Setup.ActiveCfg = Release|x64 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x86 Setup.ActiveCfg = Release|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|Win32.ActiveCfg = Release|x64 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|x64.ActiveCfg = Release|x64 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|x64.Build.0 = Release|x64 @@ -2895,11 +2917,11 @@ Global {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.All|x86 Setup.ActiveCfg = Release|Win32 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.All|x86 Setup.Build.0 = Release|Win32 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.ActiveCfg = Debug|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64.ActiveCfg = Debug|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64.ActiveCfg = Debug|x64 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64 Setup.ActiveCfg = Debug|Win32 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x86 Setup.ActiveCfg = Debug|Win32 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.ActiveCfg = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.ActiveCfg = Release|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.ActiveCfg = Release|x64 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64 Setup.ActiveCfg = Release|Win32 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x86 Setup.ActiveCfg = Release|Win32 {1F0A8A77-E661-418F-BB92-82172AE43803}.All|Win32.ActiveCfg = Release|Win32 @@ -3680,6 +3702,53 @@ Global {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 + {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 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x64 Setup.ActiveCfg = Release|x64 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x86 Setup.ActiveCfg = Release|x64 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|Win32.ActiveCfg = Debug|Win32 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|Win32.Build.0 = Debug|Win32 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x64.ActiveCfg = Debug|x64 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x64.Build.0 = Debug|x64 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x64 Setup.ActiveCfg = Debug|x64 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x86 Setup.ActiveCfg = Debug|x64 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|Win32.ActiveCfg = Release|Win32 + {4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|Win32.Build.0 = Release|Win32 + {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 + {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 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x64 Setup.ActiveCfg = Release|x64 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x86 Setup.ActiveCfg = Release|x64 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|Win32.ActiveCfg = Debug|Win32 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|Win32.Build.0 = Debug|Win32 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x64.ActiveCfg = Debug|x64 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x64.Build.0 = Debug|x64 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x64 Setup.ActiveCfg = Debug|x64 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x86 Setup.ActiveCfg = Debug|x64 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|Win32.ActiveCfg = Release|Win32 + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|Win32.Build.0 = Release|Win32 + {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 + {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 + {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x64 Setup.ActiveCfg = Release|x64 + {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x86 Setup.ActiveCfg = Release|x64 + {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|Win32.ActiveCfg = Debug|Win32 + {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|x64.ActiveCfg = Debug|x64 + {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|x64 Setup.ActiveCfg = Debug|x64 + {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|x86 Setup.ActiveCfg = Debug|x64 + {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3689,6 +3758,7 @@ Global {5580D60E-0F77-4716-9CD4-B8E5986FA375} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {D3EC0AFF-76FC-4210-A825-9A17410660A3} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {FEA1EEF7-876F-48DE-88BF-C0E3E606D758} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {8DEB383C-4091-4F42-A56F-C9E46D552D79} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {2C3C2423-234B-4772-8899-D3B137E5CA35} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {0B6C905B-142E-4999-B39D-92FF7951E921} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} @@ -3730,6 +3800,9 @@ Global {5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {50AAC2CE-BFC9-4912-87CC-C6381850D735} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} + {4748FF56-CA85-4809-97D6-A94C0FAC1D77} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} + {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} + {2469B306-B027-4FF2-8815-C9C1EA2CAE79} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} diff --git a/Makefile.am b/Makefile.am index a9193c99fa..0261b709b0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -415,13 +415,6 @@ src/include/switch_version.h: src/include/switch_version.h.in .version $(libfree else \ version="git-$$version" ; \ fi ;\ - else \ - version=`svnversion . -n || echo hacked` ; \ - if [ "x$$version" = "xhacked" ] ; then \ - version="hacked-`date -u +%Y%m%dT%H%M%SZ`" ; \ - else \ - version="svn-$$version" ; \ - fi ;\ fi ; \ oldversion=`cat .version 2>/dev/null || echo "0"` ; \ if test "$$oldversion" != "$$version" || test $$force = 1 ; then \ @@ -497,7 +490,7 @@ samples-conf: samples-htdocs: test -d $(DESTDIR)$(htdocsdir) || $(mkinstalldirs) $(DESTDIR)$(htdocsdir) - for htdocsfile in `cd $(switch_srcdir)/htdocs && find . -type f -name \* | grep -v .svn | sed -e 's|^\.||' ` ; do \ + for htdocsfile in `cd $(switch_srcdir)/htdocs && find . -type f -name \* | sed -e 's|^\.||'` ; do \ dir=`echo $$htdocsfile | sed -e 's|/[^/]*$$||'`; \ filename=`echo $$htdocsfile | sed -e 's|^.*/||'`; \ test -d $(DESTDIR)$(htdocsdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)$$dir ; \ @@ -518,29 +511,23 @@ install-data-local: test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs is-scm: - @if [ ! -d .svn -a ! -d .git ] ; then \ + @if [ ! -d .git ] ; then \ echo ; echo ; \ echo "*****************************************************************************************************" ; \ - echo "You can not update a release tarball or without a git or svn working copy please clone our git tree: " ; \ - echo "git clone git://git.freeswitch.org/freeswitch.git " ; \ - echo "or check out our read only svn mirror: " ; \ - echo "svn checkout http://svn.freeswitch.org/svn/freeswitch/trunk " ; \ + echo "You cannot update a release tarball without a git tree. Please clone FreeSWITCH as so: " ; \ + echo " git clone git://git.freeswitch.org/freeswitch.git " ; \ echo "*****************************************************************************************************" ; \ echo ; echo ; \ exit 1; \ fi update: is-scm - @if test -d .svn ; then \ - test ! -f .version || rm -f .version ; \ - echo Updating... ; \ - svn update ; \ - elif test -d .git ; then \ + @if test -d .git ; then \ test ! -f .version || rm -f .version ; \ echo "Pulling updates..." ; \ git pull ; \ else \ - echo "This source directory is not a git tree or svn working copy" ; \ + echo "This source directory is not a git tree." ; \ fi .nodepends: diff --git a/build/config/libcurl.m4 b/build/config/libcurl.m4 index 5ddf77f321..d1e6f65aa5 100644 --- a/build/config/libcurl.m4 +++ b/build/config/libcurl.m4 @@ -97,7 +97,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` fi if test x"$LIBCURL" = "x" ; then - LIBCURL=`$_libcurl_config --libs` + LIBCURL=`$_libcurl_config --libs --static` # This is so silly, but Apple actually has a bug in their # curl-config script. Fixed in Tiger, but there are still diff --git a/build/getlib.sh.in b/build/getlib.sh.in index a123483a5a..bbfe696f79 100755 --- a/build/getlib.sh.in +++ b/build/getlib.sh.in @@ -23,7 +23,7 @@ fi uncompressed=`echo $tarfile | sed 's/\(\(\.tar\.gz\|\.tar\.bz2\|\.tar\.xz\)\|\(\.tgz\|\.tbz2\)\)$//'` -case `echo $tarfile | sed 's/.*\.\([^.]\+\)$/\1/'` in +case `echo $tarfile | sed 's/^.*\.//'` in bz2|tbz2) UNZIPPER=$BZIP ;; xz) UNZIPPER=$XZ ;; gz|tgz|*) UNZIPPER=$ZCAT ;; diff --git a/build/modules.conf.in b/build/modules.conf.in index 8682fb52aa..a9993c1e87 100644 --- a/build/modules.conf.in +++ b/build/modules.conf.in @@ -44,6 +44,7 @@ applications/mod_valet_parking #applications/mod_abstraction #applications/mod_esl applications/mod_sms +applications/mod_httapi codecs/mod_g723_1 codecs/mod_amr #codecs/mod_amrwb @@ -60,6 +61,7 @@ codecs/mod_siren #codecs/mod_opus #codecs/mod_sangoma_codec #codecs/mod_dahdi_codec +#codecs/mod_isac #dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml dialplans/mod_dialplan_asterisk diff --git a/build/sounds_version.txt b/build/sounds_version.txt index 056ebde66c..0214d1555f 100644 --- a/build/sounds_version.txt +++ b/build/sounds_version.txt @@ -1,3 +1,3 @@ -en-us-callie 1.0.16 +en-us-callie 1.0.18 ru-RU-elena 1.0.13 diff --git a/conf/autoload_configs/cdr_csv.conf.xml b/conf/autoload_configs/cdr_csv.conf.xml index bcefd460b4..8d796c68f0 100644 --- a/conf/autoload_configs/cdr_csv.conf.xml +++ b/conf/autoload_configs/cdr_csv.conf.xml @@ -17,6 +17,7 @@ + diff --git a/conf/autoload_configs/httapi.conf.xml b/conf/autoload_configs/httapi.conf.xml new file mode 100644 index 0000000000..c2fe584a02 --- /dev/null +++ b/conf/autoload_configs/httapi.conf.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/autoload_configs/http_cache.conf.xml b/conf/autoload_configs/http_cache.conf.xml index 4150d6472e..4f05269658 100644 --- a/conf/autoload_configs/http_cache.conf.xml +++ b/conf/autoload_configs/http_cache.conf.xml @@ -3,6 +3,8 @@ + + diff --git a/conf/autoload_configs/modules.conf.xml b/conf/autoload_configs/modules.conf.xml index de4bc40897..50353ac849 100644 --- a/conf/autoload_configs/modules.conf.xml +++ b/conf/autoload_configs/modules.conf.xml @@ -62,6 +62,7 @@ + @@ -83,12 +84,14 @@ + + diff --git a/conf/autoload_configs/switch.conf.xml b/conf/autoload_configs/switch.conf.xml index b0f0c53fef..64f3d6fa71 100644 --- a/conf/autoload_configs/switch.conf.xml +++ b/conf/autoload_configs/switch.conf.xml @@ -16,32 +16,32 @@ - - + + - + - + - + - + - - + + - - - - - - + + + + + + + + + + + + + + + + + + + If you want to send out voicemail notifications via Windows you'll need to change the mailer-app + variable to the setting below: + + + + Do not change mailer-app-args. + You will also need to download a sendmail clone for Windows (msmtp). This version works without issue: + http://msmtp.sourceforge.net/index.html. Download and copy the .exe to %winddir%\system32. + You'll need to create a small config file for smtp credentials (host name, authentication, tls, etc.) in + %USERPROFILE%\Application Data\ called "msmtprc.txt". Below is a sample copy of this file: + + ################################### + # The SMTP server of the provider. + account provider + host smtp.myisp.com + from john@myisp.com + auth login + user johndoe + password mypassword + + # Set a default account + account default : provider + ################################### + + --> + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + diff --git a/conf/autoload_configs/voicemail_ivr.conf.xml b/conf/autoload_configs/voicemail_ivr.conf.xml index b25b4e485d..529509a495 100644 --- a/conf/autoload_configs/voicemail_ivr.conf.xml +++ b/conf/autoload_configs/voicemail_ivr.conf.xml @@ -3,7 +3,7 @@ - + diff --git a/conf/dialplan/default.xml b/conf/dialplan/default.xml index af7344837e..fb6713d0ce 100644 --- a/conf/dialplan/default.xml +++ b/conf/dialplan/default.xml @@ -145,7 +145,7 @@ - + diff --git a/conf/dialplan/public.xml b/conf/dialplan/public.xml index b54aff9b4f..e44006e33b 100644 --- a/conf/dialplan/public.xml +++ b/conf/dialplan/public.xml @@ -27,7 +27,7 @@ - + diff --git a/conf/lang/de/de.xml b/conf/lang/de/de.xml index 1b44c9a1dd..a7dbab0c0c 100644 --- a/conf/lang/de/de.xml +++ b/conf/lang/de/de.xml @@ -9,3 +9,14 @@ + diff --git a/conf/lang/de/demo/demo.xml b/conf/lang/de/demo/demo.xml index 61582b2052..fa77948b65 100644 --- a/conf/lang/de/demo/demo.xml +++ b/conf/lang/de/demo/demo.xml @@ -1,71 +1,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/lang/de/vm/sounds.xml b/conf/lang/de/vm/sounds.xml index ad9dc2e136..657e611c20 100644 --- a/conf/lang/de/vm/sounds.xml +++ b/conf/lang/de/vm/sounds.xml @@ -1,9 +1,10 @@ - + + - - + + @@ -11,8 +12,8 @@ - - + + @@ -20,7 +21,7 @@ - + @@ -28,7 +29,7 @@ - + @@ -36,7 +37,7 @@ - + @@ -44,7 +45,7 @@ - + @@ -52,19 +53,19 @@ - - - - - + + + + + - - - - + + + + @@ -72,28 +73,25 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -101,34 +99,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -136,7 +130,7 @@ - + @@ -144,15 +138,15 @@ - - - - - - - - - + + + + + + + + + @@ -160,12 +154,12 @@ - - - - - - + + + + + + @@ -173,12 +167,12 @@ - - - - - - + + + + + + @@ -186,9 +180,9 @@ - - - + + + @@ -196,7 +190,7 @@ - + @@ -204,43 +198,43 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -248,7 +242,7 @@ - + @@ -256,7 +250,7 @@ - + @@ -264,7 +258,7 @@ - + @@ -272,7 +266,7 @@ - + @@ -280,9 +274,9 @@ - - - + + + @@ -290,9 +284,9 @@ - - - + + + @@ -300,7 +294,7 @@ - + @@ -308,10 +302,10 @@ - - - - + + + + @@ -319,7 +313,7 @@ - + @@ -327,39 +321,39 @@ - + - + - + - - + + - - + + - - + + - - + + @@ -367,17 +361,17 @@ - - + + - - - + + + @@ -404,4 +398,16 @@ - + + + diff --git a/conf/lang/de/vm/tts.xml b/conf/lang/de/vm/tts.xml index 7a8f18cf50..f91cae1b99 100644 --- a/conf/lang/de/vm/tts.xml +++ b/conf/lang/de/vm/tts.xml @@ -1,8 +1,9 @@ - + + - + @@ -10,7 +11,7 @@ - + @@ -18,7 +19,7 @@ - + @@ -26,7 +27,7 @@ - + @@ -34,7 +35,7 @@ - + @@ -42,7 +43,7 @@ - + @@ -50,12 +51,12 @@ - + - + @@ -63,27 +64,25 @@ - + - - + - - + @@ -91,8 +90,8 @@ - + @@ -100,8 +99,8 @@ - + @@ -109,8 +108,8 @@ - + @@ -118,7 +117,7 @@ - + @@ -126,7 +125,7 @@ - + @@ -134,7 +133,7 @@ - + @@ -142,7 +141,7 @@ - + @@ -150,7 +149,7 @@ - + @@ -158,7 +157,7 @@ - + @@ -166,7 +165,7 @@ - + @@ -174,7 +173,7 @@ - + @@ -182,7 +181,7 @@ - + @@ -190,7 +189,7 @@ - + @@ -198,7 +197,7 @@ - + @@ -206,9 +205,20 @@ - + - + + diff --git a/conf/lang/en/demo/demo-ivr.xml b/conf/lang/en/demo/demo-ivr.xml index ec7d7bccd2..98f155a265 100644 --- a/conf/lang/en/demo/demo-ivr.xml +++ b/conf/lang/en/demo/demo-ivr.xml @@ -1,6 +1,4 @@ - - - + @@ -69,7 +67,7 @@ - + @@ -132,7 +130,7 @@ - + @@ -140,9 +138,19 @@ - - + + diff --git a/conf/lang/en/demo/demo.xml b/conf/lang/en/demo/demo.xml index e3e6f02142..bcfe6a8227 100644 --- a/conf/lang/en/demo/demo.xml +++ b/conf/lang/en/demo/demo.xml @@ -1,71 +1,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/lang/en/dir/sounds.xml b/conf/lang/en/dir/sounds.xml index fc288ff622..b715a7f825 100644 --- a/conf/lang/en/dir/sounds.xml +++ b/conf/lang/en/dir/sounds.xml @@ -117,3 +117,14 @@ + diff --git a/conf/lang/en/dir/tts.xml b/conf/lang/en/dir/tts.xml index 84007b7d52..d5f112dcda 100644 --- a/conf/lang/en/dir/tts.xml +++ b/conf/lang/en/dir/tts.xml @@ -93,3 +93,14 @@ + diff --git a/conf/lang/en/en.xml b/conf/lang/en/en.xml index 33c55197c2..3d27bce17b 100644 --- a/conf/lang/en/en.xml +++ b/conf/lang/en/en.xml @@ -3,12 +3,23 @@ - - - - + + + + + diff --git a/conf/lang/en/ivr/sounds.xml b/conf/lang/en/ivr/sounds.xml index 1e67062061..5e8b2a1a05 100644 --- a/conf/lang/en/ivr/sounds.xml +++ b/conf/lang/en/ivr/sounds.xml @@ -1,106 +1,145 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/lang/en/vm/sounds.xml b/conf/lang/en/vm/sounds.xml index e58d4904bb..ff8844ae97 100644 --- a/conf/lang/en/vm/sounds.xml +++ b/conf/lang/en/vm/sounds.xml @@ -1,9 +1,10 @@ - + + - - + + @@ -11,8 +12,8 @@ - - + + @@ -20,7 +21,23 @@ - + + + + + + + + + + + + + + + + + @@ -28,7 +45,7 @@ - + @@ -36,7 +53,7 @@ - + @@ -44,7 +61,7 @@ - + @@ -52,18 +69,18 @@ - - - - + + + + - - - - + + + + @@ -71,28 +88,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -100,34 +117,34 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -135,7 +152,7 @@ - + @@ -143,15 +160,15 @@ - - - - - - - - - + + + + + + + + + @@ -159,12 +176,12 @@ - - - - - - + + + + + + @@ -172,12 +189,12 @@ - - - - - - + + + + + + @@ -185,9 +202,9 @@ - - - + + + @@ -195,7 +212,7 @@ - + @@ -203,43 +220,43 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -247,7 +264,7 @@ - + @@ -255,7 +272,7 @@ - + @@ -263,7 +280,7 @@ - + @@ -271,7 +288,7 @@ - + @@ -279,9 +296,9 @@ - - - + + + @@ -289,9 +306,9 @@ - - - + + + @@ -299,7 +316,7 @@ - + @@ -307,17 +324,25 @@ - - - + + + + + + + + - + + + + @@ -325,39 +350,39 @@ - + - + - + - - + + - - + + - - + + - - + + @@ -365,16 +390,16 @@ - + - - - + + + @@ -401,4 +426,16 @@ - + + + diff --git a/conf/lang/en/vm/tts.xml b/conf/lang/en/vm/tts.xml index 1fc877d50e..2de4b3781e 100644 --- a/conf/lang/en/vm/tts.xml +++ b/conf/lang/en/vm/tts.xml @@ -1,8 +1,9 @@ - + + - + @@ -10,7 +11,7 @@ - + @@ -18,7 +19,7 @@ - + @@ -26,7 +27,7 @@ - + @@ -34,7 +35,7 @@ - + @@ -42,7 +43,7 @@ - + @@ -50,12 +51,12 @@ - + - + @@ -63,27 +64,25 @@ - + - - + - - + @@ -92,8 +91,8 @@ - + @@ -101,8 +100,8 @@ - + @@ -110,7 +109,7 @@ - + @@ -118,7 +117,7 @@ - + @@ -126,7 +125,7 @@ - + @@ -134,8 +133,8 @@ - + @@ -143,7 +142,7 @@ - + @@ -151,7 +150,7 @@ - + @@ -159,7 +158,7 @@ - + @@ -167,7 +166,7 @@ - + @@ -175,7 +174,7 @@ - + @@ -183,7 +182,7 @@ - + @@ -191,7 +190,7 @@ - + @@ -199,7 +198,7 @@ - + @@ -207,7 +206,7 @@ - + @@ -215,7 +214,7 @@ - + @@ -223,7 +222,7 @@ - + @@ -231,9 +230,20 @@ - + - + + diff --git a/conf/lang/en/vm/voicemail_ivr.xml b/conf/lang/en/vm/voicemail_ivr.xml index de873078a4..590026a29d 100644 --- a/conf/lang/en/vm/voicemail_ivr.xml +++ b/conf/lang/en/vm/voicemail_ivr.xml @@ -1,142 +1,142 @@ - - + + + - - - + + + - + - + - + - + - - + + - - + + - + - - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - + @@ -144,8 +144,8 @@ - - + + @@ -153,215 +153,214 @@ - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + - + - - + + - + - - - + + + - + - + - + - - - - - - + + + + + + - + - - + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - + - + - - - + + + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - + - + - + @@ -369,7 +368,7 @@ - + @@ -377,7 +376,7 @@ - + @@ -385,13 +384,25 @@ - + - - - + + + - + + + diff --git a/conf/lang/fr/demo/demo.xml b/conf/lang/fr/demo/demo.xml index 80660203a3..0d0de592ac 100644 --- a/conf/lang/fr/demo/demo.xml +++ b/conf/lang/fr/demo/demo.xml @@ -1,18 +1,29 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/conf/lang/fr/dir/sounds.xml b/conf/lang/fr/dir/sounds.xml index 02d6b3671f..a0dcb2c0e9 100644 --- a/conf/lang/fr/dir/sounds.xml +++ b/conf/lang/fr/dir/sounds.xml @@ -1,121 +1,130 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + - + + + + + + + - - - - - - + + + + + + + - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + diff --git a/conf/lang/fr/dir/tts.xml b/conf/lang/fr/dir/tts.xml index 1f5b0caa63..7d3e5e3090 100644 --- a/conf/lang/fr/dir/tts.xml +++ b/conf/lang/fr/dir/tts.xml @@ -1,101 +1,110 @@ - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + - + + + + + + + - - - - - - + + + + + + + - + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/conf/lang/fr/fr.xml b/conf/lang/fr/fr.xml index eaf00f247e..124ca02415 100644 --- a/conf/lang/fr/fr.xml +++ b/conf/lang/fr/fr.xml @@ -3,10 +3,21 @@ - + - + + diff --git a/conf/lang/fr/vm/sounds.xml b/conf/lang/fr/vm/sounds.xml index 55190a6bac..9cd209eab1 100644 --- a/conf/lang/fr/vm/sounds.xml +++ b/conf/lang/fr/vm/sounds.xml @@ -1,9 +1,9 @@ - - + + - + @@ -11,7 +11,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -51,17 +51,17 @@ - + - + - + @@ -69,27 +69,25 @@ - + - - + - - + @@ -98,8 +96,8 @@ - + @@ -107,8 +105,8 @@ - + @@ -116,8 +114,8 @@ - + @@ -125,7 +123,7 @@ - + @@ -133,7 +131,7 @@ - + @@ -141,7 +139,7 @@ - + @@ -149,7 +147,7 @@ - + @@ -157,7 +155,7 @@ - + @@ -165,7 +163,7 @@ - + @@ -173,7 +171,7 @@ - + @@ -181,12 +179,12 @@ - + - + @@ -194,7 +192,7 @@ - + @@ -202,7 +200,7 @@ - + @@ -210,27 +208,27 @@ - + - + - + - + - + @@ -238,9 +236,20 @@ - + - \ No newline at end of file + + diff --git a/conf/lang/he/demo/demo-ivr.xml b/conf/lang/he/demo/demo-ivr.xml index ec7d7bccd2..df8d24b751 100644 --- a/conf/lang/he/demo/demo-ivr.xml +++ b/conf/lang/he/demo/demo-ivr.xml @@ -1,6 +1,4 @@ - - - + @@ -69,7 +67,7 @@ - + @@ -132,7 +130,7 @@ - + @@ -145,4 +143,15 @@ - + + diff --git a/conf/lang/he/demo/demo.xml b/conf/lang/he/demo/demo.xml index e3e6f02142..bcfe6a8227 100644 --- a/conf/lang/he/demo/demo.xml +++ b/conf/lang/he/demo/demo.xml @@ -1,71 +1,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/lang/he/dir/sounds.xml b/conf/lang/he/dir/sounds.xml index 15ecec304a..5fd13fffc5 100644 --- a/conf/lang/he/dir/sounds.xml +++ b/conf/lang/he/dir/sounds.xml @@ -1,121 +1,130 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + - + + + + + + + - - - - - - + + + + + + + - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + diff --git a/conf/lang/he/he.xml b/conf/lang/he/he.xml index fe7c5d8a01..7cca73c1e8 100644 --- a/conf/lang/he/he.xml +++ b/conf/lang/he/he.xml @@ -9,3 +9,14 @@ + diff --git a/conf/lang/he/vm/sounds.xml b/conf/lang/he/vm/sounds.xml index 5a090411d7..917c84b038 100644 --- a/conf/lang/he/vm/sounds.xml +++ b/conf/lang/he/vm/sounds.xml @@ -1,9 +1,10 @@ - + + - - + + @@ -11,8 +12,8 @@ - - + + @@ -20,7 +21,7 @@ - + @@ -28,7 +29,7 @@ - + @@ -36,7 +37,7 @@ - + @@ -44,7 +45,7 @@ - + @@ -52,18 +53,18 @@ - - - - + + + + - - - - + + + + @@ -71,28 +72,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -100,34 +101,34 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -135,7 +136,7 @@ - + @@ -143,15 +144,15 @@ - - - - - - - - - + + + + + + + + + @@ -159,12 +160,12 @@ - - - - - - + + + + + + @@ -172,12 +173,12 @@ - - - - - - + + + + + + @@ -185,9 +186,9 @@ - - - + + + @@ -195,7 +196,7 @@ - + @@ -203,43 +204,43 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -247,7 +248,7 @@ - + @@ -255,7 +256,7 @@ - + @@ -263,7 +264,7 @@ - + @@ -271,7 +272,7 @@ - + @@ -279,9 +280,9 @@ - - - + + + @@ -289,9 +290,9 @@ - - - + + + @@ -299,7 +300,7 @@ - + @@ -307,9 +308,9 @@ - - - + + + @@ -317,7 +318,7 @@ - + @@ -325,39 +326,39 @@ - + - + - + - - + + - - + + - - + + - - + + @@ -365,16 +366,16 @@ - + - - - + + + @@ -401,4 +402,16 @@ - + + + diff --git a/conf/lang/ru/demo/demo-ivr.xml b/conf/lang/ru/demo/demo-ivr.xml index 8c6f3f8624..7de0d7fd0d 100644 --- a/conf/lang/ru/demo/demo-ivr.xml +++ b/conf/lang/ru/demo/demo-ivr.xml @@ -1,6 +1,4 @@ - - - + @@ -66,7 +64,7 @@ - + @@ -129,7 +127,7 @@ - + @@ -142,4 +140,15 @@ - + + diff --git a/conf/lang/ru/demo/demo.xml b/conf/lang/ru/demo/demo.xml index 7e450fbc83..10c9dbc552 100644 --- a/conf/lang/ru/demo/demo.xml +++ b/conf/lang/ru/demo/demo.xml @@ -1,100 +1,109 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/lang/ru/dir/sounds.xml b/conf/lang/ru/dir/sounds.xml index 02d6b3671f..a0dcb2c0e9 100644 --- a/conf/lang/ru/dir/sounds.xml +++ b/conf/lang/ru/dir/sounds.xml @@ -1,121 +1,130 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + - + + + + + + + - - - - - - + + + + + + + - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + diff --git a/conf/lang/ru/dir/tts.xml b/conf/lang/ru/dir/tts.xml index 67ae5ab265..f0aafa267d 100644 --- a/conf/lang/ru/dir/tts.xml +++ b/conf/lang/ru/dir/tts.xml @@ -1,96 +1,105 @@ - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + - + + + + + + + - - - - - - + + + + + + + - + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/conf/lang/ru/ru.xml b/conf/lang/ru/ru.xml index 686e840860..5f52e768a4 100644 --- a/conf/lang/ru/ru.xml +++ b/conf/lang/ru/ru.xml @@ -1,4 +1,3 @@ - @@ -11,3 +10,14 @@ + diff --git a/conf/lang/ru/vm/sounds.xml b/conf/lang/ru/vm/sounds.xml index ffd9ec5d8c..2ee9e6ec58 100644 --- a/conf/lang/ru/vm/sounds.xml +++ b/conf/lang/ru/vm/sounds.xml @@ -1,10 +1,10 @@ - - + + - - + + @@ -12,8 +12,8 @@ - - + + @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -53,30 +53,30 @@ - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + @@ -84,50 +84,48 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + @@ -135,15 +133,15 @@ - - - - - - - - - + + + + + + + + + @@ -151,12 +149,12 @@ - - - - - - + + + + + + @@ -164,12 +162,12 @@ - - - - - - + + + + + + @@ -177,9 +175,9 @@ - - - + + + @@ -187,7 +185,7 @@ - + @@ -239,7 +237,7 @@ - + @@ -247,7 +245,7 @@ - + @@ -255,7 +253,7 @@ - + @@ -263,7 +261,7 @@ - + @@ -271,9 +269,9 @@ - - - + + + @@ -281,9 +279,9 @@ - - - + + + @@ -291,7 +289,7 @@ - + @@ -299,9 +297,9 @@ - - - + + + @@ -309,7 +307,7 @@ - + @@ -317,39 +315,39 @@ - + - + - + - - + + - - + + - - + + - - + + @@ -357,9 +355,20 @@ - + - + + diff --git a/conf/lang/ru/vm/tts.xml b/conf/lang/ru/vm/tts.xml index 1fc877d50e..2de4b3781e 100644 --- a/conf/lang/ru/vm/tts.xml +++ b/conf/lang/ru/vm/tts.xml @@ -1,8 +1,9 @@ - + + - + @@ -10,7 +11,7 @@ - + @@ -18,7 +19,7 @@ - + @@ -26,7 +27,7 @@ - + @@ -34,7 +35,7 @@ - + @@ -42,7 +43,7 @@ - + @@ -50,12 +51,12 @@ - + - + @@ -63,27 +64,25 @@ - + - - + - - + @@ -92,8 +91,8 @@ - + @@ -101,8 +100,8 @@ - + @@ -110,7 +109,7 @@ - + @@ -118,7 +117,7 @@ - + @@ -126,7 +125,7 @@ - + @@ -134,8 +133,8 @@ - + @@ -143,7 +142,7 @@ - + @@ -151,7 +150,7 @@ - + @@ -159,7 +158,7 @@ - + @@ -167,7 +166,7 @@ - + @@ -175,7 +174,7 @@ - + @@ -183,7 +182,7 @@ - + @@ -191,7 +190,7 @@ - + @@ -199,7 +198,7 @@ - + @@ -207,7 +206,7 @@ - + @@ -215,7 +214,7 @@ - + @@ -223,7 +222,7 @@ - + @@ -231,9 +230,20 @@ - + - + + diff --git a/debian/freeswitch.init b/debian/freeswitch.init index c09e7128d1..6cae11ba39 100755 --- a/debian/freeswitch.init +++ b/debian/freeswitch.init @@ -28,7 +28,7 @@ WORKDIR=/opt/$NAME CALLEDSCRIPT=`basename $0` -if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi +if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi if [ "$FREESWITCH_ENABLED" != "true" ]; then echo "$DESC not enabled yet. Edit /etc/default/$NAME first." @@ -180,5 +180,3 @@ case "$1" in exit 3 ;; esac - -: diff --git a/docs/ChangeLog b/docs/ChangeLog index 78d8f84d85..6f92097c5f 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -31,6 +31,9 @@ freeswitch (1.0.7) build: unimrcp vs2010 build fixes for new version (r:2dcca5f4) build: add sqlite to clean on make current or update-clean (r:2366f429) build: Update windows to use Lame 3.98.4 (r:4349ec00) + build: fix mod_silk build issue (r:6fe6d8d7/FS-3649) + build: Rename AUTOMAKE_OPTS to AUTOMAKE_OPTIONS in several places (r:992eafd0) + build: don't allow using system libcurl on systems that strip out Curl_setopt, we use it (r:36f0a5b8/FS-2936) codec2: working prototype, still for testing only (r:04ca0751) config: move limit.conf to db.conf config: Update VM phrase macros to voice option then action on main, config menus @@ -57,6 +60,7 @@ freeswitch (1.0.7) config: Fix mod_directory phrase file references to 'dir-press.wav' (correct: vm-press) (r:3ef2692f) config: bump ru sounds version to 1.0.13 (r:2b1b19bf) config: Fix eavesdrop so that *0 works as well as 88 as the access code (r:cbfe83cc) + config: change default to short date-time in VM sounds (r:3603a69d) core: Add RTCP support (FSRTP-14) core: handle some errors on missing db handle conditions core: add ... and shutdown as a fail-safe when no modules are loaded @@ -336,6 +340,15 @@ freeswitch (1.0.7) core: add getGlobalVariable and setGlobalVariable to swig stuff (r:2faaee0e) core: Fix erroneous "module busy" messages on module unload (r:bad5964b/FS-3589) core: move code from uuid_kill into core (r:3c9551ee) + core: Directed pickup sends "call completed elsewhere" (r:43ca3ee8/FS-3634) + core: jitter-buffer tweaks (r:e3ade445/FS-3671 and r:599a4543/FS-3672) + core: Add option to disable PLC when using the jitter buffer (r:ba14f95d/FS-3678) + core: Allow fail_on_single_reject to do negated causes, i.e. fail_on_single_reject=!UNALLOCATED_NUMBER (r:522c0d53/FS-3675) + core: move the thing that passes proto_specific_hangup_cause to the core and prefix it with last_bridge_ and also log last_bridge_hangup_cauuse for good measure (r:e04f9ba9) + core: Add CHANNEL_EXECUTE to the list of default "verbose events" (r:ff7432d9/FS-3680) + core: fix queued dtmf on channels with no timer issue (r:bc968ca8) + core: use the non-signal checking version of switch_channel_up/down in the core (r:9ecf187d) + core: Link curl into core (r:74ed2cef) docs: Major clean up of doxygen generated core API documentation (r:794246e1) docs: Add libteletone back to core API documentation (r:c35c138d) embedded languages: Provide core level support for conditional Set Global Variable (r:c017c24b/FSCORE-612) @@ -404,6 +417,7 @@ freeswitch (1.0.7) libs: Merged OpenZAP and FreeTDM into the FreeSWITCH tree. libs: Add support for TLS on Windows using openssl (r:1abe3b93/MODSOFIA-92) libs: fix bsd shell incompatibility (r:e2b85e94/FS-287) + libsndfile: Update libsndfile and edit mod_sndfile.c to support ogg and flac (r:02a604f7/FS-1197) libsofiasip: Fix random crashes (r:c15ee980/SFSIP-219) libsofiasip: Fix T.38 bug in sofia_glue (r:2843f1ad/MODSOFIA-94) libsofiasip: VS2010 sofia posix problem (r:46dd24c2/SFSIP-220) @@ -478,6 +492,7 @@ freeswitch (1.0.7) mod_callcenter: New strategies: round-robin, random, and 'top-down' (r:2b4b23aa,r:bee247ca) mod_callcenter: Display an warning when MOH is invalid and resume wait with silence. (r:37b14c9a/FS-2740) mod_callcenter: Fix member been switch as abandoned when he was pickup by an agent (r:9ff8f53f/FS-3281) + mod_callcenter: Adapt mod_callcenter loopback agent fix to work with commit 2eae19e6 (r:d32ba761/FS-3657) mod_cdr_mongodb: add MongoDB CDR module (r:a9169199) mod_cdr_sqlite: initial commit (r:f625fe3b) mod_cdr_sqlite: config file for mod_cdr_sqlite (r:25bc8fe3) @@ -562,9 +577,14 @@ freeswitch (1.0.7) mod_conference: remove waste flags from both conference and member and explicitly always send audio from conferences to avoid random interop issues and general discomfort these flags are now deprecated (r:5d77e789) mod_conference: add conference cdrs to mod_conference (r:127be02d) mod_conference: add custom kick sound to conference (r:8fde25cc) + mod_conference: Fix bug where not entering PIN allows caller into PIN-protected conference (r:9dd45e35/FS-3661) + mod_conference: fix crash in video-bridge mode (r:4c13e7c0) mod_curl: use method=post when post requested (r:c6a4ddd0/FSMOD-69) mod_db: fix stack corruption (MODAPP-407) mod_dialplan_xml: Add in the INFO log the caller id number when processing a request (Currenly only show the caller name) (r:e1df5e13) + mod_dialplan_xml: Add tag for OR logic in XML dialplan (r:c1615dbb/FS-3655) + mod_dialplan_xml: add xor to regex attr (r:7c7b0068/FS-3655) + mod_dialplan_xml: add tod_tz_offset variable to set to the integer value of the tz offset or the tz-offset tag on a per-tag basis (r:65a75664) mod_dingaling: make mod_dingaling compat with google's new free phonecalls thing (r:ba0a2a32) mod_dingaling: make dingaling work with google voice inbound too (r:4ee68141) mod_dingaling: Fix crash when testing the new gv-dingaling with around 24 concurrent calls (r:73e1ec5e/FSCORE-667) @@ -602,6 +622,8 @@ freeswitch (1.0.7) mod_dptools: fix seg on user_recurse_variables reported on the mailing list (r:01b2bd04) mod_dptools: add digit_action_set_target app that can set the target (direction of the dtmf flow and subsequent channel who gets the events) to self or peer (bridged channel when possible) (r:cf9859ea) mod_dptools: get rid of digit_action_set target and add target,bind_target params to bind_digit_action (r:42b64ccd) + mod_dptools: add flags to digit bindings (r:d93ed90b) + mod_dptools: New dialplan app: play_and_detect_speech (r:34338e5a/FS-3692) mod_easyroute: Fix possible segfaults and memory leak during unload, and add new setting odbc-retries (r:7fbc47f8/FS-2973) mod_enum: switch mod_enum to use new portable in-tree version (r:2bbc37e3) mod_enum: fix race condition between ldns configure creating ldns/util.h and mod_enum (r:87884c5c) @@ -685,6 +707,15 @@ freeswitch (1.0.7) mod_gsmopen: copy from branch mod_gsmopen: fix FS-2793, compilation stops (r:355c0dbb/FS-2793) mod_gsmopen: retry serial initialization if failed, zeroing audio buffers, slower retry on soundcard busy (EAGAIN) (r:c7aefe93) + mod_h323: initial t.38 support. remake logical channel opening. add missing param name in example config. (r:8c58074c) + mod_h323: some t.38 and locking improvements. replace ptrace with switch_log_printf. (r:5efe5c88) + mod_h323: add missing conf praameter (r:0b353d7a) + mod_h323: Add mod_h323 to windows (r:015bcaf6/MODENDP-301) + mod_h323: move PTrace level set to FSH323EndPoint::Initialise. partially apply patch from from Peter Olsson, Remove UnLock() when TryLock() failed and DEBUG_RTP_PACKETS directiv e. (r:7b5803f7) + mod_h323: set network_addr of caller profile to signaling ip address. (requested by Steven Ayre) (r:072bf5ad) + mod_h323: fix race condition on destroying signaling thread in h323 library (r:c22aac0e) + mod_h323: move the switch_rtp_request_port() call from the contructor to FSH323Connection::CreateRealTimeLogicalChannel() - fix rtp port leak. tnx to Peter Olsson. (r:6f4c4ea0) + mod_h323: fix stale calls then fax send/recv in some circumstance (r:00fce043) mod_hash: free all hashtables on shutdown (r:e76d7d92) mod_hash: remove unneeded initializer (r:10d468a6) mod_hash: begin working on remote support (r:c5ad49da) @@ -701,14 +732,6 @@ freeswitch (1.0.7) mod_hash: limit_remote_thread sending invalid handle to esl_connect_timeout causing core (r:6cdd3e2a/MODAPP-446) mod_hash: avoid scheduler calling a function on null hash during shutdown (r:8458adeb) mod_hash: add realm filter to hash_dump db command so that you can quickly dump all entries that belong only to a specific realm without getting the whole db (r:81347126) - mod_h323: initial t.38 support. remake logical channel opening. add missing param name in example config. (r:8c58074c) - mod_h323: some t.38 and locking improvements. replace ptrace with switch_log_printf. (r:5efe5c88) - mod_h323: add missing conf praameter (r:0b353d7a) - mod_h323: Add mod_h323 to windows (r:015bcaf6/MODENDP-301) - mod_h323: move PTrace level set to FSH323EndPoint::Initialise. partially apply patch from from Peter Olsson, Remove UnLock() when TryLock() failed and DEBUG_RTP_PACKETS directiv e. (r:7b5803f7) - mod_h323: set network_addr of caller profile to signaling ip address. (requested by Steven Ayre) (r:072bf5ad) - mod_h323: fix race condition on destroying signaling thread in h323 library (r:c22aac0e) - mod_h323: move the switch_rtp_request_port() call from the contructor to FSH323Connection::CreateRealTimeLogicalChannel() - fix rtp port leak. tnx to Peter Olsson. (r:6f4c4ea0) mod_http_cache: Initial commit of new module (thanks crienzo) (r:c51acfcc/FS-3597) mod_java: fix eventConsumer issue and add flush() method (r:7fd3aff6) mod_java: Allow user defined java methods to be called at startup and shutdown of JVM (r:1339e218/MODLANG-117) @@ -730,6 +753,7 @@ freeswitch (1.0.7) mod_lcr: fix "as xml" for larger number of arguments (r:3dca2ebb/FS-3283) mod_lcr: fix malformed XML when has embedded %s (r:5fa9619f/FS-3284) mod_lcr: initial addition of very basic LRN (r:6d1d4a9c) + mod_logfile: Replace hard-coded file permissions w/ OS default or umask (r:513a9e1a/FS-3710) mod_loopback: add loopback_bowout_on_execute var to make 1 legged loopback calls bow out of the picture mod_loopback: only execute app once in app mode (r:64f58f2d) mod_loopback: fix bug in mod_loopback where bowout=false (r:e9ab5368) @@ -780,7 +804,8 @@ freeswitch (1.0.7) mod_portaudio: move load_config a bit lower since it needs to use the hashtables (r:1529c0ec) mod_portaudio: Fix Windows crash (r:94c9cbf6/FS-3498) mod_portaudio_stream: update to specify the channel index (r:d1169d6e) - mod_protovm: This is a very early new prototype voicemail ivr system. You need to copy the sounds.xml and make it loadale in the language folder and protovm.conf.xml inside the autoload_configs folder. Configs file will most definitly change. Once stabilized, we make it install those file by default. (r:fb549777) + mod_portaudio: mod_portaudio: fix incorrect use of pa input buffer that could lead to garbage audio (r:f2cf68bf) + mod_protovm: Removed by author; replaced by mod_voicemail_ivr mod_python: add chat app to python (r:08917021) mod_radius_cdr: Add 'Freeswitch-Direction' av pair (r:a5170df0) mod_radius_cdr: Add 'Freeswitch-Other-Leg-Id' av pair (r:18d29b46) @@ -818,6 +843,7 @@ freeswitch (1.0.7) mod_say_de: method PRONOUNCED - grammatical fixes, thank you Christian Benke (r:5d46ddbc/FS-3195) mod_say_en: introduce new say_string method of doing say and use it in mod_say_en as an example. try: eval ${say_string en.gsm en current_date_time pronounced ${strepoch()}} from the cli with this patch. We can do more to centralize the say things and go back and apply it to other langs, using this method you can set the desired file ext as well which I think is a bounty.... (r:d5ef86d7) mod_say_en: If you only tell SAY CURRENCY to say 100 it should only say 100 dollars without the "0 cents" (r:426a4e76/FS-2922) + mod_say_en: add "PRONOUNCED_YEAR" so 1985 is "nineteen eighty-five" (r:c0af0a85) mod_say_es: fix grammar when saying dates and time (r:6bed19b2/MODAPP-429) mod_say_he: Add Hebrew say module (r:ebd9c83e/FS-3211) mod_say_ja: initial commit, still needs sound files (r:b2423158/FS-2755) @@ -828,6 +854,7 @@ freeswitch (1.0.7) mod_shout: bump mod_shout to use mpg123-1.13.2 to hopefully address unwanted calls to exit() and inherit other upstream fixes (r:079f3f73) mod_shout: add append flag to mod_shout, can append MP3's (r:0419c4e0) mod_shout: add ability to set bitrate, samplerate, and encoder quality in config file (r:8ea3cbd5/FS-1231) + mod_shout: Initialize Lame sooner for file open (r:44b5cf82/FS-3646) mod_silk: Fix mod_silk compliance and performance issues (r:2ddbc457/MODCODEC-20) mod_skinny: Add the missing api files mod_skinny: add example dialplan and directory config (r:1bfcc17e) @@ -1093,6 +1120,16 @@ freeswitch (1.0.7) mod_sofia: add presence_map config (r:48416707) mod_sofia: add lookup params to presence_map (r:ea7f6a18) mod_sofia: add missing mod_sofia indexes (r:40df8d65) + mod_sofia: When doing direct pickup send CANCEL with reason="call completed elsewhere" (r:6cd6a719/FS-3634) + mod_sofia: Handle "isup-oli" in SIP From: field (similar to "gw" handling) (r:0ed54079/FS-3663) + mod_sofia: Fix NOTIFY expiry time to conform to RFC 3265 (r:42c69c04/FS-3685) + mod_sofia: Preserve VIA headers in sofia recovery (r:5a6231b6/FS-3686) + mod_sofia: Add respond 503 "Maximum Calls In Progress" param for incoming SIP OPTIONS when busy (r:a891514c/FS-3697) + mod_sofia: don't list all registrations when doing "sofia status profile foo" (use 'reg' option instead) (r:00e381f1/FS-3699) + mod_sofia: Fix typo and possible memory corruption in sofia presence (r:ff910276/FS-3706) + mod_sofia: comment out optional Require header from re-invites for the sake of interop with testy t.38 terminals (r:58c3c3a0) + mod_sofia: Set reg and invite auto failures to loglevel debug10 to satisfy Fail2ban (r:35112f22/FS-3586) + mod_sofia: Fix segfault on malformed NOTIFY (r:82807998/FS-3718) mod_soundtouch: updated soundtouch to library 1.5.0 to fix gcc > 4.3 incompatibilities (r:dfb5c629) mod_soundtouch: Update soundtouch to 1.6.0 to fix FS-3634 (r:d8ae59fd/FS-3634) mod_spandsp: initial checkin of mod_fax/mod_voipcodecs merge into mod_spandsp (r:fa9a59a8) @@ -1143,6 +1180,7 @@ freeswitch (1.0.7) mod_valet_parking: valet_info now returns uuid properly (r:34ddeb75/FS-3613) mod_valet_parking: add presence to mod_valet_parking subscribe to the lot name for general stats or individual slots to monitor with park+ prefix *note* this used to be used in mod_fifo which now will use queue+ going forward (r:9daa42c1) mod_valet_parking: lower token freq to 5, put it in a define and have more obvious warning about full lots (r:2f786a07) + mod_valet_parking: make auto unpark choose the one waiting the longest instead of the earliest ext val (r:00cf5aed) mod_voicemail: Fix vm_prefs profile lock (MODAPP-417) mod_voicemail: add 'vm-enabled' param (default true) mod_voicemail: fix vm msg being deleted when pressing key to forward to email (MODAPP-403) @@ -1167,6 +1205,9 @@ freeswitch (1.0.7) mod_voicemail: use vm_email as notification address if vm_notify_email isn't set (that behavior was in voicemail_leave_main but not in deliver_vm) (r:8974f9d6) mod_voicemail: better fix for voicemail email key match (r:aff4bcbe/FS-3080) mod_voicemail: Prevent rewind key from breaking out of message playback (r:923a104b/FS-3637) + mod_voicemail: add variable vm_auth_only or option auth_only to voicemail app so you can use it as a pin checker (r:3051480d) + mod_voicemail: fix wrong message count with saved urgent messages (r:54b4b088) + mod_voicemail: add voicemail_formatted_caller_id_number param for templates in vm (r:94b9cc0f) mod_xml_cdr: add force_process_cdr var to process b leg cdr on a case by case basis when b leg cdr is disabled (XML-17) mod_xml_cdr: add leg param to query string (XML-24) mod_xml_cdr: fix locked sessions (XML-26) diff --git a/docs/phrase/phrase_en.xml b/docs/phrase/phrase_en.xml index 58d5a3604f..f9b2a3e221 100644 --- a/docs/phrase/phrase_en.xml +++ b/docs/phrase/phrase_en.xml @@ -186,7 +186,7 @@ - + @@ -220,7 +220,7 @@ - + @@ -239,8 +239,15 @@ - - + + + + + + + + + @@ -291,10 +298,15 @@ - - - - + + + + + + + + + @@ -312,7 +324,6 @@ - @@ -397,7 +408,7 @@ - + @@ -468,8 +479,8 @@ - - + + @@ -489,13 +500,34 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -509,6 +541,14 @@ + + + + + + + + @@ -1044,8 +1084,13 @@ diff --git a/docs/phrase/phrase_fr.xml b/docs/phrase/phrase_fr.xml index 2d5f488152..991895f865 100644 --- a/docs/phrase/phrase_fr.xml +++ b/docs/phrase/phrase_fr.xml @@ -178,7 +178,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -240,7 +240,7 @@ - + diff --git a/freeswitch.spec b/freeswitch.spec index a84f0a0e5d..b99f1c68d5 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -896,7 +896,7 @@ fi # Modules in Alphabetical Order, please keep them that way.. # ###################################################################################################################### -%{prefix}/mod/mod_abtraction.so* +%{prefix}/mod/mod_abstraction.so* %{prefix}/mod/mod_amrwb.so* %{prefix}/mod/mod_avmd.so* %{prefix}/mod/mod_blacklist.so* diff --git a/libs/curl/lib/select.c b/libs/curl/lib/select.c index 0f95921513..1abe49ffb7 100644 --- a/libs/curl/lib/select.c +++ b/libs/curl/lib/select.c @@ -124,7 +124,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms) if (writefd != CURL_SOCKET_BAD) { if (pfd[num].revents & POLLOUT) ret |= CSELECT_OUT; - if (pfd[num].revents & POLLERR) + if (pfd[num].revents & (POLLERR|POLLHUP)) ret |= CSELECT_ERR; } diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index 751d9868d2..36651e49d8 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -614,8 +614,7 @@ static void clear_line(void) static void redisplay(void) { -#ifdef WIN32 -#else +#ifndef WIN32 const LineInfo *lf = el_line(el); const char *c = lf->buffer; if (!(write_str(prompt_str))) goto done; @@ -1124,7 +1123,6 @@ int main(int argc, char *argv[]) char dft_cfile[512] = "fs_cli.conf"; #endif char *home = getenv("HOME"); - char *term = getenv("TERM"); /* Vars for optargs */ int opt; static struct option options[] = { @@ -1159,15 +1157,11 @@ int main(int argc, char *argv[]) int argv_quiet = 0; int loops = 2, reconnect = 0, timeout = 0; - if (term && (!strncasecmp("screen", term, 6) || - !strncasecmp("vt100", term, 5))) { - feature_level = 1; - } else { - feature_level = 0; - } #ifdef WIN32 feature_level = 0; +#else + feature_level = 1; #endif strncpy(internal_profile.host, "127.0.0.1", sizeof(internal_profile.host)); diff --git a/libs/esl/managed/ManagedEslTest/Program.cs b/libs/esl/managed/ManagedEslTest/Program.cs index 82f1b964ae..cbede4d028 100644 --- a/libs/esl/managed/ManagedEslTest/Program.cs +++ b/libs/esl/managed/ManagedEslTest/Program.cs @@ -166,7 +166,7 @@ namespace ManagedEslTest ESLconnection eslConnection = new ESLconnection(sckClient.Handle.ToInt32()); ESLevent eslEvent = eslConnection.GetInfo(); - string strUuid = eslEvent.GetHeader("UNIQUE-ID"); + string strUuid = eslEvent.GetHeader("UNIQUE-ID", -1); eslConnection.SendRecv("myevents"); eslConnection.SendRecv("divert_events on"); diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 562ee2d84c..02ab7ef271 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -741,9 +741,10 @@ ESL_DECLARE(int) esl_wait_sock(esl_socket_t sock, uint32_t ms, esl_poll_t flags) FD_ZERO(&wfds); FD_ZERO(&efds); +#ifndef WIN32 /* Wouldn't you rather know?? */ assert(sock <= FD_SETSIZE); - +#endif if ((flags & ESL_POLL_READ)) { diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index ead853ea46..1271e46e4f 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -285,7 +285,7 @@ ESL_DECLARE(char *)esl_event_get_body(esl_event_t *event) ESL_DECLARE(esl_status_t) esl_event_del_header_val(esl_event_t *event, const char *header_name, const char *val) { esl_event_header_t *hp, *lp = NULL, *tp; - esl_status_t status = ESL_FALSE; + esl_status_t status = (esl_status_t) ESL_FALSE; int x = 0; esl_ssize_t hlen = -1; unsigned long hash = 0; @@ -875,12 +875,12 @@ ESL_DECLARE(esl_status_t) esl_event_create_json(esl_event_t **event, const char if (!(cj = cJSON_Parse(json))) { - return ESL_FALSE; + return (esl_status_t) ESL_FALSE; } if (esl_event_create(&new_event, ESL_EVENT_CLONE) != ESL_SUCCESS) { cJSON_Delete(cj); - return ESL_FALSE; + return (esl_status_t) ESL_FALSE; } for (cjp = cj->child; cjp; cjp = cjp->next) { diff --git a/libs/freetdm/.update b/libs/freetdm/.update index e9475b68ed..b537cc4f2d 100644 --- a/libs/freetdm/.update +++ b/libs/freetdm/.update @@ -1 +1 @@ -Fri Oct 3 17:54:41 EDT 2008 +Fri Feb 3 11:55:29 PST 2012 diff --git a/libs/freetdm/conf/freetdm.conf.xml b/libs/freetdm/conf/freetdm.conf.xml index d8fa55c8cb..6177f7d0f5 100644 --- a/libs/freetdm/conf/freetdm.conf.xml +++ b/libs/freetdm/conf/freetdm.conf.xml @@ -281,6 +281,253 @@ with the signaling protocols that you can run on top of your I/O interfaces. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/applications/mod_httapi/mod_httapi.2008.vcproj b/src/mod/applications/mod_httapi/mod_httapi.2008.vcproj new file mode 100644 index 0000000000..36a83970ba --- /dev/null +++ b/src/mod/applications/mod_httapi/mod_httapi.2008.vcproj @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/applications/mod_httapi/mod_httapi.2010.vcxproj b/src/mod/applications/mod_httapi/mod_httapi.2010.vcxproj new file mode 100644 index 0000000000..8b3c3b71e0 --- /dev/null +++ b/src/mod/applications/mod_httapi/mod_httapi.2010.vcxproj @@ -0,0 +1,131 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_httapi + {4748FF56-CA85-4809-97D6-A94C0FAC1D77} + mod_httapi + 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 + + + + + + \ No newline at end of file diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c new file mode 100644 index 0000000000..fba7736363 --- /dev/null +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -0,0 +1,2910 @@ +/* + * 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. + * + * Contributor(s): + * + * Anthony Minessale II + * + * mod_httapi.c -- HT-TAPI Hypertext Telephony API + * + */ +#include +#include + +SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_httapi_shutdown); +SWITCH_MODULE_DEFINITION(mod_httapi, mod_httapi_load, mod_httapi_shutdown, NULL); + +typedef struct profile_perms_s { + switch_byte_t set_params; + switch_byte_t set_vars; + switch_byte_t get_vars; + switch_byte_t extended_data; + switch_byte_t execute_apps; + switch_byte_t expand_vars; + struct { + switch_byte_t enabled; + switch_byte_t set_context; + switch_byte_t set_dp; + switch_byte_t set_cid_name; + switch_byte_t set_cid_number; + switch_byte_t full_originate; + } dial; + struct { + switch_byte_t enabled; + switch_byte_t set_profile; + } conference; +} profile_perms_t; + +struct client_s; + +typedef struct action_binding_s { + char *realm; + char *input; + char *action; + char *error_file; + char *match_digits; + char *strip; + struct client_s *client; + struct action_binding_s *parent; +} action_binding_t; + +typedef struct client_profile_s { + char *name; + char *method; + char *url; + char *cred; + char *bind_local; + int disable100continue; + uint32_t enable_cacert_check; + char *ssl_cert_file; + char *ssl_key_file; + char *ssl_key_password; + char *ssl_version; + char *ssl_cacert_file; + uint32_t enable_ssl_verifyhost; + char *cookie_file; + switch_hash_t *vars_map; + int auth_scheme; + int timeout; + profile_perms_t perms; + char *ua; + + struct { + char *use_profile; + } conference_params; + + struct { + char *context; + char *dp; + switch_event_t *app_list; + int default_allow; + } dial_params; + + struct { + switch_event_t *expand_var_list; + switch_event_t *set_var_list; + switch_event_t *get_var_list; + switch_event_t *api_list; + int default_allow; + } var_params; + +} client_profile_t; + +#define HTTAPI_MAX_API_BYTES 1024 * 1024 +#define HTTAPI_MAX_FILE_BYTES 1024 * 1024 * 100 + +typedef struct client_s { + switch_memory_pool_t *pool; + int fd; + switch_buffer_t *buffer; + switch_size_t bytes; + switch_size_t max_bytes; + switch_event_t *headers; + switch_event_t *params; + switch_event_t *one_time_params; + client_profile_t *profile; + switch_core_session_t *session; + switch_channel_t *channel; + action_binding_t *matching_action_binding; + action_binding_t *no_matching_action_binding; + struct { + char *action; + char *name; + char *file; + } record; + + int err; + long code; +} client_t; + +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; + switch_hash_t *profile_hash; + switch_hash_t *parse_hash; + char cache_path[128]; + int debug; + int not_found_expires; + int cache_ttl; +} globals; + + +/* for apr_pstrcat */ +#define DEFAULT_PREBUFFER_SIZE 1024 * 64 + +struct http_file_source; + +struct http_file_context { + int samples; + switch_file_handle_t fh; + char *cache_file; + char *meta_file; + char *lock_file; + char *metadata; + time_t expires; + switch_file_t *lock_fd; + switch_memory_pool_t *pool; + int del_on_close; + char *dest_url; + char *ua; + switch_event_t *url_params; + + struct { + char *ext; + } read; + + struct { + char *file_name; + char *profile_name; + char *file; + char *method; + char *name; + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + } write; +}; + +typedef struct http_file_context http_file_context_t; +typedef switch_status_t (*tag_parse_t)(const char *tag_name, client_t *client, switch_xml_t tag, const char *body); + +static void bind_parser(const char *tag_name, tag_parse_t handler) +{ + switch_core_hash_insert(globals.parse_hash, tag_name, (void *)(intptr_t)handler); +} + + +#define HTTAPI_SYNTAX "[debug_on|debug_off]" +SWITCH_STANDARD_API(httapi_api_function) +{ + if (session) { + return SWITCH_STATUS_FALSE; + } + + if (zstr(cmd)) { + goto usage; + } + + if (!strcasecmp(cmd, "debug_on")) { + globals.debug = 1; + } else if (!strcasecmp(cmd, "debug_off")) { + globals.debug = 0; + } else { + goto usage; + } + + stream->write_function(stream, "OK\n"); + return SWITCH_STATUS_SUCCESS; + + usage: + stream->write_function(stream, "USAGE: %s\n", HTTAPI_SYNTAX); + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match) +{ + action_binding_t *action_binding = (action_binding_t *) match->user_data; + + action_binding->client->matching_action_binding = action_binding; + action_binding->match_digits = switch_core_strdup(action_binding->client->pool, match->match_digits); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t digit_nomatch_action_callback(switch_ivr_dmachine_match_t *match) +{ + action_binding_t *action_binding = (action_binding_t *) match->user_data; + + action_binding->client->no_matching_action_binding = action_binding; + + return SWITCH_STATUS_BREAK; +} + + +static switch_status_t parse_voicemail(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *check = switch_xml_attr(tag, "check"); + const char *auth = switch_xml_attr(tag, "auth-only"); + const char *profile = switch_xml_attr(tag, "profile"); + const char *domain = switch_xml_attr(tag, "domain"); + const char *id = switch_xml_attr_soft(tag, "id"); + char *ddom = NULL; + char *str; + switch_status_t status; + + if (zstr(profile)) profile = "default"; + + if (zstr(domain)) { + if ((ddom = switch_core_get_variable_dup("domain"))) { + domain = ddom; + } + } + + if (switch_true(check)) { + check = "check"; + } else { + check = ""; + } + + if (switch_true(auth)) { + auth = "auth_only"; + check = "check"; + } else { + auth = ""; + } + + str = switch_core_session_sprintf(client->session, "%s %s %s %s %s", check, auth, profile, domain, id); + + while(*str == ' ') str++; + + status = switch_core_session_execute_application(client->session, "voicemail", str); + + switch_safe_free(ddom); + + return status; +} + +static switch_status_t parse_break(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + return SWITCH_STATUS_FALSE; +} + + +static void console_log(const char *level_str, const char *msg) +{ + switch_log_level_t level = SWITCH_LOG_DEBUG; + if (level_str) { + level = switch_log_str2level(level_str); + if (level == SWITCH_LOG_INVALID) { + level = SWITCH_LOG_DEBUG; + } + } + switch_log_printf(SWITCH_CHANNEL_LOG, level, "%s", switch_str_nil(msg)); +} + +static void console_clean_log(const char *level_str, const char *msg) +{ + switch_log_level_t level = SWITCH_LOG_DEBUG; + if (level_str) { + level = switch_log_str2level(level_str); + if (level == SWITCH_LOG_INVALID) { + level = SWITCH_LOG_DEBUG; + } + } + switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, level, "%s", switch_str_nil(msg)); +} + +static switch_status_t parse_get_var(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *var = switch_xml_attr(tag, "name"); + const char *perm = switch_xml_attr(tag, "permanent"); + + if (zstr(var)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing name attribute!"); + return SWITCH_STATUS_SUCCESS; + } + + + if (client->profile->perms.get_vars && + (!client->profile->var_params.get_var_list || switch_event_check_permission_list(client->profile->var_params.get_var_list, var))) { + const char *vval = switch_channel_get_variable(client->channel, var); + if (vval) { + switch_event_add_header_string(switch_true(perm) ? client->params : client->one_time_params, SWITCH_STACK_BOTTOM, var, vval); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "variable %s permission denied!\n", var); + return SWITCH_STATUS_FALSE; + } + + return SWITCH_STATUS_SUCCESS; + +} + +static switch_status_t parse_continue(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t parse_log(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *level = switch_xml_attr(tag, "level"); + const char *clean = switch_xml_attr(tag, "clean"); + + if (switch_true(clean)) { + console_clean_log(level, body); + } else { + console_log(level, body); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t parse_playback(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *file = switch_xml_attr(tag, "file"); + const char *name = switch_xml_attr(tag, "name"); + const char *error_file = switch_xml_attr(tag, "error-file"); + const char *action = switch_xml_attr(tag, "action"); + const char *digit_timeout_ = switch_xml_attr(tag, "digit-timeout"); + const char *input_timeout_ = switch_xml_attr(tag, "input-timeout"); + const char *tts_engine = NULL; + const char *tts_voice = NULL; + char *loops_ = (char *) switch_xml_attr(tag, "loops"); + int loops = 0; + switch_status_t status = SWITCH_STATUS_FALSE; + switch_ivr_dmachine_t *dmachine = NULL; + switch_input_args_t *args = NULL, myargs = { 0 }, nullargs = { 0 }; + long digit_timeout = 1500; + long input_timeout = 5000; + long tmp; + switch_xml_t bind = NULL; + int submit = 0; + int input = 0; + int speak = 0, say = 0, pause = 0, play = 0, speech = 0; + char *sub_action = NULL; + action_binding_t *top_action_binding = NULL; + const char *say_lang = NULL; + const char *say_type = NULL; + const char *say_method = NULL; + const char *say_gender = NULL; + const char *sp_engine = NULL; + const char *sp_grammar = NULL; + char *free_string = NULL; + + if (!strcasecmp(tag_name, "say")) { + say_lang = switch_xml_attr(tag, "language"); + say_type = switch_xml_attr(tag, "type"); + say_method = switch_xml_attr(tag, "method"); + say_gender = switch_xml_attr(tag, "gender"); + + if (zstr(say_lang) || zstr(say_type) || zstr(say_method) || zstr(body)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "speak: missing required attributes or text! (language) (type) (method) \n"); + return SWITCH_STATUS_FALSE; + } + + say = 1; + + } else if (!strcasecmp(tag_name, "speak")) { + tts_engine = switch_xml_attr(tag, "engine"); + tts_voice = switch_xml_attr(tag, "voice"); + + if (zstr(tts_engine)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "speak: missing engine attribute!\n"); + return SWITCH_STATUS_FALSE; + } + speak = 1; + } else if (!strcasecmp(tag_name, "pause")) { + const char *ms_ = switch_xml_attr(tag, "milliseconds"); + pause = atoi(ms_); + if (pause < 0) pause = 1000; + } else if (!strcasecmp(tag_name, "playback")) { + sp_engine = switch_xml_attr(tag, "asr-engine"); + sp_grammar = switch_xml_attr(tag, "asr-grammar"); + + if (sp_grammar && sp_engine) { + speech = 1; + } else { + play = 1; + } + } else if (!strcasecmp(tag_name, "vmname")) { + const char *id = switch_xml_attr(tag, "id"); + char *cmd, *resp; + switch_stream_handle_t stream = { 0 }; + char *p; + + SWITCH_STANDARD_STREAM(stream); + + cmd = switch_mprintf("%s|name_path", id); + + switch_api_execute("vm_prefs", cmd, NULL, &stream); + + resp = (char *) stream.data; + + if (!zstr(resp)) { + if (switch_stristr("://", resp) || switch_file_exists(resp, NULL) == SWITCH_STATUS_SUCCESS) { + play = 1; + file = free_string = resp; + resp = NULL; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid file! [%s]\n", resp); + switch_safe_free(resp); + return SWITCH_STATUS_FALSE; + } + } else { + switch_safe_free(resp); + say_lang = switch_xml_attr(tag, "language"); + say_gender = switch_xml_attr(tag, "gender"); + say_type = "name_spelled"; + say_method = "pronounced"; + free_string = strdup(id); + if ((p = strchr(free_string, '@'))) { + *p = '\0'; + } + say = 1; + + body = free_string; + switch_ivr_play_file(client->session, NULL, "voicemail/vm-person.wav", &nullargs); + + } + + switch_safe_free(resp); + } + + + if (zstr(name)) name = "dialed_digits"; + + if (loops_) { + loops = atoi(loops_); + + if (loops < 0) { + loops = -1; + } + } + + if (digit_timeout_) { + tmp = atol(digit_timeout_); + + if (tmp > 0) { + digit_timeout = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid digit timeout [%s]\n", digit_timeout_); + } + } + + if (input_timeout_) { + tmp = atol(input_timeout_); + + if (tmp > 0) { + input_timeout = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid input timeout [%s]\n", input_timeout_); + } + } + + if ((bind = switch_xml_child(tag, "bind"))) { + action_binding_t *action_binding; + const char *realm = "default"; + + + input++; + + top_action_binding = switch_core_session_alloc(client->session, sizeof(*action_binding)); + top_action_binding->client = client; + top_action_binding->action = (char *) action; + top_action_binding->error_file = (char *)error_file; + + switch_ivr_dmachine_create(&dmachine, "HTTAPI", NULL, digit_timeout, 0, + NULL, digit_nomatch_action_callback, top_action_binding); + + while(bind) { + action_binding = switch_core_session_alloc(client->session, sizeof(*action_binding)); + action_binding->realm = (char *) realm; + action_binding->input = bind->txt; + action_binding->client = client; + action_binding->action = (char *) switch_xml_attr(bind, "action"); + action_binding->strip = (char *) switch_xml_attr(bind, "strip"); + action_binding->error_file = (char *) error_file; + action_binding->parent = top_action_binding; + + switch_ivr_dmachine_bind(dmachine, action_binding->realm, action_binding->input, 0, digit_action_callback, action_binding); + bind = bind->next; + } + + switch_ivr_dmachine_set_realm(dmachine, realm); + myargs.dmachine = dmachine; + args = &myargs; + } + + if (zstr(file) && !input) { + file = body; + } + + if (zstr(file) && !(speak || say || pause)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing file attribute!\n"); + switch_channel_hangup(client->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + return SWITCH_STATUS_FALSE; + } + + do { + if (speak) { + status = switch_ivr_speak_text(client->session, tts_engine, tts_voice, (char *)body, args); + } else if (say) { + status = switch_ivr_say(client->session, body, say_lang, say_type, say_method, say_gender, args); + } else if (play) { + status = switch_ivr_play_file(client->session, NULL, file, args); + } else if (speech) { + char *result = NULL; + + status = switch_ivr_play_and_detect_speech(client->session, file, sp_engine, sp_grammar, &result, input_timeout, args); + + if (!zstr(result)) { + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, name, result); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "input_type", "detected_speech"); + submit = 1; + break; + } + + input_timeout = 0; + } else if (pause) { + input_timeout = pause; + status = SWITCH_STATUS_SUCCESS; + } + + if (!switch_channel_ready(client->channel)) { + break; + } + + if (!input && !pause) { + status = switch_channel_ready(client->channel) ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; + submit = 1; + break; + } + + if (input_timeout && status == SWITCH_STATUS_SUCCESS) { + if ((status = switch_ivr_sleep(client->session, input_timeout, SWITCH_TRUE, args)) == SWITCH_STATUS_SUCCESS) { + status = (input || !pause) ? SWITCH_STATUS_BREAK : SWITCH_STATUS_SUCCESS; + } + } + + if (status == SWITCH_STATUS_BREAK) { + if (error_file) { + switch_ivr_play_file(client->session, NULL, error_file, &nullargs); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, name, "invalid"); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "input_type", "invalid"); + status = SWITCH_STATUS_SUCCESS; + } + } else if (status == SWITCH_STATUS_FOUND) { + status = SWITCH_STATUS_SUCCESS; + submit = 1; + break; + } else if (status != SWITCH_STATUS_SUCCESS) { + break; + } + } while (loops-- > 0); + + + if (submit) { + if (client->matching_action_binding) { + if (client->matching_action_binding->match_digits) { + + if (client->matching_action_binding->strip) { + char *pp, *p; + + for(pp = client->matching_action_binding->strip; pp && *pp; pp++) { + if ((p = strchr(client->matching_action_binding->match_digits, *pp))) { + *p = '\0'; + } + } + } + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, name, client->matching_action_binding->match_digits); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "input_type", "dtmf"); + } + + if (client->matching_action_binding->action) { + sub_action = client->matching_action_binding->action; + } else if (client->matching_action_binding->parent && client->matching_action_binding->parent->action) { + sub_action = client->matching_action_binding->parent->action; + } + } + + if (!sub_action && top_action_binding && top_action_binding->action) { + sub_action = top_action_binding->action; + } + + if (sub_action && client->matching_action_binding && client->matching_action_binding->match_digits) { + if (!strncasecmp(sub_action, "dial:", 5)) { + char *context = NULL; + char *dp = NULL; + + if (client->profile->perms.dial.set_context) { + context = switch_core_session_strdup(client->session, sub_action + 5); + + if ((dp = strchr(context, ':'))) { + *dp++ = '\0'; + if (!client->profile->perms.dial.set_dp) { + dp = NULL; + } + } + } + + switch_ivr_session_transfer(client->session, client->matching_action_binding->match_digits, dp, context); + status = SWITCH_STATUS_FALSE; + + } else { + switch_event_add_header_string(client->params, SWITCH_STACK_BOTTOM, "url", sub_action); + } + } + } + + if (dmachine) { + switch_ivr_dmachine_destroy(&dmachine); + } + + switch_safe_free(free_string); + + return status; +} + +static switch_status_t parse_conference(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + char *str; + char *dup, *p; + const char *profile_name = switch_xml_attr(tag, "profile"); + + if (!client->profile->perms.conference.enabled) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Permission Denied!\n"); + switch_channel_hangup(client->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + return SWITCH_STATUS_FALSE; + } + + dup = switch_core_session_strdup(client->session, body); + + if ((p = strchr(dup, '@'))) { + *p = '\0'; + } + + if (zstr(profile_name) || !client->profile->perms.conference.set_profile) { + profile_name = client->profile->conference_params.use_profile; + } + + str = switch_core_session_sprintf(client->session, "%s@%s", dup, profile_name); + switch_core_session_execute_application(client->session, "conference", str); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t parse_dial(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *context = NULL; + const char *dp = NULL; + const char *cid_name = NULL; + const char *cid_number = NULL; + + if (!client->profile->perms.dial.enabled) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Permission Denied!\n"); + switch_channel_hangup(client->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + return SWITCH_STATUS_FALSE; + } + + if (client->profile->perms.dial.set_context) { + context = switch_xml_attr(tag, "context"); + } + + if (client->profile->perms.dial.set_dp) { + dp = switch_xml_attr(tag, "dialplan"); + } + + if (client->profile->perms.dial.set_cid_name) { + cid_name = switch_xml_attr(tag, "caller-id-name"); + } + + if (client->profile->perms.dial.set_cid_number) { + cid_number = switch_xml_attr(tag, "caller-id-number"); + } + + if (client->profile->perms.dial.full_originate && strchr(body, '/')) { + char *str; + + if (!cid_name) { + cid_name = switch_channel_get_variable(client->channel, "caller_id_name"); + } + if (!cid_number) { + cid_number = switch_channel_get_variable(client->channel, "caller_id_number"); + } + + str = switch_core_session_sprintf(client->session, + "{origination_caller_id_name='%s',origination_caller_id_number='%s'}%s", cid_name, cid_number, body); + + switch_core_session_execute_application(client->session, "bridge", str); + } else { + switch_ivr_session_transfer(client->session, body, dp, context); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t parse_sms(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + switch_event_t *event; + const char *from_proto = "httapi"; + const char *to_proto = "sip"; + const char *to = switch_xml_attr(tag, "to"); + + if (to && switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", from_proto); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_proto", to_proto); + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", switch_channel_get_variable(client->channel, "caller_id_number")); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", to); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "text/plain"); + + if (body) { + switch_event_add_body(event, "%s", body); + } + + switch_core_chat_send(to_proto, event); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing 'to' Attribute!\n"); + return SWITCH_STATUS_FALSE; + } + + return SWITCH_STATUS_SUCCESS; +} + +static int check_app_perm(client_t *client, const char *app_name) +{ + if (!client->profile->perms.execute_apps) { + return 0; + } + + return switch_event_check_permission_list(client->profile->dial_params.app_list, app_name); +} + +static switch_status_t parse_execute(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *app_name = switch_xml_attr(tag, "application"); + const char *data = switch_xml_attr(tag, "data"); + + if (zstr(data)) data = body; + + if (zstr(app_name)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid app\n"); + switch_channel_hangup(client->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + return SWITCH_STATUS_FALSE; + } + + if (!check_app_perm(client, app_name)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Permission Denied!\n"); + switch_channel_hangup(client->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + return SWITCH_STATUS_FALSE; + } + + if (!client->profile->perms.expand_vars) { + const char *p; + + for(p = data; p && *p; p++) { + if (*p == '$') { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Expand Variables: Permission Denied!\n"); + switch_channel_hangup(client->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + return SWITCH_STATUS_FALSE; + } + } + } + + switch_core_session_execute_application(client->session, app_name, data); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t parse_hangup(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *cause_str = switch_xml_attr(tag, "cause"); + switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING; + + if (zstr(cause_str)) { + cause_str = body; + } + + if (!zstr(cause_str)) { + cause = switch_channel_str2cause(cause_str); + } + + switch_channel_hangup(client->channel, cause); + + return SWITCH_STATUS_FALSE; +} + +static switch_status_t parse_record_call(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *limit_ = switch_xml_attr(tag, "limit"); + const char *name = switch_xml_attr(tag, "name"); + const char *action = switch_xml_attr(tag, "action"); + const char *record_file; + + int limit = 0; + + if (client->record.file) { + return SWITCH_STATUS_SUCCESS; + } + + if (zstr(name)) name = "recorded_file"; + + if (!strncasecmp(name, "http://", 7)) { + record_file = name; + } else { + client->record.action = (char *) action; + client->record.name = (char *)name; + client->record.file = switch_core_session_sprintf(client->session, "%s%s%s.wav", + SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, switch_core_session_get_uuid(client->session)); + record_file = client->record.file; + } + + if (limit_) { + limit = atoi(limit_); + if (limit < 0) limit = 0; + } + + + switch_ivr_record_session(client->session, (char *)record_file, limit, NULL); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t parse_record(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *file = switch_xml_attr(tag, "file"); + const char *name = switch_xml_attr(tag, "name"); + const char *error_file = switch_xml_attr(tag, "error-file"); + const char *beep_file = switch_xml_attr(tag, "beep-file"); + const char *action = switch_xml_attr(tag, "action"); + const char *sub_action = NULL; + const char *digit_timeout_ = switch_xml_attr(tag, "digit-timeout"); + char *loops_ = (char *) switch_xml_attr(tag, "loops"); + int loops = 0; + switch_status_t status = SWITCH_STATUS_FALSE; + switch_ivr_dmachine_t *dmachine = NULL; + switch_input_args_t *args = NULL, myargs = { 0 }; + long digit_timeout = 1500; + long tmp; + int thresh = 200; + int silence_hits = 2; + int record_limit = 0; + char *tmp_record_path = NULL; + const char *v; + int rtmp; + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + char *fname = NULL; + char *p, *ext = "wav"; + switch_xml_t bind; + action_binding_t *top_action_binding = NULL; + int http = 0; + + switch_uuid_str(uuid_str, sizeof(uuid_str)); + + if (zstr(name)) name = "attached_file"; + + if (zstr(file)) { + return SWITCH_STATUS_FALSE; + } + + fname = switch_core_strdup(client->pool, file); + + for(p = fname; p && *p; p++) { + if (*p == '/' || *p == '\\' || *p == '`') { + *p = '_'; + } + } + + if ((p = strrchr(fname, '.'))) { + *p++ = '\0'; + ext = p; + } + + for(p = fname; p && *p; p++) { + if (*p == '.') { + *p = '_'; + } + } + + if (!strncasecmp(fname, "http://", 7)) { + tmp_record_path = fname; + http = 1; + } else { + tmp_record_path = switch_core_sprintf(client->pool, "%s%s%s_%s.%s", + SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, uuid_str, fname, ext); + } + + if ((v = switch_xml_attr(tag, "limit"))) { + if ((rtmp = atoi(v)) > -1) { + record_limit = rtmp; + } + } + + if ((v = switch_xml_attr(tag, "silence-hits"))) { + if ((rtmp = atoi(v)) > -1) { + silence_hits = rtmp; + } + } + + if ((v = switch_xml_attr(tag, "threshold"))) { + if ((rtmp = atoi(v)) > -1) { + thresh = rtmp; + } + } + + if (loops_) { + loops = atoi(loops_); + + if (loops < 0) { + loops = -1; + } + } + + if (digit_timeout_) { + tmp = atol(digit_timeout_); + + if (tmp > 0) { + digit_timeout = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid digit timeout [%s]\n", digit_timeout_); + } + } + + if ((bind = switch_xml_child(tag, "bind"))) { + action_binding_t *action_binding; + const char *realm = "default"; + + top_action_binding = switch_core_session_alloc(client->session, sizeof(*action_binding)); + top_action_binding->client = client; + top_action_binding->action = (char *) action; + top_action_binding->error_file = (char *)error_file; + + switch_ivr_dmachine_create(&dmachine, "HTTAPI", NULL, digit_timeout, 0, + NULL, digit_nomatch_action_callback, top_action_binding); + + while(bind) { + action_binding = switch_core_session_alloc(client->session, sizeof(*action_binding)); + action_binding->realm = (char *) realm; + action_binding->input = bind->txt; + action_binding->client = client; + action_binding->action = (char *) switch_xml_attr(bind, "action"); + action_binding->error_file = (char *) error_file; + action_binding->parent = top_action_binding; + + switch_ivr_dmachine_bind(dmachine, action_binding->realm, action_binding->input, 0, digit_action_callback, action_binding); + bind = bind->next; + } + + switch_ivr_dmachine_set_realm(dmachine, realm); + myargs.dmachine = dmachine; + args = &myargs; + } + + if (beep_file) { + status = switch_ivr_play_file(client->session, NULL, beep_file, args); + } + + if (!switch_channel_ready(client->channel)) { + goto end; + } + + if (status == SWITCH_STATUS_SUCCESS) { + switch_file_handle_t fh = { 0 }; + fh.thresh = thresh; + fh.silence_hits = silence_hits; + + status = switch_ivr_record_file(client->session, &fh, tmp_record_path, args, record_limit); + } + + if (client->matching_action_binding) { + if (client->matching_action_binding->action) { + sub_action = client->matching_action_binding->action; + } else if (client->matching_action_binding->parent && client->matching_action_binding->parent->action) { + sub_action = client->matching_action_binding->parent->action; + } + } + + if (!sub_action && top_action_binding && top_action_binding->action) { + sub_action = top_action_binding->action; + } + + if (sub_action) { + switch_event_add_header_string(client->params, SWITCH_STACK_BOTTOM, "url", sub_action); + } + + if (!http && !zstr(tmp_record_path) && switch_file_exists(tmp_record_path, client->pool) == SWITCH_STATUS_SUCCESS) { + char *key = switch_core_sprintf(client->pool, "attach_file:%s:%s.%s", name, fname, ext); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, key, tmp_record_path); + } + + end: + + if (dmachine) { + switch_ivr_dmachine_destroy(&dmachine); + } + + return status; +} + +static switch_status_t parse_common(const char *tag_name, client_t *client, switch_xml_t tag, const char *body) +{ + const char *action = switch_xml_attr(tag, "action"); + const char *tmp_action = switch_xml_attr(tag, "temp-action"); + + if (action) { + switch_event_add_header_string(client->params, SWITCH_STACK_BOTTOM, "url", action); + } + + if (tmp_action) { + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "url", tmp_action); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t parse_xml(client_t *client) +{ + switch_status_t status = SWITCH_STATUS_FALSE; + const void *bdata; + switch_size_t len; + int runs = 0; + + if ((len = switch_buffer_peek_zerocopy(client->buffer, &bdata)) && switch_buffer_len(client->buffer) > len) { + switch_xml_t xml, tag, category; + + if (globals.debug) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Debugging Return Data:\n%s\n", (char *)bdata); + } + + if ((xml = switch_xml_parse_str((char *)bdata, len))) { + + if (client->profile->perms.set_params) { + if ((category = switch_xml_child(xml, "params"))) { + tag = category->child; + + while(tag) { + if (!zstr(tag->name)) { + char *val = tag->txt; + if (zstr(val)) { + val = NULL; + } + switch_event_add_header_string(client->params, SWITCH_STACK_BOTTOM, tag->name, val); + } + tag = tag->ordered; + } + } + } + + if (client->profile->perms.set_vars) { + if ((category = switch_xml_child(xml, "variables"))) { + tag = category->child; + + while(tag) { + if (!zstr(tag->name)) { + char *val = tag->txt; + if (zstr(val)) { + val = NULL; + } + + if (client->profile->perms.set_vars && + (!client->profile->var_params.set_var_list || + switch_event_check_permission_list(client->profile->var_params.set_var_list, tag->name))) { + switch_channel_set_variable(client->channel, tag->name, val); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "variable %s permission denied!\n", tag->name); + } + } + tag = tag->ordered; + } + } + } + + if ((category = switch_xml_child(xml, "work"))) { + + tag = category->child; + status = SWITCH_STATUS_SUCCESS; + + while(status == SWITCH_STATUS_SUCCESS && tag) { + if (!zstr(tag->name)) { + tag_parse_t handler; + + if ((handler = (tag_parse_t)(intptr_t) switch_core_hash_find(globals.parse_hash, tag->name))) { + char *expanded = tag->txt; + switch_event_t *templ_data; + + if (tag->txt && client->profile->perms.expand_vars) { + 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); + switch_event_destroy(&templ_data); + } + + runs++; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Process Tag: [%s]\n", tag->name); + + parse_common(tag->name, client, tag, expanded); + status = handler(tag->name, client, tag, expanded); + + if (expanded && expanded != tag->txt) { + free(expanded); + } + + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unsupported Tag: [%s]\n", tag->name); + status = SWITCH_STATUS_FALSE; + } + + } + tag = tag->ordered; + } + } + + if (!runs) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No instructions found in result!\n"); + status = SWITCH_STATUS_FALSE; + } + + + switch_xml_free(xml); + } + } + + return status; +} + + +static size_t get_header_callback(void *ptr, size_t size, size_t nmemb, void *userdata) +{ + size_t realsize = (size * nmemb); + char *val, *header = NULL; + client_t *client = userdata; + + /* validate length... Apache and IIS won't send a header larger than 16 KB */ + if (realsize == 0 || realsize > 1024 * 16) { + return realsize; + } + + /* get the header, adding NULL terminator if there isn't one */ + switch_zmalloc(header, realsize + 1); + strncpy(header, (char *)ptr, realsize); + + if ((val = strchr(header, ':'))) { + char *cr; + *val++ = '\0'; + while(*val == ' ') val++; + + if ((cr = strchr(val, '\r')) || (cr = strchr(val, '\r'))) { + *cr = '\0'; + } + + switch_event_add_header_string(client->headers, SWITCH_STACK_BOTTOM, header, val); + } + + switch_safe_free(header); + return realsize; +} + + +static size_t file_callback(void *ptr, size_t size, size_t nmemb, void *data) +{ + register unsigned int realsize = (unsigned int) (size * nmemb); + client_t *client = data; + + client->bytes += realsize; + + if (client->bytes > client->max_bytes) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Oversized file detected [%d bytes]\n", (int) client->bytes); + client->err = 1; + return 0; + } + + switch_buffer_write(client->buffer, ptr, realsize); + + return realsize; +} + +static void client_destroy(client_t **client) +{ + if (client && *client) { + switch_memory_pool_t *pool; + + switch_event_destroy(&(*client)->headers); + switch_event_destroy(&(*client)->params); + switch_event_destroy(&(*client)->one_time_params); + switch_buffer_destroy(&(*client)->buffer); + + pool = (*client)->pool; + switch_core_destroy_memory_pool(&pool); + } +} + +static void client_reset(client_t *client) +{ + if (client->headers) { + switch_event_destroy(&client->headers); + } + + switch_event_destroy(&client->one_time_params); + switch_event_create(&client->one_time_params, SWITCH_EVENT_CLONE); + client->one_time_params->flags |= EF_UNIQ_HEADERS; + + switch_event_create(&client->headers, SWITCH_EVENT_CLONE); + + + switch_buffer_zero(client->buffer); + + client->code = 0; + client->err = 0; + client->matching_action_binding = NULL; + client->no_matching_action_binding = NULL; +} + +static client_t *client_create(switch_core_session_t *session, const char *profile_name, switch_event_t **params) +{ + client_t *client; + switch_memory_pool_t *pool; + client_profile_t *profile; + + if (zstr(profile_name)) { + profile_name = "default"; + } + + profile = (client_profile_t *) switch_core_hash_find(globals.profile_hash, profile_name); + + if (!profile) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find profile [%s]\n", profile_name); + return NULL; + } + + switch_core_new_memory_pool(&pool); + client = switch_core_alloc(pool, sizeof(*client)); + client->pool = pool; + + switch_event_create(&client->headers, SWITCH_EVENT_CLONE); + + if (session) { + client->session = session; + client->channel = switch_core_session_get_channel(session); + } + + + client->profile = profile; + + client->max_bytes = HTTAPI_MAX_API_BYTES; + + switch_buffer_create_dynamic(&client->buffer, 1024, 1024, 0); + + if (params && *params) { + client->params = *params; + *params = NULL; + } else { + switch_event_create(&client->params, SWITCH_EVENT_CLONE); + client->params->flags |= EF_UNIQ_HEADERS; + } + + switch_event_create(&client->one_time_params, SWITCH_EVENT_CLONE); + client->one_time_params->flags |= EF_UNIQ_HEADERS; + + switch_event_add_header_string(client->params, SWITCH_STACK_BOTTOM, "hostname", switch_core_get_switchname()); + + return client; +} + + +static void cleanup_attachments(client_t *client) +{ + switch_event_header_t *hp; + + for (hp = client->params->headers; hp; hp = hp->next) { + if (!strncasecmp(hp->name, "attach_file:", 12)) { + if (switch_file_exists(hp->value, client->pool)) { + printf("DELETE %s\n", hp->value); + unlink(hp->value); + } + } + } +} + +size_t put_file_read( void *ptr, size_t size, size_t nmemb, void *userdata) +{ + return fread(ptr, size, nmemb, (FILE *) userdata); +} + +static switch_status_t httapi_sync(client_t *client) + +{ + switch_CURL *curl_handle = NULL; + char *data = NULL; + switch_curl_slist_t *headers = NULL; + char *url = NULL; + char *dynamic_url = NULL, *use_url = NULL; + const char *session_id = NULL; + switch_status_t status = SWITCH_STATUS_FALSE; + int get_style_method = 0; + char *method = NULL; + struct curl_httppost *formpost=NULL; + switch_event_t *save_params = NULL; + const char *put_file; + FILE *fd = NULL; + char *creds, *dup_creds = NULL, *ua = NULL; + + + if (client->one_time_params && client->one_time_params->headers) { + save_params = client->params; + switch_event_dup(&client->params, save_params); + switch_event_merge(client->params, client->one_time_params); + switch_event_destroy(&client->one_time_params); + switch_event_create(&client->one_time_params, SWITCH_EVENT_CLONE); + client->one_time_params->flags |= EF_UNIQ_HEADERS; + } + + + ua = switch_event_get_header(client->params, "user_agent"); + + if (zstr(ua)) { + ua = client->profile->ua; + } + + if (!(session_id = switch_event_get_header(client->params, "HTTAPI_SESSION_ID"))) { + if (client->channel && !(session_id = switch_channel_get_variable(client->channel, "HTTAPI_SESSION_ID"))) { + session_id = switch_core_session_get_uuid(client->session); + } + } + + if (client->code || client->err) { + client_reset(client); + } + + + if (!(method = switch_event_get_header(client->params, "method"))) { + method = client->profile->method; + } + + if (!(url = switch_event_get_header(client->params, "url"))) { + url = client->profile->url; + switch_event_add_header_string(client->params, SWITCH_STACK_BOTTOM, "url", url); + } + + get_style_method = method ? strcasecmp(method, "post") : 1; + + switch_event_add_header_string(client->params, SWITCH_STACK_TOP, "session_id", session_id); + + dynamic_url = switch_event_expand_headers(client->params, url); + + if ((put_file = switch_event_get_header(client->params, "put_file"))) { + if (!(fd = fopen(put_file, "rb"))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Can't open [%s]\n", put_file); + put_file = NULL; + } + } + + if (!put_file) { + switch_curl_process_form_post_params(client->params, curl_handle, &formpost); + get_style_method = 1; + } + + if (formpost) { + get_style_method = 1; + } else { + data = switch_event_build_param_string(client->params, NULL, client->profile->vars_map); + switch_assert(data); + + if (get_style_method) { + char *tmp = switch_mprintf("%s%c%s", dynamic_url, strchr(dynamic_url, '?') != NULL ? '&' : '?', data); + + if (dynamic_url != url) { + free(dynamic_url); + } + + dynamic_url = tmp; + } + } + + + if ((use_url = strchr(dynamic_url, '@'))) { + char *r, *q, *p = strstr(dynamic_url, "://"); + use_url++; + + dup_creds = strdup(p+3); + + if ((q = strchr(dup_creds, '@'))) *q = '\0'; + + q = strdup(url); + r = strchr(q, '@'); + r++; + + if ((p = strstr(q, "://"))) { + *(p+3) = '\0'; + } + + p = switch_mprintf("%s%s", q, r); + free(dynamic_url); + dynamic_url = p; + free(q); + } + + + if ((use_url = strchr(dynamic_url, '@'))) { + char *q, *p = strstr(dynamic_url, "://"); + use_url++; + + dup_creds = strdup(p+3); + *p = '\0'; + + if ((q = strchr(dup_creds, '@'))) *q = '\0'; + + creds = dup_creds; + + p = switch_mprintf("%s%s", p, use_url); + free(dynamic_url); + dynamic_url = p; + } else { + creds = client->profile->cred; + } + + curl_handle = switch_curl_easy_init(); + + if (session_id) { + char *hval = switch_mprintf("HTTAPI_SESSION_ID=%s", session_id); + switch_curl_easy_setopt(curl_handle, CURLOPT_COOKIE, hval); + free(hval); + } + + if (!strncasecmp(dynamic_url, "https", 5)) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0); + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0); + } + + + if (!zstr(creds)) { + switch_curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, client->profile->auth_scheme); + switch_curl_easy_setopt(curl_handle, CURLOPT_USERPWD, creds); + } + + if (client->profile->disable100continue) { + headers = switch_curl_slist_append(headers, "Expect:"); + } + + if (client->profile->enable_cacert_check) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, TRUE); + } + + switch_curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers); + + if (method != NULL && strcasecmp(method, "get") && strcasecmp(method, "post")) { + switch_curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, method); + } + + if (put_file) { + curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, 1L); + curl_easy_setopt(curl_handle, CURLOPT_READDATA, fd); + curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, put_file_read); + + } else if (formpost) { + curl_easy_setopt(curl_handle, CURLOPT_HTTPPOST, formpost); + } else { + switch_curl_easy_setopt(curl_handle, CURLOPT_POST, !get_style_method); + } + + switch_curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); + switch_curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10); + + if (!get_style_method && !formpost) { + switch_curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, data); + } + + switch_curl_easy_setopt(curl_handle, CURLOPT_URL, dynamic_url); + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, file_callback); + switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, get_header_callback); + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) client); + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, (void *) client); + switch_curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, ua); + + if (client->profile->timeout) { + switch_curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, client->profile->timeout); + switch_curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1); + } + + if (client->profile->ssl_cert_file) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSLCERT, client->profile->ssl_cert_file); + } + + if (client->profile->ssl_key_file) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSLKEY, client->profile->ssl_key_file); + } + + if (client->profile->ssl_key_password) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSLKEYPASSWD, client->profile->ssl_key_password); + } + + if (client->profile->ssl_version) { + if (!strcasecmp(client->profile->ssl_version, "SSLv3")) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3); + } else if (!strcasecmp(client->profile->ssl_version, "TLSv1")) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); + } + } + + if (client->profile->ssl_cacert_file) { + switch_curl_easy_setopt(curl_handle, CURLOPT_CAINFO, client->profile->ssl_cacert_file); + } + + if (client->profile->enable_ssl_verifyhost) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 2); + } + + if (client->profile->cookie_file) { + switch_curl_easy_setopt(curl_handle, CURLOPT_COOKIEJAR, client->profile->cookie_file); + switch_curl_easy_setopt(curl_handle, CURLOPT_COOKIEFILE, client->profile->cookie_file); + } + + if (client->profile->bind_local) { + curl_easy_setopt(curl_handle, CURLOPT_INTERFACE, client->profile->bind_local); + } + + + switch_curl_easy_perform(curl_handle); + switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &client->code); + switch_curl_easy_cleanup(curl_handle); + switch_curl_slist_free_all(headers); + + if (formpost) { + curl_formfree(formpost); + } + + if (client->err) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error encountered! [%s]\ndata: [%s]\n", client->profile->url, data); + status = SWITCH_STATUS_FALSE; + } else { + status = SWITCH_STATUS_SUCCESS; + } + + switch_safe_free(data); + switch_safe_free(dup_creds); + + if (dynamic_url != url) { + switch_safe_free(dynamic_url); + } + + cleanup_attachments(client); + + if (save_params) { + switch_event_destroy(&client->params); + client->params = save_params; + save_params = NULL; + } + + if (fd) { + fclose(fd); + } + + return status; +} + +#define ENABLE_PARAM_VALUE "enabled" +static switch_status_t do_config(void) +{ + char *cf = "httapi.conf"; + switch_xml_t cfg, xml, profiles_tag, profile_tag, param, settings, tag; + client_profile_t *profile = 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 ((settings = switch_xml_child(cfg, "settings"))) { + for (param = switch_xml_child(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")) { + globals.debug = switch_true(val); + } else if (!strcasecmp(var, "file-cache-ttl")) { + int tmp = atoi(val); + + if (tmp > -1) { + globals.cache_ttl = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid value [%s]for file-cache-ttl\n", val); + } + + } else if (!strcasecmp(var, "file-not-found-expires")) { + globals.not_found_expires = atoi(val); + + if (globals.not_found_expires < 0) { + globals.not_found_expires = -1; + } + } + } + } + + if (!(profiles_tag = switch_xml_child(cfg, "profiles"))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing tag!\n"); + goto done; + } + + for (profile_tag = switch_xml_child(profiles_tag, "profile"); profile_tag; profile_tag = profile_tag->next) { + char *bname = (char *) switch_xml_attr_soft(profile_tag, "name"); + char *url = NULL; + char *bind_local = NULL; + char *bind_cred = NULL; + char *method = NULL; + int disable100continue = 1; + int timeout = 0; + uint32_t enable_cacert_check = 0; + char *ssl_cert_file = NULL; + char *ssl_key_file = NULL; + char *ssl_key_password = NULL; + char *ssl_version = NULL; + char *ssl_cacert_file = NULL; + uint32_t enable_ssl_verifyhost = 0; + char *cookie_file = NULL; + char *ua = "mod_httapi/1.0"; + hash_node_t *hash_node; + int auth_scheme = CURLAUTH_BASIC; + need_vars_map = 0; + vars_map = NULL; + + if (zstr(bname)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "profile tag missing name field!\n"); + continue; + } + + if (switch_core_hash_find(globals.profile_hash, bname)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile %s already exists\n", (char *)bname); + continue; + } + + if ((tag = switch_xml_child(profile_tag, "params"))) { + for (param = switch_xml_child(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, "gateway-url")) { + if (val) { + url = val; + } + } else if (!strcasecmp(var, "user-agent")) { + ua = val; + } else if (!strcasecmp(var, "gateway-credentials")) { + bind_cred = val; + } else if (!strcasecmp(var, "auth-scheme")) { + if (*val == '=') { + auth_scheme = 0; + val++; + } + + if (!strcasecmp(val, "basic")) { + auth_scheme |= CURLAUTH_BASIC; + } else if (!strcasecmp(val, "digest")) { + auth_scheme |= CURLAUTH_DIGEST; + } else if (!strcasecmp(val, "NTLM")) { + auth_scheme |= CURLAUTH_NTLM; + } else if (!strcasecmp(val, "GSS-NEGOTIATE")) { + auth_scheme |= CURLAUTH_GSSNEGOTIATE; + } else if (!strcasecmp(val, "any")) { + auth_scheme = CURLAUTH_ANY; + } + } else if (!strcasecmp(var, "disable-100-continue") && !switch_true(val)) { + disable100continue = 0; + } else if (!strcasecmp(var, "method")) { + method = 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-cacert-check") && switch_true(val)) { + enable_cacert_check = 1; + } else if (!strcasecmp(var, "ssl-cert-path")) { + ssl_cert_file = val; + } else if (!strcasecmp(var, "ssl-key-path")) { + ssl_key_file = val; + } else if (!strcasecmp(var, "ssl-key-password")) { + ssl_key_password = val; + } else if (!strcasecmp(var, "ssl-version")) { + ssl_version = val; + } else if (!strcasecmp(var, "ssl-cacert-file")) { + ssl_cacert_file = val; + } else if (!strcasecmp(var, "enable-ssl-verifyhost") && switch_true(val)) { + enable_ssl_verifyhost = 1; + } else if (!strcasecmp(var, "cookie-file")) { + cookie_file = val; + } 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, "bind-local")) { + bind_local = val; + } + } + } + + if (!url) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile has no url!\n"); + if (vars_map) + switch_core_hash_destroy(&vars_map); + continue; + } + + if (!(profile = switch_core_alloc(globals.pool, sizeof(*profile)))) { + if (vars_map) + switch_core_hash_destroy(&vars_map); + goto done; + } + memset(profile, 0, sizeof(*profile)); + + + /* Defaults */ + profile->ua = ua; + profile->conference_params.use_profile = "default"; + profile->perms.set_params = 1; + profile->perms.conference.enabled = 1; + profile->perms.dial.enabled = 1; + + + if ((tag = switch_xml_child(profile_tag, "conference"))) { + for (param = switch_xml_child(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, "default-profile")) { + profile->conference_params.use_profile = switch_core_strdup(globals.pool, val); + } + } + } + + if ((tag = switch_xml_child(profile_tag, "dial"))) { + for (param = switch_xml_child(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, "context")) { + profile->dial_params.context = switch_core_strdup(globals.pool, val); + } else if (!strcasecmp(var, "dialplan")) { + profile->dial_params.dp = switch_core_strdup(globals.pool, val); + } + } + } + + if ((tag = switch_xml_child(profile_tag, "permissions"))) { + for (param = switch_xml_child(tag, "permission"); 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, "all")) { + switch_byte_t all = switch_true(val); + memset(&profile->perms, all, sizeof(profile->perms)); + } else if (!strcasecmp(var, "none")) { + switch_byte_t none = switch_true(val); + memset(&profile->perms, none, sizeof(profile->perms)); + } else if (!strcasecmp(var, "set-params")) { + profile->perms.set_params = switch_true(val); + } else if (!strcasecmp(var, "set-vars")) { + profile->perms.set_vars = switch_true(val); + + if (profile->perms.set_vars) { + switch_xml_t x_list, x_var; + if ((x_list = switch_xml_child(param, "variable-list"))) { + char *var = (char *) switch_xml_attr_soft(param, "default"); + + profile->var_params.default_allow = (var && !strcasecmp(var, "allow")); + switch_event_create(&profile->var_params.set_var_list, SWITCH_EVENT_CLONE); + profile->var_params.set_var_list->flags |= EF_UNIQ_HEADERS; + if (profile->var_params.default_allow) { + profile->var_params.set_var_list->flags |= EF_DEFAULT_ALLOW; + } + + + for (x_var = switch_xml_child(x_list, "variable"); x_var; x_var = x_var->next) { + const char *name = switch_xml_attr(x_var, "name"); + const char *type = switch_xml_attr(x_var, "type"); + + if (zstr(type)) type = profile->var_params.default_allow ? "deny" : "allow"; + + if (name) { + switch_event_add_header_string(profile->var_params.set_var_list, SWITCH_STACK_BOTTOM, name, type); + } + } + } + } + } else if (!strcasecmp(var, "get-vars")) { + profile->perms.get_vars = switch_true(val); + + if (profile->perms.get_vars) { + switch_xml_t x_list, x_var; + if ((x_list = switch_xml_child(param, "variable-list"))) { + char *var = (char *) switch_xml_attr_soft(param, "default"); + + profile->var_params.default_allow = (var && !strcasecmp(var, "allow")); + switch_event_create(&profile->var_params.get_var_list, SWITCH_EVENT_CLONE); + profile->var_params.get_var_list->flags |= EF_UNIQ_HEADERS; + if (profile->var_params.default_allow) { + profile->var_params.get_var_list->flags |= EF_DEFAULT_ALLOW; + } + + + for (x_var = switch_xml_child(x_list, "variable"); x_var; x_var = x_var->next) { + const char *name = switch_xml_attr(x_var, "name"); + const char *type = switch_xml_attr(x_var, "type"); + + if (zstr(type)) type = profile->var_params.default_allow ? "deny" : "allow"; + + if (name) { + switch_event_add_header_string(profile->var_params.get_var_list, SWITCH_STACK_BOTTOM, name, type); + } + } + } + } + } else if (!strcasecmp(var, "extended-data")) { + profile->perms.extended_data = switch_true(val); + } else if (!strcasecmp(var, "execute-apps")) { + profile->perms.execute_apps = switch_true(val); + + if (profile->perms.execute_apps) { + switch_xml_t x_list, x_app; + if ((x_list = switch_xml_child(param, "application-list"))) { + char *var = (char *) switch_xml_attr_soft(param, "default"); + + profile->dial_params.default_allow = (var && !strcasecmp(var, "allow")); + switch_event_create(&profile->dial_params.app_list, SWITCH_EVENT_CLONE); + profile->dial_params.app_list->flags |= EF_UNIQ_HEADERS; + if (profile->dial_params.default_allow) { + profile->dial_params.app_list->flags |= EF_DEFAULT_ALLOW; + } + + + for (x_app = switch_xml_child(x_list, "application"); x_app; x_app = x_app->next) { + const char *name = switch_xml_attr(x_app, "name"); + const char *type = switch_xml_attr(x_app, "type"); + + if (zstr(type)) type = profile->dial_params.default_allow ? "deny" : "allow"; + + if (name) { + switch_event_add_header_string(profile->dial_params.app_list, SWITCH_STACK_BOTTOM, name, type); + } + } + } + } + + } else if (!strcasecmp(var, "expand-vars")) { + profile->perms.expand_vars = switch_true(val); + + if (profile->perms.expand_vars) { + switch_xml_t x_list, x_var, x_api; + if ((x_list = switch_xml_child(param, "variable-list"))) { + char *var = (char *) switch_xml_attr_soft(param, "default"); + + profile->var_params.default_allow = (var && !strcasecmp(var, "allow")); + switch_event_create(&profile->var_params.expand_var_list, SWITCH_EVENT_CLONE); + profile->var_params.expand_var_list->flags |= EF_UNIQ_HEADERS; + if (profile->var_params.default_allow) { + profile->var_params.expand_var_list->flags |= EF_DEFAULT_ALLOW; + } + + + for (x_var = switch_xml_child(x_list, "variable"); x_var; x_var = x_var->next) { + const char *name = switch_xml_attr(x_var, "name"); + const char *type = switch_xml_attr(x_var, "type"); + + if (zstr(type)) type = profile->var_params.default_allow ? "deny" : "allow"; + + if (name) { + switch_event_add_header_string(profile->var_params.expand_var_list, SWITCH_STACK_BOTTOM, name, type); + } + } + } + + if ((x_list = switch_xml_child(param, "api-list"))) { + char *api = (char *) switch_xml_attr_soft(param, "default"); + + profile->var_params.default_allow = (api && !strcasecmp(api, "allow")); + switch_event_create(&profile->var_params.api_list, SWITCH_EVENT_CLONE); + profile->var_params.api_list->flags |= EF_UNIQ_HEADERS; + if (profile->var_params.default_allow) { + profile->var_params.api_list->flags |= EF_DEFAULT_ALLOW; + } + + + for (x_api = switch_xml_child(x_list, "api"); x_api; x_api = x_api->next) { + const char *name = switch_xml_attr(x_api, "name"); + const char *type = switch_xml_attr(x_api, "type"); + + if (zstr(type)) type = profile->var_params.default_allow ? "deny" : "allow"; + + if (name) { + switch_event_add_header_string(profile->var_params.api_list, SWITCH_STACK_BOTTOM, name, type); + } + } + } + } + + } else if (!strcasecmp(var, "dial")) { + profile->perms.dial.enabled = switch_true(val); + } else if (!strcasecmp(var, "dial-set-context")) { + profile->perms.dial.enabled = switch_true(val); + profile->perms.dial.set_context = switch_true(val); + } else if (!strcasecmp(var, "dial-set-dialplan")) { + profile->perms.dial.enabled = switch_true(val); + profile->perms.dial.set_dp = switch_true(val); + } else if (!strcasecmp(var, "dial-set-cid-name")) { + profile->perms.dial.enabled = switch_true(val); + profile->perms.dial.set_cid_name = switch_true(val); + } else if (!strcasecmp(var, "dial-set-cid-number")) { + profile->perms.dial.enabled = switch_true(val); + profile->perms.dial.set_cid_number = switch_true(val); + } else if (!strcasecmp(var, "dial-full-originate")) { + profile->perms.dial.enabled = switch_true(val); + profile->perms.dial.full_originate = switch_true(val); + } else if (!strcasecmp(var, "conference")) { + profile->perms.conference.enabled = switch_true(val); + } else if (!strcasecmp(var, "conference-set-profile")) { + profile->perms.conference.enabled = switch_true(val); + profile->perms.conference.set_profile = switch_true(val); + } + + } + } + + + + profile->auth_scheme = auth_scheme; + profile->timeout = timeout; + profile->url = strdup(url); + switch_assert(profile->url); + + if (bind_local != NULL) { + profile->bind_local = strdup(bind_local); + } + if (method != NULL) { + profile->method = strdup(method); + } else { + profile->method = NULL; + } + + if (bind_cred) { + profile->cred = strdup(bind_cred); + } + + profile->disable100continue = disable100continue; + profile->enable_cacert_check = enable_cacert_check; + + if (ssl_cert_file) { + profile->ssl_cert_file = strdup(ssl_cert_file); + } + + if (ssl_key_file) { + profile->ssl_key_file = strdup(ssl_key_file); + } + + if (ssl_key_password) { + profile->ssl_key_password = strdup(ssl_key_password); + } + + if (ssl_version) { + profile->ssl_version = strdup(ssl_version); + } + + if (ssl_cacert_file) { + profile->ssl_cacert_file = strdup(ssl_cacert_file); + } + + profile->enable_ssl_verifyhost = enable_ssl_verifyhost; + + if (cookie_file) { + profile->cookie_file = strdup(cookie_file); + } + + profile->vars_map = vars_map; + + 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, "Profile [%s] JSON Function [%s]\n", + zstr(bname) ? "N/A" : bname, profile->url); + + profile->name = strdup(bname); + + switch_core_hash_insert(globals.profile_hash, bname, profile); + + x++; + profile = NULL; + } + + done: + + switch_xml_free(xml); + + return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; +} + +static switch_status_t my_on_reporting(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_status_t status = SWITCH_STATUS_SUCCESS; + client_t *client; + const char *var; + + if (!(client = (client_t *) switch_channel_get_private(channel, "_HTTAPI_CLIENT_"))) { + return status; + } + + switch_channel_set_private(channel, "_HTTAPI_CLIENT_", NULL); + + if (client->profile->perms.extended_data) { + switch_channel_event_set_extended_data(channel, client->one_time_params); + } + + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "exiting", "true"); + + if (client->record.file) { + char *key = switch_core_sprintf(client->pool, "attach_file:%s:%s.wav", client->record.name, switch_core_session_get_uuid(session)); + switch_ivr_stop_record_session(client->session, client->record.file); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, key, client->record.file); + } + + var = switch_event_get_header(client->params, "url"); + + if (client->record.action) { + if (strcmp(var, client->record.action)) { + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "url", client->record.action); + httapi_sync(client); + if (client->profile->perms.extended_data) { + switch_channel_event_set_extended_data(channel, client->one_time_params); + } + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "exiting", "true"); + } + } + + httapi_sync(client); + + client_destroy(&client); + + return status; +} + +static switch_state_handler_table_t state_handlers = { + /*.on_init */ NULL, + /*.on_routing */ NULL, + /*.on_execute */ NULL, + /*.on_hangup */ NULL, + /*.on_exchange_media */ NULL, + /*.on_soft_execute */ NULL, + /*.on_consume_media */ NULL, + /*.on_hibernate */ NULL, + /*.on_reset */ NULL, + /*.on_park */ NULL, + /*.on_reporting */ my_on_reporting, + /*.on_destroy */ NULL, + SSH_FLAG_STICKY +}; + + +SWITCH_STANDARD_APP(httapi_function) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + char *parsed = NULL; + const char *profile_name = NULL, *url = NULL; + client_t *client; + switch_event_t *params = NULL; + uint32_t loops = 0, all_extended = 0; + switch_caller_profile_t *caller_profile; + + if (!zstr(data)) { + switch_event_create_brackets((char *)data, '{', '}', ',', ¶ms, &parsed, SWITCH_TRUE); + + if (params) { + url = parsed; + } else { + url = data; + } + + if (!zstr(url) && switch_stristr("://", url)) { + if (!params) { + switch_event_create(¶ms, SWITCH_EVENT_CLONE); + } + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "url", url); + } + } + + if ((client = (client_t *) switch_channel_get_private(channel, "_HTTAPI_CLIENT_"))) { + if (params) { + switch_event_merge(client->params, params); + switch_event_destroy(¶ms); + } + } else { + if (params) { + profile_name = switch_event_get_header(params, "httapi_profile"); + } + + if (zstr(profile_name) && !(profile_name = switch_channel_get_variable(channel, "httapi_profile"))) { + profile_name = "default"; + } + + if ((client = client_create(session, profile_name, ¶ms))) { + switch_channel_set_private(channel, "_HTTAPI_CLIENT_", client); + switch_channel_add_state_handler(channel, &state_handlers); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find suitable profile\n"); + switch_event_destroy(¶ms); + return; + } + } + + if (client->profile->perms.extended_data) { + all_extended = switch_true(switch_event_get_header(client->params, "full_channel_data_on_every_req")); + } + + if ((caller_profile = switch_channel_get_caller_profile(channel))) { + switch_caller_profile_event_set_data(caller_profile, "Caller", client->params); + } + + while(switch_channel_ready(channel)) { + switch_status_t status = SWITCH_STATUS_FALSE; + + if (client->profile->perms.extended_data && (!loops++ || all_extended)) { + switch_channel_event_set_extended_data(channel, client->one_time_params); + } + + if ((status = httapi_sync(client)) == SWITCH_STATUS_SUCCESS) { + if (client->code == 200) { + const char *ct = switch_event_get_header(client->headers, "content-type"); + + if (switch_stristr("text/xml", ct)) { + status = parse_xml(client); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received unsupported content-type %s\n", ct); + break; + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received HTTP response: %ld.\n", client->code); + break; + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error %d!\n", client->err); + } + + if (status == SWITCH_STATUS_TERM) { + httapi_sync(client); + } + + if (status != SWITCH_STATUS_SUCCESS) { + break; + } + } + + + switch_safe_free(parsed); + +} + + +/* HTTP FILE INTERFACE */ + +static char *load_cache_data(http_file_context_t *context, const char *url) +{ + char *ext = NULL; + char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 }; + char meta_buffer[1024] = ""; + int fd; + switch_ssize_t bytes; + + switch_md5_string(digest, (void *) url, strlen(url)); + + if (context->url_params) { + ext = switch_event_get_header(context->url_params, "ext"); + } + + if (zstr(ext)) { + if ((ext = strrchr(url, '.'))) { + ext++; + } else { + ext = "wav"; + } + } + + context->cache_file = switch_core_sprintf(context->pool, "%s%s%s.%s", globals.cache_path, SWITCH_PATH_SEPARATOR, digest, ext); + context->meta_file = switch_core_sprintf(context->pool, "%s.meta", context->cache_file); + context->lock_file = switch_core_sprintf(context->pool, "%s.lock", context->cache_file); + + if (switch_file_exists(context->meta_file, context->pool) == SWITCH_STATUS_SUCCESS && ((fd = open(context->meta_file, O_RDONLY, 0)) > -1)) { + if ((bytes = read(fd, meta_buffer, sizeof(meta_buffer))) > 0) { + char *p; + + if ((p = strchr(meta_buffer, ':'))) { + *p++ = '\0'; + context->expires = (time_t) atol(meta_buffer); + context->metadata = switch_core_strdup(context->pool, p); + } + } + close(fd); + } + + return context->cache_file; +} + +static size_t save_file_callback(void *ptr, size_t size, size_t nmemb, void *data) +{ + register unsigned int realsize = (unsigned int) (size * nmemb); + client_t *client = data; + int x; + + client->bytes += realsize; + + + + if (client->bytes > client->max_bytes) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Oversized file detected [%d bytes]\n", (int) client->bytes); + client->err = 1; + return 0; + } + + x = write(client->fd, ptr, realsize); + + if (x != (int) realsize) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write! %d out of %d\n", x, realsize); + } + return x; +} + + + +static switch_status_t fetch_cache_data(http_file_context_t *context, const char *url, switch_event_t **headers, const char *save_path) +{ + switch_CURL *curl_handle = NULL; + client_t client = { 0 }; + long code; + switch_status_t status = SWITCH_STATUS_FALSE; + char *dup_creds = NULL, *dynamic_url = NULL, *use_url; + char *ua = NULL; + + client.fd = -1; + + if (save_path) { + if ((client.fd = open(save_path, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) < 0) { + return SWITCH_STATUS_FALSE; + } + } + + if (context->url_params) { + ua = switch_event_get_header(context->url_params, "user_agent"); + } + + if (zstr(ua)) { + ua = "mod_httapi/1.0"; + } + + if ((use_url = strchr(url, '@'))) { + char *r, *q, *p = strstr(url, "://"); + use_url++; + + dup_creds = strdup(p+3); + + if ((q = strchr(dup_creds, '@'))) *q = '\0'; + + q = strdup(url); + r = strchr(q, '@'); + r++; + + if ((p = strstr(q, "://"))) { + *(p+3) = '\0'; + } + + p = switch_mprintf("%s%s", q, r); + dynamic_url = p; + free(q); + url = dynamic_url; + } + + curl_handle = switch_curl_easy_init(); + + switch_curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1); + + if (!strncasecmp(url, "https", 5)) { + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0); + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0); + } + + client.max_bytes = HTTAPI_MAX_FILE_BYTES; + + 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_URL, url); + + if (save_path) { + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, save_file_callback); + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &client); + } else { + switch_curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1); + switch_curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1); + } + + if (headers) { + switch_event_create(&client.headers, SWITCH_EVENT_CLONE); + if (save_path) { + switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, get_header_callback); + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, (void *) &client); + } else { + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, get_header_callback); + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &client); + } + } + + if (!zstr(dup_creds)) { + switch_curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + switch_curl_easy_setopt(curl_handle, CURLOPT_USERPWD, dup_creds); + } + + switch_curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, ua); + switch_curl_easy_perform(curl_handle); + switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &code); + switch_curl_easy_cleanup(curl_handle); + + if (client.fd > -1) { + close(client.fd); + } + + if (headers && client.headers) { + switch_event_add_header(client.headers, SWITCH_STACK_BOTTOM, "http-response-code", "%ld", code); + *headers = client.headers; + } + + switch(code) { + case 200: + if (save_path) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "caching: url:%s to %s (%" SWITCH_SIZE_T_FMT " bytes)\n", url, save_path, client.bytes); + } + status = SWITCH_STATUS_SUCCESS; + break; + + case 404: + status = SWITCH_STATUS_NOTFOUND; + break; + + default: + status = SWITCH_STATUS_FALSE; + break; + } + + switch_safe_free(dynamic_url); + switch_safe_free(dup_creds); + + + return status; +} + +static switch_status_t write_meta_file(http_file_context_t *context, const char *data, switch_event_t *headers) +{ + int fd; + switch_status_t status = SWITCH_STATUS_SUCCESS; + char write_data[1024]; + + if ((fd = open(context->meta_file, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) < 0) { + return SWITCH_STATUS_FALSE; + } + + if (!zstr(data)) { + int ttl = globals.cache_ttl; + const char *cc; + const char *p; + + if (headers && (cc = switch_event_get_header(headers, "Cache-Control"))) { + if ((p = switch_stristr("max-age=", cc))) { + p += 8; + + if (!zstr(p)) { + ttl = atoi(p); + if (ttl < 0) ttl = globals.cache_ttl; + } + } + + if (switch_stristr("no-cache", cc) || switch_stristr("no-store", cc)) { + context->del_on_close = 1; + } + } + + switch_snprintf(write_data, sizeof(write_data), + "%" SWITCH_TIME_T_FMT ":%s", + switch_epoch_time_now(NULL) + ttl, + data); + + + status = write(fd, write_data, strlen(write_data) + 1) > 0 ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; + } + + close(fd); + + return status; +} + + +static switch_status_t lock_file(http_file_context_t *context, switch_bool_t lock) +{ + + switch_status_t status = SWITCH_STATUS_SUCCESS; + + + if (lock) { + if (switch_file_open(&context->lock_fd, + context->lock_file, + SWITCH_FOPEN_WRITE | SWITCH_FOPEN_CREATE | SWITCH_FOPEN_TRUNCATE, + SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, context->pool) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_FALSE; + } + + + if (switch_file_lock(context->lock_fd, SWITCH_FLOCK_EXCLUSIVE) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_FALSE; + } + } else { + if (context->lock_fd){ + switch_file_close(context->lock_fd); + status = SWITCH_STATUS_SUCCESS; + } + + unlink(context->lock_file); + } + + return status; +} + + +static switch_status_t locate_url_file(http_file_context_t *context, const char *url) +{ + switch_event_t *headers = NULL; + int unreachable = 0; + switch_status_t status = SWITCH_STATUS_FALSE; + time_t now = switch_epoch_time_now(NULL); + char *metadata; + + load_cache_data(context, url); + + if (context->expires && now < context->expires) { + return SWITCH_STATUS_SUCCESS; + } + + lock_file(context, SWITCH_TRUE); + + if ((status = fetch_cache_data(context, url, &headers, NULL)) != SWITCH_STATUS_SUCCESS) { + if (status == SWITCH_STATUS_NOTFOUND) { + unreachable = 2; + if (now - context->expires < globals.not_found_expires) { + switch_goto_status(SWITCH_STATUS_SUCCESS, end); + } + } else { + unreachable = 1; + } + } + + if (switch_file_exists(context->cache_file, context->pool) != SWITCH_STATUS_SUCCESS && unreachable) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File at url [%s] is unreachable!\n", url); + goto end; + } + + if (!unreachable && !zstr(context->metadata)) { + metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s", + url, + switch_event_get_header_nil(headers, "last-modified"), + switch_event_get_header_nil(headers, "etag"), + switch_event_get_header_nil(headers, "content-length") + ); + + if (!strcmp(metadata, context->metadata)) { + write_meta_file(context, metadata, headers); + switch_goto_status(SWITCH_STATUS_SUCCESS, end); + } + } + + switch_event_destroy(&headers); + fetch_cache_data(context, url, &headers, context->cache_file); + metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s", + url, + switch_event_get_header_nil(headers, "last-modified"), + switch_event_get_header_nil(headers, "etag"), + switch_event_get_header_nil(headers, "content-length") + ); + + write_meta_file(context, metadata, headers); + + if (switch_file_exists(context->cache_file, context->pool) == SWITCH_STATUS_SUCCESS) { + status = SWITCH_STATUS_SUCCESS; + } + + end: + + if (status != SWITCH_STATUS_SUCCESS) { + unlink(context->meta_file); + unlink(context->cache_file); + } + + lock_file(context, SWITCH_FALSE); + + switch_event_destroy(&headers); + + return status; +} + + +static switch_status_t http_file_file_seek(switch_file_handle_t *handle, unsigned int *cur_sample, int64_t samples, int whence) +{ + http_file_context_t *context = handle->private_info; + + if (!handle->seekable) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "File is not seekable\n"); + return SWITCH_STATUS_NOTIMPL; + } + + return switch_core_file_seek(&context->fh, cur_sample, samples, whence); +} + +static switch_status_t http_file_file_open(switch_file_handle_t *handle, const char *path) +{ + http_file_context_t *context; + char *parsed = NULL, *pdup = NULL; + switch_status_t status; + + context = switch_core_alloc(handle->memory_pool, sizeof(*context)); + context->pool = handle->memory_pool; + + pdup = switch_core_strdup(context->pool, path); + + switch_event_create_brackets(pdup, '(', ')', ',', &context->url_params, &parsed, SWITCH_FALSE); + + if (context->url_params) { + context->ua = switch_event_get_header(context->url_params, "ua"); + } + + if (parsed) path = parsed; + + context->dest_url = switch_core_sprintf(context->pool, "http://%s", path); + + if (switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) { + char *ext; + + context->fh.channels = handle->channels; + context->fh.native_rate = handle->native_rate; + context->fh.samples = handle->samples; + context->fh.samplerate = handle->samplerate; + context->fh.prefix = handle->prefix; + + + if (context->url_params) { + context->write.file_name = switch_event_get_header(context->url_params, "file"); + context->write.profile_name = switch_event_get_header(context->url_params, "profile"); + context->write.method = switch_event_get_header(context->url_params, "method"); + context->write.name = switch_event_get_header(context->url_params, "name"); + } + + if (!context->write.file_name) { + char *p; + if ((p = strrchr(context->dest_url, '/'))) { + p++; + context->write.file_name = switch_core_strdup(context->pool, p); + } + } + + if ((ext = strrchr(context->write.file_name, '.'))) { + ext++; + } else { + ext = "wav"; + } + + if (!context->write.profile_name) context->write.profile_name = "default"; + if (!context->write.method) context->write.method = !strcasecmp(ext, "cgi") ? "post" : "put"; + if (!context->write.name) context->write.name = "recorded_file"; + + switch_uuid_str(context->write.uuid_str, sizeof(context->write.uuid_str)); + + context->write.file = switch_core_sprintf(context->pool, "%s%s%s_%s", + SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, context->write.uuid_str, context->write.file_name); + + + if (switch_core_file_open(&context->fh, context->write.file, handle->channels, handle->samplerate, handle->flags, NULL) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_GENERR; + } + + } else { + + if (context->url_params) { + context->read.ext = switch_event_get_header(context->url_params, "ext"); + } + + if ((status = locate_url_file(context, context->dest_url)) != SWITCH_STATUS_SUCCESS) { + return status; + } + + if ((status = switch_core_file_open(&context->fh, + context->cache_file, + handle->channels, + handle->samplerate, + SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid cache file %s opening url %s Discarding file.\n", context->cache_file, path); + unlink(context->cache_file); + unlink(context->meta_file); + unlink(context->lock_file); + + return status; + } + } + + handle->private_info = context; + handle->samples = context->fh.samples; + handle->format = context->fh.format; + handle->sections = context->fh.sections; + handle->seekable = context->fh.seekable; + handle->speed = context->fh.speed; + handle->interval = context->fh.interval; + + if (switch_test_flag((&context->fh), SWITCH_FILE_NATIVE)) { + switch_set_flag(handle, SWITCH_FILE_NATIVE); + } else { + switch_clear_flag(handle, SWITCH_FILE_NATIVE); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t http_file_file_close(switch_file_handle_t *handle) +{ + http_file_context_t *context = handle->private_info; + + if (switch_test_flag((&context->fh), SWITCH_FILE_OPEN)) { + switch_core_file_close(&context->fh); + } + + if (context->write.file) { + client_t *client; + switch_event_t *params; + char *key; + + switch_event_create(¶ms, SWITCH_EVENT_CLONE); + params->flags |= EF_UNIQ_HEADERS; + + if (!strcasecmp(context->write.method, "put")) { + switch_event_add_header(params, SWITCH_STACK_BOTTOM, "put_file", "%s", context->write.file); + } else { + key = switch_core_sprintf(context->pool, "attach_file:%s:%s", context->write.name, context->write.file_name); + switch_event_add_header(params, SWITCH_STACK_BOTTOM, key, "%s", context->write.file); + } + + switch_event_add_header(params, SWITCH_STACK_BOTTOM, "url", "%s", context->dest_url); + switch_event_add_header(params, SWITCH_STACK_BOTTOM, "file_driver", "true"); + switch_event_add_header(params, SWITCH_STACK_BOTTOM, "HTTAPI_SESSION_ID", "%s", context->write.uuid_str); + + if ((client = client_create(NULL, context->write.profile_name, ¶ms))) { + httapi_sync(client); + client_destroy(&client); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find suitable profile\n"); + switch_event_destroy(¶ms); + } + + unlink(context->write.file); + return SWITCH_STATUS_SUCCESS; + } + + + if (context->del_on_close) { + if (context->cache_file) { + unlink(context->cache_file); + unlink(context->meta_file); + unlink(context->lock_file); + } + } + + if (context->url_params) { + switch_event_destroy(&context->url_params); + } + + return SWITCH_STATUS_SUCCESS; +} + + +static switch_status_t http_file_write(switch_file_handle_t *handle, void *data, size_t *len) +{ + http_file_context_t *context = handle->private_info; + + return switch_core_file_write(&context->fh, data, len); +} + +static switch_status_t http_file_file_read(switch_file_handle_t *handle, void *data, size_t *len) +{ + http_file_context_t *context = handle->private_info; + switch_status_t status; + + if (context->samples > 0) { + if (*len > (size_t) context->samples) { + *len = context->samples; + } + + context->samples -= *len; + memset(data, 255, *len *2); + status = SWITCH_STATUS_SUCCESS; + } else { + status = switch_core_file_read(&context->fh, data, len); + } + + return status; +} + +/* Registration */ + +static char *http_file_supported_formats[SWITCH_MAX_CODECS] = { 0 }; + + +/* /HTTP FILE INTERFACE */ + +SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load) +{ + switch_api_interface_t *httapi_api_interface; + switch_application_interface_t *app_interface; + switch_file_interface_t *file_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.pool = pool; + globals.hash_root = NULL; + globals.hash_tail = NULL; + globals.cache_ttl = 300; + globals.not_found_expires = 300; + + + http_file_supported_formats[0] = "http"; + + file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE); + file_interface->interface_name = modname; + file_interface->extens = http_file_supported_formats; + file_interface->file_open = http_file_file_open; + file_interface->file_close = http_file_file_close; + file_interface->file_read = http_file_file_read; + file_interface->file_write = http_file_write; + file_interface->file_seek = http_file_file_seek; + + switch_snprintf(globals.cache_path, sizeof(globals.cache_path), "%s%shttp_file_cache", SWITCH_GLOBAL_dirs.storage_dir, SWITCH_PATH_SEPARATOR); + switch_dir_make_recursive(globals.cache_path, SWITCH_DEFAULT_DIR_PERMS, pool); + + + switch_core_hash_init(&globals.profile_hash, globals.pool); + switch_core_hash_init_case(&globals.parse_hash, globals.pool, SWITCH_FALSE); + + bind_parser("execute", parse_execute); + bind_parser("sms", parse_sms); + bind_parser("dial", parse_dial); + bind_parser("pause", parse_playback); + bind_parser("hangup", parse_hangup); + bind_parser("record", parse_record); + bind_parser("recordCall", parse_record_call); + bind_parser("playback", parse_playback); + bind_parser("vmName", parse_playback); + bind_parser("speak", parse_playback); + bind_parser("say", parse_playback); + bind_parser("conference", parse_conference); + bind_parser("break", parse_break); + bind_parser("log", parse_log); + bind_parser("continue", parse_continue); + bind_parser("getVariable", parse_get_var); + bind_parser("voicemail", parse_voicemail); + + if (do_config() != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_FALSE; + } + + SWITCH_ADD_API(httapi_api_interface, "httapi", + "HT-TAPI Hypertext Telephony API", httapi_api_function, HTTAPI_SYNTAX); + + SWITCH_ADD_APP(app_interface, "httapi", + "HT-TAPI Hypertext Telephony API", + "HT-TAPI Hypertext Telephony API", httapi_function, "{=}", SAF_SUPPORT_NOMEDIA); + + + + switch_console_set_complete("add httapi debug_on"); + switch_console_set_complete("add httapi debug_off"); + + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_httapi_shutdown) +{ + hash_node_t *ptr = NULL; + client_profile_t *profile; + switch_hash_index_t *hi; + void *val; + const void *vvar; + + for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { + switch_hash_this(hi, &vvar, NULL, &val); + profile = (client_profile_t *) val; + switch_event_destroy(&profile->dial_params.app_list); + switch_event_destroy(&profile->var_params.expand_var_list); + switch_event_destroy(&profile->var_params.set_var_list); + switch_event_destroy(&profile->var_params.get_var_list); + } + + + switch_core_hash_destroy(&globals.profile_hash); + switch_core_hash_destroy(&globals.parse_hash); + + while (globals.hash_root) { + ptr = globals.hash_root; + switch_core_hash_destroy(&ptr->hash); + globals.hash_root = ptr->next; + switch_safe_free(ptr); + } + + 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/applications/mod_httapi/mod_httapi_doc.txt b/src/mod/applications/mod_httapi/mod_httapi_doc.txt new file mode 100644 index 0000000000..8690a62fc8 --- /dev/null +++ b/src/mod/applications/mod_httapi/mod_httapi_doc.txt @@ -0,0 +1,340 @@ +HT-TAPI Hyper-Text Telephony API and http file format plugin + +This module provides an HTTP based Telephony API using a standard FreeSWITCH application interface as well as a cached http file format interface. + +The file format plugin can be used like this: + + +This syntax is valid anywhere a filename parameter is requested in FreeSWITCH. + + +The application is called like this: + + + +The target url is expected to be a CGI returning text/xml using the documentation below. + +The format is roughly as described below (We could use a DTD maybe). + + + + someval + + + someval + + + <...> + + + + +The profile name must be chosen to bind to a preset series of settings and permissions to use as a basis for the client session. +It's chosen from the specified params or from the channel variable using the keyname 'httapi_profile' and if not specified will default to 'default' +Any params specified in the initial data of the application encased in brackets {} will be parsed into the initial params similar to originate. +These params remain set until the call ends and are supplied as form elements on each hit to the HTTP server. +If the permissions allow, a tag is parsed from the resulting document and set into this data set and will be mirrored back on subsequqent http posts. +Also if the permissions allow a tag is parsed the same way setting channel variables. +The tag is required and contains one or more of the supported command tags that generally manipulate the call behaviour. +The application will continue to do the task in the work section until an error is encoutered or when an action from the work tag warrants it. +If the session exits the httapi app without hanging up it can do other tasks and make another call to httapi and the session data will remain preserved. + + +EXAMPLE: + + + + + +~\d+# + + + + +BINDINGS +Several of the work tags that indicate they support bindings can contain one of more bind tags that function with similar fashion to bind_digit_action + +*EXPR* + +ATTRS: +action : a specific url to go to next if the binding is dialed +strip : a character to strip from in the result such as # + +WORK TAGS: +*ACTIONS* + + +*EXPR* + : Plays a file and optionally collects input. + +ATTRS: +file : The file +name : Param name to save result. +error-file : Error file to play on invalid input. +action : Change the new target url. +temp-action : Change url to submit to. just for the next loop. +digit-timeout : Timeout waiting for digits after file plays (when input bindings are present) +input-timeout : Timeout waiting for more digits in a multi-digit input. +loops : max times to play the file when input bindings are present. +asr-engine : ASR engine to use +asr-grammar : ASR grammar to use + + +*EXPR* + : Plays a vm name and optionally collects input. + +ATTRS: +file : The file +name : Param name to save result. +error-file : Error file to play on invalid input. +action : Change the new target url. +temp-action : Change url to submit to. just for the next loop. +digit-timeout : Timeout waiting for digits after file plays (when input bindings are present) +input-timeout : Timeout waiting for more digits in a multi-digit input. +loops : max times to play the file when input bindings are present. + + + + + +*EXPR* + : Records a file, optionally collects input and posts the file back to the target url. + +ATTRS: +file : The file +name : Param name to save result. +error-file : Error file to play on invalid input. +action : Change the new target url. +temp-action : Change url to submit to. just for the next loop. +digit-timeout : Timeout waiting for digits after file plays (when input bindings are present) +input-timeout : Timeout waiting for more digits in a multi-digit input. + + + + + +*EXPR* + : Waits for input for a specific amount of time. + +ATTRS: +milliseconds : Number of milliseconds to pause +name : Param name to save result. +error-file : Error file to play on invalid input. +action : Change the new target url. +temp-action : Change url to submit to. just for the next loop. +digit-timeout : Timeout waiting for digits after file plays (when input bindings are present) +input-timeout : Timeout waiting for more digits in a multi-digit input. +loops : max times to play the file when input bindings are present. + + + + + +*EXPR* + : Read Text to Speech with optional input. + +ATTRS: +file : The file +name : Param name to save result. +error-file : Error file to play on invalid input. +action : Change the new target url. +temp-action : Change url to submit to. just for the next loop. +digit-timeout : Timeout waiting for digits after file plays (when input bindings are present) +input-timeout : Timeout waiting for more digits in a multi-digit input. +loops : max times to play the file when input bindings are present. +engine : tts engine to use. +voice : tts voice to use. + + + + + +*EXPR* + : Use the FS say engine to iterate sounds to similate a human speaker. + +ATTRS: +file : The file +name : Param name to save result. +error-file : Error file to play on invalid input. +action : Change the new target url. +temp-action : Change url to submit to. just for the next loop. +digit-timeout : Timeout waiting for digits after file plays (when input bindings are present) +input-timeout : Timeout waiting for more digits in a multi-digit input. +loops : max times to play the file when input bindings are present. +language : language +type : type (fs param) +method : method (fs param) +gender : gender (fs param) + + + + + +*DATA* + : Execute a FreeSWITCH app. +ATTRS: +application : The app to run +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. +data : Alternate source for app data +*DATA* : The app data + + + +DATA + : Send a SMS message. +ATTRS: +to : The dest number +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. +*DATA* : The message data + + + + + +*DATA* + : Place an outbound call or transfer. + +ATTRS: +context : Dialplan context. +dialplan : Dialplan dialplan. +caller-id-name : Caller ID Name. +caller-id-number : Caller ID Number. +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. +*DATA* : Number to dial or originate string + + + + + + + : begin recording the call. The file will be posted when the call ends. + +ATTRS: +limit : Timeout in seconds. +name : Name to use for input values. +action : URL action to use. +temp-action : Change url to submit to. just for the next loop. + + + + + + : Start a conference call. + +ATTRS: +profile : Conference profile to use. +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. + + + + + : Hangup the call + +ATTRS: +cause : Hangup cause +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. + + + + + : Exit the httapi application and continue in the dialplan. + + + + + + + : Write a log line to fs_cli, console, logs, etc. +ATTRS: +level : The log level to use. +clean : If true do not print log prefix. +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. + + + : Just continue (no-op) + +ATTRS: +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. + + + + : Get a Channel variable (depends on permissions) + +ATTRS: +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. +permanent : Add as a permanent param or just once. + + + + : Call the voicemail app without requiring "execute" permissions + +ATTRS: +action : Change url to submit to. +temp-action : Change url to submit to. just for the next loop. +check : true to check (omit to leave) +auth-only : authenticate only and move on +profile : profile name to use (omit for "default") +domain : domain to use (omit for global domain variable) +id : id to use (omit to prompt for id) + + + + + +CONFIGURATION: + +: + +debug : false Print debug data +file-cache-ttl : 300 How long to wait before checking the server to see if audio file has changed. +file-not-found-expires : 300 How long to still preserve cached audio files that are not found by the server. + + : CREATE NEW PROFILE TO REFERENCE BY NAME +gateway-url : "" Initial URL to connect to. +gateway-credentials : "" HTTP credentials. +auth-scheme : basic auth scheme to use. [basic|digest|NTLM|GSS-NEGOTIATE|any] +disable-100-continue : true Disable the 100 continue feature. +method : "" METHOD name to send. +timeout : 0 Timeout waiting for response. +enable-cacert-check : false Check CA/CERT. +ssl-cert-path : "" path to file. +ssl-key-path : "" path to file. +ssl-key-password : "" password to use. +ssl-version : "" ssl version +ssl-cacert-file : "" CA/CERT file. +enable-ssl-verifyhost : "" Verify ssl host. +cookie-file : "" Path to file to use for cookie. +enable-post-var : "" Specify specifc param names ok to send. +bind-local : "" Interface to bind to. +default-profile : default Profile to use when not specified. +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. +extended-data : Extended data is sent like full channel event data. +execute-apps : tag is enabled to execute apps. +expand-vars : Allow expansion of FS ${variables}. (this opens up all FSAPI calls) +*dial : tag is enabled allowing outbound dialing. +dial-set-context : context attribute is permitted. +dial-set-dialplan : dialplan attribute is permitted. +dial-set-cid-name : cid_name attribute is permitted. +dial-set-cid-number : cid_number attribute is permitted. +dial-full-originate : full originate syntax is permitted instead of just a number. +*conference : tag is enabled allowing creation of conferences. +conference-set-profile : attribure is permitted. +all : all permissions are set +none : no permissions are set + + 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 b2004b5456..b93016a5e6 100644 --- a/src/mod/applications/mod_http_cache/mod_http_cache.c +++ b/src/mod/applications/mod_http_cache/mod_http_cache.c @@ -40,6 +40,7 @@ SWITCH_STANDARD_API(http_cache_get); SWITCH_STANDARD_API(http_cache_put); SWITCH_STANDARD_API(http_cache_tryget); SWITCH_STANDARD_API(http_cache_clear); +SWITCH_STANDARD_API(http_cache_prefetch); #define DOWNLOAD_NEEDED "download" @@ -148,6 +149,16 @@ struct url_cache { int misses; /** Number of cache errors */ int errors; + /** The prefetch queue */ + switch_queue_t *prefetch_queue; + /** Max size of prefetch queue */ + int prefetch_queue_size; + /** Size of prefetch thread pool */ + int prefetch_thread_count; + /** Shutdown flag */ + int shutdown; + /** Synchronizes shutdown of cache */ + switch_thread_rwlock_t *shutdown_lock; }; static url_cache_t gcache; @@ -778,6 +789,35 @@ static void setup_dir(url_cache_t *cache) } } +static int isUrl(const char *filename) +{ + return !zstr(filename) && !strncmp("http://", filename, strlen("http://")); +} + +#define HTTP_PREFETCH_SYNTAX "" +SWITCH_STANDARD_API(http_cache_prefetch) +{ + switch_status_t status = SWITCH_STATUS_SUCCESS; + char *url; + + if (!isUrl(cmd)) { + stream->write_function(stream, "USAGE: %s\n", HTTP_PREFETCH_SYNTAX); + return SWITCH_STATUS_SUCCESS; + } + + /* send to thread pool */ + url = strdup(cmd); + if (switch_queue_trypush(gcache.prefetch_queue, url) != SWITCH_STATUS_SUCCESS) { + switch_safe_free(url); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Failed to queue prefetch request\n"); + stream->write_function(stream, "-ERR\n"); + } else { + stream->write_function(stream, "+OK\n"); + } + + return status; +} + #define HTTP_GET_SYNTAX "" /** * Get a file from the cache, download if it isn't cached @@ -789,7 +829,7 @@ SWITCH_STANDARD_API(http_cache_get) switch_memory_pool_t *pool = NULL; char *filename; - if (zstr(cmd) || strncmp("http://", cmd, strlen("http://"))) { + if (!isUrl(cmd)) { stream->write_function(stream, "USAGE: %s\n", HTTP_GET_SYNTAX); return SWITCH_STATUS_SUCCESS; } @@ -911,6 +951,44 @@ SWITCH_STANDARD_API(http_cache_clear) return SWITCH_STATUS_SUCCESS; } + +/** + * Thread to prefetch URLs + * @param thread the thread + * @param obj started flag + * @return NULL + */ +static void *SWITCH_THREAD_FUNC prefetch_thread(switch_thread_t *thread, void *obj) +{ + int *started = obj; + void *url = NULL; + + switch_thread_rwlock_rdlock(gcache.shutdown_lock); + *started = 1; + + // process prefetch requests + while (!gcache.shutdown) { + if (switch_queue_pop(gcache.prefetch_queue, &url) == SWITCH_STATUS_SUCCESS) { + switch_stream_handle_t stream = { 0 }; + SWITCH_STANDARD_STREAM(stream); + switch_api_execute("http_get", url, NULL, &stream); + switch_safe_free(stream.data); + switch_safe_free(url); + } + url = NULL; + } + + // shutting down- clear the queue + while (switch_queue_trypop(gcache.prefetch_queue, &url) == SWITCH_STATUS_SUCCESS) { + switch_safe_free(url); + url = NULL; + } + + switch_thread_rwlock_unlock(gcache.shutdown_lock); + + return NULL; +} + /** * Configure the module * @param cache to configure @@ -933,6 +1011,8 @@ static switch_status_t do_config(url_cache_t *cache) max_urls = 4000; default_max_age_sec = 86400; cache->location = SWITCH_PREFIX_DIR "/http_cache"; + cache->prefetch_queue_size = 100; + cache->prefetch_thread_count = 8; /* get params */ settings = switch_xml_child(cfg, "settings"); @@ -949,6 +1029,12 @@ static switch_status_t do_config(url_cache_t *cache) } else if (!strcasecmp(var, "default-max-age")) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting default-max-age to %s\n", val); default_max_age_sec = atoi(val); + } else if (!strcasecmp(var, "prefetch-queue-size")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting prefetch-queue-size to %s\n", val); + cache->prefetch_queue_size = atoi(val); + } 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 { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unsupported param: %s\n", var); } @@ -971,6 +1057,16 @@ static switch_status_t do_config(url_cache_t *cache) status = SWITCH_STATUS_TERM; goto done; } + if (cache->prefetch_queue_size <= 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "prefetch-queue-size must be > 0\n"); + status = SWITCH_STATUS_TERM; + goto done; + } + if (cache->prefetch_thread_count <= 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "prefetch-thread-count must be > 0\n"); + status = SWITCH_STATUS_TERM; + goto done; + } cache->max_url = max_urls; cache->default_max_age = (default_max_age_sec * 1000 * 1000); /* convert from seconds to nanoseconds */ @@ -992,6 +1088,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load) SWITCH_ADD_API(api, "http_tryget", "HTTP GET from cache only", http_cache_tryget, HTTP_GET_SYNTAX); SWITCH_ADD_API(api, "http_put", "HTTP PUT", http_cache_put, HTTP_PUT_SYNTAX); SWITCH_ADD_API(api, "http_clear_cache", "Clear the cache", http_cache_clear, HTTP_CACHE_CLEAR_SYNTAX); + SWITCH_ADD_API(api, "http_prefetch", "Prefetch document in a background thread. Use http_get to get the prefetched document", http_cache_prefetch, HTTP_PREFETCH_SYNTAX); memset(&gcache, 0, sizeof(url_cache_t)); gcache.pool = pool; @@ -1002,6 +1099,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load) switch_core_hash_init(&gcache.map, gcache.pool); switch_mutex_init(&gcache.mutex, SWITCH_MUTEX_UNNESTED, gcache.pool); + switch_thread_rwlock_create(&gcache.shutdown_lock, gcache.pool); /* create the queue */ gcache.queue.max_size = gcache.max_url; @@ -1011,6 +1109,21 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load) setup_dir(&gcache); + /* Start the prefetch threads */ + switch_queue_create(&gcache.prefetch_queue, gcache.prefetch_queue_size, gcache.pool); + for (int i = 0; i < gcache.prefetch_thread_count; i++) { + int started = 0; + switch_thread_t *thread; + switch_threadattr_t *thd_attr = NULL; + switch_threadattr_create(&thd_attr, gcache.pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&thread, thd_attr, prefetch_thread, &started, gcache.pool); + while (!started) { + switch_sleep(1000); + } + } + /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; } @@ -1020,6 +1133,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load) */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_http_cache_shutdown) { + gcache.shutdown = 1; + switch_queue_interrupt_all(gcache.prefetch_queue); + switch_thread_rwlock_wrlock(gcache.shutdown_lock); + url_cache_clear(&gcache, NULL); switch_core_hash_destroy(&gcache.map); switch_mutex_destroy(gcache.mutex); diff --git a/src/mod/applications/mod_mongo/mod_mongo.cpp b/src/mod/applications/mod_mongo/mod_mongo.cpp index 973827724d..85bbd0ee4a 100644 --- a/src/mod/applications/mod_mongo/mod_mongo.cpp +++ b/src/mod/applications/mod_mongo/mod_mongo.cpp @@ -1,3 +1,34 @@ +/* + * 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. + * + * Contributor(s): + * + * Tamas Cseke + * + * mod_mongo.cpp -- API for MongoDB + * + */ + #include #include "mod_mongo.h" diff --git a/src/mod/applications/mod_mongo/mod_mongo.h b/src/mod/applications/mod_mongo/mod_mongo.h index 57fdd09fdb..a1c8322bd7 100644 --- a/src/mod/applications/mod_mongo/mod_mongo.h +++ b/src/mod/applications/mod_mongo/mod_mongo.h @@ -1,3 +1,34 @@ +/* + * 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. + * + * Contributor(s): + * + * Tamas Cseke + * + * mod_mongo.h -- API for MongoDB + * + */ + #ifndef MOD_MONGO_H #define MOD_MONGO_H @@ -35,3 +66,13 @@ switch_status_t mongo_connection_pool_put(mongo_connection_pool_t *conn_pool, DB #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_mongo/mongo_conn.cpp b/src/mod/applications/mod_mongo/mongo_conn.cpp index dd23b00310..075b8f85d6 100644 --- a/src/mod/applications/mod_mongo/mongo_conn.cpp +++ b/src/mod/applications/mod_mongo/mongo_conn.cpp @@ -1,3 +1,33 @@ +/* + * 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. + * + * Contributor(s): + * + * Tamas Cseke + * + * mongo_conn.cpp -- MongoDB connection pool + * + */ #include #include "mod_mongo.h" @@ -169,3 +199,14 @@ switch_status_t mongo_connection_pool_put(mongo_connection_pool_t *conn_pool, DB 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/src/mod/applications/mod_nibblebill/mod_nibblebill.c b/src/mod/applications/mod_nibblebill/mod_nibblebill.c index cb9942e985..eca9f621c9 100755 --- a/src/mod/applications/mod_nibblebill/mod_nibblebill.c +++ b/src/mod/applications/mod_nibblebill/mod_nibblebill.c @@ -52,19 +52,20 @@ typedef struct { switch_time_t lastts; /* Last time we did any billing */ - float total; /* Total amount billed so far */ + double total; /* Total amount billed so far */ switch_time_t pausets; /* Timestamp of when a pause action started. 0 if not paused */ - float bill_adjustments; /* Adjustments to make to the next billing, based on pause/resume events */ + double bill_adjustments; /* Adjustments to make to the next billing, based on pause/resume events */ + int lowbal_action_executed; /* Set to 1 once lowbal_action has been executed */ } nibble_data_t; typedef struct nibblebill_results { - float balance; + double balance; - float percall_max; /* Overrides global on a per-user level */ - float lowbal_amt; /* ditto */ + double percall_max; /* Overrides global on a per-user level */ + double lowbal_amt; /* ditto */ } nibblebill_results_t; @@ -80,11 +81,11 @@ static struct { switch_mutex_t *mutex; /* Global billing config options */ - float percall_max_amt; /* Per-call billing limit (safety check, for fraud) */ + double percall_max_amt; /* Per-call billing limit (safety check, for fraud) */ char *percall_action; /* Exceeded length of per-call action */ - float lowbal_amt; /* When we warn them they are near depletion */ + double lowbal_amt; /* When we warn them they are near depletion */ char *lowbal_action; /* Low balance action */ - float nobal_amt; /* Minimum amount that must remain in the account */ + double nobal_amt; /* Minimum amount that must remain in the account */ char *nobal_action; /* Drop action */ /* Other options */ @@ -136,7 +137,7 @@ static int nibblebill_callback(void *pArg, int argc, char **argv, char **columnN for (i = 0; i < argc; i++) { if (!strcasecmp(columnNames[i], "nibble_balance")) { - cbt->balance = (float) atof(argv[0]); + cbt->balance = atof(argv[0]); } } @@ -179,15 +180,15 @@ static switch_status_t load_config(void) } else if (!strcasecmp(var, "percall_action")) { set_global_percall_action(val); } else if (!strcasecmp(var, "percall_max_amt")) { - globals.percall_max_amt = (float) atof(val); + globals.percall_max_amt = atof(val); } else if (!strcasecmp(var, "lowbal_action")) { set_global_lowbal_action(val); } else if (!strcasecmp(var, "lowbal_amt")) { - globals.lowbal_amt = (float) atof(val); + globals.lowbal_amt = atof(val); } else if (!strcasecmp(var, "nobal_action")) { set_global_nobal_action(val); } else if (!strcasecmp(var, "nobal_amt")) { - globals.nobal_amt = (float) atof(val); + globals.nobal_amt = atof(val); } else if (!strcasecmp(var, "global_heartbeat")) { globals.global_heartbeat = atoi(val); } @@ -252,6 +253,23 @@ void debug_event_handler(switch_event_t *event) } } +static switch_status_t exec_app(switch_core_session_t *session, const char *app_string) +{ + switch_status_t status; + char *strings[2] = { 0 }; + char *dup; + + if (!app_string) { + return SWITCH_STATUS_FALSE; + } + + dup = strdup(app_string); + switch_assert(dup); + switch_separate_string(dup, ' ', strings, sizeof(strings) / sizeof(strings[0])); + status = switch_core_session_execute_application(session, strings[0], strings[1]); + free(dup); + return status; +} static void transfer_call(switch_core_session_t *session, char *destination) { @@ -292,9 +310,8 @@ static void transfer_call(switch_core_session_t *session, char *destination) free(mydup); } - /* At this time, billing never succeeds if you don't have a database. */ -static switch_status_t bill_event(float billamount, const char *billaccount, switch_channel_t *channel) +static switch_status_t bill_event(double billamount, const char *billaccount, switch_channel_t *channel) { char *sql = NULL, *dsql = NULL; switch_odbc_statement_handle_t stmt = NULL; @@ -306,7 +323,7 @@ static switch_status_t bill_event(float billamount, const char *billaccount, swi if (globals.custom_sql_save) { if (switch_string_var_check_const(globals.custom_sql_save) || switch_string_has_escaped_data(globals.custom_sql_save)) { - switch_channel_set_variable_printf(channel, "nibble_increment", "%f", billamount, SWITCH_FALSE); + switch_channel_set_variable_printf(channel, "nibble_bill", "%f", billamount, SWITCH_FALSE); sql = switch_channel_expand_variables(channel, globals.custom_sql_save); if (sql != globals.custom_sql_save) dsql = sql; } else { @@ -339,14 +356,14 @@ static switch_status_t bill_event(float billamount, const char *billaccount, swi } -static float get_balance(const char *billaccount, switch_channel_t *channel) +static double get_balance(const char *billaccount, switch_channel_t *channel) { char *dsql = NULL, *sql = NULL; nibblebill_results_t pdata; - float balance = 0.00f; + double balance = 0.0; if (!switch_odbc_available()) { - return -1.00f; + return -1.0; } memset(&pdata, 0, sizeof(pdata)); @@ -369,7 +386,7 @@ static float get_balance(const char *billaccount, switch_channel_t *channel) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error running this query: [%s]\n", sql); /* Return -1 for safety */ - balance = -1.00f; + balance = -1.0; } else { /* Successfully retrieved! */ balance = pdata.balance; @@ -391,7 +408,7 @@ static switch_status_t do_billing(switch_core_session_t *session) /* Local vars */ nibble_data_t *nibble_data; switch_time_t ts = switch_micro_time_now(); - float billamount; + double billamount; char date[80] = ""; char *uuid; switch_size_t retsize; @@ -399,9 +416,9 @@ static switch_status_t do_billing(switch_core_session_t *session) const char *billrate; const char *billincrement; const char *billaccount; - float nobal_amt = globals.nobal_amt; - //float lowbal_amt = globals.lowbal_amt; - float balance; + double nobal_amt = globals.nobal_amt; + double lowbal_amt = globals.lowbal_amt; + double balance; if (!session) { /* Why are we here? */ @@ -421,13 +438,13 @@ static switch_status_t do_billing(switch_core_session_t *session) billaccount = switch_channel_get_variable(channel, "nibble_account"); if (!zstr(switch_channel_get_variable(channel, "nobal_amt"))) { - nobal_amt = (float)atof(switch_channel_get_variable(channel, "nobal_amt")); + nobal_amt = atof(switch_channel_get_variable(channel, "nobal_amt")); } - /* + if (!zstr(switch_channel_get_variable(channel, "lowbal_amt"))) { - lowbal_amt = (float)atof(switch_channel_get_variable(channel, "lowbal_amt")); + lowbal_amt = atof(switch_channel_get_variable(channel, "lowbal_amt")); } - */ + /* Return if there's no billing information on this session */ if (!billrate || !billaccount) { return SWITCH_STATUS_SUCCESS; @@ -497,11 +514,15 @@ static switch_status_t do_billing(switch_core_session_t *session) if ((ts - nibble_data->lastts) >= 0) { /* If billincrement is set we bill by it and not by time elapsed */ if (!(switch_strlen_zero(billincrement))) { - float chargedunits = ((int)((ts - nibble_data->lastts) / 1000000) <= (int)atof(billincrement)) ? ((float)atof(billincrement) * 1000000) : ceil((ts - nibble_data->lastts) / ((float)atof(billincrement) * 1000000)) * ((float)atof(billincrement) * 1000000); - billamount = ((float) atof(billrate) / 1000000 / 60) * chargedunits - nibble_data->bill_adjustments; + switch_time_t chargedunits = (ts - nibble_data->lastts) / 1000000 <= atol(billincrement) ? atol(billincrement) * 1000000 : (switch_time_t)(ceil((ts - nibble_data->lastts) / (atol(billincrement) * 1000000.0))) * atol(billincrement) * 1000000; + billamount = (atof(billrate) / 1000000 / 60) * chargedunits - nibble_data->bill_adjustments; + /* Account for the prepaid amount */ + nibble_data->lastts += chargedunits; } else { /* Convert billrate into microseconds and multiply by # of microseconds that have passed since last *successful* bill */ - billamount = ((float) atof(billrate) / 1000000 / 60) * ((ts - nibble_data->lastts)) - nibble_data->bill_adjustments; + billamount = (atof(billrate) / 1000000 / 60) * ((ts - nibble_data->lastts)) - nibble_data->bill_adjustments; + /* Update the last time we billed */ + nibble_data->lastts = ts; } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Billing $%f to %s (Call: %s / %f so far)\n", billamount, billaccount, @@ -521,21 +542,31 @@ static switch_status_t do_billing(switch_core_session_t *session) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Failed to log to database!\n"); } } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Just tried to bill %s negative minutes! That should be impossible.\n", - uuid); + if (switch_strlen_zero(billincrement)) + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Just tried to bill %s negative minutes! That should be impossible.\n", uuid); } - /* Update the last time we billed */ - nibble_data->lastts = ts; - /* Save this location */ if (channel) { switch_channel_set_private(channel, "_nibble_data_", nibble_data); /* don't verify balance and transfer to nobal if we're done with call */ if (switch_channel_get_state(channel) != CS_REPORTING && switch_channel_get_state(channel) != CS_HANGUP) { - /* See if this person has enough money left to continue the call */ + balance = get_balance(billaccount, channel); + + /* See if we've achieved low balance */ + if (!nibble_data->lowbal_action_executed && balance <= lowbal_amt) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Balance of %f fell below low balance amount of %f! (Account %s)\n", + balance, lowbal_amt, billaccount); + + if (exec_app(session, globals.lowbal_action) != SWITCH_STATUS_SUCCESS) + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Low balance action didn't execute\n"); + else + nibble_data->lowbal_action_executed = 1; + } + + /* See if this person has enough money left to continue the call */ if (balance <= nobal_amt) { /* Not enough money - reroute call to nobal location */ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Balance of %f fell below allowed amount of %f! (Account %s)\n", @@ -665,7 +696,7 @@ static void nibblebill_resume(switch_core_session_t *session) billrate = switch_channel_get_variable(channel, "nibble_rate"); /* Calculate how much was "lost" to billings during pause - we do this here because you never know when the billrate may change during a call */ - nibble_data->bill_adjustments += ((float) atof(billrate) / 1000000 / 60) * ((ts - nibble_data->pausets)); + nibble_data->bill_adjustments += (atof(billrate) / 1000000 / 60) * ((ts - nibble_data->pausets)); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Resumed billing! Subtracted %f from this billing cycle.\n", (atof(billrate) / 1000000 / 60) * ((ts - nibble_data->pausets))); @@ -711,11 +742,11 @@ static void nibblebill_reset(switch_core_session_t *session) } } -static float nibblebill_check(switch_core_session_t *session) +static double nibblebill_check(switch_core_session_t *session) { switch_channel_t *channel = switch_core_session_get_channel(session); nibble_data_t *nibble_data; - float amount = 0; + double amount = 0; if (!channel) { return -99999; @@ -744,7 +775,7 @@ static float nibblebill_check(switch_core_session_t *session) return amount; } -static void nibblebill_adjust(switch_core_session_t *session, float amount) +static void nibblebill_adjust(switch_core_session_t *session, double amount) { switch_channel_t *channel = switch_core_session_get_channel(session); const char *billaccount; @@ -780,7 +811,7 @@ SWITCH_STANDARD_APP(nibblebill_app_function) if (!zstr(data) && (lbuf = strdup(data)) && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { if (!strcasecmp(argv[0], "adjust") && argc == 2) { - nibblebill_adjust(session, (float) atof(argv[1])); + nibblebill_adjust(session, atof(argv[1])); } else if (!strcasecmp(argv[0], "flush")) { do_billing(session); } else if (!strcasecmp(argv[0], "pause")) { @@ -812,7 +843,7 @@ SWITCH_STANDARD_API(nibblebill_api_function) char *uuid = argv[0]; if ((psession = switch_core_session_locate(uuid))) { if (!strcasecmp(argv[1], "adjust") && argc == 3) { - nibblebill_adjust(psession, (float) atof(argv[2])); + nibblebill_adjust(psession, atof(argv[2])); } else if (!strcasecmp(argv[1], "flush")) { do_billing(psession); } else if (!strcasecmp(argv[1], "pause")) { diff --git a/src/mod/applications/mod_skel/mod_skel.2010.vcxproj b/src/mod/applications/mod_skel/mod_skel.2010.vcxproj index e1f1bf8c84..6c9d6763f5 100644 --- a/src/mod/applications/mod_skel/mod_skel.2010.vcxproj +++ b/src/mod/applications/mod_skel/mod_skel.2010.vcxproj @@ -63,10 +63,6 @@ <_ProjectFileVersion>10.0.30319.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ diff --git a/src/mod/applications/mod_sms/mod_sms.2010.vcxproj b/src/mod/applications/mod_sms/mod_sms.2010.vcxproj index 4dbbf47874..7be7e86fe1 100644 --- a/src/mod/applications/mod_sms/mod_sms.2010.vcxproj +++ b/src/mod/applications/mod_sms/mod_sms.2010.vcxproj @@ -1,4 +1,4 @@ - + @@ -20,7 +20,7 @@ mod_sms - {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39} + {2469B306-B027-4FF2-8815-C9C1EA2CAE79} mod_sms Win32Proj @@ -63,10 +63,6 @@ <_ProjectFileVersion>10.0.30319.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ @@ -132,4 +128,4 @@ - + \ No newline at end of file diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index 8c64d78ddc..ba5f7713f2 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -337,7 +337,7 @@ switch_status_t load_configuration(switch_bool_t reload) spandsp_globals.timezone = ""; /* TODO make configuration param */ - spandsp_globals.tonedebug = 1; + spandsp_globals.tonedebug = 0; if ((xml = switch_xml_open_cfg("spandsp.conf", &cfg, NULL)) || (xml = switch_xml_open_cfg("fax.conf", &cfg, NULL))) { status = SWITCH_STATUS_SUCCESS; @@ -446,7 +446,7 @@ switch_status_t load_configuration(switch_bool_t reload) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Missing name\n"); switch_goto_status(SWITCH_STATUS_FALSE, done); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Adding tone_descriptor: %s\n", name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Adding tone_descriptor: %s\n", name); if (tone_descriptor_create(&descriptor, name, spandsp_globals.config_pool) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Unable to allocate tone_descriptor: %s\n", name); switch_goto_status(SWITCH_STATUS_FALSE, done); @@ -467,7 +467,7 @@ switch_status_t load_configuration(switch_bool_t reload) "Unable to add tone_descriptor: %s, tone: %s. (too many tones)\n", name, tone_name); switch_goto_status(SWITCH_STATUS_FALSE, done); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Adding tone_descriptor: %s, tone: %s(%d)\n", name, tone_name, id); /* add elements to tone */ for (element = switch_xml_child(tone, "element"); element; element = switch_xml_next(element)) { @@ -502,7 +502,7 @@ switch_status_t load_configuration(switch_bool_t reload) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid element param.\n"); switch_goto_status(SWITCH_STATUS_FALSE, done); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Adding tone_descriptor: %s, tone: %s(%d), element (%d, %d, %d, %d)\n", name, tone_name, id, freq1, freq2, min, max); tone_descriptor_add_tone_element(descriptor, id, freq1, freq2, min, max); } diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index 2ba6c1af2f..7cb0982591 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -341,6 +341,7 @@ static int phase_b_handler(t30_state_t *s, void *user_data, int result) /* Fire event */ if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, pvt->app_mode == FUNCTION_TX ? SPANDSP_EVENT_TXFAXNEGOCIATERESULT : SPANDSP_EVENT_RXFAXNEGOCIATERESULT) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "uuid", switch_core_session_get_uuid(session)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-transfer-rate", fax_transfer_rate); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-ecm-used", (t30_stats.error_correcting_mode) ? "on" : "off"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-local-station-id", local_ident); @@ -437,6 +438,7 @@ static int phase_d_handler(t30_state_t *s, void *user_data, int msg) switch_channel_execute_on(channel, "execute_on_fax_phase_d"); if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, pvt->app_mode == FUNCTION_TX ? SPANDSP_EVENT_TXFAXPAGERESULT : SPANDSP_EVENT_RXFAXPAGERESULT) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "uuid", switch_core_session_get_uuid(session)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-document-transferred-pages", fax_document_transferred_pages); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-resolution", fax_image_resolution); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-size", fax_image_size); @@ -1303,7 +1305,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat prefix = spandsp_globals.prepend_string; } - if (!(pvt->filename = switch_core_session_sprintf(session, "%s/%s-%ld-%ld.tif", spandsp_globals.spool, prefix, spandsp_globals.total_sessions, time))) { + if (!(pvt->filename = switch_core_session_sprintf(session, "%s/%s-%ld-%" SWITCH_TIME_T_FMT ".tif", spandsp_globals.spool, prefix, spandsp_globals.total_sessions, time))) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot automatically set fax RX destination file\n"); goto done; } @@ -1683,7 +1685,7 @@ static switch_status_t t38_gateway_on_consume_media(switch_core_session_t *sessi switch_codec_implementation_t read_impl = { 0 }; int16_t *buf = NULL; switch_status_t status; - switch_size_t tx; + int 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; 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 e51192809f..9a237ac44a 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -428,6 +428,9 @@ SWITCH_STANDARD_APP(valet_parking_function) char *dest; int in = -1; + const char *timeout, *orbit_exten, *orbit_dialplan, *orbit_context; + char *timeout_str = "", *orbit_exten_str = "", *orbit_dialplan_str = "", *orbit_context_str = ""; + lot = valet_find_lot(lot_name, SWITCH_TRUE); switch_assert(lot); @@ -586,7 +589,28 @@ SWITCH_STANDARD_APP(valet_parking_function) music = "silence_stream://-1"; } - dest = switch_core_session_sprintf(session, "set:valet_ticket=%s,set:valet_hold_music=%s,sleep:1000,valet_park:%s %s", + if ((orbit_exten = switch_channel_get_variable(channel, "valet_parking_orbit_exten"))) { + orbit_exten_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_exten=%s,", orbit_exten); + } + + if ((orbit_dialplan = switch_channel_get_variable(channel, "valet_parking_orbit_dialplan"))) { + orbit_dialplan_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_dialplan=%s,", orbit_dialplan); + } + + if ((orbit_context = switch_channel_get_variable(channel, "valet_parking_orbit_context"))) { + orbit_context_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_context=%s,", orbit_context); + } + + if ((timeout = switch_channel_get_variable(channel, "valet_parking_timeout"))) { + timeout_str = switch_core_session_sprintf(session, "set:valet_parking_timeout=%s,", timeout); + } + + dest = switch_core_session_sprintf(session, "%s%s%s%s" + "set:valet_ticket=%s,set:valet_hold_music=%s,sleep:1000,valet_park:%s %s", + timeout_str, + orbit_exten_str, + orbit_dialplan_str, + orbit_context_str, token->uuid, music, lot_name, ext); switch_channel_set_variable(channel, "inline_destination", dest); diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 16dd999c99..55a25c1f2d 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -989,6 +989,8 @@ typedef enum { #define VM_ENTER_ID_MACRO "voicemail_enter_id" #define VM_ENTER_PASS_MACRO "voicemail_enter_pass" #define VM_FAIL_AUTH_MACRO "voicemail_fail_auth" +#define VM_CHANGE_PASS_SUCCESS_MACRO "voicemail_change_pass_success" +#define VM_CHANGE_PASS_FAIL_MACRO "voicemail_change_pass_fail" #define VM_ABORT_MACRO "voicemail_abort" #define VM_HELLO_MACRO "voicemail_hello" #define VM_GOODBYE_MACRO "voicemail_goodbye" @@ -1542,8 +1544,6 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t char cid_buf[1024] = ""; if (switch_channel_ready(channel)) { - const char *vm_announce_cid = NULL; - switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cbt->cid_number, cbt->cid_name); msg.from = __FILE__; @@ -1554,10 +1554,8 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t cid_buf, switch_channel_get_name(channel)); switch_core_session_receive_message(session, &msg); - if (!zstr(cbt->cid_number) && (vm_announce_cid = switch_channel_get_variable(channel, "vm_announce_cid"))) { - switch_ivr_play_file(session, NULL, vm_announce_cid, NULL); - switch_ivr_sleep(session, 500, SWITCH_TRUE, NULL); - switch_ivr_say(session, cbt->cid_number, NULL, "name_spelled", "pronounced", NULL, NULL); + if (!zstr(cbt->cid_number) && (switch_true(switch_channel_get_variable(channel, "vm_announce_cid")))) { + TRY_CODE(switch_ivr_phrase_macro(session, VM_SAY_PHONE_NUMBER_MACRO, cbt->cid_number, NULL, NULL)); } args.input_callback = cancel_on_dtmf; @@ -1863,6 +1861,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p const char *caller_id_name = NULL; const char *caller_id_number = NULL; int auth_only = 0, authed = 0; + switch_event_t *event; if (!(caller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name"))) { caller_id_name = caller_profile->caller_id_name; @@ -2168,6 +2167,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p int ok = 0; while (!ok) { + fail = 0; switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", VM_ENTER_PASS_MACRO, profile->terminator_key); TRY_CODE(switch_ivr_read(session, 0, 255, macro, NULL, buf, sizeof(buf), 10000, profile->terminator_key, 0)); @@ -2193,6 +2193,8 @@ 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); } else { sql = switch_mprintf("update voicemail_prefs set password='%s' where username='%s' and domain='%s'", buf, myid, domain_name); @@ -2200,6 +2202,8 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p switch_safe_free(file_path); switch_safe_free(sql); ok = 1; + /* add feedback for user - let him/her know that password change was successful */ + switch_ivr_phrase_macro(session, VM_CHANGE_PASS_SUCCESS_MACRO, NULL, NULL, NULL); } switch_event_destroy(¶ms); @@ -2451,6 +2455,14 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p } } + switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VM_EVENT_MAINT); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "VM-Action", "authentication"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "VM-Auth-Result", auth ? "success" : "fail"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "VM-User", myid); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "VM-Domain", domain_name); + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + FREE_DOMAIN_ROOT(); if (auth) { @@ -2517,19 +2529,21 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p status = switch_ivr_phrase_macro(session, VM_GOODBYE_MACRO, NULL, NULL, NULL); } - if (x_user) { - switch_xml_free(x_user); - x_user = NULL; - } - if (auth_only) { if (authed) { switch_channel_set_variable(channel, "user_pin_authenticated", "true"); + switch_channel_set_variable(channel, "user_pin_authenticated_user", myid); + if (!zstr(myid)) switch_ivr_set_user(session, myid); } else { switch_channel_hangup(channel, SWITCH_CAUSE_USER_CHALLENGE); } } + if (x_user) { + switch_xml_free(x_user); + x_user = NULL; + } + } @@ -3422,7 +3436,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p status = create_file(session, profile, record_macro, file_path, &message_len, SWITCH_TRUE, key_buf, buf); - if ((status == SWITCH_STATUS_NOTFOUND)) { + if (status == SWITCH_STATUS_NOTFOUND) { goto end; } @@ -3450,7 +3464,20 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p switch_core_session_get_pool(session), caller_id_name, caller_id_number, NULL, SWITCH_FALSE, session ? switch_core_session_get_uuid(session) : NULL, session); switch_event_destroy(&vars); - if (status != SWITCH_STATUS_SUCCESS) { + if (status == SWITCH_STATUS_SUCCESS) { + switch_core_time_duration_t duration; + char duration_str[80]; + switch_time_t l_duration = switch_time_make(message_len, 0); + + switch_core_measure_time(l_duration, &duration); + duration.day += duration.yr * 365; + duration.hr += duration.day * 24; + + switch_snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u", duration.hr, duration.min, duration.sec); + + switch_channel_set_variable(channel, "voicemail_message_len", duration_str); + + } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to deliver message\n"); TRY_CODE(switch_ivr_phrase_macro(session, VM_ACK_MACRO, "deleted", NULL, NULL)); } @@ -4356,7 +4383,7 @@ SWITCH_STANDARD_API(voicemail_inject_api_function) static int api_del_callback(void *pArg, int argc, char **argv, char **columnNames) { - unlink(argv[2]); + unlink(argv[3]); return 0; } @@ -4480,9 +4507,9 @@ SWITCH_STANDARD_API(voicemail_read_api_function) if (mread) { if (uuid) { - sql = switch_mprintf("update voicemail_msgs set read_epoch=%ld,flags='save' where uuid='%q'", (long) switch_epoch_time_now(NULL), uuid); + sql = switch_mprintf("update voicemail_msgs set read_epoch=%ld where uuid='%q'", (long) switch_epoch_time_now(NULL), uuid); } else { - sql = switch_mprintf("update voicemail_msgs set read_epoch=%ld,flags='save' where domain='%q'", (long) switch_epoch_time_now(NULL), domain); + sql = switch_mprintf("update voicemail_msgs set read_epoch=%ld where domain='%q'", (long) switch_epoch_time_now(NULL), domain); } } else{ if (uuid) { @@ -5605,6 +5632,158 @@ done: return SWITCH_STATUS_SUCCESS; } +#define VM_FSDB_MSG_EMAIL_USAGE " " +SWITCH_STANDARD_API(vm_fsdb_msg_email_function) +{ + const char *id = NULL, *domain = NULL, *profile_name = NULL, *uuid = NULL, *email = NULL; + vm_profile_t *profile = NULL; + char *argv[7] = { 0 }; + char *mycmd = NULL; + msg_get_callback_t cbt = { 0 }; + char *sql; + switch_memory_pool_t *pool; + + switch_core_new_memory_pool(&pool); + + if (!zstr(cmd)) { + mycmd = switch_core_strdup(pool, cmd); + switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argv[0]) + profile_name = argv[0]; + if (argv[1]) + domain = argv[1]; + if (argv[2]) + id = argv[2]; + if (argv[3]) + uuid = argv[3]; + if (argv[4]) + email = argv[4]; + + if (!profile_name || !domain || !id || !uuid || !email) { + stream->write_function(stream, "-ERR Missing Arguments\n"); + goto done; + } + + if (!(profile = get_profile(profile_name))) { + stream->write_function(stream, "-ERR Profile not found\n"); + goto done; + } else { + char *from; + char *headers, *header_string; + char *body; + int priority = 3; + switch_size_t retsize; + switch_time_exp_t tm; + char date[80] = ""; + int total_new_messages = 0; + int total_saved_messages = 0; + int total_new_urgent_messages = 0; + int total_saved_urgent_messages = 0; + int32_t message_len = 0; + char *p; + switch_time_t l_duration = 0; + switch_core_time_duration_t duration; + char duration_str[80]; + char *formatted_cid_num = NULL; + + sql = switch_mprintf("SELECT * FROM voicemail_msgs WHERE username = '%q' AND domain = '%q' AND uuid = '%q' ORDER BY read_flags, created_epoch", id, domain, uuid); + memset(&cbt, 0, sizeof(cbt)); + switch_event_create(&cbt.my_params, SWITCH_EVENT_GENERAL); + vm_execute_sql_callback(profile, profile->mutex, sql, message_get_callback, &cbt); + switch_safe_free(sql); + + if (!strcasecmp(switch_event_get_header(cbt.my_params, "VM-Message-Read-Flags"), URGENT_FLAG_STRING)) { + priority = 1; + } + + message_count(profile, id, domain, switch_event_get_header(cbt.my_params, "VM-Message-Folder"), &total_new_messages, &total_saved_messages, + &total_new_urgent_messages, &total_saved_urgent_messages); + + switch_time_exp_lt(&tm, switch_time_make(atol(switch_event_get_header(cbt.my_params, "VM-Message-Received-Epoch")), 0)); + switch_strftime(date, &retsize, sizeof(date), profile->date_fmt, &tm); + + formatted_cid_num = switch_format_number(switch_event_get_header(cbt.my_params, "VM-Message-Caller-Number")); + + /* Legacy Mod_VoiceMail variable */ + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "Message-Type", "forwarded-voicemail"); + switch_event_add_header(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_total_new_messages", "%d", total_new_messages); + switch_event_add_header(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_total_saved_messages", "%d", total_saved_messages); + switch_event_add_header(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_urgent_new_messages", "%d", total_new_urgent_messages); + switch_event_add_header(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_urgent_saved_messages", "%d", total_saved_urgent_messages); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_current_folder", switch_event_get_header(cbt.my_params, "VM-Message-Folder")); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_account", id); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_domain", domain); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_caller_id_number", switch_event_get_header(cbt.my_params, "VM-Message-Caller-Number")); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_formatted_caller_id_number", formatted_cid_num); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_caller_id_name", switch_event_get_header(cbt.my_params, "VM-Message-Caller-Name")); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_file_path", switch_event_get_header(cbt.my_params, "VM-Message-File-Path")); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_read_flags", switch_event_get_header(cbt.my_params, "VM-Message-Read-Flags")); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_time", date); + switch_event_add_header(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_priority", "%d", priority); + + + message_len = atoi(switch_event_get_header(cbt.my_params, "VM-Message-Duration")); + switch_safe_free(formatted_cid_num); + + l_duration = switch_time_make(atol(switch_event_get_header(cbt.my_params, "VM-Message-Duration")), 0); + switch_core_measure_time(l_duration, &duration); + duration.day += duration.yr * 365; + duration.hr += duration.day * 24; + + switch_snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u", duration.hr, duration.min, duration.sec); + + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_message_len", duration_str); + switch_event_add_header_string(cbt.my_params, SWITCH_STACK_BOTTOM, "voicemail_email", email); + + if (zstr(profile->email_from)) { + from = switch_core_sprintf(pool, "%s@%s", id, domain); + } else { + from = switch_event_expand_headers(cbt.my_params, profile->email_from);; + } + + if (zstr(profile->email_headers)) { + headers = switch_core_sprintf(pool, + "From: FreeSWITCH mod_voicemail <%s@%s>\nSubject: Voicemail from %s %s\nX-Priority: %d", + id, domain, switch_event_get_header(cbt.my_params, "VM-Message-Caller-Name"), + switch_event_get_header(cbt.my_params, "VM-Message-Caller-Number"), priority); + } else { + headers = switch_event_expand_headers(cbt.my_params, profile->email_headers); + } + + p = headers + (strlen(headers) - 1); + if (*p == '\n') { + if (*(p - 1) == '\r') { + p--; + } + *p = '\0'; + } + + header_string = switch_core_sprintf(pool, "%s\nX-Voicemail-Length: %u", headers, message_len); + + if (profile->email_body) { + body = switch_event_expand_headers(cbt.my_params, profile->email_body); + } else { + body = switch_mprintf("%u second Voicemail from %s %s", message_len, switch_event_get_header(cbt.my_params, "VM-Message-Caller-Name"), switch_event_get_header(cbt.my_params, "VM-Message-Caller-Number")); + } + + switch_simple_email(email, from, header_string, body, switch_event_get_header(cbt.my_params, "VM-Message-File-Path"), profile->convert_cmd, profile->convert_ext); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending message to %s\n", email); + switch_safe_free(body); + + switch_event_fire(&cbt.my_params); + + + profile_rwunlock(profile); + } + stream->write_function(stream, "-OK\n"); +done: + switch_core_destroy_memory_pool(&pool); + + return SWITCH_STATUS_SUCCESS; +} + #define VM_FSDB_MSG_COUNT_USAGE " " SWITCH_STANDARD_API(vm_fsdb_msg_count_function) { @@ -5731,6 +5910,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voicemail_load) SWITCH_ADD_API(commands_api_interface, "vm_fsdb_msg_get", "vm_fsdb_msg_get", vm_fsdb_msg_get_function, VM_FSDB_MSG_GET_USAGE); SWITCH_ADD_API(commands_api_interface, "vm_fsdb_msg_delete", "vm_fsdb_msg_delete", vm_fsdb_msg_delete_function, VM_FSDB_MSG_DELETE_USAGE); SWITCH_ADD_API(commands_api_interface, "vm_fsdb_msg_undelete", "vm_fsdb_msg_undelete", vm_fsdb_msg_undelete_function, VM_FSDB_MSG_UNDELETE_USAGE); + SWITCH_ADD_API(commands_api_interface, "vm_fsdb_msg_email", "vm_fsdb_msg_email", vm_fsdb_msg_email_function, VM_FSDB_MSG_EMAIL_USAGE); SWITCH_ADD_API(commands_api_interface, "vm_fsdb_msg_purge", "vm_fsdb_msg_purge", vm_fsdb_msg_purge_function, VM_FSDB_MSG_PURGE_USAGE); SWITCH_ADD_API(commands_api_interface, "vm_fsdb_msg_save", "vm_fsdb_msg_save", vm_fsdb_msg_save_function, VM_FSDB_MSG_SAVE_USAGE); SWITCH_ADD_API(commands_api_interface, "vm_fsdb_msg_forward", "vm_fsdb_msg_forward", vm_fsdb_msg_forward_function, VM_FSDB_MSG_FORWARD_USAGE); diff --git a/src/mod/applications/mod_voicemail_ivr/config.c b/src/mod/applications/mod_voicemail_ivr/config.c index d666ebe07f..a664d85462 100644 --- a/src/mod/applications/mod_voicemail_ivr/config.c +++ b/src/mod/applications/mod_voicemail_ivr/config.c @@ -93,6 +93,11 @@ void menu_init(vmivr_profile_t *profile, vmivr_menu_t *menu) { } } } + + if (!menu->phrase_params) { + switch_event_create(&menu->phrase_params, SWITCH_EVENT_REQUEST_PARAMS); + } + end: if (xml) switch_xml_free(xml); 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 51bfa6a521..bede1d0e04 100644 --- a/src/mod/applications/mod_voicemail_ivr/mod_voicemail_ivr.c +++ b/src/mod/applications/mod_voicemail_ivr/mod_voicemail_ivr.c @@ -54,13 +54,12 @@ SWITCH_STANDARD_APP(voicemail_ivr_function) const char *domain = NULL; const char *profile_name = NULL; vmivr_profile_t *profile = NULL; - int argc = 0; char *argv[6] = { 0 }; char *mydata = NULL; if (!zstr(data)) { mydata = switch_core_session_strdup(session, data); - argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); } if (argv[1]) diff --git a/src/mod/asr_tts/mod_flite/Makefile b/src/mod/asr_tts/mod_flite/Makefile index cdb2137f14..c93b48c1ca 100644 --- a/src/mod/asr_tts/mod_flite/Makefile +++ b/src/mod/asr_tts/mod_flite/Makefile @@ -1,4 +1,4 @@ -FLITE=flite-1.5.1 +FLITE=flite-1.5.4 FLITE_DIR=$(switch_srcdir)/libs/$(FLITE)-current FLITE_BUILDDIR=$(switch_builddir)/libs/$(FLITE)-current @@ -6,6 +6,7 @@ FLITE_BUILDDIR=$(switch_builddir)/libs/$(FLITE)-current FLITE_LIBDIR=$(FLITE_BUILDDIR)/build/libs FLITE_A=$(FLITE_LIBDIR)/libflite_cmu_us_awb.a \ $(FLITE_LIBDIR)/libflite_cmu_us_kal.a \ + $(FLITE_LIBDIR)/libflite_cmu_us_kal16.a \ $(FLITE_LIBDIR)/libflite_cmu_us_rms.a \ $(FLITE_LIBDIR)/libflite_cmu_us_slt.a \ $(FLITE_LIBDIR)/libflite_cmulex.a $(FLITE_LIBDIR)/libflite_usenglish.a $(FLITE_LIBDIR)/libflite.a -lm diff --git a/src/mod/asr_tts/mod_flite/mod_flite.2008.vcproj b/src/mod/asr_tts/mod_flite/mod_flite.2008.vcproj index 53fdaadb08..23758c9191 100644 --- a/src/mod/asr_tts/mod_flite/mod_flite.2008.vcproj +++ b/src/mod/asr_tts/mod_flite/mod_flite.2008.vcproj @@ -42,7 +42,7 @@ /> @@ -108,7 +108,7 @@ /> @@ -175,7 +175,7 @@ /> @@ -241,7 +241,7 @@ /> @@ -308,7 +308,7 @@ /> - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) APT_LIB_EXPORT;%(PreprocessorDefinitions) @@ -137,7 +137,7 @@ X64 - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) APT_LIB_EXPORT;%(PreprocessorDefinitions) @@ -152,7 +152,7 @@ - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) APT_LIB_EXPORT;%(PreprocessorDefinitions) @@ -170,7 +170,7 @@ X64 - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) APT_LIB_EXPORT;%(PreprocessorDefinitions) @@ -186,7 +186,7 @@ - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) @@ -203,7 +203,7 @@ X64 - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) @@ -218,7 +218,7 @@ - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) @@ -235,7 +235,7 @@ X64 - ../../../../libs/flite-1.3.99/include;%(AdditionalIncludeDirectories) + ../../../../libs/flite-1.5.4/include;%(AdditionalIncludeDirectories) @@ -258,7 +258,6 @@ {0ad1177e-1fd8-4643-9391-431467a11084} - false {202d7a4e-760d-4d0e-afa1-d7459ced30ff} diff --git a/src/mod/asr_tts/mod_flite/mod_flite.c b/src/mod/asr_tts/mod_flite/mod_flite.c index cd4bbfa66a..079818af07 100644 --- a/src/mod/asr_tts/mod_flite/mod_flite.c +++ b/src/mod/asr_tts/mod_flite/mod_flite.c @@ -44,6 +44,10 @@ void unregister_cmu_us_rms(cst_voice * v); cst_voice *register_cmu_us_slt(void); void unregister_cmu_us_slt(cst_voice * v); +cst_voice *register_cmu_us_kal16(void); +void unregister_cmu_us_kal16(cst_voice * v); + + SWITCH_MODULE_LOAD_FUNCTION(mod_flite_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_flite_shutdown); SWITCH_MODULE_DEFINITION(mod_flite, mod_flite_load, mod_flite_shutdown, NULL); @@ -53,6 +57,7 @@ static struct { cst_voice *kal; cst_voice *rms; cst_voice *slt; + cst_voice *kal16; } globals; struct flite_data { @@ -75,13 +80,18 @@ static switch_status_t flite_speech_open(switch_speech_handle_t *sh, const char if (!strcasecmp(voice_name, "awb")) { flite->v = globals.awb; } else if (!strcasecmp(voice_name, "kal")) { - flite->v = globals.kal; +/* "kal" is 8kHz and the native rate is set to 16kHz + * so kal talks a little bit too fast ... + * for now: "symlink" kal to kal16 + */ flite->v = globals.kal16; } else if (!strcasecmp(voice_name, "rms")) { flite->v = globals.rms; } else if (!strcasecmp(voice_name, "slt")) { flite->v = globals.slt; + } else if (!strcasecmp(voice_name, "kal16")) { + flite->v = globals.kal16; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Valid voice names are awb, kal, rms or slt.\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Valid voice names are awb, rms, slt or kal.\n"); } if (flite->v) { @@ -179,6 +189,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_flite_load) globals.kal = register_cmu_us_kal(); globals.rms = register_cmu_us_rms(); globals.slt = register_cmu_us_slt(); + globals.kal16 = register_cmu_us_kal16(); /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); @@ -203,6 +214,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_flite_shutdown) unregister_cmu_us_kal(globals.kal); unregister_cmu_us_rms(globals.rms); unregister_cmu_us_slt(globals.slt); + unregister_cmu_us_kal16(globals.kal16); return SWITCH_STATUS_UNLOAD; } diff --git a/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c b/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c index 0f3bc41f14..80be1d9686 100644 --- a/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c +++ b/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c @@ -105,7 +105,7 @@ static switch_status_t tts_commandline_speech_open(switch_speech_handle_t *sh, c /* Construct temporary file name with a new UUID */ switch_uuid_get(&uuid); switch_uuid_format(uuid_str, &uuid); - switch_snprintf(outfile, sizeof(outfile), "%s%s.tmp.wav", SWITCH_GLOBAL_dirs.temp_dir, uuid_str); + switch_snprintf(outfile, sizeof(outfile), "%s%s%s.tmp.wav", SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, uuid_str); info->file = switch_core_strdup(sh->memory_pool, outfile); info->fh = (switch_file_handle_t *) switch_core_alloc(sh->memory_pool, sizeof(switch_file_handle_t)); diff --git a/src/mod/codecs/mod_isac/LICENSE b/src/mod/codecs/mod_isac/LICENSE new file mode 100644 index 0000000000..4c41b7b251 --- /dev/null +++ b/src/mod/codecs/mod_isac/LICENSE @@ -0,0 +1,29 @@ +Copyright (c) 2011, The WebRTC project authors. 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 Google nor the names of its 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 +HOLDER 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. diff --git a/src/mod/codecs/mod_isac/Makefile b/src/mod/codecs/mod_isac/Makefile new file mode 100644 index 0000000000..d89cf0c613 --- /dev/null +++ b/src/mod/codecs/mod_isac/Makefile @@ -0,0 +1,71 @@ +BASE=../../../.. + +LOCAL_SOURCES=arith_routines.c\ +arith_routines_hist.c\ +arith_routines_logist.c\ +auto_correlation.c\ +auto_corr_to_refl_coef.c\ +bandwidth_estimator.c\ +complex_bit_reverse.c\ +complex_fft.c\ +copy_set_operations.c\ +crc.c\ +cross_correlation.c\ +decode_bwe.c\ +decode.c\ +division_operations.c\ +dot_product_with_scale.c\ +downsample_fast.c\ +encode.c\ +encode_lpc_swb.c\ +energy.c\ +entropy_coding.c\ +fft.c\ +filter_ar.c\ +filter_ar_fast_q12.c\ +filterbanks.c\ +filterbank_tables.c\ +filter_functions.c\ +filter_ma_fast_q12.c\ +get_hanning_window.c\ +get_scaling_square.c\ +ilbc_specific_functions.c\ +intialize.c\ +isac.c\ +lattice.c\ +levinson_durbin.c\ +lpc_analysis.c\ +lpc_gain_swb_tables.c\ +lpc_shape_swb12_tables.c\ +lpc_shape_swb16_tables.c\ +lpc_tables.c\ +lpc_to_refl_coef.c\ +min_max_operations.c\ +min_max_operations_neon.c\ +pitch_estimator.c\ +pitch_filter.c\ +pitch_gain_tables.c\ +pitch_lag_tables.c\ +randomization_functions.c\ +refl_coef_to_lpc.c\ +resample_48khz.c\ +resample_by_2.c\ +resample_by_2_internal.c\ +resample.c\ +resample_fractional.c\ +spectrum_ar_model_tables.c\ +splitting_filter.c\ +spl_sqrt.c\ +spl_sqrt_floor.c\ +spl_version.c\ +sqrt_of_one_minus_x_squared.c\ +transform.c\ +vector_scaling_operations.c\ +webrtc_fft_t_1024_8.c\ +webrtc_fft_t_rad.c "" + +LOCAL_OBJS=$(shell echo $(LOCAL_SOURCES) | sed "s/.c /.o /g") +LOCAL_CFLAGS=-w -I. + +include $(BASE)/build/modmake.rules + diff --git a/src/mod/codecs/mod_isac/PATENTS b/src/mod/codecs/mod_isac/PATENTS new file mode 100644 index 0000000000..190607ac26 --- /dev/null +++ b/src/mod/codecs/mod_isac/PATENTS @@ -0,0 +1,24 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the WebRTC code package. + +Google hereby grants to you a perpetual, worldwide, non-exclusive, +no-charge, irrevocable (except as stated in this section) patent +license to make, have made, use, offer to sell, sell, import, +transfer, and otherwise run, modify and propagate the contents of this +implementation of the WebRTC code package, where such license applies +only to those patent claims, both currently owned by Google and +acquired in the future, licensable by Google that are necessarily +infringed by this implementation of the WebRTC code package. This +grant does not include claims that would be infringed only as a +consequence of further modification of this implementation. If you or +your agent or exclusive licensee institute or order or agree to the +institution of patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that this +implementation of the WebRTC code package or any code incorporated +within this implementation of the WebRTC code package constitutes +direct or contributory patent infringement, or inducement of patent +infringement, then any patent rights granted to you under this License +for this implementation of the WebRTC code package shall terminate as +of the date such litigation is filed. diff --git a/src/mod/codecs/mod_isac/arith_routines.c b/src/mod/codecs/mod_isac/arith_routines.c new file mode 100644 index 0000000000..31c441a7af --- /dev/null +++ b/src/mod/codecs/mod_isac/arith_routines.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "arith_routines.h" +#include "settings.h" + + +/* + * terminate and return byte stream; + * returns the number of bytes in the stream + */ +int WebRtcIsac_EncTerminate(Bitstr *streamdata) /* in-/output struct containing bitstream */ +{ + WebRtc_UWord8 *stream_ptr; + + + /* point to the right place in the stream buffer */ + stream_ptr = streamdata->stream + streamdata->stream_index; + + /* find minimum length (determined by current interval width) */ + if ( streamdata->W_upper > 0x01FFFFFF ) + { + streamdata->streamval += 0x01000000; + /* add carry to buffer */ + if (streamdata->streamval < 0x01000000) + { + /* propagate carry */ + while ( !(++(*--stream_ptr)) ); + /* put pointer back to the old value */ + stream_ptr = streamdata->stream + streamdata->stream_index; + } + /* write remaining data to bitstream */ + *stream_ptr++ = (WebRtc_UWord8) (streamdata->streamval >> 24); + } + else + { + streamdata->streamval += 0x00010000; + /* add carry to buffer */ + if (streamdata->streamval < 0x00010000) + { + /* propagate carry */ + while ( !(++(*--stream_ptr)) ); + /* put pointer back to the old value */ + stream_ptr = streamdata->stream + streamdata->stream_index; + } + /* write remaining data to bitstream */ + *stream_ptr++ = (WebRtc_UWord8) (streamdata->streamval >> 24); + *stream_ptr++ = (WebRtc_UWord8) ((streamdata->streamval >> 16) & 0x00FF); + } + + /* calculate stream length */ + return (int)(stream_ptr - streamdata->stream); +} diff --git a/src/mod/codecs/mod_isac/arith_routines.h b/src/mod/codecs/mod_isac/arith_routines.h new file mode 100644 index 0000000000..8e5f496f98 --- /dev/null +++ b/src/mod/codecs/mod_isac/arith_routines.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * arith_routines.h + * + * Functions for arithmetic coding. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ARITH_ROUTINES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ARITH_ROUTINES_H_ + +#include "structs.h" + + +int WebRtcIsac_EncLogisticMulti2( + Bitstr *streamdata, /* in-/output struct containing bitstream */ + WebRtc_Word16 *dataQ7, /* input: data vector */ + const WebRtc_UWord16 *env, /* input: side info vector defining the width of the pdf */ + const int N, /* input: data vector length */ + const WebRtc_Word16 isSWB12kHz); /* if the codec is working in 12kHz bandwidth */ + +/* returns the number of bytes in the stream */ +int WebRtcIsac_EncTerminate(Bitstr *streamdata); /* in-/output struct containing bitstream */ + +/* returns the number of bytes in the stream so far */ +int WebRtcIsac_DecLogisticMulti2( + WebRtc_Word16 *data, /* output: data vector */ + Bitstr *streamdata, /* in-/output struct containing bitstream */ + const WebRtc_UWord16 *env, /* input: side info vector defining the width of the pdf */ + const WebRtc_Word16 *dither, /* input: dither vector */ + const int N, /* input: data vector length */ + const WebRtc_Word16 isSWB12kHz); /* if the codec is working in 12kHz bandwidth */ + +void WebRtcIsac_EncHistMulti( + Bitstr *streamdata, /* in-/output struct containing bitstream */ + const int *data, /* input: data vector */ + const WebRtc_UWord16 **cdf, /* input: array of cdf arrays */ + const int N); /* input: data vector length */ + +int WebRtcIsac_DecHistBisectMulti( + int *data, /* output: data vector */ + Bitstr *streamdata, /* in-/output struct containing bitstream */ + const WebRtc_UWord16 **cdf, /* input: array of cdf arrays */ + const WebRtc_UWord16 *cdf_size, /* input: array of cdf table sizes+1 (power of two: 2^k) */ + const int N); /* input: data vector length */ + +int WebRtcIsac_DecHistOneStepMulti( + int *data, /* output: data vector */ + Bitstr *streamdata, /* in-/output struct containing bitstream */ + const WebRtc_UWord16 **cdf, /* input: array of cdf arrays */ + const WebRtc_UWord16 *init_index,/* input: vector of initial cdf table search entries */ + const int N); /* input: data vector length */ + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ARITH_ROUTINES_H_ */ diff --git a/src/mod/codecs/mod_isac/arith_routines_hist.c b/src/mod/codecs/mod_isac/arith_routines_hist.c new file mode 100644 index 0000000000..f4a13d6078 --- /dev/null +++ b/src/mod/codecs/mod_isac/arith_routines_hist.c @@ -0,0 +1,291 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "settings.h" +#include "arith_routines.h" + + +/* + * code symbols into arithmetic bytestream + */ +void WebRtcIsac_EncHistMulti(Bitstr *streamdata, /* in-/output struct containing bitstream */ + const int *data, /* input: data vector */ + const WebRtc_UWord16 **cdf, /* input: array of cdf arrays */ + const int N) /* input: data vector length */ +{ + WebRtc_UWord32 W_lower, W_upper; + WebRtc_UWord32 W_upper_LSB, W_upper_MSB; + WebRtc_UWord8 *stream_ptr; + WebRtc_UWord8 *stream_ptr_carry; + WebRtc_UWord32 cdf_lo, cdf_hi; + int k; + + + /* point to beginning of stream buffer */ + stream_ptr = streamdata->stream + streamdata->stream_index; + W_upper = streamdata->W_upper; + + for (k=N; k>0; k--) + { + /* fetch cdf_lower and cdf_upper from cdf tables */ + cdf_lo = (WebRtc_UWord32) *(*cdf + *data); + cdf_hi = (WebRtc_UWord32) *(*cdf++ + *data++ + 1); + + /* update interval */ + W_upper_LSB = W_upper & 0x0000FFFF; + W_upper_MSB = W_upper >> 16; + W_lower = W_upper_MSB * cdf_lo; + W_lower += (W_upper_LSB * cdf_lo) >> 16; + W_upper = W_upper_MSB * cdf_hi; + W_upper += (W_upper_LSB * cdf_hi) >> 16; + + /* shift interval such that it begins at zero */ + W_upper -= ++W_lower; + + /* add integer to bitstream */ + streamdata->streamval += W_lower; + + /* handle carry */ + if (streamdata->streamval < W_lower) + { + /* propagate carry */ + stream_ptr_carry = stream_ptr; + while (!(++(*--stream_ptr_carry))); + } + + /* renormalize interval, store most significant byte of streamval and update streamval */ + while ( !(W_upper & 0xFF000000) ) /* W_upper < 2^24 */ + { + W_upper <<= 8; + *stream_ptr++ = (WebRtc_UWord8) (streamdata->streamval >> 24); + streamdata->streamval <<= 8; + } + } + + /* calculate new stream_index */ + streamdata->stream_index = (int)(stream_ptr - streamdata->stream); + streamdata->W_upper = W_upper; + + return; +} + + + +/* + * function to decode more symbols from the arithmetic bytestream, using method of bisection + * cdf tables should be of size 2^k-1 (which corresponds to an alphabet size of 2^k-2) + */ +int WebRtcIsac_DecHistBisectMulti(int *data, /* output: data vector */ + Bitstr *streamdata, /* in-/output struct containing bitstream */ + const WebRtc_UWord16 **cdf, /* input: array of cdf arrays */ + const WebRtc_UWord16 *cdf_size, /* input: array of cdf table sizes+1 (power of two: 2^k) */ + const int N) /* input: data vector length */ +{ + WebRtc_UWord32 W_lower, W_upper; + WebRtc_UWord32 W_tmp; + WebRtc_UWord32 W_upper_LSB, W_upper_MSB; + WebRtc_UWord32 streamval; + const WebRtc_UWord8 *stream_ptr; + const WebRtc_UWord16 *cdf_ptr; + int size_tmp; + int k; + + W_lower = 0; //to remove warning -DH + stream_ptr = streamdata->stream + streamdata->stream_index; + W_upper = streamdata->W_upper; + if (W_upper == 0) + /* Should not be possible in normal operation */ + return -2; + + if (streamdata->stream_index == 0) /* first time decoder is called for this stream */ + { + /* read first word from bytestream */ + streamval = *stream_ptr << 24; + streamval |= *++stream_ptr << 16; + streamval |= *++stream_ptr << 8; + streamval |= *++stream_ptr; + } else { + streamval = streamdata->streamval; + } + + for (k=N; k>0; k--) + { + /* find the integer *data for which streamval lies in [W_lower+1, W_upper] */ + W_upper_LSB = W_upper & 0x0000FFFF; + W_upper_MSB = W_upper >> 16; + + /* start halfway the cdf range */ + size_tmp = *cdf_size++ >> 1; + cdf_ptr = *cdf + (size_tmp - 1); + + /* method of bisection */ + for ( ;; ) + { + W_tmp = W_upper_MSB * *cdf_ptr; + W_tmp += (W_upper_LSB * *cdf_ptr) >> 16; + size_tmp >>= 1; + if (size_tmp == 0) break; + if (streamval > W_tmp) + { + W_lower = W_tmp; + cdf_ptr += size_tmp; + } else { + W_upper = W_tmp; + cdf_ptr -= size_tmp; + } + } + if (streamval > W_tmp) + { + W_lower = W_tmp; + *data++ = (int)(cdf_ptr - *cdf++); + } else { + W_upper = W_tmp; + *data++ = (int)(cdf_ptr - *cdf++ - 1); + } + + /* shift interval to start at zero */ + W_upper -= ++W_lower; + + /* add integer to bitstream */ + streamval -= W_lower; + + /* renormalize interval and update streamval */ + while ( !(W_upper & 0xFF000000) ) /* W_upper < 2^24 */ + { + /* read next byte from stream */ + streamval = (streamval << 8) | *++stream_ptr; + W_upper <<= 8; + } + + if (W_upper == 0) + /* Should not be possible in normal operation */ + return -2; + + + } + + streamdata->stream_index = (int)(stream_ptr - streamdata->stream); + streamdata->W_upper = W_upper; + streamdata->streamval = streamval; + + + /* find number of bytes in original stream (determined by current interval width) */ + if ( W_upper > 0x01FFFFFF ) + return streamdata->stream_index - 2; + else + return streamdata->stream_index - 1; +} + + + +/* + * function to decode more symbols from the arithmetic bytestream, taking single step up or + * down at a time + * cdf tables can be of arbitrary size, but large tables may take a lot of iterations + */ +int WebRtcIsac_DecHistOneStepMulti(int *data, /* output: data vector */ + Bitstr *streamdata, /* in-/output struct containing bitstream */ + const WebRtc_UWord16 **cdf, /* input: array of cdf arrays */ + const WebRtc_UWord16 *init_index, /* input: vector of initial cdf table search entries */ + const int N) /* input: data vector length */ +{ + WebRtc_UWord32 W_lower, W_upper; + WebRtc_UWord32 W_tmp; + WebRtc_UWord32 W_upper_LSB, W_upper_MSB; + WebRtc_UWord32 streamval; + const WebRtc_UWord8 *stream_ptr; + const WebRtc_UWord16 *cdf_ptr; + int k; + + + stream_ptr = streamdata->stream + streamdata->stream_index; + W_upper = streamdata->W_upper; + if (W_upper == 0) + /* Should not be possible in normal operation */ + return -2; + + if (streamdata->stream_index == 0) /* first time decoder is called for this stream */ + { + /* read first word from bytestream */ + streamval = *stream_ptr << 24; + streamval |= *++stream_ptr << 16; + streamval |= *++stream_ptr << 8; + streamval |= *++stream_ptr; + } else { + streamval = streamdata->streamval; + } + + + for (k=N; k>0; k--) + { + /* find the integer *data for which streamval lies in [W_lower+1, W_upper] */ + W_upper_LSB = W_upper & 0x0000FFFF; + W_upper_MSB = W_upper >> 16; + + /* start at the specified table entry */ + cdf_ptr = *cdf + (*init_index++); + W_tmp = W_upper_MSB * *cdf_ptr; + W_tmp += (W_upper_LSB * *cdf_ptr) >> 16; + if (streamval > W_tmp) + { + for ( ;; ) + { + W_lower = W_tmp; + if (cdf_ptr[0]==65535) + /* range check */ + return -3; + W_tmp = W_upper_MSB * *++cdf_ptr; + W_tmp += (W_upper_LSB * *cdf_ptr) >> 16; + if (streamval <= W_tmp) break; + } + W_upper = W_tmp; + *data++ = (int)(cdf_ptr - *cdf++ - 1); + } else { + for ( ;; ) + { + W_upper = W_tmp; + --cdf_ptr; + if (cdf_ptr<*cdf) { + /* range check */ + return -3; + } + W_tmp = W_upper_MSB * *cdf_ptr; + W_tmp += (W_upper_LSB * *cdf_ptr) >> 16; + if (streamval > W_tmp) break; + } + W_lower = W_tmp; + *data++ = (int)(cdf_ptr - *cdf++); + } + + /* shift interval to start at zero */ + W_upper -= ++W_lower; + /* add integer to bitstream */ + streamval -= W_lower; + + /* renormalize interval and update streamval */ + while ( !(W_upper & 0xFF000000) ) /* W_upper < 2^24 */ + { + /* read next byte from stream */ + streamval = (streamval << 8) | *++stream_ptr; + W_upper <<= 8; + } + } + + streamdata->stream_index = (int)(stream_ptr - streamdata->stream); + streamdata->W_upper = W_upper; + streamdata->streamval = streamval; + + + /* find number of bytes in original stream (determined by current interval width) */ + if ( W_upper > 0x01FFFFFF ) + return streamdata->stream_index - 2; + else + return streamdata->stream_index - 1; +} diff --git a/src/mod/codecs/mod_isac/arith_routines_logist.c b/src/mod/codecs/mod_isac/arith_routines_logist.c new file mode 100644 index 0000000000..422855a4ce --- /dev/null +++ b/src/mod/codecs/mod_isac/arith_routines_logist.c @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * arith_routines.h + * + * This file contains functions for arithmatically encoding and + * decoding DFT coefficients. + * + */ + + +#include "arith_routines.h" + + + +static const WebRtc_Word32 kHistEdgesQ15[51] = { + -327680, -314573, -301466, -288359, -275252, -262144, -249037, -235930, -222823, -209716, + -196608, -183501, -170394, -157287, -144180, -131072, -117965, -104858, -91751, -78644, + -65536, -52429, -39322, -26215, -13108, 0, 13107, 26214, 39321, 52428, + 65536, 78643, 91750, 104857, 117964, 131072, 144179, 157286, 170393, 183500, + 196608, 209715, 222822, 235929, 249036, 262144, 275251, 288358, 301465, 314572, + 327680}; + + +static const int kCdfSlopeQ0[51] = { /* Q0 */ + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 13, 23, 47, 87, 154, 315, 700, 1088, + 2471, 6064, 14221, 21463, 36634, 36924, 19750, 13270, 5806, 2312, + 1095, 660, 316, 145, 86, 41, 32, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 0}; + + +static const int kCdfQ16[51] = { /* Q16 */ + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 29, 38, 57, 92, 153, 279, 559, + 994, 1983, 4408, 10097, 18682, 33336, 48105, 56005, 61313, 63636, + 64560, 64998, 65262, 65389, 65447, 65481, 65497, 65510, 65512, 65514, + 65516, 65518, 65520, 65522, 65524, 65526, 65528, 65530, 65532, 65534, + 65535}; + + + +/* function to be converted to fixed point */ +static __inline WebRtc_UWord32 piecewise(WebRtc_Word32 xinQ15) { + + WebRtc_Word32 ind, qtmp1, qtmp2, qtmp3; + WebRtc_UWord32 tmpUW32; + + + qtmp2 = xinQ15; + + if (qtmp2 < kHistEdgesQ15[0]) { + qtmp2 = kHistEdgesQ15[0]; + } + if (qtmp2 > kHistEdgesQ15[50]) { + qtmp2 = kHistEdgesQ15[50]; + } + + qtmp1 = qtmp2 - kHistEdgesQ15[0]; /* Q15 - Q15 = Q15 */ + ind = (qtmp1 * 5) >> 16; /* 2^16 / 5 = 0.4 in Q15 */ + /* Q15 -> Q0 */ + qtmp1 = qtmp2 - kHistEdgesQ15[ind]; /* Q15 - Q15 = Q15 */ + qtmp2 = kCdfSlopeQ0[ind] * qtmp1; /* Q0 * Q15 = Q15 */ + qtmp3 = qtmp2>>15; /* Q15 -> Q0 */ + + tmpUW32 = kCdfQ16[ind] + qtmp3; /* Q0 + Q0 = Q0 */ + return tmpUW32; +} + + + +int WebRtcIsac_EncLogisticMulti2( + Bitstr *streamdata, /* in-/output struct containing bitstream */ + WebRtc_Word16 *dataQ7, /* input: data vector */ + const WebRtc_UWord16 *envQ8, /* input: side info vector defining the width of the pdf */ + const int N, /* input: data vector length / 2 */ + const WebRtc_Word16 isSWB12kHz) +{ + WebRtc_UWord32 W_lower, W_upper; + WebRtc_UWord32 W_upper_LSB, W_upper_MSB; + WebRtc_UWord8 *stream_ptr; + WebRtc_UWord8 *maxStreamPtr; + WebRtc_UWord8 *stream_ptr_carry; + WebRtc_UWord32 cdf_lo, cdf_hi; + int k; + + /* point to beginning of stream buffer */ + stream_ptr = streamdata->stream + streamdata->stream_index; + W_upper = streamdata->W_upper; + + maxStreamPtr = streamdata->stream + STREAM_SIZE_MAX_60 - 1; + for (k = 0; k < N; k++) + { + /* compute cdf_lower and cdf_upper by evaluating the piecewise linear cdf */ + cdf_lo = piecewise((*dataQ7 - 64) * *envQ8); + cdf_hi = piecewise((*dataQ7 + 64) * *envQ8); + + /* test and clip if probability gets too small */ + while (cdf_lo+1 >= cdf_hi) { + /* clip */ + if (*dataQ7 > 0) { + *dataQ7 -= 128; + cdf_hi = cdf_lo; + cdf_lo = piecewise((*dataQ7 - 64) * *envQ8); + } else { + *dataQ7 += 128; + cdf_lo = cdf_hi; + cdf_hi = piecewise((*dataQ7 + 64) * *envQ8); + } + } + + dataQ7++; + // increment only once per 4 iterations for SWB-16kHz or WB + // increment only once per 2 iterations for SWB-12kHz + envQ8 += (isSWB12kHz)? (k & 1):((k & 1) & (k >> 1)); + + + /* update interval */ + W_upper_LSB = W_upper & 0x0000FFFF; + W_upper_MSB = W_upper >> 16; + W_lower = W_upper_MSB * cdf_lo; + W_lower += (W_upper_LSB * cdf_lo) >> 16; + W_upper = W_upper_MSB * cdf_hi; + W_upper += (W_upper_LSB * cdf_hi) >> 16; + + /* shift interval such that it begins at zero */ + W_upper -= ++W_lower; + + /* add integer to bitstream */ + streamdata->streamval += W_lower; + + /* handle carry */ + if (streamdata->streamval < W_lower) + { + /* propagate carry */ + stream_ptr_carry = stream_ptr; + while (!(++(*--stream_ptr_carry))); + } + + /* renormalize interval, store most significant byte of streamval and update streamval */ + while ( !(W_upper & 0xFF000000) ) /* W_upper < 2^24 */ + { + W_upper <<= 8; + *stream_ptr++ = (WebRtc_UWord8) (streamdata->streamval >> 24); + + if(stream_ptr > maxStreamPtr) + { + return -ISAC_DISALLOWED_BITSTREAM_LENGTH; + } + streamdata->streamval <<= 8; + } + } + + /* calculate new stream_index */ + streamdata->stream_index = (int)(stream_ptr - streamdata->stream); + streamdata->W_upper = W_upper; + + return 0; +} + + + +int WebRtcIsac_DecLogisticMulti2( + WebRtc_Word16 *dataQ7, /* output: data vector */ + Bitstr *streamdata, /* in-/output struct containing bitstream */ + const WebRtc_UWord16 *envQ8, /* input: side info vector defining the width of the pdf */ + const WebRtc_Word16 *ditherQ7,/* input: dither vector */ + const int N, /* input: data vector length */ + const WebRtc_Word16 isSWB12kHz) +{ + WebRtc_UWord32 W_lower, W_upper; + WebRtc_UWord32 W_tmp; + WebRtc_UWord32 W_upper_LSB, W_upper_MSB; + WebRtc_UWord32 streamval; + const WebRtc_UWord8 *stream_ptr; + WebRtc_UWord32 cdf_tmp; + WebRtc_Word16 candQ7; + int k; + + stream_ptr = streamdata->stream + streamdata->stream_index; + W_upper = streamdata->W_upper; + if (streamdata->stream_index == 0) /* first time decoder is called for this stream */ + { + /* read first word from bytestream */ + streamval = *stream_ptr << 24; + streamval |= *++stream_ptr << 16; + streamval |= *++stream_ptr << 8; + streamval |= *++stream_ptr; + } else { + streamval = streamdata->streamval; + } + + + for (k = 0; k < N; k++) + { + /* find the integer *data for which streamval lies in [W_lower+1, W_upper] */ + W_upper_LSB = W_upper & 0x0000FFFF; + W_upper_MSB = W_upper >> 16; + + /* find first candidate by inverting the logistic cdf */ + candQ7 = - *ditherQ7 + 64; + cdf_tmp = piecewise(candQ7 * *envQ8); + + W_tmp = W_upper_MSB * cdf_tmp; + W_tmp += (W_upper_LSB * cdf_tmp) >> 16; + if (streamval > W_tmp) + { + W_lower = W_tmp; + candQ7 += 128; + cdf_tmp = piecewise(candQ7 * *envQ8); + + W_tmp = W_upper_MSB * cdf_tmp; + W_tmp += (W_upper_LSB * cdf_tmp) >> 16; + while (streamval > W_tmp) + { + W_lower = W_tmp; + candQ7 += 128; + cdf_tmp = piecewise(candQ7 * *envQ8); + + W_tmp = W_upper_MSB * cdf_tmp; + W_tmp += (W_upper_LSB * cdf_tmp) >> 16; + + /* error check */ + if (W_lower == W_tmp) return -1; + } + W_upper = W_tmp; + + /* another sample decoded */ + *dataQ7 = candQ7 - 64; + } + else + { + W_upper = W_tmp; + candQ7 -= 128; + cdf_tmp = piecewise(candQ7 * *envQ8); + + W_tmp = W_upper_MSB * cdf_tmp; + W_tmp += (W_upper_LSB * cdf_tmp) >> 16; + while ( !(streamval > W_tmp) ) + { + W_upper = W_tmp; + candQ7 -= 128; + cdf_tmp = piecewise(candQ7 * *envQ8); + + W_tmp = W_upper_MSB * cdf_tmp; + W_tmp += (W_upper_LSB * cdf_tmp) >> 16; + + /* error check */ + if (W_upper == W_tmp) return -1; + } + W_lower = W_tmp; + + /* another sample decoded */ + *dataQ7 = candQ7 + 64; + } + ditherQ7++; + dataQ7++; + // increment only once per 4 iterations for SWB-16kHz or WB + // increment only once per 2 iterations for SWB-12kHz + envQ8 += (isSWB12kHz)? (k & 1):((k & 1) & (k >> 1)); + + /* shift interval to start at zero */ + W_upper -= ++W_lower; + + /* add integer to bitstream */ + streamval -= W_lower; + + /* renormalize interval and update streamval */ + while ( !(W_upper & 0xFF000000) ) /* W_upper < 2^24 */ + { + /* read next byte from stream */ + streamval = (streamval << 8) | *++stream_ptr; + W_upper <<= 8; + } + } + + streamdata->stream_index = (int)(stream_ptr - streamdata->stream); + streamdata->W_upper = W_upper; + streamdata->streamval = streamval; + + /* find number of bytes in original stream (determined by current interval width) */ + if ( W_upper > 0x01FFFFFF ) + return streamdata->stream_index - 2; + else + return streamdata->stream_index - 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 new file mode 100644 index 0000000000..b7e885898a --- /dev/null +++ b/src/mod/codecs/mod_isac/auto_corr_to_refl_coef.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_AutoCorrToReflCoef(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_AutoCorrToReflCoef(G_CONST WebRtc_Word32 *R, int use_order, WebRtc_Word16 *K) +{ + int i, n; + WebRtc_Word16 tmp; + G_CONST WebRtc_Word32 *rptr; + WebRtc_Word32 L_num, L_den; + WebRtc_Word16 *acfptr, *pptr, *wptr, *p1ptr, *w1ptr, ACF[WEBRTC_SPL_MAX_LPC_ORDER], + P[WEBRTC_SPL_MAX_LPC_ORDER], W[WEBRTC_SPL_MAX_LPC_ORDER]; + + // Initialize loop and pointers. + acfptr = ACF; + rptr = R; + pptr = P; + p1ptr = &P[1]; + w1ptr = &W[1]; + wptr = w1ptr; + + // First loop; n=0. Determine shifting. + tmp = WebRtcSpl_NormW32(*R); + *acfptr = (WebRtc_Word16)((*rptr++ << tmp) >> 16); + *pptr++ = *acfptr++; + + // Initialize ACF, P and W. + for (i = 1; i <= use_order; i++) + { + *acfptr = (WebRtc_Word16)((*rptr++ << tmp) >> 16); + *wptr++ = *acfptr; + *pptr++ = *acfptr++; + } + + // Compute reflection coefficients. + for (n = 1; n <= use_order; n++, K++) + { + tmp = WEBRTC_SPL_ABS_W16(*p1ptr); + if (*P < tmp) + { + for (i = n; i <= use_order; i++) + *K++ = 0; + + return; + } + + // Division: WebRtcSpl_div(tmp, *P) + *K = 0; + if (tmp != 0) + { + L_num = tmp; + L_den = *P; + i = 15; + while (i--) + { + (*K) <<= 1; + L_num <<= 1; + if (L_num >= L_den) + { + L_num -= L_den; + (*K)++; + } + } + if (*p1ptr > 0) + *K = -*K; + } + + // Last iteration; don't do Schur recursion. + if (n == use_order) + return; + + // Schur recursion. + pptr = P; + wptr = w1ptr; + tmp = (WebRtc_Word16)(((WebRtc_Word32)*p1ptr * (WebRtc_Word32)*K + 16384) >> 15); + *pptr = WEBRTC_SPL_ADD_SAT_W16( *pptr, tmp ); + pptr++; + for (i = 1; i <= use_order - n; i++) + { + tmp = (WebRtc_Word16)(((WebRtc_Word32)*wptr * (WebRtc_Word32)*K + 16384) >> 15); + *pptr = WEBRTC_SPL_ADD_SAT_W16( *(pptr+1), tmp ); + pptr++; + tmp = (WebRtc_Word16)(((WebRtc_Word32)*pptr * (WebRtc_Word32)*K + 16384) >> 15); + *wptr = WEBRTC_SPL_ADD_SAT_W16( *wptr, tmp ); + wptr++; + } + } +} diff --git a/src/mod/codecs/mod_isac/auto_correlation.c b/src/mod/codecs/mod_isac/auto_correlation.c new file mode 100644 index 0000000000..a00fde4bc3 --- /dev/null +++ b/src/mod/codecs/mod_isac/auto_correlation.c @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_AutoCorrelation(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +int WebRtcSpl_AutoCorrelation(G_CONST WebRtc_Word16* in_vector, + int in_vector_length, + int order, + WebRtc_Word32* result, + int* scale) +{ + WebRtc_Word32 sum; + int i, j; + WebRtc_Word16 smax; // Sample max + G_CONST WebRtc_Word16* xptr1; + G_CONST WebRtc_Word16* xptr2; + WebRtc_Word32* resultptr; + int scaling = 0; + +#ifdef _ARM_OPT_ +#pragma message("NOTE: _ARM_OPT_ optimizations are used") + WebRtc_Word16 loops4; +#endif + + if (order < 0) + order = in_vector_length; + + // Find the max. sample + smax = WebRtcSpl_MaxAbsValueW16(in_vector, in_vector_length); + + // In order to avoid overflow when computing the sum we should scale the samples so that + // (in_vector_length * smax * smax) will not overflow. + + if (smax == 0) + { + scaling = 0; + } else + { + int nbits = WebRtcSpl_GetSizeInBits(in_vector_length); // # of bits in the sum loop + int t = WebRtcSpl_NormW32(WEBRTC_SPL_MUL(smax, smax)); // # of bits to normalize smax + + if (t > nbits) + { + scaling = 0; + } else + { + scaling = nbits - t; + } + + } + + resultptr = result; + + // Perform the actual correlation calculation + for (i = 0; i < order + 1; i++) + { + int loops = (in_vector_length - i); + sum = 0; + xptr1 = in_vector; + xptr2 = &in_vector[i]; +#ifndef _ARM_OPT_ + for (j = loops; j > 0; j--) + { + sum += WEBRTC_SPL_MUL_16_16_RSFT(*xptr1++, *xptr2++, scaling); + } +#else + loops4 = (loops >> 2) << 2; + + if (scaling == 0) + { + for (j = 0; j < loops4; j = j + 4) + { + sum += WEBRTC_SPL_MUL_16_16(*xptr1, *xptr2); + xptr1++; + xptr2++; + sum += WEBRTC_SPL_MUL_16_16(*xptr1, *xptr2); + xptr1++; + xptr2++; + sum += WEBRTC_SPL_MUL_16_16(*xptr1, *xptr2); + xptr1++; + xptr2++; + sum += WEBRTC_SPL_MUL_16_16(*xptr1, *xptr2); + xptr1++; + xptr2++; + } + + for (j = loops4; j < loops; j++) + { + sum += WEBRTC_SPL_MUL_16_16(*xptr1, *xptr2); + xptr1++; + xptr2++; + } + } + else + { + for (j = 0; j < loops4; j = j + 4) + { + sum += WEBRTC_SPL_MUL_16_16_RSFT(*xptr1, *xptr2, scaling); + xptr1++; + xptr2++; + sum += WEBRTC_SPL_MUL_16_16_RSFT(*xptr1, *xptr2, scaling); + xptr1++; + xptr2++; + sum += WEBRTC_SPL_MUL_16_16_RSFT(*xptr1, *xptr2, scaling); + xptr1++; + xptr2++; + sum += WEBRTC_SPL_MUL_16_16_RSFT(*xptr1, *xptr2, scaling); + xptr1++; + xptr2++; + } + + for (j = loops4; j < loops; j++) + { + sum += WEBRTC_SPL_MUL_16_16_RSFT(*xptr1, *xptr2, scaling); + xptr1++; + xptr2++; + } + } + +#endif + *resultptr++ = sum; + } + + *scale = scaling; + + return order + 1; +} diff --git a/src/mod/codecs/mod_isac/bandwidth_estimator.c b/src/mod/codecs/mod_isac/bandwidth_estimator.c new file mode 100644 index 0000000000..85912efbc8 --- /dev/null +++ b/src/mod/codecs/mod_isac/bandwidth_estimator.c @@ -0,0 +1,1024 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * BwEstimator.c + * + * This file contains the code for the Bandwidth Estimator designed + * for iSAC. + * + */ + +#include "bandwidth_estimator.h" +#include "settings.h" +#include "isac.h" + +#include + +/* array of quantization levels for bottle neck info; Matlab code: */ +/* sprintf('%4.1ff, ', logspace(log10(5000), log10(40000), 12)) */ +static const float kQRateTableWb[12] = +{ + 10000.0f, 11115.3f, 12355.1f, 13733.1f, 15264.8f, 16967.3f, + 18859.8f, 20963.3f, 23301.4f, 25900.3f, 28789.0f, 32000.0f}; + + +static const float kQRateTableSwb[24] = +{ + 10000.0f, 11115.3f, 12355.1f, 13733.1f, 15264.8f, 16967.3f, + 18859.8f, 20963.3f, 23153.1f, 25342.9f, 27532.7f, 29722.5f, + 31912.3f, 34102.1f, 36291.9f, 38481.7f, 40671.4f, 42861.2f, + 45051.0f, 47240.8f, 49430.6f, 51620.4f, 53810.2f, 56000.0f, +}; + + + + +WebRtc_Word32 WebRtcIsac_InitBandwidthEstimator( + BwEstimatorstr* bwest_str, + enum IsacSamplingRate encoderSampRate, + enum IsacSamplingRate decoderSampRate) +{ + switch(encoderSampRate) + { + case kIsacWideband: + { + bwest_str->send_bw_avg = INIT_BN_EST_WB; + break; + } + case kIsacSuperWideband: + { + bwest_str->send_bw_avg = INIT_BN_EST_SWB; + break; + } + default: + return -1; + } + + switch(decoderSampRate) + { + case kIsacWideband: + { + bwest_str->prev_frame_length = INIT_FRAME_LEN_WB; + bwest_str->rec_bw_inv = 1.0f / + (INIT_BN_EST_WB + INIT_HDR_RATE_WB); + bwest_str->rec_bw = (WebRtc_Word32)INIT_BN_EST_WB; + bwest_str->rec_bw_avg_Q = INIT_BN_EST_WB; + bwest_str->rec_bw_avg = INIT_BN_EST_WB + INIT_HDR_RATE_WB; + bwest_str->rec_header_rate = INIT_HDR_RATE_WB; + break; + } + case kIsacSuperWideband: + { + bwest_str->prev_frame_length = INIT_FRAME_LEN_SWB; + bwest_str->rec_bw_inv = 1.0f / + (INIT_BN_EST_SWB + INIT_HDR_RATE_SWB); + bwest_str->rec_bw = (WebRtc_Word32)INIT_BN_EST_SWB; + bwest_str->rec_bw_avg_Q = INIT_BN_EST_SWB; + bwest_str->rec_bw_avg = INIT_BN_EST_SWB + INIT_HDR_RATE_SWB; + bwest_str->rec_header_rate = INIT_HDR_RATE_SWB; + break; + } + default: + return -1; + } + + bwest_str->prev_rec_rtp_number = 0; + bwest_str->prev_rec_arr_ts = 0; + bwest_str->prev_rec_send_ts = 0; + bwest_str->prev_rec_rtp_rate = 1.0f; + bwest_str->last_update_ts = 0; + bwest_str->last_reduction_ts = 0; + bwest_str->count_tot_updates_rec = -9; + bwest_str->rec_jitter = 10.0f; + bwest_str->rec_jitter_short_term = 0.0f; + bwest_str->rec_jitter_short_term_abs = 5.0f; + bwest_str->rec_max_delay = 10.0f; + bwest_str->rec_max_delay_avg_Q = 10.0f; + bwest_str->num_pkts_rec = 0; + + bwest_str->send_max_delay_avg = 10.0f; + + bwest_str->hsn_detect_rec = 0; + + bwest_str->num_consec_rec_pkts_over_30k = 0; + + bwest_str->hsn_detect_snd = 0; + + bwest_str->num_consec_snt_pkts_over_30k = 0; + + bwest_str->in_wait_period = 0; + + bwest_str->change_to_WB = 0; + + bwest_str->numConsecLatePkts = 0; + bwest_str->consecLatency = 0; + bwest_str->inWaitLatePkts = 0; + bwest_str->senderTimestamp = 0; + bwest_str->receiverTimestamp = 0; + return 0; +} + +/* This function updates both bottle neck rates */ +/* Parameters: */ +/* rtp_number - value from RTP packet, from NetEq */ +/* frame length - length of signal frame in ms, from iSAC decoder */ +/* send_ts - value in RTP header giving send time in samples */ +/* arr_ts - value given by timeGetTime() time of arrival in samples of packet from NetEq */ +/* pksize - size of packet in bytes, from NetEq */ +/* Index - integer (range 0...23) indicating bottle neck & jitter as estimated by other side */ +/* returns 0 if everything went fine, -1 otherwise */ +WebRtc_Word16 WebRtcIsac_UpdateBandwidthEstimator( + BwEstimatorstr *bwest_str, + const WebRtc_UWord16 rtp_number, + const WebRtc_Word32 frame_length, + const WebRtc_UWord32 send_ts, + const WebRtc_UWord32 arr_ts, + const WebRtc_Word32 pksize + /*, const WebRtc_UWord16 Index*/) +{ + float weight = 0.0f; + float curr_bw_inv = 0.0f; + float rec_rtp_rate; + float t_diff_proj; + float arr_ts_diff; + float send_ts_diff; + float arr_time_noise; + float arr_time_noise_abs; + + float delay_correction_factor = 1; + float late_diff = 0.0f; + int immediate_set = 0; + int num_pkts_expected; + + + // We have to adjust the header-rate if the first packet has a + // frame-size different than the initialized value. + if ( frame_length != bwest_str->prev_frame_length ) + { + bwest_str->rec_header_rate = (float)HEADER_SIZE * 8.0f * + 1000.0f / (float)frame_length; /* bits/s */ + } + + /* UPDATE ESTIMATES ON THIS SIDE */ + /* compute far-side transmission rate */ + rec_rtp_rate = ((float)pksize * 8.0f * 1000.0f / (float)frame_length) + + bwest_str->rec_header_rate; + // rec_rtp_rate packet bits/s + header bits/s + + /* check for timer wrap-around */ + if (arr_ts < bwest_str->prev_rec_arr_ts) + { + bwest_str->prev_rec_arr_ts = arr_ts; + bwest_str->last_update_ts = arr_ts; + bwest_str->last_reduction_ts = arr_ts + 3*FS; + bwest_str->num_pkts_rec = 0; + + /* store frame length */ + bwest_str->prev_frame_length = frame_length; + + /* store far-side transmission rate */ + bwest_str->prev_rec_rtp_rate = rec_rtp_rate; + + /* store far-side RTP time stamp */ + bwest_str->prev_rec_rtp_number = rtp_number; + + return 0; + } + + bwest_str->num_pkts_rec++; + + /* check that it's not one of the first 9 packets */ + if ( bwest_str->count_tot_updates_rec > 0 ) + { + if(bwest_str->in_wait_period > 0 ) + { + bwest_str->in_wait_period--; + } + + bwest_str->inWaitLatePkts -= ((bwest_str->inWaitLatePkts > 0)? 1:0); + send_ts_diff = (float)(send_ts - bwest_str->prev_rec_send_ts); + + if (send_ts_diff <= (16 * frame_length)*2) + //doesn't allow for a dropped packet, not sure necessary to be + // that strict -DH + { + /* if not been updated for a long time, reduce the BN estimate */ + if((WebRtc_UWord32)(arr_ts - bwest_str->last_update_ts) * + 1000.0f / FS > 3000) + { + //how many frames should have been received since the last + // update if too many have been dropped or there have been + // big delays won't allow this reduction may no longer need + // the send_ts_diff here + num_pkts_expected = (int)(((float)(arr_ts - + bwest_str->last_update_ts) * 1000.0f /(float) FS) / + (float)frame_length); + + if(((float)bwest_str->num_pkts_rec/(float)num_pkts_expected) > + 0.9) + { + float inv_bitrate = (float) pow( 0.99995, + (double)((WebRtc_UWord32)(arr_ts - + bwest_str->last_reduction_ts)*1000.0f/FS) ); + + if ( inv_bitrate ) + { + bwest_str->rec_bw_inv /= inv_bitrate; + + //precautionary, likely never necessary + if (bwest_str->hsn_detect_snd && + bwest_str->hsn_detect_rec) + { + if (bwest_str->rec_bw_inv > 0.000066f) + { + bwest_str->rec_bw_inv = 0.000066f; + } + } + } + else + { + bwest_str->rec_bw_inv = 1.0f / + (INIT_BN_EST_WB + INIT_HDR_RATE_WB); + } + /* reset time-since-update counter */ + bwest_str->last_reduction_ts = arr_ts; + } + else + //reset here? + { + bwest_str->last_reduction_ts = arr_ts + 3*FS; + bwest_str->last_update_ts = arr_ts; + bwest_str->num_pkts_rec = 0; + } + } + } + else + { + bwest_str->last_reduction_ts = arr_ts + 3*FS; + bwest_str->last_update_ts = arr_ts; + bwest_str->num_pkts_rec = 0; + } + + + /* temporarily speed up adaptation if frame length has changed */ + if ( frame_length != bwest_str->prev_frame_length ) + { + bwest_str->count_tot_updates_rec = 10; + bwest_str->rec_header_rate = (float)HEADER_SIZE * 8.0f * + 1000.0f / (float)frame_length; /* bits/s */ + + bwest_str->rec_bw_inv = 1.0f /((float)bwest_str->rec_bw + + bwest_str->rec_header_rate); + } + + //////////////////////// + arr_ts_diff = (float)(arr_ts - bwest_str->prev_rec_arr_ts); + + if (send_ts_diff > 0 ) + { + late_diff = arr_ts_diff - send_ts_diff; + } + else + { + late_diff = arr_ts_diff - (float)(16 * frame_length); + } + + if((late_diff > 0) && !bwest_str->inWaitLatePkts) + { + bwest_str->numConsecLatePkts++; + bwest_str->consecLatency += late_diff; + } + else + { + bwest_str->numConsecLatePkts = 0; + bwest_str->consecLatency = 0; + } + if(bwest_str->numConsecLatePkts > 50) + { + float latencyMs = bwest_str->consecLatency/(FS/1000); + float averageLatencyMs = latencyMs / bwest_str->numConsecLatePkts; + delay_correction_factor = frame_length / (frame_length + averageLatencyMs); + immediate_set = 1; + bwest_str->inWaitLatePkts = (WebRtc_Word16)((bwest_str->consecLatency/(FS/1000)) / 30);// + 150; + bwest_str->start_wait_period = arr_ts; + } + /////////////////////////////////////////////// + + + + /* update only if previous packet was not lost */ + if ( rtp_number == bwest_str->prev_rec_rtp_number + 1 ) + { + + + if (!(bwest_str->hsn_detect_snd && bwest_str->hsn_detect_rec)) + { + if ((arr_ts_diff > (float)(16 * frame_length))) + { + //1/2 second + if ((late_diff > 8000.0f) && !bwest_str->in_wait_period) + { + delay_correction_factor = 0.7f; + bwest_str->in_wait_period = 55; + bwest_str->start_wait_period = arr_ts; + immediate_set = 1; + } + //320 ms + else if (late_diff > 5120.0f && !bwest_str->in_wait_period) + { + delay_correction_factor = 0.8f; + immediate_set = 1; + bwest_str->in_wait_period = 44; + bwest_str->start_wait_period = arr_ts; + } + } + } + + + if ((bwest_str->prev_rec_rtp_rate > bwest_str->rec_bw_avg) && + (rec_rtp_rate > bwest_str->rec_bw_avg) && + !bwest_str->in_wait_period) + { + /* test if still in initiation period and increment counter */ + if (bwest_str->count_tot_updates_rec++ > 99) + { + /* constant weight after initiation part */ + weight = 0.01f; + } + else + { + /* weight decreases with number of updates */ + weight = 1.0f / (float) bwest_str->count_tot_updates_rec; + } + /* Bottle Neck Estimation */ + + /* limit outliers */ + /* if more than 25 ms too much */ + if (arr_ts_diff > frame_length * FS/1000 + 400.0f) + { + // in samples, why 25ms?? + arr_ts_diff = frame_length * FS/1000 + 400.0f; + } + if(arr_ts_diff < (frame_length * FS/1000) - 160.0f) + { + /* don't allow it to be less than frame rate - 10 ms */ + arr_ts_diff = (float)frame_length * FS/1000 - 160.0f; + } + + /* compute inverse receiving rate for last packet */ + curr_bw_inv = arr_ts_diff / ((float)(pksize + HEADER_SIZE) * + 8.0f * FS); // (180+35)*8*16000 = 27.5 Mbit.... + + + if(curr_bw_inv < + (1.0f / (MAX_ISAC_BW + bwest_str->rec_header_rate))) + { + // don't allow inv rate to be larger than MAX + curr_bw_inv = (1.0f / + (MAX_ISAC_BW + bwest_str->rec_header_rate)); + } + + /* update bottle neck rate estimate */ + bwest_str->rec_bw_inv = weight * curr_bw_inv + + (1.0f - weight) * bwest_str->rec_bw_inv; + + /* reset time-since-update counter */ + bwest_str->last_update_ts = arr_ts; + bwest_str->last_reduction_ts = arr_ts + 3 * FS; + bwest_str->num_pkts_rec = 0; + + /* Jitter Estimation */ + /* projected difference between arrival times */ + t_diff_proj = ((float)(pksize + HEADER_SIZE) * 8.0f * + 1000.0f) / bwest_str->rec_bw_avg; + + + // difference between projected and actual + // arrival time differences + arr_time_noise = (float)(arr_ts_diff*1000.0f/FS) - + t_diff_proj; + arr_time_noise_abs = (float) fabs( arr_time_noise ); + + /* long term averaged absolute jitter */ + bwest_str->rec_jitter = weight * arr_time_noise_abs + + (1.0f - weight) * bwest_str->rec_jitter; + if (bwest_str->rec_jitter > 10.0f) + { + bwest_str->rec_jitter = 10.0f; + } + /* short term averaged absolute jitter */ + bwest_str->rec_jitter_short_term_abs = 0.05f * + arr_time_noise_abs + 0.95f * + bwest_str->rec_jitter_short_term_abs; + + /* short term averaged jitter */ + bwest_str->rec_jitter_short_term = 0.05f * arr_time_noise + + 0.95f * bwest_str->rec_jitter_short_term; + } + } + } + else + { + // reset time-since-update counter when + // receiving the first 9 packets + bwest_str->last_update_ts = arr_ts; + bwest_str->last_reduction_ts = arr_ts + 3*FS; + bwest_str->num_pkts_rec = 0; + + bwest_str->count_tot_updates_rec++; + } + + /* limit minimum bottle neck rate */ + if (bwest_str->rec_bw_inv > 1.0f / ((float)MIN_ISAC_BW + + bwest_str->rec_header_rate)) + { + bwest_str->rec_bw_inv = 1.0f / ((float)MIN_ISAC_BW + + bwest_str->rec_header_rate); + } + + // limit maximum bitrate + if (bwest_str->rec_bw_inv < 1.0f / ((float)MAX_ISAC_BW + + bwest_str->rec_header_rate)) + { + bwest_str->rec_bw_inv = 1.0f / ((float)MAX_ISAC_BW + + bwest_str->rec_header_rate); + } + + /* store frame length */ + bwest_str->prev_frame_length = frame_length; + + /* store far-side transmission rate */ + bwest_str->prev_rec_rtp_rate = rec_rtp_rate; + + /* store far-side RTP time stamp */ + bwest_str->prev_rec_rtp_number = rtp_number; + + // Replace bwest_str->rec_max_delay by the new + // value (atomic operation) + bwest_str->rec_max_delay = 3.0f * bwest_str->rec_jitter; + + /* store send and arrival time stamp */ + bwest_str->prev_rec_arr_ts = arr_ts ; + bwest_str->prev_rec_send_ts = send_ts; + + /* Replace bwest_str->rec_bw by the new value (atomic operation) */ + bwest_str->rec_bw = (WebRtc_Word32)(1.0f / bwest_str->rec_bw_inv - + bwest_str->rec_header_rate); + + if (immediate_set) + { + bwest_str->rec_bw = (WebRtc_Word32) (delay_correction_factor * + (float) bwest_str->rec_bw); + + if (bwest_str->rec_bw < (WebRtc_Word32) MIN_ISAC_BW) + { + bwest_str->rec_bw = (WebRtc_Word32) MIN_ISAC_BW; + } + + bwest_str->rec_bw_avg = bwest_str->rec_bw + + bwest_str->rec_header_rate; + + bwest_str->rec_bw_avg_Q = (float) bwest_str->rec_bw; + + bwest_str->rec_jitter_short_term = 0.0f; + + bwest_str->rec_bw_inv = 1.0f / (bwest_str->rec_bw + + bwest_str->rec_header_rate); + + bwest_str->count_tot_updates_rec = 1; + + immediate_set = 0; + bwest_str->consecLatency = 0; + bwest_str->numConsecLatePkts = 0; + } + + return 0; +} + + +/* This function updates the send bottle neck rate */ +/* Index - integer (range 0...23) indicating bottle neck & jitter as estimated by other side */ +/* returns 0 if everything went fine, -1 otherwise */ +WebRtc_Word16 WebRtcIsac_UpdateUplinkBwImpl( + BwEstimatorstr* bwest_str, + WebRtc_Word16 index, + enum IsacSamplingRate encoderSamplingFreq) +{ + if((index < 0) || (index > 23)) + { + return -ISAC_RANGE_ERROR_BW_ESTIMATOR; + } + + /* UPDATE ESTIMATES FROM OTHER SIDE */ + if(encoderSamplingFreq == kIsacWideband) + { + if(index > 11) + { + index -= 12; + /* compute the jitter estimate as decoded on the other side */ + bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg + + 0.1f * (float)MAX_ISAC_MD; + } + else + { + /* compute the jitter estimate as decoded on the other side */ + bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg + + 0.1f * (float)MIN_ISAC_MD; + } + + /* compute the BN estimate as decoded on the other side */ + bwest_str->send_bw_avg = 0.9f * bwest_str->send_bw_avg + + 0.1f * kQRateTableWb[index]; + } + else + { + /* compute the BN estimate as decoded on the other side */ + bwest_str->send_bw_avg = 0.9f * bwest_str->send_bw_avg + + 0.1f * kQRateTableSwb[index]; + } + + if (bwest_str->send_bw_avg > (float) 28000 && !bwest_str->hsn_detect_snd) + { + bwest_str->num_consec_snt_pkts_over_30k++; + + if (bwest_str->num_consec_snt_pkts_over_30k >= 66) + { + //approx 2 seconds with 30ms frames + bwest_str->hsn_detect_snd = 1; + } + } + else if (!bwest_str->hsn_detect_snd) + { + bwest_str->num_consec_snt_pkts_over_30k = 0; + } + return 0; +} + +// called when there is upper-band bit-stream to update jitter +// statistics. +WebRtc_Word16 WebRtcIsac_UpdateUplinkJitter( + BwEstimatorstr* bwest_str, + WebRtc_Word32 index) +{ + if((index < 0) || (index > 23)) + { + return -ISAC_RANGE_ERROR_BW_ESTIMATOR; + } + + if(index > 0) + { + /* compute the jitter estimate as decoded on the other side */ + bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg + + 0.1f * (float)MAX_ISAC_MD; + } + else + { + /* compute the jitter estimate as decoded on the other side */ + bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg + + 0.1f * (float)MIN_ISAC_MD; + } + + return 0; +} + + + +// Returns the bandwidth/jitter estimation code (integer 0...23) +// to put in the sending iSAC payload +WebRtc_UWord16 +WebRtcIsac_GetDownlinkBwJitIndexImpl( + BwEstimatorstr* bwest_str, + WebRtc_Word16* bottleneckIndex, + WebRtc_Word16* jitterInfo, + enum IsacSamplingRate decoderSamplingFreq) +{ + float MaxDelay; + //WebRtc_UWord16 MaxDelayBit; + + float rate; + float r; + float e1, e2; + const float weight = 0.1f; + const float* ptrQuantizationTable; + WebRtc_Word16 addJitterInfo; + WebRtc_Word16 minInd; + WebRtc_Word16 maxInd; + WebRtc_Word16 midInd; + + /* Get Max Delay Bit */ + /* get unquantized max delay */ + MaxDelay = (float)WebRtcIsac_GetDownlinkMaxDelay(bwest_str); + + if ( ((1.f - weight) * bwest_str->rec_max_delay_avg_Q + weight * + MAX_ISAC_MD - MaxDelay) > (MaxDelay - (1.f-weight) * + bwest_str->rec_max_delay_avg_Q - weight * MIN_ISAC_MD) ) + { + jitterInfo[0] = 0; + /* update quantized average */ + bwest_str->rec_max_delay_avg_Q = + (1.f - weight) * bwest_str->rec_max_delay_avg_Q + weight * + (float)MIN_ISAC_MD; + } + else + { + jitterInfo[0] = 1; + /* update quantized average */ + bwest_str->rec_max_delay_avg_Q = + (1.f-weight) * bwest_str->rec_max_delay_avg_Q + weight * + (float)MAX_ISAC_MD; + } + + // Get unquantized rate. + rate = (float)WebRtcIsac_GetDownlinkBandwidth(bwest_str); + + /* Get Rate Index */ + if(decoderSamplingFreq == kIsacWideband) + { + ptrQuantizationTable = kQRateTableWb; + addJitterInfo = 1; + maxInd = 11; + } + else + { + ptrQuantizationTable = kQRateTableSwb; + addJitterInfo = 0; + maxInd = 23; + } + + minInd = 0; + while(maxInd > minInd + 1) + { + midInd = (maxInd + minInd) >> 1; + if(rate > ptrQuantizationTable[midInd]) + { + minInd = midInd; + } + else + { + maxInd = midInd; + } + } + // Chose the index which gives results an average which is closest + // to rate + r = (1 - weight) * bwest_str->rec_bw_avg_Q - rate; + e1 = weight * ptrQuantizationTable[minInd] + r; + e2 = weight * ptrQuantizationTable[maxInd] + r; + e1 = (e1 > 0)? e1:-e1; + e2 = (e2 > 0)? e2:-e2; + if(e1 < e2) + { + bottleneckIndex[0] = minInd; + } + else + { + bottleneckIndex[0] = maxInd; + } + + bwest_str->rec_bw_avg_Q = (1 - weight) * bwest_str->rec_bw_avg_Q + + weight * ptrQuantizationTable[bottleneckIndex[0]]; + bottleneckIndex[0] += jitterInfo[0] * 12 * addJitterInfo; + + bwest_str->rec_bw_avg = (1 - weight) * bwest_str->rec_bw_avg + weight * + (rate + bwest_str->rec_header_rate); + + return 0; +} + + + +/* get the bottle neck rate from far side to here, as estimated on this side */ +WebRtc_Word32 WebRtcIsac_GetDownlinkBandwidth( const BwEstimatorstr *bwest_str) +{ + WebRtc_Word32 rec_bw; + float jitter_sign; + float bw_adjust; + + /* create a value between -1.0 and 1.0 indicating "average sign" of jitter */ + jitter_sign = bwest_str->rec_jitter_short_term / + bwest_str->rec_jitter_short_term_abs; + + /* adjust bw proportionally to negative average jitter sign */ + bw_adjust = 1.0f - jitter_sign * (0.15f + 0.15f * jitter_sign * jitter_sign); + + /* adjust Rate if jitter sign is mostly constant */ + rec_bw = (WebRtc_Word32)(bwest_str->rec_bw * bw_adjust); + + /* limit range of bottle neck rate */ + if (rec_bw < MIN_ISAC_BW) + { + rec_bw = MIN_ISAC_BW; + } + else if (rec_bw > MAX_ISAC_BW) + { + rec_bw = MAX_ISAC_BW; + } + return rec_bw; +} + +/* Returns the max delay (in ms) */ +WebRtc_Word32 +WebRtcIsac_GetDownlinkMaxDelay(const BwEstimatorstr *bwest_str) +{ + WebRtc_Word32 rec_max_delay; + + rec_max_delay = (WebRtc_Word32)(bwest_str->rec_max_delay); + + /* limit range of jitter estimate */ + if (rec_max_delay < MIN_ISAC_MD) + { + rec_max_delay = MIN_ISAC_MD; + } + else if (rec_max_delay > MAX_ISAC_MD) + { + rec_max_delay = MAX_ISAC_MD; + } + return rec_max_delay; +} + +/* get the bottle neck rate from here to far side, as estimated by far side */ +void +WebRtcIsac_GetUplinkBandwidth( + const BwEstimatorstr* bwest_str, + WebRtc_Word32* bitRate) +{ + /* limit range of bottle neck rate */ + if (bwest_str->send_bw_avg < MIN_ISAC_BW) + { + *bitRate = MIN_ISAC_BW; + } + else if (bwest_str->send_bw_avg > MAX_ISAC_BW) + { + *bitRate = MAX_ISAC_BW; + } + else + { + *bitRate = (WebRtc_Word32)(bwest_str->send_bw_avg); + } + return; +} + +/* Returns the max delay value from the other side in ms */ +WebRtc_Word32 +WebRtcIsac_GetUplinkMaxDelay(const BwEstimatorstr *bwest_str) +{ + WebRtc_Word32 send_max_delay; + + send_max_delay = (WebRtc_Word32)(bwest_str->send_max_delay_avg); + + /* limit range of jitter estimate */ + if (send_max_delay < MIN_ISAC_MD) + { + send_max_delay = MIN_ISAC_MD; + } + else if (send_max_delay > MAX_ISAC_MD) + { + send_max_delay = MAX_ISAC_MD; + } + return send_max_delay; +} + + +/* + * update long-term average bitrate and amount of data in buffer + * returns minimum payload size (bytes) + */ +int WebRtcIsac_GetMinBytes( + RateModel* State, + int StreamSize, /* bytes in bitstream */ + const int FrameSamples, /* samples per frame */ + const double BottleNeck, /* bottle neck rate; excl headers (bps) */ + const double DelayBuildUp, /* max delay from bottleneck buffering (ms) */ + enum ISACBandwidth bandwidth + /*,WebRtc_Word16 frequentLargePackets*/) +{ + double MinRate = 0.0; + int MinBytes; + double TransmissionTime; + int burstInterval = BURST_INTERVAL; + + // first 10 packets @ low rate, then INIT_BURST_LEN packets @ + // fixed rate of INIT_RATE bps + if (State->InitCounter > 0) + { + if (State->InitCounter-- <= INIT_BURST_LEN) + { + if(bandwidth == isac8kHz) + { + MinRate = INIT_RATE_WB; + } + else + { + MinRate = INIT_RATE_SWB; + } + } + else + { + MinRate = 0; + } + } + else + { + /* handle burst */ + if (State->BurstCounter) + { + if (State->StillBuffered < (1.0 - 1.0/BURST_LEN) * DelayBuildUp) + { + /* max bps derived from BottleNeck and DelayBuildUp values */ + MinRate = (1.0 + (FS/1000) * DelayBuildUp / + (double)(BURST_LEN * FrameSamples)) * BottleNeck; + } + else + { + // max bps derived from StillBuffered and DelayBuildUp + // values + MinRate = (1.0 + (FS/1000) * (DelayBuildUp - + State->StillBuffered) / (double)FrameSamples) * BottleNeck; + if (MinRate < 1.04 * BottleNeck) + { + MinRate = 1.04 * BottleNeck; + } + } + State->BurstCounter--; + } + } + + + /* convert rate from bits/second to bytes/packet */ + MinBytes = (int) (MinRate * FrameSamples / (8.0 * FS)); + + /* StreamSize will be adjusted if less than MinBytes */ + if (StreamSize < MinBytes) + { + StreamSize = MinBytes; + } + + /* keep track of when bottle neck was last exceeded by at least 1% */ + if (StreamSize * 8.0 * FS / FrameSamples > 1.01 * BottleNeck) { + if (State->PrevExceed) { + /* bottle_neck exceded twice in a row, decrease ExceedAgo */ + State->ExceedAgo -= /*BURST_INTERVAL*/ burstInterval / (BURST_LEN - 1); + if (State->ExceedAgo < 0) + State->ExceedAgo = 0; + } + else + { + State->ExceedAgo += (FrameSamples * 1000) / FS; /* ms */ + State->PrevExceed = 1; + } + } + else + { + State->PrevExceed = 0; + State->ExceedAgo += (FrameSamples * 1000) / FS; /* ms */ + } + + /* set burst flag if bottle neck not exceeded for long time */ + if ((State->ExceedAgo > burstInterval) && + (State->BurstCounter == 0)) + { + if (State->PrevExceed) + { + State->BurstCounter = BURST_LEN - 1; + } + else + { + State->BurstCounter = BURST_LEN; + } + } + + + /* Update buffer delay */ + TransmissionTime = StreamSize * 8.0 * 1000.0 / BottleNeck; /* ms */ + State->StillBuffered += TransmissionTime; + State->StillBuffered -= (FrameSamples * 1000) / FS; /* ms */ + if (State->StillBuffered < 0.0) + { + State->StillBuffered = 0.0; + } + + return MinBytes; +} + + +/* + * update long-term average bitrate and amount of data in buffer + */ +void WebRtcIsac_UpdateRateModel( + RateModel *State, + int StreamSize, /* bytes in bitstream */ + const int FrameSamples, /* samples per frame */ + const double BottleNeck) /* bottle neck rate; excl headers (bps) */ +{ + double TransmissionTime; + + /* avoid the initial "high-rate" burst */ + State->InitCounter = 0; + + /* Update buffer delay */ + TransmissionTime = StreamSize * 8.0 * 1000.0 / BottleNeck; /* ms */ + State->StillBuffered += TransmissionTime; + State->StillBuffered -= (FrameSamples * 1000) / FS; /* ms */ + if (State->StillBuffered < 0.0) + State->StillBuffered = 0.0; + +} + + +void WebRtcIsac_InitRateModel( + RateModel *State) +{ + State->PrevExceed = 0; /* boolean */ + State->ExceedAgo = 0; /* ms */ + State->BurstCounter = 0; /* packets */ + State->InitCounter = INIT_BURST_LEN + 10; /* packets */ + State->StillBuffered = 1.0; /* ms */ +} + +int WebRtcIsac_GetNewFrameLength( + double bottle_neck, + int current_framesamples) +{ + int new_framesamples; + + const int Thld_20_30 = 20000; + + //const int Thld_30_20 = 30000; + const int Thld_30_20 = 1000000; // disable 20 ms frames + + const int Thld_30_60 = 18000; + //const int Thld_30_60 = 0; // disable 60 ms frames + + const int Thld_60_30 = 27000; + + + new_framesamples = current_framesamples; + + /* find new framelength */ + switch(current_framesamples) { + case 320: + if (bottle_neck < Thld_20_30) + new_framesamples = 480; + break; + case 480: + if (bottle_neck < Thld_30_60) + new_framesamples = 960; + else if (bottle_neck > Thld_30_20) + new_framesamples = 320; + break; + case 960: + if (bottle_neck >= Thld_60_30) + new_framesamples = 480; + break; + } + + return new_framesamples; +} + +double WebRtcIsac_GetSnr( + double bottle_neck, + int framesamples) +{ + double s2nr; + + const double a_20 = -30.0; + const double b_20 = 0.8; + const double c_20 = 0.0; + + const double a_30 = -23.0; + const double b_30 = 0.48; + const double c_30 = 0.0; + + const double a_60 = -23.0; + const double b_60 = 0.53; + const double c_60 = 0.0; + + + /* find new SNR value */ + switch(framesamples) { + case 320: + s2nr = a_20 + b_20 * bottle_neck * 0.001 + c_20 * bottle_neck * + bottle_neck * 0.000001; + break; + case 480: + s2nr = a_30 + b_30 * bottle_neck * 0.001 + c_30 * bottle_neck * + bottle_neck * 0.000001; + break; + case 960: + s2nr = a_60 + b_60 * bottle_neck * 0.001 + c_60 * bottle_neck * + bottle_neck * 0.000001; + break; + default: + s2nr = 0; + } + + return s2nr; + +} diff --git a/src/mod/codecs/mod_isac/bandwidth_estimator.h b/src/mod/codecs/mod_isac/bandwidth_estimator.h new file mode 100644 index 0000000000..5604d7bbbd --- /dev/null +++ b/src/mod/codecs/mod_isac/bandwidth_estimator.h @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * bandwidth_estimator.h + * + * This header file contains the API for the Bandwidth Estimator + * designed for iSAC. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_BANDWIDTH_ESTIMATOR_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_BANDWIDTH_ESTIMATOR_H_ + +#include "structs.h" +#include "settings.h" + + +#define MIN_ISAC_BW 10000 +#define MIN_ISAC_BW_LB 10000 +#define MIN_ISAC_BW_UB 25000 + +#define MAX_ISAC_BW 56000 +#define MAX_ISAC_BW_UB 32000 +#define MAX_ISAC_BW_LB 32000 + +#define MIN_ISAC_MD 5 +#define MAX_ISAC_MD 25 + +// assumed header size, in bytes; we don't know the exact number +// (header compression may be used) +#define HEADER_SIZE 35 + +// Initial Frame-Size, in ms, for Wideband & Super-Wideband Mode +#define INIT_FRAME_LEN_WB 60 +#define INIT_FRAME_LEN_SWB 30 + +// Initial Bottleneck Estimate, in bits/sec, for +// Wideband & Super-wideband mode +#define INIT_BN_EST_WB 20e3f +#define INIT_BN_EST_SWB 56e3f + +// Initial Header rate (header rate depends on frame-size), +// in bits/sec, for Wideband & Super-Wideband mode. +#define INIT_HDR_RATE_WB \ + ((float)HEADER_SIZE * 8.0f * 1000.0f / (float)INIT_FRAME_LEN_WB) +#define INIT_HDR_RATE_SWB \ + ((float)HEADER_SIZE * 8.0f * 1000.0f / (float)INIT_FRAME_LEN_SWB) + +// number of packets in a row for a high rate burst +#define BURST_LEN 3 + +// ms, max time between two full bursts +#define BURST_INTERVAL 500 + +// number of packets in a row for initial high rate burst +#define INIT_BURST_LEN 5 + +// bits/s, rate for the first BURST_LEN packets +#define INIT_RATE_WB INIT_BN_EST_WB +#define INIT_RATE_SWB INIT_BN_EST_SWB + + +#if defined(__cplusplus) +extern "C" { +#endif + + /* This function initializes the struct */ + /* to be called before using the struct for anything else */ + /* returns 0 if everything went fine, -1 otherwise */ + WebRtc_Word32 WebRtcIsac_InitBandwidthEstimator( + BwEstimatorstr* bwest_str, + enum IsacSamplingRate encoderSampRate, + enum IsacSamplingRate decoderSampRate); + + /* This function updates the receiving estimate */ + /* Parameters: */ + /* rtp_number - value from RTP packet, from NetEq */ + /* frame length - length of signal frame in ms, from iSAC decoder */ + /* send_ts - value in RTP header giving send time in samples */ + /* arr_ts - value given by timeGetTime() time of arrival in samples of packet from NetEq */ + /* pksize - size of packet in bytes, from NetEq */ + /* Index - integer (range 0...23) indicating bottle neck & jitter as estimated by other side */ + /* returns 0 if everything went fine, -1 otherwise */ + WebRtc_Word16 WebRtcIsac_UpdateBandwidthEstimator( + BwEstimatorstr* bwest_str, + const WebRtc_UWord16 rtp_number, + const WebRtc_Word32 frame_length, + const WebRtc_UWord32 send_ts, + const WebRtc_UWord32 arr_ts, + const WebRtc_Word32 pksize); + + /* Update receiving estimates. Used when we only receive BWE index, no iSAC data packet. */ + WebRtc_Word16 WebRtcIsac_UpdateUplinkBwImpl( + BwEstimatorstr* bwest_str, + WebRtc_Word16 Index, + enum IsacSamplingRate encoderSamplingFreq); + + /* Returns the bandwidth/jitter estimation code (integer 0...23) to put in the sending iSAC payload */ + WebRtc_UWord16 WebRtcIsac_GetDownlinkBwJitIndexImpl( + BwEstimatorstr* bwest_str, + WebRtc_Word16* bottleneckIndex, + WebRtc_Word16* jitterInfo, + enum IsacSamplingRate decoderSamplingFreq); + + /* Returns the bandwidth estimation (in bps) */ + WebRtc_Word32 WebRtcIsac_GetDownlinkBandwidth( + const BwEstimatorstr *bwest_str); + + /* Returns the max delay (in ms) */ + WebRtc_Word32 WebRtcIsac_GetDownlinkMaxDelay( + const BwEstimatorstr *bwest_str); + + /* Returns the bandwidth that iSAC should send with in bps */ + void WebRtcIsac_GetUplinkBandwidth( + const BwEstimatorstr* bwest_str, + WebRtc_Word32* bitRate); + + /* Returns the max delay value from the other side in ms */ + WebRtc_Word32 WebRtcIsac_GetUplinkMaxDelay( + const BwEstimatorstr *bwest_str); + + + /* + * update amount of data in bottle neck buffer and burst handling + * returns minimum payload size (bytes) + */ + int WebRtcIsac_GetMinBytes( + RateModel* State, + int StreamSize, /* bytes in bitstream */ + const int FrameLen, /* ms per frame */ + const double BottleNeck, /* bottle neck rate; excl headers (bps) */ + const double DelayBuildUp, /* max delay from bottleneck buffering (ms) */ + enum ISACBandwidth bandwidth + /*,WebRtc_Word16 frequentLargePackets*/); + + /* + * update long-term average bitrate and amount of data in buffer + */ + void WebRtcIsac_UpdateRateModel( + RateModel* State, + int StreamSize, /* bytes in bitstream */ + const int FrameSamples, /* samples per frame */ + const double BottleNeck); /* bottle neck rate; excl headers (bps) */ + + + void WebRtcIsac_InitRateModel( + RateModel *State); + + /* Returns the new framelength value (input argument: bottle_neck) */ + int WebRtcIsac_GetNewFrameLength( + double bottle_neck, + int current_framelength); + + /* Returns the new SNR value (input argument: bottle_neck) */ + double WebRtcIsac_GetSnr( + double bottle_neck, + int new_framelength); + + + WebRtc_Word16 WebRtcIsac_UpdateUplinkJitter( + BwEstimatorstr* bwest_str, + WebRtc_Word32 index); + +#if defined(__cplusplus) +} +#endif + + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_BANDWIDTH_ESTIMATOR_H_ */ diff --git a/src/mod/codecs/mod_isac/codec.h b/src/mod/codecs/mod_isac/codec.h new file mode 100644 index 0000000000..6af27ea9e0 --- /dev/null +++ b/src/mod/codecs/mod_isac/codec.h @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * codec.h + * + * This header file contains the calls to the internal encoder + * and decoder functions. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CODEC_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CODEC_H_ + +#include "structs.h" + +int WebRtcIsac_EstimateBandwidth( + BwEstimatorstr* bwest_str, + Bitstr* streamdata, + WebRtc_Word32 packet_size, + WebRtc_UWord16 rtp_seq_number, + WebRtc_UWord32 send_ts, + WebRtc_UWord32 arr_ts, + enum IsacSamplingRate encoderSampRate, + enum IsacSamplingRate decoderSampRate); + +int WebRtcIsac_DecodeLb( + float* signal_out, + ISACLBDecStruct* ISACdec_obj, + WebRtc_Word16* current_framesamples, + WebRtc_Word16 isRCUPayload); + +int WebRtcIsac_DecodeRcuLb( + float* signal_out, + ISACLBDecStruct* ISACdec_obj, + WebRtc_Word16* current_framesamples); + +int WebRtcIsac_EncodeLb( + float* in, + ISACLBEncStruct* ISACencLB_obj, + WebRtc_Word16 codingMode, + WebRtc_Word16 bottleneckIndex); + +int WebRtcIsac_EncodeStoredDataLb( + const ISAC_SaveEncData_t* ISACSavedEnc_obj, + Bitstr* ISACBitStr_obj, + int BWnumber, + float scale); + + +int WebRtcIsac_EncodeStoredDataUb12( + const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, + Bitstr* bitStream, + WebRtc_Word32 jitterInfo, + float scale); + +int WebRtcIsac_EncodeStoredDataUb16( + const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, + Bitstr* bitStream, + WebRtc_Word32 jitterInfo, + float scale); + + +WebRtc_Word16 WebRtcIsac_GetRedPayloadUb( + const ISACUBSaveEncDataStruct* ISACSavedEncObj, + Bitstr* bitStreamObj, + enum ISACBandwidth bandwidth); +/****************************************************************************** + * WebRtcIsac_RateAllocation() + * Internal function to perform a rate-allocation for upper and lower-band, + * given a total rate. + * + * Input: + * - inRateBitPerSec : a total bit-rate in bits/sec. + * + * Output: + * - rateLBBitPerSec : a bit-rate allocated to the lower-band + * in bits/sec. + * - rateUBBitPerSec : a bit-rate allocated to the upper-band + * in bits/sec. + * + * Return value : 0 if rate allocation has been successful. + * -1 if failed to allocate rates. + */ + +WebRtc_Word16 +WebRtcIsac_RateAllocation( + WebRtc_Word32 inRateBitPerSec, + double* rateLBBitPerSec, + double* rateUBBitPerSec, + enum ISACBandwidth* bandwidthKHz); + + +/****************************************************************************** + * WebRtcIsac_DecodeUb16() + * + * Decode the upper-band if the codec is in 0-16 kHz mode. + * + * Input/Output: + * -ISACdec_obj : pointer to the upper-band decoder object. The + * bit-stream is stored inside the decoder object. + * + * Output: + * -signal_out : decoded audio, 480 samples 30 ms. + * + * Return value : >0 number of decoded bytes. + * <0 if an error occurred. + */ +int WebRtcIsac_DecodeUb16( + float* signal_out, + ISACUBDecStruct* ISACdec_obj, + WebRtc_Word16 isRCUPayload); + + +/****************************************************************************** + * WebRtcIsac_DecodeUb12() + * + * Decode the upper-band if the codec is in 0-12 kHz mode. + * + * Input/Output: + * -ISACdec_obj : pointer to the upper-band decoder object. The + * bit-stream is stored inside the decoder object. + * + * Output: + * -signal_out : decoded audio, 480 samples 30 ms. + * + * Return value : >0 number of decoded bytes. + * <0 if an error occurred. + */ +int WebRtcIsac_DecodeUb12( + float* signal_out, + ISACUBDecStruct* ISACdec_obj, + WebRtc_Word16 isRCUPayload); + + +/****************************************************************************** + * WebRtcIsac_EncodeUb16() + * + * Encode the upper-band if the codec is in 0-16 kHz mode. + * + * Input: + * -in : upper-band audio, 160 samples (10 ms). + * + * Input/Output: + * -ISACdec_obj : pointer to the upper-band encoder object. The + * bit-stream is stored inside the encoder object. + * + * Return value : >0 number of encoded bytes. + * <0 if an error occurred. + */ +int WebRtcIsac_EncodeUb16( + float* in, + ISACUBEncStruct* ISACenc_obj, + WebRtc_Word32 jitterInfo); + + +/****************************************************************************** + * WebRtcIsac_EncodeUb12() + * + * Encode the upper-band if the codec is in 0-12 kHz mode. + * + * Input: + * -in : upper-band audio, 160 samples (10 ms). + * + * Input/Output: + * -ISACdec_obj : pointer to the upper-band encoder object. The + * bit-stream is stored inside the encoder object. + * + * Return value : >0 number of encoded bytes. + * <0 if an error occurred. + */ +int WebRtcIsac_EncodeUb12( + float* in, + ISACUBEncStruct* ISACenc_obj, + WebRtc_Word32 jitterInfo); + +/************************** initialization functions *************************/ + +void WebRtcIsac_InitMasking(MaskFiltstr *maskdata); + +void WebRtcIsac_InitPreFilterbank(PreFiltBankstr *prefiltdata); + +void WebRtcIsac_InitPostFilterbank(PostFiltBankstr *postfiltdata); + +void WebRtcIsac_InitPitchFilter(PitchFiltstr *pitchfiltdata); + +void WebRtcIsac_InitPitchAnalysis(PitchAnalysisStruct *State); + + +/**************************** transform functions ****************************/ + +void WebRtcIsac_InitTransform(); + +void WebRtcIsac_Time2Spec(double *inre1, + double *inre2, + WebRtc_Word16 *outre, + WebRtc_Word16 *outim, + FFTstr *fftstr_obj); + +void WebRtcIsac_Spec2time(double *inre, + double *inim, + double *outre1, + double *outre2, + FFTstr *fftstr_obj); + + +/******************************* filter functions ****************************/ + +void WebRtcIsac_AllPoleFilter(double *InOut, + double *Coef, + int lengthInOut, + int orderCoef); + +void WebRtcIsac_AllZeroFilter(double *In, + double *Coef, + int lengthInOut, + int orderCoef, + double *Out); + +void WebRtcIsac_ZeroPoleFilter(double *In, + double *ZeroCoef, + double *PoleCoef, + int lengthInOut, + int orderCoef, + double *Out); + + +/***************************** filterbank functions **************************/ + +void WebRtcIsac_SplitAndFilter(double *in, + double *LP, + double *HP, + double *LP_la, + double *HP_la, + PreFiltBankstr *prefiltdata); + + +void WebRtcIsac_FilterAndCombine(double *InLP, + double *InHP, + double *Out, + PostFiltBankstr *postfiltdata); + + + +void WebRtcIsac_SplitAndFilterFloat(float *in, + float *LP, + float *HP, + double *LP_la, + double *HP_la, + PreFiltBankstr *prefiltdata); + + +void WebRtcIsac_FilterAndCombineFloat(float *InLP, + float *InHP, + float *Out, + PostFiltBankstr *postfiltdata); + + +/************************* normalized lattice filters ************************/ + +void WebRtcIsac_NormLatticeFilterMa(int orderCoef, + float *stateF, + float *stateG, + float *lat_in, + double *filtcoeflo, + double *lat_out); + +void WebRtcIsac_NormLatticeFilterAr(int orderCoef, + float *stateF, + float *stateG, + double *lat_in, + double *lo_filt_coef, + float *lat_out); + +void WebRtcIsac_Dir2Lat(double *a, + int orderCoef, + float *sth, + float *cth); + +void WebRtcIsac_AutoCorr(double *r, + const double *x, + int N, + int order); + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CODEC_H_ */ diff --git a/src/mod/codecs/mod_isac/complex_bit_reverse.c b/src/mod/codecs/mod_isac/complex_bit_reverse.c new file mode 100644 index 0000000000..85c76f8283 --- /dev/null +++ b/src/mod/codecs/mod_isac/complex_bit_reverse.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_ComplexBitReverse(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_ComplexBitReverse(WebRtc_Word16 frfi[], int stages) +{ + int mr, nn, n, l, m; + WebRtc_Word16 tr, ti; + + n = 1 << stages; + + mr = 0; + nn = n - 1; + + // decimation in time - re-order data + for (m = 1; m <= nn; ++m) + { + l = n; + do + { + l >>= 1; + } while (mr + l > nn); + mr = (mr & (l - 1)) + l; + + if (mr <= m) + continue; + + tr = frfi[2 * m]; + frfi[2 * m] = frfi[2 * mr]; + frfi[2 * mr] = tr; + + ti = frfi[2 * m + 1]; + frfi[2 * m + 1] = frfi[2 * mr + 1]; + frfi[2 * mr + 1] = ti; + } +} diff --git a/src/mod/codecs/mod_isac/complex_fft.c b/src/mod/codecs/mod_isac/complex_fft.c new file mode 100644 index 0000000000..1e8503c245 --- /dev/null +++ b/src/mod/codecs/mod_isac/complex_fft.c @@ -0,0 +1,425 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_ComplexFFT(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +#define CFFTSFT 14 +#define CFFTRND 1 +#define CFFTRND2 16384 + +#define CIFFTSFT 14 +#define CIFFTRND 1 + +static const WebRtc_Word16 kSinTable1024[] = { + 0, 201, 402, 603, 804, 1005, 1206, 1406, + 1607, 1808, 2009, 2209, 2410, 2610, 2811, 3011, + 3211, 3411, 3611, 3811, 4011, 4210, 4409, 4608, + 4807, 5006, 5205, 5403, 5601, 5799, 5997, 6195, + 6392, 6589, 6786, 6982, 7179, 7375, 7571, 7766, + 7961, 8156, 8351, 8545, 8739, 8932, 9126, 9319, + 9511, 9703, 9895, 10087, 10278, 10469, 10659, 10849, + 11038, 11227, 11416, 11604, 11792, 11980, 12166, 12353, + 12539, 12724, 12909, 13094, 13278, 13462, 13645, 13827, + 14009, 14191, 14372, 14552, 14732, 14911, 15090, 15268, + 15446, 15623, 15799, 15975, 16150, 16325, 16499, 16672, + 16845, 17017, 17189, 17360, 17530, 17699, 17868, 18036, + 18204, 18371, 18537, 18702, 18867, 19031, 19194, 19357, + 19519, 19680, 19840, 20000, 20159, 20317, 20474, 20631, + 20787, 20942, 21096, 21249, 21402, 21554, 21705, 21855, + 22004, 22153, 22301, 22448, 22594, 22739, 22883, 23027, + 23169, 23311, 23452, 23592, 23731, 23869, 24006, 24143, + 24278, 24413, 24546, 24679, 24811, 24942, 25072, 25201, + 25329, 25456, 25582, 25707, 25831, 25954, 26077, 26198, + 26318, 26437, 26556, 26673, 26789, 26905, 27019, 27132, + 27244, 27355, 27466, 27575, 27683, 27790, 27896, 28001, + 28105, 28208, 28309, 28410, 28510, 28608, 28706, 28802, + 28897, 28992, 29085, 29177, 29268, 29358, 29446, 29534, + 29621, 29706, 29790, 29873, 29955, 30036, 30116, 30195, + 30272, 30349, 30424, 30498, 30571, 30643, 30713, 30783, + 30851, 30918, 30984, 31049, + 31113, 31175, 31236, 31297, + 31356, 31413, 31470, 31525, 31580, 31633, 31684, 31735, + 31785, 31833, 31880, 31926, 31970, 32014, 32056, 32097, + 32137, 32176, 32213, 32249, 32284, 32318, 32350, 32382, + 32412, 32441, 32468, 32495, 32520, 32544, 32567, 32588, + 32609, 32628, 32646, 32662, 32678, 32692, 32705, 32717, + 32727, 32736, 32744, 32751, 32757, 32761, 32764, 32766, + 32767, 32766, 32764, 32761, 32757, 32751, 32744, 32736, + 32727, 32717, 32705, 32692, 32678, 32662, 32646, 32628, + 32609, 32588, 32567, 32544, 32520, 32495, 32468, 32441, + 32412, 32382, 32350, 32318, 32284, 32249, 32213, 32176, + 32137, 32097, 32056, 32014, 31970, 31926, 31880, 31833, + 31785, 31735, 31684, 31633, 31580, 31525, 31470, 31413, + 31356, 31297, 31236, 31175, 31113, 31049, 30984, 30918, + 30851, 30783, 30713, 30643, 30571, 30498, 30424, 30349, + 30272, 30195, 30116, 30036, 29955, 29873, 29790, 29706, + 29621, 29534, 29446, 29358, 29268, 29177, 29085, 28992, + 28897, 28802, 28706, 28608, 28510, 28410, 28309, 28208, + 28105, 28001, 27896, 27790, 27683, 27575, 27466, 27355, + 27244, 27132, 27019, 26905, 26789, 26673, 26556, 26437, + 26318, 26198, 26077, 25954, 25831, 25707, 25582, 25456, + 25329, 25201, 25072, 24942, 24811, 24679, 24546, 24413, + 24278, 24143, 24006, 23869, 23731, 23592, 23452, 23311, + 23169, 23027, 22883, 22739, 22594, 22448, 22301, 22153, + 22004, 21855, 21705, 21554, 21402, 21249, 21096, 20942, + 20787, 20631, 20474, 20317, 20159, 20000, 19840, 19680, + 19519, 19357, 19194, 19031, 18867, 18702, 18537, 18371, + 18204, 18036, 17868, 17699, 17530, 17360, 17189, 17017, + 16845, 16672, 16499, 16325, 16150, 15975, 15799, 15623, + 15446, 15268, 15090, 14911, 14732, 14552, 14372, 14191, + 14009, 13827, 13645, 13462, 13278, 13094, 12909, 12724, + 12539, 12353, 12166, 11980, 11792, 11604, 11416, 11227, + 11038, 10849, 10659, 10469, 10278, 10087, 9895, 9703, + 9511, 9319, 9126, 8932, 8739, 8545, 8351, 8156, + 7961, 7766, 7571, 7375, 7179, 6982, 6786, 6589, + 6392, 6195, 5997, 5799, 5601, 5403, 5205, 5006, + 4807, 4608, 4409, 4210, 4011, 3811, 3611, 3411, + 3211, 3011, 2811, 2610, 2410, 2209, 2009, 1808, + 1607, 1406, 1206, 1005, 804, 603, 402, 201, + 0, -201, -402, -603, -804, -1005, -1206, -1406, + -1607, -1808, -2009, -2209, -2410, -2610, -2811, -3011, + -3211, -3411, -3611, -3811, -4011, -4210, -4409, -4608, + -4807, -5006, -5205, -5403, -5601, -5799, -5997, -6195, + -6392, -6589, -6786, -6982, -7179, -7375, -7571, -7766, + -7961, -8156, -8351, -8545, -8739, -8932, -9126, -9319, + -9511, -9703, -9895, -10087, -10278, -10469, -10659, -10849, + -11038, -11227, -11416, -11604, -11792, -11980, -12166, -12353, + -12539, -12724, -12909, -13094, -13278, -13462, -13645, -13827, + -14009, -14191, -14372, -14552, -14732, -14911, -15090, -15268, + -15446, -15623, -15799, -15975, -16150, -16325, -16499, -16672, + -16845, -17017, -17189, -17360, -17530, -17699, -17868, -18036, + -18204, -18371, -18537, -18702, -18867, -19031, -19194, -19357, + -19519, -19680, -19840, -20000, -20159, -20317, -20474, -20631, + -20787, -20942, -21096, -21249, -21402, -21554, -21705, -21855, + -22004, -22153, -22301, -22448, -22594, -22739, -22883, -23027, + -23169, -23311, -23452, -23592, -23731, -23869, -24006, -24143, + -24278, -24413, -24546, -24679, -24811, -24942, -25072, -25201, + -25329, -25456, -25582, -25707, -25831, -25954, -26077, -26198, + -26318, -26437, -26556, -26673, -26789, -26905, -27019, -27132, + -27244, -27355, -27466, -27575, -27683, -27790, -27896, -28001, + -28105, -28208, -28309, -28410, -28510, -28608, -28706, -28802, + -28897, -28992, -29085, -29177, -29268, -29358, -29446, -29534, + -29621, -29706, -29790, -29873, -29955, -30036, -30116, -30195, + -30272, -30349, -30424, -30498, -30571, -30643, -30713, -30783, + -30851, -30918, -30984, -31049, -31113, -31175, -31236, -31297, + -31356, -31413, -31470, -31525, -31580, -31633, -31684, -31735, + -31785, -31833, -31880, -31926, -31970, -32014, -32056, -32097, + -32137, -32176, -32213, -32249, -32284, -32318, -32350, -32382, + -32412, -32441, -32468, -32495, -32520, -32544, -32567, -32588, + -32609, -32628, -32646, -32662, -32678, -32692, -32705, -32717, + -32727, -32736, -32744, -32751, -32757, -32761, -32764, -32766, + -32767, -32766, -32764, -32761, -32757, -32751, -32744, -32736, + -32727, -32717, -32705, -32692, -32678, -32662, -32646, -32628, + -32609, -32588, -32567, -32544, -32520, -32495, -32468, -32441, + -32412, -32382, -32350, -32318, -32284, -32249, -32213, -32176, + -32137, -32097, -32056, -32014, -31970, -31926, -31880, -31833, + -31785, -31735, -31684, -31633, -31580, -31525, -31470, -31413, + -31356, -31297, -31236, -31175, -31113, -31049, -30984, -30918, + -30851, -30783, -30713, -30643, -30571, -30498, -30424, -30349, + -30272, -30195, -30116, -30036, -29955, -29873, -29790, -29706, + -29621, -29534, -29446, -29358, -29268, -29177, -29085, -28992, + -28897, -28802, -28706, -28608, -28510, -28410, -28309, -28208, + -28105, -28001, -27896, -27790, -27683, -27575, -27466, -27355, + -27244, -27132, -27019, -26905, -26789, -26673, -26556, -26437, + -26318, -26198, -26077, -25954, -25831, -25707, -25582, -25456, + -25329, -25201, -25072, -24942, -24811, -24679, -24546, -24413, + -24278, -24143, -24006, -23869, -23731, -23592, -23452, -23311, + -23169, -23027, -22883, -22739, -22594, -22448, -22301, -22153, + -22004, -21855, -21705, -21554, -21402, -21249, -21096, -20942, + -20787, -20631, -20474, -20317, -20159, -20000, -19840, -19680, + -19519, -19357, -19194, -19031, -18867, -18702, -18537, -18371, + -18204, -18036, -17868, -17699, -17530, -17360, -17189, -17017, + -16845, -16672, -16499, -16325, -16150, -15975, -15799, -15623, + -15446, -15268, -15090, -14911, -14732, -14552, -14372, -14191, + -14009, -13827, -13645, -13462, -13278, -13094, -12909, -12724, + -12539, -12353, -12166, -11980, -11792, -11604, -11416, -11227, + -11038, -10849, -10659, -10469, -10278, -10087, -9895, -9703, + -9511, -9319, -9126, -8932, -8739, -8545, -8351, -8156, + -7961, -7766, -7571, -7375, -7179, -6982, -6786, -6589, + -6392, -6195, -5997, -5799, -5601, -5403, -5205, -5006, + -4807, -4608, -4409, -4210, -4011, -3811, -3611, -3411, + -3211, -3011, -2811, -2610, -2410, -2209, -2009, -1808, + -1607, -1406, -1206, -1005, -804, -603, -402, -201 +}; + +int WebRtcSpl_ComplexFFT(WebRtc_Word16 frfi[], int stages, int mode) +{ + int i, j, l, k, istep, n, m; + WebRtc_Word16 wr, wi; + WebRtc_Word32 tr32, ti32, qr32, qi32; + + /* The 1024-value is a constant given from the size of kSinTable1024[], + * and should not be changed depending on the input parameter 'stages' + */ + n = 1 << stages; + if (n > 1024) + return -1; + + l = 1; + k = 10 - 1; /* Constant for given kSinTable1024[]. Do not change + depending on the input parameter 'stages' */ + + if (mode == 0) + { + // mode==0: Low-complexity and Low-accuracy mode + while (l < n) + { + istep = l << 1; + + for (m = 0; m < l; ++m) + { + j = m << k; + + /* The 256-value is a constant given as 1/4 of the size of + * kSinTable1024[], and should not be changed depending on the input + * parameter 'stages'. It will result in 0 <= j < N_SINE_WAVE/2 + */ + wr = kSinTable1024[j + 256]; + wi = -kSinTable1024[j]; + + for (i = m; i < n; i += istep) + { + j = i + l; + + tr32 = WEBRTC_SPL_RSHIFT_W32((WEBRTC_SPL_MUL_16_16(wr, frfi[2 * j]) + - WEBRTC_SPL_MUL_16_16(wi, frfi[2 * j + 1])), 15); + + ti32 = WEBRTC_SPL_RSHIFT_W32((WEBRTC_SPL_MUL_16_16(wr, frfi[2 * j + 1]) + + WEBRTC_SPL_MUL_16_16(wi, frfi[2 * j])), 15); + + qr32 = (WebRtc_Word32)frfi[2 * i]; + qi32 = (WebRtc_Word32)frfi[2 * i + 1]; + frfi[2 * j] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qr32 - tr32, 1); + frfi[2 * j + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qi32 - ti32, 1); + frfi[2 * i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qr32 + tr32, 1); + frfi[2 * i + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qi32 + ti32, 1); + } + } + + --k; + l = istep; + + } + + } else + { + // mode==1: High-complexity and High-accuracy mode + while (l < n) + { + istep = l << 1; + + for (m = 0; m < l; ++m) + { + j = m << k; + + /* The 256-value is a constant given as 1/4 of the size of + * kSinTable1024[], and should not be changed depending on the input + * parameter 'stages'. It will result in 0 <= j < N_SINE_WAVE/2 + */ + wr = kSinTable1024[j + 256]; + wi = -kSinTable1024[j]; + +#ifdef WEBRTC_ARCH_ARM_V7A + WebRtc_Word32 wri; + WebRtc_Word32 frfi_r; + __asm__("pkhbt %0, %1, %2, lsl #16" : "=r"(wri) : + "r"((WebRtc_Word32)wr), "r"((WebRtc_Word32)wi)); +#endif + + for (i = m; i < n; i += istep) + { + j = i + l; + +#ifdef WEBRTC_ARCH_ARM_V7A + __asm__("pkhbt %0, %1, %2, lsl #16" : "=r"(frfi_r) : + "r"((WebRtc_Word32)frfi[2*j]), "r"((WebRtc_Word32)frfi[2*j +1])); + __asm__("smlsd %0, %1, %2, %3" : "=r"(tr32) : + "r"(wri), "r"(frfi_r), "r"(CFFTRND)); + __asm__("smladx %0, %1, %2, %3" : "=r"(ti32) : + "r"(wri), "r"(frfi_r), "r"(CFFTRND)); + +#else + tr32 = WEBRTC_SPL_MUL_16_16(wr, frfi[2 * j]) + - WEBRTC_SPL_MUL_16_16(wi, frfi[2 * j + 1]) + CFFTRND; + + ti32 = WEBRTC_SPL_MUL_16_16(wr, frfi[2 * j + 1]) + + WEBRTC_SPL_MUL_16_16(wi, frfi[2 * j]) + CFFTRND; +#endif + + tr32 = WEBRTC_SPL_RSHIFT_W32(tr32, 15 - CFFTSFT); + ti32 = WEBRTC_SPL_RSHIFT_W32(ti32, 15 - CFFTSFT); + + qr32 = ((WebRtc_Word32)frfi[2 * i]) << CFFTSFT; + qi32 = ((WebRtc_Word32)frfi[2 * i + 1]) << CFFTSFT; + + frfi[2 * j] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32( + (qr32 - tr32 + CFFTRND2), 1 + CFFTSFT); + frfi[2 * j + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32( + (qi32 - ti32 + CFFTRND2), 1 + CFFTSFT); + frfi[2 * i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32( + (qr32 + tr32 + CFFTRND2), 1 + CFFTSFT); + frfi[2 * i + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32( + (qi32 + ti32 + CFFTRND2), 1 + CFFTSFT); + } + } + + --k; + l = istep; + } + } + return 0; +} + +int WebRtcSpl_ComplexIFFT(WebRtc_Word16 frfi[], int stages, int mode) +{ + int i, j, l, k, istep, n, m, scale, shift; + WebRtc_Word16 wr, wi; + WebRtc_Word32 tr32, ti32, qr32, qi32; + WebRtc_Word32 tmp32, round2; + + /* The 1024-value is a constant given from the size of kSinTable1024[], + * and should not be changed depending on the input parameter 'stages' + */ + n = 1 << stages; + if (n > 1024) + return -1; + + scale = 0; + + l = 1; + k = 10 - 1; /* Constant for given kSinTable1024[]. Do not change + depending on the input parameter 'stages' */ + + while (l < n) + { + // variable scaling, depending upon data + shift = 0; + round2 = 8192; + + tmp32 = (WebRtc_Word32)WebRtcSpl_MaxAbsValueW16(frfi, 2 * n); + if (tmp32 > 13573) + { + shift++; + scale++; + round2 <<= 1; + } + if (tmp32 > 27146) + { + shift++; + scale++; + round2 <<= 1; + } + + istep = l << 1; + + if (mode == 0) + { + // mode==0: Low-complexity and Low-accuracy mode + for (m = 0; m < l; ++m) + { + j = m << k; + + /* The 256-value is a constant given as 1/4 of the size of + * kSinTable1024[], and should not be changed depending on the input + * parameter 'stages'. It will result in 0 <= j < N_SINE_WAVE/2 + */ + wr = kSinTable1024[j + 256]; + wi = kSinTable1024[j]; + + for (i = m; i < n; i += istep) + { + j = i + l; + + tr32 = WEBRTC_SPL_RSHIFT_W32((WEBRTC_SPL_MUL_16_16_RSFT(wr, frfi[2 * j], 0) + - WEBRTC_SPL_MUL_16_16_RSFT(wi, frfi[2 * j + 1], 0)), 15); + + ti32 = WEBRTC_SPL_RSHIFT_W32( + (WEBRTC_SPL_MUL_16_16_RSFT(wr, frfi[2 * j + 1], 0) + + WEBRTC_SPL_MUL_16_16_RSFT(wi,frfi[2*j],0)), 15); + + qr32 = (WebRtc_Word32)frfi[2 * i]; + qi32 = (WebRtc_Word32)frfi[2 * i + 1]; + frfi[2 * j] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qr32 - tr32, shift); + frfi[2 * j + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qi32 - ti32, shift); + frfi[2 * i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qr32 + tr32, shift); + frfi[2 * i + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(qi32 + ti32, shift); + } + } + } else + { + // mode==1: High-complexity and High-accuracy mode + + for (m = 0; m < l; ++m) + { + j = m << k; + + /* The 256-value is a constant given as 1/4 of the size of + * kSinTable1024[], and should not be changed depending on the input + * parameter 'stages'. It will result in 0 <= j < N_SINE_WAVE/2 + */ + wr = kSinTable1024[j + 256]; + wi = kSinTable1024[j]; + +#ifdef WEBRTC_ARCH_ARM_V7A + WebRtc_Word32 wri; + WebRtc_Word32 frfi_r; + __asm__("pkhbt %0, %1, %2, lsl #16" : "=r"(wri) : + "r"((WebRtc_Word32)wr), "r"((WebRtc_Word32)wi)); +#endif + + for (i = m; i < n; i += istep) + { + j = i + l; + +#ifdef WEBRTC_ARCH_ARM_V7A + __asm__("pkhbt %0, %1, %2, lsl #16" : "=r"(frfi_r) : + "r"((WebRtc_Word32)frfi[2*j]), "r"((WebRtc_Word32)frfi[2*j +1])); + __asm__("smlsd %0, %1, %2, %3" : "=r"(tr32) : + "r"(wri), "r"(frfi_r), "r"(CIFFTRND)); + __asm__("smladx %0, %1, %2, %3" : "=r"(ti32) : + "r"(wri), "r"(frfi_r), "r"(CIFFTRND)); +#else + + tr32 = WEBRTC_SPL_MUL_16_16(wr, frfi[2 * j]) + - WEBRTC_SPL_MUL_16_16(wi, frfi[2 * j + 1]) + CIFFTRND; + + ti32 = WEBRTC_SPL_MUL_16_16(wr, frfi[2 * j + 1]) + + WEBRTC_SPL_MUL_16_16(wi, frfi[2 * j]) + CIFFTRND; +#endif + tr32 = WEBRTC_SPL_RSHIFT_W32(tr32, 15 - CIFFTSFT); + ti32 = WEBRTC_SPL_RSHIFT_W32(ti32, 15 - CIFFTSFT); + + qr32 = ((WebRtc_Word32)frfi[2 * i]) << CIFFTSFT; + qi32 = ((WebRtc_Word32)frfi[2 * i + 1]) << CIFFTSFT; + + frfi[2 * j] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((qr32 - tr32+round2), + shift+CIFFTSFT); + frfi[2 * j + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32( + (qi32 - ti32 + round2), shift + CIFFTSFT); + frfi[2 * i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((qr32 + tr32 + round2), + shift + CIFFTSFT); + frfi[2 * i + 1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32( + (qi32 + ti32 + round2), shift + CIFFTSFT); + } + } + + } + --k; + l = istep; + } + return scale; +} diff --git a/src/mod/codecs/mod_isac/copy_set_operations.c b/src/mod/codecs/mod_isac/copy_set_operations.c new file mode 100644 index 0000000000..8247337754 --- /dev/null +++ b/src/mod/codecs/mod_isac/copy_set_operations.c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the implementation of functions + * WebRtcSpl_MemSetW16() + * WebRtcSpl_MemSetW32() + * WebRtcSpl_MemCpyReversedOrder() + * WebRtcSpl_CopyFromEndW16() + * WebRtcSpl_ZerosArrayW16() + * WebRtcSpl_ZerosArrayW32() + * WebRtcSpl_OnesArrayW16() + * WebRtcSpl_OnesArrayW32() + * + * The description header can be found in signal_processing_library.h + * + */ + +#include +#include "signal_processing_library.h" + + +void WebRtcSpl_MemSetW16(WebRtc_Word16 *ptr, WebRtc_Word16 set_value, int length) +{ + int j; + WebRtc_Word16 *arrptr = ptr; + + for (j = length; j > 0; j--) + { + *arrptr++ = set_value; + } +} + +void WebRtcSpl_MemSetW32(WebRtc_Word32 *ptr, WebRtc_Word32 set_value, int length) +{ + int j; + WebRtc_Word32 *arrptr = ptr; + + for (j = length; j > 0; j--) + { + *arrptr++ = set_value; + } +} + +void WebRtcSpl_MemCpyReversedOrder(WebRtc_Word16* dest, WebRtc_Word16* source, int length) +{ + int j; + WebRtc_Word16* destPtr = dest; + WebRtc_Word16* sourcePtr = source; + + for (j = 0; j < length; j++) + { + *destPtr-- = *sourcePtr++; + } +} + +WebRtc_Word16 WebRtcSpl_CopyFromEndW16(G_CONST WebRtc_Word16 *vector_in, + WebRtc_Word16 length, + WebRtc_Word16 samples, + WebRtc_Word16 *vector_out) +{ + // Copy the last of the input vector to vector_out + WEBRTC_SPL_MEMCPY_W16(vector_out, &vector_in[length - samples], samples); + + return samples; +} + +WebRtc_Word16 WebRtcSpl_ZerosArrayW16(WebRtc_Word16 *vector, WebRtc_Word16 length) +{ + WebRtcSpl_MemSetW16(vector, 0, length); + return length; +} + +WebRtc_Word16 WebRtcSpl_ZerosArrayW32(WebRtc_Word32 *vector, WebRtc_Word16 length) +{ + WebRtcSpl_MemSetW32(vector, 0, length); + return length; +} + +WebRtc_Word16 WebRtcSpl_OnesArrayW16(WebRtc_Word16 *vector, WebRtc_Word16 length) +{ + WebRtc_Word16 i; + WebRtc_Word16 *tmpvec = vector; + for (i = 0; i < length; i++) + { + *tmpvec++ = 1; + } + return length; +} + +WebRtc_Word16 WebRtcSpl_OnesArrayW32(WebRtc_Word32 *vector, WebRtc_Word16 length) +{ + WebRtc_Word16 i; + WebRtc_Word32 *tmpvec = vector; + for (i = 0; i < length; i++) + { + *tmpvec++ = 1; + } + return length; +} diff --git a/src/mod/codecs/mod_isac/crc.c b/src/mod/codecs/mod_isac/crc.c new file mode 100644 index 0000000000..098e4b7a69 --- /dev/null +++ b/src/mod/codecs/mod_isac/crc.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "crc.h" +#include +#include "signal_processing_library.h" + +#define POLYNOMIAL 0x04c11db7L + + +static const WebRtc_UWord32 kCrcTable[256] = { + 0, 0x4c11db7, 0x9823b6e, 0xd4326d9, 0x130476dc, 0x17c56b6b, + 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, + 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, + 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, + 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, + 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, + 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, + 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x18aeb13, 0x54bf6a4, + 0x808d07d, 0xcc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, + 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, + 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, + 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, + 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, + 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, + 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, + 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, + 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, + 0x3f9b762c, 0x3b5a6b9b, 0x315d626, 0x7d4cb91, 0xa97ed48, 0xe56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9, + 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, + 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, + 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, + 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, + 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, + 0x18197087, 0x1cd86d30, 0x29f3d35, 0x65e2082, 0xb1d065b, 0xfdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, + 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, + 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, + 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, + 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, + 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 +}; + + + + +/**************************************************************************** + * WebRtcIsac_GetCrc(...) + * + * This function returns a 32 bit CRC checksum of a bit stream + * + * Input: + * - bitstream : payload bitstream + * - len_bitstream_in_bytes : number of 8-bit words in the bit stream + * + * Output: + * - crc : checksum + * + * Return value : 0 - Ok + * -1 - Error + */ + +WebRtc_Word16 WebRtcIsac_GetCrc(const WebRtc_Word16* bitstream, + WebRtc_Word16 len_bitstream_in_bytes, + WebRtc_UWord32* crc) +{ + WebRtc_UWord8* bitstream_ptr_uw8; + WebRtc_UWord32 crc_state; + int byte_cntr; + int crc_tbl_indx; + + /* Sanity Check. */ + if (bitstream == NULL) { + return -1; + } + /* cast to UWord8 pointer */ + bitstream_ptr_uw8 = (WebRtc_UWord8 *)bitstream; + + /* initialize */ + crc_state = 0xFFFFFFFF; + + for (byte_cntr = 0; byte_cntr < len_bitstream_in_bytes; byte_cntr++) { + crc_tbl_indx = (WEBRTC_SPL_RSHIFT_U32(crc_state, 24) ^ + bitstream_ptr_uw8[byte_cntr]) & 0xFF; + crc_state = WEBRTC_SPL_LSHIFT_U32(crc_state, 8) ^ kCrcTable[crc_tbl_indx]; + } + + *crc = ~crc_state; + return 0; +} diff --git a/src/mod/codecs/mod_isac/crc.h b/src/mod/codecs/mod_isac/crc.h new file mode 100644 index 0000000000..015127894b --- /dev/null +++ b/src/mod/codecs/mod_isac/crc.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * crc.h + * + * Checksum functions + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CRC_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CRC_H_ + +#include "typedefs.h" + +/**************************************************************************** + * WebRtcIsac_GetCrc(...) + * + * This function returns a 32 bit CRC checksum of a bit stream + * + * Input: + * - encoded : payload bit stream + * - no_of_word8s : number of 8-bit words in the bit stream + * + * Output: + * - crc : checksum + * + * Return value : 0 - Ok + * -1 - Error + */ + +WebRtc_Word16 WebRtcIsac_GetCrc( + const WebRtc_Word16* encoded, + WebRtc_Word16 no_of_word8s, + WebRtc_UWord32* crc); + + + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CRC_H_ */ diff --git a/src/mod/codecs/mod_isac/cross_correlation.c b/src/mod/codecs/mod_isac/cross_correlation.c new file mode 100644 index 0000000000..726a74967b --- /dev/null +++ b/src/mod/codecs/mod_isac/cross_correlation.c @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_CrossCorrelation(). + * The description header can be found in signal_processing_library.h + * + */ + +/* TODO(kma): Clean up the code in this file, and break it up for + * various platforms (Xscale, ARM/Neon etc.). + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_CrossCorrelation(WebRtc_Word32* cross_correlation, WebRtc_Word16* seq1, + WebRtc_Word16* seq2, WebRtc_Word16 dim_seq, + WebRtc_Word16 dim_cross_correlation, + WebRtc_Word16 right_shifts, + WebRtc_Word16 step_seq2) +{ + int i, j; + WebRtc_Word16* seq1Ptr; + WebRtc_Word16* seq2Ptr; + WebRtc_Word32* CrossCorrPtr; + +#ifdef _XSCALE_OPT_ + +#ifdef _WIN32 +#pragma message("NOTE: _XSCALE_OPT_ optimizations are used (overrides _ARM_OPT_ and requires /QRxscale compiler flag)") +#endif + + __int64 macc40; + + int iseq1[250]; + int iseq2[250]; + int iseq3[250]; + int * iseq1Ptr; + int * iseq2Ptr; + int * iseq3Ptr; + int len, i_len; + + seq1Ptr = seq1; + iseq1Ptr = iseq1; + for(i = 0; i < ((dim_seq + 1) >> 1); i++) + { + *iseq1Ptr = (unsigned short)*seq1Ptr++; + *iseq1Ptr++ |= (WebRtc_Word32)*seq1Ptr++ << 16; + + } + + if(dim_seq%2) + { + *(iseq1Ptr-1) &= 0x0000ffff; + } + *iseq1Ptr = 0; + iseq1Ptr++; + *iseq1Ptr = 0; + iseq1Ptr++; + *iseq1Ptr = 0; + + if(step_seq2 < 0) + { + seq2Ptr = seq2 - dim_cross_correlation + 1; + CrossCorrPtr = &cross_correlation[dim_cross_correlation - 1]; + } + else + { + seq2Ptr = seq2; + CrossCorrPtr = cross_correlation; + } + + len = dim_seq + dim_cross_correlation - 1; + i_len = (len + 1) >> 1; + iseq2Ptr = iseq2; + + iseq3Ptr = iseq3; + for(i = 0; i < i_len; i++) + { + *iseq2Ptr = (unsigned short)*seq2Ptr++; + *iseq3Ptr = (unsigned short)*seq2Ptr; + *iseq2Ptr++ |= (WebRtc_Word32)*seq2Ptr++ << 16; + *iseq3Ptr++ |= (WebRtc_Word32)*seq2Ptr << 16; + } + + if(len % 2) + { + iseq2[i_len - 1] &= 0x0000ffff; + iseq3[i_len - 1] = 0; + } + else + iseq3[i_len - 1] &= 0x0000ffff; + + iseq2[i_len] = 0; + iseq3[i_len] = 0; + iseq2[i_len + 1] = 0; + iseq3[i_len + 1] = 0; + iseq2[i_len + 2] = 0; + iseq3[i_len + 2] = 0; + + // Set pointer to start value + iseq2Ptr = iseq2; + iseq3Ptr = iseq3; + + i_len = (dim_seq + 7) >> 3; + for (i = 0; i < dim_cross_correlation; i++) + { + + iseq1Ptr = iseq1; + + macc40 = 0; + + _WriteCoProcessor(macc40, 0); + + if((i & 1)) + { + iseq3Ptr = iseq3 + (i >> 1); + for (j = i_len; j > 0; j--) + { + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq3Ptr++); + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq3Ptr++); + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq3Ptr++); + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq3Ptr++); + } + } + else + { + iseq2Ptr = iseq2 + (i >> 1); + for (j = i_len; j > 0; j--) + { + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq2Ptr++); + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq2Ptr++); + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq2Ptr++); + _SmulAddPack_2SW_ACC(*iseq1Ptr++, *iseq2Ptr++); + } + + } + + macc40 = _ReadCoProcessor(0); + *CrossCorrPtr = (WebRtc_Word32)(macc40 >> right_shifts); + CrossCorrPtr += step_seq2; + } +#else // #ifdef _XSCALE_OPT_ +#ifdef _ARM_OPT_ + WebRtc_Word16 dim_seq8 = (dim_seq >> 3) << 3; +#endif + + CrossCorrPtr = cross_correlation; + + for (i = 0; i < dim_cross_correlation; i++) + { + // Set the pointer to the static vector, set the pointer to the sliding vector + // and initialize cross_correlation + seq1Ptr = seq1; + seq2Ptr = seq2 + (step_seq2 * i); + (*CrossCorrPtr) = 0; + +#ifndef _ARM_OPT_ +#ifdef _WIN32 +#pragma message("NOTE: default implementation is used") +#endif + // Perform the cross correlation + for (j = 0; j < dim_seq; j++) + { + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), right_shifts); + seq1Ptr++; + seq2Ptr++; + } +#else +#ifdef _WIN32 +#pragma message("NOTE: _ARM_OPT_ optimizations are used") +#endif + if (right_shifts == 0) + { + // Perform the optimized cross correlation + for (j = 0; j < dim_seq8; j = j + 8) + { + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + } + + for (j = dim_seq8; j < dim_seq; j++) + { + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16((*seq1Ptr), (*seq2Ptr)); + seq1Ptr++; + seq2Ptr++; + } + } + else // right_shifts != 0 + + { + // Perform the optimized cross correlation + for (j = 0; j < dim_seq8; j = j + 8) + { + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + } + + for (j = dim_seq8; j < dim_seq; j++) + { + (*CrossCorrPtr) += WEBRTC_SPL_MUL_16_16_RSFT((*seq1Ptr), (*seq2Ptr), + right_shifts); + seq1Ptr++; + seq2Ptr++; + } + } +#endif + CrossCorrPtr++; + } +#endif +} diff --git a/src/mod/codecs/mod_isac/decode.c b/src/mod/codecs/mod_isac/decode.c new file mode 100644 index 0000000000..25634b0a89 --- /dev/null +++ b/src/mod/codecs/mod_isac/decode.c @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * decode_B.c + * + * This file contains definition of funtions for decoding. + * Decoding of lower-band, including normal-decoding and RCU decoding. + * Decoding of upper-band, including 8-12 kHz, when the bandwidth is + * 0-12 kHz, and 8-16 kHz, when the bandwidth is 0-16 kHz. + * + */ + + +#include "codec.h" +#include "entropy_coding.h" +#include "pitch_estimator.h" +#include "bandwidth_estimator.h" +#include "structs.h" +#include "settings.h" + +#include +#include +#include + + +/* + * function to decode the bitstream + * returns the total number of bytes in the stream + */ +int +WebRtcIsac_DecodeLb( + float* signal_out, + ISACLBDecStruct* ISACdecLB_obj, + WebRtc_Word16* current_framesamples, + WebRtc_Word16 isRCUPayload) +{ + int k, model; + int len, err; + WebRtc_Word16 bandwidthInd; + + float LP_dec_float[FRAMESAMPLES_HALF]; + float HP_dec_float[FRAMESAMPLES_HALF]; + + double LPw[FRAMESAMPLES_HALF]; + double HPw[FRAMESAMPLES_HALF]; + double LPw_pf[FRAMESAMPLES_HALF]; + + double lo_filt_coef[(ORDERLO+1)*SUBFRAMES]; + double hi_filt_coef[(ORDERHI+1)*SUBFRAMES]; + + double real_f[FRAMESAMPLES_HALF]; + double imag_f[FRAMESAMPLES_HALF]; + + double PitchLags[4]; + double PitchGains[4]; + double AvgPitchGain; + WebRtc_Word16 PitchGains_Q12[4]; + WebRtc_Word16 AvgPitchGain_Q12; + + float gain; + + int frame_nb; /* counter */ + int frame_mode; /* 0 for 20ms and 30ms, 1 for 60ms */ + int processed_samples; + + (ISACdecLB_obj->bitstr_obj).W_upper = 0xFFFFFFFF; + (ISACdecLB_obj->bitstr_obj).streamval = 0; + (ISACdecLB_obj->bitstr_obj).stream_index = 0; + + len = 0; + + /* decode framelength and BW estimation - not used, + only for stream pointer*/ + err = WebRtcIsac_DecodeFrameLen(&ISACdecLB_obj->bitstr_obj, + current_framesamples); + if (err < 0) { // error check + return err; + } + + /* frame_mode: 0, or 1 */ + frame_mode = *current_framesamples/MAX_FRAMESAMPLES; + /* processed_samples: either 320 (20ms) or 480 (30, 60 ms) */ + processed_samples = *current_framesamples/(frame_mode+1); + + err = WebRtcIsac_DecodeSendBW(&ISACdecLB_obj->bitstr_obj, &bandwidthInd); + if (err < 0) { // error check + return err; + } + + /* one loop if it's one frame (20 or 30ms), 2 loops if 2 frames + bundled together (60ms) */ + for (frame_nb = 0; frame_nb <= frame_mode; frame_nb++) { + /* decode & dequantize pitch parameters */ + err = WebRtcIsac_DecodePitchGain(&(ISACdecLB_obj->bitstr_obj), + PitchGains_Q12); + if (err < 0) { // error check + return err; + } + + err = WebRtcIsac_DecodePitchLag(&ISACdecLB_obj->bitstr_obj, + PitchGains_Q12, PitchLags); + if (err < 0) { // error check + return err; + } + + AvgPitchGain_Q12 = (PitchGains_Q12[0] + PitchGains_Q12[1] + + PitchGains_Q12[2] + PitchGains_Q12[3])>>2; + + /* decode & dequantize FiltCoef */ + err = WebRtcIsac_DecodeLpc(&ISACdecLB_obj->bitstr_obj, + lo_filt_coef,hi_filt_coef, &model); + if (err < 0) { // error check + return err; + } + /* decode & dequantize spectrum */ + len = WebRtcIsac_DecodeSpecLb(&ISACdecLB_obj->bitstr_obj, + real_f, imag_f, AvgPitchGain_Q12); + if (len < 0) { // error check + return len; + } + + /* inverse transform */ + WebRtcIsac_Spec2time(real_f, imag_f, LPw, HPw, + &ISACdecLB_obj->fftstr_obj); + + /* convert PitchGains back to FLOAT for pitchfilter_post */ + for (k = 0; k < 4; k++) { + PitchGains[k] = ((float)PitchGains_Q12[k])/4096; + } + + if(isRCUPayload) + { + for (k = 0; k < 240; k++) { + LPw[k] *= RCU_TRANSCODING_SCALE_INVERSE; + HPw[k] *= RCU_TRANSCODING_SCALE_INVERSE; + } + } + + /* inverse pitch filter */ + WebRtcIsac_PitchfilterPost(LPw, LPw_pf, + &ISACdecLB_obj->pitchfiltstr_obj, PitchLags, PitchGains); + /* convert AvgPitchGain back to FLOAT for computation of gain */ + AvgPitchGain = ((float)AvgPitchGain_Q12)/4096; + gain = 1.0f - 0.45f * (float)AvgPitchGain; + + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + /* reduce gain to compensate for pitch enhancer */ + LPw_pf[ k ] *= gain; + } + + if(isRCUPayload) + { + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + /* compensation for transcoding gain changes*/ + LPw_pf[k] *= RCU_TRANSCODING_SCALE; + HPw[k] *= RCU_TRANSCODING_SCALE; + } + } + + /* perceptual post-filtering (using normalized lattice filter) */ + WebRtcIsac_NormLatticeFilterAr(ORDERLO, + ISACdecLB_obj->maskfiltstr_obj.PostStateLoF, + (ISACdecLB_obj->maskfiltstr_obj).PostStateLoG, + LPw_pf, lo_filt_coef, LP_dec_float); + WebRtcIsac_NormLatticeFilterAr(ORDERHI, + ISACdecLB_obj->maskfiltstr_obj.PostStateHiF, + (ISACdecLB_obj->maskfiltstr_obj).PostStateHiG, + HPw, hi_filt_coef, HP_dec_float); + + /* recombine the 2 bands */ + WebRtcIsac_FilterAndCombineFloat( LP_dec_float, HP_dec_float, + signal_out + frame_nb * processed_samples, + &ISACdecLB_obj->postfiltbankstr_obj); + } + + return len; +} + + +/* + * This decode function is called when the codec is operating in 16 kHz + * bandwidth to decode the upperband, i.e. 8-16 kHz. + * + * Contrary to lower-band, the upper-band (8-16 kHz) is not split in + * frequency, but split to 12 sub-frames, i.e. twice as lower-band. + */ +int +WebRtcIsac_DecodeUb16( + float* signal_out, + ISACUBDecStruct* ISACdecUB_obj, + WebRtc_Word16 isRCUPayload) +{ + int len, err; + + double halfFrameFirst[FRAMESAMPLES_HALF]; + double halfFrameSecond[FRAMESAMPLES_HALF]; + + double percepFilterParam[(UB_LPC_ORDER+1) * (SUBFRAMES<<1) + + (UB_LPC_ORDER+1)]; + + double real_f[FRAMESAMPLES_HALF]; + double imag_f[FRAMESAMPLES_HALF]; + + len = 0; + + /* decode & dequantize FiltCoef */ + memset(percepFilterParam, 0, sizeof(percepFilterParam)); + err = WebRtcIsac_DecodeInterpolLpcUb(&ISACdecUB_obj->bitstr_obj, + percepFilterParam, isac16kHz); + if (err < 0) { // error check + return err; + } + + /* decode & dequantize spectrum */ + len = WebRtcIsac_DecodeSpecUB16(&ISACdecUB_obj->bitstr_obj, real_f, + imag_f); + if (len < 0) { // error check + return len; + } + if(isRCUPayload) + { + int n; + for(n = 0; n < 240; n++) + { + real_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; + imag_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; + } + } + + /* inverse transform */ + WebRtcIsac_Spec2time(real_f, imag_f, halfFrameFirst, halfFrameSecond, + &ISACdecUB_obj->fftstr_obj); + + /* perceptual post-filtering (using normalized lattice filter) */ + WebRtcIsac_NormLatticeFilterAr(UB_LPC_ORDER, + ISACdecUB_obj->maskfiltstr_obj.PostStateLoF, + (ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, halfFrameFirst, + &percepFilterParam[(UB_LPC_ORDER+1)], signal_out); + + WebRtcIsac_NormLatticeFilterAr(UB_LPC_ORDER, + ISACdecUB_obj->maskfiltstr_obj.PostStateLoF, + (ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, halfFrameSecond, + &percepFilterParam[(UB_LPC_ORDER + 1) * SUBFRAMES + (UB_LPC_ORDER+1)], + &signal_out[FRAMESAMPLES_HALF]); + + return len; +} + +/* + * This decode function is called when the codec operates at 0-12 kHz + * bandwidth to decode the upperband, i.e. 8-12 kHz. + * + * At the encoder the upper-band is split into two band, 8-12 kHz & 12-16 + * kHz, and only 8-12 kHz is encoded. At the decoder, 8-12 kHz band is + * reconstructed and 12-16 kHz replaced with zeros. Then two bands + * are combined, to reconstruct the upperband 8-16 kHz. + */ +int +WebRtcIsac_DecodeUb12( + float* signal_out, + ISACUBDecStruct* ISACdecUB_obj, + WebRtc_Word16 isRCUPayload) +{ + int len, err; + + float LP_dec_float[FRAMESAMPLES_HALF]; + float HP_dec_float[FRAMESAMPLES_HALF]; + + double LPw[FRAMESAMPLES_HALF]; + double HPw[FRAMESAMPLES_HALF]; + + double percepFilterParam[(UB_LPC_ORDER+1)*SUBFRAMES]; + + double real_f[FRAMESAMPLES_HALF]; + double imag_f[FRAMESAMPLES_HALF]; + + len = 0; + + /* decode & dequantize FiltCoef */ + err = WebRtcIsac_DecodeInterpolLpcUb(&ISACdecUB_obj->bitstr_obj, + percepFilterParam, isac12kHz); + if(err < 0) { // error check + return err; + } + + /* decode & dequantize spectrum */ + len = WebRtcIsac_DecodeSpecUB12(&ISACdecUB_obj->bitstr_obj, + real_f, imag_f); + if(len < 0) { // error check + return len; + } + + if(isRCUPayload) + { + int n; + for(n = 0; n < 240; n++) + { + real_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; + imag_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; + } + } + + /* inverse transform */ + WebRtcIsac_Spec2time(real_f, imag_f, LPw, HPw, &ISACdecUB_obj->fftstr_obj); + + /* perceptual post-filtering (using normalized lattice filter) */ + WebRtcIsac_NormLatticeFilterAr(UB_LPC_ORDER, + ISACdecUB_obj->maskfiltstr_obj.PostStateLoF, + (ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, LPw, + percepFilterParam, LP_dec_float); + + /* Zerro for upper-band */ + memset(HP_dec_float, 0, sizeof(float) * (FRAMESAMPLES_HALF)); + + /* recombine the 2 bands */ + WebRtcIsac_FilterAndCombineFloat(HP_dec_float, LP_dec_float, signal_out, + &ISACdecUB_obj->postfiltbankstr_obj); + + + + return len; +} diff --git a/src/mod/codecs/mod_isac/decode_bwe.c b/src/mod/codecs/mod_isac/decode_bwe.c new file mode 100644 index 0000000000..cdac7fa8bf --- /dev/null +++ b/src/mod/codecs/mod_isac/decode_bwe.c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "structs.h" +#include "bandwidth_estimator.h" +#include "entropy_coding.h" +#include "codec.h" + + +int +WebRtcIsac_EstimateBandwidth( + BwEstimatorstr* bwest_str, + Bitstr* streamdata, + WebRtc_Word32 packet_size, + WebRtc_UWord16 rtp_seq_number, + WebRtc_UWord32 send_ts, + WebRtc_UWord32 arr_ts, + enum IsacSamplingRate encoderSampRate, + enum IsacSamplingRate decoderSampRate) +{ + WebRtc_Word16 index; + WebRtc_Word16 frame_samples; + WebRtc_UWord32 sendTimestampIn16kHz; + WebRtc_UWord32 arrivalTimestampIn16kHz; + WebRtc_UWord32 diffSendTime; + WebRtc_UWord32 diffArrivalTime; + int err; + + /* decode framelength and BW estimation */ + err = WebRtcIsac_DecodeFrameLen(streamdata, &frame_samples); + if(err < 0) // error check + { + return err; + } + err = WebRtcIsac_DecodeSendBW(streamdata, &index); + if(err < 0) // error check + { + return err; + } + + /* UPDATE ESTIMATES FROM OTHER SIDE */ + err = WebRtcIsac_UpdateUplinkBwImpl(bwest_str, index, encoderSampRate); + if(err < 0) + { + return err; + } + + // We like BWE to work at 16 kHz sampling rate, + // therefore, we have to change the timestamps accordingly. + // translate the send timestamp if required + diffSendTime = (WebRtc_UWord32)((WebRtc_UWord32)send_ts - + (WebRtc_UWord32)bwest_str->senderTimestamp); + bwest_str->senderTimestamp = send_ts; + + diffArrivalTime = (WebRtc_UWord32)((WebRtc_UWord32)arr_ts - + (WebRtc_UWord32)bwest_str->receiverTimestamp); + bwest_str->receiverTimestamp = arr_ts; + + if(decoderSampRate == kIsacSuperWideband) + { + diffArrivalTime = (WebRtc_UWord32)diffArrivalTime >> 1; + diffSendTime = (WebRtc_UWord32)diffSendTime >> 1; + } + // arrival timestamp in 16 kHz + arrivalTimestampIn16kHz = (WebRtc_UWord32)((WebRtc_UWord32) + bwest_str->prev_rec_arr_ts + (WebRtc_UWord32)diffArrivalTime); + // send timestamp in 16 kHz + sendTimestampIn16kHz = (WebRtc_UWord32)((WebRtc_UWord32) + bwest_str->prev_rec_send_ts + (WebRtc_UWord32)diffSendTime); + + err = WebRtcIsac_UpdateBandwidthEstimator(bwest_str, rtp_seq_number, + (frame_samples * 1000) / FS, sendTimestampIn16kHz, + arrivalTimestampIn16kHz, packet_size); + // error check + if(err < 0) + { + return err; + } + + return 0; +} diff --git a/src/mod/codecs/mod_isac/division_operations.c b/src/mod/codecs/mod_isac/division_operations.c new file mode 100644 index 0000000000..b143373a2f --- /dev/null +++ b/src/mod/codecs/mod_isac/division_operations.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains implementations of the divisions + * WebRtcSpl_DivU32U16() + * WebRtcSpl_DivW32W16() + * WebRtcSpl_DivW32W16ResW16() + * WebRtcSpl_DivResultInQ31() + * WebRtcSpl_DivW32HiLow() + * + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +WebRtc_UWord32 WebRtcSpl_DivU32U16(WebRtc_UWord32 num, WebRtc_UWord16 den) +{ + // Guard against division with 0 + if (den != 0) + { + return (WebRtc_UWord32)(num / den); + } else + { + return (WebRtc_UWord32)0xFFFFFFFF; + } +} + +WebRtc_Word32 WebRtcSpl_DivW32W16(WebRtc_Word32 num, WebRtc_Word16 den) +{ + // Guard against division with 0 + if (den != 0) + { + return (WebRtc_Word32)(num / den); + } else + { + return (WebRtc_Word32)0x7FFFFFFF; + } +} + +WebRtc_Word16 WebRtcSpl_DivW32W16ResW16(WebRtc_Word32 num, WebRtc_Word16 den) +{ + // Guard against division with 0 + if (den != 0) + { + return (WebRtc_Word16)(num / den); + } else + { + return (WebRtc_Word16)0x7FFF; + } +} + +WebRtc_Word32 WebRtcSpl_DivResultInQ31(WebRtc_Word32 num, WebRtc_Word32 den) +{ + WebRtc_Word32 L_num = num; + WebRtc_Word32 L_den = den; + WebRtc_Word32 div = 0; + int k = 31; + int change_sign = 0; + + if (num == 0) + return 0; + + if (num < 0) + { + change_sign++; + L_num = -num; + } + if (den < 0) + { + change_sign++; + L_den = -den; + } + while (k--) + { + div <<= 1; + L_num <<= 1; + if (L_num >= L_den) + { + L_num -= L_den; + div++; + } + } + if (change_sign == 1) + { + div = -div; + } + return div; +} + +WebRtc_Word32 WebRtcSpl_DivW32HiLow(WebRtc_Word32 num, WebRtc_Word16 den_hi, + WebRtc_Word16 den_low) +{ + WebRtc_Word16 approx, tmp_hi, tmp_low, num_hi, num_low; + WebRtc_Word32 tmpW32; + + approx = (WebRtc_Word16)WebRtcSpl_DivW32W16((WebRtc_Word32)0x1FFFFFFF, den_hi); + // result in Q14 (Note: 3FFFFFFF = 0.5 in Q30) + + // tmpW32 = 1/den = approx * (2.0 - den * approx) (in Q30) + tmpW32 = (WEBRTC_SPL_MUL_16_16(den_hi, approx) << 1) + + ((WEBRTC_SPL_MUL_16_16(den_low, approx) >> 15) << 1); + // tmpW32 = den * approx + + tmpW32 = (WebRtc_Word32)0x7fffffffL - tmpW32; // result in Q30 (tmpW32 = 2.0-(den*approx)) + + // Store tmpW32 in hi and low format + tmp_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(tmpW32, 16); + tmp_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((tmpW32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)tmp_hi, 16)), 1); + + // tmpW32 = 1/den in Q29 + tmpW32 = ((WEBRTC_SPL_MUL_16_16(tmp_hi, approx) + (WEBRTC_SPL_MUL_16_16(tmp_low, approx) + >> 15)) << 1); + + // 1/den in hi and low format + tmp_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(tmpW32, 16); + tmp_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((tmpW32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)tmp_hi, 16)), 1); + + // Store num in hi and low format + num_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(num, 16); + num_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((num + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)num_hi, 16)), 1); + + // num * (1/den) by 32 bit multiplication (result in Q28) + + tmpW32 = (WEBRTC_SPL_MUL_16_16(num_hi, tmp_hi) + (WEBRTC_SPL_MUL_16_16(num_hi, tmp_low) + >> 15) + (WEBRTC_SPL_MUL_16_16(num_low, tmp_hi) >> 15)); + + // Put result in Q31 (convert from Q28) + tmpW32 = WEBRTC_SPL_LSHIFT_W32(tmpW32, 3); + + return tmpW32; +} diff --git a/src/mod/codecs/mod_isac/dot_product_with_scale.c b/src/mod/codecs/mod_isac/dot_product_with_scale.c new file mode 100644 index 0000000000..6e085fdb60 --- /dev/null +++ b/src/mod/codecs/mod_isac/dot_product_with_scale.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_DotProductWithScale(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +WebRtc_Word32 WebRtcSpl_DotProductWithScale(WebRtc_Word16 *vector1, WebRtc_Word16 *vector2, + int length, int scaling) +{ + WebRtc_Word32 sum; + int i; +#ifdef _ARM_OPT_ +#pragma message("NOTE: _ARM_OPT_ optimizations are used") + WebRtc_Word16 len4 = (length >> 2) << 2; +#endif + + sum = 0; + +#ifndef _ARM_OPT_ + for (i = 0; i < length; i++) + { + sum += WEBRTC_SPL_MUL_16_16_RSFT(*vector1++, *vector2++, scaling); + } +#else + if (scaling == 0) + { + for (i = 0; i < len4; i = i + 4) + { + sum += WEBRTC_SPL_MUL_16_16(*vector1, *vector2); + vector1++; + vector2++; + sum += WEBRTC_SPL_MUL_16_16(*vector1, *vector2); + vector1++; + vector2++; + sum += WEBRTC_SPL_MUL_16_16(*vector1, *vector2); + vector1++; + vector2++; + sum += WEBRTC_SPL_MUL_16_16(*vector1, *vector2); + vector1++; + vector2++; + } + + for (i = len4; i < length; i++) + { + sum += WEBRTC_SPL_MUL_16_16(*vector1, *vector2); + vector1++; + vector2++; + } + } + else + { + for (i = 0; i < len4; i = i + 4) + { + sum += WEBRTC_SPL_MUL_16_16_RSFT(*vector1, *vector2, scaling); + vector1++; + vector2++; + sum += WEBRTC_SPL_MUL_16_16_RSFT(*vector1, *vector2, scaling); + vector1++; + vector2++; + sum += WEBRTC_SPL_MUL_16_16_RSFT(*vector1, *vector2, scaling); + vector1++; + vector2++; + sum += WEBRTC_SPL_MUL_16_16_RSFT(*vector1, *vector2, scaling); + vector1++; + vector2++; + } + + for (i = len4; i < length; i++) + { + sum += WEBRTC_SPL_MUL_16_16_RSFT(*vector1, *vector2, scaling); + vector1++; + vector2++; + } + } +#endif + + return sum; +} diff --git a/src/mod/codecs/mod_isac/downsample_fast.c b/src/mod/codecs/mod_isac/downsample_fast.c new file mode 100644 index 0000000000..cce463c5d3 --- /dev/null +++ b/src/mod/codecs/mod_isac/downsample_fast.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_DownsampleFast(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +int WebRtcSpl_DownsampleFast(WebRtc_Word16 *in_ptr, WebRtc_Word16 in_length, + WebRtc_Word16 *out_ptr, WebRtc_Word16 out_length, + WebRtc_Word16 *B, WebRtc_Word16 B_length, WebRtc_Word16 factor, + WebRtc_Word16 delay) +{ + WebRtc_Word32 o; + int i, j; + + WebRtc_Word16 *downsampled_ptr = out_ptr; + WebRtc_Word16 *b_ptr; + WebRtc_Word16 *x_ptr; + WebRtc_Word16 endpos = delay + + (WebRtc_Word16)WEBRTC_SPL_MUL_16_16(factor, (out_length - 1)) + 1; + + if (in_length < endpos) + { + return -1; + } + + for (i = delay; i < endpos; i += factor) + { + b_ptr = &B[0]; + x_ptr = &in_ptr[i]; + + o = (WebRtc_Word32)2048; // Round val + + for (j = 0; j < B_length; j++) + { + o += WEBRTC_SPL_MUL_16_16(*b_ptr++, *x_ptr--); + } + + o = WEBRTC_SPL_RSHIFT_W32(o, 12); + + // If output is higher than 32768, saturate it. Same with negative side + + *downsampled_ptr++ = WebRtcSpl_SatW32ToW16(o); + } + + return 0; +} diff --git a/src/mod/codecs/mod_isac/encode.c b/src/mod/codecs/mod_isac/encode.c new file mode 100644 index 0000000000..75cd726507 --- /dev/null +++ b/src/mod/codecs/mod_isac/encode.c @@ -0,0 +1,1451 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * encode.c + * + * This file contains definition of funtions for encoding. + * Decoding of upper-band, including 8-12 kHz, when the bandwidth is + * 0-12 kHz, and 8-16 kHz, when the bandwidth is 0-16 kHz. + * + */ + +#include +#include + +#include "structs.h" +#include "codec.h" +#include "pitch_estimator.h" +#include "entropy_coding.h" +#include "arith_routines.h" +#include "pitch_gain_tables.h" +#include "pitch_lag_tables.h" +#include "spectrum_ar_model_tables.h" +#include "lpc_tables.h" +#include "lpc_analysis.h" +#include "bandwidth_estimator.h" +#include "lpc_shape_swb12_tables.h" +#include "lpc_shape_swb16_tables.h" +#include "lpc_gain_swb_tables.h" + + +#define UB_LOOKAHEAD 24 + +/* + Rate allocation tables of lower and upper-band bottleneck for + 12kHz & 16kHz bandwidth. + + 12 kHz bandwidth + ----------------- + The overall bottleneck of the coder is between 38 kbps and 45 kbps. We have + considered 7 enteries, uniformly distributed in this interval, i.e. 38, + 39.17, 40.33, 41.5, 42.67, 43.83 and 45. For every entery, the lower-band + and the upper-band bottlenecks are specified in + 'kLowerBandBitRate12' and 'kUpperBandBitRate12' + tables, respectively. E.g. the overall rate of 41.5 kbps corresponts to a + bottleneck of 31 kbps for lower-band and 27 kbps for upper-band. Given an + overall bottleneck of the codec, we use linear interpolation to get + lower-band and upper-band bottlenecks. + + 16 kHz bandwidth + ----------------- + The overall bottleneck of the coder is between 50 kbps and 56 kbps. We have + considered 7 enteries, uniformly distributed in this interval, i.e. 50, 51.2, + 52.4, 53.6, 54.8 and 56. For every entery, the lower-band and the upper-band + bottlenecks are specified in 'kLowerBandBitRate16' and + 'kUpperBandBitRate16' tables, respectively. E.g. the overall rate + of 53.6 kbps corresponts to a bottleneck of 32 kbps for lower-band and 30 + kbps for upper-band. Given an overall bottleneck of the codec, we use linear + interpolation to get lower-band and upper-band bottlenecks. + +*/ + +// 38 39.17 40.33 41.5 42.67 43.83 45 +static const WebRtc_Word16 kLowerBandBitRate12[7] = { + 29000, 30000, 30000, 31000, 31000, 32000, 32000}; +static const WebRtc_Word16 kUpperBandBitRate12[7] = { + 25000, 25000, 27000, 27000, 29000, 29000, 32000}; + +// 50 51.2 52.4 53.6 54.8 56 +static const WebRtc_Word16 kLowerBandBitRate16[6] = { + 31000, 31000, 32000, 32000, 32000, 32000}; +static const WebRtc_Word16 kUpperBandBitRate16[6] = { + 28000, 29000, 29000, 30000, 31000, 32000}; + +/****************************************************************************** + * WebRtcIsac_RateAllocation() + * Internal function to perform a rate-allocation for upper and lower-band, + * given a total rate. + * + * Input: + * - inRateBitPerSec : a total bottleneck in bits/sec. + * + * Output: + * - rateLBBitPerSec : a bottleneck allocated to the lower-band + * in bits/sec. + * - rateUBBitPerSec : a bottleneck allocated to the upper-band + * in bits/sec. + * + * Return value : 0 if rate allocation has been successful. + * -1 if failed to allocate rates. + */ + +WebRtc_Word16 +WebRtcIsac_RateAllocation( + WebRtc_Word32 inRateBitPerSec, + double* rateLBBitPerSec, + double* rateUBBitPerSec, + enum ISACBandwidth* bandwidthKHz) +{ + WebRtc_Word16 idx; + double idxD; + double idxErr; + if(inRateBitPerSec < 38000) + { + // If the given overall bottleneck is less than 38000 then + // then codec has to operate in wideband mode, i.e. 8 kHz + // bandwidth. + *rateLBBitPerSec = (WebRtc_Word16)((inRateBitPerSec > 32000)? + 32000:inRateBitPerSec); + *rateUBBitPerSec = 0; + *bandwidthKHz = isac8kHz; + } + else if((inRateBitPerSec >= 38000) && (inRateBitPerSec < 50000)) + { + // At a bottleneck between 38 and 50 kbps the codec is operating + // at 12 kHz bandwidth. Using xxxBandBitRate12[] to calculates + // upper/lower bottleneck + + // find the bottlenecks by linear interpolation + // step is (45000 - 38000)/6.0 we use the inverse of it. + const double stepSizeInv = 8.5714286e-4; + idxD = (inRateBitPerSec - 38000) * stepSizeInv; + idx = (idxD >= 6)? 6:((WebRtc_Word16)idxD); + idxErr = idxD - idx; + *rateLBBitPerSec = kLowerBandBitRate12[idx]; + *rateUBBitPerSec = kUpperBandBitRate12[idx]; + + if(idx < 6) + { + *rateLBBitPerSec += (WebRtc_Word16)(idxErr * + (kLowerBandBitRate12[idx + 1] - + kLowerBandBitRate12[idx])); + *rateUBBitPerSec += (WebRtc_Word16)(idxErr * + (kUpperBandBitRate12[idx + 1] - + kUpperBandBitRate12[idx])); + } + + *bandwidthKHz = isac12kHz; + } + else if((inRateBitPerSec >= 50000) && (inRateBitPerSec <= 56000)) + { + // A bottleneck between 50 and 56 kbps corresponds to bandwidth + // of 16 kHz. Using xxxBandBitRate16[] to calculates + // upper/lower bottleneck + + // find the bottlenecks by linear interpolation + // step is (56000 - 50000)/5 we use the inverse of it + const double stepSizeInv = 8.3333333e-4; + idxD = (inRateBitPerSec - 50000) * stepSizeInv; + idx = (idxD >= 5)? 5:((WebRtc_Word16)idxD); + idxErr = idxD - idx; + *rateLBBitPerSec = kLowerBandBitRate16[idx]; + *rateUBBitPerSec = kUpperBandBitRate16[idx]; + + if(idx < 5) + { + *rateLBBitPerSec += (WebRtc_Word16)(idxErr * + (kLowerBandBitRate16[idx + 1] - + kLowerBandBitRate16[idx])); + + *rateUBBitPerSec += (WebRtc_Word16)(idxErr * + (kUpperBandBitRate16[idx + 1] - + kUpperBandBitRate16[idx])); + } + + *bandwidthKHz = isac16kHz; + } + else + { + // Out-of-range botlteneck value. + return -1; + } + + // limit the values. + *rateLBBitPerSec = (*rateLBBitPerSec > 32000)? 32000:*rateLBBitPerSec; + *rateUBBitPerSec = (*rateUBBitPerSec > 32000)? 32000:*rateUBBitPerSec; + + return 0; +} + + + +int +WebRtcIsac_EncodeLb( + float* in, + ISACLBEncStruct* ISACencLB_obj, + WebRtc_Word16 codingMode, + WebRtc_Word16 bottleneckIndex) +{ + int stream_length = 0; + int err; + int k; + int iterCntr; + + double lofilt_coef[(ORDERLO+1)*SUBFRAMES]; + double hifilt_coef[(ORDERHI+1)*SUBFRAMES]; + float LP[FRAMESAMPLES_HALF]; + float HP[FRAMESAMPLES_HALF]; + + double LP_lookahead[FRAMESAMPLES_HALF]; + double HP_lookahead[FRAMESAMPLES_HALF]; + double LP_lookahead_pf[FRAMESAMPLES_HALF + QLOOKAHEAD]; + double LPw[FRAMESAMPLES_HALF]; + + double HPw[FRAMESAMPLES_HALF]; + double LPw_pf[FRAMESAMPLES_HALF]; + WebRtc_Word16 fre[FRAMESAMPLES_HALF]; /* Q7 */ + WebRtc_Word16 fim[FRAMESAMPLES_HALF]; /* Q7 */ + + double PitchLags[4]; + double PitchGains[4]; + WebRtc_Word16 PitchGains_Q12[4]; + WebRtc_Word16 AvgPitchGain_Q12; + + int frame_mode; /* 0 for 30ms, 1 for 60ms */ + int processed_samples, status = 0; + + double bits_gains; + int bmodel; + + transcode_obj transcodingParam; + double bytesLeftSpecCoding; + WebRtc_UWord16 payloadLimitBytes; + + /* copy new frame length and bottle neck rate only for the first + 10 ms data */ + if (ISACencLB_obj->buffer_index == 0) { + /* set the framelength for the next packet */ + ISACencLB_obj->current_framesamples = ISACencLB_obj->new_framelength; + } + /* frame_mode is 0 (30 ms) or 1 (60 ms) */ + frame_mode = ISACencLB_obj->current_framesamples/MAX_FRAMESAMPLES; + /* processed_samples: 480 (30, 60 ms) */ + processed_samples = ISACencLB_obj->current_framesamples/(frame_mode+1); + + /* buffer speech samples (by 10ms packet) until the framelength */ + /* is reached (30 or 60 ms) */ + /****************************************************************/ + + /* fill the buffer with 10ms input data */ + for (k = 0; k < FRAMESAMPLES_10ms; k++) { + ISACencLB_obj->data_buffer_float[k + ISACencLB_obj->buffer_index] = + in[k]; + } + + /* if buffersize is not equal to current framesize then increase index + and return. We do no encoding untill we have enough audio. */ + if (ISACencLB_obj->buffer_index + FRAMESAMPLES_10ms != processed_samples) { + ISACencLB_obj->buffer_index += FRAMESAMPLES_10ms; + return 0; + } + /* if buffer reached the right size, reset index and continue with + encoding the frame */ + ISACencLB_obj->buffer_index = 0; + + /* end of buffer function */ + /**************************/ + + /* encoding */ + /************/ + + if (frame_mode == 0 || ISACencLB_obj->frame_nb == 0 ) { + // This is to avoid Linux warnings until we change 'int' to 'Word32' + // at all places. + int intVar; + /* reset bitstream */ + ISACencLB_obj->bitstr_obj.W_upper = 0xFFFFFFFF; + ISACencLB_obj->bitstr_obj.streamval = 0; + ISACencLB_obj->bitstr_obj.stream_index = 0; + + if((codingMode == 0) && (frame_mode == 0) && + (ISACencLB_obj->enforceFrameSize == 0)) { + ISACencLB_obj->new_framelength = + WebRtcIsac_GetNewFrameLength(ISACencLB_obj->bottleneck, + ISACencLB_obj->current_framesamples); + } + + ISACencLB_obj->s2nr = WebRtcIsac_GetSnr( + ISACencLB_obj->bottleneck, ISACencLB_obj->current_framesamples); + + /* encode frame length */ + status = WebRtcIsac_EncodeFrameLen( + ISACencLB_obj->current_framesamples, &ISACencLB_obj->bitstr_obj); + if (status < 0) { + /* Wrong frame size */ + return status; + } + /* Save framelength for multiple packets memory */ + ISACencLB_obj->SaveEnc_obj.framelength = + ISACencLB_obj->current_framesamples; + + /* To be used for Redundant Coding */ + ISACencLB_obj->lastBWIdx = bottleneckIndex; + intVar = (int)bottleneckIndex; + WebRtcIsac_EncodeReceiveBw(&intVar, &ISACencLB_obj->bitstr_obj); + } + + /* split signal in two bands */ + WebRtcIsac_SplitAndFilterFloat(ISACencLB_obj->data_buffer_float, LP, HP, + LP_lookahead, HP_lookahead, &ISACencLB_obj->prefiltbankstr_obj ); + + /* estimate pitch parameters and pitch-filter lookahead signal */ + WebRtcIsac_PitchAnalysis(LP_lookahead, LP_lookahead_pf, + &ISACencLB_obj->pitchanalysisstr_obj, PitchLags, PitchGains); + + /* encode in FIX Q12 */ + + /* convert PitchGain to Fixed point */ + for (k=0;kframe_nb == 0) + { + ISACencLB_obj->SaveEnc_obj.startIdx = 0; + } else { + ISACencLB_obj->SaveEnc_obj.startIdx = 1; + } + + /* quantize & encode pitch parameters */ + WebRtcIsac_EncodePitchGain(PitchGains_Q12, &ISACencLB_obj->bitstr_obj, + &ISACencLB_obj->SaveEnc_obj); + WebRtcIsac_EncodePitchLag(PitchLags, PitchGains_Q12, + &ISACencLB_obj->bitstr_obj, &ISACencLB_obj->SaveEnc_obj); + + AvgPitchGain_Q12 = (PitchGains_Q12[0] + PitchGains_Q12[1] + + PitchGains_Q12[2] + PitchGains_Q12[3])>>2; + + /* find coefficients for perceptual pre-filters */ + WebRtcIsac_GetLpcCoefLb(LP_lookahead_pf, HP_lookahead, + &ISACencLB_obj->maskfiltstr_obj, ISACencLB_obj->s2nr, + PitchGains_Q12, lofilt_coef, hifilt_coef); + + /* code LPC model and shape - gains not quantized yet */ + WebRtcIsac_EncodeLpcLb(lofilt_coef, hifilt_coef, &bmodel, &bits_gains, + &ISACencLB_obj->bitstr_obj, &ISACencLB_obj->SaveEnc_obj); + + /* convert PitchGains back to FLOAT for pitchfilter_pre */ + for (k = 0; k < 4; k++) { + PitchGains[k] = ((float)PitchGains_Q12[k])/4096; + } + + /* Store the state of arithmetic coder before coding LPC gains */ + transcodingParam.W_upper = ISACencLB_obj->bitstr_obj.W_upper; + transcodingParam.stream_index = ISACencLB_obj->bitstr_obj.stream_index; + transcodingParam.streamval = ISACencLB_obj->bitstr_obj.streamval; + transcodingParam.stream[0] = ISACencLB_obj->bitstr_obj.stream[ + ISACencLB_obj->bitstr_obj.stream_index - 2]; + transcodingParam.stream[1] = ISACencLB_obj->bitstr_obj.stream[ + ISACencLB_obj->bitstr_obj.stream_index - 1]; + transcodingParam.stream[2] = ISACencLB_obj->bitstr_obj.stream[ + ISACencLB_obj->bitstr_obj.stream_index]; + + /* Store LPC Gains before encoding them */ + for(k = 0; k < SUBFRAMES; k++) { + transcodingParam.loFiltGain[k] = lofilt_coef[(LPC_LOBAND_ORDER+1)*k]; + transcodingParam.hiFiltGain[k] = hifilt_coef[(LPC_HIBAND_ORDER+1)*k]; + } + + /* Code gains */ + WebRtcIsac_EncodeLpcGainLb(lofilt_coef, hifilt_coef, bmodel, + &ISACencLB_obj->bitstr_obj, &ISACencLB_obj->SaveEnc_obj); + + /* Get the correct value for the payload limit and calculate the + number of bytes left for coding the spectrum.*/ + if((frame_mode == 1) && (ISACencLB_obj->frame_nb == 0)) { + /* It is a 60ms and we are in the first 30ms then the limit at + this point should be half of the assigned value */ + payloadLimitBytes = ISACencLB_obj->payloadLimitBytes60 >> 1; + } + else if (frame_mode == 0) { + /* It is a 30ms frame */ + /* Subract 3 because termination process may add 3 bytes */ + payloadLimitBytes = ISACencLB_obj->payloadLimitBytes30 - 3; + } else { + /* This is the second half of a 60ms frame. */ + /* Subract 3 because termination process may add 3 bytes */ + payloadLimitBytes = ISACencLB_obj->payloadLimitBytes60 - 3; + } + bytesLeftSpecCoding = payloadLimitBytes - transcodingParam.stream_index; + + /* perceptual pre-filtering (using normalized lattice filter) */ + /* low-band filtering */ + WebRtcIsac_NormLatticeFilterMa(ORDERLO, + ISACencLB_obj->maskfiltstr_obj.PreStateLoF, + ISACencLB_obj->maskfiltstr_obj.PreStateLoG, LP, lofilt_coef, LPw); + /* high-band filtering */ + WebRtcIsac_NormLatticeFilterMa(ORDERHI, + ISACencLB_obj->maskfiltstr_obj.PreStateHiF, + ISACencLB_obj->maskfiltstr_obj.PreStateHiG, HP, hifilt_coef, HPw); + + + /* pitch filter */ + WebRtcIsac_PitchfilterPre(LPw, LPw_pf, &ISACencLB_obj->pitchfiltstr_obj, + PitchLags, PitchGains); + + /* transform */ + WebRtcIsac_Time2Spec(LPw_pf, HPw, fre, fim, &ISACencLB_obj->fftstr_obj); + + + /* Save data for multiple packets memory */ + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + ISACencLB_obj->SaveEnc_obj.fre[k + + ISACencLB_obj->SaveEnc_obj.startIdx*FRAMESAMPLES_HALF] = fre[k]; + ISACencLB_obj->SaveEnc_obj.fim[k + + ISACencLB_obj->SaveEnc_obj.startIdx*FRAMESAMPLES_HALF] = fim[k]; + } + ISACencLB_obj->SaveEnc_obj.AvgPitchGain[ + ISACencLB_obj->SaveEnc_obj.startIdx] = AvgPitchGain_Q12; + + /* quantization and lossless coding */ + err = WebRtcIsac_EncodeSpecLb(fre, fim, &ISACencLB_obj->bitstr_obj, + AvgPitchGain_Q12); + if ((err < 0) && (err != -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + /* There has been an error but it was not too large payload + (we can cure too large payload) */ + if (frame_mode == 1 && ISACencLB_obj->frame_nb == 1) { + /* If this is the second 30ms of a 60ms frame reset + this such that in the next call encoder starts fresh. */ + ISACencLB_obj->frame_nb = 0; + } + return err; + } + iterCntr = 0; + while((ISACencLB_obj->bitstr_obj.stream_index > payloadLimitBytes) || + (err == -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + double bytesSpecCoderUsed; + double transcodeScale; + + if(iterCntr >= MAX_PAYLOAD_LIMIT_ITERATION) { + /* We were not able to limit the payload size */ + if((frame_mode == 1) && (ISACencLB_obj->frame_nb == 0)) { + /* This was the first 30ms of a 60ms frame. Although + the payload is larger than it should be but we let + the second 30ms be encoded. Maybe together we + won't exceed the limit. */ + ISACencLB_obj->frame_nb = 1; + return 0; + } else if((frame_mode == 1) && (ISACencLB_obj->frame_nb == 1)) { + ISACencLB_obj->frame_nb = 0; + } + + if(err != -ISAC_DISALLOWED_BITSTREAM_LENGTH) { + return -ISAC_PAYLOAD_LARGER_THAN_LIMIT; + } else { + return status; + } + } + + if(err == -ISAC_DISALLOWED_BITSTREAM_LENGTH) { + bytesSpecCoderUsed = STREAM_SIZE_MAX; + // being coservative + transcodeScale = bytesLeftSpecCoding / bytesSpecCoderUsed * 0.5; + } else { + bytesSpecCoderUsed = ISACencLB_obj->bitstr_obj.stream_index - + transcodingParam.stream_index; + transcodeScale = bytesLeftSpecCoding / bytesSpecCoderUsed; + } + + /* To be safe, we reduce the scale depending on + the number of iterations. */ + transcodeScale *= (1.0 - (0.9 * (double)iterCntr / + (double)MAX_PAYLOAD_LIMIT_ITERATION)); + + /* Scale the LPC Gains */ + for (k = 0; k < SUBFRAMES; k++) { + lofilt_coef[(LPC_LOBAND_ORDER+1) * k] = + transcodingParam.loFiltGain[k] * transcodeScale; + hifilt_coef[(LPC_HIBAND_ORDER+1) * k] = + transcodingParam.hiFiltGain[k] * transcodeScale; + transcodingParam.loFiltGain[k] = + lofilt_coef[(LPC_LOBAND_ORDER+1) * k]; + transcodingParam.hiFiltGain[k] = + hifilt_coef[(LPC_HIBAND_ORDER+1) * k]; + } + + /* Scale DFT coefficients */ + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + fre[k] = (WebRtc_Word16)(fre[k] * transcodeScale); + fim[k] = (WebRtc_Word16)(fim[k] * transcodeScale); + } + + /* Save data for multiple packets memory */ + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + ISACencLB_obj->SaveEnc_obj.fre[k + + ISACencLB_obj->SaveEnc_obj.startIdx * FRAMESAMPLES_HALF] = + fre[k]; + ISACencLB_obj->SaveEnc_obj.fim[k + + ISACencLB_obj->SaveEnc_obj.startIdx * FRAMESAMPLES_HALF] = + fim[k]; + } + + /* Re-store the state of arithmetic coder before coding LPC gains */ + ISACencLB_obj->bitstr_obj.W_upper = transcodingParam.W_upper; + ISACencLB_obj->bitstr_obj.stream_index = transcodingParam.stream_index; + ISACencLB_obj->bitstr_obj.streamval = transcodingParam.streamval; + ISACencLB_obj->bitstr_obj.stream[transcodingParam.stream_index - 2] = + transcodingParam.stream[0]; + ISACencLB_obj->bitstr_obj.stream[transcodingParam.stream_index - 1] = + transcodingParam.stream[1]; + ISACencLB_obj->bitstr_obj.stream[transcodingParam.stream_index] = + transcodingParam.stream[2]; + + /* Code gains */ + WebRtcIsac_EncodeLpcGainLb(lofilt_coef, hifilt_coef, bmodel, + &ISACencLB_obj->bitstr_obj, &ISACencLB_obj->SaveEnc_obj); + + /* Update the number of bytes left for encoding the spectrum */ + bytesLeftSpecCoding = payloadLimitBytes - + transcodingParam.stream_index; + + /* Encode the spectrum */ + err = WebRtcIsac_EncodeSpecLb(fre, fim, &ISACencLB_obj->bitstr_obj, + AvgPitchGain_Q12); + if((err < 0) && (err != -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + /* There has been an error but it was not too large + payload (we can cure too large payload) */ + if (frame_mode == 1 && ISACencLB_obj->frame_nb == 1) { + /* If this is the second 30ms of a 60ms frame reset + this such that in the next call encoder starts fresh. */ + ISACencLB_obj->frame_nb = 0; + } + return err; + } + iterCntr++; + } + + /* i.e. 60 ms framesize and just processed the first 30ms, */ + /* go back to main function to buffer the other 30ms speech frame */ + if (frame_mode == 1) + { + if(ISACencLB_obj->frame_nb == 0) + { + ISACencLB_obj->frame_nb = 1; + return 0; + } + else if(ISACencLB_obj->frame_nb == 1) + { + ISACencLB_obj->frame_nb = 0; + /* also update the framelength for next packet, + in Adaptive mode only */ + if (codingMode == 0 && (ISACencLB_obj->enforceFrameSize == 0)) + { + ISACencLB_obj->new_framelength = + WebRtcIsac_GetNewFrameLength(ISACencLB_obj->bottleneck, + ISACencLB_obj->current_framesamples); + } + } + } + else + { + ISACencLB_obj->frame_nb = 0; + } + + /* complete arithmetic coding */ + stream_length = WebRtcIsac_EncTerminate(&ISACencLB_obj->bitstr_obj); + + return stream_length; +} + +int +WebRtcIsac_EncodeUb16( + float* in, + ISACUBEncStruct* ISACencUB_obj, + WebRtc_Word32 jitterInfo) +{ + int err; + int k; + + double lpcVecs[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + double percepFilterParams[(1 + UB_LPC_ORDER) * (SUBFRAMES<<1) + + (1 + UB_LPC_ORDER)]; + + double LP_lookahead[FRAMESAMPLES]; + WebRtc_Word16 fre[FRAMESAMPLES_HALF]; /* Q7 */ + WebRtc_Word16 fim[FRAMESAMPLES_HALF]; /* Q7 */ + + int status = 0; + + double varscale[2]; + double corr[SUBFRAMES<<1][UB_LPC_ORDER + 1]; + double lpcGains[SUBFRAMES<<1]; + transcode_obj transcodingParam; + double bytesLeftSpecCoding; + WebRtc_UWord16 payloadLimitBytes; + WebRtc_UWord16 iterCntr; + double s2nr; + + /* buffer speech samples (by 10ms packet) until the framelength is */ + /* reached (30 or 60 ms) */ + /*********************************************************************/ + + /* fill the buffer with 10ms input data */ + for (k = 0; k < FRAMESAMPLES_10ms; k++) { + ISACencUB_obj->data_buffer_float[k + ISACencUB_obj->buffer_index] = + in[k]; + } + + /* if buffersize is not equal to current framesize, and end of file is + not reached yet, we don't do encoding unless we have the whole frame */ + if (ISACencUB_obj->buffer_index + FRAMESAMPLES_10ms < FRAMESAMPLES) { + ISACencUB_obj->buffer_index += FRAMESAMPLES_10ms; + return 0; + } + + /* end of buffer function */ + /**************************/ + + /* encoding */ + /************/ + + /* reset bitstream */ + ISACencUB_obj->bitstr_obj.W_upper = 0xFFFFFFFF; + ISACencUB_obj->bitstr_obj.streamval = 0; + ISACencUB_obj->bitstr_obj.stream_index = 0; + + /* bandwidth estimation and coding */ + /* To be used for Redundant Coding */ + WebRtcIsac_EncodeJitterInfo(jitterInfo, &ISACencUB_obj->bitstr_obj); + + status = WebRtcIsac_EncodeBandwidth(isac16kHz, + &ISACencUB_obj->bitstr_obj); + if (status < 0) { + return status; + } + + s2nr = WebRtcIsac_GetSnr(ISACencUB_obj->bottleneck, + FRAMESAMPLES); + + memcpy(lpcVecs, ISACencUB_obj->lastLPCVec, UB_LPC_ORDER * sizeof(double)); + + for (k = 0; k < FRAMESAMPLES; k++) { + LP_lookahead[k] = ISACencUB_obj->data_buffer_float[UB_LOOKAHEAD + k]; + } + + /* find coefficients for perceptual pre-filters */ + WebRtcIsac_GetLpcCoefUb(LP_lookahead, &ISACencUB_obj->maskfiltstr_obj, + &lpcVecs[UB_LPC_ORDER], corr, varscale, isac16kHz); + + memcpy(ISACencUB_obj->lastLPCVec, + &lpcVecs[(UB16_LPC_VEC_PER_FRAME - 1) * (UB_LPC_ORDER)], + sizeof(double) * UB_LPC_ORDER); + + /* code LPC model and shape - gains not quantized yet */ + WebRtcIsac_EncodeLpcUB(lpcVecs, &ISACencUB_obj->bitstr_obj, + percepFilterParams, isac16kHz, &ISACencUB_obj->SaveEnc_obj); + + + // the first set of lpc parameters are from the last sub-frame of + // the previous frame. so we don't care about them + WebRtcIsac_GetLpcGain(s2nr, &percepFilterParams[UB_LPC_ORDER + 1], + (SUBFRAMES<<1), lpcGains, corr, varscale); + + /* Store the state of arithmetic coder before coding LPC gains */ + transcodingParam.stream_index = ISACencUB_obj->bitstr_obj.stream_index; + transcodingParam.W_upper = ISACencUB_obj->bitstr_obj.W_upper; + transcodingParam.streamval = ISACencUB_obj->bitstr_obj.streamval; + transcodingParam.stream[0] = ISACencUB_obj->bitstr_obj.stream[ + ISACencUB_obj->bitstr_obj.stream_index - 2]; + transcodingParam.stream[1] = ISACencUB_obj->bitstr_obj.stream[ + ISACencUB_obj->bitstr_obj.stream_index - 1]; + transcodingParam.stream[2] = ISACencUB_obj->bitstr_obj.stream[ + ISACencUB_obj->bitstr_obj.stream_index]; + + /* Store LPC Gains before encoding them */ + for(k = 0; k < SUBFRAMES; k++) { + transcodingParam.loFiltGain[k] = lpcGains[k]; + transcodingParam.hiFiltGain[k] = lpcGains[SUBFRAMES + k]; + } + + // Store the gains for multiple encoding + memcpy(ISACencUB_obj->SaveEnc_obj.lpcGain, lpcGains, (SUBFRAMES << 1) * sizeof(double)); + + WebRtcIsac_EncodeLpcGainUb(lpcGains, &ISACencUB_obj->bitstr_obj, + ISACencUB_obj->SaveEnc_obj.lpcGainIndex); + WebRtcIsac_EncodeLpcGainUb(&lpcGains[SUBFRAMES], &ISACencUB_obj->bitstr_obj, + &ISACencUB_obj->SaveEnc_obj.lpcGainIndex[SUBFRAMES]); + + /* Get the correct value for the payload limit and calculate the number of + bytes left for coding the spectrum. It is a 30ms frame + Subract 3 because termination process may add 3 bytes */ + payloadLimitBytes = ISACencUB_obj->maxPayloadSizeBytes - + ISACencUB_obj->numBytesUsed - 3; + bytesLeftSpecCoding = payloadLimitBytes - + ISACencUB_obj->bitstr_obj.stream_index; + + for (k = 0; k < (SUBFRAMES<<1); k++) { + percepFilterParams[k*(UB_LPC_ORDER + 1) + (UB_LPC_ORDER + 1)] = + lpcGains[k]; + } + + /* perceptual pre-filtering (using normalized lattice filter) */ + /* first half-frame filtering */ + WebRtcIsac_NormLatticeFilterMa(UB_LPC_ORDER, + ISACencUB_obj->maskfiltstr_obj.PreStateLoF, + ISACencUB_obj->maskfiltstr_obj.PreStateLoG, + &ISACencUB_obj->data_buffer_float[0], + &percepFilterParams[UB_LPC_ORDER + 1], + &LP_lookahead[0]); + + /* Second half-frame filtering */ + WebRtcIsac_NormLatticeFilterMa(UB_LPC_ORDER, + ISACencUB_obj->maskfiltstr_obj.PreStateLoF, + ISACencUB_obj->maskfiltstr_obj.PreStateLoG, + &ISACencUB_obj->data_buffer_float[FRAMESAMPLES_HALF], + &percepFilterParams[(UB_LPC_ORDER + 1) + SUBFRAMES * + (UB_LPC_ORDER + 1)], &LP_lookahead[FRAMESAMPLES_HALF]); + + WebRtcIsac_Time2Spec(&LP_lookahead[0], &LP_lookahead[FRAMESAMPLES_HALF], + fre, fim, &ISACencUB_obj->fftstr_obj); + + //Store FFT coefficients for multiple encoding + memcpy(&ISACencUB_obj->SaveEnc_obj.realFFT, fre, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + memcpy(&ISACencUB_obj->SaveEnc_obj.imagFFT, fim, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + // Prepare the audio buffer for the next packet + // move the last 3 ms to the beginning of the buffer + memcpy(ISACencUB_obj->data_buffer_float, + &ISACencUB_obj->data_buffer_float[FRAMESAMPLES], + LB_TOTAL_DELAY_SAMPLES * sizeof(float)); + // start writing with 3 ms delay to compensate for the delay + // of the lower-band. + ISACencUB_obj->buffer_index = LB_TOTAL_DELAY_SAMPLES; + + // Save the bit-stream object at this point for FEC. + memcpy(&ISACencUB_obj->SaveEnc_obj.bitStreamObj, + &ISACencUB_obj->bitstr_obj, sizeof(Bitstr)); + + /* quantization and lossless coding */ + err = WebRtcIsac_EncodeSpecUB16(fre, fim, &ISACencUB_obj->bitstr_obj); + if ((err < 0) && (err != -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + return err; + } + + iterCntr = 0; + while((ISACencUB_obj->bitstr_obj.stream_index > payloadLimitBytes) || + (err == -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + double bytesSpecCoderUsed; + double transcodeScale; + + if (iterCntr >= MAX_PAYLOAD_LIMIT_ITERATION) { + /* We were not able to limit the payload size */ + return -ISAC_PAYLOAD_LARGER_THAN_LIMIT; + } + + if (err == -ISAC_DISALLOWED_BITSTREAM_LENGTH) { + bytesSpecCoderUsed = STREAM_SIZE_MAX; + // being conservative + transcodeScale = bytesLeftSpecCoding / bytesSpecCoderUsed * 0.5; + } else { + bytesSpecCoderUsed = ISACencUB_obj->bitstr_obj.stream_index - + transcodingParam.stream_index; + transcodeScale = bytesLeftSpecCoding / bytesSpecCoderUsed; + } + + /* To be safe, we reduce the scale depending on the + number of iterations. */ + transcodeScale *= (1.0 - (0.9 * (double)iterCntr/ + (double)MAX_PAYLOAD_LIMIT_ITERATION)); + + /* Scale the LPC Gains */ + for (k = 0; k < SUBFRAMES; k++) { + transcodingParam.loFiltGain[k] *= transcodeScale; + transcodingParam.hiFiltGain[k] *= transcodeScale; + } + + /* Scale DFT coefficients */ + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + fre[k] = (WebRtc_Word16)(fre[k] * transcodeScale + 0.5); + fim[k] = (WebRtc_Word16)(fim[k] * transcodeScale + 0.5); + } + + //Store FFT coefficients for multiple encoding + memcpy(&ISACencUB_obj->SaveEnc_obj.realFFT, fre, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + memcpy(&ISACencUB_obj->SaveEnc_obj.imagFFT, fim, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + + /* Store the state of arithmetic coder before coding LPC gains */ + ISACencUB_obj->bitstr_obj.W_upper = transcodingParam.W_upper; + + ISACencUB_obj->bitstr_obj.stream_index = transcodingParam.stream_index; + + ISACencUB_obj->bitstr_obj.streamval = transcodingParam.streamval; + + ISACencUB_obj->bitstr_obj.stream[transcodingParam.stream_index - 2] = + transcodingParam.stream[0]; + + ISACencUB_obj->bitstr_obj.stream[transcodingParam.stream_index - 1] = + transcodingParam.stream[1]; + + ISACencUB_obj->bitstr_obj.stream[transcodingParam.stream_index] = + transcodingParam.stream[2]; + + // Store the gains for multiple encoding + memcpy(ISACencUB_obj->SaveEnc_obj.lpcGain, lpcGains, + (SUBFRAMES << 1) * sizeof(double)); + + WebRtcIsac_EncodeLpcGainUb(transcodingParam.loFiltGain, + &ISACencUB_obj->bitstr_obj, + ISACencUB_obj->SaveEnc_obj.lpcGainIndex); + WebRtcIsac_EncodeLpcGainUb(transcodingParam.hiFiltGain, + &ISACencUB_obj->bitstr_obj, + &ISACencUB_obj->SaveEnc_obj.lpcGainIndex[SUBFRAMES]); + + /* Update the number of bytes left for encoding the spectrum */ + bytesLeftSpecCoding = payloadLimitBytes - + ISACencUB_obj->bitstr_obj.stream_index; + + // Save the bit-stream object at this point for FEC. + memcpy(&ISACencUB_obj->SaveEnc_obj.bitStreamObj, + &ISACencUB_obj->bitstr_obj, sizeof(Bitstr)); + + /* Encode the spectrum */ + err = WebRtcIsac_EncodeSpecUB16(fre, fim, &ISACencUB_obj->bitstr_obj); + if ((err < 0) && (err != -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + /* There has been an error but it was not too large payload + (we can cure too large payload) */ + return err; + } + iterCntr++; + } + + /* complete arithmetic coding */ + return WebRtcIsac_EncTerminate(&ISACencUB_obj->bitstr_obj); +} + + +int +WebRtcIsac_EncodeUb12( + float* in, + ISACUBEncStruct* ISACencUB_obj, + WebRtc_Word32 jitterInfo) +{ + int err; + int k; + int iterCntr; + + double lpcVecs[UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME]; + + double percepFilterParams[(1 + UB_LPC_ORDER) * SUBFRAMES]; + float LP[FRAMESAMPLES_HALF]; + float HP[FRAMESAMPLES_HALF]; + + double LP_lookahead[FRAMESAMPLES_HALF]; + double HP_lookahead[FRAMESAMPLES_HALF]; + double LPw[FRAMESAMPLES_HALF]; + + double HPw[FRAMESAMPLES_HALF]; + WebRtc_Word16 fre[FRAMESAMPLES_HALF]; /* Q7 */ + WebRtc_Word16 fim[FRAMESAMPLES_HALF]; /* Q7 */ + + int status = 0; + + double varscale[1]; + + double corr[UB_LPC_GAIN_DIM][UB_LPC_ORDER + 1]; + double lpcGains[SUBFRAMES]; + transcode_obj transcodingParam; + double bytesLeftSpecCoding; + WebRtc_UWord16 payloadLimitBytes; + double s2nr; + + /* buffer speech samples (by 10ms packet) until the framelength is */ + /* reached (30 or 60 ms) */ + /********************************************************************/ + + /* fill the buffer with 10ms input data */ + for (k=0; kdata_buffer_float[k + ISACencUB_obj->buffer_index] = + in[k]; + } + + /* if buffer-size is not equal to current frame-size then increase the + index and return. We do the encoding when we have enough audio. */ + if (ISACencUB_obj->buffer_index + FRAMESAMPLES_10ms < FRAMESAMPLES) { + ISACencUB_obj->buffer_index += FRAMESAMPLES_10ms; + return 0; + } + /* if buffer reached the right size, reset index and continue + with encoding the frame */ + ISACencUB_obj->buffer_index = 0; + + /* end of buffer function */ + /**************************/ + + /* encoding */ + /************/ + + /* reset bitstream */ + ISACencUB_obj->bitstr_obj.W_upper = 0xFFFFFFFF; + ISACencUB_obj->bitstr_obj.streamval = 0; + ISACencUB_obj->bitstr_obj.stream_index = 0; + + /* bandwidth estimation and coding */ + /* To be used for Redundant Coding */ + WebRtcIsac_EncodeJitterInfo(jitterInfo, &ISACencUB_obj->bitstr_obj); + + status = WebRtcIsac_EncodeBandwidth(isac12kHz, + &ISACencUB_obj->bitstr_obj); + if (status < 0) { + return status; + } + + + s2nr = WebRtcIsac_GetSnr(ISACencUB_obj->bottleneck, + FRAMESAMPLES); + + /* split signal in two bands */ + WebRtcIsac_SplitAndFilterFloat(ISACencUB_obj->data_buffer_float, HP, LP, + HP_lookahead, LP_lookahead, &ISACencUB_obj->prefiltbankstr_obj); + + /* find coefficients for perceptual pre-filters */ + WebRtcIsac_GetLpcCoefUb(LP_lookahead, &ISACencUB_obj->maskfiltstr_obj, + lpcVecs, corr, varscale, isac12kHz); + + /* code LPC model and shape - gains not quantized yet */ + WebRtcIsac_EncodeLpcUB(lpcVecs, &ISACencUB_obj->bitstr_obj, + percepFilterParams, isac12kHz, &ISACencUB_obj->SaveEnc_obj); + + WebRtcIsac_GetLpcGain(s2nr, percepFilterParams, SUBFRAMES, lpcGains, + corr, varscale); + + /* Store the state of arithmetic coder before coding LPC gains */ + transcodingParam.W_upper = ISACencUB_obj->bitstr_obj.W_upper; + + transcodingParam.stream_index = ISACencUB_obj->bitstr_obj.stream_index; + + transcodingParam.streamval = ISACencUB_obj->bitstr_obj.streamval; + + transcodingParam.stream[0] = ISACencUB_obj->bitstr_obj.stream[ + ISACencUB_obj->bitstr_obj.stream_index - 2]; + + transcodingParam.stream[1] = ISACencUB_obj->bitstr_obj.stream[ + ISACencUB_obj->bitstr_obj.stream_index - 1]; + + transcodingParam.stream[2] = ISACencUB_obj->bitstr_obj.stream[ + ISACencUB_obj->bitstr_obj.stream_index]; + + /* Store LPC Gains before encoding them */ + for(k = 0; k < SUBFRAMES; k++) { + transcodingParam.loFiltGain[k] = lpcGains[k]; + } + + // Store the gains for multiple encoding + memcpy(ISACencUB_obj->SaveEnc_obj.lpcGain, lpcGains, SUBFRAMES * + sizeof(double)); + + WebRtcIsac_EncodeLpcGainUb(lpcGains, &ISACencUB_obj->bitstr_obj, + ISACencUB_obj->SaveEnc_obj.lpcGainIndex); + + for(k = 0; k < SUBFRAMES; k++) { + percepFilterParams[k*(UB_LPC_ORDER + 1)] = lpcGains[k]; + } + + /* perceptual pre-filtering (using normalized lattice filter) */ + /* low-band filtering */ + WebRtcIsac_NormLatticeFilterMa(UB_LPC_ORDER, + ISACencUB_obj->maskfiltstr_obj.PreStateLoF, + ISACencUB_obj->maskfiltstr_obj.PreStateLoG, LP, percepFilterParams, + LPw); + + /* Get the correct value for the payload limit and calculate the number + of bytes left for coding the spectrum. It is a 30ms frame Subract 3 + because termination process may add 3 bytes */ + payloadLimitBytes = ISACencUB_obj->maxPayloadSizeBytes - + ISACencUB_obj->numBytesUsed - 3; + bytesLeftSpecCoding = payloadLimitBytes - + ISACencUB_obj->bitstr_obj.stream_index; + + memset(HPw, 0, sizeof(double) * FRAMESAMPLES_HALF); + + /* transform */ + WebRtcIsac_Time2Spec(LPw, HPw, fre, fim, &ISACencUB_obj->fftstr_obj); + + //Store real FFT coefficients for multiple encoding + memcpy(&ISACencUB_obj->SaveEnc_obj.realFFT, fre, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + //Store imaginary FFT coefficients for multiple encoding + memcpy(&ISACencUB_obj->SaveEnc_obj.imagFFT, fim, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + // Save the bit-stream object at this point for FEC. + memcpy(&ISACencUB_obj->SaveEnc_obj.bitStreamObj, + &ISACencUB_obj->bitstr_obj, sizeof(Bitstr)); + + /* quantization and lossless coding */ + err = WebRtcIsac_EncodeSpecUB12(fre, fim, &ISACencUB_obj->bitstr_obj); + if ((err < 0) && (err != -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + /* There has been an error but it was not too large + payload (we can cure too large payload) */ + return err; + } + iterCntr = 0; + while((ISACencUB_obj->bitstr_obj.stream_index > payloadLimitBytes) || + (err == -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + double bytesSpecCoderUsed; + double transcodeScale; + + if (iterCntr >= MAX_PAYLOAD_LIMIT_ITERATION) { + /* We were not able to limit the payload size */ + return -ISAC_PAYLOAD_LARGER_THAN_LIMIT; + } + + if (err == -ISAC_DISALLOWED_BITSTREAM_LENGTH) { + bytesSpecCoderUsed = STREAM_SIZE_MAX; + // being coservative + transcodeScale = bytesLeftSpecCoding / bytesSpecCoderUsed * 0.5; + } else { + bytesSpecCoderUsed = ISACencUB_obj->bitstr_obj.stream_index - + transcodingParam.stream_index; + transcodeScale = bytesLeftSpecCoding / bytesSpecCoderUsed; + } + + /* To be safe, we reduce the scale depending on the + number of iterations. */ + transcodeScale *= (1.0 - (0.9 * (double)iterCntr/ + (double)MAX_PAYLOAD_LIMIT_ITERATION)); + + /* Scale the LPC Gains */ + for (k = 0; k < SUBFRAMES; k++) { + transcodingParam.loFiltGain[k] *= transcodeScale; + } + + /* Scale DFT coefficients */ + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + fre[k] = (WebRtc_Word16)(fre[k] * transcodeScale + 0.5); + fim[k] = (WebRtc_Word16)(fim[k] * transcodeScale + 0.5); + } + + //Store real FFT coefficients for multiple encoding + memcpy(&ISACencUB_obj->SaveEnc_obj.realFFT, fre, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + //Store imaginary FFT coefficients for multiple encoding + memcpy(&ISACencUB_obj->SaveEnc_obj.imagFFT, fim, + FRAMESAMPLES_HALF * sizeof(WebRtc_Word16)); + + + /* Re-store the state of arithmetic coder before coding LPC gains */ + ISACencUB_obj->bitstr_obj.W_upper = transcodingParam.W_upper; + + ISACencUB_obj->bitstr_obj.stream_index = transcodingParam.stream_index; + + ISACencUB_obj->bitstr_obj.streamval = transcodingParam.streamval; + + ISACencUB_obj->bitstr_obj.stream[transcodingParam.stream_index - 2] = + transcodingParam.stream[0]; + + ISACencUB_obj->bitstr_obj.stream[transcodingParam.stream_index - 1] = + transcodingParam.stream[1]; + + ISACencUB_obj->bitstr_obj.stream[transcodingParam.stream_index] = + transcodingParam.stream[2]; + + // Store the gains for multiple encoding + memcpy(&ISACencUB_obj->SaveEnc_obj.lpcGain, lpcGains, SUBFRAMES * + sizeof(double)); + + // encode LPC gain and store quantization indices. HAving quantization + // indices reduces transcoding complexity if 'scale factor' is 1. + WebRtcIsac_EncodeLpcGainUb(transcodingParam.loFiltGain, + &ISACencUB_obj->bitstr_obj, + ISACencUB_obj->SaveEnc_obj.lpcGainIndex); + + // Save the bit-stream object at this point for FEC. + memcpy(&ISACencUB_obj->SaveEnc_obj.bitStreamObj, + &ISACencUB_obj->bitstr_obj, sizeof(Bitstr)); + + /* Update the number of bytes left for encoding the spectrum */ + bytesLeftSpecCoding = payloadLimitBytes - + ISACencUB_obj->bitstr_obj.stream_index; + + /* Encode the spectrum */ + err = WebRtcIsac_EncodeSpecUB12(fre, fim, + &ISACencUB_obj->bitstr_obj); + if ((err < 0) && (err != -ISAC_DISALLOWED_BITSTREAM_LENGTH)) { + /* There has been an error but it was not too large payload + (we can cure too large payload) */ + return err; + } + iterCntr++; + } + + /* complete arithmetic coding */ + return WebRtcIsac_EncTerminate(&ISACencUB_obj->bitstr_obj); +} + + + + + + +/* This function is used to create a new bitstream with new BWE. + The same data as previously encoded with the function WebRtcIsac_Encoder(). + The data needed is taken from the struct, where it was stored + when calling the encoder. */ + +int WebRtcIsac_EncodeStoredDataLb( + const ISAC_SaveEncData_t* ISACSavedEnc_obj, + Bitstr* ISACBitStr_obj, + int BWnumber, + float scale) +{ + int ii; + int status; + int BWno = BWnumber; + + const WebRtc_UWord16 *WebRtcIsac_kQPitchGainCdf_ptr[1]; + const WebRtc_UWord16 **cdf; + + double tmpLPCcoeffs_lo[(ORDERLO+1)*SUBFRAMES*2]; + double tmpLPCcoeffs_hi[(ORDERHI+1)*SUBFRAMES*2]; + int tmpLPCindex_g[12*2]; + WebRtc_Word16 tmp_fre[FRAMESAMPLES], tmp_fim[FRAMESAMPLES]; + + /* Sanity Check - possible values for BWnumber is 0 - 23 */ + if ((BWnumber < 0) || (BWnumber > 23)) { + return -ISAC_RANGE_ERROR_BW_ESTIMATOR; + } + + /* reset bitstream */ + ISACBitStr_obj->W_upper = 0xFFFFFFFF; + ISACBitStr_obj->streamval = 0; + ISACBitStr_obj->stream_index = 0; + + /* encode frame length */ + status = WebRtcIsac_EncodeFrameLen(ISACSavedEnc_obj->framelength, + ISACBitStr_obj); + if (status < 0) { + /* Wrong frame size */ + return status; + } + + /* Transcoding */ + if ((scale > 0.0) && (scale < 1.0)) { + /* Compensate LPC gain */ + for (ii = 0; + ii < ((ORDERLO + 1)* SUBFRAMES * (1 + ISACSavedEnc_obj->startIdx)); + ii++) { + tmpLPCcoeffs_lo[ii] = scale * ISACSavedEnc_obj->LPCcoeffs_lo[ii]; + } + for (ii = 0; + ii < ((ORDERHI + 1) * SUBFRAMES *(1 + ISACSavedEnc_obj->startIdx)); + ii++) { + tmpLPCcoeffs_hi[ii] = scale * ISACSavedEnc_obj->LPCcoeffs_hi[ii]; + } + /* Scale DFT */ + for (ii = 0; + ii < (FRAMESAMPLES_HALF * (1 + ISACSavedEnc_obj->startIdx)); + ii++) { + tmp_fre[ii] = (WebRtc_Word16)((scale) * + (float)ISACSavedEnc_obj->fre[ii]) ; + tmp_fim[ii] = (WebRtc_Word16)((scale) * + (float)ISACSavedEnc_obj->fim[ii]) ; + } + } else { + for (ii = 0; + ii < (KLT_ORDER_GAIN * (1 + ISACSavedEnc_obj->startIdx)); + ii++) { + tmpLPCindex_g[ii] = ISACSavedEnc_obj->LPCindex_g[ii]; + } + for (ii = 0; + ii < (FRAMESAMPLES_HALF * (1 + ISACSavedEnc_obj->startIdx)); + ii++) { + tmp_fre[ii] = ISACSavedEnc_obj->fre[ii]; + tmp_fim[ii] = ISACSavedEnc_obj->fim[ii]; + } + } + + /* encode bandwidth estimate */ + WebRtcIsac_EncodeReceiveBw(&BWno, ISACBitStr_obj); + + /* Loop over number of 30 msec */ + for (ii = 0; ii <= ISACSavedEnc_obj->startIdx; ii++) { + /* encode pitch gains */ + *WebRtcIsac_kQPitchGainCdf_ptr = WebRtcIsac_kQPitchGainCdf; + WebRtcIsac_EncHistMulti(ISACBitStr_obj, + &ISACSavedEnc_obj->pitchGain_index[ii], WebRtcIsac_kQPitchGainCdf_ptr, 1); + + /* entropy coding of quantization pitch lags */ + /* voicing classificiation */ + if (ISACSavedEnc_obj->meanGain[ii] < 0.2) { + cdf = WebRtcIsac_kQPitchLagCdfPtrLo; + } else if (ISACSavedEnc_obj->meanGain[ii] < 0.4) { + cdf = WebRtcIsac_kQPitchLagCdfPtrMid; + } else { + cdf = WebRtcIsac_kQPitchLagCdfPtrHi; + } + WebRtcIsac_EncHistMulti(ISACBitStr_obj, + &ISACSavedEnc_obj->pitchIndex[PITCH_SUBFRAMES*ii], cdf, + PITCH_SUBFRAMES); + + /* LPC */ + /* entropy coding of model number */ + WebRtcIsac_EncHistMulti(ISACBitStr_obj, + &ISACSavedEnc_obj->LPCmodel[ii], WebRtcIsac_kQKltModelCdfPtr, 1); + + /* entropy coding of quantization indices - LPC shape only */ + WebRtcIsac_EncHistMulti(ISACBitStr_obj, + &ISACSavedEnc_obj->LPCindex_s[KLT_ORDER_SHAPE*ii], + WebRtcIsac_kQKltCdfPtrShape[ISACSavedEnc_obj->LPCmodel[ii]], + KLT_ORDER_SHAPE); + + /* If transcoding, get new LPC gain indices */ + if (scale < 1.0) { + WebRtcIsac_TranscodeLPCCoef(&tmpLPCcoeffs_lo[(ORDERLO+1) * + SUBFRAMES*ii], &tmpLPCcoeffs_hi[(ORDERHI+1)*SUBFRAMES*ii], + ISACSavedEnc_obj->LPCmodel[ii], + &tmpLPCindex_g[KLT_ORDER_GAIN * ii]); + } + + /* entropy coding of quantization indices - LPC gain */ + WebRtcIsac_EncHistMulti(ISACBitStr_obj, + &tmpLPCindex_g[KLT_ORDER_GAIN*ii], WebRtcIsac_kQKltCdfPtrGain[ + ISACSavedEnc_obj->LPCmodel[ii]], KLT_ORDER_GAIN); + + /* quantization and lossless coding */ + status = WebRtcIsac_EncodeSpecLb(&tmp_fre[ii*FRAMESAMPLES_HALF], + &tmp_fim[ii*FRAMESAMPLES_HALF], ISACBitStr_obj, + ISACSavedEnc_obj->AvgPitchGain[ii]); + if (status < 0) { + return status; + } + } + + /* complete arithmetic coding */ + return WebRtcIsac_EncTerminate(ISACBitStr_obj); +} + + + + +int WebRtcIsac_EncodeStoredDataUb12( + const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, + Bitstr* bitStream, + WebRtc_Word32 jitterInfo, + float scale) +{ + int n; + int err; + double lpcGain[SUBFRAMES]; + WebRtc_Word16 realFFT[FRAMESAMPLES_HALF]; + WebRtc_Word16 imagFFT[FRAMESAMPLES_HALF]; + + /* reset bitstream */ + bitStream->W_upper = 0xFFFFFFFF; + bitStream->streamval = 0; + bitStream->stream_index = 0; + + // Encode jitter index + WebRtcIsac_EncodeJitterInfo(jitterInfo, bitStream); + + err = WebRtcIsac_EncodeBandwidth(isac12kHz, bitStream); + if(err < 0) + { + return err; + } + + // Encode LPC-shape + WebRtcIsac_EncHistMulti(bitStream, ISACSavedEnc_obj->indexLPCShape, + WebRtcIsac_kLpcShapeCdfMatUb12, UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME); + + + // we only consider scales between zero and one. + if((scale <= 0.0) || (scale > 1.0)) + { + scale = 1.0f; + } + + if(scale == 1.0f) + { + //memcpy(lpcGain, ISACSavedEnc_obj->lpcGain, SUBFRAMES * sizeof(double)); + WebRtcIsac_EncHistMulti(bitStream, ISACSavedEnc_obj->lpcGainIndex, + WebRtcIsac_kLpcGainCdfMat, UB_LPC_GAIN_DIM); + // store FFT coefficients + err = WebRtcIsac_EncodeSpecUB12(ISACSavedEnc_obj->realFFT, + ISACSavedEnc_obj->imagFFT, bitStream); + } + else + { + /* scale lpc gain and FFT coefficients */ + for(n = 0; n < SUBFRAMES; n++) + { + lpcGain[n] = scale * ISACSavedEnc_obj->lpcGain[n]; + } + // store lpc gain + WebRtcIsac_StoreLpcGainUb(lpcGain, bitStream); + for(n = 0; n < FRAMESAMPLES_HALF; n++) + { + realFFT[n] = (WebRtc_Word16)(scale * (float)ISACSavedEnc_obj->realFFT[n] + 0.5f); + imagFFT[n] = (WebRtc_Word16)(scale * (float)ISACSavedEnc_obj->imagFFT[n] + 0.5f); + } + // store FFT coefficients + err = WebRtcIsac_EncodeSpecUB12(realFFT, imagFFT, bitStream); + } + if(err < 0) + { + // error happened while encoding FFT coefficients. + return err; + } + + /* complete arithmetic coding */ + return WebRtcIsac_EncTerminate(bitStream); +} + + +int +WebRtcIsac_EncodeStoredDataUb16( + const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, + Bitstr* bitStream, + WebRtc_Word32 jitterInfo, + float scale) +{ + int n; + int err; + double lpcGain[SUBFRAMES << 1]; + WebRtc_Word16 realFFT[FRAMESAMPLES_HALF]; + WebRtc_Word16 imagFFT[FRAMESAMPLES_HALF]; + + /* reset bitstream */ + bitStream->W_upper = 0xFFFFFFFF; + bitStream->streamval = 0; + bitStream->stream_index = 0; + + // Encode jitter index + WebRtcIsac_EncodeJitterInfo(jitterInfo, bitStream); + + err = WebRtcIsac_EncodeBandwidth(isac16kHz, bitStream); + if(err < 0) + { + return err; + } + + WebRtcIsac_EncHistMulti(bitStream, ISACSavedEnc_obj->indexLPCShape, + WebRtcIsac_kLpcShapeCdfMatUb16, UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME); + + // we only consider scales between zero and one. + if((scale <= 0.0) || (scale > 1.0)) + { + scale = 1.0f; + } + + if(scale == 1.0f) + { + // store gains + WebRtcIsac_EncHistMulti(bitStream, ISACSavedEnc_obj->lpcGainIndex, + WebRtcIsac_kLpcGainCdfMat, UB_LPC_GAIN_DIM); + WebRtcIsac_EncHistMulti(bitStream, &ISACSavedEnc_obj->lpcGainIndex[SUBFRAMES], + WebRtcIsac_kLpcGainCdfMat, UB_LPC_GAIN_DIM); + // store FFT coefficients + err = WebRtcIsac_EncodeSpecUB16(ISACSavedEnc_obj->realFFT, + ISACSavedEnc_obj->imagFFT, bitStream); + + } + else + { + /* Scale Gain */ + for(n = 0; n < SUBFRAMES; n++) + { + lpcGain[n] = scale * ISACSavedEnc_obj->lpcGain[n]; + lpcGain[n + SUBFRAMES] = scale * ISACSavedEnc_obj->lpcGain[n + SUBFRAMES]; + } + // store lpc gain + WebRtcIsac_StoreLpcGainUb(lpcGain, bitStream); + WebRtcIsac_StoreLpcGainUb(&lpcGain[SUBFRAMES], bitStream); + /* scale FFT coefficients */ + for(n = 0; n < FRAMESAMPLES_HALF; n++) + { + realFFT[n] = (WebRtc_Word16)(scale * (float)ISACSavedEnc_obj->realFFT[n] + 0.5f); + imagFFT[n] = (WebRtc_Word16)(scale * (float)ISACSavedEnc_obj->imagFFT[n] + 0.5f); + } + // store FFT coefficients + err = WebRtcIsac_EncodeSpecUB16(realFFT, imagFFT, bitStream); + } + + if(err < 0) + { + // error happened while encoding FFT coefficients. + return err; + } + + /* complete arithmetic coding */ + return WebRtcIsac_EncTerminate(bitStream); +} + + +WebRtc_Word16 +WebRtcIsac_GetRedPayloadUb( + const ISACUBSaveEncDataStruct* ISACSavedEncObj, + Bitstr* bitStreamObj, + enum ISACBandwidth bandwidth) +{ + int n; + WebRtc_Word16 status; + WebRtc_Word16 realFFT[FRAMESAMPLES_HALF]; + WebRtc_Word16 imagFFT[FRAMESAMPLES_HALF]; + + // store bit-stream object. + memcpy(bitStreamObj, &ISACSavedEncObj->bitStreamObj, sizeof(Bitstr)); + + // Scale FFT coefficients. + for(n = 0; n < FRAMESAMPLES_HALF; n++) + { + realFFT[n] = (WebRtc_Word16)((float)ISACSavedEncObj->realFFT[n] * + RCU_TRANSCODING_SCALE_UB + 0.5); + imagFFT[n] = (WebRtc_Word16)((float)ISACSavedEncObj->imagFFT[n] * + RCU_TRANSCODING_SCALE_UB + 0.5); + } + + switch(bandwidth) + { + case isac12kHz: + { + status = WebRtcIsac_EncodeSpecUB12(realFFT, imagFFT, bitStreamObj); + break; + } + case isac16kHz: + { + status = WebRtcIsac_EncodeSpecUB16(realFFT, imagFFT, bitStreamObj); + break; + } + default: + return -1; + } + + if(status < 0) + { + // error happened + return status; + } + else + { + // terminate entropy coding + return WebRtcIsac_EncTerminate(bitStreamObj); + } +} diff --git a/src/mod/codecs/mod_isac/encode_lpc_swb.c b/src/mod/codecs/mod_isac/encode_lpc_swb.c new file mode 100644 index 0000000000..2bf4c36460 --- /dev/null +++ b/src/mod/codecs/mod_isac/encode_lpc_swb.c @@ -0,0 +1,708 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * code_LPC_UB.c + * + * This file contains definition of functions used to + * encode LPC parameters (Shape & gain) of the upper band. + * + */ + +#include "encode_lpc_swb.h" +#include "typedefs.h" +#include "settings.h" + +#include "lpc_shape_swb12_tables.h" +#include "lpc_shape_swb16_tables.h" +#include "lpc_gain_swb_tables.h" + +#include +#include +#include + +/****************************************************************************** + * WebRtcIsac_RemoveLarMean() + * + * Remove the means from LAR coefficients. + * + * Input: + * -lar : pointer to lar vectors. LAR vectors are + * concatenated. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -lar : pointer to mean-removed LAR:s. + * + * + */ +WebRtc_Word16 +WebRtcIsac_RemoveLarMean( + double* lar, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 coeffCntr; + WebRtc_Word16 vecCntr; + WebRtc_Word16 numVec; + const double* meanLAR; + switch(bandwidth) + { + case isac12kHz: + { + numVec = UB_LPC_VEC_PER_FRAME; + meanLAR = WebRtcIsac_kMeanLarUb12; + break; + } + case isac16kHz: + { + numVec = UB16_LPC_VEC_PER_FRAME; + meanLAR = WebRtcIsac_kMeanLarUb16; + break; + } + default: + return -1; + } + + for(vecCntr = 0; vecCntr < numVec; vecCntr++) + { + for(coeffCntr = 0; coeffCntr < UB_LPC_ORDER; coeffCntr++) + { + // REMOVE MEAN + *lar++ -= meanLAR[coeffCntr]; + } + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_DecorrelateIntraVec() + * + * Remove the correlation amonge the components of LAR vectors. If LAR vectors + * of one frame are put in a matrix where each column is a LAR vector of a + * sub-frame, then this is equivalent to multiplying the LAR matrix with + * a decorrelting mtrix from left. + * + * Input: + * -inLar : pointer to mean-removed LAR vecrtors. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : decorrelated LAR vectors. + */ +WebRtc_Word16 +WebRtcIsac_DecorrelateIntraVec( + const double* data, + double* out, + WebRtc_Word16 bandwidth) +{ + const double* ptrData; + const double* ptrRow; + WebRtc_Word16 rowCntr; + WebRtc_Word16 colCntr; + WebRtc_Word16 larVecCntr; + WebRtc_Word16 numVec; + const double* decorrMat; + switch(bandwidth) + { + case isac12kHz: + { + decorrMat = &WebRtcIsac_kIntraVecDecorrMatUb12[0][0]; + numVec = UB_LPC_VEC_PER_FRAME; + break; + } + case isac16kHz: + { + decorrMat = &WebRtcIsac_kIintraVecDecorrMatUb16[0][0]; + numVec = UB16_LPC_VEC_PER_FRAME; + break; + } + default: + return -1; + } + + // + // decorrMat * data + // + // data is assumed to contain 'numVec' of LAR + // vectors (mean removed) each of dimension 'UB_LPC_ORDER' + // concatenated one after the other. + // + + ptrData = data; + for(larVecCntr = 0; larVecCntr < numVec; larVecCntr++) + { + for(rowCntr = 0; rowCntr < UB_LPC_ORDER; rowCntr++) + { + ptrRow = &decorrMat[rowCntr * UB_LPC_ORDER]; + *out = 0; + for(colCntr = 0; colCntr < UB_LPC_ORDER; colCntr++) + { + *out += ptrData[colCntr] * ptrRow[colCntr]; + } + out++; + } + ptrData += UB_LPC_ORDER; + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_DecorrelateInterVec() + * + * Remover the correlation among mean-removed LAR vectors. If LAR vectors + * of one frame are put in a matrix where each column is a LAR vector of a + * sub-frame, then this is equivalent to multiplying the LAR matrix with + * a decorrelting mtrix from right. + * + * Input: + * -data : pointer to matrix of LAR vectors. The matrix + * is stored column-wise. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : decorrelated LAR vectors. + */ +WebRtc_Word16 +WebRtcIsac_DecorrelateInterVec( + const double* data, + double* out, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 coeffCntr; + WebRtc_Word16 rowCntr; + WebRtc_Word16 colCntr; + const double* decorrMat; + WebRtc_Word16 interVecDim; + + switch(bandwidth) + { + case isac12kHz: + { + decorrMat = &WebRtcIsac_kInterVecDecorrMatUb12[0][0]; + interVecDim = UB_LPC_VEC_PER_FRAME; + break; + } + case isac16kHz: + { + decorrMat = &WebRtcIsac_kInterVecDecorrMatUb16[0][0]; + interVecDim = UB16_LPC_VEC_PER_FRAME; + break; + } + default: + return -1; + } + + // + // data * decorrMat + // + // data is of size 'interVecDim' * 'UB_LPC_ORDER' + // That is 'interVecDim' of LAR vectors (mean removed) + // in columns each of dimension 'UB_LPC_ORDER'. + // matrix is stored column-wise. + // + + for(coeffCntr = 0; coeffCntr < UB_LPC_ORDER; coeffCntr++) + { + for(colCntr = 0; colCntr < interVecDim; colCntr++) + { + out[coeffCntr + colCntr * UB_LPC_ORDER] = 0; + for(rowCntr = 0; rowCntr < interVecDim; rowCntr++) + { + out[coeffCntr + colCntr * UB_LPC_ORDER] += + data[coeffCntr + rowCntr * UB_LPC_ORDER] * + decorrMat[rowCntr * interVecDim + colCntr]; + } + } + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_QuantizeUncorrLar() + * + * Quantize the uncorrelated parameters. + * + * Input: + * -data : uncorrelated LAR vectors. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -data : quantized version of the input. + * -idx : pointer to quantization indices. + */ +double +WebRtcIsac_QuantizeUncorrLar( + double* data, + int* recIdx, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 cntr; + WebRtc_Word32 idx; + WebRtc_Word16 interVecDim; + const double* leftRecPoint; + double quantizationStepSize; + const WebRtc_Word16* numQuantCell; + switch(bandwidth) + { + case isac12kHz: + { + leftRecPoint = WebRtcIsac_kLpcShapeLeftRecPointUb12; + quantizationStepSize = WebRtcIsac_kLpcShapeQStepSizeUb12; + numQuantCell = WebRtcIsac_kLpcShapeNumRecPointUb12; + interVecDim = UB_LPC_VEC_PER_FRAME; + break; + } + case isac16kHz: + { + leftRecPoint = WebRtcIsac_kLpcShapeLeftRecPointUb16; + quantizationStepSize = WebRtcIsac_kLpcShapeQStepSizeUb16; + numQuantCell = WebRtcIsac_kLpcShapeNumRecPointUb16; + interVecDim = UB16_LPC_VEC_PER_FRAME; + break; + } + default: + return -1; + } + + // + // Quantize the parametrs. + // + for(cntr = 0; cntr < UB_LPC_ORDER * interVecDim; cntr++) + { + idx = (WebRtc_Word32)floor((*data - leftRecPoint[cntr]) / + quantizationStepSize + 0.5); + if(idx < 0) + { + idx = 0; + } + else if(idx >= numQuantCell[cntr]) + { + idx = numQuantCell[cntr] - 1; + } + + *data++ = leftRecPoint[cntr] + idx * quantizationStepSize; + *recIdx++ = idx; + } + return 0; +} + + +/****************************************************************************** + * WebRtcIsac_DequantizeLpcParam() + * + * Get the quantized value of uncorrelated LARs given the quantization indices. + * + * Input: + * -idx : pointer to quantiztion indices. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : pointer to quantized values. + */ +WebRtc_Word16 +WebRtcIsac_DequantizeLpcParam( + const int* idx, + double* out, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 cntr; + WebRtc_Word16 interVecDim; + const double* leftRecPoint; + double quantizationStepSize; + + switch(bandwidth) + { + case isac12kHz: + { + leftRecPoint = WebRtcIsac_kLpcShapeLeftRecPointUb12; + quantizationStepSize = WebRtcIsac_kLpcShapeQStepSizeUb12; + interVecDim = UB_LPC_VEC_PER_FRAME; + break; + } + case isac16kHz: + { + leftRecPoint = WebRtcIsac_kLpcShapeLeftRecPointUb16; + quantizationStepSize = WebRtcIsac_kLpcShapeQStepSizeUb16; + interVecDim = UB16_LPC_VEC_PER_FRAME; + break; + } + default: + return -1; + } + + // + // Dequantize given the quantization indices + // + + for(cntr = 0; cntr < UB_LPC_ORDER * interVecDim; cntr++) + { + *out++ = leftRecPoint[cntr] + *idx++ * quantizationStepSize; + } + return 0; +} + + +/****************************************************************************** + * WebRtcIsac_CorrelateIntraVec() + * + * This is the inverse of WebRtcIsac_DecorrelateIntraVec(). + * + * Input: + * -data : uncorrelated parameters. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : correlated parametrs. + */ +WebRtc_Word16 +WebRtcIsac_CorrelateIntraVec( + const double* data, + double* out, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 vecCntr; + WebRtc_Word16 rowCntr; + WebRtc_Word16 colCntr; + WebRtc_Word16 numVec; + const double* ptrData; + const double* intraVecDecorrMat; + + switch(bandwidth) + { + case isac12kHz: + { + numVec = UB_LPC_VEC_PER_FRAME; + intraVecDecorrMat = &WebRtcIsac_kIntraVecDecorrMatUb12[0][0]; + break; + } + case isac16kHz: + { + numVec = UB16_LPC_VEC_PER_FRAME; + intraVecDecorrMat = &WebRtcIsac_kIintraVecDecorrMatUb16[0][0]; + break; + } + default: + return -1; + } + + + ptrData = data; + for(vecCntr = 0; vecCntr < numVec; vecCntr++) + { + for(colCntr = 0; colCntr < UB_LPC_ORDER; colCntr++) + { + *out = 0; + for(rowCntr = 0; rowCntr < UB_LPC_ORDER; rowCntr++) + { + *out += ptrData[rowCntr] * + intraVecDecorrMat[rowCntr * UB_LPC_ORDER + colCntr]; + } + out++; + } + ptrData += UB_LPC_ORDER; + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_CorrelateInterVec() + * + * This is the inverse of WebRtcIsac_DecorrelateInterVec(). + * + * Input: + * -data + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : correlated parametrs. + */ +WebRtc_Word16 +WebRtcIsac_CorrelateInterVec( + const double* data, + double* out, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 coeffCntr; + WebRtc_Word16 rowCntr; + WebRtc_Word16 colCntr; + WebRtc_Word16 interVecDim; + double myVec[UB16_LPC_VEC_PER_FRAME]; + const double* interVecDecorrMat; + + switch(bandwidth) + { + case isac12kHz: + { + interVecDim = UB_LPC_VEC_PER_FRAME; + interVecDecorrMat = &WebRtcIsac_kInterVecDecorrMatUb12[0][0]; + break; + } + case isac16kHz: + { + interVecDim = UB16_LPC_VEC_PER_FRAME; + interVecDecorrMat = &WebRtcIsac_kInterVecDecorrMatUb16[0][0]; + break; + } + default: + return -1; + } + + for(coeffCntr = 0; coeffCntr < UB_LPC_ORDER; coeffCntr++) + { + for(rowCntr = 0; rowCntr < interVecDim; rowCntr++) + { + myVec[rowCntr] = 0; + for(colCntr = 0; colCntr < interVecDim; colCntr++) + { + myVec[rowCntr] += data[coeffCntr + colCntr * UB_LPC_ORDER] * //*ptrData * + interVecDecorrMat[rowCntr * interVecDim + colCntr]; + //ptrData += UB_LPC_ORDER; + } + } + + for(rowCntr = 0; rowCntr < interVecDim; rowCntr++) + { + out[coeffCntr + rowCntr * UB_LPC_ORDER] = myVec[rowCntr]; + } + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_AddLarMean() + * + * This is the inverse of WebRtcIsac_RemoveLarMean() + * + * Input: + * -data : pointer to mean-removed LAR:s. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -data : pointer to LARs. + */ +WebRtc_Word16 +WebRtcIsac_AddLarMean( + double* data, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 coeffCntr; + WebRtc_Word16 vecCntr; + WebRtc_Word16 numVec; + const double* meanLAR; + + switch(bandwidth) + { + case isac12kHz: + { + numVec = UB_LPC_VEC_PER_FRAME; + meanLAR = WebRtcIsac_kMeanLarUb12; + break; + } + case isac16kHz: + { + numVec = UB16_LPC_VEC_PER_FRAME; + meanLAR = WebRtcIsac_kMeanLarUb16; + break; + } + default: + return -1; + } + + for(vecCntr = 0; vecCntr < numVec; vecCntr++) + { + for(coeffCntr = 0; coeffCntr < UB_LPC_ORDER; coeffCntr++) + { + *data++ += meanLAR[coeffCntr]; + } + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_ToLogDomainRemoveMean() + * + * Transform the LPC gain to log domain then remove the mean value. + * + * Input: + * -lpcGain : pointer to LPC Gain, expecting 6 LPC gains + * + * Output: + * -lpcGain : mean-removed in log domain. + */ +WebRtc_Word16 +WebRtcIsac_ToLogDomainRemoveMean( + double* data) +{ + WebRtc_Word16 coeffCntr; + for(coeffCntr = 0; coeffCntr < UB_LPC_GAIN_DIM; coeffCntr++) + { + data[coeffCntr] = log(data[coeffCntr]) - WebRtcIsac_kMeanLpcGain; + } + return 0; +} + + +/****************************************************************************** + * WebRtcIsac_DecorrelateLPGain() + * + * Decorrelate LPC gains. There are 6 LPC Gains per frame. This is like + * multiplying gain vector with decorrelating matrix. + * + * Input: + * -data : LPC gain in log-domain with mean removed. + * + * Output: + * -out : decorrelated parameters. + */ +WebRtc_Word16 WebRtcIsac_DecorrelateLPGain( + const double* data, + double* out) +{ + WebRtc_Word16 rowCntr; + WebRtc_Word16 colCntr; + + for(colCntr = 0; colCntr < UB_LPC_GAIN_DIM; colCntr++) + { + *out = 0; + for(rowCntr = 0; rowCntr < UB_LPC_GAIN_DIM; rowCntr++) + { + *out += data[rowCntr] * WebRtcIsac_kLpcGainDecorrMat[rowCntr][colCntr]; + } + out++; + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_QuantizeLpcGain() + * + * Quantize the decorrelated log-domain gains. + * + * Input: + * -lpcGain : uncorrelated LPC gains. + * + * Output: + * -idx : quantization indices + * -lpcGain : quantized value of the inpt. + */ +double WebRtcIsac_QuantizeLpcGain( + double* data, + int* idx) +{ + WebRtc_Word16 coeffCntr; + for(coeffCntr = 0; coeffCntr < UB_LPC_GAIN_DIM; coeffCntr++) + { + *idx = (int)floor((*data - WebRtcIsac_kLeftRecPointLpcGain[coeffCntr]) / + WebRtcIsac_kQSizeLpcGain + 0.5); + + if(*idx < 0) + { + *idx = 0; + } + else if(*idx >= WebRtcIsac_kNumQCellLpcGain[coeffCntr]) + { + *idx = WebRtcIsac_kNumQCellLpcGain[coeffCntr] - 1; + } + *data = WebRtcIsac_kLeftRecPointLpcGain[coeffCntr] + *idx * + WebRtcIsac_kQSizeLpcGain; + + data++; + idx++; + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_DequantizeLpcGain() + * + * Get the quantized values given the quantization indices. + * + * Input: + * -idx : pointer to quantization indices. + * + * Output: + * -lpcGains : quantized values of the given parametes. + */ +WebRtc_Word16 WebRtcIsac_DequantizeLpcGain( + const int* idx, + double* out) +{ + WebRtc_Word16 coeffCntr; + for(coeffCntr = 0; coeffCntr < UB_LPC_GAIN_DIM; coeffCntr++) + { + *out = WebRtcIsac_kLeftRecPointLpcGain[coeffCntr] + *idx * + WebRtcIsac_kQSizeLpcGain; + out++; + idx++; + } + return 0; +} + +/****************************************************************************** + * WebRtcIsac_CorrelateLpcGain() + * + * This is the inverse of WebRtcIsac_DecorrelateLPGain(). + * + * Input: + * -data : decorrelated parameters. + * + * Output: + * -out : correlated parameters. + */ +WebRtc_Word16 WebRtcIsac_CorrelateLpcGain( + const double* data, + double* out) +{ + WebRtc_Word16 rowCntr; + WebRtc_Word16 colCntr; + + for(rowCntr = 0; rowCntr < UB_LPC_GAIN_DIM; rowCntr++) + { + *out = 0; + for(colCntr = 0; colCntr < UB_LPC_GAIN_DIM; colCntr++) + { + *out += WebRtcIsac_kLpcGainDecorrMat[rowCntr][colCntr] * data[colCntr]; + } + out++; + } + + return 0; +} + + +/****************************************************************************** + * WebRtcIsac_AddMeanToLinearDomain() + * + * This is the inverse of WebRtcIsac_ToLogDomainRemoveMean(). + * + * Input: + * -lpcGain : LPC gain in log-domain & mean removed + * + * Output: + * -lpcGain : LPC gain in normal domain. + */ +WebRtc_Word16 WebRtcIsac_AddMeanToLinearDomain( + double* lpcGains) +{ + WebRtc_Word16 coeffCntr; + for(coeffCntr = 0; coeffCntr < UB_LPC_GAIN_DIM; coeffCntr++) + { + lpcGains[coeffCntr] = exp(lpcGains[coeffCntr] + WebRtcIsac_kMeanLpcGain); + } + return 0; +} diff --git a/src/mod/codecs/mod_isac/encode_lpc_swb.h b/src/mod/codecs/mod_isac/encode_lpc_swb.h new file mode 100644 index 0000000000..e7f1a76af2 --- /dev/null +++ b/src/mod/codecs/mod_isac/encode_lpc_swb.h @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * encode_lpc_swb.h + * + * This file contains declaration of functions used to + * encode LPC parameters (Shape & gain) of the upper band. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENCODE_LPC_SWB_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENCODE_LPC_SWB_H_ + +#include "typedefs.h" +#include "settings.h" +#include "structs.h" + + +/****************************************************************************** + * WebRtcIsac_RemoveLarMean() + * + * Remove the means from LAR coefficients. + * + * Input: + * -lar : pointer to lar vectors. LAR vectors are + * concatenated. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -lar : pointer to mean-removed LAR:s. + * + * + */ +WebRtc_Word16 WebRtcIsac_RemoveLarMean( + double* lar, + WebRtc_Word16 bandwidth); + +/****************************************************************************** + * WebRtcIsac_DecorrelateIntraVec() + * + * Remove the correlation amonge the components of LAR vectors. If LAR vectors + * of one frame are put in a matrix where each column is a LAR vector of a + * sub-frame, then this is equivalent to multiplying the LAR matrix with + * a decorrelting mtrix from left. + * + * Input: + * -inLar : pointer to mean-removed LAR vecrtors. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : decorrelated LAR vectors. + */ +WebRtc_Word16 WebRtcIsac_DecorrelateIntraVec( + const double* inLAR, + double* out, + WebRtc_Word16 bandwidth); + + +/****************************************************************************** + * WebRtcIsac_DecorrelateInterVec() + * + * Remover the correlation among mean-removed LAR vectors. If LAR vectors + * of one frame are put in a matrix where each column is a LAR vector of a + * sub-frame, then this is equivalent to multiplying the LAR matrix with + * a decorrelting mtrix from right. + * + * Input: + * -data : pointer to matrix of LAR vectors. The matrix + * is stored column-wise. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : decorrelated LAR vectors. + */ +WebRtc_Word16 WebRtcIsac_DecorrelateInterVec( + const double* data, + double* out, + WebRtc_Word16 bandwidth); + + +/****************************************************************************** + * WebRtcIsac_QuantizeUncorrLar() + * + * Quantize the uncorrelated parameters. + * + * Input: + * -data : uncorrelated LAR vectors. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -data : quantized version of the input. + * -idx : pointer to quantization indices. + */ +double WebRtcIsac_QuantizeUncorrLar( + double* data, + int* idx, + WebRtc_Word16 bandwidth); + + +/****************************************************************************** + * WebRtcIsac_CorrelateIntraVec() + * + * This is the inverse of WebRtcIsac_DecorrelateIntraVec(). + * + * Input: + * -data : uncorrelated parameters. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : correlated parametrs. + */ +WebRtc_Word16 WebRtcIsac_CorrelateIntraVec( + const double* data, + double* out, + WebRtc_Word16 bandwidth); + + +/****************************************************************************** + * WebRtcIsac_CorrelateInterVec() + * + * This is the inverse of WebRtcIsac_DecorrelateInterVec(). + * + * Input: + * -data + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : correlated parametrs. + */ +WebRtc_Word16 WebRtcIsac_CorrelateInterVec( + const double* data, + double* out, + WebRtc_Word16 bandwidth); + + +/****************************************************************************** + * WebRtcIsac_AddLarMean() + * + * This is the inverse of WebRtcIsac_RemoveLarMean() + * + * Input: + * -data : pointer to mean-removed LAR:s. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -data : pointer to LARs. + */ +WebRtc_Word16 WebRtcIsac_AddLarMean( + double* data, + WebRtc_Word16 bandwidth); + + +/****************************************************************************** + * WebRtcIsac_DequantizeLpcParam() + * + * Get the quantized value of uncorrelated LARs given the quantization indices. + * + * Input: + * -idx : pointer to quantiztion indices. + * -bandwidth : indicates if the given LAR vectors belong + * to SWB-12kHz or SWB-16kHz. + * + * Output: + * -out : pointer to quantized values. + */ +WebRtc_Word16 WebRtcIsac_DequantizeLpcParam( + const int* idx, + double* out, + WebRtc_Word16 bandwidth); + + +/****************************************************************************** + * WebRtcIsac_ToLogDomainRemoveMean() + * + * Transform the LPC gain to log domain then remove the mean value. + * + * Input: + * -lpcGain : pointer to LPC Gain, expecting 6 LPC gains + * + * Output: + * -lpcGain : mean-removed in log domain. + */ +WebRtc_Word16 WebRtcIsac_ToLogDomainRemoveMean( + double* lpGains); + + +/****************************************************************************** + * WebRtcIsac_DecorrelateLPGain() + * + * Decorrelate LPC gains. There are 6 LPC Gains per frame. This is like + * multiplying gain vector with decorrelating matrix. + * + * Input: + * -data : LPC gain in log-domain with mean removed. + * + * Output: + * -out : decorrelated parameters. + */ +WebRtc_Word16 WebRtcIsac_DecorrelateLPGain( + const double* data, + double* out); + + +/****************************************************************************** + * WebRtcIsac_QuantizeLpcGain() + * + * Quantize the decorrelated log-domain gains. + * + * Input: + * -lpcGain : uncorrelated LPC gains. + * + * Output: + * -idx : quantization indices + * -lpcGain : quantized value of the inpt. + */ +double WebRtcIsac_QuantizeLpcGain( + double* lpGains, + int* idx); + + +/****************************************************************************** + * WebRtcIsac_DequantizeLpcGain() + * + * Get the quantized values given the quantization indices. + * + * Input: + * -idx : pointer to quantization indices. + * + * Output: + * -lpcGains : quantized values of the given parametes. + */ +WebRtc_Word16 WebRtcIsac_DequantizeLpcGain( + const int* idx, + double* lpGains); + + +/****************************************************************************** + * WebRtcIsac_CorrelateLpcGain() + * + * This is the inverse of WebRtcIsac_DecorrelateLPGain(). + * + * Input: + * -data : decorrelated parameters. + * + * Output: + * -out : correlated parameters. + */ +WebRtc_Word16 WebRtcIsac_CorrelateLpcGain( + const double* data, + double* out); + + +/****************************************************************************** + * WebRtcIsac_AddMeanToLinearDomain() + * + * This is the inverse of WebRtcIsac_ToLogDomainRemoveMean(). + * + * Input: + * -lpcGain : LPC gain in log-domain & mean removed + * + * Output: + * -lpcGain : LPC gain in normal domain. + */ +WebRtc_Word16 WebRtcIsac_AddMeanToLinearDomain( + double* lpcGains); + + +#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENCODE_LPC_SWB_H_ diff --git a/src/mod/codecs/mod_isac/energy.c b/src/mod/codecs/mod_isac/energy.c new file mode 100644 index 0000000000..e8fdf94e03 --- /dev/null +++ b/src/mod/codecs/mod_isac/energy.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_Energy(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +WebRtc_Word32 WebRtcSpl_Energy(WebRtc_Word16* vector, int vector_length, int* scale_factor) +{ + WebRtc_Word32 en = 0; + int i; + int scaling = WebRtcSpl_GetScalingSquare(vector, vector_length, vector_length); + int looptimes = vector_length; + WebRtc_Word16 *vectorptr = vector; + + for (i = 0; i < looptimes; i++) + { + en += WEBRTC_SPL_MUL_16_16_RSFT(*vectorptr, *vectorptr, scaling); + vectorptr++; + } + *scale_factor = scaling; + + return en; +} diff --git a/src/mod/codecs/mod_isac/entropy_coding.c b/src/mod/codecs/mod_isac/entropy_coding.c new file mode 100644 index 0000000000..a7299447f1 --- /dev/null +++ b/src/mod/codecs/mod_isac/entropy_coding.c @@ -0,0 +1,2748 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * entropy_coding.c + * + * This header file defines all of the functions used to arithmetically + * encode the iSAC bistream + * + */ + + +#include "entropy_coding.h" +#include "settings.h" +#include "arith_routines.h" +#include "signal_processing_library.h" +#include "spectrum_ar_model_tables.h" +#include "lpc_tables.h" +#include "pitch_gain_tables.h" +#include "pitch_lag_tables.h" +#include "encode_lpc_swb.h" +#include "lpc_shape_swb12_tables.h" +#include "lpc_shape_swb16_tables.h" +#include "lpc_gain_swb_tables.h" +#include "os_specific_inline.h" + +#include +#include + +static const WebRtc_UWord16 kLpcVecPerSegmentUb12 = 5; +static const WebRtc_UWord16 kLpcVecPerSegmentUb16 = 4; + +/* coefficients for the stepwise rate estimation */ +static const WebRtc_Word32 kRPointsQ10[100] = { + 14495, 14295, 14112, 13944, 13788, 13643, 13459, 13276, 13195, 13239, + 13243, 13191, 13133, 13216, 13263, 13330, 13316, 13242, 13191, 13106, + 12942, 12669, 12291, 11840, 11361, 10795, 10192, 9561, 8934, 8335, + 7750, 7161, 6589, 6062, 5570, 5048, 4548, 4069, 3587, 3143, + 2717, 2305, 1915, 1557, 1235, 963, 720, 541, 423, 366, + 369, 435, 561, 750, 1001, 1304, 1626, 1989, 2381, 2793, + 3219, 3656, 4134, 4612, 5106, 5629, 6122, 6644, 7216, 7801, + 8386, 8987, 9630, 10255, 10897, 11490, 11950, 12397, 12752, 12999, + 13175, 13258, 13323, 13290, 13296, 13335, 13113, 13255, 13347, 13355, + 13298, 13247, 13313, 13155, 13267, 13313, 13374, 13446, 13525, 13609}; + + +/* cdf array for encoder bandwidth (12 vs 16 kHz) indicator */ +static const WebRtc_UWord16 kOneBitEqualProbCdf[3] = { + 0, 32768, 65535 }; + +/* pointer to cdf array for encoder bandwidth (12 vs 16 kHz) indicator */ +static const WebRtc_UWord16 *kOneBitEqualProbCdf_ptr[1] = { + kOneBitEqualProbCdf }; + +/* initial cdf index for decoder of encoded bandwidth (12 vs 16 kHz) indicator */ +static const WebRtc_UWord16 kOneBitEqualProbInitIndex[1] = {1}; + + +/* coefficients for the stepwise rate estimation */ + + +static const WebRtc_Word32 acnQ10 = 426; +static const WebRtc_Word32 bcnQ10 = -581224; +static const WebRtc_Word32 ccnQ10 = 722631; +static const WebRtc_Word32 lbcnQ10 = -402874; +#define DPMIN_Q10 -10240 // -10.00 in Q10 +#define DPMAX_Q10 10240 // 10.00 in Q10 +#define MINBITS_Q10 10240 /* 10.0 in Q10 */ +#define IS_SWB_12KHZ 1 + +__inline WebRtc_UWord32 stepwise(WebRtc_Word32 dinQ10) { + + WebRtc_Word32 ind, diQ10, dtQ10; + + diQ10 = dinQ10; + if (diQ10 < DPMIN_Q10) + diQ10 = DPMIN_Q10; + if (diQ10 >= DPMAX_Q10) + diQ10 = DPMAX_Q10 - 1; + + dtQ10 = diQ10 - DPMIN_Q10; /* Q10 + Q10 = Q10 */ + ind = (dtQ10 * 5) >> 10; /* 2^10 / 5 = 0.2 in Q10 */ + /* Q10 -> Q0 */ + + return kRPointsQ10[ind]; +} + + +__inline short log2_Q10_B( int x ) +{ + int zeros; + short frac; + + zeros = WebRtcSpl_NormU32( x ); + frac = ((unsigned int)(x << zeros) & 0x7FFFFFFF) >> 21; + return (short) (((31 - zeros) << 10) + frac); +} + + + +/* compute correlation from power spectrum */ +static void WebRtcIsac_FindCorrelation(WebRtc_Word32 *PSpecQ12, WebRtc_Word32 *CorrQ7) +{ + WebRtc_Word32 summ[FRAMESAMPLES/8]; + WebRtc_Word32 diff[FRAMESAMPLES/8]; + const WebRtc_Word16 *CS_ptrQ9; + WebRtc_Word32 sum; + int k, n; + + for (k = 0; k < FRAMESAMPLES/8; k++) { + summ[k] = (PSpecQ12[k] + PSpecQ12[FRAMESAMPLES_QUARTER-1 - k] + 16) >> 5; + diff[k] = (PSpecQ12[k] - PSpecQ12[FRAMESAMPLES_QUARTER-1 - k] + 16) >> 5; + } + + sum = 2; + for (n = 0; n < FRAMESAMPLES/8; n++) + sum += summ[n]; + CorrQ7[0] = sum; + + for (k = 0; k < AR_ORDER; k += 2) { + sum = 0; + CS_ptrQ9 = WebRtcIsac_kCos[k]; + for (n = 0; n < FRAMESAMPLES/8; n++) + sum += (CS_ptrQ9[n] * diff[n] + 256) >> 9; + CorrQ7[k+1] = sum; + } + + for (k=1; k> 9; + CorrQ7[k+1] = sum; + } +} + +/* compute inverse AR power spectrum */ +/* Changed to the function used in iSAC FIX for compatibility reasons */ +static void WebRtcIsac_FindInvArSpec(const WebRtc_Word16 *ARCoefQ12, + const WebRtc_Word32 gainQ10, + WebRtc_Word32 *CurveQ16) +{ + WebRtc_Word32 CorrQ11[AR_ORDER+1]; + WebRtc_Word32 sum, tmpGain; + WebRtc_Word32 diffQ16[FRAMESAMPLES/8]; + const WebRtc_Word16 *CS_ptrQ9; + int k, n; + WebRtc_Word16 round, shftVal = 0, sh; + + sum = 0; + for (n = 0; n < AR_ORDER+1; n++) + sum += WEBRTC_SPL_MUL(ARCoefQ12[n], ARCoefQ12[n]); /* Q24 */ + sum = WEBRTC_SPL_RSHIFT_W32(WEBRTC_SPL_MUL(WEBRTC_SPL_RSHIFT_W32(sum, 6), 65) + 32768, 16); /* result in Q8 */ + CorrQ11[0] = WEBRTC_SPL_RSHIFT_W32(WEBRTC_SPL_MUL(sum, gainQ10) + 256, 9); + + /* To avoid overflow, we shift down gainQ10 if it is large. We will not lose any precision */ + if(gainQ10>400000){ + tmpGain = WEBRTC_SPL_RSHIFT_W32(gainQ10, 3); + round = 32; + shftVal = 6; + } else { + tmpGain = gainQ10; + round = 256; + shftVal = 9; + } + + for (k = 1; k < AR_ORDER+1; k++) { + sum = 16384; + for (n = k; n < AR_ORDER+1; n++) + sum += WEBRTC_SPL_MUL(ARCoefQ12[n-k], ARCoefQ12[n]); /* Q24 */ + sum = WEBRTC_SPL_RSHIFT_W32(sum, 15); + CorrQ11[k] = WEBRTC_SPL_RSHIFT_W32(WEBRTC_SPL_MUL(sum, tmpGain) + round, shftVal); + } + sum = WEBRTC_SPL_LSHIFT_W32(CorrQ11[0], 7); + for (n = 0; n < FRAMESAMPLES/8; n++) + CurveQ16[n] = sum; + + for (k = 1; k < AR_ORDER; k += 2) { + //CS_ptrQ9 = WebRtcIsac_kCos[k]; + for (n = 0; n < FRAMESAMPLES/8; n++) + CurveQ16[n] += WEBRTC_SPL_RSHIFT_W32( + WEBRTC_SPL_MUL(WebRtcIsac_kCos[k][n], CorrQ11[k+1]) + 2, 2); + } + + CS_ptrQ9 = WebRtcIsac_kCos[0]; + + /* If CorrQ11[1] too large we avoid getting overflow in the calculation by shifting */ + sh=WebRtcSpl_NormW32(CorrQ11[1]); + if (CorrQ11[1]==0) /* Use next correlation */ + sh=WebRtcSpl_NormW32(CorrQ11[2]); + + if (sh<9) + shftVal = 9 - sh; + else + shftVal = 0; + + for (n = 0; n < FRAMESAMPLES/8; n++) + diffQ16[n] = WEBRTC_SPL_RSHIFT_W32(WEBRTC_SPL_MUL(CS_ptrQ9[n], WEBRTC_SPL_RSHIFT_W32(CorrQ11[1], shftVal)) + 2, 2); + for (k = 2; k < AR_ORDER; k += 2) { + CS_ptrQ9 = WebRtcIsac_kCos[k]; + for (n = 0; n < FRAMESAMPLES/8; n++) + diffQ16[n] += WEBRTC_SPL_RSHIFT_W32(WEBRTC_SPL_MUL(CS_ptrQ9[n], WEBRTC_SPL_RSHIFT_W32(CorrQ11[k+1], shftVal)) + 2, 2); + } + + for (k=0; k>25); // * 128/4294967295 + + /* new random unsigned int */ + seed = (seed * 196314165) + 907633515; + + /* fixed-point dither sample between -64 and 64 */ + dither2_Q7 = (WebRtc_Word16)(((int)seed + 16777216)>>25); + + shft = (seed >> 25) & 15; + if (shft < 5) + { + bufQ7[k] = dither1_Q7; + bufQ7[k+1] = dither2_Q7; + bufQ7[k+2] = 0; + } + else if (shft < 10) + { + bufQ7[k] = dither1_Q7; + bufQ7[k+1] = 0; + bufQ7[k+2] = dither2_Q7; + } + else + { + bufQ7[k] = 0; + bufQ7[k+1] = dither1_Q7; + bufQ7[k+2] = dither2_Q7; + } + } + } + else + { + dither_gain_Q14 = (WebRtc_Word16)(22528 - 10 * AvgPitchGain_Q12); + + /* dither on half of the coefficients */ + for (k = 0; k < length-1; k += 2) + { + /* new random unsigned int */ + seed = (seed * 196314165) + 907633515; + + /* fixed-point dither sample between -64 and 64 */ + dither1_Q7 = (WebRtc_Word16)(((int)seed + 16777216)>>25); + + /* dither sample is placed in either even or odd index */ + shft = (seed >> 25) & 1; /* either 0 or 1 */ + + bufQ7[k + shft] = (((dither_gain_Q14 * dither1_Q7) + 8192)>>14); + bufQ7[k + 1 - shft] = 0; + } + } +} + + + +/****************************************************************************** + * GenerateDitherQ7LbUB() + * + * generate array of dither samples in Q7 There are less zeros in dither + * vector compared to GenerateDitherQ7Lb. + * + * A uniform random number generator with the range of [-64 64] is employed + * but the generated dithers are scaled by 0.35, a heuristic scaling. + * + * Input: + * -seed : the initial seed for the random number generator. + * -length : the number of dither values to be generated. + * + * Output: + * -bufQ7 : pointer to a buffer where dithers are written to. + */ +static void GenerateDitherQ7LbUB( + WebRtc_Word16 *bufQ7, + WebRtc_UWord32 seed, + int length) +{ + int k; + for (k = 0; k < length; k++) { + /* new random unsigned int */ + seed = (seed * 196314165) + 907633515; + + /* fixed-point dither sample between -64 and 64 (Q7) */ + // * 128/4294967295 + bufQ7[k] = (WebRtc_Word16)(((int)seed + 16777216)>>25); + + // scale by 0.35 + bufQ7[k] = (WebRtc_Word16)WEBRTC_SPL_MUL_16_16_RSFT(bufQ7[k], + 2048, 13); + } +} + + + +/* + * function to decode the complex spectrum from the bit stream + * returns the total number of bytes in the stream + */ +int WebRtcIsac_DecodeSpecLb(Bitstr *streamdata, + double *fr, + double *fi, + WebRtc_Word16 AvgPitchGain_Q12) +{ + WebRtc_Word16 DitherQ7[FRAMESAMPLES]; + WebRtc_Word16 data[FRAMESAMPLES]; + WebRtc_Word32 invARSpec2_Q16[FRAMESAMPLES_QUARTER]; + WebRtc_UWord16 invARSpecQ8[FRAMESAMPLES_QUARTER]; + WebRtc_Word16 ARCoefQ12[AR_ORDER+1]; + WebRtc_Word16 RCQ15[AR_ORDER]; + WebRtc_Word16 gainQ10; + WebRtc_Word32 gain2_Q10, res; + WebRtc_Word32 in_sqrt; + WebRtc_Word32 newRes; + int k, len, i; + + /* create dither signal */ + GenerateDitherQ7Lb(DitherQ7, streamdata->W_upper, FRAMESAMPLES, AvgPitchGain_Q12); + + /* decode model parameters */ + if (WebRtcIsac_DecodeRc(streamdata, RCQ15) < 0) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + WebRtcSpl_ReflCoefToLpc(RCQ15, AR_ORDER, ARCoefQ12); + + if (WebRtcIsac_DecodeGain2(streamdata, &gain2_Q10) < 0) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + /* compute inverse AR power spectrum */ + WebRtcIsac_FindInvArSpec(ARCoefQ12, gain2_Q10, invARSpec2_Q16); + + /* convert to magnitude spectrum, by doing square-roots (modified from SPLIB) */ + res = 1 << (WebRtcSpl_GetSizeInBits(invARSpec2_Q16[0]) >> 1); + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) + { + in_sqrt = invARSpec2_Q16[k]; + i = 10; + + /* Negative values make no sense for a real sqrt-function. */ + if (in_sqrt<0) + in_sqrt=-in_sqrt; + + newRes = (in_sqrt / res + res) >> 1; + do + { + res = newRes; + newRes = (in_sqrt / res + res) >> 1; + } while (newRes != res && i-- > 0); + + invARSpecQ8[k] = (WebRtc_Word16)newRes; + } + + /* arithmetic decoding of spectrum */ + if ((len = WebRtcIsac_DecLogisticMulti2(data, streamdata, invARSpecQ8, DitherQ7, + FRAMESAMPLES, !IS_SWB_12KHZ)) <1) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + /* subtract dither and scale down spectral samples with low SNR */ + if (AvgPitchGain_Q12 <= 614) + { + for (k = 0; k < FRAMESAMPLES; k += 4) + { + gainQ10 = WebRtcSpl_DivW32W16ResW16(30 << 10, + (WebRtc_Word16)((invARSpec2_Q16[k>>2] + (32768 + (33 << 16))) >> 16)); + *fr++ = (double)((data[ k ] * gainQ10 + 512) >> 10) / 128.0; + *fi++ = (double)((data[k+1] * gainQ10 + 512) >> 10) / 128.0; + *fr++ = (double)((data[k+2] * gainQ10 + 512) >> 10) / 128.0; + *fi++ = (double)((data[k+3] * gainQ10 + 512) >> 10) / 128.0; + } + } + else + { + for (k = 0; k < FRAMESAMPLES; k += 4) + { + gainQ10 = WebRtcSpl_DivW32W16ResW16(36 << 10, + (WebRtc_Word16)((invARSpec2_Q16[k>>2] + (32768 + (40 << 16))) >> 16)); + *fr++ = (double)((data[ k ] * gainQ10 + 512) >> 10) / 128.0; + *fi++ = (double)((data[k+1] * gainQ10 + 512) >> 10) / 128.0; + *fr++ = (double)((data[k+2] * gainQ10 + 512) >> 10) / 128.0; + *fi++ = (double)((data[k+3] * gainQ10 + 512) >> 10) / 128.0; + } + } + + return len; +} + +/****************************************************************************** + * WebRtcIsac_DecodeSpecUB16() + * Decode real and imaginary part of the DFT coefficients, given a bit-stream. + * This function is called when the codec is in 0-16 kHz bandwidth. + * The decoded DFT coefficient can be transformed to time domain by + * WebRtcIsac_Time2Spec(). + * + * Input: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * -*fr : pointer to a buffer where the real part of DFT + * coefficients are written to. + * -*fi : pointer to a buffer where the imaginary part + * of DFT coefficients are written to. + * + * Return value : < 0 if an error occures + * 0 if succeeded. + */ +int WebRtcIsac_DecodeSpecUB16( + Bitstr* streamdata, + double* fr, + double* fi) +{ + WebRtc_Word16 DitherQ7[FRAMESAMPLES]; + WebRtc_Word16 data[FRAMESAMPLES]; + WebRtc_Word32 invARSpec2_Q16[FRAMESAMPLES_QUARTER]; + WebRtc_UWord16 invARSpecQ8[FRAMESAMPLES_QUARTER]; + WebRtc_Word16 ARCoefQ12[AR_ORDER+1]; + WebRtc_Word16 RCQ15[AR_ORDER]; + WebRtc_Word32 gain2_Q10, res; + WebRtc_Word32 in_sqrt; + WebRtc_Word32 newRes; + int k, len, i, j; + + /* create dither signal */ + GenerateDitherQ7LbUB(DitherQ7, streamdata->W_upper, FRAMESAMPLES); + + /* decode model parameters */ + if (WebRtcIsac_DecodeRc(streamdata, RCQ15) < 0) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + WebRtcSpl_ReflCoefToLpc(RCQ15, AR_ORDER, ARCoefQ12); + + if (WebRtcIsac_DecodeGain2(streamdata, &gain2_Q10) < 0) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + /* compute inverse AR power spectrum */ + WebRtcIsac_FindInvArSpec(ARCoefQ12, gain2_Q10, invARSpec2_Q16); + + /* convert to magnitude spectrum, by doing square-roots (modified from SPLIB) */ + res = 1 << (WebRtcSpl_GetSizeInBits(invARSpec2_Q16[0]) >> 1); + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) + { + in_sqrt = invARSpec2_Q16[k]; + i = 10; + + /* Negative values make no sense for a real sqrt-function. */ + if (in_sqrt<0) + in_sqrt=-in_sqrt; + + newRes = (in_sqrt / res + res) >> 1; + do + { + res = newRes; + newRes = (in_sqrt / res + res) >> 1; + } while (newRes != res && i-- > 0); + + invARSpecQ8[k] = (WebRtc_Word16)newRes; + } + + /* arithmetic decoding of spectrum */ + if ((len = WebRtcIsac_DecLogisticMulti2(data, streamdata, invARSpecQ8, + DitherQ7, FRAMESAMPLES, !IS_SWB_12KHZ)) <1) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + /* re-arrange DFT coefficients and scale down */ + for (j = 0, k = 0; k < FRAMESAMPLES; k += 4, j++) + { + fr[j] = (double)data[ k ] / 128.0; + fi[j] = (double)data[k+1] / 128.0; + fr[(FRAMESAMPLES_HALF) - 1 - j] = (double)data[k+2] / 128.0; + fi[(FRAMESAMPLES_HALF) - 1 - j] = (double)data[k+3] / 128.0; + + } + return len; +} + + + + +/****************************************************************************** + * WebRtcIsac_DecodeSpecUB12() + * Decode real and imaginary part of the DFT coefficients, given a bit-stream. + * This function is called when the codec is in 0-12 kHz bandwidth. + * The decoded DFT coefficient can be transformed to time domain by + * WebRtcIsac_Time2Spec(). + * + * Input: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * -*fr : pointer to a buffer where the real part of DFT + * coefficients are written to. + * -*fi : pointer to a buffer where the imaginary part + * of DFT coefficients are written to. + * + * Return value : < 0 if an error occures + * 0 if succeeded. + */ +int WebRtcIsac_DecodeSpecUB12( + Bitstr *streamdata, + double *fr, + double *fi) +{ + WebRtc_Word16 DitherQ7[FRAMESAMPLES]; + WebRtc_Word16 data[FRAMESAMPLES]; + WebRtc_Word32 invARSpec2_Q16[FRAMESAMPLES_QUARTER]; + WebRtc_UWord16 invARSpecQ8[FRAMESAMPLES_QUARTER]; + WebRtc_Word16 ARCoefQ12[AR_ORDER+1]; + WebRtc_Word16 RCQ15[AR_ORDER]; + WebRtc_Word32 gain2_Q10; + WebRtc_Word32 res; + WebRtc_Word32 in_sqrt; + WebRtc_Word32 newRes; + int k, len, i; + + /* create dither signal */ + GenerateDitherQ7LbUB(DitherQ7, streamdata->W_upper, FRAMESAMPLES); + + /* decode model parameters */ + if (WebRtcIsac_DecodeRc(streamdata, RCQ15) < 0) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + WebRtcSpl_ReflCoefToLpc(RCQ15, AR_ORDER, ARCoefQ12); + + if (WebRtcIsac_DecodeGain2(streamdata, &gain2_Q10) < 0) + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + + + /* compute inverse AR power spectrum */ + WebRtcIsac_FindInvArSpec(ARCoefQ12, gain2_Q10, invARSpec2_Q16); + + /* convert to magnitude spectrum, by doing square-roots (modified from SPLIB) */ + res = 1 << (WebRtcSpl_GetSizeInBits(invARSpec2_Q16[0]) >> 1); + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) + { + in_sqrt = invARSpec2_Q16[k]; + i = 10; + + /* Negative values make no sense for a real sqrt-function. */ + if (in_sqrt<0) + in_sqrt=-in_sqrt; + + newRes = (in_sqrt / res + res) >> 1; + do + { + res = newRes; + newRes = (in_sqrt / res + res) >> 1; + } while (newRes != res && i-- > 0); + + invARSpecQ8[k] = (WebRtc_Word16)newRes; + } + + /* arithmetic decoding of spectrum */ + if ((len = WebRtcIsac_DecLogisticMulti2(data, streamdata, + invARSpecQ8, DitherQ7, (FRAMESAMPLES_HALF), IS_SWB_12KHZ)) < 1) + { + return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; + } + + for (k = 0, i = 0; k < FRAMESAMPLES_HALF; k += 4) + { + fr[i] = (double)data[ k ] / 128.0; + fi[i] = (double)data[k+1] / 128.0; + i++; + fr[i] = (double)data[k+2] / 128.0; + fi[i] = (double)data[k+3] / 128.0; + i++; + } + + // The second half of real and imaginary coefficients is zero. This is + // due to using the old FFT module which requires two signals as input + // while in 0-12 kHz mode we only have 8-12 kHz band, and the second signal + // is set to zero + memset(&fr[FRAMESAMPLES_QUARTER], 0, FRAMESAMPLES_QUARTER * sizeof(double)); + memset(&fi[FRAMESAMPLES_QUARTER], 0, FRAMESAMPLES_QUARTER * sizeof(double)); + + return len; +} + + + + + +int WebRtcIsac_EncodeSpecLb(const WebRtc_Word16 *fr, + const WebRtc_Word16 *fi, + Bitstr *streamdata, + WebRtc_Word16 AvgPitchGain_Q12) +{ + WebRtc_Word16 ditherQ7[FRAMESAMPLES]; + WebRtc_Word16 dataQ7[FRAMESAMPLES]; + WebRtc_Word32 PSpec[FRAMESAMPLES_QUARTER]; + WebRtc_Word32 invARSpec2_Q16[FRAMESAMPLES_QUARTER]; + WebRtc_UWord16 invARSpecQ8[FRAMESAMPLES_QUARTER]; + WebRtc_Word32 CorrQ7[AR_ORDER+1]; + WebRtc_Word32 CorrQ7_norm[AR_ORDER+1]; + WebRtc_Word16 RCQ15[AR_ORDER]; + WebRtc_Word16 ARCoefQ12[AR_ORDER+1]; + WebRtc_Word32 gain2_Q10; + WebRtc_Word16 val; + WebRtc_Word32 nrg, res; + WebRtc_UWord32 sum; + WebRtc_Word32 in_sqrt; + WebRtc_Word32 newRes; + WebRtc_Word16 err; + WebRtc_UWord32 nrg_u32; + int shift_var; + int k, n, j, i; + + + /* create dither_float signal */ + GenerateDitherQ7Lb(ditherQ7, streamdata->W_upper, FRAMESAMPLES, AvgPitchGain_Q12); + + /* add dither and quantize, and compute power spectrum */ + for (k = 0; k < FRAMESAMPLES; k += 4) + { + val = ((*fr++ + ditherQ7[k] + 64) & 0xFF80) - ditherQ7[k]; + dataQ7[k] = val; + sum = val * val; + + val = ((*fi++ + ditherQ7[k+1] + 64) & 0xFF80) - ditherQ7[k+1]; + dataQ7[k+1] = val; + sum += val * val; + + val = ((*fr++ + ditherQ7[k+2] + 64) & 0xFF80) - ditherQ7[k+2]; + dataQ7[k+2] = val; + sum += val * val; + + val = ((*fi++ + ditherQ7[k+3] + 64) & 0xFF80) - ditherQ7[k+3]; + dataQ7[k+3] = val; + sum += val * val; + + PSpec[k>>2] = sum >> 2; + } + + /* compute correlation from power spectrum */ + WebRtcIsac_FindCorrelation(PSpec, CorrQ7); + + + /* find AR coefficients */ + /* number of bit shifts to 14-bit normalize CorrQ7[0] (leaving room for sign) */ + shift_var = WebRtcSpl_NormW32(CorrQ7[0]) - 18; + + if (shift_var > 0) { + for (k=0; k> (-shift_var); + } + } + + /* find RC coefficients */ + WebRtcSpl_AutoCorrToReflCoef(CorrQ7_norm, AR_ORDER, RCQ15); + + /* quantize & code RC Coefficient */ + WebRtcIsac_EncodeRc(RCQ15, streamdata); + + /* RC -> AR coefficients */ + WebRtcSpl_ReflCoefToLpc(RCQ15, AR_ORDER, ARCoefQ12); + + /* compute ARCoef' * Corr * ARCoef in Q19 */ + nrg = 0; + for (j = 0; j <= AR_ORDER; j++) { + for (n = 0; n <= j; n++) { + nrg += ( ARCoefQ12[j] * ((CorrQ7_norm[j-n] * ARCoefQ12[n] + 256) >> 9) + 4 ) >> 3; + } + for (n = j+1; n <= AR_ORDER; n++) { + nrg += ( ARCoefQ12[j] * ((CorrQ7_norm[n-j] * ARCoefQ12[n] + 256) >> 9) + 4 ) >> 3; + } + } + + nrg_u32 = (WebRtc_UWord32)nrg; + if (shift_var > 0) { + nrg_u32 = nrg_u32 >> shift_var; + } else { + nrg_u32 = nrg_u32 << (-shift_var); + } + + if (nrg_u32 > 0x7FFFFFFF) + nrg = 0x7FFFFFFF; + else + nrg = (WebRtc_Word32)nrg_u32; + + gain2_Q10 = WebRtcSpl_DivResultInQ31(FRAMESAMPLES_QUARTER, nrg); /* also shifts 31 bits to the left! */ + + /* quantize & code gain2_Q10 */ + if (WebRtcIsac_EncodeGain2(&gain2_Q10, streamdata)) { + return -1; + } + + /* compute inverse AR power spectrum */ + WebRtcIsac_FindInvArSpec(ARCoefQ12, gain2_Q10, invARSpec2_Q16); + + /* convert to magnitude spectrum, by doing square-roots (modified from SPLIB) */ + res = 1 << (WebRtcSpl_GetSizeInBits(invARSpec2_Q16[0]) >> 1); + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) + { + in_sqrt = invARSpec2_Q16[k]; + i = 10; + + /* Negative values make no sense for a real sqrt-function. */ + if (in_sqrt<0) + in_sqrt=-in_sqrt; + + newRes = (in_sqrt / res + res) >> 1; + do + { + res = newRes; + newRes = (in_sqrt / res + res) >> 1; + } while (newRes != res && i-- > 0); + + invARSpecQ8[k] = (WebRtc_Word16)newRes; + } + + /* arithmetic coding of spectrum */ + err = WebRtcIsac_EncLogisticMulti2(streamdata, dataQ7, invARSpecQ8, + FRAMESAMPLES, !IS_SWB_12KHZ); + if (err < 0) + { + return (err); + } + + return 0; +} + + +/****************************************************************************** + * WebRtcIsac_EncodeSpecUB16() + * Quantize and encode real and imaginary part of the DFT coefficients. + * This function is called when the codec is in 0-16 kHz bandwidth. + * The real and imaginary part are computed by calling WebRtcIsac_Time2Spec(). + * + * + * Input: + * -*fr : pointer to a buffer where the real part of DFT + * coefficients are stored. + * -*fi : pointer to a buffer where the imaginary part + * of DFT coefficients are stored. + * + * Output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Return value : < 0 if an error occures + * 0 if succeeded. + */ +int WebRtcIsac_EncodeSpecUB16( + const WebRtc_Word16* fr, + const WebRtc_Word16* fi, + Bitstr* streamdata) +{ + WebRtc_Word16 ditherQ7[FRAMESAMPLES]; + WebRtc_Word16 dataQ7[FRAMESAMPLES]; + WebRtc_Word32 PSpec[FRAMESAMPLES_QUARTER]; + WebRtc_Word32 invARSpec2_Q16[FRAMESAMPLES_QUARTER]; + WebRtc_UWord16 invARSpecQ8[FRAMESAMPLES_QUARTER]; + WebRtc_Word32 CorrQ7[AR_ORDER+1]; + WebRtc_Word32 CorrQ7_norm[AR_ORDER+1]; + WebRtc_Word16 RCQ15[AR_ORDER]; + WebRtc_Word16 ARCoefQ12[AR_ORDER+1]; + WebRtc_Word32 gain2_Q10; + WebRtc_Word16 val; + WebRtc_Word32 nrg, res; + WebRtc_UWord32 sum; + WebRtc_Word32 in_sqrt; + WebRtc_Word32 newRes; + WebRtc_Word16 err; + WebRtc_UWord32 nrg_u32; + int shift_var; + int k, n, j, i; + + /* create dither_float signal */ + GenerateDitherQ7LbUB(ditherQ7, streamdata->W_upper, FRAMESAMPLES); + + /* add dither and quantize, and compute power spectrum */ + for (j = 0, k = 0; k < FRAMESAMPLES; k += 4, j++) + { + val = ((fr[j] + ditherQ7[k] + 64) & 0xFF80) - ditherQ7[k]; + dataQ7[k] = val; + sum = val * val; + + val = ((fi[j] + ditherQ7[k+1] + 64) & 0xFF80) - ditherQ7[k+1]; + dataQ7[k+1] = val; + sum += val * val; + + val = ((fr[(FRAMESAMPLES_HALF) - 1 - j] + ditherQ7[k+2] + 64) & + 0xFF80) - ditherQ7[k+2]; + dataQ7[k+2] = val; + sum += val * val; + + val = ((fi[(FRAMESAMPLES_HALF) - 1 - j] + ditherQ7[k+3] + 64) & + 0xFF80) - ditherQ7[k+3]; + dataQ7[k+3] = val; + sum += val * val; + + PSpec[k>>2] = sum >> 2; + } + + /* compute correlation from power spectrum */ + WebRtcIsac_FindCorrelation(PSpec, CorrQ7); + + + /* find AR coefficients + number of bit shifts to 14-bit normalize CorrQ7[0] + (leaving room for sign) */ + shift_var = WebRtcSpl_NormW32(CorrQ7[0]) - 18; + + if (shift_var > 0) { + for (k=0; k> (-shift_var); + } + } + + /* find RC coefficients */ + WebRtcSpl_AutoCorrToReflCoef(CorrQ7_norm, AR_ORDER, RCQ15); + + /* quantize & code RC Coef */ + WebRtcIsac_EncodeRc(RCQ15, streamdata); + + /* RC -> AR coefficients */ + WebRtcSpl_ReflCoefToLpc(RCQ15, AR_ORDER, ARCoefQ12); + + /* compute ARCoef' * Corr * ARCoef in Q19 */ + nrg = 0; + for (j = 0; j <= AR_ORDER; j++) { + for (n = 0; n <= j; n++) { + nrg += ( ARCoefQ12[j] * ((CorrQ7_norm[j-n] * ARCoefQ12[n] + + 256) >> 9) + 4 ) >> 3; + } + for (n = j+1; n <= AR_ORDER; n++) { + nrg += ( ARCoefQ12[j] * ((CorrQ7_norm[n-j] * ARCoefQ12[n] + + 256) >> 9) + 4 ) >> 3; + } + } + nrg_u32 = (WebRtc_UWord32)nrg; + if (shift_var > 0) { + nrg_u32 = nrg_u32 >> shift_var; + } else { + nrg_u32 = nrg_u32 << (-shift_var); + } + + if (nrg_u32 > 0x7FFFFFFF) + nrg = 0x7FFFFFFF; + else + nrg = (WebRtc_Word32)nrg_u32; + + gain2_Q10 = WebRtcSpl_DivResultInQ31(FRAMESAMPLES_QUARTER, nrg); /* also shifts 31 bits to the left! */ + + /* quantize & code gain2_Q10 */ + if (WebRtcIsac_EncodeGain2(&gain2_Q10, streamdata)) { + return -1; + } + + /* compute inverse AR power spectrum */ + WebRtcIsac_FindInvArSpec(ARCoefQ12, gain2_Q10, invARSpec2_Q16); + + /* convert to magnitude spectrum, by doing square-roots (modified from SPLIB) */ + res = 1 << (WebRtcSpl_GetSizeInBits(invARSpec2_Q16[0]) >> 1); + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) + { + in_sqrt = invARSpec2_Q16[k]; + i = 10; + + /* Negative values make no sense for a real sqrt-function. */ + if (in_sqrt<0) + in_sqrt=-in_sqrt; + + newRes = (in_sqrt / res + res) >> 1; + do + { + res = newRes; + newRes = (in_sqrt / res + res) >> 1; + } while (newRes != res && i-- > 0); + + invARSpecQ8[k] = (WebRtc_Word16)newRes; + } + + /* arithmetic coding of spectrum */ + err = WebRtcIsac_EncLogisticMulti2(streamdata, dataQ7, invARSpecQ8, + FRAMESAMPLES, !IS_SWB_12KHZ); + if (err < 0) + { + return (err); + } + + return 0; +} + + + + +int WebRtcIsac_EncodeSpecUB12(const WebRtc_Word16 *fr, + const WebRtc_Word16 *fi, + Bitstr *streamdata) +{ + WebRtc_Word16 ditherQ7[FRAMESAMPLES]; + WebRtc_Word16 dataQ7[FRAMESAMPLES]; + WebRtc_Word32 PSpec[FRAMESAMPLES_QUARTER]; + WebRtc_Word32 invARSpec2_Q16[FRAMESAMPLES_QUARTER]; + WebRtc_UWord16 invARSpecQ8[FRAMESAMPLES_QUARTER]; + WebRtc_Word32 CorrQ7[AR_ORDER+1]; + WebRtc_Word32 CorrQ7_norm[AR_ORDER+1]; + WebRtc_Word16 RCQ15[AR_ORDER]; + WebRtc_Word16 ARCoefQ12[AR_ORDER+1]; + WebRtc_Word32 gain2_Q10; + WebRtc_Word16 val; + WebRtc_Word32 nrg, res; + WebRtc_UWord32 sum; + WebRtc_Word32 in_sqrt; + WebRtc_Word32 newRes; + WebRtc_Word16 err; + int shift_var; + int k, n, j, i; + WebRtc_UWord32 nrg_u32; + + /* create dither_float signal */ + GenerateDitherQ7LbUB(ditherQ7, streamdata->W_upper, FRAMESAMPLES); + + /* add dither and quantize, and compute power spectrum */ + for (k = 0, j = 0; k < (FRAMESAMPLES_HALF); k += 4) + { + val = ((*fr++ + ditherQ7[k] + 64) & 0xFF80) - ditherQ7[k]; + dataQ7[k] = val; + sum = (val) * (val); + + val = ((*fi++ + ditherQ7[k+1] + 64) & 0xFF80) - ditherQ7[k+1]; + dataQ7[k+1] = val; + sum += (val) * (val); + + if(j < FRAMESAMPLES_QUARTER) + { + PSpec[j] = sum >> 1; + j++; + } + + val = ((*fr++ + ditherQ7[k+2] + 64) & 0xFF80) - ditherQ7[k+2]; + dataQ7[k+2] = val; + sum = (val) * (val); + + val = ((*fi++ + ditherQ7[k+3] + 64) & 0xFF80) - ditherQ7[k+3]; + dataQ7[k+3] = val; + sum += (val) * (val); + + if(j < FRAMESAMPLES_QUARTER) + { + PSpec[j] = sum >> 1; + j++; + } + } + /* compute correlation from power spectrum */ + WebRtcIsac_FindCorrelation(PSpec, CorrQ7); + + + /* find AR coefficients */ + /* number of bit shifts to 14-bit normalize CorrQ7[0] (leaving room for sign) */ + shift_var = WebRtcSpl_NormW32(CorrQ7[0]) - 18; + + if (shift_var > 0) { + for (k=0; k> (-shift_var); + } + } + + /* find RC coefficients */ + WebRtcSpl_AutoCorrToReflCoef(CorrQ7_norm, AR_ORDER, RCQ15); + + /* quantize & code RC Coef */ + WebRtcIsac_EncodeRc(RCQ15, streamdata); + + + /* RC -> AR coefficients */ + WebRtcSpl_ReflCoefToLpc(RCQ15, AR_ORDER, ARCoefQ12); + + + /* compute ARCoef' * Corr * ARCoef in Q19 */ + nrg = 0; + for (j = 0; j <= AR_ORDER; j++) { + for (n = 0; n <= j; n++) { + nrg += ( ARCoefQ12[j] * ((CorrQ7_norm[j-n] * ARCoefQ12[n] + 256) >> 9) + 4 ) >> 3; + } + for (n = j+1; n <= AR_ORDER; n++) { + nrg += ( ARCoefQ12[j] * ((CorrQ7_norm[n-j] * ARCoefQ12[n] + 256) >> 9) + 4 ) >> 3; + } + } + + nrg_u32 = (WebRtc_UWord32)nrg; + if (shift_var > 0) { + nrg_u32 = nrg_u32 >> shift_var; + } else { + nrg_u32 = nrg_u32 << (-shift_var); + } + + if (nrg_u32 > 0x7FFFFFFF) { + nrg = 0x7FFFFFFF; + } else { + nrg = (WebRtc_Word32)nrg_u32; + } + + gain2_Q10 = WebRtcSpl_DivResultInQ31(FRAMESAMPLES_QUARTER, nrg); /* also shifts 31 bits to the left! */ + + /* quantize & code gain2_Q10 */ + if (WebRtcIsac_EncodeGain2(&gain2_Q10, streamdata)) { + return -1; + } + + /* compute inverse AR power spectrum */ + WebRtcIsac_FindInvArSpec(ARCoefQ12, gain2_Q10, invARSpec2_Q16); + + /* convert to magnitude spectrum, by doing square-roots (modified from SPLIB) */ + res = 1 << (WebRtcSpl_GetSizeInBits(invARSpec2_Q16[0]) >> 1); + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) + { + in_sqrt = invARSpec2_Q16[k]; + i = 10; + + /* Negative values make no sense for a real sqrt-function. */ + if (in_sqrt<0) + in_sqrt=-in_sqrt; + + newRes = (in_sqrt / res + res) >> 1; + do + { + res = newRes; + newRes = (in_sqrt / res + res) >> 1; + } while (newRes != res && i-- > 0); + + invARSpecQ8[k] = (WebRtc_Word16)newRes; + } + + /* arithmetic coding of spectrum */ + err = WebRtcIsac_EncLogisticMulti2(streamdata, dataQ7, invARSpecQ8, + (FRAMESAMPLES_HALF), IS_SWB_12KHZ); + if (err < 0) + { + return (err); + } + + return 0; +} + + + +/* step-up */ +void WebRtcIsac_Rc2Poly(double *RC, int N, double *a) +{ + int m, k; + double tmp[MAX_AR_MODEL_ORDER]; + + a[0] = 1.0; + tmp[0] = 1.0; + for (m=1; m<=N; m++) { + /* copy */ + for (k=1; k0; m--) { + tmp_inv = 1.0 / (1.0 - RC[m]*RC[m]); + for (k=1; k<=m; k++) + tmp[k] = (a[k] - RC[m] * a[m-k+1]) * tmp_inv; + + for (k=1; k WebRtcIsac_kQKltMaxIndGain[k]) + index_g[k] = WebRtcIsac_kQKltMaxIndGain[k]; + index_ovr_g[k] = WebRtcIsac_kQKltOffsetGain[bmodel][k]+index_g[k]; + pos = WebRtcIsac_kQKltOfLevelsGain[bmodel] + index_ovr_g[k]; + + /* determine number of bits */ + sum = WebRtcIsac_kQKltCodeLenGain[pos]; + Bits += sum; + } + + for (k=0; k WebRtcIsac_kQKltMaxIndShape[k]) + index_s[k] = WebRtcIsac_kQKltMaxIndShape[k]; + index_ovr_s[k] = WebRtcIsac_kQKltOffsetShape[bmodel][k]+index_s[k]; + pos = WebRtcIsac_kQKltOfLevelsShape[bmodel] + index_ovr_s[k]; + sum = WebRtcIsac_kQKltCodeLenShape[pos]; + Bits += sum; + } + + + /* Only one model remains in this version of the code, model = 0 */ + *model=bmodel; + *size=Bits; + + /* entropy coding of model number */ + WebRtcIsac_EncHistMulti(streamdata, model, WebRtcIsac_kQKltModelCdfPtr, 1); + + /* entropy coding of quantization indices - shape only */ + WebRtcIsac_EncHistMulti(streamdata, index_s, WebRtcIsac_kQKltCdfPtrShape[bmodel], KLT_ORDER_SHAPE); + + /* Save data for creation of multiple bit streams */ + encData->LPCmodel[encData->startIdx] = 0; + for (k=0; kLPCindex_s[KLT_ORDER_SHAPE*encData->startIdx + k] = index_s[k]; + } + + /* find quantization levels for shape coefficients */ + for (k=0; kLPCcoeffs_lo[(ORDERLO+1)*SUBFRAMES*encData->startIdx + k] = LPCCoef_lo[k]; + } + for (k=0; k<(ORDERHI+1)*SUBFRAMES; k++) { + encData->LPCcoeffs_hi[(ORDERHI+1)*SUBFRAMES*encData->startIdx + k] = LPCCoef_hi[k]; + } +} + + +WebRtc_Word16 +WebRtcIsac_EncodeLpcUB( + double* lpcVecs, + Bitstr* streamdata, + double* interpolLPCCoeff, + WebRtc_Word16 bandwidth, + ISACUBSaveEncDataStruct* encData) +{ + + double U[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + int idx[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + int interpolCntr; + + WebRtcIsac_Poly2LarUB(lpcVecs, bandwidth); + WebRtcIsac_RemoveLarMean(lpcVecs, bandwidth); + WebRtcIsac_DecorrelateIntraVec(lpcVecs, U, bandwidth); + WebRtcIsac_DecorrelateInterVec(U, lpcVecs, bandwidth); + WebRtcIsac_QuantizeUncorrLar(lpcVecs, idx, bandwidth); + + WebRtcIsac_CorrelateInterVec(lpcVecs, U, bandwidth); + WebRtcIsac_CorrelateIntraVec(U, lpcVecs, bandwidth); + WebRtcIsac_AddLarMean(lpcVecs, bandwidth); + + switch(bandwidth) + { + case isac12kHz: + { + // Stor the indices to be used for multiple encoding. + memcpy(encData->indexLPCShape, idx, UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME * + sizeof(int)); + WebRtcIsac_EncHistMulti(streamdata, idx, WebRtcIsac_kLpcShapeCdfMatUb12, + UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME); + for(interpolCntr = 0; interpolCntr < UB_INTERPOL_SEGMENTS; interpolCntr++) + { + WebRtcIsac_Lar2PolyInterpolUB(lpcVecs, + interpolLPCCoeff, kLpcVecPerSegmentUb12 + 1); + lpcVecs += UB_LPC_ORDER; + interpolLPCCoeff += (kLpcVecPerSegmentUb12 * (UB_LPC_ORDER + 1)); + } + break; + } + case isac16kHz: + { + // Stor the indices to be used for multiple encoding. + memcpy(encData->indexLPCShape, idx, UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME * + sizeof(int)); + WebRtcIsac_EncHistMulti(streamdata, idx, WebRtcIsac_kLpcShapeCdfMatUb16, + UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME); + for(interpolCntr = 0; interpolCntr < UB16_INTERPOL_SEGMENTS; interpolCntr++) + { + WebRtcIsac_Lar2PolyInterpolUB(lpcVecs, + interpolLPCCoeff, kLpcVecPerSegmentUb16 + 1); + lpcVecs += UB_LPC_ORDER; + interpolLPCCoeff += (kLpcVecPerSegmentUb16 * (UB_LPC_ORDER + 1)); + } + break; + } + default: + return -1; + } + return 0; +} + +void WebRtcIsac_EncodeLpcGainLb(double *LPCCoef_lo, double *LPCCoef_hi, int model, Bitstr *streamdata, ISAC_SaveEncData_t* encData) { + + int j, k, n, pos, pos2, posg, offsg, offs2; + int index_g[KLT_ORDER_GAIN]; + int index_ovr_g[KLT_ORDER_GAIN]; + double tmpcoeffs_g[KLT_ORDER_GAIN]; + double tmpcoeffs2_g[KLT_ORDER_GAIN]; + double sum; + + /* log gains, mean removal and scaling */ + posg = 0; + for (k=0; k WebRtcIsac_kQKltMaxIndGain[k]) { + index_g[k] = WebRtcIsac_kQKltMaxIndGain[k]; + } + index_ovr_g[k] = WebRtcIsac_kQKltOffsetGain[model][k]+index_g[k]; + + /* find quantization levels for coefficients */ + tmpcoeffs_g[WebRtcIsac_kQKltSelIndGain[k]] = WebRtcIsac_kQKltLevelsGain[WebRtcIsac_kQKltOfLevelsGain[model]+index_ovr_g[k]]; + + /* Save data for creation of multiple bit streams */ + encData->LPCindex_g[KLT_ORDER_GAIN*encData->startIdx + k] = index_g[k]; + } + + + /* entropy coding of quantization indices - gain */ + WebRtcIsac_EncHistMulti(streamdata, index_g, WebRtcIsac_kQKltCdfPtrGain[model], KLT_ORDER_GAIN); + + /* find quantization levels for coefficients */ + + /* left transform */ + offsg = 0; + posg = 0; + for (j=0; j WebRtcIsac_kQArBoundaryLevels[index[k]]) + { + while (RCQ15[k] > WebRtcIsac_kQArBoundaryLevels[index[k] + 1]) + index[k]++; + } + else + { + while (RCQ15[k] < WebRtcIsac_kQArBoundaryLevels[--index[k]]) ; + } + + RCQ15[k] = *(WebRtcIsac_kQArRcLevelsPtr[k] + index[k]); + } + + + /* entropy coding of quantization indices */ + WebRtcIsac_EncHistMulti(streamdata, index, WebRtcIsac_kQArRcCdfPtr, AR_ORDER); +} + + +/* decode & dequantize squared Gain */ +int WebRtcIsac_DecodeGain2(Bitstr *streamdata, WebRtc_Word32 *gainQ10) +{ + int index, err; + + /* entropy decoding of quantization index */ + err = WebRtcIsac_DecHistOneStepMulti(&index, streamdata, WebRtcIsac_kQGainCdf_ptr, + WebRtcIsac_kQGainInitIndex, 1); + if (err<0) // error check + return err; + + /* find quantization level */ + *gainQ10 = WebRtcIsac_kQGain2Levels[index]; + + return 0; +} + + + +/* quantize & code squared Gain */ +int WebRtcIsac_EncodeGain2(WebRtc_Word32 *gainQ10, Bitstr *streamdata) +{ + int index; + + + /* find quantization index */ + index = WebRtcIsac_kQGainInitIndex[0]; + if (*gainQ10 > WebRtcIsac_kQGain2BoundaryLevels[index]) + { + while (*gainQ10 > WebRtcIsac_kQGain2BoundaryLevels[index + 1]) + index++; + } + else + { + while (*gainQ10 < WebRtcIsac_kQGain2BoundaryLevels[--index]) ; + } + + /* dequantize */ + *gainQ10 = WebRtcIsac_kQGain2Levels[index]; + + + /* entropy coding of quantization index */ + WebRtcIsac_EncHistMulti(streamdata, &index, WebRtcIsac_kQGainCdf_ptr, 1); + + return 0; +} + + +/* code and decode Pitch Gains and Lags functions */ + +/* decode & dequantize Pitch Gains */ +int WebRtcIsac_DecodePitchGain(Bitstr *streamdata, WebRtc_Word16 *PitchGains_Q12) +{ + int index_comb, err; + const WebRtc_UWord16 *WebRtcIsac_kQPitchGainCdf_ptr[1]; + + /* entropy decoding of quantization indices */ + *WebRtcIsac_kQPitchGainCdf_ptr = WebRtcIsac_kQPitchGainCdf; + err = WebRtcIsac_DecHistBisectMulti(&index_comb, streamdata, WebRtcIsac_kQPitchGainCdf_ptr, WebRtcIsac_kQCdfTableSizeGain, 1); + /* error check, Q_mean_Gain.. tables are of size 144 */ + if ((err<0) || (index_comb<0) || (index_comb>144)) + return -ISAC_RANGE_ERROR_DECODE_PITCH_GAIN; + + /* unquantize back to pitch gains by table look-up */ + PitchGains_Q12[0] = WebRtcIsac_kQMeanGain1Q12[index_comb]; + PitchGains_Q12[1] = WebRtcIsac_kQMeanGain2Q12[index_comb]; + PitchGains_Q12[2] = WebRtcIsac_kQMeanGain3Q12[index_comb]; + PitchGains_Q12[3] = WebRtcIsac_kQMeanGain4Q12[index_comb]; + + return 0; +} + + +/* quantize & code Pitch Gains */ +void WebRtcIsac_EncodePitchGain(WebRtc_Word16 *PitchGains_Q12, Bitstr *streamdata, ISAC_SaveEncData_t* encData) +{ + int k,j; + double C; + double S[PITCH_SUBFRAMES]; + int index[3]; + int index_comb; + const WebRtc_UWord16 *WebRtcIsac_kQPitchGainCdf_ptr[1]; + double PitchGains[PITCH_SUBFRAMES] = {0,0,0,0}; + + /* take the asin */ + for (k=0; k WebRtcIsac_kIndexUpperLimitGain[k]) index[k] = WebRtcIsac_kIndexUpperLimitGain[k]; + index[k] -= WebRtcIsac_kIndexLowerLimitGain[k]; + } + + /* calculate unique overall index */ + index_comb = WebRtcIsac_kIndexMultsGain[0] * index[0] + WebRtcIsac_kIndexMultsGain[1] * index[1] + index[2]; + + /* unquantize back to pitch gains by table look-up */ + PitchGains_Q12[0] = WebRtcIsac_kQMeanGain1Q12[index_comb]; + PitchGains_Q12[1] = WebRtcIsac_kQMeanGain2Q12[index_comb]; + PitchGains_Q12[2] = WebRtcIsac_kQMeanGain3Q12[index_comb]; + PitchGains_Q12[3] = WebRtcIsac_kQMeanGain4Q12[index_comb]; + + /* entropy coding of quantization pitch gains */ + *WebRtcIsac_kQPitchGainCdf_ptr = WebRtcIsac_kQPitchGainCdf; + WebRtcIsac_EncHistMulti(streamdata, &index_comb, WebRtcIsac_kQPitchGainCdf_ptr, 1); + encData->pitchGain_index[encData->startIdx] = index_comb; + +} + + + +/* Pitch LAG */ + + +/* decode & dequantize Pitch Lags */ +int WebRtcIsac_DecodePitchLag(Bitstr *streamdata, WebRtc_Word16 *PitchGain_Q12, double *PitchLags) +{ + int k, err; + double StepSize; + double C; + int index[PITCH_SUBFRAMES]; + double mean_gain; + const double *mean_val2, *mean_val3, *mean_val4; + const WebRtc_Word16 *lower_limit; + const WebRtc_UWord16 *init_index; + const WebRtc_UWord16 *cdf_size; + const WebRtc_UWord16 **cdf; + + //(Y) + double PitchGain[4]={0,0,0,0}; + // + + /* compute mean pitch gain */ + mean_gain = 0.0; + for (k = 0; k < 4; k++) + { + //(Y) + PitchGain[k] = ((float)PitchGain_Q12[k])/4096; + //(Y) + mean_gain += PitchGain[k]; + } + mean_gain /= 4.0; + + /* voicing classificiation */ + if (mean_gain < 0.2) { + StepSize = WebRtcIsac_kQPitchLagStepsizeLo; + cdf = WebRtcIsac_kQPitchLagCdfPtrLo; + cdf_size = WebRtcIsac_kQPitchLagCdfSizeLo; + mean_val2 = WebRtcIsac_kQMeanLag2Lo; + mean_val3 = WebRtcIsac_kQMeanLag3Lo; + mean_val4 = WebRtcIsac_kQMeanLag4Lo; + lower_limit = WebRtcIsac_kQIndexLowerLimitLagLo; + init_index = WebRtcIsac_kQInitIndexLagLo; + } else if (mean_gain < 0.4) { + StepSize = WebRtcIsac_kQPitchLagStepsizeMid; + cdf = WebRtcIsac_kQPitchLagCdfPtrMid; + cdf_size = WebRtcIsac_kQPitchLagCdfSizeMid; + mean_val2 = WebRtcIsac_kQMeanLag2Mid; + mean_val3 = WebRtcIsac_kQMeanLag3Mid; + mean_val4 = WebRtcIsac_kQMeanLag4Mid; + lower_limit = WebRtcIsac_kQIndexLowerLimitLagMid; + init_index = WebRtcIsac_kQInitIndexLagMid; + } else { + StepSize = WebRtcIsac_kQPitchLagStepsizeHi; + cdf = WebRtcIsac_kQPitchLagCdfPtrHi; + cdf_size = WebRtcIsac_kQPitchLagCdfSizeHi; + mean_val2 = WebRtcIsac_kQMeanLag2Hi; + mean_val3 = WebRtcIsac_kQMeanLag3Hi; + mean_val4 = WebRtcIsac_kQMeanLag4Hi; + lower_limit = WebRtcIsac_kQindexLowerLimitLagHi; + init_index = WebRtcIsac_kQInitIndexLagHi; + } + + /* entropy decoding of quantization indices */ + err = WebRtcIsac_DecHistBisectMulti(index, streamdata, cdf, cdf_size, 1); + if ((err<0) || (index[0]<0)) // error check + return -ISAC_RANGE_ERROR_DECODE_PITCH_LAG; + + err = WebRtcIsac_DecHistOneStepMulti(index+1, streamdata, cdf+1, init_index, 3); + if (err<0) // error check + return -ISAC_RANGE_ERROR_DECODE_PITCH_LAG; + + + /* unquantize back to transform coefficients and do the inverse transform: S = T'*C */ + C = (index[0] + lower_limit[0]) * StepSize; + for (k=0; kmeanGain[encData->startIdx] = mean_gain; + + /* voicing classification */ + if (mean_gain < 0.2) { + StepSize = WebRtcIsac_kQPitchLagStepsizeLo; + cdf = WebRtcIsac_kQPitchLagCdfPtrLo; + mean_val2 = WebRtcIsac_kQMeanLag2Lo; + mean_val3 = WebRtcIsac_kQMeanLag3Lo; + mean_val4 = WebRtcIsac_kQMeanLag4Lo; + lower_limit = WebRtcIsac_kQIndexLowerLimitLagLo; + upper_limit = WebRtcIsac_kQIndexUpperLimitLagLo; + } else if (mean_gain < 0.4) { + StepSize = WebRtcIsac_kQPitchLagStepsizeMid; + cdf = WebRtcIsac_kQPitchLagCdfPtrMid; + mean_val2 = WebRtcIsac_kQMeanLag2Mid; + mean_val3 = WebRtcIsac_kQMeanLag3Mid; + mean_val4 = WebRtcIsac_kQMeanLag4Mid; + lower_limit = WebRtcIsac_kQIndexLowerLimitLagMid; + upper_limit = WebRtcIsac_kQIndexUpperLimitLagMid; + } else { + StepSize = WebRtcIsac_kQPitchLagStepsizeHi; + cdf = WebRtcIsac_kQPitchLagCdfPtrHi; + mean_val2 = WebRtcIsac_kQMeanLag2Hi; + mean_val3 = WebRtcIsac_kQMeanLag3Hi; + mean_val4 = WebRtcIsac_kQMeanLag4Hi; + lower_limit = WebRtcIsac_kQindexLowerLimitLagHi; + upper_limit = WebRtcIsac_kQindexUpperLimitLagHi; + } + + + /* find quantization index */ + for (k=0; k<4; k++) + { + /* transform */ + C = 0.0; + for (j=0; j upper_limit[k]) index[k] = upper_limit[k]; + index[k] -= lower_limit[k]; + + /* Save data for creation of multiple bit streams */ + encData->pitchIndex[PITCH_SUBFRAMES*encData->startIdx + k] = index[k]; + } + + /* unquantize back to transform coefficients and do the inverse transform: S = T'*C */ + C = (index[0] + lower_limit[0]) * StepSize; + for (k=0; k WebRtcIsac_kQKltMaxIndGain[k]) { + index_g[k] = WebRtcIsac_kQKltMaxIndGain[k]; + } + index_ovr_g[k] = WebRtcIsac_kQKltOffsetGain[model][k]+index_g[k]; + + /* find quantization levels for coefficients */ + tmpcoeffs_g[WebRtcIsac_kQKltSelIndGain[k]] = WebRtcIsac_kQKltLevelsGain[WebRtcIsac_kQKltOfLevelsGain[model]+index_ovr_g[k]]; + } +} + + +/* decode & dequantize LPC Coef */ +int +WebRtcIsac_DecodeLpcCoefUB( + Bitstr* streamdata, + double* lpcVecs, + double* percepFilterGains, + WebRtc_Word16 bandwidth) +{ + int index_s[KLT_ORDER_SHAPE]; + + double U[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + int err; + + /* entropy decoding of quantization indices */ + switch(bandwidth) + { + case isac12kHz: + { + err = WebRtcIsac_DecHistOneStepMulti(index_s, streamdata, + WebRtcIsac_kLpcShapeCdfMatUb12, WebRtcIsac_kLpcShapeEntropySearchUb12, + UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME); + break; + } + case isac16kHz: + { + err = WebRtcIsac_DecHistOneStepMulti(index_s, streamdata, + WebRtcIsac_kLpcShapeCdfMatUb16, WebRtcIsac_kLpcShapeEntropySearchUb16, + UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME); + break; + } + default: + return -1; + } + + if (err<0) // error check + { + return err; + } + + WebRtcIsac_DequantizeLpcParam(index_s, lpcVecs, bandwidth); + WebRtcIsac_CorrelateInterVec(lpcVecs, U, bandwidth); + WebRtcIsac_CorrelateIntraVec(U, lpcVecs, bandwidth); + WebRtcIsac_AddLarMean(lpcVecs, bandwidth); + + + WebRtcIsac_DecodeLpcGainUb(percepFilterGains, streamdata); + + if(bandwidth == isac16kHz) + { + // decode another set of Gains + WebRtcIsac_DecodeLpcGainUb(&percepFilterGains[SUBFRAMES], streamdata); + } + + return 0; +} + +WebRtc_Word16 +WebRtcIsac_EncodeBandwidth( + enum ISACBandwidth bandwidth, + Bitstr* streamData) +{ + int bandwidthMode; + switch(bandwidth) + { + case isac12kHz: + { + bandwidthMode = 0; + break; + } + case isac16kHz: + { + bandwidthMode = 1; + break; + } + default: + return -ISAC_DISALLOWED_ENCODER_BANDWIDTH; + } + + WebRtcIsac_EncHistMulti(streamData, &bandwidthMode, + kOneBitEqualProbCdf_ptr, 1); + return 0; +} + +WebRtc_Word16 +WebRtcIsac_DecodeBandwidth( + Bitstr* streamData, + enum ISACBandwidth* bandwidth) +{ + int bandwidthMode; + + if(WebRtcIsac_DecHistOneStepMulti(&bandwidthMode, streamData, + kOneBitEqualProbCdf_ptr, + kOneBitEqualProbInitIndex, 1) < 0) + { + // error check + return -ISAC_RANGE_ERROR_DECODE_BANDWITH; + } + + switch(bandwidthMode) + { + case 0: + { + *bandwidth = isac12kHz; + break; + } + case 1: + { + *bandwidth = isac16kHz; + break; + } + default: + return -ISAC_DISALLOWED_BANDWIDTH_MODE_DECODER; + } + return 0; +} + +WebRtc_Word16 +WebRtcIsac_EncodeJitterInfo( + WebRtc_Word32 jitterIndex, + Bitstr* streamData) +{ + // This is to avoid LINUX warning until we change 'int' to + // 'Word32' + int intVar; + + if((jitterIndex < 0) || (jitterIndex > 1)) + { + return -1; + } + intVar = (int)(jitterIndex); + // Use the same CDF table as for bandwidth + // both take two values with equal probability + WebRtcIsac_EncHistMulti(streamData, &intVar, + kOneBitEqualProbCdf_ptr, 1); + return 0; + +} + +WebRtc_Word16 +WebRtcIsac_DecodeJitterInfo( + Bitstr* streamData, + WebRtc_Word32* jitterInfo) +{ + int intVar; + + // Use the same CDF table as for bandwidth + // both take two values with equal probability + if(WebRtcIsac_DecHistOneStepMulti(&intVar, streamData, + kOneBitEqualProbCdf_ptr, + kOneBitEqualProbInitIndex, 1) < 0) + { + // error check + return -ISAC_RANGE_ERROR_DECODE_BANDWITH; + } + *jitterInfo = (WebRtc_Word16)(intVar); + return 0; +} diff --git a/src/mod/codecs/mod_isac/entropy_coding.h b/src/mod/codecs/mod_isac/entropy_coding.h new file mode 100644 index 0000000000..8446bcf3e5 --- /dev/null +++ b/src/mod/codecs/mod_isac/entropy_coding.h @@ -0,0 +1,412 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * entropy_coding.h + * + * This header file declares all of the functions used to arithmetically + * encode the iSAC bistream + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_ + +#include "structs.h" + +/* decode complex spectrum (return number of bytes in stream) */ +int WebRtcIsac_DecodeSpecLb(Bitstr *streamdata, + double *fr, + double *fi, + WebRtc_Word16 AvgPitchGain_Q12); + +/****************************************************************************** + * WebRtcIsac_DecodeSpecUB16() + * Decode real and imaginary part of the DFT coefficients, given a bit-stream. + * This function is called when the codec is in 0-16 kHz bandwidth. + * The decoded DFT coefficient can be transformed to time domain by + * WebRtcIsac_Time2Spec(). + * + * Input: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * -*fr : pointer to a buffer where the real part of DFT + * coefficients are written to. + * -*fi : pointer to a buffer where the imaginary part + * of DFT coefficients are written to. + * + * Return value : < 0 if an error occures + * 0 if succeeded. + */ +int WebRtcIsac_DecodeSpecUB16( + Bitstr* streamdata, + double* fr, + double* fi); + + +/****************************************************************************** + * WebRtcIsac_DecodeSpecUB12() + * Decode real and imaginary part of the DFT coefficients, given a bit-stream. + * This function is called when the codec is in 0-12 kHz bandwidth. + * The decoded DFT coefficient can be transformed to time domain by + * WebRtcIsac_Time2Spec(). + * + * Input: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * -*fr : pointer to a buffer where the real part of DFT + * coefficients are written to. + * -*fi : pointer to a buffer where the imaginary part + * of DFT coefficients are written to. + * + * Return value : < 0 if an error occures + * 0 if succeeded. + */ +int WebRtcIsac_DecodeSpecUB12( + Bitstr* streamdata, + double* fr, + double* fi); + + +/* encode complex spectrum */ +int WebRtcIsac_EncodeSpecLb(const WebRtc_Word16* fr, + const WebRtc_Word16* fi, + Bitstr* streamdata, + WebRtc_Word16 AvgPitchGain_Q12); + + +/****************************************************************************** + * WebRtcIsac_EncodeSpecUB16() + * Quantize and encode real and imaginary part of the DFT coefficients. + * This function is called when the codec is in 0-16 kHz bandwidth. + * The real and imaginary part are computed by calling WebRtcIsac_Time2Spec(). + * + * + * Input: + * -*fr : pointer to a buffer where the real part of DFT + * coefficients are stored. + * -*fi : pointer to a buffer where the imaginary part + * of DFT coefficients are stored. + * + * Output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Return value : < 0 if an error occures + * 0 if succeeded. + */ +int WebRtcIsac_EncodeSpecUB16( + const WebRtc_Word16* fr, + const WebRtc_Word16* fi, + Bitstr* streamdata); + + +/****************************************************************************** + * WebRtcIsac_EncodeSpecUB12() + * Quantize and encode real and imaginary part of the DFT coefficients. + * This function is called when the codec is in 0-12 kHz bandwidth. + * The real and imaginary part are computed by calling WebRtcIsac_Time2Spec(). + * + * + * Input: + * -*fr : pointer to a buffer where the real part of DFT + * coefficients are stored. + * -*fi : pointer to a buffer where the imaginary part + * of DFT coefficients are stored. + * + * Output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Return value : < 0 if an error occures + * 0 if succeeded. + */ +int WebRtcIsac_EncodeSpecUB12( + const WebRtc_Word16* fr, + const WebRtc_Word16* fi, + Bitstr* streamdata); + + +/* decode & dequantize LPC Coef */ +int WebRtcIsac_DecodeLpcCoef(Bitstr *streamdata, double *LPCCoef, int *outmodel); +int WebRtcIsac_DecodeLpcCoefUB( + Bitstr* streamdata, + double* lpcVecs, + double* percepFilterGains, + WebRtc_Word16 bandwidth); + +int WebRtcIsac_DecodeLpc(Bitstr *streamdata, double *LPCCoef_lo, double *LPCCoef_hi, int *outmodel); + +/* quantize & code LPC Coef */ +void WebRtcIsac_EncodeLpcLb(double *LPCCoef_lo, double *LPCCoef_hi, int *model, double *size, Bitstr *streamdata, ISAC_SaveEncData_t* encData); +void WebRtcIsac_EncodeLpcGainLb(double *LPCCoef_lo, double *LPCCoef_hi, int model, Bitstr *streamdata, ISAC_SaveEncData_t* encData); + +/****************************************************************************** + * WebRtcIsac_EncodeLpcUB() + * Encode LPC parameters, given as A-polynomial, of upper-band. The encoding + * is performed in LAR domain. + * For the upper-band, we compute and encode LPC of some sub-frames, LPC of + * other sub-frames are computed by linear interpolation, in LAR domain. This + * function performs the interpolation and returns the LPC of all sub-frames. + * + * Inputs: + * - lpcCoef : a buffer containing A-polynomials of sub-frames + * (excluding first coefficient that is 1). + * - bandwidth : specifies if the codec is operating at 0-12 kHz + * or 0-16 kHz mode. + * + * Input/output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * - interpolLPCCoeff : Decoded and interpolated LPC (A-polynomial) + * of all sub-frames. + * If LP analysis is of order K, and there are N + * sub-frames then this is a buffer of size + * (k + 1) * N, each vector starts with the LPC gain + * of the corresponding sub-frame. The LPC gains + * are encoded and inserted after this function is + * called. The first A-coefficient which is 1 is not + * included. + * + * Return value : 0 if encoding is successful, + * <0 if failed to encode. + */ +WebRtc_Word16 WebRtcIsac_EncodeLpcUB( + double* lpcCoeff, + Bitstr* streamdata, + double* interpolLPCCoeff, + WebRtc_Word16 bandwidth, + ISACUBSaveEncDataStruct* encData); + +/****************************************************************************** + * WebRtcIsac_DecodeInterpolLpcUb() + * Decode LPC coefficients and interpolate to get the coefficients fo all + * sub-frmaes. + * + * Inputs: + * - bandwidth : spepecifies if the codec is in 0-12 kHz or + * 0-16 kHz mode. + * + * Input/output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * - percepFilterParam : Decoded and interpolated LPC (A-polynomial) of + * all sub-frames. + * If LP analysis is of order K, and there are N + * sub-frames then this is a buffer of size + * (k + 1) * N, each vector starts with the LPC gain + * of the corresponding sub-frame. The LPC gains + * are encoded and inserted after this function is + * called. The first A-coefficient which is 1 is not + * included. + * + * Return value : 0 if encoding is successful, + * <0 if failed to encode. + */ +WebRtc_Word16 WebRtcIsac_DecodeInterpolLpcUb( + Bitstr* streamdata, + double* percepFilterParam, + WebRtc_Word16 bandwidth); + +/* decode & dequantize RC */ +int WebRtcIsac_DecodeRc(Bitstr *streamdata, WebRtc_Word16 *RCQ15); + +/* quantize & code RC */ +void WebRtcIsac_EncodeRc(WebRtc_Word16 *RCQ15, Bitstr *streamdata); + +/* decode & dequantize squared Gain */ +int WebRtcIsac_DecodeGain2(Bitstr *streamdata, WebRtc_Word32 *Gain2); + +/* quantize & code squared Gain (input is squared gain) */ +int WebRtcIsac_EncodeGain2(WebRtc_Word32 *gain2, Bitstr *streamdata); + +void WebRtcIsac_EncodePitchGain(WebRtc_Word16* PitchGains_Q12, Bitstr* streamdata, ISAC_SaveEncData_t* encData); + +void WebRtcIsac_EncodePitchLag(double* PitchLags, WebRtc_Word16* PitchGain_Q12, Bitstr* streamdata, ISAC_SaveEncData_t* encData); + +int WebRtcIsac_DecodePitchGain(Bitstr *streamdata, WebRtc_Word16 *PitchGain_Q12); +int WebRtcIsac_DecodePitchLag(Bitstr *streamdata, WebRtc_Word16 *PitchGain_Q12, double *PitchLag); + +int WebRtcIsac_DecodeFrameLen(Bitstr *streamdata, WebRtc_Word16 *framelength); +int WebRtcIsac_EncodeFrameLen(WebRtc_Word16 framelength, Bitstr *streamdata); +int WebRtcIsac_DecodeSendBW(Bitstr *streamdata, WebRtc_Word16 *BWno); +void WebRtcIsac_EncodeReceiveBw(int *BWno, Bitstr *streamdata); + +/* step-down */ +void WebRtcIsac_Poly2Rc(double *a, int N, double *RC); + +/* step-up */ +void WebRtcIsac_Rc2Poly(double *RC, int N, double *a); + +void WebRtcIsac_TranscodeLPCCoef(double *LPCCoef_lo, double *LPCCoef_hi, int model, + int *index_g); + + +/****************************************************************************** + * WebRtcIsac_EncodeLpcGainUb() + * Encode LPC gains of sub-Frames. + * + * Input/outputs: + * - lpGains : a buffer which contains 'SUBFRAME' number of + * LP gains to be encoded. The input values are + * overwritten by the quantized values. + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * - lpcGainIndex : quantization indices for lpc gains, these will + * be stored to be used for FEC. + */ +void WebRtcIsac_EncodeLpcGainUb( + double* lpGains, + Bitstr* streamdata, + int* lpcGainIndex); + + +/****************************************************************************** + * WebRtcIsac_EncodeLpcGainUb() + * Store LPC gains of sub-Frames in 'streamdata'. + * + * Input: + * - lpGains : a buffer which contains 'SUBFRAME' number of + * LP gains to be encoded. + * Input/outputs: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + */ +void WebRtcIsac_StoreLpcGainUb( + double* lpGains, + Bitstr* streamdata); + + +/****************************************************************************** + * WebRtcIsac_DecodeLpcGainUb() + * Decode the LPC gain of sub-frames. + * + * Input/output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * - lpGains : a buffer where decoded LPC gians will be stored. + * + * Return value : 0 if succeeded. + * <0 if failed. + */ +WebRtc_Word16 WebRtcIsac_DecodeLpcGainUb( + double* lpGains, + Bitstr* streamdata); + + +/****************************************************************************** + * WebRtcIsac_EncodeBandwidth() + * Encode if the bandwidth of encoded audio is 0-12 kHz or 0-16 kHz. + * + * Input: + * - bandwidth : an enumerator specifying if the codec in is + * 0-12 kHz or 0-16 kHz mode. + * + * Input/output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Return value : 0 if succeeded. + * <0 if failed. + */ +WebRtc_Word16 WebRtcIsac_EncodeBandwidth( + enum ISACBandwidth bandwidth, + Bitstr* streamData); + + +/****************************************************************************** + * WebRtcIsac_DecodeBandwidth() + * Decode the bandwidth of the encoded audio, i.e. if the bandwidth is 0-12 kHz + * or 0-16 kHz. + * + * Input/output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * - bandwidth : an enumerator specifying if the codec is in + * 0-12 kHz or 0-16 kHz mode. + * + * Return value : 0 if succeeded. + * <0 if failed. + */ +WebRtc_Word16 WebRtcIsac_DecodeBandwidth( + Bitstr* streamData, + enum ISACBandwidth* bandwidth); + + +/****************************************************************************** + * WebRtcIsac_EncodeJitterInfo() + * Decode the jitter information. + * + * Input/output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Input: + * - jitterInfo : one bit of info specifying if the channel is + * in high/low jitter. Zero indicates low jitter + * and one indicates high jitter. + * + * Return value : 0 if succeeded. + * <0 if failed. + */ +WebRtc_Word16 WebRtcIsac_EncodeJitterInfo( + WebRtc_Word32 jitterIndex, + Bitstr* streamData); + + +/****************************************************************************** + * WebRtcIsac_DecodeJitterInfo() + * Decode the jitter information. + * + * Input/output: + * - streamdata : pointer to a stucture containg the encoded + * data and theparameters needed for entropy + * coding. + * + * Output: + * - jitterInfo : one bit of info specifying if the channel is + * in high/low jitter. Zero indicates low jitter + * and one indicates high jitter. + * + * Return value : 0 if succeeded. + * <0 if failed. + */ +WebRtc_Word16 WebRtcIsac_DecodeJitterInfo( + Bitstr* streamData, + WebRtc_Word32* jitterInfo); + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_ */ diff --git a/src/mod/codecs/mod_isac/fft.c b/src/mod/codecs/mod_isac/fft.c new file mode 100644 index 0000000000..c8247983aa --- /dev/null +++ b/src/mod/codecs/mod_isac/fft.c @@ -0,0 +1,947 @@ +/* + * Copyright(c)1995,97 Mark Olesen + * Queen's Univ at Kingston (Canada) + * + * Permission to use, copy, modify, and distribute this software for + * any purpose without fee is hereby granted, provided that this + * entire notice is included in all copies of any software which is + * or includes a copy or modification of this software and in all + * copies of the supporting documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR QUEEN'S + * UNIVERSITY AT KINGSTON MAKES ANY REPRESENTATION OR WARRANTY OF ANY + * KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS + * FITNESS FOR ANY PARTICULAR PURPOSE. + * + * All of which is to say that you can do what you like with this + * source code provided you don't try to sell it as your own and you + * include an unaltered copy of this message (including the + * copyright). + * + * It is also implicitly understood that bug fixes and improvements + * should make their way back to the general Internet community so + * that everyone benefits. + * + * Changes: + * Trivial type modifications by the WebRTC authors. + */ + + +/* + * File: + * WebRtcIsac_Fftn.c + * + * Public: + * WebRtcIsac_Fftn / fftnf (); + * + * Private: + * WebRtcIsac_Fftradix / fftradixf (); + * + * Descript: + * multivariate complex Fourier transform, computed in place + * using mixed-radix Fast Fourier Transform algorithm. + * + * Fortran code by: + * RC Singleton, Stanford Research Institute, Sept. 1968 + * + * translated by f2c (version 19950721). + * + * int WebRtcIsac_Fftn (int ndim, const int dims[], REAL Re[], REAL Im[], + * int iSign, double scaling); + * + * NDIM = the total number dimensions + * DIMS = a vector of array sizes + * if NDIM is zero then DIMS must be zero-terminated + * + * RE and IM hold the real and imaginary components of the data, and return + * the resulting real and imaginary Fourier coefficients. Multidimensional + * data *must* be allocated contiguously. There is no limit on the number + * of dimensions. + * + * ISIGN = the sign of the complex exponential (ie, forward or inverse FFT) + * the magnitude of ISIGN (normally 1) is used to determine the + * correct indexing increment (see below). + * + * SCALING = normalizing constant by which the final result is *divided* + * if SCALING == -1, normalize by total dimension of the transform + * if SCALING < -1, normalize by the square-root of the total dimension + * + * example: + * tri-variate transform with Re[n1][n2][n3], Im[n1][n2][n3] + * + * int dims[3] = {n1,n2,n3} + * WebRtcIsac_Fftn (3, dims, Re, Im, 1, scaling); + * + *-----------------------------------------------------------------------* + * int WebRtcIsac_Fftradix (REAL Re[], REAL Im[], size_t nTotal, size_t nPass, + * size_t nSpan, int iSign, size_t max_factors, + * size_t max_perm); + * + * RE, IM - see above documentation + * + * Although there is no limit on the number of dimensions, WebRtcIsac_Fftradix() must + * be called once for each dimension, but the calls may be in any order. + * + * NTOTAL = the total number of complex data values + * NPASS = the dimension of the current variable + * NSPAN/NPASS = the spacing of consecutive data values while indexing the + * current variable + * ISIGN - see above documentation + * + * example: + * tri-variate transform with Re[n1][n2][n3], Im[n1][n2][n3] + * + * WebRtcIsac_Fftradix (Re, Im, n1*n2*n3, n1, n1, 1, maxf, maxp); + * WebRtcIsac_Fftradix (Re, Im, n1*n2*n3, n2, n1*n2, 1, maxf, maxp); + * WebRtcIsac_Fftradix (Re, Im, n1*n2*n3, n3, n1*n2*n3, 1, maxf, maxp); + * + * single-variate transform, + * NTOTAL = N = NSPAN = (number of complex data values), + * + * WebRtcIsac_Fftradix (Re, Im, n, n, n, 1, maxf, maxp); + * + * The data can also be stored in a single array with alternating real and + * imaginary parts, the magnitude of ISIGN is changed to 2 to give correct + * indexing increment, and data [0] and data [1] used to pass the initial + * addresses for the sequences of real and imaginary values, + * + * example: + * REAL data [2*NTOTAL]; + * WebRtcIsac_Fftradix ( &data[0], &data[1], NTOTAL, nPass, nSpan, 2, maxf, maxp); + * + * for temporary allocation: + * + * MAX_FACTORS >= the maximum prime factor of NPASS + * MAX_PERM >= the number of prime factors of NPASS. In addition, + * if the square-free portion K of NPASS has two or more prime + * factors, then MAX_PERM >= (K-1) + * + * storage in FACTOR for a maximum of 15 prime factors of NPASS. if NPASS + * has more than one square-free factor, the product of the square-free + * factors must be <= 210 array storage for maximum prime factor of 23 the + * following two constants should agree with the array dimensions. + * + *----------------------------------------------------------------------*/ +#include "fft.h" + +#include +#include + + + +/* double precision routine */ +static int +WebRtcIsac_Fftradix (double Re[], double Im[], + size_t nTotal, size_t nPass, size_t nSpan, int isign, + int max_factors, unsigned int max_perm, + FFTstr *fftstate); + + + +#ifndef M_PI +# define M_PI 3.14159265358979323846264338327950288 +#endif + +#ifndef SIN60 +# define SIN60 0.86602540378443865 /* sin(60 deg) */ +# define COS72 0.30901699437494742 /* cos(72 deg) */ +# define SIN72 0.95105651629515357 /* sin(72 deg) */ +#endif + +# define REAL double +# define FFTN WebRtcIsac_Fftn +# define FFTNS "fftn" +# define FFTRADIX WebRtcIsac_Fftradix +# define FFTRADIXS "fftradix" + + +int WebRtcIsac_Fftns(unsigned int ndim, const int dims[], + double Re[], + double Im[], + int iSign, + double scaling, + FFTstr *fftstate) +{ + + size_t nSpan, nPass, nTotal; + unsigned int i; + int ret, max_factors, max_perm; + + /* + * tally the number of elements in the data array + * and determine the number of dimensions + */ + nTotal = 1; + if (ndim && dims [0]) + { + for (i = 0; i < ndim; i++) + { + if (dims [i] <= 0) + { + return -1; + } + nTotal *= dims [i]; + } + } + else + { + ndim = 0; + for (i = 0; dims [i]; i++) + { + if (dims [i] <= 0) + { + return -1; + } + nTotal *= dims [i]; + ndim++; + } + } + + /* determine maximum number of factors and permuations */ +#if 1 + /* + * follow John Beale's example, just use the largest dimension and don't + * worry about excess allocation. May be someone else will do it? + */ + max_factors = max_perm = 1; + for (i = 0; i < ndim; i++) + { + nSpan = dims [i]; + if ((int)nSpan > max_factors) + { + max_factors = (int)nSpan; + } + if ((int)nSpan > max_perm) + { + max_perm = (int)nSpan; + } + } +#else + /* use the constants used in the original Fortran code */ + max_factors = 23; + max_perm = 209; +#endif + /* loop over the dimensions: */ + nPass = 1; + for (i = 0; i < ndim; i++) + { + nSpan = dims [i]; + nPass *= nSpan; + ret = FFTRADIX (Re, Im, nTotal, nSpan, nPass, iSign, + max_factors, max_perm, fftstate); + /* exit, clean-up already done */ + if (ret) + return ret; + } + + /* Divide through by the normalizing constant: */ + if (scaling && scaling != 1.0) + { + if (iSign < 0) iSign = -iSign; + if (scaling < 0.0) + { + scaling = (double)nTotal; + if (scaling < -1.0) + scaling = sqrt (scaling); + } + scaling = 1.0 / scaling; /* multiply is often faster */ + for (i = 0; i < nTotal; i += iSign) + { + Re [i] *= scaling; + Im [i] *= scaling; + } + } + return 0; +} + +/* + * singleton's mixed radix routine + * + * could move allocation out to WebRtcIsac_Fftn(), but leave it here so that it's + * possible to make this a standalone function + */ + +static int FFTRADIX (REAL Re[], + REAL Im[], + size_t nTotal, + size_t nPass, + size_t nSpan, + int iSign, + int max_factors, + unsigned int max_perm, + FFTstr *fftstate) +{ + int ii, mfactor, kspan, ispan, inc; + int j, jc, jf, jj, k, k1, k2, k3, k4, kk, kt, nn, ns, nt; + + + REAL radf; + REAL c1, c2, c3, cd, aa, aj, ak, ajm, ajp, akm, akp; + REAL s1, s2, s3, sd, bb, bj, bk, bjm, bjp, bkm, bkp; + + REAL *Rtmp = NULL; /* temp space for real part*/ + REAL *Itmp = NULL; /* temp space for imaginary part */ + REAL *Cos = NULL; /* Cosine values */ + REAL *Sin = NULL; /* Sine values */ + + REAL s60 = SIN60; /* sin(60 deg) */ + REAL c72 = COS72; /* cos(72 deg) */ + REAL s72 = SIN72; /* sin(72 deg) */ + REAL pi2 = M_PI; /* use PI first, 2 PI later */ + + + fftstate->SpaceAlloced = 0; + fftstate->MaxPermAlloced = 0; + + + // initialize to avoid warnings + k3 = c2 = c3 = s2 = s3 = 0.0; + + if (nPass < 2) + return 0; + + /* allocate storage */ + if (fftstate->SpaceAlloced < max_factors * sizeof (REAL)) + { +#ifdef SUN_BROKEN_REALLOC + if (!fftstate->SpaceAlloced) /* first time */ + { + fftstate->SpaceAlloced = max_factors * sizeof (REAL); + } + else + { +#endif + fftstate->SpaceAlloced = max_factors * sizeof (REAL); +#ifdef SUN_BROKEN_REALLOC + } +#endif + } + else + { + /* allow full use of alloc'd space */ + max_factors = fftstate->SpaceAlloced / sizeof (REAL); + } + if (fftstate->MaxPermAlloced < max_perm) + { +#ifdef SUN_BROKEN_REALLOC + if (!fftstate->MaxPermAlloced) /* first time */ + else +#endif + fftstate->MaxPermAlloced = max_perm; + } + else + { + /* allow full use of alloc'd space */ + max_perm = fftstate->MaxPermAlloced; + } + if (fftstate->Tmp0 == NULL || fftstate->Tmp1 == NULL || fftstate->Tmp2 == NULL || fftstate->Tmp3 == NULL + || fftstate->Perm == NULL) { + return -1; + } + + /* assign pointers */ + Rtmp = (REAL *) fftstate->Tmp0; + Itmp = (REAL *) fftstate->Tmp1; + Cos = (REAL *) fftstate->Tmp2; + Sin = (REAL *) fftstate->Tmp3; + + /* + * Function Body + */ + inc = iSign; + if (iSign < 0) { + s72 = -s72; + s60 = -s60; + pi2 = -pi2; + inc = -inc; /* absolute value */ + } + + /* adjust for strange increments */ + nt = inc * (int)nTotal; + ns = inc * (int)nSpan; + kspan = ns; + + nn = nt - inc; + jc = ns / (int)nPass; + radf = pi2 * (double) jc; + pi2 *= 2.0; /* use 2 PI from here on */ + + ii = 0; + jf = 0; + /* determine the factors of n */ + mfactor = 0; + k = (int)nPass; + while (k % 16 == 0) { + mfactor++; + fftstate->factor [mfactor - 1] = 4; + k /= 16; + } + j = 3; + jj = 9; + do { + while (k % jj == 0) { + mfactor++; + fftstate->factor [mfactor - 1] = j; + k /= jj; + } + j += 2; + jj = j * j; + } while (jj <= k); + if (k <= 4) { + kt = mfactor; + fftstate->factor [mfactor] = k; + if (k != 1) + mfactor++; + } else { + if (k - (k / 4 << 2) == 0) { + mfactor++; + fftstate->factor [mfactor - 1] = 2; + k /= 4; + } + kt = mfactor; + j = 2; + do { + if (k % j == 0) { + mfactor++; + fftstate->factor [mfactor - 1] = j; + k /= j; + } + j = ((j + 1) / 2 << 1) + 1; + } while (j <= k); + } + if (kt) { + j = kt; + do { + mfactor++; + fftstate->factor [mfactor - 1] = fftstate->factor [j - 1]; + j--; + } while (j); + } + + /* test that mfactors is in range */ + if (mfactor > NFACTOR) + { + return -1; + } + + /* compute fourier transform */ + for (;;) { + sd = radf / (double) kspan; + cd = sin(sd); + cd = 2.0 * cd * cd; + sd = sin(sd + sd); + kk = 0; + ii++; + + switch (fftstate->factor [ii - 1]) { + case 2: + /* transform for factor of 2 (including rotation factor) */ + kspan /= 2; + k1 = kspan + 2; + do { + do { + k2 = kk + kspan; + ak = Re [k2]; + bk = Im [k2]; + Re [k2] = Re [kk] - ak; + Im [k2] = Im [kk] - bk; + Re [kk] += ak; + Im [kk] += bk; + kk = k2 + kspan; + } while (kk < nn); + kk -= nn; + } while (kk < jc); + if (kk >= kspan) + goto Permute_Results_Label; /* exit infinite loop */ + do { + c1 = 1.0 - cd; + s1 = sd; + do { + do { + do { + k2 = kk + kspan; + ak = Re [kk] - Re [k2]; + bk = Im [kk] - Im [k2]; + Re [kk] += Re [k2]; + Im [kk] += Im [k2]; + Re [k2] = c1 * ak - s1 * bk; + Im [k2] = s1 * ak + c1 * bk; + kk = k2 + kspan; + } while (kk < (nt-1)); + k2 = kk - nt; + c1 = -c1; + kk = k1 - k2; + } while (kk > k2); + ak = c1 - (cd * c1 + sd * s1); + s1 = sd * c1 - cd * s1 + s1; + c1 = 2.0 - (ak * ak + s1 * s1); + s1 *= c1; + c1 *= ak; + kk += jc; + } while (kk < k2); + k1 += inc + inc; + kk = (k1 - kspan + 1) / 2 + jc - 1; + } while (kk < (jc + jc)); + break; + + case 4: /* transform for factor of 4 */ + ispan = kspan; + kspan /= 4; + + do { + c1 = 1.0; + s1 = 0.0; + do { + do { + k1 = kk + kspan; + k2 = k1 + kspan; + k3 = k2 + kspan; + akp = Re [kk] + Re [k2]; + akm = Re [kk] - Re [k2]; + ajp = Re [k1] + Re [k3]; + ajm = Re [k1] - Re [k3]; + bkp = Im [kk] + Im [k2]; + bkm = Im [kk] - Im [k2]; + bjp = Im [k1] + Im [k3]; + bjm = Im [k1] - Im [k3]; + Re [kk] = akp + ajp; + Im [kk] = bkp + bjp; + ajp = akp - ajp; + bjp = bkp - bjp; + if (iSign < 0) { + akp = akm + bjm; + bkp = bkm - ajm; + akm -= bjm; + bkm += ajm; + } else { + akp = akm - bjm; + bkp = bkm + ajm; + akm += bjm; + bkm -= ajm; + } + /* avoid useless multiplies */ + if (s1 == 0.0) { + Re [k1] = akp; + Re [k2] = ajp; + Re [k3] = akm; + Im [k1] = bkp; + Im [k2] = bjp; + Im [k3] = bkm; + } else { + Re [k1] = akp * c1 - bkp * s1; + Re [k2] = ajp * c2 - bjp * s2; + Re [k3] = akm * c3 - bkm * s3; + Im [k1] = akp * s1 + bkp * c1; + Im [k2] = ajp * s2 + bjp * c2; + Im [k3] = akm * s3 + bkm * c3; + } + kk = k3 + kspan; + } while (kk < nt); + + c2 = c1 - (cd * c1 + sd * s1); + s1 = sd * c1 - cd * s1 + s1; + c1 = 2.0 - (c2 * c2 + s1 * s1); + s1 *= c1; + c1 *= c2; + /* values of c2, c3, s2, s3 that will get used next time */ + c2 = c1 * c1 - s1 * s1; + s2 = 2.0 * c1 * s1; + c3 = c2 * c1 - s2 * s1; + s3 = c2 * s1 + s2 * c1; + kk = kk - nt + jc; + } while (kk < kspan); + kk = kk - kspan + inc; + } while (kk < jc); + if (kspan == jc) + goto Permute_Results_Label; /* exit infinite loop */ + break; + + default: + /* transform for odd factors */ +#ifdef FFT_RADIX4 + return -1; + break; +#else /* FFT_RADIX4 */ + k = fftstate->factor [ii - 1]; + ispan = kspan; + kspan /= k; + + switch (k) { + case 3: /* transform for factor of 3 (optional code) */ + do { + do { + k1 = kk + kspan; + k2 = k1 + kspan; + ak = Re [kk]; + bk = Im [kk]; + aj = Re [k1] + Re [k2]; + bj = Im [k1] + Im [k2]; + Re [kk] = ak + aj; + Im [kk] = bk + bj; + ak -= 0.5 * aj; + bk -= 0.5 * bj; + aj = (Re [k1] - Re [k2]) * s60; + bj = (Im [k1] - Im [k2]) * s60; + Re [k1] = ak - bj; + Re [k2] = ak + bj; + Im [k1] = bk + aj; + Im [k2] = bk - aj; + kk = k2 + kspan; + } while (kk < (nn - 1)); + kk -= nn; + } while (kk < kspan); + break; + + case 5: /* transform for factor of 5 (optional code) */ + c2 = c72 * c72 - s72 * s72; + s2 = 2.0 * c72 * s72; + do { + do { + k1 = kk + kspan; + k2 = k1 + kspan; + k3 = k2 + kspan; + k4 = k3 + kspan; + akp = Re [k1] + Re [k4]; + akm = Re [k1] - Re [k4]; + bkp = Im [k1] + Im [k4]; + bkm = Im [k1] - Im [k4]; + ajp = Re [k2] + Re [k3]; + ajm = Re [k2] - Re [k3]; + bjp = Im [k2] + Im [k3]; + bjm = Im [k2] - Im [k3]; + aa = Re [kk]; + bb = Im [kk]; + Re [kk] = aa + akp + ajp; + Im [kk] = bb + bkp + bjp; + ak = akp * c72 + ajp * c2 + aa; + bk = bkp * c72 + bjp * c2 + bb; + aj = akm * s72 + ajm * s2; + bj = bkm * s72 + bjm * s2; + Re [k1] = ak - bj; + Re [k4] = ak + bj; + Im [k1] = bk + aj; + Im [k4] = bk - aj; + ak = akp * c2 + ajp * c72 + aa; + bk = bkp * c2 + bjp * c72 + bb; + aj = akm * s2 - ajm * s72; + bj = bkm * s2 - bjm * s72; + Re [k2] = ak - bj; + Re [k3] = ak + bj; + Im [k2] = bk + aj; + Im [k3] = bk - aj; + kk = k4 + kspan; + } while (kk < (nn-1)); + kk -= nn; + } while (kk < kspan); + break; + + default: + if (k != jf) { + jf = k; + s1 = pi2 / (double) k; + c1 = cos(s1); + s1 = sin(s1); + if (jf > max_factors){ + return -1; + } + Cos [jf - 1] = 1.0; + Sin [jf - 1] = 0.0; + j = 1; + do { + Cos [j - 1] = Cos [k - 1] * c1 + Sin [k - 1] * s1; + Sin [j - 1] = Cos [k - 1] * s1 - Sin [k - 1] * c1; + k--; + Cos [k - 1] = Cos [j - 1]; + Sin [k - 1] = -Sin [j - 1]; + j++; + } while (j < k); + } + do { + do { + k1 = kk; + k2 = kk + ispan; + ak = aa = Re [kk]; + bk = bb = Im [kk]; + j = 1; + k1 += kspan; + do { + k2 -= kspan; + j++; + Rtmp [j - 1] = Re [k1] + Re [k2]; + ak += Rtmp [j - 1]; + Itmp [j - 1] = Im [k1] + Im [k2]; + bk += Itmp [j - 1]; + j++; + Rtmp [j - 1] = Re [k1] - Re [k2]; + Itmp [j - 1] = Im [k1] - Im [k2]; + k1 += kspan; + } while (k1 < k2); + Re [kk] = ak; + Im [kk] = bk; + k1 = kk; + k2 = kk + ispan; + j = 1; + do { + k1 += kspan; + k2 -= kspan; + jj = j; + ak = aa; + bk = bb; + aj = 0.0; + bj = 0.0; + k = 1; + do { + k++; + ak += Rtmp [k - 1] * Cos [jj - 1]; + bk += Itmp [k - 1] * Cos [jj - 1]; + k++; + aj += Rtmp [k - 1] * Sin [jj - 1]; + bj += Itmp [k - 1] * Sin [jj - 1]; + jj += j; + if (jj > jf) { + jj -= jf; + } + } while (k < jf); + k = jf - j; + Re [k1] = ak - bj; + Im [k1] = bk + aj; + Re [k2] = ak + bj; + Im [k2] = bk - aj; + j++; + } while (j < k); + kk += ispan; + } while (kk < nn); + kk -= nn; + } while (kk < kspan); + break; + } + + /* multiply by rotation factor (except for factors of 2 and 4) */ + if (ii == mfactor) + goto Permute_Results_Label; /* exit infinite loop */ + kk = jc; + do { + c2 = 1.0 - cd; + s1 = sd; + do { + c1 = c2; + s2 = s1; + kk += kspan; + do { + do { + ak = Re [kk]; + Re [kk] = c2 * ak - s2 * Im [kk]; + Im [kk] = s2 * ak + c2 * Im [kk]; + kk += ispan; + } while (kk < nt); + ak = s1 * s2; + s2 = s1 * c2 + c1 * s2; + c2 = c1 * c2 - ak; + kk = kk - nt + kspan; + } while (kk < ispan); + c2 = c1 - (cd * c1 + sd * s1); + s1 += sd * c1 - cd * s1; + c1 = 2.0 - (c2 * c2 + s1 * s1); + s1 *= c1; + c2 *= c1; + kk = kk - ispan + jc; + } while (kk < kspan); + kk = kk - kspan + jc + inc; + } while (kk < (jc + jc)); + break; +#endif /* FFT_RADIX4 */ + } + } + + /* permute the results to normal order---done in two stages */ + /* permutation for square factors of n */ +Permute_Results_Label: + fftstate->Perm [0] = ns; + if (kt) { + k = kt + kt + 1; + if (mfactor < k) + k--; + j = 1; + fftstate->Perm [k] = jc; + do { + fftstate->Perm [j] = fftstate->Perm [j - 1] / fftstate->factor [j - 1]; + fftstate->Perm [k - 1] = fftstate->Perm [k] * fftstate->factor [j - 1]; + j++; + k--; + } while (j < k); + k3 = fftstate->Perm [k]; + kspan = fftstate->Perm [1]; + kk = jc; + k2 = kspan; + j = 1; + if (nPass != nTotal) { + /* permutation for multivariate transform */ + Permute_Multi_Label: + do { + do { + k = kk + jc; + do { + /* swap Re [kk] <> Re [k2], Im [kk] <> Im [k2] */ + ak = Re [kk]; Re [kk] = Re [k2]; Re [k2] = ak; + bk = Im [kk]; Im [kk] = Im [k2]; Im [k2] = bk; + kk += inc; + k2 += inc; + } while (kk < (k-1)); + kk += ns - jc; + k2 += ns - jc; + } while (kk < (nt-1)); + k2 = k2 - nt + kspan; + kk = kk - nt + jc; + } while (k2 < (ns-1)); + do { + do { + k2 -= fftstate->Perm [j - 1]; + j++; + k2 = fftstate->Perm [j] + k2; + } while (k2 > fftstate->Perm [j - 1]); + j = 1; + do { + if (kk < (k2-1)) + goto Permute_Multi_Label; + kk += jc; + k2 += kspan; + } while (k2 < (ns-1)); + } while (kk < (ns-1)); + } else { + /* permutation for single-variate transform (optional code) */ + Permute_Single_Label: + do { + /* swap Re [kk] <> Re [k2], Im [kk] <> Im [k2] */ + ak = Re [kk]; Re [kk] = Re [k2]; Re [k2] = ak; + bk = Im [kk]; Im [kk] = Im [k2]; Im [k2] = bk; + kk += inc; + k2 += kspan; + } while (k2 < (ns-1)); + do { + do { + k2 -= fftstate->Perm [j - 1]; + j++; + k2 = fftstate->Perm [j] + k2; + } while (k2 >= fftstate->Perm [j - 1]); + j = 1; + do { + if (kk < k2) + goto Permute_Single_Label; + kk += inc; + k2 += kspan; + } while (k2 < (ns-1)); + } while (kk < (ns-1)); + } + jc = k3; + } + + if ((kt << 1) + 1 >= mfactor) + return 0; + ispan = fftstate->Perm [kt]; + /* permutation for square-free factors of n */ + j = mfactor - kt; + fftstate->factor [j] = 1; + do { + fftstate->factor [j - 1] *= fftstate->factor [j]; + j--; + } while (j != kt); + kt++; + nn = fftstate->factor [kt - 1] - 1; + if (nn > (int) max_perm) { + return -1; + } + j = jj = 0; + for (;;) { + k = kt + 1; + k2 = fftstate->factor [kt - 1]; + kk = fftstate->factor [k - 1]; + j++; + if (j > nn) + break; /* exit infinite loop */ + jj += kk; + while (jj >= k2) { + jj -= k2; + k2 = kk; + k++; + kk = fftstate->factor [k - 1]; + jj += kk; + } + fftstate->Perm [j - 1] = jj; + } + /* determine the permutation cycles of length greater than 1 */ + j = 0; + for (;;) { + do { + j++; + kk = fftstate->Perm [j - 1]; + } while (kk < 0); + if (kk != j) { + do { + k = kk; + kk = fftstate->Perm [k - 1]; + fftstate->Perm [k - 1] = -kk; + } while (kk != j); + k3 = kk; + } else { + fftstate->Perm [j - 1] = -j; + if (j == nn) + break; /* exit infinite loop */ + } + } + max_factors *= inc; + /* reorder a and b, following the permutation cycles */ + for (;;) { + j = k3 + 1; + nt -= ispan; + ii = nt - inc + 1; + if (nt < 0) + break; /* exit infinite loop */ + do { + do { + j--; + } while (fftstate->Perm [j - 1] < 0); + jj = jc; + do { + kspan = jj; + if (jj > max_factors) { + kspan = max_factors; + } + jj -= kspan; + k = fftstate->Perm [j - 1]; + kk = jc * k + ii + jj; + k1 = kk + kspan - 1; + k2 = 0; + do { + k2++; + Rtmp [k2 - 1] = Re [k1]; + Itmp [k2 - 1] = Im [k1]; + k1 -= inc; + } while (k1 != (kk-1)); + do { + k1 = kk + kspan - 1; + k2 = k1 - jc * (k + fftstate->Perm [k - 1]); + k = -fftstate->Perm [k - 1]; + do { + Re [k1] = Re [k2]; + Im [k1] = Im [k2]; + k1 -= inc; + k2 -= inc; + } while (k1 != (kk-1)); + kk = k2 + 1; + } while (k != j); + k1 = kk + kspan - 1; + k2 = 0; + do { + k2++; + Re [k1] = Rtmp [k2 - 1]; + Im [k1] = Itmp [k2 - 1]; + k1 -= inc; + } while (k1 != (kk-1)); + } while (jj); + } while (j != 1); + } + return 0; /* exit point here */ +} +/* ---------------------- end-of-file (c source) ---------------------- */ + diff --git a/src/mod/codecs/mod_isac/fft.h b/src/mod/codecs/mod_isac/fft.h new file mode 100644 index 0000000000..a42f57bcb5 --- /dev/null +++ b/src/mod/codecs/mod_isac/fft.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/*--------------------------------*-C-*---------------------------------* + * File: + * fftn.h + * ---------------------------------------------------------------------* + * Re[]: real value array + * Im[]: imaginary value array + * nTotal: total number of complex values + * nPass: number of elements involved in this pass of transform + * nSpan: nspan/nPass = number of bytes to increment pointer + * in Re[] and Im[] + * isign: exponent: +1 = forward -1 = reverse + * scaling: normalizing constant by which the final result is *divided* + * scaling == -1, normalize by total dimension of the transform + * scaling < -1, normalize by the square-root of the total dimension + * + * ---------------------------------------------------------------------- + * See the comments in the code for correct usage! + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_FFT_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_FFT_H_ + + +#include "structs.h" + + +/* double precision routine */ + + +int WebRtcIsac_Fftns (unsigned int ndim, const int dims[], double Re[], double Im[], + int isign, double scaling, FFTstr *fftstate); + + + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_FFT_H_ */ diff --git a/src/mod/codecs/mod_isac/filter_ar.c b/src/mod/codecs/mod_isac/filter_ar.c new file mode 100644 index 0000000000..24e83a6b91 --- /dev/null +++ b/src/mod/codecs/mod_isac/filter_ar.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_FilterAR(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +int WebRtcSpl_FilterAR(G_CONST WebRtc_Word16* a, + int a_length, + G_CONST WebRtc_Word16* x, + int x_length, + WebRtc_Word16* state, + int state_length, + WebRtc_Word16* state_low, + int state_low_length, + WebRtc_Word16* filtered, + WebRtc_Word16* filtered_low, + int filtered_low_length) +{ + WebRtc_Word32 o; + WebRtc_Word32 oLOW; + int i, j, stop; + G_CONST WebRtc_Word16* x_ptr = &x[0]; + WebRtc_Word16* filteredFINAL_ptr = filtered; + WebRtc_Word16* filteredFINAL_LOW_ptr = filtered_low; + + for (i = 0; i < x_length; i++) + { + // Calculate filtered[i] and filtered_low[i] + G_CONST WebRtc_Word16* a_ptr = &a[1]; + WebRtc_Word16* filtered_ptr = &filtered[i - 1]; + WebRtc_Word16* filtered_low_ptr = &filtered_low[i - 1]; + WebRtc_Word16* state_ptr = &state[state_length - 1]; + WebRtc_Word16* state_low_ptr = &state_low[state_length - 1]; + + o = (WebRtc_Word32)(*x_ptr++) << 12; + oLOW = (WebRtc_Word32)0; + + stop = (i < a_length) ? i + 1 : a_length; + for (j = 1; j < stop; j++) + { + o -= WEBRTC_SPL_MUL_16_16(*a_ptr, *filtered_ptr--); + oLOW -= WEBRTC_SPL_MUL_16_16(*a_ptr++, *filtered_low_ptr--); + } + for (j = i + 1; j < a_length; j++) + { + o -= WEBRTC_SPL_MUL_16_16(*a_ptr, *state_ptr--); + oLOW -= WEBRTC_SPL_MUL_16_16(*a_ptr++, *state_low_ptr--); + } + + o += (oLOW >> 12); + *filteredFINAL_ptr = (WebRtc_Word16)((o + (WebRtc_Word32)2048) >> 12); + *filteredFINAL_LOW_ptr++ = (WebRtc_Word16)(o - ((WebRtc_Word32)(*filteredFINAL_ptr++) + << 12)); + } + + // Save the filter state + if (x_length >= state_length) + { + WebRtcSpl_CopyFromEndW16(filtered, x_length, a_length - 1, state); + WebRtcSpl_CopyFromEndW16(filtered_low, x_length, a_length - 1, state_low); + } else + { + for (i = 0; i < state_length - x_length; i++) + { + state[i] = state[i + x_length]; + state_low[i] = state_low[i + x_length]; + } + for (i = 0; i < x_length; i++) + { + state[state_length - x_length + i] = filtered[i]; + state[state_length - x_length + i] = filtered_low[i]; + } + } + + return x_length; +} diff --git a/src/mod/codecs/mod_isac/filter_ar_fast_q12.c b/src/mod/codecs/mod_isac/filter_ar_fast_q12.c new file mode 100644 index 0000000000..6184da3f4c --- /dev/null +++ b/src/mod/codecs/mod_isac/filter_ar_fast_q12.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_FilterARFastQ12(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_FilterARFastQ12(WebRtc_Word16 *in, WebRtc_Word16 *out, WebRtc_Word16 *A, + WebRtc_Word16 A_length, WebRtc_Word16 length) +{ + WebRtc_Word32 o; + int i, j; + + WebRtc_Word16 *x_ptr = &in[0]; + WebRtc_Word16 *filtered_ptr = &out[0]; + + for (i = 0; i < length; i++) + { + // Calculate filtered[i] + G_CONST WebRtc_Word16 *a_ptr = &A[0]; + WebRtc_Word16 *state_ptr = &out[i - 1]; + + o = WEBRTC_SPL_MUL_16_16(*x_ptr++, *a_ptr++); + + for (j = 1; j < A_length; j++) + { + o -= WEBRTC_SPL_MUL_16_16(*a_ptr++,*state_ptr--); + } + + // Saturate the output + o = WEBRTC_SPL_SAT((WebRtc_Word32)134215679, o, (WebRtc_Word32)-134217728); + + *filtered_ptr++ = (WebRtc_Word16)((o + (WebRtc_Word32)2048) >> 12); + } + + return; +} diff --git a/src/mod/codecs/mod_isac/filter_functions.c b/src/mod/codecs/mod_isac/filter_functions.c new file mode 100644 index 0000000000..33024a3dee --- /dev/null +++ b/src/mod/codecs/mod_isac/filter_functions.c @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include +#ifdef WEBRTC_ANDROID +#include +#endif +#include "pitch_estimator.h" +#include "lpc_analysis.h" +#include "codec.h" + + + +void WebRtcIsac_AllPoleFilter(double *InOut, double *Coef, int lengthInOut, int orderCoef){ + + /* the state of filter is assumed to be in InOut[-1] to InOut[-orderCoef] */ + double scal; + double sum; + int n,k; + + //if (fabs(Coef[0]-1.0)<0.001) { + if ( (Coef[0] > 0.9999) && (Coef[0] < 1.0001) ) + { + for(n = 0; n < lengthInOut; n++) + { + sum = Coef[1] * InOut[-1]; + for(k = 2; k <= orderCoef; k++){ + sum += Coef[k] * InOut[-k]; + } + *InOut++ -= sum; + } + } + else + { + scal = 1.0 / Coef[0]; + for(n=0;nbuffer, sizeof(double) * PITCH_WLPCBUFLEN); + memcpy(tmpbuffer+PITCH_WLPCBUFLEN, in, sizeof(double) * PITCH_FRAME_LEN); + memcpy(wfdata->buffer, tmpbuffer+PITCH_FRAME_LEN, sizeof(double) * PITCH_WLPCBUFLEN); + + dp=weoutbuf; + dp2=whoutbuf; + for (k=0;kweostate[k]; + *dp2++ = wfdata->whostate[k]; + opol[k]=0.0; + } + opol[0]=1.0; + opol[PITCH_WLPCORDER]=0.0; + weo=dp; + who=dp2; + + endpos=PITCH_WLPCBUFLEN + PITCH_SUBFRAME_LEN; + inp=tmpbuffer + PITCH_WLPCBUFLEN; + + for (n=0; nwindow[k]*tmpbuffer[start+k]; + } + + /* Get LPC polynomial */ + WebRtcIsac_AutoCorr(corr, ext, PITCH_WLPCWINLEN, PITCH_WLPCORDER); + corr[0]=1.01*corr[0]+1.0; /* White noise correction */ + WebRtcIsac_LevDurb(apol, rc, corr, PITCH_WLPCORDER); + WebRtcIsac_BwExpand(apolr, apol, rho, PITCH_WLPCORDER+1); + + /* Filtering */ + WebRtcIsac_ZeroPoleFilter(inp, apol, apolr, PITCH_SUBFRAME_LEN, PITCH_WLPCORDER, weo); + WebRtcIsac_ZeroPoleFilter(inp, apolr, opol, PITCH_SUBFRAME_LEN, PITCH_WLPCORDER, who); + + inp+=PITCH_SUBFRAME_LEN; + endpos+=PITCH_SUBFRAME_LEN; + weo+=PITCH_SUBFRAME_LEN; + who+=PITCH_SUBFRAME_LEN; + } + + /* Export filter states */ + for (k=0;kweostate[k]=weoutbuf[PITCH_FRAME_LEN+k]; + wfdata->whostate[k]=whoutbuf[PITCH_FRAME_LEN+k]; + } + + /* Export output data */ + memcpy(weiout, weoutbuf+PITCH_WLPCORDER, sizeof(double) * PITCH_FRAME_LEN); + memcpy(whiout, whoutbuf+PITCH_WLPCORDER, sizeof(double) * PITCH_FRAME_LEN); +} + + +static const double APupper[ALLPASSSECTIONS] = {0.0347, 0.3826}; +static const double APlower[ALLPASSSECTIONS] = {0.1544, 0.744}; + + + +void WebRtcIsac_AllpassFilterForDec(double *InOut, + const double *APSectionFactors, + int lengthInOut, + double *FilterState) +{ + //This performs all-pass filtering--a series of first order all-pass sections are used + //to filter the input in a cascade manner. + int n,j; + double temp; + for (j=0; j> 12); + } + return; +} diff --git a/src/mod/codecs/mod_isac/filterbank_tables.c b/src/mod/codecs/mod_isac/filterbank_tables.c new file mode 100644 index 0000000000..0f844af9d2 --- /dev/null +++ b/src/mod/codecs/mod_isac/filterbank_tables.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* filterbank_tables.c*/ +/* This file contains variables that are used in filterbanks.c*/ + +#include "filterbank_tables.h" +#include "settings.h" + +/* The composite all-pass filter factors */ +const float WebRtcIsac_kCompositeApFactorsFloat[4] = { + 0.03470000000000f, 0.15440000000000f, 0.38260000000000f, 0.74400000000000f}; + +/* The upper channel all-pass filter factors */ +const float WebRtcIsac_kUpperApFactorsFloat[2] = { + 0.03470000000000f, 0.38260000000000f}; + +/* The lower channel all-pass filter factors */ +const float WebRtcIsac_kLowerApFactorsFloat[2] = { + 0.15440000000000f, 0.74400000000000f}; + +/* The matrix for transforming the backward composite state to upper channel state */ +const float WebRtcIsac_kTransform1Float[8] = { + -0.00158678506084f, 0.00127157815343f, -0.00104805672709f, 0.00084837248079f, + 0.00134467983258f, -0.00107756549387f, 0.00088814793277f, -0.00071893072525f}; + +/* The matrix for transforming the backward composite state to lower channel state */ +const float WebRtcIsac_kTransform2Float[8] = { + -0.00170686041697f, 0.00136780109829f, -0.00112736532350f, 0.00091257055385f, + 0.00103094281812f, -0.00082615076557f, 0.00068092756088f, -0.00055119165484f}; diff --git a/src/mod/codecs/mod_isac/filterbank_tables.h b/src/mod/codecs/mod_isac/filterbank_tables.h new file mode 100644 index 0000000000..e8fda5e545 --- /dev/null +++ b/src/mod/codecs/mod_isac/filterbank_tables.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * filterbank_tables.h + * + * Header file for variables that are defined in + * filterbank_tables.c. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_FILTERBANK_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_FILTERBANK_TABLES_H_ + +#include "structs.h" + +/********************* Coefficient Tables ************************/ +/* The number of composite all-pass filter factors */ +#define NUMBEROFCOMPOSITEAPSECTIONS 4 + +/* The number of all-pass filter factors in an upper or lower channel*/ +#define NUMBEROFCHANNELAPSECTIONS 2 + +/* The composite all-pass filter factors */ +extern const float WebRtcIsac_kCompositeApFactorsFloat[4]; + +/* The upper channel all-pass filter factors */ +extern const float WebRtcIsac_kUpperApFactorsFloat[2]; + +/* The lower channel all-pass filter factors */ +extern const float WebRtcIsac_kLowerApFactorsFloat[2]; + +/* The matrix for transforming the backward composite state to upper channel state */ +extern const float WebRtcIsac_kTransform1Float[8]; + +/* The matrix for transforming the backward composite state to lower channel state */ +extern const float WebRtcIsac_kTransform2Float[8]; + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_FILTERBANK_TABLES_H_ */ diff --git a/src/mod/codecs/mod_isac/filterbanks.c b/src/mod/codecs/mod_isac/filterbanks.c new file mode 100644 index 0000000000..671fd321ce --- /dev/null +++ b/src/mod/codecs/mod_isac/filterbanks.c @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * filterbanks.c + * + * This file contains function WebRtcIsac_AllPassFilter2Float, + * WebRtcIsac_SplitAndFilter, and WebRtcIsac_FilterAndCombine + * which implement filterbanks that produce decimated lowpass and + * highpass versions of a signal, and performs reconstruction. + * + */ + +#include "settings.h" +#include "filterbank_tables.h" +#include "codec.h" + +/* This function performs all-pass filtering--a series of first order all-pass + * sections are used to filter the input in a cascade manner. + * The input is overwritten!! + */ +static void WebRtcIsac_AllPassFilter2Float(float *InOut, const float *APSectionFactors, + int lengthInOut, int NumberOfSections, + float *FilterState) +{ + int n, j; + float temp; + for (j=0; jINLABUFx arrays + each of length QLOOKAHEAD. + The remaining FRAMESAMPLES_HALF-QLOOKAHEAD samples are based + on the first FRAMESAMPLES_HALF-QLOOKAHEAD samples of the input + array in[]. + HP: a FRAMESAMPLES_HALF array of high-pass filtered samples that + have been phase equalized. The first QLOOKAHEAD samples are + based on the samples in the two prefiltdata->INLABUFx arrays + each of length QLOOKAHEAD. + The remaining FRAMESAMPLES_HALF-QLOOKAHEAD samples are based + on the first FRAMESAMPLES_HALF-QLOOKAHEAD samples of the input + array in[]. + + LP_la: a FRAMESAMPLES_HALF array of low-pass filtered samples. + These samples are not phase equalized. They are computed + from the samples in the in[] array. + HP_la: a FRAMESAMPLES_HALF array of high-pass filtered samples + that are not phase equalized. They are computed from + the in[] vector. + prefiltdata: this input data structure's filterbank state and + lookahead sample buffers are updated for the next + encoding iteration. +*/ +void WebRtcIsac_SplitAndFilterFloat(float *pin, float *LP, float *HP, + double *LP_la, double *HP_la, + PreFiltBankstr *prefiltdata) +{ + int k,n; + float CompositeAPFilterState[NUMBEROFCOMPOSITEAPSECTIONS]; + float ForTransform_CompositeAPFilterState[NUMBEROFCOMPOSITEAPSECTIONS]; + float ForTransform_CompositeAPFilterState2[NUMBEROFCOMPOSITEAPSECTIONS]; + float tempinoutvec[FRAMESAMPLES+MAX_AR_MODEL_ORDER]; + float tempin_ch1[FRAMESAMPLES+MAX_AR_MODEL_ORDER]; + float tempin_ch2[FRAMESAMPLES+MAX_AR_MODEL_ORDER]; + float in[FRAMESAMPLES]; + float ftmp; + + + /* High pass filter */ + + for (k=0;kHPstates_float[0] + + kHpStCoefInFloat[3] * prefiltdata->HPstates_float[1]; + ftmp = pin[k] - kHpStCoefInFloat[0] * prefiltdata->HPstates_float[0] - + kHpStCoefInFloat[1] * prefiltdata->HPstates_float[1]; + prefiltdata->HPstates_float[1] = prefiltdata->HPstates_float[0]; + prefiltdata->HPstates_float[0] = ftmp; + } + + /* + % backwards all-pass filtering to obtain zero-phase + [tmp1(N2+LA:-1:LA+1, 1), state1] = filter(Q.coef, Q.coef(end:-1:1), in(N:-2:2)); + tmp1(LA:-1:1) = filter(Q.coef, Q.coef(end:-1:1), Q.LookAheadBuf1, state1); + Q.LookAheadBuf1 = in(N:-2:N-2*LA+2); + */ + /*Backwards all-pass filter the odd samples of the input (upper channel) + to eventually obtain zero phase. The composite all-pass filter (comprised of both + the upper and lower channel all-pass filsters in series) is used for the + filtering. */ + + /* First Channel */ + + /*initial state of composite filter is zero */ + for (k=0;kINLABUF1_float, + WebRtcIsac_kCompositeApFactorsFloat, QLOOKAHEAD, + NUMBEROFCOMPOSITEAPSECTIONS, CompositeAPFilterState); + + /* save the output, but write it in forward order */ + /* write the lookahead samples for the next encoding iteration. Every other + sample at the end of the input frame is written in reverse order for the + lookahead length. Exported in the prefiltdata structure. */ + for (k=0;kINLABUF1_float[k]; + prefiltdata->INLABUF1_float[k]=in[FRAMESAMPLES-1-2*k]; + } + + /* Second Channel. This is exactly like the first channel, except that the + even samples are now filtered instead (lower channel). */ + for (k=0;kINLABUF2_float, + WebRtcIsac_kCompositeApFactorsFloat, QLOOKAHEAD,NUMBEROFCOMPOSITEAPSECTIONS, + CompositeAPFilterState); + + for (k=0;kINLABUF2_float[k]; + prefiltdata->INLABUF2_float[k]=in[FRAMESAMPLES-2-2*k]; + } + + /* Transform filter states from backward to forward */ + /*At this point, each of the states of the backwards composite filters for the + two channels are transformed into forward filtering states for the corresponding + forward channel filters. Each channel's forward filtering state from the previous + encoding iteration is added to the transformed state to get a proper forward state */ + + /* So the existing NUMBEROFCOMPOSITEAPSECTIONS x 1 (4x1) state vector is multiplied by a + NUMBEROFCHANNELAPSECTIONSxNUMBEROFCOMPOSITEAPSECTIONS (2x4) transform matrix to get the + new state that is added to the previous 2x1 input state */ + + for (k=0;kINSTAT1_float[k] += ForTransform_CompositeAPFilterState[n]* + WebRtcIsac_kTransform1Float[k*NUMBEROFCHANNELAPSECTIONS+n]; + prefiltdata->INSTAT2_float[k] += ForTransform_CompositeAPFilterState2[n]* + WebRtcIsac_kTransform2Float[k*NUMBEROFCHANNELAPSECTIONS+n]; + } + } + + /*obtain polyphase components by forward all-pass filtering through each channel */ + /* the backward filtered samples are now forward filtered with the corresponding channel filters */ + /* The all pass filtering automatically updates the filter states which are exported in the + prefiltdata structure */ + WebRtcIsac_AllPassFilter2Float(tempin_ch1,WebRtcIsac_kUpperApFactorsFloat, + FRAMESAMPLES_HALF, NUMBEROFCHANNELAPSECTIONS, prefiltdata->INSTAT1_float); + WebRtcIsac_AllPassFilter2Float(tempin_ch2,WebRtcIsac_kLowerApFactorsFloat, + FRAMESAMPLES_HALF, NUMBEROFCHANNELAPSECTIONS, prefiltdata->INSTAT2_float); + + /* Now Construct low-pass and high-pass signals as combinations of polyphase components */ + for (k=0; kINSTATLA1_float); + WebRtcIsac_AllPassFilter2Float(tempin_ch2,WebRtcIsac_kLowerApFactorsFloat, + FRAMESAMPLES_HALF, NUMBEROFCHANNELAPSECTIONS, prefiltdata->INSTATLA2_float); + + for (k=0; kSTATE_0_UPPER_float); + + /* Now, all-pass filter the new lower channel signal. But since all-pass filter factors + at the decoder are swapped from the ones at the encoder, the 'upper' channel + all-pass filter factors (WebRtcIsac_kUpperApFactorsFloat) are used to filter this new + lower channel signal */ + WebRtcIsac_AllPassFilter2Float(tempin_ch2, WebRtcIsac_kUpperApFactorsFloat, + FRAMESAMPLES_HALF, NUMBEROFCHANNELAPSECTIONS,postfiltdata->STATE_0_LOWER_float); + + + /* Merge outputs to form the full length output signal.*/ + for (k=0;kHPstates1_float[0] + + kHpStCoefOut1Float[3] * postfiltdata->HPstates1_float[1]; + ftmp = Out[k] - kHpStCoefOut1Float[0] * postfiltdata->HPstates1_float[0] - + kHpStCoefOut1Float[1] * postfiltdata->HPstates1_float[1]; + postfiltdata->HPstates1_float[1] = postfiltdata->HPstates1_float[0]; + postfiltdata->HPstates1_float[0] = ftmp; + Out[k] = ftmp2; + } + + for (k=0;kHPstates2_float[0] + + kHpStCoefOut2Float[3] * postfiltdata->HPstates2_float[1]; + ftmp = Out[k] - kHpStCoefOut2Float[0] * postfiltdata->HPstates2_float[0] - + kHpStCoefOut2Float[1] * postfiltdata->HPstates2_float[1]; + postfiltdata->HPstates2_float[1] = postfiltdata->HPstates2_float[0]; + postfiltdata->HPstates2_float[0] = ftmp; + Out[k] = ftmp2; + } +} diff --git a/src/mod/codecs/mod_isac/get_hanning_window.c b/src/mod/codecs/mod_isac/get_hanning_window.c new file mode 100644 index 0000000000..6d67e60f7a --- /dev/null +++ b/src/mod/codecs/mod_isac/get_hanning_window.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_GetHanningWindow(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +// Hanning table with 256 entries +static const WebRtc_Word16 kHanningTable[] = { + 1, 2, 6, 10, 15, 22, 30, 39, + 50, 62, 75, 89, 104, 121, 138, 157, + 178, 199, 222, 246, 271, 297, 324, 353, + 383, 413, 446, 479, 513, 549, 586, 624, + 663, 703, 744, 787, 830, 875, 920, 967, + 1015, 1064, 1114, 1165, 1218, 1271, 1325, 1381, + 1437, 1494, 1553, 1612, 1673, 1734, 1796, 1859, + 1924, 1989, 2055, 2122, 2190, 2259, 2329, 2399, + 2471, 2543, 2617, 2691, 2765, 2841, 2918, 2995, + 3073, 3152, 3232, 3312, 3393, 3475, 3558, 3641, + 3725, 3809, 3895, 3980, 4067, 4154, 4242, 4330, + 4419, 4509, 4599, 4689, 4781, 4872, 4964, 5057, + 5150, 5244, 5338, 5432, 5527, 5622, 5718, 5814, + 5910, 6007, 6104, 6202, 6299, 6397, 6495, 6594, + 6693, 6791, 6891, 6990, 7090, 7189, 7289, 7389, + 7489, 7589, 7690, 7790, 7890, 7991, 8091, 8192, + 8293, 8393, 8494, 8594, 8694, 8795, 8895, 8995, + 9095, 9195, 9294, 9394, 9493, 9593, 9691, 9790, + 9889, 9987, 10085, 10182, 10280, 10377, 10474, 10570, +10666, 10762, 10857, 10952, 11046, 11140, 11234, 11327, +11420, 11512, 11603, 11695, 11785, 11875, 11965, 12054, +12142, 12230, 12317, 12404, 12489, 12575, 12659, 12743, +12826, 12909, 12991, 13072, 13152, 13232, 13311, 13389, +13466, 13543, 13619, 13693, 13767, 13841, 13913, 13985, +14055, 14125, 14194, 14262, 14329, 14395, 14460, 14525, +14588, 14650, 14711, 14772, 14831, 14890, 14947, 15003, +15059, 15113, 15166, 15219, 15270, 15320, 15369, 15417, +15464, 15509, 15554, 15597, 15640, 15681, 15721, 15760, +15798, 15835, 15871, 15905, 15938, 15971, 16001, 16031, +16060, 16087, 16113, 16138, 16162, 16185, 16206, 16227, +16246, 16263, 16280, 16295, 16309, 16322, 16334, 16345, +16354, 16362, 16369, 16374, 16378, 16382, 16383, 16384 +}; + +void WebRtcSpl_GetHanningWindow(WebRtc_Word16 *v, WebRtc_Word16 size) +{ + int jj; + WebRtc_Word16 *vptr1; + + WebRtc_Word32 index; + WebRtc_Word32 factor = ((WebRtc_Word32)0x40000000); + + factor = WebRtcSpl_DivW32W16(factor, size); + if (size < 513) + index = (WebRtc_Word32)-0x200000; + else + index = (WebRtc_Word32)-0x100000; + vptr1 = v; + + for (jj = 0; jj < size; jj++) + { + index += factor; + (*vptr1++) = kHanningTable[index >> 22]; + } + +} diff --git a/src/mod/codecs/mod_isac/get_scaling_square.c b/src/mod/codecs/mod_isac/get_scaling_square.c new file mode 100644 index 0000000000..dccbf334fd --- /dev/null +++ b/src/mod/codecs/mod_isac/get_scaling_square.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_GetScalingSquare(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +int WebRtcSpl_GetScalingSquare(WebRtc_Word16 *in_vector, int in_vector_length, int times) +{ + int nbits = WebRtcSpl_GetSizeInBits(times); + int i; + WebRtc_Word16 smax = -1; + WebRtc_Word16 sabs; + WebRtc_Word16 *sptr = in_vector; + int t; + int looptimes = in_vector_length; + + for (i = looptimes; i > 0; i--) + { + sabs = (*sptr > 0 ? *sptr++ : -*sptr++); + smax = (sabs > smax ? sabs : smax); + } + t = WebRtcSpl_NormW32(WEBRTC_SPL_MUL(smax, smax)); + + if (smax == 0) + { + return 0; // Since norm(0) returns 0 + } else + { + return (t > nbits) ? 0 : nbits - t; + } +} diff --git a/src/mod/codecs/mod_isac/ilbc_specific_functions.c b/src/mod/codecs/mod_isac/ilbc_specific_functions.c new file mode 100644 index 0000000000..5a9e5773b3 --- /dev/null +++ b/src/mod/codecs/mod_isac/ilbc_specific_functions.c @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains implementations of the iLBC specific functions + * WebRtcSpl_ScaleAndAddVectorsWithRound() + * WebRtcSpl_ReverseOrderMultArrayElements() + * WebRtcSpl_ElementwiseVectorMult() + * WebRtcSpl_AddVectorsAndShift() + * WebRtcSpl_AddAffineVectorToVector() + * WebRtcSpl_AffineTransformVector() + * + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_ScaleAndAddVectorsWithRound(WebRtc_Word16 *vector1, WebRtc_Word16 scale1, + WebRtc_Word16 *vector2, WebRtc_Word16 scale2, + WebRtc_Word16 right_shifts, WebRtc_Word16 *out, + WebRtc_Word16 vector_length) +{ + int i; + WebRtc_Word16 roundVal; + roundVal = 1 << right_shifts; + roundVal = roundVal >> 1; + for (i = 0; i < vector_length; i++) + { + out[i] = (WebRtc_Word16)((WEBRTC_SPL_MUL_16_16(vector1[i], scale1) + + WEBRTC_SPL_MUL_16_16(vector2[i], scale2) + roundVal) >> right_shifts); + } +} + +void WebRtcSpl_ReverseOrderMultArrayElements(WebRtc_Word16 *out, G_CONST WebRtc_Word16 *in, + G_CONST WebRtc_Word16 *win, + WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts) +{ + int i; + WebRtc_Word16 *outptr = out; + G_CONST WebRtc_Word16 *inptr = in; + G_CONST WebRtc_Word16 *winptr = win; + for (i = 0; i < vector_length; i++) + { + (*outptr++) = (WebRtc_Word16)WEBRTC_SPL_MUL_16_16_RSFT(*inptr++, + *winptr--, right_shifts); + } +} + +void WebRtcSpl_ElementwiseVectorMult(WebRtc_Word16 *out, G_CONST WebRtc_Word16 *in, + G_CONST WebRtc_Word16 *win, WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts) +{ + int i; + WebRtc_Word16 *outptr = out; + G_CONST WebRtc_Word16 *inptr = in; + G_CONST WebRtc_Word16 *winptr = win; + for (i = 0; i < vector_length; i++) + { + (*outptr++) = (WebRtc_Word16)WEBRTC_SPL_MUL_16_16_RSFT(*inptr++, + *winptr++, right_shifts); + } +} + +void WebRtcSpl_AddVectorsAndShift(WebRtc_Word16 *out, G_CONST WebRtc_Word16 *in1, + G_CONST WebRtc_Word16 *in2, WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts) +{ + int i; + WebRtc_Word16 *outptr = out; + G_CONST WebRtc_Word16 *in1ptr = in1; + G_CONST WebRtc_Word16 *in2ptr = in2; + for (i = vector_length; i > 0; i--) + { + (*outptr++) = (WebRtc_Word16)(((*in1ptr++) + (*in2ptr++)) >> right_shifts); + } +} + +void WebRtcSpl_AddAffineVectorToVector(WebRtc_Word16 *out, WebRtc_Word16 *in, + WebRtc_Word16 gain, WebRtc_Word32 add_constant, + WebRtc_Word16 right_shifts, int vector_length) +{ + WebRtc_Word16 *inPtr; + WebRtc_Word16 *outPtr; + int i; + + inPtr = in; + outPtr = out; + for (i = 0; i < vector_length; i++) + { + (*outPtr++) += (WebRtc_Word16)((WEBRTC_SPL_MUL_16_16((*inPtr++), gain) + + (WebRtc_Word32)add_constant) >> right_shifts); + } +} + +void WebRtcSpl_AffineTransformVector(WebRtc_Word16 *out, WebRtc_Word16 *in, + WebRtc_Word16 gain, WebRtc_Word32 add_constant, + WebRtc_Word16 right_shifts, int vector_length) +{ + WebRtc_Word16 *inPtr; + WebRtc_Word16 *outPtr; + int i; + + inPtr = in; + outPtr = out; + for (i = 0; i < vector_length; i++) + { + (*outPtr++) = (WebRtc_Word16)((WEBRTC_SPL_MUL_16_16((*inPtr++), gain) + + (WebRtc_Word32)add_constant) >> right_shifts); + } +} diff --git a/src/mod/codecs/mod_isac/intialize.c b/src/mod/codecs/mod_isac/intialize.c new file mode 100644 index 0000000000..6df034d1c7 --- /dev/null +++ b/src/mod/codecs/mod_isac/intialize.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* encode.c - Encoding function for the iSAC coder */ + +#include "structs.h" +#include "codec.h" +#include "pitch_estimator.h" + +#include + +void WebRtcIsac_InitMasking(MaskFiltstr *maskdata) { + + int k; + + for (k = 0; k < WINLEN; k++) { + maskdata->DataBufferLo[k] = 0.0; + maskdata->DataBufferHi[k] = 0.0; + } + for (k = 0; k < ORDERLO+1; k++) { + maskdata->CorrBufLo[k] = 0.0; + maskdata->PreStateLoF[k] = 0.0; + maskdata->PreStateLoG[k] = 0.0; + maskdata->PostStateLoF[k] = 0.0; + maskdata->PostStateLoG[k] = 0.0; + } + for (k = 0; k < ORDERHI+1; k++) { + maskdata->CorrBufHi[k] = 0.0; + maskdata->PreStateHiF[k] = 0.0; + maskdata->PreStateHiG[k] = 0.0; + maskdata->PostStateHiF[k] = 0.0; + maskdata->PostStateHiG[k] = 0.0; + } + + maskdata->OldEnergy = 10.0; + + /* fill tables for transforms */ + WebRtcIsac_InitTransform(); + + return; +} + +void WebRtcIsac_InitPreFilterbank(PreFiltBankstr *prefiltdata) +{ + int k; + + for (k = 0; k < QLOOKAHEAD; k++) { + prefiltdata->INLABUF1[k] = 0; + prefiltdata->INLABUF2[k] = 0; + + prefiltdata->INLABUF1_float[k] = 0; + prefiltdata->INLABUF2_float[k] = 0; + } + for (k = 0; k < 2*(QORDER-1); k++) { + prefiltdata->INSTAT1[k] = 0; + prefiltdata->INSTAT2[k] = 0; + prefiltdata->INSTATLA1[k] = 0; + prefiltdata->INSTATLA2[k] = 0; + + prefiltdata->INSTAT1_float[k] = 0; + prefiltdata->INSTAT2_float[k] = 0; + prefiltdata->INSTATLA1_float[k] = 0; + prefiltdata->INSTATLA2_float[k] = 0; + } + + /* High pass filter states */ + prefiltdata->HPstates[0] = 0.0; + prefiltdata->HPstates[1] = 0.0; + + prefiltdata->HPstates_float[0] = 0.0f; + prefiltdata->HPstates_float[1] = 0.0f; + + return; +} + +void WebRtcIsac_InitPostFilterbank(PostFiltBankstr *postfiltdata) +{ + int k; + + for (k = 0; k < 2*POSTQORDER; k++) { + postfiltdata->STATE_0_LOWER[k] = 0; + postfiltdata->STATE_0_UPPER[k] = 0; + + postfiltdata->STATE_0_LOWER_float[k] = 0; + postfiltdata->STATE_0_UPPER_float[k] = 0; + } + + /* High pass filter states */ + postfiltdata->HPstates1[0] = 0.0; + postfiltdata->HPstates1[1] = 0.0; + + postfiltdata->HPstates2[0] = 0.0; + postfiltdata->HPstates2[1] = 0.0; + + postfiltdata->HPstates1_float[0] = 0.0f; + postfiltdata->HPstates1_float[1] = 0.0f; + + postfiltdata->HPstates2_float[0] = 0.0f; + postfiltdata->HPstates2_float[1] = 0.0f; + + return; +} + + +void WebRtcIsac_InitPitchFilter(PitchFiltstr *pitchfiltdata) +{ + int k; + + for (k = 0; k < PITCH_BUFFSIZE; k++) { + pitchfiltdata->ubuf[k] = 0.0; + } + pitchfiltdata->ystate[0] = 0.0; + for (k = 1; k < (PITCH_DAMPORDER); k++) { + pitchfiltdata->ystate[k] = 0.0; + } + pitchfiltdata->oldlagp[0] = 50.0; + pitchfiltdata->oldgainp[0] = 0.0; +} + +void WebRtcIsac_InitWeightingFilter(WeightFiltstr *wfdata) +{ + int k; + double t, dtmp, dtmp2, denum, denum2; + + for (k=0;kbuffer[k]=0.0; + + for (k=0;kistate[k]=0.0; + wfdata->weostate[k]=0.0; + wfdata->whostate[k]=0.0; + } + + /* next part should be in Matlab, writing to a global table */ + t = 0.5; + denum = 1.0 / ((double) PITCH_WLPCWINLEN); + denum2 = denum * denum; + for (k=0;kwindow[k] = dtmp2 * dtmp2; + t++; + } +} + +/* clear all buffers */ +void WebRtcIsac_InitPitchAnalysis(PitchAnalysisStruct *State) +{ + int k; + + for (k = 0; k < PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2-PITCH_FRAME_LEN/2+2; k++) + State->dec_buffer[k] = 0.0; + for (k = 0; k < 2*ALLPASSSECTIONS+1; k++) + State->decimator_state[k] = 0.0; + for (k = 0; k < 2; k++) + State->hp_state[k] = 0.0; + for (k = 0; k < QLOOKAHEAD; k++) + State->whitened_buf[k] = 0.0; + for (k = 0; k < QLOOKAHEAD; k++) + State->inbuf[k] = 0.0; + + WebRtcIsac_InitPitchFilter(&(State->PFstr_wght)); + + WebRtcIsac_InitPitchFilter(&(State->PFstr)); + + WebRtcIsac_InitWeightingFilter(&(State->Wghtstr)); +} diff --git a/src/mod/codecs/mod_isac/isac.c b/src/mod/codecs/mod_isac/isac.c new file mode 100644 index 0000000000..2199d571f9 --- /dev/null +++ b/src/mod/codecs/mod_isac/isac.c @@ -0,0 +1,2797 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * isac.c + * + * This C file contains the functions for the ISAC API + * + */ + +#include "isac.h" +#include "bandwidth_estimator.h" +#include "crc.h" +#include "entropy_coding.h" +#include "codec.h" +#include "structs.h" +#include "signal_processing_library.h" +#include "lpc_shape_swb16_tables.h" +#include "os_specific_inline.h" + +#include +#include +#include +#include + +#define BIT_MASK_DEC_INIT 0x0001 +#define BIT_MASK_ENC_INIT 0x0002 + +#define LEN_CHECK_SUM_WORD8 4 +#define MAX_NUM_LAYERS 10 + + +/**************************************************************************** + * UpdatePayloadSizeLimit() + * + * Call this function to update the limit on the payload size. The limit on + * payload size might change i) if a user ''directly changes the limit by + * calling xxx_setMaxPayloadSize() or xxx_setMaxRate(), or ii) indirectly + * when bandwidth is changing. The latter might be the result of bandwidth + * adaptation, or direct change of the bottleneck in instantaneous mode. + * + * This function takes the current overall limit on payload, and translate it + * to the limits on lower and upper-band. If the codec is in wideband mode + * then the overall limit and the limit on the lower-band is the same. + * Otherwise, a fraction of the limit should be allocated to lower-band + * leaving some room for the upper-band bit-stream. That is why an update + * of limit is required every time that the bandwidth is changing. + * + */ +static void UpdatePayloadSizeLimit( + ISACMainStruct *instISAC) +{ + WebRtc_Word16 lim30MsPayloadBytes; + WebRtc_Word16 lim60MsPayloadBytes; + + lim30MsPayloadBytes = WEBRTC_SPL_MIN( + (instISAC->maxPayloadSizeBytes), + (instISAC->maxRateBytesPer30Ms)); + + lim60MsPayloadBytes = WEBRTC_SPL_MIN( + (instISAC->maxPayloadSizeBytes), + (instISAC->maxRateBytesPer30Ms << 1)); + + // The only time that iSAC will have 60 ms + // frame-size is when operating in wideband so + // there is no upper-band bit-stream + + if(instISAC->bandwidthKHz == isac8kHz) + { + // at 8 kHz there is no upper-band bit-stream + // therefore the lower-band limit is as the overall + // limit. + instISAC->instLB.ISACencLB_obj.payloadLimitBytes60 = + lim60MsPayloadBytes; + instISAC->instLB.ISACencLB_obj.payloadLimitBytes30 = + lim30MsPayloadBytes; + } + else + { + // when in super-wideband, we only have 30 ms frames + // Do a rate allocation for the given limit. + if(lim30MsPayloadBytes > 250) + { + // 4/5 to lower-band the rest for upper-band + instISAC->instLB.ISACencLB_obj.payloadLimitBytes30 = + (lim30MsPayloadBytes << 2) / 5; + } + else if(lim30MsPayloadBytes > 200) + { + // for the interval of 200 to 250 the share of + // upper-band linearly grows from 20 to 50; + instISAC->instLB.ISACencLB_obj.payloadLimitBytes30 = + (lim30MsPayloadBytes << 1) / 5 + 100; + } + else + { + // allocate only 20 for upper-band + instISAC->instLB.ISACencLB_obj.payloadLimitBytes30 = + lim30MsPayloadBytes - 20; + } + instISAC->instUB.ISACencUB_obj.maxPayloadSizeBytes = + lim30MsPayloadBytes; + } +} + + +/**************************************************************************** + * UpdateBottleneck() + * + * This function updates the bottleneck only if the codec is operating in + * channel-adaptive mode. Furthermore, as the update of bottleneck might + * result in an update of bandwidth, therefore, the bottlenech should be + * updated just right before the first 10ms of a frame is pushed into encoder. + * + */ +static void UpdateBottleneck( + ISACMainStruct *instISAC) +{ + // read the bottleneck from bandwidth estimator for the + // first 10 ms audio. This way, if there is a change + // in bandwidth upper and lower-band will be in sync. + if((instISAC->codingMode == 0) && + (instISAC->instLB.ISACencLB_obj.buffer_index == 0) && + (instISAC->instLB.ISACencLB_obj.frame_nb == 0)) + { + WebRtc_Word32 bottleneck; + WebRtcIsac_GetUplinkBandwidth(&(instISAC->bwestimator_obj), + &bottleneck); + + // Adding hysteresis when increasing signal bandwidth + if((instISAC->bandwidthKHz == isac8kHz) + && (bottleneck > 37000) + && (bottleneck < 41000)) + { + bottleneck = 37000; + } + + // switching from 12 kHz to 16 kHz is not allowed at this revision + // If we let this happen, we have to take care of buffer_index and + // the last LPC vector. + if((instISAC->bandwidthKHz != isac16kHz) && + (bottleneck > 46000)) + { + bottleneck = 46000; + } + + // we might need a rate allocation. + if(instISAC->encoderSamplingRateKHz == kIsacWideband) + { + // wideband is the only choise we have here. + instISAC->instLB.ISACencLB_obj.bottleneck = + (bottleneck > 32000)? 32000:bottleneck; + instISAC->bandwidthKHz = isac8kHz; + } + else + { + // do the rate-allosation and get the new bandwidth. + enum ISACBandwidth bandwidth; + WebRtcIsac_RateAllocation(bottleneck, + &(instISAC->instLB.ISACencLB_obj.bottleneck), + &(instISAC->instUB.ISACencUB_obj.bottleneck), + &bandwidth); + if(bandwidth != isac8kHz) + { + instISAC->instLB.ISACencLB_obj.new_framelength = 480; + } + if(bandwidth != instISAC->bandwidthKHz) + { + // bandwidth is changing. + instISAC->bandwidthKHz = bandwidth; + UpdatePayloadSizeLimit(instISAC); + if(bandwidth == isac12kHz) + { + instISAC->instLB.ISACencLB_obj.buffer_index = 0; + } + // currently we don't let the bandwidth to switch to 16 kHz + // if in adaptive mode. If we let this happen, we have to take + // car of buffer_index and the last LPC vector. + } + } + } +} + + +/**************************************************************************** + * GetSendBandwidthInfo() + * + * This is called to get the bandwidth info. This info is the bandwidth and + * and the jitter of 'there-to-here' channel, estimated 'here.' These info + * is signaled in an in-band fashion to the otherside. + * + * The call to the bandwidth estimator trigers a recursive averaging which + * has to be synchronized between encoder & decoder, therefore. The call to + * BWE should be once per packet. As the BWE info is inserted into bit-stream + * we need a valid info right before the encodeLB function is going to + * generating a bit-stream. That is when lower-band buffer has already 20ms + * of audio, and the 3rd block of 10ms is going to be injected into encoder. + * + * Inputs: + * - instISAC : iSAC instance. + * + * Outputs: + * - bandwidthIndex : an index which has to be encoded in + * lower-band bit-stream, indicating the + * bandwidth of there-to-here channel. + * - jitterInfo : this indicates if the jitter is high + * or low and it is encoded in upper-band + * bit-stream. + * + */ +static void GetSendBandwidthInfo( + ISACMainStruct* instISAC, + WebRtc_Word16* bandwidthIndex, + WebRtc_Word16* jitterInfo) +{ + if((instISAC->instLB.ISACencLB_obj.buffer_index == + (FRAMESAMPLES_10ms << 1)) && + (instISAC->instLB.ISACencLB_obj.frame_nb == 0)) + { + /* bandwidth estimation and coding */ + WebRtcIsac_GetDownlinkBwJitIndexImpl(&(instISAC->bwestimator_obj), + bandwidthIndex, jitterInfo, instISAC->decoderSamplingRateKHz); + } +} + + +/**************************************************************************** + * WebRtcIsac_AssignSize(...) + * + * This function returns the size of the ISAC instance, so that the instance + * can be created out side iSAC. + * + * Output: + * - sizeinbytes : number of bytes needed to allocate for the + * instance. + * + * Return value : 0 - Ok + * -1 - Error + */ +WebRtc_Word16 WebRtcIsac_AssignSize( + int *sizeInBytes) +{ + *sizeInBytes = sizeof(ISACMainStruct) * 2 / sizeof(WebRtc_Word16); + return 0; +} + + +/**************************************************************************** + * WebRtcIsac_Assign(...) + * + * This function assignes the memory already created to the ISAC instance. + * + * Input: + * - ISAC_main_inst : address of the pointer to the coder instance. + * - instISAC_Addr : the already allocaded memeory, where we put the + * iSAC struct + * + * Return value : 0 - Ok + * -1 - Error + */ +WebRtc_Word16 WebRtcIsac_Assign( + ISACStruct** ISAC_main_inst, + void* instISAC_Addr) +{ + if(instISAC_Addr != NULL) + { + ISACMainStruct* instISAC = (ISACMainStruct*)instISAC_Addr; + instISAC->errorCode = 0; + instISAC->initFlag = 0; + + // Assign the address + *ISAC_main_inst = (ISACStruct*)instISAC_Addr; + + // Default is wideband. + instISAC->encoderSamplingRateKHz = kIsacWideband; + instISAC->decoderSamplingRateKHz = kIsacWideband; + instISAC->bandwidthKHz = isac8kHz; + return 0; + } + else + { + return -1; + } +} + + +/**************************************************************************** + * WebRtcIsac_Create(...) + * + * This function creates an ISAC instance, which will contain the state + * information for one coding/decoding channel. + * + * Input: + * - ISAC_main_inst : address of the pointer to the coder instance. + * + * Return value : 0 - Ok + * -1 - Error + */ +WebRtc_Word16 WebRtcIsac_Create( + ISACStruct** ISAC_main_inst) +{ + ISACMainStruct* instISAC; + + instISAC = (ISACMainStruct*)WEBRTC_SPL_VNEW(ISACMainStruct, 1); + *ISAC_main_inst = (ISACStruct*)instISAC; + if(*ISAC_main_inst != NULL) + { + instISAC->errorCode = 0; + instISAC->initFlag = 0; + // Default is wideband + instISAC->bandwidthKHz = isac8kHz; + instISAC->encoderSamplingRateKHz = kIsacWideband; + instISAC->decoderSamplingRateKHz = kIsacWideband; + return 0; + } + else + { + return -1; + } +} + + +/**************************************************************************** + * WebRtcIsac_Free(...) + * + * This function frees the ISAC instance created at the beginning. + * + * Input: + * - ISAC_main_inst : a ISAC instance. + * + * Return value : 0 - Ok + * -1 - Error + */ +WebRtc_Word16 WebRtcIsac_Free( + ISACStruct* ISAC_main_inst) +{ + ISACMainStruct* instISAC; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + WEBRTC_SPL_FREE(instISAC); + return 0; +} + + +/**************************************************************************** + * EncoderInitLb(...) - internal function for initialization of + * Lower Band + * EncoderInitUb(...) - internal function for initialization of + * Upper Band + * WebRtcIsac_EncoderInit(...) - API function + * + * This function initializes a ISAC instance prior to the encoder calls. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - CodingMode : 0 -> Bit rate and frame length are automatically + * adjusted to available bandwidth on + * transmission channel, applicable just to + * wideband mode. + * 1 -> User sets a frame length and a target bit + * rate which is taken as the maximum + * short-term average bit rate. + * + * Return value : 0 - Ok + * -1 - Error + */ +static WebRtc_Word16 EncoderInitLb( + ISACLBStruct* instLB, + WebRtc_Word16 codingMode, + enum IsacSamplingRate sampRate) +{ + WebRtc_Word16 statusInit = 0; + int k; + + /* Init stream vector to zero */ + for(k=0; k < STREAM_SIZE_MAX_60; k++) + { + instLB->ISACencLB_obj.bitstr_obj.stream[k] = 0; + } + + if((codingMode == 1) || (sampRate == kIsacSuperWideband)) + { + // 30 ms frame-size if either in super-wideband or + // instanteneous mode (I-mode) + instLB->ISACencLB_obj.new_framelength = 480; + } + else + { + instLB->ISACencLB_obj.new_framelength = INITIAL_FRAMESAMPLES; + } + + WebRtcIsac_InitMasking(&instLB->ISACencLB_obj.maskfiltstr_obj); + WebRtcIsac_InitPreFilterbank(&instLB->ISACencLB_obj.prefiltbankstr_obj); + WebRtcIsac_InitPitchFilter(&instLB->ISACencLB_obj.pitchfiltstr_obj); + WebRtcIsac_InitPitchAnalysis( + &instLB->ISACencLB_obj.pitchanalysisstr_obj); + + + instLB->ISACencLB_obj.buffer_index = 0; + instLB->ISACencLB_obj.frame_nb = 0; + /* default for I-mode */ + instLB->ISACencLB_obj.bottleneck = 32000; + instLB->ISACencLB_obj.current_framesamples = 0; + instLB->ISACencLB_obj.s2nr = 0; + instLB->ISACencLB_obj.payloadLimitBytes30 = STREAM_SIZE_MAX_30; + instLB->ISACencLB_obj.payloadLimitBytes60 = STREAM_SIZE_MAX_60; + instLB->ISACencLB_obj.maxPayloadBytes = STREAM_SIZE_MAX_60; + instLB->ISACencLB_obj.maxRateInBytes = STREAM_SIZE_MAX_30; + instLB->ISACencLB_obj.enforceFrameSize = 0; + /* invalid value prevents getRedPayload to + run before encoder is called */ + instLB->ISACencLB_obj.lastBWIdx = -1; + return statusInit; +} + +static WebRtc_Word16 EncoderInitUb( + ISACUBStruct* instUB, + WebRtc_Word16 bandwidth) +{ + WebRtc_Word16 statusInit = 0; + int k; + + /* Init stream vector to zero */ + for(k = 0; k < STREAM_SIZE_MAX_60; k++) + { + instUB->ISACencUB_obj.bitstr_obj.stream[k] = 0; + } + + WebRtcIsac_InitMasking(&instUB->ISACencUB_obj.maskfiltstr_obj); + WebRtcIsac_InitPreFilterbank(&instUB->ISACencUB_obj.prefiltbankstr_obj); + + if(bandwidth == isac16kHz) + { + instUB->ISACencUB_obj.buffer_index = LB_TOTAL_DELAY_SAMPLES; + } + else + { + instUB->ISACencUB_obj.buffer_index = 0; + } + /* default for I-mode */ + instUB->ISACencUB_obj.bottleneck = 32000; + // These store the limits for the wideband + super-wideband bit-stream. + instUB->ISACencUB_obj.maxPayloadSizeBytes = STREAM_SIZE_MAX_30 << 1; + // This has to be updated after each lower-band encoding to guarantee + // a correct payload-limitation. + instUB->ISACencUB_obj.numBytesUsed = 0; + memset(instUB->ISACencUB_obj.data_buffer_float, 0, + (MAX_FRAMESAMPLES + LB_TOTAL_DELAY_SAMPLES) * sizeof(float)); + + memcpy(&(instUB->ISACencUB_obj.lastLPCVec), + WebRtcIsac_kMeanLarUb16, sizeof(double) * UB_LPC_ORDER); + + return statusInit; +} + + +WebRtc_Word16 WebRtcIsac_EncoderInit( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 codingMode) +{ + ISACMainStruct *instISAC; + WebRtc_Word16 status; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + + if((codingMode != 0) && (codingMode != 1)) + { + instISAC->errorCode = ISAC_DISALLOWED_CODING_MODE; + return -1; + } + // default bottleneck + instISAC->bottleneck = MAX_ISAC_BW; + + if(instISAC->encoderSamplingRateKHz == kIsacWideband) + { + instISAC->bandwidthKHz = isac8kHz; + instISAC->maxPayloadSizeBytes = STREAM_SIZE_MAX_60; + instISAC->maxRateBytesPer30Ms = STREAM_SIZE_MAX_30; + } + else + { + instISAC->bandwidthKHz = isac16kHz; + instISAC->maxPayloadSizeBytes = STREAM_SIZE_MAX; + instISAC->maxRateBytesPer30Ms = STREAM_SIZE_MAX; + } + + // Channel-adaptive = 0; Instantaneous (Channel-independent) = 1; + instISAC->codingMode = codingMode; + + WebRtcIsac_InitBandwidthEstimator(&instISAC->bwestimator_obj, + instISAC->encoderSamplingRateKHz, + instISAC->decoderSamplingRateKHz); + + WebRtcIsac_InitRateModel(&instISAC->rate_data_obj); + /* default for I-mode */ + instISAC->MaxDelay = 10.0; + + status = EncoderInitLb(&instISAC->instLB, codingMode, + instISAC->encoderSamplingRateKHz); + if(status < 0) + { + instISAC->errorCode = -status; + return -1; + } + + if(instISAC->encoderSamplingRateKHz == kIsacSuperWideband) + { + // Initialize encoder filter-bank. + memset(instISAC->analysisFBState1, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + memset(instISAC->analysisFBState2, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + + status = EncoderInitUb(&(instISAC->instUB), + instISAC->bandwidthKHz); + if(status < 0) + { + instISAC->errorCode = -status; + return -1; + } + } + // Initializtion is successful, set the flag + instISAC->initFlag |= BIT_MASK_ENC_INIT; + return 0; +} + + +/**************************************************************************** + * WebRtcIsac_Encode(...) + * + * This function encodes 10ms frame(s) and inserts it into a package. + * Input speech length has to be 160 samples (10ms). The encoder buffers those + * 10ms frames until it reaches the chosen Framesize (480 or 960 samples + * corresponding to 30 or 60 ms frames), and then proceeds to the encoding. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - speechIn : input speech vector. + * + * Output: + * - encoded : the encoded data vector + * + * Return value: + * : >0 - Length (in bytes) of coded data + * : 0 - The buffer didn't reach the chosen + * frameSize so it keeps buffering speech + * samples. + * : -1 - Error + */ +WebRtc_Word16 WebRtcIsac_Encode( + ISACStruct* ISAC_main_inst, + const WebRtc_Word16* speechIn, + WebRtc_Word16* encoded) +{ + ISACMainStruct* instISAC; + ISACLBStruct* instLB; + ISACUBStruct* instUB; + + float inFrame[FRAMESAMPLES_10ms]; + WebRtc_Word16 speechInLB[FRAMESAMPLES_10ms]; + WebRtc_Word16 speechInUB[FRAMESAMPLES_10ms]; + WebRtc_Word16 streamLenLB; + WebRtc_Word16 streamLenUB; + WebRtc_Word16 streamLen; + WebRtc_Word16 k; + WebRtc_UWord8* ptrEncodedUW8 = (WebRtc_UWord8*)encoded; + int garbageLen; + WebRtc_Word32 bottleneck; + WebRtc_Word16 bottleneckIdx = 0; + WebRtc_Word16 jitterInfo = 0; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + instLB = &(instISAC->instLB); + instUB = &(instISAC->instUB); + + /* check if encoder initiated */ + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + return -1; + } + + if(instISAC->encoderSamplingRateKHz == kIsacSuperWideband) + { + WebRtcSpl_AnalysisQMF(speechIn, speechInLB, speechInUB, + instISAC->analysisFBState1, instISAC->analysisFBState2); + + /* convert from fixed to floating point */ + for(k = 0; k < FRAMESAMPLES_10ms; k++) + { + inFrame[k] = (float)speechInLB[k]; + } + } + else + { + for(k = 0; k < FRAMESAMPLES_10ms; k++) + { + inFrame[k] = (float) speechIn[k]; + } + } + + /* add some noise to avoid denormal numbers */ + inFrame[0] += (float)1.23455334e-3; + inFrame[1] -= (float)2.04324239e-3; + inFrame[2] += (float)1.90854954e-3; + inFrame[9] += (float)1.84854878e-3; + + + // This function will update the bottleneck if required + UpdateBottleneck(instISAC); + + // Get the bandwith information which has to be sent to the other side + GetSendBandwidthInfo(instISAC, &bottleneckIdx, &jitterInfo); + + // + // ENCODE LOWER-BAND + // + streamLenLB = WebRtcIsac_EncodeLb(inFrame, &instLB->ISACencLB_obj, + instISAC->codingMode, bottleneckIdx); + + if(streamLenLB < 0) + { + return -1; + } + + if(instISAC->encoderSamplingRateKHz == kIsacSuperWideband) + { + instUB = &(instISAC->instUB); + + // convert to float + for(k = 0; k < FRAMESAMPLES_10ms; k++) + { + inFrame[k] = (float) speechInUB[k]; + } + + /* add some noise to avoid denormal numbers */ + inFrame[0] += (float)1.23455334e-3; + inFrame[1] -= (float)2.04324239e-3; + inFrame[2] += (float)1.90854954e-3; + inFrame[9] += (float)1.84854878e-3; + + // Tell to upper-band the number of bytes used so far. + // This is for payload limitation. + instUB->ISACencUB_obj.numBytesUsed = streamLenLB + 1 + + LEN_CHECK_SUM_WORD8; + + // + // ENCODE UPPER-BAND + // + switch(instISAC->bandwidthKHz) + { + case isac12kHz: + { + streamLenUB = WebRtcIsac_EncodeUb12(inFrame, + &instUB->ISACencUB_obj, + jitterInfo); + break; + } + case isac16kHz: + { + streamLenUB = WebRtcIsac_EncodeUb16(inFrame, + &instUB->ISACencUB_obj, + jitterInfo); + break; + } + case isac8kHz: + { + streamLenUB = 0; + break; + } + default: + return -1; + } + + if((streamLenUB < 0) && + (streamLenUB != -ISAC_PAYLOAD_LARGER_THAN_LIMIT)) + { + // an error has happened but this is not the error due to a + // bit-stream larger than the limit + return -1; + } + + if(streamLenLB == 0) + { + return 0; + } + + // One bite is allocated for the length. According to older decoders + // so the length bit-stream plus one byte for size and + // LEN_CHECK_SUM_WORD8 for the checksum should be less than or equal + // to 255. + if((streamLenUB > (255 - (LEN_CHECK_SUM_WORD8 + 1))) || + (streamLenUB == -ISAC_PAYLOAD_LARGER_THAN_LIMIT)) + { + // we have got a too long bit-stream we skip the upper-band + // bit-stream for this frame. + streamLenUB = 0; + } + + memcpy(ptrEncodedUW8, instLB->ISACencLB_obj.bitstr_obj.stream, + streamLenLB); + streamLen = streamLenLB; + if(streamLenUB > 0) + { + ptrEncodedUW8[streamLenLB] = (WebRtc_UWord8)(streamLenUB + 1 + + LEN_CHECK_SUM_WORD8); + memcpy(&ptrEncodedUW8[streamLenLB + 1], + instUB->ISACencUB_obj.bitstr_obj.stream, streamLenUB); + streamLen += ptrEncodedUW8[streamLenLB]; + } + else + { + ptrEncodedUW8[streamLenLB] = 0; + } + } + else + { + if(streamLenLB == 0) + { + return 0; + } + memcpy(ptrEncodedUW8, instLB->ISACencLB_obj.bitstr_obj.stream, + streamLenLB); + streamLenUB = 0; + streamLen = streamLenLB; + } + + // Add Garbage if required. + WebRtcIsac_GetUplinkBandwidth(&instISAC->bwestimator_obj, &bottleneck); + if(instISAC->codingMode == 0) + { + int minBytes; + int limit; + WebRtc_UWord8* ptrGarbage; + + instISAC->MaxDelay = (double)WebRtcIsac_GetUplinkMaxDelay( + &instISAC->bwestimator_obj); + + /* update rate model and get minimum number of bytes in this packet */ + minBytes = WebRtcIsac_GetMinBytes(&(instISAC->rate_data_obj), + streamLen, instISAC->instLB.ISACencLB_obj.current_framesamples, + bottleneck, instISAC->MaxDelay, instISAC->bandwidthKHz); + + /* Make sure MinBytes does not exceed packet size limit */ + if(instISAC->bandwidthKHz == isac8kHz) + { + if(instLB->ISACencLB_obj.current_framesamples == FRAMESAMPLES) + { + limit = instLB->ISACencLB_obj.payloadLimitBytes30; + } + else + { + limit = instLB->ISACencLB_obj.payloadLimitBytes60; + } + } + else + { + limit = instUB->ISACencUB_obj.maxPayloadSizeBytes; + } + minBytes = (minBytes > limit)? limit:minBytes; + + /* Make sure we don't allow more than 255 bytes of garbage data. + We store the length of the garbage data in 8 bits in the bitstream, + 255 is the max garbage length we can signal using 8 bits. */ + if((instISAC->bandwidthKHz == isac8kHz) || + (streamLenUB == 0)) + { + ptrGarbage = &ptrEncodedUW8[streamLenLB]; + limit = streamLen + 255; + } + else + { + ptrGarbage = &ptrEncodedUW8[streamLenLB + 1 + streamLenUB]; + limit = streamLen + (255 - ptrEncodedUW8[streamLenLB]); + } + minBytes = (minBytes > limit)? limit:minBytes; + + garbageLen = (minBytes > streamLen)? (minBytes - streamLen):0; + + /* Save data for creation of multiple bitstreams */ + //ISACencLB_obj->SaveEnc_obj.minBytes = MinBytes; + + /* if bitstream is too short, add garbage at the end */ + if(garbageLen > 0) + { + for(k = 0; k < garbageLen; k++) + { + ptrGarbage[k] = (WebRtc_UWord8)(rand() & 0xFF); + } + + // for a correct length of the upper-band bit-stream together + // with the garbage. Garbage is embeded in upper-band bit-stream. + // That is the only way to preserve backward compatibility. + if((instISAC->bandwidthKHz == isac8kHz) || + (streamLenUB == 0)) + { + ptrEncodedUW8[streamLenLB] = (WebRtc_UWord8)garbageLen; + } + else + { + ptrEncodedUW8[streamLenLB] += (WebRtc_UWord8)garbageLen; + // write the length of the garbage at the end of the upper-band + // bit-stream, if exists. This helps for sanity check. + ptrEncodedUW8[streamLenLB + 1 + streamLenUB] = (WebRtc_UWord8)garbageLen; + + } + + streamLen += garbageLen; + } + } + else + { + /* update rate model */ + WebRtcIsac_UpdateRateModel(&instISAC->rate_data_obj, streamLen, + instISAC->instLB.ISACencLB_obj.current_framesamples, bottleneck); + garbageLen = 0; + } + + // Generate CRC if required. + if((instISAC->bandwidthKHz != isac8kHz) && + (streamLenUB > 0)) + { + WebRtc_UWord32 crc; + + WebRtcIsac_GetCrc((WebRtc_Word16*)(&(ptrEncodedUW8[streamLenLB + 1])), + streamLenUB + garbageLen, &crc); +#ifndef WEBRTC_BIG_ENDIAN + for(k = 0; k < LEN_CHECK_SUM_WORD8; k++) + { + ptrEncodedUW8[streamLen - LEN_CHECK_SUM_WORD8 + k] = + (WebRtc_UWord8)((crc >> (24 - k * 8)) & 0xFF); + } +#else + memcpy(&ptrEncodedUW8[streamLenLB + streamLenUB + 1], &crc, + LEN_CHECK_SUM_WORD8); +#endif + } + + return streamLen; +} + + +/****************************************************************************** + * WebRtcIsac_GetNewBitStream(...) + * + * This function returns encoded data, with the recieved bwe-index in the + * stream. If the rate is set to a value less than bottleneck of codec + * the new bistream will be re-encoded with the given target rate. + * It should always return a complete packet, i.e. only called once + * even for 60 msec frames. + * + * NOTE 1! This function does not write in the ISACStruct, it is not allowed. + * NOTE 3! Rates larger than the bottleneck of the codec will be limited + * to the current bottleneck. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - bweIndex : Index of bandwidth estimate to put in new + * bitstream + * - rate : target rate of the transcoder is bits/sec. + * Valid values are the accepted rate in iSAC, + * i.e. 10000 to 56000. + * + * Output: + * - encoded : The encoded data vector + * + * Return value : >0 - Length (in bytes) of coded data + * -1 - Error or called in SWB mode + * NOTE! No error code is written to + * the struct since it is only allowed to read + * the struct. + */ +WebRtc_Word16 WebRtcIsac_GetNewBitStream( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 bweIndex, + WebRtc_Word16 jitterInfo, + WebRtc_Word32 rate, + WebRtc_Word16* encoded, + WebRtc_Word16 isRCU) +{ + Bitstr iSACBitStreamInst; /* Local struct for bitstream handling */ + WebRtc_Word16 streamLenLB; + WebRtc_Word16 streamLenUB; + WebRtc_Word16 totalStreamLen; + double gain2; + double gain1; + float scale; + enum ISACBandwidth bandwidthKHz; + double rateLB; + double rateUB; + WebRtc_Word32 currentBN; + ISACMainStruct* instISAC; + WebRtc_UWord8* encodedPtrUW8 = (WebRtc_UWord8*)encoded; + WebRtc_UWord32 crc; +#ifndef WEBRTC_BIG_ENDIAN + WebRtc_Word16 k; +#endif + + instISAC = (ISACMainStruct*)ISAC_main_inst; + + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + return -1; + } + + // Get the bottleneck of this iSAC and limit the + // given rate to the current bottleneck. + WebRtcIsac_GetUplinkBw(ISAC_main_inst, ¤tBN); + if(rate > currentBN) + { + rate = currentBN; + } + + if(WebRtcIsac_RateAllocation(rate, &rateLB, &rateUB, &bandwidthKHz) < 0) + { + return -1; + } + + // Cannot transcode from 16 kHz to 12 kHz + if((bandwidthKHz == isac12kHz) && + (instISAC->bandwidthKHz == isac16kHz)) + { + return -1; + } + + // These gains are in dB + // gain for the given rate. + gain1 = WebRtcIsac_GetSnr(rateLB, + instISAC->instLB.ISACencLB_obj.current_framesamples); + // gain of this iSAC + gain2 = WebRtcIsac_GetSnr( + instISAC->instLB.ISACencLB_obj.bottleneck, + instISAC->instLB.ISACencLB_obj.current_framesamples); + + // scale is the ratio of two gains in normal domain. + scale = (float)pow(10, (gain1 - gain2) / 20.0); + // change the scale if this is a RCU bit-stream. + scale = (isRCU)? (scale * RCU_TRANSCODING_SCALE):scale; + + streamLenLB = WebRtcIsac_EncodeStoredDataLb( + &instISAC->instLB.ISACencLB_obj.SaveEnc_obj, &iSACBitStreamInst, + bweIndex, scale); + + if(streamLenLB < 0) + { + return -1; + } + + /* convert from bytes to WebRtc_Word16 */ + memcpy(encoded, iSACBitStreamInst.stream, streamLenLB); + + if(bandwidthKHz == isac8kHz) + { + return streamLenLB; + } + + totalStreamLen = streamLenLB; + // super-wideband is always at 30ms. + // These gains are in dB + // gain for the given rate. + gain1 = WebRtcIsac_GetSnr(rateUB, FRAMESAMPLES); + // gain of this iSAC + gain2 = WebRtcIsac_GetSnr( + instISAC->instUB.ISACencUB_obj.bottleneck, FRAMESAMPLES); + + // scale is the ratio of two gains in normal domain. + scale = (float)pow(10, (gain1 - gain2) / 20.0); + + // change the scale if this is a RCU bit-stream. + scale = (isRCU)? (scale * RCU_TRANSCODING_SCALE_UB):scale; + + switch(instISAC->bandwidthKHz) + { + case isac12kHz: + { + streamLenUB = WebRtcIsac_EncodeStoredDataUb12( + &(instISAC->instUB.ISACencUB_obj.SaveEnc_obj), + &iSACBitStreamInst, jitterInfo, scale); + break; + } + case isac16kHz: + { + streamLenUB = WebRtcIsac_EncodeStoredDataUb16( + &(instISAC->instUB.ISACencUB_obj.SaveEnc_obj), + &iSACBitStreamInst, jitterInfo, scale); + break; + } + default: + return -1; + } + + if(streamLenUB < 0) + { + return -1; + } + + if(streamLenUB + 1 + LEN_CHECK_SUM_WORD8 > 255) + { + return streamLenLB; + } + + totalStreamLen = streamLenLB + streamLenUB + 1 + LEN_CHECK_SUM_WORD8; + encodedPtrUW8[streamLenLB] = streamLenUB + 1 + LEN_CHECK_SUM_WORD8; + + memcpy(&encodedPtrUW8[streamLenLB+1], iSACBitStreamInst.stream, + streamLenUB); + + WebRtcIsac_GetCrc((WebRtc_Word16*)(&(encodedPtrUW8[streamLenLB + 1])), + streamLenUB, &crc); +#ifndef WEBRTC_BIG_ENDIAN + for(k = 0; k < LEN_CHECK_SUM_WORD8; k++) + { + encodedPtrUW8[totalStreamLen - LEN_CHECK_SUM_WORD8 + k] = + (WebRtc_UWord8)((crc >> (24 - k * 8)) & 0xFF); + } +#else + memcpy(&encodedPtrUW8[streamLenLB + streamLenUB + 1], &crc, + LEN_CHECK_SUM_WORD8); +#endif + + + return totalStreamLen; +} + + +/**************************************************************************** + * DecoderInitLb(...) - internal function for initialization of + * Lower Band + * DecoderInitUb(...) - internal function for initialization of + * Upper Band + * WebRtcIsac_DecoderInit(...) - API function + * + * This function initializes a ISAC instance prior to the decoder calls. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * + * Return value + * : 0 - Ok + * -1 - Error + */ +static WebRtc_Word16 DecoderInitLb( + ISACLBStruct* instISAC) +{ + int i; + /* Init stream vector to zero */ + for (i=0; iISACdecLB_obj.bitstr_obj.stream[i] = 0; + } + + WebRtcIsac_InitMasking(&instISAC->ISACdecLB_obj.maskfiltstr_obj); + WebRtcIsac_InitPostFilterbank( + &instISAC->ISACdecLB_obj.postfiltbankstr_obj); + WebRtcIsac_InitPitchFilter(&instISAC->ISACdecLB_obj.pitchfiltstr_obj); + + return (0); +} + +static WebRtc_Word16 DecoderInitUb( + ISACUBStruct* instISAC) +{ + int i; + /* Init stream vector to zero */ + for (i = 0; i < STREAM_SIZE_MAX_60; i++) + { + instISAC->ISACdecUB_obj.bitstr_obj.stream[i] = 0; + } + + WebRtcIsac_InitMasking(&instISAC->ISACdecUB_obj.maskfiltstr_obj); + WebRtcIsac_InitPostFilterbank( + &instISAC->ISACdecUB_obj.postfiltbankstr_obj); + return (0); +} + +WebRtc_Word16 WebRtcIsac_DecoderInit( + ISACStruct *ISAC_main_inst) +{ + ISACMainStruct* instISAC; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + + if(DecoderInitLb(&instISAC->instLB) < 0) + { + return -1; + } + + if(instISAC->decoderSamplingRateKHz == kIsacSuperWideband) + { + memset(instISAC->synthesisFBState1, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + memset(instISAC->synthesisFBState2, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + + if(DecoderInitUb(&(instISAC->instUB)) < 0) + { + return -1; + } + } + + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + WebRtcIsac_InitBandwidthEstimator(&instISAC->bwestimator_obj, + instISAC->encoderSamplingRateKHz, + instISAC->decoderSamplingRateKHz); + } + + instISAC->initFlag |= BIT_MASK_DEC_INIT; + + instISAC->resetFlag_8kHz = 0; + + return 0; +} + + +/**************************************************************************** + * WebRtcIsac_UpdateBwEstimate(...) + * + * This function updates the estimate of the bandwidth. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - encoded : encoded ISAC frame(s). + * - packet_size : size of the packet. + * - rtp_seq_number : the RTP number of the packet. + * - arr_ts : the arrival time of the packet (from NetEq) + * in samples. + * + * Return value : 0 - Ok + * -1 - Error + */ +WebRtc_Word16 WebRtcIsac_UpdateBwEstimate( + ISACStruct* ISAC_main_inst, + const WebRtc_UWord16* encoded, + WebRtc_Word32 packet_size, + WebRtc_UWord16 rtp_seq_number, + WebRtc_UWord32 send_ts, + WebRtc_UWord32 arr_ts) +{ + ISACMainStruct *instISAC; + Bitstr streamdata; +#ifndef WEBRTC_BIG_ENDIAN + int k; +#endif + WebRtc_Word16 err; + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct *)ISAC_main_inst; + + /* check if decoder initiated */ + if((instISAC->initFlag & BIT_MASK_DEC_INIT) != + BIT_MASK_DEC_INIT) + { + instISAC->errorCode = ISAC_DECODER_NOT_INITIATED; + return -1; + } + + if(packet_size <= 0) + { + /* return error code if the packet length is null */ + instISAC->errorCode = ISAC_EMPTY_PACKET; + return -1; + } + + streamdata.W_upper = 0xFFFFFFFF; + streamdata.streamval = 0; + streamdata.stream_index = 0; + +#ifndef WEBRTC_BIG_ENDIAN + for(k = 0; k < 10; k++) + { + streamdata.stream[k] = (WebRtc_UWord8) ((encoded[k>>1] >> + ((k&1) << 3)) & 0xFF); + } +#else + memcpy(streamdata.stream, encoded, 10); +#endif + + err = WebRtcIsac_EstimateBandwidth(&instISAC->bwestimator_obj, &streamdata, + packet_size, rtp_seq_number, send_ts, arr_ts, + instISAC->encoderSamplingRateKHz, + instISAC->decoderSamplingRateKHz); + + if(err < 0) + { + /* return error code if something went wrong */ + instISAC->errorCode = -err; + return -1; + } + + return 0; +} + +static WebRtc_Word16 Decode( + ISACStruct* ISAC_main_inst, + const WebRtc_UWord16* encoded, + WebRtc_Word16 lenEncodedBytes, + WebRtc_Word16* decoded, + WebRtc_Word16* speechType, + WebRtc_Word16 isRCUPayload) +{ + /* number of samples (480 or 960), output from decoder + that were actually used in the encoder/decoder + (determined on the fly) */ + ISACMainStruct* instISAC; + ISACUBDecStruct* decInstUB; + ISACLBDecStruct* decInstLB; + + WebRtc_Word16 numSamplesLB; + WebRtc_Word16 numSamplesUB; + WebRtc_Word16 speechIdx; + float outFrame[MAX_FRAMESAMPLES]; + WebRtc_Word16 outFrameLB[MAX_FRAMESAMPLES]; + WebRtc_Word16 outFrameUB[MAX_FRAMESAMPLES]; + WebRtc_Word16 numDecodedBytesLB; + WebRtc_Word16 numDecodedBytesUB; + WebRtc_Word16 lenEncodedLBBytes; + WebRtc_Word16 validChecksum = 1; + WebRtc_Word16 k; + WebRtc_UWord8* ptrEncodedUW8 = (WebRtc_UWord8*)encoded; + WebRtc_UWord16 numLayer; + WebRtc_Word16 totSizeBytes; + WebRtc_Word16 err; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + decInstUB = &(instISAC->instUB.ISACdecUB_obj); + decInstLB = &(instISAC->instLB.ISACdecLB_obj); + + /* check if decoder initiated */ + if((instISAC->initFlag & BIT_MASK_DEC_INIT) != + BIT_MASK_DEC_INIT) + { + instISAC->errorCode = ISAC_DECODER_NOT_INITIATED; + return -1; + } + + if(lenEncodedBytes <= 0) + { + /* return error code if the packet length is null */ + instISAC->errorCode = ISAC_EMPTY_PACKET; + return -1; + } + + // the size of the rncoded lower-band is bounded by + // STREAM_SIZE_MAX, + // If a payload with the size larger than STREAM_SIZE_MAX + // is received, it is not considered erroneous. + lenEncodedLBBytes = (lenEncodedBytes > STREAM_SIZE_MAX) + ? STREAM_SIZE_MAX:lenEncodedBytes; + + // Copy to lower-band bit-stream structure + memcpy(instISAC->instLB.ISACdecLB_obj.bitstr_obj.stream, ptrEncodedUW8, + lenEncodedLBBytes); + + // Regardless of that the current codec is setup to work in + // wideband or super-wideband, the decoding of the lower-band + // has to be performed. + numDecodedBytesLB = WebRtcIsac_DecodeLb(outFrame, decInstLB, + &numSamplesLB, isRCUPayload); + + // Check for error + if((numDecodedBytesLB < 0) || + (numDecodedBytesLB > lenEncodedLBBytes) || + (numSamplesLB > MAX_FRAMESAMPLES)) + { + instISAC->errorCode = ISAC_LENGTH_MISMATCH; + return -1; + } + + // Error Check, we accept multi-layer bit-stream + // This will limit number of iterations of the + // while loop. Even withouut this the number of iterations + // is limited. + numLayer = 1; + totSizeBytes = numDecodedBytesLB; + while(totSizeBytes != lenEncodedBytes) + { + if((totSizeBytes > lenEncodedBytes) || + (ptrEncodedUW8[totSizeBytes] == 0) || + (numLayer > MAX_NUM_LAYERS)) + { + instISAC->errorCode = ISAC_LENGTH_MISMATCH; + return -1; + } + totSizeBytes += ptrEncodedUW8[totSizeBytes]; + numLayer++; + } + + if(instISAC->decoderSamplingRateKHz == kIsacWideband) + { + for(k = 0; k < numSamplesLB; k++) + { + if(outFrame[k] > 32767) + { + decoded[k] = 32767; + } + else if(outFrame[k] < -32768) + { + decoded[k] = -32768; + } + else + { + decoded[k] = (WebRtc_Word16)WebRtcIsac_lrint(outFrame[k]); + } + } + numSamplesUB = 0; + } + else + { + WebRtc_UWord32 crc; + // We don't accept larger than 30ms (480 samples at lower-band) + // frame-size. + for(k = 0; k < numSamplesLB; k++) + { + if(outFrame[k] > 32767) + { + outFrameLB[k] = 32767; + } + else if(outFrame[k] < -32768) + { + outFrameLB[k] = -32768; + } + else + { + outFrameLB[k] = (WebRtc_Word16)WebRtcIsac_lrint(outFrame[k]); + } + } + + //numSamplesUB = numSamplesLB; + + // Check for possible error, and if upper-band stream exist. + if(numDecodedBytesLB == lenEncodedBytes) + { + // Decoding was successful. No super-wideband bitstream + // exists. + numSamplesUB = numSamplesLB; + memset(outFrameUB, 0, sizeof(WebRtc_Word16) * numSamplesUB); + + // Prepare for the potential increase of signal bandwidth + instISAC->resetFlag_8kHz = 2; + } + else + { + // this includes the check sum and the bytes that stores the + // length + WebRtc_Word16 lenNextStream = ptrEncodedUW8[numDecodedBytesLB]; + + // Is this garbage or valid super-wideband bit-stream? + // Check if checksum is valid + if(lenNextStream <= (LEN_CHECK_SUM_WORD8 + 1)) + { + // such a small second layer cannot be super-wideband layer. + // It must be a short garbage. + validChecksum = 0; + } + else + { + // Run CRC to see if the checksum match. + WebRtcIsac_GetCrc((WebRtc_Word16*)( + &ptrEncodedUW8[numDecodedBytesLB + 1]), + lenNextStream - LEN_CHECK_SUM_WORD8 - 1, &crc); + + validChecksum = 1; + for(k = 0; k < LEN_CHECK_SUM_WORD8; k++) + { + validChecksum &= (((crc >> (24 - k * 8)) & 0xFF) == + ptrEncodedUW8[numDecodedBytesLB + lenNextStream - + LEN_CHECK_SUM_WORD8 + k]); + } + } + + if(!validChecksum) + { + // this is a garbage, we have received a wideband + // bit-stream with garbage + numSamplesUB = numSamplesLB; + memset(outFrameUB, 0, sizeof(WebRtc_Word16) * numSamplesUB); + } + else + { + // A valid super-wideband biststream exists. + enum ISACBandwidth bandwidthKHz; + WebRtc_Word32 maxDelayBit; + + //instISAC->bwestimator_obj.incomingStreamSampFreq = + // kIsacSuperWideband; + // If we have super-wideband bit-stream, we cannot + // have 60 ms frame-size. + if(numSamplesLB > FRAMESAMPLES) + { + instISAC->errorCode = ISAC_LENGTH_MISMATCH; + return -1; + } + + // the rest of the bit-stream contains the upper-band + // bit-stream curently this is the only thing there, + // however, we might add more layers. + + // Have to exclude one byte where the length is stored + // and last 'LEN_CHECK_SUM_WORD8' bytes where the + // checksum is stored. + lenNextStream -= (LEN_CHECK_SUM_WORD8 + 1); + + memcpy(decInstUB->bitstr_obj.stream, + &ptrEncodedUW8[numDecodedBytesLB + 1], lenNextStream); + + // THIS IS THE FIRST DECODING + decInstUB->bitstr_obj.W_upper = 0xFFFFFFFF; + decInstUB->bitstr_obj.streamval = 0; + decInstUB->bitstr_obj.stream_index = 0; + + // Decode jitter infotmation + err = WebRtcIsac_DecodeJitterInfo(&decInstUB->bitstr_obj, + &maxDelayBit); + // error check + if(err < 0) + { + instISAC->errorCode = -err; + return -1; + } + + // Update jitter info which is in the upper-band bit-stream + // only if the encoder is in super-wideband. Otherwise, + // the jitter info is already embeded in bandwidth index + // and has been updated. + if(instISAC->encoderSamplingRateKHz == kIsacSuperWideband) + { + err = WebRtcIsac_UpdateUplinkJitter( + &(instISAC->bwestimator_obj), maxDelayBit); + if(err < 0) + { + instISAC->errorCode = -err; + return -1; + } + } + + // decode bandwidth information + err = WebRtcIsac_DecodeBandwidth(&decInstUB->bitstr_obj, + &bandwidthKHz); + if(err < 0) + { + instISAC->errorCode = -err; + return -1; + } + + switch(bandwidthKHz) + { + case isac12kHz: + { + numDecodedBytesUB = WebRtcIsac_DecodeUb12(outFrame, + decInstUB, isRCUPayload); + + // Hang-over for transient alleviation - + // wait two frames to add the upper band going up from 8 kHz + if (instISAC->resetFlag_8kHz > 0) + { + if (instISAC->resetFlag_8kHz == 2) + { + // Silence first and a half frame + memset(outFrame, 0, MAX_FRAMESAMPLES * + sizeof(float)); + } + else + { + const float rampStep = 2.0f / MAX_FRAMESAMPLES; + float rampVal = 0; + memset(outFrame, 0, (MAX_FRAMESAMPLES>>1) * + sizeof(float)); + + // Ramp up second half of second frame + for(k = MAX_FRAMESAMPLES/2; k < MAX_FRAMESAMPLES; k++) + { + outFrame[k] *= rampVal; + rampVal += rampStep; + } + } + instISAC->resetFlag_8kHz -= 1; + } + + break; + } + case isac16kHz: + { + numDecodedBytesUB = WebRtcIsac_DecodeUb16(outFrame, + decInstUB, isRCUPayload); + break; + } + default: + return -1; + } + + // it might be less due to garbage. + if((numDecodedBytesUB != lenNextStream) && + (numDecodedBytesUB != (lenNextStream - ptrEncodedUW8[ + numDecodedBytesLB + 1 + numDecodedBytesUB]))) + { + instISAC->errorCode = ISAC_LENGTH_MISMATCH; + return -1; + } + + // If there is no error Upper-band always decodes + // 30 ms (480 samples) + numSamplesUB = FRAMESAMPLES; + + // Convert to W16 + for(k = 0; k < numSamplesUB; k++) + { + if(outFrame[k] > 32767) + { + outFrameUB[k] = 32767; + } + else if(outFrame[k] < -32768) + { + outFrameUB[k] = -32768; + } + else + { + outFrameUB[k] = (WebRtc_Word16)WebRtcIsac_lrint( + outFrame[k]); + } + } + } + } + + speechIdx = 0; + while(speechIdx < numSamplesLB) + { + WebRtcSpl_SynthesisQMF(&outFrameLB[speechIdx], + &outFrameUB[speechIdx], &decoded[(speechIdx<<1)], + instISAC->synthesisFBState1, instISAC->synthesisFBState2); + + speechIdx += FRAMESAMPLES_10ms; + } + } + *speechType = 0; + return (numSamplesLB + numSamplesUB); +} + + + + + + + +/**************************************************************************** + * WebRtcIsac_Decode(...) + * + * This function decodes a ISAC frame. Output speech length + * will be a multiple of 480 samples: 480 or 960 samples, + * depending on the frameSize (30 or 60 ms). + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - encoded : encoded ISAC frame(s) + * - len : bytes in encoded vector + * + * Output: + * - decoded : The decoded vector + * + * Return value : >0 - number of samples in decoded vector + * -1 - Error + */ + +WebRtc_Word16 WebRtcIsac_Decode( + ISACStruct* ISAC_main_inst, + const WebRtc_UWord16* encoded, + WebRtc_Word16 lenEncodedBytes, + WebRtc_Word16* decoded, + WebRtc_Word16* speechType) +{ + WebRtc_Word16 isRCUPayload = 0; + return Decode(ISAC_main_inst, encoded, lenEncodedBytes, decoded, + speechType, isRCUPayload); +} + +/**************************************************************************** + * WebRtcIsac_DecodeRcu(...) + * + * This function decodes a redundant (RCU) iSAC frame. Function is called in + * NetEq with a stored RCU payload i case of packet loss. Output speech length + * will be a multiple of 480 samples: 480 or 960 samples, + * depending on the framesize (30 or 60 ms). + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - encoded : encoded ISAC RCU frame(s) + * - len : bytes in encoded vector + * + * Output: + * - decoded : The decoded vector + * + * Return value : >0 - number of samples in decoded vector + * -1 - Error + */ + + + +WebRtc_Word16 WebRtcIsac_DecodeRcu( + ISACStruct* ISAC_main_inst, + const WebRtc_UWord16* encoded, + WebRtc_Word16 lenEncodedBytes, + WebRtc_Word16* decoded, + WebRtc_Word16* speechType) +{ + WebRtc_Word16 isRCUPayload = 1; + return Decode(ISAC_main_inst, encoded, lenEncodedBytes, decoded, + speechType, isRCUPayload); +} + + +/**************************************************************************** + * WebRtcIsac_DecodePlc(...) + * + * This function conducts PLC for ISAC frame(s). Output speech length + * will be a multiple of 480 samples: 480 or 960 samples, + * depending on the frameSize (30 or 60 ms). + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - noOfLostFrames : Number of PLC frames to produce + * + * Output: + * - decoded : The decoded vector + * + * Return value : >0 - number of samples in decoded PLC vector + * -1 - Error + */ +WebRtc_Word16 WebRtcIsac_DecodePlc( + ISACStruct* ISAC_main_inst, + WebRtc_Word16* decoded, + WebRtc_Word16 noOfLostFrames) +{ + WebRtc_Word16 numSamples; + ISACMainStruct* instISAC; + + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct*)ISAC_main_inst; + + /* Limit number of frames to two = 60 msec. Otherwise we exceed data vectors */ + if(noOfLostFrames > 2) + { + noOfLostFrames = 2; + } + + /* Get the number of samples per frame */ + switch(instISAC->decoderSamplingRateKHz) + { + case kIsacWideband: + { + numSamples = 480 * noOfLostFrames; + break; + } + case kIsacSuperWideband: + { + numSamples = 960 * noOfLostFrames; + break; + } + default: + return -1; + } + + /* Set output samples to zero */ + memset(decoded, 0, numSamples * sizeof(WebRtc_Word16)); + return numSamples; +} + + +/**************************************************************************** + * ControlLb(...) - Internal function for controling Lower Band + * ControlUb(...) - Internal function for controling Upper Band + * WebRtcIsac_Control(...) - API function + * + * This function sets the limit on the short-term average bit rate and the + * frame length. Should be used only in Instantaneous mode. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - rate : limit on the short-term average bit rate, + * in bits/second (between 10000 and 32000) + * - frameSize : number of milliseconds per frame (30 or 60) + * + * Return value : 0 - ok + * -1 - Error + */ +static WebRtc_Word16 ControlLb( + ISACLBStruct* instISAC, + double rate, + WebRtc_Word16 frameSize) +{ + if((rate >= 10000) && (rate <= 32000)) + { + instISAC->ISACencLB_obj.bottleneck = rate; + } + else + { + return -ISAC_DISALLOWED_BOTTLENECK; + } + + if((frameSize == 30) || (frameSize == 60)) + { + instISAC->ISACencLB_obj.new_framelength = (FS/1000) * frameSize; + } + else + { + return -ISAC_DISALLOWED_FRAME_LENGTH; + } + + return 0; +} + +static WebRtc_Word16 ControlUb( + ISACUBStruct* instISAC, + double rate) +{ + if((rate >= 10000) && (rate <= 32000)) + { + instISAC->ISACencUB_obj.bottleneck = rate; + } + else + { + return -ISAC_DISALLOWED_BOTTLENECK; + } + return 0; +} + +WebRtc_Word16 WebRtcIsac_Control( + ISACStruct* ISAC_main_inst, + WebRtc_Word32 bottleneckBPS, + WebRtc_Word16 frameSize) +{ + ISACMainStruct *instISAC; + WebRtc_Word16 status; + double rateLB; + double rateUB; + enum ISACBandwidth bandwidthKHz; + + + /* Typecast pointer to real structure */ + instISAC = (ISACMainStruct*)ISAC_main_inst; + + if(instISAC->codingMode == 0) + { + /* in adaptive mode */ + instISAC->errorCode = ISAC_MODE_MISMATCH; + return -1; + } + + /* check if encoder initiated */ + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + return -1; + } + + if(instISAC->encoderSamplingRateKHz == kIsacWideband) + { + // if the sampling rate is 16kHz then bandwith should be 8kHz, + // regardless of bottleneck. + bandwidthKHz = isac8kHz; + rateLB = (bottleneckBPS > 32000)? 32000:bottleneckBPS; + rateUB = 0; + } + else + { + if(WebRtcIsac_RateAllocation(bottleneckBPS, &rateLB, &rateUB, + &bandwidthKHz) < 0) + { + return -1; + } + } + + if((instISAC->encoderSamplingRateKHz == kIsacSuperWideband) && + (frameSize != 30) && + (bandwidthKHz != isac8kHz)) + { + // Cannot have 60 ms in super-wideband + instISAC->errorCode = ISAC_DISALLOWED_FRAME_LENGTH; + return -1; + } + + status = ControlLb(&instISAC->instLB, rateLB, frameSize); + if(status < 0) + { + instISAC->errorCode = -status; + return -1; + } + if(bandwidthKHz != isac8kHz) + { + status = ControlUb(&(instISAC->instUB), rateUB); + if(status < 0) + { + instISAC->errorCode = -status; + return -1; + } + } + + // + // Check if bandwidth is changing from wideband to super-wideband + // then we have to synch data buffer of lower & upper-band. also + // clean up the upper-band data buffer. + // + if((instISAC->bandwidthKHz == isac8kHz) && + (bandwidthKHz != isac8kHz)) + { + memset(instISAC->instUB.ISACencUB_obj.data_buffer_float, 0, + sizeof(float) * (MAX_FRAMESAMPLES + LB_TOTAL_DELAY_SAMPLES)); + + if(bandwidthKHz == isac12kHz) + { + instISAC->instUB.ISACencUB_obj.buffer_index = + instISAC->instLB.ISACencLB_obj.buffer_index; + } + else + { + instISAC->instUB.ISACencUB_obj.buffer_index = LB_TOTAL_DELAY_SAMPLES + + instISAC->instLB.ISACencLB_obj.buffer_index; + + memcpy(&(instISAC->instUB.ISACencUB_obj.lastLPCVec), + WebRtcIsac_kMeanLarUb16, sizeof(double) * UB_LPC_ORDER); + } + } + + // update the payload limit it the bandwidth is changing. + if(instISAC->bandwidthKHz != bandwidthKHz) + { + instISAC->bandwidthKHz = bandwidthKHz; + UpdatePayloadSizeLimit(instISAC); + } + instISAC->bottleneck = bottleneckBPS; + return 0; +} + + +/**************************************************************************** + * WebRtcIsac_ControlBwe(...) + * + * This function sets the initial values of bottleneck and frame-size if + * iSAC is used in channel-adaptive mode. Through this API, users can + * enforce a frame-size for all values of bottleneck. Then iSAC will not + * automatically change the frame-size. + * + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - rateBPS : initial value of bottleneck in bits/second + * 10000 <= rateBPS <= 32000 is accepted + * For default bottleneck set rateBPS = 0 + * - frameSizeMs : number of milliseconds per frame (30 or 60) + * - enforceFrameSize : 1 to enforce the given frame-size through out + * the adaptation process, 0 to let iSAC change + * the frame-size if required. + * + * Return value : 0 - ok + * -1 - Error + */ +WebRtc_Word16 WebRtcIsac_ControlBwe( + ISACStruct* ISAC_main_inst, + WebRtc_Word32 bottleneckBPS, + WebRtc_Word16 frameSizeMs, + WebRtc_Word16 enforceFrameSize) +{ + ISACMainStruct *instISAC; + enum ISACBandwidth bandwidth; + + /* Typecast pointer to real structure */ + instISAC = (ISACMainStruct *)ISAC_main_inst; + + /* check if encoder initiated */ + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + return -1; + } + + /* Check that we are in channel-adaptive mode, otherwise, return (-1) */ + if(instISAC->codingMode != 0) + { + instISAC->errorCode = ISAC_MODE_MISMATCH; + return -1; + } + if((frameSizeMs != 30) && + (instISAC->encoderSamplingRateKHz == kIsacSuperWideband)) + { + return -1; + } + + /* Set struct variable if enforceFrameSize is set. ISAC will then */ + /* keep the chosen frame size. */ + if((enforceFrameSize != 0) /*|| + (instISAC->samplingRateKHz == kIsacSuperWideband)*/) + { + instISAC->instLB.ISACencLB_obj.enforceFrameSize = 1; + } + else + { + instISAC->instLB.ISACencLB_obj.enforceFrameSize = 0; + } + + /* Set initial rate, if value between 10000 and 32000, */ + /* if rateBPS is 0, keep the default initial bottleneck value (15000) */ + if(bottleneckBPS != 0) + { + double rateLB; + double rateUB; + if(WebRtcIsac_RateAllocation(bottleneckBPS, &rateLB, &rateUB, &bandwidth) < 0) + { + return -1; + } + instISAC->bwestimator_obj.send_bw_avg = (float)bottleneckBPS; + instISAC->bandwidthKHz = bandwidth; + } + + /* Set initial frameSize. If enforceFrameSize is set the frame size will + not change */ + if(frameSizeMs != 0) + { + if((frameSizeMs == 30) || (frameSizeMs == 60)) + { + instISAC->instLB.ISACencLB_obj.new_framelength = (FS/1000) * + frameSizeMs; + //instISAC->bwestimator_obj.rec_header_rate = ((float)HEADER_SIZE * + // 8.0f * 1000.0f / (float)frameSizeMs); + } + else + { + instISAC->errorCode = ISAC_DISALLOWED_FRAME_LENGTH; + return -1; + } + } + return 0; +} + + +/**************************************************************************** + * WebRtcIsac_GetDownLinkBwIndex(...) + * + * This function returns index representing the Bandwidth estimate from + * other side to this side. + * + * Input: + * - ISAC_main_inst : iSAC struct + * + * Output: + * - bweIndex : Bandwidth estimate to transmit to other side. + * + */ +WebRtc_Word16 WebRtcIsac_GetDownLinkBwIndex( + ISACStruct* ISAC_main_inst, + WebRtc_Word16* bweIndex, + WebRtc_Word16* jitterInfo) +{ + ISACMainStruct *instISAC; + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct*)ISAC_main_inst; + + /* check if encoder initiated */ + if((instISAC->initFlag & BIT_MASK_DEC_INIT) != + BIT_MASK_DEC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + return -1; + } + + /* Call function to get Bandwidth Estimate */ + WebRtcIsac_GetDownlinkBwJitIndexImpl(&(instISAC->bwestimator_obj), + bweIndex, jitterInfo, instISAC->decoderSamplingRateKHz); + return 0; +} + + +/**************************************************************************** + * WebRtcIsac_UpdateUplinkBw(...) + * + * This function takes an index representing the Bandwidth estimate from + * this side to other side and updates BWE. + * + * Input: + * - ISAC_main_inst : iSAC struct + * - rateIndex : Bandwidth estimate from other side. + * + * Return value : 0 - ok + * -1 - index out of range + */ +WebRtc_Word16 WebRtcIsac_UpdateUplinkBw( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 bweIndex) +{ + ISACMainStruct *instISAC; + WebRtc_Word16 returnVal; + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct *)ISAC_main_inst; + + /* check if encoder initiated */ + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + return -1; + } + + /* Call function to get Bandwidth Estimate */ + returnVal = WebRtcIsac_UpdateUplinkBwImpl( + &(instISAC->bwestimator_obj), bweIndex, + instISAC->encoderSamplingRateKHz); + + if(returnVal < 0) + { + instISAC->errorCode = -returnVal; + return -1; + } + else + { + return 0; + } +} + + +/**************************************************************************** + * WebRtcIsac_ReadBwIndex(...) + * + * This function returns the index of the Bandwidth estimate from the + * bitstream. + * + * Input: + * - encoded : Encoded bitstream + * + * Output: + * - frameLength : Length of frame in packet (in samples) + * - bweIndex : Bandwidth estimate in bitstream + * + */ +WebRtc_Word16 WebRtcIsac_ReadBwIndex( + const WebRtc_Word16* encoded, + WebRtc_Word16* bweIndex) +{ + Bitstr streamdata; +#ifndef WEBRTC_BIG_ENDIAN + int k; +#endif + WebRtc_Word16 err; + + streamdata.W_upper = 0xFFFFFFFF; + streamdata.streamval = 0; + streamdata.stream_index = 0; + +#ifndef WEBRTC_BIG_ENDIAN + for(k = 0; k < 10; k++) + { + streamdata.stream[k] = (WebRtc_UWord8) ((encoded[k>>1] >> + ((k&1) << 3)) & 0xFF); + } +#else + memcpy(streamdata.stream, encoded, 10); +#endif + + /* decode frame length */ + err = WebRtcIsac_DecodeFrameLen(&streamdata, bweIndex); + if(err < 0) + { + return err; + } + + /* decode BW estimation */ + err = WebRtcIsac_DecodeSendBW(&streamdata, bweIndex); + if(err < 0) + { + return err; + } + + return 0; +} + + +/**************************************************************************** + * WebRtcIsac_ReadFrameLen(...) + * + * This function returns the length of the frame represented in the packet. + * + * Input: + * - encoded : Encoded bitstream + * + * Output: + * - frameLength : Length of frame in packet (in samples) + * + */ +WebRtc_Word16 WebRtcIsac_ReadFrameLen( + ISACStruct* ISAC_main_inst, + const WebRtc_Word16* encoded, + WebRtc_Word16* frameLength) +{ + Bitstr streamdata; +#ifndef WEBRTC_BIG_ENDIAN + int k; +#endif + WebRtc_Word16 err; + ISACMainStruct* instISAC; + + streamdata.W_upper = 0xFFFFFFFF; + streamdata.streamval = 0; + streamdata.stream_index = 0; + +#ifndef WEBRTC_BIG_ENDIAN + for (k=0; k<10; k++) { + streamdata.stream[k] = (WebRtc_UWord8) ((encoded[k>>1] >> + ((k&1) << 3)) & 0xFF); + } +#else + memcpy(streamdata.stream, encoded, 10); +#endif + + /* decode frame length */ + err = WebRtcIsac_DecodeFrameLen(&streamdata, frameLength); + if(err < 0) { + return -1; + } + instISAC = (ISACMainStruct*)ISAC_main_inst; + + if(instISAC->decoderSamplingRateKHz == kIsacSuperWideband) + { + // the decoded frame length indicates the number of samples in + // lower-band in this case, multiply by 2 to get the total number + // of samples. + *frameLength <<= 1; + } + + return 0; +} + + +/******************************************************************************* + * WebRtcIsac_GetNewFrameLen(...) + * + * returns the frame lenght (in samples) of the next packet. In the case of + * channel-adaptive mode, iSAC decides on its frame lenght based on the + * estimated bottleneck this allows a user to prepare for the next packet + * (at the encoder). + * + * The primary usage is in CE to make the iSAC works in channel-adaptive mode + * + * Input: + * - ISAC_main_inst : iSAC struct + * + * Return Value : frame lenght in samples + * + */ +WebRtc_Word16 WebRtcIsac_GetNewFrameLen( + ISACStruct *ISAC_main_inst) +{ + ISACMainStruct *instISAC; + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct *)ISAC_main_inst; + + /* Return new frame length */ + if(instISAC->encoderSamplingRateKHz == kIsacWideband) + { + return (instISAC->instLB.ISACencLB_obj.new_framelength); + } + else + { + return ((instISAC->instLB.ISACencLB_obj.new_framelength) << 1); + } +} + + +/**************************************************************************** + * WebRtcIsac_GetErrorCode(...) + * + * This function can be used to check the error code of an iSAC instance. + * When a function returns -1 a error code will be set for that instance. + * The function below extract the code of the last error that occured in + * the specified instance. + * + * Input: + * - ISAC_main_inst : ISAC instance + * + * Return value : Error code + */ +WebRtc_Word16 WebRtcIsac_GetErrorCode( + ISACStruct *ISAC_main_inst) +{ + ISACMainStruct *instISAC; + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct *)ISAC_main_inst; + + return (instISAC->errorCode); +} + + +/**************************************************************************** + * WebRtcIsac_GetUplinkBw(...) + * + * This function outputs the target bottleneck of the codec. In + * channel-adaptive mode, the target bottleneck is specified through in-band + * signalling retreived by bandwidth estimator. + * In channel-independent, also called instantaneous mode, the target + * bottleneck is provided to the encoder by calling xxx_control(...) (if + * xxx_control is never called the default values is). + * Note that the output is the iSAC internal operating bottleneck whch might + * differ slightly from the one provided through xxx_control(). + * + * Input: + * - ISAC_main_inst : iSAC instance + * + * Output: + * - *bottleneck : bottleneck in bits/sec + * + * Return value : -1 if error happens + * 0 bit-rates computed correctly. + */ +WebRtc_Word16 WebRtcIsac_GetUplinkBw( + ISACStruct* ISAC_main_inst, + WebRtc_Word32* bottleneck) +{ + ISACMainStruct* instISAC = (ISACMainStruct *)ISAC_main_inst; + + if(instISAC->codingMode == 0) + { + // we are in adaptive mode then get the bottleneck from BWE + *bottleneck = (WebRtc_Word32)instISAC->bwestimator_obj.send_bw_avg; + } + else + { + *bottleneck = instISAC->bottleneck; + } + + if((*bottleneck > 32000) && (*bottleneck < 38000)) + { + *bottleneck = 32000; + } + else if((*bottleneck > 45000) && (*bottleneck < 50000)) + { + *bottleneck = 45000; + } + else if(*bottleneck > 56000) + { + *bottleneck = 56000; + } + + return 0; +} + + +/****************************************************************************** + * WebRtcIsac_SetMaxPayloadSize(...) + * + * This function sets a limit for the maximum payload size of iSAC. The same + * value is used both for 30 and 60 ms packets. If the encoder sampling rate + * is 16 kHz the maximum payload size is between 120 and 400 bytes. If the + * encoder sampling rate is 32 kHz the maximum payload size is between 120 + * and 600 bytes. + * + * --------------- + * IMPORTANT NOTES + * --------------- + * The size of a packet is limited to the minimum of 'max-payload-size' and + * 'max-rate.' For instance, let's assume the max-payload-size is set to + * 170 bytes, and max-rate is set to 40 kbps. Note that a limit of 40 kbps + * translates to 150 bytes for 30ms frame-size & 300 bytes for 60ms + * frame-size. Then a packet with a frame-size of 30 ms is limited to 150, + * i.e. min(170, 150), and a packet with 60 ms frame-size is limited to + * 170 bytes, i.e. min(170, 300). + * + * Input: + * - ISAC_main_inst : iSAC instance + * - maxPayloadBytes : maximum size of the payload in bytes + * valid values are between 100 and 400 bytes + * if encoder sampling rate is 16 kHz. For + * 32 kHz encoder sampling rate valid values + * are between 100 and 600 bytes. + * + * Return value : 0 if successful + * -1 if error happens + */ +WebRtc_Word16 WebRtcIsac_SetMaxPayloadSize( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 maxPayloadBytes) +{ + ISACMainStruct *instISAC; + WebRtc_Word16 status = 0; + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct *)ISAC_main_inst; + + /* check if encoder initiated */ + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + return -1; + } + + if(instISAC->encoderSamplingRateKHz == kIsacSuperWideband) + { + // sanity check + if(maxPayloadBytes < 120) + { + // maxRate is out of valid range + // set to the acceptable value and return -1. + maxPayloadBytes = 120; + status = -1; + } + + /* sanity check */ + if(maxPayloadBytes > STREAM_SIZE_MAX) + { + // maxRate is out of valid range + // set to the acceptable value and return -1. + maxPayloadBytes = STREAM_SIZE_MAX; + status = -1; + } + } + else + { + if(maxPayloadBytes < 120) + { + // max payload-size is out of valid range + // set to the acceptable value and return -1. + maxPayloadBytes = 120; + status = -1; + } + if(maxPayloadBytes > STREAM_SIZE_MAX_60) + { + // max payload-size is out of valid range + // set to the acceptable value and return -1. + maxPayloadBytes = STREAM_SIZE_MAX_60; + status = -1; + } + } + instISAC->maxPayloadSizeBytes = maxPayloadBytes; + UpdatePayloadSizeLimit(instISAC); + return status; +} + + +/****************************************************************************** + * WebRtcIsac_SetMaxRate(...) + * + * This function sets the maximum rate which the codec may not exceed for + * any signal packet. The maximum rate is defined and payload-size per + * frame-size in bits per second. + * + * The codec has a maximum rate of 53400 bits per second (200 bytes per 30 + * ms) if the encoder sampling rate is 16kHz, and 160 kbps (600 bytes/30 ms) + * if the encoder sampling rate is 32 kHz. + * + * It is possible to set a maximum rate between 32000 and 53400 bits/sec + * in wideband mode, and 32000 to 160000 bits/sec in super-wideband mode. + * + * --------------- + * IMPORTANT NOTES + * --------------- + * The size of a packet is limited to the minimum of 'max-payload-size' and + * 'max-rate.' For instance, let's assume the max-payload-size is set to + * 170 bytes, and max-rate is set to 40 kbps. Note that a limit of 40 kbps + * translates to 150 bytes for 30ms frame-size & 300 bytes for 60ms + * frame-size. Then a packet with a frame-size of 30 ms is limited to 150, + * i.e. min(170, 150), and a packet with 60 ms frame-size is limited to + * 170 bytes, min(170, 300). + * + * Input: + * - ISAC_main_inst : iSAC instance + * - maxRate : maximum rate in bits per second, + * valid values are 32000 to 53400 bits/sec in + * wideband mode, and 32000 to 160000 bits/sec in + * super-wideband mode. + * + * Return value : 0 if successful + * -1 if error happens + */ +WebRtc_Word16 WebRtcIsac_SetMaxRate( + ISACStruct* ISAC_main_inst, + WebRtc_Word32 maxRate) +{ + ISACMainStruct *instISAC; + WebRtc_Word16 maxRateInBytesPer30Ms; + WebRtc_Word16 status = 0; + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct *)ISAC_main_inst; + + /* check if encoder initiated */ + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + return -1; + } + /* + Calculate maximum number of bytes per 30 msec packets for the + given maximum rate. Multiply with 30/1000 to get number of + bits per 30 ms, divide by 8 to get number of bytes per 30 ms: + maxRateInBytes = floor((maxRate * 30/1000) / 8); + */ + maxRateInBytesPer30Ms = (WebRtc_Word16)(maxRate*3/800); + + if(instISAC->encoderSamplingRateKHz == kIsacWideband) + { + if(maxRate < 32000) + { + // max rate is out of valid range + // set to the acceptable value and return -1. + maxRateInBytesPer30Ms = 120; + status = -1; + } + + if(maxRate > 53400) + { + // max rate is out of valid range + // set to the acceptable value and return -1. + maxRateInBytesPer30Ms = 200; + status = -1; + } + } + else + { + if(maxRateInBytesPer30Ms < 120) + { + // maxRate is out of valid range + // set to the acceptable value and return -1. + maxRateInBytesPer30Ms = 120; + status = -1; + } + + if(maxRateInBytesPer30Ms > STREAM_SIZE_MAX) + { + // maxRate is out of valid range + // set to the acceptable value and return -1. + maxRateInBytesPer30Ms = STREAM_SIZE_MAX; + status = -1; + } + } + instISAC->maxRateBytesPer30Ms = maxRateInBytesPer30Ms; + UpdatePayloadSizeLimit(instISAC); + return status; +} + + +/**************************************************************************** + * WebRtcIsac_GetRedPayload(...) + * + * Populates "encoded" with the redundant payload of the recently encoded + * frame. This function has to be called once that WebRtcIsac_Encode(...) + * returns a positive value. Regardless of the frame-size this function will + * be called only once after encoding is completed. The bit-stream is + * targeted for 16000 bit/sec. + * + * Input: + * - ISAC_main_inst : iSAC struct + * + * Output: + * - encoded : the encoded data vector + * + * + * Return value : >0 - Length (in bytes) of coded data + * : -1 - Error + * + * + */ +WebRtc_Word16 WebRtcIsac_GetRedPayload( + ISACStruct* ISAC_main_inst, + WebRtc_Word16* encoded) +{ + ISACMainStruct* instISAC; + Bitstr iSACBitStreamInst; + WebRtc_Word16 streamLenLB; + WebRtc_Word16 streamLenUB; + WebRtc_Word16 streamLen; + WebRtc_Word16 totalLenUB; + WebRtc_UWord8* ptrEncodedUW8 = (WebRtc_UWord8*)encoded; +#ifndef WEBRTC_BIG_ENDIAN + int k; +#endif + + /* typecast pointer to real structure */ + instISAC = (ISACMainStruct*)ISAC_main_inst; + + + if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + instISAC->errorCode = ISAC_ENCODER_NOT_INITIATED; + } + + + iSACBitStreamInst.W_upper = 0xFFFFFFFF; + iSACBitStreamInst.streamval = 0; + iSACBitStreamInst.stream_index = 0; + + + streamLenLB = WebRtcIsac_EncodeStoredDataLb( + &instISAC->instLB.ISACencLB_obj.SaveEnc_obj, + &iSACBitStreamInst, + instISAC->instLB.ISACencLB_obj.lastBWIdx, + RCU_TRANSCODING_SCALE); + + if(streamLenLB < 0) + { + return -1; + } + + /* convert from bytes to WebRtc_Word16 */ + memcpy(ptrEncodedUW8, iSACBitStreamInst.stream, streamLenLB); + + streamLen = streamLenLB; + + if(instISAC->bandwidthKHz == isac8kHz) + { + return streamLenLB; + } + + streamLenUB = WebRtcIsac_GetRedPayloadUb( + &instISAC->instUB.ISACencUB_obj.SaveEnc_obj, + &iSACBitStreamInst, instISAC->bandwidthKHz); + + if(streamLenUB < 0) + { + // an error has happened but this is not the error due to a + // bit-stream larger than the limit + return -1; + } + + // We have one byte to write the total length of the upper band + // the length include the bitstream length, check-sum and the + // single byte where the length is written to. This is according to + // iSAC wideband and how the "garbage" is dealt. + totalLenUB = streamLenUB + 1 + LEN_CHECK_SUM_WORD8; + if(totalLenUB > 255) + { + streamLenUB = 0; + } + + // Generate CRC if required. + if((instISAC->bandwidthKHz != isac8kHz) && + (streamLenUB > 0)) + { + WebRtc_UWord32 crc; + streamLen += totalLenUB; + ptrEncodedUW8[streamLenLB] = (WebRtc_UWord8)totalLenUB; + memcpy(&ptrEncodedUW8[streamLenLB+1], iSACBitStreamInst.stream, streamLenUB); + + WebRtcIsac_GetCrc((WebRtc_Word16*)(&(ptrEncodedUW8[streamLenLB + 1])), + streamLenUB, &crc); +#ifndef WEBRTC_BIG_ENDIAN + for(k = 0; k < LEN_CHECK_SUM_WORD8; k++) + { + ptrEncodedUW8[streamLen - LEN_CHECK_SUM_WORD8 + k] = + (WebRtc_UWord8)((crc >> (24 - k * 8)) & 0xFF); + } +#else + memcpy(&ptrEncodedUW8[streamLenLB + streamLenUB + 1], &crc, + LEN_CHECK_SUM_WORD8); +#endif + } + + + return streamLen; +} + + +/**************************************************************************** + * WebRtcIsac_version(...) + * + * This function returns the version number. + * + * Output: + * - version : Pointer to character string + * + */ +void WebRtcIsac_version(char *version) +{ + strcpy(version, "4.3.0"); +} + + +/****************************************************************************** + * WebRtcIsac_SetEncSampRate() + * Set the sampling rate of the encoder. Initialization of the encoder WILL + * NOT overwrite the sampling rate of the encoder. The default value is 16 kHz + * which is set when the instance is created. The encoding-mode and the + * bottleneck remain unchanged by this call, however, the maximum rate and + * maximum payload-size will reset to their default value. + * + * Input: + * - ISAC_main_inst : iSAC instance + * - sampRate : enumerator specifying the sampling rate. + * + * Return value : 0 if successful + * -1 if failed. + */ +WebRtc_Word16 WebRtcIsac_SetEncSampRate( + ISACStruct* ISAC_main_inst, + enum IsacSamplingRate sampRate) +{ + ISACMainStruct* instISAC; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + + if((sampRate != kIsacWideband) && + (sampRate != kIsacSuperWideband)) + { + // Sampling Frequency is not supported + instISAC->errorCode = ISAC_UNSUPPORTED_SAMPLING_FREQUENCY; + return -1; + } + else if((instISAC->initFlag & BIT_MASK_ENC_INIT) != + BIT_MASK_ENC_INIT) + { + if(sampRate == kIsacWideband) + { + instISAC->bandwidthKHz = isac8kHz; + } + else + { + instISAC->bandwidthKHz = isac16kHz; + } + instISAC->encoderSamplingRateKHz = sampRate; + return 0; + } + else + { + ISACUBStruct* instUB = &(instISAC->instUB); + ISACLBStruct* instLB = &(instISAC->instLB); + double bottleneckLB; + double bottleneckUB; + WebRtc_Word32 bottleneck = instISAC->bottleneck; + WebRtc_Word16 codingMode = instISAC->codingMode; + WebRtc_Word16 frameSizeMs = instLB->ISACencLB_obj.new_framelength / (FS / 1000); + + if((sampRate == kIsacWideband) && + (instISAC->encoderSamplingRateKHz == kIsacSuperWideband)) + { + // changing from super-wideband to wideband. + // we don't need to re-initialize the encoder of the + // lower-band. + instISAC->bandwidthKHz = isac8kHz; + if(codingMode == 1) + { + ControlLb(instLB, + (bottleneck > 32000)? 32000:bottleneck, FRAMESIZE); + } + instISAC->maxPayloadSizeBytes = STREAM_SIZE_MAX_60; + instISAC->maxRateBytesPer30Ms = STREAM_SIZE_MAX_30; + } + else if((sampRate == kIsacSuperWideband) && + (instISAC->encoderSamplingRateKHz == kIsacWideband)) + { + if(codingMode == 1) + { + WebRtcIsac_RateAllocation(bottleneck, &bottleneckLB, &bottleneckUB, + &(instISAC->bandwidthKHz)); + } + + instISAC->bandwidthKHz = isac16kHz; + instISAC->maxPayloadSizeBytes = STREAM_SIZE_MAX; + instISAC->maxRateBytesPer30Ms = STREAM_SIZE_MAX; + + EncoderInitLb(instLB, codingMode, sampRate); + EncoderInitUb(instUB, instISAC->bandwidthKHz); + + memset(instISAC->analysisFBState1, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + memset(instISAC->analysisFBState2, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + + if(codingMode == 1) + { + instISAC->bottleneck = bottleneck; + ControlLb(instLB, bottleneckLB, + (instISAC->bandwidthKHz == isac8kHz)? frameSizeMs:FRAMESIZE); + if(instISAC->bandwidthKHz > isac8kHz) + { + ControlUb(instUB, bottleneckUB); + } + } + else + { + instLB->ISACencLB_obj.enforceFrameSize = 0; + instLB->ISACencLB_obj.new_framelength = FRAMESAMPLES; + } + } + instISAC->encoderSamplingRateKHz = sampRate; + return 0; + } +} + + +/****************************************************************************** + * WebRtcIsac_SetDecSampRate() + * Set the sampling rate of the decoder. Initialization of the decoder WILL + * NOT overwrite the sampling rate of the encoder. The default value is 16 kHz + * which is set when the instance is created. + * + * Input: + * - ISAC_main_inst : iSAC instance + * - sampRate : enumerator specifying the sampling rate. + * + * Return value : 0 if successful + * -1 if failed. + */ +WebRtc_Word16 WebRtcIsac_SetDecSampRate( + ISACStruct* ISAC_main_inst, + enum IsacSamplingRate sampRate) +{ + ISACMainStruct* instISAC; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + + if((sampRate != kIsacWideband) && + (sampRate != kIsacSuperWideband)) + { + // Sampling Frequency is not supported + instISAC->errorCode = ISAC_UNSUPPORTED_SAMPLING_FREQUENCY; + return -1; + } + else + { + if((instISAC->decoderSamplingRateKHz == kIsacWideband) && + (sampRate == kIsacSuperWideband)) + { + // switching from wideband to super-wideband at the decoder + // we need to reset the filter-bank and initialize + // upper-band decoder. + memset(instISAC->synthesisFBState1, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + memset(instISAC->synthesisFBState2, 0, + FB_STATE_SIZE_WORD32 * sizeof(WebRtc_Word32)); + + if(DecoderInitUb(&(instISAC->instUB)) < 0) + { + return -1; + } + } + instISAC->decoderSamplingRateKHz = sampRate; + return 0; + } +} + + +/****************************************************************************** + * WebRtcIsac_EncSampRate() + * + * Input: + * - ISAC_main_inst : iSAC instance + * + * Return value : enumerator representing sampling frequency + * associated with the encoder, the input audio + * is expected to be sampled at this rate. + * + */ +enum IsacSamplingRate WebRtcIsac_EncSampRate( + ISACStruct* ISAC_main_inst) +{ + ISACMainStruct* instISAC; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + + return instISAC->encoderSamplingRateKHz; +} + + +/****************************************************************************** + * WebRtcIsac_DecSampRate() + * Return the sampling rate of the decoded audio. + * + * Input: + * - ISAC_main_inst : iSAC instance + * + * Return value : enumerator representing sampling frequency + * associated with the decoder, i.e. the + * sampling rate of the decoded audio. + * + */ +enum IsacSamplingRate WebRtcIsac_DecSampRate( + ISACStruct* ISAC_main_inst) +{ + ISACMainStruct* instISAC; + + instISAC = (ISACMainStruct*)ISAC_main_inst; + + return instISAC->decoderSamplingRateKHz; +} diff --git a/src/mod/codecs/mod_isac/isac.gypi b/src/mod/codecs/mod_isac/isac.gypi new file mode 100644 index 0000000000..d30be551bd --- /dev/null +++ b/src/mod/codecs/mod_isac/isac.gypi @@ -0,0 +1,91 @@ +# Copyright (c) 2011 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 +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +{ + 'targets': [ + { + 'target_name': 'iSAC', + 'type': '<(library)', + 'dependencies': [ + '<(webrtc_root)/common_audio/common_audio.gyp:signal_processing', + ], + 'include_dirs': [ + '../interface', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '../interface', + ], + }, + 'sources': [ + '../interface/isac.h', + 'arith_routines.c', + 'arith_routines_hist.c', + 'arith_routines_logist.c', + 'bandwidth_estimator.c', + 'crc.c', + 'decode.c', + 'decode_bwe.c', + 'encode.c', + 'encode_lpc_swb.c', + 'entropy_coding.c', + 'fft.c', + 'filter_functions.c', + 'filterbank_tables.c', + 'intialize.c', + 'isac.c', + 'filterbanks.c', + 'pitch_lag_tables.c', + 'lattice.c', + 'lpc_gain_swb_tables.c', + 'lpc_analysis.c', + 'lpc_shape_swb12_tables.c', + 'lpc_shape_swb16_tables.c', + 'lpc_tables.c', + 'pitch_estimator.c', + 'pitch_filter.c', + 'pitch_gain_tables.c', + 'spectrum_ar_model_tables.c', + 'transform.c', + 'arith_routines.h', + 'bandwidth_estimator.h', + 'codec.h', + 'crc.h', + 'encode_lpc_swb.h', + 'entropy_coding.h', + 'fft.h', + 'filterbank_tables.h', + 'lpc_gain_swb_tables.h', + 'lpc_analysis.h', + 'lpc_shape_swb12_tables.h', + 'lpc_shape_swb16_tables.h', + 'lpc_tables.h', + 'pitch_estimator.h', + 'pitch_gain_tables.h', + 'pitch_lag_tables.h', + 'settings.h', + 'spectrum_ar_model_tables.h', + 'structs.h', + 'os_specific_inline.h', + ], + 'conditions': [ + ['OS!="win"', { + 'defines': [ + 'WEBRTC_LINUX', + ], + }], + ], + }, + ], +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/src/mod/codecs/mod_isac/isac.h b/src/mod/codecs/mod_isac/isac.h new file mode 100644 index 0000000000..03c260bb8a --- /dev/null +++ b/src/mod/codecs/mod_isac/isac.h @@ -0,0 +1,729 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_ISAC_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_ISAC_H_ + +/* + * Define the fixed-point numeric formats + */ +#include "typedefs.h" + +typedef struct WebRtcISACStruct ISACStruct; + +enum IsacSamplingRate {kIsacWideband = 16, kIsacSuperWideband = 32}; + + +#if defined(__cplusplus) +extern "C" { +#endif + + /****************************************************************************** + * WebRtcIsac_AssignSize(...) + * + * This function returns the size of the ISAC instance, so that the instance + * can be created outside iSAC. + * + * Input: + * - samplingRate : sampling rate of the input/output audio. + * + * Output: + * - sizeinbytes : number of bytes needed to allocate for the + * instance. + * + * Return value : 0 - Ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_AssignSize( + int* sizeinbytes); + + + /****************************************************************************** + * WebRtcIsac_Assign(...) + * + * This function assignes the memory already created to the ISAC instance. + * + * Input: + * - *ISAC_main_inst : a pointer to the coder instance. + * - samplingRate : sampling rate of the input/output audio. + * - ISAC_inst_Addr : the already allocated memory, where we put the + * iSAC structure. + * + * Return value : 0 - Ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_Assign( + ISACStruct** ISAC_main_inst, + void* ISAC_inst_Addr); + + + /****************************************************************************** + * WebRtcIsac_Create(...) + * + * This function creates an ISAC instance, which will contain the state + * information for one coding/decoding channel. + * + * Input: + * - *ISAC_main_inst : a pointer to the coder instance. + * + * Return value : 0 - Ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_Create( + ISACStruct** ISAC_main_inst); + + + /****************************************************************************** + * WebRtcIsac_Free(...) + * + * This function frees the ISAC instance created at the beginning. + * + * Input: + * - ISAC_main_inst : an ISAC instance. + * + * Return value : 0 - Ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_Free( + ISACStruct* ISAC_main_inst); + + + /****************************************************************************** + * WebRtcIsac_EncoderInit(...) + * + * This function initializes an ISAC instance prior to the encoder calls. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - CodingMode : 0 -> Bit rate and frame length are + * automatically adjusted to available bandwidth + * on transmission channel, just valid if codec + * is created to work in wideband mode. + * 1 -> User sets a frame length and a target bit + * rate which is taken as the maximum + * short-term average bit rate. + * + * Return value : 0 - Ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_EncoderInit( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 CodingMode); + + + /****************************************************************************** + * WebRtcIsac_Encode(...) + * + * This function encodes 10ms audio blocks and inserts it into a package. + * Input speech length has 160 samples if operating at 16 kHz sampling + * rate, or 320 if operating at 32 kHz sampling rate. The encoder buffers the + * input audio until the whole frame is buffered then proceeds with encoding. + * + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - speechIn : input speech vector. + * + * Output: + * - encoded : the encoded data vector + * + * Return value: + * : >0 - Length (in bytes) of coded data + * : 0 - The buffer didn't reach the chosen + * frame-size so it keeps buffering speech + * samples. + * : -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_Encode( + ISACStruct* ISAC_main_inst, + const WebRtc_Word16* speechIn, + WebRtc_Word16* encoded); + + + /****************************************************************************** + * WebRtcIsac_DecoderInit(...) + * + * This function initializes an ISAC instance prior to the decoder calls. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * + * Return value + * : 0 - Ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_DecoderInit( + ISACStruct* ISAC_main_inst); + + + /****************************************************************************** + * WebRtcIsac_UpdateBwEstimate(...) + * + * This function updates the estimate of the bandwidth. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - encoded : encoded ISAC frame(s). + * - packet_size : size of the packet. + * - rtp_seq_number : the RTP number of the packet. + * - send_ts : the RTP send timestamp, given in samples + * - arr_ts : the arrival time of the packet (from NetEq) + * in samples. + * + * Return value : 0 - Ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_UpdateBwEstimate( + ISACStruct* ISAC_main_inst, + const WebRtc_UWord16* encoded, + WebRtc_Word32 packet_size, + WebRtc_UWord16 rtp_seq_number, + WebRtc_UWord32 send_ts, + WebRtc_UWord32 arr_ts); + + + /****************************************************************************** + * WebRtcIsac_Decode(...) + * + * This function decodes an ISAC frame. At 16 kHz sampling rate, the length + * of the output audio could be either 480 or 960 samples, equivalent to + * 30 or 60 ms respectively. At 32 kHz sampling rate, the length of the + * output audio is 960 samples, which is 30 ms. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - encoded : encoded ISAC frame(s). + * - len : bytes in encoded vector. + * + * Output: + * - decoded : The decoded vector. + * + * Return value : >0 - number of samples in decoded vector. + * -1 - Error. + */ + + WebRtc_Word16 WebRtcIsac_Decode( + ISACStruct* ISAC_main_inst, + const WebRtc_UWord16* encoded, + WebRtc_Word16 len, + WebRtc_Word16* decoded, + WebRtc_Word16* speechType); + + + /****************************************************************************** + * WebRtcIsac_DecodePlc(...) + * + * This function conducts PLC for ISAC frame(s). Output speech length + * will be a multiple of frames, i.e. multiples of 30 ms audio. Therefore, + * the output is multiple of 480 samples if operating at 16 kHz and multiple + * of 960 if operating at 32 kHz. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - noOfLostFrames : Number of PLC frames to produce. + * + * Output: + * - decoded : The decoded vector. + * + * Return value : >0 - number of samples in decoded PLC vector + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_DecodePlc( + ISACStruct* ISAC_main_inst, + WebRtc_Word16* decoded, + WebRtc_Word16 noOfLostFrames); + + + /****************************************************************************** + * WebRtcIsac_Control(...) + * + * This function sets the limit on the short-term average bit-rate and the + * frame length. Should be used only in Instantaneous mode. At 16 kHz sampling + * rate, an average bit-rate between 10000 to 32000 bps is valid and a + * frame-size of 30 or 60 ms is acceptable. At 32 kHz, an average bit-rate + * between 10000 to 56000 is acceptable, and the valid frame-size is 30 ms. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - rate : limit on the short-term average bit rate, + * in bits/second. + * - framesize : frame-size in millisecond. + * + * Return value : 0 - ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_Control( + ISACStruct* ISAC_main_inst, + WebRtc_Word32 rate, + WebRtc_Word16 framesize); + + + /****************************************************************************** + * WebRtcIsac_ControlBwe(...) + * + * This function sets the initial values of bottleneck and frame-size if + * iSAC is used in channel-adaptive mode. Therefore, this API is not + * applicable if the codec is created to operate in super-wideband mode. + * + * Through this API, users can enforce a frame-size for all values of + * bottleneck. Then iSAC will not automatically change the frame-size. + * + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - rateBPS : initial value of bottleneck in bits/second + * 10000 <= rateBPS <= 56000 is accepted + * For default bottleneck set rateBPS = 0 + * - frameSizeMs : number of milliseconds per frame (30 or 60) + * - enforceFrameSize : 1 to enforce the given frame-size through + * out the adaptation process, 0 to let iSAC + * change the frame-size if required. + * + * Return value : 0 - ok + * -1 - Error + */ + + WebRtc_Word16 WebRtcIsac_ControlBwe( + ISACStruct* ISAC_main_inst, + WebRtc_Word32 rateBPS, + WebRtc_Word16 frameSizeMs, + WebRtc_Word16 enforceFrameSize); + + + /****************************************************************************** + * WebRtcIsac_ReadFrameLen(...) + * + * This function returns the length of the frame represented in the packet. + * + * Input: + * - encoded : Encoded bit-stream + * + * Output: + * - frameLength : Length of frame in packet (in samples) + * + */ + + WebRtc_Word16 WebRtcIsac_ReadFrameLen( + ISACStruct* ISAC_main_inst, + const WebRtc_Word16* encoded, + WebRtc_Word16* frameLength); + + + /****************************************************************************** + * WebRtcIsac_version(...) + * + * This function returns the version number. + * + * Output: + * - version : Pointer to character string + * + */ + + void WebRtcIsac_version( + char *version); + + + /****************************************************************************** + * WebRtcIsac_GetErrorCode(...) + * + * This function can be used to check the error code of an iSAC instance. When + * a function returns -1 a error code will be set for that instance. The + * function below extract the code of the last error that occurred in the + * specified instance. + * + * Input: + * - ISAC_main_inst : ISAC instance + * + * Return value : Error code + */ + + WebRtc_Word16 WebRtcIsac_GetErrorCode( + ISACStruct* ISAC_main_inst); + + + /**************************************************************************** + * WebRtcIsac_GetUplinkBw(...) + * + * This function outputs the target bottleneck of the codec. In + * channel-adaptive mode, the target bottleneck is specified through in-band + * signalling retreived by bandwidth estimator. + * In channel-independent, also called instantaneous mode, the target + * bottleneck is provided to the encoder by calling xxx_control(...). If + * xxx_control is never called the default values is returned. The default + * value for bottleneck at 16 kHz encoder sampling rate is 32000 bits/sec, + * and it is 56000 bits/sec for 32 kHz sampling rate. + * Note that the output is the iSAC internal operating bottleneck which might + * differ slightly from the one provided through xxx_control(). + * + * Input: + * - ISAC_main_inst : iSAC instance + * + * Output: + * - *bottleneck : bottleneck in bits/sec + * + * Return value : -1 if error happens + * 0 bit-rates computed correctly. + */ + + WebRtc_Word16 WebRtcIsac_GetUplinkBw( + ISACStruct* ISAC_main_inst, + WebRtc_Word32* bottleneck); + + + /****************************************************************************** + * WebRtcIsac_SetMaxPayloadSize(...) + * + * This function sets a limit for the maximum payload size of iSAC. The same + * value is used both for 30 and 60 ms packets. If the encoder sampling rate + * is 16 kHz the maximum payload size is between 120 and 400 bytes. If the + * encoder sampling rate is 32 kHz the maximum payload size is between 120 + * and 600 bytes. + * + * If an out of range limit is used, the function returns -1, but the closest + * valid value will be applied. + * + * --------------- + * IMPORTANT NOTES + * --------------- + * The size of a packet is limited to the minimum of 'max-payload-size' and + * 'max-rate.' For instance, let's assume the max-payload-size is set to + * 170 bytes, and max-rate is set to 40 kbps. Note that a limit of 40 kbps + * translates to 150 bytes for 30ms frame-size & 300 bytes for 60ms + * frame-size. Then a packet with a frame-size of 30 ms is limited to 150, + * i.e. min(170, 150), and a packet with 60 ms frame-size is limited to + * 170 bytes, i.e. min(170, 300). + * + * Input: + * - ISAC_main_inst : iSAC instance + * - maxPayloadBytes : maximum size of the payload in bytes + * valid values are between 120 and 400 bytes + * if encoder sampling rate is 16 kHz. For + * 32 kHz encoder sampling rate valid values + * are between 120 and 600 bytes. + * + * Return value : 0 if successful + * -1 if error happens + */ + + WebRtc_Word16 WebRtcIsac_SetMaxPayloadSize( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 maxPayloadBytes); + + + /****************************************************************************** + * WebRtcIsac_SetMaxRate(...) + * + * This function sets the maximum rate which the codec may not exceed for + * any signal packet. The maximum rate is defined and payload-size per + * frame-size in bits per second. + * + * The codec has a maximum rate of 53400 bits per second (200 bytes per 30 + * ms) if the encoder sampling rate is 16kHz, and 160 kbps (600 bytes/30 ms) + * if the encoder sampling rate is 32 kHz. + * + * It is possible to set a maximum rate between 32000 and 53400 bits/sec + * in wideband mode, and 32000 to 160000 bits/sec in super-wideband mode. + * + * If an out of range limit is used, the function returns -1, but the closest + * valid value will be applied. + * + * --------------- + * IMPORTANT NOTES + * --------------- + * The size of a packet is limited to the minimum of 'max-payload-size' and + * 'max-rate.' For instance, let's assume the max-payload-size is set to + * 170 bytes, and max-rate is set to 40 kbps. Note that a limit of 40 kbps + * translates to 150 bytes for 30ms frame-size & 300 bytes for 60ms + * frame-size. Then a packet with a frame-size of 30 ms is limited to 150, + * i.e. min(170, 150), and a packet with 60 ms frame-size is limited to + * 170 bytes, min(170, 300). + * + * Input: + * - ISAC_main_inst : iSAC instance + * - maxRate : maximum rate in bits per second, + * valid values are 32000 to 53400 bits/sec in + * wideband mode, and 32000 to 160000 bits/sec in + * super-wideband mode. + * + * Return value : 0 if successful + * -1 if error happens + */ + + WebRtc_Word16 WebRtcIsac_SetMaxRate( + ISACStruct* ISAC_main_inst, + WebRtc_Word32 maxRate); + + + /****************************************************************************** + * WebRtcIsac_DecSampRate() + * Return the sampling rate of the decoded audio. + * + * Input: + * - ISAC_main_inst : iSAC instance + * + * Return value : enumerator representing sampling frequency + * associated with the decoder, i.e. the + * sampling rate of the decoded audio. + * + */ + + enum IsacSamplingRate WebRtcIsac_DecSampRate( + ISACStruct* ISAC_main_inst); + + + /****************************************************************************** + * WebRtcIsac_EncSampRate() + * + * Input: + * - ISAC_main_inst : iSAC instance + * + * Return value : enumerator representing sampling frequency + * associated with the encoder, the input audio + * is expected to be sampled at this rate. + * + */ + + enum IsacSamplingRate WebRtcIsac_EncSampRate( + ISACStruct* ISAC_main_inst); + + + /****************************************************************************** + * WebRtcIsac_SetDecSampRate() + * Set the sampling rate of the decoder. Initialization of the decoder WILL + * NOT overwrite the sampling rate of the encoder. The default value is 16 kHz + * which is set when the instance is created. + * + * Input: + * - ISAC_main_inst : iSAC instance + * - sampRate : enumerator specifying the sampling rate. + * + * Return value : 0 if successful + * -1 if failed. + */ + + WebRtc_Word16 WebRtcIsac_SetDecSampRate( + ISACStruct* ISAC_main_inst, + enum IsacSamplingRate sampRate); + + + /****************************************************************************** + * WebRtcIsac_SetEncSampRate() + * Set the sampling rate of the encoder. Initialization of the encoder WILL + * NOT overwrite the sampling rate of the encoder. The default value is 16 kHz + * which is set when the instance is created. The encoding-mode and the + * bottleneck remain unchanged by this call, however, the maximum rate and + * maximum payload-size will reset to their default value. + * + * Input: + * - ISAC_main_inst : iSAC instance + * - sampRate : enumerator specifying the sampling rate. + * + * Return value : 0 if successful + * -1 if failed. + */ + + WebRtc_Word16 WebRtcIsac_SetEncSampRate( + ISACStruct* ISAC_main_inst, + enum IsacSamplingRate sampRate); + + + + /****************************************************************************** + * WebRtcIsac_GetNewBitStream(...) + * + * This function returns encoded data, with the recieved bwe-index in the + * stream. If the rate is set to a value less than bottleneck of codec + * the new bistream will be re-encoded with the given target rate. + * It should always return a complete packet, i.e. only called once + * even for 60 msec frames. + * + * NOTE 1! This function does not write in the ISACStruct, it is not allowed. + * NOTE 2! Currently not implemented for SWB mode. + * NOTE 3! Rates larger than the bottleneck of the codec will be limited + * to the current bottleneck. + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - bweIndex : Index of bandwidth estimate to put in new + * bitstream + * - rate : target rate of the transcoder is bits/sec. + * Valid values are the accepted rate in iSAC, + * i.e. 10000 to 56000. + * - isRCU : if the new bit-stream is an RCU stream. + * Note that the rate parameter always indicates + * the target rate of the main paylaod, regardless + * of 'isRCU' value. + * + * Output: + * - encoded : The encoded data vector + * + * Return value : >0 - Length (in bytes) of coded data + * -1 - Error or called in SWB mode + * NOTE! No error code is written to + * the struct since it is only allowed to read + * the struct. + */ + WebRtc_Word16 WebRtcIsac_GetNewBitStream( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 bweIndex, + WebRtc_Word16 jitterInfo, + WebRtc_Word32 rate, + WebRtc_Word16* encoded, + WebRtc_Word16 isRCU); + + + + /**************************************************************************** + * WebRtcIsac_GetDownLinkBwIndex(...) + * + * This function returns index representing the Bandwidth estimate from + * other side to this side. + * + * Input: + * - ISAC_main_inst : iSAC struct + * + * Output: + * - bweIndex : Bandwidth estimate to transmit to other side. + * + */ + + WebRtc_Word16 WebRtcIsac_GetDownLinkBwIndex( + ISACStruct* ISAC_main_inst, + WebRtc_Word16* bweIndex, + WebRtc_Word16* jitterInfo); + + + /**************************************************************************** + * WebRtcIsac_UpdateUplinkBw(...) + * + * This function takes an index representing the Bandwidth estimate from + * this side to other side and updates BWE. + * + * Input: + * - ISAC_main_inst : iSAC struct + * - bweIndex : Bandwidth estimate from other side. + * + */ + + WebRtc_Word16 WebRtcIsac_UpdateUplinkBw( + ISACStruct* ISAC_main_inst, + WebRtc_Word16 bweIndex); + + + /**************************************************************************** + * WebRtcIsac_ReadBwIndex(...) + * + * This function returns the index of the Bandwidth estimate from the bitstream. + * + * Input: + * - encoded : Encoded bitstream + * + * Output: + * - frameLength : Length of frame in packet (in samples) + * - bweIndex : Bandwidth estimate in bitstream + * + */ + + WebRtc_Word16 WebRtcIsac_ReadBwIndex( + const WebRtc_Word16* encoded, + WebRtc_Word16* bweIndex); + + + + /******************************************************************************* + * WebRtcIsac_GetNewFrameLen(...) + * + * returns the frame lenght (in samples) of the next packet. In the case of channel-adaptive + * mode, iSAC decides on its frame lenght based on the estimated bottleneck + * this allows a user to prepare for the next packet (at the encoder) + * + * The primary usage is in CE to make the iSAC works in channel-adaptive mode + * + * Input: + * - ISAC_main_inst : iSAC struct + * + * Return Value : frame lenght in samples + * + */ + + WebRtc_Word16 WebRtcIsac_GetNewFrameLen( + ISACStruct* ISAC_main_inst); + + + /**************************************************************************** + * WebRtcIsac_GetRedPayload(...) + * + * Populates "encoded" with the redundant payload of the recently encoded + * frame. This function has to be called once that WebRtcIsac_Encode(...) + * returns a positive value. Regardless of the frame-size this function will + * be called only once after encoding is completed. + * + * Input: + * - ISAC_main_inst : iSAC struct + * + * Output: + * - encoded : the encoded data vector + * + * + * Return value: + * : >0 - Length (in bytes) of coded data + * : -1 - Error + * + * + */ + WebRtc_Word16 WebRtcIsac_GetRedPayload( + ISACStruct* ISAC_main_inst, + WebRtc_Word16* encoded); + + + /**************************************************************************** + * WebRtcIsac_DecodeRcu(...) + * + * This function decodes a redundant (RCU) iSAC frame. Function is called in + * NetEq with a stored RCU payload i case of packet loss. Output speech length + * will be a multiple of 480 samples: 480 or 960 samples, + * depending on the framesize (30 or 60 ms). + * + * Input: + * - ISAC_main_inst : ISAC instance. + * - encoded : encoded ISAC RCU frame(s) + * - len : bytes in encoded vector + * + * Output: + * - decoded : The decoded vector + * + * Return value : >0 - number of samples in decoded vector + * -1 - Error + */ + WebRtc_Word16 WebRtcIsac_DecodeRcu( + ISACStruct* ISAC_main_inst, + const WebRtc_UWord16* encoded, + WebRtc_Word16 len, + WebRtc_Word16* decoded, + WebRtc_Word16* speechType); + + +#if defined(__cplusplus) +} +#endif + + + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_ISAC_H_ */ diff --git a/src/mod/codecs/mod_isac/lattice.c b/src/mod/codecs/mod_isac/lattice.c new file mode 100644 index 0000000000..a46135a3f7 --- /dev/null +++ b/src/mod/codecs/mod_isac/lattice.c @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * lattice.c + * + * contains the normalized lattice filter routines (MA and AR) for iSAC codec + * + */ +#include "settings.h" +#include "codec.h" + +#include +#include +#ifdef WEBRTC_ANDROID +#include +#endif + +/* filter the signal using normalized lattice filter */ +/* MA filter */ +void WebRtcIsac_NormLatticeFilterMa(int orderCoef, + float *stateF, + float *stateG, + float *lat_in, + double *filtcoeflo, + double *lat_out) +{ + int n,k,i,u,temp1; + int ord_1 = orderCoef+1; + float sth[MAX_AR_MODEL_ORDER]; + float cth[MAX_AR_MODEL_ORDER]; + float inv_cth[MAX_AR_MODEL_ORDER]; + double a[MAX_AR_MODEL_ORDER+1]; + float f[MAX_AR_MODEL_ORDER+1][HALF_SUBFRAMELEN], g[MAX_AR_MODEL_ORDER+1][HALF_SUBFRAMELEN]; + float gain1; + + for (u=0;u=0;i--) //get the state of f&g for the first input, for all orders + { + ARf[i][0] = cth[i]*ARf[i+1][0] - sth[i]*stateG[i]; + ARg[i+1][0] = sth[i]*ARf[i+1][0] + cth[i]* stateG[i]; + } + ARg[0][0] = ARf[0][0]; + + for(n=0;n<(HALF_SUBFRAMELEN-1);n++) + { + for(k=orderCoef-1;k>=0;k--) + { + ARf[k][n+1] = cth[k]*ARf[k+1][n+1] - sth[k]*ARg[k][n]; + ARg[k+1][n+1] = sth[k]*ARf[k+1][n+1] + cth[k]* ARg[k][n]; + } + ARg[0][n+1] = ARf[0][n+1]; + } + + memcpy(lat_out+u * HALF_SUBFRAMELEN, &(ARf[0][0]), sizeof(float) * HALF_SUBFRAMELEN); + + /* cannot use memcpy in the following */ + for (i=0;i0; m--) + { + tmp_inv = 1.0f / cth2; + for (k=1; k<=m; k++) + { + tmp[k] = ((float)a[k] - sth[m] * (float)a[m-k+1]) * tmp_inv; + } + + for (k=1; k= 0; i--) + { + temp1W32 = WEBRTC_SPL_LSHIFT_W32(R[i], norm); + // Put R in hi and low format + R_hi[i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + R_low[i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)R_hi[i], 16)), 1); + } + + // K = A[1] = -R[1] / R[0] + + temp2W32 = WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)R_hi[1],16) + + WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)R_low[1],1); // R[1] in Q31 + temp3W32 = WEBRTC_SPL_ABS_W32(temp2W32); // abs R[1] + temp1W32 = WebRtcSpl_DivW32HiLow(temp3W32, R_hi[0], R_low[0]); // abs(R[1])/R[0] in Q31 + // Put back the sign on R[1] + if (temp2W32 > 0) + { + temp1W32 = -temp1W32; + } + + // Put K in hi and low format + K_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + K_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)K_hi, 16)), 1); + + // Store first reflection coefficient + K[0] = K_hi; + + temp1W32 = WEBRTC_SPL_RSHIFT_W32(temp1W32, 4); // A[1] in Q27 + + // Put A[1] in hi and low format + A_hi[1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + A_low[1] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)A_hi[1], 16)), 1); + + // Alpha = R[0] * (1-K^2) + + temp1W32 = (((WEBRTC_SPL_MUL_16_16(K_hi, K_low) >> 14) + WEBRTC_SPL_MUL_16_16(K_hi, K_hi)) + << 1); // temp1W32 = k^2 in Q31 + + temp1W32 = WEBRTC_SPL_ABS_W32(temp1W32); // Guard against <0 + temp1W32 = (WebRtc_Word32)0x7fffffffL - temp1W32; // temp1W32 = (1 - K[0]*K[0]) in Q31 + + // Store temp1W32 = 1 - K[0]*K[0] on hi and low format + tmp_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + tmp_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)tmp_hi, 16)), 1); + + // Calculate Alpha in Q31 + temp1W32 = ((WEBRTC_SPL_MUL_16_16(R_hi[0], tmp_hi) + + (WEBRTC_SPL_MUL_16_16(R_hi[0], tmp_low) >> 15) + + (WEBRTC_SPL_MUL_16_16(R_low[0], tmp_hi) >> 15)) << 1); + + // Normalize Alpha and put it in hi and low format + + Alpha_exp = WebRtcSpl_NormW32(temp1W32); + temp1W32 = WEBRTC_SPL_LSHIFT_W32(temp1W32, Alpha_exp); + Alpha_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + Alpha_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)Alpha_hi, 16)), 1); + + // Perform the iterative calculations in the Levinson-Durbin algorithm + + for (i = 2; i <= order; i++) + { + /* ---- + temp1W32 = R[i] + > R[j]*A[i-j] + / + ---- + j=1..i-1 + */ + + temp1W32 = 0; + + for (j = 1; j < i; j++) + { + // temp1W32 is in Q31 + temp1W32 += ((WEBRTC_SPL_MUL_16_16(R_hi[j], A_hi[i-j]) << 1) + + (((WEBRTC_SPL_MUL_16_16(R_hi[j], A_low[i-j]) >> 15) + + (WEBRTC_SPL_MUL_16_16(R_low[j], A_hi[i-j]) >> 15)) << 1)); + } + + temp1W32 = WEBRTC_SPL_LSHIFT_W32(temp1W32, 4); + temp1W32 += (WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)R_hi[i], 16) + + WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)R_low[i], 1)); + + // K = -temp1W32 / Alpha + temp2W32 = WEBRTC_SPL_ABS_W32(temp1W32); // abs(temp1W32) + temp3W32 = WebRtcSpl_DivW32HiLow(temp2W32, Alpha_hi, Alpha_low); // abs(temp1W32)/Alpha + + // Put the sign of temp1W32 back again + if (temp1W32 > 0) + { + temp3W32 = -temp3W32; + } + + // Use the Alpha shifts from earlier to de-normalize + norm = WebRtcSpl_NormW32(temp3W32); + if ((Alpha_exp <= norm) || (temp3W32 == 0)) + { + temp3W32 = WEBRTC_SPL_LSHIFT_W32(temp3W32, Alpha_exp); + } else + { + if (temp3W32 > 0) + { + temp3W32 = (WebRtc_Word32)0x7fffffffL; + } else + { + temp3W32 = (WebRtc_Word32)0x80000000L; + } + } + + // Put K on hi and low format + K_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp3W32, 16); + K_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp3W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)K_hi, 16)), 1); + + // Store Reflection coefficient in Q15 + K[i - 1] = K_hi; + + // Test for unstable filter. + // If unstable return 0 and let the user decide what to do in that case + + if ((WebRtc_Word32)WEBRTC_SPL_ABS_W16(K_hi) > (WebRtc_Word32)32750) + { + return 0; // Unstable filter + } + + /* + Compute updated LPC coefficient: Anew[i] + Anew[j]= A[j] + K*A[i-j] for j=1..i-1 + Anew[i]= K + */ + + for (j = 1; j < i; j++) + { + // temp1W32 = A[j] in Q27 + temp1W32 = WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)A_hi[j],16) + + WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)A_low[j],1); + + // temp1W32 += K*A[i-j] in Q27 + temp1W32 += ((WEBRTC_SPL_MUL_16_16(K_hi, A_hi[i-j]) + + (WEBRTC_SPL_MUL_16_16(K_hi, A_low[i-j]) >> 15) + + (WEBRTC_SPL_MUL_16_16(K_low, A_hi[i-j]) >> 15)) << 1); + + // Put Anew in hi and low format + A_upd_hi[j] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + A_upd_low[j] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)A_upd_hi[j], 16)), 1); + } + + // temp3W32 = K in Q27 (Convert from Q31 to Q27) + temp3W32 = WEBRTC_SPL_RSHIFT_W32(temp3W32, 4); + + // Store Anew in hi and low format + A_upd_hi[i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp3W32, 16); + A_upd_low[i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp3W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)A_upd_hi[i], 16)), 1); + + // Alpha = Alpha * (1-K^2) + + temp1W32 = (((WEBRTC_SPL_MUL_16_16(K_hi, K_low) >> 14) + + WEBRTC_SPL_MUL_16_16(K_hi, K_hi)) << 1); // K*K in Q31 + + temp1W32 = WEBRTC_SPL_ABS_W32(temp1W32); // Guard against <0 + temp1W32 = (WebRtc_Word32)0x7fffffffL - temp1W32; // 1 - K*K in Q31 + + // Convert 1- K^2 in hi and low format + tmp_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + tmp_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)tmp_hi, 16)), 1); + + // Calculate Alpha = Alpha * (1-K^2) in Q31 + temp1W32 = ((WEBRTC_SPL_MUL_16_16(Alpha_hi, tmp_hi) + + (WEBRTC_SPL_MUL_16_16(Alpha_hi, tmp_low) >> 15) + + (WEBRTC_SPL_MUL_16_16(Alpha_low, tmp_hi) >> 15)) << 1); + + // Normalize Alpha and store it on hi and low format + + norm = WebRtcSpl_NormW32(temp1W32); + temp1W32 = WEBRTC_SPL_LSHIFT_W32(temp1W32, norm); + + Alpha_hi = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(temp1W32, 16); + Alpha_low = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32 + - WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)Alpha_hi, 16)), 1); + + // Update the total normalization of Alpha + Alpha_exp = Alpha_exp + norm; + + // Update A[] + + for (j = 1; j <= i; j++) + { + A_hi[j] = A_upd_hi[j]; + A_low[j] = A_upd_low[j]; + } + } + + /* + Set A[0] to 1.0 and store the A[i] i=1...order in Q12 + (Convert from Q27 and use rounding) + */ + + A[0] = 4096; + + for (i = 1; i <= order; i++) + { + // temp1W32 in Q27 + temp1W32 = WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)A_hi[i], 16) + + WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)A_low[i], 1); + // Round and store upper word + A[i] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32((temp1W32<<1)+(WebRtc_Word32)32768, 16); + } + return 1; // Stable filters +} diff --git a/src/mod/codecs/mod_isac/lpc_analysis.c b/src/mod/codecs/mod_isac/lpc_analysis.c new file mode 100644 index 0000000000..854b2d733c --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_analysis.c @@ -0,0 +1,535 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "lpc_analysis.h" +#include "settings.h" +#include "codec.h" +#include "entropy_coding.h" + +#include +#include + +#define LEVINSON_EPS 1.0e-10 + + +/* window */ +/* Matlab generation code: + * t = (1:256)/257; r = 1-(1-t).^.45; w = sin(r*pi).^3; w = w/sum(w); plot((1:256)/8, w); grid; + * for k=1:16, fprintf(1, '%.8f, ', w(k*16 + (-15:0))); fprintf(1, '\n'); end + */ +static const double kLpcCorrWindow[WINLEN] = { + 0.00000000, 0.00000001, 0.00000004, 0.00000010, 0.00000020, + 0.00000035, 0.00000055, 0.00000083, 0.00000118, 0.00000163, + 0.00000218, 0.00000283, 0.00000361, 0.00000453, 0.00000558, 0.00000679, + 0.00000817, 0.00000973, 0.00001147, 0.00001342, 0.00001558, + 0.00001796, 0.00002058, 0.00002344, 0.00002657, 0.00002997, + 0.00003365, 0.00003762, 0.00004190, 0.00004651, 0.00005144, 0.00005673, + 0.00006236, 0.00006837, 0.00007476, 0.00008155, 0.00008875, + 0.00009636, 0.00010441, 0.00011290, 0.00012186, 0.00013128, + 0.00014119, 0.00015160, 0.00016252, 0.00017396, 0.00018594, 0.00019846, + 0.00021155, 0.00022521, 0.00023946, 0.00025432, 0.00026978, + 0.00028587, 0.00030260, 0.00031998, 0.00033802, 0.00035674, + 0.00037615, 0.00039626, 0.00041708, 0.00043863, 0.00046092, 0.00048396, + 0.00050775, 0.00053233, 0.00055768, 0.00058384, 0.00061080, + 0.00063858, 0.00066720, 0.00069665, 0.00072696, 0.00075813, + 0.00079017, 0.00082310, 0.00085692, 0.00089164, 0.00092728, 0.00096384, + 0.00100133, 0.00103976, 0.00107914, 0.00111947, 0.00116077, + 0.00120304, 0.00124630, 0.00129053, 0.00133577, 0.00138200, + 0.00142924, 0.00147749, 0.00152676, 0.00157705, 0.00162836, 0.00168070, + 0.00173408, 0.00178850, 0.00184395, 0.00190045, 0.00195799, + 0.00201658, 0.00207621, 0.00213688, 0.00219860, 0.00226137, + 0.00232518, 0.00239003, 0.00245591, 0.00252284, 0.00259079, 0.00265977, + 0.00272977, 0.00280078, 0.00287280, 0.00294582, 0.00301984, + 0.00309484, 0.00317081, 0.00324774, 0.00332563, 0.00340446, + 0.00348421, 0.00356488, 0.00364644, 0.00372889, 0.00381220, 0.00389636, + 0.00398135, 0.00406715, 0.00415374, 0.00424109, 0.00432920, + 0.00441802, 0.00450754, 0.00459773, 0.00468857, 0.00478001, + 0.00487205, 0.00496464, 0.00505775, 0.00515136, 0.00524542, 0.00533990, + 0.00543476, 0.00552997, 0.00562548, 0.00572125, 0.00581725, + 0.00591342, 0.00600973, 0.00610612, 0.00620254, 0.00629895, + 0.00639530, 0.00649153, 0.00658758, 0.00668341, 0.00677894, 0.00687413, + 0.00696891, 0.00706322, 0.00715699, 0.00725016, 0.00734266, + 0.00743441, 0.00752535, 0.00761540, 0.00770449, 0.00779254, + 0.00787947, 0.00796519, 0.00804963, 0.00813270, 0.00821431, 0.00829437, + 0.00837280, 0.00844949, 0.00852436, 0.00859730, 0.00866822, + 0.00873701, 0.00880358, 0.00886781, 0.00892960, 0.00898884, + 0.00904542, 0.00909923, 0.00915014, 0.00919805, 0.00924283, 0.00928436, + 0.00932252, 0.00935718, 0.00938821, 0.00941550, 0.00943890, + 0.00945828, 0.00947351, 0.00948446, 0.00949098, 0.00949294, + 0.00949020, 0.00948262, 0.00947005, 0.00945235, 0.00942938, 0.00940099, + 0.00936704, 0.00932738, 0.00928186, 0.00923034, 0.00917268, + 0.00910872, 0.00903832, 0.00896134, 0.00887763, 0.00878706, + 0.00868949, 0.00858478, 0.00847280, 0.00835343, 0.00822653, 0.00809199, + 0.00794970, 0.00779956, 0.00764145, 0.00747530, 0.00730103, + 0.00711857, 0.00692787, 0.00672888, 0.00652158, 0.00630597, + 0.00608208, 0.00584994, 0.00560962, 0.00536124, 0.00510493, 0.00484089, + 0.00456935, 0.00429062, 0.00400505, 0.00371310, 0.00341532, + 0.00311238, 0.00280511, 0.00249452, 0.00218184, 0.00186864, + 0.00155690, 0.00124918, 0.00094895, 0.00066112, 0.00039320, 0.00015881 +}; + +double WebRtcIsac_LevDurb(double *a, double *k, double *r, int order) +{ + + double sum, alpha; + int m, m_h, i; + alpha = 0; //warning -DH + a[0] = 1.0; + if (r[0] < LEVINSON_EPS) { /* if r[0] <= 0, set LPC coeff. to zero */ + for (i = 0; i < order; i++) { + k[i] = 0; + a[i+1] = 0; + } + } else { + a[1] = k[0] = -r[1]/r[0]; + alpha = r[0] + r[1] * k[0]; + for (m = 1; m < order; m++){ + sum = r[m + 1]; + for (i = 0; i < m; i++){ + sum += a[i+1] * r[m - i]; + } + k[m] = -sum / alpha; + alpha += k[m] * sum; + m_h = (m + 1) >> 1; + for (i = 0; i < m_h; i++){ + sum = a[i+1] + k[m] * a[m - i]; + a[m - i] += k[m] * a[i+1]; + a[i+1] = sum; + } + a[m+1] = k[m]; + } + } + return alpha; +} + + +//was static before, but didn't work with MEX file +void WebRtcIsac_GetVars(const double *input, const WebRtc_Word16 *pitchGains_Q12, + double *oldEnergy, double *varscale) +{ + double nrg[4], chng, pg; + int k; + + double pitchGains[4]={0,0,0,0};; + + /* Calculate energies of first and second frame halfs */ + nrg[0] = 0.0001; + for (k = QLOOKAHEAD/2; k < (FRAMESAMPLES_QUARTER + QLOOKAHEAD) / 2; k++) { + nrg[0] += input[k]*input[k]; + } + nrg[1] = 0.0001; + for ( ; k < (FRAMESAMPLES_HALF + QLOOKAHEAD) / 2; k++) { + nrg[1] += input[k]*input[k]; + } + nrg[2] = 0.0001; + for ( ; k < (FRAMESAMPLES*3/4 + QLOOKAHEAD) / 2; k++) { + nrg[2] += input[k]*input[k]; + } + nrg[3] = 0.0001; + for ( ; k < (FRAMESAMPLES + QLOOKAHEAD) / 2; k++) { + nrg[3] += input[k]*input[k]; + } + + /* Calculate average level change */ + chng = 0.25 * (fabs(10.0 * log10(nrg[3] / nrg[2])) + + fabs(10.0 * log10(nrg[2] / nrg[1])) + + fabs(10.0 * log10(nrg[1] / nrg[0])) + + fabs(10.0 * log10(nrg[0] / *oldEnergy))); + + + /* Find average pitch gain */ + pg = 0.0; + for (k=0; k<4; k++) + { + pitchGains[k] = ((float)pitchGains_Q12[k])/4096; + pg += pitchGains[k]; + } + pg *= 0.25; + + /* If pitch gain is low and energy constant - increase noise level*/ + /* Matlab code: + pg = 0:.01:.45; plot(pg, 0.0 + 1.0 * exp( -1.0 * exp(-200.0 * pg.*pg.*pg) / (1.0 + 0.4 * 0) )) + */ + *varscale = 0.0 + 1.0 * exp( -1.4 * exp(-200.0 * pg*pg*pg) / (1.0 + 0.4 * chng) ); + + *oldEnergy = nrg[3]; +} + +void +WebRtcIsac_GetVarsUB( + const double* input, + double* oldEnergy, + double* varscale) +{ + double nrg[4], chng; + int k; + + /* Calculate energies of first and second frame halfs */ + nrg[0] = 0.0001; + for (k = 0; k < (FRAMESAMPLES_QUARTER) / 2; k++) { + nrg[0] += input[k]*input[k]; + } + nrg[1] = 0.0001; + for ( ; k < (FRAMESAMPLES_HALF) / 2; k++) { + nrg[1] += input[k]*input[k]; + } + nrg[2] = 0.0001; + for ( ; k < (FRAMESAMPLES*3/4) / 2; k++) { + nrg[2] += input[k]*input[k]; + } + nrg[3] = 0.0001; + for ( ; k < (FRAMESAMPLES) / 2; k++) { + nrg[3] += input[k]*input[k]; + } + + /* Calculate average level change */ + chng = 0.25 * (fabs(10.0 * log10(nrg[3] / nrg[2])) + + fabs(10.0 * log10(nrg[2] / nrg[1])) + + fabs(10.0 * log10(nrg[1] / nrg[0])) + + fabs(10.0 * log10(nrg[0] / *oldEnergy))); + + + /* If pitch gain is low and energy constant - increase noise level*/ + /* Matlab code: + pg = 0:.01:.45; plot(pg, 0.0 + 1.0 * exp( -1.0 * exp(-200.0 * pg.*pg.*pg) / (1.0 + 0.4 * 0) )) + */ + *varscale = exp( -1.4 / (1.0 + 0.4 * chng) ); + + *oldEnergy = nrg[3]; +} + +void WebRtcIsac_GetLpcCoefLb(double *inLo, double *inHi, MaskFiltstr *maskdata, + double signal_noise_ratio, const WebRtc_Word16 *pitchGains_Q12, + double *lo_coeff, double *hi_coeff) +{ + int k, n, j, pos1, pos2; + double varscale; + + double DataLo[WINLEN], DataHi[WINLEN]; + double corrlo[ORDERLO+2], corrlo2[ORDERLO+1]; + double corrhi[ORDERHI+1]; + double k_veclo[ORDERLO], k_vechi[ORDERHI]; + + double a_LO[ORDERLO+1], a_HI[ORDERHI+1]; + double tmp, res_nrg; + + double FwdA, FwdB; + + /* hearing threshold level in dB; higher value gives more noise */ + const double HearThresOffset = -28.0; + + /* bandwdith expansion factors for low- and high band */ + const double gammaLo = 0.9; + const double gammaHi = 0.8; + + /* less-noise-at-low-frequencies factor */ + double aa; + + + /* convert from dB to signal level */ + const double H_T_H = pow(10.0, 0.05 * HearThresOffset); + double S_N_R = pow(10.0, 0.05 * signal_noise_ratio) / 3.46; /* divide by sqrt(12) */ + + /* change quallevel depending on pitch gains and level fluctuations */ + WebRtcIsac_GetVars(inLo, pitchGains_Q12, &(maskdata->OldEnergy), &varscale); + + /* less-noise-at-low-frequencies factor */ + aa = 0.35 * (0.5 + 0.5 * varscale); + + /* replace data in buffer by new look-ahead data */ + for (pos1 = 0; pos1 < QLOOKAHEAD; pos1++) + maskdata->DataBufferLo[pos1 + WINLEN - QLOOKAHEAD] = inLo[pos1]; + + for (k = 0; k < SUBFRAMES; k++) { + + /* Update input buffer and multiply signal with window */ + for (pos1 = 0; pos1 < WINLEN - UPDATE/2; pos1++) { + maskdata->DataBufferLo[pos1] = maskdata->DataBufferLo[pos1 + UPDATE/2]; + maskdata->DataBufferHi[pos1] = maskdata->DataBufferHi[pos1 + UPDATE/2]; + DataLo[pos1] = maskdata->DataBufferLo[pos1] * kLpcCorrWindow[pos1]; + DataHi[pos1] = maskdata->DataBufferHi[pos1] * kLpcCorrWindow[pos1]; + } + pos2 = k * UPDATE/2; + for (n = 0; n < UPDATE/2; n++, pos1++) { + maskdata->DataBufferLo[pos1] = inLo[QLOOKAHEAD + pos2]; + maskdata->DataBufferHi[pos1] = inHi[pos2++]; + DataLo[pos1] = maskdata->DataBufferLo[pos1] * kLpcCorrWindow[pos1]; + DataHi[pos1] = maskdata->DataBufferHi[pos1] * kLpcCorrWindow[pos1]; + } + + /* Get correlation coefficients */ + WebRtcIsac_AutoCorr(corrlo, DataLo, WINLEN, ORDERLO+1); /* computing autocorrelation */ + WebRtcIsac_AutoCorr(corrhi, DataHi, WINLEN, ORDERHI); + + + /* less noise for lower frequencies, by filtering/scaling autocorrelation sequences */ + corrlo2[0] = (1.0+aa*aa) * corrlo[0] - 2.0*aa * corrlo[1]; + tmp = (1.0 + aa*aa); + for (n = 1; n <= ORDERLO; n++) { + corrlo2[n] = tmp * corrlo[n] - aa * (corrlo[n-1] + corrlo[n+1]); + } + tmp = (1.0+aa) * (1.0+aa); + for (n = 0; n <= ORDERHI; n++) { + corrhi[n] = tmp * corrhi[n]; + } + + /* add white noise floor */ + corrlo2[0] += 1e-6; + corrhi[0] += 1e-6; + + + FwdA = 0.01; + FwdB = 0.01; + + /* recursive filtering of correlation over subframes */ + for (n = 0; n <= ORDERLO; n++) { + maskdata->CorrBufLo[n] = FwdA * maskdata->CorrBufLo[n] + corrlo2[n]; + corrlo2[n] = ((1.0-FwdA)*FwdB) * maskdata->CorrBufLo[n] + (1.0-FwdB) * corrlo2[n]; + } + for (n = 0; n <= ORDERHI; n++) { + maskdata->CorrBufHi[n] = FwdA * maskdata->CorrBufHi[n] + corrhi[n]; + corrhi[n] = ((1.0-FwdA)*FwdB) * maskdata->CorrBufHi[n] + (1.0-FwdB) * corrhi[n]; + } + + /* compute prediction coefficients */ + WebRtcIsac_LevDurb(a_LO, k_veclo, corrlo2, ORDERLO); + WebRtcIsac_LevDurb(a_HI, k_vechi, corrhi, ORDERHI); + + /* bandwidth expansion */ + tmp = gammaLo; + for (n = 1; n <= ORDERLO; n++) { + a_LO[n] *= tmp; + tmp *= gammaLo; + } + + /* residual energy */ + res_nrg = 0.0; + for (j = 0; j <= ORDERLO; j++) { + for (n = 0; n <= j; n++) { + res_nrg += a_LO[j] * corrlo2[j-n] * a_LO[n]; + } + for (n = j+1; n <= ORDERLO; n++) { + res_nrg += a_LO[j] * corrlo2[n-j] * a_LO[n]; + } + } + + /* add hearing threshold and compute the gain */ + *lo_coeff++ = S_N_R / (sqrt(res_nrg) / varscale + H_T_H); + + /* copy coefficients to output array */ + for (n = 1; n <= ORDERLO; n++) { + *lo_coeff++ = a_LO[n]; + } + + + /* bandwidth expansion */ + tmp = gammaHi; + for (n = 1; n <= ORDERHI; n++) { + a_HI[n] *= tmp; + tmp *= gammaHi; + } + + /* residual energy */ + res_nrg = 0.0; + for (j = 0; j <= ORDERHI; j++) { + for (n = 0; n <= j; n++) { + res_nrg += a_HI[j] * corrhi[j-n] * a_HI[n]; + } + for (n = j+1; n <= ORDERHI; n++) { + res_nrg += a_HI[j] * corrhi[n-j] * a_HI[n]; + } + } + + /* add hearing threshold and compute of the gain */ + *hi_coeff++ = S_N_R / (sqrt(res_nrg) / varscale + H_T_H); + + /* copy coefficients to output array */ + for (n = 1; n <= ORDERHI; n++) { + *hi_coeff++ = a_HI[n]; + } + } +} + + + +/****************************************************************************** + * WebRtcIsac_GetLpcCoefUb() + * + * Compute LP coefficients and correlation coefficients. At 12 kHz LP + * coefficients of the first and the last sub-frame is computed. At 16 kHz + * LP coefficients of 4th, 8th and 12th sub-frames are computed. We always + * compute correlation coefficients of all sub-frames. + * + * Inputs: + * -inSignal : Input signal + * -maskdata : a structure keeping signal from previous frame. + * -bandwidth : specifies if the codec is in 0-16 kHz mode or + * 0-12 kHz mode. + * + * Outputs: + * -lpCoeff : pointer to a buffer where A-polynomials are + * written to (first coeff is 1 and it is not + * written) + * -corrMat : a matrix where correlation coefficients of each + * sub-frame are written to one row. + * -varscale : a scale used to compute LPC gains. + */ +void +WebRtcIsac_GetLpcCoefUb( + double* inSignal, + MaskFiltstr* maskdata, + double* lpCoeff, + double corrMat[][UB_LPC_ORDER + 1], + double* varscale, + WebRtc_Word16 bandwidth) +{ + int frameCntr, activeFrameCntr, n, pos1, pos2; + WebRtc_Word16 criterion1; + WebRtc_Word16 criterion2; + WebRtc_Word16 numSubFrames = SUBFRAMES * (1 + (bandwidth == isac16kHz)); + double data[WINLEN]; + double corrSubFrame[UB_LPC_ORDER+2]; + double reflecCoeff[UB_LPC_ORDER]; + + double aPolynom[UB_LPC_ORDER+1]; + double tmp; + + /* bandwdith expansion factors */ + const double gamma = 0.9; + + /* change quallevel depending on pitch gains and level fluctuations */ + WebRtcIsac_GetVarsUB(inSignal, &(maskdata->OldEnergy), varscale); + + /* replace data in buffer by new look-ahead data */ + for(frameCntr = 0, activeFrameCntr = 0; frameCntr < numSubFrames; + frameCntr++) + { + if(frameCntr == SUBFRAMES) + { + // we are in 16 kHz + varscale++; + WebRtcIsac_GetVarsUB(&inSignal[FRAMESAMPLES_HALF], + &(maskdata->OldEnergy), varscale); + } + /* Update input buffer and multiply signal with window */ + for(pos1 = 0; pos1 < WINLEN - UPDATE/2; pos1++) + { + maskdata->DataBufferLo[pos1] = maskdata->DataBufferLo[pos1 + + UPDATE/2]; + data[pos1] = maskdata->DataBufferLo[pos1] * kLpcCorrWindow[pos1]; + } + pos2 = frameCntr * UPDATE/2; + for(n = 0; n < UPDATE/2; n++, pos1++, pos2++) + { + maskdata->DataBufferLo[pos1] = inSignal[pos2]; + data[pos1] = maskdata->DataBufferLo[pos1] * kLpcCorrWindow[pos1]; + } + + /* Get correlation coefficients */ + /* computing autocorrelation */ + WebRtcIsac_AutoCorr(corrSubFrame, data, WINLEN, UB_LPC_ORDER+1); + memcpy(corrMat[frameCntr], corrSubFrame, + (UB_LPC_ORDER+1)*sizeof(double)); + + criterion1 = ((frameCntr == 0) || (frameCntr == (SUBFRAMES - 1))) && + (bandwidth == isac12kHz); + criterion2 = (((frameCntr+1) % 4) == 0) && + (bandwidth == isac16kHz); + if(criterion1 || criterion2) + { + /* add noise */ + corrSubFrame[0] += 1e-6; + /* compute prediction coefficients */ + WebRtcIsac_LevDurb(aPolynom, reflecCoeff, corrSubFrame, + UB_LPC_ORDER); + + /* bandwidth expansion */ + tmp = gamma; + for (n = 1; n <= UB_LPC_ORDER; n++) + { + *lpCoeff++ = aPolynom[n] * tmp; + tmp *= gamma; + } + activeFrameCntr++; + } + } +} + + + +/****************************************************************************** + * WebRtcIsac_GetLpcGain() + * + * Compute the LPC gains for each sub-frame, given the LPC of each sub-frame + * and the corresponding correlation coefficients. + * + * Inputs: + * -signal_noise_ratio : the desired SNR in dB. + * -numVecs : number of sub-frames + * -corrMat : a matrix of correlation coefficients where + * each row is a set of correlation coefficients of + * one sub-frame. + * -varscale : a scale computed when WebRtcIsac_GetLpcCoefUb() + * is called. + * + * Outputs: + * -gain : pointer to a buffer where LP gains are written. + * + */ +void +WebRtcIsac_GetLpcGain( + double signal_noise_ratio, + const double* filtCoeffVecs, + int numVecs, + double* gain, + double corrMat[][UB_LPC_ORDER + 1], + const double* varscale) +{ + WebRtc_Word16 j, n; + WebRtc_Word16 subFrameCntr; + double aPolynom[ORDERLO + 1]; + double res_nrg; + + const double HearThresOffset = -28.0; + const double H_T_H = pow(10.0, 0.05 * HearThresOffset); + /* divide by sqrt(12) = 3.46 */ + const double S_N_R = pow(10.0, 0.05 * signal_noise_ratio) / 3.46; + + aPolynom[0] = 1; + for(subFrameCntr = 0; subFrameCntr < numVecs; subFrameCntr++) + { + if(subFrameCntr == SUBFRAMES) + { + // we are in second half of a SWB frame. use new varscale + varscale++; + } + memcpy(&aPolynom[1], &filtCoeffVecs[(subFrameCntr * (UB_LPC_ORDER + 1)) + + 1], sizeof(double) * UB_LPC_ORDER); + + /* residual energy */ + res_nrg = 0.0; + for(j = 0; j <= UB_LPC_ORDER; j++) + { + for(n = 0; n <= j; n++) + { + res_nrg += aPolynom[j] * corrMat[subFrameCntr][j-n] * + aPolynom[n]; + } + for(n = j+1; n <= UB_LPC_ORDER; n++) + { + res_nrg += aPolynom[j] * corrMat[subFrameCntr][n-j] * + aPolynom[n]; + } + } + + /* add hearing threshold and compute the gain */ + gain[subFrameCntr] = S_N_R / (sqrt(res_nrg) / *varscale + H_T_H); + } +} diff --git a/src/mod/codecs/mod_isac/lpc_analysis.h b/src/mod/codecs/mod_isac/lpc_analysis.h new file mode 100644 index 0000000000..4eafeac7bc --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_analysis.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * lpc_analysis.h + * + * LPC functions + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_ANALYSIS_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_ANALYSIS_H_ + +#include "settings.h" +#include "structs.h" + +double WebRtcIsac_LevDurb(double *a, double *k, double *r, int order); + +void WebRtcIsac_GetVars(const double *input, const WebRtc_Word16 *pitchGains_Q12, + double *oldEnergy, double *varscale); + +void WebRtcIsac_GetLpcCoefLb(double *inLo, double *inHi, MaskFiltstr *maskdata, + double signal_noise_ratio, const WebRtc_Word16 *pitchGains_Q12, + double *lo_coeff, double *hi_coeff); + + +void WebRtcIsac_GetLpcGain( + double signal_noise_ratio, + const double* filtCoeffVecs, + int numVecs, + double* gain, + double corrLo[][UB_LPC_ORDER + 1], + const double* varscale); + +void WebRtcIsac_GetLpcCoefUb( + double* inSignal, + MaskFiltstr* maskdata, + double* lpCoeff, + double corr[][UB_LPC_ORDER + 1], + double* varscale, + WebRtc_Word16 bandwidth); + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_ANALYIS_H_ */ diff --git a/src/mod/codecs/mod_isac/lpc_gain_swb_tables.c b/src/mod/codecs/mod_isac/lpc_gain_swb_tables.c new file mode 100644 index 0000000000..25c69cbfef --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_gain_swb_tables.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * SWB_KLT_Tables_LPCGain.c + * + * This file defines tables used for entropy coding of LPC Gain + * of upper-band. + * + */ + +#include "lpc_gain_swb_tables.h" +#include "settings.h" +#include "typedefs.h" + +const double WebRtcIsac_kQSizeLpcGain = 0.100000; + +const double WebRtcIsac_kMeanLpcGain = -3.3822; + +/* +* The smallest reconstruction points for quantiztion of +* LPC gains. +*/ +const double WebRtcIsac_kLeftRecPointLpcGain[SUBFRAMES] = +{ + -0.800000, -1.000000, -1.200000, -2.200000, -3.000000, -12.700000 +}; + +/* +* Number of reconstruction points of quantizers for LPC Gains. +*/ +const WebRtc_Word16 WebRtcIsac_kNumQCellLpcGain[SUBFRAMES] = +{ + 17, 20, 25, 45, 77, 170 +}; +/* +* Starting index for entropy decoder to search for the right interval, +* one entry per LAR coefficient +*/ +const WebRtc_UWord16 WebRtcIsac_kLpcGainEntropySearch[SUBFRAMES] = +{ + 8, 10, 12, 22, 38, 85 +}; + +/* +* The following 6 vectors define CDF of 6 decorrelated LPC +* gains. +*/ +const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec0[18] = +{ + 0, 10, 27, 83, 234, 568, 1601, 4683, 16830, 57534, 63437, + 64767, 65229, 65408, 65483, 65514, 65527, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec1[21] = +{ + 0, 15, 33, 84, 185, 385, 807, 1619, 3529, 7850, 19488, + 51365, 62437, 64548, 65088, 65304, 65409, 65484, 65507, 65522, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec2[26] = +{ + 0, 15, 29, 54, 89, 145, 228, 380, 652, 1493, 4260, + 12359, 34133, 50749, 57224, 60814, 62927, 64078, 64742, 65103, 65311, 65418, + 65473, 65509, 65521, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec3[46] = +{ + 0, 8, 12, 16, 26, 42, 56, 76, 111, 164, 247, + 366, 508, 693, 1000, 1442, 2155, 3188, 4854, 7387, 11249, 17617, + 30079, 46711, 56291, 60127, 62140, 63258, 63954, 64384, 64690, 64891, 65031, + 65139, 65227, 65293, 65351, 65399, 65438, 65467, 65492, 65504, 65510, 65518, + 65523, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec4[78] = +{ + 0, 17, 29, 39, 51, 70, 104, 154, 234, 324, 443, + 590, 760, 971, 1202, 1494, 1845, 2274, 2797, 3366, 4088, 4905, + 5899, 7142, 8683, 10625, 12983, 16095, 20637, 28216, 38859, 47237, 51537, + 54150, 56066, 57583, 58756, 59685, 60458, 61103, 61659, 62144, 62550, 62886, + 63186, 63480, 63743, 63954, 64148, 64320, 64467, 64600, 64719, 64837, 64939, + 65014, 65098, 65160, 65211, 65250, 65290, 65325, 65344, 65366, 65391, 65410, + 65430, 65447, 65460, 65474, 65487, 65494, 65501, 65509, 65513, 65518, 65520, + 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec5[171] = +{ + 0, 10, 12, 14, 16, 18, 23, 29, 35, 42, 51, + 58, 65, 72, 78, 87, 96, 103, 111, 122, 134, 150, + 167, 184, 202, 223, 244, 265, 289, 315, 346, 379, 414, + 450, 491, 532, 572, 613, 656, 700, 751, 802, 853, 905, + 957, 1021, 1098, 1174, 1250, 1331, 1413, 1490, 1565, 1647, 1730, + 1821, 1913, 2004, 2100, 2207, 2314, 2420, 2532, 2652, 2783, 2921, + 3056, 3189, 3327, 3468, 3640, 3817, 3993, 4171, 4362, 4554, 4751, + 4948, 5142, 5346, 5566, 5799, 6044, 6301, 6565, 6852, 7150, 7470, + 7797, 8143, 8492, 8835, 9181, 9547, 9919, 10315, 10718, 11136, 11566, + 12015, 12482, 12967, 13458, 13953, 14432, 14903, 15416, 15936, 16452, 16967, + 17492, 18024, 18600, 19173, 19736, 20311, 20911, 21490, 22041, 22597, 23157, + 23768, 24405, 25034, 25660, 26280, 26899, 27614, 28331, 29015, 29702, 30403, + 31107, 31817, 32566, 33381, 34224, 35099, 36112, 37222, 38375, 39549, 40801, + 42074, 43350, 44626, 45982, 47354, 48860, 50361, 51845, 53312, 54739, 56026, + 57116, 58104, 58996, 59842, 60658, 61488, 62324, 63057, 63769, 64285, 64779, + 65076, 65344, 65430, 65500, 65517, 65535 +}; + +/* +* An array of pointers to CDFs of decorrelated LPC Gains +*/ +const WebRtc_UWord16* WebRtcIsac_kLpcGainCdfMat[SUBFRAMES] = +{ + WebRtcIsac_kLpcGainCdfVec0, WebRtcIsac_kLpcGainCdfVec1, + WebRtcIsac_kLpcGainCdfVec2, WebRtcIsac_kLpcGainCdfVec3, + WebRtcIsac_kLpcGainCdfVec4, WebRtcIsac_kLpcGainCdfVec5 +}; + +/* +* A matrix to decorrellate LPC gains of subframes. +*/ +const double WebRtcIsac_kLpcGainDecorrMat[SUBFRAMES][SUBFRAMES] = +{ + {-0.150860, 0.327872, 0.367220, 0.504613, 0.559270, 0.409234}, + { 0.457128, -0.613591, -0.289283, -0.029734, 0.393760, 0.418240}, + {-0.626043, 0.136489, -0.439118, -0.448323, 0.135987, 0.420869}, + { 0.526617, 0.480187, 0.242552, -0.488754, -0.158713, 0.411331}, + {-0.302587, -0.494953, 0.588112, -0.063035, -0.404290, 0.387510}, + { 0.086378, 0.147714, -0.428875, 0.548300, -0.570121, 0.401391} +}; diff --git a/src/mod/codecs/mod_isac/lpc_gain_swb_tables.h b/src/mod/codecs/mod_isac/lpc_gain_swb_tables.h new file mode 100644 index 0000000000..1eba97c8ba --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_gain_swb_tables.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * SWB_KLT_Tables_LPCGain.h + * + * This file declares tables used for entropy coding of LPC Gain + * of upper-band. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_GAIN_SWB_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_GAIN_SWB_TABLES_H_ + +#include "settings.h" +#include "typedefs.h" + +extern const double WebRtcIsac_kQSizeLpcGain; + +extern const double WebRtcIsac_kLeftRecPointLpcGain[SUBFRAMES]; + +extern const WebRtc_Word16 WebRtcIsac_kNumQCellLpcGain[SUBFRAMES]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcGainEntropySearch[SUBFRAMES]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec0[18]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec1[21]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec2[26]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec3[46]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec4[78]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcGainCdfVec5[171]; + +extern const WebRtc_UWord16* WebRtcIsac_kLpcGainCdfMat[SUBFRAMES]; + +extern const double WebRtcIsac_kLpcGainDecorrMat[SUBFRAMES][SUBFRAMES]; + +#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_GAIN_SWB_TABLES_H_ diff --git a/src/mod/codecs/mod_isac/lpc_shape_swb12_tables.c b/src/mod/codecs/mod_isac/lpc_shape_swb12_tables.c new file mode 100644 index 0000000000..695d583277 --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_shape_swb12_tables.c @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * SWB_KLT_Tables.c + * + * This file defines tables used for entropy coding of LPC shape of + * upper-band signal if the bandwidth is 12 kHz. + * + */ + +#include "lpc_shape_swb12_tables.h" +#include "settings.h" +#include "typedefs.h" + +/* +* Mean value of LAR +*/ +const double WebRtcIsac_kMeanLarUb12[UB_LPC_ORDER] = +{ + 0.03748928306641, 0.09453441192543, -0.01112522344398, 0.03800237516842 +}; + +/* +* A rotation matrix to decorrelate intra-vector correlation, +* i.e. correlation among components of LAR vector. +*/ +const double WebRtcIsac_kIntraVecDecorrMatUb12[UB_LPC_ORDER][UB_LPC_ORDER] = +{ + {-0.00075365493856, -0.05809964887743, -0.23397966154116, 0.97050367376411}, + { 0.00625021257734, -0.17299965610679, 0.95977735920651, 0.22104179375008}, + { 0.20543384258374, -0.96202143495696, -0.15301870801552, -0.09432375099565}, + {-0.97865075648479, -0.20300322280841, -0.02581111653779, -0.01913568980258} +}; + +/* +* A rotation matrix to remove correlation among LAR coefficients +* of different LAR vectors. One might guess that decorrelation matrix +* for the first component should differ from the second component +* but we haven't observed a significant benefit of having different +* decorrelation matrices for different components. +*/ +const double WebRtcIsac_kInterVecDecorrMatUb12 +[UB_LPC_VEC_PER_FRAME][UB_LPC_VEC_PER_FRAME] = +{ + { 0.70650597970460, -0.70770707262373}, + {-0.70770707262373, -0.70650597970460} +}; + +/* +* LAR quantization step-size. +*/ +const double WebRtcIsac_kLpcShapeQStepSizeUb12 = 0.150000; + +/* +* The smallest reconstruction points for quantiztion of LAR coefficients. +*/ +const double WebRtcIsac_kLpcShapeLeftRecPointUb12 +[UB_LPC_ORDER*UB_LPC_VEC_PER_FRAME] = +{ + -0.900000, -1.050000, -1.350000, -1.800000, -1.350000, -1.650000, + -2.250000, -3.450000 +}; + +/* +* Number of reconstruction points of quantizers for LAR coefficients. +*/ +const WebRtc_Word16 WebRtcIsac_kLpcShapeNumRecPointUb12 +[UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME] = +{ + 13, 15, 19, 27, 19, 24, 32, 48 +}; + +/* +* Starting index for entropy decoder to search for the right interval, +* one entry per LAR coefficient +*/ +const WebRtc_UWord16 WebRtcIsac_kLpcShapeEntropySearchUb12 +[UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME] = +{ + 6, 7, 9, 13, 9, 12, 16, 24 +}; + +/* +* The following 8 vectors define CDF of 8 decorrelated LAR +* coefficients. +*/ +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec0Ub12[14] = +{ + 0, 13, 95, 418, 1687, 6498, 21317, 44200, 59029, 63849, 65147, + 65449, 65525, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec1Ub12[16] = +{ + 0, 10, 59, 255, 858, 2667, 8200, 22609, 42988, 57202, 62947, + 64743, 65308, 65476, 65522, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec2Ub12[20] = +{ + 0, 18, 40, 118, 332, 857, 2017, 4822, 11321, 24330, 41279, + 54342, 60637, 63394, 64659, 65184, 65398, 65482, 65518, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec3Ub12[28] = +{ + 0, 21, 38, 90, 196, 398, 770, 1400, 2589, 4650, 8211, + 14933, 26044, 39592, 50814, 57452, 60971, 62884, 63995, 64621, 65019, 65273, + 65410, 65480, 65514, 65522, 65531, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec4Ub12[20] = +{ + 0, 7, 46, 141, 403, 969, 2132, 4649, 10633, 24902, 43254, + 54665, 59928, 62674, 64173, 64938, 65293, 65464, 65523, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec5Ub12[25] = +{ + 0, 7, 22, 72, 174, 411, 854, 1737, 3545, 6774, 13165, + 25221, 40980, 52821, 58714, 61706, 63472, 64437, 64989, 65287, 65430, 65503, + 65525, 65529, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec6Ub12[33] = +{ + 0, 11, 21, 36, 65, 128, 228, 401, 707, 1241, 2126, + 3589, 6060, 10517, 18853, 31114, 42477, 49770, 54271, 57467, 59838, 61569, + 62831, 63772, 64433, 64833, 65123, 65306, 65419, 65466, 65499, 65519, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec7Ub12[49] = +{ + 0, 14, 34, 67, 107, 167, 245, 326, 449, 645, 861, + 1155, 1508, 2003, 2669, 3544, 4592, 5961, 7583, 9887, 13256, 18765, + 26519, 34077, 40034, 44349, 47795, 50663, 53262, 55473, 57458, 59122, 60592, + 61742, 62690, 63391, 63997, 64463, 64794, 65045, 65207, 65309, 65394, 65443, + 65478, 65504, 65514, 65523, 65535 +}; + +/* +* An array of pointers to CDFs of decorrelated LARs +*/ +const WebRtc_UWord16* WebRtcIsac_kLpcShapeCdfMatUb12 +[UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME] = +{ + WebRtcIsac_kLpcShapeCdfVec0Ub12, WebRtcIsac_kLpcShapeCdfVec1Ub12, + WebRtcIsac_kLpcShapeCdfVec2Ub12, WebRtcIsac_kLpcShapeCdfVec3Ub12, + WebRtcIsac_kLpcShapeCdfVec4Ub12, WebRtcIsac_kLpcShapeCdfVec5Ub12, + WebRtcIsac_kLpcShapeCdfVec6Ub12, WebRtcIsac_kLpcShapeCdfVec7Ub12 +}; diff --git a/src/mod/codecs/mod_isac/lpc_shape_swb12_tables.h b/src/mod/codecs/mod_isac/lpc_shape_swb12_tables.h new file mode 100644 index 0000000000..1e93847fae --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_shape_swb12_tables.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * lpc_shape_swb12_tables.h + * + * This file declares tables used for entropy coding of LPC shape of + * upper-band signal if the bandwidth is 12 kHz. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_SHAPE_SWB12_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_SHAPE_SWB12_TABLES_H_ + +#include "settings.h" +#include "typedefs.h" + +extern const double WebRtcIsac_kMeanLarUb12[UB_LPC_ORDER]; + +extern const double WebRtcIsac_kMeanLpcGain; + +extern const double WebRtcIsac_kIntraVecDecorrMatUb12[UB_LPC_ORDER][UB_LPC_ORDER]; + +extern const double WebRtcIsac_kInterVecDecorrMatUb12 +[UB_LPC_VEC_PER_FRAME][UB_LPC_VEC_PER_FRAME]; + +extern const double WebRtcIsac_kLpcShapeQStepSizeUb12; + +extern const double WebRtcIsac_kLpcShapeLeftRecPointUb12 +[UB_LPC_ORDER*UB_LPC_VEC_PER_FRAME]; + + +extern const WebRtc_Word16 WebRtcIsac_kLpcShapeNumRecPointUb12 +[UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeEntropySearchUb12 +[UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec0Ub12[14]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec1Ub12[16]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec2Ub12[20]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec3Ub12[28]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec4Ub12[20]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec5Ub12[25]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec6Ub12[33]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec7Ub12[49]; + +extern const WebRtc_UWord16* WebRtcIsac_kLpcShapeCdfMatUb12 +[UB_LPC_ORDER * UB_LPC_VEC_PER_FRAME]; + +#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_SHAPE_SWB12_TABLES_H_ diff --git a/src/mod/codecs/mod_isac/lpc_shape_swb16_tables.c b/src/mod/codecs/mod_isac/lpc_shape_swb16_tables.c new file mode 100644 index 0000000000..89f45233f5 --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_shape_swb16_tables.c @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * SWB16_KLT_Tables.c + * + * This file defines tables used for entropy coding of LPC shape of + * upper-band signal if the bandwidth is 16 kHz. + * + */ + +#include "lpc_shape_swb16_tables.h" +#include "settings.h" +#include "typedefs.h" + +/* +* Mean value of LAR +*/ +const double WebRtcIsac_kMeanLarUb16[UB_LPC_ORDER] = +{ +0.454978, 0.364747, 0.102999, 0.104523 +}; + +/* +* A rotation matrix to decorrelate intra-vector correlation, +* i.e. correlation among components of LAR vector. +*/ +const double WebRtcIsac_kIintraVecDecorrMatUb16[UB_LPC_ORDER][UB_LPC_ORDER] = +{ + {-0.020528, -0.085858, -0.002431, 0.996093}, + {-0.033155, 0.036102, 0.998786, 0.004866}, + { 0.202627, 0.974853, -0.028940, 0.088132}, + {-0.978479, 0.202454, -0.039785, -0.002811} +}; + +/* +* A rotation matrix to remove correlation among LAR coefficients +* of different LAR vectors. One might guess that decorrelation matrix +* for the first component should differ from the second component +* but we haven't observed a significant benefit of having different +* decorrelation matrices for different components. +*/ +const double WebRtcIsac_kInterVecDecorrMatUb16 +[UB16_LPC_VEC_PER_FRAME][UB16_LPC_VEC_PER_FRAME] = +{ + { 0.291675, -0.515786, 0.644927, 0.482658}, + {-0.647220, 0.479712, 0.289556, 0.516856}, + { 0.643084, 0.485489, -0.289307, 0.516763}, + {-0.287185, -0.517823, -0.645389, 0.482553} +}; + +/* +* The following 16 vectors define CDF of 16 decorrelated LAR +* coefficients. +*/ +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub16[14] = +{ + 0, 2, 20, 159, 1034, 5688, 20892, 44653, + 59849, 64485, 65383, 65518, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec1Ub16[16] = +{ + 0, 1, 7, 43, 276, 1496, 6681, 21653, + 43891, 58859, 64022, 65248, 65489, 65529, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec2Ub16[18] = +{ + 0, 1, 9, 54, 238, 933, 3192, 9461, + 23226, 42146, 56138, 62413, 64623, 65300, 65473, 65521, + 65533, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec3Ub16[30] = +{ + 0, 2, 4, 8, 17, 36, 75, 155, + 329, 683, 1376, 2662, 5047, 9508, 17526, 29027, + 40363, 48997, 55096, 59180, 61789, 63407, 64400, 64967, + 65273, 65429, 65497, 65526, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec4Ub16[16] = +{ + 0, 1, 10, 63, 361, 1785, 7407, 22242, + 43337, 58125, 63729, 65181, 65472, 65527, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec5Ub16[17] = +{ + 0, 1, 7, 29, 134, 599, 2443, 8590, + 22962, 42635, 56911, 63060, 64940, 65408, 65513, 65531, + 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec6Ub16[21] = +{ + 0, 1, 5, 16, 57, 191, 611, 1808, + 4847, 11755, 24612, 40910, 53789, 60698, 63729, 64924, + 65346, 65486, 65523, 65532, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec7Ub16[36] = +{ + 0, 1, 4, 12, 25, 55, 104, 184, + 314, 539, 926, 1550, 2479, 3861, 5892, 8845, + 13281, 20018, 29019, 38029, 45581, 51557, 56057, 59284, + 61517, 63047, 64030, 64648, 65031, 65261, 65402, 65480, + 65518, 65530, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec8Ub16[21] = +{ + 0, 1, 2, 7, 26, 103, 351, 1149, + 3583, 10204, 23846, 41711, 55361, 61917, 64382, 65186, + 65433, 65506, 65528, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub160[21] = +{ + 0, 6, 19, 63, 205, 638, 1799, 4784, + 11721, 24494, 40803, 53805, 60886, 63822, 64931, 65333, + 65472, 65517, 65530, 65533, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub161[28] = +{ + 0, 1, 3, 11, 31, 86, 221, 506, + 1101, 2296, 4486, 8477, 15356, 26079, 38941, 49952, + 57165, 61257, 63426, 64549, 65097, 65351, 65463, 65510, + 65526, 65532, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub162[55] = +{ + 0, 3, 12, 23, 42, 65, 89, 115, + 150, 195, 248, 327, 430, 580, 784, 1099, + 1586, 2358, 3651, 5899, 9568, 14312, 19158, 23776, + 28267, 32663, 36991, 41153, 45098, 48680, 51870, 54729, + 57141, 59158, 60772, 62029, 63000, 63761, 64322, 64728, + 65000, 65192, 65321, 65411, 65463, 65496, 65514, 65523, + 65527, 65529, 65531, 65532, 65533, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub163[26] = +{ + 0, 2, 4, 10, 21, 48, 114, 280, + 701, 1765, 4555, 11270, 24267, 41213, 54285, 61003, + 63767, 64840, 65254, 65421, 65489, 65514, 65526, 65532, + 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub164[28] = +{ + 0, 1, 3, 6, 15, 36, 82, 196, + 453, 1087, 2557, 5923, 13016, 25366, 40449, 52582, + 59539, 62896, 64389, 65033, 65316, 65442, 65494, 65519, + 65529, 65533, 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub165[34] = +{ + 0, 2, 4, 8, 18, 35, 73, 146, + 279, 524, 980, 1789, 3235, 5784, 10040, 16998, + 27070, 38543, 48499, 55421, 59712, 62257, 63748, 64591, + 65041, 65278, 65410, 65474, 65508, 65522, 65530, 65533, + 65534, 65535 +}; + +const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub166[71] = +{ + 0, 1, 2, 6, 13, 26, 55, 92, + 141, 191, 242, 296, 355, 429, 522, 636, + 777, 947, 1162, 1428, 1753, 2137, 2605, 3140, + 3743, 4409, 5164, 6016, 6982, 8118, 9451, 10993, + 12754, 14810, 17130, 19780, 22864, 26424, 30547, 35222, + 40140, 44716, 48698, 52056, 54850, 57162, 59068, 60643, + 61877, 62827, 63561, 64113, 64519, 64807, 65019, 65167, + 65272, 65343, 65399, 65440, 65471, 65487, 65500, 65509, + 65518, 65524, 65527, 65531, 65533, 65534, 65535 +}; + +/* +* An array of pointers to CDFs of decorrelated LARs +*/ +const WebRtc_UWord16* WebRtcIsac_kLpcShapeCdfMatUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME] = { + WebRtcIsac_kLpcShapeCdfVec01Ub16, + WebRtcIsac_kLpcShapeCdfVec1Ub16, + WebRtcIsac_kLpcShapeCdfVec2Ub16, + WebRtcIsac_kLpcShapeCdfVec3Ub16, + WebRtcIsac_kLpcShapeCdfVec4Ub16, + WebRtcIsac_kLpcShapeCdfVec5Ub16, + WebRtcIsac_kLpcShapeCdfVec6Ub16, + WebRtcIsac_kLpcShapeCdfVec7Ub16, + WebRtcIsac_kLpcShapeCdfVec8Ub16, + WebRtcIsac_kLpcShapeCdfVec01Ub160, + WebRtcIsac_kLpcShapeCdfVec01Ub161, + WebRtcIsac_kLpcShapeCdfVec01Ub162, + WebRtcIsac_kLpcShapeCdfVec01Ub163, + WebRtcIsac_kLpcShapeCdfVec01Ub164, + WebRtcIsac_kLpcShapeCdfVec01Ub165, + WebRtcIsac_kLpcShapeCdfVec01Ub166 +}; + +/* +* The smallest reconstruction points for quantiztion of LAR coefficients. +*/ +const double WebRtcIsac_kLpcShapeLeftRecPointUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME] = +{ + -0.8250, -0.9750, -1.1250, -2.1750, -0.9750, -1.1250, -1.4250, + -2.6250, -1.4250, -1.2750, -1.8750, -3.6750, -1.7250, -1.8750, + -2.3250, -5.4750 +}; + +/* +* Number of reconstruction points of quantizers for LAR coefficients. +*/ +const WebRtc_Word16 WebRtcIsac_kLpcShapeNumRecPointUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME] = +{ + 13, 15, 17, 29, 15, 16, 20, 35, 20, + 20, 27, 54, 25, 27, 33, 70 +}; + +/* +* Starting index for entropy decoder to search for the right interval, +* one entry per LAR coefficient +*/ +const WebRtc_UWord16 WebRtcIsac_kLpcShapeEntropySearchUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME] = +{ + 6, 7, 8, 14, 7, 8, 10, 17, 10, + 10, 13, 27, 12, 13, 16, 35 +}; + +/* +* LAR quantization step-size. +*/ +const double WebRtcIsac_kLpcShapeQStepSizeUb16 = 0.150000; diff --git a/src/mod/codecs/mod_isac/lpc_shape_swb16_tables.h b/src/mod/codecs/mod_isac/lpc_shape_swb16_tables.h new file mode 100644 index 0000000000..68d08b2047 --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_shape_swb16_tables.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * lpc_shape_swb16_tables.h + * + * This file declares tables used for entropy coding of LPC shape of + * upper-band signal if the bandwidth is 16 kHz. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_SHAPE_SWB16_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_SHAPE_SWB16_TABLES_H_ + +#include "settings.h" +#include "typedefs.h" + + +extern const double WebRtcIsac_kMeanLarUb16[UB_LPC_ORDER]; + +extern const double WebRtcIsac_kIintraVecDecorrMatUb16[UB_LPC_ORDER][UB_LPC_ORDER]; + +extern const double WebRtcIsac_kInterVecDecorrMatUb16 +[UB16_LPC_VEC_PER_FRAME][UB16_LPC_VEC_PER_FRAME]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub16[14]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec1Ub16[16]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec2Ub16[18]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec3Ub16[30]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec4Ub16[16]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec5Ub16[17]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec6Ub16[21]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec7Ub16[36]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec8Ub16[21]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub160[21]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub161[28]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub162[55]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub163[26]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub164[28]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub165[34]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeCdfVec01Ub166[71]; + +extern const WebRtc_UWord16* WebRtcIsac_kLpcShapeCdfMatUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + +extern const double WebRtcIsac_kLpcShapeLeftRecPointUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + +extern const WebRtc_Word16 WebRtcIsac_kLpcShapeNumRecPointUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + +extern const WebRtc_UWord16 WebRtcIsac_kLpcShapeEntropySearchUb16 +[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + +extern const double WebRtcIsac_kLpcShapeQStepSizeUb16; + +#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_SHAPE_SWB16_TABLES_H_ diff --git a/src/mod/codecs/mod_isac/lpc_tables.c b/src/mod/codecs/mod_isac/lpc_tables.c new file mode 100644 index 0000000000..7df6121462 --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_tables.c @@ -0,0 +1,1129 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* coding tables for the KLT coefficients */ + +#include "lpc_tables.h" +#include "settings.h" + +/* indices of KLT coefficients used */ +const WebRtc_UWord16 WebRtcIsac_kQKltSelIndGain[12] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11}; + +const WebRtc_UWord16 WebRtcIsac_kQKltSelIndShape[108] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107}; + +/* cdf array for model indicator */ +const WebRtc_UWord16 WebRtcIsac_kQKltModelCdf[4] = { + 0, 15434, 37548, 65535}; + +/* pointer to cdf array for model indicator */ +const WebRtc_UWord16 *WebRtcIsac_kQKltModelCdfPtr[1] = {WebRtcIsac_kQKltModelCdf}; + +/* initial cdf index for decoder of model indicator */ +const WebRtc_UWord16 WebRtcIsac_kQKltModelInitIndex[1] = {1}; + +/* offset to go from rounded value to quantization index */ +const short WebRtcIsac_kQKltQuantMinGain[12] = { + 3, 6, 4, 6, 6, 9, 5, 16, 11, 34, 32, 47}; + + +const short WebRtcIsac_kQKltQuantMinShape[108] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 1, 1, 1, 1, 2, 2, 2, 3, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 1, 2, 2, 3, 0, 0, 0, 0, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 4, 3, 5, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 2, 1, 2, 2, 3, 4, + 4, 7, 0, 0, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 2, 3, 4, 4, 5, 7, 13, + 0, 1, 1, 2, 3, 2, 2, 2, 4, 4, + 5, 6, 7, 11, 9, 13, 12, 26}; + +/* maximum quantization index */ +const WebRtc_UWord16 WebRtcIsac_kQKltMaxIndGain[12] = { + 6, 12, 8, 14, 10, 19, 12, 31, 22, 56, 52, 138}; + +const WebRtc_UWord16 WebRtcIsac_kQKltMaxIndShape[108] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 2, 2, 2, 2, 4, 4, 5, 6, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 1, 2, 2, + 2, 2, 3, 4, 5, 7, 0, 0, 0, 0, + 2, 0, 2, 2, 2, 2, 3, 2, 2, 4, + 4, 6, 6, 9, 0, 0, 0, 0, 2, 2, + 2, 2, 2, 2, 3, 2, 4, 4, 7, 7, + 9, 13, 0, 0, 2, 2, 2, 2, 2, 2, + 3, 4, 5, 4, 6, 8, 8, 10, 16, 25, + 0, 2, 2, 4, 5, 4, 4, 4, 7, 8, + 9, 10, 13, 19, 17, 23, 25, 49}; + +/* index offset */ +const WebRtc_UWord16 WebRtcIsac_kQKltOffsetGain[3][12] = { +{ 0, 7, 20, 29, 44, 55, 75, 88, 120, 143, + 200, 253}, +{ 0, 7, 19, 27, 42, 53, 73, 86, 117, 140, + 197, 249}, +{ 0, 7, 20, 28, 44, 55, 75, 89, 121, 145, + 202, 257}}; + +const WebRtc_UWord16 WebRtcIsac_kQKltOffsetShape[3][108] = { +{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 11, 14, 17, 20, 23, 28, 33, 39, 46, 47, + 48, 49, 50, 52, 53, 54, 55, 56, 58, 61, + 64, 67, 70, 74, 79, 85, 93, 94, 95, 96, + 97, 100, 101, 104, 107, 110, 113, 117, 120, 123, + 128, 133, 140, 147, 157, 158, 159, 160, 161, 164, + 167, 170, 173, 176, 179, 183, 186, 191, 196, 204, + 212, 222, 236, 237, 238, 241, 244, 247, 250, 253, + 256, 260, 265, 271, 276, 283, 292, 301, 312, 329, + 355, 356, 359, 362, 367, 373, 378, 383, 388, 396, + 405, 415, 426, 440, 460, 478, 502, 528}, +{ 0, 1, 2, 3, 4, 6, 7, 8, 9, 11, + 13, 16, 19, 22, 26, 29, 34, 39, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 55, 57, 60, + 63, 66, 70, 73, 78, 84, 91, 92, 93, 94, + 95, 96, 97, 99, 102, 105, 108, 111, 114, 118, + 123, 128, 134, 141, 151, 152, 153, 154, 156, 159, + 162, 165, 168, 171, 174, 177, 181, 186, 194, 200, + 208, 218, 233, 234, 235, 236, 239, 242, 245, 248, + 251, 254, 258, 263, 270, 277, 288, 297, 308, 324, + 349, 351, 354, 357, 361, 366, 372, 378, 383, 390, + 398, 407, 420, 431, 450, 472, 496, 524}, +{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, + 14, 17, 20, 23, 26, 29, 34, 40, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 58, 61, 64, + 67, 70, 73, 77, 82, 88, 96, 97, 98, 99, + 101, 102, 104, 107, 110, 113, 116, 119, 122, 125, + 129, 134, 141, 150, 160, 161, 162, 163, 166, 168, + 171, 174, 177, 180, 183, 186, 190, 195, 201, 208, + 216, 226, 243, 244, 245, 248, 251, 254, 257, 260, + 263, 268, 273, 278, 284, 291, 299, 310, 323, 340, + 366, 368, 371, 374, 379, 383, 389, 394, 399, 406, + 414, 422, 433, 445, 461, 480, 505, 533}}; + +/* initial cdf index for KLT coefficients */ +const WebRtc_UWord16 WebRtcIsac_kQKltInitIndexGain[3][12] = { +{ 3, 6, 4, 7, 5, 10, 6, 16, 11, 28, + 26, 69}, +{ 3, 6, 4, 7, 5, 10, 6, 15, 11, 28, + 26, 69}, +{ 3, 6, 4, 8, 5, 10, 7, 16, 12, 28, + 27, 70}}; + +const WebRtc_UWord16 WebRtcIsac_kQKltInitIndexShape[3][108] = { +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 1, 1, 1, 1, 2, 2, 3, 3, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 2, 2, 3, 4, 0, 0, 0, 0, + 1, 0, 1, 1, 1, 1, 2, 1, 1, 2, + 2, 3, 3, 5, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 2, 1, 2, 2, 4, 4, + 5, 7, 0, 0, 1, 1, 1, 1, 1, 1, + 2, 2, 3, 2, 3, 4, 4, 5, 8, 13, + 0, 1, 1, 2, 3, 2, 2, 2, 4, 4, + 5, 5, 7, 10, 9, 12, 13, 25}, +{ 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 2, 1, 2, 2, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 2, 1, 2, 3, 3, 0, 0, 0, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 3, 3, 5, 0, 0, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 4, 3, 4, + 5, 7, 0, 0, 0, 1, 1, 1, 1, 1, + 1, 2, 2, 3, 3, 5, 4, 5, 8, 12, + 1, 1, 1, 2, 2, 3, 3, 2, 3, 4, + 4, 6, 5, 9, 11, 12, 14, 25}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 1, 2, 3, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, + 1, 1, 2, 2, 3, 4, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 3, 4, 5, 0, 0, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 3, 3, 4, + 5, 8, 0, 0, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 3, 3, 4, 5, 6, 8, 13, + 1, 1, 1, 2, 2, 3, 2, 2, 3, 4, + 4, 5, 6, 8, 9, 12, 14, 25}}; + +/* offsets for quantizer representation levels*/ +const WebRtc_UWord16 WebRtcIsac_kQKltOfLevelsGain[3] = { + 0, 392, 779}; + +const WebRtc_UWord16 WebRtcIsac_kQKltOfLevelsShape[3] = { + 0, 578, 1152}; + +/* quantizer representation levels */ +const double WebRtcIsac_kQKltLevelsGain[1176] = { +-2.78127126, -1.76745590, -0.77913790, -0.00437329, 0.79961206, 1.81775776, 2.81389782, -5.78753143, -4.88384084, -3.89320940, +-2.88133610, -1.92859977, -0.86347396, 0.02003888, 0.86140400, 1.89667156, 2.97134967, 3.98781964, 4.91727277, 5.82865898, +-4.11195874, -2.80898424, -1.87547977, -0.80943825, -0.00679084, 0.79573851, 1.83953397, 2.67586037, 3.76274082, -6.10933968, +-4.93034581, -3.89281296, -2.91530625, -1.89684163, -0.85319130, -0.02275767, 0.86862017, 1.91578276, 2.96107339, 3.96543056, + 4.91369908, 5.91058154, 6.83848343, 8.07136925, -5.87470395, -4.84703049, -3.84284597, -2.86168446, -1.89290192, -0.82798145, +-0.00080013, 0.82594974, 1.85754329, 2.88351798, 3.96172628, -8.85684885, -7.87387461, -6.97811862, -5.93256270, -4.94301439, +-3.95513701, -2.96041544, -1.94031192, -0.87961478, -0.00456201, 0.89911505, 1.91723376, 2.94011511, 3.93302540, 4.97990967, + 5.93133404, 7.02181199, 7.92407762, 8.80155440, 10.04665814, -4.82396678, -3.85612158, -2.89482244, -1.89558408, -0.90036978, +-0.00677823, 0.90607989, 1.90937981, 2.91175777, 3.91637730, 4.97565723, 5.84771228, 7.11145863, -16.07879840, -15.03776309, +-13.93905670, -12.95671800, -11.89171202, -10.95820934, -9.95923714, -8.94357334, -7.99068299, -6.97481009, -5.94826231, -4.96673988, +-3.97490466, -2.97846970, -1.95130435, -0.94215262, -0.01444043, 0.96770704, 1.95848598, 2.94107862, 3.95666119, 4.97253085, + 5.97191122, 6.93277360, 7.96608727, 8.87958779, 10.00264269, 10.86560820, 12.07449071, 13.04491775, 13.97507061, 14.91845261, +-10.85696295, -9.83365357, -9.01245635, -7.95915145, -6.95625003, -5.95362618, -4.93468444, -3.98760978, -2.95044407, -1.97041277, +-0.97701799, -0.00840234, 0.97834289, 1.98361415, 2.97802439, 3.96415871, 4.95369042, 5.94101770, 6.92756798, 7.94063998, + 8.85951828, 9.97077022, 11.00068503, -33.92030406, -32.81426422, -32.00000000, -31.13243639, -30.11886909, -29.06017570, -28.12598824, +-27.22045482, -25.81215858, -25.07849962, -23.93018013, -23.02097643, -21.89529725, -20.99091085, -19.98889048, -18.94327044, -17.96562071, +-16.96126218, -15.95054062, -14.98516200, -13.97101012, -13.02106500, -11.98438006, -11.03216748, -9.95930286, -8.97043946, -7.98085082, +-6.98360995, -5.98998802, -4.98668173, -4.00032906, -3.00420619, -1.98701132, -0.99324682, -0.00609324, 0.98297834, 1.99483076, + 3.00305044, 3.97142097, 4.97525759, 5.98612258, 6.97448236, 7.97575900, 9.01086211, 9.98665542, 11.00541438, 11.98078628, + 12.92352471, 14.06849675, 14.99949430, 15.94904834, 16.97440321, 18.04040916, 18.88987609, 20.05312391, 21.00000000, 21.79443341, +-31.98578825, -31.00000000, -29.89060567, -28.98555686, -27.97114102, -26.84935410, -26.02402230, -24.94195278, -23.92336849, -22.95552382, +-21.97932836, -20.96055470, -19.99649553, -19.03436122, -17.96706525, -17.01139515, -16.01363516, -14.99154248, -14.00298333, -12.99630613, +-11.99955519, -10.99000421, -10.00819092, -8.99763648, -7.98431793, -7.01769025, -5.99604690, -4.99980697, -3.99334671, -3.01748192, +-2.02051217, -1.00848371, -0.01942358, 1.00477757, 1.95477872, 2.98593031, 3.98779079, 4.96862849, 6.02694771, 6.93983733, + 7.89874717, 8.99615862, 10.02367921, 10.96293452, 11.84351528, 12.92207187, 13.85122329, 15.05146877, 15.99371264, 17.00000000, + 18.00000000, 19.00000000, 19.82763573, -47.00000000, -46.00000000, -44.87138498, -44.00000000, -43.00000000, -42.00000000, -41.00000000, +-39.88966612, -38.98913239, -37.80306486, -37.23584325, -35.94200288, -34.99881301, -34.11361858, -33.06507360, -32.13129135, -30.90891364, +-29.81511907, -28.99250380, -28.04535391, -26.99767800, -26.04418164, -24.95687851, -24.04865595, -23.03392645, -21.89366707, -20.93517364, +-19.99388660, -18.91620943, -18.03749683, -16.99532379, -15.98683813, -15.06421479, -13.99359211, -12.99714098, -11.97022520, -10.98500279, +-9.98834422, -8.95729330, -8.01232284, -7.00253661, -5.99681626, -5.01207817, -3.95914904, -3.01232178, -1.96615919, -0.97687670, + 0.01228030, 0.98412288, 2.01753544, 3.00580570, 3.97783510, 4.98846894, 6.01321400, 7.00867732, 8.00416375, 9.01771966, + 9.98637729, 10.98255180, 11.99194163, 13.01807333, 14.00999545, 15.00118556, 16.00089224, 17.00584148, 17.98251763, 18.99942091, + 19.96917690, 20.97839265, 21.98207297, 23.00171271, 23.99930737, 24.99746061, 26.00936304, 26.98240132, 28.01126868, 29.01395915, + 29.98153507, 31.01376711, 31.99876818, 33.00475317, 33.99753994, 34.99493913, 35.98933585, 36.95620160, 37.98428461, 38.99317544, + 40.01832073, 40.98048133, 41.95999283, 42.98232091, 43.96523612, 44.99574268, 45.99524194, 47.05464025, 48.03821548, 48.99354366, + 49.96400411, 50.98017973, 51.95184408, 52.96291806, 54.00194392, 54.96603783, 55.95623778, 57.03076595, 58.05889901, 58.99081551, + 59.97928121, 61.05071612, 62.03971580, 63.01286038, 64.01290338, 65.02074503, 65.99454594, 67.00399425, 67.96571257, 68.95305727, + 69.92030664, 70.95594862, 71.98088567, 73.04764124, 74.00285480, 75.02696330, 75.89837673, 76.93459997, 78.16266309, 78.83317543, + 80.00000000, 80.87251574, 82.09803524, 83.10671664, 84.00000000, 84.77023523, 86.00000000, 87.00000000, 87.92946897, 88.69159118, + 90.00000000, 90.90535270, -3.00000000, -2.00000000, -0.77592424, -0.00564307, 0.76727305, 2.00000000, 3.00000000, -6.00000000, +-5.00000000, -4.00000000, -2.92897924, -1.85623684, -0.72445303, -0.00119184, 0.72896652, 2.05710416, 3.17909894, 4.00000000, + 5.00000000, -3.00000000, -2.00000000, -0.67480586, -0.00028016, 0.66618169, 2.00000000, 3.00000000, 4.00000000, -7.00000000, +-6.00000000, -5.00000000, -3.78336783, -2.84811556, -2.04088844, -0.71114371, 0.03142493, 0.69662772, 1.91417930, 3.00000000, + 4.01411062, 5.00000000, 6.00000000, 7.00000000, -6.00000000, -5.00000000, -4.00000000, -3.00000000, -2.00000000, -0.63703469, + 0.00169604, 0.66294191, 1.83808563, 3.00000000, 4.00000000, -8.00000000, -7.00000000, -6.03082300, -5.00000000, -3.88061019, +-2.92670084, -1.99902336, -0.72898996, -0.02880170, 0.73769927, 1.95920233, 2.78356263, 4.08100921, 5.00000000, 6.00000000, + 6.78771437, 8.00000000, 9.00000000, 10.00000000, 11.00000000, -5.00000000, -4.00000000, -2.88150384, -1.89520024, -0.71479482, + 0.00962397, 0.72816030, 1.73583550, 3.00000000, 4.00000000, 5.00000000, 6.00000000, 7.00000000, -16.00000000, -15.00000000, +-13.80516401, -13.00000000, -12.00000000, -11.00000000, -10.02723144, -9.11825995, -8.05820112, -7.00000000, -6.17943541, -5.01837980, +-3.97546169, -2.92806857, -1.89778775, -0.81138893, -0.02246016, 0.80528415, 1.85705214, 2.96438524, 3.97540151, 4.79684246, + 6.00000000, 6.75549513, 8.12185828, 9.00000000, 10.00000000, 11.00000000, 12.00000000, 13.00000000, 14.00000000, -11.00000000, +-10.00000000, -9.00000000, -7.91603344, -6.77865892, -5.85765006, -4.93342332, -3.96679157, -2.84925552, -1.89230732, -0.85384229, + 0.00579591, 0.84863246, 1.89006713, 2.89483818, 3.87322971, 5.13228411, 6.00000000, 7.00000000, 8.00000000, 9.00000000, + 10.00000000, 11.00000000, -34.00000000, -33.00000000, -32.00000000, -31.00000000, -30.00000000, -29.00000000, -28.00000000, -27.00000000, +-26.00000000, -25.00000000, -24.00000000, -23.00000000, -22.00000000, -21.00000000, -20.19501953, -19.00000000, -18.00000000, -17.00000000, +-16.00000000, -14.89069633, -14.00000000, -13.00000000, -12.16260304, -11.15418282, -9.83543570, -8.85600407, -7.82712677, -7.05664308, +-5.97007352, -4.89268438, -3.93822771, -2.94975269, -1.92192127, -0.90702480, 0.03974847, 0.92488359, 1.93747579, 2.94500522, + 3.95181797, 4.95433087, 5.95141808, 7.00212920, 8.02964757, 9.03210585, 9.84644504, 10.82907720, 11.87622530, 12.96908371, + 14.00000000, 15.16963413, 15.94902025, 17.00000000, 18.00000000, 19.00000000, 20.00000000, 21.00000000, 22.00000000, -29.00000000, +-27.79780781, -27.00757888, -26.01571026, -24.89695568, -23.99946491, -22.98699614, -21.96678139, -20.99883532, -20.00851529, -18.94738054, +-17.98672566, -16.98684787, -15.96917397, -14.99856852, -13.98974852, -12.97786927, -11.96110939, -10.98877093, -9.99875257, -8.99001359, +-8.00799989, -6.99471760, -6.00034670, -4.99936372, -4.00581479, -3.00424577, -2.02047620, -0.99713266, -0.00366397, 1.00803955, + 1.98452687, 3.00748501, 4.02714611, 4.97661026, 5.99337271, 6.99754716, 8.00713602, 8.97184974, 9.98047901, 10.97685939, + 11.99533975, 12.96107876, 13.95061478, 15.00756776, 15.94078690, 16.88231059, 17.92069248, 18.78011047, 20.00000000, 21.00000000, + 22.00000000, -55.76988333, -54.96048193, -53.88411581, -52.94117980, -51.80983449, -50.90359699, -50.00000000, -48.99838741, -47.97685542, +-47.03288597, -45.97820919, -45.02418374, -43.90081897, -42.88832512, -41.98234549, -40.96745512, -39.98148729, -39.06792854, -37.96493755, +-36.98707870, -36.03416079, -35.01192444, -33.95785029, -32.99469087, -31.96633807, -31.01769053, -29.99727691, -28.99329690, -27.98873019, +-27.00344273, -25.97657141, -25.00511074, -23.96689479, -23.01566842, -22.01632643, -21.00076343, -19.97788007, -18.97248680, -17.96076284, +-16.97585453, -15.98345587, -15.01612745, -13.96862118, -12.96622055, -12.02196641, -11.02078103, -9.98445656, -9.00050060, -8.03442387, +-7.00363761, -5.97921358, -4.98886269, -4.00528221, -3.01672947, -1.98599795, -1.00668518, -0.02633490, 1.00794139, 2.00837138, + 2.99213287, 3.98710216, 4.99064334, 6.01416391, 7.01759708, 7.97878151, 8.99665730, 10.02656114, 11.01863887, 12.01207901, + 13.00958725, 13.99237829, 15.00954971, 16.00724653, 17.00606559, 17.99886292, 18.99611967, 19.98808171, 21.01871930, 21.97014763, + 22.99833843, 24.00316842, 24.99949142, 25.98539601, 27.02480733, 27.98075377, 28.98266019, 30.00611445, 30.99409128, 31.94523141, + 32.97688339, 33.98800206, 35.00177074, 35.98639997, 36.98939428, 37.95644255, 39.00114054, 39.99492439, 40.99338254, 41.97050844, + 43.03085663, 43.96757668, 44.97800970, 45.95953358, 46.98109551, 47.99368477, 49.00141209, 49.94459923, 50.93298108, 51.99894661, + 53.06463883, 53.99704669, 55.02037199, 55.98368047, 57.01930954, 58.03813852, 58.96232502, 60.01644186, 61.03254711, 62.01086576, + 62.87962247, 63.98378413, 65.02189831, 65.93003954, 66.92439900, 68.07051633, 68.95928756, 70.03315022, 71.05579859, 72.00000000, + 73.00000000, 74.00000000, 75.00000000, 75.93485291, 77.20950456, 78.00000000, 79.00000000, 79.91519960, 81.00000000, -3.00000000, +-2.00000000, -0.65174074, -0.00092112, 0.62967387, 2.00000000, 3.00000000, -6.00000000, -5.00000000, -4.00000000, -2.89861729, +-1.69999061, -0.72632201, 0.00219241, 0.72891750, 1.73257865, 3.00000000, 3.76561508, 5.00000000, 6.00000000, -3.00000000, +-2.00000000, -0.66227013, 0.00389373, 0.66163500, 2.00000000, 3.00000000, 4.00000000, -8.00000000, -7.00000000, -6.00000000, +-4.76421796, -4.04320264, -3.01415201, -1.84346485, -0.77185048, 0.00061977, 0.76274524, 1.84330156, 3.00000000, 4.00000000, + 5.00000000, 6.00000000, 7.00000000, -6.00000000, -5.00000000, -4.00000000, -3.00000000, -1.75749611, -0.72951347, -0.00104394, + 0.72040315, 1.72594036, 3.00000000, 4.00000000, -9.00000000, -8.00000000, -7.00000000, -5.90394062, -5.00000000, -3.75562807, +-2.89699407, -1.86696610, -0.79056636, -0.00330943, 0.79744554, 1.85149941, 2.91118681, 3.99520311, 4.96341987, 6.00000000, + 7.00000000, 8.00000000, 9.00000000, 10.00000000, -6.00000000, -4.80151529, -4.00000000, -2.87442856, -1.85285815, -0.77767592, +-0.02071301, 0.81752572, 1.82503940, 2.79602150, 3.92870203, 5.00000000, 6.00000000, 7.00000000, -17.00000000, -16.00000000, +-15.00000000, -14.00000000, -13.00000000, -12.00000000, -11.00000000, -9.80059874, -9.00000000, -8.00185204, -7.13087808, -5.92942149, +-4.77883243, -3.93417708, -2.88004618, -1.89952522, -0.86239337, 0.00332274, 0.86657548, 1.89479279, 2.89701813, 3.90987417, + 4.98910145, 6.07676766, 7.00000000, 8.00000000, 9.00000000, 10.00000000, 11.00000000, 12.00000000, 13.00000000, 14.00000000, +-12.00000000, -11.00000000, -9.89996262, -8.85894205, -7.87594823, -6.99685317, -5.94917589, -4.93914916, -3.93317670, -2.93174244, +-1.90737478, -0.90982242, 0.00803316, 0.90111563, 1.90362879, 2.90332432, 3.90654662, 4.94461954, 5.87963665, 6.91988113, + 7.79514004, 8.98805413, 10.00000000, 11.00000000, -35.00000000, -34.00000000, -33.00000000, -32.00000000, -31.00000000, -30.00000000, +-29.00000000, -28.00000000, -27.00000000, -26.00000000, -25.00000000, -24.00000000, -22.88310970, -22.00000000, -21.00000000, -20.00000000, +-19.00000000, -18.00000000, -17.00000000, -16.11854974, -15.00000000, -14.10507667, -13.04497040, -11.94846700, -10.97432494, -9.94514368, +-8.97311414, -7.94171496, -6.97232122, -5.98590548, -4.97455572, -3.95477903, -2.93935454, -1.95573532, -0.97120273, -0.02084826, + 0.95689153, 1.96679781, 2.97060165, 3.96660892, 4.96754331, 5.97996089, 6.93822411, 7.96618014, 8.95809791, 9.98891474, + 10.95713402, 11.85433084, 13.03831696, 13.84035295, 15.00729606, 15.98652872, 17.20557599, 18.00000000, 18.90794805, 20.00000000, + 21.00000000, -34.00000000, -33.00000000, -32.00000000, -31.00000000, -30.00000000, -28.97280602, -28.00000000, -27.16255057, -26.04078092, +-24.85442050, -24.15783484, -22.78614956, -21.95739865, -21.21844626, -20.03008104, -19.03888543, -17.90460490, -17.02064693, -15.84673652, +-14.87140709, -13.87996048, -12.94907251, -11.96795995, -11.00977925, -9.95103238, -8.96674655, -7.96351667, -6.96886200, -5.99335494, +-4.97515534, -3.98891694, -2.99581150, -1.98758360, -0.99249128, -0.00001403, 0.98807868, 1.99119869, 2.99019366, 3.98612953, + 5.00312941, 5.98833080, 6.99686651, 7.98373889, 8.97942222, 9.94202752, 10.99671622, 11.94306164, 12.98539825, 13.90728690, + 14.89907642, 15.94836675, 16.89611342, 17.84084949, 18.74910958, 20.00000000, -67.00000000, -66.00000000, -65.00000000, -64.00000000, +-63.02511977, -62.00000000, -61.06061493, -59.95964043, -59.12824439, -58.00000000, -57.00000000, -56.00000000, -54.87857996, -54.09689334, +-53.00000000, -52.21057366, -50.93867921, -50.03032952, -49.19283867, -47.89439051, -46.99505692, -46.04895543, -44.89687413, -43.78942208, +-42.99025156, -41.88436155, -40.99169704, -40.00320429, -38.90181498, -38.06029271, -37.05030818, -36.07554573, -35.03202233, -33.93117946, +-32.97736655, -31.98942819, -30.99546798, -30.01511004, -28.97296525, -28.02561164, -26.94386985, -25.99632704, -25.00461143, -24.01578192, +-22.99177609, -22.02261094, -20.97939001, -19.96176066, -19.00442980, -18.01529434, -17.00196902, -15.99794828, -14.98675055, -13.97517657, +-12.98676283, -11.99718760, -11.00167809, -9.98872268, -9.02138474, -8.00320338, -6.99542797, -6.00059136, -5.01311763, -4.00336943, +-3.00348281, -1.99365875, -0.98223019, 0.00126343, 0.99699237, 1.99381968, 3.00054436, 3.99898305, 5.00160508, 6.00310399, + 6.99885096, 8.02740039, 8.99515550, 9.98962151, 11.00642302, 11.98694516, 13.00018933, 13.97726018, 14.99186645, 16.00580131, + 16.97434224, 17.96982658, 19.00066438, 20.01228749, 21.00741822, 21.94988312, 23.00860212, 23.98801542, 24.97638417, 25.98003521, + 27.02336188, 27.99667029, 29.01014125, 30.02481912, 31.01415797, 31.97399854, 33.06214485, 33.99929330, 34.94095386, 35.96368372, + 36.96980925, 37.98389244, 39.01121235, 40.00715026, 41.06382894, 41.96618280, 43.01555590, 43.95430436, 45.01970038, 45.99967821, + 47.19847394, 48.04852502, 49.10609965, 50.04244122, 50.86051406, 51.92983796, 53.02781107, 54.06248545, 54.89942009, 56.08347165, + 57.06887956, 58.09671115, 59.07832400, 59.87005277, 61.14778499, 62.00000000, 63.00000000, 64.00000000, 65.00000000, 66.00000000, + 67.00000000, 68.00000000, 69.00000000, 70.00000000, 71.00000000, 72.00000000}; + +const double WebRtcIsac_kQKltLevelsShape[1735] = { + 0.00032397, 0.00008053, -0.00061202, -0.00012620, 0.00030437, 0.00054764, -0.00027902, 0.00069360, 0.00029449, -0.80219239, + 0.00091089, -0.74514927, -0.00094283, 0.64030631, -0.60509119, 0.00035575, 0.61851665, -0.62129957, 0.00375219, 0.60054900, +-0.61554359, 0.00054977, 0.63362016, -1.73118727, -0.65422341, 0.00524568, 0.66165298, 1.76785515, -1.83182018, -0.65997434, +-0.00011887, 0.67524299, 1.79933938, -1.76344480, -0.72547708, -0.00133017, 0.73104704, 1.75305377, 2.85164534, -2.80423916, +-1.71959639, -0.75419722, -0.00329945, 0.77196760, 1.72211069, 2.87339653, 0.00031089, -0.00015311, 0.00018201, -0.00035035, +-0.77357251, 0.00154647, -0.00047625, -0.00045299, 0.00086590, 0.00044762, -0.83383829, 0.00024787, -0.68526258, -0.00122472, + 0.64643255, -0.60904942, -0.00448987, 0.62309184, -0.59626442, -0.00574132, 0.62296546, -0.63222115, 0.00013441, 0.63609545, +-0.66911055, -0.00369971, 0.66346095, 2.07281301, -1.77184694, -0.67640425, -0.00010145, 0.64818392, 1.74948973, -1.69420224, +-0.71943894, -0.00004680, 0.75303493, 1.81075983, 2.80610041, -2.80005755, -1.79866753, -0.77409777, -0.00084220, 0.80141293, + 1.78291081, 2.73954236, 3.82994169, 0.00015140, -0.00012766, -0.00034241, -0.00119125, -0.76113497, 0.00069246, 0.76722027, + 0.00132862, -0.69107530, 0.00010656, 0.77061578, -0.78012970, 0.00095947, 0.77828502, -0.64787758, 0.00217168, 0.63050167, +-0.58601125, 0.00306596, 0.59466308, -0.58603410, 0.00059779, 0.64257970, 1.76512766, -0.61193600, -0.00259517, 0.59767574, +-0.61026273, 0.00315811, 0.61725479, -1.69169719, -0.65816029, 0.00067575, 0.65576890, 2.00000000, -1.72689193, -0.69780808, +-0.00040990, 0.70668487, 1.74198458, -3.79028154, -3.00000000, -1.73194459, -0.70179341, -0.00106695, 0.71302629, 1.76849782, +-2.89332364, -1.78585007, -0.78731491, -0.00132610, 0.79692976, 1.75247009, 2.97828682, -5.26238694, -3.69559829, -2.87286122, +-1.84908818, -0.84434577, -0.01167975, 0.84641753, 1.84087672, 2.87628156, 3.83556679, -0.00190204, 0.00092642, 0.00354385, +-0.00012982, -0.67742785, 0.00229509, 0.64935672, -0.58444751, 0.00470733, 0.57299534, -0.58456202, -0.00097715, 0.64593607, +-0.64060330, -0.00638534, 0.59680157, -0.59287537, 0.00490772, 0.58919707, -0.60306173, -0.00417464, 0.60562100, -1.75218757, +-0.63018569, -0.00225922, 0.63863300, -0.63949939, -0.00126421, 0.64268914, -1.75851182, -0.68318060, 0.00510418, 0.69049211, + 1.88178506, -1.71136148, -0.72710534, -0.00815559, 0.73412917, 1.79996711, -2.77111145, -1.73940498, -0.78212945, 0.01074476, + 0.77688916, 1.76873972, 2.87281379, 3.77554698, -3.75832725, -2.95463235, -1.80451491, -0.80017226, 0.00149902, 0.80729206, + 1.78265046, 2.89391793, -3.78236148, -2.83640598, -1.82532067, -0.88844327, -0.00620952, 0.88208030, 1.85757631, 2.81712391, + 3.88430176, 5.16179367, -7.00000000, -5.93805408, -4.87172597, -3.87524433, -2.89399744, -1.92359563, -0.92136341, -0.00172725, + 0.93087018, 1.90528280, 2.89809686, 3.88085708, 4.89147740, 5.89078692, -0.00239502, 0.00312564, -1.00000000, 0.00178325, + 1.00000000, -0.62198029, 0.00143254, 0.65344051, -0.59851220, -0.00676987, 0.61510140, -0.58894151, 0.00385055, 0.59794203, +-0.59808568, -0.00038214, 0.57625703, -0.63009713, -0.01107985, 0.61278758, -0.64206758, -0.00154369, 0.65480598, 1.80604162, +-1.80909286, -0.67810514, 0.00205762, 0.68571097, 1.79453891, -3.22682422, -1.73808453, -0.71870305, -0.00738594, 0.71486172, + 1.73005326, -1.66891897, -0.73689615, -0.00616203, 0.74262409, 1.73807899, -2.92417482, -1.73866741, -0.78133871, 0.00764425, + 0.80027264, 1.78668732, 2.74992588, -4.00000000, -2.75578740, -1.83697516, -0.83117035, -0.00355191, 0.83527172, 1.82814700, + 2.77377675, 3.80718693, -3.81667698, -2.83575471, -1.83372350, -0.86579471, 0.00547578, 0.87582281, 1.82858793, 2.87265007, + 3.91405377, -4.87521600, -3.78999094, -2.86437014, -1.86964365, -0.90618018, 0.00128243, 0.91497811, 1.87374952, 2.83199819, + 3.91519130, 4.76632822, -6.68713448, -6.01252467, -4.94587936, -3.88795368, -2.91299088, -1.92592211, -0.95504570, -0.00089980, + 0.94565200, 1.93239633, 2.91832808, 3.91363475, 4.88920034, 5.96471415, 6.83905252, 7.86195009, 8.81571018, -12.96141759, +-11.73039516, -10.96459719, -9.97382433, -9.04414433, -7.89460619, -6.96628608, -5.93236595, -4.93337924, -3.95479990, -2.96451499, +-1.96635876, -0.97271229, -0.00402238, 0.98343930, 1.98348291, 2.96641164, 3.95456471, 4.95517089, 5.98975714, 6.90322073, + 7.90468849, 8.85639467, 9.97255498, 10.79006309, 11.81988596, 0.04950500, -1.00000000, -0.01226628, 1.00000000, -0.59479469, +-0.10438305, 0.59822144, -2.00000000, -0.67109149, -0.09256692, 0.65171621, 2.00000000, -3.00000000, -1.68391999, -0.76681039, +-0.03354151, 0.71509146, 1.77615472, -2.00000000, -0.68661511, -0.02497881, 0.66478398, 2.00000000, -2.00000000, -0.67032784, +-0.00920582, 0.64892756, 2.00000000, -2.00000000, -0.68561894, 0.03641869, 0.73021611, 1.68293863, -4.00000000, -2.72024184, +-1.80096059, -0.81696185, 0.03604685, 0.79232033, 1.70070730, 3.00000000, -4.00000000, -2.71795670, -1.80482986, -0.86001162, + 0.03764903, 0.87723968, 1.79970771, 2.72685932, 3.67589143, -5.00000000, -4.00000000, -2.85492548, -1.78996365, -0.83250358, +-0.01376828, 0.84195506, 1.78161105, 2.76754458, 4.00000000, -6.00000000, -5.00000000, -3.82268811, -2.77563624, -1.82608163, +-0.86486114, -0.02671886, 0.86693165, 1.88422879, 2.86248347, 3.95632216, -7.00000000, -6.00000000, -5.00000000, -3.77533988, +-2.86391432, -1.87052039, -0.90513658, 0.06271236, 0.91083620, 1.85734756, 2.86031688, 3.82019418, 4.94420394, 6.00000000, +-11.00000000, -10.00000000, -9.00000000, -8.00000000, -6.91952415, -6.00000000, -4.92044374, -3.87845165, -2.87392362, -1.88413020, +-0.91915740, 0.00318517, 0.91602800, 1.89664838, 2.88925058, 3.84123856, 4.78988651, 5.94526812, 6.81953917, 8.00000000, +-9.00000000, -8.00000000, -7.03319143, -5.94530963, -4.86669720, -3.92438007, -2.88620396, -1.92848070, -0.94365985, 0.01671855, + 0.97349410, 1.93419878, 2.89740109, 3.89662823, 4.83235583, 5.88106535, 6.80328232, 8.00000000, -13.00000000, -12.00000000, +-11.00000000, -10.00000000, -9.00000000, -7.86033489, -6.83344055, -5.89844215, -4.90811454, -3.94841298, -2.95820490, -1.98627966, +-0.99161468, -0.02286136, 0.96055651, 1.95052433, 2.93969396, 3.94304346, 4.88522624, 5.87434241, 6.78309433, 7.87244101, + 9.00000000, 10.00000000, -12.09117356, -11.00000000, -10.00000000, -8.84766108, -7.86934236, -6.98544896, -5.94233429, -4.95583292, +-3.95575986, -2.97085529, -1.98955811, -0.99359873, -0.00485413, 0.98298870, 1.98093258, 2.96430203, 3.95540216, 4.96915010, + 5.96775124, 6.99236918, 7.96503302, 8.99864542, 9.85857723, 10.96541926, 11.91647197, 12.71060069, -26.00000000, -25.00000000, +-24.00585596, -23.11642573, -22.14271284, -20.89800711, -19.87815799, -19.05036354, -17.88555651, -16.86471209, -15.97711073, -14.94012359, +-14.02661226, -12.98243228, -11.97489256, -10.97402777, -9.96425624, -9.01085220, -7.97372506, -6.98795002, -5.97271328, -5.00191694, +-3.98055849, -2.98458048, -1.99470442, -0.99656768, -0.00825666, 1.00272004, 1.99922218, 2.99357669, 4.01407905, 5.01003897, + 5.98115528, 7.00018958, 8.00338125, 8.98981046, 9.98990318, 10.96341479, 11.96866930, 12.99175139, 13.94580443, 14.95745083, + 15.98992869, 16.97484646, 17.99630043, 18.93396897, 19.88347741, 20.96532482, 21.92191032, 23.22314702, 0.00006846, 0.00014352, +-0.00056203, 0.00027588, -0.00147678, 1.00000000, 0.00003823, 0.00001975, -0.00033710, -0.00096712, 1.00000000, -1.00000000, + 0.00067511, -1.00000000, 0.00342065, 1.00000000, -1.00000000, 0.00196254, 1.00000000, -1.00000000, 0.00201173, 1.00000000, +-2.00000000, -1.00000000, -0.00381686, 1.00000000, -1.00000000, 0.00178037, 1.00000000, -2.00000000, -1.00000000, -0.00320274, + 1.00000000, 2.00000000, -2.00000000, -1.00000000, 0.00426519, 1.00000000, 2.00000000, -3.00000000, -2.00000000, -1.00000000, +-0.00074072, 0.64654602, 2.00000000, 0.00031217, 0.00063348, 0.00020247, 0.00047891, 0.00122893, -0.00150669, -0.00148276, + 0.00016848, 0.00147085, 1.00000000, -0.00088160, 1.00000000, -1.00000000, 0.00381641, 1.00000000, -1.00000000, 0.00129816, + 1.00000000, -1.00000000, 0.00074903, 1.00000000, -2.00000000, -0.76230566, -0.00370764, 0.82467977, -0.78769346, -0.00492670, + 0.84532630, -2.00000000, -0.70943195, -0.01257613, 0.75905385, 2.00000000, -2.00000000, -0.62780445, -0.00408633, 0.60272506, + 2.00000000, 3.00000000, -3.00000000, -2.00000000, -0.61412985, 0.00102833, 0.61527589, 2.00000000, 3.00000000, 0.00012115, +-0.00080909, 0.00071061, -0.00227957, 0.00179794, 0.00103827, -1.00000000, 0.00444757, -1.00000000, 0.00604068, 1.00000000, +-1.00000000, 0.00427327, 1.00000000, -1.00000000, 0.00086662, 1.00000000, -1.00000000, -0.00837492, 1.00000000, -0.65715934, +-0.00645342, 0.64004630, -2.00000000, -0.64987682, -0.01449567, 0.69893373, -2.00000000, -0.63221961, 0.00421765, 0.62452105, + 2.00000000, -2.00000000, -0.60027006, -0.00110630, 0.62033821, 2.00000000, -2.00000000, -0.59823932, 0.00928313, 0.62188520, + 2.00000000, 3.00000000, -3.00000000, -2.00000000, -0.63230286, -0.00248555, 0.62632575, 2.00000000, 3.00000000, -5.00000000, +-4.00000000, -3.00000000, -2.00000000, -0.66521143, 0.00544305, 0.66930486, 2.00000000, 3.00000000, 4.00000000, 0.00077008, + 0.00061140, -0.00009317, -0.00049643, 1.00000000, -1.00000000, -0.00285084, 1.00000000, -1.00000000, 0.00601784, 1.00000000, +-1.00000000, -0.00091887, 0.75122772, -0.71579859, -0.00043545, 1.00000000, -0.85571363, -0.00227654, 0.63816873, -1.00000000, +-0.00393484, 0.76748004, -0.58223659, -0.01229777, 0.58080322, -0.61945902, -0.00232238, 0.62277938, 2.00000000, -2.00000000, +-0.60595489, -0.00535702, 0.60547736, 2.00000000, -4.00000000, -3.00000000, -2.00000000, -0.62368122, 0.01112097, 0.63997294, + 2.00000000, 3.00000000, -3.00000000, -2.00000000, -0.64318217, 0.00515139, 0.64781184, 2.00000000, -3.00000000, -1.78031579, +-0.67122588, 0.02153711, 0.67899877, 2.00000000, 3.00000000, 4.00000000, -4.00000000, -3.00000000, -1.80503233, -0.69835727, +-0.00270770, 0.70999554, 1.77332849, 3.00000000, 4.00000000, 5.00000000, -8.00000000, -7.00000000, -6.00000000, -5.00000000, +-4.00000000, -2.81600693, -1.72970368, -0.73779413, -0.01384841, 0.75694606, 1.80042618, 3.00000000, 4.00000000, 5.00000000, + 6.00000000, -0.00051787, 0.00059593, -0.00023319, -1.00000000, 0.00191861, 0.79547197, -0.75020995, 0.00217840, 0.69165833, +-1.00000000, -0.00304964, 0.67698951, -0.64516943, -0.00657667, 0.59260129, -0.62819301, -0.00456626, 0.59426260, -0.60909519, + 0.00256476, 0.61660408, -0.66560131, -0.00293463, 0.67477566, 2.00000000, -2.00000000, -0.62484067, 0.00505116, 0.63491494, + 2.00000000, -3.00000000, -2.00000000, -0.68427246, 0.00924353, 0.68755774, 2.00000000, 3.00000000, -3.00000000, -2.00000000, +-0.65390928, 0.01008025, 0.65849449, 2.00000000, 3.00000000, -5.00000000, -4.00000000, -3.00000000, -1.70848232, -0.72079538, +-0.00007674, 0.71556176, 1.76815351, 3.00000000, 4.00000000, 5.00000000, -4.00000000, -3.00000000, -1.82887466, -0.73529886, + 0.00033458, 0.73847588, 1.83009515, 3.00000000, 4.00000000, -5.00000000, -4.00000000, -2.83203553, -1.79500085, -0.77452749, +-0.00614320, 0.77416943, 1.82469471, 2.77034612, 4.00000000, 5.00000000, -7.00000000, -6.00000000, -5.00000000, -4.00000000, +-2.76574798, -1.84700836, -0.80822297, 0.00054165, 0.80901445, 1.85687331, 2.75680191, 3.81986695, 5.00000000, 6.00000000, + 7.00000000, 8.00000000, -13.00000000, -12.00000000, -11.00000000, -10.00000000, -9.00000000, -8.00000000, -7.00000000, -6.00000000, +-5.00000000, -3.88304817, -2.93396067, -1.86645989, -0.84825410, 0.00666207, 0.84853252, 1.88634684, 2.95282618, 3.89813287, + 4.89189079, 6.00000000, 7.00000000, 8.00000000, 9.00000000, 10.00000000, 11.00000000, -0.00344877, 1.00000000, -0.61413659, +-0.02115630, 0.59438887, -0.60873054, 0.00844993, 0.62510557, -2.00000000, -0.75002947, 0.00120913, 0.66616051, -2.00000000, +-0.72324691, 0.04760499, 0.70532533, 2.00000000, -3.00000000, -1.66577589, -0.78941380, -0.01909714, 0.74993685, 1.70945570, +-1.64422308, -0.70992006, -0.02795108, 0.76990363, 1.79682243, 2.96233315, -1.71686461, -0.76572785, -0.00041846, 0.78174132, + 1.66217596, -3.00000000, -1.77033369, -0.79475091, 0.03709740, 0.80097076, 1.83947400, 2.85879773, -4.00000000, -3.16528651, +-1.79564411, -0.90078981, 0.02403102, 0.86138856, 1.84207433, 2.74584048, -4.00000000, -2.91249347, -1.87804769, -0.87323549, + 0.08164382, 0.89037056, 1.82505263, 2.71336163, 4.00000000, -4.81262228, -3.87173565, -2.83424209, -1.87517938, -0.86199960, + 0.00268598, 0.89547657, 1.90713511, 2.85219071, 3.86417171, 4.80711781, 6.00000000, 7.00000000, -5.00000000, -3.82388480, +-2.82875808, -1.90350457, -0.90795818, 0.03047007, 0.93676836, 1.88844957, 2.83269711, 3.76109686, 5.00000000, -9.00000000, +-8.00000000, -6.88037957, -5.88776398, -4.91209139, -3.93902541, -2.90989221, -1.92281230, -0.98960535, -0.07440511, 0.94023957, + 1.91666262, 2.83340828, 3.83651295, 4.77839424, 6.12284019, 7.00000000, 8.00000000, 9.00000000, -12.00000000, -11.00000000, +-10.00000000, -9.00000000, -8.00000000, -6.68554513, -5.97994708, -4.98789075, -3.91383581, -2.92952795, -1.91727195, -0.93148075, +-0.00568870, 0.93515148, 1.94580068, 2.93838956, 3.92567644, 4.96573603, 5.95402763, 7.00000000, 8.00000000, 9.00000000, +-11.00000000, -9.90096030, -8.97868124, -7.93663988, -6.98806055, -5.95937864, -4.93473664, -3.95454756, -2.96518446, -1.97711766, +-0.98552111, -0.03317271, 0.95115775, 1.93785086, 2.96310779, 3.93322450, 5.01716212, 5.85909823, 6.89163669, 7.97492693, + 8.85698897, 9.79802946, 11.09373957, 12.00000000, -13.00000000, -12.00000000, -10.67579109, -9.95079100, -8.90576592, -7.93254656, +-6.96112672, -5.96015798, -4.95493809, -3.98556269, -2.98182856, -1.98150255, -0.96551153, -0.00399791, 0.98644875, 1.98043830, + 2.97969033, 3.97728257, 4.95173541, 5.95649050, 6.96447378, 7.95591513, 9.07680954, 9.92093070, 10.76496555, 11.97525735, + 13.00000000, 14.00000000, -25.00000000, -24.00000000, -23.00000000, -22.00072357, -21.00000000, -20.00000000, -19.00000000, -18.20003462, +-17.01648407, -15.78651996, -14.95660266, -13.99167850, -13.28722978, -11.85013840, -10.92025302, -9.87055810, -8.93841040, -7.95329867, +-6.97819441, -6.01593394, -5.00905213, -3.99905285, -2.99171810, -1.99062796, -1.00112466, 0.00140492, 1.00701091, 2.02327185, + 3.00194633, 3.99188294, 5.00313145, 6.00448038, 6.98904951, 7.98158293, 8.98212774, 10.00363404, 10.98641678, 11.98034311, + 12.95176779, 13.95383703, 14.99084578, 15.98600642, 16.99406826, 17.98134623, 19.01793961, 19.86072639, 20.88465474, 21.99287082, + 22.81916620, 23.77946383, 0.00000234, 0.00000298, 0.00000048, 0.00002408, -0.00000165, -0.00001831, -0.00005703, -0.00000184, +-1.00000000, 0.00001977, 1.00000000, -1.00000000, 0.00000010, 1.00000000, -1.00000000, -0.00001152, 1.00000000, -1.00000000, + 0.00000840, 1.00000000, -1.00000000, 0.00002353, 1.00000000, -0.75455603, -0.00001433, 1.00000000, -0.65859705, -0.00000703, + 0.62995860, -2.00000000, -0.72724652, -0.00033969, 0.61359174, 2.00000000, -2.00000000, -0.69510998, -0.00031410, 0.66467605, + 2.00000000, 3.00000000, -3.00000000, -2.00000000, -0.65738683, 0.00039019, 0.66554720, 1.91774106, 3.18089124, 0.00000070, + 0.00001152, -0.00000795, -0.00000058, -0.00003502, -0.00001508, -0.00004225, -0.00002165, -1.00000000, 0.00004391, 1.00000000, +-1.00000000, 0.00001784, 1.00000000, -1.00000000, -0.00003678, 1.00000000, -0.68878314, -0.00013166, 0.60880149, -0.75291978, + 0.00006493, 1.00000000, -0.76757316, 0.00003057, 0.67140524, -0.61602267, -0.00014495, 0.63625803, 2.00000000, -2.00000000, +-0.61253314, -0.00116483, 0.65071851, 2.00000000, -3.00000000, -1.71451667, -0.67799909, -0.00048294, 0.65846019, 2.00000000, +-3.02497593, -1.83515395, -0.70317981, 0.00519701, 0.67780009, 1.84218153, 2.88846262, 4.00000000, 0.00001124, 0.00000588, +-0.00000172, 0.00002835, 1.00000000, 0.00001012, -0.00008644, 1.00000000, -0.75115901, 0.00004347, 1.00000000, -1.00000000, + 0.00002800, 1.00000000, -1.00000000, -0.00006039, 1.00000000, -0.79763258, -0.00011907, 0.71713616, -0.76791870, -0.00007113, + 0.63583609, -0.62337806, 0.00012891, 0.62242094, -0.60837055, 0.00043216, 0.65515705, -0.63637782, -0.00019749, 0.60423967, + 2.00000000, -2.00000000, -0.65404827, -0.00089304, 0.64706660, 2.00000000, -1.86334076, -0.66410366, 0.00063219, 0.66968004, + 2.00000000, 3.00000000, 4.00000000, -4.00000000, -3.00000000, -1.79048834, -0.69451890, 0.00030677, 0.71009333, 1.70591343, + 3.00000000, 4.00000000, -4.00000000, -2.90176499, -1.78368781, -0.74425178, 0.00234068, 0.74847325, 1.78886822, 2.78478854, + 3.83608985, 4.95996151, 0.00002170, 0.00001281, 0.00002162, -1.00000000, -0.00007266, 1.00000000, -1.00000000, -0.00003250, +-0.64088804, 0.00015239, 1.00000000, -0.58450370, -0.00008410, 0.60567186, -1.00000000, -0.00010752, 1.00000000, -0.58922508, +-0.00017378, 0.60755779, -0.62797206, -0.00001016, 0.64432847, -0.58497934, -0.00001851, 0.59716791, -0.62642499, -0.00097386, + 0.63568558, 2.00000000, -2.00000000, -0.63236390, -0.00173361, 0.63142762, 1.75629192, -3.00000000, -2.00000000, -0.65596684, + 0.00209364, 0.65419742, 2.00000000, -3.00000000, -1.73856625, -0.67767521, -0.00119512, 0.68973603, 1.70985573, 3.00000000, +-3.00000000, -1.81820220, -0.73974134, 0.00695869, 0.72216179, 1.75624461, 3.00000000, 4.00000000, -5.00000000, -4.00000000, +-3.17718593, -1.76857567, -0.76822322, 0.00267400, 0.76414602, 1.84309221, 3.04940652, 4.00000000, -7.08189123, -6.00000000, +-5.22882249, -3.96477958, -2.79653492, -1.81923435, -0.80050253, -0.01086663, 0.82708565, 1.85804900, 2.89996354, 3.76028554, + 4.80518081, 5.81738096, 7.00000000, 8.00000000, 9.08816091, -0.00002979, -0.00000333, -1.00000000, -0.00011532, 1.00000000, +-0.70921122, -0.00005325, 0.68933188, -0.67581263, -0.00023107, 0.57868212, -0.58388312, -0.00020850, 0.60149012, -0.60912457, + 0.00001567, 0.60180554, -0.59130091, -0.00038863, 0.59908653, -2.00000000, -0.63697707, 0.00083913, 0.62040514, 2.00000000, +-2.00000000, -0.63216238, -0.00081100, 0.64411071, 2.00000000, -1.76856259, -0.65266989, -0.00243486, 0.66888899, 2.00000000, +-1.75427214, -0.71415385, -0.00226376, 0.71296778, 1.66182947, 3.00000000, -3.00000000, -1.72505821, -0.72920134, -0.00360424, + 0.73800767, 1.72848281, 3.00000000, -4.00000000, -2.95284408, -1.72025758, -0.76503859, 0.00418761, 0.75297139, 1.73959808, + 3.00000000, -5.00000000, -3.96232791, -2.74080544, -1.78897123, -0.80233505, -0.00002050, 0.79693417, 1.76182598, 2.78434458, + 3.85693287, 5.00000000, -6.00000000, -4.78439284, -3.83501790, -2.85203629, -1.84909573, -0.85382658, -0.00181019, 0.84735145, + 1.83676575, 2.83656843, 3.86722376, 4.79702431, 6.00000000, -9.00000000, -8.00000000, -7.00000000, -6.07957292, -4.84677515, +-3.85093972, -2.88683139, -1.84596391, -0.88058034, -0.00008692, 0.87554746, 1.86933183, 2.84729990, 3.89029797, 4.87311773, + 5.90844023, 7.00000000, -11.00000000, -9.97745420, -8.90015761, -7.94187517, -6.86987726, -5.84795335, -4.86693435, -3.90601819, +-2.91031804, -1.91620096, -0.90497055, 0.00659199, 0.90926869, 1.90980821, 2.91070850, 3.93685967, 4.85581177, 6.06727337, + 7.05801043, 8.00000000, 9.00000000, 10.00000000, 10.90825787, 12.00000000, 13.00000000, 14.00000000, -0.00008918, 1.00000000, +-0.54405938, 0.00120348, 0.55781920, -0.59227786, -0.00349602, 0.59777231, -1.63717598, -0.69048065, 0.00999281, 0.65770558, + 2.00000000, -2.00000000, -0.71013571, 0.00454518, 0.66991065, -3.00000000, -1.73004867, -0.73743921, 0.01162454, 0.69964842, + 1.83319587, -1.81225491, -0.76806000, 0.00164742, 0.76780397, 1.67168896, -1.64564794, -0.79903361, -0.01522880, 0.84277926, + 1.68873752, -3.00000000, -1.72063244, -0.83687428, 0.00246724, 0.84618697, 1.79464483, 2.77447025, -3.77118426, -2.75025539, +-1.82050448, -0.90373722, -0.00187780, 0.90102245, 1.85249394, 2.71364180, -2.71720889, -1.79466125, -0.89860801, -0.02725825, + 0.90877329, 1.90542096, 2.76847902, 3.71496428, -4.70257302, -3.90746659, -2.87078421, -1.88858709, -0.93608993, -0.02157425, + 0.95181182, 1.91155682, 2.83614575, 3.87820801, 4.72172277, -5.02764544, -3.80066801, -2.87484378, -1.90707477, -0.96326017, +-0.01060091, 0.96558851, 1.92191548, 2.86970759, 3.85655474, 4.83135970, 5.76387469, -9.00000000, -8.00000000, -6.75261776, +-5.86333393, -4.84846871, -3.91871758, -2.93827286, -1.93050320, -0.96359634, -0.00141931, 0.95926312, 1.92541870, 2.93009411, + 3.86699087, 4.82315929, 5.67815206, -8.76594345, -7.70350451, -6.91784020, -5.81539490, -4.92526872, -3.91513203, -2.92134949, +-1.95465646, -0.97638102, -0.00742564, 0.96948714, 1.96401112, 2.95256722, 3.93146353, 4.90991357, 5.88139022, 6.88640588, + 7.82610489, 9.00000000, -10.97611369, -9.80036760, -8.91109518, -7.92809404, -6.93865353, -5.91965899, -4.92957669, -3.95206224, +-2.97308718, -1.97778214, -0.98552568, -0.00063212, 0.98686014, 1.97511867, 2.97114218, 3.97854244, 4.96578513, 5.96457765, + 6.95180187, 7.95163483, 8.93760897, 9.87666900, 10.88024562, 11.96270158, 12.99519291, -15.00000000, -13.76826291, -12.97229116, +-12.00334834, -10.95980884, -9.98190891, -8.93798503, -7.95621309, -6.96109479, -5.96056649, -4.95843419, -3.97688640, -2.98989576, +-1.98533395, -0.99580972, 0.00694370, 0.99421120, 1.99033132, 2.98751217, 3.98549580, 4.96482394, 5.96623233, 6.93564626, + 7.93772467, 8.92015276, 9.88785129, 10.97606096, 11.79686057, -23.00000000, -22.00000000, -21.00000000, -20.00000000, -19.00000000, +-17.73310977, -16.83574096, -15.90889480, -15.00437366, -13.95007272, -12.99296117, -11.98334751, -10.96970820, -9.97775151, -8.98193840, +-7.98378966, -6.98887770, -5.99059477, -5.00228769, -3.99355850, -2.99947486, -1.99897483, -0.99375857, 0.00324880, 1.00215912, + 1.99277083, 3.00503747, 3.99390482, 4.98854283, 5.98753219, 6.98245347, 7.98089893, 8.95960522, 9.95663648, 11.00810285, + 12.01421617, 12.96208687, 13.99227766, 14.97230040, 15.95114804, 16.97347393, 17.97794884, 18.96777118, 19.94446034, 20.94799029, + 22.14740083, 22.84288347, 23.99212109, 25.00000000, 25.96562658}; + +/* cdf tables for quantizer indices */ +const WebRtc_UWord16 WebRtcIsac_kQKltCdfGain[1212] = { + 0, 13, 301, 3730, 61784, 65167, 65489, 65535, 0, 17, + 142, 314, 929, 2466, 7678, 56450, 63463, 64740, 65204, 65426, + 65527, 65535, 0, 8, 100, 724, 6301, 60105, 65125, 65510, + 65531, 65535, 0, 13, 117, 368, 1068, 3010, 11928, 53603, + 61177, 63404, 64505, 65108, 65422, 65502, 65531, 65535, 0, 4, + 17, 96, 410, 1859, 12125, 54361, 64103, 65305, 65497, 65535, + 0, 4, 88, 230, 469, 950, 1746, 3228, 6092, 16592, + 44756, 56848, 61256, 63308, 64325, 64920, 65309, 65460, 65502, 65522, + 65535, 0, 88, 352, 1675, 6339, 20749, 46686, 59284, 63525, + 64949, 65359, 65502, 65527, 65535, 0, 13, 38, 63, 117, + 234, 381, 641, 929, 1407, 2043, 2809, 4032, 5753, 8792, + 14407, 24308, 38941, 48947, 55403, 59293, 61411, 62688, 63630, 64329, + 64840, 65188, 65376, 65472, 65506, 65527, 65531, 65535, 0, 8, + 29, 75, 222, 615, 1327, 2801, 5623, 9931, 16094, 24966, + 34419, 43458, 50676, 56186, 60055, 62500, 63936, 64765, 65225, 65435, + 65514, 65535, 0, 8, 13, 15, 17, 21, 33, 59, + 71, 92, 151, 243, 360, 456, 674, 934, 1223, 1583, + 1989, 2504, 3031, 3617, 4354, 5154, 6163, 7411, 8780, 10747, + 12874, 15591, 18974, 23027, 27436, 32020, 36948, 41830, 46205, 49797, + 53042, 56094, 58418, 60360, 61763, 62818, 63559, 64103, 64509, 64798, + 65045, 65162, 65288, 65363, 65447, 65506, 65522, 65531, 65533, 65535, + 0, 4, 6, 25, 38, 71, 138, 264, 519, 808, + 1227, 1825, 2516, 3408, 4279, 5560, 7092, 9197, 11420, 14108, + 16947, 20300, 23926, 27459, 31164, 34827, 38575, 42178, 45540, 48747, + 51444, 54090, 56426, 58460, 60080, 61595, 62734, 63668, 64275, 64673, + 64936, 65112, 65217, 65334, 65426, 65464, 65477, 65489, 65518, 65527, + 65529, 65531, 65533, 65535, 0, 2, 4, 8, 10, 12, + 14, 16, 21, 33, 50, 71, 84, 92, 105, 138, + 180, 255, 318, 377, 435, 473, 511, 590, 682, 758, + 913, 1097, 1256, 1449, 1671, 1884, 2169, 2445, 2772, 3157, + 3563, 3944, 4375, 4848, 5334, 5820, 6448, 7101, 7716, 8378, + 9102, 9956, 10752, 11648, 12707, 13670, 14758, 15910, 17187, 18472, + 19627, 20649, 21951, 23169, 24283, 25552, 26862, 28227, 29391, 30764, + 31882, 33213, 34432, 35600, 36910, 38116, 39464, 40729, 41872, 43144, + 44371, 45514, 46762, 47813, 48968, 50069, 51032, 51974, 52908, 53737, + 54603, 55445, 56282, 56990, 57572, 58191, 58840, 59410, 59887, 60264, + 60607, 60946, 61269, 61516, 61771, 61960, 62198, 62408, 62558, 62776, + 62985, 63207, 63408, 63546, 63739, 63906, 64070, 64237, 64371, 64551, + 64677, 64836, 64999, 65095, 65213, 65284, 65338, 65380, 65426, 65447, + 65472, 65485, 65487, 65489, 65502, 65510, 65512, 65514, 65516, 65518, + 65522, 65531, 65533, 65535, 0, 2, 4, 6, 65528, 65531, + 65533, 65535, 0, 2, 4, 6, 8, 10, 222, 65321, + 65513, 65528, 65531, 65533, 65535, 0, 2, 4, 50, 65476, + 65529, 65531, 65533, 65535, 0, 2, 4, 6, 8, 12, + 38, 544, 64936, 65509, 65523, 65525, 65529, 65531, 65533, 65535, + 0, 2, 4, 6, 8, 10, 1055, 64508, 65528, 65531, + 65533, 65535, 0, 2, 4, 6, 8, 10, 12, 123, + 3956, 62999, 65372, 65495, 65515, 65521, 65523, 65525, 65527, 65529, + 65531, 65533, 65535, 0, 2, 4, 12, 53, 4707, 59445, + 65467, 65525, 65527, 65529, 65531, 65533, 65535, 0, 2, 4, + 6, 8, 10, 12, 14, 16, 38, 40, 50, 67, + 96, 234, 929, 14345, 55750, 64866, 65389, 65462, 65514, 65517, + 65519, 65521, 65523, 65525, 65527, 65529, 65531, 65533, 65535, 0, + 2, 4, 6, 8, 10, 15, 35, 91, 377, 1946, + 13618, 52565, 63714, 65184, 65465, 65520, 65523, 65525, 65527, 65529, + 65531, 65533, 65535, 0, 2, 4, 6, 8, 10, 12, + 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, + 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, + 54, 82, 149, 362, 751, 1701, 4239, 12893, 38627, 55072, + 60875, 63071, 64158, 64702, 65096, 65283, 65412, 65473, 65494, 65505, + 65508, 65517, 65519, 65521, 65523, 65525, 65527, 65529, 65531, 65533, + 65535, 0, 2, 15, 23, 53, 143, 260, 418, 698, + 988, 1353, 1812, 2411, 3144, 4015, 5143, 6401, 7611, 8999, + 10653, 12512, 14636, 16865, 19404, 22154, 24798, 27521, 30326, 33102, + 35790, 38603, 41415, 43968, 46771, 49435, 52152, 54715, 57143, 59481, + 61178, 62507, 63603, 64489, 64997, 65257, 65427, 65473, 65503, 65520, + 65529, 65531, 65533, 65535, 0, 3, 6, 9, 26, 32, + 44, 46, 64, 94, 111, 164, 205, 254, 327, 409, + 506, 608, 733, 885, 1093, 1292, 1482, 1742, 1993, 2329, + 2615, 3029, 3374, 3798, 4257, 4870, 5405, 5992, 6618, 7225, + 7816, 8418, 9051, 9761, 10532, 11380, 12113, 13010, 13788, 14594, + 15455, 16361, 17182, 18088, 18997, 20046, 20951, 21968, 22947, 24124, + 25296, 26547, 27712, 28775, 29807, 30835, 31709, 32469, 33201, 34014, + 34876, 35773, 36696, 37620, 38558, 39547, 40406, 41277, 42367, 43290, + 44445, 45443, 46510, 47684, 48973, 50157, 51187, 52242, 53209, 54083, + 55006, 55871, 56618, 57293, 57965, 58556, 59222, 59722, 60180, 60554, + 60902, 61250, 61554, 61837, 62100, 62372, 62631, 62856, 63078, 63324, + 63557, 63768, 63961, 64089, 64235, 64352, 64501, 64633, 64770, 64887, + 65001, 65059, 65121, 65188, 65246, 65302, 65346, 65390, 65428, 65463, + 65477, 65506, 65515, 65517, 65519, 65521, 65523, 65525, 65527, 65529, + 65531, 65533, 65535, 0, 2, 4, 109, 65332, 65531, 65533, + 65535, 0, 2, 4, 6, 8, 25, 1817, 63874, 65511, + 65527, 65529, 65531, 65533, 65535, 0, 2, 4, 907, 65014, + 65529, 65531, 65533, 65535, 0, 2, 4, 6, 8, 10, + 12, 132, 2743, 62708, 65430, 65525, 65527, 65529, 65531, 65533, + 65535, 0, 2, 4, 6, 8, 35, 3743, 61666, 65485, + 65531, 65533, 65535, 0, 2, 4, 6, 8, 10, 23, + 109, 683, 6905, 58417, 64911, 65398, 65497, 65518, 65525, 65527, + 65529, 65531, 65533, 65535, 0, 2, 4, 6, 53, 510, + 10209, 55212, 64573, 65441, 65522, 65529, 65531, 65533, 65535, 0, + 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, + 22, 32, 90, 266, 1037, 3349, 14468, 50488, 62394, 64685, + 65341, 65480, 65514, 65519, 65521, 65523, 65525, 65527, 65529, 65531, + 65533, 65535, 0, 2, 4, 6, 9, 16, 37, 106, + 296, 748, 1868, 5733, 18897, 45553, 60165, 63949, 64926, 65314, + 65441, 65508, 65524, 65529, 65531, 65533, 65535, 0, 2, 4, + 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, + 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, + 46, 48, 50, 83, 175, 344, 667, 1293, 2337, 4357, + 8033, 14988, 28600, 43244, 52011, 57042, 59980, 61779, 63065, 63869, + 64390, 64753, 64988, 65164, 65326, 65422, 65462, 65492, 65506, 65522, + 65524, 65526, 65531, 65533, 65535, 0, 2, 4, 6, 8, + 10, 12, 14, 16, 25, 39, 48, 55, 62, 65, + 85, 106, 139, 169, 194, 252, 323, 485, 688, 1074, + 1600, 2544, 3863, 5733, 8303, 11397, 15529, 20273, 25734, 31455, + 36853, 41891, 46410, 50306, 53702, 56503, 58673, 60479, 61880, 62989, + 63748, 64404, 64852, 65124, 65309, 65424, 65480, 65524, 65528, 65533, + 65535, 0, 2, 4, 6, 8, 10, 12, 14, 21, + 23, 25, 27, 29, 31, 39, 41, 43, 48, 60, + 72, 79, 106, 136, 166, 187, 224, 252, 323, 381, + 427, 478, 568, 660, 783, 912, 1046, 1175, 1365, 1567, + 1768, 2024, 2347, 2659, 3049, 3529, 4033, 4623, 5281, 5925, + 6726, 7526, 8417, 9468, 10783, 12141, 13571, 15222, 16916, 18659, + 20350, 22020, 23725, 25497, 27201, 29026, 30867, 32632, 34323, 36062, + 37829, 39466, 41144, 42654, 43981, 45343, 46579, 47759, 49013, 50171, + 51249, 52283, 53245, 54148, 54938, 55669, 56421, 57109, 57791, 58464, + 59092, 59674, 60105, 60653, 61083, 61407, 61757, 62095, 62388, 62649, + 62873, 63157, 63358, 63540, 63725, 63884, 64046, 64155, 64278, 64426, + 64548, 64654, 64806, 64906, 64994, 65077, 65137, 65215, 65277, 65324, + 65354, 65409, 65437, 65455, 65462, 65490, 65495, 65499, 65508, 65511, + 65513, 65515, 65517, 65519, 65521, 65523, 65525, 65527, 65529, 65531, + 65533, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQKltCdfShape[2059] = { + 0, 65535, 0, 65535, 0, 65535, 0, 65535, 0, 65535, + 0, 65535, 0, 65535, 0, 65535, 0, 65535, 0, 4, + 65535, 0, 8, 65514, 65535, 0, 29, 65481, 65535, 0, + 121, 65439, 65535, 0, 239, 65284, 65535, 0, 8, 779, + 64999, 65527, 65535, 0, 8, 888, 64693, 65522, 65535, 0, + 29, 2604, 62843, 65497, 65531, 65535, 0, 25, 176, 4576, + 61164, 65275, 65527, 65535, 0, 65535, 0, 65535, 0, 65535, + 0, 65535, 0, 4, 65535, 0, 65535, 0, 65535, 0, + 65535, 0, 65535, 0, 4, 65535, 0, 33, 65502, 65535, + 0, 54, 65481, 65535, 0, 251, 65309, 65535, 0, 611, + 65074, 65535, 0, 1273, 64292, 65527, 65535, 0, 4, 1809, + 63940, 65518, 65535, 0, 88, 4392, 60603, 65426, 65531, 65535, + 0, 25, 419, 7046, 57756, 64961, 65514, 65531, 65535, 0, + 65535, 0, 65535, 0, 65535, 0, 65535, 0, 4, 65531, + 65535, 0, 65535, 0, 8, 65531, 65535, 0, 4, 65527, + 65535, 0, 17, 65510, 65535, 0, 42, 65481, 65535, 0, + 197, 65342, 65531, 65535, 0, 385, 65154, 65535, 0, 1005, + 64522, 65535, 0, 8, 1985, 63469, 65533, 65535, 0, 38, + 3119, 61884, 65514, 65535, 0, 4, 6, 67, 4961, 60804, + 65472, 65535, 0, 17, 565, 9182, 56538, 65087, 65514, 65535, + 0, 8, 63, 327, 2118, 14490, 52774, 63839, 65376, 65522, + 65535, 0, 65535, 0, 65535, 0, 65535, 0, 65535, 0, + 17, 65522, 65535, 0, 59, 65489, 65535, 0, 50, 65522, + 65535, 0, 54, 65489, 65535, 0, 310, 65179, 65535, 0, + 615, 64836, 65535, 0, 4, 1503, 63965, 65535, 0, 2780, + 63383, 65535, 0, 21, 3919, 61051, 65527, 65535, 0, 84, + 6674, 59929, 65435, 65535, 0, 4, 255, 7976, 55784, 65150, + 65518, 65531, 65535, 0, 4, 8, 582, 10726, 53465, 64949, + 65518, 65535, 0, 29, 339, 3006, 17555, 49517, 62956, 65200, + 65497, 65531, 65535, 0, 2, 33, 138, 565, 2324, 7670, + 22089, 45966, 58949, 63479, 64966, 65380, 65518, 65535, 0, 65535, + 0, 65535, 0, 2, 65533, 65535, 0, 46, 65514, 65535, + 0, 414, 65091, 65535, 0, 540, 64911, 65535, 0, 419, + 65162, 65535, 0, 976, 64790, 65535, 0, 2977, 62495, 65531, + 65535, 0, 4, 3852, 61034, 65527, 65535, 0, 4, 29, + 6021, 60243, 65468, 65535, 0, 84, 6711, 58066, 65418, 65535, + 0, 13, 281, 9550, 54917, 65125, 65506, 65535, 0, 2, + 63, 984, 12108, 52644, 64342, 65435, 65527, 65535, 0, 29, + 251, 2014, 14871, 47553, 62881, 65229, 65518, 65535, 0, 13, + 142, 749, 4220, 18497, 45200, 60913, 64823, 65426, 65527, 65535, + 0, 13, 71, 264, 1176, 3789, 10500, 24480, 43488, 56324, + 62315, 64493, 65242, 65464, 65514, 65522, 65531, 65535, 0, 4, + 13, 38, 109, 205, 448, 850, 1708, 3429, 6276, 11371, + 19221, 29734, 40955, 49391, 55411, 59460, 62102, 63793, 64656, 65150, + 65401, 65485, 65522, 65531, 65535, 0, 65535, 0, 2, 65533, + 65535, 0, 1160, 65476, 65535, 0, 2, 6640, 64763, 65533, + 65535, 0, 2, 38, 9923, 61009, 65527, 65535, 0, 2, + 4949, 63092, 65533, 65535, 0, 2, 3090, 63398, 65533, 65535, + 0, 2, 2520, 58744, 65510, 65535, 0, 2, 13, 544, + 8784, 51403, 65148, 65533, 65535, 0, 2, 25, 1017, 10412, + 43550, 63651, 65489, 65527, 65535, 0, 2, 4, 29, 783, + 13377, 52462, 64524, 65495, 65533, 65535, 0, 2, 4, 6, + 100, 1817, 18451, 52590, 63559, 65376, 65531, 65535, 0, 2, + 4, 6, 46, 385, 2562, 11225, 37416, 60488, 65026, 65487, + 65529, 65533, 65535, 0, 2, 4, 6, 8, 10, 12, + 42, 222, 971, 5221, 19811, 45048, 60312, 64486, 65294, 65474, + 65525, 65529, 65533, 65535, 0, 2, 4, 8, 71, 167, + 666, 2533, 7875, 19622, 38082, 54359, 62108, 64633, 65290, 65495, + 65529, 65533, 65535, 0, 2, 4, 6, 8, 10, 13, + 109, 586, 1930, 4949, 11600, 22641, 36125, 48312, 56899, 61495, + 63927, 64932, 65389, 65489, 65518, 65531, 65533, 65535, 0, 4, + 6, 8, 67, 209, 712, 1838, 4195, 8432, 14432, 22834, + 31723, 40523, 48139, 53929, 57865, 60657, 62403, 63584, 64363, 64907, + 65167, 65372, 65472, 65514, 65535, 0, 2, 4, 13, 25, + 42, 46, 50, 75, 113, 147, 281, 448, 657, 909, + 1185, 1591, 1976, 2600, 3676, 5317, 7398, 9914, 12941, 16169, + 19477, 22885, 26464, 29851, 33360, 37228, 41139, 44802, 48654, 52058, + 55181, 57676, 59581, 61022, 62190, 63107, 63676, 64199, 64547, 64924, + 65158, 65313, 65430, 65481, 65518, 65535, 0, 65535, 0, 65535, + 0, 65535, 0, 65535, 0, 65533, 65535, 0, 65535, 0, + 65535, 0, 65535, 0, 65533, 65535, 0, 2, 65535, 0, + 2, 65533, 65535, 0, 2, 65533, 65535, 0, 2, 65533, + 65535, 0, 2, 4, 65533, 65535, 0, 2, 65533, 65535, + 0, 2, 4, 65531, 65533, 65535, 0, 2, 4, 65531, + 65533, 65535, 0, 2, 4, 6, 65524, 65533, 65535, 0, + 65535, 0, 65535, 0, 65535, 0, 65535, 0, 65535, 0, + 65535, 0, 65535, 0, 65535, 0, 65533, 65535, 0, 65533, + 65535, 0, 2, 65533, 65535, 0, 2, 65533, 65535, 0, + 2, 65533, 65535, 0, 2, 4, 65532, 65535, 0, 6, + 65523, 65535, 0, 2, 15, 65530, 65533, 65535, 0, 2, + 35, 65493, 65531, 65533, 65535, 0, 2, 4, 158, 65382, + 65531, 65533, 65535, 0, 65535, 0, 65535, 0, 65535, 0, + 65535, 0, 65535, 0, 65535, 0, 2, 65535, 0, 2, + 65533, 65535, 0, 2, 65533, 65535, 0, 2, 65533, 65535, + 0, 2, 65533, 65535, 0, 9, 65512, 65535, 0, 2, + 12, 65529, 65535, 0, 2, 73, 65434, 65533, 65535, 0, + 2, 240, 65343, 65533, 65535, 0, 2, 476, 65017, 65531, + 65533, 65535, 0, 2, 4, 1046, 64686, 65531, 65533, 65535, + 0, 2, 4, 6, 8, 1870, 63898, 65529, 65531, 65533, + 65535, 0, 65535, 0, 65535, 0, 65535, 0, 65533, 65535, + 0, 2, 65533, 65535, 0, 2, 65533, 65535, 0, 2, + 65532, 65535, 0, 6, 65533, 65535, 0, 6, 65523, 65535, + 0, 2, 65532, 65535, 0, 137, 65439, 65535, 0, 576, + 64899, 65533, 65535, 0, 2, 289, 65299, 65533, 65535, 0, + 2, 4, 6, 880, 64134, 65531, 65533, 65535, 0, 2, + 4, 1853, 63347, 65533, 65535, 0, 2, 6, 2516, 61762, + 65529, 65531, 65533, 65535, 0, 2, 4, 9, 3980, 61380, + 65503, 65529, 65531, 65533, 65535, 0, 2, 4, 6, 8, + 10, 12, 61, 6393, 59859, 65466, 65527, 65529, 65531, 65533, + 65535, 0, 65535, 0, 65535, 0, 65535, 0, 2, 65532, + 65535, 0, 3, 65529, 65535, 0, 2, 65529, 65535, 0, + 61, 65453, 65535, 0, 234, 65313, 65535, 0, 503, 65138, + 65535, 0, 155, 65402, 65533, 65535, 0, 2, 1058, 64554, + 65533, 65535, 0, 2, 4, 3138, 62109, 65531, 65533, 65535, + 0, 2, 4, 2031, 63339, 65531, 65533, 65535, 0, 2, + 4, 6, 9, 4155, 60778, 65523, 65529, 65531, 65533, 65535, + 0, 2, 4, 41, 6189, 59269, 65490, 65531, 65533, 65535, + 0, 2, 4, 6, 210, 8789, 57043, 65400, 65528, 65531, + 65533, 65535, 0, 2, 4, 6, 8, 26, 453, 10086, + 55499, 64948, 65483, 65524, 65527, 65529, 65531, 65533, 65535, 0, + 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, + 114, 1014, 11202, 52670, 64226, 65356, 65503, 65514, 65523, 65525, + 65527, 65529, 65531, 65533, 65535, 0, 65533, 65535, 0, 15, + 65301, 65535, 0, 152, 64807, 65535, 0, 2, 3328, 63308, + 65535, 0, 2, 4050, 59730, 65533, 65535, 0, 2, 164, + 10564, 61894, 65529, 65535, 0, 15, 6712, 59831, 65076, 65532, + 65535, 0, 32, 7712, 57449, 65459, 65535, 0, 2, 210, + 7849, 53110, 65021, 65523, 65535, 0, 2, 12, 1081, 13883, + 48262, 62870, 65477, 65535, 0, 2, 88, 847, 6145, 37852, + 62012, 65454, 65533, 65535, 0, 9, 47, 207, 1823, 14522, + 45521, 61069, 64891, 65481, 65528, 65531, 65533, 65535, 0, 2, + 9, 488, 2881, 12758, 38703, 58412, 64420, 65410, 65533, 65535, + 0, 2, 4, 6, 61, 333, 1891, 6486, 19720, 43188, + 57547, 62472, 64796, 65421, 65497, 65523, 65529, 65531, 65533, 65535, + 0, 2, 4, 6, 8, 10, 12, 29, 117, 447, + 1528, 6138, 21242, 43133, 56495, 62432, 64746, 65362, 65500, 65529, + 65531, 65533, 65535, 0, 2, 18, 105, 301, 760, 1490, + 3472, 7568, 15002, 26424, 40330, 53029, 60048, 62964, 64274, 64890, + 65337, 65445, 65489, 65513, 65527, 65530, 65533, 65535, 0, 2, + 4, 6, 41, 102, 409, 853, 2031, 4316, 7302, 11328, + 16869, 24825, 34926, 43481, 50877, 56126, 59874, 62103, 63281, 63857, + 64166, 64675, 65382, 65522, 65531, 65533, 65535, 0, 2, 4, + 6, 8, 10, 12, 14, 16, 18, 29, 38, 53, + 58, 96, 181, 503, 1183, 2849, 5590, 8600, 11379, 13942, + 16478, 19453, 22638, 26039, 29411, 32921, 37596, 41433, 44998, 48560, + 51979, 55106, 57666, 59892, 61485, 62616, 63484, 64018, 64375, 64685, + 64924, 65076, 65278, 65395, 65471, 65509, 65529, 65535, 0, 65535, + 0, 65535, 0, 65535, 0, 65535, 0, 65535, 0, 65535, + 0, 65535, 0, 65535, 0, 2, 65533, 65535, 0, 2, + 65533, 65535, 0, 2, 65533, 65535, 0, 2, 65533, 65535, + 0, 2, 65533, 65535, 0, 2, 65533, 65535, 0, 7, + 65519, 65535, 0, 2, 14, 65491, 65533, 65535, 0, 2, + 81, 65427, 65531, 65533, 65535, 0, 2, 4, 312, 65293, + 65528, 65533, 65535, 0, 65535, 0, 65535, 0, 65535, 0, + 65535, 0, 65535, 0, 65535, 0, 65535, 0, 65535, 0, + 2, 65533, 65535, 0, 2, 65533, 65535, 0, 2, 65533, + 65535, 0, 5, 65523, 65535, 0, 2, 65533, 65535, 0, + 7, 65526, 65535, 0, 46, 65464, 65533, 65535, 0, 2, + 120, 65309, 65533, 65535, 0, 2, 5, 362, 65097, 65533, + 65535, 0, 2, 18, 1164, 64785, 65528, 65531, 65533, 65535, + 0, 65535, 0, 65535, 0, 65535, 0, 65533, 65535, 0, + 65535, 0, 65533, 65535, 0, 2, 65533, 65535, 0, 2, + 65533, 65535, 0, 2, 65533, 65535, 0, 2, 65530, 65535, + 0, 2, 65523, 65535, 0, 69, 65477, 65535, 0, 141, + 65459, 65535, 0, 194, 65325, 65533, 65535, 0, 2, 543, + 64912, 65533, 65535, 0, 5, 1270, 64301, 65529, 65531, 65533, + 65535, 0, 2, 4, 12, 2055, 63538, 65508, 65531, 65533, + 65535, 0, 2, 7, 102, 3775, 61970, 65429, 65526, 65528, + 65533, 65535, 0, 65535, 0, 65535, 0, 65535, 0, 2, + 65533, 65535, 0, 2, 65535, 0, 9, 65533, 65535, 0, + 25, 65512, 65535, 0, 2, 65533, 65535, 0, 44, 65480, + 65535, 0, 48, 65475, 65535, 0, 162, 65373, 65535, 0, + 637, 64806, 65533, 65535, 0, 2, 935, 64445, 65533, 65535, + 0, 2, 4, 1662, 64083, 65533, 65535, 0, 2, 12, + 3036, 62469, 65521, 65533, 65535, 0, 2, 120, 5405, 60468, + 65469, 65531, 65533, 65535, 0, 2, 4, 18, 254, 6663, + 58999, 65272, 65528, 65533, 65535, 0, 2, 4, 9, 12, + 67, 591, 8981, 56781, 64564, 65365, 65508, 65524, 65526, 65529, + 65531, 65533, 65535, 0, 65535, 0, 65535, 0, 2, 65533, + 65535, 0, 9, 65526, 65535, 0, 14, 65503, 65535, 0, + 127, 65390, 65535, 0, 517, 64990, 65535, 0, 178, 65330, + 65535, 0, 2, 1055, 64533, 65533, 65535, 0, 2, 1558, + 63942, 65533, 65535, 0, 2, 2205, 63173, 65533, 65535, 0, + 25, 4493, 60862, 65505, 65533, 65535, 0, 2, 48, 5890, + 59442, 65482, 65533, 65535, 0, 2, 4, 127, 7532, 58191, + 65394, 65533, 65535, 0, 2, 5, 32, 550, 10388, 54924, + 65046, 65510, 65531, 65533, 65535, 0, 2, 4, 30, 150, + 1685, 14340, 51375, 63619, 65288, 65503, 65528, 65533, 65535, 0, + 2, 4, 6, 8, 28, 97, 473, 2692, 15407, 50020, + 62880, 65064, 65445, 65508, 65531, 65533, 65535, 0, 2, 4, + 12, 32, 79, 150, 372, 907, 2184, 5868, 18207, 45431, + 59856, 64031, 65096, 65401, 65481, 65507, 65521, 65523, 65525, 65527, + 65529, 65531, 65533, 65535, 0, 65533, 65535, 0, 182, 65491, + 65535, 0, 877, 64286, 65535, 0, 9, 2708, 63612, 65533, + 65535, 0, 2, 6038, 59532, 65535, 0, 2, 92, 5500, + 60539, 65533, 65535, 0, 268, 8908, 56512, 65385, 65535, 0, + 129, 13110, 52742, 65036, 65535, 0, 2, 806, 14003, 51929, + 64732, 65523, 65535, 0, 7, 92, 2667, 18159, 47678, 62610, + 65355, 65535, 0, 32, 1836, 19676, 48237, 61677, 64960, 65526, + 65535, 0, 21, 159, 967, 5668, 22782, 44709, 58317, 64020, + 65406, 65528, 65535, 0, 7, 162, 1838, 8328, 23929, 43014, + 56394, 63374, 65216, 65484, 65521, 65535, 0, 2, 4, 6, + 28, 268, 1120, 3613, 10688, 24185, 40989, 54917, 61684, 64510, + 65403, 65530, 65535, 0, 2, 16, 44, 139, 492, 1739, + 5313, 13558, 26766, 41566, 52446, 58937, 62815, 64480, 65201, 65454, + 65524, 65533, 65535, 0, 7, 25, 76, 263, 612, 1466, + 3325, 6832, 12366, 20152, 29466, 39255, 47360, 53506, 57740, 60726, + 62845, 64131, 64882, 65260, 65459, 65521, 65528, 65530, 65535, 0, + 2, 4, 14, 48, 136, 312, 653, 1240, 2369, 4327, + 7028, 10759, 15449, 21235, 28027, 35386, 42938, 49562, 54990, 59119, + 62086, 63916, 64863, 65249, 65445, 65493, 65523, 65535, 0, 2, + 4, 6, 8, 10, 12, 21, 83, 208, 409, 723, + 1152, 1868, 2951, 4463, 6460, 8979, 11831, 15195, 18863, 22657, + 26762, 30881, 34963, 39098, 43054, 47069, 50620, 53871, 56821, 59386, + 61340, 62670, 63512, 64023, 64429, 64750, 64944, 65126, 65279, 65366, + 65413, 65445, 65473, 65505, 65510, 65521, 65528, 65530, 65535}; + +/* pointers to cdf tables for quantizer indices */ +const WebRtc_UWord16 *WebRtcIsac_kQKltCdfPtrGain[3][12] = { +{WebRtcIsac_kQKltCdfGain +0 +0, WebRtcIsac_kQKltCdfGain +0 +8, WebRtcIsac_kQKltCdfGain +0 +22, WebRtcIsac_kQKltCdfGain +0 +32, WebRtcIsac_kQKltCdfGain +0 +48, WebRtcIsac_kQKltCdfGain +0 +60, WebRtcIsac_kQKltCdfGain +0 +81, WebRtcIsac_kQKltCdfGain +0 +95, WebRtcIsac_kQKltCdfGain +0 +128, WebRtcIsac_kQKltCdfGain +0 +152, +WebRtcIsac_kQKltCdfGain +0 +210, WebRtcIsac_kQKltCdfGain +0 +264}, +{WebRtcIsac_kQKltCdfGain +404 +0, WebRtcIsac_kQKltCdfGain +404 +8, WebRtcIsac_kQKltCdfGain +404 +21, WebRtcIsac_kQKltCdfGain +404 +30, WebRtcIsac_kQKltCdfGain +404 +46, WebRtcIsac_kQKltCdfGain +404 +58, WebRtcIsac_kQKltCdfGain +404 +79, WebRtcIsac_kQKltCdfGain +404 +93, WebRtcIsac_kQKltCdfGain +404 +125, WebRtcIsac_kQKltCdfGain +404 +149, +WebRtcIsac_kQKltCdfGain +404 +207, WebRtcIsac_kQKltCdfGain +404 +260}, +{WebRtcIsac_kQKltCdfGain +803 +0, WebRtcIsac_kQKltCdfGain +803 +8, WebRtcIsac_kQKltCdfGain +803 +22, WebRtcIsac_kQKltCdfGain +803 +31, WebRtcIsac_kQKltCdfGain +803 +48, WebRtcIsac_kQKltCdfGain +803 +60, WebRtcIsac_kQKltCdfGain +803 +81, WebRtcIsac_kQKltCdfGain +803 +96, WebRtcIsac_kQKltCdfGain +803 +129, WebRtcIsac_kQKltCdfGain +803 +154, +WebRtcIsac_kQKltCdfGain +803 +212, WebRtcIsac_kQKltCdfGain +803 +268}}; + +const WebRtc_UWord16 *WebRtcIsac_kQKltCdfPtrShape[3][108] = { +{WebRtcIsac_kQKltCdfShape +0 +0, WebRtcIsac_kQKltCdfShape +0 +2, WebRtcIsac_kQKltCdfShape +0 +4, WebRtcIsac_kQKltCdfShape +0 +6, WebRtcIsac_kQKltCdfShape +0 +8, WebRtcIsac_kQKltCdfShape +0 +10, WebRtcIsac_kQKltCdfShape +0 +12, WebRtcIsac_kQKltCdfShape +0 +14, WebRtcIsac_kQKltCdfShape +0 +16, WebRtcIsac_kQKltCdfShape +0 +18, +WebRtcIsac_kQKltCdfShape +0 +21, WebRtcIsac_kQKltCdfShape +0 +25, WebRtcIsac_kQKltCdfShape +0 +29, WebRtcIsac_kQKltCdfShape +0 +33, WebRtcIsac_kQKltCdfShape +0 +37, WebRtcIsac_kQKltCdfShape +0 +43, WebRtcIsac_kQKltCdfShape +0 +49, WebRtcIsac_kQKltCdfShape +0 +56, WebRtcIsac_kQKltCdfShape +0 +64, WebRtcIsac_kQKltCdfShape +0 +66, +WebRtcIsac_kQKltCdfShape +0 +68, WebRtcIsac_kQKltCdfShape +0 +70, WebRtcIsac_kQKltCdfShape +0 +72, WebRtcIsac_kQKltCdfShape +0 +75, WebRtcIsac_kQKltCdfShape +0 +77, WebRtcIsac_kQKltCdfShape +0 +79, WebRtcIsac_kQKltCdfShape +0 +81, WebRtcIsac_kQKltCdfShape +0 +83, WebRtcIsac_kQKltCdfShape +0 +86, WebRtcIsac_kQKltCdfShape +0 +90, +WebRtcIsac_kQKltCdfShape +0 +94, WebRtcIsac_kQKltCdfShape +0 +98, WebRtcIsac_kQKltCdfShape +0 +102, WebRtcIsac_kQKltCdfShape +0 +107, WebRtcIsac_kQKltCdfShape +0 +113, WebRtcIsac_kQKltCdfShape +0 +120, WebRtcIsac_kQKltCdfShape +0 +129, WebRtcIsac_kQKltCdfShape +0 +131, WebRtcIsac_kQKltCdfShape +0 +133, WebRtcIsac_kQKltCdfShape +0 +135, +WebRtcIsac_kQKltCdfShape +0 +137, WebRtcIsac_kQKltCdfShape +0 +141, WebRtcIsac_kQKltCdfShape +0 +143, WebRtcIsac_kQKltCdfShape +0 +147, WebRtcIsac_kQKltCdfShape +0 +151, WebRtcIsac_kQKltCdfShape +0 +155, WebRtcIsac_kQKltCdfShape +0 +159, WebRtcIsac_kQKltCdfShape +0 +164, WebRtcIsac_kQKltCdfShape +0 +168, WebRtcIsac_kQKltCdfShape +0 +172, +WebRtcIsac_kQKltCdfShape +0 +178, WebRtcIsac_kQKltCdfShape +0 +184, WebRtcIsac_kQKltCdfShape +0 +192, WebRtcIsac_kQKltCdfShape +0 +200, WebRtcIsac_kQKltCdfShape +0 +211, WebRtcIsac_kQKltCdfShape +0 +213, WebRtcIsac_kQKltCdfShape +0 +215, WebRtcIsac_kQKltCdfShape +0 +217, WebRtcIsac_kQKltCdfShape +0 +219, WebRtcIsac_kQKltCdfShape +0 +223, +WebRtcIsac_kQKltCdfShape +0 +227, WebRtcIsac_kQKltCdfShape +0 +231, WebRtcIsac_kQKltCdfShape +0 +235, WebRtcIsac_kQKltCdfShape +0 +239, WebRtcIsac_kQKltCdfShape +0 +243, WebRtcIsac_kQKltCdfShape +0 +248, WebRtcIsac_kQKltCdfShape +0 +252, WebRtcIsac_kQKltCdfShape +0 +258, WebRtcIsac_kQKltCdfShape +0 +264, WebRtcIsac_kQKltCdfShape +0 +273, +WebRtcIsac_kQKltCdfShape +0 +282, WebRtcIsac_kQKltCdfShape +0 +293, WebRtcIsac_kQKltCdfShape +0 +308, WebRtcIsac_kQKltCdfShape +0 +310, WebRtcIsac_kQKltCdfShape +0 +312, WebRtcIsac_kQKltCdfShape +0 +316, WebRtcIsac_kQKltCdfShape +0 +320, WebRtcIsac_kQKltCdfShape +0 +324, WebRtcIsac_kQKltCdfShape +0 +328, WebRtcIsac_kQKltCdfShape +0 +332, +WebRtcIsac_kQKltCdfShape +0 +336, WebRtcIsac_kQKltCdfShape +0 +341, WebRtcIsac_kQKltCdfShape +0 +347, WebRtcIsac_kQKltCdfShape +0 +354, WebRtcIsac_kQKltCdfShape +0 +360, WebRtcIsac_kQKltCdfShape +0 +368, WebRtcIsac_kQKltCdfShape +0 +378, WebRtcIsac_kQKltCdfShape +0 +388, WebRtcIsac_kQKltCdfShape +0 +400, WebRtcIsac_kQKltCdfShape +0 +418, +WebRtcIsac_kQKltCdfShape +0 +445, WebRtcIsac_kQKltCdfShape +0 +447, WebRtcIsac_kQKltCdfShape +0 +451, WebRtcIsac_kQKltCdfShape +0 +455, WebRtcIsac_kQKltCdfShape +0 +461, WebRtcIsac_kQKltCdfShape +0 +468, WebRtcIsac_kQKltCdfShape +0 +474, WebRtcIsac_kQKltCdfShape +0 +480, WebRtcIsac_kQKltCdfShape +0 +486, WebRtcIsac_kQKltCdfShape +0 +495, +WebRtcIsac_kQKltCdfShape +0 +505, WebRtcIsac_kQKltCdfShape +0 +516, WebRtcIsac_kQKltCdfShape +0 +528, WebRtcIsac_kQKltCdfShape +0 +543, WebRtcIsac_kQKltCdfShape +0 +564, WebRtcIsac_kQKltCdfShape +0 +583, WebRtcIsac_kQKltCdfShape +0 +608, WebRtcIsac_kQKltCdfShape +0 +635}, +{WebRtcIsac_kQKltCdfShape +686 +0, WebRtcIsac_kQKltCdfShape +686 +2, WebRtcIsac_kQKltCdfShape +686 +4, WebRtcIsac_kQKltCdfShape +686 +6, WebRtcIsac_kQKltCdfShape +686 +8, WebRtcIsac_kQKltCdfShape +686 +11, WebRtcIsac_kQKltCdfShape +686 +13, WebRtcIsac_kQKltCdfShape +686 +15, WebRtcIsac_kQKltCdfShape +686 +17, WebRtcIsac_kQKltCdfShape +686 +20, +WebRtcIsac_kQKltCdfShape +686 +23, WebRtcIsac_kQKltCdfShape +686 +27, WebRtcIsac_kQKltCdfShape +686 +31, WebRtcIsac_kQKltCdfShape +686 +35, WebRtcIsac_kQKltCdfShape +686 +40, WebRtcIsac_kQKltCdfShape +686 +44, WebRtcIsac_kQKltCdfShape +686 +50, WebRtcIsac_kQKltCdfShape +686 +56, WebRtcIsac_kQKltCdfShape +686 +63, WebRtcIsac_kQKltCdfShape +686 +65, +WebRtcIsac_kQKltCdfShape +686 +67, WebRtcIsac_kQKltCdfShape +686 +69, WebRtcIsac_kQKltCdfShape +686 +71, WebRtcIsac_kQKltCdfShape +686 +73, WebRtcIsac_kQKltCdfShape +686 +75, WebRtcIsac_kQKltCdfShape +686 +77, WebRtcIsac_kQKltCdfShape +686 +79, WebRtcIsac_kQKltCdfShape +686 +82, WebRtcIsac_kQKltCdfShape +686 +85, WebRtcIsac_kQKltCdfShape +686 +89, +WebRtcIsac_kQKltCdfShape +686 +93, WebRtcIsac_kQKltCdfShape +686 +97, WebRtcIsac_kQKltCdfShape +686 +102, WebRtcIsac_kQKltCdfShape +686 +106, WebRtcIsac_kQKltCdfShape +686 +112, WebRtcIsac_kQKltCdfShape +686 +119, WebRtcIsac_kQKltCdfShape +686 +127, WebRtcIsac_kQKltCdfShape +686 +129, WebRtcIsac_kQKltCdfShape +686 +131, WebRtcIsac_kQKltCdfShape +686 +133, +WebRtcIsac_kQKltCdfShape +686 +135, WebRtcIsac_kQKltCdfShape +686 +137, WebRtcIsac_kQKltCdfShape +686 +139, WebRtcIsac_kQKltCdfShape +686 +142, WebRtcIsac_kQKltCdfShape +686 +146, WebRtcIsac_kQKltCdfShape +686 +150, WebRtcIsac_kQKltCdfShape +686 +154, WebRtcIsac_kQKltCdfShape +686 +158, WebRtcIsac_kQKltCdfShape +686 +162, WebRtcIsac_kQKltCdfShape +686 +167, +WebRtcIsac_kQKltCdfShape +686 +173, WebRtcIsac_kQKltCdfShape +686 +179, WebRtcIsac_kQKltCdfShape +686 +186, WebRtcIsac_kQKltCdfShape +686 +194, WebRtcIsac_kQKltCdfShape +686 +205, WebRtcIsac_kQKltCdfShape +686 +207, WebRtcIsac_kQKltCdfShape +686 +209, WebRtcIsac_kQKltCdfShape +686 +211, WebRtcIsac_kQKltCdfShape +686 +214, WebRtcIsac_kQKltCdfShape +686 +218, +WebRtcIsac_kQKltCdfShape +686 +222, WebRtcIsac_kQKltCdfShape +686 +226, WebRtcIsac_kQKltCdfShape +686 +230, WebRtcIsac_kQKltCdfShape +686 +234, WebRtcIsac_kQKltCdfShape +686 +238, WebRtcIsac_kQKltCdfShape +686 +242, WebRtcIsac_kQKltCdfShape +686 +247, WebRtcIsac_kQKltCdfShape +686 +253, WebRtcIsac_kQKltCdfShape +686 +262, WebRtcIsac_kQKltCdfShape +686 +269, +WebRtcIsac_kQKltCdfShape +686 +278, WebRtcIsac_kQKltCdfShape +686 +289, WebRtcIsac_kQKltCdfShape +686 +305, WebRtcIsac_kQKltCdfShape +686 +307, WebRtcIsac_kQKltCdfShape +686 +309, WebRtcIsac_kQKltCdfShape +686 +311, WebRtcIsac_kQKltCdfShape +686 +315, WebRtcIsac_kQKltCdfShape +686 +319, WebRtcIsac_kQKltCdfShape +686 +323, WebRtcIsac_kQKltCdfShape +686 +327, +WebRtcIsac_kQKltCdfShape +686 +331, WebRtcIsac_kQKltCdfShape +686 +335, WebRtcIsac_kQKltCdfShape +686 +340, WebRtcIsac_kQKltCdfShape +686 +346, WebRtcIsac_kQKltCdfShape +686 +354, WebRtcIsac_kQKltCdfShape +686 +362, WebRtcIsac_kQKltCdfShape +686 +374, WebRtcIsac_kQKltCdfShape +686 +384, WebRtcIsac_kQKltCdfShape +686 +396, WebRtcIsac_kQKltCdfShape +686 +413, +WebRtcIsac_kQKltCdfShape +686 +439, WebRtcIsac_kQKltCdfShape +686 +442, WebRtcIsac_kQKltCdfShape +686 +446, WebRtcIsac_kQKltCdfShape +686 +450, WebRtcIsac_kQKltCdfShape +686 +455, WebRtcIsac_kQKltCdfShape +686 +461, WebRtcIsac_kQKltCdfShape +686 +468, WebRtcIsac_kQKltCdfShape +686 +475, WebRtcIsac_kQKltCdfShape +686 +481, WebRtcIsac_kQKltCdfShape +686 +489, +WebRtcIsac_kQKltCdfShape +686 +498, WebRtcIsac_kQKltCdfShape +686 +508, WebRtcIsac_kQKltCdfShape +686 +522, WebRtcIsac_kQKltCdfShape +686 +534, WebRtcIsac_kQKltCdfShape +686 +554, WebRtcIsac_kQKltCdfShape +686 +577, WebRtcIsac_kQKltCdfShape +686 +602, WebRtcIsac_kQKltCdfShape +686 +631}, +{WebRtcIsac_kQKltCdfShape +1368 +0, WebRtcIsac_kQKltCdfShape +1368 +2, WebRtcIsac_kQKltCdfShape +1368 +4, WebRtcIsac_kQKltCdfShape +1368 +6, WebRtcIsac_kQKltCdfShape +1368 +8, WebRtcIsac_kQKltCdfShape +1368 +10, WebRtcIsac_kQKltCdfShape +1368 +12, WebRtcIsac_kQKltCdfShape +1368 +14, WebRtcIsac_kQKltCdfShape +1368 +16, WebRtcIsac_kQKltCdfShape +1368 +20, +WebRtcIsac_kQKltCdfShape +1368 +24, WebRtcIsac_kQKltCdfShape +1368 +28, WebRtcIsac_kQKltCdfShape +1368 +32, WebRtcIsac_kQKltCdfShape +1368 +36, WebRtcIsac_kQKltCdfShape +1368 +40, WebRtcIsac_kQKltCdfShape +1368 +44, WebRtcIsac_kQKltCdfShape +1368 +50, WebRtcIsac_kQKltCdfShape +1368 +57, WebRtcIsac_kQKltCdfShape +1368 +65, WebRtcIsac_kQKltCdfShape +1368 +67, +WebRtcIsac_kQKltCdfShape +1368 +69, WebRtcIsac_kQKltCdfShape +1368 +71, WebRtcIsac_kQKltCdfShape +1368 +73, WebRtcIsac_kQKltCdfShape +1368 +75, WebRtcIsac_kQKltCdfShape +1368 +77, WebRtcIsac_kQKltCdfShape +1368 +79, WebRtcIsac_kQKltCdfShape +1368 +81, WebRtcIsac_kQKltCdfShape +1368 +85, WebRtcIsac_kQKltCdfShape +1368 +89, WebRtcIsac_kQKltCdfShape +1368 +93, +WebRtcIsac_kQKltCdfShape +1368 +97, WebRtcIsac_kQKltCdfShape +1368 +101, WebRtcIsac_kQKltCdfShape +1368 +105, WebRtcIsac_kQKltCdfShape +1368 +110, WebRtcIsac_kQKltCdfShape +1368 +116, WebRtcIsac_kQKltCdfShape +1368 +123, WebRtcIsac_kQKltCdfShape +1368 +132, WebRtcIsac_kQKltCdfShape +1368 +134, WebRtcIsac_kQKltCdfShape +1368 +136, WebRtcIsac_kQKltCdfShape +1368 +138, +WebRtcIsac_kQKltCdfShape +1368 +141, WebRtcIsac_kQKltCdfShape +1368 +143, WebRtcIsac_kQKltCdfShape +1368 +146, WebRtcIsac_kQKltCdfShape +1368 +150, WebRtcIsac_kQKltCdfShape +1368 +154, WebRtcIsac_kQKltCdfShape +1368 +158, WebRtcIsac_kQKltCdfShape +1368 +162, WebRtcIsac_kQKltCdfShape +1368 +166, WebRtcIsac_kQKltCdfShape +1368 +170, WebRtcIsac_kQKltCdfShape +1368 +174, +WebRtcIsac_kQKltCdfShape +1368 +179, WebRtcIsac_kQKltCdfShape +1368 +185, WebRtcIsac_kQKltCdfShape +1368 +193, WebRtcIsac_kQKltCdfShape +1368 +203, WebRtcIsac_kQKltCdfShape +1368 +214, WebRtcIsac_kQKltCdfShape +1368 +216, WebRtcIsac_kQKltCdfShape +1368 +218, WebRtcIsac_kQKltCdfShape +1368 +220, WebRtcIsac_kQKltCdfShape +1368 +224, WebRtcIsac_kQKltCdfShape +1368 +227, +WebRtcIsac_kQKltCdfShape +1368 +231, WebRtcIsac_kQKltCdfShape +1368 +235, WebRtcIsac_kQKltCdfShape +1368 +239, WebRtcIsac_kQKltCdfShape +1368 +243, WebRtcIsac_kQKltCdfShape +1368 +247, WebRtcIsac_kQKltCdfShape +1368 +251, WebRtcIsac_kQKltCdfShape +1368 +256, WebRtcIsac_kQKltCdfShape +1368 +262, WebRtcIsac_kQKltCdfShape +1368 +269, WebRtcIsac_kQKltCdfShape +1368 +277, +WebRtcIsac_kQKltCdfShape +1368 +286, WebRtcIsac_kQKltCdfShape +1368 +297, WebRtcIsac_kQKltCdfShape +1368 +315, WebRtcIsac_kQKltCdfShape +1368 +317, WebRtcIsac_kQKltCdfShape +1368 +319, WebRtcIsac_kQKltCdfShape +1368 +323, WebRtcIsac_kQKltCdfShape +1368 +327, WebRtcIsac_kQKltCdfShape +1368 +331, WebRtcIsac_kQKltCdfShape +1368 +335, WebRtcIsac_kQKltCdfShape +1368 +339, +WebRtcIsac_kQKltCdfShape +1368 +343, WebRtcIsac_kQKltCdfShape +1368 +349, WebRtcIsac_kQKltCdfShape +1368 +355, WebRtcIsac_kQKltCdfShape +1368 +361, WebRtcIsac_kQKltCdfShape +1368 +368, WebRtcIsac_kQKltCdfShape +1368 +376, WebRtcIsac_kQKltCdfShape +1368 +385, WebRtcIsac_kQKltCdfShape +1368 +397, WebRtcIsac_kQKltCdfShape +1368 +411, WebRtcIsac_kQKltCdfShape +1368 +429, +WebRtcIsac_kQKltCdfShape +1368 +456, WebRtcIsac_kQKltCdfShape +1368 +459, WebRtcIsac_kQKltCdfShape +1368 +463, WebRtcIsac_kQKltCdfShape +1368 +467, WebRtcIsac_kQKltCdfShape +1368 +473, WebRtcIsac_kQKltCdfShape +1368 +478, WebRtcIsac_kQKltCdfShape +1368 +485, WebRtcIsac_kQKltCdfShape +1368 +491, WebRtcIsac_kQKltCdfShape +1368 +497, WebRtcIsac_kQKltCdfShape +1368 +505, +WebRtcIsac_kQKltCdfShape +1368 +514, WebRtcIsac_kQKltCdfShape +1368 +523, WebRtcIsac_kQKltCdfShape +1368 +535, WebRtcIsac_kQKltCdfShape +1368 +548, WebRtcIsac_kQKltCdfShape +1368 +565, WebRtcIsac_kQKltCdfShape +1368 +585, WebRtcIsac_kQKltCdfShape +1368 +611, WebRtcIsac_kQKltCdfShape +1368 +640}}; + +/* code length for all coefficients using different models */ +const double WebRtcIsac_kQKltCodeLenGain[392] = { + 12.29956028, 7.83007500, 4.25642781, 0.17489215, 4.27591254, 7.66908312, 10.47643804, 11.91253716, 9.03421572, 8.57373525, + 6.73555740, 5.41409855, 3.65237863, 0.42623449, 3.22418399, 5.68145719, 7.14201900, 8.20558413, 9.34178852, 13.00000000, + 13.00000000, 9.47643804, 6.71459778, 3.55472644, 0.28457419, 3.70652835, 7.41128536, 11.60768258, 14.00000000, 12.29956028, + 9.29956028, 8.02845645, 6.54878889, 5.07667251, 2.87749552, 0.65310542, 3.11316029, 4.87911416, 5.89540125, 6.76398581, + 7.70537925, 9.67807191, 11.14201900, 14.00000000, 14.00000000, 12.29956028, 9.69621925, 7.70537925, 5.49915812, 2.67441345, + 0.63381441, 2.74999773, 5.76877882, 8.41503750, 10.75207249, 14.00000000, 9.60768258, 8.85025288, 8.09913319, 7.09010692, + 6.36337538, 5.46667027, 4.51618422, 2.64189829, 1.21843537, 2.43823474, 3.89409149, 4.99718498, 6.00989604, 6.78325414, + 7.39637366, 8.76159526, 10.60768258, 11.67807191, 12.29956028, 9.54056838, 7.95560588, 5.63040265, 3.81264793, 2.18521728, + 1.33727600, 2.37909290, 3.94981123, 5.52426657, 7.32051990, 8.84012866, 11.35614381, 13.00000000, 12.29956028, 11.35614381, + 11.35614381, 10.24511250, 9.12963528, 8.80032766, 7.97763219, 7.83007500, 7.09913319, 6.68711704, 6.41879942, 5.74379131, + 5.25096862, 4.43061904, 3.54492969, 2.72664147, 2.16306204, 2.71142226, 3.34357514, 4.07444556, 4.95151313, 5.68145719, + 6.12041675, 6.55085135, 7.00282052, 7.55705650, 8.44541115, 9.41503750, 10.91253716, 11.60768258, 14.00000000, 14.00000000, + 13.00000000, 11.60768258, 10.47643804, 8.80032766, 7.38161450, 6.52426657, 5.47447919, 4.53749773, 3.92719747, 3.41058292, + 2.88495635, 2.79344346, 2.85805254, 3.18261657, 3.57216340, 4.08225499, 4.74438125, 5.51215997, 6.30477171, 7.15450995, + 8.28575448, 9.69621925, 11.60768258, 13.00000000, 13.67807191, 15.00000000, 15.00000000, 14.00000000, 12.41503750, 11.29956028, + 12.41503750, 11.60768258, 10.11735695, 9.47643804, 9.12963528, 9.41503750, 8.23181568, 7.97763219, 7.82507432, 7.50814690, + 7.33466408, 6.99157138, 6.95834085, 6.80524315, 6.47447919, 6.35614381, 6.02128954, 5.71459778, 5.58109327, 5.05821876, + 4.94539568, 4.59220115, 4.27591254, 4.01522554, 3.89376424, 3.83760867, 3.73321346, 3.74674342, 3.90493270, 4.18942837, + 4.33599724, 4.42446075, 4.81760565, 5.07667251, 5.54570071, 5.95697272, 6.46667027, 6.91253716, 7.33466408, 7.82507432, + 8.05163277, 9.12963528, 9.02272008, 9.77118131, 9.60768258, 10.11735695, 12.00000000, 12.83007500, 15.00000000, 15.00000000, + 14.00000000, 15.00000000, 11.75207249, 12.29956028, 10.95560588, 9.93391081, 9.02272008, 8.00564656, 7.82507432, 7.28919357, + 6.77599833, 6.56745810, 6.19910010, 6.23347109, 5.67694524, 5.41879942, 4.96039548, 4.88170777, 4.60768258, 4.52883287, + 4.28876323, 4.17583679, 4.21332197, 4.14474217, 4.16119001, 4.12809476, 4.18501706, 4.28489599, 4.35299136, 4.60286019, + 4.63040265, 4.81017544, 5.00989604, 5.33822190, 5.43489792, 5.84644797, 6.13272126, 6.75444729, 7.36337538, 7.96108101, + 8.54056838, 9.28575448, 9.12963528, 9.47643804, 10.75207249, 12.29956028, 12.41503750, 11.14201900, 12.83007500, 15.00000000, + 15.00000000, 15.00000000, 15.00000000, 15.00000000, 15.00000000, 14.00000000, 15.00000000, 15.00000000, 15.00000000, 15.00000000, + 13.67807191, 12.41503750, 11.91253716, 11.60768258, 12.29956028, 13.00000000, 12.29956028, 10.95560588, 10.60768258, 9.77118131, + 10.02272008, 10.11735695, 10.14201900, 10.75207249, 10.75207249, 9.69621925, 9.47643804, 9.75207249, 8.72387559, 8.47643804, + 8.68711704, 8.40754296, 8.20558413, 8.26529038, 7.84518189, 7.89147554, 7.64685317, 7.41128536, 7.33466408, 7.42635281, + 7.24845594, 7.11430363, 7.07518750, 7.07518750, 6.70537925, 6.64906082, 6.73555740, 6.62931259, 6.50015411, 6.26190774, + 6.36337538, 6.19264508, 5.95151313, 6.08860801, 5.91253716, 5.83007500, 5.68145719, 5.67244736, 5.82632286, 6.00282052, + 5.65348627, 5.74970158, 5.87846648, 5.69052365, 5.64464890, 5.58531476, 5.81512466, 5.57688409, 5.87329553, 5.62170514, + 5.74851759, 5.81017544, 5.64464890, 5.76398581, 5.60339522, 5.69507833, 5.84139031, 5.68711704, 5.73908047, 5.84139031, + 5.71459778, 5.96245305, 5.82632286, 5.89540125, 6.08860801, 6.12041675, 6.13272126, 6.30477171, 6.24177679, 6.28232358, + 6.29091619, 6.53239445, 6.81512466, 6.72620440, 6.65792533, 6.84518189, 7.10215454, 7.44157929, 7.57793523, 7.59485854, + 7.66460965, 8.05163277, 8.00564656, 8.43775758, 8.10518224, 8.28575448, 8.77118131, 8.23181568, 8.29264087, 8.20558413, + 8.34894831, 8.89147554, 8.40754296, 8.61629571, 8.64244800, 8.61629571, 8.93391081, 8.50814690, 9.02272008, 8.68711704, + 8.65127185, 9.41503750, 9.11735695, 9.85025288, 10.24511250, 10.60768258, 10.47643804, 11.60768258, 11.35614381, 12.29956028, + 15.00000000, 15.00000000, 12.29956028, 13.00000000, 15.00000000, 15.00000000, 15.00000000, 15.00000000, 14.00000000, 12.83007500, + 15.00000000, 15.00000000}; + +const double WebRtcIsac_kQKltCodeLenShape[578] = { + 0.00002201, 0.00002201, 0.00002201, 0.00002201, 0.00002201, 0.00002201, 0.00002201, 0.00002201, 0.00002201, 14.00000000, + 0.00011007, 13.00000000, 0.00066056, 11.60768258, 11.14201900, 0.00185034, 10.24511250, 9.08113676, 0.00480700, 9.41503750, + 8.09913319, 0.01084946, 8.02845645, 13.00000000, 6.40941295, 0.02926496, 6.95560588, 13.00000000, 13.00000000, 6.21864029, + 0.03861814, 6.30477171, 12.29956028, 11.14201900, 4.66964328, 0.12158980, 4.62604734, 10.91253716, 14.00000000, 11.35614381, + 8.76159526, 3.89671219, 0.21179147, 3.99472634, 8.02272008, 13.00000000, 0.00002201, 0.00002201, 0.00002201, 0.00002201, + 14.00000000, 0.00011007, 0.00002201, 0.00002201, 0.00002201, 0.00002201, 14.00000000, 0.00011007, 10.95560588, 0.00147568, + 10.95560588, 10.24511250, 0.00240150, 10.24511250, 8.02845645, 0.01056115, 8.17982104, 6.74497143, 0.02381629, 7.15137706, + 5.68598330, 0.05650076, 5.72970467, 13.00000000, 14.00000000, 5.18221688, 0.07697435, 5.37611851, 11.91253716, 9.54056838, + 3.92853764, 0.22143514, 3.76428491, 9.28575448, 14.00000000, 11.35614381, 7.37794818, 3.30585980, 0.37001735, 3.18521728, + 6.88886433, 11.91253716, 14.00000000, 0.00002201, 0.00002201, 0.00002201, 0.00002201, 14.00000000, 0.00019814, 14.00000000, + 0.00002201, 13.00000000, 0.00028621, 14.00000000, 14.00000000, 0.00028621, 13.00000000, 11.91253716, 0.00094690, 11.35614381, + 10.60768258, 0.00213692, 10.24511250, 8.37794818, 0.00863317, 8.43775758, 14.00000000, 7.41128536, 0.01698415, 7.42635281, + 6.02702021, 0.04514485, 6.01558154, 13.00000000, 5.05090284, 0.09207659, 4.98877274, 15.00000000, 10.75207249, 4.41081703, + 0.15733047, 4.17424617, 11.60768258, 14.00000000, 15.00000000, 10.06926266, 3.74320161, 0.23091117, 3.81141115, 10.02272008, + 11.91253716, 6.90196792, 2.92703003, 0.46874039, 2.93846004, 7.26190774, 11.60768258, 13.00000000, 10.21864029, 7.95560588, + 5.19345038, 2.40520888, 0.77554605, 2.56628417, 5.41409855, 8.81017544, 12.29956028, 0.00002201, 0.00002201, 0.00002201, + 0.00002201, 11.91253716, 0.00068259, 12.29956028, 10.11735695, 0.00233535, 10.47643804, 10.35614381, 0.00140957, 12.29956028, + 10.24511250, 0.00222511, 10.47643804, 7.72387559, 0.01475842, 7.52426657, 6.73555740, 0.02924249, 6.55085135, 14.00000000, + 5.45021533, 0.06930886, 5.38345116, 4.55913083, 0.11289841, 4.92853764, 11.60768258, 4.07148162, 0.19798859, 3.87200568, + 13.00000000, 9.60768258, 3.31393725, 0.29937064, 3.57321111, 9.35614381, 14.00000000, 8.02845645, 3.08542800, 0.45503557, + 2.80678268, 7.47643804, 12.29956028, 14.00000000, 14.00000000, 14.00000000, 6.83509307, 2.69166097, 0.61673447, 2.51266238, + 6.84771516, 11.91253716, 11.14201900, 7.72387559, 4.61899789, 2.17136763, 1.03592993, 2.28586183, 4.86814304, 7.78568088, + 10.91253716, 14.00000000, 15.00000000, 11.04580369, 9.28575448, 7.26190774, 5.21946023, 3.61575588, 2.18431651, 1.45666604, + 2.33566383, 3.85470467, 5.46181107, 7.30651304, 8.89147554, 11.91253716, 0.00002201, 0.00002201, 15.00000000, 0.00011007, + 15.00000000, 10.47643804, 0.00149771, 11.60768258, 7.30651304, 0.01903486, 7.20558413, 6.92318440, 0.02587674, 6.71459778, + 7.28919357, 0.01756340, 7.45696818, 6.06926266, 0.03841465, 6.45890338, 4.46035649, 0.13896157, 4.43204392, 14.00000000, + 14.00000000, 4.09010692, 0.19672654, 3.86653665, 13.00000000, 14.00000000, 11.35614381, 3.45117809, 0.27340929, 3.64878468, + 9.93391081, 9.60768258, 3.30585980, 0.35178287, 3.15607895, 9.12963528, 12.29956028, 7.93391081, 2.82180202, 0.53064436, + 2.68258739, 7.42635281, 11.14201900, 15.00000000, 10.06926266, 6.15294265, 2.55861197, 0.69308389, 2.48602573, 5.90592231, + 9.47643804, 13.00000000, 11.14201900, 8.20558413, 5.21618324, 2.34973357, 1.00379135, 2.09611815, 4.80278331, 7.82507432, + 11.91253716, 12.29956028, 8.98877274, 6.75444729, 4.23886435, 2.19859476, 1.29528579, 2.06032897, 4.06704711, 6.76398581, + 9.34178852, 13.00000000, 12.29956028, 10.14201900, 8.40754296, 6.16710999, 4.64850859, 3.28768796, 2.22892326, 1.78568088, + 2.35209193, 3.45141888, 4.91121176, 6.45117809, 8.20558413, 10.35614381, 13.00000000, 12.83007500, 14.00000000, 14.00000000, + 12.83007500, 11.35614381, 9.85025288, 9.41503750, 8.07518750, 7.34894831, 6.25516616, 5.25096862, 4.52477322, 3.68513357, + 3.06152306, 2.64011320, 2.54608637, 2.95765662, 3.44445223, 4.01665007, 4.63258525, 5.27633906, 6.24678325, 7.05163277, + 8.02845645, 9.60768258, 10.79054663, 12.83007500, 14.00000000, 0.00002201, 15.00000000, 0.00011007, 15.00000000, 5.82009091, + 0.02710994, 10.11735695, 15.00000000, 3.30346709, 0.17317845, 6.41128536, 15.00000000, 15.00000000, 10.83007500, 2.72897475, + 0.35935964, 3.85853144, 13.00000000, 15.00000000, 3.72766182, 0.17268211, 4.74674342, 15.00000000, 15.00000000, 4.40754296, + 0.11993823, 4.93997965, 15.00000000, 15.00000000, 4.70193743, 0.22110152, 3.27591254, 11.35614381, 15.00000000, 12.54056838, + 6.94743195, 2.99157138, 0.62079088, 2.25338071, 7.41128536, 15.00000000, 15.00000000, 11.47643804, 6.04580369, 2.80232255, + 0.98380109, 1.70502034, 5.15607895, 10.75207249, 13.00000000, 15.00000000, 15.00000000, 11.35614381, 6.44157929, 2.37955105, + 0.74567258, 2.44181848, 6.07667251, 10.75207249, 15.00000000, 15.00000000, 15.00000000, 15.00000000, 9.44541115, 5.25432568, + 1.97815248, 0.94086682, 2.57885561, 5.17265730, 8.72387559, 14.00000000, 15.00000000, 15.00000000, 15.00000000, 10.67807191, + 7.59485854, 4.91187431, 2.91934900, 1.32321648, 1.50614455, 3.85215911, 7.15137706, 10.60768258, 14.00000000, 15.00000000, + 15.00000000, 15.00000000, 15.00000000, 15.00000000, 15.00000000, 15.00000000, 11.09310940, 8.50814690, 6.45117809, 3.94675287, + 2.16730774, 1.37674720, 2.10215454, 3.97278511, 6.34178852, 8.50814690, 10.32757466, 14.00000000, 14.00000000, 15.00000000, + 15.00000000, 15.00000000, 14.00000000, 10.02272008, 9.41503750, 7.03710399, 5.13349379, 3.61683574, 2.47999526, 1.82788507, + 2.00945280, 3.08020557, 4.69793233, 6.64025044, 8.32051990, 10.91253716, 14.00000000, 15.00000000, 15.00000000, 15.00000000, + 15.00000000, 15.00000000, 15.00000000, 14.41503750, 9.41503750, 7.10215454, 5.60768258, 4.44014496, 3.30064444, 2.56941678, + 2.28103909, 2.42694459, 2.93206152, 3.83383692, 4.75207249, 6.02702021, 7.16394964, 9.35614381, 11.14201900, 12.29956028, + 15.00000000, 15.00000000, 14.00000000, 15.00000000, 15.00000000, 10.11735695, 8.85025288, 7.02558541, 5.86300889, 4.79726396, + 3.95117259, 3.44925321, 2.96348293, 2.88219459, 2.89671219, 3.10518224, 3.50065237, 4.05748549, 4.55291677, 5.23016216, + 5.79420675, 6.39452048, 6.91253716, 7.97763219, 8.32051990, 9.35614381, 10.60768258, 11.60768258, 15.00000000, 15.00000000, + 12.83007500, 12.41503750, 11.91253716, 14.00000000, 14.00000000, 11.35614381, 10.75207249, 10.91253716, 8.93391081, 8.61629571, + 8.29264087, 8.02272008, 7.89147554, 7.33466408, 7.41128536, 6.71459778, 5.92853764, 5.31964048, 4.97693875, 4.70308379, + 4.43632704, 4.34357514, 4.30825648, 4.26529038, 4.19465917, 4.27420773, 4.22315577, 4.08262792, 4.06667818, 4.16119001, + 4.08860801, 4.26698468, 4.39128315, 4.71517590, 5.10442472, 5.50714538, 5.81017544, 6.15922208}; + +/* left KLT transforms */ +const double WebRtcIsac_kKltT1Gain[3][4] = { +{-0.79742827, 0.60341375, 0.60341375, 0.79742827}, +{-0.81372390, 0.58125159, 0.58125159, 0.81372390}, +{-0.71832547, 0.69570721, 0.69570721, 0.71832547}}; + +const double WebRtcIsac_kKltT1Shape[3][324] = { +{ 0.00159597, 0.00049320, 0.00513821, 0.00021066, 0.01338581, -0.00422367, -0.00272072, 0.00935107, 0.02047622, 0.02691189, + 0.00478236, 0.03969702, 0.00886698, 0.04877604, -0.10898362, -0.05930891, -0.03415047, 0.98889721, 0.00293558, -0.00035282, + 0.01156321, -0.00195341, -0.00937631, 0.01052213, -0.02551163, 0.01644059, 0.03189927, 0.07754773, -0.08742313, -0.03026338, + 0.05136248, -0.14395974, 0.17725040, 0.22664856, 0.93380230, 0.07076411, 0.00557890, -0.00222834, 0.01377569, 0.01466808, + 0.02847361, -0.00603178, 0.02382480, -0.01210452, 0.03797267, -0.02371480, 0.11260335, -0.07366682, 0.00453436, -0.04136941, +-0.07912843, -0.95031418, 0.25295337, -0.05302216, -0.00617554, -0.00044040, -0.00653778, 0.01097838, 0.01529174, 0.01374431, +-0.00748512, -0.00020034, 0.02432713, 0.11101570, -0.08556891, 0.09282249, -0.01029446, 0.67556443, -0.67454300, 0.06910063, + 0.20866865, -0.10318050, 0.00932175, 0.00524058, 0.00803610, -0.00594676, -0.01082578, 0.01069906, 0.00546768, 0.01565291, + 0.06816200, 0.10201227, 0.16812734, 0.22984074, 0.58213170, -0.54138651, -0.51379962, 0.06847390, -0.01920037, -0.04592324, +-0.00467394, 0.00328858, 0.00377424, -0.00987448, 0.08222096, -0.00377301, 0.04551941, -0.02592517, 0.16317082, 0.13077530, + 0.22702921, -0.31215289, -0.69645962, -0.38047101, -0.39339411, 0.11124777, 0.02508035, -0.00708074, 0.00400344, 0.00040331, + 0.01142402, 0.01725406, 0.01635170, 0.14285366, 0.03949233, -0.05905676, 0.05877154, -0.17497577, -0.32479440, 0.80754464, +-0.38085603, -0.17055430, -0.03168622, -0.07531451, 0.02942002, -0.02148095, -0.00754114, -0.00322372, 0.00567812, -0.01701521, +-0.12358320, 0.11473564, 0.09070136, 0.06533068, -0.22560802, 0.19209022, 0.81605094, 0.36592275, -0.09919829, 0.16667122, + 0.16300725, 0.04803807, 0.06739263, -0.00156752, -0.01685302, -0.00905240, -0.02297836, -0.00469939, 0.06310613, -0.16391930, + 0.10919511, 0.12529293, 0.85581322, -0.32145522, 0.24539076, 0.07181839, 0.07289591, 0.14066759, 0.10406711, 0.05815518, + 0.01072680, -0.00759339, 0.00053486, -0.00044865, 0.03407361, 0.01645348, 0.08758579, 0.27722240, 0.53665485, -0.74853376, +-0.01118192, -0.19805430, 0.06130619, -0.09675299, 0.08978480, 0.03405255, -0.00706867, 0.05102045, 0.03250746, 0.01849966, +-0.01216314, -0.01184187, -0.01579288, 0.00114807, 0.11376166, 0.88342114, -0.36425379, 0.13863190, 0.12524180, -0.13553892, + 0.04715856, -0.12341103, 0.04531568, 0.01899360, -0.00206897, 0.00567768, -0.01444163, 0.00411946, -0.00855896, 0.00381663, +-0.01664861, -0.05534280, 0.21328278, 0.20161162, 0.72360394, 0.59130708, -0.08043791, 0.08757349, -0.13893918, -0.05147377, + 0.02680690, -0.01144070, 0.00625162, -0.00634215, -0.01248947, -0.00329455, -0.00609625, -0.00136305, -0.05097048, -0.01029851, + 0.25065384, -0.16856837, -0.07123372, 0.15992623, -0.39487617, -0.79972301, 0.18118185, -0.04826639, -0.01805578, -0.02927253, +-0.16400618, 0.07472763, 0.10376449, 0.01705406, 0.01065801, -0.01500498, 0.02039914, 0.37776349, -0.84484186, 0.10434286, + 0.15616990, 0.13474456, -0.00906238, -0.25238368, -0.03820885, -0.10650905, -0.03880833, -0.03660028, -0.09640894, 0.00583314, + 0.01922097, 0.01489911, -0.02431117, -0.09372217, 0.39404721, -0.84786223, -0.31277121, 0.03193850, 0.01974060, 0.01887901, + 0.00337911, -0.11359599, -0.02792521, -0.03220184, -0.01533311, 0.00015962, -0.04225043, -0.00933965, 0.00675311, 0.00206060, + 0.15926771, 0.40199829, -0.80792558, -0.35591604, -0.17169764, 0.02830436, 0.02459982, -0.03438589, 0.00718705, -0.01798329, +-0.01594508, -0.00702430, -0.00952419, -0.00962701, -0.01307212, -0.01749740, 0.01299602, 0.00587270, -0.36103108, -0.82039266, +-0.43092844, -0.08500097, -0.04361674, -0.00333482, 0.01250434, -0.02538295, -0.00921797, 0.01645071, -0.01400872, 0.00317607, + 0.00003277, -0.01617646, -0.00616863, -0.00882661, 0.00466157, 0.00353237, 0.91803104, -0.39503305, -0.02048964, 0.00060125, + 0.01980634, 0.00300109, 0.00313880, 0.00657337, 0.00715163, 0.00000261, 0.00854276, -0.00154825, -0.00516128, 0.00909527, + 0.00095609, 0.00701196, -0.00221867, -0.00156741}, +{-0.00469582, -0.00020403, -0.00587134, 0.00185153, -0.02256479, -0.01185761, -0.02891481, -0.00493792, -0.00182344, 0.00285962, + 0.01558059, -0.02185140, 0.04639438, -0.04357142, 0.12718613, -0.06756136, 0.05542227, 0.98480184, -0.00374376, -0.00236433, +-0.00607169, -0.00303290, -0.00127243, -0.01794845, 0.00620033, -0.00732704, -0.02837749, -0.00107164, 0.04820548, 0.00713300, + 0.09784244, -0.16806261, -0.04563341, -0.33406041, 0.91554083, -0.08139655, -0.00415851, -0.00538193, -0.00731198, -0.00534534, +-0.00623075, -0.02016943, -0.05480133, -0.03172290, -0.03879603, 0.01518441, 0.09591688, 0.02238470, 0.08126640, 0.08236821, +-0.24802119, 0.89516402, 0.32029647, 0.07188887, -0.00220366, 0.00344025, -0.00277284, 0.00358963, -0.08668007, -0.02205910, +-0.05289669, -0.03535201, -0.01188017, -0.06456872, -0.09321006, -0.00009617, -0.15804070, 0.24632041, 0.90166119, 0.19250690, + 0.17264619, -0.09699155, -0.00567329, -0.00897700, -0.01442565, -0.01939390, 0.03702127, -0.02999862, -0.04385696, -0.05232394, +-0.03339177, 0.03905964, -0.00281424, -0.29213275, 0.02892968, 0.90257613, -0.21546058, -0.18070946, 0.09014567, 0.04117230, +-0.01029696, -0.00329116, -0.03354346, 0.02937079, 0.01274208, -0.01260649, -0.03505571, -0.01020645, 0.03787209, 0.12132165, +-0.20826840, 0.81556933, -0.43874351, 0.21518682, -0.14564290, -0.05210031, 0.07124563, 0.06127983, -0.00457321, 0.01740496, + 0.04185176, 0.00128036, -0.05033693, -0.01890046, 0.06221734, 0.10280078, -0.03738531, 0.04830209, -0.08408293, -0.46409009, +-0.83936263, -0.14817619, -0.13135927, 0.04563506, 0.08340661, 0.04040200, 0.00044396, -0.01365972, 0.01228951, 0.01078273, + 0.09205406, -0.03791500, 0.07135889, 0.08158339, 0.06298278, -0.22875755, -0.92917558, -0.11248260, 0.17801883, -0.03971674, +-0.07491915, 0.06477287, 0.04635713, 0.01856159, 0.00130895, -0.01991604, 0.02358176, -0.09376056, 0.02782280, -0.04691559, + 0.13749249, 0.31383132, 0.92274602, 0.04727419, 0.09765196, -0.02108945, 0.00626005, 0.05193322, 0.02009133, 0.03094066, + 0.04573470, 0.00451733, 0.00240169, -0.00982355, -0.03546208, -0.14156875, -0.02480689, 0.22997442, 0.09778317, 0.88834235, +-0.32797611, -0.00079977, 0.04917079, 0.06977359, 0.06451185, 0.07816204, 0.03119314, 0.01136506, 0.01062006, 0.00632783, + 0.03241828, -0.03318847, -0.01350502, -0.30055361, 0.07265375, 0.17308022, 0.88795796, -0.23231020, -0.08932700, 0.11759604, + 0.00590705, 0.03525351, 0.00840466, 0.04389942, 0.04387629, 0.04003275, 0.01772966, 0.02709780, -0.02393282, 0.02766178, + 0.00342983, -0.33882220, 0.76612668, 0.44061716, -0.28414784, -0.09364014, 0.03694060, 0.01124120, 0.01130268, -0.02869682, +-0.07428963, -0.03504754, 0.05874942, 0.01196795, 0.02003875, 0.00787152, -0.01605561, 0.04501257, -0.06959958, -0.13015784, +-0.05738065, 0.04681625, 0.06668700, -0.04492094, 0.02927765, -0.94404277, 0.19243952, 0.09504337, -0.12540826, 0.05394317, +-0.07972638, -0.02145188, 0.00136427, 0.01964678, 0.06667373, 0.06204535, 0.17302394, 0.22005905, 0.58329964, -0.68440447, + 0.19628796, 0.15718011, -0.12481840, -0.08222507, 0.11780870, 0.03798206, -0.01818866, 0.00892766, 0.05582263, 0.01126832, +-0.00973589, 0.00697442, -0.09937902, 0.06621185, -0.19452202, -0.80004569, -0.13946094, -0.48990700, -0.17595191, -0.00798873, +-0.06121856, 0.08768040, -0.04507631, 0.00448896, 0.01153941, -0.04711652, -0.01050749, -0.01660047, -0.03007159, -0.01468906, + 0.12848053, 0.13859838, 0.93863771, -0.22250065, -0.14841278, 0.04666032, -0.06344813, -0.01915105, -0.01840150, -0.02389410, +-0.01245496, 0.05023402, 0.02125840, 0.02467318, -0.01893022, -0.00889647, 0.00551817, 0.00481915, -0.40626968, -0.89028236, + 0.18261687, -0.03852330, 0.02621926, -0.05420122, -0.01704117, -0.00072893, -0.02694170, -0.04335124, 0.02256467, 0.00642301, +-0.01619484, -0.00871160, 0.00400065, -0.00488820, -0.00752173, -0.00170603, 0.89554989, -0.41825934, -0.08725803, -0.09051404, +-0.00916236, -0.02959065, -0.07268075, -0.00816626, -0.00314215, -0.01941078, -0.00036782, -0.00188655, -0.02107724, -0.00771657, +-0.00448194, -0.00387517, 0.00082998, 0.00202471}, +{ 0.00167296, -0.00647772, -0.00604394, 0.01490810, -0.00837664, 0.00246438, 0.02082153, 0.01216715, 0.01001396, -0.02850860, +-0.01187868, -0.00113289, 0.04140237, -0.11084998, 0.16102260, 0.20084170, -0.28969446, -0.91312256, 0.00087788, -0.00136895, + 0.00004622, 0.00578894, 0.00524119, -0.00044550, 0.00948906, -0.00396910, -0.03312197, -0.00075487, 0.00987494, -0.02088734, + 0.09835550, -0.20080342, 0.13687782, -0.16111863, -0.90089988, 0.30312999, 0.00248784, -0.00975419, -0.01617200, 0.00699371, +-0.02151635, -0.01625774, -0.01262800, 0.02588781, -0.05620764, -0.13651454, 0.04242442, -0.02615307, 0.20497288, -0.20422909, + 0.14184406, 0.89712919, 0.01758042, 0.25447787, -0.00207668, -0.00260329, 0.00724812, -0.01007749, 0.00806242, -0.03089729, +-0.01161934, -0.00618676, -0.10327342, -0.10160272, 0.11919283, 0.20781533, 0.11564869, -0.19072476, 0.86402008, -0.24650846, + 0.24684161, 0.04775750, 0.00486888, -0.01735569, -0.01868000, -0.01870386, -0.03243262, -0.05883701, -0.03433371, 0.10441236, +-0.22831067, -0.22837988, 0.15082544, -0.21313767, 0.13215611, -0.78096079, -0.32270595, -0.21307018, 0.17339271, -0.05435742, +-0.00940813, 0.00272520, 0.00542917, -0.05232991, -0.01280809, -0.10773627, -0.17626479, 0.03719285, -0.26297104, -0.21780618, + 0.21406665, 0.15202177, 0.75911044, 0.38627481, -0.16504189, -0.10242997, -0.02394939, -0.06018959, 0.00994733, -0.02617197, +-0.01543723, -0.10320051, -0.03010481, -0.19098072, -0.06893233, 0.12253174, -0.25556092, -0.31989059, 0.09542655, 0.72712041, +-0.43108921, -0.01568072, -0.16532685, 0.06646835, -0.08885408, -0.00050364, -0.01791050, 0.00245405, 0.00204794, -0.17948691, +-0.05193881, -0.16329387, -0.13676259, 0.01214133, -0.30994612, -0.00687734, 0.63254090, -0.47180795, -0.35409214, 0.23658315, + 0.11170294, 0.05229887, -0.06107035, -0.01094212, 0.01523854, -0.01608284, -0.03739206, -0.23864328, -0.03958494, -0.19305719, +-0.26019058, 0.24108257, -0.55933566, 0.40623396, -0.53367968, -0.08930957, -0.00599383, -0.00050845, 0.06960811, 0.02664961, + 0.01464197, -0.00486781, -0.01905736, 0.01437578, 0.02379930, -0.26639588, 0.05208876, -0.43525002, -0.63009424, 0.05251889, + 0.56732782, -0.06731164, -0.03705909, -0.03253946, 0.00950673, -0.07941760, 0.02388267, -0.01258409, -0.00343524, 0.00148711, +-0.00362107, 0.03981813, -0.07235214, -0.46180041, -0.05595288, -0.55699317, 0.61935853, -0.25379716, 0.06796783, 0.01039267, +-0.06329171, -0.02143024, 0.09406929, -0.00799203, -0.01419805, -0.00603024, 0.01313145, 0.00091161, -0.00212107, -0.02405340, + 0.07146405, -0.76695326, -0.14841817, 0.60372663, -0.01478424, 0.06522462, 0.08580016, -0.05817981, 0.02438942, 0.04840904, + 0.02934363, -0.02239678, -0.00582247, -0.00091312, -0.00394148, -0.00285276, -0.03435745, 0.05277435, 0.17882781, -0.06194164, + 0.27321118, 0.01840179, -0.10188148, -0.33168524, -0.03491221, 0.67351789, 0.37017376, 0.32083717, 0.09737800, -0.20998084, +-0.10725041, 0.06379186, 0.02169903, -0.02031584, 0.05623799, -0.18300962, -0.17337803, 0.08915172, -0.53835537, -0.08547263, + 0.15163321, 0.56732906, 0.21878115, 0.37274266, 0.26206918, 0.13443927, 0.09178695, -0.03276324, -0.01131664, -0.00236369, + 0.00772568, 0.01008805, -0.17122615, 0.15301569, 0.40135484, -0.06058913, 0.56405128, -0.05176853, 0.24544337, 0.62448073, + 0.07265009, -0.01198695, 0.05151774, -0.03678498, 0.01886154, 0.03724094, 0.01393667, 0.00758055, -0.00254297, 0.00537118, + 0.24169707, -0.41735970, -0.67564355, -0.09270478, 0.53106033, 0.06214579, 0.02574404, 0.09943837, 0.03032542, 0.02194476, + 0.06369772, -0.00133741, 0.01301113, 0.01508494, 0.00036111, -0.00278870, 0.00139205, 0.00015792, -0.43347887, 0.69923146, +-0.55406563, -0.01102231, 0.01347767, 0.07012139, -0.02530164, 0.06803192, 0.01177196, 0.04374491, 0.04073027, 0.04037438, + 0.00167330, -0.01807065, -0.00425562, 0.00149653, -0.00035119, -0.00172888, 0.84785495, 0.52289580, 0.01067734, -0.00859194, + 0.01685964, 0.00481442, 0.00434738, 0.07592695, 0.01419942, 0.01005336, 0.03316937, 0.00360465, 0.00435039, 0.00029122, + 0.00171268, 0.00198919, -0.00046889, -0.00094176}}; + +/* right KLT transforms */ +const double WebRtcIsac_kKltT2Gain[3][36] = { +{ 0.14572837, -0.45446306, 0.61990621, -0.52197033, 0.32145074, -0.11026900, -0.20698282, 0.48962182, -0.27127933, -0.33627476, + 0.65094037, -0.32715751, 0.40262573, -0.47844405, -0.33876075, 0.44130653, 0.37383966, -0.39964662, -0.51730480, 0.06611973, + 0.49030187, 0.47512886, -0.02141226, -0.51129451, -0.58578569, -0.39132064, -0.13187771, 0.15649421, 0.40735596, 0.54396897, + 0.40381276, 0.40904942, 0.41179766, 0.41167576, 0.40840251, 0.40468132}, +{-0.11368135, 0.34815515, -0.56434996, 0.61130763, -0.39970336, 0.11795708, 0.28514257, -0.58879243, 0.32775812, 0.27024886, +-0.56251299, 0.27411037, 0.42649186, -0.44080232, -0.36408215, 0.35932457, 0.43592895, -0.41484213, -0.49813030, -0.00012592, + 0.49865688, 0.47634953, 0.01094246, -0.52552726, -0.56154082, -0.41110686, -0.14170764, 0.15946614, 0.40818082, 0.55094554, + 0.40051601, 0.41084781, 0.41567800, 0.41450700, 0.40871872, 0.39891823}, +{-0.10719481, 0.34796287, -0.54573957, 0.59521001, -0.43943367, 0.14907223, 0.26554957, -0.59549939, 0.36760692, 0.26040652, +-0.55268701, 0.25778784, 0.38994096, -0.45282773, -0.37975656, 0.40213055, 0.43052647, -0.38937904, -0.52698359, 0.02788094, + 0.48284286, 0.47792474, 0.02557759, -0.50922240, -0.57699826, -0.39476779, -0.14708238, 0.12742149, 0.37835245, 0.57464021, + 0.39408127, 0.40327462, 0.40993655, 0.41419345, 0.41506301, 0.41253853}}; + +const double WebRtcIsac_kKltT2Shape[3][36] = { +{ 0.13427386, -0.35132558, 0.52506528, -0.59419077, 0.45075085, -0.16312057, 0.29857439, -0.58660147, 0.34265431, 0.20879510, +-0.56063262, 0.30238345, 0.43308283, -0.41186999, -0.35288681, 0.42768996, 0.36094634, -0.45284910, -0.47116680, 0.02893449, + 0.54326135, 0.45249040, -0.06264420, -0.52283830, 0.57137758, 0.44298139, 0.12617554, -0.20819946, -0.42324603, -0.48876443, + 0.39597050, 0.40713935, 0.41389880, 0.41512486, 0.41130400, 0.40575001}, +{ 0.16540737, -0.43379435, 0.58165221, -0.55154773, 0.35734028, -0.11935912, 0.29434254, -0.55954817, 0.23549804, 0.33087258, +-0.58848503, 0.29835834, 0.45464789, -0.38316155, -0.41689708, 0.35607296, 0.41260747, -0.41910198, -0.48633899, -0.04144955, + 0.47824583, 0.51050942, 0.01000345, -0.52184032, 0.53488229, 0.42641051, 0.17049774, -0.15849613, -0.43229355, -0.53945045, + 0.39582002, 0.41033103, 0.41788713, 0.41688080, 0.41081697, 0.39719658}, +{ 0.13386268, -0.37919915, 0.54989123, -0.57663572, 0.42402636, -0.15362720, 0.29641577, -0.58806770, 0.31381040, 0.26524954, +-0.56271012, 0.28431868, 0.42699898, -0.41058922, -0.40408270, 0.39215865, 0.40788513, -0.40699735, -0.49846482, -0.01521208, + 0.48756040, 0.49479418, -0.00347672, -0.51841384, 0.55513106, 0.41683793, 0.15131217, -0.15613621, -0.41029341, -0.54996461, + 0.39402116, 0.40965305, 0.41862791, 0.41730770, 0.41089648, 0.39837262}}; + +/* means of log gains and LAR coefficients*/ +const double WebRtcIsac_kLpcMeansGain[3][12] = { +{-6.86881911, -5.35075273, -6.86792680, -5.36200897, -6.86401538, -5.36921533, -6.86802969, -5.36893966, -6.86538097, -5.36315063, +-6.85535304, -5.35155315}, +{-6.12914600, -4.78070092, -6.12971780, -4.78382183, -6.12858525, -4.79362198, -6.12926491, -4.79017481, -6.12102401, -4.78346122, +-6.11441152, -4.78019228}, +{-5.67273484, -3.73876311, -5.65246094, -3.71407895, -5.61716443, -3.68814580, -5.58804560, -3.66334094, -5.54189577, -3.63845640, +-5.49293185, -3.61760203}}; + +const double WebRtcIsac_kLpcMeansShape[3][108] = { +{-0.91232981, 0.26258634, -0.33716701, 0.08477430, -0.03378426, 0.14423909, 0.07036185, 0.06155019, 0.01490385, 0.04138740, + 0.01427317, 0.01288970, 0.83872106, 0.25750199, 0.07988929, -0.01957923, 0.00831390, 0.01770300, -0.90957164, 0.25732216, +-0.33385344, 0.08735740, -0.03715332, 0.14584917, 0.06998990, 0.06131968, 0.01504379, 0.04067339, 0.01428039, 0.01406460, + 0.83846243, 0.26169862, 0.08109025, -0.01767055, 0.00970539, 0.01954310, -0.90490803, 0.24656405, -0.33578607, 0.08843286, +-0.03749139, 0.14443959, 0.07214669, 0.06170993, 0.01449947, 0.04134309, 0.01314762, 0.01413471, 0.83895203, 0.26748062, + 0.08197507, -0.01781298, 0.00885967, 0.01922394, -0.90922472, 0.24495889, -0.33921540, 0.08877169, -0.03581332, 0.14199172, + 0.07444032, 0.06185940, 0.01502054, 0.04185113, 0.01276579, 0.01355457, 0.83645358, 0.26631720, 0.08119697, -0.01835449, + 0.00788512, 0.01846446, -0.90482253, 0.24658310, -0.34019734, 0.08281090, -0.03486038, 0.14359248, 0.07401336, 0.06001471, + 0.01528421, 0.04254560, 0.01321472, 0.01240799, 0.83857127, 0.26281654, 0.08174380, -0.02099842, 0.00755176, 0.01699448, +-0.90132307, 0.25174308, -0.33838268, 0.07883863, -0.02877906, 0.14105407, 0.07220290, 0.06000352, 0.01684879, 0.04226844, + 0.01331331, 0.01269244, 0.83832138, 0.25467485, 0.08118028, -0.02120528, 0.00747832, 0.01567212}, +{-1.11639718, 0.35377266, 0.00798929, 0.20165280, 0.07656104, 0.10629964, 0.04894160, 0.10955305, -0.01806405, 0.05082282, + 0.01730794, 0.01345957, 0.73717782, 0.05952284, 0.03176204, 0.08195122, 0.01253148, 0.02253385, -1.12053537, 0.35523538, + 0.00859646, 0.20007706, 0.07715852, 0.10754596, 0.05165976, 0.10927703, -0.01554395, 0.05178866, 0.01752534, 0.01343468, + 0.73489046, 0.06395167, 0.03287798, 0.07972374, 0.01293550, 0.02300929, -1.11772179, 0.35457623, 0.01205524, 0.19926481, + 0.08000866, 0.10817921, 0.05052481, 0.11016167, -0.01552091, 0.05155510, 0.01787163, 0.01343778, 0.73142568, 0.06840830, + 0.03316828, 0.07902608, 0.01525042, 0.02178127, -1.12120164, 0.36405233, 0.00630305, 0.19799738, 0.07829690, 0.10727588, + 0.04017317, 0.10437949, -0.01844109, 0.05021700, 0.01561726, 0.01226571, 0.73438044, 0.06947982, 0.03396317, 0.07858683, + 0.01367105, 0.02041955, -1.12146187, 0.35952226, 0.00340090, 0.19700813, 0.07938222, 0.10904137, 0.03921216, 0.10531403, +-0.01833415, 0.04956231, 0.01399539, 0.01323582, 0.74378099, 0.07059589, 0.03367692, 0.08151462, 0.01182040, 0.02075577, +-1.11245254, 0.35234230, 0.00687490, 0.20204252, 0.07813186, 0.11081259, 0.04634665, 0.11073238, -0.01637954, 0.05104577, + 0.01675122, 0.01448696, 0.74013627, 0.06239059, 0.03129412, 0.08207461, 0.01249475, 0.02189238}, +{-1.27118948, 0.35834331, -0.33499347, 0.13524073, 0.04829079, 0.19542773, 0.05273835, 0.04157974, -0.01755227, 0.01513442, + 0.00386630, 0.02199463, 1.14439142, 0.21903073, 0.14750213, 0.12743356, 0.08463334, 0.06839691, -1.28367777, 0.35556287, +-0.33809405, 0.13627881, 0.04939309, 0.19642571, 0.05354373, 0.04099247, -0.01787481, 0.01472425, 0.00391474, 0.02150716, + 1.14739079, 0.21840872, 0.14643624, 0.12724347, 0.08390642, 0.06811938, -1.29007667, 0.35159558, -0.34154267, 0.13295849, + 0.04883602, 0.19587595, 0.05452759, 0.04174703, -0.01782110, 0.01388270, 0.00374754, 0.02138105, 1.14333767, 0.21690116, + 0.14544599, 0.12606728, 0.08314168, 0.06771389, -1.29856471, 0.35239315, -0.34238732, 0.13277553, 0.04722712, 0.19233156, + 0.05366901, 0.04328110, -0.01657749, 0.01444736, 0.00438108, 0.02102563, 1.13548397, 0.21537812, 0.14357377, 0.12525845, + 0.08230994, 0.06722511, -1.30663540, 0.34366563, -0.34205544, 0.12861679, 0.04655851, 0.18864359, 0.05351285, 0.04358693, +-0.01604498, 0.01431907, 0.00395326, 0.02082299, 1.12207794, 0.21167325, 0.14212491, 0.12418671, 0.08155467, 0.06639789, +-1.31011673, 0.33686271, -0.34379843, 0.12169569, 0.04480323, 0.18637557, 0.05374078, 0.04260827, -0.01588226, 0.01378294, + 0.00396009, 0.02112406, 1.10466984, 0.20905894, 0.14107033, 0.12303074, 0.08047136, 0.06588031}}; + diff --git a/src/mod/codecs/mod_isac/lpc_tables.h b/src/mod/codecs/mod_isac/lpc_tables.h new file mode 100644 index 0000000000..604d963c37 --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_tables.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * lpc_tables.h + * + * header file for coding tables for the LPC coefficients + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_TABLES_H_ + +#include "structs.h" + +#include "settings.h" + +#define KLT_STEPSIZE 1.00000000 +#define KLT_NUM_AVG_GAIN 0 +#define KLT_NUM_AVG_SHAPE 0 +#define KLT_NUM_MODELS 3 +#define LPC_GAIN_SCALE 4.000f +#define LPC_LOBAND_SCALE 2.100f +#define LPC_LOBAND_ORDER ORDERLO +#define LPC_HIBAND_SCALE 0.450f +#define LPC_HIBAND_ORDER ORDERHI +#define LPC_GAIN_ORDER 2 + +#define LPC_SHAPE_ORDER (LPC_LOBAND_ORDER + LPC_HIBAND_ORDER) + +#define KLT_ORDER_GAIN (LPC_GAIN_ORDER * SUBFRAMES) +#define KLT_ORDER_SHAPE (LPC_SHAPE_ORDER * SUBFRAMES) +/* indices of KLT coefficients used */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltSelIndGain[12]; + +extern const WebRtc_UWord16 WebRtcIsac_kQKltSelIndShape[108]; + +/* cdf array for model indicator */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltModelCdf[KLT_NUM_MODELS+1]; + +/* pointer to cdf array for model indicator */ +extern const WebRtc_UWord16 *WebRtcIsac_kQKltModelCdfPtr[1]; + +/* initial cdf index for decoder of model indicator */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltModelInitIndex[1]; + +/* offset to go from rounded value to quantization index */ +extern const short WebRtcIsac_kQKltQuantMinGain[12]; + +extern const short WebRtcIsac_kQKltQuantMinShape[108]; + +/* maximum quantization index */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltMaxIndGain[12]; + +extern const WebRtc_UWord16 WebRtcIsac_kQKltMaxIndShape[108]; + +/* index offset */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltOffsetGain[KLT_NUM_MODELS][12]; + +extern const WebRtc_UWord16 WebRtcIsac_kQKltOffsetShape[KLT_NUM_MODELS][108]; + +/* initial cdf index for KLT coefficients */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltInitIndexGain[KLT_NUM_MODELS][12]; + +extern const WebRtc_UWord16 WebRtcIsac_kQKltInitIndexShape[KLT_NUM_MODELS][108]; + +/* offsets for quantizer representation levels */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltOfLevelsGain[3]; + +extern const WebRtc_UWord16 WebRtcIsac_kQKltOfLevelsShape[3]; + +/* quantizer representation levels */ +extern const double WebRtcIsac_kQKltLevelsGain[1176]; + +extern const double WebRtcIsac_kQKltLevelsShape[1735]; + +/* cdf tables for quantizer indices */ +extern const WebRtc_UWord16 WebRtcIsac_kQKltCdfGain[1212]; + +extern const WebRtc_UWord16 WebRtcIsac_kQKltCdfShape[2059]; + +/* pointers to cdf tables for quantizer indices */ +extern const WebRtc_UWord16 *WebRtcIsac_kQKltCdfPtrGain[KLT_NUM_MODELS][12]; + +extern const WebRtc_UWord16 *WebRtcIsac_kQKltCdfPtrShape[KLT_NUM_MODELS][108]; + +/* code length for all coefficients using different models */ +extern const double WebRtcIsac_kQKltCodeLenGain[392]; + +extern const double WebRtcIsac_kQKltCodeLenShape[578]; + +/* left KLT transforms */ +extern const double WebRtcIsac_kKltT1Gain[KLT_NUM_MODELS][4]; + +extern const double WebRtcIsac_kKltT1Shape[KLT_NUM_MODELS][324]; + +/* right KLT transforms */ +extern const double WebRtcIsac_kKltT2Gain[KLT_NUM_MODELS][36]; + +extern const double WebRtcIsac_kKltT2Shape[KLT_NUM_MODELS][36]; + +/* means of log gains and LAR coefficients */ +extern const double WebRtcIsac_kLpcMeansGain[KLT_NUM_MODELS][12]; + +extern const double WebRtcIsac_kLpcMeansShape[KLT_NUM_MODELS][108]; + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_LPC_TABLES_H_ */ diff --git a/src/mod/codecs/mod_isac/lpc_to_refl_coef.c b/src/mod/codecs/mod_isac/lpc_to_refl_coef.c new file mode 100644 index 0000000000..2cb83c2e1d --- /dev/null +++ b/src/mod/codecs/mod_isac/lpc_to_refl_coef.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_LpcToReflCoef(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +#define SPL_LPC_TO_REFL_COEF_MAX_AR_MODEL_ORDER 50 + +void WebRtcSpl_LpcToReflCoef(WebRtc_Word16* a16, int use_order, WebRtc_Word16* k16) +{ + int m, k; + WebRtc_Word32 tmp32[SPL_LPC_TO_REFL_COEF_MAX_AR_MODEL_ORDER]; + WebRtc_Word32 tmp_inv_denom32; + WebRtc_Word16 tmp_inv_denom16; + + k16[use_order - 1] = WEBRTC_SPL_LSHIFT_W16(a16[use_order], 3); //Q12<<3 => Q15 + for (m = use_order - 1; m > 0; m--) + { + // (1 - k^2) in Q30 + tmp_inv_denom32 = ((WebRtc_Word32)1073741823) - WEBRTC_SPL_MUL_16_16(k16[m], k16[m]); + // (1 - k^2) in Q15 + tmp_inv_denom16 = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(tmp_inv_denom32, 15); + + for (k = 1; k <= m; k++) + { + // tmp[k] = (a[k] - RC[m] * a[m-k+1]) / (1.0 - RC[m]*RC[m]); + + // [Q12<<16 - (Q15*Q12)<<1] = [Q28 - Q28] = Q28 + tmp32[k] = WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)a16[k], 16) + - WEBRTC_SPL_LSHIFT_W32(WEBRTC_SPL_MUL_16_16(k16[m], a16[m-k+1]), 1); + + tmp32[k] = WebRtcSpl_DivW32W16(tmp32[k], tmp_inv_denom16); //Q28/Q15 = Q13 + } + + for (k = 1; k < m; k++) + { + a16[k] = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(tmp32[k], 1); //Q13>>1 => Q12 + } + + tmp32[m] = WEBRTC_SPL_SAT(8191, tmp32[m], -8191); + k16[m - 1] = (WebRtc_Word16)WEBRTC_SPL_LSHIFT_W32(tmp32[m], 2); //Q13<<2 => Q15 + } + return; +} diff --git a/src/mod/codecs/mod_isac/min_max_operations.c b/src/mod/codecs/mod_isac/min_max_operations.c new file mode 100644 index 0000000000..57eaff7b71 --- /dev/null +++ b/src/mod/codecs/mod_isac/min_max_operations.c @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * This file contains the implementation of functions + * WebRtcSpl_MaxAbsValueW16() + * WebRtcSpl_MaxAbsIndexW16() + * WebRtcSpl_MaxAbsValueW32() + * WebRtcSpl_MaxValueW16() + * WebRtcSpl_MaxIndexW16() + * WebRtcSpl_MaxValueW32() + * WebRtcSpl_MaxIndexW32() + * WebRtcSpl_MinValueW16() + * WebRtcSpl_MinIndexW16() + * WebRtcSpl_MinValueW32() + * WebRtcSpl_MinIndexW32() + * + * The description header can be found in signal_processing_library.h. + * + */ + +#include "signal_processing_library.h" + +#if !(defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM_NEON)) + +// Maximum absolute value of word16 vector. +WebRtc_Word16 WebRtcSpl_MaxAbsValueW16(const WebRtc_Word16 *vector, WebRtc_Word16 length) +{ + WebRtc_Word32 tempMax = 0; + WebRtc_Word32 absVal; + WebRtc_Word16 totMax; + int i; + G_CONST WebRtc_Word16 *tmpvector = vector; + + for (i = 0; i < length; i++) + { + absVal = WEBRTC_SPL_ABS_W32((*tmpvector)); + if (absVal > tempMax) + { + tempMax = absVal; + } + tmpvector++; + } + totMax = (WebRtc_Word16)WEBRTC_SPL_MIN(tempMax, WEBRTC_SPL_WORD16_MAX); + return totMax; +} + +#endif + +// Index of maximum absolute value in a word16 vector. +WebRtc_Word16 WebRtcSpl_MaxAbsIndexW16(G_CONST WebRtc_Word16* vector, WebRtc_Word16 length) +{ + WebRtc_Word16 tempMax; + WebRtc_Word16 absTemp; + WebRtc_Word16 tempMaxIndex = 0; + WebRtc_Word16 i = 0; + G_CONST WebRtc_Word16 *tmpvector = vector; + + tempMax = WEBRTC_SPL_ABS_W16(*tmpvector); + tmpvector++; + for (i = 1; i < length; i++) + { + absTemp = WEBRTC_SPL_ABS_W16(*tmpvector); + tmpvector++; + if (absTemp > tempMax) + { + tempMax = absTemp; + tempMaxIndex = i; + } + } + return tempMaxIndex; +} + +// Maximum absolute value of word32 vector. +WebRtc_Word32 WebRtcSpl_MaxAbsValueW32(G_CONST WebRtc_Word32 *vector, WebRtc_Word16 length) +{ + WebRtc_UWord32 tempMax = 0; + WebRtc_UWord32 absVal; + WebRtc_Word32 retval; + int i; + G_CONST WebRtc_Word32 *tmpvector = vector; + + for (i = 0; i < length; i++) + { + absVal = WEBRTC_SPL_ABS_W32((*tmpvector)); + if (absVal > tempMax) + { + tempMax = absVal; + } + tmpvector++; + } + retval = (WebRtc_Word32)(WEBRTC_SPL_MIN(tempMax, WEBRTC_SPL_WORD32_MAX)); + return retval; +} + +// Maximum value of word16 vector. +#ifndef XSCALE_OPT +WebRtc_Word16 WebRtcSpl_MaxValueW16(G_CONST WebRtc_Word16* vector, WebRtc_Word16 length) +{ + WebRtc_Word16 tempMax; + WebRtc_Word16 i; + G_CONST WebRtc_Word16 *tmpvector = vector; + + tempMax = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ > tempMax) + tempMax = vector[i]; + } + return tempMax; +} +#else +#pragma message(">> WebRtcSpl_MaxValueW16 is excluded from this build") +#endif + +// Index of maximum value in a word16 vector. +WebRtc_Word16 WebRtcSpl_MaxIndexW16(G_CONST WebRtc_Word16 *vector, WebRtc_Word16 length) +{ + WebRtc_Word16 tempMax; + WebRtc_Word16 tempMaxIndex = 0; + WebRtc_Word16 i = 0; + G_CONST WebRtc_Word16 *tmpvector = vector; + + tempMax = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ > tempMax) + { + tempMax = vector[i]; + tempMaxIndex = i; + } + } + return tempMaxIndex; +} + +// Maximum value of word32 vector. +#ifndef XSCALE_OPT +WebRtc_Word32 WebRtcSpl_MaxValueW32(G_CONST WebRtc_Word32* vector, WebRtc_Word16 length) +{ + WebRtc_Word32 tempMax; + WebRtc_Word16 i; + G_CONST WebRtc_Word32 *tmpvector = vector; + + tempMax = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ > tempMax) + tempMax = vector[i]; + } + return tempMax; +} +#else +#pragma message(">> WebRtcSpl_MaxValueW32 is excluded from this build") +#endif + +// Index of maximum value in a word32 vector. +WebRtc_Word16 WebRtcSpl_MaxIndexW32(G_CONST WebRtc_Word32* vector, WebRtc_Word16 length) +{ + WebRtc_Word32 tempMax; + WebRtc_Word16 tempMaxIndex = 0; + WebRtc_Word16 i = 0; + G_CONST WebRtc_Word32 *tmpvector = vector; + + tempMax = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ > tempMax) + { + tempMax = vector[i]; + tempMaxIndex = i; + } + } + return tempMaxIndex; +} + +// Minimum value of word16 vector. +WebRtc_Word16 WebRtcSpl_MinValueW16(G_CONST WebRtc_Word16 *vector, WebRtc_Word16 length) +{ + WebRtc_Word16 tempMin; + WebRtc_Word16 i; + G_CONST WebRtc_Word16 *tmpvector = vector; + + // Find the minimum value + tempMin = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ < tempMin) + tempMin = (vector[i]); + } + return tempMin; +} + +// Index of minimum value in a word16 vector. +#ifndef XSCALE_OPT +WebRtc_Word16 WebRtcSpl_MinIndexW16(G_CONST WebRtc_Word16* vector, WebRtc_Word16 length) +{ + WebRtc_Word16 tempMin; + WebRtc_Word16 tempMinIndex = 0; + WebRtc_Word16 i = 0; + G_CONST WebRtc_Word16* tmpvector = vector; + + // Find index of smallest value + tempMin = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ < tempMin) + { + tempMin = vector[i]; + tempMinIndex = i; + } + } + return tempMinIndex; +} +#else +#pragma message(">> WebRtcSpl_MinIndexW16 is excluded from this build") +#endif + +// Minimum value of word32 vector. +WebRtc_Word32 WebRtcSpl_MinValueW32(G_CONST WebRtc_Word32 *vector, WebRtc_Word16 length) +{ + WebRtc_Word32 tempMin; + WebRtc_Word16 i; + G_CONST WebRtc_Word32 *tmpvector = vector; + + // Find the minimum value + tempMin = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ < tempMin) + tempMin = (vector[i]); + } + return tempMin; +} + +// Index of minimum value in a word32 vector. +#ifndef XSCALE_OPT +WebRtc_Word16 WebRtcSpl_MinIndexW32(G_CONST WebRtc_Word32* vector, WebRtc_Word16 length) +{ + WebRtc_Word32 tempMin; + WebRtc_Word16 tempMinIndex = 0; + WebRtc_Word16 i = 0; + G_CONST WebRtc_Word32 *tmpvector = vector; + + // Find index of smallest value + tempMin = *tmpvector++; + for (i = 1; i < length; i++) + { + if (*tmpvector++ < tempMin) + { + tempMin = vector[i]; + tempMinIndex = i; + } + } + return tempMinIndex; +} +#else +#pragma message(">> WebRtcSpl_MinIndexW32 is excluded from this build") +#endif diff --git a/src/mod/codecs/mod_isac/min_max_operations_neon.c b/src/mod/codecs/mod_isac/min_max_operations_neon.c new file mode 100644 index 0000000000..158bcc1837 --- /dev/null +++ b/src/mod/codecs/mod_isac/min_max_operations_neon.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#if (defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM_NEON)) + +#include + +#include "signal_processing_library.h" + +// Maximum absolute value of word16 vector. +WebRtc_Word16 WebRtcSpl_MaxAbsValueW16(const WebRtc_Word16* vector, + WebRtc_Word16 length) { + WebRtc_Word32 temp_max = 0; + WebRtc_Word32 abs_val; + WebRtc_Word16 tot_max; + int i; + + __asm__("vmov.i16 d25, #0" : : : "d25"); + + for (i = 0; i < length - 7; i += 8) { + __asm__("vld1.16 {d26, d27}, [%0]" : : "r"(&vector[i]) : "q13"); + __asm__("vabs.s16 q13, q13" : : : "q13"); + __asm__("vpmax.s16 d26, d27" : : : "q13"); + __asm__("vpmax.s16 d25, d26" : : : "d25", "d26"); + } + __asm__("vpmax.s16 d25, d25" : : : "d25"); + __asm__("vpmax.s16 d25, d25" : : : "d25"); + __asm__("vmov.s16 %0, d25[0]" : "=r"(temp_max): : "d25"); + + for (; i < length; i++) { + abs_val = WEBRTC_SPL_ABS_W32((vector[i])); + if (abs_val > temp_max) { + temp_max = abs_val; + } + } + tot_max = (WebRtc_Word16)WEBRTC_SPL_MIN(temp_max, WEBRTC_SPL_WORD16_MAX); + return tot_max; +} + +#endif diff --git a/src/mod/codecs/mod_isac/mod_iSAC.2008.vcproj b/src/mod/codecs/mod_isac/mod_iSAC.2008.vcproj new file mode 100644 index 0000000000..e10f663275 --- /dev/null +++ b/src/mod/codecs/mod_isac/mod_iSAC.2008.vcproj @@ -0,0 +1,643 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/codecs/mod_isac/mod_iSAC.2010.vcxproj b/src/mod/codecs/mod_isac/mod_iSAC.2010.vcxproj new file mode 100644 index 0000000000..369cd51a67 --- /dev/null +++ b/src/mod/codecs/mod_isac/mod_iSAC.2010.vcxproj @@ -0,0 +1,222 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_iSAC + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD} + mod_iSAC + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mod/codecs/mod_isac/mod_isac.c b/src/mod/codecs/mod_isac/mod_isac.c new file mode 100644 index 0000000000..3f5f40aadb --- /dev/null +++ b/src/mod/codecs/mod_isac/mod_isac.c @@ -0,0 +1,257 @@ +/* + * 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 / ISAC codec module + * + * 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_isac.c -- isac Codec Module + * + */ + +#include +#include "isac.h" + +SWITCH_MODULE_LOAD_FUNCTION(mod_isac_codec_load); +SWITCH_MODULE_DEFINITION(mod_isac, mod_isac_codec_load, NULL, NULL); + +struct isac_context { + ISACStruct *ISAC_main_inst; +}; + +static switch_status_t switch_isac_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings) +{ + uint32_t encoding, decoding; + WebRtc_Word16 err; + struct isac_context *context = NULL; + + encoding = (flags & SWITCH_CODEC_FLAG_ENCODE); + decoding = (flags & SWITCH_CODEC_FLAG_DECODE); + + if (!(encoding || decoding)) { + return SWITCH_STATUS_FALSE; + } + + if (!(context = switch_core_alloc(codec->memory_pool, sizeof(*context)))) { + return SWITCH_STATUS_FALSE; + } + + codec->private_info = context; + + err = WebRtcIsac_Create(&context->ISAC_main_inst); + + if (err < 0) return SWITCH_STATUS_FALSE; + + WebRtcIsac_SetEncSampRate(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000); + WebRtcIsac_SetDecSampRate(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000); + + if (encoding) { + if (WebRtcIsac_EncoderInit(context->ISAC_main_inst, 0) < 0) { + return SWITCH_STATUS_FALSE; + } + } + + if (decoding) { + if (WebRtcIsac_DecoderInit(context->ISAC_main_inst) < 0) { + return SWITCH_STATUS_FALSE; + } + } + + if (codec->implementation->actual_samples_per_second == 16000) { + if (WebRtcIsac_ControlBwe(context->ISAC_main_inst, 0, codec->implementation->microseconds_per_packet / 1000, 0) < 0) { + return SWITCH_STATUS_FALSE; + } + } else { + if (WebRtcIsac_Control(context->ISAC_main_inst, codec->implementation->actual_samples_per_second / 1000, + codec->implementation->microseconds_per_packet / 1000) < 0) { + return SWITCH_STATUS_FALSE; + } + } + + if (WebRtcIsac_SetMaxPayloadSize(context->ISAC_main_inst, SWITCH_RECOMMENDED_BUFFER_SIZE) < 0) { + return SWITCH_STATUS_FALSE; + } + + if (WebRtcIsac_SetMaxRate(context->ISAC_main_inst, codec->implementation->bits_per_second) < 0) { + return SWITCH_STATUS_FALSE; + } + + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t switch_isac_encode(switch_codec_t *codec, switch_codec_t *other_codec, + void *decoded_data, + uint32_t decoded_data_len, + uint32_t decoded_rate, + void *encoded_data, + uint32_t *encoded_data_len, + uint32_t *encoded_rate, + unsigned int *flag) +{ + struct isac_context *context = codec->private_info; + WebRtc_Word16 len = 0, *in, *out; + int rise = (codec->implementation->actual_samples_per_second / 100); + + in = decoded_data; + out = encoded_data; + + while(len == 0) { + len = WebRtcIsac_Encode(context->ISAC_main_inst, in, out); + in += rise; + } + + if (len < 0) { + return SWITCH_STATUS_GENERR; + } + + *encoded_data_len = (uint32_t) len; + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t switch_isac_decode(switch_codec_t *codec, + switch_codec_t *other_codec, + void *encoded_data, + uint32_t encoded_data_len, + uint32_t encoded_rate, + void *decoded_data, + uint32_t *decoded_data_len, + uint32_t *decoded_rate, + unsigned int *flag) +{ + struct isac_context *context = codec->private_info; + WebRtc_Word16 len, speechType[1]; + + if ((*flag & SFF_PLC)) { + len = WebRtcIsac_DecodePlc(context->ISAC_main_inst, decoded_data, 1); + } else { + len = WebRtcIsac_Decode(context->ISAC_main_inst, encoded_data, encoded_data_len, decoded_data, speechType); + } + + if (len < 0) { + *decoded_data_len = 0; + return SWITCH_STATUS_GENERR; + } + + *decoded_data_len = (uint32_t) len * 2; + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t switch_isac_destroy(switch_codec_t *codec) +{ + struct isac_context *context = codec->private_info; + + WebRtcIsac_Free(context->ISAC_main_inst); + + return SWITCH_STATUS_SUCCESS; +} + + +SWITCH_MODULE_LOAD_FUNCTION(mod_isac_codec_load) +{ + switch_codec_interface_t *codec_interface; + + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + SWITCH_ADD_CODEC(codec_interface, "isac"); /* 8.0kbit */ + + switch_core_codec_add_implementation(pool, codec_interface, + SWITCH_CODEC_TYPE_AUDIO, + 99, + "isac", + NULL, + 16000, + 16000, + 53400, + 30000, + 480, + 960, + 0, + 1, + 3, + switch_isac_init, + switch_isac_encode, + switch_isac_decode, + switch_isac_destroy); + + + + switch_core_codec_add_implementation(pool, codec_interface, + SWITCH_CODEC_TYPE_AUDIO, + 99, + "isac", + NULL, + 16000, + 16000, + 53400, + 60000, + 960, + 1920, + 0, + 1, + 6, + switch_isac_init, + switch_isac_encode, + switch_isac_decode, + switch_isac_destroy); + + + + + switch_core_codec_add_implementation(pool, codec_interface, + SWITCH_CODEC_TYPE_AUDIO, + 99, + "isac", + NULL, + 32000, + 32000, + 160000, + 30000, + 960, + 1920, + 0, + 1, + 6, + switch_isac_init, + switch_isac_encode, + switch_isac_decode, + switch_isac_destroy); + + + + /* indicate that the module should continue to be loaded */ + 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/codecs/mod_isac/os_specific_inline.h b/src/mod/codecs/mod_isac/os_specific_inline.h new file mode 100644 index 0000000000..c469c2ec9c --- /dev/null +++ b/src/mod/codecs/mod_isac/os_specific_inline.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_OS_SPECIFIC_INLINE_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_OS_SPECIFIC_INLINE_H_ + +#include +#include "typedefs.h" + +// TODO(turaj): switch to WEBRTC_POSIX when available +#if defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#define WebRtcIsac_lrint lrint +#elif (defined(WEBRTC_ARCH_X86) && defined(WIN32)) +static __inline long int WebRtcIsac_lrint(double x_dbl) { + long int x_int; + + __asm { + fld x_dbl + fistp x_int + }; + + return x_int; +} +#else // Do a slow but correct implementation of lrint + +static __inline long int WebRtcIsac_lrint(double x_dbl) { + long int x_int; + x_int = (long int)floor(x_dbl + 0.499999999999); + return x_int; +} + +#endif + +#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_OS_SPECIFIC_INLINE_H_ diff --git a/src/mod/codecs/mod_isac/pitch_estimator.c b/src/mod/codecs/mod_isac/pitch_estimator.c new file mode 100644 index 0000000000..75525f69d4 --- /dev/null +++ b/src/mod/codecs/mod_isac/pitch_estimator.c @@ -0,0 +1,622 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "pitch_estimator.h" + +#include +#include +#ifdef WEBRTC_ANDROID +#include +#endif + +static const double kInterpolWin[8] = {-0.00067556028640, 0.02184247643159, -0.12203175715679, 0.60086484101160, + 0.60086484101160, -0.12203175715679, 0.02184247643159, -0.00067556028640}; + +/* interpolation filter */ +__inline static void IntrepolFilter(double *data_ptr, double *intrp) +{ + *intrp = kInterpolWin[0] * data_ptr[-3]; + *intrp += kInterpolWin[1] * data_ptr[-2]; + *intrp += kInterpolWin[2] * data_ptr[-1]; + *intrp += kInterpolWin[3] * data_ptr[0]; + *intrp += kInterpolWin[4] * data_ptr[1]; + *intrp += kInterpolWin[5] * data_ptr[2]; + *intrp += kInterpolWin[6] * data_ptr[3]; + *intrp += kInterpolWin[7] * data_ptr[4]; +} + + +/* 2D parabolic interpolation */ +/* probably some 0.5 factors can be eliminated, and the square-roots can be removed from the Cholesky fact. */ +__inline static void Intrpol2D(double T[3][3], double *x, double *y, double *peak_val) +{ + double c, b[2], A[2][2]; + double t1, t2, d; + double delta1, delta2; + + + // double T[3][3] = {{-1.25, -.25,-.25}, {-.25, .75, .75}, {-.25, .75, .75}}; + // should result in: delta1 = 0.5; delta2 = 0.0; peak_val = 1.0 + + c = T[1][1]; + b[0] = 0.5 * (T[1][2] + T[2][1] - T[0][1] - T[1][0]); + b[1] = 0.5 * (T[1][0] + T[2][1] - T[0][1] - T[1][2]); + A[0][1] = -0.5 * (T[0][1] + T[2][1] - T[1][0] - T[1][2]); + t1 = 0.5 * (T[0][0] + T[2][2]) - c; + t2 = 0.5 * (T[2][0] + T[0][2]) - c; + d = (T[0][1] + T[1][2] + T[1][0] + T[2][1]) - 4.0 * c - t1 - t2; + A[0][0] = -t1 - 0.5 * d; + A[1][1] = -t2 - 0.5 * d; + + /* deal with singularities or ill-conditioned cases */ + if ( (A[0][0] < 1e-7) || ((A[0][0] * A[1][1] - A[0][1] * A[0][1]) < 1e-7) ) { + *peak_val = T[1][1]; + return; + } + + /* Cholesky decomposition: replace A by upper-triangular factor */ + A[0][0] = sqrt(A[0][0]); + A[0][1] = A[0][1] / A[0][0]; + A[1][1] = sqrt(A[1][1] - A[0][1] * A[0][1]); + + /* compute [x; y] = -0.5 * inv(A) * b */ + t1 = b[0] / A[0][0]; + t2 = (b[1] - t1 * A[0][1]) / A[1][1]; + delta2 = t2 / A[1][1]; + delta1 = 0.5 * (t1 - delta2 * A[0][1]) / A[0][0]; + delta2 *= 0.5; + + /* limit norm */ + t1 = delta1 * delta1 + delta2 * delta2; + if (t1 > 1.0) { + delta1 /= t1; + delta2 /= t1; + } + + *peak_val = 0.5 * (b[0] * delta1 + b[1] * delta2) + c; + + *x += delta1; + *y += delta2; +} + + +static void PCorr(const double *in, double *outcorr) +{ + double sum, ysum, prod; + const double *x, *inptr; + int k, n; + + //ysum = 1e-6; /* use this with float (i.s.o. double)! */ + ysum = 1e-13; + sum = 0.0; + x = in + PITCH_MAX_LAG/2 + 2; + for (n = 0; n < PITCH_CORR_LEN2; n++) { + ysum += in[n] * in[n]; + sum += x[n] * in[n]; + } + + outcorr += PITCH_LAG_SPAN2 - 1; /* index of last element in array */ + *outcorr = sum / sqrt(ysum); + + for (k = 1; k < PITCH_LAG_SPAN2; k++) { + ysum -= in[k-1] * in[k-1]; + ysum += in[PITCH_CORR_LEN2 + k - 1] * in[PITCH_CORR_LEN2 + k - 1]; + sum = 0.0; + inptr = &in[k]; + prod = x[0] * inptr[0]; + for (n = 1; n < PITCH_CORR_LEN2; n++) { + sum += prod; + prod = x[n] * inptr[n]; + } + sum += prod; + outcorr--; + *outcorr = sum / sqrt(ysum); + } +} + + +void WebRtcIsac_InitializePitch(const double *in, + const double old_lag, + const double old_gain, + PitchAnalysisStruct *State, + double *lags) +{ + double buf_dec[PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2+2]; + double ratio, log_lag, gain_bias; + double bias; + double corrvec1[PITCH_LAG_SPAN2]; + double corrvec2[PITCH_LAG_SPAN2]; + int m, k; + // Allocating 10 extra entries at the begining of the CorrSurf + double corrSurfBuff[10 + (2*PITCH_BW+3)*(PITCH_LAG_SPAN2+4)]; + double* CorrSurf[2*PITCH_BW+3]; + double *CorrSurfPtr1, *CorrSurfPtr2; + double LagWin[3] = {0.2, 0.5, 0.98}; + int ind1, ind2, peaks_ind, peak, max_ind; + int peaks[PITCH_MAX_NUM_PEAKS]; + double adj, gain_tmp; + double corr, corr_max; + double intrp_a, intrp_b, intrp_c, intrp_d; + double peak_vals[PITCH_MAX_NUM_PEAKS]; + double lags1[PITCH_MAX_NUM_PEAKS]; + double lags2[PITCH_MAX_NUM_PEAKS]; + double T[3][3]; + int row; + + for(k = 0; k < 2*PITCH_BW+3; k++) + { + CorrSurf[k] = &corrSurfBuff[10 + k * (PITCH_LAG_SPAN2+4)]; + } + /* reset CorrSurf matrix */ + memset(corrSurfBuff, 0, sizeof(double) * (10 + (2*PITCH_BW+3) * (PITCH_LAG_SPAN2+4))); + + //warnings -DH + max_ind = 0; + peak = 0; + + /* copy old values from state buffer */ + memcpy(buf_dec, State->dec_buffer, sizeof(double) * (PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2-PITCH_FRAME_LEN/2+2)); + + /* decimation; put result after the old values */ + WebRtcIsac_DecimateAllpass(in, State->decimator_state, PITCH_FRAME_LEN, + &buf_dec[PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2-PITCH_FRAME_LEN/2+2]); + + /* low-pass filtering */ + for (k = PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2-PITCH_FRAME_LEN/2+2; k < PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2+2; k++) + buf_dec[k] += 0.75 * buf_dec[k-1] - 0.25 * buf_dec[k-2]; + + /* copy end part back into state buffer */ + memcpy(State->dec_buffer, buf_dec+PITCH_FRAME_LEN/2, sizeof(double) * (PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2-PITCH_FRAME_LEN/2+2)); + + /* compute correlation for first and second half of the frame */ + PCorr(buf_dec, corrvec1); + PCorr(buf_dec + PITCH_CORR_STEP2, corrvec2); + + /* bias towards pitch lag of previous frame */ + log_lag = log(0.5 * old_lag); + gain_bias = 4.0 * old_gain * old_gain; + if (gain_bias > 0.8) gain_bias = 0.8; + for (k = 0; k < PITCH_LAG_SPAN2; k++) + { + ratio = log((double) (k + (PITCH_MIN_LAG/2-2))) - log_lag; + bias = 1.0 + gain_bias * exp(-5.0 * ratio * ratio); + corrvec1[k] *= bias; + } + + /* taper correlation functions */ + for (k = 0; k < 3; k++) { + gain_tmp = LagWin[k]; + corrvec1[k] *= gain_tmp; + corrvec2[k] *= gain_tmp; + corrvec1[PITCH_LAG_SPAN2-1-k] *= gain_tmp; + corrvec2[PITCH_LAG_SPAN2-1-k] *= gain_tmp; + } + + corr_max = 0.0; + /* fill middle row of correlation surface */ + ind1 = 0; + ind2 = 0; + CorrSurfPtr1 = &CorrSurf[PITCH_BW][2]; + for (k = 0; k < PITCH_LAG_SPAN2; k++) { + corr = corrvec1[ind1++] + corrvec2[ind2++]; + CorrSurfPtr1[k] = corr; + if (corr > corr_max) { + corr_max = corr; /* update maximum */ + max_ind = (int)(&CorrSurfPtr1[k] - &CorrSurf[0][0]); + } + } + /* fill first and last rows of correlation surface */ + ind1 = 0; + ind2 = PITCH_BW; + CorrSurfPtr1 = &CorrSurf[0][2]; + CorrSurfPtr2 = &CorrSurf[2*PITCH_BW][PITCH_BW+2]; + for (k = 0; k < PITCH_LAG_SPAN2-PITCH_BW; k++) { + ratio = ((double) (ind1 + 12)) / ((double) (ind2 + 12)); + adj = 0.2 * ratio * (2.0 - ratio); /* adjustment factor; inverse parabola as a function of ratio */ + corr = adj * (corrvec1[ind1] + corrvec2[ind2]); + CorrSurfPtr1[k] = corr; + if (corr > corr_max) { + corr_max = corr; /* update maximum */ + max_ind = (int)(&CorrSurfPtr1[k] - &CorrSurf[0][0]); + } + corr = adj * (corrvec1[ind2++] + corrvec2[ind1++]); + CorrSurfPtr2[k] = corr; + if (corr > corr_max) { + corr_max = corr; /* update maximum */ + max_ind = (int)(&CorrSurfPtr2[k] - &CorrSurf[0][0]); + } + } + /* fill second and next to last rows of correlation surface */ + ind1 = 0; + ind2 = PITCH_BW-1; + CorrSurfPtr1 = &CorrSurf[1][2]; + CorrSurfPtr2 = &CorrSurf[2*PITCH_BW-1][PITCH_BW+1]; + for (k = 0; k < PITCH_LAG_SPAN2-PITCH_BW+1; k++) { + ratio = ((double) (ind1 + 12)) / ((double) (ind2 + 12)); + adj = 0.9 * ratio * (2.0 - ratio); /* adjustment factor; inverse parabola as a function of ratio */ + corr = adj * (corrvec1[ind1] + corrvec2[ind2]); + CorrSurfPtr1[k] = corr; + if (corr > corr_max) { + corr_max = corr; /* update maximum */ + max_ind = (int)(&CorrSurfPtr1[k] - &CorrSurf[0][0]); + } + corr = adj * (corrvec1[ind2++] + corrvec2[ind1++]); + CorrSurfPtr2[k] = corr; + if (corr > corr_max) { + corr_max = corr; /* update maximum */ + max_ind = (int)(&CorrSurfPtr2[k] - &CorrSurf[0][0]); + } + } + /* fill remainder of correlation surface */ + for (m = 2; m < PITCH_BW; m++) { + ind1 = 0; + ind2 = PITCH_BW - m; /* always larger than ind1 */ + CorrSurfPtr1 = &CorrSurf[m][2]; + CorrSurfPtr2 = &CorrSurf[2*PITCH_BW-m][PITCH_BW+2-m]; + for (k = 0; k < PITCH_LAG_SPAN2-PITCH_BW+m; k++) { + ratio = ((double) (ind1 + 12)) / ((double) (ind2 + 12)); + adj = ratio * (2.0 - ratio); /* adjustment factor; inverse parabola as a function of ratio */ + corr = adj * (corrvec1[ind1] + corrvec2[ind2]); + CorrSurfPtr1[k] = corr; + if (corr > corr_max) { + corr_max = corr; /* update maximum */ + max_ind = (int)(&CorrSurfPtr1[k] - &CorrSurf[0][0]); + } + corr = adj * (corrvec1[ind2++] + corrvec2[ind1++]); + CorrSurfPtr2[k] = corr; + if (corr > corr_max) { + corr_max = corr; /* update maximum */ + max_ind = (int)(&CorrSurfPtr2[k] - &CorrSurf[0][0]); + } + } + } + + /* threshold value to qualify as a peak */ + corr_max *= 0.6; + + peaks_ind = 0; + /* find peaks */ + for (m = 1; m < PITCH_BW+1; m++) { + if (peaks_ind == PITCH_MAX_NUM_PEAKS) break; + CorrSurfPtr1 = &CorrSurf[m][2]; + for (k = 2; k < PITCH_LAG_SPAN2-PITCH_BW-2+m; k++) { + corr = CorrSurfPtr1[k]; + if (corr > corr_max) { + if ( (corr > CorrSurfPtr1[k - (PITCH_LAG_SPAN2+5)]) && (corr > CorrSurfPtr1[k - (PITCH_LAG_SPAN2+4)]) ) { + if ( (corr > CorrSurfPtr1[k + (PITCH_LAG_SPAN2+4)]) && (corr > CorrSurfPtr1[k + (PITCH_LAG_SPAN2+5)]) ) { + /* found a peak; store index into matrix */ + peaks[peaks_ind++] = (int)(&CorrSurfPtr1[k] - &CorrSurf[0][0]); + if (peaks_ind == PITCH_MAX_NUM_PEAKS) break; + } + } + } + } + } + for (m = PITCH_BW+1; m < 2*PITCH_BW; m++) { + if (peaks_ind == PITCH_MAX_NUM_PEAKS) break; + CorrSurfPtr1 = &CorrSurf[m][2]; + for (k = 2+m-PITCH_BW; k < PITCH_LAG_SPAN2-2; k++) { + corr = CorrSurfPtr1[k]; + if (corr > corr_max) { + if ( (corr > CorrSurfPtr1[k - (PITCH_LAG_SPAN2+5)]) && (corr > CorrSurfPtr1[k - (PITCH_LAG_SPAN2+4)]) ) { + if ( (corr > CorrSurfPtr1[k + (PITCH_LAG_SPAN2+4)]) && (corr > CorrSurfPtr1[k + (PITCH_LAG_SPAN2+5)]) ) { + /* found a peak; store index into matrix */ + peaks[peaks_ind++] = (int)(&CorrSurfPtr1[k] - &CorrSurf[0][0]); + if (peaks_ind == PITCH_MAX_NUM_PEAKS) break; + } + } + } + } + } + + if (peaks_ind > 0) { + /* examine each peak */ + CorrSurfPtr1 = &CorrSurf[0][0]; + for (k = 0; k < peaks_ind; k++) { + peak = peaks[k]; + + /* compute four interpolated values around current peak */ + IntrepolFilter(&CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+5)], &intrp_a); + IntrepolFilter(&CorrSurfPtr1[peak - 1 ], &intrp_b); + IntrepolFilter(&CorrSurfPtr1[peak ], &intrp_c); + IntrepolFilter(&CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+4)], &intrp_d); + + /* determine maximum of the interpolated values */ + corr = CorrSurfPtr1[peak]; + corr_max = intrp_a; + if (intrp_b > corr_max) corr_max = intrp_b; + if (intrp_c > corr_max) corr_max = intrp_c; + if (intrp_d > corr_max) corr_max = intrp_d; + + /* determine where the peak sits and fill a 3x3 matrix around it */ + row = peak / (PITCH_LAG_SPAN2+4); + lags1[k] = (double) ((peak - row * (PITCH_LAG_SPAN2+4)) + PITCH_MIN_LAG/2 - 4); + lags2[k] = (double) (lags1[k] + PITCH_BW - row); + if ( corr > corr_max ) { + T[0][0] = CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+5)]; + T[2][0] = CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+4)]; + T[1][1] = corr; + T[0][2] = CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+4)]; + T[2][2] = CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+5)]; + T[1][0] = intrp_a; + T[0][1] = intrp_b; + T[2][1] = intrp_c; + T[1][2] = intrp_d; + } else { + if (intrp_a == corr_max) { + lags1[k] -= 0.5; + lags2[k] += 0.5; + IntrepolFilter(&CorrSurfPtr1[peak - 2*(PITCH_LAG_SPAN2+5)], &T[0][0]); + IntrepolFilter(&CorrSurfPtr1[peak - (2*PITCH_LAG_SPAN2+9)], &T[2][0]); + T[1][1] = intrp_a; + T[0][2] = intrp_b; + T[2][2] = intrp_c; + T[1][0] = CorrSurfPtr1[peak - (2*PITCH_LAG_SPAN2+9)]; + T[0][1] = CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+5)]; + T[2][1] = CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+4)]; + T[1][2] = corr; + } else if (intrp_b == corr_max) { + lags1[k] -= 0.5; + lags2[k] -= 0.5; + IntrepolFilter(&CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+6)], &T[0][0]); + T[2][0] = intrp_a; + T[1][1] = intrp_b; + IntrepolFilter(&CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+3)], &T[0][2]); + T[2][2] = intrp_d; + T[1][0] = CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+5)]; + T[0][1] = CorrSurfPtr1[peak - 1]; + T[2][1] = corr; + T[1][2] = CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+4)]; + } else if (intrp_c == corr_max) { + lags1[k] += 0.5; + lags2[k] += 0.5; + T[0][0] = intrp_a; + IntrepolFilter(&CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+4)], &T[2][0]); + T[1][1] = intrp_c; + T[0][2] = intrp_d; + IntrepolFilter(&CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+5)], &T[2][2]); + T[1][0] = CorrSurfPtr1[peak - (PITCH_LAG_SPAN2+4)]; + T[0][1] = corr; + T[2][1] = CorrSurfPtr1[peak + 1]; + T[1][2] = CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+5)]; + } else { + lags1[k] += 0.5; + lags2[k] -= 0.5; + T[0][0] = intrp_b; + T[2][0] = intrp_c; + T[1][1] = intrp_d; + IntrepolFilter(&CorrSurfPtr1[peak + 2*(PITCH_LAG_SPAN2+4)], &T[0][2]); + IntrepolFilter(&CorrSurfPtr1[peak + (2*PITCH_LAG_SPAN2+9)], &T[2][2]); + T[1][0] = corr; + T[0][1] = CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+4)]; + T[2][1] = CorrSurfPtr1[peak + (PITCH_LAG_SPAN2+5)]; + T[1][2] = CorrSurfPtr1[peak + (2*PITCH_LAG_SPAN2+9)]; + } + } + + /* 2D parabolic interpolation gives more accurate lags and peak value */ + Intrpol2D(T, &lags1[k], &lags2[k], &peak_vals[k]); + } + + /* determine the highest peak, after applying a bias towards short lags */ + corr_max = 0.0; + for (k = 0; k < peaks_ind; k++) { + corr = peak_vals[k] * pow(PITCH_PEAK_DECAY, log(lags1[k] + lags2[k])); + if (corr > corr_max) { + corr_max = corr; + peak = k; + } + } + + lags1[peak] *= 2.0; + lags2[peak] *= 2.0; + + if (lags1[peak] < (double) PITCH_MIN_LAG) lags1[peak] = (double) PITCH_MIN_LAG; + if (lags2[peak] < (double) PITCH_MIN_LAG) lags2[peak] = (double) PITCH_MIN_LAG; + if (lags1[peak] > (double) PITCH_MAX_LAG) lags1[peak] = (double) PITCH_MAX_LAG; + if (lags2[peak] > (double) PITCH_MAX_LAG) lags2[peak] = (double) PITCH_MAX_LAG; + + /* store lags of highest peak in output array */ + lags[0] = lags1[peak]; + lags[1] = lags1[peak]; + lags[2] = lags2[peak]; + lags[3] = lags2[peak]; + } + else + { + row = max_ind / (PITCH_LAG_SPAN2+4); + lags1[0] = (double) ((max_ind - row * (PITCH_LAG_SPAN2+4)) + PITCH_MIN_LAG/2 - 4); + lags2[0] = (double) (lags1[0] + PITCH_BW - row); + + if (lags1[0] < (double) PITCH_MIN_LAG) lags1[0] = (double) PITCH_MIN_LAG; + if (lags2[0] < (double) PITCH_MIN_LAG) lags2[0] = (double) PITCH_MIN_LAG; + if (lags1[0] > (double) PITCH_MAX_LAG) lags1[0] = (double) PITCH_MAX_LAG; + if (lags2[0] > (double) PITCH_MAX_LAG) lags2[0] = (double) PITCH_MAX_LAG; + + /* store lags of highest peak in output array */ + lags[0] = lags1[0]; + lags[1] = lags1[0]; + lags[2] = lags2[0]; + lags[3] = lags2[0]; + } +} + + + +/* create weighting matrix by orthogonalizing a basis of polynomials of increasing order + * t = (0:4)'; + * A = [t.^0, t.^1, t.^2, t.^3, t.^4]; + * [Q, dummy] = qr(A); + * P.Weight = Q * diag([0, .1, .5, 1, 1]) * Q'; */ +static const double kWeight[5][5] = { + { 0.29714285714286, -0.30857142857143, -0.05714285714286, 0.05142857142857, 0.01714285714286}, + {-0.30857142857143, 0.67428571428571, -0.27142857142857, -0.14571428571429, 0.05142857142857}, + {-0.05714285714286, -0.27142857142857, 0.65714285714286, -0.27142857142857, -0.05714285714286}, + { 0.05142857142857, -0.14571428571429, -0.27142857142857, 0.67428571428571, -0.30857142857143}, + { 0.01714285714286, 0.05142857142857, -0.05714285714286, -0.30857142857143, 0.29714285714286} +}; + + +void WebRtcIsac_PitchAnalysis(const double *in, /* PITCH_FRAME_LEN samples */ + double *out, /* PITCH_FRAME_LEN+QLOOKAHEAD samples */ + PitchAnalysisStruct *State, + double *lags, + double *gains) +{ + double HPin[PITCH_FRAME_LEN]; + double Weighted[PITCH_FRAME_LEN]; + double Whitened[PITCH_FRAME_LEN + QLOOKAHEAD]; + double inbuf[PITCH_FRAME_LEN + QLOOKAHEAD]; + double out_G[PITCH_FRAME_LEN + QLOOKAHEAD]; // could be removed by using out instead + double out_dG[4][PITCH_FRAME_LEN + QLOOKAHEAD]; + double old_lag, old_gain; + double nrg_wht, tmp; + double Wnrg, Wfluct, Wgain; + double H[4][4]; + double grad[4]; + double dG[4]; + int k, m, n, iter; + + /* high pass filtering using second order pole-zero filter */ + WebRtcIsac_Highpass(in, HPin, State->hp_state, PITCH_FRAME_LEN); + + /* copy from state into buffer */ + memcpy(Whitened, State->whitened_buf, sizeof(double) * QLOOKAHEAD); + + /* compute weighted and whitened signals */ + WebRtcIsac_WeightingFilter(HPin, &Weighted[0], &Whitened[QLOOKAHEAD], &(State->Wghtstr)); + + /* copy from buffer into state */ + memcpy(State->whitened_buf, Whitened+PITCH_FRAME_LEN, sizeof(double) * QLOOKAHEAD); + + old_lag = State->PFstr_wght.oldlagp[0]; + old_gain = State->PFstr_wght.oldgainp[0]; + + /* inital pitch estimate */ + WebRtcIsac_InitializePitch(Weighted, old_lag, old_gain, State, lags); + + + /* Iterative optimization of lags - to be done */ + + /* compute energy of whitened signal */ + nrg_wht = 0.0; + for (k = 0; k < PITCH_FRAME_LEN + QLOOKAHEAD; k++) + nrg_wht += Whitened[k] * Whitened[k]; + + + /* Iterative optimization of gains */ + + /* set weights for energy, gain fluctiation, and spectral gain penalty functions */ + Wnrg = 1.0 / nrg_wht; + Wgain = 0.005; + Wfluct = 3.0; + + /* set initial gains */ + for (k = 0; k < 4; k++) + gains[k] = PITCH_MAX_GAIN_06; + + /* two iterations should be enough */ + for (iter = 0; iter < 2; iter++) { + /* compute Jacobian of pre-filter output towards gains */ + WebRtcIsac_PitchfilterPre_gains(Whitened, out_G, out_dG, &(State->PFstr_wght), lags, gains); + + /* gradient and approximate Hessian (lower triangle) for minimizing the filter's output power */ + for (k = 0; k < 4; k++) { + tmp = 0.0; + for (n = 0; n < PITCH_FRAME_LEN + QLOOKAHEAD; n++) + tmp += out_G[n] * out_dG[k][n]; + grad[k] = tmp * Wnrg; + } + for (k = 0; k < 4; k++) { + for (m = 0; m <= k; m++) { + tmp = 0.0; + for (n = 0; n < PITCH_FRAME_LEN + QLOOKAHEAD; n++) + tmp += out_dG[m][n] * out_dG[k][n]; + H[k][m] = tmp * Wnrg; + } + } + + /* add gradient and Hessian (lower triangle) for dampening fast gain changes */ + for (k = 0; k < 4; k++) { + tmp = kWeight[k+1][0] * old_gain; + for (m = 0; m < 4; m++) + tmp += kWeight[k+1][m+1] * gains[m]; + grad[k] += tmp * Wfluct; + } + for (k = 0; k < 4; k++) { + for (m = 0; m <= k; m++) { + H[k][m] += kWeight[k+1][m+1] * Wfluct; + } + } + + /* add gradient and Hessian for dampening gain */ + for (k = 0; k < 3; k++) { + tmp = 1.0 / (1 - gains[k]); + grad[k] += tmp * tmp * Wgain; + H[k][k] += 2.0 * tmp * (tmp * tmp * Wgain); + } + tmp = 1.0 / (1 - gains[3]); + grad[3] += 1.33 * (tmp * tmp * Wgain); + H[3][3] += 2.66 * tmp * (tmp * tmp * Wgain); + + + /* compute Cholesky factorization of Hessian + * by overwritting the upper triangle; scale factors on diagonal + * (for non pc-platforms store the inverse of the diagonals seperately to minimize divisions) */ + H[0][1] = H[1][0] / H[0][0]; + H[0][2] = H[2][0] / H[0][0]; + H[0][3] = H[3][0] / H[0][0]; + H[1][1] -= H[0][0] * H[0][1] * H[0][1]; + H[1][2] = (H[2][1] - H[0][1] * H[2][0]) / H[1][1]; + H[1][3] = (H[3][1] - H[0][1] * H[3][0]) / H[1][1]; + H[2][2] -= H[0][0] * H[0][2] * H[0][2] + H[1][1] * H[1][2] * H[1][2]; + H[2][3] = (H[3][2] - H[0][2] * H[3][0] - H[1][2] * H[1][1] * H[1][3]) / H[2][2]; + H[3][3] -= H[0][0] * H[0][3] * H[0][3] + H[1][1] * H[1][3] * H[1][3] + H[2][2] * H[2][3] * H[2][3]; + + /* Compute update as delta_gains = -inv(H) * grad */ + /* copy and negate */ + for (k = 0; k < 4; k++) + dG[k] = -grad[k]; + /* back substitution */ + dG[1] -= dG[0] * H[0][1]; + dG[2] -= dG[0] * H[0][2] + dG[1] * H[1][2]; + dG[3] -= dG[0] * H[0][3] + dG[1] * H[1][3] + dG[2] * H[2][3]; + /* scale */ + for (k = 0; k < 4; k++) + dG[k] /= H[k][k]; + /* back substitution */ + dG[2] -= dG[3] * H[2][3]; + dG[1] -= dG[3] * H[1][3] + dG[2] * H[1][2]; + dG[0] -= dG[3] * H[0][3] + dG[2] * H[0][2] + dG[1] * H[0][1]; + + /* update gains and check range */ + for (k = 0; k < 4; k++) { + gains[k] += dG[k]; + if (gains[k] > PITCH_MAX_GAIN) + gains[k] = PITCH_MAX_GAIN; + else if (gains[k] < 0.0) + gains[k] = 0.0; + } + } + + /* update state for next frame */ + WebRtcIsac_PitchfilterPre(Whitened, out, &(State->PFstr_wght), lags, gains); + + /* concatenate previous input's end and current input */ + memcpy(inbuf, State->inbuf, sizeof(double) * QLOOKAHEAD); + memcpy(inbuf+QLOOKAHEAD, in, sizeof(double) * PITCH_FRAME_LEN); + + /* lookahead pitch filtering for masking analysis */ + WebRtcIsac_PitchfilterPre_la(inbuf, out, &(State->PFstr), lags, gains); + + /* store last part of input */ + for (k = 0; k < QLOOKAHEAD; k++) + State->inbuf[k] = inbuf[k + PITCH_FRAME_LEN]; +} diff --git a/src/mod/codecs/mod_isac/pitch_estimator.h b/src/mod/codecs/mod_isac/pitch_estimator.h new file mode 100644 index 0000000000..f5d93564be --- /dev/null +++ b/src/mod/codecs/mod_isac/pitch_estimator.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * pitch_estimator.h + * + * Pitch functions + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_ESTIMATOR_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_ESTIMATOR_H_ + +#include "structs.h" + + + +void WebRtcIsac_PitchAnalysis(const double *in, /* PITCH_FRAME_LEN samples */ + double *out, /* PITCH_FRAME_LEN+QLOOKAHEAD samples */ + PitchAnalysisStruct *State, + double *lags, + double *gains); + +void WebRtcIsac_InitializePitch(const double *in, + const double old_lag, + const double old_gain, + PitchAnalysisStruct *State, + double *lags); + +void WebRtcIsac_PitchfilterPre(double *indat, + double *outdat, + PitchFiltstr *pfp, + double *lags, + double *gains); + +void WebRtcIsac_PitchfilterPost(double *indat, + double *outdat, + PitchFiltstr *pfp, + double *lags, + double *gains); + +void WebRtcIsac_PitchfilterPre_la(double *indat, + double *outdat, + PitchFiltstr *pfp, + double *lags, + double *gains); + +void WebRtcIsac_PitchfilterPre_gains(double *indat, + double *outdat, + double out_dG[][PITCH_FRAME_LEN + QLOOKAHEAD], + PitchFiltstr *pfp, + double *lags, + double *gains); + +void WebRtcIsac_WeightingFilter(const double *in, double *weiout, double *whiout, WeightFiltstr *wfdata); + +void WebRtcIsac_Highpass(const double *in, double *out, double *state, int N); + +void WebRtcIsac_DecimateAllpass(const double *in, + double *state_in, /* array of size: 2*ALLPASSSECTIONS+1 */ + int N, /* number of input samples */ + double *out); /* array of size N/2 */ + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_ESTIMATOR_H_ */ diff --git a/src/mod/codecs/mod_isac/pitch_filter.c b/src/mod/codecs/mod_isac/pitch_filter.c new file mode 100644 index 0000000000..ccc8d214da --- /dev/null +++ b/src/mod/codecs/mod_isac/pitch_filter.c @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "pitch_estimator.h" +#include "os_specific_inline.h" + +#include +#include +#include + +static const double kDampFilter[PITCH_DAMPORDER] = {-0.07, 0.25, 0.64, 0.25, -0.07}; + +/* interpolation coefficients; generated by design_pitch_filter.m */ +static const double kIntrpCoef[PITCH_FRACS][PITCH_FRACORDER] = { + {-0.02239172458614, 0.06653315052934, -0.16515880017569, 0.60701333734125, 0.64671399919202, -0.20249000396417, 0.09926548334755, -0.04765933793109, 0.01754159521746}, + {-0.01985640750434, 0.05816126837866, -0.13991265473714, 0.44560418147643, 0.79117042386876, -0.20266133815188, 0.09585268418555, -0.04533310458084, 0.01654127246314}, + {-0.01463300534216, 0.04229888475060, -0.09897034715253, 0.28284326017787, 0.90385267956632, -0.16976950138649, 0.07704272393639, -0.03584218578311, 0.01295781500709}, + {-0.00764851320885, 0.02184035544377, -0.04985561057281, 0.13083306574393, 0.97545011664662, -0.10177807997561, 0.04400901776474, -0.02010737175166, 0.00719783432422}, + {-0.00000000000000, 0.00000000000000, -0.00000000000001, 0.00000000000001, 0.99999999999999, 0.00000000000001, -0.00000000000001, 0.00000000000000, -0.00000000000000}, + { 0.00719783432422, -0.02010737175166, 0.04400901776474, -0.10177807997562, 0.97545011664663, 0.13083306574393, -0.04985561057280, 0.02184035544377, -0.00764851320885}, + { 0.01295781500710, -0.03584218578312, 0.07704272393640, -0.16976950138650, 0.90385267956634, 0.28284326017785, -0.09897034715252, 0.04229888475059, -0.01463300534216}, + { 0.01654127246315, -0.04533310458085, 0.09585268418557, -0.20266133815190, 0.79117042386878, 0.44560418147640, -0.13991265473712, 0.05816126837865, -0.01985640750433} +}; + + +void WebRtcIsac_PitchfilterPre(double *indat, + double *outdat, + PitchFiltstr *pfp, + double *lags, + double *gains) +{ + + double ubuf[PITCH_INTBUFFSIZE]; + const double *fracoeff = NULL; + double curgain, curlag, gaindelta, lagdelta; + double sum, inystate[PITCH_DAMPORDER]; + double ftmp, oldlag, oldgain; + int k, n, m, pos, ind, pos2, Li, frc; + + Li = 0; + /* Set up buffer and states */ + memcpy(ubuf, pfp->ubuf, sizeof(double) * PITCH_BUFFSIZE); + memcpy(inystate, pfp->ystate, sizeof(double) * PITCH_DAMPORDER); + + oldlag = *pfp->oldlagp; + oldgain = *pfp->oldgainp; + + /* No interpolation if pitch lag step is big */ + if ((lags[0] > (PITCH_UPSTEP * oldlag)) || (lags[0] < (PITCH_DOWNSTEP * oldlag))) { + oldlag = lags[0]; + oldgain = gains[0]; + } + + ind=0; + for (k=0;k0;m--) + inystate[m] = inystate[m-1]; + + /* Filter to get fractional pitch */ + pos = ind + PITCH_BUFFSIZE; + pos2 = pos - Li; + sum=0; + for (m=0;mubuf, ubuf+PITCH_FRAME_LEN, sizeof(double) * PITCH_BUFFSIZE); + memcpy(pfp->ystate, inystate, sizeof(double) * PITCH_DAMPORDER); + + *pfp->oldlagp = oldlag; + *pfp->oldgainp = oldgain; + +} + + +void WebRtcIsac_PitchfilterPre_la(double *indat, + double *outdat, + PitchFiltstr *pfp, + double *lags, + double *gains) +{ + double ubuf[PITCH_INTBUFFSIZE+QLOOKAHEAD]; + const double *fracoeff = NULL; + double curgain, curlag, gaindelta, lagdelta; + double sum, inystate[PITCH_DAMPORDER]; + double ftmp; + double oldlag, oldgain; + int k, n, m, pos, ind, pos2, Li, frc; + + Li = 0; + /* Set up buffer and states */ + memcpy(ubuf, pfp->ubuf, sizeof(double) * PITCH_BUFFSIZE); + memcpy(inystate, pfp->ystate, sizeof(double) * PITCH_DAMPORDER); + + oldlag = *pfp->oldlagp; + oldgain = *pfp->oldgainp; + + /* No interpolation if pitch lag step is big */ + if ((lags[0] > (PITCH_UPSTEP * oldlag)) || (lags[0] < (PITCH_DOWNSTEP * oldlag))) { + oldlag = lags[0]; + oldgain = gains[0]; + } + + + ind=0; + for (k=0;k0;m--) + inystate[m] = inystate[m-1]; + + /* Filter to get fractional pitch */ + pos = ind + PITCH_BUFFSIZE; + pos2 = pos - Li; + sum=0.0; + for (m=0;mubuf, ubuf+PITCH_FRAME_LEN, sizeof(double) * PITCH_BUFFSIZE); + memcpy(pfp->ystate, inystate, sizeof(double) * PITCH_DAMPORDER); + + *pfp->oldlagp = oldlag; + *pfp->oldgainp = oldgain; + + + /* Filter look-ahead segment */ + for (n=0;n0;m--) + inystate[m] = inystate[m-1]; + + /* Filter to get fractional pitch */ + pos = ind + PITCH_BUFFSIZE; + pos2 = pos - Li; + sum=0.0; + for (m=0;mubuf, sizeof(double) * PITCH_BUFFSIZE); + memcpy(inystate, pfp->ystate, sizeof(double) * PITCH_DAMPORDER); + + /* clear some buffers */ + for (k = 0; k < 4; k++) { + gain_mult[k] = 0.0; + for (n = 0; n < PITCH_DAMPORDER; n++) + inystate_dG[k][n] = 0.0; + } + + oldlag = *pfp->oldlagp; + oldgain = *pfp->oldgainp; + + /* No interpolation if pitch lag step is big */ + if ((lags[0] > (PITCH_UPSTEP * oldlag)) || (lags[0] < (PITCH_DOWNSTEP * oldlag))) { + oldlag = lags[0]; + oldgain = gains[0]; + gain_mult[0] = 1.0; + } + + + ind=0; + for (k=0;k 1.0) gain_mult[k] = 1.0; + if (k > 0) gain_mult[k-1] -= 0.2; + } + + /* shift low pass filter states */ + for (m=PITCH_DAMPORDER-1;m>0;m--) { + inystate[m] = inystate[m-1]; + for (j = 0; j < 4; j++) + inystate_dG[j][m] = inystate_dG[j][m-1]; + } + + pos = ind + PITCH_BUFFSIZE; + pos2 = pos - Li; + + /* Filter to get fractional pitch */ + sum=0.0; + for (m=0;m 0) ? Li-ind : 0; + for (j = 0; j < k+1; j++) { + /* filter */ + sum2 = 0.0; + for (m = PITCH_FRACORDER-1; m >= m_tmp; m--) + sum2 += out_dG[j][ind-Li + m] * fracoeff[m]; + inystate_dG[j][0] = gain_mult[j] * sum + curgain * sum2; + } + + /* Low pass filter */ + sum=0.0; + for (m=0;m0;m--) { + inystate[m] = inystate[m-1]; + for (j = 0; j < 4; j++) + inystate_dG[j][m] = inystate_dG[j][m-1]; + } + + pos = ind + PITCH_BUFFSIZE; + pos2 = pos - Li; + + /* Filter to get fractional pitch */ + sum=0.0; + for (m=0;m 0) ? Li-ind : 0; + for (j = 0; (j= m_tmp; m--) + sum2 += out_dG[j][ind-Li + m] * fracoeff[m]; + inystate_dG[j][0] = gain_mult[j] * sum + curgain * sum2; + } + + /* Low pass filter */ + sum=0.0; + for (m=0;mubuf, sizeof(double) * PITCH_BUFFSIZE); + memcpy(inystate, pfp->ystate, sizeof(double) * PITCH_DAMPORDER); + + oldlag = *pfp->oldlagp; + oldgain = *pfp->oldgainp; + + /* make output more periodic */ + for (k=0;k (PITCH_UPSTEP * oldlag)) || (lags[0] < (PITCH_DOWNSTEP * oldlag))) { + oldlag = lags[0]; + oldgain = gains[0]; + } + + + ind=0; + for (k=0;k0;m--) + inystate[m] = inystate[m-1]; + + /* Filter to get fractional pitch */ + pos = ind + PITCH_BUFFSIZE; + pos2 = pos - Li; + sum=0.0; + for (m=0;mubuf, ubuf+PITCH_FRAME_LEN, sizeof(double) * PITCH_BUFFSIZE); + memcpy(pfp->ystate, inystate, sizeof(double) * PITCH_DAMPORDER); + + *pfp->oldlagp = oldlag; + *pfp->oldgainp = oldgain; + +} diff --git a/src/mod/codecs/mod_isac/pitch_gain_tables.c b/src/mod/codecs/mod_isac/pitch_gain_tables.c new file mode 100644 index 0000000000..5d998a2928 --- /dev/null +++ b/src/mod/codecs/mod_isac/pitch_gain_tables.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "pitch_gain_tables.h" + +#include "settings.h" + +/* header file for coding tables for the pitch filter side-info in the entropy coder */ +/********************* Pitch Filter Gain Coefficient Tables ************************/ +/* cdf for quantized pitch filter gains */ +const WebRtc_UWord16 WebRtcIsac_kQPitchGainCdf[255] = { + 0, 2, 4, 6, 64, 901, 903, 905, 16954, 16956, + 16961, 17360, 17362, 17364, 17366, 17368, 17370, 17372, 17374, 17411, + 17514, 17516, 17583, 18790, 18796, 18802, 20760, 20777, 20782, 21722, + 21724, 21728, 21738, 21740, 21742, 21744, 21746, 21748, 22224, 22227, + 22230, 23214, 23229, 23239, 25086, 25108, 25120, 26088, 26094, 26098, + 26175, 26177, 26179, 26181, 26183, 26185, 26484, 26507, 26522, 27705, + 27731, 27750, 29767, 29799, 29817, 30866, 30883, 30885, 31025, 31029, + 31031, 31033, 31035, 31037, 31114, 31126, 31134, 32687, 32722, 32767, + 35718, 35742, 35757, 36943, 36952, 36954, 37115, 37128, 37130, 37132, + 37134, 37136, 37143, 37145, 37152, 38843, 38863, 38897, 47458, 47467, + 47474, 49040, 49061, 49063, 49145, 49157, 49159, 49161, 49163, 49165, + 49167, 49169, 49171, 49757, 49770, 49782, 61333, 61344, 61346, 62860, + 62883, 62885, 62887, 62889, 62891, 62893, 62895, 62897, 62899, 62901, + 62903, 62905, 62907, 62909, 65496, 65498, 65500, 65521, 65523, 65525, + 65527, 65529, 65531, 65533, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535}; + +/* index limits and ranges */ +const WebRtc_Word16 WebRtcIsac_kIndexLowerLimitGain[3] = { + -7, -2, -1}; + +const WebRtc_Word16 WebRtcIsac_kIndexUpperLimitGain[3] = { + 0, 3, 1}; + +const WebRtc_UWord16 WebRtcIsac_kIndexMultsGain[2] = { + 18, 3}; + +/* size of cdf table */ +const WebRtc_UWord16 WebRtcIsac_kQCdfTableSizeGain[1] = { + 256}; + +///////////////////////////FIXED POINT +/* mean values of pitch filter gains in FIXED point */ +const WebRtc_Word16 WebRtcIsac_kQMeanGain1Q12[144] = { + 843, 1092, 1336, 1222, 1405, 1656, 1500, 1815, 1843, 1838, 1839, 1843, 1843, 1843, 1843, 1843, + 1843, 1843, 814, 846, 1092, 1013, 1174, 1383, 1391, 1511, 1584, 1734, 1753, 1843, 1843, 1843, + 1843, 1843, 1843, 1843, 524, 689, 777, 845, 947, 1069, 1090, 1263, 1380, 1447, 1559, 1676, + 1645, 1749, 1843, 1843, 1843, 1843, 81, 477, 563, 611, 706, 806, 849, 1012, 1192, 1128, + 1330, 1489, 1425, 1576, 1826, 1741, 1843, 1843, 0, 290, 305, 356, 488, 575, 602, 741, + 890, 835, 1079, 1196, 1182, 1376, 1519, 1506, 1680, 1843, 0, 47, 97, 69, 289, 381, + 385, 474, 617, 664, 803, 1079, 935, 1160, 1269, 1265, 1506, 1741, 0, 0, 0, 0, + 112, 120, 190, 283, 442, 343, 526, 809, 684, 935, 1134, 1020, 1265, 1506, 0, 0, + 0, 0, 0, 0, 0, 111, 256, 87, 373, 597, 430, 684, 935, 770, 1020, 1265}; + +const WebRtc_Word16 WebRtcIsac_kQMeanGain2Q12[144] = { + 1760, 1525, 1285, 1747, 1671, 1393, 1843, 1826, 1555, 1843, 1784, 1606, 1843, 1843, 1711, 1843, + 1843, 1814, 1389, 1275, 1040, 1564, 1414, 1252, 1610, 1495, 1343, 1753, 1592, 1405, 1804, 1720, + 1475, 1843, 1814, 1581, 1208, 1061, 856, 1349, 1148, 994, 1390, 1253, 1111, 1495, 1343, 1178, + 1770, 1465, 1234, 1814, 1581, 1342, 1040, 793, 713, 1053, 895, 737, 1128, 1003, 861, 1277, + 1094, 981, 1475, 1192, 1019, 1581, 1342, 1098, 855, 570, 483, 833, 648, 540, 948, 744, + 572, 1009, 844, 636, 1234, 934, 685, 1342, 1217, 984, 537, 318, 124, 603, 423, 350, + 687, 479, 322, 791, 581, 430, 987, 671, 488, 1098, 849, 597, 283, 27, 0, 397, + 222, 38, 513, 271, 124, 624, 325, 157, 737, 484, 233, 849, 597, 343, 27, 0, + 0, 141, 0, 0, 256, 69, 0, 370, 87, 0, 484, 229, 0, 597, 343, 87}; + +const WebRtc_Word16 WebRtcIsac_kQMeanGain3Q12[144] = { + 1843, 1843, 1711, 1843, 1818, 1606, 1843, 1827, 1511, 1814, 1639, 1393, 1760, 1525, 1285, 1656, + 1419, 1176, 1835, 1718, 1475, 1841, 1650, 1387, 1648, 1498, 1287, 1600, 1411, 1176, 1522, 1299, + 1040, 1419, 1176, 928, 1773, 1461, 1128, 1532, 1355, 1202, 1429, 1260, 1115, 1398, 1151, 1025, + 1172, 1080, 790, 1176, 928, 677, 1475, 1147, 1019, 1276, 1096, 922, 1214, 1010, 901, 1057, + 893, 800, 1040, 796, 734, 928, 677, 424, 1137, 897, 753, 1120, 830, 710, 875, 751, + 601, 795, 642, 583, 790, 544, 475, 677, 474, 140, 987, 750, 482, 697, 573, 450, + 691, 487, 303, 661, 394, 332, 537, 303, 220, 424, 168, 0, 737, 484, 229, 624, + 348, 153, 441, 261, 136, 397, 166, 51, 283, 27, 0, 168, 0, 0, 484, 229, + 0, 370, 57, 0, 256, 43, 0, 141, 0, 0, 27, 0, 0, 0, 0, 0}; + + +const WebRtc_Word16 WebRtcIsac_kQMeanGain4Q12[144] = { + 1843, 1843, 1843, 1843, 1841, 1843, 1500, 1821, 1843, 1222, 1434, 1656, 843, 1092, 1336, 504, + 757, 1007, 1843, 1843, 1843, 1838, 1791, 1843, 1265, 1505, 1599, 965, 1219, 1425, 730, 821, + 1092, 249, 504, 757, 1783, 1819, 1843, 1351, 1567, 1727, 1096, 1268, 1409, 805, 961, 1131, + 444, 670, 843, 0, 249, 504, 1425, 1655, 1743, 1096, 1324, 1448, 822, 1019, 1199, 490, + 704, 867, 81, 450, 555, 0, 0, 249, 1247, 1428, 1530, 881, 1073, 1283, 610, 759, + 939, 278, 464, 645, 0, 200, 270, 0, 0, 0, 935, 1163, 1410, 528, 790, 1068, + 377, 499, 717, 173, 240, 274, 0, 43, 62, 0, 0, 0, 684, 935, 1182, 343, + 551, 735, 161, 262, 423, 0, 55, 27, 0, 0, 0, 0, 0, 0, 430, 684, + 935, 87, 377, 597, 0, 46, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0}; diff --git a/src/mod/codecs/mod_isac/pitch_gain_tables.h b/src/mod/codecs/mod_isac/pitch_gain_tables.h new file mode 100644 index 0000000000..f958f5df45 --- /dev/null +++ b/src/mod/codecs/mod_isac/pitch_gain_tables.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * pitch_gain_tables.h + * + * This file contains tables for the pitch filter side-info in the entropy coder. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_GAIN_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_GAIN_TABLES_H_ + +#include "typedefs.h" + +/* header file for coding tables for the pitch filter side-info in the entropy coder */ +/********************* Pitch Filter Gain Coefficient Tables ************************/ +/* cdf for quantized pitch filter gains */ +extern const WebRtc_UWord16 WebRtcIsac_kQPitchGainCdf[255]; + +/* index limits and ranges */ +extern const WebRtc_Word16 WebRtcIsac_kIndexLowerLimitGain[3]; + +extern const WebRtc_Word16 WebRtcIsac_kIndexUpperLimitGain[3]; +extern const WebRtc_UWord16 WebRtcIsac_kIndexMultsGain[2]; + +/* mean values of pitch filter gains */ +//(Y) +extern const WebRtc_Word16 WebRtcIsac_kQMeanGain1Q12[144]; +extern const WebRtc_Word16 WebRtcIsac_kQMeanGain2Q12[144]; +extern const WebRtc_Word16 WebRtcIsac_kQMeanGain3Q12[144]; +extern const WebRtc_Word16 WebRtcIsac_kQMeanGain4Q12[144]; +//(Y) + +/* size of cdf table */ +extern const WebRtc_UWord16 WebRtcIsac_kQCdfTableSizeGain[1]; + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_GAIN_TABLES_H_ */ diff --git a/src/mod/codecs/mod_isac/pitch_lag_tables.c b/src/mod/codecs/mod_isac/pitch_lag_tables.c new file mode 100644 index 0000000000..72a031e227 --- /dev/null +++ b/src/mod/codecs/mod_isac/pitch_lag_tables.c @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "pitch_lag_tables.h" +#include "settings.h" + +/* header file for coding tables for the pitch filter side-info in the entropy coder */ +/********************* Pitch Filter Gain Coefficient Tables ************************/ + +/* tables for use with small pitch gain */ + +/* cdf for quantized pitch filter lags */ +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf1Lo[127] = { + 0, 134, 336, 549, 778, 998, 1264, 1512, 1777, 2070, + 2423, 2794, 3051, 3361, 3708, 3979, 4315, 4610, 4933, 5269, + 5575, 5896, 6155, 6480, 6816, 7129, 7477, 7764, 8061, 8358, + 8718, 9020, 9390, 9783, 10177, 10543, 10885, 11342, 11795, 12213, + 12680, 13096, 13524, 13919, 14436, 14903, 15349, 15795, 16267, 16734, + 17266, 17697, 18130, 18632, 19080, 19447, 19884, 20315, 20735, 21288, + 21764, 22264, 22723, 23193, 23680, 24111, 24557, 25022, 25537, 26082, + 26543, 27090, 27620, 28139, 28652, 29149, 29634, 30175, 30692, 31273, + 31866, 32506, 33059, 33650, 34296, 34955, 35629, 36295, 36967, 37726, + 38559, 39458, 40364, 41293, 42256, 43215, 44231, 45253, 46274, 47359, + 48482, 49678, 50810, 51853, 53016, 54148, 55235, 56263, 57282, 58363, + 59288, 60179, 61076, 61806, 62474, 63129, 63656, 64160, 64533, 64856, + 65152, 65535, 65535, 65535, 65535, 65535, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf2Lo[20] = { + 0, 429, 3558, 5861, 8558, 11639, 15210, 19502, 24773, 31983, + 42602, 48567, 52601, 55676, 58160, 60172, 61889, 63235, 65383, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf3Lo[2] = { + 0, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf4Lo[10] = { + 0, 2966, 6368, 11182, 19431, 37793, 48532, 55353, 60626, 65535}; + +const WebRtc_UWord16 *WebRtcIsac_kQPitchLagCdfPtrLo[4] = {WebRtcIsac_kQPitchLagCdf1Lo, WebRtcIsac_kQPitchLagCdf2Lo, WebRtcIsac_kQPitchLagCdf3Lo, WebRtcIsac_kQPitchLagCdf4Lo}; + +/* size of first cdf table */ +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdfSizeLo[1] = {128}; + +/* index limits and ranges */ +const WebRtc_Word16 WebRtcIsac_kQIndexLowerLimitLagLo[4] = { +-140, -9, 0, -4}; + +const WebRtc_Word16 WebRtcIsac_kQIndexUpperLimitLagLo[4] = { +-20, 9, 0, 4}; + +/* initial index for arithmetic decoder */ +const WebRtc_UWord16 WebRtcIsac_kQInitIndexLagLo[3] = { + 10, 1, 5}; + +/* mean values of pitch filter lags */ +const double WebRtcIsac_kQMeanLag2Lo[19] = { +-17.21385070, -15.82678944, -14.07123081, -12.03003877, -10.01311864, -8.00794627, -5.91162987, -3.89231876, -1.90220980, -0.01879275, + 1.89144232, 3.88123171, 5.92146992, 7.96435361, 9.98923648, 11.98266347, 13.96101002, 15.74855713, 17.10976611}; + +const double WebRtcIsac_kQMeanLag3Lo[1] = { + 0.00000000}; + +const double WebRtcIsac_kQMeanLag4Lo[9] = { +-7.76246496, -5.92083980, -3.94095226, -1.89502305, 0.03724681, 1.93054221, 3.96443467, 5.91726366, 7.78434291}; + +const double WebRtcIsac_kQPitchLagStepsizeLo = 2.000000; + + +/* tables for use with medium pitch gain */ + +/* cdf for quantized pitch filter lags */ +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf1Mid[255] = { + 0, 28, 61, 88, 121, 149, 233, 331, 475, 559, + 624, 661, 689, 712, 745, 791, 815, 843, 866, 922, + 959, 1024, 1061, 1117, 1178, 1238, 1280, 1350, 1453, 1513, + 1564, 1625, 1671, 1741, 1788, 1904, 2072, 2421, 2626, 2770, + 2840, 2900, 2942, 3012, 3068, 3115, 3147, 3194, 3254, 3319, + 3366, 3520, 3678, 3780, 3850, 3911, 3957, 4032, 4106, 4185, + 4292, 4474, 4683, 4842, 5019, 5191, 5321, 5428, 5540, 5675, + 5763, 5847, 5959, 6127, 6304, 6564, 6839, 7090, 7263, 7421, + 7556, 7728, 7872, 7984, 8142, 8361, 8580, 8743, 8938, 9227, + 9409, 9539, 9674, 9795, 9930, 10060, 10177, 10382, 10614, 10861, + 11038, 11271, 11415, 11629, 11792, 12044, 12193, 12416, 12574, 12821, + 13007, 13235, 13445, 13654, 13901, 14134, 14488, 15000, 15703, 16285, + 16504, 16797, 17086, 17328, 17579, 17807, 17998, 18268, 18538, 18836, + 19087, 19274, 19474, 19716, 19935, 20270, 20833, 21303, 21532, 21741, + 21978, 22207, 22523, 22770, 23054, 23613, 23943, 24204, 24399, 24651, + 24832, 25074, 25270, 25549, 25759, 26015, 26150, 26424, 26713, 27048, + 27342, 27504, 27681, 27854, 28021, 28207, 28412, 28664, 28859, 29064, + 29278, 29548, 29748, 30107, 30377, 30656, 30856, 31164, 31452, 31755, + 32011, 32328, 32626, 32919, 33319, 33789, 34329, 34925, 35396, 35973, + 36443, 36964, 37551, 38156, 38724, 39357, 40023, 40908, 41587, 42602, + 43924, 45037, 45810, 46597, 47421, 48291, 49092, 50051, 51448, 52719, + 53440, 54241, 54944, 55977, 56676, 57299, 57872, 58389, 59059, 59688, + 60237, 60782, 61094, 61573, 61890, 62290, 62658, 63030, 63217, 63454, + 63622, 63882, 64003, 64273, 64427, 64529, 64581, 64697, 64758, 64902, + 65414, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf2Mid[36] = { + 0, 71, 335, 581, 836, 1039, 1323, 1795, 2258, 2608, + 3005, 3591, 4243, 5344, 7163, 10583, 16848, 28078, 49448, 57007, + 60357, 61850, 62837, 63437, 63872, 64188, 64377, 64614, 64774, 64949, + 65039, 65115, 65223, 65360, 65474, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf3Mid[2] = { + 0, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf4Mid[20] = { + 0, 28, 246, 459, 667, 1045, 1523, 2337, 4337, 11347, + 44231, 56709, 60781, 62243, 63161, 63969, 64608, 65062, 65502, 65535}; + +const WebRtc_UWord16 *WebRtcIsac_kQPitchLagCdfPtrMid[4] = {WebRtcIsac_kQPitchLagCdf1Mid, WebRtcIsac_kQPitchLagCdf2Mid, WebRtcIsac_kQPitchLagCdf3Mid, WebRtcIsac_kQPitchLagCdf4Mid}; + +/* size of first cdf table */ +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdfSizeMid[1] = {256}; + +/* index limits and ranges */ +const WebRtc_Word16 WebRtcIsac_kQIndexLowerLimitLagMid[4] = { +-280, -17, 0, -9}; + +const WebRtc_Word16 WebRtcIsac_kQIndexUpperLimitLagMid[4] = { +-40, 17, 0, 9}; + +/* initial index for arithmetic decoder */ +const WebRtc_UWord16 WebRtcIsac_kQInitIndexLagMid[3] = { + 18, 1, 10}; + +/* mean values of pitch filter lags */ +const double WebRtcIsac_kQMeanLag2Mid[35] = { +-16.89183900, -15.86949778, -15.05476653, -14.00664348, -13.02793036, -12.07324237, -11.00542532, -10.11250602, -8.90792971, -8.02474753, +-7.00426767, -5.94055287, -4.98251338, -3.91053158, -2.98820425, -1.93524245, -0.92978085, -0.01722509, 0.91317387, 1.92973955, + 2.96908851, 3.93728974, 4.96308471, 5.92244151, 7.08673497, 8.00993708, 9.04656316, 9.98538742, 10.97851694, 11.94772884, + 13.02426166, 14.00039951, 15.01347042, 15.80758023, 16.94086895}; + +const double WebRtcIsac_kQMeanLag3Mid[1] = { + 0.00000000}; + +const double WebRtcIsac_kQMeanLag4Mid[19] = { +-8.60409403, -7.89198395, -7.03450280, -5.86260421, -4.93822322, -3.93078706, -2.91302322, -1.91824007, -0.87003282, 0.02822649, + 0.89951758, 1.87495484, 2.91802604, 3.96874074, 5.06571703, 5.93618227, 7.00520185, 7.88497726, 8.64160364}; + +const double WebRtcIsac_kQPitchLagStepsizeMid = 1.000000; + + +/* tables for use with large pitch gain */ + +/* cdf for quantized pitch filter lags */ +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf1Hi[511] = { + 0, 7, 18, 33, 69, 105, 156, 228, 315, 612, + 680, 691, 709, 724, 735, 738, 742, 746, 749, 753, + 756, 760, 764, 774, 782, 785, 789, 796, 800, 803, + 807, 814, 818, 822, 829, 832, 847, 854, 858, 869, + 876, 883, 898, 908, 934, 977, 1010, 1050, 1060, 1064, + 1075, 1078, 1086, 1089, 1093, 1104, 1111, 1122, 1133, 1136, + 1151, 1162, 1183, 1209, 1252, 1281, 1339, 1364, 1386, 1401, + 1411, 1415, 1426, 1430, 1433, 1440, 1448, 1455, 1462, 1477, + 1487, 1495, 1502, 1506, 1509, 1516, 1524, 1531, 1535, 1542, + 1553, 1556, 1578, 1589, 1611, 1625, 1639, 1643, 1654, 1665, + 1672, 1687, 1694, 1705, 1708, 1719, 1730, 1744, 1752, 1759, + 1791, 1795, 1820, 1867, 1886, 1915, 1936, 1943, 1965, 1987, + 2041, 2099, 2161, 2175, 2200, 2211, 2226, 2233, 2244, 2251, + 2266, 2280, 2287, 2298, 2309, 2316, 2331, 2342, 2356, 2378, + 2403, 2418, 2447, 2497, 2544, 2602, 2863, 2895, 2903, 2935, + 2950, 2971, 3004, 3011, 3018, 3029, 3040, 3062, 3087, 3127, + 3152, 3170, 3199, 3243, 3293, 3322, 3340, 3377, 3402, 3427, + 3474, 3518, 3543, 3579, 3601, 3637, 3659, 3706, 3731, 3760, + 3818, 3847, 3869, 3901, 3920, 3952, 4068, 4169, 4220, 4271, + 4524, 4571, 4604, 4632, 4672, 4730, 4777, 4806, 4857, 4904, + 4951, 5002, 5031, 5060, 5107, 5150, 5212, 5266, 5331, 5382, + 5432, 5490, 5544, 5610, 5700, 5762, 5812, 5874, 5972, 6022, + 6091, 6163, 6232, 6305, 6402, 6540, 6685, 6880, 7090, 7271, + 7379, 7452, 7542, 7625, 7687, 7770, 7843, 7911, 7966, 8024, + 8096, 8190, 8252, 8320, 8411, 8501, 8585, 8639, 8751, 8842, + 8918, 8986, 9066, 9127, 9203, 9269, 9345, 9406, 9464, 9536, + 9612, 9667, 9735, 9844, 9931, 10036, 10119, 10199, 10260, 10358, + 10441, 10514, 10666, 10734, 10872, 10951, 11053, 11125, 11223, 11324, + 11516, 11664, 11737, 11816, 11892, 12008, 12120, 12200, 12280, 12392, + 12490, 12576, 12685, 12812, 12917, 13003, 13108, 13210, 13300, 13384, + 13470, 13579, 13673, 13771, 13879, 13999, 14136, 14201, 14368, 14614, + 14759, 14867, 14958, 15030, 15121, 15189, 15280, 15385, 15461, 15555, + 15653, 15768, 15884, 15971, 16069, 16145, 16210, 16279, 16380, 16463, + 16539, 16615, 16688, 16818, 16919, 17017, 18041, 18338, 18523, 18649, + 18790, 18917, 19047, 19167, 19315, 19460, 19601, 19731, 19858, 20068, + 20173, 20318, 20466, 20625, 20741, 20911, 21045, 21201, 21396, 21588, + 21816, 22022, 22305, 22547, 22786, 23072, 23322, 23600, 23879, 24168, + 24433, 24769, 25120, 25511, 25895, 26289, 26792, 27219, 27683, 28077, + 28566, 29094, 29546, 29977, 30491, 30991, 31573, 32105, 32594, 33173, + 33788, 34497, 35181, 35833, 36488, 37255, 37921, 38645, 39275, 39894, + 40505, 41167, 41790, 42431, 43096, 43723, 44385, 45134, 45858, 46607, + 47349, 48091, 48768, 49405, 49955, 50555, 51167, 51985, 52611, 53078, + 53494, 53965, 54435, 54996, 55601, 56125, 56563, 56838, 57244, 57566, + 57967, 58297, 58771, 59093, 59419, 59647, 59886, 60143, 60461, 60693, + 60917, 61170, 61416, 61634, 61891, 62122, 62310, 62455, 62632, 62839, + 63103, 63436, 63639, 63805, 63906, 64015, 64192, 64355, 64475, 64558, + 64663, 64742, 64811, 64865, 64916, 64956, 64981, 65025, 65068, 65115, + 65195, 65314, 65419, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf2Hi[68] = { + 0, 7, 11, 22, 37, 52, 56, 59, 81, 85, + 89, 96, 115, 130, 137, 152, 170, 181, 193, 200, + 207, 233, 237, 259, 289, 318, 363, 433, 592, 992, + 1607, 3062, 6149, 12206, 25522, 48368, 58223, 61918, 63640, 64584, + 64943, 65098, 65206, 65268, 65294, 65335, 65350, 65372, 65387, 65402, + 65413, 65420, 65428, 65435, 65439, 65450, 65454, 65468, 65472, 65476, + 65483, 65491, 65498, 65505, 65516, 65520, 65528, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf3Hi[2] = { + 0, 65535}; + +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf4Hi[35] = { + 0, 7, 19, 30, 41, 48, 63, 74, 82, 96, + 122, 152, 215, 330, 701, 2611, 10931, 48106, 61177, 64341, + 65112, 65238, 65309, 65338, 65364, 65379, 65401, 65427, 65453, 65465, + 65476, 65490, 65509, 65528, 65535}; + +const WebRtc_UWord16 *WebRtcIsac_kQPitchLagCdfPtrHi[4] = {WebRtcIsac_kQPitchLagCdf1Hi, WebRtcIsac_kQPitchLagCdf2Hi, WebRtcIsac_kQPitchLagCdf3Hi, WebRtcIsac_kQPitchLagCdf4Hi}; + +/* size of first cdf table */ +const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdfSizeHi[1] = {512}; + +/* index limits and ranges */ +const WebRtc_Word16 WebRtcIsac_kQindexLowerLimitLagHi[4] = { +-552, -34, 0, -16}; + +const WebRtc_Word16 WebRtcIsac_kQindexUpperLimitLagHi[4] = { +-80, 32, 0, 17}; + +/* initial index for arithmetic decoder */ +const WebRtc_UWord16 WebRtcIsac_kQInitIndexLagHi[3] = { + 34, 1, 18}; + +/* mean values of pitch filter lags */ +const double WebRtcIsac_kQMeanLag2Hi[67] = { +-17.07263295, -16.50000000, -15.83966081, -15.55613708, -14.96948007, -14.50000000, -14.00000000, -13.48377986, -13.00000000, -12.50000000, +-11.93199636, -11.44530414, -11.04197641, -10.39910301, -10.15202337, -9.51322461, -8.93357741, -8.46456632, -8.10270672, -7.53751847, +-6.98686404, -6.50000000, -6.08463150, -5.46872991, -5.00864717, -4.50163760, -4.01382410, -3.43856708, -2.96898001, -2.46554810, +-1.96861004, -1.47106701, -0.97197237, -0.46561654, -0.00531409, 0.45767857, 0.96777907, 1.47507903, 1.97740425, 2.46695420, + 3.00695774, 3.47167185, 4.02712538, 4.49280007, 5.01087640, 5.48191963, 6.04916550, 6.51511058, 6.97297819, 7.46565499, + 8.01489405, 8.39912001, 8.91819757, 9.50000000, 10.11654065, 10.50000000, 11.03712583, 11.50000000, 12.00000000, 12.38964346, + 12.89466127, 13.43657881, 13.96013840, 14.46279912, 15.00000000, 15.39412269, 15.96662441}; + +const double WebRtcIsac_kQMeanLag3Hi[1] = { + 0.00000000}; + +const double WebRtcIsac_kQMeanLag4Hi[34] = { +-7.98331221, -7.47988769, -7.03626557, -6.52708003, -6.06982173, -5.51856292, -5.05827033, -4.45909878, -3.99125864, -3.45308135, +-3.02328139, -2.47297273, -1.94341995, -1.44699056, -0.93612243, -0.43012406, 0.01120357, 0.44054812, 0.93199883, 1.45669587, + 1.97218322, 2.50187419, 2.98748690, 3.49343202, 4.01660147, 4.50984306, 5.01402683, 5.58936797, 5.91787793, 6.59998900, + 6.85034315, 7.53503316, 7.87711194, 8.53631648}; + +const double WebRtcIsac_kQPitchLagStepsizeHi = 0.500000; + +/* transform matrix */ +const double WebRtcIsac_kTransform[4][4] = { +{-0.50000000, -0.50000000, -0.50000000, -0.50000000}, +{ 0.67082039, 0.22360680, -0.22360680, -0.67082039}, +{ 0.50000000, -0.50000000, -0.50000000, 0.50000000}, +{ 0.22360680, -0.67082039, 0.67082039, -0.22360680}}; + +/* transpose transform matrix */ +const double WebRtcIsac_kTransformTranspose[4][4] = { +{-0.50000000, 0.67082039, 0.50000000, 0.22360680}, +{-0.50000000, 0.22360680, -0.50000000, -0.67082039}, +{-0.50000000, -0.22360680, -0.50000000, 0.67082039}, +{-0.50000000, -0.67082039, 0.50000000, -0.22360680}}; + diff --git a/src/mod/codecs/mod_isac/pitch_lag_tables.h b/src/mod/codecs/mod_isac/pitch_lag_tables.h new file mode 100644 index 0000000000..67b02e5e4d --- /dev/null +++ b/src/mod/codecs/mod_isac/pitch_lag_tables.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * pitch_lag_tables.h + * + * This file contains tables for the pitch filter side-info in the entropy coder. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_LAG_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_LAG_TABLES_H_ + +#include "typedefs.h" +/* header file for coding tables for the pitch filter side-info in the entropy coder */ +/********************* Pitch Filter Lag Coefficient Tables ************************/ + +/* tables for use with small pitch gain */ + +/* cdfs for quantized pitch lags */ +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf1Lo[127]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf2Lo[20]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf3Lo[2]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf4Lo[10]; + +extern const WebRtc_UWord16 *WebRtcIsac_kQPitchLagCdfPtrLo[4]; + +/* size of first cdf table */ +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdfSizeLo[1]; + +/* index limits and ranges */ +extern const WebRtc_Word16 WebRtcIsac_kQIndexLowerLimitLagLo[4]; +extern const WebRtc_Word16 WebRtcIsac_kQIndexUpperLimitLagLo[4]; + +/* initial index for arithmetic decoder */ +extern const WebRtc_UWord16 WebRtcIsac_kQInitIndexLagLo[3]; + +/* mean values of pitch filter lags */ +extern const double WebRtcIsac_kQMeanLag2Lo[19]; +extern const double WebRtcIsac_kQMeanLag3Lo[1]; +extern const double WebRtcIsac_kQMeanLag4Lo[9]; + +extern const double WebRtcIsac_kQPitchLagStepsizeLo; + + +/* tables for use with medium pitch gain */ + +/* cdfs for quantized pitch lags */ +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf1Mid[255]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf2Mid[36]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf3Mid[2]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf4Mid[20]; + +extern const WebRtc_UWord16 *WebRtcIsac_kQPitchLagCdfPtrMid[4]; + +/* size of first cdf table */ +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdfSizeMid[1]; + +/* index limits and ranges */ +extern const WebRtc_Word16 WebRtcIsac_kQIndexLowerLimitLagMid[4]; +extern const WebRtc_Word16 WebRtcIsac_kQIndexUpperLimitLagMid[4]; + +/* initial index for arithmetic decoder */ +extern const WebRtc_UWord16 WebRtcIsac_kQInitIndexLagMid[3]; + +/* mean values of pitch filter lags */ +extern const double WebRtcIsac_kQMeanLag2Mid[35]; +extern const double WebRtcIsac_kQMeanLag3Mid[1]; +extern const double WebRtcIsac_kQMeanLag4Mid[19]; + +extern const double WebRtcIsac_kQPitchLagStepsizeMid; + + +/* tables for use with large pitch gain */ + +/* cdfs for quantized pitch lags */ +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf1Hi[511]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf2Hi[68]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf3Hi[2]; +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdf4Hi[35]; + +extern const WebRtc_UWord16 *WebRtcIsac_kQPitchLagCdfPtrHi[4]; + +/* size of first cdf table */ +extern const WebRtc_UWord16 WebRtcIsac_kQPitchLagCdfSizeHi[1]; + +/* index limits and ranges */ +extern const WebRtc_Word16 WebRtcIsac_kQindexLowerLimitLagHi[4]; +extern const WebRtc_Word16 WebRtcIsac_kQindexUpperLimitLagHi[4]; + +/* initial index for arithmetic decoder */ +extern const WebRtc_UWord16 WebRtcIsac_kQInitIndexLagHi[3]; + +/* mean values of pitch filter lags */ +extern const double WebRtcIsac_kQMeanLag2Hi[67]; +extern const double WebRtcIsac_kQMeanLag3Hi[1]; +extern const double WebRtcIsac_kQMeanLag4Hi[34]; + +extern const double WebRtcIsac_kQPitchLagStepsizeHi; + +/* transform matrix */ +extern const double WebRtcIsac_kTransform[4][4]; + +/* transpose transform matrix */ +extern const double WebRtcIsac_kTransformTranspose[4][4]; + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_PITCH_LAG_TABLES_H_ */ diff --git a/src/mod/codecs/mod_isac/randomization_functions.c b/src/mod/codecs/mod_isac/randomization_functions.c new file mode 100644 index 0000000000..04271ada4d --- /dev/null +++ b/src/mod/codecs/mod_isac/randomization_functions.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains implementations of the randomization functions + * WebRtcSpl_IncreaseSeed() + * WebRtcSpl_RandU() + * WebRtcSpl_RandN() + * WebRtcSpl_RandUArray() + * + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +static const WebRtc_Word16 kRandNTable[] = { + 9178, -7260, 40, 10189, 4894, -3531, -13779, 14764, + -4008, -8884, -8990, 1008, 7368, 5184, 3251, -5817, + -9786, 5963, 1770, 8066, -7135, 10772, -2298, 1361, + 6484, 2241, -8633, 792, 199, -3344, 6553, -10079, + -15040, 95, 11608, -12469, 14161, -4176, 2476, 6403, + 13685, -16005, 6646, 2239, 10916, -3004, -602, -3141, + 2142, 14144, -5829, 5305, 8209, 4713, 2697, -5112, + 16092, -1210, -2891, -6631, -5360, -11878, -6781, -2739, + -6392, 536, 10923, 10872, 5059, -4748, -7770, 5477, + 38, -1025, -2892, 1638, 6304, 14375, -11028, 1553, + -1565, 10762, -393, 4040, 5257, 12310, 6554, -4799, + 4899, -6354, 1603, -1048, -2220, 8247, -186, -8944, + -12004, 2332, 4801, -4933, 6371, 131, 8614, -5927, + -8287, -22760, 4033, -15162, 3385, 3246, 3153, -5250, + 3766, 784, 6494, -62, 3531, -1582, 15572, 662, + -3952, -330, -3196, 669, 7236, -2678, -6569, 23319, + -8645, -741, 14830, -15976, 4903, 315, -11342, 10311, + 1858, -7777, 2145, 5436, 5677, -113, -10033, 826, + -1353, 17210, 7768, 986, -1471, 8291, -4982, 8207, + -14911, -6255, -2449, -11881, -7059, -11703, -4338, 8025, + 7538, -2823, -12490, 9470, -1613, -2529, -10092, -7807, + 9480, 6970, -12844, 5123, 3532, 4816, 4803, -8455, + -5045, 14032, -4378, -1643, 5756, -11041, -2732, -16618, + -6430, -18375, -3320, 6098, 5131, -4269, -8840, 2482, + -7048, 1547, -21890, -6505, -7414, -424, -11722, 7955, + 1653, -17299, 1823, 473, -9232, 3337, 1111, 873, + 4018, -8982, 9889, 3531, -11763, -3799, 7373, -4539, + 3231, 7054, -8537, 7616, 6244, 16635, 447, -2915, + 13967, 705, -2669, -1520, -1771, -16188, 5956, 5117, + 6371, -9936, -1448, 2480, 5128, 7550, -8130, 5236, + 8213, -6443, 7707, -1950, -13811, 7218, 7031, -3883, + 67, 5731, -2874, 13480, -3743, 9298, -3280, 3552, + -4425, -18, -3785, -9988, -5357, 5477, -11794, 2117, + 1416, -9935, 3376, 802, -5079, -8243, 12652, 66, + 3653, -2368, 6781, -21895, -7227, 2487, 7839, -385, + 6646, -7016, -4658, 5531, -1705, 834, 129, 3694, + -1343, 2238, -22640, -6417, -11139, 11301, -2945, -3494, + -5626, 185, -3615, -2041, -7972, -3106, -60, -23497, + -1566, 17064, 3519, 2518, 304, -6805, -10269, 2105, + 1936, -426, -736, -8122, -1467, 4238, -6939, -13309, + 360, 7402, -7970, 12576, 3287, 12194, -6289, -16006, + 9171, 4042, -9193, 9123, -2512, 6388, -4734, -8739, + 1028, -5406, -1696, 5889, -666, -4736, 4971, 3565, + 9362, -6292, 3876, -3652, -19666, 7523, -4061, 391, + -11773, 7502, -3763, 4929, -9478, 13278, 2805, 4496, + 7814, 16419, 12455, -14773, 2127, -2746, 3763, 4847, + 3698, 6978, 4751, -6957, -3581, -45, 6252, 1513, + -4797, -7925, 11270, 16188, -2359, -5269, 9376, -10777, + 7262, 20031, -6515, -2208, -5353, 8085, -1341, -1303, + 7333, 5576, 3625, 5763, -7931, 9833, -3371, -10305, + 6534, -13539, -9971, 997, 8464, -4064, -1495, 1857, + 13624, 5458, 9490, -11086, -4524, 12022, -550, -198, + 408, -8455, -7068, 10289, 9712, -3366, 9028, -7621, + -5243, 2362, 6909, 4672, -4933, -1799, 4709, -4563, + -62, -566, 1624, -7010, 14730, -17791, -3697, -2344, + -1741, 7099, -9509, -6855, -1989, 3495, -2289, 2031, + 12784, 891, 14189, -3963, -5683, 421, -12575, 1724, + -12682, -5970, -8169, 3143, -1824, -5488, -5130, 8536, + 12799, 794, 5738, 3459, -11689, -258, -3738, -3775, + -8742, 2333, 8312, -9383, 10331, 13119, 8398, 10644, + -19433, -6446, -16277, -11793, 16284, 9345, 15222, 15834, + 2009, -7349, 130, -14547, 338, -5998, 3337, 21492, + 2406, 7703, -951, 11196, -564, 3406, 2217, 4806, + 2374, -5797, 11839, 8940, -11874, 18213, 2855, 10492 +}; + +WebRtc_UWord32 WebRtcSpl_IncreaseSeed(WebRtc_UWord32 *seed) +{ + seed[0] = (seed[0] * ((WebRtc_Word32)69069) + 1) & (WEBRTC_SPL_MAX_SEED_USED - 1); + return seed[0]; +} + +WebRtc_Word16 WebRtcSpl_RandU(WebRtc_UWord32 *seed) +{ + return (WebRtc_Word16)(WebRtcSpl_IncreaseSeed(seed) >> 16); +} + +WebRtc_Word16 WebRtcSpl_RandN(WebRtc_UWord32 *seed) +{ + return kRandNTable[WebRtcSpl_IncreaseSeed(seed) >> 23]; +} + +// Creates an array of uniformly distributed variables +WebRtc_Word16 WebRtcSpl_RandUArray(WebRtc_Word16* vector, + WebRtc_Word16 vector_length, + WebRtc_UWord32* seed) +{ + int i; + for (i = 0; i < vector_length; i++) + { + vector[i] = WebRtcSpl_RandU(seed); + } + return vector_length; +} diff --git a/src/mod/codecs/mod_isac/refl_coef_to_lpc.c b/src/mod/codecs/mod_isac/refl_coef_to_lpc.c new file mode 100644 index 0000000000..d07804dee7 --- /dev/null +++ b/src/mod/codecs/mod_isac/refl_coef_to_lpc.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_ReflCoefToLpc(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_ReflCoefToLpc(G_CONST WebRtc_Word16 *k, int use_order, WebRtc_Word16 *a) +{ + WebRtc_Word16 any[WEBRTC_SPL_MAX_LPC_ORDER + 1]; + WebRtc_Word16 *aptr, *aptr2, *anyptr; + G_CONST WebRtc_Word16 *kptr; + int m, i; + + kptr = k; + *a = 4096; // i.e., (Word16_MAX >> 3)+1. + *any = *a; + a[1] = WEBRTC_SPL_RSHIFT_W16((*k), 3); + + for (m = 1; m < use_order; m++) + { + kptr++; + aptr = a; + aptr++; + aptr2 = &a[m]; + anyptr = any; + anyptr++; + + any[m + 1] = WEBRTC_SPL_RSHIFT_W16((*kptr), 3); + for (i = 0; i < m; i++) + { + *anyptr = (*aptr) + + (WebRtc_Word16)WEBRTC_SPL_MUL_16_16_RSFT((*aptr2), (*kptr), 15); + anyptr++; + aptr++; + aptr2--; + } + + aptr = a; + anyptr = any; + for (i = 0; i < (m + 2); i++) + { + *aptr = *anyptr; + aptr++; + anyptr++; + } + } +} diff --git a/src/mod/codecs/mod_isac/resample.c b/src/mod/codecs/mod_isac/resample.c new file mode 100644 index 0000000000..19d1778558 --- /dev/null +++ b/src/mod/codecs/mod_isac/resample.c @@ -0,0 +1,505 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the resampling functions for 22 kHz. + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" +#include "resample_by_2_internal.h" + +// Declaration of internally used functions +static void WebRtcSpl_32khzTo22khzIntToShort(const WebRtc_Word32 *In, WebRtc_Word16 *Out, + const WebRtc_Word32 K); + +void WebRtcSpl_32khzTo22khzIntToInt(const WebRtc_Word32 *In, WebRtc_Word32 *Out, + const WebRtc_Word32 K); + +// interpolation coefficients +static const WebRtc_Word16 kCoefficients32To22[5][9] = { + {127, -712, 2359, -6333, 23456, 16775, -3695, 945, -154}, + {-39, 230, -830, 2785, 32366, -2324, 760, -218, 38}, + {117, -663, 2222, -6133, 26634, 13070, -3174, 831, -137}, + {-77, 457, -1677, 5958, 31175, -4136, 1405, -408, 71}, + { 98, -560, 1900, -5406, 29240, 9423, -2480, 663, -110} +}; + +////////////////////// +// 22 kHz -> 16 kHz // +////////////////////// + +// number of subblocks; options: 1, 2, 4, 5, 10 +#define SUB_BLOCKS_22_16 5 + +// 22 -> 16 resampler +void WebRtcSpl_Resample22khzTo16khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State22khzTo16khz* state, WebRtc_Word32* tmpmem) +{ + int k; + + // process two blocks of 10/SUB_BLOCKS_22_16 ms (to reduce temp buffer size) + for (k = 0; k < SUB_BLOCKS_22_16; k++) + { + ///// 22 --> 44 ///// + // WebRtc_Word16 in[220/SUB_BLOCKS_22_16] + // WebRtc_Word32 out[440/SUB_BLOCKS_22_16] + ///// + WebRtcSpl_UpBy2ShortToInt(in, 220 / SUB_BLOCKS_22_16, tmpmem + 16, state->S_22_44); + + ///// 44 --> 32 ///// + // WebRtc_Word32 in[440/SUB_BLOCKS_22_16] + // WebRtc_Word32 out[320/SUB_BLOCKS_22_16] + ///// + // copy state to and from input array + tmpmem[8] = state->S_44_32[0]; + tmpmem[9] = state->S_44_32[1]; + tmpmem[10] = state->S_44_32[2]; + tmpmem[11] = state->S_44_32[3]; + tmpmem[12] = state->S_44_32[4]; + tmpmem[13] = state->S_44_32[5]; + tmpmem[14] = state->S_44_32[6]; + tmpmem[15] = state->S_44_32[7]; + state->S_44_32[0] = tmpmem[440 / SUB_BLOCKS_22_16 + 8]; + state->S_44_32[1] = tmpmem[440 / SUB_BLOCKS_22_16 + 9]; + state->S_44_32[2] = tmpmem[440 / SUB_BLOCKS_22_16 + 10]; + state->S_44_32[3] = tmpmem[440 / SUB_BLOCKS_22_16 + 11]; + state->S_44_32[4] = tmpmem[440 / SUB_BLOCKS_22_16 + 12]; + state->S_44_32[5] = tmpmem[440 / SUB_BLOCKS_22_16 + 13]; + state->S_44_32[6] = tmpmem[440 / SUB_BLOCKS_22_16 + 14]; + state->S_44_32[7] = tmpmem[440 / SUB_BLOCKS_22_16 + 15]; + + WebRtcSpl_Resample44khzTo32khz(tmpmem + 8, tmpmem, 40 / SUB_BLOCKS_22_16); + + ///// 32 --> 16 ///// + // WebRtc_Word32 in[320/SUB_BLOCKS_22_16] + // WebRtc_Word32 out[160/SUB_BLOCKS_22_16] + ///// + WebRtcSpl_DownBy2IntToShort(tmpmem, 320 / SUB_BLOCKS_22_16, out, state->S_32_16); + + // move input/output pointers 10/SUB_BLOCKS_22_16 ms seconds ahead + in += 220 / SUB_BLOCKS_22_16; + out += 160 / SUB_BLOCKS_22_16; + } +} + +// initialize state of 22 -> 16 resampler +void WebRtcSpl_ResetResample22khzTo16khz(WebRtcSpl_State22khzTo16khz* state) +{ + int k; + for (k = 0; k < 8; k++) + { + state->S_22_44[k] = 0; + state->S_44_32[k] = 0; + state->S_32_16[k] = 0; + } +} + +////////////////////// +// 16 kHz -> 22 kHz // +////////////////////// + +// number of subblocks; options: 1, 2, 4, 5, 10 +#define SUB_BLOCKS_16_22 4 + +// 16 -> 22 resampler +void WebRtcSpl_Resample16khzTo22khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State16khzTo22khz* state, WebRtc_Word32* tmpmem) +{ + int k; + + // process two blocks of 10/SUB_BLOCKS_16_22 ms (to reduce temp buffer size) + for (k = 0; k < SUB_BLOCKS_16_22; k++) + { + ///// 16 --> 32 ///// + // WebRtc_Word16 in[160/SUB_BLOCKS_16_22] + // WebRtc_Word32 out[320/SUB_BLOCKS_16_22] + ///// + WebRtcSpl_UpBy2ShortToInt(in, 160 / SUB_BLOCKS_16_22, tmpmem + 8, state->S_16_32); + + ///// 32 --> 22 ///// + // WebRtc_Word32 in[320/SUB_BLOCKS_16_22] + // WebRtc_Word32 out[220/SUB_BLOCKS_16_22] + ///// + // copy state to and from input array + tmpmem[0] = state->S_32_22[0]; + tmpmem[1] = state->S_32_22[1]; + tmpmem[2] = state->S_32_22[2]; + tmpmem[3] = state->S_32_22[3]; + tmpmem[4] = state->S_32_22[4]; + tmpmem[5] = state->S_32_22[5]; + tmpmem[6] = state->S_32_22[6]; + tmpmem[7] = state->S_32_22[7]; + state->S_32_22[0] = tmpmem[320 / SUB_BLOCKS_16_22]; + state->S_32_22[1] = tmpmem[320 / SUB_BLOCKS_16_22 + 1]; + state->S_32_22[2] = tmpmem[320 / SUB_BLOCKS_16_22 + 2]; + state->S_32_22[3] = tmpmem[320 / SUB_BLOCKS_16_22 + 3]; + state->S_32_22[4] = tmpmem[320 / SUB_BLOCKS_16_22 + 4]; + state->S_32_22[5] = tmpmem[320 / SUB_BLOCKS_16_22 + 5]; + state->S_32_22[6] = tmpmem[320 / SUB_BLOCKS_16_22 + 6]; + state->S_32_22[7] = tmpmem[320 / SUB_BLOCKS_16_22 + 7]; + + WebRtcSpl_32khzTo22khzIntToShort(tmpmem, out, 20 / SUB_BLOCKS_16_22); + + // move input/output pointers 10/SUB_BLOCKS_16_22 ms seconds ahead + in += 160 / SUB_BLOCKS_16_22; + out += 220 / SUB_BLOCKS_16_22; + } +} + +// initialize state of 16 -> 22 resampler +void WebRtcSpl_ResetResample16khzTo22khz(WebRtcSpl_State16khzTo22khz* state) +{ + int k; + for (k = 0; k < 8; k++) + { + state->S_16_32[k] = 0; + state->S_32_22[k] = 0; + } +} + +////////////////////// +// 22 kHz -> 8 kHz // +////////////////////// + +// number of subblocks; options: 1, 2, 5, 10 +#define SUB_BLOCKS_22_8 2 + +// 22 -> 8 resampler +void WebRtcSpl_Resample22khzTo8khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State22khzTo8khz* state, WebRtc_Word32* tmpmem) +{ + int k; + + // process two blocks of 10/SUB_BLOCKS_22_8 ms (to reduce temp buffer size) + for (k = 0; k < SUB_BLOCKS_22_8; k++) + { + ///// 22 --> 22 lowpass ///// + // WebRtc_Word16 in[220/SUB_BLOCKS_22_8] + // WebRtc_Word32 out[220/SUB_BLOCKS_22_8] + ///// + WebRtcSpl_LPBy2ShortToInt(in, 220 / SUB_BLOCKS_22_8, tmpmem + 16, state->S_22_22); + + ///// 22 --> 16 ///// + // WebRtc_Word32 in[220/SUB_BLOCKS_22_8] + // WebRtc_Word32 out[160/SUB_BLOCKS_22_8] + ///// + // copy state to and from input array + tmpmem[8] = state->S_22_16[0]; + tmpmem[9] = state->S_22_16[1]; + tmpmem[10] = state->S_22_16[2]; + tmpmem[11] = state->S_22_16[3]; + tmpmem[12] = state->S_22_16[4]; + tmpmem[13] = state->S_22_16[5]; + tmpmem[14] = state->S_22_16[6]; + tmpmem[15] = state->S_22_16[7]; + state->S_22_16[0] = tmpmem[220 / SUB_BLOCKS_22_8 + 8]; + state->S_22_16[1] = tmpmem[220 / SUB_BLOCKS_22_8 + 9]; + state->S_22_16[2] = tmpmem[220 / SUB_BLOCKS_22_8 + 10]; + state->S_22_16[3] = tmpmem[220 / SUB_BLOCKS_22_8 + 11]; + state->S_22_16[4] = tmpmem[220 / SUB_BLOCKS_22_8 + 12]; + state->S_22_16[5] = tmpmem[220 / SUB_BLOCKS_22_8 + 13]; + state->S_22_16[6] = tmpmem[220 / SUB_BLOCKS_22_8 + 14]; + state->S_22_16[7] = tmpmem[220 / SUB_BLOCKS_22_8 + 15]; + + WebRtcSpl_Resample44khzTo32khz(tmpmem + 8, tmpmem, 20 / SUB_BLOCKS_22_8); + + ///// 16 --> 8 ///// + // WebRtc_Word32 in[160/SUB_BLOCKS_22_8] + // WebRtc_Word32 out[80/SUB_BLOCKS_22_8] + ///// + WebRtcSpl_DownBy2IntToShort(tmpmem, 160 / SUB_BLOCKS_22_8, out, state->S_16_8); + + // move input/output pointers 10/SUB_BLOCKS_22_8 ms seconds ahead + in += 220 / SUB_BLOCKS_22_8; + out += 80 / SUB_BLOCKS_22_8; + } +} + +// initialize state of 22 -> 8 resampler +void WebRtcSpl_ResetResample22khzTo8khz(WebRtcSpl_State22khzTo8khz* state) +{ + int k; + for (k = 0; k < 8; k++) + { + state->S_22_22[k] = 0; + state->S_22_22[k + 8] = 0; + state->S_22_16[k] = 0; + state->S_16_8[k] = 0; + } +} + +////////////////////// +// 8 kHz -> 22 kHz // +////////////////////// + +// number of subblocks; options: 1, 2, 5, 10 +#define SUB_BLOCKS_8_22 2 + +// 8 -> 22 resampler +void WebRtcSpl_Resample8khzTo22khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State8khzTo22khz* state, WebRtc_Word32* tmpmem) +{ + int k; + + // process two blocks of 10/SUB_BLOCKS_8_22 ms (to reduce temp buffer size) + for (k = 0; k < SUB_BLOCKS_8_22; k++) + { + ///// 8 --> 16 ///// + // WebRtc_Word16 in[80/SUB_BLOCKS_8_22] + // WebRtc_Word32 out[160/SUB_BLOCKS_8_22] + ///// + WebRtcSpl_UpBy2ShortToInt(in, 80 / SUB_BLOCKS_8_22, tmpmem + 18, state->S_8_16); + + ///// 16 --> 11 ///// + // WebRtc_Word32 in[160/SUB_BLOCKS_8_22] + // WebRtc_Word32 out[110/SUB_BLOCKS_8_22] + ///// + // copy state to and from input array + tmpmem[10] = state->S_16_11[0]; + tmpmem[11] = state->S_16_11[1]; + tmpmem[12] = state->S_16_11[2]; + tmpmem[13] = state->S_16_11[3]; + tmpmem[14] = state->S_16_11[4]; + tmpmem[15] = state->S_16_11[5]; + tmpmem[16] = state->S_16_11[6]; + tmpmem[17] = state->S_16_11[7]; + state->S_16_11[0] = tmpmem[160 / SUB_BLOCKS_8_22 + 10]; + state->S_16_11[1] = tmpmem[160 / SUB_BLOCKS_8_22 + 11]; + state->S_16_11[2] = tmpmem[160 / SUB_BLOCKS_8_22 + 12]; + state->S_16_11[3] = tmpmem[160 / SUB_BLOCKS_8_22 + 13]; + state->S_16_11[4] = tmpmem[160 / SUB_BLOCKS_8_22 + 14]; + state->S_16_11[5] = tmpmem[160 / SUB_BLOCKS_8_22 + 15]; + state->S_16_11[6] = tmpmem[160 / SUB_BLOCKS_8_22 + 16]; + state->S_16_11[7] = tmpmem[160 / SUB_BLOCKS_8_22 + 17]; + + WebRtcSpl_32khzTo22khzIntToInt(tmpmem + 10, tmpmem, 10 / SUB_BLOCKS_8_22); + + ///// 11 --> 22 ///// + // WebRtc_Word32 in[110/SUB_BLOCKS_8_22] + // WebRtc_Word16 out[220/SUB_BLOCKS_8_22] + ///// + WebRtcSpl_UpBy2IntToShort(tmpmem, 110 / SUB_BLOCKS_8_22, out, state->S_11_22); + + // move input/output pointers 10/SUB_BLOCKS_8_22 ms seconds ahead + in += 80 / SUB_BLOCKS_8_22; + out += 220 / SUB_BLOCKS_8_22; + } +} + +// initialize state of 8 -> 22 resampler +void WebRtcSpl_ResetResample8khzTo22khz(WebRtcSpl_State8khzTo22khz* state) +{ + int k; + for (k = 0; k < 8; k++) + { + state->S_8_16[k] = 0; + state->S_16_11[k] = 0; + state->S_11_22[k] = 0; + } +} + +// compute two inner-products and store them to output array +static void WebRtcSpl_DotProdIntToInt(const WebRtc_Word32* in1, const WebRtc_Word32* in2, + const WebRtc_Word16* coef_ptr, WebRtc_Word32* out1, + WebRtc_Word32* out2) +{ + WebRtc_Word32 tmp1 = 16384; + WebRtc_Word32 tmp2 = 16384; + WebRtc_Word16 coef; + + coef = coef_ptr[0]; + tmp1 += coef * in1[0]; + tmp2 += coef * in2[-0]; + + coef = coef_ptr[1]; + tmp1 += coef * in1[1]; + tmp2 += coef * in2[-1]; + + coef = coef_ptr[2]; + tmp1 += coef * in1[2]; + tmp2 += coef * in2[-2]; + + coef = coef_ptr[3]; + tmp1 += coef * in1[3]; + tmp2 += coef * in2[-3]; + + coef = coef_ptr[4]; + tmp1 += coef * in1[4]; + tmp2 += coef * in2[-4]; + + coef = coef_ptr[5]; + tmp1 += coef * in1[5]; + tmp2 += coef * in2[-5]; + + coef = coef_ptr[6]; + tmp1 += coef * in1[6]; + tmp2 += coef * in2[-6]; + + coef = coef_ptr[7]; + tmp1 += coef * in1[7]; + tmp2 += coef * in2[-7]; + + coef = coef_ptr[8]; + *out1 = tmp1 + coef * in1[8]; + *out2 = tmp2 + coef * in2[-8]; +} + +// compute two inner-products and store them to output array +static void WebRtcSpl_DotProdIntToShort(const WebRtc_Word32* in1, const WebRtc_Word32* in2, + const WebRtc_Word16* coef_ptr, WebRtc_Word16* out1, + WebRtc_Word16* out2) +{ + WebRtc_Word32 tmp1 = 16384; + WebRtc_Word32 tmp2 = 16384; + WebRtc_Word16 coef; + + coef = coef_ptr[0]; + tmp1 += coef * in1[0]; + tmp2 += coef * in2[-0]; + + coef = coef_ptr[1]; + tmp1 += coef * in1[1]; + tmp2 += coef * in2[-1]; + + coef = coef_ptr[2]; + tmp1 += coef * in1[2]; + tmp2 += coef * in2[-2]; + + coef = coef_ptr[3]; + tmp1 += coef * in1[3]; + tmp2 += coef * in2[-3]; + + coef = coef_ptr[4]; + tmp1 += coef * in1[4]; + tmp2 += coef * in2[-4]; + + coef = coef_ptr[5]; + tmp1 += coef * in1[5]; + tmp2 += coef * in2[-5]; + + coef = coef_ptr[6]; + tmp1 += coef * in1[6]; + tmp2 += coef * in2[-6]; + + coef = coef_ptr[7]; + tmp1 += coef * in1[7]; + tmp2 += coef * in2[-7]; + + coef = coef_ptr[8]; + tmp1 += coef * in1[8]; + tmp2 += coef * in2[-8]; + + // scale down, round and saturate + tmp1 >>= 15; + if (tmp1 > (WebRtc_Word32)0x00007FFF) + tmp1 = 0x00007FFF; + if (tmp1 < (WebRtc_Word32)0xFFFF8000) + tmp1 = 0xFFFF8000; + tmp2 >>= 15; + if (tmp2 > (WebRtc_Word32)0x00007FFF) + tmp2 = 0x00007FFF; + if (tmp2 < (WebRtc_Word32)0xFFFF8000) + tmp2 = 0xFFFF8000; + *out1 = (WebRtc_Word16)tmp1; + *out2 = (WebRtc_Word16)tmp2; +} + +// Resampling ratio: 11/16 +// input: WebRtc_Word32 (normalized, not saturated) :: size 16 * K +// output: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) :: size 11 * K +// K: Number of blocks + +void WebRtcSpl_32khzTo22khzIntToInt(const WebRtc_Word32* In, + WebRtc_Word32* Out, + const WebRtc_Word32 K) +{ + ///////////////////////////////////////////////////////////// + // Filter operation: + // + // Perform resampling (16 input samples -> 11 output samples); + // process in sub blocks of size 16 samples. + WebRtc_Word32 m; + + for (m = 0; m < K; m++) + { + // first output sample + Out[0] = ((WebRtc_Word32)In[3] << 15) + (1 << 14); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToInt(&In[0], &In[22], kCoefficients32To22[0], &Out[1], &Out[10]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToInt(&In[2], &In[20], kCoefficients32To22[1], &Out[2], &Out[9]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToInt(&In[3], &In[19], kCoefficients32To22[2], &Out[3], &Out[8]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToInt(&In[5], &In[17], kCoefficients32To22[3], &Out[4], &Out[7]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToInt(&In[6], &In[16], kCoefficients32To22[4], &Out[5], &Out[6]); + + // update pointers + In += 16; + Out += 11; + } +} + +// Resampling ratio: 11/16 +// input: WebRtc_Word32 (normalized, not saturated) :: size 16 * K +// output: WebRtc_Word16 (saturated) :: size 11 * K +// K: Number of blocks + +void WebRtcSpl_32khzTo22khzIntToShort(const WebRtc_Word32 *In, + WebRtc_Word16 *Out, + const WebRtc_Word32 K) +{ + ///////////////////////////////////////////////////////////// + // Filter operation: + // + // Perform resampling (16 input samples -> 11 output samples); + // process in sub blocks of size 16 samples. + WebRtc_Word32 tmp; + WebRtc_Word32 m; + + for (m = 0; m < K; m++) + { + // first output sample + tmp = In[3]; + if (tmp > (WebRtc_Word32)0x00007FFF) + tmp = 0x00007FFF; + if (tmp < (WebRtc_Word32)0xFFFF8000) + tmp = 0xFFFF8000; + Out[0] = (WebRtc_Word16)tmp; + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToShort(&In[0], &In[22], kCoefficients32To22[0], &Out[1], &Out[10]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToShort(&In[2], &In[20], kCoefficients32To22[1], &Out[2], &Out[9]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToShort(&In[3], &In[19], kCoefficients32To22[2], &Out[3], &Out[8]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToShort(&In[5], &In[17], kCoefficients32To22[3], &Out[4], &Out[7]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_DotProdIntToShort(&In[6], &In[16], kCoefficients32To22[4], &Out[5], &Out[6]); + + // update pointers + In += 16; + Out += 11; + } +} diff --git a/src/mod/codecs/mod_isac/resample_48khz.c b/src/mod/codecs/mod_isac/resample_48khz.c new file mode 100644 index 0000000000..31cbe6b6a9 --- /dev/null +++ b/src/mod/codecs/mod_isac/resample_48khz.c @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains resampling functions between 48 kHz and nb/wb. + * The description header can be found in signal_processing_library.h + * + */ + +#include +#include "signal_processing_library.h" +#include "resample_by_2_internal.h" + +//////////////////////////// +///// 48 kHz -> 16 kHz ///// +//////////////////////////// + +// 48 -> 16 resampler +void WebRtcSpl_Resample48khzTo16khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State48khzTo16khz* state, WebRtc_Word32* tmpmem) +{ + ///// 48 --> 48(LP) ///// + // WebRtc_Word16 in[480] + // WebRtc_Word32 out[480] + ///// + WebRtcSpl_LPBy2ShortToInt(in, 480, tmpmem + 16, state->S_48_48); + + ///// 48 --> 32 ///// + // WebRtc_Word32 in[480] + // WebRtc_Word32 out[320] + ///// + // copy state to and from input array + memcpy(tmpmem + 8, state->S_48_32, 8 * sizeof(WebRtc_Word32)); + memcpy(state->S_48_32, tmpmem + 488, 8 * sizeof(WebRtc_Word32)); + WebRtcSpl_Resample48khzTo32khz(tmpmem + 8, tmpmem, 160); + + ///// 32 --> 16 ///// + // WebRtc_Word32 in[320] + // WebRtc_Word16 out[160] + ///// + WebRtcSpl_DownBy2IntToShort(tmpmem, 320, out, state->S_32_16); +} + +// initialize state of 48 -> 16 resampler +void WebRtcSpl_ResetResample48khzTo16khz(WebRtcSpl_State48khzTo16khz* state) +{ + memset(state->S_48_48, 0, 16 * sizeof(WebRtc_Word32)); + memset(state->S_48_32, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_32_16, 0, 8 * sizeof(WebRtc_Word32)); +} + +//////////////////////////// +///// 16 kHz -> 48 kHz ///// +//////////////////////////// + +// 16 -> 48 resampler +void WebRtcSpl_Resample16khzTo48khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State16khzTo48khz* state, WebRtc_Word32* tmpmem) +{ + ///// 16 --> 32 ///// + // WebRtc_Word16 in[160] + // WebRtc_Word32 out[320] + ///// + WebRtcSpl_UpBy2ShortToInt(in, 160, tmpmem + 16, state->S_16_32); + + ///// 32 --> 24 ///// + // WebRtc_Word32 in[320] + // WebRtc_Word32 out[240] + // copy state to and from input array + ///// + memcpy(tmpmem + 8, state->S_32_24, 8 * sizeof(WebRtc_Word32)); + memcpy(state->S_32_24, tmpmem + 328, 8 * sizeof(WebRtc_Word32)); + WebRtcSpl_Resample32khzTo24khz(tmpmem + 8, tmpmem, 80); + + ///// 24 --> 48 ///// + // WebRtc_Word32 in[240] + // WebRtc_Word16 out[480] + ///// + WebRtcSpl_UpBy2IntToShort(tmpmem, 240, out, state->S_24_48); +} + +// initialize state of 16 -> 48 resampler +void WebRtcSpl_ResetResample16khzTo48khz(WebRtcSpl_State16khzTo48khz* state) +{ + memset(state->S_16_32, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_32_24, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_24_48, 0, 8 * sizeof(WebRtc_Word32)); +} + +//////////////////////////// +///// 48 kHz -> 8 kHz ///// +//////////////////////////// + +// 48 -> 8 resampler +void WebRtcSpl_Resample48khzTo8khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State48khzTo8khz* state, WebRtc_Word32* tmpmem) +{ + ///// 48 --> 24 ///// + // WebRtc_Word16 in[480] + // WebRtc_Word32 out[240] + ///// + WebRtcSpl_DownBy2ShortToInt(in, 480, tmpmem + 256, state->S_48_24); + + ///// 24 --> 24(LP) ///// + // WebRtc_Word32 in[240] + // WebRtc_Word32 out[240] + ///// + WebRtcSpl_LPBy2IntToInt(tmpmem + 256, 240, tmpmem + 16, state->S_24_24); + + ///// 24 --> 16 ///// + // WebRtc_Word32 in[240] + // WebRtc_Word32 out[160] + ///// + // copy state to and from input array + memcpy(tmpmem + 8, state->S_24_16, 8 * sizeof(WebRtc_Word32)); + memcpy(state->S_24_16, tmpmem + 248, 8 * sizeof(WebRtc_Word32)); + WebRtcSpl_Resample48khzTo32khz(tmpmem + 8, tmpmem, 80); + + ///// 16 --> 8 ///// + // WebRtc_Word32 in[160] + // WebRtc_Word16 out[80] + ///// + WebRtcSpl_DownBy2IntToShort(tmpmem, 160, out, state->S_16_8); +} + +// initialize state of 48 -> 8 resampler +void WebRtcSpl_ResetResample48khzTo8khz(WebRtcSpl_State48khzTo8khz* state) +{ + memset(state->S_48_24, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_24_24, 0, 16 * sizeof(WebRtc_Word32)); + memset(state->S_24_16, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_16_8, 0, 8 * sizeof(WebRtc_Word32)); +} + +//////////////////////////// +///// 8 kHz -> 48 kHz ///// +//////////////////////////// + +// 8 -> 48 resampler +void WebRtcSpl_Resample8khzTo48khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State8khzTo48khz* state, WebRtc_Word32* tmpmem) +{ + ///// 8 --> 16 ///// + // WebRtc_Word16 in[80] + // WebRtc_Word32 out[160] + ///// + WebRtcSpl_UpBy2ShortToInt(in, 80, tmpmem + 264, state->S_8_16); + + ///// 16 --> 12 ///// + // WebRtc_Word32 in[160] + // WebRtc_Word32 out[120] + ///// + // copy state to and from input array + memcpy(tmpmem + 256, state->S_16_12, 8 * sizeof(WebRtc_Word32)); + memcpy(state->S_16_12, tmpmem + 416, 8 * sizeof(WebRtc_Word32)); + WebRtcSpl_Resample32khzTo24khz(tmpmem + 256, tmpmem + 240, 40); + + ///// 12 --> 24 ///// + // WebRtc_Word32 in[120] + // WebRtc_Word16 out[240] + ///// + WebRtcSpl_UpBy2IntToInt(tmpmem + 240, 120, tmpmem, state->S_12_24); + + ///// 24 --> 48 ///// + // WebRtc_Word32 in[240] + // WebRtc_Word16 out[480] + ///// + WebRtcSpl_UpBy2IntToShort(tmpmem, 240, out, state->S_24_48); +} + +// initialize state of 8 -> 48 resampler +void WebRtcSpl_ResetResample8khzTo48khz(WebRtcSpl_State8khzTo48khz* state) +{ + memset(state->S_8_16, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_16_12, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_12_24, 0, 8 * sizeof(WebRtc_Word32)); + memset(state->S_24_48, 0, 8 * sizeof(WebRtc_Word32)); +} diff --git a/src/mod/codecs/mod_isac/resample_by_2.c b/src/mod/codecs/mod_isac/resample_by_2.c new file mode 100644 index 0000000000..e239db75c0 --- /dev/null +++ b/src/mod/codecs/mod_isac/resample_by_2.c @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the resampling by two functions. + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +#ifdef WEBRTC_ARCH_ARM_V7A + +// allpass filter coefficients. +static const WebRtc_UWord32 kResampleAllpass1[3] = {3284, 24441, 49528 << 15}; +static const WebRtc_UWord32 kResampleAllpass2[3] = + {12199, 37471 << 15, 60255 << 15}; + +// Multiply two 32-bit values and accumulate to another input value. +// Return: state + ((diff * tbl_value) >> 16) + +static __inline WebRtc_Word32 MUL_ACCUM_1(WebRtc_Word32 tbl_value, + WebRtc_Word32 diff, + WebRtc_Word32 state) { + WebRtc_Word32 result; + __asm__("smlawb %r0, %r1, %r2, %r3": "=r"(result): "r"(diff), + "r"(tbl_value), "r"(state)); + return result; +} + +// Multiply two 32-bit values and accumulate to another input value. +// Return: Return: state + (((diff << 1) * tbl_value) >> 32) +// +// The reason to introduce this function is that, in case we can't use smlawb +// instruction (in MUL_ACCUM_1) due to input value range, we can still use +// smmla to save some cycles. + +static __inline WebRtc_Word32 MUL_ACCUM_2(WebRtc_Word32 tbl_value, + WebRtc_Word32 diff, + WebRtc_Word32 state) { + WebRtc_Word32 result; + __asm__("smmla %r0, %r1, %r2, %r3": "=r"(result): "r"(diff << 1), + "r"(tbl_value), "r"(state)); + return result; +} + +#else + +// allpass filter coefficients. +static const WebRtc_UWord16 kResampleAllpass1[3] = {3284, 24441, 49528}; +static const WebRtc_UWord16 kResampleAllpass2[3] = {12199, 37471, 60255}; + +// Multiply a 32-bit value with a 16-bit value and accumulate to another input: +#define MUL_ACCUM_1(a, b, c) WEBRTC_SPL_SCALEDIFF32(a, b, c) +#define MUL_ACCUM_2(a, b, c) WEBRTC_SPL_SCALEDIFF32(a, b, c) + +#endif // WEBRTC_ARCH_ARM_V7A + + +// decimator +void WebRtcSpl_DownsampleBy2(const WebRtc_Word16* in, const WebRtc_Word16 len, + WebRtc_Word16* out, WebRtc_Word32* filtState) { + WebRtc_Word32 tmp1, tmp2, diff, in32, out32; + WebRtc_Word16 i; + + register WebRtc_Word32 state0 = filtState[0]; + register WebRtc_Word32 state1 = filtState[1]; + register WebRtc_Word32 state2 = filtState[2]; + register WebRtc_Word32 state3 = filtState[3]; + register WebRtc_Word32 state4 = filtState[4]; + register WebRtc_Word32 state5 = filtState[5]; + register WebRtc_Word32 state6 = filtState[6]; + register WebRtc_Word32 state7 = filtState[7]; + + for (i = (len >> 1); i > 0; i--) { + // lower allpass filter + in32 = (WebRtc_Word32)(*in++) << 10; + diff = in32 - state1; + tmp1 = MUL_ACCUM_1(kResampleAllpass2[0], diff, state0); + state0 = in32; + diff = tmp1 - state2; + tmp2 = MUL_ACCUM_2(kResampleAllpass2[1], diff, state1); + state1 = tmp1; + diff = tmp2 - state3; + state3 = MUL_ACCUM_2(kResampleAllpass2[2], diff, state2); + state2 = tmp2; + + // upper allpass filter + in32 = (WebRtc_Word32)(*in++) << 10; + diff = in32 - state5; + tmp1 = MUL_ACCUM_1(kResampleAllpass1[0], diff, state4); + state4 = in32; + diff = tmp1 - state6; + tmp2 = MUL_ACCUM_1(kResampleAllpass1[1], diff, state5); + state5 = tmp1; + diff = tmp2 - state7; + state7 = MUL_ACCUM_2(kResampleAllpass1[2], diff, state6); + state6 = tmp2; + + // add two allpass outputs, divide by two and round + out32 = (state3 + state7 + 1024) >> 11; + + // limit amplitude to prevent wrap-around, and write to output array + *out++ = WebRtcSpl_SatW32ToW16(out32); + } + + filtState[0] = state0; + filtState[1] = state1; + filtState[2] = state2; + filtState[3] = state3; + filtState[4] = state4; + filtState[5] = state5; + filtState[6] = state6; + filtState[7] = state7; +} + + +void WebRtcSpl_UpsampleBy2(const WebRtc_Word16* in, WebRtc_Word16 len, + WebRtc_Word16* out, WebRtc_Word32* filtState) { + WebRtc_Word32 tmp1, tmp2, diff, in32, out32; + WebRtc_Word16 i; + + register WebRtc_Word32 state0 = filtState[0]; + register WebRtc_Word32 state1 = filtState[1]; + register WebRtc_Word32 state2 = filtState[2]; + register WebRtc_Word32 state3 = filtState[3]; + register WebRtc_Word32 state4 = filtState[4]; + register WebRtc_Word32 state5 = filtState[5]; + register WebRtc_Word32 state6 = filtState[6]; + register WebRtc_Word32 state7 = filtState[7]; + + for (i = len; i > 0; i--) { + // lower allpass filter + in32 = (WebRtc_Word32)(*in++) << 10; + diff = in32 - state1; + tmp1 = MUL_ACCUM_1(kResampleAllpass1[0], diff, state0); + state0 = in32; + diff = tmp1 - state2; + tmp2 = MUL_ACCUM_1(kResampleAllpass1[1], diff, state1); + state1 = tmp1; + diff = tmp2 - state3; + state3 = MUL_ACCUM_2(kResampleAllpass1[2], diff, state2); + state2 = tmp2; + + // round; limit amplitude to prevent wrap-around; write to output array + out32 = (state3 + 512) >> 10; + *out++ = WebRtcSpl_SatW32ToW16(out32); + + // upper allpass filter + diff = in32 - state5; + tmp1 = MUL_ACCUM_1(kResampleAllpass2[0], diff, state4); + state4 = in32; + diff = tmp1 - state6; + tmp2 = MUL_ACCUM_2(kResampleAllpass2[1], diff, state5); + state5 = tmp1; + diff = tmp2 - state7; + state7 = MUL_ACCUM_2(kResampleAllpass2[2], diff, state6); + state6 = tmp2; + + // round; limit amplitude to prevent wrap-around; write to output array + out32 = (state7 + 512) >> 10; + *out++ = WebRtcSpl_SatW32ToW16(out32); + } + + filtState[0] = state0; + filtState[1] = state1; + filtState[2] = state2; + filtState[3] = state3; + filtState[4] = state4; + filtState[5] = state5; + filtState[6] = state6; + filtState[7] = state7; +} diff --git a/src/mod/codecs/mod_isac/resample_by_2_internal.c b/src/mod/codecs/mod_isac/resample_by_2_internal.c new file mode 100644 index 0000000000..cbd2395803 --- /dev/null +++ b/src/mod/codecs/mod_isac/resample_by_2_internal.c @@ -0,0 +1,679 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This header file contains some internal resampling functions. + * + */ + +#include "resample_by_2_internal.h" + +// allpass filter coefficients. +static const WebRtc_Word16 kResampleAllpass[2][3] = { + {821, 6110, 12382}, + {3050, 9368, 15063} +}; + +// +// decimator +// input: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) OVERWRITTEN! +// output: WebRtc_Word16 (saturated) (of length len/2) +// state: filter state array; length = 8 + +void WebRtcSpl_DownBy2IntToShort(WebRtc_Word32 *in, WebRtc_Word32 len, WebRtc_Word16 *out, + WebRtc_Word32 *state) +{ + WebRtc_Word32 tmp0, tmp1, diff; + WebRtc_Word32 i; + + len >>= 1; + + // lower allpass filter (operates on even input samples) + for (i = 0; i < len; i++) + { + tmp0 = in[i << 1]; + diff = tmp0 - state[1]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[0] + diff * kResampleAllpass[1][0]; + state[0] = tmp0; + diff = tmp1 - state[2]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[1] + diff * kResampleAllpass[1][1]; + state[1] = tmp1; + diff = tmp0 - state[3]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[3] = state[2] + diff * kResampleAllpass[1][2]; + state[2] = tmp0; + + // divide by two and store temporarily + in[i << 1] = (state[3] >> 1); + } + + in++; + + // upper allpass filter (operates on odd input samples) + for (i = 0; i < len; i++) + { + tmp0 = in[i << 1]; + diff = tmp0 - state[5]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[4] + diff * kResampleAllpass[0][0]; + state[4] = tmp0; + diff = tmp1 - state[6]; + // scale down and round + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[5] + diff * kResampleAllpass[0][1]; + state[5] = tmp1; + diff = tmp0 - state[7]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[7] = state[6] + diff * kResampleAllpass[0][2]; + state[6] = tmp0; + + // divide by two and store temporarily + in[i << 1] = (state[7] >> 1); + } + + in--; + + // combine allpass outputs + for (i = 0; i < len; i += 2) + { + // divide by two, add both allpass outputs and round + tmp0 = (in[i << 1] + in[(i << 1) + 1]) >> 15; + tmp1 = (in[(i << 1) + 2] + in[(i << 1) + 3]) >> 15; + if (tmp0 > (WebRtc_Word32)0x00007FFF) + tmp0 = 0x00007FFF; + if (tmp0 < (WebRtc_Word32)0xFFFF8000) + tmp0 = 0xFFFF8000; + out[i] = (WebRtc_Word16)tmp0; + if (tmp1 > (WebRtc_Word32)0x00007FFF) + tmp1 = 0x00007FFF; + if (tmp1 < (WebRtc_Word32)0xFFFF8000) + tmp1 = 0xFFFF8000; + out[i + 1] = (WebRtc_Word16)tmp1; + } +} + +// +// decimator +// input: WebRtc_Word16 +// output: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) (of length len/2) +// state: filter state array; length = 8 + +void WebRtcSpl_DownBy2ShortToInt(const WebRtc_Word16 *in, + WebRtc_Word32 len, + WebRtc_Word32 *out, + WebRtc_Word32 *state) +{ + WebRtc_Word32 tmp0, tmp1, diff; + WebRtc_Word32 i; + + len >>= 1; + + // lower allpass filter (operates on even input samples) + for (i = 0; i < len; i++) + { + tmp0 = ((WebRtc_Word32)in[i << 1] << 15) + (1 << 14); + diff = tmp0 - state[1]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[0] + diff * kResampleAllpass[1][0]; + state[0] = tmp0; + diff = tmp1 - state[2]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[1] + diff * kResampleAllpass[1][1]; + state[1] = tmp1; + diff = tmp0 - state[3]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[3] = state[2] + diff * kResampleAllpass[1][2]; + state[2] = tmp0; + + // divide by two and store temporarily + out[i] = (state[3] >> 1); + } + + in++; + + // upper allpass filter (operates on odd input samples) + for (i = 0; i < len; i++) + { + tmp0 = ((WebRtc_Word32)in[i << 1] << 15) + (1 << 14); + diff = tmp0 - state[5]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[4] + diff * kResampleAllpass[0][0]; + state[4] = tmp0; + diff = tmp1 - state[6]; + // scale down and round + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[5] + diff * kResampleAllpass[0][1]; + state[5] = tmp1; + diff = tmp0 - state[7]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[7] = state[6] + diff * kResampleAllpass[0][2]; + state[6] = tmp0; + + // divide by two and store temporarily + out[i] += (state[7] >> 1); + } + + in--; +} + +// +// interpolator +// input: WebRtc_Word16 +// output: WebRtc_Word32 (normalized, not saturated) (of length len*2) +// state: filter state array; length = 8 +void WebRtcSpl_UpBy2ShortToInt(const WebRtc_Word16 *in, WebRtc_Word32 len, WebRtc_Word32 *out, + WebRtc_Word32 *state) +{ + WebRtc_Word32 tmp0, tmp1, diff; + WebRtc_Word32 i; + + // upper allpass filter (generates odd output samples) + for (i = 0; i < len; i++) + { + tmp0 = ((WebRtc_Word32)in[i] << 15) + (1 << 14); + diff = tmp0 - state[5]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[4] + diff * kResampleAllpass[0][0]; + state[4] = tmp0; + diff = tmp1 - state[6]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[5] + diff * kResampleAllpass[0][1]; + state[5] = tmp1; + diff = tmp0 - state[7]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[7] = state[6] + diff * kResampleAllpass[0][2]; + state[6] = tmp0; + + // scale down, round and store + out[i << 1] = state[7] >> 15; + } + + out++; + + // lower allpass filter (generates even output samples) + for (i = 0; i < len; i++) + { + tmp0 = ((WebRtc_Word32)in[i] << 15) + (1 << 14); + diff = tmp0 - state[1]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[0] + diff * kResampleAllpass[1][0]; + state[0] = tmp0; + diff = tmp1 - state[2]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[1] + diff * kResampleAllpass[1][1]; + state[1] = tmp1; + diff = tmp0 - state[3]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[3] = state[2] + diff * kResampleAllpass[1][2]; + state[2] = tmp0; + + // scale down, round and store + out[i << 1] = state[3] >> 15; + } +} + +// +// interpolator +// input: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) +// output: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) (of length len*2) +// state: filter state array; length = 8 +void WebRtcSpl_UpBy2IntToInt(const WebRtc_Word32 *in, WebRtc_Word32 len, WebRtc_Word32 *out, + WebRtc_Word32 *state) +{ + WebRtc_Word32 tmp0, tmp1, diff; + WebRtc_Word32 i; + + // upper allpass filter (generates odd output samples) + for (i = 0; i < len; i++) + { + tmp0 = in[i]; + diff = tmp0 - state[5]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[4] + diff * kResampleAllpass[0][0]; + state[4] = tmp0; + diff = tmp1 - state[6]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[5] + diff * kResampleAllpass[0][1]; + state[5] = tmp1; + diff = tmp0 - state[7]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[7] = state[6] + diff * kResampleAllpass[0][2]; + state[6] = tmp0; + + // scale down, round and store + out[i << 1] = state[7]; + } + + out++; + + // lower allpass filter (generates even output samples) + for (i = 0; i < len; i++) + { + tmp0 = in[i]; + diff = tmp0 - state[1]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[0] + diff * kResampleAllpass[1][0]; + state[0] = tmp0; + diff = tmp1 - state[2]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[1] + diff * kResampleAllpass[1][1]; + state[1] = tmp1; + diff = tmp0 - state[3]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[3] = state[2] + diff * kResampleAllpass[1][2]; + state[2] = tmp0; + + // scale down, round and store + out[i << 1] = state[3]; + } +} + +// +// interpolator +// input: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) +// output: WebRtc_Word16 (saturated) (of length len*2) +// state: filter state array; length = 8 +void WebRtcSpl_UpBy2IntToShort(const WebRtc_Word32 *in, WebRtc_Word32 len, WebRtc_Word16 *out, + WebRtc_Word32 *state) +{ + WebRtc_Word32 tmp0, tmp1, diff; + WebRtc_Word32 i; + + // upper allpass filter (generates odd output samples) + for (i = 0; i < len; i++) + { + tmp0 = in[i]; + diff = tmp0 - state[5]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[4] + diff * kResampleAllpass[0][0]; + state[4] = tmp0; + diff = tmp1 - state[6]; + // scale down and round + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[5] + diff * kResampleAllpass[0][1]; + state[5] = tmp1; + diff = tmp0 - state[7]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[7] = state[6] + diff * kResampleAllpass[0][2]; + state[6] = tmp0; + + // scale down, saturate and store + tmp1 = state[7] >> 15; + if (tmp1 > (WebRtc_Word32)0x00007FFF) + tmp1 = 0x00007FFF; + if (tmp1 < (WebRtc_Word32)0xFFFF8000) + tmp1 = 0xFFFF8000; + out[i << 1] = (WebRtc_Word16)tmp1; + } + + out++; + + // lower allpass filter (generates even output samples) + for (i = 0; i < len; i++) + { + tmp0 = in[i]; + diff = tmp0 - state[1]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[0] + diff * kResampleAllpass[1][0]; + state[0] = tmp0; + diff = tmp1 - state[2]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[1] + diff * kResampleAllpass[1][1]; + state[1] = tmp1; + diff = tmp0 - state[3]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[3] = state[2] + diff * kResampleAllpass[1][2]; + state[2] = tmp0; + + // scale down, saturate and store + tmp1 = state[3] >> 15; + if (tmp1 > (WebRtc_Word32)0x00007FFF) + tmp1 = 0x00007FFF; + if (tmp1 < (WebRtc_Word32)0xFFFF8000) + tmp1 = 0xFFFF8000; + out[i << 1] = (WebRtc_Word16)tmp1; + } +} + +// lowpass filter +// input: WebRtc_Word16 +// output: WebRtc_Word32 (normalized, not saturated) +// state: filter state array; length = 8 +void WebRtcSpl_LPBy2ShortToInt(const WebRtc_Word16* in, WebRtc_Word32 len, WebRtc_Word32* out, + WebRtc_Word32* state) +{ + WebRtc_Word32 tmp0, tmp1, diff; + WebRtc_Word32 i; + + len >>= 1; + + // lower allpass filter: odd input -> even output samples + in++; + // initial state of polyphase delay element + tmp0 = state[12]; + for (i = 0; i < len; i++) + { + diff = tmp0 - state[1]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[0] + diff * kResampleAllpass[1][0]; + state[0] = tmp0; + diff = tmp1 - state[2]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[1] + diff * kResampleAllpass[1][1]; + state[1] = tmp1; + diff = tmp0 - state[3]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[3] = state[2] + diff * kResampleAllpass[1][2]; + state[2] = tmp0; + + // scale down, round and store + out[i << 1] = state[3] >> 1; + tmp0 = ((WebRtc_Word32)in[i << 1] << 15) + (1 << 14); + } + in--; + + // upper allpass filter: even input -> even output samples + for (i = 0; i < len; i++) + { + tmp0 = ((WebRtc_Word32)in[i << 1] << 15) + (1 << 14); + diff = tmp0 - state[5]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[4] + diff * kResampleAllpass[0][0]; + state[4] = tmp0; + diff = tmp1 - state[6]; + // scale down and round + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[5] + diff * kResampleAllpass[0][1]; + state[5] = tmp1; + diff = tmp0 - state[7]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[7] = state[6] + diff * kResampleAllpass[0][2]; + state[6] = tmp0; + + // average the two allpass outputs, scale down and store + out[i << 1] = (out[i << 1] + (state[7] >> 1)) >> 15; + } + + // switch to odd output samples + out++; + + // lower allpass filter: even input -> odd output samples + for (i = 0; i < len; i++) + { + tmp0 = ((WebRtc_Word32)in[i << 1] << 15) + (1 << 14); + diff = tmp0 - state[9]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[8] + diff * kResampleAllpass[1][0]; + state[8] = tmp0; + diff = tmp1 - state[10]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[9] + diff * kResampleAllpass[1][1]; + state[9] = tmp1; + diff = tmp0 - state[11]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[11] = state[10] + diff * kResampleAllpass[1][2]; + state[10] = tmp0; + + // scale down, round and store + out[i << 1] = state[11] >> 1; + } + + // upper allpass filter: odd input -> odd output samples + in++; + for (i = 0; i < len; i++) + { + tmp0 = ((WebRtc_Word32)in[i << 1] << 15) + (1 << 14); + diff = tmp0 - state[13]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[12] + diff * kResampleAllpass[0][0]; + state[12] = tmp0; + diff = tmp1 - state[14]; + // scale down and round + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[13] + diff * kResampleAllpass[0][1]; + state[13] = tmp1; + diff = tmp0 - state[15]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[15] = state[14] + diff * kResampleAllpass[0][2]; + state[14] = tmp0; + + // average the two allpass outputs, scale down and store + out[i << 1] = (out[i << 1] + (state[15] >> 1)) >> 15; + } +} + +// lowpass filter +// input: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) +// output: WebRtc_Word32 (normalized, not saturated) +// state: filter state array; length = 8 +void WebRtcSpl_LPBy2IntToInt(const WebRtc_Word32* in, WebRtc_Word32 len, WebRtc_Word32* out, + WebRtc_Word32* state) +{ + WebRtc_Word32 tmp0, tmp1, diff; + WebRtc_Word32 i; + + len >>= 1; + + // lower allpass filter: odd input -> even output samples + in++; + // initial state of polyphase delay element + tmp0 = state[12]; + for (i = 0; i < len; i++) + { + diff = tmp0 - state[1]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[0] + diff * kResampleAllpass[1][0]; + state[0] = tmp0; + diff = tmp1 - state[2]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[1] + diff * kResampleAllpass[1][1]; + state[1] = tmp1; + diff = tmp0 - state[3]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[3] = state[2] + diff * kResampleAllpass[1][2]; + state[2] = tmp0; + + // scale down, round and store + out[i << 1] = state[3] >> 1; + tmp0 = in[i << 1]; + } + in--; + + // upper allpass filter: even input -> even output samples + for (i = 0; i < len; i++) + { + tmp0 = in[i << 1]; + diff = tmp0 - state[5]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[4] + diff * kResampleAllpass[0][0]; + state[4] = tmp0; + diff = tmp1 - state[6]; + // scale down and round + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[5] + diff * kResampleAllpass[0][1]; + state[5] = tmp1; + diff = tmp0 - state[7]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[7] = state[6] + diff * kResampleAllpass[0][2]; + state[6] = tmp0; + + // average the two allpass outputs, scale down and store + out[i << 1] = (out[i << 1] + (state[7] >> 1)) >> 15; + } + + // switch to odd output samples + out++; + + // lower allpass filter: even input -> odd output samples + for (i = 0; i < len; i++) + { + tmp0 = in[i << 1]; + diff = tmp0 - state[9]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[8] + diff * kResampleAllpass[1][0]; + state[8] = tmp0; + diff = tmp1 - state[10]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[9] + diff * kResampleAllpass[1][1]; + state[9] = tmp1; + diff = tmp0 - state[11]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[11] = state[10] + diff * kResampleAllpass[1][2]; + state[10] = tmp0; + + // scale down, round and store + out[i << 1] = state[11] >> 1; + } + + // upper allpass filter: odd input -> odd output samples + in++; + for (i = 0; i < len; i++) + { + tmp0 = in[i << 1]; + diff = tmp0 - state[13]; + // scale down and round + diff = (diff + (1 << 13)) >> 14; + tmp1 = state[12] + diff * kResampleAllpass[0][0]; + state[12] = tmp0; + diff = tmp1 - state[14]; + // scale down and round + diff = diff >> 14; + if (diff < 0) + diff += 1; + tmp0 = state[13] + diff * kResampleAllpass[0][1]; + state[13] = tmp1; + diff = tmp0 - state[15]; + // scale down and truncate + diff = diff >> 14; + if (diff < 0) + diff += 1; + state[15] = state[14] + diff * kResampleAllpass[0][2]; + state[14] = tmp0; + + // average the two allpass outputs, scale down and store + out[i << 1] = (out[i << 1] + (state[15] >> 1)) >> 15; + } +} diff --git a/src/mod/codecs/mod_isac/resample_by_2_internal.h b/src/mod/codecs/mod_isac/resample_by_2_internal.h new file mode 100644 index 0000000000..b6ac9f0cb4 --- /dev/null +++ b/src/mod/codecs/mod_isac/resample_by_2_internal.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This header file contains some internal resampling functions. + * + */ + +#ifndef WEBRTC_SPL_RESAMPLE_BY_2_INTERNAL_H_ +#define WEBRTC_SPL_RESAMPLE_BY_2_INTERNAL_H_ + +#include "typedefs.h" + +/******************************************************************* + * resample_by_2_fast.c + * Functions for internal use in the other resample functions + ******************************************************************/ +void WebRtcSpl_DownBy2IntToShort(WebRtc_Word32 *in, WebRtc_Word32 len, WebRtc_Word16 *out, + WebRtc_Word32 *state); + +void WebRtcSpl_DownBy2ShortToInt(const WebRtc_Word16 *in, WebRtc_Word32 len, + WebRtc_Word32 *out, WebRtc_Word32 *state); + +void WebRtcSpl_UpBy2ShortToInt(const WebRtc_Word16 *in, WebRtc_Word32 len, + WebRtc_Word32 *out, WebRtc_Word32 *state); + +void WebRtcSpl_UpBy2IntToInt(const WebRtc_Word32 *in, WebRtc_Word32 len, WebRtc_Word32 *out, + WebRtc_Word32 *state); + +void WebRtcSpl_UpBy2IntToShort(const WebRtc_Word32 *in, WebRtc_Word32 len, + WebRtc_Word16 *out, WebRtc_Word32 *state); + +void WebRtcSpl_LPBy2ShortToInt(const WebRtc_Word16* in, WebRtc_Word32 len, + WebRtc_Word32* out, WebRtc_Word32* state); + +void WebRtcSpl_LPBy2IntToInt(const WebRtc_Word32* in, WebRtc_Word32 len, WebRtc_Word32* out, + WebRtc_Word32* state); + +#endif // WEBRTC_SPL_RESAMPLE_BY_2_INTERNAL_H_ diff --git a/src/mod/codecs/mod_isac/resample_fractional.c b/src/mod/codecs/mod_isac/resample_fractional.c new file mode 100644 index 0000000000..51003d45d7 --- /dev/null +++ b/src/mod/codecs/mod_isac/resample_fractional.c @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the resampling functions between 48, 44, 32 and 24 kHz. + * The description headers can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +// interpolation coefficients +static const WebRtc_Word16 kCoefficients48To32[2][8] = { + {778, -2050, 1087, 23285, 12903, -3783, 441, 222}, + {222, 441, -3783, 12903, 23285, 1087, -2050, 778} +}; + +static const WebRtc_Word16 kCoefficients32To24[3][8] = { + {767, -2362, 2434, 24406, 10620, -3838, 721, 90}, + {386, -381, -2646, 19062, 19062, -2646, -381, 386}, + {90, 721, -3838, 10620, 24406, 2434, -2362, 767} +}; + +static const WebRtc_Word16 kCoefficients44To32[4][9] = { + {117, -669, 2245, -6183, 26267, 13529, -3245, 845, -138}, + {-101, 612, -2283, 8532, 29790, -5138, 1789, -524, 91}, + {50, -292, 1016, -3064, 32010, 3933, -1147, 315, -53}, + {-156, 974, -3863, 18603, 21691, -6246, 2353, -712, 126} +}; + +// Resampling ratio: 2/3 +// input: WebRtc_Word32 (normalized, not saturated) :: size 3 * K +// output: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) :: size 2 * K +// K: number of blocks + +void WebRtcSpl_Resample48khzTo32khz(const WebRtc_Word32 *In, WebRtc_Word32 *Out, + const WebRtc_Word32 K) +{ + ///////////////////////////////////////////////////////////// + // Filter operation: + // + // Perform resampling (3 input samples -> 2 output samples); + // process in sub blocks of size 3 samples. + WebRtc_Word32 tmp; + WebRtc_Word32 m; + + for (m = 0; m < K; m++) + { + tmp = 1 << 14; + tmp += kCoefficients48To32[0][0] * In[0]; + tmp += kCoefficients48To32[0][1] * In[1]; + tmp += kCoefficients48To32[0][2] * In[2]; + tmp += kCoefficients48To32[0][3] * In[3]; + tmp += kCoefficients48To32[0][4] * In[4]; + tmp += kCoefficients48To32[0][5] * In[5]; + tmp += kCoefficients48To32[0][6] * In[6]; + tmp += kCoefficients48To32[0][7] * In[7]; + Out[0] = tmp; + + tmp = 1 << 14; + tmp += kCoefficients48To32[1][0] * In[1]; + tmp += kCoefficients48To32[1][1] * In[2]; + tmp += kCoefficients48To32[1][2] * In[3]; + tmp += kCoefficients48To32[1][3] * In[4]; + tmp += kCoefficients48To32[1][4] * In[5]; + tmp += kCoefficients48To32[1][5] * In[6]; + tmp += kCoefficients48To32[1][6] * In[7]; + tmp += kCoefficients48To32[1][7] * In[8]; + Out[1] = tmp; + + // update pointers + In += 3; + Out += 2; + } +} + +// Resampling ratio: 3/4 +// input: WebRtc_Word32 (normalized, not saturated) :: size 4 * K +// output: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) :: size 3 * K +// K: number of blocks + +void WebRtcSpl_Resample32khzTo24khz(const WebRtc_Word32 *In, WebRtc_Word32 *Out, + const WebRtc_Word32 K) +{ + ///////////////////////////////////////////////////////////// + // Filter operation: + // + // Perform resampling (4 input samples -> 3 output samples); + // process in sub blocks of size 4 samples. + WebRtc_Word32 m; + WebRtc_Word32 tmp; + + for (m = 0; m < K; m++) + { + tmp = 1 << 14; + tmp += kCoefficients32To24[0][0] * In[0]; + tmp += kCoefficients32To24[0][1] * In[1]; + tmp += kCoefficients32To24[0][2] * In[2]; + tmp += kCoefficients32To24[0][3] * In[3]; + tmp += kCoefficients32To24[0][4] * In[4]; + tmp += kCoefficients32To24[0][5] * In[5]; + tmp += kCoefficients32To24[0][6] * In[6]; + tmp += kCoefficients32To24[0][7] * In[7]; + Out[0] = tmp; + + tmp = 1 << 14; + tmp += kCoefficients32To24[1][0] * In[1]; + tmp += kCoefficients32To24[1][1] * In[2]; + tmp += kCoefficients32To24[1][2] * In[3]; + tmp += kCoefficients32To24[1][3] * In[4]; + tmp += kCoefficients32To24[1][4] * In[5]; + tmp += kCoefficients32To24[1][5] * In[6]; + tmp += kCoefficients32To24[1][6] * In[7]; + tmp += kCoefficients32To24[1][7] * In[8]; + Out[1] = tmp; + + tmp = 1 << 14; + tmp += kCoefficients32To24[2][0] * In[2]; + tmp += kCoefficients32To24[2][1] * In[3]; + tmp += kCoefficients32To24[2][2] * In[4]; + tmp += kCoefficients32To24[2][3] * In[5]; + tmp += kCoefficients32To24[2][4] * In[6]; + tmp += kCoefficients32To24[2][5] * In[7]; + tmp += kCoefficients32To24[2][6] * In[8]; + tmp += kCoefficients32To24[2][7] * In[9]; + Out[2] = tmp; + + // update pointers + In += 4; + Out += 3; + } +} + +// +// fractional resampling filters +// Fout = 11/16 * Fin +// Fout = 8/11 * Fin +// + +// compute two inner-products and store them to output array +static void WebRtcSpl_ResampDotProduct(const WebRtc_Word32 *in1, const WebRtc_Word32 *in2, + const WebRtc_Word16 *coef_ptr, WebRtc_Word32 *out1, + WebRtc_Word32 *out2) +{ + WebRtc_Word32 tmp1 = 16384; + WebRtc_Word32 tmp2 = 16384; + WebRtc_Word16 coef; + + coef = coef_ptr[0]; + tmp1 += coef * in1[0]; + tmp2 += coef * in2[-0]; + + coef = coef_ptr[1]; + tmp1 += coef * in1[1]; + tmp2 += coef * in2[-1]; + + coef = coef_ptr[2]; + tmp1 += coef * in1[2]; + tmp2 += coef * in2[-2]; + + coef = coef_ptr[3]; + tmp1 += coef * in1[3]; + tmp2 += coef * in2[-3]; + + coef = coef_ptr[4]; + tmp1 += coef * in1[4]; + tmp2 += coef * in2[-4]; + + coef = coef_ptr[5]; + tmp1 += coef * in1[5]; + tmp2 += coef * in2[-5]; + + coef = coef_ptr[6]; + tmp1 += coef * in1[6]; + tmp2 += coef * in2[-6]; + + coef = coef_ptr[7]; + tmp1 += coef * in1[7]; + tmp2 += coef * in2[-7]; + + coef = coef_ptr[8]; + *out1 = tmp1 + coef * in1[8]; + *out2 = tmp2 + coef * in2[-8]; +} + +// Resampling ratio: 8/11 +// input: WebRtc_Word32 (normalized, not saturated) :: size 11 * K +// output: WebRtc_Word32 (shifted 15 positions to the left, + offset 16384) :: size 8 * K +// K: number of blocks + +void WebRtcSpl_Resample44khzTo32khz(const WebRtc_Word32 *In, WebRtc_Word32 *Out, + const WebRtc_Word32 K) +{ + ///////////////////////////////////////////////////////////// + // Filter operation: + // + // Perform resampling (11 input samples -> 8 output samples); + // process in sub blocks of size 11 samples. + WebRtc_Word32 tmp; + WebRtc_Word32 m; + + for (m = 0; m < K; m++) + { + tmp = 1 << 14; + + // first output sample + Out[0] = ((WebRtc_Word32)In[3] << 15) + tmp; + + // sum and accumulate filter coefficients and input samples + tmp += kCoefficients44To32[3][0] * In[5]; + tmp += kCoefficients44To32[3][1] * In[6]; + tmp += kCoefficients44To32[3][2] * In[7]; + tmp += kCoefficients44To32[3][3] * In[8]; + tmp += kCoefficients44To32[3][4] * In[9]; + tmp += kCoefficients44To32[3][5] * In[10]; + tmp += kCoefficients44To32[3][6] * In[11]; + tmp += kCoefficients44To32[3][7] * In[12]; + tmp += kCoefficients44To32[3][8] * In[13]; + Out[4] = tmp; + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_ResampDotProduct(&In[0], &In[17], kCoefficients44To32[0], &Out[1], &Out[7]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_ResampDotProduct(&In[2], &In[15], kCoefficients44To32[1], &Out[2], &Out[6]); + + // sum and accumulate filter coefficients and input samples + WebRtcSpl_ResampDotProduct(&In[3], &In[14], kCoefficients44To32[2], &Out[3], &Out[5]); + + // update pointers + In += 11; + Out += 8; + } +} diff --git a/src/mod/codecs/mod_isac/settings.h b/src/mod/codecs/mod_isac/settings.h new file mode 100644 index 0000000000..b7aed77065 --- /dev/null +++ b/src/mod/codecs/mod_isac/settings.h @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * settings.h + * + * Declaration of #defines used in the iSAC codec + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_SETTINGS_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_SETTINGS_H_ + +/* sampling frequency (Hz) */ +#define FS 16000 + +/* number of samples per frame (either 320 (20ms), 480 (30ms) or 960 (60ms)) */ +#define INITIAL_FRAMESAMPLES 960 + + +#define MAXFFTSIZE 2048 +#define NFACTOR 11 + + + +/* do not modify the following; this will have to be modified if we have a 20ms framesize option */ +/*************************************************************************************************/ +/* miliseconds */ +#define FRAMESIZE 30 +/* number of samples per frame processed in the encoder, 480 */ +#define FRAMESAMPLES 480 /* ((FRAMESIZE*FS)/1000) */ +#define FRAMESAMPLES_HALF 240 +#define FRAMESAMPLES_QUARTER 120 +/*************************************************************************************************/ + + + +/* max number of samples per frame (= 60 ms frame) */ +#define MAX_FRAMESAMPLES 960 +#define MAX_SWBFRAMESAMPLES (MAX_FRAMESAMPLES * 2) +/* number of samples per 10ms frame */ +#define FRAMESAMPLES_10ms ((10*FS)/1000) +#define SWBFRAMESAMPLES_10ms (FRAMESAMPLES_10ms * 2) +/* number of samples in 30 ms frame */ +#define FRAMESAMPLES_30ms 480 +/* number of subframes */ +#define SUBFRAMES 6 +/* length of a subframe */ +#define UPDATE 80 +/* length of half a subframe (low/high band) */ +#define HALF_SUBFRAMELEN (UPDATE/2) +/* samples of look ahead (in a half-band, so actually half the samples of look ahead @ FS) */ +#define QLOOKAHEAD 24 /* 3 ms */ +/* order of AR model in spectral entropy coder */ +#define AR_ORDER 6 +/* order of LP model in spectral entropy coder */ +#define LP_ORDER 0 + +/* window length (masking analysis) */ +#define WINLEN 256 +/* order of low-band pole filter used to approximate masking curve */ +#define ORDERLO 12 +/* order of hi-band pole filter used to approximate masking curve */ +#define ORDERHI 6 + +#define UB_LPC_ORDER 4 +#define UB_LPC_VEC_PER_FRAME 2 +#define UB16_LPC_VEC_PER_FRAME 4 +#define UB_ACTIVE_SUBFRAMES 2 +#define UB_MAX_LPC_ORDER 6 +#define UB_INTERPOL_SEGMENTS 1 +#define UB16_INTERPOL_SEGMENTS 3 +#define LB_TOTAL_DELAY_SAMPLES 48 +enum ISACBandwidth {isac8kHz = 8, isac12kHz = 12, isac16kHz = 16}; +enum ISACBand{isacLowerBand = 0, isacUpperBand = 1}; +#define UB_LPC_GAIN_DIM SUBFRAMES +#define FB_STATE_SIZE_WORD32 6 + + +/* order for post_filter_bank */ +#define POSTQORDER 3 +/* order for pre-filterbank */ +#define QORDER 3 +/* another order */ +#define QORDER_ALL (POSTQORDER+QORDER-1) +/* for decimator */ +#define ALLPASSSECTIONS 2 + + +/* array size for byte stream in number of bytes. */ +#define STREAM_SIZE_MAX 600 /* The old maximum size still needed for the decoding */ +#define STREAM_SIZE_MAX_30 200 /* 200 bytes = 53.4 kbit/s @ 30 ms.framelength */ +#define STREAM_SIZE_MAX_60 400 /* 400 bytes = 53.4 kbit/s @ 60 ms.framelength */ + +/* storage size for bit counts */ +#define BIT_COUNTER_SIZE 30 +/* maximum order of any AR model or filter */ +#define MAX_AR_MODEL_ORDER 12//50 + + +/* For pitch analysis */ +#define PITCH_FRAME_LEN (FRAMESAMPLES_HALF) /* 30 ms */ +#define PITCH_MAX_LAG 140 /* 57 Hz */ +#define PITCH_MIN_LAG 20 /* 400 Hz */ +#define PITCH_MAX_GAIN 0.45 +#define PITCH_MAX_GAIN_06 0.27 /* PITCH_MAX_GAIN*0.6 */ +#define PITCH_MAX_GAIN_Q12 1843 +#define PITCH_LAG_SPAN2 (PITCH_MAX_LAG/2-PITCH_MIN_LAG/2+5) +#define PITCH_CORR_LEN2 60 /* 15 ms */ +#define PITCH_CORR_STEP2 (PITCH_FRAME_LEN/4) +#define PITCH_BW 11 /* half the band width of correlation surface */ +#define PITCH_SUBFRAMES 4 +#define PITCH_GRAN_PER_SUBFRAME 5 +#define PITCH_SUBFRAME_LEN (PITCH_FRAME_LEN/PITCH_SUBFRAMES) +#define PITCH_UPDATE (PITCH_SUBFRAME_LEN/PITCH_GRAN_PER_SUBFRAME) +/* maximum number of peaks to be examined in correlation surface */ +#define PITCH_MAX_NUM_PEAKS 10 +#define PITCH_PEAK_DECAY 0.85 +/* For weighting filter */ +#define PITCH_WLPCORDER 6 +#define PITCH_WLPCWINLEN PITCH_FRAME_LEN +#define PITCH_WLPCASYM 0.3 /* asymmetry parameter */ +#define PITCH_WLPCBUFLEN PITCH_WLPCWINLEN +/* For pitch filter */ +#define PITCH_BUFFSIZE (PITCH_MAX_LAG + 50) /* Extra 50 for fraction and LP filters */ +#define PITCH_INTBUFFSIZE (PITCH_FRAME_LEN+PITCH_BUFFSIZE) +/* Max rel. step for interpolation */ +#define PITCH_UPSTEP 1.5 +/* Max rel. step for interpolation */ +#define PITCH_DOWNSTEP 0.67 +#define PITCH_FRACS 8 +#define PITCH_FRACORDER 9 +#define PITCH_DAMPORDER 5 +#define PITCH_FILTDELAY 1.5f +/* stepsize for quantization of the pitch Gain */ +#define PITCH_GAIN_STEPSIZE 0.125 + + + +/* Order of high pass filter */ +#define HPORDER 2 + +/* some mathematical constants */ +#define LOG2EXP 1.44269504088896 /* log2(exp) */ +#define PI 3.14159265358979 + +/* Maximum number of iterations allowed to limit payload size */ +#define MAX_PAYLOAD_LIMIT_ITERATION 5 + +/* Redundant Coding */ +#define RCU_BOTTLENECK_BPS 16000 +#define RCU_TRANSCODING_SCALE 0.40f +#define RCU_TRANSCODING_SCALE_INVERSE 2.5f + +#define RCU_TRANSCODING_SCALE_UB 0.50f +#define RCU_TRANSCODING_SCALE_UB_INVERSE 2.0f + + +/* Define Error codes */ +/* 6000 General */ +#define ISAC_MEMORY_ALLOCATION_FAILED 6010 +#define ISAC_MODE_MISMATCH 6020 +#define ISAC_DISALLOWED_BOTTLENECK 6030 +#define ISAC_DISALLOWED_FRAME_LENGTH 6040 +#define ISAC_UNSUPPORTED_SAMPLING_FREQUENCY 6050 + +/* 6200 Bandwidth estimator */ +#define ISAC_RANGE_ERROR_BW_ESTIMATOR 6240 +/* 6400 Encoder */ +#define ISAC_ENCODER_NOT_INITIATED 6410 +#define ISAC_DISALLOWED_CODING_MODE 6420 +#define ISAC_DISALLOWED_FRAME_MODE_ENCODER 6430 +#define ISAC_DISALLOWED_BITSTREAM_LENGTH 6440 +#define ISAC_PAYLOAD_LARGER_THAN_LIMIT 6450 +#define ISAC_DISALLOWED_ENCODER_BANDWIDTH 6460 +/* 6600 Decoder */ +#define ISAC_DECODER_NOT_INITIATED 6610 +#define ISAC_EMPTY_PACKET 6620 +#define ISAC_DISALLOWED_FRAME_MODE_DECODER 6630 +#define ISAC_RANGE_ERROR_DECODE_FRAME_LENGTH 6640 +#define ISAC_RANGE_ERROR_DECODE_BANDWIDTH 6650 +#define ISAC_RANGE_ERROR_DECODE_PITCH_GAIN 6660 +#define ISAC_RANGE_ERROR_DECODE_PITCH_LAG 6670 +#define ISAC_RANGE_ERROR_DECODE_LPC 6680 +#define ISAC_RANGE_ERROR_DECODE_SPECTRUM 6690 +#define ISAC_LENGTH_MISMATCH 6730 +#define ISAC_RANGE_ERROR_DECODE_BANDWITH 6740 +#define ISAC_DISALLOWED_BANDWIDTH_MODE_DECODER 6750 +/* 6800 Call setup formats */ +#define ISAC_INCOMPATIBLE_FORMATS 6810 + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_SETTINGS_H_ */ diff --git a/src/mod/codecs/mod_isac/signal_processing_library.h b/src/mod/codecs/mod_isac/signal_processing_library.h new file mode 100644 index 0000000000..651a68c8b4 --- /dev/null +++ b/src/mod/codecs/mod_isac/signal_processing_library.h @@ -0,0 +1,1686 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This header file includes all of the fix point signal processing library (SPL) function + * descriptions and declarations. + * For specific function calls, see bottom of file. + */ + +#ifndef WEBRTC_SPL_SIGNAL_PROCESSING_LIBRARY_H_ +#define WEBRTC_SPL_SIGNAL_PROCESSING_LIBRARY_H_ + +#include +#include "typedefs.h" + +#ifdef ARM_WINM +#include // intrinsic file for windows mobile +#endif + +// Macros specific for the fixed point implementation +#define WEBRTC_SPL_WORD16_MAX 32767 +#define WEBRTC_SPL_WORD16_MIN -32768 +#define WEBRTC_SPL_WORD32_MAX (WebRtc_Word32)0x7fffffff +#define WEBRTC_SPL_WORD32_MIN (WebRtc_Word32)0x80000000 +#define WEBRTC_SPL_MAX_LPC_ORDER 14 +#define WEBRTC_SPL_MAX_SEED_USED 0x80000000L +#define WEBRTC_SPL_MIN(A, B) (A < B ? A : B) // Get min value +#define WEBRTC_SPL_MAX(A, B) (A > B ? A : B) // Get max value +#define WEBRTC_SPL_ABS_W16(a) \ + (((WebRtc_Word16)a >= 0) ? ((WebRtc_Word16)a) : -((WebRtc_Word16)a)) +#define WEBRTC_SPL_ABS_W32(a) \ + (((WebRtc_Word32)a >= 0) ? ((WebRtc_Word32)a) : -((WebRtc_Word32)a)) + +#if (defined WEBRTC_TARGET_PC)||(defined __TARGET_XSCALE) +#define WEBRTC_SPL_GET_BYTE(a, nr) (((WebRtc_Word8 *)a)[nr]) +#define WEBRTC_SPL_SET_BYTE(d_ptr, val, index) \ + (((WebRtc_Word8 *)d_ptr)[index] = (val)) +#elif defined WEBRTC_BIG_ENDIAN +#define WEBRTC_SPL_GET_BYTE(a, nr) \ + ((((WebRtc_Word16 *)a)[nr >> 1]) >> (((nr + 1) & 0x1) * 8) & 0x00ff) +#define WEBRTC_SPL_SET_BYTE(d_ptr, val, index) \ + ((WebRtc_Word16 *)d_ptr)[index >> 1] = \ + ((((WebRtc_Word16 *)d_ptr)[index >> 1]) \ + & (0x00ff << (8 * ((index) & 0x1)))) | (val << (8 * ((index + 1) & 0x1))) +#else +#define WEBRTC_SPL_GET_BYTE(a,nr) \ + ((((WebRtc_Word16 *)(a))[(nr) >> 1]) >> (((nr) & 0x1) * 8) & 0x00ff) +#define WEBRTC_SPL_SET_BYTE(d_ptr, val, index) \ + ((WebRtc_Word16 *)(d_ptr))[(index) >> 1] = \ + ((((WebRtc_Word16 *)(d_ptr))[(index) >> 1]) \ + & (0x00ff << (8 * (((index) + 1) & 0x1)))) | \ + ((val) << (8 * ((index) & 0x1))) +#endif + +#define WEBRTC_SPL_MUL(a, b) \ + ((WebRtc_Word32) ((WebRtc_Word32)(a) * (WebRtc_Word32)(b))) +#define WEBRTC_SPL_UMUL(a, b) \ + ((WebRtc_UWord32) ((WebRtc_UWord32)(a) * (WebRtc_UWord32)(b))) +#define WEBRTC_SPL_UMUL_RSFT16(a, b) \ + ((WebRtc_UWord32) ((WebRtc_UWord32)(a) * (WebRtc_UWord32)(b)) >> 16) +#define WEBRTC_SPL_UMUL_16_16(a, b) \ + ((WebRtc_UWord32) (WebRtc_UWord16)(a) * (WebRtc_UWord16)(b)) +#define WEBRTC_SPL_UMUL_16_16_RSFT16(a, b) \ + (((WebRtc_UWord32) (WebRtc_UWord16)(a) * (WebRtc_UWord16)(b)) >> 16) +#define WEBRTC_SPL_UMUL_32_16(a, b) \ + ((WebRtc_UWord32) ((WebRtc_UWord32)(a) * (WebRtc_UWord16)(b))) +#define WEBRTC_SPL_UMUL_32_16_RSFT16(a, b) \ + ((WebRtc_UWord32) ((WebRtc_UWord32)(a) * (WebRtc_UWord16)(b)) >> 16) +#define WEBRTC_SPL_MUL_16_U16(a, b) \ + ((WebRtc_Word32)(WebRtc_Word16)(a) * (WebRtc_UWord16)(b)) +#define WEBRTC_SPL_DIV(a, b) \ + ((WebRtc_Word32) ((WebRtc_Word32)(a) / (WebRtc_Word32)(b))) +#define WEBRTC_SPL_UDIV(a, b) \ + ((WebRtc_UWord32) ((WebRtc_UWord32)(a) / (WebRtc_UWord32)(b))) + +#ifndef WEBRTC_ARCH_ARM_V7A +// For ARMv7 platforms, these are inline functions in spl_inl_armv7.h +#define WEBRTC_SPL_MUL_16_16(a, b) \ + ((WebRtc_Word32) (((WebRtc_Word16)(a)) * ((WebRtc_Word16)(b)))) +#define WEBRTC_SPL_MUL_16_32_RSFT16(a, b) \ + (WEBRTC_SPL_MUL_16_16(a, b >> 16) \ + + ((WEBRTC_SPL_MUL_16_16(a, (b & 0xffff) >> 1) + 0x4000) >> 15)) +#define WEBRTC_SPL_MUL_32_32_RSFT32(a32a, a32b, b32) \ + ((WebRtc_Word32)(WEBRTC_SPL_MUL_16_32_RSFT16(a32a, b32) \ + + (WEBRTC_SPL_MUL_16_32_RSFT16(a32b, b32) >> 16))) +#define WEBRTC_SPL_MUL_32_32_RSFT32BI(a32, b32) \ + ((WebRtc_Word32)(WEBRTC_SPL_MUL_16_32_RSFT16(( \ + (WebRtc_Word16)(a32 >> 16)), b32) + \ + (WEBRTC_SPL_MUL_16_32_RSFT16(( \ + (WebRtc_Word16)((a32 & 0x0000FFFF) >> 1)), b32) >> 15))) +#endif + +#define WEBRTC_SPL_MUL_16_32_RSFT11(a, b) \ + ((WEBRTC_SPL_MUL_16_16(a, (b) >> 16) << 5) \ + + (((WEBRTC_SPL_MUL_16_U16(a, (WebRtc_UWord16)(b)) >> 1) + 0x0200) >> 10)) +#define WEBRTC_SPL_MUL_16_32_RSFT14(a, b) \ + ((WEBRTC_SPL_MUL_16_16(a, (b) >> 16) << 2) \ + + (((WEBRTC_SPL_MUL_16_U16(a, (WebRtc_UWord16)(b)) >> 1) + 0x1000) >> 13)) +#define WEBRTC_SPL_MUL_16_32_RSFT15(a, b) \ + ((WEBRTC_SPL_MUL_16_16(a, (b) >> 16) << 1) \ + + (((WEBRTC_SPL_MUL_16_U16(a, (WebRtc_UWord16)(b)) >> 1) + 0x2000) >> 14)) + +#ifdef ARM_WINM +#define WEBRTC_SPL_MUL_16_16(a, b) \ + _SmulLo_SW_SL((WebRtc_Word16)(a), (WebRtc_Word16)(b)) +#endif + +#define WEBRTC_SPL_MUL_16_16_RSFT(a, b, c) \ + (WEBRTC_SPL_MUL_16_16(a, b) >> (c)) + +#define WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(a, b, c) \ + ((WEBRTC_SPL_MUL_16_16(a, b) + ((WebRtc_Word32) \ + (((WebRtc_Word32)1) << ((c) - 1)))) >> (c)) +#define WEBRTC_SPL_MUL_16_16_RSFT_WITH_FIXROUND(a, b) \ + ((WEBRTC_SPL_MUL_16_16(a, b) + ((WebRtc_Word32) (1 << 14))) >> 15) + +// C + the 32 most significant bits of A * B +#define WEBRTC_SPL_SCALEDIFF32(A, B, C) \ + (C + (B >> 16) * A + (((WebRtc_UWord32)(0x0000FFFF & B) * A) >> 16)) + +#define WEBRTC_SPL_ADD_SAT_W32(a, b) WebRtcSpl_AddSatW32(a, b) +#define WEBRTC_SPL_SAT(a, b, c) (b > a ? a : b < c ? c : b) +#define WEBRTC_SPL_MUL_32_16(a, b) ((a) * (b)) + +#define WEBRTC_SPL_SUB_SAT_W32(a, b) WebRtcSpl_SubSatW32(a, b) +#define WEBRTC_SPL_ADD_SAT_W16(a, b) WebRtcSpl_AddSatW16(a, b) +#define WEBRTC_SPL_SUB_SAT_W16(a, b) WebRtcSpl_SubSatW16(a, b) + +// We cannot do casting here due to signed/unsigned problem +#define WEBRTC_SPL_IS_NEG(a) ((a) & 0x80000000) +// Shifting with negative numbers allowed +// Positive means left shift +#define WEBRTC_SPL_SHIFT_W16(x, c) \ + (((c) >= 0) ? ((x) << (c)) : ((x) >> (-(c)))) +#define WEBRTC_SPL_SHIFT_W32(x, c) \ + (((c) >= 0) ? ((x) << (c)) : ((x) >> (-(c)))) + +// Shifting with negative numbers not allowed +// We cannot do casting here due to signed/unsigned problem +#define WEBRTC_SPL_RSHIFT_W16(x, c) ((x) >> (c)) +#define WEBRTC_SPL_LSHIFT_W16(x, c) ((x) << (c)) +#define WEBRTC_SPL_RSHIFT_W32(x, c) ((x) >> (c)) +#define WEBRTC_SPL_LSHIFT_W32(x, c) ((x) << (c)) + +#define WEBRTC_SPL_RSHIFT_U16(x, c) ((WebRtc_UWord16)(x) >> (c)) +#define WEBRTC_SPL_LSHIFT_U16(x, c) ((WebRtc_UWord16)(x) << (c)) +#define WEBRTC_SPL_RSHIFT_U32(x, c) ((WebRtc_UWord32)(x) >> (c)) +#define WEBRTC_SPL_LSHIFT_U32(x, c) ((WebRtc_UWord32)(x) << (c)) + +#define WEBRTC_SPL_VNEW(t, n) (t *) malloc (sizeof (t) * (n)) +#define WEBRTC_SPL_FREE free + +#define WEBRTC_SPL_RAND(a) \ + ((WebRtc_Word16)(WEBRTC_SPL_MUL_16_16_RSFT((a), 18816, 7) & 0x00007fff)) + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define WEBRTC_SPL_MEMCPY_W8(v1, v2, length) \ + memcpy(v1, v2, (length) * sizeof(char)) +#define WEBRTC_SPL_MEMCPY_W16(v1, v2, length) \ + memcpy(v1, v2, (length) * sizeof(WebRtc_Word16)) + +#define WEBRTC_SPL_MEMMOVE_W16(v1, v2, length) \ + memmove(v1, v2, (length) * sizeof(WebRtc_Word16)) + +// inline functions: +#include "spl_inl.h" + +// Get SPL Version +WebRtc_Word16 WebRtcSpl_get_version(char* version, + WebRtc_Word16 length_in_bytes); + +int WebRtcSpl_GetScalingSquare(WebRtc_Word16* in_vector, + int in_vector_length, + int times); + +// Copy and set operations. Implementation in copy_set_operations.c. +// Descriptions at bottom of file. +void WebRtcSpl_MemSetW16(WebRtc_Word16* vector, + WebRtc_Word16 set_value, + int vector_length); +void WebRtcSpl_MemSetW32(WebRtc_Word32* vector, + WebRtc_Word32 set_value, + int vector_length); +void WebRtcSpl_MemCpyReversedOrder(WebRtc_Word16* out_vector, + WebRtc_Word16* in_vector, + int vector_length); +WebRtc_Word16 WebRtcSpl_CopyFromEndW16(G_CONST WebRtc_Word16* in_vector, + WebRtc_Word16 in_vector_length, + WebRtc_Word16 samples, + WebRtc_Word16* out_vector); +WebRtc_Word16 WebRtcSpl_ZerosArrayW16(WebRtc_Word16* vector, + WebRtc_Word16 vector_length); +WebRtc_Word16 WebRtcSpl_ZerosArrayW32(WebRtc_Word32* vector, + WebRtc_Word16 vector_length); +WebRtc_Word16 WebRtcSpl_OnesArrayW16(WebRtc_Word16* vector, + WebRtc_Word16 vector_length); +WebRtc_Word16 WebRtcSpl_OnesArrayW32(WebRtc_Word32* vector, + WebRtc_Word16 vector_length); +// End: Copy and set operations. + +// Minimum and maximum operations. Implementation in min_max_operations.c. +// Descriptions at bottom of file. +WebRtc_Word16 WebRtcSpl_MaxAbsValueW16(const WebRtc_Word16* vector, + WebRtc_Word16 length); +WebRtc_Word32 WebRtcSpl_MaxAbsValueW32(G_CONST WebRtc_Word32* vector, + WebRtc_Word16 length); +WebRtc_Word16 WebRtcSpl_MinValueW16(G_CONST WebRtc_Word16* vector, + WebRtc_Word16 length); +WebRtc_Word32 WebRtcSpl_MinValueW32(G_CONST WebRtc_Word32* vector, + WebRtc_Word16 length); +WebRtc_Word16 WebRtcSpl_MaxValueW16(G_CONST WebRtc_Word16* vector, + WebRtc_Word16 length); + +WebRtc_Word16 WebRtcSpl_MaxAbsIndexW16(G_CONST WebRtc_Word16* vector, + WebRtc_Word16 length); +WebRtc_Word32 WebRtcSpl_MaxValueW32(G_CONST WebRtc_Word32* vector, + WebRtc_Word16 length); +WebRtc_Word16 WebRtcSpl_MinIndexW16(G_CONST WebRtc_Word16* vector, + WebRtc_Word16 length); +WebRtc_Word16 WebRtcSpl_MinIndexW32(G_CONST WebRtc_Word32* vector, + WebRtc_Word16 length); +WebRtc_Word16 WebRtcSpl_MaxIndexW16(G_CONST WebRtc_Word16* vector, + WebRtc_Word16 length); +WebRtc_Word16 WebRtcSpl_MaxIndexW32(G_CONST WebRtc_Word32* vector, + WebRtc_Word16 length); +// End: Minimum and maximum operations. + +// Vector scaling operations. Implementation in vector_scaling_operations.c. +// Description at bottom of file. +void WebRtcSpl_VectorBitShiftW16(WebRtc_Word16* out_vector, + WebRtc_Word16 vector_length, + G_CONST WebRtc_Word16* in_vector, + WebRtc_Word16 right_shifts); +void WebRtcSpl_VectorBitShiftW32(WebRtc_Word32* out_vector, + WebRtc_Word16 vector_length, + G_CONST WebRtc_Word32* in_vector, + WebRtc_Word16 right_shifts); +void WebRtcSpl_VectorBitShiftW32ToW16(WebRtc_Word16* out_vector, + WebRtc_Word16 vector_length, + G_CONST WebRtc_Word32* in_vector, + WebRtc_Word16 right_shifts); + +void WebRtcSpl_ScaleVector(G_CONST WebRtc_Word16* in_vector, + WebRtc_Word16* out_vector, + WebRtc_Word16 gain, + WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts); +void WebRtcSpl_ScaleVectorWithSat(G_CONST WebRtc_Word16* in_vector, + WebRtc_Word16* out_vector, + WebRtc_Word16 gain, + WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts); +void WebRtcSpl_ScaleAndAddVectors(G_CONST WebRtc_Word16* in_vector1, + WebRtc_Word16 gain1, int right_shifts1, + G_CONST WebRtc_Word16* in_vector2, + WebRtc_Word16 gain2, int right_shifts2, + WebRtc_Word16* out_vector, + int vector_length); +// End: Vector scaling operations. + +// iLBC specific functions. Implementations in ilbc_specific_functions.c. +// Description at bottom of file. +void WebRtcSpl_ScaleAndAddVectorsWithRound(WebRtc_Word16* in_vector1, + WebRtc_Word16 scale1, + WebRtc_Word16* in_vector2, + WebRtc_Word16 scale2, + WebRtc_Word16 right_shifts, + WebRtc_Word16* out_vector, + WebRtc_Word16 vector_length); +void WebRtcSpl_ReverseOrderMultArrayElements(WebRtc_Word16* out_vector, + G_CONST WebRtc_Word16* in_vector, + G_CONST WebRtc_Word16* window, + WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts); +void WebRtcSpl_ElementwiseVectorMult(WebRtc_Word16* out_vector, + G_CONST WebRtc_Word16* in_vector, + G_CONST WebRtc_Word16* window, + WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts); +void WebRtcSpl_AddVectorsAndShift(WebRtc_Word16* out_vector, + G_CONST WebRtc_Word16* in_vector1, + G_CONST WebRtc_Word16* in_vector2, + WebRtc_Word16 vector_length, + WebRtc_Word16 right_shifts); +void WebRtcSpl_AddAffineVectorToVector(WebRtc_Word16* out_vector, + WebRtc_Word16* in_vector, + WebRtc_Word16 gain, + WebRtc_Word32 add_constant, + WebRtc_Word16 right_shifts, + int vector_length); +void WebRtcSpl_AffineTransformVector(WebRtc_Word16* out_vector, + WebRtc_Word16* in_vector, + WebRtc_Word16 gain, + WebRtc_Word32 add_constant, + WebRtc_Word16 right_shifts, + int vector_length); +// End: iLBC specific functions. + +// Signal processing operations. Descriptions at bottom of this file. +int WebRtcSpl_AutoCorrelation(G_CONST WebRtc_Word16* vector, + int vector_length, int order, + WebRtc_Word32* result_vector, + int* scale); +WebRtc_Word16 WebRtcSpl_LevinsonDurbin(WebRtc_Word32* auto_corr, + WebRtc_Word16* lpc_coef, + WebRtc_Word16* refl_coef, + WebRtc_Word16 order); +void WebRtcSpl_ReflCoefToLpc(G_CONST WebRtc_Word16* refl_coef, + int use_order, + WebRtc_Word16* lpc_coef); +void WebRtcSpl_LpcToReflCoef(WebRtc_Word16* lpc_coef, + int use_order, + WebRtc_Word16* refl_coef); +void WebRtcSpl_AutoCorrToReflCoef(G_CONST WebRtc_Word32* auto_corr, + int use_order, + WebRtc_Word16* refl_coef); +void WebRtcSpl_CrossCorrelation(WebRtc_Word32* cross_corr, + WebRtc_Word16* vector1, + WebRtc_Word16* vector2, + WebRtc_Word16 dim_vector, + WebRtc_Word16 dim_cross_corr, + WebRtc_Word16 right_shifts, + WebRtc_Word16 step_vector2); +void WebRtcSpl_GetHanningWindow(WebRtc_Word16* window, WebRtc_Word16 size); +void WebRtcSpl_SqrtOfOneMinusXSquared(WebRtc_Word16* in_vector, + int vector_length, + WebRtc_Word16* out_vector); +// End: Signal processing operations. + +// Randomization functions. Implementations collected in randomization_functions.c and +// descriptions at bottom of this file. +WebRtc_UWord32 WebRtcSpl_IncreaseSeed(WebRtc_UWord32* seed); +WebRtc_Word16 WebRtcSpl_RandU(WebRtc_UWord32* seed); +WebRtc_Word16 WebRtcSpl_RandN(WebRtc_UWord32* seed); +WebRtc_Word16 WebRtcSpl_RandUArray(WebRtc_Word16* vector, + WebRtc_Word16 vector_length, + WebRtc_UWord32* seed); +// End: Randomization functions. + +// Math functions +WebRtc_Word32 WebRtcSpl_Sqrt(WebRtc_Word32 value); +WebRtc_Word32 WebRtcSpl_SqrtFloor(WebRtc_Word32 value); + +// Divisions. Implementations collected in division_operations.c and +// descriptions at bottom of this file. +WebRtc_UWord32 WebRtcSpl_DivU32U16(WebRtc_UWord32 num, WebRtc_UWord16 den); +WebRtc_Word32 WebRtcSpl_DivW32W16(WebRtc_Word32 num, WebRtc_Word16 den); +WebRtc_Word16 WebRtcSpl_DivW32W16ResW16(WebRtc_Word32 num, WebRtc_Word16 den); +WebRtc_Word32 WebRtcSpl_DivResultInQ31(WebRtc_Word32 num, WebRtc_Word32 den); +WebRtc_Word32 WebRtcSpl_DivW32HiLow(WebRtc_Word32 num, WebRtc_Word16 den_hi, + WebRtc_Word16 den_low); +// End: Divisions. + +WebRtc_Word32 WebRtcSpl_Energy(WebRtc_Word16* vector, + int vector_length, + int* scale_factor); + +WebRtc_Word32 WebRtcSpl_DotProductWithScale(WebRtc_Word16* vector1, + WebRtc_Word16* vector2, + int vector_length, + int scaling); + +// Filter operations. +int WebRtcSpl_FilterAR(G_CONST WebRtc_Word16* ar_coef, int ar_coef_length, + G_CONST WebRtc_Word16* in_vector, int in_vector_length, + WebRtc_Word16* filter_state, int filter_state_length, + WebRtc_Word16* filter_state_low, + int filter_state_low_length, WebRtc_Word16* out_vector, + WebRtc_Word16* out_vector_low, int out_vector_low_length); + +void WebRtcSpl_FilterMAFastQ12(WebRtc_Word16* in_vector, + WebRtc_Word16* out_vector, + WebRtc_Word16* ma_coef, + WebRtc_Word16 ma_coef_length, + WebRtc_Word16 vector_length); +void WebRtcSpl_FilterARFastQ12(WebRtc_Word16* in_vector, + WebRtc_Word16* out_vector, + WebRtc_Word16* ar_coef, + WebRtc_Word16 ar_coef_length, + WebRtc_Word16 vector_length); +int WebRtcSpl_DownsampleFast(WebRtc_Word16* in_vector, + WebRtc_Word16 in_vector_length, + WebRtc_Word16* out_vector, + WebRtc_Word16 out_vector_length, + WebRtc_Word16* ma_coef, + WebRtc_Word16 ma_coef_length, + WebRtc_Word16 factor, + WebRtc_Word16 delay); +// End: Filter operations. + +// FFT operations +int WebRtcSpl_ComplexFFT(WebRtc_Word16 vector[], int stages, int mode); +int WebRtcSpl_ComplexIFFT(WebRtc_Word16 vector[], int stages, int mode); +void WebRtcSpl_ComplexBitReverse(WebRtc_Word16 vector[], int stages); +// End: FFT operations + +/************************************************************ + * + * RESAMPLING FUNCTIONS AND THEIR STRUCTS ARE DEFINED BELOW + * + ************************************************************/ + +/******************************************************************* + * resample.c + * + * Includes the following resampling combinations + * 22 kHz -> 16 kHz + * 16 kHz -> 22 kHz + * 22 kHz -> 8 kHz + * 8 kHz -> 22 kHz + * + ******************************************************************/ + +// state structure for 22 -> 16 resampler +typedef struct +{ + WebRtc_Word32 S_22_44[8]; + WebRtc_Word32 S_44_32[8]; + WebRtc_Word32 S_32_16[8]; +} WebRtcSpl_State22khzTo16khz; + +void WebRtcSpl_Resample22khzTo16khz(const WebRtc_Word16* in, + WebRtc_Word16* out, + WebRtcSpl_State22khzTo16khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample22khzTo16khz(WebRtcSpl_State22khzTo16khz* state); + +// state structure for 16 -> 22 resampler +typedef struct +{ + WebRtc_Word32 S_16_32[8]; + WebRtc_Word32 S_32_22[8]; +} WebRtcSpl_State16khzTo22khz; + +void WebRtcSpl_Resample16khzTo22khz(const WebRtc_Word16* in, + WebRtc_Word16* out, + WebRtcSpl_State16khzTo22khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample16khzTo22khz(WebRtcSpl_State16khzTo22khz* state); + +// state structure for 22 -> 8 resampler +typedef struct +{ + WebRtc_Word32 S_22_22[16]; + WebRtc_Word32 S_22_16[8]; + WebRtc_Word32 S_16_8[8]; +} WebRtcSpl_State22khzTo8khz; + +void WebRtcSpl_Resample22khzTo8khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State22khzTo8khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample22khzTo8khz(WebRtcSpl_State22khzTo8khz* state); + +// state structure for 8 -> 22 resampler +typedef struct +{ + WebRtc_Word32 S_8_16[8]; + WebRtc_Word32 S_16_11[8]; + WebRtc_Word32 S_11_22[8]; +} WebRtcSpl_State8khzTo22khz; + +void WebRtcSpl_Resample8khzTo22khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State8khzTo22khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample8khzTo22khz(WebRtcSpl_State8khzTo22khz* state); + +/******************************************************************* + * resample_fractional.c + * Functions for internal use in the other resample functions + * + * Includes the following resampling combinations + * 48 kHz -> 32 kHz + * 32 kHz -> 24 kHz + * 44 kHz -> 32 kHz + * + ******************************************************************/ + +void WebRtcSpl_Resample48khzTo32khz(const WebRtc_Word32* In, WebRtc_Word32* Out, + const WebRtc_Word32 K); + +void WebRtcSpl_Resample32khzTo24khz(const WebRtc_Word32* In, WebRtc_Word32* Out, + const WebRtc_Word32 K); + +void WebRtcSpl_Resample44khzTo32khz(const WebRtc_Word32* In, WebRtc_Word32* Out, + const WebRtc_Word32 K); + +/******************************************************************* + * resample_48khz.c + * + * Includes the following resampling combinations + * 48 kHz -> 16 kHz + * 16 kHz -> 48 kHz + * 48 kHz -> 8 kHz + * 8 kHz -> 48 kHz + * + ******************************************************************/ + +typedef struct +{ + WebRtc_Word32 S_48_48[16]; + WebRtc_Word32 S_48_32[8]; + WebRtc_Word32 S_32_16[8]; +} WebRtcSpl_State48khzTo16khz; + +void WebRtcSpl_Resample48khzTo16khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State48khzTo16khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample48khzTo16khz(WebRtcSpl_State48khzTo16khz* state); + +typedef struct +{ + WebRtc_Word32 S_16_32[8]; + WebRtc_Word32 S_32_24[8]; + WebRtc_Word32 S_24_48[8]; +} WebRtcSpl_State16khzTo48khz; + +void WebRtcSpl_Resample16khzTo48khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State16khzTo48khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample16khzTo48khz(WebRtcSpl_State16khzTo48khz* state); + +typedef struct +{ + WebRtc_Word32 S_48_24[8]; + WebRtc_Word32 S_24_24[16]; + WebRtc_Word32 S_24_16[8]; + WebRtc_Word32 S_16_8[8]; +} WebRtcSpl_State48khzTo8khz; + +void WebRtcSpl_Resample48khzTo8khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State48khzTo8khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample48khzTo8khz(WebRtcSpl_State48khzTo8khz* state); + +typedef struct +{ + WebRtc_Word32 S_8_16[8]; + WebRtc_Word32 S_16_12[8]; + WebRtc_Word32 S_12_24[8]; + WebRtc_Word32 S_24_48[8]; +} WebRtcSpl_State8khzTo48khz; + +void WebRtcSpl_Resample8khzTo48khz(const WebRtc_Word16* in, WebRtc_Word16* out, + WebRtcSpl_State8khzTo48khz* state, + WebRtc_Word32* tmpmem); + +void WebRtcSpl_ResetResample8khzTo48khz(WebRtcSpl_State8khzTo48khz* state); + +/******************************************************************* + * resample_by_2.c + * + * Includes down and up sampling by a factor of two. + * + ******************************************************************/ + +void WebRtcSpl_DownsampleBy2(const WebRtc_Word16* in, const WebRtc_Word16 len, + WebRtc_Word16* out, WebRtc_Word32* filtState); + +void WebRtcSpl_UpsampleBy2(const WebRtc_Word16* in, WebRtc_Word16 len, WebRtc_Word16* out, + WebRtc_Word32* filtState); + +/************************************************************ + * END OF RESAMPLING FUNCTIONS + ************************************************************/ +void WebRtcSpl_AnalysisQMF(const WebRtc_Word16* in_data, + WebRtc_Word16* low_band, + WebRtc_Word16* high_band, + WebRtc_Word32* filter_state1, + WebRtc_Word32* filter_state2); +void WebRtcSpl_SynthesisQMF(const WebRtc_Word16* low_band, + const WebRtc_Word16* high_band, + WebRtc_Word16* out_data, + WebRtc_Word32* filter_state1, + WebRtc_Word32* filter_state2); + +#ifdef __cplusplus +} +#endif // __cplusplus +#endif // WEBRTC_SPL_SIGNAL_PROCESSING_LIBRARY_H_ + +// +// WebRtcSpl_AddSatW16(...) +// WebRtcSpl_AddSatW32(...) +// +// Returns the result of a saturated 16-bit, respectively 32-bit, addition of +// the numbers specified by the |var1| and |var2| parameters. +// +// Input: +// - var1 : Input variable 1 +// - var2 : Input variable 2 +// +// Return value : Added and saturated value +// + +// +// WebRtcSpl_SubSatW16(...) +// WebRtcSpl_SubSatW32(...) +// +// Returns the result of a saturated 16-bit, respectively 32-bit, subtraction +// of the numbers specified by the |var1| and |var2| parameters. +// +// Input: +// - var1 : Input variable 1 +// - var2 : Input variable 2 +// +// Returned value : Subtracted and saturated value +// + +// +// WebRtcSpl_GetSizeInBits(...) +// +// Returns the # of bits that are needed at the most to represent the number +// specified by the |value| parameter. +// +// Input: +// - value : Input value +// +// Return value : Number of bits needed to represent |value| +// + +// +// WebRtcSpl_NormW32(...) +// +// Norm returns the # of left shifts required to 32-bit normalize the 32-bit +// signed number specified by the |value| parameter. +// +// Input: +// - value : Input value +// +// Return value : Number of bit shifts needed to 32-bit normalize |value| +// + +// +// WebRtcSpl_NormW16(...) +// +// Norm returns the # of left shifts required to 16-bit normalize the 16-bit +// signed number specified by the |value| parameter. +// +// Input: +// - value : Input value +// +// Return value : Number of bit shifts needed to 32-bit normalize |value| +// + +// +// WebRtcSpl_NormU32(...) +// +// Norm returns the # of left shifts required to 32-bit normalize the unsigned +// 32-bit number specified by the |value| parameter. +// +// Input: +// - value : Input value +// +// Return value : Number of bit shifts needed to 32-bit normalize |value| +// + +// +// WebRtcSpl_GetScalingSquare(...) +// +// Returns the # of bits required to scale the samples specified in the +// |in_vector| parameter so that, if the squares of the samples are added the +// # of times specified by the |times| parameter, the 32-bit addition will not +// overflow (result in WebRtc_Word32). +// +// Input: +// - in_vector : Input vector to check scaling on +// - in_vector_length : Samples in |in_vector| +// - times : Number of additions to be performed +// +// Return value : Number of right bit shifts needed to avoid +// overflow in the addition calculation +// + +// +// WebRtcSpl_MemSetW16(...) +// +// Sets all the values in the WebRtc_Word16 vector |vector| of length +// |vector_length| to the specified value |set_value| +// +// Input: +// - vector : Pointer to the WebRtc_Word16 vector +// - set_value : Value specified +// - vector_length : Length of vector +// + +// +// WebRtcSpl_MemSetW32(...) +// +// Sets all the values in the WebRtc_Word32 vector |vector| of length +// |vector_length| to the specified value |set_value| +// +// Input: +// - vector : Pointer to the WebRtc_Word16 vector +// - set_value : Value specified +// - vector_length : Length of vector +// + +// +// WebRtcSpl_MemCpyReversedOrder(...) +// +// Copies all the values from the source WebRtc_Word16 vector |in_vector| to a +// destination WebRtc_Word16 vector |out_vector|. It is done in reversed order, +// meaning that the first sample of |in_vector| is copied to the last sample of +// the |out_vector|. The procedure continues until the last sample of +// |in_vector| has been copied to the first sample of |out_vector|. This +// creates a reversed vector. Used in e.g. prediction in iLBC. +// +// Input: +// - in_vector : Pointer to the first sample in a WebRtc_Word16 vector +// of length |length| +// - vector_length : Number of elements to copy +// +// Output: +// - out_vector : Pointer to the last sample in a WebRtc_Word16 vector +// of length |length| +// + +// +// WebRtcSpl_CopyFromEndW16(...) +// +// Copies the rightmost |samples| of |in_vector| (of length |in_vector_length|) +// to the vector |out_vector|. +// +// Input: +// - in_vector : Input vector +// - in_vector_length : Number of samples in |in_vector| +// - samples : Number of samples to extract (from right side) +// from |in_vector| +// +// Output: +// - out_vector : Vector with the requested samples +// +// Return value : Number of copied samples in |out_vector| +// + +// +// WebRtcSpl_ZerosArrayW16(...) +// WebRtcSpl_ZerosArrayW32(...) +// +// Inserts the value "zero" in all positions of a w16 and a w32 vector +// respectively. +// +// Input: +// - vector_length : Number of samples in vector +// +// Output: +// - vector : Vector containing all zeros +// +// Return value : Number of samples in vector +// + +// +// WebRtcSpl_OnesArrayW16(...) +// WebRtcSpl_OnesArrayW32(...) +// +// Inserts the value "one" in all positions of a w16 and a w32 vector +// respectively. +// +// Input: +// - vector_length : Number of samples in vector +// +// Output: +// - vector : Vector containing all ones +// +// Return value : Number of samples in vector +// + +// +// WebRtcSpl_MinValueW16(...) +// WebRtcSpl_MinValueW32(...) +// +// Returns the minimum value of a vector +// +// Input: +// - vector : Input vector +// - vector_length : Number of samples in vector +// +// Return value : Minimum sample value in vector +// + +// +// WebRtcSpl_MaxValueW16(...) +// WebRtcSpl_MaxValueW32(...) +// +// Returns the maximum value of a vector +// +// Input: +// - vector : Input vector +// - vector_length : Number of samples in vector +// +// Return value : Maximum sample value in vector +// + +// +// WebRtcSpl_MaxAbsValueW16(...) +// WebRtcSpl_MaxAbsValueW32(...) +// +// Returns the largest absolute value of a vector +// +// Input: +// - vector : Input vector +// - vector_length : Number of samples in vector +// +// Return value : Maximum absolute value in vector +// + +// +// WebRtcSpl_MaxAbsIndexW16(...) +// +// Returns the vector index to the largest absolute value of a vector +// +// Input: +// - vector : Input vector +// - vector_length : Number of samples in vector +// +// Return value : Index to maximum absolute value in vector +// + +// +// WebRtcSpl_MinIndexW16(...) +// WebRtcSpl_MinIndexW32(...) +// +// Returns the vector index to the minimum sample value of a vector +// +// Input: +// - vector : Input vector +// - vector_length : Number of samples in vector +// +// Return value : Index to minimum sample value in vector +// + +// +// WebRtcSpl_MaxIndexW16(...) +// WebRtcSpl_MaxIndexW32(...) +// +// Returns the vector index to the maximum sample value of a vector +// +// Input: +// - vector : Input vector +// - vector_length : Number of samples in vector +// +// Return value : Index to maximum sample value in vector +// + +// +// WebRtcSpl_VectorBitShiftW16(...) +// WebRtcSpl_VectorBitShiftW32(...) +// +// Bit shifts all the values in a vector up or downwards. Different calls for +// WebRtc_Word16 and WebRtc_Word32 vectors respectively. +// +// Input: +// - vector_length : Length of vector +// - in_vector : Pointer to the vector that should be bit shifted +// - right_shifts : Number of right bit shifts (negative value gives left +// shifts) +// +// Output: +// - out_vector : Pointer to the result vector (can be the same as +// |in_vector|) +// + +// +// WebRtcSpl_VectorBitShiftW32ToW16(...) +// +// Bit shifts all the values in a WebRtc_Word32 vector up or downwards and +// stores the result as a WebRtc_Word16 vector +// +// Input: +// - vector_length : Length of vector +// - in_vector : Pointer to the vector that should be bit shifted +// - right_shifts : Number of right bit shifts (negative value gives left +// shifts) +// +// Output: +// - out_vector : Pointer to the result vector (can be the same as +// |in_vector|) +// + +// +// WebRtcSpl_ScaleVector(...) +// +// Performs the vector operation: +// out_vector[k] = (gain*in_vector[k])>>right_shifts +// +// Input: +// - in_vector : Input vector +// - gain : Scaling gain +// - vector_length : Elements in the |in_vector| +// - right_shifts : Number of right bit shifts applied +// +// Output: +// - out_vector : Output vector (can be the same as |in_vector|) +// + +// +// WebRtcSpl_ScaleVectorWithSat(...) +// +// Performs the vector operation: +// out_vector[k] = SATURATE( (gain*in_vector[k])>>right_shifts ) +// +// Input: +// - in_vector : Input vector +// - gain : Scaling gain +// - vector_length : Elements in the |in_vector| +// - right_shifts : Number of right bit shifts applied +// +// Output: +// - out_vector : Output vector (can be the same as |in_vector|) +// + +// +// WebRtcSpl_ScaleAndAddVectors(...) +// +// Performs the vector operation: +// out_vector[k] = (gain1*in_vector1[k])>>right_shifts1 +// + (gain2*in_vector2[k])>>right_shifts2 +// +// Input: +// - in_vector1 : Input vector 1 +// - gain1 : Gain to be used for vector 1 +// - right_shifts1 : Right bit shift to be used for vector 1 +// - in_vector2 : Input vector 2 +// - gain2 : Gain to be used for vector 2 +// - right_shifts2 : Right bit shift to be used for vector 2 +// - vector_length : Elements in the input vectors +// +// Output: +// - out_vector : Output vector +// + +// +// WebRtcSpl_ScaleAndAddVectorsWithRound(...) +// +// Performs the vector operation: +// +// out_vector[k] = ((scale1*in_vector1[k]) + (scale2*in_vector2[k]) +// + round_value) >> right_shifts +// +// where: +// +// round_value = (1<>1 +// +// Input: +// - in_vector1 : Input vector 1 +// - scale1 : Gain to be used for vector 1 +// - in_vector2 : Input vector 2 +// - scale2 : Gain to be used for vector 2 +// - right_shifts : Number of right bit shifts to be applied +// - vector_length : Number of elements in the input vectors +// +// Output: +// - out_vector : Output vector +// + +// +// WebRtcSpl_ReverseOrderMultArrayElements(...) +// +// Performs the vector operation: +// out_vector[n] = (in_vector[n]*window[-n])>>right_shifts +// +// Input: +// - in_vector : Input vector +// - window : Window vector (should be reversed). The pointer +// should be set to the last value in the vector +// - right_shifts : Number of right bit shift to be applied after the +// multiplication +// - vector_length : Number of elements in |in_vector| +// +// Output: +// - out_vector : Output vector (can be same as |in_vector|) +// + +// +// WebRtcSpl_ElementwiseVectorMult(...) +// +// Performs the vector operation: +// out_vector[n] = (in_vector[n]*window[n])>>right_shifts +// +// Input: +// - in_vector : Input vector +// - window : Window vector. +// - right_shifts : Number of right bit shift to be applied after the +// multiplication +// - vector_length : Number of elements in |in_vector| +// +// Output: +// - out_vector : Output vector (can be same as |in_vector|) +// + +// +// WebRtcSpl_AddVectorsAndShift(...) +// +// Performs the vector operation: +// out_vector[k] = (in_vector1[k] + in_vector2[k])>>right_shifts +// +// Input: +// - in_vector1 : Input vector 1 +// - in_vector2 : Input vector 2 +// - right_shifts : Number of right bit shift to be applied after the +// multiplication +// - vector_length : Number of elements in |in_vector1| and |in_vector2| +// +// Output: +// - out_vector : Output vector (can be same as |in_vector1|) +// + +// +// WebRtcSpl_AddAffineVectorToVector(...) +// +// Adds an affine transformed vector to another vector |out_vector|, i.e, +// performs +// out_vector[k] += (in_vector[k]*gain+add_constant)>>right_shifts +// +// Input: +// - in_vector : Input vector +// - gain : Gain value, used to multiply the in vector with +// - add_constant : Constant value to add (usually 1<<(right_shifts-1), +// but others can be used as well +// - right_shifts : Number of right bit shifts (0-16) +// - vector_length : Number of samples in |in_vector| and |out_vector| +// +// Output: +// - out_vector : Vector with the output +// + +// +// WebRtcSpl_AffineTransformVector(...) +// +// Affine transforms a vector, i.e, performs +// out_vector[k] = (in_vector[k]*gain+add_constant)>>right_shifts +// +// Input: +// - in_vector : Input vector +// - gain : Gain value, used to multiply the in vector with +// - add_constant : Constant value to add (usually 1<<(right_shifts-1), +// but others can be used as well +// - right_shifts : Number of right bit shifts (0-16) +// - vector_length : Number of samples in |in_vector| and |out_vector| +// +// Output: +// - out_vector : Vector with the output +// + +// +// WebRtcSpl_AutoCorrelation(...) +// +// A 32-bit fix-point implementation of auto-correlation computation +// +// Input: +// - vector : Vector to calculate autocorrelation upon +// - vector_length : Length (in samples) of |vector| +// - order : The order up to which the autocorrelation should be +// calculated +// +// Output: +// - result_vector : auto-correlation values (values should be seen +// relative to each other since the absolute values +// might have been down shifted to avoid overflow) +// +// - scale : The number of left shifts required to obtain the +// auto-correlation in Q0 +// +// Return value : Number of samples in |result_vector|, i.e., (order+1) +// + +// +// WebRtcSpl_LevinsonDurbin(...) +// +// A 32-bit fix-point implementation of the Levinson-Durbin algorithm that +// does NOT use the 64 bit class +// +// Input: +// - auto_corr : Vector with autocorrelation values of length >= +// |use_order|+1 +// - use_order : The LPC filter order (support up to order 20) +// +// Output: +// - lpc_coef : lpc_coef[0..use_order] LPC coefficients in Q12 +// - refl_coef : refl_coef[0...use_order-1]| Reflection coefficients in +// Q15 +// +// Return value : 1 for stable 0 for unstable +// + +// +// WebRtcSpl_ReflCoefToLpc(...) +// +// Converts reflection coefficients |refl_coef| to LPC coefficients |lpc_coef|. +// This version is a 16 bit operation. +// +// NOTE: The 16 bit refl_coef -> lpc_coef conversion might result in a +// "slightly unstable" filter (i.e., a pole just outside the unit circle) in +// "rare" cases even if the reflection coefficients are stable. +// +// Input: +// - refl_coef : Reflection coefficients in Q15 that should be converted +// to LPC coefficients +// - use_order : Number of coefficients in |refl_coef| +// +// Output: +// - lpc_coef : LPC coefficients in Q12 +// + +// +// WebRtcSpl_LpcToReflCoef(...) +// +// Converts LPC coefficients |lpc_coef| to reflection coefficients |refl_coef|. +// This version is a 16 bit operation. +// The conversion is implemented by the step-down algorithm. +// +// Input: +// - lpc_coef : LPC coefficients in Q12, that should be converted to +// reflection coefficients +// - use_order : Number of coefficients in |lpc_coef| +// +// Output: +// - refl_coef : Reflection coefficients in Q15. +// + +// +// WebRtcSpl_AutoCorrToReflCoef(...) +// +// Calculates reflection coefficients (16 bit) from auto-correlation values +// +// Input: +// - auto_corr : Auto-correlation values +// - use_order : Number of coefficients wanted be calculated +// +// Output: +// - refl_coef : Reflection coefficients in Q15. +// + +// +// WebRtcSpl_CrossCorrelation(...) +// +// Calculates the cross-correlation between two sequences |vector1| and +// |vector2|. |vector1| is fixed and |vector2| slides as the pointer is +// increased with the amount |step_vector2| +// +// Input: +// - vector1 : First sequence (fixed throughout the correlation) +// - vector2 : Second sequence (slides |step_vector2| for each +// new correlation) +// - dim_vector : Number of samples to use in the cross-correlation +// - dim_cross_corr : Number of cross-correlations to calculate (the +// start position for |vector2| is updated for each +// new one) +// - right_shifts : Number of right bit shifts to use. This will +// become the output Q-domain. +// - step_vector2 : How many (positive or negative) steps the +// |vector2| pointer should be updated for each new +// cross-correlation value. +// +// Output: +// - cross_corr : The cross-correlation in Q(-right_shifts) +// + +// +// WebRtcSpl_GetHanningWindow(...) +// +// Creates (the first half of) a Hanning window. Size must be at least 1 and +// at most 512. +// +// Input: +// - size : Length of the requested Hanning window (1 to 512) +// +// Output: +// - window : Hanning vector in Q14. +// + +// +// WebRtcSpl_SqrtOfOneMinusXSquared(...) +// +// Calculates y[k] = sqrt(1 - x[k]^2) for each element of the input vector +// |in_vector|. Input and output values are in Q15. +// +// Inputs: +// - in_vector : Values to calculate sqrt(1 - x^2) of +// - vector_length : Length of vector |in_vector| +// +// Output: +// - out_vector : Output values in Q15 +// + +// +// WebRtcSpl_IncreaseSeed(...) +// +// Increases the seed (and returns the new value) +// +// Input: +// - seed : Seed for random calculation +// +// Output: +// - seed : Updated seed value +// +// Return value : The new seed value +// + +// +// WebRtcSpl_RandU(...) +// +// Produces a uniformly distributed value in the WebRtc_Word16 range +// +// Input: +// - seed : Seed for random calculation +// +// Output: +// - seed : Updated seed value +// +// Return value : Uniformly distributed value in the range +// [Word16_MIN...Word16_MAX] +// + +// +// WebRtcSpl_RandN(...) +// +// Produces a normal distributed value in the WebRtc_Word16 range +// +// Input: +// - seed : Seed for random calculation +// +// Output: +// - seed : Updated seed value +// +// Return value : N(0,1) value in the Q13 domain +// + +// +// WebRtcSpl_RandUArray(...) +// +// Produces a uniformly distributed vector with elements in the WebRtc_Word16 +// range +// +// Input: +// - vector_length : Samples wanted in the vector +// - seed : Seed for random calculation +// +// Output: +// - vector : Vector with the uniform values +// - seed : Updated seed value +// +// Return value : Number of samples in vector, i.e., |vector_length| +// + +// +// WebRtcSpl_Sqrt(...) +// +// Returns the square root of the input value |value|. The precision of this +// function is integer precision, i.e., sqrt(8) gives 2 as answer. +// If |value| is a negative number then 0 is returned. +// +// Algorithm: +// +// A sixth order Taylor Series expansion is used here to compute the square +// root of a number y^0.5 = (1+x)^0.5 +// where +// x = y-1 +// = 1+(x/2)-0.5*((x/2)^2+0.5*((x/2)^3-0.625*((x/2)^4+0.875*((x/2)^5) +// 0.5 <= x < 1 +// +// Input: +// - value : Value to calculate sqrt of +// +// Return value : Result of the sqrt calculation +// + +// +// WebRtcSpl_SqrtFloor(...) +// +// Returns the square root of the input value |value|. The precision of this +// function is rounding down integer precision, i.e., sqrt(8) gives 2 as answer. +// If |value| is a negative number then 0 is returned. +// +// Algorithm: +// +// An iterative 4 cylce/bit routine +// +// Input: +// - value : Value to calculate sqrt of +// +// Return value : Result of the sqrt calculation +// + +// +// WebRtcSpl_DivU32U16(...) +// +// Divides a WebRtc_UWord32 |num| by a WebRtc_UWord16 |den|. +// +// If |den|==0, (WebRtc_UWord32)0xFFFFFFFF is returned. +// +// Input: +// - num : Numerator +// - den : Denominator +// +// Return value : Result of the division (as a WebRtc_UWord32), i.e., the +// integer part of num/den. +// + +// +// WebRtcSpl_DivW32W16(...) +// +// Divides a WebRtc_Word32 |num| by a WebRtc_Word16 |den|. +// +// If |den|==0, (WebRtc_Word32)0x7FFFFFFF is returned. +// +// Input: +// - num : Numerator +// - den : Denominator +// +// Return value : Result of the division (as a WebRtc_Word32), i.e., the +// integer part of num/den. +// + +// +// WebRtcSpl_DivW32W16ResW16(...) +// +// Divides a WebRtc_Word32 |num| by a WebRtc_Word16 |den|, assuming that the +// result is less than 32768, otherwise an unpredictable result will occur. +// +// If |den|==0, (WebRtc_Word16)0x7FFF is returned. +// +// Input: +// - num : Numerator +// - den : Denominator +// +// Return value : Result of the division (as a WebRtc_Word16), i.e., the +// integer part of num/den. +// + +// +// WebRtcSpl_DivResultInQ31(...) +// +// Divides a WebRtc_Word32 |num| by a WebRtc_Word16 |den|, assuming that the +// absolute value of the denominator is larger than the numerator, otherwise +// an unpredictable result will occur. +// +// Input: +// - num : Numerator +// - den : Denominator +// +// Return value : Result of the division in Q31. +// + +// +// WebRtcSpl_DivW32HiLow(...) +// +// Divides a WebRtc_Word32 |num| by a denominator in hi, low format. The +// absolute value of the denominator has to be larger (or equal to) the +// numerator. +// +// Input: +// - num : Numerator +// - den_hi : High part of denominator +// - den_low : Low part of denominator +// +// Return value : Divided value in Q31 +// + +// +// WebRtcSpl_Energy(...) +// +// Calculates the energy of a vector +// +// Input: +// - vector : Vector which the energy should be calculated on +// - vector_length : Number of samples in vector +// +// Output: +// - scale_factor : Number of left bit shifts needed to get the physical +// energy value, i.e, to get the Q0 value +// +// Return value : Energy value in Q(-|scale_factor|) +// + +// +// WebRtcSpl_FilterAR(...) +// +// Performs a 32-bit AR filtering on a vector in Q12 +// +// Input: +// - ar_coef : AR-coefficient vector (values in Q12), +// ar_coef[0] must be 4096. +// - ar_coef_length : Number of coefficients in |ar_coef|. +// - in_vector : Vector to be filtered. +// - in_vector_length : Number of samples in |in_vector|. +// - filter_state : Current state (higher part) of the filter. +// - filter_state_length : Length (in samples) of |filter_state|. +// - filter_state_low : Current state (lower part) of the filter. +// - filter_state_low_length : Length (in samples) of |filter_state_low|. +// - out_vector_low_length : Maximum length (in samples) of +// |out_vector_low|. +// +// Output: +// - filter_state : Updated state (upper part) vector. +// - filter_state_low : Updated state (lower part) vector. +// - out_vector : Vector containing the upper part of the +// filtered values. +// - out_vector_low : Vector containing the lower part of the +// filtered values. +// +// Return value : Number of samples in the |out_vector|. +// + +// +// WebRtcSpl_FilterMAFastQ12(...) +// +// Performs a MA filtering on a vector in Q12 +// +// Input: +// - in_vector : Input samples (state in positions +// in_vector[-order] .. in_vector[-1]) +// - ma_coef : Filter coefficients (in Q12) +// - ma_coef_length : Number of B coefficients (order+1) +// - vector_length : Number of samples to be filtered +// +// Output: +// - out_vector : Filtered samples +// + +// +// WebRtcSpl_FilterARFastQ12(...) +// +// Performs a AR filtering on a vector in Q12 +// +// Input: +// - in_vector : Input samples +// - out_vector : State information in positions +// out_vector[-order] .. out_vector[-1] +// - ar_coef : Filter coefficients (in Q12) +// - ar_coef_length : Number of B coefficients (order+1) +// - vector_length : Number of samples to be filtered +// +// Output: +// - out_vector : Filtered samples +// + +// +// WebRtcSpl_DownsampleFast(...) +// +// Performs a MA down sampling filter on a vector +// +// Input: +// - in_vector : Input samples (state in positions +// in_vector[-order] .. in_vector[-1]) +// - in_vector_length : Number of samples in |in_vector| to be filtered. +// This must be at least +// |delay| + |factor|*(|out_vector_length|-1) + 1) +// - out_vector_length : Number of down sampled samples desired +// - ma_coef : Filter coefficients (in Q12) +// - ma_coef_length : Number of B coefficients (order+1) +// - factor : Decimation factor +// - delay : Delay of filter (compensated for in out_vector) +// +// Output: +// - out_vector : Filtered samples +// +// Return value : 0 if OK, -1 if |in_vector| is too short +// + +// +// WebRtcSpl_DotProductWithScale(...) +// +// Calculates the dot product between two (WebRtc_Word16) vectors +// +// Input: +// - vector1 : Vector 1 +// - vector2 : Vector 2 +// - vector_length : Number of samples used in the dot product +// - scaling : The number of right bit shifts to apply on each term +// during calculation to avoid overflow, i.e., the +// output will be in Q(-|scaling|) +// +// Return value : The dot product in Q(-scaling) +// + +// +// WebRtcSpl_ComplexIFFT(...) +// +// Complex Inverse FFT +// +// Computes an inverse complex 2^|stages|-point FFT on the input vector, which +// is in bit-reversed order. The original content of the vector is destroyed in +// the process, since the input is overwritten by the output, normal-ordered, +// FFT vector. With X as the input complex vector, y as the output complex +// vector and with M = 2^|stages|, the following is computed: +// +// M-1 +// y(k) = sum[X(i)*[cos(2*pi*i*k/M) + j*sin(2*pi*i*k/M)]] +// i=0 +// +// The implementations are optimized for speed, not for code size. It uses the +// decimation-in-time algorithm with radix-2 butterfly technique. +// +// Input: +// - vector : In pointer to complex vector containing 2^|stages| +// real elements interleaved with 2^|stages| imaginary +// elements. +// [ReImReImReIm....] +// The elements are in Q(-scale) domain, see more on Return +// Value below. +// +// - stages : Number of FFT stages. Must be at least 3 and at most 10, +// since the table WebRtcSpl_kSinTable1024[] is 1024 +// elements long. +// +// - mode : This parameter gives the user to choose how the FFT +// should work. +// mode==0: Low-complexity and Low-accuracy mode +// mode==1: High-complexity and High-accuracy mode +// +// Output: +// - vector : Out pointer to the FFT vector (the same as input). +// +// Return Value : The scale value that tells the number of left bit shifts +// that the elements in the |vector| should be shifted with +// in order to get Q0 values, i.e. the physically correct +// values. The scale parameter is always 0 or positive, +// except if N>1024 (|stages|>10), which returns a scale +// value of -1, indicating error. +// + +// +// WebRtcSpl_ComplexFFT(...) +// +// Complex FFT +// +// Computes a complex 2^|stages|-point FFT on the input vector, which is in +// bit-reversed order. The original content of the vector is destroyed in +// the process, since the input is overwritten by the output, normal-ordered, +// FFT vector. With x as the input complex vector, Y as the output complex +// vector and with M = 2^|stages|, the following is computed: +// +// M-1 +// Y(k) = 1/M * sum[x(i)*[cos(2*pi*i*k/M) + j*sin(2*pi*i*k/M)]] +// i=0 +// +// The implementations are optimized for speed, not for code size. It uses the +// decimation-in-time algorithm with radix-2 butterfly technique. +// +// This routine prevents overflow by scaling by 2 before each FFT stage. This is +// a fixed scaling, for proper normalization - there will be log2(n) passes, so +// this results in an overall factor of 1/n, distributed to maximize arithmetic +// accuracy. +// +// Input: +// - vector : In pointer to complex vector containing 2^|stages| real +// elements interleaved with 2^|stages| imaginary elements. +// [ReImReImReIm....] +// The output is in the Q0 domain. +// +// - stages : Number of FFT stages. Must be at least 3 and at most 10, +// since the table WebRtcSpl_kSinTable1024[] is 1024 +// elements long. +// +// - mode : This parameter gives the user to choose how the FFT +// should work. +// mode==0: Low-complexity and Low-accuracy mode +// mode==1: High-complexity and High-accuracy mode +// +// Output: +// - vector : The output FFT vector is in the Q0 domain. +// +// Return value : The scale parameter is always 0, except if N>1024, +// which returns a scale value of -1, indicating error. +// + +// +// WebRtcSpl_ComplexBitReverse(...) +// +// Complex Bit Reverse +// +// This function bit-reverses the position of elements in the complex input +// vector into the output vector. +// +// If you bit-reverse a linear-order array, you obtain a bit-reversed order +// array. If you bit-reverse a bit-reversed order array, you obtain a +// linear-order array. +// +// Input: +// - vector : In pointer to complex vector containing 2^|stages| real +// elements interleaved with 2^|stages| imaginary elements. +// [ReImReImReIm....] +// - stages : Number of FFT stages. Must be at least 3 and at most 10, +// since the table WebRtcSpl_kSinTable1024[] is 1024 +// elements long. +// +// Output: +// - vector : Out pointer to complex vector in bit-reversed order. +// The input vector is over written. +// + +// +// WebRtcSpl_AnalysisQMF(...) +// +// Splits a 0-2*F Hz signal into two sub bands: 0-F Hz and F-2*F Hz. The +// current version has F = 8000, therefore, a super-wideband audio signal is +// split to lower-band 0-8 kHz and upper-band 8-16 kHz. +// +// Input: +// - in_data : Wide band speech signal, 320 samples (10 ms) +// +// Input & Output: +// - filter_state1 : Filter state for first All-pass filter +// - filter_state2 : Filter state for second All-pass filter +// +// Output: +// - low_band : Lower-band signal 0-8 kHz band, 160 samples (10 ms) +// - high_band : Upper-band signal 8-16 kHz band (flipped in frequency +// domain), 160 samples (10 ms) +// + +// +// WebRtcSpl_SynthesisQMF(...) +// +// Combines the two sub bands (0-F and F-2*F Hz) into a signal of 0-2*F +// Hz, (current version has F = 8000 Hz). So the filter combines lower-band +// (0-8 kHz) and upper-band (8-16 kHz) channels to obtain super-wideband 0-16 +// kHz audio. +// +// Input: +// - low_band : The signal with the 0-8 kHz band, 160 samples (10 ms) +// - high_band : The signal with the 8-16 kHz band, 160 samples (10 ms) +// +// Input & Output: +// - filter_state1 : Filter state for first All-pass filter +// - filter_state2 : Filter state for second All-pass filter +// +// Output: +// - out_data : Super-wideband speech signal, 0-16 kHz +// + +// WebRtc_Word16 WebRtcSpl_SatW32ToW16(...) +// +// This function saturates a 32-bit word into a 16-bit word. +// +// Input: +// - value32 : The value of a 32-bit word. +// +// Output: +// - out16 : the saturated 16-bit word. +// + +// int32_t WebRtc_MulAccumW16(...) +// +// This function multiply a 16-bit word by a 16-bit word, and accumulate this +// value to a 32-bit integer. +// +// Input: +// - a : The value of the first 16-bit word. +// - b : The value of the second 16-bit word. +// - c : The value of an 32-bit integer. +// +// Return Value: The value of a * b + c. +// + +// WebRtc_Word16 WebRtcSpl_get_version(...) +// +// This function gives the version string of the Signal Processing Library. +// +// Input: +// - length_in_bytes : The size of Allocated space (in Bytes) where +// the version number is written to (in string format). +// +// Output: +// - version : Pointer to a buffer where the version number is written to. +// diff --git a/src/mod/codecs/mod_isac/spectrum_ar_model_tables.c b/src/mod/codecs/mod_isac/spectrum_ar_model_tables.c new file mode 100644 index 0000000000..92b9c4d626 --- /dev/null +++ b/src/mod/codecs/mod_isac/spectrum_ar_model_tables.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "spectrum_ar_model_tables.h" +#include "settings.h" + +/********************* AR Coefficient Tables ************************/ +/* cdf for quantized reflection coefficient 1 */ +const WebRtc_UWord16 WebRtcIsac_kQArRc1Cdf[12] = { + 0, 2, 4, 129, 7707, 57485, 65495, 65527, 65529, 65531, + 65533, 65535}; + +/* cdf for quantized reflection coefficient 2 */ +const WebRtc_UWord16 WebRtcIsac_kQArRc2Cdf[12] = { + 0, 2, 4, 7, 531, 25298, 64525, 65526, 65529, 65531, + 65533, 65535}; + +/* cdf for quantized reflection coefficient 3 */ +const WebRtc_UWord16 WebRtcIsac_kQArRc3Cdf[12] = { + 0, 2, 4, 6, 620, 22898, 64843, 65527, 65529, 65531, + 65533, 65535}; + +/* cdf for quantized reflection coefficient 4 */ +const WebRtc_UWord16 WebRtcIsac_kQArRc4Cdf[12] = { + 0, 2, 4, 6, 35, 10034, 60733, 65506, 65529, 65531, + 65533, 65535}; + +/* cdf for quantized reflection coefficient 5 */ +const WebRtc_UWord16 WebRtcIsac_kQArRc5Cdf[12] = { + 0, 2, 4, 6, 36, 7567, 56727, 65385, 65529, 65531, + 65533, 65535}; + +/* cdf for quantized reflection coefficient 6 */ +const WebRtc_UWord16 WebRtcIsac_kQArRc6Cdf[12] = { + 0, 2, 4, 6, 14, 6579, 57360, 65409, 65529, 65531, + 65533, 65535}; + +/* representation levels for quantized reflection coefficient 1 */ +const WebRtc_Word16 WebRtcIsac_kQArRc1Levels[11] = { + -32104, -29007, -23202, -15496, -9279, -2577, 5934, 17535, 24512, 29503, 32104 +}; + +/* representation levels for quantized reflection coefficient 2 */ +const WebRtc_Word16 WebRtcIsac_kQArRc2Levels[11] = { + -32104, -29503, -23494, -15261, -7309, -1399, 6158, 16381, 24512, 29503, 32104 +}; + +/* representation levels for quantized reflection coefficient 3 */ +const WebRtc_Word16 WebRtcIsac_kQArRc3Levels[11] = { +-32104, -29503, -23157, -15186, -7347, -1359, 5829, 17535, 24512, 29503, 32104 +}; + +/* representation levels for quantized reflection coefficient 4 */ +const WebRtc_Word16 WebRtcIsac_kQArRc4Levels[11] = { +-32104, -29503, -24512, -15362, -6665, -342, 6596, 14585, 24512, 29503, 32104 +}; + +/* representation levels for quantized reflection coefficient 5 */ +const WebRtc_Word16 WebRtcIsac_kQArRc5Levels[11] = { +-32104, -29503, -24512, -15005, -6564, -106, 7123, 14920, 24512, 29503, 32104 +}; + +/* representation levels for quantized reflection coefficient 6 */ +const WebRtc_Word16 WebRtcIsac_kQArRc6Levels[11] = { +-32104, -29503, -24512, -15096, -6656, -37, 7036, 14847, 24512, 29503, 32104 +}; + +/* quantization boundary levels for reflection coefficients */ +const WebRtc_Word16 WebRtcIsac_kQArBoundaryLevels[12] = { +-32768, -31441, -27566, -21458, -13612, -4663, 4663, 13612, 21458, 27566, 31441, 32767 +}; + +/* initial index for AR reflection coefficient quantizer and cdf table search */ +const WebRtc_UWord16 WebRtcIsac_kQArRcInitIndex[6] = { + 5, 5, 5, 5, 5, 5}; + +/* pointers to AR cdf tables */ +const WebRtc_UWord16 *WebRtcIsac_kQArRcCdfPtr[AR_ORDER] = { + WebRtcIsac_kQArRc1Cdf, WebRtcIsac_kQArRc2Cdf, WebRtcIsac_kQArRc3Cdf, + WebRtcIsac_kQArRc4Cdf, WebRtcIsac_kQArRc5Cdf, WebRtcIsac_kQArRc6Cdf +}; + +/* pointers to AR representation levels tables */ +const WebRtc_Word16 *WebRtcIsac_kQArRcLevelsPtr[AR_ORDER] = { + WebRtcIsac_kQArRc1Levels, WebRtcIsac_kQArRc2Levels, WebRtcIsac_kQArRc3Levels, + WebRtcIsac_kQArRc4Levels, WebRtcIsac_kQArRc5Levels, WebRtcIsac_kQArRc6Levels +}; + + +/******************** GAIN Coefficient Tables ***********************/ +/* cdf for Gain coefficient */ +const WebRtc_UWord16 WebRtcIsac_kQGainCdf[19] = { + 0, 2, 4, 6, 8, 10, 12, 14, 16, 1172, + 11119, 29411, 51699, 64445, 65527, 65529, 65531, 65533, 65535}; + +/* representation levels for quantized squared Gain coefficient */ +const WebRtc_Word32 WebRtcIsac_kQGain2Levels[18] = { +// 17, 28, 46, 76, 128, 215, 364, 709, 1268, 1960, 3405, 6078, 11286, 17827, 51918, 134498, 487432, 2048000}; + 128, 128, 128, 128, 128, 215, 364, 709, 1268, 1960, 3405, 6078, 11286, 17827, 51918, 134498, 487432, 2048000}; +/* quantization boundary levels for squared Gain coefficient */ +const WebRtc_Word32 WebRtcIsac_kQGain2BoundaryLevels[19] = { +0, 21, 35, 59, 99, 166, 280, 475, 815, 1414, 2495, 4505, 8397, 16405, 34431, 81359, 240497, 921600, 0x7FFFFFFF}; + +/* pointers to Gain cdf table */ +const WebRtc_UWord16 *WebRtcIsac_kQGainCdf_ptr[1] = {WebRtcIsac_kQGainCdf}; + +/* Gain initial index for gain quantizer and cdf table search */ +const WebRtc_UWord16 WebRtcIsac_kQGainInitIndex[1] = {11}; + +/************************* Cosine Tables ****************************/ +/* Cosine table */ +const WebRtc_Word16 WebRtcIsac_kCos[6][60] = { +{512, 512, 511, 510, 508, 507, 505, 502, 499, 496, 493, 489, 485, 480, 476, 470, 465, 459, 453, 447, +440, 433, 426, 418, 410, 402, 394, 385, 376, 367, 357, 348, 338, 327, 317, 306, 295, 284, 273, 262, +250, 238, 226, 214, 202, 190, 177, 165, 152, 139, 126, 113, 100, 87, 73, 60, 47, 33, 20, 7}, +{512, 510, 508, 503, 498, 491, 483, 473, 462, 450, 437, 422, 406, 389, 371, 352, 333, 312, 290, 268, +244, 220, 196, 171, 145, 120, 93, 67, 40, 13, -13, -40, -67, -93, -120, -145, -171, -196, -220, -244, +-268, -290, -312, -333, -352, -371, -389, -406, -422, -437, -450, -462, -473, -483, -491, -498, -503, -508, -510, -512}, +{512, 508, 502, 493, 480, 465, 447, 426, 402, 376, 348, 317, 284, 250, 214, 177, 139, 100, 60, 20, +-20, -60, -100, -139, -177, -214, -250, -284, -317, -348, -376, -402, -426, -447, -465, -480, -493, -502, -508, -512, +-512, -508, -502, -493, -480, -465, -447, -426, -402, -376, -348, -317, -284, -250, -214, -177, -139, -100, -60, -20}, +{511, 506, 495, 478, 456, 429, 398, 362, 322, 279, 232, 183, 133, 80, 27, -27, -80, -133, -183, -232, +-279, -322, -362, -398, -429, -456, -478, -495, -506, -511, -511, -506, -495, -478, -456, -429, -398, -362, -322, -279, +-232, -183, -133, -80, -27, 27, 80, 133, 183, 232, 279, 322, 362, 398, 429, 456, 478, 495, 506, 511}, +{511, 502, 485, 459, 426, 385, 338, 284, 226, 165, 100, 33, -33, -100, -165, -226, -284, -338, -385, -426, +-459, -485, -502, -511, -511, -502, -485, -459, -426, -385, -338, -284, -226, -165, -100, -33, 33, 100, 165, 226, +284, 338, 385, 426, 459, 485, 502, 511, 511, 502, 485, 459, 426, 385, 338, 284, 226, 165, 100, 33}, +{510, 498, 473, 437, 389, 333, 268, 196, 120, 40, -40, -120, -196, -268, -333, -389, -437, -473, -498, -510, +-510, -498, -473, -437, -389, -333, -268, -196, -120, -40, 40, 120, 196, 268, 333, 389, 437, 473, 498, 510, +510, 498, 473, 437, 389, 333, 268, 196, 120, 40, -40, -120, -196, -268, -333, -389, -437, -473, -498, -510} +}; diff --git a/src/mod/codecs/mod_isac/spectrum_ar_model_tables.h b/src/mod/codecs/mod_isac/spectrum_ar_model_tables.h new file mode 100644 index 0000000000..159245bd98 --- /dev/null +++ b/src/mod/codecs/mod_isac/spectrum_ar_model_tables.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * spectrum_ar_model_tables.h + * + * This file contains definitions of tables with AR coefficients, + * Gain coefficients and cosine tables. + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_SPECTRUM_AR_MODEL_TABLES_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_SPECTRUM_AR_MODEL_TABLES_H_ + +#include "structs.h" + +/********************* AR Coefficient Tables ************************/ +/* cdf for quantized reflection coefficient 1 */ +extern const WebRtc_UWord16 WebRtcIsac_kQArRc1Cdf[12]; + +/* cdf for quantized reflection coefficient 2 */ +extern const WebRtc_UWord16 WebRtcIsac_kQArRc2Cdf[12]; + +/* cdf for quantized reflection coefficient 3 */ +extern const WebRtc_UWord16 WebRtcIsac_kQArRc3Cdf[12]; + +/* cdf for quantized reflection coefficient 4 */ +extern const WebRtc_UWord16 WebRtcIsac_kQArRc4Cdf[12]; + +/* cdf for quantized reflection coefficient 5 */ +extern const WebRtc_UWord16 WebRtcIsac_kQArRc5Cdf[12]; + +/* cdf for quantized reflection coefficient 6 */ +extern const WebRtc_UWord16 WebRtcIsac_kQArRc6Cdf[12]; + +/* quantization boundary levels for reflection coefficients */ +extern const WebRtc_Word16 WebRtcIsac_kQArBoundaryLevels[12]; + +/* initial indices for AR reflection coefficient quantizer and cdf table search */ +extern const WebRtc_UWord16 WebRtcIsac_kQArRcInitIndex[AR_ORDER]; + +/* pointers to AR cdf tables */ +extern const WebRtc_UWord16 *WebRtcIsac_kQArRcCdfPtr[AR_ORDER]; + +/* pointers to AR representation levels tables */ +extern const WebRtc_Word16 *WebRtcIsac_kQArRcLevelsPtr[AR_ORDER]; + + +/******************** GAIN Coefficient Tables ***********************/ +/* cdf for Gain coefficient */ +extern const WebRtc_UWord16 WebRtcIsac_kQGainCdf[19]; + +/* representation levels for quantized Gain coefficient */ +extern const WebRtc_Word32 WebRtcIsac_kQGain2Levels[18]; + +/* squared quantization boundary levels for Gain coefficient */ +extern const WebRtc_Word32 WebRtcIsac_kQGain2BoundaryLevels[19]; + +/* pointer to Gain cdf table */ +extern const WebRtc_UWord16 *WebRtcIsac_kQGainCdf_ptr[1]; + +/* Gain initial index for gain quantizer and cdf table search */ +extern const WebRtc_UWord16 WebRtcIsac_kQGainInitIndex[1]; + +/************************* Cosine Tables ****************************/ +/* Cosine table */ +extern const WebRtc_Word16 WebRtcIsac_kCos[6][60]; + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_SPECTRUM_AR_MODEL_TABLES_H_ */ diff --git a/src/mod/codecs/mod_isac/spl_inl.h b/src/mod/codecs/mod_isac/spl_inl.h new file mode 100644 index 0000000000..23b32099a3 --- /dev/null +++ b/src/mod/codecs/mod_isac/spl_inl.h @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +// This header file includes the inline functions in +// the fix point signal processing library. + +#ifndef WEBRTC_SPL_SPL_INL_H_ +#define WEBRTC_SPL_SPL_INL_H_ + +#ifdef WEBRTC_ARCH_ARM_V7A +#include "spl_inl_armv7.h" +#else + +static __inline WebRtc_Word16 WebRtcSpl_SatW32ToW16(WebRtc_Word32 value32) { + WebRtc_Word16 out16 = (WebRtc_Word16) value32; + + if (value32 > 32767) + out16 = 32767; + else if (value32 < -32768) + out16 = -32768; + + return out16; +} + +static __inline WebRtc_Word16 WebRtcSpl_AddSatW16(WebRtc_Word16 a, + WebRtc_Word16 b) { + return WebRtcSpl_SatW32ToW16((WebRtc_Word32) a + (WebRtc_Word32) b); +} + +static __inline WebRtc_Word32 WebRtcSpl_AddSatW32(WebRtc_Word32 l_var1, + WebRtc_Word32 l_var2) { + WebRtc_Word32 l_sum; + + // perform long addition + l_sum = l_var1 + l_var2; + + // check for under or overflow + if (WEBRTC_SPL_IS_NEG(l_var1)) { + if (WEBRTC_SPL_IS_NEG(l_var2) && !WEBRTC_SPL_IS_NEG(l_sum)) { + l_sum = (WebRtc_Word32)0x80000000; + } + } else { + if (!WEBRTC_SPL_IS_NEG(l_var2) && WEBRTC_SPL_IS_NEG(l_sum)) { + l_sum = (WebRtc_Word32)0x7FFFFFFF; + } + } + + return l_sum; +} + +static __inline WebRtc_Word16 WebRtcSpl_SubSatW16(WebRtc_Word16 var1, + WebRtc_Word16 var2) { + return WebRtcSpl_SatW32ToW16((WebRtc_Word32) var1 - (WebRtc_Word32) var2); +} + +static __inline WebRtc_Word32 WebRtcSpl_SubSatW32(WebRtc_Word32 l_var1, + WebRtc_Word32 l_var2) { + WebRtc_Word32 l_diff; + + // perform subtraction + l_diff = l_var1 - l_var2; + + // check for underflow + if ((l_var1 < 0) && (l_var2 > 0) && (l_diff > 0)) + l_diff = (WebRtc_Word32)0x80000000; + // check for overflow + if ((l_var1 > 0) && (l_var2 < 0) && (l_diff < 0)) + l_diff = (WebRtc_Word32)0x7FFFFFFF; + + return l_diff; +} + +static __inline WebRtc_Word16 WebRtcSpl_GetSizeInBits(WebRtc_UWord32 n) { + int bits; + + if (0xFFFF0000 & n) { + bits = 16; + } else { + bits = 0; + } + if (0x0000FF00 & (n >> bits)) bits += 8; + if (0x000000F0 & (n >> bits)) bits += 4; + if (0x0000000C & (n >> bits)) bits += 2; + if (0x00000002 & (n >> bits)) bits += 1; + if (0x00000001 & (n >> bits)) bits += 1; + + return bits; +} + +static __inline int WebRtcSpl_NormW32(WebRtc_Word32 a) { + int zeros; + + if (a <= 0) a ^= 0xFFFFFFFF; + + if (!(0xFFFF8000 & a)) { + zeros = 16; + } else { + zeros = 0; + } + if (!(0xFF800000 & (a << zeros))) zeros += 8; + if (!(0xF8000000 & (a << zeros))) zeros += 4; + if (!(0xE0000000 & (a << zeros))) zeros += 2; + if (!(0xC0000000 & (a << zeros))) zeros += 1; + + return zeros; +} + +static __inline int WebRtcSpl_NormU32(WebRtc_UWord32 a) { + int zeros; + + if (a == 0) return 0; + + if (!(0xFFFF0000 & a)) { + zeros = 16; + } else { + zeros = 0; + } + if (!(0xFF000000 & (a << zeros))) zeros += 8; + if (!(0xF0000000 & (a << zeros))) zeros += 4; + if (!(0xC0000000 & (a << zeros))) zeros += 2; + if (!(0x80000000 & (a << zeros))) zeros += 1; + + return zeros; +} + +static __inline int WebRtcSpl_NormW16(WebRtc_Word16 a) { + int zeros; + + if (a <= 0) a ^= 0xFFFF; + + if (!(0xFF80 & a)) { + zeros = 8; + } else { + zeros = 0; + } + if (!(0xF800 & (a << zeros))) zeros += 4; + if (!(0xE000 & (a << zeros))) zeros += 2; + if (!(0xC000 & (a << zeros))) zeros += 1; + + return zeros; +} + +static __inline int32_t WebRtc_MulAccumW16(int16_t a, + int16_t b, + int32_t c) { + return (a * b + c); +} + +#endif // WEBRTC_ARCH_ARM_V7A + +#endif // WEBRTC_SPL_SPL_INL_H_ diff --git a/src/mod/codecs/mod_isac/spl_inl_armv7.h b/src/mod/codecs/mod_isac/spl_inl_armv7.h new file mode 100644 index 0000000000..689c2baeea --- /dev/null +++ b/src/mod/codecs/mod_isac/spl_inl_armv7.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +// This header file includes the inline functions for ARM processors in +// the fix point signal processing library. + +#ifndef WEBRTC_SPL_SPL_INL_ARMV7_H_ +#define WEBRTC_SPL_SPL_INL_ARMV7_H_ + +static __inline WebRtc_Word32 WEBRTC_SPL_MUL_16_32_RSFT16(WebRtc_Word16 a, + WebRtc_Word32 b) { + WebRtc_Word32 tmp; + __asm__("smulwb %0, %1, %2":"=r"(tmp):"r"(b), "r"(a)); + return tmp; +} + +static __inline WebRtc_Word32 WEBRTC_SPL_MUL_32_32_RSFT32(WebRtc_Word16 a, + WebRtc_Word16 b, + WebRtc_Word32 c) { + WebRtc_Word32 tmp; + __asm__("pkhbt %0, %1, %2, lsl #16" : "=r"(tmp) : "r"(b), "r"(a)); + __asm__("smmul %0, %1, %2":"=r"(tmp):"r"(tmp), "r"(c)); + return tmp; +} + +static __inline WebRtc_Word32 WEBRTC_SPL_MUL_32_32_RSFT32BI(WebRtc_Word32 a, + WebRtc_Word32 b) { + WebRtc_Word32 tmp; + __asm__("smmul %0, %1, %2":"=r"(tmp):"r"(a), "r"(b)); + return tmp; +} + +static __inline WebRtc_Word32 WEBRTC_SPL_MUL_16_16(WebRtc_Word16 a, + WebRtc_Word16 b) { + WebRtc_Word32 tmp; + __asm__("smulbb %0, %1, %2":"=r"(tmp):"r"(a), "r"(b)); + return tmp; +} + +static __inline int32_t WebRtc_MulAccumW16(int16_t a, + int16_t b, + int32_t c) { + int32_t tmp = 0; + __asm__("smlabb %0, %1, %2, %3":"=r"(tmp):"r"(a), "r"(b), "r"(c)); + return tmp; +} + +static __inline WebRtc_Word16 WebRtcSpl_AddSatW16(WebRtc_Word16 a, + WebRtc_Word16 b) { + WebRtc_Word32 s_sum; + + __asm__("qadd16 %0, %1, %2":"=r"(s_sum):"r"(a), "r"(b)); + + return (WebRtc_Word16) s_sum; +} + +static __inline WebRtc_Word32 WebRtcSpl_AddSatW32(WebRtc_Word32 l_var1, + WebRtc_Word32 l_var2) { + WebRtc_Word32 l_sum; + + __asm__("qadd %0, %1, %2":"=r"(l_sum):"r"(l_var1), "r"(l_var2)); + + return l_sum; +} + +static __inline WebRtc_Word16 WebRtcSpl_SubSatW16(WebRtc_Word16 var1, + WebRtc_Word16 var2) { + WebRtc_Word32 s_sub; + + __asm__("qsub16 %0, %1, %2":"=r"(s_sub):"r"(var1), "r"(var2)); + + return (WebRtc_Word16)s_sub; +} + +static __inline WebRtc_Word32 WebRtcSpl_SubSatW32(WebRtc_Word32 l_var1, + WebRtc_Word32 l_var2) { + WebRtc_Word32 l_sub; + + __asm__("qsub %0, %1, %2":"=r"(l_sub):"r"(l_var1), "r"(l_var2)); + + return l_sub; +} + +static __inline WebRtc_Word16 WebRtcSpl_GetSizeInBits(WebRtc_UWord32 n) { + WebRtc_Word32 tmp; + + __asm__("clz %0, %1":"=r"(tmp):"r"(n)); + + return (WebRtc_Word16)(32 - tmp); +} + +static __inline int WebRtcSpl_NormW32(WebRtc_Word32 a) { + WebRtc_Word32 tmp; + + if (a <= 0) a ^= 0xFFFFFFFF; + + __asm__("clz %0, %1":"=r"(tmp):"r"(a)); + + return tmp - 1; +} + +static __inline int WebRtcSpl_NormU32(WebRtc_UWord32 a) { + int tmp; + + if (a == 0) return 0; + + __asm__("clz %0, %1":"=r"(tmp):"r"(a)); + + return tmp; +} + +static __inline int WebRtcSpl_NormW16(WebRtc_Word16 a) { + WebRtc_Word32 tmp; + + if (a <= 0) a ^= 0xFFFFFFFF; + + __asm__("clz %0, %1":"=r"(tmp):"r"(a)); + + return tmp - 17; +} + +static __inline WebRtc_Word16 WebRtcSpl_SatW32ToW16(WebRtc_Word32 value32) { + WebRtc_Word16 out16; + + __asm__("ssat %r0, #16, %r1" : "=r"(out16) : "r"(value32)); + + return out16; +} +#endif // WEBRTC_SPL_SPL_INL_ARMV7_H_ diff --git a/src/mod/codecs/mod_isac/spl_sqrt.c b/src/mod/codecs/mod_isac/spl_sqrt.c new file mode 100644 index 0000000000..cfe2cd3f34 --- /dev/null +++ b/src/mod/codecs/mod_isac/spl_sqrt.c @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_Sqrt(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +WebRtc_Word32 WebRtcSpl_SqrtLocal(WebRtc_Word32 in); + +WebRtc_Word32 WebRtcSpl_SqrtLocal(WebRtc_Word32 in) +{ + + WebRtc_Word16 x_half, t16; + WebRtc_Word32 A, B, x2; + + /* The following block performs: + y=in/2 + x=y-2^30 + x_half=x/2^31 + t = 1 + (x_half) - 0.5*((x_half)^2) + 0.5*((x_half)^3) - 0.625*((x_half)^4) + + 0.875*((x_half)^5) + */ + + B = in; + + B = WEBRTC_SPL_RSHIFT_W32(B, 1); // B = in/2 + B = B - ((WebRtc_Word32)0x40000000); // B = in/2 - 1/2 + x_half = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(B, 16);// x_half = x/2 = (in-1)/2 + B = B + ((WebRtc_Word32)0x40000000); // B = 1 + x/2 + B = B + ((WebRtc_Word32)0x40000000); // Add 0.5 twice (since 1.0 does not exist in Q31) + + x2 = ((WebRtc_Word32)x_half) * ((WebRtc_Word32)x_half) * 2; // A = (x/2)^2 + A = -x2; // A = -(x/2)^2 + B = B + (A >> 1); // B = 1 + x/2 - 0.5*(x/2)^2 + + A = WEBRTC_SPL_RSHIFT_W32(A, 16); + A = A * A * 2; // A = (x/2)^4 + t16 = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(A, 16); + B = B + WEBRTC_SPL_MUL_16_16(-20480, t16) * 2; // B = B - 0.625*A + // After this, B = 1 + x/2 - 0.5*(x/2)^2 - 0.625*(x/2)^4 + + t16 = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(A, 16); + A = WEBRTC_SPL_MUL_16_16(x_half, t16) * 2; // A = (x/2)^5 + t16 = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(A, 16); + B = B + WEBRTC_SPL_MUL_16_16(28672, t16) * 2; // B = B + 0.875*A + // After this, B = 1 + x/2 - 0.5*(x/2)^2 - 0.625*(x/2)^4 + 0.875*(x/2)^5 + + t16 = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(x2, 16); + A = WEBRTC_SPL_MUL_16_16(x_half, t16) * 2; // A = x/2^3 + + B = B + (A >> 1); // B = B + 0.5*A + // After this, B = 1 + x/2 - 0.5*(x/2)^2 + 0.5*(x/2)^3 - 0.625*(x/2)^4 + 0.875*(x/2)^5 + + B = B + ((WebRtc_Word32)32768); // Round off bit + + return B; +} + +WebRtc_Word32 WebRtcSpl_Sqrt(WebRtc_Word32 value) +{ + /* + Algorithm: + + Six term Taylor Series is used here to compute the square root of a number + y^0.5 = (1+x)^0.5 where x = y-1 + = 1+(x/2)-0.5*((x/2)^2+0.5*((x/2)^3-0.625*((x/2)^4+0.875*((x/2)^5) + 0.5 <= x < 1 + + Example of how the algorithm works, with ut=sqrt(in), and + with in=73632 and ut=271 (even shift value case): + + in=73632 + y= in/131072 + x=y-1 + t = 1 + (x/2) - 0.5*((x/2)^2) + 0.5*((x/2)^3) - 0.625*((x/2)^4) + 0.875*((x/2)^5) + ut=t*(1/sqrt(2))*512 + + or: + + in=73632 + in2=73632*2^14 + y= in2/2^31 + x=y-1 + t = 1 + (x/2) - 0.5*((x/2)^2) + 0.5*((x/2)^3) - 0.625*((x/2)^4) + 0.875*((x/2)^5) + ut=t*(1/sqrt(2)) + ut2=ut*2^9 + + which gives: + + in = 73632 + in2 = 1206386688 + y = 0.56176757812500 + x = -0.43823242187500 + t = 0.74973506527313 + ut = 0.53014274874797 + ut2 = 2.714330873589594e+002 + + or: + + in=73632 + in2=73632*2^14 + y=in2/2 + x=y-2^30 + x_half=x/2^31 + t = 1 + (x_half) - 0.5*((x_half)^2) + 0.5*((x_half)^3) - 0.625*((x_half)^4) + + 0.875*((x_half)^5) + ut=t*(1/sqrt(2)) + ut2=ut*2^9 + + which gives: + + in = 73632 + in2 = 1206386688 + y = 603193344 + x = -470548480 + x_half = -0.21911621093750 + t = 0.74973506527313 + ut = 0.53014274874797 + ut2 = 2.714330873589594e+002 + + */ + + WebRtc_Word16 x_norm, nshift, t16, sh; + WebRtc_Word32 A; + + WebRtc_Word16 k_sqrt_2 = 23170; // 1/sqrt2 (==5a82) + + A = value; + + if (A == 0) + return (WebRtc_Word32)0; // sqrt(0) = 0 + + sh = WebRtcSpl_NormW32(A); // # shifts to normalize A + A = WEBRTC_SPL_LSHIFT_W32(A, sh); // Normalize A + if (A < (WEBRTC_SPL_WORD32_MAX - 32767)) + { + A = A + ((WebRtc_Word32)32768); // Round off bit + } else + { + A = WEBRTC_SPL_WORD32_MAX; + } + + x_norm = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(A, 16); // x_norm = AH + + nshift = WEBRTC_SPL_RSHIFT_W16(sh, 1); // nshift = sh>>1 + nshift = -nshift; // Negate the power for later de-normalization + + A = (WebRtc_Word32)WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)x_norm, 16); + A = WEBRTC_SPL_ABS_W32(A); // A = abs(x_norm<<16) + A = WebRtcSpl_SqrtLocal(A); // A = sqrt(A) + + if ((-2 * nshift) == sh) + { // Even shift value case + + t16 = (WebRtc_Word16)WEBRTC_SPL_RSHIFT_W32(A, 16); // t16 = AH + + A = WEBRTC_SPL_MUL_16_16(k_sqrt_2, t16) * 2; // A = 1/sqrt(2)*t16 + A = A + ((WebRtc_Word32)32768); // Round off + A = A & ((WebRtc_Word32)0x7fff0000); // Round off + + A = WEBRTC_SPL_RSHIFT_W32(A, 15); // A = A>>16 + + } else + { + A = WEBRTC_SPL_RSHIFT_W32(A, 16); // A = A>>16 + } + + A = A & ((WebRtc_Word32)0x0000ffff); + A = (WebRtc_Word32)WEBRTC_SPL_SHIFT_W32(A, nshift); // De-normalize the result + + return A; +} diff --git a/src/mod/codecs/mod_isac/spl_sqrt_floor.c b/src/mod/codecs/mod_isac/spl_sqrt_floor.c new file mode 100644 index 0000000000..aa36459ec4 --- /dev/null +++ b/src/mod/codecs/mod_isac/spl_sqrt_floor.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * This file contains the function WebRtcSpl_SqrtFloor(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +#define WEBRTC_SPL_SQRT_ITER(N) \ + try1 = root + (1 << (N)); \ + if (value >= try1 << (N)) \ + { \ + value -= try1 << (N); \ + root |= 2 << (N); \ + } + +// (out) Square root of input parameter +WebRtc_Word32 WebRtcSpl_SqrtFloor(WebRtc_Word32 value) +{ + // new routine for performance, 4 cycles/bit in ARM + // output precision is 16 bits + + WebRtc_Word32 root = 0, try1; + + WEBRTC_SPL_SQRT_ITER (15); + WEBRTC_SPL_SQRT_ITER (14); + WEBRTC_SPL_SQRT_ITER (13); + WEBRTC_SPL_SQRT_ITER (12); + WEBRTC_SPL_SQRT_ITER (11); + WEBRTC_SPL_SQRT_ITER (10); + WEBRTC_SPL_SQRT_ITER ( 9); + WEBRTC_SPL_SQRT_ITER ( 8); + WEBRTC_SPL_SQRT_ITER ( 7); + WEBRTC_SPL_SQRT_ITER ( 6); + WEBRTC_SPL_SQRT_ITER ( 5); + WEBRTC_SPL_SQRT_ITER ( 4); + WEBRTC_SPL_SQRT_ITER ( 3); + WEBRTC_SPL_SQRT_ITER ( 2); + WEBRTC_SPL_SQRT_ITER ( 1); + WEBRTC_SPL_SQRT_ITER ( 0); + + return root >> 1; +} diff --git a/src/mod/codecs/mod_isac/spl_version.c b/src/mod/codecs/mod_isac/spl_version.c new file mode 100644 index 0000000000..936925ea14 --- /dev/null +++ b/src/mod/codecs/mod_isac/spl_version.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_get_version(). + * The description header can be found in signal_processing_library.h + * + */ + +#include +#include "signal_processing_library.h" + +WebRtc_Word16 WebRtcSpl_get_version(char* version, WebRtc_Word16 length_in_bytes) +{ + strncpy(version, "1.2.0", length_in_bytes); + return 0; +} diff --git a/src/mod/codecs/mod_isac/splitting_filter.c b/src/mod/codecs/mod_isac/splitting_filter.c new file mode 100644 index 0000000000..f1acf675f9 --- /dev/null +++ b/src/mod/codecs/mod_isac/splitting_filter.c @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * This file contains the splitting filter functions. + * + */ + +#include "signal_processing_library.h" + +// Number of samples in a low/high-band frame. +enum +{ + kBandFrameLength = 160 +}; + +// QMF filter coefficients in Q16. +static const WebRtc_UWord16 WebRtcSpl_kAllPassFilter1[3] = {6418, 36982, 57261}; +static const WebRtc_UWord16 WebRtcSpl_kAllPassFilter2[3] = {21333, 49062, 63010}; + +/////////////////////////////////////////////////////////////////////////////////////////////// +// WebRtcSpl_AllPassQMF(...) +// +// Allpass filter used by the analysis and synthesis parts of the QMF filter. +// +// Input: +// - in_data : Input data sequence (Q10) +// - data_length : Length of data sequence (>2) +// - filter_coefficients : Filter coefficients (length 3, Q16) +// +// Input & Output: +// - filter_state : Filter state (length 6, Q10). +// +// Output: +// - out_data : Output data sequence (Q10), length equal to +// |data_length| +// + +void WebRtcSpl_AllPassQMF(WebRtc_Word32* in_data, const WebRtc_Word16 data_length, + WebRtc_Word32* out_data, const WebRtc_UWord16* filter_coefficients, + WebRtc_Word32* filter_state) +{ + // The procedure is to filter the input with three first order all pass filters + // (cascade operations). + // + // a_3 + q^-1 a_2 + q^-1 a_1 + q^-1 + // y[n] = ----------- ----------- ----------- x[n] + // 1 + a_3q^-1 1 + a_2q^-1 1 + a_1q^-1 + // + // The input vector |filter_coefficients| includes these three filter coefficients. + // The filter state contains the in_data state, in_data[-1], followed by + // the out_data state, out_data[-1]. This is repeated for each cascade. + // The first cascade filter will filter the |in_data| and store the output in + // |out_data|. The second will the take the |out_data| as input and make an + // intermediate storage in |in_data|, to save memory. The third, and final, cascade + // filter operation takes the |in_data| (which is the output from the previous cascade + // filter) and store the output in |out_data|. + // Note that the input vector values are changed during the process. + WebRtc_Word16 k; + WebRtc_Word32 diff; + // First all-pass cascade; filter from in_data to out_data. + + // Let y_i[n] indicate the output of cascade filter i (with filter coefficient a_i) at + // vector position n. Then the final output will be y[n] = y_3[n] + + // First loop, use the states stored in memory. + // "diff" should be safe from wrap around since max values are 2^25 + diff = WEBRTC_SPL_SUB_SAT_W32(in_data[0], filter_state[1]); // = (x[0] - y_1[-1]) + // y_1[0] = x[-1] + a_1 * (x[0] - y_1[-1]) + out_data[0] = WEBRTC_SPL_SCALEDIFF32(filter_coefficients[0], diff, filter_state[0]); + + // For the remaining loops, use previous values. + for (k = 1; k < data_length; k++) + { + diff = WEBRTC_SPL_SUB_SAT_W32(in_data[k], out_data[k - 1]); // = (x[n] - y_1[n-1]) + // y_1[n] = x[n-1] + a_1 * (x[n] - y_1[n-1]) + out_data[k] = WEBRTC_SPL_SCALEDIFF32(filter_coefficients[0], diff, in_data[k - 1]); + } + + // Update states. + filter_state[0] = in_data[data_length - 1]; // x[N-1], becomes x[-1] next time + filter_state[1] = out_data[data_length - 1]; // y_1[N-1], becomes y_1[-1] next time + + // Second all-pass cascade; filter from out_data to in_data. + diff = WEBRTC_SPL_SUB_SAT_W32(out_data[0], filter_state[3]); // = (y_1[0] - y_2[-1]) + // y_2[0] = y_1[-1] + a_2 * (y_1[0] - y_2[-1]) + in_data[0] = WEBRTC_SPL_SCALEDIFF32(filter_coefficients[1], diff, filter_state[2]); + for (k = 1; k < data_length; k++) + { + diff = WEBRTC_SPL_SUB_SAT_W32(out_data[k], in_data[k - 1]); // =(y_1[n] - y_2[n-1]) + // y_2[0] = y_1[-1] + a_2 * (y_1[0] - y_2[-1]) + in_data[k] = WEBRTC_SPL_SCALEDIFF32(filter_coefficients[1], diff, out_data[k-1]); + } + + filter_state[2] = out_data[data_length - 1]; // y_1[N-1], becomes y_1[-1] next time + filter_state[3] = in_data[data_length - 1]; // y_2[N-1], becomes y_2[-1] next time + + // Third all-pass cascade; filter from in_data to out_data. + diff = WEBRTC_SPL_SUB_SAT_W32(in_data[0], filter_state[5]); // = (y_2[0] - y[-1]) + // y[0] = y_2[-1] + a_3 * (y_2[0] - y[-1]) + out_data[0] = WEBRTC_SPL_SCALEDIFF32(filter_coefficients[2], diff, filter_state[4]); + for (k = 1; k < data_length; k++) + { + diff = WEBRTC_SPL_SUB_SAT_W32(in_data[k], out_data[k - 1]); // = (y_2[n] - y[n-1]) + // y[n] = y_2[n-1] + a_3 * (y_2[n] - y[n-1]) + out_data[k] = WEBRTC_SPL_SCALEDIFF32(filter_coefficients[2], diff, in_data[k-1]); + } + filter_state[4] = in_data[data_length - 1]; // y_2[N-1], becomes y_2[-1] next time + filter_state[5] = out_data[data_length - 1]; // y[N-1], becomes y[-1] next time +} + +void WebRtcSpl_AnalysisQMF(const WebRtc_Word16* in_data, WebRtc_Word16* low_band, + WebRtc_Word16* high_band, WebRtc_Word32* filter_state1, + WebRtc_Word32* filter_state2) +{ + WebRtc_Word16 i; + WebRtc_Word16 k; + WebRtc_Word32 tmp; + WebRtc_Word32 half_in1[kBandFrameLength]; + WebRtc_Word32 half_in2[kBandFrameLength]; + WebRtc_Word32 filter1[kBandFrameLength]; + WebRtc_Word32 filter2[kBandFrameLength]; + + // Split even and odd samples. Also shift them to Q10. + for (i = 0, k = 0; i < kBandFrameLength; i++, k += 2) + { + half_in2[i] = WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)in_data[k], 10); + half_in1[i] = WEBRTC_SPL_LSHIFT_W32((WebRtc_Word32)in_data[k + 1], 10); + } + + // All pass filter even and odd samples, independently. + WebRtcSpl_AllPassQMF(half_in1, kBandFrameLength, filter1, WebRtcSpl_kAllPassFilter1, + filter_state1); + WebRtcSpl_AllPassQMF(half_in2, kBandFrameLength, filter2, WebRtcSpl_kAllPassFilter2, + filter_state2); + + // Take the sum and difference of filtered version of odd and even + // branches to get upper & lower band. + for (i = 0; i < kBandFrameLength; i++) + { + tmp = filter1[i] + filter2[i] + 1024; + tmp = WEBRTC_SPL_RSHIFT_W32(tmp, 11); + low_band[i] = WebRtcSpl_SatW32ToW16(tmp); + + tmp = filter1[i] - filter2[i] + 1024; + tmp = WEBRTC_SPL_RSHIFT_W32(tmp, 11); + high_band[i] = WebRtcSpl_SatW32ToW16(tmp); + } +} + +void WebRtcSpl_SynthesisQMF(const WebRtc_Word16* low_band, const WebRtc_Word16* high_band, + WebRtc_Word16* out_data, WebRtc_Word32* filter_state1, + WebRtc_Word32* filter_state2) +{ + WebRtc_Word32 tmp; + WebRtc_Word32 half_in1[kBandFrameLength]; + WebRtc_Word32 half_in2[kBandFrameLength]; + WebRtc_Word32 filter1[kBandFrameLength]; + WebRtc_Word32 filter2[kBandFrameLength]; + WebRtc_Word16 i; + WebRtc_Word16 k; + + // Obtain the sum and difference channels out of upper and lower-band channels. + // Also shift to Q10 domain. + for (i = 0; i < kBandFrameLength; i++) + { + tmp = (WebRtc_Word32)low_band[i] + (WebRtc_Word32)high_band[i]; + half_in1[i] = WEBRTC_SPL_LSHIFT_W32(tmp, 10); + tmp = (WebRtc_Word32)low_band[i] - (WebRtc_Word32)high_band[i]; + half_in2[i] = WEBRTC_SPL_LSHIFT_W32(tmp, 10); + } + + // all-pass filter the sum and difference channels + WebRtcSpl_AllPassQMF(half_in1, kBandFrameLength, filter1, WebRtcSpl_kAllPassFilter2, + filter_state1); + WebRtcSpl_AllPassQMF(half_in2, kBandFrameLength, filter2, WebRtcSpl_kAllPassFilter1, + filter_state2); + + // The filtered signals are even and odd samples of the output. Combine + // them. The signals are Q10 should shift them back to Q0 and take care of + // saturation. + for (i = 0, k = 0; i < kBandFrameLength; i++) + { + tmp = WEBRTC_SPL_RSHIFT_W32(filter2[i] + 512, 10); + out_data[k++] = WebRtcSpl_SatW32ToW16(tmp); + + tmp = WEBRTC_SPL_RSHIFT_W32(filter1[i] + 512, 10); + out_data[k++] = WebRtcSpl_SatW32ToW16(tmp); + } + +} diff --git a/src/mod/codecs/mod_isac/sqrt_of_one_minus_x_squared.c b/src/mod/codecs/mod_isac/sqrt_of_one_minus_x_squared.c new file mode 100644 index 0000000000..9fb2c73bc5 --- /dev/null +++ b/src/mod/codecs/mod_isac/sqrt_of_one_minus_x_squared.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the function WebRtcSpl_SqrtOfOneMinusXSquared(). + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_SqrtOfOneMinusXSquared(WebRtc_Word16 *xQ15, int vector_length, + WebRtc_Word16 *yQ15) +{ + WebRtc_Word32 sq; + int m; + WebRtc_Word16 tmp; + + for (m = 0; m < vector_length; m++) + { + tmp = xQ15[m]; + sq = WEBRTC_SPL_MUL_16_16(tmp, tmp); // x^2 in Q30 + sq = 1073741823 - sq; // 1-x^2, where 1 ~= 0.99999999906 is 1073741823 in Q30 + sq = WebRtcSpl_Sqrt(sq); // sqrt(1-x^2) in Q15 + yQ15[m] = (WebRtc_Word16)sq; + } +} diff --git a/src/mod/codecs/mod_isac/structs.h b/src/mod/codecs/mod_isac/structs.h new file mode 100644 index 0000000000..7523ad6e4a --- /dev/null +++ b/src/mod/codecs/mod_isac/structs.h @@ -0,0 +1,478 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * structs.h + * + * This header file contains all the structs used in the ISAC codec + * + */ + +#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_STRUCTS_H_ +#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_STRUCTS_H_ + + +#include "typedefs.h" +#include "settings.h" +#include "isac.h" + +typedef struct Bitstreamstruct { + + WebRtc_UWord8 stream[STREAM_SIZE_MAX]; + WebRtc_UWord32 W_upper; + WebRtc_UWord32 streamval; + WebRtc_UWord32 stream_index; + +} Bitstr; + +typedef struct { + + double DataBufferLo[WINLEN]; + double DataBufferHi[WINLEN]; + + double CorrBufLo[ORDERLO+1]; + double CorrBufHi[ORDERHI+1]; + + float PreStateLoF[ORDERLO+1]; + float PreStateLoG[ORDERLO+1]; + float PreStateHiF[ORDERHI+1]; + float PreStateHiG[ORDERHI+1]; + float PostStateLoF[ORDERLO+1]; + float PostStateLoG[ORDERLO+1]; + float PostStateHiF[ORDERHI+1]; + float PostStateHiG[ORDERHI+1]; + + double OldEnergy; + +} MaskFiltstr; + + +typedef struct { + + //state vectors for each of the two analysis filters + double INSTAT1[2*(QORDER-1)]; + double INSTAT2[2*(QORDER-1)]; + double INSTATLA1[2*(QORDER-1)]; + double INSTATLA2[2*(QORDER-1)]; + double INLABUF1[QLOOKAHEAD]; + double INLABUF2[QLOOKAHEAD]; + + float INSTAT1_float[2*(QORDER-1)]; + float INSTAT2_float[2*(QORDER-1)]; + float INSTATLA1_float[2*(QORDER-1)]; + float INSTATLA2_float[2*(QORDER-1)]; + float INLABUF1_float[QLOOKAHEAD]; + float INLABUF2_float[QLOOKAHEAD]; + + /* High pass filter */ + double HPstates[HPORDER]; + float HPstates_float[HPORDER]; + +} PreFiltBankstr; + + +typedef struct { + + //state vectors for each of the two analysis filters + double STATE_0_LOWER[2*POSTQORDER]; + double STATE_0_UPPER[2*POSTQORDER]; + + /* High pass filter */ + double HPstates1[HPORDER]; + double HPstates2[HPORDER]; + + float STATE_0_LOWER_float[2*POSTQORDER]; + float STATE_0_UPPER_float[2*POSTQORDER]; + + float HPstates1_float[HPORDER]; + float HPstates2_float[HPORDER]; + +} PostFiltBankstr; + +typedef struct { + + //data buffer for pitch filter + double ubuf[PITCH_BUFFSIZE]; + + //low pass state vector + double ystate[PITCH_DAMPORDER]; + + //old lag and gain + double oldlagp[1]; + double oldgainp[1]; + +} PitchFiltstr; + +typedef struct { + + //data buffer + double buffer[PITCH_WLPCBUFLEN]; + + //state vectors + double istate[PITCH_WLPCORDER]; + double weostate[PITCH_WLPCORDER]; + double whostate[PITCH_WLPCORDER]; + + //LPC window -> should be a global array because constant + double window[PITCH_WLPCWINLEN]; + +} WeightFiltstr; + +typedef struct { + + //for inital estimator + double dec_buffer[PITCH_CORR_LEN2 + PITCH_CORR_STEP2 + + PITCH_MAX_LAG/2 - PITCH_FRAME_LEN/2+2]; + double decimator_state[2*ALLPASSSECTIONS+1]; + double hp_state[2]; + + double whitened_buf[QLOOKAHEAD]; + + double inbuf[QLOOKAHEAD]; + + PitchFiltstr PFstr_wght; + PitchFiltstr PFstr; + WeightFiltstr Wghtstr; + +} PitchAnalysisStruct; + + + +/* Have instance of struct together with other iSAC structs */ +typedef struct { + + /* Previous frame length (in ms) */ + WebRtc_Word32 prev_frame_length; + + /* Previous RTP timestamp from received + packet (in samples relative beginning) */ + WebRtc_Word32 prev_rec_rtp_number; + + /* Send timestamp for previous packet (in ms using timeGetTime()) */ + WebRtc_UWord32 prev_rec_send_ts; + + /* Arrival time for previous packet (in ms using timeGetTime()) */ + WebRtc_UWord32 prev_rec_arr_ts; + + /* rate of previous packet, derived from RTP timestamps (in bits/s) */ + float prev_rec_rtp_rate; + + /* Time sinse the last update of the BN estimate (in ms) */ + WebRtc_UWord32 last_update_ts; + + /* Time sinse the last reduction (in ms) */ + WebRtc_UWord32 last_reduction_ts; + + /* How many times the estimate was update in the beginning */ + WebRtc_Word32 count_tot_updates_rec; + + /* The estimated bottle neck rate from there to here (in bits/s) */ + WebRtc_Word32 rec_bw; + float rec_bw_inv; + float rec_bw_avg; + float rec_bw_avg_Q; + + /* The estimated mean absolute jitter value, + as seen on this side (in ms) */ + float rec_jitter; + float rec_jitter_short_term; + float rec_jitter_short_term_abs; + float rec_max_delay; + float rec_max_delay_avg_Q; + + /* (assumed) bitrate for headers (bps) */ + float rec_header_rate; + + /* The estimated bottle neck rate from here to there (in bits/s) */ + float send_bw_avg; + + /* The estimated mean absolute jitter value, as seen on + the other siee (in ms) */ + float send_max_delay_avg; + + // number of packets received since last update + int num_pkts_rec; + + int num_consec_rec_pkts_over_30k; + + // flag for marking that a high speed network has been + // detected downstream + int hsn_detect_rec; + + int num_consec_snt_pkts_over_30k; + + // flag for marking that a high speed network has + // been detected upstream + int hsn_detect_snd; + + WebRtc_UWord32 start_wait_period; + + int in_wait_period; + + int change_to_WB; + + WebRtc_UWord32 senderTimestamp; + WebRtc_UWord32 receiverTimestamp; + //enum IsacSamplingRate incomingStreamSampFreq; + WebRtc_UWord16 numConsecLatePkts; + float consecLatency; + WebRtc_Word16 inWaitLatePkts; +} BwEstimatorstr; + + +typedef struct { + + /* boolean, flags if previous packet exceeded B.N. */ + int PrevExceed; + /* ms */ + int ExceedAgo; + /* packets left to send in current burst */ + int BurstCounter; + /* packets */ + int InitCounter; + /* ms remaining in buffer when next packet will be sent */ + double StillBuffered; + +} RateModel; + + +typedef struct { + + unsigned int SpaceAlloced; + unsigned int MaxPermAlloced; + double Tmp0[MAXFFTSIZE]; + double Tmp1[MAXFFTSIZE]; + double Tmp2[MAXFFTSIZE]; + double Tmp3[MAXFFTSIZE]; + int Perm[MAXFFTSIZE]; + int factor [NFACTOR]; + +} FFTstr; + + +/* The following strutc is used to store data from encoding, to make it + fast and easy to construct a new bitstream with a different Bandwidth + estimate. All values (except framelength and minBytes) is double size to + handle 60 ms of data. +*/ +typedef struct { + + /* Used to keep track of if it is first or second part of 60 msec packet */ + int startIdx; + + /* Frame length in samples */ + WebRtc_Word16 framelength; + + /* Pitch Gain */ + int pitchGain_index[2]; + + /* Pitch Lag */ + double meanGain[2]; + int pitchIndex[PITCH_SUBFRAMES*2]; + + /* LPC */ + int LPCmodel[2]; + int LPCindex_s[108*2]; /* KLT_ORDER_SHAPE = 108 */ + int LPCindex_g[12*2]; /* KLT_ORDER_GAIN = 12 */ + double LPCcoeffs_lo[(ORDERLO+1)*SUBFRAMES*2]; + double LPCcoeffs_hi[(ORDERHI+1)*SUBFRAMES*2]; + + /* Encode Spec */ + WebRtc_Word16 fre[FRAMESAMPLES]; + WebRtc_Word16 fim[FRAMESAMPLES]; + WebRtc_Word16 AvgPitchGain[2]; + + /* Used in adaptive mode only */ + int minBytes; + +} ISAC_SaveEncData_t; + + +typedef struct { + + int indexLPCShape[UB_LPC_ORDER * UB16_LPC_VEC_PER_FRAME]; + double lpcGain[SUBFRAMES<<1]; + int lpcGainIndex[SUBFRAMES<<1]; + + Bitstr bitStreamObj; + + WebRtc_Word16 realFFT[FRAMESAMPLES_HALF]; + WebRtc_Word16 imagFFT[FRAMESAMPLES_HALF]; +} ISACUBSaveEncDataStruct; + + + +typedef struct { + + Bitstr bitstr_obj; + MaskFiltstr maskfiltstr_obj; + PreFiltBankstr prefiltbankstr_obj; + PitchFiltstr pitchfiltstr_obj; + PitchAnalysisStruct pitchanalysisstr_obj; + FFTstr fftstr_obj; + ISAC_SaveEncData_t SaveEnc_obj; + + int buffer_index; + WebRtc_Word16 current_framesamples; + + float data_buffer_float[FRAMESAMPLES_30ms]; + + int frame_nb; + double bottleneck; + WebRtc_Word16 new_framelength; + double s2nr; + + /* Maximum allowed number of bits for a 30 msec packet */ + WebRtc_Word16 payloadLimitBytes30; + /* Maximum allowed number of bits for a 30 msec packet */ + WebRtc_Word16 payloadLimitBytes60; + /* Maximum allowed number of bits for both 30 and 60 msec packet */ + WebRtc_Word16 maxPayloadBytes; + /* Maximum allowed rate in bytes per 30 msec packet */ + WebRtc_Word16 maxRateInBytes; + + /*--- + If set to 1 iSAC will not addapt the frame-size, if used in + channel-adaptive mode. The initial value will be used for all rates. + ---*/ + WebRtc_Word16 enforceFrameSize; + + /*----- + This records the BWE index the encoder injected into the bit-stream. + It will be used in RCU. The same BWE index of main paylaod will be in + the redundant payload. We can not retrive it from BWE because it is + a recursive procedure (WebRtcIsac_GetDownlinkBwJitIndexImpl) and has to be + called only once per each encode. + -----*/ + WebRtc_Word16 lastBWIdx; +} ISACLBEncStruct; + +typedef struct { + + Bitstr bitstr_obj; + MaskFiltstr maskfiltstr_obj; + PreFiltBankstr prefiltbankstr_obj; + FFTstr fftstr_obj; + ISACUBSaveEncDataStruct SaveEnc_obj; + + int buffer_index; + float data_buffer_float[MAX_FRAMESAMPLES + + LB_TOTAL_DELAY_SAMPLES]; + double bottleneck; + /* Maximum allowed number of bits for a 30 msec packet */ + //WebRtc_Word16 payloadLimitBytes30; + /* Maximum allowed number of bits for both 30 and 60 msec packet */ + //WebRtc_Word16 maxPayloadBytes; + WebRtc_Word16 maxPayloadSizeBytes; + + double lastLPCVec[UB_LPC_ORDER]; + WebRtc_Word16 numBytesUsed; + WebRtc_Word16 lastJitterInfo; +} ISACUBEncStruct; + + + +typedef struct { + + Bitstr bitstr_obj; + MaskFiltstr maskfiltstr_obj; + PostFiltBankstr postfiltbankstr_obj; + PitchFiltstr pitchfiltstr_obj; + FFTstr fftstr_obj; + +} ISACLBDecStruct; + +typedef struct { + + Bitstr bitstr_obj; + MaskFiltstr maskfiltstr_obj; + PostFiltBankstr postfiltbankstr_obj; + FFTstr fftstr_obj; + +} ISACUBDecStruct; + + + +typedef struct { + + ISACLBEncStruct ISACencLB_obj; + ISACLBDecStruct ISACdecLB_obj; +} ISACLBStruct; + + +typedef struct { + + ISACUBEncStruct ISACencUB_obj; + ISACUBDecStruct ISACdecUB_obj; +} ISACUBStruct; + +/* + This struct is used to take a snapshot of the entropy coder and LPC gains + right before encoding LPC gains. This allows us to go back to that state + if we like to limit the payload size. +*/ +typedef struct { + /* 6 lower-band & 6 upper-band */ + double loFiltGain[SUBFRAMES]; + double hiFiltGain[SUBFRAMES]; + /* Upper boundary of interval W */ + WebRtc_UWord32 W_upper; + WebRtc_UWord32 streamval; + /* Index to the current position in bytestream */ + WebRtc_UWord32 stream_index; + WebRtc_UWord8 stream[3]; +} transcode_obj; + + +typedef struct { + // lower-band codec instance + ISACLBStruct instLB; + // upper-band codec instance + ISACUBStruct instUB; + + // Bandwidth Estimator and model for the rate. + BwEstimatorstr bwestimator_obj; + RateModel rate_data_obj; + double MaxDelay; + + /* 0 = adaptive; 1 = instantaneous */ + WebRtc_Word16 codingMode; + + // overall bottleneck of the codec + WebRtc_Word32 bottleneck; + + // QMF Filter state + WebRtc_Word32 analysisFBState1[FB_STATE_SIZE_WORD32]; + WebRtc_Word32 analysisFBState2[FB_STATE_SIZE_WORD32]; + WebRtc_Word32 synthesisFBState1[FB_STATE_SIZE_WORD32]; + WebRtc_Word32 synthesisFBState2[FB_STATE_SIZE_WORD32]; + + // Error Code + WebRtc_Word16 errorCode; + + // bandwidth of the encoded audio 8, 12 or 16 kHz + enum ISACBandwidth bandwidthKHz; + // Sampling rate of audio, encoder and decode, 8 or 16 kHz + enum IsacSamplingRate encoderSamplingRateKHz; + enum IsacSamplingRate decoderSamplingRateKHz; + // Flag to keep track of initializations, lower & upper-band + // encoder and decoder. + WebRtc_Word16 initFlag; + + // Flag to to indicate signal bandwidth switch + WebRtc_Word16 resetFlag_8kHz; + + // Maximum allowed rate, measured in Bytes per 30 ms. + WebRtc_Word16 maxRateBytesPer30Ms; + // Maximum allowed payload-size, measured in Bytes. + WebRtc_Word16 maxPayloadSizeBytes; +} ISACMainStruct; + +#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_STRUCTS_H_ */ diff --git a/src/mod/codecs/mod_isac/transform.c b/src/mod/codecs/mod_isac/transform.c new file mode 100644 index 0000000000..97b801ac49 --- /dev/null +++ b/src/mod/codecs/mod_isac/transform.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "settings.h" +#include "fft.h" +#include "codec.h" +#include "os_specific_inline.h" +#include + +static double costab1[FRAMESAMPLES_HALF]; +static double sintab1[FRAMESAMPLES_HALF]; +static double costab2[FRAMESAMPLES_QUARTER]; +static double sintab2[FRAMESAMPLES_QUARTER]; + +void WebRtcIsac_InitTransform() +{ + int k; + double fact, phase; + + fact = PI / (FRAMESAMPLES_HALF); + phase = 0.0; + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + costab1[k] = cos(phase); + sintab1[k] = sin(phase); + phase += fact; + } + + fact = PI * ((double) (FRAMESAMPLES_HALF - 1)) / ((double) FRAMESAMPLES_HALF); + phase = 0.5 * fact; + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) { + costab2[k] = cos(phase); + sintab2[k] = sin(phase); + phase += fact; + } +} + + +void WebRtcIsac_Time2Spec(double *inre1, + double *inre2, + WebRtc_Word16 *outreQ7, + WebRtc_Word16 *outimQ7, + FFTstr *fftstr_obj) +{ + + int k; + int dims[1]; + double tmp1r, tmp1i, xr, xi, yr, yi, fact; + double tmpre[FRAMESAMPLES_HALF], tmpim[FRAMESAMPLES_HALF]; + + + dims[0] = FRAMESAMPLES_HALF; + + + /* Multiply with complex exponentials and combine into one complex vector */ + fact = 0.5 / sqrt(FRAMESAMPLES_HALF); + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + tmp1r = costab1[k]; + tmp1i = sintab1[k]; + tmpre[k] = (inre1[k] * tmp1r + inre2[k] * tmp1i) * fact; + tmpim[k] = (inre2[k] * tmp1r - inre1[k] * tmp1i) * fact; + } + + + /* Get DFT */ + WebRtcIsac_Fftns(1, dims, tmpre, tmpim, -1, 1.0, fftstr_obj); + + /* Use symmetry to separate into two complex vectors and center frames in time around zero */ + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) { + xr = tmpre[k] + tmpre[FRAMESAMPLES_HALF - 1 - k]; + yi = -tmpre[k] + tmpre[FRAMESAMPLES_HALF - 1 - k]; + xi = tmpim[k] - tmpim[FRAMESAMPLES_HALF - 1 - k]; + yr = tmpim[k] + tmpim[FRAMESAMPLES_HALF - 1 - k]; + + tmp1r = costab2[k]; + tmp1i = sintab2[k]; + outreQ7[k] = (WebRtc_Word16)WebRtcIsac_lrint((xr * tmp1r - xi * tmp1i) * 128.0); + outimQ7[k] = (WebRtc_Word16)WebRtcIsac_lrint((xr * tmp1i + xi * tmp1r) * 128.0); + outreQ7[FRAMESAMPLES_HALF - 1 - k] = (WebRtc_Word16)WebRtcIsac_lrint((-yr * tmp1i - yi * tmp1r) * 128.0); + outimQ7[FRAMESAMPLES_HALF - 1 - k] = (WebRtc_Word16)WebRtcIsac_lrint((-yr * tmp1r + yi * tmp1i) * 128.0); + } +} + + +void WebRtcIsac_Spec2time(double *inre, double *inim, double *outre1, double *outre2, FFTstr *fftstr_obj) +{ + + int k; + double tmp1r, tmp1i, xr, xi, yr, yi, fact; + + int dims; + + dims = FRAMESAMPLES_HALF; + + for (k = 0; k < FRAMESAMPLES_QUARTER; k++) { + /* Move zero in time to beginning of frames */ + tmp1r = costab2[k]; + tmp1i = sintab2[k]; + xr = inre[k] * tmp1r + inim[k] * tmp1i; + xi = inim[k] * tmp1r - inre[k] * tmp1i; + yr = -inim[FRAMESAMPLES_HALF - 1 - k] * tmp1r - inre[FRAMESAMPLES_HALF - 1 - k] * tmp1i; + yi = -inre[FRAMESAMPLES_HALF - 1 - k] * tmp1r + inim[FRAMESAMPLES_HALF - 1 - k] * tmp1i; + + /* Combine into one vector, z = x + j * y */ + outre1[k] = xr - yi; + outre1[FRAMESAMPLES_HALF - 1 - k] = xr + yi; + outre2[k] = xi + yr; + outre2[FRAMESAMPLES_HALF - 1 - k] = -xi + yr; + } + + + /* Get IDFT */ + WebRtcIsac_Fftns(1, &dims, outre1, outre2, 1, FRAMESAMPLES_HALF, fftstr_obj); + + + /* Demodulate and separate */ + fact = sqrt(FRAMESAMPLES_HALF); + for (k = 0; k < FRAMESAMPLES_HALF; k++) { + tmp1r = costab1[k]; + tmp1i = sintab1[k]; + xr = (outre1[k] * tmp1r - outre2[k] * tmp1i) * fact; + outre2[k] = (outre2[k] * tmp1r + outre1[k] * tmp1i) * fact; + outre1[k] = xr; + } +} diff --git a/src/mod/codecs/mod_isac/typedefs.h b/src/mod/codecs/mod_isac/typedefs.h new file mode 100644 index 0000000000..ba87309638 --- /dev/null +++ b/src/mod/codecs/mod_isac/typedefs.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +// This file contains platform-specific typedefs and defines. + +#ifndef WEBRTC_TYPEDEFS_H_ +#define WEBRTC_TYPEDEFS_H_ + +// Reserved words definitions +// TODO(andrew): Look at removing these. +#define WEBRTC_EXTERN extern +#define G_CONST const +#define WEBRTC_INLINE extern __inline + +// Define WebRTC preprocessor identifiers based on the current build platform. +// TODO(andrew): Clean these up. We can probably remove everything in this +// block. +// - TARGET_MAC_INTEL and TARGET_MAC aren't used anywhere. +// - In the few places where TARGET_PC is used, it should be replaced by +// something more specific. +// - Do we really support PowerPC? Probably not. Remove WEBRTC_MAC_INTEL +// from build/common.gypi as well. +#if defined(WIN32) + // Windows & Windows Mobile. + #if !defined(WEBRTC_TARGET_PC) + #define WEBRTC_TARGET_PC + #endif +#elif defined(__APPLE__) + // Mac OS X. + #if defined(__LITTLE_ENDIAN__ ) + #if !defined(WEBRTC_TARGET_MAC_INTEL) + #define WEBRTC_TARGET_MAC_INTEL + #endif + #else + #if !defined(WEBRTC_TARGET_MAC) + #define WEBRTC_TARGET_MAC + #endif + #endif +#else + // Linux etc. + #if !defined(WEBRTC_TARGET_PC) + #define WEBRTC_TARGET_PC + #endif +#endif + +// Derived from Chromium's build/build_config.h +// Processor architecture detection. For more info on what's defined, see: +// http://msdn.microsoft.com/en-us/library/b0084kay.aspx +// http://www.agner.org/optimize/calling_conventions.pdf +// or with gcc, run: "echo | gcc -E -dM -" +// TODO(andrew): replace WEBRTC_LITTLE_ENDIAN with WEBRTC_ARCH_LITTLE_ENDIAN? +#if defined(_M_X64) || defined(__x86_64__) +#define WEBRTC_ARCH_X86_FAMILY +#define WEBRTC_ARCH_X86_64 +#define WEBRTC_ARCH_64_BITS +#define WEBRTC_ARCH_LITTLE_ENDIAN +#elif defined(_M_IX86) || defined(__i386__) +#define WEBRTC_ARCH_X86_FAMILY +#define WEBRTC_ARCH_X86 +#define WEBRTC_ARCH_32_BITS +#define WEBRTC_ARCH_LITTLE_ENDIAN +#elif defined(__ARMEL__) +// TODO(andrew): We'd prefer to control platform defines here, but this is +// currently provided by the Android makefiles. Commented to avoid duplicate +// definition warnings. +//#define WEBRTC_ARCH_ARM +// TODO(andrew): Chromium uses the following two defines. Should we switch? +//#define WEBRTC_ARCH_ARM_FAMILY +//#define WEBRTC_ARCH_ARMEL +#define WEBRTC_ARCH_32_BITS +#define WEBRTC_ARCH_LITTLE_ENDIAN +#else +#error Please add support for your architecture in typedefs.h +#endif + +#if defined(__SSE2__) || defined(_MSC_VER) +#define WEBRTC_USE_SSE2 +#endif + +#if defined(WEBRTC_TARGET_PC) + +#if !defined(_MSC_VER) + #include +#else + // Define C99 equivalent types. + // Since MSVC doesn't include these headers, we have to write our own + // version to provide a compatibility layer between MSVC and the WebRTC + // headers. + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef signed long long int64_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef unsigned long long uint64_t; +#endif + +#if defined(WIN32) + typedef __int64 WebRtc_Word64; + typedef unsigned __int64 WebRtc_UWord64; +#else + typedef int64_t WebRtc_Word64; + typedef uint64_t WebRtc_UWord64; +#endif + typedef int32_t WebRtc_Word32; + typedef uint32_t WebRtc_UWord32; + typedef int16_t WebRtc_Word16; + typedef uint16_t WebRtc_UWord16; + typedef char WebRtc_Word8; + typedef uint8_t WebRtc_UWord8; + + // Define endian for the platform + #define WEBRTC_LITTLE_ENDIAN + +#elif defined(WEBRTC_TARGET_MAC_INTEL) + #include + + typedef int64_t WebRtc_Word64; + typedef uint64_t WebRtc_UWord64; + typedef int32_t WebRtc_Word32; + typedef uint32_t WebRtc_UWord32; + typedef int16_t WebRtc_Word16; + typedef char WebRtc_Word8; + typedef uint16_t WebRtc_UWord16; + typedef uint8_t WebRtc_UWord8; + + // Define endian for the platform + #define WEBRTC_LITTLE_ENDIAN + +#else + #error "No platform defined for WebRTC type definitions (typedefs.h)" +#endif + +#endif // WEBRTC_TYPEDEFS_H_ diff --git a/src/mod/codecs/mod_isac/vector_scaling_operations.c b/src/mod/codecs/mod_isac/vector_scaling_operations.c new file mode 100644 index 0000000000..20d239cabe --- /dev/null +++ b/src/mod/codecs/mod_isac/vector_scaling_operations.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains implementations of the functions + * WebRtcSpl_VectorBitShiftW16() + * WebRtcSpl_VectorBitShiftW32() + * WebRtcSpl_VectorBitShiftW32ToW16() + * WebRtcSpl_ScaleVector() + * WebRtcSpl_ScaleVectorWithSat() + * WebRtcSpl_ScaleAndAddVectors() + * + * The description header can be found in signal_processing_library.h + * + */ + +#include "signal_processing_library.h" + +void WebRtcSpl_VectorBitShiftW16(WebRtc_Word16 *res, + WebRtc_Word16 length, + G_CONST WebRtc_Word16 *in, + WebRtc_Word16 right_shifts) +{ + int i; + + if (right_shifts > 0) + { + for (i = length; i > 0; i--) + { + (*res++) = ((*in++) >> right_shifts); + } + } else + { + for (i = length; i > 0; i--) + { + (*res++) = ((*in++) << (-right_shifts)); + } + } +} + +void WebRtcSpl_VectorBitShiftW32(WebRtc_Word32 *out_vector, + WebRtc_Word16 vector_length, + G_CONST WebRtc_Word32 *in_vector, + WebRtc_Word16 right_shifts) +{ + int i; + + if (right_shifts > 0) + { + for (i = vector_length; i > 0; i--) + { + (*out_vector++) = ((*in_vector++) >> right_shifts); + } + } else + { + for (i = vector_length; i > 0; i--) + { + (*out_vector++) = ((*in_vector++) << (-right_shifts)); + } + } +} + +void WebRtcSpl_VectorBitShiftW32ToW16(WebRtc_Word16 *res, + WebRtc_Word16 length, + G_CONST WebRtc_Word32 *in, + WebRtc_Word16 right_shifts) +{ + int i; + + if (right_shifts >= 0) + { + for (i = length; i > 0; i--) + { + (*res++) = (WebRtc_Word16)((*in++) >> right_shifts); + } + } else + { + WebRtc_Word16 left_shifts = -right_shifts; + for (i = length; i > 0; i--) + { + (*res++) = (WebRtc_Word16)((*in++) << left_shifts); + } + } +} + +void WebRtcSpl_ScaleVector(G_CONST WebRtc_Word16 *in_vector, WebRtc_Word16 *out_vector, + WebRtc_Word16 gain, WebRtc_Word16 in_vector_length, + WebRtc_Word16 right_shifts) +{ + // Performs vector operation: out_vector = (gain*in_vector)>>right_shifts + int i; + G_CONST WebRtc_Word16 *inptr; + WebRtc_Word16 *outptr; + + inptr = in_vector; + outptr = out_vector; + + for (i = 0; i < in_vector_length; i++) + { + (*outptr++) = (WebRtc_Word16)WEBRTC_SPL_MUL_16_16_RSFT(*inptr++, gain, right_shifts); + } +} + +void WebRtcSpl_ScaleVectorWithSat(G_CONST WebRtc_Word16 *in_vector, WebRtc_Word16 *out_vector, + WebRtc_Word16 gain, WebRtc_Word16 in_vector_length, + WebRtc_Word16 right_shifts) +{ + // Performs vector operation: out_vector = (gain*in_vector)>>right_shifts + int i; + WebRtc_Word32 tmpW32; + G_CONST WebRtc_Word16 *inptr; + WebRtc_Word16 *outptr; + + inptr = in_vector; + outptr = out_vector; + + for (i = 0; i < in_vector_length; i++) + { + tmpW32 = WEBRTC_SPL_MUL_16_16_RSFT(*inptr++, gain, right_shifts); + (*outptr++) = WebRtcSpl_SatW32ToW16(tmpW32); + } +} + +void WebRtcSpl_ScaleAndAddVectors(G_CONST WebRtc_Word16 *in1, WebRtc_Word16 gain1, int shift1, + G_CONST WebRtc_Word16 *in2, WebRtc_Word16 gain2, int shift2, + WebRtc_Word16 *out, int vector_length) +{ + // Performs vector operation: out = (gain1*in1)>>shift1 + (gain2*in2)>>shift2 + int i; + G_CONST WebRtc_Word16 *in1ptr; + G_CONST WebRtc_Word16 *in2ptr; + WebRtc_Word16 *outptr; + + in1ptr = in1; + in2ptr = in2; + outptr = out; + + for (i = 0; i < vector_length; i++) + { + (*outptr++) = (WebRtc_Word16)WEBRTC_SPL_MUL_16_16_RSFT(gain1, *in1ptr++, shift1) + + (WebRtc_Word16)WEBRTC_SPL_MUL_16_16_RSFT(gain2, *in2ptr++, shift2); + } +} diff --git a/src/mod/codecs/mod_isac/webrtc_fft_t_1024_8.c b/src/mod/codecs/mod_isac/webrtc_fft_t_1024_8.c new file mode 100644 index 0000000000..b587380523 --- /dev/null +++ b/src/mod/codecs/mod_isac/webrtc_fft_t_1024_8.c @@ -0,0 +1,704 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the Q14 radix-8 tables used in ARM9e optimizations. + * + */ + +extern const int s_Q14S_8; +const int s_Q14S_8 = 1024; +extern const unsigned short t_Q14S_8[2032]; +const unsigned short t_Q14S_8[2032] = { + 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , + 0x22a3,0x187e ,0x3249,0x0c7c ,0x11a8,0x238e , + 0x0000,0x2d41 ,0x22a3,0x187e ,0xdd5d,0x3b21 , + 0xdd5d,0x3b21 ,0x11a8,0x238e ,0xb4be,0x3ec5 , + 0xc000,0x4000 ,0x0000,0x2d41 ,0xa57e,0x2d41 , + 0xac61,0x3b21 ,0xee58,0x3537 ,0xb4be,0x0c7c , + 0xa57e,0x2d41 ,0xdd5d,0x3b21 ,0xdd5d,0xe782 , + 0xac61,0x187e ,0xcdb7,0x3ec5 ,0x11a8,0xcac9 , + 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , + 0x396b,0x0646 ,0x3cc8,0x0324 ,0x35eb,0x0964 , + 0x3249,0x0c7c ,0x396b,0x0646 ,0x2aaa,0x1294 , + 0x2aaa,0x1294 ,0x35eb,0x0964 ,0x1e7e,0x1b5d , + 0x22a3,0x187e ,0x3249,0x0c7c ,0x11a8,0x238e , + 0x1a46,0x1e2b ,0x2e88,0x0f8d ,0x0471,0x2afb , + 0x11a8,0x238e ,0x2aaa,0x1294 ,0xf721,0x3179 , + 0x08df,0x289a ,0x26b3,0x1590 ,0xea02,0x36e5 , + 0x0000,0x2d41 ,0x22a3,0x187e ,0xdd5d,0x3b21 , + 0xf721,0x3179 ,0x1e7e,0x1b5d ,0xd178,0x3e15 , + 0xee58,0x3537 ,0x1a46,0x1e2b ,0xc695,0x3fb1 , + 0xe5ba,0x3871 ,0x15fe,0x20e7 ,0xbcf0,0x3fec , + 0xdd5d,0x3b21 ,0x11a8,0x238e ,0xb4be,0x3ec5 , + 0xd556,0x3d3f ,0x0d48,0x2620 ,0xae2e,0x3c42 , + 0xcdb7,0x3ec5 ,0x08df,0x289a ,0xa963,0x3871 , + 0xc695,0x3fb1 ,0x0471,0x2afb ,0xa678,0x3368 , + 0xc000,0x4000 ,0x0000,0x2d41 ,0xa57e,0x2d41 , + 0xba09,0x3fb1 ,0xfb8f,0x2f6c ,0xa678,0x2620 , + 0xb4be,0x3ec5 ,0xf721,0x3179 ,0xa963,0x1e2b , + 0xb02d,0x3d3f ,0xf2b8,0x3368 ,0xae2e,0x1590 , + 0xac61,0x3b21 ,0xee58,0x3537 ,0xb4be,0x0c7c , + 0xa963,0x3871 ,0xea02,0x36e5 ,0xbcf0,0x0324 , + 0xa73b,0x3537 ,0xe5ba,0x3871 ,0xc695,0xf9ba , + 0xa5ed,0x3179 ,0xe182,0x39db ,0xd178,0xf073 , + 0xa57e,0x2d41 ,0xdd5d,0x3b21 ,0xdd5d,0xe782 , + 0xa5ed,0x289a ,0xd94d,0x3c42 ,0xea02,0xdf19 , + 0xa73b,0x238e ,0xd556,0x3d3f ,0xf721,0xd766 , + 0xa963,0x1e2b ,0xd178,0x3e15 ,0x0471,0xd094 , + 0xac61,0x187e ,0xcdb7,0x3ec5 ,0x11a8,0xcac9 , + 0xb02d,0x1294 ,0xca15,0x3f4f ,0x1e7e,0xc625 , + 0xb4be,0x0c7c ,0xc695,0x3fb1 ,0x2aaa,0xc2c1 , + 0xba09,0x0646 ,0xc338,0x3fec ,0x35eb,0xc0b1 , + 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , + 0x3e69,0x0192 ,0x3f36,0x00c9 ,0x3d9a,0x025b , + 0x3cc8,0x0324 ,0x3e69,0x0192 ,0x3b1e,0x04b5 , + 0x3b1e,0x04b5 ,0x3d9a,0x025b ,0x388e,0x070e , + 0x396b,0x0646 ,0x3cc8,0x0324 ,0x35eb,0x0964 , + 0x37af,0x07d6 ,0x3bf4,0x03ed ,0x3334,0x0bb7 , + 0x35eb,0x0964 ,0x3b1e,0x04b5 ,0x306c,0x0e06 , + 0x341e,0x0af1 ,0x3a46,0x057e ,0x2d93,0x1050 , + 0x3249,0x0c7c ,0x396b,0x0646 ,0x2aaa,0x1294 , + 0x306c,0x0e06 ,0x388e,0x070e ,0x27b3,0x14d2 , + 0x2e88,0x0f8d ,0x37af,0x07d6 ,0x24ae,0x1709 , + 0x2c9d,0x1112 ,0x36ce,0x089d ,0x219c,0x1937 , + 0x2aaa,0x1294 ,0x35eb,0x0964 ,0x1e7e,0x1b5d , + 0x28b2,0x1413 ,0x3505,0x0a2b ,0x1b56,0x1d79 , + 0x26b3,0x1590 ,0x341e,0x0af1 ,0x1824,0x1f8c , + 0x24ae,0x1709 ,0x3334,0x0bb7 ,0x14ea,0x2193 , + 0x22a3,0x187e ,0x3249,0x0c7c ,0x11a8,0x238e , + 0x2093,0x19ef ,0x315b,0x0d41 ,0x0e61,0x257e , + 0x1e7e,0x1b5d ,0x306c,0x0e06 ,0x0b14,0x2760 , + 0x1c64,0x1cc6 ,0x2f7b,0x0eca ,0x07c4,0x2935 , + 0x1a46,0x1e2b ,0x2e88,0x0f8d ,0x0471,0x2afb , + 0x1824,0x1f8c ,0x2d93,0x1050 ,0x011c,0x2cb2 , + 0x15fe,0x20e7 ,0x2c9d,0x1112 ,0xfdc7,0x2e5a , + 0x13d5,0x223d ,0x2ba4,0x11d3 ,0xfa73,0x2ff2 , + 0x11a8,0x238e ,0x2aaa,0x1294 ,0xf721,0x3179 , + 0x0f79,0x24da ,0x29af,0x1354 ,0xf3d2,0x32ef , + 0x0d48,0x2620 ,0x28b2,0x1413 ,0xf087,0x3453 , + 0x0b14,0x2760 ,0x27b3,0x14d2 ,0xed41,0x35a5 , + 0x08df,0x289a ,0x26b3,0x1590 ,0xea02,0x36e5 , + 0x06a9,0x29ce ,0x25b1,0x164c ,0xe6cb,0x3812 , + 0x0471,0x2afb ,0x24ae,0x1709 ,0xe39c,0x392b , + 0x0239,0x2c21 ,0x23a9,0x17c4 ,0xe077,0x3a30 , + 0x0000,0x2d41 ,0x22a3,0x187e ,0xdd5d,0x3b21 , + 0xfdc7,0x2e5a ,0x219c,0x1937 ,0xda4f,0x3bfd , + 0xfb8f,0x2f6c ,0x2093,0x19ef ,0xd74e,0x3cc5 , + 0xf957,0x3076 ,0x1f89,0x1aa7 ,0xd45c,0x3d78 , + 0xf721,0x3179 ,0x1e7e,0x1b5d ,0xd178,0x3e15 , + 0xf4ec,0x3274 ,0x1d72,0x1c12 ,0xcea5,0x3e9d , + 0xf2b8,0x3368 ,0x1c64,0x1cc6 ,0xcbe2,0x3f0f , + 0xf087,0x3453 ,0x1b56,0x1d79 ,0xc932,0x3f6b , + 0xee58,0x3537 ,0x1a46,0x1e2b ,0xc695,0x3fb1 , + 0xec2b,0x3612 ,0x1935,0x1edc ,0xc40c,0x3fe1 , + 0xea02,0x36e5 ,0x1824,0x1f8c ,0xc197,0x3ffb , + 0xe7dc,0x37b0 ,0x1711,0x203a ,0xbf38,0x3fff , + 0xe5ba,0x3871 ,0x15fe,0x20e7 ,0xbcf0,0x3fec , + 0xe39c,0x392b ,0x14ea,0x2193 ,0xbabf,0x3fc4 , + 0xe182,0x39db ,0x13d5,0x223d ,0xb8a6,0x3f85 , + 0xdf6d,0x3a82 ,0x12bf,0x22e7 ,0xb6a5,0x3f30 , + 0xdd5d,0x3b21 ,0x11a8,0x238e ,0xb4be,0x3ec5 , + 0xdb52,0x3bb6 ,0x1091,0x2435 ,0xb2f2,0x3e45 , + 0xd94d,0x3c42 ,0x0f79,0x24da ,0xb140,0x3daf , + 0xd74e,0x3cc5 ,0x0e61,0x257e ,0xafa9,0x3d03 , + 0xd556,0x3d3f ,0x0d48,0x2620 ,0xae2e,0x3c42 , + 0xd363,0x3daf ,0x0c2e,0x26c1 ,0xacd0,0x3b6d , + 0xd178,0x3e15 ,0x0b14,0x2760 ,0xab8e,0x3a82 , + 0xcf94,0x3e72 ,0x09fa,0x27fe ,0xaa6a,0x3984 , + 0xcdb7,0x3ec5 ,0x08df,0x289a ,0xa963,0x3871 , + 0xcbe2,0x3f0f ,0x07c4,0x2935 ,0xa87b,0x374b , + 0xca15,0x3f4f ,0x06a9,0x29ce ,0xa7b1,0x3612 , + 0xc851,0x3f85 ,0x058d,0x2a65 ,0xa705,0x34c6 , + 0xc695,0x3fb1 ,0x0471,0x2afb ,0xa678,0x3368 , + 0xc4e2,0x3fd4 ,0x0355,0x2b8f ,0xa60b,0x31f8 , + 0xc338,0x3fec ,0x0239,0x2c21 ,0xa5bc,0x3076 , + 0xc197,0x3ffb ,0x011c,0x2cb2 ,0xa58d,0x2ee4 , + 0xc000,0x4000 ,0x0000,0x2d41 ,0xa57e,0x2d41 , + 0xbe73,0x3ffb ,0xfee4,0x2dcf ,0xa58d,0x2b8f , + 0xbcf0,0x3fec ,0xfdc7,0x2e5a ,0xa5bc,0x29ce , + 0xbb77,0x3fd4 ,0xfcab,0x2ee4 ,0xa60b,0x27fe , + 0xba09,0x3fb1 ,0xfb8f,0x2f6c ,0xa678,0x2620 , + 0xb8a6,0x3f85 ,0xfa73,0x2ff2 ,0xa705,0x2435 , + 0xb74d,0x3f4f ,0xf957,0x3076 ,0xa7b1,0x223d , + 0xb600,0x3f0f ,0xf83c,0x30f9 ,0xa87b,0x203a , + 0xb4be,0x3ec5 ,0xf721,0x3179 ,0xa963,0x1e2b , + 0xb388,0x3e72 ,0xf606,0x31f8 ,0xaa6a,0x1c12 , + 0xb25e,0x3e15 ,0xf4ec,0x3274 ,0xab8e,0x19ef , + 0xb140,0x3daf ,0xf3d2,0x32ef ,0xacd0,0x17c4 , + 0xb02d,0x3d3f ,0xf2b8,0x3368 ,0xae2e,0x1590 , + 0xaf28,0x3cc5 ,0xf19f,0x33df ,0xafa9,0x1354 , + 0xae2e,0x3c42 ,0xf087,0x3453 ,0xb140,0x1112 , + 0xad41,0x3bb6 ,0xef6f,0x34c6 ,0xb2f2,0x0eca , + 0xac61,0x3b21 ,0xee58,0x3537 ,0xb4be,0x0c7c , + 0xab8e,0x3a82 ,0xed41,0x35a5 ,0xb6a5,0x0a2b , + 0xaac8,0x39db ,0xec2b,0x3612 ,0xb8a6,0x07d6 , + 0xaa0f,0x392b ,0xeb16,0x367d ,0xbabf,0x057e , + 0xa963,0x3871 ,0xea02,0x36e5 ,0xbcf0,0x0324 , + 0xa8c5,0x37b0 ,0xe8ef,0x374b ,0xbf38,0x00c9 , + 0xa834,0x36e5 ,0xe7dc,0x37b0 ,0xc197,0xfe6e , + 0xa7b1,0x3612 ,0xe6cb,0x3812 ,0xc40c,0xfc13 , + 0xa73b,0x3537 ,0xe5ba,0x3871 ,0xc695,0xf9ba , + 0xa6d3,0x3453 ,0xe4aa,0x38cf ,0xc932,0xf763 , + 0xa678,0x3368 ,0xe39c,0x392b ,0xcbe2,0xf50f , + 0xa62c,0x3274 ,0xe28e,0x3984 ,0xcea5,0xf2bf , + 0xa5ed,0x3179 ,0xe182,0x39db ,0xd178,0xf073 , + 0xa5bc,0x3076 ,0xe077,0x3a30 ,0xd45c,0xee2d , + 0xa599,0x2f6c ,0xdf6d,0x3a82 ,0xd74e,0xebed , + 0xa585,0x2e5a ,0xde64,0x3ad3 ,0xda4f,0xe9b4 , + 0xa57e,0x2d41 ,0xdd5d,0x3b21 ,0xdd5d,0xe782 , + 0xa585,0x2c21 ,0xdc57,0x3b6d ,0xe077,0xe559 , + 0xa599,0x2afb ,0xdb52,0x3bb6 ,0xe39c,0xe33a , + 0xa5bc,0x29ce ,0xda4f,0x3bfd ,0xe6cb,0xe124 , + 0xa5ed,0x289a ,0xd94d,0x3c42 ,0xea02,0xdf19 , + 0xa62c,0x2760 ,0xd84d,0x3c85 ,0xed41,0xdd19 , + 0xa678,0x2620 ,0xd74e,0x3cc5 ,0xf087,0xdb26 , + 0xa6d3,0x24da ,0xd651,0x3d03 ,0xf3d2,0xd93f , + 0xa73b,0x238e ,0xd556,0x3d3f ,0xf721,0xd766 , + 0xa7b1,0x223d ,0xd45c,0x3d78 ,0xfa73,0xd59b , + 0xa834,0x20e7 ,0xd363,0x3daf ,0xfdc7,0xd3df , + 0xa8c5,0x1f8c ,0xd26d,0x3de3 ,0x011c,0xd231 , + 0xa963,0x1e2b ,0xd178,0x3e15 ,0x0471,0xd094 , + 0xaa0f,0x1cc6 ,0xd085,0x3e45 ,0x07c4,0xcf07 , + 0xaac8,0x1b5d ,0xcf94,0x3e72 ,0x0b14,0xcd8c , + 0xab8e,0x19ef ,0xcea5,0x3e9d ,0x0e61,0xcc21 , + 0xac61,0x187e ,0xcdb7,0x3ec5 ,0x11a8,0xcac9 , + 0xad41,0x1709 ,0xcccc,0x3eeb ,0x14ea,0xc983 , + 0xae2e,0x1590 ,0xcbe2,0x3f0f ,0x1824,0xc850 , + 0xaf28,0x1413 ,0xcafb,0x3f30 ,0x1b56,0xc731 , + 0xb02d,0x1294 ,0xca15,0x3f4f ,0x1e7e,0xc625 , + 0xb140,0x1112 ,0xc932,0x3f6b ,0x219c,0xc52d , + 0xb25e,0x0f8d ,0xc851,0x3f85 ,0x24ae,0xc44a , + 0xb388,0x0e06 ,0xc772,0x3f9c ,0x27b3,0xc37b , + 0xb4be,0x0c7c ,0xc695,0x3fb1 ,0x2aaa,0xc2c1 , + 0xb600,0x0af1 ,0xc5ba,0x3fc4 ,0x2d93,0xc21d , + 0xb74d,0x0964 ,0xc4e2,0x3fd4 ,0x306c,0xc18e , + 0xb8a6,0x07d6 ,0xc40c,0x3fe1 ,0x3334,0xc115 , + 0xba09,0x0646 ,0xc338,0x3fec ,0x35eb,0xc0b1 , + 0xbb77,0x04b5 ,0xc266,0x3ff5 ,0x388e,0xc064 , + 0xbcf0,0x0324 ,0xc197,0x3ffb ,0x3b1e,0xc02c , + 0xbe73,0x0192 ,0xc0ca,0x3fff ,0x3d9a,0xc00b , + 0x4000,0x0000 ,0x3f9b,0x0065 ,0x3f36,0x00c9 , + 0x3ed0,0x012e ,0x3e69,0x0192 ,0x3e02,0x01f7 , + 0x3d9a,0x025b ,0x3d31,0x02c0 ,0x3cc8,0x0324 , + 0x3c5f,0x0388 ,0x3bf4,0x03ed ,0x3b8a,0x0451 , + 0x3b1e,0x04b5 ,0x3ab2,0x051a ,0x3a46,0x057e , + 0x39d9,0x05e2 ,0x396b,0x0646 ,0x38fd,0x06aa , + 0x388e,0x070e ,0x381f,0x0772 ,0x37af,0x07d6 , + 0x373f,0x0839 ,0x36ce,0x089d ,0x365d,0x0901 , + 0x35eb,0x0964 ,0x3578,0x09c7 ,0x3505,0x0a2b , + 0x3492,0x0a8e ,0x341e,0x0af1 ,0x33a9,0x0b54 , + 0x3334,0x0bb7 ,0x32bf,0x0c1a ,0x3249,0x0c7c , + 0x31d2,0x0cdf ,0x315b,0x0d41 ,0x30e4,0x0da4 , + 0x306c,0x0e06 ,0x2ff4,0x0e68 ,0x2f7b,0x0eca , + 0x2f02,0x0f2b ,0x2e88,0x0f8d ,0x2e0e,0x0fee , + 0x2d93,0x1050 ,0x2d18,0x10b1 ,0x2c9d,0x1112 , + 0x2c21,0x1173 ,0x2ba4,0x11d3 ,0x2b28,0x1234 , + 0x2aaa,0x1294 ,0x2a2d,0x12f4 ,0x29af,0x1354 , + 0x2931,0x13b4 ,0x28b2,0x1413 ,0x2833,0x1473 , + 0x27b3,0x14d2 ,0x2733,0x1531 ,0x26b3,0x1590 , + 0x2632,0x15ee ,0x25b1,0x164c ,0x252f,0x16ab , + 0x24ae,0x1709 ,0x242b,0x1766 ,0x23a9,0x17c4 , + 0x2326,0x1821 ,0x22a3,0x187e ,0x221f,0x18db , + 0x219c,0x1937 ,0x2117,0x1993 ,0x2093,0x19ef , + 0x200e,0x1a4b ,0x1f89,0x1aa7 ,0x1f04,0x1b02 , + 0x1e7e,0x1b5d ,0x1df8,0x1bb8 ,0x1d72,0x1c12 , + 0x1ceb,0x1c6c ,0x1c64,0x1cc6 ,0x1bdd,0x1d20 , + 0x1b56,0x1d79 ,0x1ace,0x1dd3 ,0x1a46,0x1e2b , + 0x19be,0x1e84 ,0x1935,0x1edc ,0x18ad,0x1f34 , + 0x1824,0x1f8c ,0x179b,0x1fe3 ,0x1711,0x203a , + 0x1688,0x2091 ,0x15fe,0x20e7 ,0x1574,0x213d , + 0x14ea,0x2193 ,0x145f,0x21e8 ,0x13d5,0x223d , + 0x134a,0x2292 ,0x12bf,0x22e7 ,0x1234,0x233b , + 0x11a8,0x238e ,0x111d,0x23e2 ,0x1091,0x2435 , + 0x1005,0x2488 ,0x0f79,0x24da ,0x0eed,0x252c , + 0x0e61,0x257e ,0x0dd4,0x25cf ,0x0d48,0x2620 , + 0x0cbb,0x2671 ,0x0c2e,0x26c1 ,0x0ba1,0x2711 , + 0x0b14,0x2760 ,0x0a87,0x27af ,0x09fa,0x27fe , + 0x096d,0x284c ,0x08df,0x289a ,0x0852,0x28e7 , + 0x07c4,0x2935 ,0x0736,0x2981 ,0x06a9,0x29ce , + 0x061b,0x2a1a ,0x058d,0x2a65 ,0x04ff,0x2ab0 , + 0x0471,0x2afb ,0x03e3,0x2b45 ,0x0355,0x2b8f , + 0x02c7,0x2bd8 ,0x0239,0x2c21 ,0x01aa,0x2c6a , + 0x011c,0x2cb2 ,0x008e,0x2cfa ,0x0000,0x2d41 , + 0xff72,0x2d88 ,0xfee4,0x2dcf ,0xfe56,0x2e15 , + 0xfdc7,0x2e5a ,0xfd39,0x2e9f ,0xfcab,0x2ee4 , + 0xfc1d,0x2f28 ,0xfb8f,0x2f6c ,0xfb01,0x2faf , + 0xfa73,0x2ff2 ,0xf9e5,0x3034 ,0xf957,0x3076 , + 0xf8ca,0x30b8 ,0xf83c,0x30f9 ,0xf7ae,0x3139 , + 0xf721,0x3179 ,0xf693,0x31b9 ,0xf606,0x31f8 , + 0xf579,0x3236 ,0xf4ec,0x3274 ,0xf45f,0x32b2 , + 0xf3d2,0x32ef ,0xf345,0x332c ,0xf2b8,0x3368 , + 0xf22c,0x33a3 ,0xf19f,0x33df ,0xf113,0x3419 , + 0xf087,0x3453 ,0xeffb,0x348d ,0xef6f,0x34c6 , + 0xeee3,0x34ff ,0xee58,0x3537 ,0xedcc,0x356e , + 0xed41,0x35a5 ,0xecb6,0x35dc ,0xec2b,0x3612 , + 0xeba1,0x3648 ,0xeb16,0x367d ,0xea8c,0x36b1 , + 0xea02,0x36e5 ,0xe978,0x3718 ,0xe8ef,0x374b , + 0xe865,0x377e ,0xe7dc,0x37b0 ,0xe753,0x37e1 , + 0xe6cb,0x3812 ,0xe642,0x3842 ,0xe5ba,0x3871 , + 0xe532,0x38a1 ,0xe4aa,0x38cf ,0xe423,0x38fd , + 0xe39c,0x392b ,0xe315,0x3958 ,0xe28e,0x3984 , + 0xe208,0x39b0 ,0xe182,0x39db ,0xe0fc,0x3a06 , + 0xe077,0x3a30 ,0xdff2,0x3a59 ,0xdf6d,0x3a82 , + 0xdee9,0x3aab ,0xde64,0x3ad3 ,0xdde1,0x3afa , + 0xdd5d,0x3b21 ,0xdcda,0x3b47 ,0xdc57,0x3b6d , + 0xdbd5,0x3b92 ,0xdb52,0x3bb6 ,0xdad1,0x3bda , + 0xda4f,0x3bfd ,0xd9ce,0x3c20 ,0xd94d,0x3c42 , + 0xd8cd,0x3c64 ,0xd84d,0x3c85 ,0xd7cd,0x3ca5 , + 0xd74e,0x3cc5 ,0xd6cf,0x3ce4 ,0xd651,0x3d03 , + 0xd5d3,0x3d21 ,0xd556,0x3d3f ,0xd4d8,0x3d5b , + 0xd45c,0x3d78 ,0xd3df,0x3d93 ,0xd363,0x3daf , + 0xd2e8,0x3dc9 ,0xd26d,0x3de3 ,0xd1f2,0x3dfc , + 0xd178,0x3e15 ,0xd0fe,0x3e2d ,0xd085,0x3e45 , + 0xd00c,0x3e5c ,0xcf94,0x3e72 ,0xcf1c,0x3e88 , + 0xcea5,0x3e9d ,0xce2e,0x3eb1 ,0xcdb7,0x3ec5 , + 0xcd41,0x3ed8 ,0xcccc,0x3eeb ,0xcc57,0x3efd , + 0xcbe2,0x3f0f ,0xcb6e,0x3f20 ,0xcafb,0x3f30 , + 0xca88,0x3f40 ,0xca15,0x3f4f ,0xc9a3,0x3f5d , + 0xc932,0x3f6b ,0xc8c1,0x3f78 ,0xc851,0x3f85 , + 0xc7e1,0x3f91 ,0xc772,0x3f9c ,0xc703,0x3fa7 , + 0xc695,0x3fb1 ,0xc627,0x3fbb ,0xc5ba,0x3fc4 , + 0xc54e,0x3fcc ,0xc4e2,0x3fd4 ,0xc476,0x3fdb , + 0xc40c,0x3fe1 ,0xc3a1,0x3fe7 ,0xc338,0x3fec , + 0xc2cf,0x3ff1 ,0xc266,0x3ff5 ,0xc1fe,0x3ff8 , + 0xc197,0x3ffb ,0xc130,0x3ffd ,0xc0ca,0x3fff , + 0xc065,0x4000 ,0xc000,0x4000 ,0xbf9c,0x4000 , + 0xbf38,0x3fff ,0xbed5,0x3ffd ,0xbe73,0x3ffb , + 0xbe11,0x3ff8 ,0xbdb0,0x3ff5 ,0xbd50,0x3ff1 , + 0xbcf0,0x3fec ,0xbc91,0x3fe7 ,0xbc32,0x3fe1 , + 0xbbd4,0x3fdb ,0xbb77,0x3fd4 ,0xbb1b,0x3fcc , + 0xbabf,0x3fc4 ,0xba64,0x3fbb ,0xba09,0x3fb1 , + 0xb9af,0x3fa7 ,0xb956,0x3f9c ,0xb8fd,0x3f91 , + 0xb8a6,0x3f85 ,0xb84f,0x3f78 ,0xb7f8,0x3f6b , + 0xb7a2,0x3f5d ,0xb74d,0x3f4f ,0xb6f9,0x3f40 , + 0xb6a5,0x3f30 ,0xb652,0x3f20 ,0xb600,0x3f0f , + 0xb5af,0x3efd ,0xb55e,0x3eeb ,0xb50e,0x3ed8 , + 0xb4be,0x3ec5 ,0xb470,0x3eb1 ,0xb422,0x3e9d , + 0xb3d5,0x3e88 ,0xb388,0x3e72 ,0xb33d,0x3e5c , + 0xb2f2,0x3e45 ,0xb2a7,0x3e2d ,0xb25e,0x3e15 , + 0xb215,0x3dfc ,0xb1cd,0x3de3 ,0xb186,0x3dc9 , + 0xb140,0x3daf ,0xb0fa,0x3d93 ,0xb0b5,0x3d78 , + 0xb071,0x3d5b ,0xb02d,0x3d3f ,0xafeb,0x3d21 , + 0xafa9,0x3d03 ,0xaf68,0x3ce4 ,0xaf28,0x3cc5 , + 0xaee8,0x3ca5 ,0xaea9,0x3c85 ,0xae6b,0x3c64 , + 0xae2e,0x3c42 ,0xadf2,0x3c20 ,0xadb6,0x3bfd , + 0xad7b,0x3bda ,0xad41,0x3bb6 ,0xad08,0x3b92 , + 0xacd0,0x3b6d ,0xac98,0x3b47 ,0xac61,0x3b21 , + 0xac2b,0x3afa ,0xabf6,0x3ad3 ,0xabc2,0x3aab , + 0xab8e,0x3a82 ,0xab5b,0x3a59 ,0xab29,0x3a30 , + 0xaaf8,0x3a06 ,0xaac8,0x39db ,0xaa98,0x39b0 , + 0xaa6a,0x3984 ,0xaa3c,0x3958 ,0xaa0f,0x392b , + 0xa9e3,0x38fd ,0xa9b7,0x38cf ,0xa98d,0x38a1 , + 0xa963,0x3871 ,0xa93a,0x3842 ,0xa912,0x3812 , + 0xa8eb,0x37e1 ,0xa8c5,0x37b0 ,0xa89f,0x377e , + 0xa87b,0x374b ,0xa857,0x3718 ,0xa834,0x36e5 , + 0xa812,0x36b1 ,0xa7f1,0x367d ,0xa7d0,0x3648 , + 0xa7b1,0x3612 ,0xa792,0x35dc ,0xa774,0x35a5 , + 0xa757,0x356e ,0xa73b,0x3537 ,0xa71f,0x34ff , + 0xa705,0x34c6 ,0xa6eb,0x348d ,0xa6d3,0x3453 , + 0xa6bb,0x3419 ,0xa6a4,0x33df ,0xa68e,0x33a3 , + 0xa678,0x3368 ,0xa664,0x332c ,0xa650,0x32ef , + 0xa63e,0x32b2 ,0xa62c,0x3274 ,0xa61b,0x3236 , + 0xa60b,0x31f8 ,0xa5fb,0x31b9 ,0xa5ed,0x3179 , + 0xa5e0,0x3139 ,0xa5d3,0x30f9 ,0xa5c7,0x30b8 , + 0xa5bc,0x3076 ,0xa5b2,0x3034 ,0xa5a9,0x2ff2 , + 0xa5a1,0x2faf ,0xa599,0x2f6c ,0xa593,0x2f28 , + 0xa58d,0x2ee4 ,0xa588,0x2e9f ,0xa585,0x2e5a , + 0xa581,0x2e15 ,0xa57f,0x2dcf ,0xa57e,0x2d88 , + 0xa57e,0x2d41 ,0xa57e,0x2cfa ,0xa57f,0x2cb2 , + 0xa581,0x2c6a ,0xa585,0x2c21 ,0xa588,0x2bd8 , + 0xa58d,0x2b8f ,0xa593,0x2b45 ,0xa599,0x2afb , + 0xa5a1,0x2ab0 ,0xa5a9,0x2a65 ,0xa5b2,0x2a1a , + 0xa5bc,0x29ce ,0xa5c7,0x2981 ,0xa5d3,0x2935 , + 0xa5e0,0x28e7 ,0xa5ed,0x289a ,0xa5fb,0x284c , + 0xa60b,0x27fe ,0xa61b,0x27af ,0xa62c,0x2760 , + 0xa63e,0x2711 ,0xa650,0x26c1 ,0xa664,0x2671 , + 0xa678,0x2620 ,0xa68e,0x25cf ,0xa6a4,0x257e , + 0xa6bb,0x252c ,0xa6d3,0x24da ,0xa6eb,0x2488 , + 0xa705,0x2435 ,0xa71f,0x23e2 ,0xa73b,0x238e , + 0xa757,0x233b ,0xa774,0x22e7 ,0xa792,0x2292 , + 0xa7b1,0x223d ,0xa7d0,0x21e8 ,0xa7f1,0x2193 , + 0xa812,0x213d ,0xa834,0x20e7 ,0xa857,0x2091 , + 0xa87b,0x203a ,0xa89f,0x1fe3 ,0xa8c5,0x1f8c , + 0xa8eb,0x1f34 ,0xa912,0x1edc ,0xa93a,0x1e84 , + 0xa963,0x1e2b ,0xa98d,0x1dd3 ,0xa9b7,0x1d79 , + 0xa9e3,0x1d20 ,0xaa0f,0x1cc6 ,0xaa3c,0x1c6c , + 0xaa6a,0x1c12 ,0xaa98,0x1bb8 ,0xaac8,0x1b5d , + 0xaaf8,0x1b02 ,0xab29,0x1aa7 ,0xab5b,0x1a4b , + 0xab8e,0x19ef ,0xabc2,0x1993 ,0xabf6,0x1937 , + 0xac2b,0x18db ,0xac61,0x187e ,0xac98,0x1821 , + 0xacd0,0x17c4 ,0xad08,0x1766 ,0xad41,0x1709 , + 0xad7b,0x16ab ,0xadb6,0x164c ,0xadf2,0x15ee , + 0xae2e,0x1590 ,0xae6b,0x1531 ,0xaea9,0x14d2 , + 0xaee8,0x1473 ,0xaf28,0x1413 ,0xaf68,0x13b4 , + 0xafa9,0x1354 ,0xafeb,0x12f4 ,0xb02d,0x1294 , + 0xb071,0x1234 ,0xb0b5,0x11d3 ,0xb0fa,0x1173 , + 0xb140,0x1112 ,0xb186,0x10b1 ,0xb1cd,0x1050 , + 0xb215,0x0fee ,0xb25e,0x0f8d ,0xb2a7,0x0f2b , + 0xb2f2,0x0eca ,0xb33d,0x0e68 ,0xb388,0x0e06 , + 0xb3d5,0x0da4 ,0xb422,0x0d41 ,0xb470,0x0cdf , + 0xb4be,0x0c7c ,0xb50e,0x0c1a ,0xb55e,0x0bb7 , + 0xb5af,0x0b54 ,0xb600,0x0af1 ,0xb652,0x0a8e , + 0xb6a5,0x0a2b ,0xb6f9,0x09c7 ,0xb74d,0x0964 , + 0xb7a2,0x0901 ,0xb7f8,0x089d ,0xb84f,0x0839 , + 0xb8a6,0x07d6 ,0xb8fd,0x0772 ,0xb956,0x070e , + 0xb9af,0x06aa ,0xba09,0x0646 ,0xba64,0x05e2 , + 0xbabf,0x057e ,0xbb1b,0x051a ,0xbb77,0x04b5 , + 0xbbd4,0x0451 ,0xbc32,0x03ed ,0xbc91,0x0388 , + 0xbcf0,0x0324 ,0xbd50,0x02c0 ,0xbdb0,0x025b , + 0xbe11,0x01f7 ,0xbe73,0x0192 ,0xbed5,0x012e , + 0xbf38,0x00c9 ,0xbf9c,0x0065 }; + + +extern const int s_Q14R_8; +const int s_Q14R_8 = 1024; +extern const unsigned short t_Q14R_8[2032]; +const unsigned short t_Q14R_8[2032] = { + 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , + 0x3b21,0x187e ,0x3ec5,0x0c7c ,0x3537,0x238e , + 0x2d41,0x2d41 ,0x3b21,0x187e ,0x187e,0x3b21 , + 0x187e,0x3b21 ,0x3537,0x238e ,0xf384,0x3ec5 , + 0x0000,0x4000 ,0x2d41,0x2d41 ,0xd2bf,0x2d41 , + 0xe782,0x3b21 ,0x238e,0x3537 ,0xc13b,0x0c7c , + 0xd2bf,0x2d41 ,0x187e,0x3b21 ,0xc4df,0xe782 , + 0xc4df,0x187e ,0x0c7c,0x3ec5 ,0xdc72,0xcac9 , + 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , + 0x3fb1,0x0646 ,0x3fec,0x0324 ,0x3f4f,0x0964 , + 0x3ec5,0x0c7c ,0x3fb1,0x0646 ,0x3d3f,0x1294 , + 0x3d3f,0x1294 ,0x3f4f,0x0964 ,0x39db,0x1b5d , + 0x3b21,0x187e ,0x3ec5,0x0c7c ,0x3537,0x238e , + 0x3871,0x1e2b ,0x3e15,0x0f8d ,0x2f6c,0x2afb , + 0x3537,0x238e ,0x3d3f,0x1294 ,0x289a,0x3179 , + 0x3179,0x289a ,0x3c42,0x1590 ,0x20e7,0x36e5 , + 0x2d41,0x2d41 ,0x3b21,0x187e ,0x187e,0x3b21 , + 0x289a,0x3179 ,0x39db,0x1b5d ,0x0f8d,0x3e15 , + 0x238e,0x3537 ,0x3871,0x1e2b ,0x0646,0x3fb1 , + 0x1e2b,0x3871 ,0x36e5,0x20e7 ,0xfcdc,0x3fec , + 0x187e,0x3b21 ,0x3537,0x238e ,0xf384,0x3ec5 , + 0x1294,0x3d3f ,0x3368,0x2620 ,0xea70,0x3c42 , + 0x0c7c,0x3ec5 ,0x3179,0x289a ,0xe1d5,0x3871 , + 0x0646,0x3fb1 ,0x2f6c,0x2afb ,0xd9e0,0x3368 , + 0x0000,0x4000 ,0x2d41,0x2d41 ,0xd2bf,0x2d41 , + 0xf9ba,0x3fb1 ,0x2afb,0x2f6c ,0xcc98,0x2620 , + 0xf384,0x3ec5 ,0x289a,0x3179 ,0xc78f,0x1e2b , + 0xed6c,0x3d3f ,0x2620,0x3368 ,0xc3be,0x1590 , + 0xe782,0x3b21 ,0x238e,0x3537 ,0xc13b,0x0c7c , + 0xe1d5,0x3871 ,0x20e7,0x36e5 ,0xc014,0x0324 , + 0xdc72,0x3537 ,0x1e2b,0x3871 ,0xc04f,0xf9ba , + 0xd766,0x3179 ,0x1b5d,0x39db ,0xc1eb,0xf073 , + 0xd2bf,0x2d41 ,0x187e,0x3b21 ,0xc4df,0xe782 , + 0xce87,0x289a ,0x1590,0x3c42 ,0xc91b,0xdf19 , + 0xcac9,0x238e ,0x1294,0x3d3f ,0xce87,0xd766 , + 0xc78f,0x1e2b ,0x0f8d,0x3e15 ,0xd505,0xd094 , + 0xc4df,0x187e ,0x0c7c,0x3ec5 ,0xdc72,0xcac9 , + 0xc2c1,0x1294 ,0x0964,0x3f4f ,0xe4a3,0xc625 , + 0xc13b,0x0c7c ,0x0646,0x3fb1 ,0xed6c,0xc2c1 , + 0xc04f,0x0646 ,0x0324,0x3fec ,0xf69c,0xc0b1 , + 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , + 0x3ffb,0x0192 ,0x3fff,0x00c9 ,0x3ff5,0x025b , + 0x3fec,0x0324 ,0x3ffb,0x0192 ,0x3fd4,0x04b5 , + 0x3fd4,0x04b5 ,0x3ff5,0x025b ,0x3f9c,0x070e , + 0x3fb1,0x0646 ,0x3fec,0x0324 ,0x3f4f,0x0964 , + 0x3f85,0x07d6 ,0x3fe1,0x03ed ,0x3eeb,0x0bb7 , + 0x3f4f,0x0964 ,0x3fd4,0x04b5 ,0x3e72,0x0e06 , + 0x3f0f,0x0af1 ,0x3fc4,0x057e ,0x3de3,0x1050 , + 0x3ec5,0x0c7c ,0x3fb1,0x0646 ,0x3d3f,0x1294 , + 0x3e72,0x0e06 ,0x3f9c,0x070e ,0x3c85,0x14d2 , + 0x3e15,0x0f8d ,0x3f85,0x07d6 ,0x3bb6,0x1709 , + 0x3daf,0x1112 ,0x3f6b,0x089d ,0x3ad3,0x1937 , + 0x3d3f,0x1294 ,0x3f4f,0x0964 ,0x39db,0x1b5d , + 0x3cc5,0x1413 ,0x3f30,0x0a2b ,0x38cf,0x1d79 , + 0x3c42,0x1590 ,0x3f0f,0x0af1 ,0x37b0,0x1f8c , + 0x3bb6,0x1709 ,0x3eeb,0x0bb7 ,0x367d,0x2193 , + 0x3b21,0x187e ,0x3ec5,0x0c7c ,0x3537,0x238e , + 0x3a82,0x19ef ,0x3e9d,0x0d41 ,0x33df,0x257e , + 0x39db,0x1b5d ,0x3e72,0x0e06 ,0x3274,0x2760 , + 0x392b,0x1cc6 ,0x3e45,0x0eca ,0x30f9,0x2935 , + 0x3871,0x1e2b ,0x3e15,0x0f8d ,0x2f6c,0x2afb , + 0x37b0,0x1f8c ,0x3de3,0x1050 ,0x2dcf,0x2cb2 , + 0x36e5,0x20e7 ,0x3daf,0x1112 ,0x2c21,0x2e5a , + 0x3612,0x223d ,0x3d78,0x11d3 ,0x2a65,0x2ff2 , + 0x3537,0x238e ,0x3d3f,0x1294 ,0x289a,0x3179 , + 0x3453,0x24da ,0x3d03,0x1354 ,0x26c1,0x32ef , + 0x3368,0x2620 ,0x3cc5,0x1413 ,0x24da,0x3453 , + 0x3274,0x2760 ,0x3c85,0x14d2 ,0x22e7,0x35a5 , + 0x3179,0x289a ,0x3c42,0x1590 ,0x20e7,0x36e5 , + 0x3076,0x29ce ,0x3bfd,0x164c ,0x1edc,0x3812 , + 0x2f6c,0x2afb ,0x3bb6,0x1709 ,0x1cc6,0x392b , + 0x2e5a,0x2c21 ,0x3b6d,0x17c4 ,0x1aa7,0x3a30 , + 0x2d41,0x2d41 ,0x3b21,0x187e ,0x187e,0x3b21 , + 0x2c21,0x2e5a ,0x3ad3,0x1937 ,0x164c,0x3bfd , + 0x2afb,0x2f6c ,0x3a82,0x19ef ,0x1413,0x3cc5 , + 0x29ce,0x3076 ,0x3a30,0x1aa7 ,0x11d3,0x3d78 , + 0x289a,0x3179 ,0x39db,0x1b5d ,0x0f8d,0x3e15 , + 0x2760,0x3274 ,0x3984,0x1c12 ,0x0d41,0x3e9d , + 0x2620,0x3368 ,0x392b,0x1cc6 ,0x0af1,0x3f0f , + 0x24da,0x3453 ,0x38cf,0x1d79 ,0x089d,0x3f6b , + 0x238e,0x3537 ,0x3871,0x1e2b ,0x0646,0x3fb1 , + 0x223d,0x3612 ,0x3812,0x1edc ,0x03ed,0x3fe1 , + 0x20e7,0x36e5 ,0x37b0,0x1f8c ,0x0192,0x3ffb , + 0x1f8c,0x37b0 ,0x374b,0x203a ,0xff37,0x3fff , + 0x1e2b,0x3871 ,0x36e5,0x20e7 ,0xfcdc,0x3fec , + 0x1cc6,0x392b ,0x367d,0x2193 ,0xfa82,0x3fc4 , + 0x1b5d,0x39db ,0x3612,0x223d ,0xf82a,0x3f85 , + 0x19ef,0x3a82 ,0x35a5,0x22e7 ,0xf5d5,0x3f30 , + 0x187e,0x3b21 ,0x3537,0x238e ,0xf384,0x3ec5 , + 0x1709,0x3bb6 ,0x34c6,0x2435 ,0xf136,0x3e45 , + 0x1590,0x3c42 ,0x3453,0x24da ,0xeeee,0x3daf , + 0x1413,0x3cc5 ,0x33df,0x257e ,0xecac,0x3d03 , + 0x1294,0x3d3f ,0x3368,0x2620 ,0xea70,0x3c42 , + 0x1112,0x3daf ,0x32ef,0x26c1 ,0xe83c,0x3b6d , + 0x0f8d,0x3e15 ,0x3274,0x2760 ,0xe611,0x3a82 , + 0x0e06,0x3e72 ,0x31f8,0x27fe ,0xe3ee,0x3984 , + 0x0c7c,0x3ec5 ,0x3179,0x289a ,0xe1d5,0x3871 , + 0x0af1,0x3f0f ,0x30f9,0x2935 ,0xdfc6,0x374b , + 0x0964,0x3f4f ,0x3076,0x29ce ,0xddc3,0x3612 , + 0x07d6,0x3f85 ,0x2ff2,0x2a65 ,0xdbcb,0x34c6 , + 0x0646,0x3fb1 ,0x2f6c,0x2afb ,0xd9e0,0x3368 , + 0x04b5,0x3fd4 ,0x2ee4,0x2b8f ,0xd802,0x31f8 , + 0x0324,0x3fec ,0x2e5a,0x2c21 ,0xd632,0x3076 , + 0x0192,0x3ffb ,0x2dcf,0x2cb2 ,0xd471,0x2ee4 , + 0x0000,0x4000 ,0x2d41,0x2d41 ,0xd2bf,0x2d41 , + 0xfe6e,0x3ffb ,0x2cb2,0x2dcf ,0xd11c,0x2b8f , + 0xfcdc,0x3fec ,0x2c21,0x2e5a ,0xcf8a,0x29ce , + 0xfb4b,0x3fd4 ,0x2b8f,0x2ee4 ,0xce08,0x27fe , + 0xf9ba,0x3fb1 ,0x2afb,0x2f6c ,0xcc98,0x2620 , + 0xf82a,0x3f85 ,0x2a65,0x2ff2 ,0xcb3a,0x2435 , + 0xf69c,0x3f4f ,0x29ce,0x3076 ,0xc9ee,0x223d , + 0xf50f,0x3f0f ,0x2935,0x30f9 ,0xc8b5,0x203a , + 0xf384,0x3ec5 ,0x289a,0x3179 ,0xc78f,0x1e2b , + 0xf1fa,0x3e72 ,0x27fe,0x31f8 ,0xc67c,0x1c12 , + 0xf073,0x3e15 ,0x2760,0x3274 ,0xc57e,0x19ef , + 0xeeee,0x3daf ,0x26c1,0x32ef ,0xc493,0x17c4 , + 0xed6c,0x3d3f ,0x2620,0x3368 ,0xc3be,0x1590 , + 0xebed,0x3cc5 ,0x257e,0x33df ,0xc2fd,0x1354 , + 0xea70,0x3c42 ,0x24da,0x3453 ,0xc251,0x1112 , + 0xe8f7,0x3bb6 ,0x2435,0x34c6 ,0xc1bb,0x0eca , + 0xe782,0x3b21 ,0x238e,0x3537 ,0xc13b,0x0c7c , + 0xe611,0x3a82 ,0x22e7,0x35a5 ,0xc0d0,0x0a2b , + 0xe4a3,0x39db ,0x223d,0x3612 ,0xc07b,0x07d6 , + 0xe33a,0x392b ,0x2193,0x367d ,0xc03c,0x057e , + 0xe1d5,0x3871 ,0x20e7,0x36e5 ,0xc014,0x0324 , + 0xe074,0x37b0 ,0x203a,0x374b ,0xc001,0x00c9 , + 0xdf19,0x36e5 ,0x1f8c,0x37b0 ,0xc005,0xfe6e , + 0xddc3,0x3612 ,0x1edc,0x3812 ,0xc01f,0xfc13 , + 0xdc72,0x3537 ,0x1e2b,0x3871 ,0xc04f,0xf9ba , + 0xdb26,0x3453 ,0x1d79,0x38cf ,0xc095,0xf763 , + 0xd9e0,0x3368 ,0x1cc6,0x392b ,0xc0f1,0xf50f , + 0xd8a0,0x3274 ,0x1c12,0x3984 ,0xc163,0xf2bf , + 0xd766,0x3179 ,0x1b5d,0x39db ,0xc1eb,0xf073 , + 0xd632,0x3076 ,0x1aa7,0x3a30 ,0xc288,0xee2d , + 0xd505,0x2f6c ,0x19ef,0x3a82 ,0xc33b,0xebed , + 0xd3df,0x2e5a ,0x1937,0x3ad3 ,0xc403,0xe9b4 , + 0xd2bf,0x2d41 ,0x187e,0x3b21 ,0xc4df,0xe782 , + 0xd1a6,0x2c21 ,0x17c4,0x3b6d ,0xc5d0,0xe559 , + 0xd094,0x2afb ,0x1709,0x3bb6 ,0xc6d5,0xe33a , + 0xcf8a,0x29ce ,0x164c,0x3bfd ,0xc7ee,0xe124 , + 0xce87,0x289a ,0x1590,0x3c42 ,0xc91b,0xdf19 , + 0xcd8c,0x2760 ,0x14d2,0x3c85 ,0xca5b,0xdd19 , + 0xcc98,0x2620 ,0x1413,0x3cc5 ,0xcbad,0xdb26 , + 0xcbad,0x24da ,0x1354,0x3d03 ,0xcd11,0xd93f , + 0xcac9,0x238e ,0x1294,0x3d3f ,0xce87,0xd766 , + 0xc9ee,0x223d ,0x11d3,0x3d78 ,0xd00e,0xd59b , + 0xc91b,0x20e7 ,0x1112,0x3daf ,0xd1a6,0xd3df , + 0xc850,0x1f8c ,0x1050,0x3de3 ,0xd34e,0xd231 , + 0xc78f,0x1e2b ,0x0f8d,0x3e15 ,0xd505,0xd094 , + 0xc6d5,0x1cc6 ,0x0eca,0x3e45 ,0xd6cb,0xcf07 , + 0xc625,0x1b5d ,0x0e06,0x3e72 ,0xd8a0,0xcd8c , + 0xc57e,0x19ef ,0x0d41,0x3e9d ,0xda82,0xcc21 , + 0xc4df,0x187e ,0x0c7c,0x3ec5 ,0xdc72,0xcac9 , + 0xc44a,0x1709 ,0x0bb7,0x3eeb ,0xde6d,0xc983 , + 0xc3be,0x1590 ,0x0af1,0x3f0f ,0xe074,0xc850 , + 0xc33b,0x1413 ,0x0a2b,0x3f30 ,0xe287,0xc731 , + 0xc2c1,0x1294 ,0x0964,0x3f4f ,0xe4a3,0xc625 , + 0xc251,0x1112 ,0x089d,0x3f6b ,0xe6c9,0xc52d , + 0xc1eb,0x0f8d ,0x07d6,0x3f85 ,0xe8f7,0xc44a , + 0xc18e,0x0e06 ,0x070e,0x3f9c ,0xeb2e,0xc37b , + 0xc13b,0x0c7c ,0x0646,0x3fb1 ,0xed6c,0xc2c1 , + 0xc0f1,0x0af1 ,0x057e,0x3fc4 ,0xefb0,0xc21d , + 0xc0b1,0x0964 ,0x04b5,0x3fd4 ,0xf1fa,0xc18e , + 0xc07b,0x07d6 ,0x03ed,0x3fe1 ,0xf449,0xc115 , + 0xc04f,0x0646 ,0x0324,0x3fec ,0xf69c,0xc0b1 , + 0xc02c,0x04b5 ,0x025b,0x3ff5 ,0xf8f2,0xc064 , + 0xc014,0x0324 ,0x0192,0x3ffb ,0xfb4b,0xc02c , + 0xc005,0x0192 ,0x00c9,0x3fff ,0xfda5,0xc00b , + 0x4000,0x0000 ,0x4000,0x0065 ,0x3fff,0x00c9 , + 0x3ffd,0x012e ,0x3ffb,0x0192 ,0x3ff8,0x01f7 , + 0x3ff5,0x025b ,0x3ff1,0x02c0 ,0x3fec,0x0324 , + 0x3fe7,0x0388 ,0x3fe1,0x03ed ,0x3fdb,0x0451 , + 0x3fd4,0x04b5 ,0x3fcc,0x051a ,0x3fc4,0x057e , + 0x3fbb,0x05e2 ,0x3fb1,0x0646 ,0x3fa7,0x06aa , + 0x3f9c,0x070e ,0x3f91,0x0772 ,0x3f85,0x07d6 , + 0x3f78,0x0839 ,0x3f6b,0x089d ,0x3f5d,0x0901 , + 0x3f4f,0x0964 ,0x3f40,0x09c7 ,0x3f30,0x0a2b , + 0x3f20,0x0a8e ,0x3f0f,0x0af1 ,0x3efd,0x0b54 , + 0x3eeb,0x0bb7 ,0x3ed8,0x0c1a ,0x3ec5,0x0c7c , + 0x3eb1,0x0cdf ,0x3e9d,0x0d41 ,0x3e88,0x0da4 , + 0x3e72,0x0e06 ,0x3e5c,0x0e68 ,0x3e45,0x0eca , + 0x3e2d,0x0f2b ,0x3e15,0x0f8d ,0x3dfc,0x0fee , + 0x3de3,0x1050 ,0x3dc9,0x10b1 ,0x3daf,0x1112 , + 0x3d93,0x1173 ,0x3d78,0x11d3 ,0x3d5b,0x1234 , + 0x3d3f,0x1294 ,0x3d21,0x12f4 ,0x3d03,0x1354 , + 0x3ce4,0x13b4 ,0x3cc5,0x1413 ,0x3ca5,0x1473 , + 0x3c85,0x14d2 ,0x3c64,0x1531 ,0x3c42,0x1590 , + 0x3c20,0x15ee ,0x3bfd,0x164c ,0x3bda,0x16ab , + 0x3bb6,0x1709 ,0x3b92,0x1766 ,0x3b6d,0x17c4 , + 0x3b47,0x1821 ,0x3b21,0x187e ,0x3afa,0x18db , + 0x3ad3,0x1937 ,0x3aab,0x1993 ,0x3a82,0x19ef , + 0x3a59,0x1a4b ,0x3a30,0x1aa7 ,0x3a06,0x1b02 , + 0x39db,0x1b5d ,0x39b0,0x1bb8 ,0x3984,0x1c12 , + 0x3958,0x1c6c ,0x392b,0x1cc6 ,0x38fd,0x1d20 , + 0x38cf,0x1d79 ,0x38a1,0x1dd3 ,0x3871,0x1e2b , + 0x3842,0x1e84 ,0x3812,0x1edc ,0x37e1,0x1f34 , + 0x37b0,0x1f8c ,0x377e,0x1fe3 ,0x374b,0x203a , + 0x3718,0x2091 ,0x36e5,0x20e7 ,0x36b1,0x213d , + 0x367d,0x2193 ,0x3648,0x21e8 ,0x3612,0x223d , + 0x35dc,0x2292 ,0x35a5,0x22e7 ,0x356e,0x233b , + 0x3537,0x238e ,0x34ff,0x23e2 ,0x34c6,0x2435 , + 0x348d,0x2488 ,0x3453,0x24da ,0x3419,0x252c , + 0x33df,0x257e ,0x33a3,0x25cf ,0x3368,0x2620 , + 0x332c,0x2671 ,0x32ef,0x26c1 ,0x32b2,0x2711 , + 0x3274,0x2760 ,0x3236,0x27af ,0x31f8,0x27fe , + 0x31b9,0x284c ,0x3179,0x289a ,0x3139,0x28e7 , + 0x30f9,0x2935 ,0x30b8,0x2981 ,0x3076,0x29ce , + 0x3034,0x2a1a ,0x2ff2,0x2a65 ,0x2faf,0x2ab0 , + 0x2f6c,0x2afb ,0x2f28,0x2b45 ,0x2ee4,0x2b8f , + 0x2e9f,0x2bd8 ,0x2e5a,0x2c21 ,0x2e15,0x2c6a , + 0x2dcf,0x2cb2 ,0x2d88,0x2cfa ,0x2d41,0x2d41 , + 0x2cfa,0x2d88 ,0x2cb2,0x2dcf ,0x2c6a,0x2e15 , + 0x2c21,0x2e5a ,0x2bd8,0x2e9f ,0x2b8f,0x2ee4 , + 0x2b45,0x2f28 ,0x2afb,0x2f6c ,0x2ab0,0x2faf , + 0x2a65,0x2ff2 ,0x2a1a,0x3034 ,0x29ce,0x3076 , + 0x2981,0x30b8 ,0x2935,0x30f9 ,0x28e7,0x3139 , + 0x289a,0x3179 ,0x284c,0x31b9 ,0x27fe,0x31f8 , + 0x27af,0x3236 ,0x2760,0x3274 ,0x2711,0x32b2 , + 0x26c1,0x32ef ,0x2671,0x332c ,0x2620,0x3368 , + 0x25cf,0x33a3 ,0x257e,0x33df ,0x252c,0x3419 , + 0x24da,0x3453 ,0x2488,0x348d ,0x2435,0x34c6 , + 0x23e2,0x34ff ,0x238e,0x3537 ,0x233b,0x356e , + 0x22e7,0x35a5 ,0x2292,0x35dc ,0x223d,0x3612 , + 0x21e8,0x3648 ,0x2193,0x367d ,0x213d,0x36b1 , + 0x20e7,0x36e5 ,0x2091,0x3718 ,0x203a,0x374b , + 0x1fe3,0x377e ,0x1f8c,0x37b0 ,0x1f34,0x37e1 , + 0x1edc,0x3812 ,0x1e84,0x3842 ,0x1e2b,0x3871 , + 0x1dd3,0x38a1 ,0x1d79,0x38cf ,0x1d20,0x38fd , + 0x1cc6,0x392b ,0x1c6c,0x3958 ,0x1c12,0x3984 , + 0x1bb8,0x39b0 ,0x1b5d,0x39db ,0x1b02,0x3a06 , + 0x1aa7,0x3a30 ,0x1a4b,0x3a59 ,0x19ef,0x3a82 , + 0x1993,0x3aab ,0x1937,0x3ad3 ,0x18db,0x3afa , + 0x187e,0x3b21 ,0x1821,0x3b47 ,0x17c4,0x3b6d , + 0x1766,0x3b92 ,0x1709,0x3bb6 ,0x16ab,0x3bda , + 0x164c,0x3bfd ,0x15ee,0x3c20 ,0x1590,0x3c42 , + 0x1531,0x3c64 ,0x14d2,0x3c85 ,0x1473,0x3ca5 , + 0x1413,0x3cc5 ,0x13b4,0x3ce4 ,0x1354,0x3d03 , + 0x12f4,0x3d21 ,0x1294,0x3d3f ,0x1234,0x3d5b , + 0x11d3,0x3d78 ,0x1173,0x3d93 ,0x1112,0x3daf , + 0x10b1,0x3dc9 ,0x1050,0x3de3 ,0x0fee,0x3dfc , + 0x0f8d,0x3e15 ,0x0f2b,0x3e2d ,0x0eca,0x3e45 , + 0x0e68,0x3e5c ,0x0e06,0x3e72 ,0x0da4,0x3e88 , + 0x0d41,0x3e9d ,0x0cdf,0x3eb1 ,0x0c7c,0x3ec5 , + 0x0c1a,0x3ed8 ,0x0bb7,0x3eeb ,0x0b54,0x3efd , + 0x0af1,0x3f0f ,0x0a8e,0x3f20 ,0x0a2b,0x3f30 , + 0x09c7,0x3f40 ,0x0964,0x3f4f ,0x0901,0x3f5d , + 0x089d,0x3f6b ,0x0839,0x3f78 ,0x07d6,0x3f85 , + 0x0772,0x3f91 ,0x070e,0x3f9c ,0x06aa,0x3fa7 , + 0x0646,0x3fb1 ,0x05e2,0x3fbb ,0x057e,0x3fc4 , + 0x051a,0x3fcc ,0x04b5,0x3fd4 ,0x0451,0x3fdb , + 0x03ed,0x3fe1 ,0x0388,0x3fe7 ,0x0324,0x3fec , + 0x02c0,0x3ff1 ,0x025b,0x3ff5 ,0x01f7,0x3ff8 , + 0x0192,0x3ffb ,0x012e,0x3ffd ,0x00c9,0x3fff , + 0x0065,0x4000 ,0x0000,0x4000 ,0xff9b,0x4000 , + 0xff37,0x3fff ,0xfed2,0x3ffd ,0xfe6e,0x3ffb , + 0xfe09,0x3ff8 ,0xfda5,0x3ff5 ,0xfd40,0x3ff1 , + 0xfcdc,0x3fec ,0xfc78,0x3fe7 ,0xfc13,0x3fe1 , + 0xfbaf,0x3fdb ,0xfb4b,0x3fd4 ,0xfae6,0x3fcc , + 0xfa82,0x3fc4 ,0xfa1e,0x3fbb ,0xf9ba,0x3fb1 , + 0xf956,0x3fa7 ,0xf8f2,0x3f9c ,0xf88e,0x3f91 , + 0xf82a,0x3f85 ,0xf7c7,0x3f78 ,0xf763,0x3f6b , + 0xf6ff,0x3f5d ,0xf69c,0x3f4f ,0xf639,0x3f40 , + 0xf5d5,0x3f30 ,0xf572,0x3f20 ,0xf50f,0x3f0f , + 0xf4ac,0x3efd ,0xf449,0x3eeb ,0xf3e6,0x3ed8 , + 0xf384,0x3ec5 ,0xf321,0x3eb1 ,0xf2bf,0x3e9d , + 0xf25c,0x3e88 ,0xf1fa,0x3e72 ,0xf198,0x3e5c , + 0xf136,0x3e45 ,0xf0d5,0x3e2d ,0xf073,0x3e15 , + 0xf012,0x3dfc ,0xefb0,0x3de3 ,0xef4f,0x3dc9 , + 0xeeee,0x3daf ,0xee8d,0x3d93 ,0xee2d,0x3d78 , + 0xedcc,0x3d5b ,0xed6c,0x3d3f ,0xed0c,0x3d21 , + 0xecac,0x3d03 ,0xec4c,0x3ce4 ,0xebed,0x3cc5 , + 0xeb8d,0x3ca5 ,0xeb2e,0x3c85 ,0xeacf,0x3c64 , + 0xea70,0x3c42 ,0xea12,0x3c20 ,0xe9b4,0x3bfd , + 0xe955,0x3bda ,0xe8f7,0x3bb6 ,0xe89a,0x3b92 , + 0xe83c,0x3b6d ,0xe7df,0x3b47 ,0xe782,0x3b21 , + 0xe725,0x3afa ,0xe6c9,0x3ad3 ,0xe66d,0x3aab , + 0xe611,0x3a82 ,0xe5b5,0x3a59 ,0xe559,0x3a30 , + 0xe4fe,0x3a06 ,0xe4a3,0x39db ,0xe448,0x39b0 , + 0xe3ee,0x3984 ,0xe394,0x3958 ,0xe33a,0x392b , + 0xe2e0,0x38fd ,0xe287,0x38cf ,0xe22d,0x38a1 , + 0xe1d5,0x3871 ,0xe17c,0x3842 ,0xe124,0x3812 , + 0xe0cc,0x37e1 ,0xe074,0x37b0 ,0xe01d,0x377e , + 0xdfc6,0x374b ,0xdf6f,0x3718 ,0xdf19,0x36e5 , + 0xdec3,0x36b1 ,0xde6d,0x367d ,0xde18,0x3648 , + 0xddc3,0x3612 ,0xdd6e,0x35dc ,0xdd19,0x35a5 , + 0xdcc5,0x356e ,0xdc72,0x3537 ,0xdc1e,0x34ff , + 0xdbcb,0x34c6 ,0xdb78,0x348d ,0xdb26,0x3453 , + 0xdad4,0x3419 ,0xda82,0x33df ,0xda31,0x33a3 , + 0xd9e0,0x3368 ,0xd98f,0x332c ,0xd93f,0x32ef , + 0xd8ef,0x32b2 ,0xd8a0,0x3274 ,0xd851,0x3236 , + 0xd802,0x31f8 ,0xd7b4,0x31b9 ,0xd766,0x3179 , + 0xd719,0x3139 ,0xd6cb,0x30f9 ,0xd67f,0x30b8 , + 0xd632,0x3076 ,0xd5e6,0x3034 ,0xd59b,0x2ff2 , + 0xd550,0x2faf ,0xd505,0x2f6c ,0xd4bb,0x2f28 , + 0xd471,0x2ee4 ,0xd428,0x2e9f ,0xd3df,0x2e5a , + 0xd396,0x2e15 ,0xd34e,0x2dcf ,0xd306,0x2d88 , + 0xd2bf,0x2d41 ,0xd278,0x2cfa ,0xd231,0x2cb2 , + 0xd1eb,0x2c6a ,0xd1a6,0x2c21 ,0xd161,0x2bd8 , + 0xd11c,0x2b8f ,0xd0d8,0x2b45 ,0xd094,0x2afb , + 0xd051,0x2ab0 ,0xd00e,0x2a65 ,0xcfcc,0x2a1a , + 0xcf8a,0x29ce ,0xcf48,0x2981 ,0xcf07,0x2935 , + 0xcec7,0x28e7 ,0xce87,0x289a ,0xce47,0x284c , + 0xce08,0x27fe ,0xcdca,0x27af ,0xcd8c,0x2760 , + 0xcd4e,0x2711 ,0xcd11,0x26c1 ,0xccd4,0x2671 , + 0xcc98,0x2620 ,0xcc5d,0x25cf ,0xcc21,0x257e , + 0xcbe7,0x252c ,0xcbad,0x24da ,0xcb73,0x2488 , + 0xcb3a,0x2435 ,0xcb01,0x23e2 ,0xcac9,0x238e , + 0xca92,0x233b ,0xca5b,0x22e7 ,0xca24,0x2292 , + 0xc9ee,0x223d ,0xc9b8,0x21e8 ,0xc983,0x2193 , + 0xc94f,0x213d ,0xc91b,0x20e7 ,0xc8e8,0x2091 , + 0xc8b5,0x203a ,0xc882,0x1fe3 ,0xc850,0x1f8c , + 0xc81f,0x1f34 ,0xc7ee,0x1edc ,0xc7be,0x1e84 , + 0xc78f,0x1e2b ,0xc75f,0x1dd3 ,0xc731,0x1d79 , + 0xc703,0x1d20 ,0xc6d5,0x1cc6 ,0xc6a8,0x1c6c , + 0xc67c,0x1c12 ,0xc650,0x1bb8 ,0xc625,0x1b5d , + 0xc5fa,0x1b02 ,0xc5d0,0x1aa7 ,0xc5a7,0x1a4b , + 0xc57e,0x19ef ,0xc555,0x1993 ,0xc52d,0x1937 , + 0xc506,0x18db ,0xc4df,0x187e ,0xc4b9,0x1821 , + 0xc493,0x17c4 ,0xc46e,0x1766 ,0xc44a,0x1709 , + 0xc426,0x16ab ,0xc403,0x164c ,0xc3e0,0x15ee , + 0xc3be,0x1590 ,0xc39c,0x1531 ,0xc37b,0x14d2 , + 0xc35b,0x1473 ,0xc33b,0x1413 ,0xc31c,0x13b4 , + 0xc2fd,0x1354 ,0xc2df,0x12f4 ,0xc2c1,0x1294 , + 0xc2a5,0x1234 ,0xc288,0x11d3 ,0xc26d,0x1173 , + 0xc251,0x1112 ,0xc237,0x10b1 ,0xc21d,0x1050 , + 0xc204,0x0fee ,0xc1eb,0x0f8d ,0xc1d3,0x0f2b , + 0xc1bb,0x0eca ,0xc1a4,0x0e68 ,0xc18e,0x0e06 , + 0xc178,0x0da4 ,0xc163,0x0d41 ,0xc14f,0x0cdf , + 0xc13b,0x0c7c ,0xc128,0x0c1a ,0xc115,0x0bb7 , + 0xc103,0x0b54 ,0xc0f1,0x0af1 ,0xc0e0,0x0a8e , + 0xc0d0,0x0a2b ,0xc0c0,0x09c7 ,0xc0b1,0x0964 , + 0xc0a3,0x0901 ,0xc095,0x089d ,0xc088,0x0839 , + 0xc07b,0x07d6 ,0xc06f,0x0772 ,0xc064,0x070e , + 0xc059,0x06aa ,0xc04f,0x0646 ,0xc045,0x05e2 , + 0xc03c,0x057e ,0xc034,0x051a ,0xc02c,0x04b5 , + 0xc025,0x0451 ,0xc01f,0x03ed ,0xc019,0x0388 , + 0xc014,0x0324 ,0xc00f,0x02c0 ,0xc00b,0x025b , + 0xc008,0x01f7 ,0xc005,0x0192 ,0xc003,0x012e , + 0xc001,0x00c9 ,0xc000,0x0065 }; diff --git a/src/mod/codecs/mod_isac/webrtc_fft_t_rad.c b/src/mod/codecs/mod_isac/webrtc_fft_t_rad.c new file mode 100644 index 0000000000..13fbd9f53e --- /dev/null +++ b/src/mod/codecs/mod_isac/webrtc_fft_t_rad.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2011 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 + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +/* + * This file contains the Q14 radix-2 tables used in ARM9E optimization routines. + * + */ + +extern const unsigned short t_Q14S_rad8[2]; +const unsigned short t_Q14S_rad8[2] = { 0x0000,0x2d41 }; + +//extern const int t_Q30S_rad8[2]; +//const int t_Q30S_rad8[2] = { 0x00000000,0x2d413ccd }; + +extern const unsigned short t_Q14R_rad8[2]; +const unsigned short t_Q14R_rad8[2] = { 0x2d41,0x2d41 }; + +//extern const int t_Q30R_rad8[2]; +//const int t_Q30R_rad8[2] = { 0x2d413ccd,0x2d413ccd }; diff --git a/src/mod/codecs/mod_speex/mod_speex.c b/src/mod/codecs/mod_speex/mod_speex.c index 6e21939d33..aaec0a6602 100644 --- a/src/mod/codecs/mod_speex/mod_speex.c +++ b/src/mod/codecs/mod_speex/mod_speex.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,6 +24,7 @@ * Contributor(s): * * Anthony Minessale II + * Chris Rienzo * * * mod_speex.c -- Speex Codec Module @@ -279,10 +280,11 @@ 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; + *flag |= SWITCH_CODEC_FLAG_SILENCE | SFF_CNG; return SWITCH_STATUS_SUCCESS; } @@ -353,6 +355,126 @@ static switch_status_t switch_speex_destroy(switch_codec_t *codec) return SWITCH_STATUS_SUCCESS; } +/** + * read default settings from speex.conf + */ +static void load_configuration() +{ + switch_xml_t xml = NULL, cfg = NULL; + + if ((xml = switch_xml_open_cfg("speex.conf", &cfg, NULL))) { + switch_xml_t x_lists; + if ((x_lists = switch_xml_child(cfg, "settings"))) { + const char *settings_name = switch_xml_attr(x_lists, "name"); + switch_xml_t x_list; + if (zstr(settings_name)) { + settings_name = ""; + } + 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; + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s %s = %s\n", settings_name, name, value); + + if (!strcasecmp("quality", name)) { + /* compression quality, integer 0-10 */ + int tmp = atoi(value); + if (switch_is_number(value) && tmp >= 0 && tmp <= 10) { + default_codec_settings.quality = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid quality value: %s\n", value); + } + } else if (!strcasecmp("complexity", name)) { + /* compression complexity, integer 1-10 */ + int tmp = atoi(value); + if (switch_is_number(value) && tmp >= 1 && tmp <= 10) { + default_codec_settings.complexity = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid complexity value: %s\n", value); + } + } else if (!strcasecmp("enhancement", name)) { + /* enable perceptual enhancement, boolean */ + default_codec_settings.enhancement = switch_true(value); + } else if (!strcasecmp("vad", name)) { + /* enable voice activity detection, boolean */ + default_codec_settings.vad = switch_true(value); + } else if (!strcasecmp("vbr", name)) { + /* enable variable bit rate, boolean */ + default_codec_settings.vbr = switch_true(value); + } else if (!strcasecmp("vbr-quality", name)) { + /* variable bit rate quality, float 0-10 */ + float tmp = atof(value); + if (switch_is_number(value) && tmp >= 0 && tmp <= 10) { + default_codec_settings.vbr_quality = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid vbr-quality value: %s\n", value); + } + } else if (!strcasecmp("abr", name)) { + /* average bit rate, integer bits per sec */ + int tmp = atoi(value); + if (switch_is_number(value) && tmp >= 0) { + default_codec_settings.abr = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid abr value: %s\n", value); + } + } else if (!strcasecmp("dtx", name)) { + /* discontinuous transmit, boolean */ + default_codec_settings.dtx = switch_true(value); + } else if (!strcasecmp("preproc", name)) { + /* enable preprocessor, boolean */ + default_codec_settings.preproc = switch_true(value); + } else if (!strcasecmp("pp-vad", name)) { + /* enable preprocessor VAD, boolean */ + default_codec_settings.pp_vad = switch_true(value); + } else if (!strcasecmp("pp-agc", name)) { + /* enable preprocessor automatic gain control, boolean */ + default_codec_settings.pp_agc = switch_true(value); + } else if (!strcasecmp("pp-agc-level", name)) { + /* agc level, float */ + float tmp = atof(value); + if (switch_is_number(value) && tmp >= 0.0f) { + default_codec_settings.pp_agc_level = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid pp-agc-level value: %s\n", value); + } + } else if (!strcasecmp("pp-denoise", name)) { + /* enable preprocessor denoiser, boolean */ + default_codec_settings.pp_denoise = switch_true(value); + } else if (!strcasecmp("pp-dereverb", name)) { + /* enable preprocessor reverberation removal, boolean */ + default_codec_settings.pp_dereverb = switch_true(value); + } else if (!strcasecmp("pp-dereverb-decay", name)) { + /* reverberation removal decay, float */ + float tmp = atof(value); + if (switch_is_number(value) && tmp >= 0.0f) { + default_codec_settings.pp_dereverb_decay = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid pp-dereverb-decay value: %s\n", value); + } + } else if (!strcasecmp("pp-dereverb-level", name)) { + /* reverberation removal level, float */ + float tmp = atof(value); + if (switch_is_number(value) && tmp >= 0.0f) { + default_codec_settings.pp_dereverb_level = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid pp-dereverb-level value: %s\n", value); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ignoring invalid unknown param: %s = %s\n", name, value); + } + } + } + switch_xml_free(xml); + } +} + SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load) { switch_codec_interface_t *codec_interface; @@ -361,6 +483,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load) int bps[4] = { 0, 24600, 42200, 44000 }; /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + load_configuration(); + SWITCH_ADD_CODEC(codec_interface, "Speex"); codec_interface->parse_fmtp = switch_speex_fmtp_parse; for (counta = 1; counta <= 3; counta++) { 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 45a736facf..97b3431d3d 100644 --- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c +++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c @@ -84,7 +84,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * switch_xml_t xcond, xaction, xexpression, xregex; switch_channel_t *channel = switch_core_session_get_channel(session); char *exten_name = (char *) switch_xml_attr(xexten, "name"); - int proceed = 0, save_proceed = 0; + int proceed = 0, save_proceed = 0, soft_proceed = 0; char *expression_expanded = NULL, *field_expanded = NULL; switch_regex_t *re = NULL, *save_re = NULL; int offset = 0; @@ -117,7 +117,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * if (switch_xml_child(xcond, "condition")) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Nested conditions are not allowed!\n"); - proceed = 1; + soft_proceed = 1; goto done; } @@ -143,6 +143,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * "Dialplan: %s Date/Time Match (PASS) [%s] break=%s\n", switch_channel_get_name(channel), exten_name, do_break_a ? do_break_a : "on-false"); anti_action = SWITCH_FALSE; + soft_proceed = 1; } else if (time_match == 0) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_DEBUG, "Dialplan: %s Date/TimeMatch (FAIL) [%s] break=%s\n", @@ -189,7 +190,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * total++; field = (char *) switch_xml_attr(xregex, "field"); - + if (field) { if (strchr(field, '$')) { if ((field_expanded = switch_channel_expand_variables(channel, field)) == field) { @@ -222,9 +223,11 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_DEBUG, "Dialplan: %s Absolute Condition [%s] match=%s\n", switch_channel_get_name(channel), exten_name, all ? "all" : "any"); pass++; + soft_proceed = 1; if (!all && !xor) break; } else if (time_match == 1) { pass++; + soft_proceed = 1; if (!all && !xor) break; } @@ -310,6 +313,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_DEBUG, "Dialplan: %s Absolute Condition [%s]\n", switch_channel_get_name(channel), exten_name); anti_action = SWITCH_FALSE; + soft_proceed = 1; } } @@ -364,7 +368,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * switch_caller_extension_add_application(session, *extension, application, data); } } - proceed = 1; + soft_proceed = 1; } } else { if (field && strchr(expression, '(')) { @@ -439,7 +443,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * switch_regex_safe_free(re); switch_safe_free(field_expanded); switch_safe_free(expression_expanded); - return proceed; + return proceed ? proceed : soft_proceed; } static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t *root, diff --git a/src/mod/endpoints/mod_gsmopen/.gitignore b/src/mod/endpoints/mod_gsmopen/.gitignore index fe8dc68bd5..e2769c8969 100644 --- a/src/mod/endpoints/mod_gsmopen/.gitignore +++ b/src/mod/endpoints/mod_gsmopen/.gitignore @@ -1,4 +1,3 @@ !/gsmlib/gsmlib-*/aclocal.m4 !/gsmlib/gsmlib-*/configure -!/gsmlib/gsmlib-1.10.tar.gz -!/gsmlib/gsmlib_1.10-12ubuntu1.diff.gz +!/gsmlib/gsmlib_1.10.orig.tar.gz diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/README b/src/mod/endpoints/mod_gsmopen/gsmlib/README index 8279636209..709f78f2ca 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/README +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/README @@ -2,7 +2,7 @@ For Linux distros without gsmlib (eg: CentOS): Here are the original (ancient) sources for gsmlib, and the patch made by Ubuntu for modern compilers. -In the directory gsmlib-1.10-patched-12ubuntu1 are the patched sources, ready for (no need to patch them again): +In the directory gsmlib-1.10-patched-13ubuntu are the patched sources, ready for (no need to patch them again): ./configure make make install diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/copyright b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/copyright deleted file mode 100644 index b78ded23aa..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/copyright +++ /dev/null @@ -1,26 +0,0 @@ -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 - -Copyright: - - This package 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; version 2 dated June, 1991. - - 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 General Public License for more details. - - You should have received a copy of the GNU 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 GNU/Linux systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.default b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.default deleted file mode 100644 index fa72d12e81..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.default +++ /dev/null @@ -1,13 +0,0 @@ -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 - -function do_accounting { true; } # it's your turn diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.undocumented b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.undocumented deleted file mode 100644 index 62d096021d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.undocumented +++ /dev/null @@ -1,2 +0,0 @@ -gsmsmsspool.1 -gsmsmsrequeue.8 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmctl.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmctl.vcproj deleted file mode 100644 index f079939e50..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmctl.vcproj +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmlib.sln b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmlib.sln deleted file mode 100644 index 1236577fb5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmlib.sln +++ /dev/null @@ -1,92 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmctl", "gsmctl.vcproj", "{54A7F660-F430-4533-8151-63BEFD12232B}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "gsmlib.vcproj", "{982662D6-47D2-40D6-A873-E970D407BB2B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmpb", "gsmpb.vcproj", "{7E44C592-6CBC-4A35-817E-D6EA48E4AB1B}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsendsms", "gsmsendsms.vcproj", "{D9879143-D549-4877-AEB2-667BC5D35F32}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsd", "gsmsmsd.vcproj", "{98F03909-E60D-4797-A35F-F0E535FF4A75}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsstore", "gsmsmsstore.vcproj", "{A99A0B10-EB66-40FF-A994-B6D6E0D9167F}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgsmlib", "testgsmlib.vcproj", "{33DFBB83-99BD-449D-A486-B4BCE37544C6}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms", "testsms.vcproj", "{D3147DAC-F5E2-4ED8-B73C-43A96B042698}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms2", "testsms2.vcproj", "{AFAD00BB-1A68-4696-A3EA-4CAD26D9E051}" - ProjectSection(ProjectDependencies) = postProject - {982662D6-47D2-40D6-A873-E970D407BB2B} = {982662D6-47D2-40D6-A873-E970D407BB2B} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {54A7F660-F430-4533-8151-63BEFD12232B}.Debug|Win32.ActiveCfg = Debug|Win32 - {54A7F660-F430-4533-8151-63BEFD12232B}.Debug|Win32.Build.0 = Debug|Win32 - {54A7F660-F430-4533-8151-63BEFD12232B}.Release|Win32.ActiveCfg = Release|Win32 - {54A7F660-F430-4533-8151-63BEFD12232B}.Release|Win32.Build.0 = Release|Win32 - {982662D6-47D2-40D6-A873-E970D407BB2B}.Debug|Win32.ActiveCfg = Debug|Win32 - {982662D6-47D2-40D6-A873-E970D407BB2B}.Debug|Win32.Build.0 = Debug|Win32 - {982662D6-47D2-40D6-A873-E970D407BB2B}.Release|Win32.ActiveCfg = Release|Win32 - {982662D6-47D2-40D6-A873-E970D407BB2B}.Release|Win32.Build.0 = Release|Win32 - {7E44C592-6CBC-4A35-817E-D6EA48E4AB1B}.Debug|Win32.ActiveCfg = Debug|Win32 - {7E44C592-6CBC-4A35-817E-D6EA48E4AB1B}.Debug|Win32.Build.0 = Debug|Win32 - {7E44C592-6CBC-4A35-817E-D6EA48E4AB1B}.Release|Win32.ActiveCfg = Release|Win32 - {7E44C592-6CBC-4A35-817E-D6EA48E4AB1B}.Release|Win32.Build.0 = Release|Win32 - {D9879143-D549-4877-AEB2-667BC5D35F32}.Debug|Win32.ActiveCfg = Debug|Win32 - {D9879143-D549-4877-AEB2-667BC5D35F32}.Debug|Win32.Build.0 = Debug|Win32 - {D9879143-D549-4877-AEB2-667BC5D35F32}.Release|Win32.ActiveCfg = Release|Win32 - {D9879143-D549-4877-AEB2-667BC5D35F32}.Release|Win32.Build.0 = Release|Win32 - {98F03909-E60D-4797-A35F-F0E535FF4A75}.Debug|Win32.ActiveCfg = Debug|Win32 - {98F03909-E60D-4797-A35F-F0E535FF4A75}.Debug|Win32.Build.0 = Debug|Win32 - {98F03909-E60D-4797-A35F-F0E535FF4A75}.Release|Win32.ActiveCfg = Release|Win32 - {98F03909-E60D-4797-A35F-F0E535FF4A75}.Release|Win32.Build.0 = Release|Win32 - {A99A0B10-EB66-40FF-A994-B6D6E0D9167F}.Debug|Win32.ActiveCfg = Debug|Win32 - {A99A0B10-EB66-40FF-A994-B6D6E0D9167F}.Debug|Win32.Build.0 = Debug|Win32 - {A99A0B10-EB66-40FF-A994-B6D6E0D9167F}.Release|Win32.ActiveCfg = Release|Win32 - {A99A0B10-EB66-40FF-A994-B6D6E0D9167F}.Release|Win32.Build.0 = Release|Win32 - {33DFBB83-99BD-449D-A486-B4BCE37544C6}.Debug|Win32.ActiveCfg = Debug|Win32 - {33DFBB83-99BD-449D-A486-B4BCE37544C6}.Debug|Win32.Build.0 = Debug|Win32 - {33DFBB83-99BD-449D-A486-B4BCE37544C6}.Release|Win32.ActiveCfg = Release|Win32 - {33DFBB83-99BD-449D-A486-B4BCE37544C6}.Release|Win32.Build.0 = Release|Win32 - {D3147DAC-F5E2-4ED8-B73C-43A96B042698}.Debug|Win32.ActiveCfg = Debug|Win32 - {D3147DAC-F5E2-4ED8-B73C-43A96B042698}.Debug|Win32.Build.0 = Debug|Win32 - {D3147DAC-F5E2-4ED8-B73C-43A96B042698}.Release|Win32.ActiveCfg = Release|Win32 - {D3147DAC-F5E2-4ED8-B73C-43A96B042698}.Release|Win32.Build.0 = Release|Win32 - {AFAD00BB-1A68-4696-A3EA-4CAD26D9E051}.Debug|Win32.ActiveCfg = Debug|Win32 - {AFAD00BB-1A68-4696-A3EA-4CAD26D9E051}.Debug|Win32.Build.0 = Debug|Win32 - {AFAD00BB-1A68-4696-A3EA-4CAD26D9E051}.Release|Win32.ActiveCfg = Release|Win32 - {AFAD00BB-1A68-4696-A3EA-4CAD26D9E051}.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-12ubuntu1/win32/gsmlib.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmlib.vcproj deleted file mode 100644 index 7c668458d4..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmlib.vcproj +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmpb.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmpb.vcproj deleted file mode 100644 index 49a608f6c7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmpb.vcproj +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsendsms.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsendsms.vcproj deleted file mode 100644 index 04e6531f1e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsendsms.vcproj +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsmsd.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsmsd.vcproj deleted file mode 100644 index f6c7eb999b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsmsd.vcproj +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsmsstore.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsmsstore.vcproj deleted file mode 100644 index de1b20ff1b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsmsmsstore.vcproj +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testgsmlib.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testgsmlib.vcproj deleted file mode 100644 index 766f863d6f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testgsmlib.vcproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testsms.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testsms.vcproj deleted file mode 100644 index 54ae74c491..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testsms.vcproj +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testsms2.vcproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testsms2.vcproj deleted file mode 100644 index 824eb4971e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/testsms2.vcproj +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ABOUT-NLS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ABOUT-NLS similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ABOUT-NLS rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ABOUT-NLS diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/AUTHORS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/AUTHORS similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/AUTHORS rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/AUTHORS diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/COPYING b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/COPYING similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/COPYING rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/COPYING diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ChangeLog b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ChangeLog similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ChangeLog rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ChangeLog diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/INSTALL b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/INSTALL similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/INSTALL rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/INSTALL diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/NEWS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/NEWS similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/NEWS rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/NEWS diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/README b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/README similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/README rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/README diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/TODO b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/TODO similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/TODO rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/TODO diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/acconfig.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acconfig.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/acconfig.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acconfig.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/acinclude.m4 b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acinclude.m4 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/acinclude.m4 rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acinclude.m4 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/aclocal.m4 b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/aclocal.m4 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/aclocal.m4 rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/aclocal.m4 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmctl.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmctl.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmctl.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmctl.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmpb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmpb.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmpb.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmpb.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsendsms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsendsms.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsendsms.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsendsms.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsmsd.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsd.cc similarity index 99% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsmsd.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsd.cc index e436546225..ffb2db0739 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsmsd.cc +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsd.cc @@ -40,6 +40,7 @@ #include #include #include +#include using namespace std; using namespace gsmlib; @@ -413,6 +414,9 @@ int main(int argc, char *argv[]) case 's': spoolDir = optarg; break; + case 'L': + enableSyslog = true; + break; case 'S': sentDir = optarg; break; diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsmsstore.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsstore.cc similarity index 98% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsmsstore.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsstore.cc index e164aafebf..2bb50a0c76 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/apps/gsmsmsstore.cc +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsstore.cc @@ -292,19 +292,14 @@ int main(int argc, char *argv[]) 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 == "-") diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/configure b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/configure rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/configure.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/configure.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.cron.d b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.cron.d similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.cron.d rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.cron.d diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.default b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.default similarity index 81% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.default rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.default index fa72d12e81..8ab73a9530 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.default +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.default @@ -10,4 +10,4 @@ SUBJECT="SMS delivery report:" SMSPROCESSOR="" # or /usr/bin/gsmsmsprocessor -function do_accounting { true; } # it's your turn +do_accounting () { true; } # it's your turn diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.init b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.init similarity index 87% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.init rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.init index 9a783b10ea..7bb3ac0cd1 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.init +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.init @@ -1,4 +1,13 @@ #! /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 # @@ -27,11 +36,6 @@ 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 -if [ ! -d /var/run/gsm-utils ]; then - mkdir /var/run/gsm-utils - chown gsmsms:gsmsms /var/run/gsm-utils -fi - case "$1" in start) echo -n "Starting $DESC: " @@ -61,10 +65,10 @@ case "$1" in 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 + --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS sleep 5 start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ - --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS + --make-pidfile --background --exec $DAEMON -- $OPTIONS echo "." ;; *) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsmsmsrequeue b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsrequeue similarity index 94% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsmsmsrequeue rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsrequeue index 888c6a993f..88b65c15bf 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsmsmsrequeue +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsrequeue @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # # /usr/bin/gsmsmsrequeue: Re-queues failed SMS # @@ -9,7 +9,8 @@ PRIORITIES=3 SMSADMIN=root SUBJECT="SMS delivery report:" -function send_notify { +send_notify() +{ tmpfile="$SPOOLDIR/tmp/"`basename "$1"` status="$2" if mv "$1" "$tmpfile" 2>/dev/null; then @@ -21,7 +22,10 @@ function send_notify { rm "$tmpfile" fi } -function do_accounting { true; } +do_accounting() +{ + true; +} test -r /etc/default/gsm-utils && . /etc/default/gsm-utils diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsmsmsspool b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsspool similarity index 98% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsmsmsspool rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsspool index 12ffb008e0..75bc1f9b79 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsmsmsspool +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsspool @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # # /usr/bin/gsmsmsspool: Queues SMS for sending # diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/changelog b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/changelog similarity index 71% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/changelog rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/changelog index a343c93fa5..86bca0b277 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/changelog +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/changelog @@ -1,12 +1,73 @@ -gsmlib (1.10-12ubuntu1) hardy; urgency=low +gsmlib (1.10-13) unstable; urgency=low - * Merge from Debian unstable. Remaining Ubuntu changes: - - [debian/gsm-utils.postinst, debian/gsm-utils.init] - Create /var/run/gsm-utils if it does not exist - - Actually fix the init script (debian #377448) - - Set Ubuntu maintainer adress. + * 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) - -- Albin Tonnerre Wed, 12 Dec 2007 00:45:00 +0100 + -- 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 @@ -42,27 +103,6 @@ gsmlib (1.10-11) unstable; urgency=low -- Mark Purcell Sat, 29 Sep 2007 18:22:56 +0100 -gsmlib (1.10-10ubuntu3) feisty; urgency=low - - * Rebuild for ldbl128 change (powerpc, sparc). - * Set Ubuntu maintainer address. - - -- Matthias Klose Thu, 1 Mar 2007 22:37:57 +0000 - -gsmlib (1.10-10ubuntu2) edgy; urgency=low - - * [debian/gsm-utils.postinst, debian/gsm-utils.init] - Create /var/run/gsm-utils if it does not exist - - -- Matt Zimmerman Tue, 11 Jul 2006 13:59:12 -0700 - -gsmlib (1.10-10ubuntu1) edgy; urgency=low - - * Re-sync with Debian - * debian/gsm-utils.init reload/restart was not calling --stop - - -- Barry deFreese Sat, 8 Jul 2006 22:52:23 -0400 - gsmlib (1.10-10) unstable; urgency=low * FTBFS with G++ 4.1: extra qualifications (Closes: #356109) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/compat b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/compat similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/compat rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/compat diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/control b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/control similarity index 83% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/control rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/control index 8ae52158a3..b230b8b838 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/control +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/control @@ -1,10 +1,10 @@ Source: gsmlib Section: comm Priority: extra -Maintainer: Ubuntu MOTU Developers -XSBC-Original-Maintainer: Mark Purcell +Maintainer: Mark Purcell Build-Depends: debhelper (>= 3.0.0), chrpath -Standards-Version: 3.2.1 +Standards-Version: 3.7.3 +Homepage: http://www.pxh.de/fs/gsmlib/ Package: libgsmme-dev Section: libdevel @@ -16,8 +16,6 @@ Description: Header files and static libraries for 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. - . - Website: http://www.pxh.de/fs/gsmlib/ Package: libgsmme1c2a Conflicts: libgsmme1, libgsmme1c102, libgsmme1c2 @@ -35,8 +33,6 @@ Description: GSM mobile phone access library * sending and reception of SMS messages . gsmlib uses standard ETSI GSM 07.07, ETSI GSM 07.05, and others. - . - Website: http://www.pxh.de/fs/gsmlib/ Package: gsm-utils Section: comm @@ -47,6 +43,3 @@ Description: GSM mobile phone access applications 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. - . - Website: http://www.pxh.de/fs/gsmlib/ - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/copyright b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/copyright new file mode 100644 index 0000000000..dcb44c32cd --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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'. diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/dirs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/dirs new file mode 100644 index 0000000000..a39a14c5cf --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/dirs @@ -0,0 +1 @@ +/var/run/gsm-utils diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.cron.d b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.cron.d similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.cron.d rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.cron.d diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.default b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.default new file mode 100644 index 0000000000..11901da54a --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.dirs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.dirs similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.dirs rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.dirs diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.docs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.docs similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.docs rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.docs diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.examples b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.examples new file mode 100644 index 0000000000..bd892f97be --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.examples @@ -0,0 +1,2 @@ +contrib/gsm-utils.cron.d +contrib/gsm-utils.init diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.init b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.init similarity index 79% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.init rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.init index 3a84240e09..bc51002f65 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/contrib/gsm-utils.init +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.init @@ -1,4 +1,13 @@ #! /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 # @@ -11,6 +20,12 @@ 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 @@ -55,11 +70,11 @@ case "$1" in ;; restart|force-reload) echo -n "Restarting $DESC: $NAME" - start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \ - --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS + 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 --exec $DAEMON -- $OPTIONS + --make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS echo "." ;; *) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.postinst b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postinst similarity index 91% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.postinst rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postinst index 7ad58b46f0..2954c4a400 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.postinst +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postinst @@ -19,9 +19,6 @@ if ! groups gsmsms | grep -q dialout ; then fi # echo Updating spool directory structure: /var/spool/sms -if [ ! -d /var/run/gsm-utils ]; then - mkdir /var/run/gsm-utils -fi chown -R gsmsms:gsmsms /var/spool/sms /var/run/gsm-utils chmod 700 /var/spool/sms/* chmod 750 /var/spool/sms diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.postrm b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postrm similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.postrm rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postrm diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsmsiexfer.1 b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsmsiexfer.1 similarity index 85% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsmsiexfer.1 rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsmsiexfer.1 index 5f7d449649..4dc996578a 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsmsiexfer.1 +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsmsiexfer.1 @@ -14,10 +14,10 @@ .SH NAME gsmsiexfer \- Siemens ME file transfer program for Siemens phones S25, S35, S45, ME45, SL45 .SH SYNOPSIS -.B gsmsiexfer --help +.B gsmsiexfer \-\-help .PP .SH DESCRIPTION -\fIgsmsiexer\fP comes with no man page. Try gsmsiexfer --help, or +\fIgsmsiexer\fP comes with no man page. Try gsmsiexfer \-\-help, or read the source. .PP .SH "SEE ALSO" diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/libgsmme-dev.docs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/libgsmme-dev.docs similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/libgsmme-dev.docs rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/libgsmme-dev.docs diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/rules b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/rules similarity index 91% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/rules rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/rules index 11886b8d35..a615ea02d4 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/rules +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/rules @@ -1,6 +1,4 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -39,7 +37,7 @@ configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. - CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS) INSTALL_PROGRAM=$(INSTALL_PROGRAM) \ + CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" INSTALL_PROGRAM=$(INSTALL_PROGRAM) \ ./configure $(confflags) --prefix=/usr --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info @@ -80,8 +78,6 @@ install: build $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp chrpath -d debian/tmp/usr/bin/* cp contrib/gsmsmsspool contrib/gsmsmsrequeue debian/tmp/usr/bin - cp contrib/gsm-utils.init contrib/gsm-utils.default debian - cp contrib/gsm-utils.cron.d debian # Build architecture-independent files here. @@ -110,12 +106,9 @@ binary-arch: build install usr/bin -# dh_installdebconf dh_installdocs dh_installexamples dh_installmenu -# dh_installemacsen -# dh_installpam dh_installinit dh_installcron dh_installman -pgsm-utils debian/*.1 debian/tmp/usr/share/man/man*/* @@ -127,7 +120,6 @@ binary-arch: build install dh_fixperms dh_makeshlibs -V dh_installdeb -# dh_perl dh_shlibdeps -ldebian/libgsmme1c2a/usr/lib dh_gencontrol dh_md5sums diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/watch b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/watch similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/watch rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/watch diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/FAQ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/FAQ similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/FAQ rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/FAQ diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/README.NLS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.NLS similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/README.NLS rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.NLS diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/README.developers b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.developers similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/README.developers rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.developers diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmctl.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmctl.man similarity index 96% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmctl.man rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmctl.man index 2a7a980b46..fdd48d3377 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmctl.man +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmctl.man @@ -62,7 +62,7 @@ given on the command line (usually an GSM modem) using the specified 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. @@ -282,14 +282,14 @@ ME is waiting SIM PIN to be given. .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 @@ -298,13 +298,13 @@ ME is waiting SIM PIN2 to be given. .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 @@ -539,11 +539,11 @@ The output could look like (lines edited to fit): .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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsminfo.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsminfo.man similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsminfo.man rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsminfo.man diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmlib.lsm b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmlib.lsm similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmlib.lsm rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmlib.lsm diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmpb.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmpb.man similarity index 74% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmpb.man rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmpb.man index cfd09409a1..fef171e0aa 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmpb.man +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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 @@ source is copied to the destination file, thus overwriting the 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 @@ must contain indices for every entry. Additionally, these indices must 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 @@ are: .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 @@ TA phonebook .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 @@ The fields have the following meanings: \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 @@ respectively. The text should only contain characters that can be 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 @@ The following invocation of \fIgsmpb\fP synchronizes the mobile phone's 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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsendsms.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsendsms.man similarity index 72% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsendsms.man rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsendsms.man index 05aab7bdef..d3c8a9c395 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsendsms.man +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsendsms.man @@ -17,26 +17,26 @@ gsmsendsms \- SMS message sender utility .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 @@ no \fIbaudrate\fP is given, a default baud rate of 38400 is used. \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 @@ terminates on error the error code 1 is returned. .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 @@ since all the numbering and ID information is 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 @@ The following two invocations of \fIgsmsendsms\fP each send the same 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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsmsd.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsd.man similarity index 77% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsmsd.man rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsd.man index 033aa364f1..89e9c95f39 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsmsd.man +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsd.man @@ -17,34 +17,34 @@ gsmsmsd \- SMS message reception daemon .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 @@ shell and the SMS message is written to the standard input of the action. \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 @@ The default is \fIsms\fP, \fIcb\fP, and \fIstat\fP. .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 @@ since all the numbering and ID information is 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 @@ for details on the SMS text character set and maximum length. \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 @@ The following invocation of \fIgsmsmsd\fP sends each incoming SMS message 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 @@ This is the format of SMS status report messages as output from \fIgsmsmsd\fP: .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 @@ messages from the "SM" SMS store and looks in the "/tmp/spooldir" 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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsmsstore.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsstore.man similarity index 66% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsmsstore.man rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsstore.man index af84535dd2..fb3fb9bc7f 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/doc/gsmsmsstore.man +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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 @@ to add SMS submit messages to a store. \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 @@ terminates on error the error code 1 is returned. .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 @@ The following command lists all entries in the mobile phone connected 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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/README.sieme b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/README.sieme similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/README.sieme rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/README.sieme diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsm_sie_me.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsm_sie_me.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsm_sie_me.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsm_sie_me.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsmsiectl.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiectl.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsmsiectl.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiectl.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsmsiexfer.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiexfer.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/ext/gsmsiexfer.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiexfer.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/g41.patch b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/g41.patch similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/g41.patch rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/g41.patch diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsm_config.h.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsm_config.h.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsm_config.h.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsm_config.h.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.dirs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.dirs similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.dirs rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.dirs diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.postinst b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.postinst similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.postinst rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.postinst diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.prerm b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.prerm similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib-1.10.debmg/debian/gsm-utils.prerm rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.prerm diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.undocumented b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.undocumented similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/debian/gsm-utils.undocumented rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.undocumented diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib.spec b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib.spec similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib.spec rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib.spec diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_at.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.cc similarity index 93% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_at.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.cc index b571d5d93b..1c163d06e1 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_at.cc +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.cc @@ -106,11 +106,27 @@ string GsmAt::chat(string atCommand, string response, string &pdu, 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:")) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_at.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_at.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_cb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_cb.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_cb.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_cb.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_error.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_error.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_error.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_error.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_event.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_event.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_event.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_event.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_map_key.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_map_key.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_map_key.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_map_key.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_me_ta.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_me_ta.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_me_ta.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_me_ta.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_nls.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_nls.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_nls.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_nls.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_parser.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_parser.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_parser.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_parser.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_phonebook.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_phonebook.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_phonebook.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_phonebook.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_port.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_port.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_port.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_port.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_codec.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_codec.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_codec.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_codec.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_store.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_store.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_store.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sms_store.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.cc similarity index 99% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.cc index b569ea6c67..e1b265c3f7 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook.cc +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.cc @@ -20,6 +20,7 @@ #include #include #include +#include const int MAX_LINE_SIZE = 1000; diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook_base.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook_base.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook_base.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_phonebook_base.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_sms_store.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_sms_store.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_sms_store.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sorted_sms_store.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sysdep.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sysdep.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_sysdep.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sysdep.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_unix_serial.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.cc similarity index 99% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_unix_serial.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.cc index d62d379239..feea2a24d9 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_unix_serial.cc +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.cc @@ -27,6 +27,7 @@ #include #include #include +#include using namespace std; using namespace gsmlib; diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_unix_serial.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_unix_serial.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_util.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.cc similarity index 99% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_util.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.cc index a6e342d765..3958908df7 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_util.cc +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.cc @@ -267,7 +267,6 @@ NoCopy &NoCopy::operator=(NoCopy &n) { cerr << "ABORT: NoCopy::operator= used" << endl; abort(); - return n; } #endif // NDEBUG diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_util.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_util.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_win32_serial.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_win32_serial.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_win32_serial.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/gsmlib/gsm_win32_serial.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/ChangeLog b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/ChangeLog similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/ChangeLog rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/ChangeLog diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/Makefile b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile similarity index 99% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/Makefile rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile index ecaf364def..37585e769e 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/Makefile +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile @@ -51,7 +51,7 @@ RANLIB = ranlib DEFS = -DGNULOCALEDIR=\"$(gnulocaledir)\" \ -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" -DHAVE_CONFIG_H CPPFLAGS = -CFLAGS = -D_REENTRANT +CFLAGS = -D_REENTRANT -g -O2 LDFLAGS = COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/VERSION b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/VERSION similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/VERSION rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/VERSION diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/bindtextdom.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/bindtextdom.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/bindtextdom.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/bindtextdom.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/cat-compat.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/cat-compat.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/cat-compat.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/cat-compat.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/dcgettext.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dcgettext.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/dcgettext.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dcgettext.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/dgettext.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dgettext.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/dgettext.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dgettext.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/explodename.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/explodename.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/explodename.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/explodename.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/finddomain.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/finddomain.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/finddomain.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/finddomain.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/gettext.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/gettext.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/gettext.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/gettext.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/gettextP.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettextP.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/gettextP.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettextP.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/hash-string.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/hash-string.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/hash-string.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/hash-string.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/intl-compat.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/intl-compat.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/intl-compat.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/intl-compat.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/l10nflist.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/l10nflist.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/l10nflist.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/l10nflist.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/libgettext.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/libgettext.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/libgettext.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/libgettext.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/linux-msg.sed b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/linux-msg.sed old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/linux-msg.sed rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/linux-msg.sed diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/loadinfo.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadinfo.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/loadinfo.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadinfo.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/loadmsgcat.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadmsgcat.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/loadmsgcat.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadmsgcat.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/localealias.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/localealias.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/localealias.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/localealias.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/po2tbl.sed.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/po2tbl.sed.in old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/po2tbl.sed.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/po2tbl.sed.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/textdomain.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/textdomain.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/textdomain.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/textdomain.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/xopen-msg.sed b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/xopen-msg.sed old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/intl/xopen-msg.sed rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/xopen-msg.sed diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/Makefile.in.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/Makefile.in.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/Makefile.in.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/Makefile.in.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/POTFILES.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/POTFILES.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/POTFILES.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/POTFILES.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/cat-id-tbl.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/cat-id-tbl.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/cat-id-tbl.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/cat-id-tbl.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/de.gmo b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.gmo similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/de.gmo rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.gmo diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/de.po b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.po similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/de.po rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.po diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/gsmlib.pot b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/gsmlib.pot similarity index 91% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/gsmlib.pot rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/gsmlib.pot index 48ae57758f..1d0385cf4f 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/gsmlib.pot +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/gsmlib.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-09-29 18:24+0100\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" @@ -16,225 +16,225 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: apps/gsmsmsd.cc:171 +#: apps/gsmsmsd.cc:172 #, c-format msgid "could not execute '%s'" msgstr "" -#: apps/gsmsmsd.cc:175 +#: 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:197 apps/gsmsmsd.cc:198 apps/gsmsmsd.cc:199 #, c-format msgid "%d" msgstr "" -#: apps/gsmsmsd.cc:215 +#: apps/gsmsmsd.cc:216 #, c-format msgid "error when calling opendir('%s')(errno: %d/%s)" msgstr "" -#: apps/gsmsmsd.cc:259 +#: apps/gsmsmsd.cc:260 #, c-format msgid "count not open SMS spool file %s" msgstr "" -#: apps/gsmsmsd.cc:435 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:440 +#: 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:444 +#: 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:448 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:451 +#: apps/gsmsmsd.cc:455 msgid " -c, --concatenate start ID for concatenated SMS messages" msgstr "" -#: apps/gsmsmsd.cc:453 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:454 +#: apps/gsmsmsd.cc:458 msgid " -d, --device sets the device to connect to" msgstr "" -#: apps/gsmsmsd.cc:455 +#: apps/gsmsmsd.cc:459 msgid " -D, --direct enable direct routing of SMSs" msgstr "" -#: apps/gsmsmsd.cc:456 +#: apps/gsmsmsd.cc:460 msgid " -f, --flush flush SMS from store" msgstr "" -#: apps/gsmsmsd.cc:457 +#: apps/gsmsmsd.cc:461 msgid " -F, --failed directory to move failed SMS to," msgstr "" -#: apps/gsmsmsd.cc:458 apps/gsmsmsd.cc:471 +#: apps/gsmsmsd.cc:462 apps/gsmsmsd.cc:475 msgid " if unset, the SMS will be deleted" msgstr "" -#: apps/gsmsmsd.cc:459 apps/gsmsendsms.cc:161 apps/gsmpb.cc:332 +#: 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:460 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:462 +#: apps/gsmsmsd.cc:466 msgid " -L, --syslog log errors and information to syslog" msgstr "" -#: apps/gsmsmsd.cc:465 +#: apps/gsmsmsd.cc:469 msgid " -P, --priorities number of priority levels to use," msgstr "" -#: apps/gsmsmsd.cc:466 +#: apps/gsmsmsd.cc:470 msgid " (default: none)" msgstr "" -#: apps/gsmsmsd.cc:467 apps/gsmsendsms.cc:163 +#: apps/gsmsmsd.cc:471 apps/gsmsendsms.cc:163 msgid " -r, --requeststat request SMS status report" msgstr "" -#: apps/gsmsmsd.cc:468 +#: apps/gsmsmsd.cc:472 msgid " -s, --spool spool directory for outgoing SMS" msgstr "" -#: apps/gsmsmsd.cc:470 +#: apps/gsmsmsd.cc:474 msgid " -S, --sent directory to move sent SMS to," msgstr "" -#: apps/gsmsmsd.cc:472 +#: 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:475 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:476 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:478 +#: apps/gsmsmsd.cc:482 msgid " sms_type may be any combination of" msgstr "" -#: apps/gsmsmsd.cc:479 +#: apps/gsmsmsd.cc:483 msgid " sms, no_sms controls reception of normal SMS" msgstr "" -#: apps/gsmsmsd.cc:481 +#: apps/gsmsmsd.cc:485 msgid " cb, no_cb controls reception of cell broadcast messages" msgstr "" -#: apps/gsmsmsd.cc:483 +#: apps/gsmsmsd.cc:487 msgid " stat, no_stat controls reception of status reports" msgstr "" -#: apps/gsmsmsd.cc:485 +#: apps/gsmsmsd.cc:489 msgid " default is \"sms cb stat\"" msgstr "" -#: apps/gsmsmsd.cc:486 +#: apps/gsmsmsd.cc:490 msgid "If no action is given, the SMS is printed to stdout" msgstr "" -#: apps/gsmsmsd.cc:488 +#: apps/gsmsmsd.cc:492 msgid "If -P is given, it activates the priority system and sets the" msgstr "" -#: apps/gsmsmsd.cc:489 +#: apps/gsmsmsd.cc:493 msgid "number or levels to use. For every level, there must be directories" msgstr "" -#: apps/gsmsmsd.cc:490 +#: apps/gsmsmsd.cc:494 msgid "named +." msgstr "" -#: apps/gsmsmsd.cc:491 +#: apps/gsmsmsd.cc:495 msgid "For example \"-P 2 -s queue -S send -F failed\" needs the following" msgstr "" -#: apps/gsmsmsd.cc:492 +#: apps/gsmsmsd.cc:496 msgid "directories: queue1/ queue2/ send1/ send2/ failed1/ failed2/" msgstr "" -#: apps/gsmsmsd.cc:493 +#: apps/gsmsmsd.cc:497 msgid "Before sending one SMS from queue2, all pending SMS from queue1" msgstr "" -#: apps/gsmsmsd.cc:494 +#: apps/gsmsmsd.cc:498 msgid "will be sent." msgstr "" -#: apps/gsmsmsd.cc:499 apps/gsmsendsms.cc:178 apps/gsmpb.cc:354 +#: 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:538 +#: apps/gsmsmsd.cc:542 #, c-format msgid "error when calling sigaction() (errno: %d/%s)" msgstr "" -#: apps/gsmsmsd.cc:558 +#: apps/gsmsmsd.cc:562 msgid "store name must be given for flush option" msgstr "" #. process the new message -#: apps/gsmsmsd.cc:566 apps/gsmsmsd.cc:634 +#: apps/gsmsmsd.cc:570 apps/gsmsmsd.cc:638 msgid "Type of message: " msgstr "" -#: apps/gsmsmsd.cc:570 apps/gsmsmsd.cc:638 +#: apps/gsmsmsd.cc:574 apps/gsmsmsd.cc:642 msgid "SMS message\n" msgstr "" -#: apps/gsmsmsd.cc:573 +#: apps/gsmsmsd.cc:577 msgid "submit report message\n" msgstr "" -#: apps/gsmsmsd.cc:576 apps/gsmsmsd.cc:644 +#: apps/gsmsmsd.cc:580 apps/gsmsmsd.cc:648 msgid "status report message\n" msgstr "" -#: apps/gsmsmsd.cc:641 +#: apps/gsmsmsd.cc:645 msgid "cell broadcast message\n" msgstr "" -#: apps/gsmsmsd.cc:697 apps/gsmsmsd.cc:699 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:700 +#: apps/gsmsmsd.cc:704 msgid "(try setting sms_type, please refer to gsmsmsd manpage)" msgstr "" @@ -599,7 +599,7 @@ msgstr "" 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 "" @@ -689,30 +689,30 @@ msgstr "" 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 "" @@ -1523,71 +1523,71 @@ msgstr "" msgid "unknown time period format" msgstr "" -#: gsmlib/gsm_unix_serial.cc:120 +#: gsmlib/gsm_unix_serial.cc:121 msgid "interrupted when reading from TA" msgstr "" -#: gsmlib/gsm_unix_serial.cc:135 +#: gsmlib/gsm_unix_serial.cc:136 msgid "end of file when reading from TA" msgstr "" -#: gsmlib/gsm_unix_serial.cc:145 +#: gsmlib/gsm_unix_serial.cc:146 msgid "reading from TA" msgstr "" -#: gsmlib/gsm_unix_serial.cc:150 +#: gsmlib/gsm_unix_serial.cc:151 msgid "timeout when reading from TA" msgstr "" -#: gsmlib/gsm_unix_serial.cc:177 +#: gsmlib/gsm_unix_serial.cc:178 #, c-format msgid "opening device '%s'" msgstr "" -#: gsmlib/gsm_unix_serial.cc:184 +#: gsmlib/gsm_unix_serial.cc:185 msgid "getting file status flags failed" msgstr "" -#: gsmlib/gsm_unix_serial.cc:189 +#: gsmlib/gsm_unix_serial.cc:190 msgid "switching of non-blocking mode failed" msgstr "" -#: gsmlib/gsm_unix_serial.cc:204 +#: gsmlib/gsm_unix_serial.cc:205 msgid "clearing DTR failed" msgstr "" -#: gsmlib/gsm_unix_serial.cc:210 +#: gsmlib/gsm_unix_serial.cc:211 msgid "setting DTR failed" msgstr "" -#: gsmlib/gsm_unix_serial.cc:215 +#: gsmlib/gsm_unix_serial.cc:216 #, c-format msgid "tcgetattr device '%s'" msgstr "" -#: gsmlib/gsm_unix_serial.cc:244 +#: gsmlib/gsm_unix_serial.cc:245 #, c-format msgid "tcsetattr device '%s'" msgstr "" -#: gsmlib/gsm_unix_serial.cc:302 +#: gsmlib/gsm_unix_serial.cc:303 #, c-format msgid "reset modem failed '%s'" msgstr "" -#: gsmlib/gsm_unix_serial.cc:347 gsmlib/gsm_unix_serial.cc:379 +#: gsmlib/gsm_unix_serial.cc:348 gsmlib/gsm_unix_serial.cc:380 msgid "interrupted when writing to TA" msgstr "" -#: gsmlib/gsm_unix_serial.cc:362 gsmlib/gsm_unix_serial.cc:371 +#: gsmlib/gsm_unix_serial.cc:363 gsmlib/gsm_unix_serial.cc:372 msgid "writing to TA" msgstr "" -#: gsmlib/gsm_unix_serial.cc:392 +#: gsmlib/gsm_unix_serial.cc:393 msgid "timeout when writing to TA" msgstr "" -#: gsmlib/gsm_unix_serial.cc:453 +#: gsmlib/gsm_unix_serial.cc:454 #, c-format msgid "unknown baudrate '%s'" msgstr "" @@ -1621,51 +1621,51 @@ msgstr "" 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 "" diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/stamp-cat-id b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/stamp-cat-id similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/po/stamp-cat-id rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/stamp-cat-id diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.guess b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.guess similarity index 98% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.guess rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.guess index 0f0fe712ae..f32079abda 100755 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.guess +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-03-06' +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 @@ -56,8 +56,8 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -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." @@ -330,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -532,7 +532,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[45]) + *: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 @@ -793,12 +793,15 @@ EOF exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in - x86) + 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 @@ -833,7 +836,14 @@ EOF echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + 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 @@ -954,8 +964,8 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -1474,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + 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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.rpath b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.rpath old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.rpath rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.rpath diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.sub b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.sub similarity index 97% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.sub rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.sub index 5defff65a6..6759825a5b 100755 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/config.sub +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-01-18' +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 @@ -72,8 +72,8 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -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." @@ -369,10 +369,14 @@ case $basic_machine in | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | 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) @@ -443,6 +447,14 @@ case $basic_machine in 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 @@ -475,8 +487,8 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16c) - basic_machine=cr16c-unknown + cr16) + basic_machine=cr16-unknown os=-elf ;; crds | unos) @@ -668,6 +680,14 @@ case $basic_machine in 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 ;; @@ -683,6 +703,10 @@ case $basic_machine in basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; @@ -809,6 +833,14 @@ case $basic_machine in 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 ;; @@ -1017,6 +1049,10 @@ case $basic_machine in basic_machine=tic6x-unknown os=-coff ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown ;; diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/debugconfig.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/debugconfig.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/debugconfig.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/debugconfig.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/depcomp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/depcomp old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/depcomp rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/depcomp diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/install-sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/install-sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/install-sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/install-sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/ltconfig b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltconfig similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/ltconfig rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltconfig diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/ltmain.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltmain.sh similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/ltmain.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltmain.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/missing b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/missing old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/missing rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/missing diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/mkinstalldirs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/mkinstalldirs similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/scripts/mkinstalldirs rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/mkinstalldirs diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/stamp-h.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/stamp-h.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/stamp-h.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/stamp-h.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runparser.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runparser.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runparser.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runparser.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runsms.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runsms.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runsms.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runsms.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runspb.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runspb.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runspb2.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb2.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runspb2.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb2.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runspbi.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspbi.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runspbi.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspbi.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runssms.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runssms.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/runssms.sh rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runssms.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spb.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb.pb similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spb.pb rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb.pb diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spb2.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb2.pb similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spb2.pb rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb2.pb diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spbi1.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi1.pb similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spbi1.pb rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi1.pb diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spbi2-orig.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi2-orig.pb similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/spbi2-orig.pb rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi2-orig.pb diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testcb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testcb.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testcb.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testcb.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testgsmlib.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testgsmlib.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testgsmlib.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testgsmlib.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testparser-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser-output.txt similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testparser-output.txt rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testparser.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testparser.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testpb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testpb.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testpb2.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb2.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testpb2.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb2.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testsms-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms-output.txt similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testsms-output.txt rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testsms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testsms.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testsms2.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms2.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testsms2.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms2.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspb-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb-output.txt similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspb-output.txt rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspb.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspb2-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb2-output.txt similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspb2-output.txt rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb2-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspbi-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspbi-output.txt similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testspbi-output.txt rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspbi-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testssms-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms-output.txt similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testssms-output.txt rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testssms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms.cc similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/tests/testssms.cc rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/COPYING b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/COPYING similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/COPYING rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/COPYING diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/Makefile.am rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.am diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.in similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/Makefile.in rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.in diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/README.win b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/README.win similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/README.win rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/README.win diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/getopt.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.c similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/getopt.c rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.c diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/getopt.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.h similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/getopt.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.h diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsm_config.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h similarity index 99% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsm_config.h rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h index fbf1d18a47..176ccc58d2 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-12ubuntu1/win32/gsm_config.h +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h @@ -68,9 +68,7 @@ /* 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.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmctl.dsp new file mode 100644 index 0000000000..b48a1c54db --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmctl.dsp @@ -0,0 +1,118 @@ +# Microsoft Developer Studio Project File - Name="gsmctl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=gsmctl - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "gsmctl.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "gsmctl.mak" CFG="gsmctl - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "gsmctl - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "gsmctl - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "gsmctl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /TP /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "gsmctl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "gsmctl - Win32 Release" +# Name "gsmctl - Win32 Debug" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\getopt.c + +!IF "$(CFG)" == "gsmctl - Win32 Release" + +!ELSEIF "$(CFG)" == "gsmctl - Win32 Debug" + +# ADD CPP /Od + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\apps\gsmctl.cc +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\getopt.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsp new file mode 100644 index 0000000000..ace489a252 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsp @@ -0,0 +1,232 @@ +# Microsoft Developer Studio Project File - Name="gsmlib" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=gsmlib - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "gsmlib.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "gsmlib.mak" CFG="gsmlib - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "gsmlib - Win32 Release" (basierend auf "Win32 (x86) Static Library") +!MESSAGE "gsmlib - Win32 Debug" (basierend auf "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "gsmlib - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GR /GX /O2 /I "../vcproject" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /FR /YX /FD /TP /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "gsmlib - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "gsmlib - Win32 Release" +# Name "gsmlib - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;cc;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\gsmlib\gsm_at.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_error.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_cb.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_event.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_me_ta.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_nls.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_parser.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_phonebook.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sms.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sms_codec.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sms_store.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sorted_phonebook.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sorted_phonebook_base.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sorted_sms_store.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_util.cc +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_win32_serial.cc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\gsmlib\gsm_at.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_cb.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_error.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_event.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_map_key.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_me_ta.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_nls.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_parser.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_phonebook.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_port.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sms.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sms_codec.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sms_store.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sorted_phonebook.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sorted_phonebook_base.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sorted_sms_store.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_sysdep.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_util.h +# End Source File +# Begin Source File + +SOURCE=..\gsmlib\gsm_win32_serial.h +# End Source File +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsw b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsw new file mode 100644 index 0000000000..21ab8168ac --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsw @@ -0,0 +1,149 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELSCHT WERDEN! + +############################################################################### + +Project: "gsmctl"=".\gsmctl.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Project: "gsmlib"=".\gsmlib.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "gsmpb"=".\gsmpb.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Project: "gsmsendsms"=".\gsmsendsms.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Project: "gsmsmsd"=".\gsmsmsd.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Project: "gsmsmsstore"=".\gsmsmsstore.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Project: "testgsmlib"=".\testgsmlib.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Project: "testsms"=".\testsms.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Project: "testsms2"=".\testsms2.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gsmlib + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.dsp new file mode 100644 index 0000000000..befc0f6d51 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.dsp @@ -0,0 +1,118 @@ +# Microsoft Developer Studio Project File - Name="gsmpb" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=gsmpb - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "gsmpb.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "gsmpb.mak" CFG="gsmpb - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "gsmpb - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "gsmpb - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "gsmpb - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /TP /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "gsmpb - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "gsmpb - Win32 Release" +# Name "gsmpb - Win32 Debug" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\getopt.c + +!IF "$(CFG)" == "gsmpb - Win32 Release" + +!ELSEIF "$(CFG)" == "gsmpb - Win32 Debug" + +# ADD CPP /Od + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\apps\gsmpb.cc +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\getopt.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsendsms.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsendsms.dsp new file mode 100644 index 0000000000..7e660fbdbb --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsendsms.dsp @@ -0,0 +1,118 @@ +# Microsoft Developer Studio Project File - Name="gsmsendsms" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=gsmsendsms - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "gsmsendsms.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "gsmsendsms.mak" CFG="gsmsendsms - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "gsmsendsms - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "gsmsendsms - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "gsmsendsms - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /TP /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "gsmsendsms - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "gsmsendsms - Win32 Release" +# Name "gsmsendsms - Win32 Debug" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\getopt.c + +!IF "$(CFG)" == "gsmsendsms - Win32 Release" + +!ELSEIF "$(CFG)" == "gsmsendsms - Win32 Debug" + +# ADD CPP /Od + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\apps\gsmsendsms.cc +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\getopt.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsd.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsd.dsp new file mode 100644 index 0000000000..2facfaa47c --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsd.dsp @@ -0,0 +1,118 @@ +# Microsoft Developer Studio Project File - Name="gsmsmsd" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=gsmsmsd - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "gsmsmsd.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "gsmsmsd.mak" CFG="gsmsmsd - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "gsmsmsd - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "gsmsmsd - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "gsmsmsd - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /TP /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "gsmsmsd - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "gsmsmsd - Win32 Release" +# Name "gsmsmsd - Win32 Debug" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\getopt.c + +!IF "$(CFG)" == "gsmsmsd - Win32 Release" + +!ELSEIF "$(CFG)" == "gsmsmsd - Win32 Debug" + +# ADD CPP /Od + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\apps\gsmsmsd.cc +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\getopt.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsstore.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsstore.dsp new file mode 100644 index 0000000000..5e7a9c150a --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsstore.dsp @@ -0,0 +1,119 @@ +# Microsoft Developer Studio Project File - Name="gsmsmsstore" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=gsmsmsstore - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "gsmsmsstore.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "gsmsmsstore.mak" CFG="gsmsmsstore - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "gsmsmsstore - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "gsmsmsstore - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "gsmsmsstore - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /TP /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "gsmsmsstore - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "gsmsmsstore - Win32 Release" +# Name "gsmsmsstore - Win32 Debug" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\getopt.c + +!IF "$(CFG)" == "gsmsmsstore - Win32 Release" + +!ELSEIF "$(CFG)" == "gsmsmsstore - Win32 Debug" + +# ADD CPP /Od + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\apps\gsmsmsstore.cc +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\getopt.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testgsmlib.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testgsmlib.dsp new file mode 100644 index 0000000000..26de21002d --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testgsmlib.dsp @@ -0,0 +1,101 @@ +# Microsoft Developer Studio Project File - Name="testgsmlib" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=testgsmlib - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "testgsmlib.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "testgsmlib.mak" CFG="testgsmlib - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "testgsmlib - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "testgsmlib - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "testgsmlib - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /TP /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "testgsmlib - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "testgsmlib - Win32 Release" +# Name "testgsmlib - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\tests\testgsmlib.cc +# ADD CPP /I "../gsmlib" /I ".." /I "." /D "HAVE_CONFIG_H" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms.dsp new file mode 100644 index 0000000000..09bf409bd2 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="testsms" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=testsms - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "testsms.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "testsms.mak" CFG="testsms - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "testsms - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "testsms - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "testsms - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /TP /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "testsms - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "testsms - Win32 Release" +# Name "testsms - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\tests\testsms.cc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms2.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms2.dsp new file mode 100644 index 0000000000..0ab2880c41 --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms2.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="testsms2" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=testsms2 - Win32 Debug +!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "testsms2.mak". +!MESSAGE +!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "testsms2.mak" CFG="testsms2 - Win32 Debug" +!MESSAGE +!MESSAGE Fr die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "testsms2 - Win32 Release" (basierend auf "Win32 (x86) Console Application") +!MESSAGE "testsms2 - Win32 Debug" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "testsms2 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /TP /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "testsms2 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../gsmlib" /I ".." /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_CONFIG_H" /YX /FD /GZ /TP /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "testsms2 - Win32 Release" +# Name "testsms2 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\tests\testsms2.cc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10-12ubuntu1.diff.gz b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10-12ubuntu1.diff.gz deleted file mode 100644 index 60524bfec2..0000000000 Binary files a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10-12ubuntu1.diff.gz and /dev/null differ 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 new file mode 100644 index 0000000000..ddea9c6d8f --- /dev/null +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10-13.diff @@ -0,0 +1,64915 @@ +--- 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 Empfngers" ++msgstr " Telefonummer die Telefonnummer des Empfngers" + + #: 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-Entrge zum Zielgert/-datei" ++msgstr " -c, --copy kopiere Quell-Eintrge zum Zielgert/-datei" + + #: apps/gsmpb.cc:327 + msgid "" +@@ -626,14 +626,14 @@ + msgstr "" + ": [-a][-b Baud-Rate][-c][-C sca][-d Gert oder Datei]\n" + " [-h][-I Init String][-k][-l][-s Gert 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 fge neue SMS-Submit-Nachricht (Telefonnumer und\n" ++" -a, --add fge neue SMS-Submit-Nachricht (Telefonnummer und\n" + " Text) in das Zielgert/-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.tar.gz b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10.orig.tar.gz similarity index 100% rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10.tar.gz rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib_1.10.orig.tar.gz diff --git a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp index 76d32ac3f0..6834a1d880 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp +++ b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp @@ -1339,29 +1339,27 @@ 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) { - ERRORA("|%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"); - } - + 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"); } } diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp index 4033577f7c..7db2452a95 100644 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp +++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp @@ -88,7 +88,7 @@ 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 MDL_CHAT_PROTO "SMS" +#define GSMOPEN_CHAT_PROTO "sms" #if 1 SWITCH_STANDARD_API(gsm_function); /* BEGIN: Changes here */ @@ -2038,16 +2038,32 @@ static switch_status_t load_config(int reload_type) 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(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, type=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, type, + 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)) { @@ -2077,7 +2093,7 @@ static switch_status_t chat_send(const char *proto, const char *from, const char *host++ = '\0'; } - DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, type, + 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 @@ -2118,6 +2134,33 @@ static switch_status_t chat_send(const char *proto, const char *from, const char 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) { @@ -2155,7 +2198,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load) 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, MDL_CHAT_PROTO, chat_send); + SWITCH_ADD_CHAT(chat_interface, GSMOPEN_CHAT_PROTO, chat_send); /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; @@ -3115,10 +3158,10 @@ SWITCH_STANDARD_API(sendsms_function) 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, MDL_CHAT_PROTO, 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->name, argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), tech_pvt->name); - chat_send(MDL_CHAT_PROTO, tech_pvt->name, argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), NULL, 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); @@ -3260,7 +3303,7 @@ int sms_incoming(private_t * tech_pvt) 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", MDL_CHAT_PROTO); + 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); @@ -3291,7 +3334,7 @@ int sms_incoming(private_t * tech_pvt) 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", MDL_CHAT_PROTO); + 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); @@ -3368,12 +3411,12 @@ SWITCH_STANDARD_API(gsmopen_chat_function) //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(MDL_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); + //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, MDL_CHAT_PROTO, tech_pvt->skype_user, + 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(MDL_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", + 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] ); diff --git a/src/mod/endpoints/mod_h323/mod_h323.2010.vcxproj b/src/mod/endpoints/mod_h323/mod_h323.2010.vcxproj index cb33edf477..ff9730673b 100644 --- a/src/mod/endpoints/mod_h323/mod_h323.2010.vcxproj +++ b/src/mod/endpoints/mod_h323/mod_h323.2010.vcxproj @@ -68,7 +68,7 @@ - %(AdditionalIncludeDirectories) + ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions) @@ -77,7 +77,7 @@ /NODEFAULTLIB:LIMBCTD %(AdditionalOptions) h323plusd.lib;ptlibsd.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) + ..\..\..\..\..\ptlib\lib;..\..\..\..\..\h323plus\lib;%(AdditionalLibraryDirectories) false @@ -85,7 +85,7 @@ - %(AdditionalIncludeDirectories) + ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions) @@ -94,7 +94,7 @@ /NODEFAULTLIB:LIMBCTD %(AdditionalOptions) h323plusd.lib;ptlibsd.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) + ..\..\..\..\..\ptlib\lib\x64;..\..\..\..\..\h323plus\lib\x64;%(AdditionalLibraryDirectories) false @@ -102,7 +102,7 @@ - %(AdditionalIncludeDirectories) + ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions) @@ -110,7 +110,7 @@ h323plus.lib;ptlibs.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) + ..\..\..\..\..\ptlib\lib;..\..\..\..\..\h323plus\lib;%(AdditionalLibraryDirectories) false false @@ -119,7 +119,7 @@ - %(AdditionalIncludeDirectories) + ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions) @@ -127,11 +127,12 @@ h323plus.lib;ptlibs.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) + ..\..\..\..\..\ptlib\lib\x64;..\..\..\..\..\h323plus\lib\x64;%(AdditionalLibraryDirectories) false false + false diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.c b/src/mod/endpoints/mod_rtmp/mod_rtmp.c index 9d2039e37e..5dd5b4adfd 100644 --- a/src/mod/endpoints/mod_rtmp/mod_rtmp.c +++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.c @@ -843,7 +843,7 @@ switch_call_cause_t rtmp_session_create_call(rtmp_session_t *rsession, switch_co switch_channel_t *channel; const char *dialplan, *context; - if (!(*newsession = switch_core_session_request(rtmp_globals.rtmp_endpoint_interface, SOF_NONE, SWITCH_CALL_DIRECTION_INBOUND, NULL))) { + if (!(*newsession = switch_core_session_request(rtmp_globals.rtmp_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL))) { return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } diff --git a/src/mod/endpoints/mod_rtmp/rtmp.c b/src/mod/endpoints/mod_rtmp/rtmp.c index 701487020e..25f769b552 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp.c @@ -886,6 +886,11 @@ switch_status_t rtmp_handle_data(rtmp_session_t *rsession) if (rsession->tech_pvt) { uint16_t len = state->origlen; + if (!rsession->tech_pvt->readbuf) { + return SWITCH_STATUS_FALSE; + } + + switch_mutex_lock(rsession->tech_pvt->readbuf_mutex); if (rsession->tech_pvt->maxlen && switch_buffer_inuse(rsession->tech_pvt->readbuf) > rsession->tech_pvt->maxlen * 40) { rsession->tech_pvt->over_size++; diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen.2010.vcxproj b/src/mod/endpoints/mod_skypopen/mod_skypopen.2010.vcxproj index 126494830e..a09125af9a 100644 --- a/src/mod/endpoints/mod_skypopen/mod_skypopen.2010.vcxproj +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen.2010.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + mod_skypopen @@ -21,10 +29,18 @@ DynamicLibrary MultiByte + + DynamicLibrary + MultiByte + DynamicLibrary MultiByte + + DynamicLibrary + MultiByte + @@ -32,10 +48,18 @@ + + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -55,6 +79,21 @@ + + + %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) + + + Level4 + false + + + rpcrt4.lib "..\..\..\..\libs\spandsp\src\x64\Debug\libtiff.lib" "..\..\..\..\x64\Debug\libspandsp.lib" %(AdditionalOptions) + false + + + + %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) @@ -68,6 +107,19 @@ + + + %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\tiff-3.8.2\libtiff;%(AdditionalIncludeDirectories) + + + + + rpcrt4.lib "..\..\..\..\libs\spandsp\src\x64\Release\libtiff.lib" "..\..\..\..\x64\Release\libspandsp.lib" %(AdditionalOptions) + false + + + + diff --git a/src/mod/endpoints/mod_skypopen/skypopen_protocol.c b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c index a308e2e551..95746411e9 100644 --- a/src/mod/endpoints/mod_skypopen/skypopen_protocol.c +++ b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c @@ -1329,7 +1329,7 @@ LRESULT APIENTRY skypopen_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, lReturnCode = 0; fIssueDefProc = 0; - tech_pvt = (private_t *) GetWindowLong(hWindow, GWL_USERDATA); + tech_pvt = (private_t *) GetWindowLong(hWindow, GWLP_USERDATA); if (!running) { DEBUGA_SKYPE("let's DIE!\n", SKYPOPEN_P_LOG); @@ -1340,7 +1340,7 @@ LRESULT APIENTRY skypopen_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, switch (uiMessage) { case WM_CREATE: tech_pvt = (private_t *) ((LPCREATESTRUCT) ulParam)->lpCreateParams; - SetWindowLong(hWindow, GWL_USERDATA, (LONG) tech_pvt); + SetWindowLong(hWindow, GWLP_USERDATA, (LONG) tech_pvt); DEBUGA_SKYPE("got CREATE\n", SKYPOPEN_P_LOG); break; case WM_DESTROY: diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index c02f1f8ee1..3cac1a0fc2 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -454,7 +454,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session) } if (!((use_my_cause = switch_channel_get_variable(channel, "sip_ignore_remote_cause")) && switch_true(use_my_cause))) { - ps_cause = switch_channel_get_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE); + ps_cause = switch_channel_get_variable(channel, "last_bridge_" SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE); } if (!zstr(ps_cause) && (!strncasecmp(ps_cause, "sip:", 4) || !strncasecmp(ps_cause, "sips:", 5))) { @@ -494,7 +494,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session) val = switch_channel_get_variable(tech_pvt->channel, "disable_q850_reason"); - if (switch_false(val)) { + if (!val || switch_false(val)) { if (switch_channel_test_flag(channel, CF_INTERCEPT) || cause == SWITCH_CAUSE_PICKED_OFF || cause == SWITCH_CAUSE_LOSE_RACE) { switch_snprintf(reason, sizeof(reason), "SIP;cause=200;text=\"Call completed elsewhere\""); } else if (cause > 0 && cause < 128) { @@ -1723,7 +1723,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } - if ((var = switch_channel_get_variable(channel, SOFIA_SECURE_MEDIA_VARIABLE)) && switch_true(var)) { + if ((var = switch_channel_get_variable(channel, SOFIA_SECURE_MEDIA_VARIABLE)) && + (switch_true(var) || !strcasecmp(var, SWITCH_RTP_CRYPTO_KEY_32) || !strcasecmp(var, SWITCH_RTP_CRYPTO_KEY_80))) { sofia_set_flag_locked(tech_pvt, TFLAG_SECURE); } @@ -1912,13 +1913,18 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi { switch_t38_options_t *t38_options = switch_channel_get_private(tech_pvt->channel, "t38_options"); - sofia_glue_set_image_sdp(tech_pvt, t38_options, msg->numeric_arg); + if (t38_options) { + sofia_glue_set_image_sdp(tech_pvt, t38_options, msg->numeric_arg); - if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - switch_channel_set_flag(channel, CF_REQ_MEDIA); + if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { + switch_channel_set_flag(channel, CF_REQ_MEDIA); + } + sofia_set_flag_locked(tech_pvt, TFLAG_SENT_UPDATE); + 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", + switch_channel_get_name(channel)); } - sofia_set_flag_locked(tech_pvt, TFLAG_SENT_UPDATE); - sofia_glue_do_invite(session); } break; @@ -1980,7 +1986,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Operation not permitted on an inbound non-answered call leg!\n"); } else { - nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR(event), TAG_END()); + nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_SUBSCRIPTION_STATE_STR("active"), + SIPTAG_EVENT_STR(event), TAG_END()); } } @@ -2027,7 +2034,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))) { + if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) { switch_core_session_t *rsession; if ((rsession = switch_core_session_locate(uuid))) { switch_channel_t *rchannel = switch_core_session_get_channel(rsession); @@ -2096,11 +2103,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi if (zstr(number)) { number = tech_pvt->caller_profile->destination_number; } - - if (sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, - "Cannot send display update to %s Did not receive reply to last update\n", switch_channel_get_name(tech_pvt->channel)); - } else { + + 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)) { @@ -2151,6 +2155,17 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi nua_update(tech_pvt->nh, NUTAG_SESSION_TIMER(tech_pvt->session_timeout), NUTAG_SESSION_REFRESHER(tech_pvt->session_refresher), + TAG_IF(!zstr(tech_pvt->route_uri), NUTAG_PROXY(tech_pvt->route_uri)), + TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)), + TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END()); + } else if ((ua && (switch_stristr("Yealink", ua)))) { + snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" ", name, number, tech_pvt->profile->sipip); + + sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY); + nua_update(tech_pvt->nh, + NUTAG_SESSION_TIMER(tech_pvt->session_timeout), + NUTAG_SESSION_REFRESHER(tech_pvt->session_refresher), + TAG_IF(!zstr(tech_pvt->route_uri), NUTAG_PROXY(tech_pvt->route_uri)), TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)), TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END()); } @@ -2461,14 +2476,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi { switch_ring_ready_t ring_ready_val = msg->numeric_arg; - if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) { - switch_channel_mark_ring_ready(channel); - status = SWITCH_STATUS_SUCCESS; - switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO, - "Pretending to send ringing. Not available for 3pcc calls\n"); - goto end_lock; - } - if (!switch_channel_test_flag(channel, CF_RING_READY) && !sofia_test_flag(tech_pvt, TFLAG_BYE) && !switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED)) { char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX); @@ -2517,14 +2524,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi const char *val = NULL; const char *call_info = switch_channel_get_variable(channel, "presence_call_info_full"); - if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) { - sofia_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA); - switch_channel_mark_pre_answered(channel); - status = SWITCH_STATUS_SUCCESS; - switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO, - "Pretending to send early media. Not available for 3pcc calls\n"); - goto end_lock; - } if (!sofia_test_flag(tech_pvt, TFLAG_ANS) && !sofia_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) { @@ -2802,8 +2801,29 @@ static int show_reg_callback_xml(void *pArg, int argc, char **argv, char **colum return 0; } -static const char *status_names[] = { "DOWN", "UP", NULL }; +static int sql2str_callback(void *pArg, int argc, char **argv, char **columnNames) +{ + struct cb_helper_sql2str *cbt = (struct cb_helper_sql2str *) pArg; + switch_copy_string(cbt->buf, argv[0], cbt->len); + cbt->matches++; + return 0; +} + +static uint32_t sofia_profile_reg_count(sofia_profile_t *profile) +{ + struct cb_helper_sql2str cb; + char reg_count[80] = ""; + char *sql; + cb.buf = reg_count; + cb.len = sizeof(reg_count); + sql = switch_mprintf("select count(*) from sip_registrations where profile_name = '%q'", profile->name); + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sql2str_callback, &cb); + free(sql); + return strtoul(reg_count, NULL, 10); +} + +static const char *status_names[] = { "DOWN", "UP", NULL }; static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t *stream) { @@ -2977,6 +2997,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t stream->write_function(stream, "FAILED-CALLS-IN \t%u\n", profile->ib_failed_calls); stream->write_function(stream, "CALLS-OUT \t%u\n", profile->ob_calls); stream->write_function(stream, "FAILED-CALLS-OUT \t%u\n", profile->ob_failed_calls); + stream->write_function(stream, "REGISTRATIONS \t%lu\n", sofia_profile_reg_count(profile)); } cb.profile = profile; @@ -3253,9 +3274,9 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl stream->write_function(stream, " %u\n", profile->ob_calls); stream->write_function(stream, " %u\n", profile->ib_failed_calls); stream->write_function(stream, " %u\n", profile->ob_failed_calls); + stream->write_function(stream, " %lu\n", sofia_profile_reg_count(profile)); stream->write_function(stream, " \n"); } - stream->write_function(stream, " \n"); cb.profile = profile; cb.stream = stream; @@ -3274,6 +3295,13 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host" " from sip_registrations where profile_name='%q' and contact like '%%%q%%'", profile->name, argv[3]); } + if (!sql && argv[2] && !strcasecmp(argv[2], "reg")) { + + sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status," + "rpid,expires,user_agent,server_user,server_host,profile_name,hostname," + "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host" + " from sip_registrations where profile_name='%q'", profile->name); + } if (!sql && argv[2] && !strcasecmp(argv[2], "user") && argv[3]) { char *dup = strdup(argv[3]); char *host = NULL, *user = NULL; @@ -3304,17 +3332,15 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl switch_safe_free(sqlextra); } - if (!sql) { - sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status," - "rpid,expires,user_agent,server_user,server_host,profile_name,hostname," - "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host" - " from sip_registrations where profile_name='%q'", profile->name); + if (sql) { + stream->write_function(stream, " \n"); + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, show_reg_callback_xml, &cb); + switch_safe_free(sql); + + stream->write_function(stream, " \n"); } - sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, show_reg_callback_xml, &cb); - switch_safe_free(sql); - - stream->write_function(stream, " \n"); stream->write_function(stream, "\n"); sofia_glue_release_profile(profile); @@ -3683,15 +3709,6 @@ static int contact_callback(void *pArg, int argc, char **argv, char **columnName return 0; } -static int sql2str_callback(void *pArg, int argc, char **argv, char **columnNames) -{ - struct cb_helper_sql2str *cbt = (struct cb_helper_sql2str *) pArg; - - switch_copy_string(cbt->buf, argv[0], cbt->len); - cbt->matches++; - return 0; -} - SWITCH_STANDARD_API(sofia_count_reg_function) { char *data; @@ -4179,7 +4196,7 @@ SWITCH_STANDARD_API(sofia_function) } if (strstr(argv[2], "sla")) { - mod_sofia_globals.debug_sla = 1; + mod_sofia_globals.debug_sla = 10; stream->write_function(stream, "+OK Debugging sla\n"); } @@ -4649,8 +4666,8 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session } now = switch_epoch_time_now(NULL); - sql = switch_mprintf("insert into sip_dialogs (uuid,presence_id,presence_data,profile_name,hostname,rcd) " - "values ('%q', '%q', '%q', '%q', '%q', %ld)", switch_core_session_get_uuid(nsession), + sql = switch_mprintf("insert into sip_dialogs (uuid,presence_id,presence_data,profile_name,hostname,rcd,call_info_state) " + "values ('%q', '%q', '%q', '%q', '%q', %ld, '')", switch_core_session_get_uuid(nsession), switch_str_nil(presence_id), switch_str_nil(presence_data), profile->name, mod_sofia_globals.hostname, (long) now); sofia_glue_actually_execute_sql(profile, sql, profile->ireg_mutex); switch_safe_free(sql); @@ -4831,7 +4848,7 @@ static int notify_callback(void *pArg, int argc, char **argv, char **columnNames nua_handle_bind(nh, &mod_sofia_globals.destroy_private); - nua_notify(nh, NUTAG_NEWSUB(1), + nua_notify(nh, NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), TAG_IF(dst->route_uri, NUTAG_PROXY(route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)), SIPTAG_EVENT_STR(es), SIPTAG_CONTENT_TYPE_STR(ct), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END()); @@ -4920,7 +4937,7 @@ static void general_event_handler(switch_event_t *event) nua_handle_bind(nh, &mod_sofia_globals.destroy_private); nua_notify(nh, - NUTAG_NEWSUB(1), + NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), TAG_IF(dst->route_uri, NUTAG_PROXY(dst->route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)), SIPTAG_EVENT_STR(es), TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END()); @@ -4941,7 +4958,7 @@ static void general_event_handler(switch_event_t *event) if ((session = switch_core_session_locate(uuid))) { if ((tech_pvt = switch_core_session_get_private(session))) { nua_notify(tech_pvt->nh, - NUTAG_NEWSUB(1), + NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_EVENT_STR(es), SIPTAG_CONTENT_TYPE_STR(ct), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END()); } switch_core_session_rwunlock(session); diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 490fe1a9d4..9947e3778e 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -247,7 +247,7 @@ typedef enum { PFLAG_T38_PASSTHRU, PFLAG_CID_IN_1XX, PFLAG_IN_DIALOG_CHAT, - PFLAG_DEL_SUBS_ON_REG, + PFLAG_DEL_SUBS_ON_REG_REUSE, PFLAG_IGNORE_183NOSDP, PFLAG_PRESENCE_PROBE_ON_REGISTER, PFLAG_PRESENCE_ON_REGISTER, @@ -262,6 +262,7 @@ typedef enum { PFLAG_SHUTDOWN, PFLAG_PRESENCE_MAP, PFLAG_OPTIONS_RESPOND_503_ON_BUSY, + PFLAG_PRESENCE_DISABLE_EARLY, /* No new flags below this line */ PFLAG_MAX } PFLAGS; @@ -454,6 +455,9 @@ struct sofia_gateway { char *auth_username; char *register_password; char *register_from; + char *options_from_uri; + char *options_to_uri; + char *options_user_agent; char *register_contact; char *extension; char *real_extension; @@ -647,6 +651,7 @@ struct sofia_profile { su_strlst_t *tls_verify_in_subjects; uint32_t sip_force_expires; uint32_t sip_expires_max_deviation; + int ireg_seconds; }; struct private_object { @@ -827,6 +832,7 @@ typedef struct { int network_port; const char *is_nat; int is_auto_nat; + int fs_path; } sofia_nat_parse_t; @@ -873,8 +879,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session); uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_sdp); -void sofia_presence_establish_presence(sofia_profile_t *profile); - void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, sofia_dispatch_event_t *de, tagi_t tags[]); @@ -1113,6 +1117,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use const char *body, const char *o_contact, const char *network_ip); 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); void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t *bleg); void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *profile, sip_t const *sip, switch_bool_t send); void sofia_send_callee_id(switch_core_session_t *session, const char *name, const char *number); @@ -1141,7 +1146,7 @@ switch_status_t sofia_glue_sdp_map(const char *r_sdp, switch_event_t **fmtp, swi void sofia_glue_build_vid_refresh_message(switch_core_session_t *session, const char *pl); void sofia_glue_check_dtmf_type(private_object_t *tech_pvt); void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str); -char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sofia_dispatch_event_t *de, sofia_nat_parse_t *np); +char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np); void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t on); void sofia_process_dispatch_event(sofia_dispatch_event_t **dep); char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool); diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 07ea5d2bbe..2cab2095e7 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -91,7 +91,7 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status, if (status >= 300 && sip && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) { char *sql; - sql = switch_mprintf("update sip_subscriptions set expires=%ld where call_id='%q'", (long) switch_epoch_time_now(NULL), sip->sip_call_id->i_id); + sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", sip->sip_call_id->i_id); switch_assert(sql != NULL); sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); nua_handle_destroy(nh); @@ -239,21 +239,25 @@ static void extract_header_vars(sofia_profile_t *profile, sip_t const *sip, switch_stream_handle_t stream = { 0 }; int x = 0; - if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { - SWITCH_STANDARD_STREAM(stream); + SWITCH_STANDARD_STREAM(stream); - for(vp = sip->sip_via; vp; vp = vp->v_next) { - char *v = sip_header_as_string(nh->nh_home, (void *) vp); - - stream.write_function(&stream, x == 0 ? "%s" : ",%s", v); - su_free(nh->nh_home, v); - - x++; - } + for(vp = sip->sip_via; vp; vp = vp->v_next) { + char *v = sip_header_as_string(nh->nh_home, (void *) vp); - switch_channel_set_variable(channel, "sip_recover_via", (char *)stream.data); - free(stream.data); + stream.write_function(&stream, x == 0 ? "%s" : ",%s", v); + su_free(nh->nh_home, v); + + x++; } + + switch_channel_set_variable(channel, "sip_full_via", (char *)stream.data); + + if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { + switch_channel_set_variable(channel, "sip_recover_via", (char *)stream.data); + } + + free(stream.data); + } if (sip->sip_from) { @@ -563,8 +567,9 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status, char st[80] = ""; #endif - if (!session) + if (!session) { return; + } channel = switch_core_session_get_channel(session); tech_pvt = switch_core_session_get_private(session); @@ -1570,7 +1575,7 @@ void watchdog_triggered_abort(void) { void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread, void *obj) { sofia_profile_t *profile = (sofia_profile_t *) obj; - uint32_t ireg_loops = IREG_SECONDS; /* Number of loop iterations done when we haven't checked for registrations */ + uint32_t ireg_loops = profile->ireg_seconds; /* Number of loop iterations done when we haven't checked for registrations */ uint32_t gateway_loops = GATEWAY_SECONDS; /* Number of loop iterations done when we haven't checked for gateways */ void *pop = NULL; /* queue_pop placeholder */ switch_size_t sql_len = 1024 * 32; /* length of sqlbuf */ @@ -2021,10 +2026,6 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void sofia_glue_add_profile(profile->name, profile); - if (profile->pres_type) { - sofia_presence_establish_presence(profile); - } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Starting thread for %s\n", profile->name); profile->started = switch_epoch_time_now(NULL); @@ -2332,13 +2333,14 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) *caller_id_in_from = "false", *extension = NULL, *proxy = NULL, + *options_user_agent = NULL, *context = profile->context, *expire_seconds = "3600", *retry_seconds = "30", *timeout_seconds = "60", *from_user = "", *from_domain = NULL, *outbound_proxy = NULL, *register_proxy = NULL, *contact_host = NULL, - *contact_params = NULL, *params = NULL, *register_transport = NULL, - *reg_id = NULL, *str_rfc_5626 = NULL; + *contact_params = "", *params = NULL, *register_transport = NULL, + *reg_id = NULL, *str_rfc_5626 = ""; if (!context) { context = "default"; @@ -2437,6 +2439,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) ping_max = atoi(val); } else if (!strcmp(var, "ping-min")) { ping_min = atoi(val); + } else if (!strcmp(var, "ping-user-agent")) { + options_user_agent = val; } else if (!strcmp(var, "proxy")) { proxy = val; } else if (!strcmp(var, "context")) { @@ -2488,16 +2492,6 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) str_rfc_5626 = switch_core_sprintf(gateway->pool, ";reg-id=%s;+sip.instance=\"\"",reg_id,str_guid); } - if (ping_freq) { - if (ping_freq >= 5) { - gateway->ping_freq = ping_freq; - gateway->ping_max = ping_max; - gateway->ping_min = ping_min; - gateway->ping = switch_epoch_time_now(NULL) + ping_freq; - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n"); - } - } if ((gw_subs_tag = switch_xml_child(gateway_tag, "subscriptions"))) { parse_gateway_subscriptions(profile, gateway, gw_subs_tag); @@ -2521,6 +2515,14 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: password param is REQUIRED!\n"); goto skip; } + } else { + if (zstr(username)) { + username = "FreeSWITCH"; + } + + if (zstr(password)) { + password = ""; + } } if (zstr(from_user)) { @@ -2580,6 +2582,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) gateway->auth_username = switch_core_strdup(gateway->pool, auth_username); gateway->register_password = switch_core_strdup(gateway->pool, password); gateway->distinct_to = distinct_to; + gateway->options_user_agent = options_user_agent; if (switch_true(caller_id_in_from)) { sofia_set_flag(gateway, REG_FLAG_CALLERID); @@ -2611,6 +2614,22 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) from_user, !zstr(from_domain) ? from_domain : proxy, register_transport); + if (ping_freq) { + if (ping_freq >= 5) { + gateway->ping_freq = ping_freq; + 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_from_uri = gateway->options_to_uri; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n"); + } + } + if (contact_host) { if (!strcmp(contact_host, "sip-ip")) { sipip = profile->sipip; @@ -2661,11 +2680,11 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) profile->tls_sip_port : profile->sip_port, params, str_rfc_5626); } else { - format = strchr(sipip, ':') ? "" : ""; + format = strchr(sipip, ':') ? "" : ""; gateway->register_contact = switch_core_sprintf(gateway->pool, format, extension, sipip, sofia_glue_transport_has_tls(gateway->register_transport) ? - profile->tls_sip_port : profile->sip_port, params,contact_params); + profile->tls_sip_port : profile->sip_port, params); } } else { if (rfc_5626) { @@ -2921,12 +2940,6 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID); } - } else if (!strcasecmp(var, "delete-subs-on-register")) { - if (switch_true(val)) { - sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG); - } else { - sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG); - } } else if (!strcasecmp(var, "watchdog-enabled")) { profile->watchdog_enabled = switch_true(val); } else if (!strcasecmp(var, "watchdog-step-timeout")) { @@ -2978,6 +2991,11 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) sofia_glue_parse_rtp_bugs(&profile->auto_rtp_bugs, val); } else if (!strcasecmp(var, "manual-rtp-bugs")) { sofia_glue_parse_rtp_bugs(&profile->manual_rtp_bugs, val); + } else if (!strcasecmp(var, "registration-thread-frequency")) { + profile->ireg_seconds = atoi(val); + if (profile->ireg_seconds < 0) { + profile->ireg_seconds = IREG_SECONDS; + } } else if (!strcasecmp(var, "user-agent-string")) { profile->user_agent = switch_core_strdup(profile->pool, val); } else if (!strcasecmp(var, "auto-restart")) { @@ -3018,6 +3036,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_pflag(profile, PFLAG_T38_PASSTHRU); } + } else if (!strcasecmp(var, "presence-disable-early")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } else { + sofia_clear_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } } else if (!strcasecmp(var, "ignore-183nosdp")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_IGNORE_183NOSDP); @@ -3343,7 +3367,7 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else if (!strcasecmp(var, "context")) { profile->context = switch_core_strdup(profile->pool, val); } else if (!strcasecmp(var, "local-network-acl")) { - if (!strcasecmp(var, "none")) { + if (!strcasecmp(val, "none")) { profile->local_network = NULL; } else { profile->local_network = switch_core_strdup(profile->pool, val); @@ -3440,14 +3464,14 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) sofia_clear_pflag(profile, PFLAG_OPTIONS_RESPOND_503_ON_BUSY); } } else if (!strcasecmp(var, "sip-force-expires")) { - uint32_t sip_force_expires = atoi(val); + int32_t sip_force_expires = atoi(val); if (sip_force_expires >= 0) { profile->sip_force_expires = sip_force_expires; } else { profile->sip_force_expires = 0; } } else if (!strcasecmp(var, "sip-expires-max-deviation")) { - uint32_t sip_expires_max_deviation = atoi(val); + int32_t sip_expires_max_deviation = atoi(val); if (sip_expires_max_deviation >= 0) { profile->sip_expires_max_deviation = sip_expires_max_deviation; } else { @@ -3690,7 +3714,7 @@ switch_status_t config_sofia(int reload, char *profile_name) profile->contact_user = SOFIA_DEFAULT_CONTACT_USER; sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID); sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER); - sofia_set_pflag(profile, PFLAG_PRESENCE_ON_FIRST_REGISTER); + //sofia_set_pflag(profile, PFLAG_PRESENCE_ON_FIRST_REGISTER); sofia_set_pflag(profile, PFLAG_SQL_IN_TRANS); profile->shutdown_type = "false"; @@ -3699,6 +3723,8 @@ switch_status_t config_sofia(int reload, char *profile_name) sofia_set_pflag(profile, PFLAG_CID_IN_1XX); profile->ndlb |= PFLAG_NDLB_ALLOW_NONDUP_SDP; profile->te = 101; + profile->ireg_seconds = IREG_SECONDS; + profile->tls_verify_policy = TPTLS_VERIFY_NONE; /* lib default */ @@ -3738,6 +3764,11 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY); } + } else if (!strcasecmp(var, "registration-thread-frequency")) { + profile->ireg_seconds = atoi(val); + if (profile->ireg_seconds < 0) { + profile->ireg_seconds = IREG_SECONDS; + } } else if (!strcasecmp(var, "user-agent-string")) { profile->user_agent = switch_core_strdup(profile->pool, val); } else if (!strcasecmp(var, "auto-restart")) { @@ -3779,18 +3810,18 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_IN_DIALOG_CHAT); } - } else if (!strcasecmp(var, "delete-subs-on-register")) { - if (switch_true(val)) { - sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG); - } else { - sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG); - } } else if (!strcasecmp(var, "t38-passthru")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_T38_PASSTHRU); } else { sofia_clear_pflag(profile, PFLAG_T38_PASSTHRU); } + } else if (!strcasecmp(var, "presence-disable-early")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } else { + sofia_clear_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } } else if (!strcasecmp(var, "ignore-183nosdp")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_IGNORE_183NOSDP); @@ -4500,14 +4531,14 @@ switch_status_t config_sofia(int reload, char *profile_name) sofia_clear_pflag(profile, PFLAG_OPTIONS_RESPOND_503_ON_BUSY); } } else if (!strcasecmp(var, "sip-force-expires")) { - uint32_t sip_force_expires = atoi(val); + int32_t sip_force_expires = atoi(val); if (sip_force_expires >= 0) { profile->sip_force_expires = sip_force_expires; } else { profile->sip_force_expires = 0; } } else if (!strcasecmp(var, "sip-expires-max-deviation")) { - uint32_t sip_expires_max_deviation = atoi(val); + int32_t sip_expires_max_deviation = atoi(val); if (sip_expires_max_deviation >= 0) { profile->sip_expires_max_deviation = sip_expires_max_deviation; } else { @@ -4705,7 +4736,7 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu gateway->ping = switch_epoch_time_now(NULL) + gateway->ping_freq; sofia_reg_release_gateway(gateway); gateway->pinging = 0; - } else if (sofia_test_pflag(profile, PFLAG_UNREG_OPTIONS_FAIL) && status != 200 && sip && sip->sip_to) { + } else if (sofia_test_pflag(profile, PFLAG_UNREG_OPTIONS_FAIL) && (status != 200 && status != 486) && sip && sip->sip_to) { char *sql; time_t now = switch_epoch_time_now(NULL); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Expire registration '%s@%s' due to options failure\n", @@ -4775,6 +4806,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status if (channel && sip->sip_call_info) { char *p; call_info = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_call_info); + if (switch_stristr("appearance", call_info)) { switch_channel_set_variable(channel, "presence_call_info_full", call_info); if ((p = strchr(call_info, ';'))) { @@ -4811,10 +4843,15 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status if (mod_sofia_globals.debug_sla > 1) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "QUERY SQL %s\n", sql); } - + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Auto-Fixing Broken SLA [;%s]\n", + sip->sip_from->a_url->url_host, buf); + switch_channel_set_variable_printf(channel, "presence_call_info_full", ";%s", sip->sip_from->a_url->url_host, buf); + switch_channel_set_variable(channel, "presence_call_info", buf); } - } + } } } @@ -5182,8 +5219,8 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status astate = "confirmed"; } - if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED) && - !switch_channel_test_flag(channel, CF_RING_READY)) { + if ((!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED) && + !switch_channel_test_flag(channel, CF_RING_READY)) || sofia_test_flag(tech_pvt, TFLAG_RECOVERING)) { const char *from_user = "", *from_host = "", *to_user = "", *to_host = "", *contact_user = "", *contact_host = ""; const char *user_agent = "", *call_id = ""; const char *to_tag = ""; @@ -5234,8 +5271,9 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status sql = switch_mprintf("insert into sip_dialogs " "(call_id,uuid,sip_to_user,sip_to_host,sip_to_tag,sip_from_user,sip_from_host,sip_from_tag,contact_user," - "contact_host,state,direction,user_agent,profile_name,hostname,contact,presence_id,presence_data,call_info,rcd) " - "values('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q',%ld)", + "contact_host,state,direction,user_agent,profile_name,hostname,contact,presence_id,presence_data," + "call_info,rcd,call_info_state) " + "values('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q',%ld,'')", call_id, switch_core_session_get_uuid(session), to_user, to_host, to_tag, from_user, from_host, from_tag, contact_user, @@ -5550,7 +5588,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, const char *val; if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) { nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_WITH_THIS_MSG(de->data->e_msg), - NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_EVENT_STR("talk"), TAG_END()); + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_EVENT_STR("talk"), TAG_END()); } } @@ -5658,11 +5696,13 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, const char *invite_route_uri = switch_channel_get_variable(tech_pvt->channel, "sip_invite_route_uri"); nua_ack(nh, - TAG_IF(invite_full_from, SIPTAG_FROM_STR(invite_full_from)), - TAG_IF(invite_full_to, SIPTAG_TO_STR(invite_full_to)), - TAG_IF(!zstr(invite_full_via), SIPTAG_VIA_STR(invite_full_via)), - TAG_IF(!zstr(invite_route_uri), SIPTAG_ROUTE_STR(invite_route_uri)), - TAG_END()); + TAG_IF(invite_full_from, SIPTAG_FROM_STR(invite_full_from)), + TAG_IF(invite_full_to, SIPTAG_TO_STR(invite_full_to)), + TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), + TAG_IF((zstr(tech_pvt->user_via) && !zstr(invite_full_via)), SIPTAG_VIA_STR(invite_full_via)), + + TAG_IF(!zstr(invite_route_uri), SIPTAG_ROUTE_STR(invite_route_uri)), + TAG_END()); } else { nua_ack(nh, @@ -5774,11 +5814,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } } else { if (sofia_test_pflag(profile, PFLAG_3PCC)) { - if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { + if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "No SDP in INVITE and 3pcc=yes cannot work with bypass or proxy media, hanging up.\n"); switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "3PCC DISABLED"); switch_channel_hangup(channel, SWITCH_CAUSE_MANDATORY_IE_MISSING); - } else { + } else { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP"); sofia_glue_tech_choose_port(tech_pvt, 0); sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); @@ -5798,23 +5838,23 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->local_sdp_str), TAG_END()); } } - } else if (sofia_test_pflag(profile, PFLAG_3PCC_PROXY)) { - //3PCC proxy mode delays the 200 OK until the call is answered + } else if (sofia_test_pflag(profile, PFLAG_3PCC_PROXY)) { + //3PCC proxy mode delays the 200 OK until the call is answered // so can be made to work with bypass media as we have time to find out what the other end thinks codec offer should be... - switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP"); - sofia_set_flag_locked(tech_pvt, TFLAG_3PCC); - //sofia_glue_tech_choose_port(tech_pvt, 0); - //sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); - switch_channel_set_flag(channel, TFLAG_LATE_NEGOTIATION); - //Moves into CS_INIT so call moves forward into the dialplan - switch_channel_set_state(channel, CS_INIT); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "No SDP in INVITE and 3pcc not enabled, hanging up.\n"); - switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "3PCC DISABLED"); - switch_channel_hangup(channel, SWITCH_CAUSE_MANDATORY_IE_MISSING); - } - goto done; + switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP"); + sofia_set_flag_locked(tech_pvt, TFLAG_3PCC); + //sofia_glue_tech_choose_port(tech_pvt, 0); + //sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_set_flag(tech_pvt, TFLAG_LATE_NEGOTIATION); + //Moves into CS_INIT so call moves forward into the dialplan + switch_channel_set_state(channel, CS_INIT); + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "No SDP in INVITE and 3pcc not enabled, hanging up.\n"); + switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "3PCC DISABLED"); + switch_channel_hangup(channel, SWITCH_CAUSE_MANDATORY_IE_MISSING); } + goto done; + } } else if (tech_pvt && sofia_test_flag(tech_pvt, TFLAG_SDP) && !r_sdp) { sofia_set_flag_locked(tech_pvt, TFLAG_NOSDP_REINVITE); @@ -5869,53 +5909,56 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, switch_core_session_message_t *msg; if (switch_channel_test_flag(channel, CF_PROXY_MODE) && !is_t38 && profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) { - tech_pvt->hold_laps = 1; - switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp); - switch_channel_clear_flag(channel, CF_PROXY_MODE); - sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); + if (switch_stristr("sendonly", r_sdp) || switch_stristr("0.0.0.0", r_sdp)) { + tech_pvt->hold_laps = 1; + switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp); + switch_channel_clear_flag(channel, CF_PROXY_MODE); + sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); - if (!switch_channel_media_ready(channel)) { - if (switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_INBOUND) { - //const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE); + if (!switch_channel_media_ready(channel)) { + if (switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_INBOUND) { + //const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE); - tech_pvt->num_codecs = 0; + tech_pvt->num_codecs = 0; + sofia_glue_tech_prepare_codecs(tech_pvt); + if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { + switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); + status = SWITCH_STATUS_FALSE; + switch_core_session_rwunlock(other_session); + goto done; + } + } + } + + + if (!switch_rtp_ready(tech_pvt->rtp_session)) { sofia_glue_tech_prepare_codecs(tech_pvt); - if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { - switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); - status = SWITCH_STATUS_FALSE; + if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) { + switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_core_session_rwunlock(other_session); goto done; } } - } + sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); - if (!switch_rtp_ready(tech_pvt->rtp_session)) { - sofia_glue_tech_prepare_codecs(tech_pvt); - if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) { - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - switch_core_session_rwunlock(other_session); - goto done; + if (sofia_use_soa(tech_pvt)) { + nua_respond(tech_pvt->nh, SIP_200_OK, + SIPTAG_CONTACT_STR(tech_pvt->reply_contact), + SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), + TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END()); + } else { + nua_respond(tech_pvt->nh, SIP_200_OK, + NUTAG_MEDIA_ENABLE(0), + SIPTAG_CONTACT_STR(tech_pvt->reply_contact), + SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->local_sdp_str), TAG_END()); } - } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); + launch_media_on_hold(session); - if (sofia_use_soa(tech_pvt)) { - nua_respond(tech_pvt->nh, SIP_200_OK, - SIPTAG_CONTACT_STR(tech_pvt->reply_contact), - SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), - SOATAG_REUSE_REJECTED(1), - SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), - TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END()); - } else { - nua_respond(tech_pvt->nh, SIP_200_OK, - NUTAG_MEDIA_ENABLE(0), - SIPTAG_CONTACT_STR(tech_pvt->reply_contact), - SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->local_sdp_str), TAG_END()); + switch_core_session_rwunlock(other_session); + goto done; } - launch_media_on_hold(session); - - switch_core_session_rwunlock(other_session); - goto done; } if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { @@ -6032,7 +6075,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } break; case nua_callstate_ready: - if (r_sdp && !is_dup_sdp && switch_rtp_ready(tech_pvt->rtp_session)) { + if (r_sdp && !is_dup_sdp && switch_rtp_ready(tech_pvt->rtp_session) && !sofia_test_flag(tech_pvt, TFLAG_NOSDP_REINVITE)) { /* sdp changed since 18X w sdp, we're supposed to ignore it but we, of course, were pressured into supporting it */ uint8_t match = 0; @@ -6326,7 +6369,6 @@ void *SWITCH_THREAD_FUNC nightmare_xfer_thread_run(switch_thread_t *thread, void mark_transfer_record(session, nhelper->bridge_to_uuid, tuuid_str); switch_ivr_uuid_bridge(nhelper->bridge_to_uuid, tuuid_str); switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER"); - sofia_set_flag_locked(tech_pvt, TFLAG_BYE); } else { switch_channel_hangup(switch_core_session_get_channel(tsession), SWITCH_CAUSE_ORIGINATOR_CANCEL); status = SWITCH_STATUS_FALSE; @@ -6341,7 +6383,7 @@ void *SWITCH_THREAD_FUNC nightmare_xfer_thread_run(switch_thread_t *thread, void } nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag"), - NUTAG_SUBSTATE(nua_substate_terminated), + NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR(status == SWITCH_STATUS_SUCCESS ? "SIP/2.0 200 OK\r\n" : "SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(nhelper->event), TAG_END()); @@ -6572,7 +6614,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Denying Attended Transfer, variable [deny_refer_requests] was set to true\n"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), + 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()); } else if (switch_channel_test_flag(channel_b, CF_ORIGINATOR)) { @@ -6627,7 +6669,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_core_session_rwunlock(a_session); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), + 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 (b_tech_pvt && !sofia_test_flag(b_tech_pvt, TFLAG_BYE)) { @@ -6646,7 +6688,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t } } else { nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), + 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()); } @@ -6693,7 +6735,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_ivr_uuid_bridge(br_b, br_a); switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), + 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()); sofia_clear_flag_locked(b_tech_pvt, TFLAG_SIP_HOLD); @@ -6707,7 +6749,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot transfer channels that are not in a bridge.\n"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), + 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()); } else { switch_core_session_t *t_session, *hup_session; @@ -6757,14 +6799,14 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), + 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_core_session_rwunlock(t_session); switch_channel_hangup(hup_channel, SWITCH_CAUSE_ATTENDED_TRANSFER); } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Session to transfer to not found.\n"); nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), - NUTAG_SUBSTATE(nua_substate_terminated), + 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()); } } @@ -6878,7 +6920,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Transfer! [%s]\n", br_a); 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_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), + 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()); } } @@ -6920,13 +6962,13 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t 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_PAYLOAD_STR("SIP/2.0 200 OK\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 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END()); } 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_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()); } } @@ -7137,11 +7179,13 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "media_control+xml")) { switch_core_session_t *other_session; - if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { - sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data); - switch_core_session_rwunlock(other_session); - } else { - sofia_glue_build_vid_refresh_message(session, sip->sip_payload->pl_data); + if (switch_channel_test_flag(channel, CF_VIDEO)) { + if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { + sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data); + switch_core_session_rwunlock(other_session); + } else { + switch_channel_set_flag(channel, CF_VIDEO_REFRESH_REQ); + } } } else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf-relay")) { @@ -7985,12 +8029,62 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ if ((call_info = sip_call_info(sip))) { call_info_str = sip_header_as_string(nh->nh_home, (void *) call_info); + + if (sofia_test_pflag(profile, PFLAG_MANAGE_SHARED_APPEARANCE) && switch_stristr("appearance", call_info_str)) { + char *p; + + switch_channel_set_variable(channel, "presence_call_info_full", call_info_str); + if ((p = strchr(call_info_str, ';'))) { + p++; + switch_channel_set_variable(channel, "presence_call_info", p); + } + } + if (call_info->ci_params && (msg_params_find(call_info->ci_params, "answer-after=0"))) { switch_channel_set_variable(channel, "sip_auto_answer_detected", "true"); } switch_channel_set_variable(channel, "sip_call_info", call_info_str); + } else if (sofia_test_pflag(profile, PFLAG_MANAGE_SHARED_APPEARANCE)) { + char buf[128] = ""; + char *sql; + char *state = "progressing"; + + if (sip && + sip->sip_from && sip->sip_from->a_url && sip->sip_from->a_url->url_user && sip->sip_from->a_url->url_host && + sip->sip_to && sip->sip_to->a_url && sip->sip_to->a_url->url_user && sip->sip_to->a_url->url_host) { + sql = + switch_mprintf("select 'appearance-index=1' from sip_subscriptions where expires > -1 and hostname='%q' and event='call-info' and " + "sub_to_user='%q' and sub_to_host='%q'", mod_sofia_globals.hostname, sip->sip_to->a_url->url_user, + sip->sip_from->a_url->url_host); + sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf)); + + if (mod_sofia_globals.debug_sla > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "QUERY SQL %s [%s]\n", sql, buf); + } + free(sql); + + if (!zstr(buf)) { + sql = switch_mprintf("update sip_dialogs set call_info='%q',call_info_state='%q' " + "where uuid='%q'", buf, state, switch_core_session_get_uuid(session)); + + if (mod_sofia_globals.debug_sla > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "QUERY SQL %s\n", sql); + } + + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Auto-Fixing Broken SLA [;%s]\n", + sip->sip_from->a_url->url_host, buf); + + switch_channel_set_variable_printf(channel, "presence_call_info_full", ";%s", sip->sip_from->a_url->url_host, buf); + switch_channel_set_variable(channel, "presence_call_info", buf); + call_info_str = switch_core_session_sprintf(session, ";%s", sip->sip_from->a_url->url_host, buf); + } + } } + if (profile->pres_type) { const char *presence_id = switch_channel_get_variable(channel, "presence_id"); if (zstr(presence_id)) { @@ -8109,7 +8203,8 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ free(sql); } - } + } + check_decode(displayname, session); tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), @@ -8161,7 +8256,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ if (app && data && !strcasecmp(app, "conference")) { - tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,conference:%s", data); + 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)) { @@ -8197,7 +8292,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ 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}", uuid); + 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); @@ -8210,7 +8305,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ if (do_conf) { tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, - "answer,conference:%s@sla+flags{mintwo}", uuid); + "answer,conference:%s@sla+flags{mintwo|dist-dtmf}", uuid); } else { if (one_leg && c_app) { if (c_data) { @@ -8411,8 +8506,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ sql = switch_mprintf("insert into sip_dialogs " "(call_id,uuid,sip_to_user,sip_to_host,sip_to_tag,sip_from_user,sip_from_host,sip_from_tag,contact_user," - "contact_host,state,direction,user_agent,profile_name,hostname,contact,presence_id,presence_data,call_info,rcd) " - "values('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q',%ld)", + "contact_host,state,direction,user_agent,profile_name,hostname,contact,presence_id,presence_data," + "call_info,rcd,call_info_state) " + "values('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q',%ld,'')", call_id, tech_pvt->sofia_private->uuid, to_user, to_host, to_tag, dialog_from_user, dialog_from_host, from_tag, @@ -8499,10 +8595,34 @@ void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t switch_caller_profile_t *acp = a_tech_pvt->caller_profile; if (ua && switch_stristr("snom", ua)) { - if (zstr(acp->caller_id_name)) { - snprintf(message, sizeof(message), "From:\r\nTo: %s\r\n", acp->caller_id_number); + const char *ver_str = NULL; + int version = 0; + + ver_str = switch_stristr( "/", ua); + + if ( ver_str ) { + char *argv[4] = { 0 }; + char *dotted = strdup( ver_str + 1 ); + if ( dotted ) { + switch_separate_string(dotted, '.', argv, (sizeof(argv) / sizeof(argv[0]))); + if ( argv[0] && argv[1] && argv[2] ) { + version = ( atoi(argv[0]) * 10000 ) + ( atoi(argv[1]) * 100 ) + atoi(argv[2]); + } + } + switch_safe_free( dotted ); + } + if ( version >= 80424 ) { + if (zstr(acp->caller_id_name)) { + snprintf(message, sizeof(message), "From: %s\r\nTo:\r\n", acp->caller_id_number); + } else { + snprintf(message, sizeof(message), "From: \"%s\" %s\r\nTo:\r\n", acp->caller_id_name, acp->caller_id_number); + } } else { - snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", acp->caller_id_name, acp->caller_id_number); + if (zstr(acp->caller_id_name)) { + snprintf(message, sizeof(message), "From:\r\nTo: %s\r\n", acp->caller_id_number); + } else { + snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", acp->caller_id_name, acp->caller_id_number); + } } nua_info(b_tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"), diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index a2b2580f1f..702dbbeaae 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -44,10 +44,10 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t * char buf[2048] = ""; char max_buf[128] = ""; char max_data[128] = ""; - const char *ip = t38_options->local_ip; - uint32_t port = t38_options->local_port; + const char *ip; + uint32_t port; const char *family = "IP4"; - const char *username = tech_pvt->profile->username; + const char *username; const char *bit_removal_on = "a=T38FaxFillBitRemoval\n"; const char *bit_removal_off = ""; @@ -59,6 +59,13 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t * const char *var; int broken_boolean; + switch_assert(tech_pvt); + switch_assert(t38_options); + + ip = t38_options->local_ip; + port = t38_options->local_port; + username = tech_pvt->profile->username; + //sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA); var = switch_channel_get_variable(tech_pvt->channel, "t38_broken_boolean"); @@ -558,13 +565,22 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch if (mult && switch_false(mult)) { char *bp = buf; - + int both = 1; + if ((!zstr(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE))) { generate_m(tech_pvt, buf, sizeof(buf), port, 0, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 1); bp = (buf + strlen(buf)); + + /* asterisk can't handle AVP and SAVP in sep streams, way to blow off the spec....*/ + if (switch_true(switch_channel_get_variable(tech_pvt->channel, "sdp_secure_savp_only"))) { + both = 0; + } + } - generate_m(tech_pvt, bp, sizeof(buf) - strlen(buf), port, 0, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 0); + if (both) { + generate_m(tech_pvt, bp, sizeof(buf) - strlen(buf), port, 0, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 0); + } } else { @@ -583,14 +599,23 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch if (cur_ptime != this_ptime) { char *bp = buf; - cur_ptime = this_ptime; + int both = 1; + cur_ptime = this_ptime; + if ((!zstr(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE))) { generate_m(tech_pvt, buf, sizeof(buf), port, cur_ptime, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 1); bp = (buf + strlen(buf)); + + /* asterisk can't handle AVP and SAVP in sep streams, way to blow off the spec....*/ + if (switch_true(switch_channel_get_variable(tech_pvt->channel, "sdp_secure_savp_only"))) { + both = 0; + } + } + + if (both) { + generate_m(tech_pvt, bp, sizeof(buf) - strlen(buf), port, cur_ptime, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 0); } - - generate_m(tech_pvt, bp, sizeof(buf) - strlen(buf), port, cur_ptime, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 0); } } @@ -762,6 +787,11 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt) switch_assert(tech_pvt->session != NULL); if ((abs = switch_channel_get_variable(tech_pvt->channel, "absolute_codec_string"))) { + /* inherit_codec == true will implicitly clear the absolute_codec_string + variable if used since it was the reason it was set in the first place and is no longer needed */ + if (switch_true(switch_channel_get_variable(tech_pvt->channel, "inherit_codec"))) { + switch_channel_set_variable(tech_pvt->channel, "absolute_codec_string", NULL); + } codec_string = abs; goto ready; } @@ -1968,6 +1998,30 @@ void sofia_glue_set_extra_headers(switch_core_session_t *session, sip_t const *s switch_channel_api_on(channel, "api_on_sip_extra_headers"); } +char *sofia_glue_get_extra_headers_from_event(switch_event_t *event, const char *prefix) +{ + char *extra_headers = NULL; + switch_stream_handle_t stream = { 0 }; + switch_event_header_t *hp; + + SWITCH_STANDARD_STREAM(stream); + for (hp = event->headers; hp; hp = hp->next) { + if (!zstr(hp->name) && !zstr(hp->value) && !strncasecmp(hp->name, prefix, strlen(prefix))) { + char *name = strdup(hp->name); + const char *hname = name + strlen(prefix); + stream.write_function(&stream, "%s: %s\r\n", hname, (char *)hp->value); + free(name); + } + } + + if (!zstr((char *) stream.data)) { + extra_headers = stream.data; + } else { + switch_safe_free(stream.data); + } + + return extra_headers; +} switch_status_t sofia_glue_do_invite(switch_core_session_t *session) { @@ -2291,6 +2345,29 @@ 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), TAG_IF(call_id, SIPTAG_CALL_ID_STR(call_id)), @@ -2503,7 +2580,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) } else { tech_pvt->session_refresher = nua_no_refresher; } - + if (sofia_use_soa(tech_pvt)) { nua_invite(tech_pvt->nh, NUTAG_AUTOANSWER(0), @@ -2925,7 +3002,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force) tech_pvt->read_codec.agreed_pt = tech_pvt->agreed_pt; if (force != 2) { - switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec); + switch_core_session_set_real_read_codec(tech_pvt->session, &tech_pvt->read_codec); switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec); } @@ -4398,9 +4475,12 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s continue; } - if (!strcasecmp(attr->a_name, "sendonly") || !strcasecmp(attr->a_name, "inactive")) { + if (!strcasecmp(attr->a_name, "sendonly")) { sendonly = 1; switch_channel_set_variable(tech_pvt->channel, "media_audio_mode", "recvonly"); + } else if (!strcasecmp(attr->a_name, "inactive")) { + sendonly = 1; + switch_channel_set_variable(tech_pvt->channel, "media_audio_mode", "inactive"); } else if (!strcasecmp(attr->a_name, "recvonly")) { switch_channel_set_variable(tech_pvt->channel, "media_audio_mode", "sendonly"); recvonly = 1; @@ -4599,7 +4679,8 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s crypto_tag = atoi(crypto); if (tech_pvt->remote_crypto_key && switch_rtp_ready(tech_pvt->rtp_session)) { - if (crypto_tag && crypto_tag == tech_pvt->crypto_tag) { + /* Compare all the key. The tag may remain the same even if key changed */ + if (crypto && !strcmp(crypto, tech_pvt->remote_crypto_key)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Existing key is still valid.\n"); } else { const char *a = switch_stristr("AES", tech_pvt->remote_crypto_key); @@ -5139,7 +5220,22 @@ char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup) { char *url = NULL, *e; - if ((url = strchr(buf, '<')) && (e = strchr(url, '>'))) { + while(*buf == ' ') { + buf++; + } + + if (*buf == '"') { + buf++; + if((e = strchr(buf, '"'))) { + buf = e+1; + } + } + + while(*buf == ' ') { + buf++; + } + + if ((url = strchr(buf, '<')) && (e = switch_find_end_paren(url, '<', '>'))) { url++; if (to_dup) { url = strdup(url); @@ -5894,7 +5990,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile) " mwi_user VARCHAR(255),\n" " mwi_host VARCHAR(255),\n" " orig_server_host VARCHAR(255),\n" - " orig_hostname VARCHAR(255)\n" + " orig_hostname VARCHAR(255),\n" + " sub_host VARCHAR(255)\n" ");\n"; char recovery_sql[] = @@ -5940,7 +6037,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile) " presence_id VARCHAR(255),\n" " presence_data VARCHAR(255),\n" " call_info VARCHAR(255),\n" - " call_info_state VARCHAR(255),\n" + " call_info_state VARCHAR(255) default '',\n" " expires INTEGER default 0,\n" " status VARCHAR(255),\n" " rpid VARCHAR(255),\n" @@ -6011,6 +6108,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile) "create index sr_call_id on sip_registrations (call_id)", "create index sr_sip_user on sip_registrations (sip_user)", "create index sr_sip_host on sip_registrations (sip_host)", + "create index sr_sub_host on sip_registrations (sub_host)", "create index sr_mwi_user on sip_registrations (mwi_user)", "create index sr_mwi_host on sip_registrations (mwi_host)", "create index sr_profile_name on sip_registrations (profile_name)", @@ -6090,7 +6188,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile) } - test_sql = switch_mprintf("delete from sip_registrations where (contact like '%%TCP%%' " + test_sql = switch_mprintf("delete from sip_registrations where (sub_host is null or contact like '%%TCP%%' " "or status like '%%TCP%%' or status like '%%TLS%%') and hostname='%q' " "and network_ip like '%%' and network_port like '%%' and sip_username " "like '%%' and mwi_user like '%%' and mwi_host like '%%' " @@ -6256,6 +6354,7 @@ void sofia_glue_actually_execute_sql_trans(sofia_profile_t *profile, char *sql, void sofia_glue_actually_execute_sql(sofia_profile_t *profile, char *sql, switch_mutex_t *mutex) { switch_cache_db_handle_t *dbh = NULL; + char *err = NULL; if (mutex) { switch_mutex_lock(mutex); @@ -6266,7 +6365,12 @@ void sofia_glue_actually_execute_sql(sofia_profile_t *profile, char *sql, switch goto end; } - switch_cache_db_execute_sql(dbh, sql, NULL); + switch_cache_db_execute_sql(dbh, sql, &err); + + if (err) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s]\n%s\n", err, sql); + free(err); + } end: @@ -6314,7 +6418,7 @@ switch_bool_t sofia_glue_execute_sql_callback(sofia_profile_t *profile, char *sofia_glue_execute_sql2str(sofia_profile_t *profile, switch_mutex_t *mutex, char *sql, char *resbuf, size_t len) { char *ret = NULL; - + char *err = NULL; switch_cache_db_handle_t *dbh = NULL; if (!(dbh = sofia_glue_get_db_handle(profile))) { @@ -6326,7 +6430,12 @@ char *sofia_glue_execute_sql2str(sofia_profile_t *profile, switch_mutex_t *mutex switch_mutex_lock(mutex); } - ret = switch_cache_db_execute_sql2str(dbh, sql, resbuf, len, NULL); + ret = switch_cache_db_execute_sql2str(dbh, sql, resbuf, len, &err); + + if (err) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s]\n%s\n", err, sql); + free(err); + } if (mutex) { switch_mutex_unlock(mutex); @@ -6502,9 +6611,14 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use nua_handle_t *nh; sofia_destination_t *dst = NULL; char *contact_str, *contact, *user_via = NULL; - char *route_uri = NULL; + char *route_uri = NULL, *p; contact = sofia_glue_get_url_from_contact((char *) o_contact, 1); + + if ((p = strstr(contact, ";fs_"))) { + *p = '\0'; + } + if (!zstr(network_ip) && sofia_glue_check_nat(profile, network_ip)) { char *ptr = NULL; //const char *transport_str = NULL; @@ -6552,6 +6666,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use NUTAG_NEWSUB(1), TAG_IF(dst->route_uri, NUTAG_PROXY(route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)), 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(contenttype, SIPTAG_CONTENT_TYPE_STR(contenttype)), TAG_IF(body, SIPTAG_PAYLOAD_STR(body)), TAG_END()); @@ -6741,7 +6856,7 @@ void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str } } -char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sofia_dispatch_event_t *de, sofia_nat_parse_t *np) +char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np) { char *contact_str = NULL; const char *contact_host;//, *contact_user; @@ -6834,33 +6949,68 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sof np->is_nat = NULL; } - if (zstr(contact_host)) { - np->is_nat = "No contact host"; - } + if (np->is_nat && np->fs_path) { + char *full_contact = sip_header_as_string(nh->nh_home, (void *) contact); + char *full_contact_dup; + char *path_encoded; + int path_encoded_len; + char *path_val; + const char *tp; - if (np->is_nat) { - contact_host = np->network_ip; - switch_snprintf(new_port, sizeof(new_port), ":%d", np->network_port); - port = NULL; - } + full_contact_dup = sofia_glue_get_url_from_contact(full_contact, 1); + if ((tp = switch_stristr("transport=", full_contact_dup))) { + tp += 10; + } + + if (zstr(tp)) { + tp = "udp"; + } - if (port) { - switch_snprintf(new_port, sizeof(new_port), ":%s", port); - } + path_val = switch_mprintf("sip:%s:%d;transport=%s", np->network_ip, np->network_port, tp); + path_encoded_len = (int)(strlen(path_val) * 3) + 1; + + switch_zmalloc(path_encoded, path_encoded_len); + switch_copy_string(path_encoded, ";fs_path=", 10); + switch_url_encode(path_val, path_encoded + 9, path_encoded_len - 9); + + contact_str = switch_mprintf("%s <%s;fs_nat=yes%s>", display, full_contact_dup, path_encoded); + + free(full_contact_dup); + free(path_encoded); + free(path_val); - ipv6 = strchr(contact_host, ':'); - if (contact->m_url->url_params) { - contact_str = switch_mprintf("%s %s", - display, 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", - display, - contact->m_url->url_user, ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : ""); - } + if (zstr(contact_host)) { + np->is_nat = "No contact host"; + } + + if (np->is_nat) { + contact_host = np->network_ip; + switch_snprintf(new_port, sizeof(new_port), ":%d", np->network_port); + port = NULL; + } + + + if (port) { + switch_snprintf(new_port, sizeof(new_port), ":%s", port); + } + + ipv6 = strchr(contact_host, ':'); + + + if (contact->m_url->url_params) { + contact_str = switch_mprintf("%s %s", + display, 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", + display, + contact->m_url->url_user, ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : ""); + } + } return contact_str; } diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index c1e4031b36..1dfa7188cd 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -40,6 +40,7 @@ struct state_helper { switch_hash_t *hash; sofia_profile_t *profile; switch_memory_pool_t *pool; + int total; }; @@ -50,11 +51,19 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char **columnNames); static int broadsoft_sla_gather_state_callback(void *pArg, int argc, char **argv, char **columnNames); static int broadsoft_sla_notify_callback(void *pArg, int argc, char **argv, char **columnNames); -static void sync_sla(sofia_profile_t *profile, const char *to_user, const char *to_host, switch_bool_t clear, switch_bool_t unseize); +static int sync_sla(sofia_profile_t *profile, const char *to_user, const char *to_host, switch_bool_t clear, switch_bool_t unseize, const char *call_id); static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char **columnNames); static int sofia_dialog_probe_notify_callback(void *pArg, int argc, char **argv, char **columnNames); +struct pres_sql_cb { + sofia_profile_t *profile; + int ttl; +}; + +static int sofia_presence_send_sql(void *pArg, int argc, char **argv, char **columnNames); + struct dialog_helper { + char state[128]; char status[512]; char rpid[512]; char presence_id[1024]; @@ -114,6 +123,7 @@ switch_status_t sofia_presence_chat_send(switch_event_t *message_event) char header[256] = ""; char *route_uri = NULL; const char *network_ip = NULL, *network_port = NULL, *from_proto; + char *extra_headers = NULL; proto = switch_event_get_header(message_event, "proto"); from_proto = switch_event_get_header(message_event, "from_proto"); @@ -127,6 +137,8 @@ switch_status_t sofia_presence_chat_send(switch_event_t *message_event) network_ip = switch_event_get_header(message_event, "to_sip_ip"); network_port = switch_event_get_header(message_event, "to_sip_port"); + extra_headers = sofia_glue_get_extra_headers_from_event(message_event, SOFIA_SIP_HEADER_PREFIX); + if (!to) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing To: header.\n"); goto end; @@ -320,6 +332,7 @@ switch_status_t sofia_presence_chat_send(switch_event_t *message_event) SIPTAG_CONTENT_TYPE_STR(ct), SIPTAG_PAYLOAD_STR(body), SIPTAG_HEADER_STR(header), + TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END()); sofia_glue_free_destination(dst); @@ -359,8 +372,8 @@ void sofia_presence_cancel(void) sql = switch_mprintf("select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from," "full_via,expires,user_agent,accept,profile_name,network_ip" - ",-1,'unavailable','unavailable' from sip_subscriptions where version > -1 and " - "expires > -1 and event='presence' and hostname='%q'", + ",-1,'unavailable','unavailable' from sip_subscriptions where " + "event='presence' and hostname='%q'", mod_sofia_globals.hostname); @@ -384,25 +397,6 @@ void sofia_presence_cancel(void) } } -void sofia_presence_establish_presence(sofia_profile_t *profile) -{ - struct resub_helper h = { 0 }; - h.profile = profile; - - if (sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, - "select sip_user,sip_host,'Registered','unknown','' from sip_registrations", - sofia_presence_resub_callback, &h) != SWITCH_TRUE) { - return; - } - - if (sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, - "select sub_to_user,sub_to_host,'Online','unknown',proto from sip_subscriptions " - "where expires > -1 and version > -1 and proto='ext' or proto='user' or proto='conf'", - sofia_presence_resub_callback, &h) != SWITCH_TRUE) { - return; - } -} - char *sofia_presence_translate_rpid(char *in, char *ext) { char *r = in; @@ -472,15 +466,16 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) if ((pname = switch_event_get_header(event, "sofia-profile"))) { profile = sofia_glue_find_profile(pname); } - + if (!profile) { if (!host || !(profile = sofia_glue_find_profile(host))) { char *sql; char buf[512] = ""; switch_console_callback_match_t *matches; - sql = switch_mprintf("select profile_name from sip_registrations where sip_host='%s' or mwi_host='%s'", host, host); - + sql = switch_mprintf("select profile_name from sip_registrations where hostname='%q' and (sip_host='%s' or mwi_host='%s')", + mod_sofia_globals.hostname, host, host); + if (list_profiles_full(NULL, NULL, &matches, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) { switch_console_callback_match_node_t *m; @@ -498,7 +493,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) switch_console_free_matches(&matches); } - + switch_safe_free(sql); if (!(profile = sofia_glue_find_profile(buf))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find profile %s\n", switch_str_nil(host)); @@ -508,6 +503,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) } } + if (profile->domain_name && strcasecmp(profile->domain_name, host)) { host = profile->domain_name; } @@ -537,14 +533,17 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) if (for_everyone) { sql = switch_mprintf("select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from," "full_via,expires,user_agent,accept,profile_name,network_ip" - ",'%q',full_to,network_ip,network_port from sip_subscriptions where version > -1 and expires > -1 and event='message-summary' " - "and sub_to_user='%q' and (sub_to_host='%q' or presence_hosts like '%%%q%%')", stream.data, user, host, host); + ",'%q',full_to,network_ip,network_port from sip_subscriptions " + "where hostname='%q' and profile_name='%q' and event='message-summary' " + "and sub_to_user='%q' and (sub_to_host='%q' or presence_hosts like '%%%q%%')", + stream.data, mod_sofia_globals.hostname, profile->name, user, host, host); } else if (sub_call_id) { sql = switch_mprintf("select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from," "full_via,expires,user_agent,accept,profile_name,network_ip" - ",'%q',full_to,network_ip,network_port from sip_subscriptions where version > -1 and expires > -1 and event='message-summary' " - "and sub_to_user='%q' and (sub_to_host='%q' or presence_hosts like '%%%q%%' and call_id='%q')", - stream.data, user, host, host, sub_call_id); + ",'%q',full_to,network_ip,network_port from sip_subscriptions where " + "hostname='%q' and profile_name='%q' and event='message-summary' " + "and sub_to_user='%q' and (sub_to_host='%q' or presence_hosts like '%%%q%%') and call_id='%q'", + stream.data, mod_sofia_globals.hostname, profile->name, user, host, host, sub_call_id); } @@ -557,10 +556,12 @@ 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' " - "from sip_registrations where mwi_user='%q' and mwi_host='%q'", stream.data, user, host); + "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' " - "from sip_registrations where mwi_user='%q' and mwi_host='%q' and call_id='%q'", stream.data, user, host, 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); } if (sql) { @@ -582,18 +583,27 @@ static int sofia_presence_dialog_callback(void *pArg, int argc, char **argv, cha { struct dialog_helper *helper = (struct dialog_helper *) pArg; - if (argc == 3) { - switch_set_string(helper->status, argv[0]); - switch_set_string(helper->rpid, argv[1]); - switch_set_string(helper->presence_id, argv[2]); + if (argc >= 4) { + + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "CHECK DIALOG state[%s] status[%s] rpid[%s] pres[%s]\n", + argv[0], argv[1], argv[2], argv[3]); + } + + if (!helper->hits) { + switch_set_string(helper->state, argv[0]); + switch_set_string(helper->status, argv[1]); + switch_set_string(helper->rpid, argv[2]); + switch_set_string(helper->presence_id, argv[3]); + } helper->hits++; } - return -1; + return 0; } -static void do_normal_probe(sofia_profile_t *profile, switch_event_t *event) +static void do_normal_probe(switch_event_t *event) { char *sql; struct resub_helper h = { 0 }; @@ -601,6 +611,8 @@ static void do_normal_probe(sofia_profile_t *profile, switch_event_t *event) char *proto = switch_event_get_header(event, "proto"); char *probe_user = NULL, *probe_euser, *probe_host, *p; struct dialog_helper dh = { { 0 } }; + char *sub_call_id = switch_event_get_header(event, "sub-call-id"); + sofia_profile_t *profile; //DUMP_EVENT(event); @@ -621,9 +633,12 @@ static void do_normal_probe(sofia_profile_t *profile, switch_event_t *event) } if (probe_euser && probe_host && (profile = sofia_glue_find_profile(probe_host))) { - sql = switch_mprintf("select status,rpid,presence_id from sip_dialogs " - "where ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') order by rcd desc", - probe_euser, probe_host, probe_euser, probe_host); + sql = switch_mprintf("select state,status,rpid,presence_id from sip_dialogs " + "where hostname='%q' and profile_name='%q' and call_info_state != 'seized' and " + "((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') order by rcd desc", + mod_sofia_globals.hostname, profile->name, probe_euser, probe_host, probe_euser, probe_host); + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_dialog_callback, &dh); h.profile = profile; @@ -631,37 +646,43 @@ static void do_normal_probe(sofia_profile_t *profile, switch_event_t *event) switch_safe_free(sql); sql = switch_mprintf("select sip_registrations.sip_user, " - "sip_registrations.sip_host, " - "sip_registrations.status, " - "sip_registrations.rpid, " - "'', " - "sip_dialogs.uuid, " - "sip_dialogs.state, " - "sip_dialogs.direction, " - "sip_dialogs.sip_to_user, " - "sip_dialogs.sip_to_host, " + "sip_registrations.sub_host, " + "sip_registrations.status, " + "sip_registrations.rpid, " + "'', " + "sip_dialogs.uuid, " + "sip_dialogs.state, " + "sip_dialogs.direction, " + "sip_dialogs.sip_to_user, " + "sip_dialogs.sip_to_host, " - "sip_presence.status," - "sip_presence.rpid," - "sip_dialogs.presence_id, " - "sip_presence.open_closed," - "'%q','%q' " - "from sip_registrations " + "sip_presence.status," + "sip_presence.rpid," + "sip_dialogs.presence_id, " + "sip_presence.open_closed," + "'%q','%q','%q' " + "from sip_registrations " - "left join sip_dialogs on " - "sip_dialogs.presence_id = sip_registrations.sip_user %q '@' %q sip_registrations.sip_host " - "or (sip_dialogs.sip_from_user = sip_registrations.sip_user " - "and sip_dialogs.sip_from_host = sip_registrations.sip_host) " + "left join sip_dialogs on " + "sip_dialogs.hostname = sip_registrations.hostname and sip_dialogs.profile_name = sip_registrations.profile_name and (" + "sip_dialogs.presence_id = sip_registrations.sip_user %q '@' %q sip_registrations.sub_host " + "or (sip_dialogs.sip_from_user = sip_registrations.sip_user " + "and sip_dialogs.sip_from_host = sip_registrations.sip_host)) " - "left join sip_presence on " - "(sip_registrations.sip_user=sip_presence.sip_user and sip_registrations.orig_server_host=sip_presence.sip_host and " - "sip_registrations.profile_name=sip_presence.profile_name) " - "where sip_dialogs.presence_id='%q@%q' or (sip_registrations.sip_user='%q' and " - "(sip_registrations.orig_server_host='%q' or sip_registrations.sip_host='%q' " - "or sip_registrations.presence_hosts like '%%%q%%'))", - dh.status, dh.rpid, - switch_sql_concat(), switch_sql_concat(), - probe_euser, probe_host, probe_euser, probe_host, probe_host, probe_host); + "left join sip_presence on " + "sip_presence.hostname=sip_registrations.hostname and " + "(sip_registrations.sip_user=sip_presence.sip_user and sip_registrations.orig_server_host=sip_presence.sip_host and " + "sip_registrations.profile_name=sip_presence.profile_name) " + "where sip_registrations.hostname='%q' and sip_registrations.profile_name='%q' and sip_dialogs.call_info_state != 'seized' " + "and sip_dialogs.presence_id='%q@%q' or (sip_registrations.sip_user='%q' and " + "(sip_registrations.orig_server_host='%q' or sip_registrations.sub_host='%q' " + "))", + dh.status, dh.rpid, switch_str_nil(sub_call_id), + switch_sql_concat(), switch_sql_concat(), + mod_sofia_globals.hostname, profile->name, probe_euser, probe_host, probe_euser, probe_host, probe_host); + + + switch_assert(sql); if (mod_sofia_globals.debug_presence > 0) { @@ -673,11 +694,12 @@ static void do_normal_probe(sofia_profile_t *profile, switch_event_t *event) } sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_resub_callback, &h); - + if (!h.rowcount) { h.noreg++; switch_safe_free(sql); + /* find ones with presence_id defined that are not registred */ sql = switch_mprintf("select sip_from_user, sip_from_host, 'Registered', '', '', " "uuid, state, direction, " @@ -686,9 +708,9 @@ static void do_normal_probe(sofia_profile_t *profile, switch_event_t *event) "from sip_dialogs " - "where (presence_id='%q@%q' or " + "where call_info_state != 'seized' and hostname='%q' and profile_name='%q' and (presence_id='%q@%q' or " "(sip_from_user='%q' and (sip_from_host='%q' or sip_to_host='%q')))", - + mod_sofia_globals.hostname, profile->name, dh.status, dh.rpid, probe_euser, probe_host, probe_euser, probe_host, probe_host); if (mod_sofia_globals.debug_presence > 0) { @@ -726,13 +748,14 @@ static void do_normal_probe(sofia_profile_t *profile, switch_event_t *event) switch_safe_free(probe_user); } -static void do_dialog_probe(sofia_profile_t *profile, switch_event_t *event) +static void do_dialog_probe(switch_event_t *event) { // Received SUBSCRIBE for "dialog" events. // Return a complete list of dialogs for the monitored entity. char *sql; char *to = switch_event_get_header(event, "to"); char *probe_user = NULL, *probe_euser, *probe_host, *p; + sofia_profile_t *profile; if (!to || !(probe_user = strdup(to))) { return; @@ -762,16 +785,20 @@ static void do_dialog_probe(sofia_profile_t *profile, switch_event_t *event) "sip_dialogs.contact, sip_dialogs.contact_user, sip_dialogs.contact_host, " "sip_dialogs.sip_to_tag, sip_dialogs.sip_from_tag, sip_subscriptions.orig_proto " "from sip_dialogs " - "left join sip_subscriptions on sip_subscriptions.call_id='%q' " - "left join sip_registrations on " + "left join sip_subscriptions on sip_subscriptions.hostname=sip_dialogs.hostname and " + "sip_subscriptions.profile_name=sip_dialogs.profile_name and " + "sip_subscriptions.call_id='%q' " + "left join sip_registrations on sip_registrations.hostname=sip_dialogs.hostname and " + "sip_registrations.profile_name=sip_dialogs.profile_name and " "(sip_dialogs.sip_from_user = sip_registrations.sip_user " "and (sip_dialogs.sip_from_host = sip_registrations.orig_server_host or " "sip_dialogs.sip_from_host = sip_registrations.sip_host) ) " - "where sip_dialogs.presence_id='%q@%q' or (sip_registrations.sip_user='%q' and " - "(sip_registrations.orig_server_host='%q' or sip_registrations.sip_host='%q' " + "where sip_dialogs.hostname='%q' and sip_dialogs.profile_name='%q' and " + "sip_dialogs.call_info_state != 'seized' and sip_dialogs.presence_id='%q@%q' or (sip_registrations.sip_user='%q' and " + "(sip_registrations.orig_server_host='%q' or sip_registrations.sub_host='%q' " "or sip_registrations.presence_hosts like '%%%q%%'))", probe_euser, probe_host, - sub_call_id, + sub_call_id, mod_sofia_globals.hostname, profile->name, probe_euser, probe_host, probe_euser, probe_host, probe_host, probe_host); switch_assert(sql); @@ -795,26 +822,10 @@ static void do_dialog_probe(sofia_profile_t *profile, switch_event_t *event) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s END DIALOG_PROBE_SQL\n\n", profile->name); } - // The dialog_probe_callback has built up the dialogs to be included in the NOTIFY. - // Now send the "full" dialog event to the triggering subscription. - sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,version, " - "'full',full_to,full_from,contact,expires,event,network_ip,network_port " - "from sip_subscriptions " - "where expires > -1 and hostname='%q' " - "and sub_to_user='%q' and sub_to_host='%q' " "and (event='dialog') and " - "call_id='%q'", - mod_sofia_globals.hostname, probe_euser, probe_host, sub_call_id); - if (mod_sofia_globals.debug_presence > 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s DUMP DIALOG_PROBE subscription sql:\n%s\n", profile->name, sql); - } - sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_dialog_probe_notify_callback, h4235); - switch_safe_free(sql); sql = switch_mprintf("update sip_subscriptions set version=version+1 " - "where expires > -1 and hostname='%q' " - "and sub_to_user='%q' and sub_to_host='%q' " "and (event='dialog') and " - "call_id='%q'", - mod_sofia_globals.hostname, probe_euser, probe_host, sub_call_id); + "where hostname='%q' and profile_name='%q' and sub_to_user='%q' and sub_to_host='%q' and call_id='%q'", + mod_sofia_globals.hostname, profile->name, probe_euser, probe_host, sub_call_id); if (mod_sofia_globals.debug_presence > 1) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s DUMP DIALOG_PROBE set version sql:\n%s\n", profile->name, sql); @@ -822,6 +833,22 @@ static void do_dialog_probe(sofia_profile_t *profile, switch_event_t *event) sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); switch_safe_free(sql); + + // The dialog_probe_callback has built up the dialogs to be included in the NOTIFY. + // Now send the "full" dialog event to the triggering subscription. + sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,version, " + "'full',full_to,full_from,contact,network_ip,network_port " + "from sip_subscriptions " + "where hostname='%q' and profile_name='%q' and sub_to_user='%q' and sub_to_host='%q' and call_id='%q'", + mod_sofia_globals.hostname, profile->name, probe_euser, probe_host, sub_call_id); + + if (mod_sofia_globals.debug_presence > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s DUMP DIALOG_PROBE subscription sql:\n%s\n", profile->name, sql); + } + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_dialog_probe_notify_callback, h4235); + switch_safe_free(sql); + sofia_glue_release_profile(profile); switch_core_hash_destroy(&h4235->hash); h4235 = NULL; @@ -846,9 +873,14 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) char *sql = NULL; char *euser = NULL, *user = NULL, *host = NULL; char *call_info = switch_event_get_header(event, "presence-call-info"); + char *call_id = switch_event_get_header(event, "call-id"); char *presence_source = switch_event_get_header(event, "presence-source"); char *call_info_state = switch_event_get_header(event, "presence-call-info-state"); + const char *uuid = switch_event_get_header(event, "unique-id"); switch_console_callback_match_t *matches; + struct presence_helper helper = { 0 }; + int hup = 0; + if (!mod_sofia_globals.running) { return; @@ -858,6 +890,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) proto = SOFIA_CHAT_PROTO; } + //DUMP_EVENT(event); if (rpid && !strcasecmp(rpid, "n/a")) { rpid = NULL; @@ -869,6 +902,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) if (status && switch_stristr("CS_HANGUP", status)) { status = "Available"; + hup = 1; } if (rpid) { @@ -876,66 +910,95 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) } if (event->event_id == SWITCH_EVENT_ROSTER) { - struct presence_helper helper = { 0 }; - - if (!mod_sofia_globals.profile_hash) - return; - - if (from) { - sql = switch_mprintf("select sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host," - "sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event," - "sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from," - "sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent," - "sip_subscriptions.accept,sip_subscriptions.profile_name,sip_subscriptions.network_ip" - ",1,'%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'','','','','sip'," - " sip_subscriptions.full_to,sip_subscriptions.network_ip,sip_subscriptions.network_port " - "from sip_subscriptions left join sip_presence on " - "(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and " - "sip_subscriptions.profile_name=sip_presence.profile_name) " - "where sip_subscriptions.version > -1 and " - "sip_subscriptions.expires > -1 and sip_subscriptions.event='presence' and sip_subscriptions.full_from like '%%%q%%'", - switch_str_nil(status), switch_str_nil(rpid), from); - } else { - sql = switch_mprintf("select sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host," - "sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event," - "sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from," - "sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent," - "sip_subscriptions.accept,sip_subscriptions.profile_name,sip_subscriptions.network_ip" - ",1,'%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'','','','','sip'," - "sip_subscriptions.full_to,sip_subscriptions.network_ip,sip_subscriptions.network_port " - "from sip_subscriptions left join sip_presence on " - "(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and " - "sip_subscriptions.profile_name=sip_presence.profile_name) " - "where sip_subscriptions.version > -1 and " - "sip_subscriptions.expires > -1 and sip_subscriptions.event='presence'", switch_str_nil(status), - switch_str_nil(rpid)); - } - - switch_assert(sql != NULL); - if (list_profiles_full(NULL, NULL, &matches, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) { switch_console_callback_match_node_t *m; for (m = matches->head; m; m = m->next) { if ((profile = sofia_glue_find_profile(m->val))) { if (profile->pres_type != PRES_TYPE_FULL) { + + + if (!mod_sofia_globals.profile_hash) { + return; + } + + if (from) { + + sql = switch_mprintf("update sip_subscriptions set version=version+1 where hostname='%q' and profile_name='%q' and " + "sip_subscriptions.event='presence' and sip_subscriptions.full_from like '%%%q%%'", + mod_sofia_globals.hostname, profile->name, from); + + if (mod_sofia_globals.debug_presence > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "PRES SQL %s\n", sql); + } + + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + + + sql = switch_mprintf("select sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host," + "sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event," + "sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from," + "sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent," + "sip_subscriptions.accept,sip_subscriptions.profile_name,sip_subscriptions.network_ip" + ",1,'%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'','','','','sip'," + " sip_subscriptions.full_to,sip_subscriptions.network_ip,sip_subscriptions.network_port " + "from sip_subscriptions left join sip_presence on " + "(sip_subscriptions.sub_to_user=sip_presence.sip_user and " + "sip_subscriptions.sub_to_host=sip_presence.sip_host and " + "sip_subscriptions.profile_name=sip_presence.profile_name and " + "sip_presence.profile_name=sip_subscriptions.profile_name) " + "where sip_subscriptions.hostname='%q' and sip_subscriptions.profile_name='%q' and " + "sip_subscriptions.event='presence' and sip_subscriptions.full_from like '%%%q%%'", + switch_str_nil(status), switch_str_nil(rpid), mod_sofia_globals.hostname, profile->name, from); + } else { + + sql = switch_mprintf("update sip_subscriptions set version=version+1 where hostname='%q' and profile_name='%q' and " + "sip_subscriptions.event='presence'", mod_sofia_globals.hostname, profile->name); + + if (mod_sofia_globals.debug_presence > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "PRES SQL %s\n", sql); + } + + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + + sql = switch_mprintf("select sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host," + "sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event," + "sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from," + "sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent," + "sip_subscriptions.accept,sip_subscriptions.profile_name,sip_subscriptions.network_ip" + ",1,'%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'','','','','sip'," + "sip_subscriptions.full_to,sip_subscriptions.network_ip,sip_subscriptions.network_port " + "from sip_subscriptions left join sip_presence on " + "(sip_subscriptions.sub_to_user=sip_presence.sip_user and " + "sip_subscriptions.sub_to_host=sip_presence.sip_host and " + "sip_subscriptions.profile_name=sip_presence.profile_name and " + "sip_subscriptions.hostname = sip_presence.hostname) " + "where sip_subscriptions.hostname='%q' and sip_subscriptions.profile_name='%q' and " + "sip_subscriptions.event='presence'", switch_str_nil(status), + switch_str_nil(rpid), mod_sofia_globals.hostname, profile->name); + } + + switch_assert(sql != NULL); + + if (mod_sofia_globals.debug_presence > 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s is passive, skipping\n", (char *) profile->name); } sofia_glue_release_profile(profile); continue; } + memset(&helper, 0, sizeof(helper)); helper.profile = profile; helper.event = NULL; sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_sub_callback, &helper); - + switch_safe_free(sql); sofia_glue_release_profile(profile); } } switch_console_free_matches(&matches); } - free(sql); + switch_safe_free(sql); return; } @@ -978,10 +1041,10 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) if (!probe_type || strcasecmp(probe_type, "dialog")) { /* NORMAL PROBE */ - do_normal_probe(profile, event); + do_normal_probe(event); } else { /* DIALOG PROBE */ - do_dialog_probe(profile, event); + do_dialog_probe(event); } } goto done; @@ -1009,9 +1072,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) continue; } - if (call_info) { - const char *uuid = switch_event_get_header(event, "unique-id"); - + if (call_info) { #if 0 if (mod_sofia_globals.debug_sla > 1) { @@ -1021,13 +1082,14 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) #endif if (uuid) { - sql = switch_mprintf("update sip_dialogs set call_info='%q',call_info_state='%q' where hostname='%q' and uuid='%q'", - call_info, call_info_state, mod_sofia_globals.hostname, uuid); + sql = switch_mprintf("update sip_dialogs set call_info='%q',call_info_state='%q' where " + "hostname='%q' and profile_name='%q' and uuid='%q'", + call_info, call_info_state, mod_sofia_globals.hostname, profile->name, uuid); } else { - sql = switch_mprintf("update sip_dialogs set call_info='%q', call_info_state='%q' where hostname='%q' and " + sql = switch_mprintf("update sip_dialogs set call_info='%q', call_info_state='%q' where hostname='%q' and profile_name='%q' and " "((sip_dialogs.sip_from_user='%q' and sip_dialogs.sip_from_host='%q') or presence_id='%q@%q') and call_info='%q'", - call_info, call_info_state, mod_sofia_globals.hostname, euser, host, euser, host, call_info); + call_info, call_info_state, mod_sofia_globals.hostname, profile->name, euser, host, euser, host, call_info); } @@ -1042,141 +1104,233 @@ static void actual_sofia_presence_event_handler(switch_event_t *event) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "PROCESS PRESENCE EVENT\n"); } - sync_sla(profile, euser, host, SWITCH_TRUE, SWITCH_TRUE); + sync_sla(profile, euser, host, SWITCH_TRUE, SWITCH_TRUE, call_id); } if (!strcmp(proto, "dp")) { - sql = switch_mprintf("update sip_presence set rpid='%q',status='%q' where sip_user='%q' and sip_host='%q'", - rpid, status, euser, host); + sql = switch_mprintf("update sip_presence set rpid='%q',status='%q' where hostname='%q' and profile_name='%q' and " + "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); } + + if (zstr(uuid)) { - sql = switch_mprintf("select status,rpid,presence_id from sip_dialogs " - "where ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') order by rcd desc", - euser, host, euser, host); + sql = switch_mprintf("select state,status,rpid,presence_id from sip_dialogs " + "where call_info_state != 'seized' and hostname='%q' and profile_name='%q' and " + "((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') order by rcd desc", + mod_sofia_globals.hostname, profile->name, euser, host, euser, host); + } else { + sql = switch_mprintf("select state,status,rpid,presence_id from sip_dialogs " + "where uuid != '%q' and call_info_state != 'seized' and hostname='%q' and profile_name='%q' and " + "((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') order by rcd desc", + uuid, mod_sofia_globals.hostname, profile->name, euser, host, euser, host); + } + + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "CHECK SQL: %s@%s [%s]\nhits: %d\n", euser, host, sql, dh.hits); + } + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_dialog_callback, &dh); + + switch_safe_free(sql); +#if 0 + if (hup && dh.hits > 0) { + /* sigh, mangle this packet to simulate a call that is up instead of hungup */ + event->flags |= EF_UNIQ_HEADERS; + if (!strcasecmp(dh.state, "early")) { + status = "CS_ROUTING"; + if (rpid) { + rpid = sofia_presence_translate_rpid(rpid, status); + } + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "early"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State", status); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Call-State", "EARLY"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "astate", "early"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "early"); + } else { + status = "CS_EXECUTE"; + if (rpid) { + rpid = sofia_presence_translate_rpid(rpid, status); + } + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State", status); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Call-State", "ACTIVE"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "astate", "confirmed"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "confirmed"); + } + } +#endif - if (dh.hits && presence_source && (!strcasecmp(presence_source, "register") || switch_stristr("register", status))) { + if (zstr(call_id) && (dh.hits && presence_source && (!strcasecmp(presence_source, "register") || switch_stristr("register", status)))) { goto done; } - - if ((sql = switch_mprintf("select distinct sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host," - "sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event," - "sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from," - "sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent," - "sip_subscriptions.accept,sip_subscriptions.profile_name" - ",'%q','%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'%q','%q'," - "sip_subscriptions.version, '%q',sip_subscriptions.orig_proto,sip_subscriptions.full_to," - "sip_subscriptions.network_ip, sip_subscriptions.network_port " - "from sip_subscriptions " - "left join sip_presence on " - "(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and " - "sip_subscriptions.profile_name=sip_presence.profile_name) " - - "where sip_subscriptions.version > -1 and sip_subscriptions.expires > -1 and " - "sip_subscriptions.proto='%q' and " - "(event='%q' or event='%q') and sub_to_user='%q' " - "and (sub_to_host='%q' or presence_hosts like '%%%q%%') " - "and (sip_subscriptions.profile_name = '%q' or sip_subscriptions.presence_hosts != sip_subscriptions.sub_to_host) ", - - switch_str_nil(status), switch_str_nil(rpid), host, - dh.status,dh.rpid,dh.presence_id, proto, - event_type, alt_event_type, euser, host, host, profile->name))) { + if (zstr(call_id)) { + + sql = switch_mprintf("update sip_subscriptions set version=version+1 where hostname='%q' and profile_name='%q' and " + "sip_subscriptions.event != 'line-seize' " + "and sip_subscriptions.proto='%q' and (event='%q' or event='%q') and sub_to_user='%q' and " + "(sub_to_host='%q' or sub_to_host='%q' or sub_to_host='%q' or " + "presence_hosts like '%%%q%%') and " + "(sip_subscriptions.profile_name = '%q' or presence_hosts like '%%%q%%')", + mod_sofia_globals.hostname, profile->name, + proto, event_type, alt_event_type, euser, host, profile->sipip, + profile->extsipip ? profile->extsipip : "N/A", host, profile->name, host); - struct presence_helper helper = { 0 }; - 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 > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "PRES SQL %s\n", sql); } - 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); - - sql = switch_mprintf("update sip_subscriptions set version=version+1 where event='dialog' and sub_to_user='%q' " - "and (sub_to_host='%q' or presence_hosts like '%%%q%%') " - "and (profile_name = '%q' or presence_hosts != sub_to_host)", - euser, host, host, profile->name); - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - - 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); + + + sql = switch_mprintf("select distinct sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host," + "sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event," + "sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from," + "sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent," + "sip_subscriptions.accept,sip_subscriptions.profile_name" + ",'%q','%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'%q','%q'," + "sip_subscriptions.version, '%q',sip_subscriptions.orig_proto,sip_subscriptions.full_to," + "sip_subscriptions.network_ip, sip_subscriptions.network_port " + "from sip_subscriptions " + "left join sip_presence on " + "(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and " + "sip_subscriptions.profile_name=sip_presence.profile_name and sip_subscriptions.hostname=sip_presence.hostname) " + + "where sip_subscriptions.hostname='%q' and sip_subscriptions.profile_name='%q' and " + "sip_subscriptions.event != 'line-seize' and " + "sip_subscriptions.proto='%q' and " + "(event='%q' or event='%q') and sub_to_user='%q' " + "and (sub_to_host='%q' or sub_to_host='%q' or sub_to_host='%q' or presence_hosts like '%%%q%%') ", + + + switch_str_nil(status), switch_str_nil(rpid), host, + dh.status,dh.rpid,dh.presence_id, mod_sofia_globals.hostname, profile->name, proto, + event_type, alt_event_type, euser, host, profile->sipip, + profile->extsipip ? profile->extsipip : "N/A", host); + } else { + sql = switch_mprintf("update sip_subscriptions set version=version+1 where sip_subscriptions.event != 'line-seize' and " + "hostname='%q' and profile_name = '%q' and sip_subscriptions.call_id='%q'", + mod_sofia_globals.hostname, profile->name, call_id); + + + if (mod_sofia_globals.debug_presence > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "PRES SQL %s\n", sql); } -#if 1 - if (event) { - const char *refresh = switch_event_get_header(event, "refresh"); - if (switch_true(refresh)) { - 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); - } + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + + + sql = switch_mprintf("select distinct sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host," + "sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event," + "sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from," + "sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent," + "sip_subscriptions.accept,sip_subscriptions.profile_name" + ",'%q','%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'%q','%q'," + "sip_subscriptions.version, '%q',sip_subscriptions.orig_proto,sip_subscriptions.full_to," + "sip_subscriptions.network_ip, sip_subscriptions.network_port " + "from sip_subscriptions " + "left join sip_presence on " + "(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and " + "sip_subscriptions.profile_name=sip_presence.profile_name and sip_subscriptions.hostname=sip_presence.hostname) " + + "where sip_subscriptions.hostname='%q' and sip_subscriptions.profile_name='%q' and " + "sip_subscriptions.event != 'line-seize' and " + "sip_subscriptions.call_id='%q'", + + 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); + + 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); + } + 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 (!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') { + *next++ = '\0'; } } -#endif - - 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') { - *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); + if (!zstr(this_sql) && (!last || strcmp(last, this_sql))) { + sofia_glue_execute_sql(profile, &this_sql, SWITCH_FALSE); + last = this_sql; } - switch_safe_free(helper.stream.data); - helper.stream.data = NULL; - } - sofia_glue_release_profile(profile); + this_sql = next; + } while (this_sql); } + switch_safe_free(helper.stream.data); + helper.stream.data = NULL; + + 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; @@ -1348,7 +1502,7 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char char *status = argv[2]; char *rpid = argv[3]; char *proto = argv[4]; - + char *call_id = NULL; char *presence_id = NULL; char *to_user = NULL; char *uuid = NULL; @@ -1358,6 +1512,14 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char char to_buf[128] = ""; switch_event_header_t *hp; char *free_me = NULL; + int do_event = 1, i; + + + if (mod_sofia_globals.debug_presence > 1) { + for (i = 0; i < argc; i++) { + switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_WARNING, "sofia_presence_resub_callback: %d [%s]=[%s]\n", i, columnNames[i], argv[i]); + } + } if (argc > 5) { uuid = argv[5]; @@ -1381,6 +1543,18 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char if ((p = strchr(free_me, '@'))) *p = '\0'; user = free_me; } + + if (argc > 16) { + call_id = argv[16]; + } + + } + + if (!zstr(uuid) && !switch_ivr_uuid_exists(uuid)) { + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s SKIPPING NOT FOUND UUID %s\n", profile->name, uuid); + } + do_event = 0; } if (zstr(proto)) { @@ -1391,7 +1565,7 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s PRESENCE_PROBE %s@%s\n", profile->name, user, host); } - if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { + if (do_event && switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", proto ? proto : SOFIA_CHAT_PROTO); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url); @@ -1401,7 +1575,11 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Force-Direction", "inbound"); } - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "resub", "true"); + if (!zstr(call_id)) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id); + } + + //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "resub", "true"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); @@ -1433,13 +1611,15 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char } } - switch_event_fire(&event); } switch_safe_free(free_me); + h->rowcount++; + + return 0; } @@ -1516,12 +1696,12 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * if (mod_sofia_globals.debug_presence > 1) { for (i = 0; i < argc; i++) { - switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_DEBUG, "sofia_dialog_probe_callback: %d [%s]=[%s]\n", i, columnNames[i], argv[i]); + switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_WARNING, "sofia_dialog_probe_callback: %d [%s]=[%s]\n", i, columnNames[i], argv[i]); } } if (zstr(to_user) || zstr(contact_user)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "sofia_dialog_probe_callback: not enough info to generate a dialog entry\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "sofia_dialog_probe_callback: not enough info to generate a dialog entry\n"); return 0; } @@ -1548,8 +1728,8 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * local_host = to_host; if (proto && !strcasecmp(proto, "queue")) { - local_user = "queue"; - local_user_param = switch_mprintf(";fifo=%s", to_user); + 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); @@ -1562,8 +1742,8 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * remote_host = local_host; } else if (proto && !strcasecmp(proto, "park")) { - local_user = "park"; - local_user_param = switch_mprintf(";fifo=%s", to_user); + 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); @@ -1576,8 +1756,8 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * remote_host = local_host; } else if (proto && !strcasecmp(proto, "conf")) { - local_user = "conference"; - local_user_param = switch_mprintf(";conference=%s", to_user); + local_user = to_user; + local_user_param = switch_mprintf(";proto=%s", proto); if (skip_proto) { buf_to_free = switch_mprintf("sip:%s@%s", to_user, host); } else { @@ -1610,28 +1790,28 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * data = ""; } tmp = switch_core_sprintf(h->pool, "%s" - "\n" - " %s\n" - " \n" - " sip:%s@%s%s\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " sip:%s@%s\n" - " \n" - " \n" - "\n", - data, - uuid, call_id, to_tag, from_tag, direction, - state, - local_user, local_user, local_host, local_user_param, - local_user, local_host, - !strcasecmp(event_status, "hold") ? "no" : "yes", - remote_display_buf, remote_user, remote_host, - remote_uri - ); + "\n" + " %s\n" + " \n" + " sip:%s@%s%s\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " sip:%s@%s\n" + " \n" + " \n" + "\n", + data, + uuid, call_id, to_tag, from_tag, direction, + state, + local_user, local_user, local_host, local_user_param, + local_user, local_host, + !strcasecmp(event_status, "hold") ? "no" : "yes", + remote_display_buf, remote_user, remote_host, + remote_uri + ); switch_core_hash_insert(h->hash, key, tmp); switch_safe_free(buf_to_free); @@ -1640,32 +1820,124 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * return 0; } -static void send_presence_notify(sofia_profile_t *profile, - const char *full_to, - const char *full_from, - const char *contact, - const char *expires, - const char *call_id, - const char *event, - const char *remote_ip, - const char *remote_port, - const char *ct, - const char *pl, - const char *call_info +#define send_presence_notify(_a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l) \ +_send_presence_notify(_a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,__FILE__, __SWITCH_FUNC__, __LINE__) + +static void _send_presence_notify(sofia_profile_t *profile, + const char *full_to, + const char *full_from, + const char *o_contact, + const char *expires, + const char *call_id, + const char *event, + const char *remote_ip, + const char *remote_port, + const char *ct, + const char *pl, + const char *call_info, + const char *file, const char *func, int line ) { char sstr[128] = ""; nua_handle_t *nh; int exptime = 0; char expires_str[10] = ""; - char *tmp, *route = NULL; sip_cseq_t *cseq = NULL; uint32_t callsequence; uint32_t now = (uint32_t) switch_epoch_time_now(NULL); + char *our_contact = profile->url, *our_contact_dup = NULL; + + sofia_destination_t *dst = NULL; + char *contact_str, *contact, *user_via = NULL; + char *route_uri = NULL, *o_contact_dup = NULL, *tmp, *to_uri, *dcs = NULL; + const char *tp; + + tmp = (char *)o_contact; + o_contact_dup = sofia_glue_get_url_from_contact(tmp, 1); + + + if ((tp = switch_stristr("transport=", o_contact_dup))) { + tp += 10; + } + + if (zstr(tp)) { + tp = "udp"; + } + + if (!switch_stristr("transport=", our_contact)) { + our_contact_dup = switch_mprintf("<%s;transport=%s>", our_contact, tp); + our_contact = our_contact_dup; + } + + + if (!zstr(remote_ip) && sofia_glue_check_nat(profile, remote_ip)) { + char *ptr = NULL; + + if ((ptr = sofia_glue_find_parameter(o_contact, "transport="))) { + sofia_transport_t transport = sofia_glue_str2transport(ptr); + + switch (transport) { + case SOFIA_TRANSPORT_TCP: + contact_str = profile->tcp_public_contact; + break; + case SOFIA_TRANSPORT_TCP_TLS: + contact_str = profile->tls_public_contact; + break; + default: + contact_str = profile->public_url; + break; + } + user_via = sofia_glue_create_external_via(NULL, profile, transport); + } else { + user_via = sofia_glue_create_external_via(NULL, profile, SOFIA_TRANSPORT_UDP); + contact_str = profile->public_url; + } + + } else { + contact_str = our_contact; + } + + + if ((to_uri = sofia_glue_get_url_from_contact((char *)full_to, 1))) { + char *p; + + if ((p = strstr(to_uri, "sip:"))) { + char *q; + + p += 4; + if ((q = strchr(p, '@'))) { + *q++ = '\0'; + + if ((dcs = switch_string_replace(contact_str, "mod_sofia", p))) { + contact_str = dcs; + } + + } + } + + free(to_uri); + } + + dst = sofia_glue_get_destination((char *) o_contact); + switch_assert(dst); + + if (!zstr(dst->contact)) { + contact = sofia_glue_get_url_from_contact(dst->contact, 1); + } else { + contact = strdup(o_contact); + } + + if (dst->route_uri) { + route_uri = sofia_glue_strip_uri(dst->route_uri); + } else { + if (remote_ip && remote_port) { + route_uri = switch_mprintf("sip:user@%s:%s;transport=%s", remote_ip, remote_port, tp); + } + } if (expires) { long ltmp = atol(expires); - + if (ltmp > 0) { exptime = (ltmp - now); } else { @@ -1673,42 +1945,27 @@ static void send_presence_notify(sofia_profile_t *profile, } } - - switch_mutex_lock(profile->ireg_mutex); - if (!profile->cseq_base) { - profile->cseq_base = (now - 1312693200) * 10; - } - callsequence = ++profile->cseq_base; - switch_mutex_unlock(profile->ireg_mutex); - - - nh = nua_handle(profile->nua, NULL, TAG_END()); - cseq = sip_cseq_create(nh->nh_home, callsequence, SIP_METHOD_NOTIFY); - nua_handle_bind(nh, &mod_sofia_globals.destroy_private); - - if (exptime > 0) { - switch_snprintf(sstr, sizeof(sstr), "active;expires=%u", (unsigned) exptime); - } else { + if (exptime <= 0) { switch_snprintf(sstr, sizeof(sstr), "terminated;reason=noresource"); + } else { + switch_snprintf(sstr, sizeof(sstr), "active;expires=%u", (unsigned) exptime); } - - tmp = (char *)contact; - contact = sofia_glue_get_url_from_contact(tmp, 0); - - if (remote_ip && remote_port) { - route = switch_mprintf("sip:%s:%s", remote_ip, remote_port); - } - - if (mod_sofia_globals.debug_presence > 1) { + if (mod_sofia_globals.debug_presence > 1 || mod_sofia_globals.debug_sla > 1) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SEND PRES NOTIFY:\n" - "route[%s]\ncontact[%s]\nto[%s]\nfrom[%s]\nurl[%s]\ncall_id[%s]\nexpires_str[%s]\n" + "file[%s]\nfunc[%s]\nline[%d]\n" + "profile[%s]\nvia[%s]\nip[%s]\nport[%s]\nroute[%s]\ncontact[%s]\nto[%s]\nfrom[%s]\nurl[%s]\ncall_id[%s]\nexpires_str[%s]\n" "event[%s]\nct[%s]\npl[%s]\ncall_info[%s]\nexptime[%ld]\n", - route, - contact, + file, func, line, + profile->name, + switch_str_nil(user_via), + remote_ip, + remote_port, + route_uri, + o_contact, full_to, full_from, - profile->url, + contact, call_id, expires_str, event, @@ -1717,17 +1974,32 @@ static void send_presence_notify(sofia_profile_t *profile, switch_str_nil(call_info), (long)exptime ); - - } + + switch_mutex_lock(profile->ireg_mutex); + if (!profile->cseq_base) { + profile->cseq_base = (now - 1312693200) * 10; + } + callsequence = ++profile->cseq_base; + switch_mutex_unlock(profile->ireg_mutex); + + + nh = nua_handle(profile->nua, NULL, NUTAG_URL(contact), SIPTAG_CONTACT_STR(contact_str), TAG_END()); + cseq = sip_cseq_create(nh->nh_home, callsequence, SIP_METHOD_NOTIFY); + nua_handle_bind(nh, &mod_sofia_globals.destroy_private); + + nua_notify(nh, NUTAG_NEWSUB(1), - TAG_IF(route, NUTAG_PROXY(route)), - NUTAG_URL(contact), + TAG_IF(route_uri, NUTAG_PROXY(route_uri)), + TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)), + TAG_IF(user_via, SIPTAG_VIA_STR(user_via)), + + SIPTAG_FROM_STR(full_to), SIPTAG_TO_STR(full_from), - SIPTAG_CONTACT_STR(profile->url), + SIPTAG_CALL_ID_STR(call_id), TAG_IF(*expires_str, SIPTAG_EXPIRES_STR(expires_str)), SIPTAG_SUBSCRIPTION_STATE_STR(sstr), @@ -1739,8 +2011,16 @@ static void send_presence_notify(sofia_profile_t *profile, SIPTAG_CSEQ(cseq), TAG_END()); - switch_safe_free(route); - + + switch_safe_free(route_uri); + switch_safe_free(dcs); + switch_safe_free(contact); + + sofia_glue_free_destination(dst); + switch_safe_free(user_via); + switch_safe_free(o_contact_dup); + switch_safe_free(our_contact_dup); + } @@ -1768,11 +2048,18 @@ static int sofia_dialog_probe_notify_callback(void *pArg, int argc, char **argv, const char *pl = NULL; const char *ct = "application/dialog-info+xml"; + if (mod_sofia_globals.debug_presence > 0) { + int i; + for(i = 0; i < argc; i++) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "arg %d[%s] = [%s]\n", i, columnNames[i], argv[i]); + } + } + if (mod_sofia_globals.debug_presence > 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, - "SEND DIALOG\nTo: \t%s@%s\nFrom: \t%s@%s\nCall-ID: \t%s\n", - user, host, user, host, call_id); + "SEND DIALOG\nTo: \t%s@%s\nFrom: \t%s@%s\nCall-ID: \t%s\n", + user, host, user, host, call_id); } to = switch_mprintf("sip:%s@%s", user, host); @@ -1859,7 +2146,7 @@ static char *translate_rpid(char *in) r = "busy"; } - end: + end: return r; } @@ -1987,7 +2274,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * char *open_closed = NULL; char *dialog_status = NULL; char *dialog_rpid = NULL; - + char *default_dialog = "partial"; const char *ct = "no/idea"; char *to = NULL; @@ -2037,6 +2324,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * port = argv[27]; } + if (!zstr(presence_id) && strchr(presence_id, '@')) { char *p; @@ -2138,6 +2426,16 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * char *clean_to_user = NULL; char *clean_from_user = NULL; 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"); + + if (user_agent && switch_stristr("snom", user_agent) && uuid) { + default_dialog = "full" ; + } + + if (call_state && !strcasecmp(call_state, "cs_hangup")) { + astate = "hangup"; + } if (event_status && !strncasecmp(event_status, "hold", 4)) { holding = 1; @@ -2197,12 +2495,10 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * stream.write_function(&stream, "\n" "\n", version, clean_id); - + "version=\"%s\" state=\"%s\" entity=\"%s\">\n", version, default_dialog, clean_id); } - //if (strcasecmp(event_status, "Registered")) { if (!zstr(uuid)) { if (!zstr(answer_state)) { astate = answer_state; @@ -2219,11 +2515,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * if (!strcasecmp(astate, "answered")) { astate = "confirmed"; } - - if (!strcasecmp(astate, "hangup")) { - astate = "terminated"; - } - + + if (is_dialog) { if (!strcasecmp(astate, "ringing")) { @@ -2237,6 +2530,11 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * if (holding) { astate = "early"; } + + + if (!strcasecmp(astate, "hangup")) { + astate = "terminated"; + } stream.write_function(&stream, "\n", uuid, direction); stream.write_function(&stream, "%s\n", astate); @@ -2245,8 +2543,13 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * astate = "early"; } } - + + if (sofia_test_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY) && + (!zstr(call_info_state) && (!strcasecmp(call_info_state, "alterting") || !strcasecmp(call_info_state, "progressing")))) { + goto end; + } + if (!strcasecmp(astate, "early") || !strcasecmp(astate, "confirmed")) { clean_to_user = switch_mprintf("%s", sub_to_user ? sub_to_user : to_user); @@ -2268,9 +2571,9 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * stream.write_function(&stream, "\n", clean_to_user, host); stream.write_function(&stream, "\n"); } else if (!strcasecmp(proto, "queue")) { - stream.write_function(&stream, "\nsip:queue@%s;fifo=%s\n", - host, !zstr(clean_to_user) ? clean_to_user : "unknown"); - stream.write_function(&stream, "\n", host); + stream.write_function(&stream, "\nsip:%s@%s;proto=queue\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) { @@ -2281,9 +2584,9 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * stream.write_function(&stream, "\n"); } else if (!strcasecmp(proto, "park")) { - stream.write_function(&stream, "\nsip:park@%s;slot=%s\n", - host, !zstr(clean_to_user) ? clean_to_user : "unknown"); - stream.write_function(&stream, "\n", host); + stream.write_function(&stream, "\nsip:%s@%s;proto=park\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) { @@ -2293,9 +2596,10 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * } stream.write_function(&stream, "\n"); } else if (!strcasecmp(proto, "conf")) { - stream.write_function(&stream, "\nsip:conference@%s;conference=%s\n", - host, !zstr(clean_to_user) ? clean_to_user : "unknown"); - stream.write_function(&stream, "\n", host); + stream.write_function(&stream, "\nsip:%s@%s;proto=conference\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@%s\n", uuid, host); if (skip_proto) { @@ -2323,18 +2627,21 @@ 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 uuid='%s';", astate, 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); switch_copy_string(helper->last_uuid, uuid, sizeof(helper->last_uuid)); } + if (zstr(astate)) astate = ""; - if (!is_dialog && (zstr(astate) || strcasecmp(astate, "hangup"))) { + if (!is_dialog) { switch_set_string(status_line, status); if (in) { open = "open"; if (switch_false(resub)) { + int term; const char *direction = switch_event_get_header(helper->event, "Caller-Direction"); const char *op, *what = "Ring"; @@ -2376,11 +2683,14 @@ 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"; + term = 1; } - - - - if (!strcmp(status, "hold")) { + + if (!term && !strcmp(status, "hold")) { rpid = "on-the-phone"; if (!zstr(op)) { switch_snprintf(status_line, sizeof(status_line), "Hold %s", op); @@ -2440,7 +2750,6 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * pl = gen_pidf(user_agent, clean_id, profile->url, open, rpid, prpid, status, &ct); - } @@ -2449,13 +2758,18 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * const char *register_source = switch_event_get_header_nil(helper->event, "register-source"); 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 uuid='%q'", rpid, status_line, uuid); + 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); sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); } } send_presence_notify(profile, full_to, full_from, contact, expires, call_id, event, ip, port, ct, pl, NULL); + + end: + switch_safe_free(free_me); if (ext_profile) { @@ -2488,6 +2802,14 @@ static int sofia_presence_mwi_callback(void *pArg, int argc, char **argv, char * struct mwi_helper *h = (struct mwi_helper *) pArg; sofia_profile_t *ext_profile = NULL, *profile = h->profile; + + if (mod_sofia_globals.debug_presence > 0) { + int i; + for(i = 0; i < argc; i++) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "arg %d[%s] = [%s]\n", i, columnNames[i], argv[i]); + } + } + if (profile_name && strcasecmp(profile_name, h->profile->name)) { if ((ext_profile = sofia_glue_find_profile(profile_name))) { profile = ext_profile; @@ -2559,6 +2881,7 @@ static int broadsoft_sla_notify_callback(void *pArg, int argc, char **argv, char char *event = argv[4]; int i; + if (mod_sofia_globals.debug_sla > 1) { for (i = 0; i < argc; i++) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SLA3: %d [%s]=[%s]\n", i, columnNames[i], argv[i]); @@ -2593,6 +2916,8 @@ static int broadsoft_sla_notify_callback(void *pArg, int argc, char **argv, char } send_presence_notify(sh->profile, argv[5], argv[6], argv[7], argv[8], call_id, event, argv[9], argv[10], NULL, NULL, tmp); + + sh->total++; return 0; } @@ -2690,11 +3015,91 @@ static int broadsoft_sla_gather_state_callback(void *pArg, int argc, char **argv return 0; } -static void sync_sla(sofia_profile_t *profile, const char *to_user, const char *to_host, switch_bool_t clear, switch_bool_t unseize) +static int sync_sla(sofia_profile_t *profile, const char *to_user, const char *to_host, switch_bool_t clear, switch_bool_t unseize, const char *call_id) { struct state_helper *sh; switch_memory_pool_t *pool; char *sql; + int total = 0; + + + if (clear) { + struct pres_sql_cb cb = {profile, 0}; + + + if (call_id) { + + sql = switch_mprintf("update sip_subscriptions set version=version+1,expires=%ld where " + "call_id='%q' " + "and event='line-seize'", (long) switch_epoch_time_now(NULL), + call_id); + + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + + if (mod_sofia_globals.debug_sla > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CLEAR SQL %s\n", sql); + } + switch_safe_free(sql); + + sql = switch_mprintf("select full_to, full_from, contact, -1, call_id, event, network_ip, network_port, " + "NULL as ct, NULL as pt " + " from sip_subscriptions where call_id='%q' " + + "and event='line-seize'", call_id); + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_send_sql, &cb); + if (mod_sofia_globals.debug_sla > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CLEAR SQL %s\n", sql); + } + switch_safe_free(sql); + } else { + + sql = switch_mprintf("update sip_subscriptions set version=version+1,expires=%ld where " + "hostname='%q' and profile_name='%q' " + "and sub_to_user='%q' and sub_to_host='%q' " + + "and event='line-seize'", (long) switch_epoch_time_now(NULL), + mod_sofia_globals.hostname, profile->name, to_user, to_host + ); + + if (mod_sofia_globals.debug_sla > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CLEAR SQL %s\n", sql); + } + + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + + + sql = switch_mprintf("select full_to, full_from, contact, -1, call_id, event, network_ip, network_port, " + "NULL as ct, NULL as pt " + " from sip_subscriptions where " + "hostname='%q' and profile_name='%q' " + "and sub_to_user='%q' and sub_to_host='%q' " + "and event='line-seized'", + mod_sofia_globals.hostname, profile->name, to_user, to_host + ); + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_send_sql, &cb); + + if (mod_sofia_globals.debug_sla > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CLEAR SQL %s\n", sql); + } + + switch_safe_free(sql); + } + + + sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and profile_name='%q' and " + "((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " + "and call_info_state='seized'", mod_sofia_globals.hostname, profile->name, to_user, to_host, to_user, to_host); + + + if (mod_sofia_globals.debug_sla > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CLEAR SQL %s\n", sql); + } + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + switch_safe_free(sql); + } + switch_core_new_memory_pool(&pool); sh = switch_core_alloc(pool, sizeof(*sh)); @@ -2702,8 +3107,10 @@ static void sync_sla(sofia_profile_t *profile, const char *to_user, const char * switch_core_hash_init(&sh->hash, sh->pool); sql = switch_mprintf("select sip_from_user,sip_from_host,call_info,call_info_state,uuid from sip_dialogs " - "where call_info_state is not null and hostname='%q' and ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q')", - mod_sofia_globals.hostname, to_user, to_host, to_user, to_host); + "where call_info_state is not null and hostname='%q' and profile_name='%q' " + "and ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " + "and profile_name='%q'", + mod_sofia_globals.hostname, profile->name, to_user, to_host, to_user, to_host, profile->name); if (mod_sofia_globals.debug_sla > 1) { @@ -2713,48 +3120,62 @@ static void sync_sla(sofia_profile_t *profile, const char *to_user, const char * switch_safe_free(sql); - if (unseize) { - sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,full_to,full_from,contact,expires,network_ip,network_port " - "from sip_subscriptions " - "where version > -1 and expires > -1 and hostname='%q' " - "and sub_to_user='%q' and sub_to_host='%q' " - "and (event='call-info' or event='line-seize')", mod_sofia_globals.hostname, to_user, to_host); - } else { - sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,full_to,full_from,contact,expires,network_ip,network_port " - "from sip_subscriptions " - "where version > -1 and expires > -1 and hostname='%q' " - "and sub_to_user='%q' and sub_to_host='%q' " "and (event='call-info')", mod_sofia_globals.hostname, to_user, to_host); - } + if (!zstr(call_id)) { + if (unseize) { + sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,full_to,full_from,contact,expires,network_ip,network_port " + "from sip_subscriptions where call_id='%q' and hostname='%q' and profile_name='%q' " + "and (event='call-info' or event='line-seize')", + call_id, mod_sofia_globals.hostname, profile->name); + + } else { + sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,full_to,full_from,contact,expires,network_ip,network_port " + "from sip_subscriptions where call_id='%q' and hostname='%q' and profile_name='%q' and event='call-info'", + call_id, mod_sofia_globals.hostname, profile->name); + } + + } else { + + if (unseize) { + sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,full_to,full_from,contact,expires,network_ip,network_port " + "from sip_subscriptions " + "where hostname='%q' and profile_name='%q' " + "and sub_to_user='%q' and sub_to_host='%q' " + "and (event='call-info' or event='line-seize') and (profile_name='%q' or presence_hosts like '%%%q%%')", + mod_sofia_globals.hostname, profile->name, to_user, to_host, profile->name, to_host); + } else { + sql = switch_mprintf("select call_id,expires,sub_to_user,sub_to_host,event,full_to,full_from,contact,expires,network_ip,network_port " + "from sip_subscriptions " + "where hostname='%q' and profile_name='%q' " + "and sub_to_user='%q' and sub_to_host='%q' " "and (event='call-info') and " + "(profile_name='%q' or presence_hosts like '%%%q%%')", + mod_sofia_globals.hostname, profile->name, to_user, to_host, profile->name, to_host); + } + } if (mod_sofia_globals.debug_sla > 1) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "PRES SQL %s\n", sql); } + sh->profile = profile; sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, broadsoft_sla_notify_callback, sh); switch_safe_free(sql); + total = sh->total; sh = NULL; switch_core_destroy_memory_pool(&pool); - if (clear) { - sql = switch_mprintf("delete from sip_dialogs where ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " - "and call_info_state='seized'", to_user, to_host, to_user, to_host); + - - if (mod_sofia_globals.debug_sla > 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CLEAR SQL %s\n", sql); - } - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - } + return total; } void sofia_presence_handle_sip_i_subscribe(int status, char const *phrase, nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, - sofia_dispatch_event_t *de, + sofia_dispatch_event_t *de, tagi_t tags[]) { @@ -2778,7 +3199,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, char *full_agent = NULL; char *sstr; switch_event_t *sevent; - int sub_state; + int sub_state = nua_substate_pending; int sent_reply = 0; sip_contact_t const *contact; const char *ipv6; @@ -2786,6 +3207,8 @@ void sofia_presence_handle_sip_i_subscribe(int status, sofia_nat_parse_t np = { { 0 } }; int found_proto = 0; char to_tag[13] = ""; + char buf[32] = ""; + int subbed = 0; if (!sip) { return; @@ -2794,7 +3217,8 @@ void sofia_presence_handle_sip_i_subscribe(int status, to = sip->sip_to; contact = sip->sip_contact; - if (!(contact_str = sofia_glue_gen_contact_str(profile, sip, de, &np))) { + np.fs_path = 1; + if (!(contact_str = sofia_glue_gen_contact_str(profile, sip, nh, de, &np))) { nua_respond(nh, 481, "INVALID SUBSCRIPTION", TAG_END()); return; } @@ -2804,7 +3228,17 @@ void sofia_presence_handle_sip_i_subscribe(int status, //contact_host = sip->sip_contact->m_url->url_host; contact_user = sip->sip_contact->m_url->url_user; - tl_gets(tags, NUTAG_SUBSTATE_REF(sub_state), TAG_END()); + //tl_gets(tags, NUTAG_SUBSTATE_REF(sub_state), TAG_END()); + + //sip->sip_subscription_state->ss_substate + + if (sip->sip_subscription_state && sip->sip_subscription_state->ss_substate) { + if (switch_stristr("terminated", sip->sip_subscription_state->ss_substate)) { + sub_state = nua_substate_terminated; + } else if (switch_stristr("active", sip->sip_subscription_state->ss_substate)) { + sub_state = nua_substate_active; + } + } event = sip_header_as_string(nh->nh_home, (void *) sip->sip_event); @@ -2835,6 +3269,10 @@ void sofia_presence_handle_sip_i_subscribe(int status, } } + if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DELTA %ld\n", exp_delta); + } + if (!exp_delta) { sub_state = nua_substate_terminated; } @@ -2877,66 +3315,81 @@ void sofia_presence_handle_sip_i_subscribe(int status, proto = alt_proto; } - if ((sub_state == nua_substate_active) && (switch_stristr("dialog", (const char *) event))) { + if ((sub_state != nua_substate_terminated)) { + sql = switch_mprintf("select count(*) from sip_subscriptions where call_id='%q' and hostname='%q' and profile_name='%q'", + call_id, mod_sofia_globals.hostname, profile->name); + sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf)); + + + if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "check subs sql: %s [%s]\n", sql, buf); + } + + switch_safe_free(sql); + + if ((subbed = atoi(buf)) > 0) { + sub_state = nua_substate_active; + } + } + + if (sub_state == nua_substate_active) { sstr = switch_mprintf("active;expires=%ld", exp_delta); sql = switch_mprintf("update sip_subscriptions " - "set expires=%ld " - "where call_id='%q' and event='dialog' and hostname='%q' ", - (long) switch_epoch_time_now(NULL) + exp_delta, - call_id, - mod_sofia_globals.hostname); - + "set expires=%ld,contact='%q' " + "where hostname='%q' and profile_name='%q' and call_id='%q' and profile_name='%q'", + (long) switch_epoch_time_now(NULL) + exp_delta, contact_str, mod_sofia_globals.hostname, profile->name, + call_id, profile->name); if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "re-subscribe with dialog detected, sql: %s\n", sql); + "re-subscribe event %s, sql: %s\n", event, sql); } sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); } else { - if (sofia_test_pflag(profile, PFLAG_MULTIREG)) { - sql = switch_mprintf("delete from sip_subscriptions where call_id='%q' " - "or (proto='%q' and sip_user='%q' and sip_host='%q' " - "and sub_to_user='%q' and sub_to_host='%q' and event='%q' and hostname='%q' " - "and contact='%q')", - call_id, proto, from_user, from_host, to_user, to_host, event, mod_sofia_globals.hostname, contact_str); - - } else { - sql = switch_mprintf("delete from sip_subscriptions where " - "proto='%q' and sip_user='%q' and sip_host='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q' and hostname='%q'", - proto, from_user, from_host, to_user, to_host, event, mod_sofia_globals.hostname); - } - - switch_mutex_lock(profile->ireg_mutex); - switch_assert(sql != NULL); - sofia_glue_actually_execute_sql(profile, sql, NULL); - switch_safe_free(sql); if (sub_state == nua_substate_terminated) { - sstr = switch_mprintf("terminated"); + sql = switch_mprintf("delete from sip_subscriptions where call_id='%q' and profile_name='%q' and hostname='%q'", + call_id, profile->name, mod_sofia_globals.hostname); + + if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "sub del sql: %s\n", sql); + } + + switch_mutex_lock(profile->ireg_mutex); + switch_assert(sql != NULL); + sofia_glue_actually_execute_sql(profile, sql, NULL); + switch_safe_free(sql); + + sstr = switch_mprintf("terminated;reason=noresource"); } else { sip_accept_t *ap = sip->sip_accept; char accept[256] = ""; + + sub_state = nua_substate_active; full_agent = sip_header_as_string(nh->nh_home, (void *) sip->sip_user_agent); while (ap) { switch_snprintf(accept + strlen(accept), sizeof(accept) - strlen(accept), "%s%s ", ap->ac_type, ap->ac_next ? "," : ""); ap = ap->ac_next; } - + sql = switch_mprintf("insert into sip_subscriptions " "(proto,sip_user,sip_host,sub_to_user,sub_to_host,presence_hosts,event,contact,call_id,full_from," - "full_via,expires,user_agent,accept,profile_name,hostname,network_port,network_ip, orig_proto, full_to) " - "values ('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q',%ld,'%q','%q','%q','%q','%d','%q','%q','%q;tag=%q')", - proto, from_user, from_host, to_user, to_host, profile->presence_hosts ? profile->presence_hosts : to_host, + "full_via,expires,user_agent,accept,profile_name,hostname,network_port,network_ip,version,orig_proto, full_to) " + "values ('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q',%ld,'%q','%q','%q','%q','%d','%q',-1,'%q','%q;tag=%q')", + proto, from_user, from_host, to_user, to_host, profile->presence_hosts ? profile->presence_hosts : "", event, contact_str, call_id, full_from, full_via, (long) switch_epoch_time_now(NULL) + exp_delta, full_agent, accept, profile->name, mod_sofia_globals.hostname, np.network_port, np.network_ip, orig_proto, full_to, to_tag); switch_assert(sql != NULL); + if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s SUBSCRIBE %s@%s %s@%s\n%s\n", @@ -3027,19 +3480,21 @@ void sofia_presence_handle_sip_i_subscribe(int status, p++; } +#if 0 nua_notify(nh, SIPTAG_EXPIRES_STR("0"), SIPTAG_SUBSCRIPTION_STATE_STR(sstr), TAG_IF(full_call_info, SIPTAG_CALL_INFO_STR(full_call_info)), TAG_END()); - +#endif if (!strcasecmp(event, "line-seize")) { if (mod_sofia_globals.debug_sla > 1) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CANCEL LINE SEIZE\n"); } - sql = switch_mprintf("delete from sip_dialogs where ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " + sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and profile_name='%q' and " + "((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " "and call_info_state='seized'", - to_user, to_host, to_user, to_host); + mod_sofia_globals.hostname, profile->name, to_user, to_host, to_user, to_host); if (mod_sofia_globals.debug_sla > 1) { @@ -3047,7 +3502,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, } sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - sync_sla(profile, to_user, to_host, SWITCH_FALSE, SWITCH_FALSE); + sync_sla(profile, to_user, to_host, SWITCH_FALSE, SWITCH_FALSE, NULL); } su_free(nh->nh_home, full_call_info); @@ -3071,11 +3526,13 @@ void sofia_presence_handle_sip_i_subscribe(int status, SIPTAG_SUBSCRIPTION_STATE_STR(sstr), SIPTAG_EVENT_STR("line-seize"), TAG_IF(full_call_info, SIPTAG_CALL_INFO_STR(full_call_info)), TAG_END()); + - sql = switch_mprintf("delete from sip_dialogs where ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " - "and call_info_state='seized'", - to_user, to_host, to_user, to_host); + sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and profile_name='%q' and " + "((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " + "and call_info_state='seized' and profile_name='%q'", + mod_sofia_globals.hostname, profile->name, to_user, to_host, to_user, to_host, profile->name); if (mod_sofia_globals.debug_sla > 1) { @@ -3084,20 +3541,21 @@ void sofia_presence_handle_sip_i_subscribe(int status, sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); now = switch_epoch_time_now(NULL); - sql = switch_mprintf("insert into sip_dialogs (sip_from_user,sip_from_host,call_info,call_info_state,hostname,expires,rcd) " - "values ('%q','%q','%q','seized','%q',%ld,%ld)", - to_user, to_host, switch_str_nil(p), mod_sofia_globals.hostname, switch_epoch_time_now(NULL) + exp_delta, (long)now); + sql = switch_mprintf("insert into sip_dialogs (sip_from_user,sip_from_host,call_info,call_info_state,hostname,expires,rcd,profile_name) " + "values ('%q','%q','%q','seized','%q',%ld,%ld,'%q')", + to_user, to_host, switch_str_nil(p), mod_sofia_globals.hostname, + switch_epoch_time_now(NULL) + exp_delta, (long)now, profile->name); if (mod_sofia_globals.debug_sla > 1) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SEIZE SQL %s\n", sql); } sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - sync_sla(profile, to_user, to_host, SWITCH_FALSE, SWITCH_FALSE); + sync_sla(profile, to_user, to_host, SWITCH_FALSE, SWITCH_FALSE, NULL); su_free(nh->nh_home, full_call_info); } } else if (!strcasecmp(event, "call-info")) { - sync_sla(profile, to_user, to_host, SWITCH_FALSE, SWITCH_FALSE); + sync_sla(profile, to_user, to_host, SWITCH_FALSE, SWITCH_FALSE, call_id); } } @@ -3108,9 +3566,11 @@ void sofia_presence_handle_sip_i_subscribe(int status, if (!strcasecmp(event, "message-summary")) { if ((sql = switch_mprintf("select proto,sip_user,'%q',sub_to_user,sub_to_host,event,contact,call_id,full_from," "full_via,expires,user_agent,accept,profile_name,network_ip" - " from sip_subscriptions where version > -1 and " - "expires > -1 and event='message-summary' and sip_user='%q' " - "and (sip_host='%q' or presence_hosts like '%%%q%%')", to_host, to_user, to_host, to_host))) { + " 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))) { sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_sub_reg_callback, profile); switch_safe_free(sql); @@ -3119,66 +3579,81 @@ void sofia_presence_handle_sip_i_subscribe(int status, end: - if (to_user && (strstr(to_user, "ext+") || strstr(to_user, "user+"))) { - char protocol[80]; - char *p; + if (strcasecmp(event, "call-info") && strcasecmp(event, "line-seize")) { - switch_copy_string(protocol, to_user, sizeof(protocol)); - if ((p = strchr(protocol, '+'))) { - *p = '\0'; - } + if (to_user && (strstr(to_user, "ext+") || strstr(to_user, "user+"))) { + char protocol[80]; + char *p; - if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", protocol); - if (!zstr(orig_proto)) { - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "orig_proto", orig_proto); + switch_copy_string(protocol, to_user, sizeof(protocol)); + if ((p = strchr(protocol, '+'))) { + *p = '\0'; } - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name); - switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, to_host); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "rpid", "active"); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "status", "Click To Call"); - switch_event_fire(&sevent); - } - } else if (to_user && (strcasecmp(proto, SOFIA_CHAT_PROTO) != 0)) { - if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", proto); - if (!zstr(orig_proto)) { - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "orig_proto", orig_proto); + if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", protocol); + if (!zstr(orig_proto)) { + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "orig_proto", orig_proto); + } + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, to_host); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "rpid", "active"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "status", "Click To Call"); + switch_event_fire(&sevent); } - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name); - switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host); - switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "to", "%s%s%s@%s", proto, "+", to_user, to_host); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto-specific-event-name", event); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "event_type", "presence"); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); - switch_event_fire(&sevent); + + } else if (to_user && (strcasecmp(proto, SOFIA_CHAT_PROTO) != 0)) { + if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", proto); + if (!zstr(orig_proto)) { + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "orig_proto", orig_proto); + } + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "to", "%s%s%s@%s", proto, "+", to_user, to_host); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto-specific-event-name", event); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); + switch_event_fire(&sevent); - } - } else { - if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { - if (!strcasecmp(event, "dialog")) { - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "probe-type", "dialog"); } + } else { - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name); - switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host); - switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, to_host); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto-specific-event-name", event); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "event_type", "presence"); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); - switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "sub-call-id", call_id); - switch_event_fire(&sevent); + if (!strcasecmp(event, "dialog")) { + if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "probe-type", "dialog"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, to_host); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto-specific-event-name", event); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "sub-call-id", call_id); + switch_event_fire(&sevent); + } + } else if (!strcasecmp(event, "presence")) { + if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "presence-source", "subscribe"); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host); + switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, to_host); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "rpid", "unknown"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "status", "Registered"); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "sub-call-id", call_id); + switch_event_fire(&sevent); + } + } } } - - if (event) { su_free(nh->nh_home, event); } @@ -3290,10 +3765,19 @@ void sofia_presence_handle_sip_r_subscribe(int status, static int sofia_presence_send_sql(void *pArg, int argc, char **argv, char **columnNames) { - sofia_profile_t *profile = (sofia_profile_t *) pArg; - - send_presence_notify(profile, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], NULL); + struct pres_sql_cb *cb = (struct pres_sql_cb *) pArg; + + if (mod_sofia_globals.debug_presence > 0) { + int i; + for(i = 0; i < argc; i++) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "arg %d[%s] = [%s]\n", i, columnNames[i], argv[i]); + } + } + + send_presence_notify(cb->profile, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], NULL); + cb->ttl++; + return 0; } @@ -3303,7 +3787,8 @@ uint32_t sofia_presence_contact_count(sofia_profile_t *profile, const char *cont char buf[32] = ""; char *sql; - sql = switch_mprintf("select count(*) from sip_subscriptions where profile_name='%q' and contact='%q'", profile->name, contact_str); + sql = switch_mprintf("select count(*) from sip_subscriptions where hostname='%q' and profile_name='%q' and contact='%q'", + mod_sofia_globals.hostname, profile->name, contact_str); sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf)); switch_safe_free(sql); @@ -3311,7 +3796,7 @@ uint32_t sofia_presence_contact_count(sofia_profile_t *profile, const char *cont } void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, - sofia_dispatch_event_t *de, + sofia_dispatch_event_t *de, tagi_t tags[]) { @@ -3325,9 +3810,10 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n char expstr[30] = ""; long exp = 0, exp_delta = 3600; char *pd_dup = NULL; - int count = 1, sub_count = 0; + int count = 1, sub_count = 1; char *contact_str; int open = 1; + sofia_nat_parse_t np = { { 0 } }; if (!sip) { return; @@ -3336,7 +3822,8 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n from = sip->sip_from; payload = sip->sip_payload; - contact_str = sofia_glue_gen_contact_str(profile, sip, de, NULL); + np.fs_path = 1; + contact_str = sofia_glue_gen_contact_str(profile, sip, nh, de, &np); if (from) { from_user = (char *) from->a_url->url_user; @@ -3386,20 +3873,10 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n } } - if (!(open = !strcasecmp(open_closed, "open"))) { - sql = switch_mprintf("update sip_subscriptions set version = -1 where contact='%q'", contact_str); - } else { - sql = switch_mprintf("update sip_subscriptions set version = 0 where contact='%q'", contact_str); - } - - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - - if (sofia_test_pflag(profile, PFLAG_MULTIREG) && !open) { count = sofia_reg_reg_count(profile, from_user, from_host); + sub_count = sofia_presence_contact_count(profile, contact_str); } - - sub_count = sofia_presence_contact_count(profile, contact_str); /* if (count > 1) let's not and say we did or all the clients who subscribe to their own presence will think they selves is offline */ @@ -3422,12 +3899,19 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n } } else if (contact_str) { + struct pres_sql_cb cb = {profile, 0}; + sql = switch_mprintf("select full_to, full_from, contact, expires, call_id, event, network_ip, network_port, " "'application/pidf+xml' as ct,'%q' as pt " - " from sip_subscriptions where sub_to_user='%q' and sub_to_host='%q' and event='%q'" - "and contact = '%q' ", switch_str_nil(payload->pl_data), from_user, from_host, event_type); + " from sip_subscriptions where " + "hostname='%q' and profile_name='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q'" + "and contact = '%q' ", - sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_send_sql, profile); + switch_str_nil(payload->pl_data), + mod_sofia_globals.hostname, profile->name, + from_user, from_host, event_type); + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_send_sql, &cb); switch_safe_free(sql); } @@ -3484,7 +3968,7 @@ void sofia_presence_set_hash_key(char *hash_key, int32_t len, sip_t const *sip) void sofia_presence_handle_sip_i_message(int status, char const *phrase, nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, - sofia_dispatch_event_t *de, + sofia_dispatch_event_t *de, tagi_t tags[]) { if (sip) { @@ -3616,7 +4100,7 @@ void sofia_presence_handle_sip_i_message(int status, end: - nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END()); + nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END()); } @@ -3655,17 +4139,43 @@ void sofia_presence_check_subscriptions(sofia_profile_t *profile, time_t now) char *sql; if (now) { - sql = switch_mprintf("select full_to, full_from, contact, expires, call_id, event, network_ip, network_port, " - "NULL as ct, NULL as pt " - " from sip_subscriptions where (expires = -1 or (expires > 0 and expires <= %ld)) and hostname='%q'", - (long) now, mod_sofia_globals.hostname); + struct pres_sql_cb cb = {profile, 0}; - sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_send_sql, profile); + if (profile->pres_type != PRES_TYPE_FULL) { + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "check_subs: %s is passive, skipping\n", (char *) profile->name); + } + return; + } + + sql = switch_mprintf("update sip_subscriptions set version=version+1 where " + "((expires > 0 and expires <= %ld)) and profile_name='%q' and hostname='%q'", + (long) now, profile->name, mod_sofia_globals.hostname); + + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); switch_safe_free(sql); - sql = switch_mprintf("delete from sip_subscriptions where (expires = -1 or (expires > 0 and expires <= %ld)) and hostname='%q'", - (long) now, mod_sofia_globals.hostname); - sofia_glue_actually_execute_sql(profile, sql, profile->ireg_mutex); + sql = switch_mprintf("select full_to, full_from, contact, -1, call_id, event, network_ip, network_port, " + "NULL as ct, NULL as pt " + " from sip_subscriptions where ((expires > 0 and expires <= %ld)) and profile_name='%q' and hostname='%q'", + (long) now, profile->name, mod_sofia_globals.hostname); + + sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_send_sql, &cb); + switch_safe_free(sql); + + if (cb.ttl) { + sql = switch_mprintf("delete from sip_subscriptions where ((expires > 0 and expires <= %ld)) " + "and profile_name='%q' and hostname='%q'", + (long) now, profile->name, mod_sofia_globals.hostname); + + if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "sub del sql: %s\n", sql); + } + + sofia_glue_actually_execute_sql(profile, sql, profile->ireg_mutex); + 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 57807950e6..df094f093b 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -278,6 +278,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) { sofia_gateway_t *check, *gateway_ptr, *last = NULL; switch_event_t *event; + int delta = 0; switch_mutex_lock(profile->gw_mutex); for (gateway_ptr = profile->gateways; gateway_ptr; gateway_ptr = gateway_ptr->next) { @@ -353,8 +354,9 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) nua_options(nh, TAG_IF(gateway_ptr->register_sticky_proxy, NUTAG_PROXY(gateway_ptr->register_sticky_proxy)), TAG_IF(user_via, SIPTAG_VIA_STR(user_via)), - SIPTAG_TO_STR(gateway_ptr->register_from), - SIPTAG_CONTACT_STR(gateway_ptr->register_contact), SIPTAG_FROM_STR(gateway_ptr->register_from), TAG_END()); + SIPTAG_TO_STR(gateway_ptr->options_to_uri), SIPTAG_FROM_STR(gateway_ptr->options_from_uri), + TAG_IF(gateway_ptr->options_user_agent, SIPTAG_USER_AGENT_STR(gateway_ptr->options_user_agent)), + TAG_END()); switch_safe_free(user_via); user_via = NULL; @@ -373,12 +375,18 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) gateway_ptr->failures = 0; - if (gateway_ptr->freq > 60) { - gateway_ptr->expires = now + (gateway_ptr->freq - 15); + if (gateway_ptr->freq > 30) { + delta = (gateway_ptr->freq - 15); } else { - gateway_ptr->expires = now + (gateway_ptr->freq - 2); + delta = (gateway_ptr->freq / 2); } + if (delta < 1) { + delta = 1; + } + + gateway_ptr->expires = now + delta; + gateway_ptr->state = REG_STATE_REGED; gateway_ptr->status = SOFIA_GATEWAY_UP; break; @@ -386,9 +394,9 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) case REG_STATE_UNREGISTER: sofia_reg_kill_reg(gateway_ptr); gateway_ptr->state = REG_STATE_NOREG; + gateway_ptr->status = SOFIA_GATEWAY_DOWN; break; case REG_STATE_UNREGED: - gateway_ptr->status = SOFIA_GATEWAY_DOWN; gateway_ptr->retry = 0; if (!gateway_ptr->nh) { @@ -419,6 +427,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) NUTAG_OUTBOUND("no-options-keepalive"), NUTAG_OUTBOUND("no-validate"), NUTAG_KEEPALIVE(0), TAG_NULL()); gateway_ptr->retry = now + gateway_ptr->retry_seconds; } else { + gateway_ptr->status = SOFIA_GATEWAY_DOWN; nua_unregister(gateway_ptr->nh, NUTAG_URL(gateway_ptr->register_url), TAG_IF(user_via, SIPTAG_VIA_STR(user_via)), @@ -564,19 +573,6 @@ int sofia_reg_nat_callback(void *pArg, int argc, char **argv, char **columnNames } -int sofia_sub_del_callback(void *pArg, int argc, char **argv, char **columnNames) -{ - sofia_profile_t *profile = (sofia_profile_t *) pArg; - nua_handle_t *nh; - - if (argv[0]) { - if ((nh = nua_handle_by_call_id(profile->nua, argv[0]))) { - nua_handle_destroy(nh); - } - } - return 0; -} - void sofia_reg_send_reboot(sofia_profile_t *profile, const char *user, const char *host, const char *contact, const char *user_agent, const char *network_ip) { @@ -752,18 +748,6 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) sofia_glue_actually_execute_sql(profile, sql, NULL); - if (now) { - switch_snprintf(sql, sizeof(sql), - "select call_id from sip_subscriptions where (expires = -1 or (expires > 0 and expires <= %ld)) and hostname='%s'", (long) now, - mod_sofia_globals.hostname); - } else { - switch_snprintfv(sql, sizeof(sql), "select sub_to_user,sub_to_host,call_id from sip_subscriptions where expires >= -1 and hostname='%q'", - mod_sofia_globals.hostname); - } - - sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_sub_del_callback, profile); - - sofia_presence_check_subscriptions(profile, now); if (now) { @@ -871,10 +855,6 @@ void sofia_reg_check_sync(sofia_profile_t *profile) switch_snprintfv(sql, sizeof(sql), "delete from sip_authentication where expires > 0 and hostname='%q'", mod_sofia_globals.hostname); sofia_glue_actually_execute_sql(profile, sql, NULL); - switch_snprintfv(sql, sizeof(sql), "select sub_to_user,sub_to_host,call_id from sip_subscriptions where expires >= -1 and hostname='%q'", - mod_sofia_globals.hostname); - sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_sub_del_callback, profile); - switch_snprintfv(sql, sizeof(sql), "delete from sip_subscriptions where expires >= -1 and hostname='%q'", mod_sofia_globals.hostname); sofia_glue_actually_execute_sql(profile, sql, NULL); @@ -1056,14 +1036,11 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_event_t *auth_params = NULL; int r = 0; long reg_count = 0; - int delete_subs; const char *agent = "unknown"; const char *pres_on_reg = NULL; int send_pres = 0; int is_tls = 0, is_tcp = 0; - delete_subs = sofia_test_pflag(profile, PFLAG_DEL_SUBS_ON_REG); - if (v_event && *v_event) pres_on_reg = switch_event_get_header(*v_event, "send-presence-on-register"); if (!(send_pres = switch_true(pres_on_reg))) { @@ -1114,10 +1091,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_goto_int(r, 1, end); } - if (!reg_host) { + if (zstr(reg_host)) { reg_host = to_host; } - if (!sub_host) { + if (zstr(sub_host)) { sub_host = to_host; } @@ -1502,18 +1479,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand username = switch_event_get_header(auth_params, "sip_auth_username"); realm = switch_event_get_header(auth_params, "sip_auth_realm"); } - if (auth_res != AUTH_RENEWED) { + if (auth_res != AUTH_RENEWED || !multi_reg) { if (multi_reg) { - - if (delete_subs) { - if (reg_count == 1) { - sql = switch_mprintf("update sip_subscriptions set expires=%ld where sip_user='%q' and sip_host='%q' and contact='%q'", - (long) switch_epoch_time_now(NULL), to_user, sub_host, contact_str); - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - } - } - - if (multi_reg_contact) { sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q' and contact='%q'", to_user, reg_host, contact_str); @@ -1521,10 +1488,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand sql = switch_mprintf("delete from sip_registrations where call_id='%q'", call_id); } } else { - if (delete_subs) { - sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q'", to_user, sub_host); - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - } sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, reg_host); } switch_mutex_lock(profile->ireg_mutex); @@ -1557,14 +1520,19 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand sql = switch_mprintf("insert into sip_registrations " "(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires," "user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm," - "mwi_user,mwi_host, orig_server_host, orig_hostname) " - "values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q')", - call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : reg_host, + "mwi_user,mwi_host, orig_server_host, orig_hostname, sub_host) " + "values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q','%q')", + call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : "", contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime + 60, agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm, - mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname); + mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname, sub_host); } else { - sql = switch_mprintf("update sip_registrations set expires = %ld where sip_user='%q' and sip_host='%q' and contact='%q'", (long) switch_epoch_time_now(NULL) + (long) exptime + 60, to_user, reg_host, contact_str); + sql = switch_mprintf("update sip_registrations set " + "sub_host='%q', network_ip='%q',network_port='%q'," + "expires = %ld where sip_user='%q' and sip_host='%q' and contact='%q'", + sub_host, network_ip, network_port_c, + (long) switch_epoch_time_now(NULL) + (long) exptime + 60, + to_user, reg_host, contact_str); } if (sql) { @@ -1586,7 +1554,7 @@ 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, "profile-name", profile->name); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-user", to_user); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-host", reg_host); - switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "presence-hosts", profile->presence_hosts ? profile->presence_hosts : reg_host); + switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "presence-hosts", profile->presence_hosts ? profile->presence_hosts : "n/a"); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "contact", contact_str); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "call-id", call_id); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "rpid", rpid); @@ -1609,38 +1577,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand "Register:\nFrom: [%s@%s]\nContact: [%s]\nExpires: [%ld]\n", to_user, reg_host, contact_str, (long) exptime); } -#if 0 - if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", - (sip && sip->sip_user_agent) ? sip->sip_user_agent->g_string : "unknown"); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, sub_host); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Registered"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); - switch_event_fire(&event); - } - - - if (sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER) || - (reg_count == 1 && sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER))) { - - if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "sip"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, sub_host); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, sub_host); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Registered"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_subtype", "probe"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); - switch_event_fire(&event); - } - } -#endif - - } else { int send = 1; @@ -1662,18 +1598,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); switch_event_fire(&event); } -#if 0 - if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "sip"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s+%s@%s", SOFIA_CHAT_PROTO, to_user, sub_host); - - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "unavailable"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); - switch_event_fire(&event); - } -#endif + if (multi_reg) { char *icontact, *p; @@ -1684,17 +1609,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand if ((p = strchr(icontact + 4, ':'))) { *p = '\0'; } - if (delete_subs) { - if (multi_reg_contact) { - sql = - switch_mprintf("update sip_subscriptions set expires=%ld where sip_user='%q' and sip_host='%q' and contact='%q'", - (long) switch_epoch_time_now(NULL), to_user, sub_host, contact_str); - } else { - sql = switch_mprintf("update sip_subscriptions set expires=%ld where call_id='%q'", (long) switch_epoch_time_now(NULL), call_id); - } - - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - } if (multi_reg_contact) { sql = @@ -1707,12 +1621,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_safe_free(icontact); } else { - if (delete_subs) { - if ((sql = switch_mprintf("update sip_subscriptions set expires=%ld where sip_user='%q' and sip_host='%q'", - (long) switch_epoch_time_now(NULL), to_user, sub_host))) { - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); - } - } + if ((sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, reg_host))) { sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); } @@ -1742,7 +1651,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand (reg_count == 1 && sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER))) { 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-Pofile", profile->name); + switch_event_add_header_string(s_mwi_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name); switch_event_add_header_string(s_mwi_event, SWITCH_STACK_BOTTOM, "VM-Call-ID", call_id); } } @@ -2129,7 +2038,7 @@ void sofia_reg_handle_sip_r_challenge(int status, if (!var_gateway && realm) { char rb[512] = ""; char *p = (char *) realm; - while ((*p == '"')) { + while (*p == '"') { p++; } switch_set_string(rb, p); 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 e873114ed4..e90d174966 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 @@ -428,7 +428,7 @@ SWITCH_STANDARD_APP(socket_function) return; } - if ((port_name = strchr(host, ':'))) { + if ((port_name = strrchr(host, ':'))) { *port_name++ = '\0'; port = (switch_port_t) atoi(port_name); } @@ -440,12 +440,12 @@ SWITCH_STANDARD_APP(socket_function) switch_channel_set_variable(channel, "socket_host", host); - if (switch_sockaddr_info_get(&sa, host, AF_INET, port, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + if (switch_sockaddr_info_get(&sa, host, SWITCH_UNSPEC, port, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket Error!\n"); return; } - if (switch_socket_create(&new_sock, AF_INET, SOCK_STREAM, SWITCH_PROTO_TCP, switch_core_session_get_pool(session)) + if (switch_socket_create(&new_sock, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket Error!\n"); return; @@ -2468,6 +2468,7 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj) switch_channel_t *channel = NULL; switch_event_t *revent = NULL; const char *var; + int locked = 1; switch_mutex_lock(globals.listener_mutex); prefs.threads++; @@ -2477,6 +2478,7 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj) if ((session = listener->session)) { if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) { + locked = 0; goto done; } } @@ -2655,7 +2657,9 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj) if (listener->session) { switch_channel_clear_flag(switch_core_session_get_channel(listener->session), CF_CONTROLLED); switch_clear_flag_locked(listener, LFLAG_SESSION); - switch_core_session_rwunlock(listener->session); + if (locked) { + switch_core_session_rwunlock(listener->session); + } } else if (listener->pool) { switch_memory_pool_t *pool = listener->pool; switch_core_destroy_memory_pool(&pool); @@ -2762,7 +2766,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime) config(); while (!prefs.done) { - rv = switch_sockaddr_info_get(&sa, prefs.ip, SWITCH_INET, prefs.port, 0, pool); + rv = switch_sockaddr_info_get(&sa, prefs.ip, SWITCH_UNSPEC, prefs.port, 0, pool); if (rv) goto fail; rv = switch_socket_create(&listen_list.sock, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, pool); diff --git a/src/mod/event_handlers/mod_event_zmq/mod_event_zmq.cpp b/src/mod/event_handlers/mod_event_zmq/mod_event_zmq.cpp index c8975ebe5d..b85acbf0e0 100644 --- a/src/mod/event_handlers/mod_event_zmq/mod_event_zmq.cpp +++ b/src/mod/event_handlers/mod_event_zmq/mod_event_zmq.cpp @@ -4,24 +4,17 @@ #include #include +#include "mod_event_zmq.h" + namespace mod_event_zmq { -SWITCH_MODULE_LOAD_FUNCTION(load); -SWITCH_MODULE_SHUTDOWN_FUNCTION(shutdown); -SWITCH_MODULE_RUNTIME_FUNCTION(runtime); - -extern "C" { -SWITCH_MODULE_DEFINITION(mod_event_zmq, load, shutdown, runtime); -}; - // Handles publishing events out to clients class ZmqEventPublisher { public: - ZmqEventPublisher() : - context(1), - event_publisher(context, ZMQ_PUB) + ZmqEventPublisher(zmq::context_t &context) : + _publisher(context, ZMQ_PUB) { - event_publisher.bind("tcp://*:5556"); + _publisher.bind("tcp://*:5556"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Listening for clients\n"); } @@ -35,7 +28,7 @@ public: zmq::message_t msg(pjson, strlen(pjson), free_message_data, NULL); // Send the message - event_publisher.send(msg); + _publisher.send(msg); } private: @@ -43,18 +36,34 @@ private: free (data); } - zmq::context_t context; - zmq::socket_t event_publisher; + zmq::socket_t _publisher; +}; + +class char_msg : public zmq::message_t { +public: + char_msg() : zmq::message_t(sizeof(char)) { } + char_msg(char data) : zmq::message_t(sizeof(char)) { + *char_data() = data; + } + + char* char_data() { + return static_cast(this->data()); + } }; // Handles global inititalization and teardown of the module class ZmqModule { public: ZmqModule(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) : - _running(false) { + _context(1), _term_rep(_context, ZMQ_REP), _term_req(_context, ZMQ_REQ), _publisher(_context) { + + // Set up the term messaging connection + _term_rep.bind(TERM_URI); + _term_req.connect(TERM_URI); + // Subscribe to all switch events of any subclass // Store a pointer to ourself in the user data - if (switch_event_bind_removable(modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, (void*)this, &_node) + if (switch_event_bind_removable(modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, static_cast(&_publisher), &_node) != SWITCH_STATUS_SUCCESS) { throw std::runtime_error("Couldn't bind to switch events."); } @@ -67,20 +76,45 @@ public: } void Listen() { - if(_running) - return; + // All we do is sit here and block the run loop thread so it doesn't return + // it seems that if you want to keep your module running you can't return from the run loop + + char_msg msg; + while(true) { + // Listen for term message + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Entered run loop, waiting for term message\n"); + _term_rep.recv(&msg); + if(*msg.char_data() == MODULE_TERM_REQ_MESSAGE) { + // Ack term message + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Got term message, sending ack and leaving run loop\n"); - _publisher.reset(new ZmqEventPublisher()); - _running = true; + *msg.char_data() = MODULE_TERM_ACK_MESSAGE; + _term_rep.send(msg); - while(_running) { - switch_yield(100000); + break; + } + } + } + + void Shutdown() { + // Send term message + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Shutdown requested, sending term message to runloop\n"); + char_msg msg(MODULE_TERM_REQ_MESSAGE); + _term_req.send(msg); + + while(true) { + // Wait for the term ack message + _term_req.recv(&msg); + if(*msg.char_data() == MODULE_TERM_ACK_MESSAGE) { + // Continue shutdown + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Got term ack message, continuing shutdown\n"); + break; + } } } ~ZmqModule() { // Unsubscribe from the switch events - _running = false; switch_event_unbind(&_node); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Module shut down\n"); } @@ -89,9 +123,8 @@ private: // Dispatches events to the publisher static void event_handler(switch_event_t *event) { try { - ZmqModule *module = (ZmqModule*)event->bind_user_data; - if(module->_publisher.get()) - module->_publisher->PublishEvent(event); + ZmqEventPublisher *publisher = static_cast(event->bind_user_data); + publisher->PublishEvent(event); } catch(std::exception ex) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Error publishing event via 0MQ: %s\n", ex.what()); } catch(...) { // Exceptions must not propogate to C caller @@ -100,8 +133,12 @@ private: } switch_event_node_t *_node; - std::auto_ptr _publisher; - bool _running; + + zmq::context_t _context; + zmq::socket_t _term_rep; + zmq::socket_t _term_req; + + ZmqEventPublisher _publisher; }; //*****************************// @@ -140,10 +177,15 @@ SWITCH_MODULE_RUNTIME_FUNCTION(runtime) { SWITCH_MODULE_SHUTDOWN_FUNCTION(shutdown) { try { + // Tell the module to shutdown + module->Shutdown(); + // Free the module object module.reset(); + } catch(std::exception &ex) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error shutting down module: %s\n", ex.what()); } catch(...) { // Exceptions must not propogate to C caller - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error shutting down module\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown error shutting down module\n"); } } diff --git a/src/mod/event_handlers/mod_event_zmq/mod_event_zmq.h b/src/mod/event_handlers/mod_event_zmq/mod_event_zmq.h new file mode 100644 index 0000000000..a60c720d74 --- /dev/null +++ b/src/mod/event_handlers/mod_event_zmq/mod_event_zmq.h @@ -0,0 +1,20 @@ +#ifndef MOD_EVENT_ZMQ_H +#define MOD_EVENT_ZMQ_H + +namespace mod_event_zmq { +static const char MODULE_TERM_REQ_MESSAGE = 1; +static const char MODULE_TERM_ACK_MESSAGE = 2; + +static const char *TERM_URI = "inproc://mod_event_zmq_term"; + +SWITCH_MODULE_LOAD_FUNCTION(load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(runtime); + +extern "C" { +SWITCH_MODULE_DEFINITION(mod_event_zmq, load, shutdown, runtime); +}; + +} + +#endif // MOD_EVENT_ZMQ_H diff --git a/src/mod/formats/mod_shout/Makefile b/src/mod/formats/mod_shout/Makefile index d35d75a630..f059677e7e 100644 --- a/src/mod/formats/mod_shout/Makefile +++ b/src/mod/formats/mod_shout/Makefile @@ -49,7 +49,7 @@ $(LAMELA): $(LAME_BUILDDIR)/Makefile $(SHOUT_DIR): $(GETLIB) $(SHOUT).tar.gz - patch -p0 -i hack_out_ogg.diff + patch -p 6 -d ../../../../libs/libshout-2.2.2 < hack_out_ogg.diff $(SHOUT_BUILDDIR)/Makefile: $(SHOUT_DIR) mkdir -p $(SHOUT_BUILDDIR) diff --git a/src/mod/formats/mod_vlc/Makefile b/src/mod/formats/mod_vlc/Makefile new file mode 100644 index 0000000000..a41d9b3109 --- /dev/null +++ b/src/mod/formats/mod_vlc/Makefile @@ -0,0 +1,4 @@ +BASE=../../../.. +include $(BASE)/build/modmake.rules + +LOCAL_LDFLAGS= -lvlc diff --git a/src/mod/formats/mod_vlc/README b/src/mod/formats/mod_vlc/README new file mode 100644 index 0000000000..4ffce5d174 --- /dev/null +++ b/src/mod/formats/mod_vlc/README @@ -0,0 +1,26 @@ +You HAVE to have libvlc version 1.2 or later for mod_vlc to work. Both for the reason that +libvlc version 1.2 is LGPL and because there are new api's in 1.2 that are required. + +Building and usage: + +I used git://git.videolan.org/vlc.git to get the latest version of libvlc. + +On debian I had to install: +sudo apt-get install libavcodec-dev libavutil-dev libavformat-dev liba52-0.7.4-dev + +My configure line for libvlc was: +./configure --prefix=/usr/ --disable-vlc --disable-lua --disable-mad --disable-swscale --disable-postproc --disable-xcb --disable-alsa + +Debian unstable now has VLC 2.0 packaged. I am now testing with the packaged version of the library. + +The dialplan syntax I use are one of the following: + + + + +Development: + +If you are having troubles, first change the value of vlc_args in mod_vlc.c. + +The documentation for the libvlc library is located at: +http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html \ No newline at end of file diff --git a/src/mod/formats/mod_vlc/TODO b/src/mod/formats/mod_vlc/TODO new file mode 100644 index 0000000000..ea3aacd33a --- /dev/null +++ b/src/mod/formats/mod_vlc/TODO @@ -0,0 +1,14 @@ +Following list not in priority order. + +1. Determine if a new instance is needed for each independant inbound stream, or if a global instance can handle all inbound and outbound streams +2. Look into libvlc imem and determine if it is possible to stream parts of a call at a time, or if imem requires all of the buffer to be loaded. + a. Add and confirm stream over network functionality + b. Add and confirm stream to file + c. Confirm transcode works to mp3, wav, aac, etc. +3. Test multiple concurrent listeners to the same stream. + a. Look into have a single libvlc thread stream the file and write to the audio buffer, and multiple readers + b. Test multiple input streams simultaniously + c. Load test multiple requests(both multiple to the same stream, and multiple unique streams) to look for issues +4. Enable proper seeking support +5. Add video support +6. Confirm streaming from file works on differnt sample rates. 8k, 16k, etc. diff --git a/src/mod/formats/mod_vlc/mod_vlc.c b/src/mod/formats/mod_vlc/mod_vlc.c new file mode 100644 index 0000000000..fdcb64ed8d --- /dev/null +++ b/src/mod/formats/mod_vlc/mod_vlc.c @@ -0,0 +1,222 @@ +/* + * 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. + * + * Contributor(s): + * + * William King william.king@quentustech.com + * + * mod_vlc.c -- VLC streaming module + * + * Examples: + * + * File: vlc:///path/to/file + * Stream: http://path.to.file.com:port/file.pls + * Stream: vlc://ftp://path.to.file.com:port/file.mp3 + * + * Notes: + * + * Requires at least libvlc version 1.2 + * + */ +#include +#include +#include + +#define VLC_BUFFER_SIZE 4096 + +static char *vlc_file_supported_formats[SWITCH_MAX_CODECS] = { 0 }; + +/* Change valud to -vvv for vlc related debug. Be careful since vlc is at least as verbose as FS about logging */ +const char *vlc_args = ""; + +libvlc_instance_t *inst; + +struct vlc_file_context { + libvlc_media_player_t *mp; + libvlc_media_t *m; + switch_file_handle_t fh; + switch_memory_pool_t *pool; + switch_buffer_t *audio_buffer; + switch_mutex_t *audio_mutex; + char *path; + int samples; + int playing; + int err; +}; + +typedef struct vlc_file_context vlc_file_context_t; + +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_vlc_shutdown); +SWITCH_MODULE_LOAD_FUNCTION(mod_vlc_load); +SWITCH_MODULE_DEFINITION(mod_vlc, mod_vlc_load, mod_vlc_shutdown, NULL); + +void vlc_auto_play_callback(void *data, const void *samples, unsigned count, int64_t pts) { + vlc_file_context_t *context = (vlc_file_context_t *) data; + + switch_mutex_lock(context->audio_mutex); + if (context->audio_buffer) { + if (!switch_buffer_write(context->audio_buffer, samples, count * 2)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Buffer error\n"); + } + } + switch_mutex_unlock(context->audio_mutex); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "VLC callback for %s %d \n", context->path, count); +} + +static switch_status_t vlc_file_open(switch_file_handle_t *handle, const char *path) +{ + vlc_file_context_t *context; + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "VLC open %s\n", path); + + context = switch_core_alloc(handle->memory_pool, sizeof(*context)); + context->pool = handle->memory_pool; + + context->path = switch_core_strdup(context->pool, path); + switch_buffer_create_dynamic(&(context->audio_buffer), VLC_BUFFER_SIZE, VLC_BUFFER_SIZE * 2, 0); + + /* Determine if this is a url or a path */ + /* TODO: Change this so that it tries local files first, and then if it fails try location. */ + if(! strncmp(context->path, "http", 4)){ + context->m = libvlc_media_new_location(inst, context->path); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "VLC Path is http %s\n", context->path); + } else if (! strncmp(context->path, "mms", 3)){ + context->m = libvlc_media_new_path(inst, context->path); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "VLC Path is mms %s\n", context->path); + } else if (! strncmp(context->path, "/", 1)){ + context->m = libvlc_media_new_path(inst, context->path); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "VLC Path is file %s\n", context->path); + } else { + context->m = libvlc_media_new_location(inst, context->path); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "VLC Path is unknown type %s\n", context->path); + } + + context->playing = 0; + context->err = 0; + + context->mp = libvlc_media_player_new_from_media(context->m); + + if ( !handle->samplerate) + handle->samplerate = 16000; + libvlc_audio_set_format(context->mp, "S16N", handle->samplerate, 1); + + libvlc_audio_set_callbacks(context->mp, vlc_auto_play_callback, NULL,NULL,NULL,NULL, (void *) context); + + switch_mutex_init(&context->audio_mutex, SWITCH_MUTEX_NESTED, context->pool); + + handle->private_info = context; + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t vlc_file_read(switch_file_handle_t *handle, void *data, size_t *len) +{ + vlc_file_context_t *context = handle->private_info; + size_t bytes = *len * sizeof(int16_t); + libvlc_state_t status; + + if (!context) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VLC read handle context is NULL\n"); + return SWITCH_STATUS_GENERR; + } + + if (context->err) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VLC error\n"); + return SWITCH_STATUS_GENERR; + } + + if(! context->playing ) { + context->playing = 1; + libvlc_media_player_play(context->mp); + } + + status = libvlc_media_get_state(context->m); + if (status == 6 || status == 7) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "VLC media state: %d\n", (int) status); + return SWITCH_STATUS_GENERR; + } + + switch_mutex_lock(context->audio_mutex); + switch_buffer_read(context->audio_buffer, data, bytes); + switch_mutex_unlock(context->audio_mutex); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t vlc_file_close(switch_file_handle_t *handle) +{ + vlc_file_context_t *context = handle->private_info; + + libvlc_media_player_stop(context->mp); + libvlc_media_release(context->m); + + return SWITCH_STATUS_SUCCESS; +} + +/* Macro expands to: switch_status_t mod_vlc_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */ +SWITCH_MODULE_LOAD_FUNCTION(mod_vlc_load) +{ + switch_file_interface_t *file_interface; + + /* connect my internal structure to the blank pointer passed to me */ + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + vlc_file_supported_formats[0] = "vlc"; + + file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE); + file_interface->interface_name = modname; + file_interface->extens = vlc_file_supported_formats; + file_interface->file_open = vlc_file_open; + file_interface->file_close = vlc_file_close; + file_interface->file_read = vlc_file_read; + + /* load the vlc engine. */ + inst = libvlc_new(1, &vlc_args); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Initialized VLC instance\n"); + + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; +} + +/* + Called when the system shuts down + Macro expands to: switch_status_t mod_vlc_shutdown() */ +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_vlc_shutdown) +{ + libvlc_release(inst); + 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/languages/mod_lua/freeswitch.i b/src/mod/languages/mod_lua/freeswitch.i index ae2b468c77..a615fcd742 100644 --- a/src/mod/languages/mod_lua/freeswitch.i +++ b/src/mod/languages/mod_lua/freeswitch.i @@ -59,7 +59,7 @@ class Session : public CoreSession { Session(char *uuid, CoreSession *a_leg = NULL); Session(switch_core_session_t *session); ~Session(); - virtual void destroy(void); + virtual void destroy(const char *err = NULL); virtual bool begin_allow_threads(); virtual bool end_allow_threads(); diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp index 0b0a17a225..96897a24c9 100644 --- a/src/mod/languages/mod_lua/freeswitch_lua.cpp +++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp @@ -27,7 +27,7 @@ Session::Session(switch_core_session_t *new_session):CoreSession(new_session) static switch_status_t lua_hanguphook(switch_core_session_t *session_hungup); -void Session::destroy(void) +void Session::destroy(const char *err) { if (!allocated) { @@ -48,6 +48,13 @@ void Session::destroy(void) switch_safe_free(cb_arg); CoreSession::destroy(); + + + if (!zstr(err)) { + lua_pushstring(L, err); + lua_error(L); + } + } @@ -140,7 +147,23 @@ void Session::do_hangup_hook() arg_count++; } - docall(L, arg_count, 1, 1); + docall(L, arg_count, 0, 1); + + const char *err = lua_tostring(L, -1); + + switch_channel_set_variable(channel, "lua_hangup_hook_return_val", err); + + if (!zstr(err)) { + + if (!strcasecmp(err, "exit") || !strcasecmp(err, "die")) { + lua_error(L); + } else { + lua_pop(L, 1); + } + } else { + lua_pop(L, 1); + } + if (channel) { switch_channel_set_private(channel, "CoreSession", NULL); @@ -296,7 +319,7 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp arg_count++; } - docall(L, arg_count, 1, 1); + docall(L, arg_count, 0, 1); ret = lua_tostring(L, -1); lua_pop(L, 1); @@ -362,6 +385,7 @@ bool Dbh::test_reactive(char *test_sql, char *drop_sql, char *reactive_sql) int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv) { SWIGLUA_FN *lua_fun = (SWIGLUA_FN *)pArg; + int ret = 0; lua_pushvalue(lua_fun->L, lua_fun->idx); /* get the lua callback function onto the stack */ @@ -373,13 +397,13 @@ int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv) lua_settable(lua_fun->L, -3); } - docall(lua_fun->L, 1, 1, 1); /* 1 in, 1 out */ + docall(lua_fun->L, 1, 0, 1); + ret = lua_tonumber(lua_fun->L, -1); + lua_pop(lua_fun->L, 1); - if (lua_isnumber(lua_fun->L, -1)) { - if (lua_tonumber(lua_fun->L, -1) != 0) { - return 1; - } - } + if (ret != 0) { + return 1; + } return 0; /* 0 to continue with next row */ } diff --git a/src/mod/languages/mod_lua/freeswitch_lua.h b/src/mod/languages/mod_lua/freeswitch_lua.h index 6411d69697..36c0afae5c 100644 --- a/src/mod/languages/mod_lua/freeswitch_lua.h +++ b/src/mod/languages/mod_lua/freeswitch_lua.h @@ -31,7 +31,7 @@ namespace LUA { Session(char *uuid, CoreSession * a_leg = NULL); Session(switch_core_session_t *session); ~Session(); - SWITCH_MOD_DECLARE(virtual void) destroy(void); + SWITCH_MOD_DECLARE(virtual void) destroy(const char *err = NULL); virtual bool begin_allow_threads(); virtual bool end_allow_threads(); diff --git a/src/mod/languages/mod_lua/mod_lua.cpp b/src/mod/languages/mod_lua/mod_lua.cpp index abeb847550..765bdfcc98 100644 --- a/src/mod/languages/mod_lua/mod_lua.cpp +++ b/src/mod/languages/mod_lua/mod_lua.cpp @@ -101,7 +101,9 @@ int docall(lua_State * L, int narg, int clear, int perror) if (!zstr(err)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err); } - lua_pop(L, 1); /* pop error message from the stack */ + //lua_pop(L, 1); /* pop error message from the stack */ + // pass error up to top + lua_error(L); } return status; @@ -369,6 +371,8 @@ static switch_status_t do_config(void) if (!strcmp(var, "startup-script")) { if (val) { lua_thread(val); + /* wait 10ms to avoid lua init issues */ + switch_yield(10000); } } } @@ -621,7 +625,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_lua_load) SWITCH_ADD_API(api_interface, "luarun", "run a script", luarun_api_function, "